Loop Builder for Openclaw

A structured skill for building resilient, self-running agent loops with automated triggers, persistent state memory, objective safety gates, and supervised rollout levels.

hansraj316
v0.2.0
Jun 16, 2026
1
429
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install loop-creator

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install loop-creator using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Loop Builder?

The Loop Builder skill is a comprehensive framework designed to convert recurring, manual development and triage chores into robust, self-running agent loops. Unlike standard prompts that deliver one-off responses, this skill constructs a complete system comprising six crucial components: an automation trigger, local memory state files, procedural instruction manuals, isolated git worktrees, specialized sub-agents, and objective hard-stop conditions. It is ideal for developers leveraging Openclaw Skills to automate continuous integration (CI) triage, pull request reviews, automated linting, documentation updates, and periodic dependency management.

By organizing agent execution around a persistent state file and an objective verification gate (such as test suites or exit codes), Loop Builder prevents common agent failures like infinite execution loops or premature "done" assertions. It introduces a structured autonomy ladder, ensuring that loops start safely at low-risk suggestion phases before earning higher clearance levels based on proven, supervised performance.

Loop Builder Use Cases

  • Automating continuous integration (CI) triage and pull request validation loops.
  • Generating and updating daily development reports, change logs, or engineering digests.
  • Executing recursive refactoring, linting, or dependency upgrades until all test suites pass.
  • Periodically monitoring remote endpoints, logs, or databases for exceptions and generating structured incident drafts.
  • Creating isolated writer-checker multi-agent flows where one agent generates code or content and another objectively grades it.

How Loop Builder Works

  1. Gather Requirements: Clarify the automation trigger (schedule, hook, or session-based), establish an objective hard-stop gate (such as terminal test commands), and set the initial autonomy level.
  2. Design Split-Agent Roles: For complex tasks, split the loop into a Writer loop (creates outputs) and a Checker loop (evaluates outputs against the gate) to prevent self-grading errors.
  3. Build Core Artifacts: Create the procedural markdown manual, initialize the persistent state file, and configure the restricted command allowlist.
  4. Run Proof Iterations: Manually run 1 to 5 iterations to confirm the hard-stop gate behaves correctly and calculate the worst-case token consumption and operational costs.
  5. Schedule and Deploy: Configure the loop's deployment trigger (e.g., cron routines or repository event hooks) to run unattended.
  6. Supervised Harden & Graduate: Run the loop under strict observation at a low autonomy level, graduating it to automated writing or merging only after sustained error-free cycles.

Loop Builder Setup

To use this loop builder within your workspace, set up the procedural file structure:

# 1. Create the skill directory
mkdir -p .claude/skills/loop-builder

# 2. Initialize the state directory if needed
mkdir -p reports

Create the .claude/skills/loop-builder/SKILL.md file containing your loop's concrete procedures. Next, define your restricted execution permissions by updating .claude/settings.json. Since automatic security blocks might prevent automated agents from self-modifying security permissions, copy and paste this command allowlist configuration manually:

{
  "permissions": {
    "allow": [
      "npm run test",
      "git fetch",
      "git checkout",
      "gh pr status"
    ],
    "deny": [
      "gh pr merge",
      "git push --force",
      "rm -rf"
    ]
  }
}

Finally, initialize your state tracker file at reports/loop-state.md with a clean markdown table to log iterations.

Loop Builder Data Schema & Taxonomy

The Loop Builder relies on clean, predictable, and highly restricted file structures to ensure data persists cleanly across stateless cloud execution instances.

File Taxonomy

File Path Description Access Mode
.claude/skills/<loop-name>/SKILL.md The core procedural manual detailing the agent's role, commands, and hard-stop gates. Read-Only during execution
reports/<loop-name>-STATE.md The persistent memory state file. Must be written to last and read first. Read/Write (committed per run)
.claude/settings.json Local security and permissions allowlist/denylist configuration. User-configured, Read-Only for AI

State File Schema (reports/<loop-name>-STATE.md)

The state file acts as the only memory block across runs. Keep it small, concise, and structured as follows:

  • Metadata Section: Loop name, trigger frequency, and current autonomy level.
  • Target Items: Active PRs, files, or tickets being processed.
  • Execution Log: A history of recent runs, duration, token usage, and verdict outcomes (PASS, FAIL, or MAX_ITERATIONS).

Loop Builder Advanced Features

  • Autonomous Multi-Agent Handshake: Divide workloads among isolated sub-agents executing in separate git worktree environments to prevent write conflicts during concurrent tasks.
  • Rigid Command Allowlisting: Native defense mechanisms preventing catastrophic failure modes by defining explicit allow/deny boundaries for shell tools.
  • Event-Driven Hook Triggers: Integration with local session hooks inside .claude/settings.json that fire automatically on repository shifts or commit events.
  • State-Tracking Rollback Safeguards: Designed for Openclaw Skills to run inside ephemeral cloud sandboxes by committing state files back to git, ensuring run-to-run persistence.
  • Autonomy Ladder Graduation: Structured pathways to safely promote agents from basic suggestions up to automated pull request merges.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*