Install
openclaw skills install @englandtong/agent-loop-engineeringRuns bounded AI coding loops with persistent state, evidence gates, safe stops, and resumable handoffs.
openclaw skills install @englandtong/agent-loop-engineeringVersion: 2.0.0
Use this skill as the execution plane for AI coding work. Take one authorized outcome, make bounded changes, verify actual behavior, record concise evidence, and continue until the work is ready for review or a real stop gate is reached.
Respond in the user's language. Keep persistent project state factual and concise.
{baseDir}/references/en/.{baseDir}/SKILL.zh-CN.md,并只加载 {baseDir}/references/zh-CN/ 中需要的参考文件。Start execution only when these are clear:
Prefer Docs/ACTIVE_PACKET.md using contract version 2.0. Read {baseDir}/references/en/execution-loop.md.
If the user only has an idea, direction, or pain point, do not guess a full implementation target. Use cms-project-governance Goal Discovery when available. Otherwise ask at most three material questions, propose defaults for reversible unknowns, and wait until the entry gate is satisfied.
In a governed project:
Do not expand scope from chat, logs, status notes, or a convenient implementation idea. Do not mark governed work accepted. Set execution_state: Ready for Review and hand evidence to QA.
In standalone Lite work, the same agent may self-accept only when the packet sets qa_required: false, the change is low risk and reversible, both automatic and functional evidence pass, and no Owner boundary is involved.
Preferred v2 state:
Docs/ACTIVE_PACKET.mdDocs/LOOP_RUNS.jsonlUse {baseDir}/templates/en/ACTIVE_PACKET.md and {baseDir}/templates/en/LOOP_RUNS.example.jsonl when bootstrapping a clear standalone task.
Legacy TARGET.md, ACCEPTANCE.md, WORK_ORDER.md, LOOP_STATE.md, STATUS.md, NEXT_ACTIONS.md, PENDING.md, EVALUATION.md, and LOOP_RUNS.jsonl may be read without forced migration. Read {baseDir}/references/en/migration.md.
If state files disagree, set execution_state: Invalid State and stop. Authority order:
Owner-approved TARGET / Non-Goals
-> ACCEPTANCE
-> active WORK_ORDER
-> ACTIVE_PACKET
-> logs, status, next actions, and chat
An authorized goal has at most ten stages:
| Size | Stage ceiling | Review horizon |
|---|---|---|
| Small | 30 minutes | 5 hours |
| Medium | 60 minutes | 10 hours |
| Large | 120 minutes | 20 hours |
A stage is a timeboxed outcome checkpoint. A loop is one implement-verify-evaluate cycle inside the stage. Do not create a document for each stage or loop.
Formal alignment checkpoints occur after stages 3, 6, and 10. The execution agent provides evidence and a target-link statement; Controller or Owner decides material direction changes.
At stage 10, stop and return one of:
Ready for ReviewNeeds Fix with bounded repairBlockedLocally Compliant, Globally MisalignedNever silently begin another ten stages.
Read current packet
-> confirm stage outcome and one next action
-> inspect only relevant code and evidence
-> implement the smallest coherent change
-> run focused automatic verification
-> run functional or user-flow verification
-> review diff and risks
-> update state and append one loop record
-> continue, review, repair, or stop
Read {baseDir}/references/en/execution-loop.md for progress and failure rules.
Default loop rules:
No evidence means no completion.
Required evidence classes:
When automatic and functional evidence conflict, keep work open. A green build does not overrule a broken user flow.
Read {baseDir}/references/en/evidence-and-completion.md before reporting Ready for Review, standalone completion, or completion with risk.
At loop end:
execution_state.Docs/LOOP_RUNS.jsonl.Do not copy the same status into multiple files. Do not paste large logs, full chat transcripts, secrets, private data, or hidden reasoning into project state.
Stop and report Blocked before:
Project rules may be stricter. A configuration flag cannot override a hard stop. Read {baseDir}/references/en/safety-and-context.md.
An outer runner may repeatedly start one loop, but it must:
Do not let multiple agents write the same packet or log concurrently. Read {baseDir}/references/en/automation-and-handoff.md.
When Node.js is available, validate state without modifying the project:
node {baseDir}/scripts/validate-loop-state.mjs --workspace <project-path>
Use --json for machine-readable output. Validator success proves state consistency, not product correctness.
After each user-visible work period, report:
Execution state:
Stage:
Target link:
Work completed:
Automatic verification:
Functional verification:
Risks or blockers:
Files changed:
Next action:
Governance/QA action needed:
Do not claim the project is accepted unless the current authority permits that decision.