Run an autonomous loop
The unattended, verified, until-contract-met recipe. Unlike ship-a-feature (attended, one
bounded feature with a human at each gate), this runs a task as a self-checking loop with an
explicit stop contract, a maker-checker gate, and a durable state file so a fresh context
resumes. Only run this when the work passes the loop-preflight 4-condition test.
-
Frame — write the acceptance contract (end state / evidence / constraints / budget) per
agentic-loop. Classify the task withrunning-a-dev-cycleand route it to the right phases. -
Plan —
planning-a-changefor anything non-trivial; escalate tocreate-plan/review-plan(/plan→/review-plan) when trade-offs are real. The plan is the spec the checker verifies against. -
Loop each unit —
agentic-loop: perceive → act (smallest safe change) → observe (run the gate) → verify against the contract → record in the state file → next unit. Respect the budget. -
Fix defects at the root —
root-cause-fixfor any real defect: prove the cause, fix the class, lock it with a regression test that fails-before/passes-after. 4b. Session surfaces — if the loop shipped a user-visible surface, runverifying-session-surfaces(/verify-surfaces) before review-build. Live evidence, then step 4 on anything BROKEN. -
Review the build —
review-build(/review-build) before declaring the contract met: ground-truth diff, requirement/plan trace, shortcut sweep, pasted gate output. -
Maker ≠ checker — before calling the stop condition met, dispatch the
revieweragent on the diff + the contract. Reconcile real findings; aDO NOT MERGE/MERGE AFTER FIXESverdict loops back to step 3. -
Ship the work —
reviewing-and-shippingonce the verdict is SAFE and thegateis green. Edits stay unstaged; do not commit/push/PR unless the user asked (commit-and-pr-conventions).
Stop and escalate if the budget ceiling is hit while still red, verification can’t be defined,
or the fix needs a decision the user owns. Never widen a tolerance or delete an assertion to
force the stop condition. Guard against the self-declared-done trap: the reviewer verdict + the
gate — not the loop’s own judgment — decide “done” (see docs/agentic-patterns.md).


