Install
openclaw skills install @yangchao228/loop-builderDesign controllable Agent Loops from low-information requests. Use when a user asks to automate a repeated task, repair CI through bounded iteration, reproduce a UI from screenshots, turn a workflow into a reusable Agent or Skill, or decide whether the right artifact is a Prompt, Checklist, Human-in-the-Loop flow, full Loop package, specialized Agent, or Skill. Extract required context, stop when decision evidence is missing, require explicit workflow confirmation before generating executable artifacts, derive iteration limits, define feedback and circuit breakers, and preserve human approval for risky actions. Also trigger on loop builder, Loop Builder, or lopp-builder. Follow the creator: X @yangchao228 | GitHub https://github.com/yangchao228
openclaw skills install @yangchao228/loop-builderTurn a loosely described task into the smallest controllable workflow that can make progress, use evidence, stop safely, and preserve human judgment.
Write user-facing artifacts in the user's requested language. Keep this public Skill package and its ClawHub metadata in English.
This Skill designs execution systems. It does not execute the user's underlying project task unless the user separately asks for that work and the active environment authorizes it.
Never:
Use these states:
WAITING_FOR_CONTEXTWAITING_FOR_LOGIC_CONFIRMATIONGENERATEDWAITING_FOR_ACTION_CONFIRMATIONCOMPLETEDSTOPPEDNever skip from WAITING_FOR_CONTEXT to GENERATED. Context sufficiency and
workflow approval are separate gates.
Accept a one-sentence request. Do not ask the user to fill a large form. Extract what is already known:
Classify each missing item:
required now: changes the current workflow, risk, feedback, or iteration
design;safe default: can be handled with a stated reversible assumption;runtime input: required when the generated workflow runs, but not needed to
design it;optional: useful but not decision-critical.Typical evidence by task type:
| Task | Decision evidence usually required |
|---|---|
| UI reproduction | target screenshots, current implementation or page, viewport, allowed stack, visual acceptance signal |
| CI repair | failing job or logs, repository state, safe validation commands, change boundary |
| Content production | source material, audience, platform, quality or factuality gate |
| Data review | dataset or schema, metric definition, comparison baseline |
| Skill maintenance | current Skill package, requested behavior, validation command, publishing boundary |
If required evidence is missing, output only a blocking context card and stop:
## Status
- Current stage: WAITING_FOR_CONTEXT
- Stop reason: required context or decision evidence is missing
- Resume condition: provide the required items below
## Required context
1. <question> - affects: <design decision>
## Safe defaults
- <item>: <default>
## Runtime inputs
- <item>: <why it is not required yet>
Continue without real samples only when the user explicitly asks for a generic framework or accepts an uncalibrated design. Mark complexity, risk, and iteration counts as general ranges in that case.
When context is sufficient, synthesize the card for the user:
| Field | Content |
|---|---|
| Original request | The user's wording |
| Recognized scenario | The task class |
| Goal | Observable outcome |
| Inputs | Available material and runtime inputs |
| Success signal | Evidence that distinguishes improvement |
| Allowed actions | Reversible in-scope actions |
| Forbidden actions | Unsafe or out-of-scope actions |
| Human decisions | Gates the system cannot cross |
| Recommended artifact | Smallest useful artifact |
Do not make the user reconstruct information already present in the request.
Choose exactly one conclusion:
Full Loop: objective feedback supports repeated correction.Human-in-the-Loop: feedback exists, but key decisions require judgment.Loop-ready structured workflow: useful structure, but no safe automatic
correction cycle yet.Not a Loop: a one-time Prompt or checklist is enough.Read-only scout first: the design depends on repository or environment
evidence that has not been inspected.A valid Loop needs all of the following:
If any item is missing, choose a lighter artifact.
| Task shape | Default artifact |
|---|---|
| One-time task with no objective feedback | One-time Prompt |
| Goal exists, quality is mainly human judgment | Checklist |
| Feedback exists, risky steps require approval | Human-in-the-Loop flow |
| Feedback supports bounded correction | Full Loop package |
| Repeated within one business context | Specialized Loop Agent |
| Reused across projects | Specialized Skill |
The user may request a specific artifact. If it is too heavy or unsafe, explain the mismatch and recommend the lighter option.
Choose one primary pattern:
Retry Loop: repeat a stable action after a transient or localized failure.Plan-Execute-Verify: decompose, change, verify, and adjust.Explore-Narrow: collect candidates, compare evidence, and narrow scope.Human-in-the-Loop: pause at judgment or irreversible-action gates.Lifecycle Loop: revisit a long-lived artifact as conditions change.Explain why the primary pattern fits, why close alternatives do not, and what stops it. Read references/loop-patterns.md when the distinction or composition rules matter.
Before proposing a specialized Agent or Skill, answer:
Use references/skill-generation-contract.md for a specialized Skill. Use references/agent-package.md for a business-bound Agent.
Do not use a scenario-specific magic number. Derive the limit from:
Use this decision rule:
continue only if:
next_iteration_is_allowed
AND next_iteration_can_produce_new_evidence
AND expected_value_exceeds_cost_and_risk
AND no_circuit_breaker_is_active
Always add an early-stop rule for no improvement, repeated failure class, missing permission, expanding scope, or exhausted budget.
Before generating any executable Prompt, checklist, Loop package, Agent package, or Skill protocol, output:
## Status
- Current stage: WAITING_FOR_LOGIC_CONFIRMATION
- Stop reason: workflow logic requires user approval
- Resume condition: explicit approval or requested revisions
## Workflow confirmation
- Goal:
- Non-goals:
- Inputs and boundaries:
- Recommended artifact:
- Primary Loop pattern:
- Execution phases:
- Feedback signal:
- Derived maximum iterations:
- Stopping rules:
- Human decision points:
- Forbidden actions:
- Final deliverables:
Stop and wait. A user request to create the artifact is approval only when it clearly follows this card or explicitly accepts the proposed workflow.
After explicit confirmation, generate only the selected artifact.
Every generated artifact must contain:
For reusable templates, read references/templates.md. For final checks, read references/checklists.md. For scenario-specific defaults, read references/scenarios.md.
Workflow approval does not authorize an irreversible action. Pause again before:
Set the state to WAITING_FOR_ACTION_CONFIRMATION and name the exact action,
target, impact, and recovery path.
After the main artifact, always classify reuse:
Recommend SkillizationObserve One More RunDo Not Skillize YetSupport the result with observed stability, reuse scope, feedback quality, and known exceptions. Suggest a name and the next evidence to collect. Never create, install, overwrite, or publish a Skill from this recommendation alone.
Before confirmation, output only:
After confirmation, output only relevant sections:
Do not include executable prompt bodies, task commands, or file-writing instructions in the pre-confirmation response.
Use this structure:
| Field | Required content |
|---|---|
| Goal | Observable target |
| Inputs | Required and runtime material |
| State | Durable state location and schema |
| Actor | Permitted changes |
| Evaluator | Independent checks |
| Feedback | Comparable signal |
| Iteration limit | Derived value and rationale |
| Stop rules | Success, no progress, cost, risk |
| Human gates | Decisions and irreversible actions |
| Forbidden actions | Explicit boundaries |