Playbooks · 5 loops

Loops that finish
the job.

Five copy-paste agent loops with clear stop rules.

§ 01

The playbooks

5 loopscopy · paste · run · stop

No installs, no backend — just prompts you hand to the agent you already use, plus guardrails that keep each cycle honest.

Build Until Green

Run the build, fix the first error, repeat until the build is green.

Fix loop6 steps · 10–30 min
Run npm run build (or your build command) once with no code changes. Save the complete log to build-baseline.log. Report the error count and the first error verbatim, then stop. Do not fix anything yet.

Coverage Until Threshold

Add small, focused tests until the coverage target is met — then stop.

Test loop6 steps · 20–45 min
Set the coverage target and scope in one message. Example: "Target: 80% lines and 70% branches on src/checkout/**. Measure with npm run coverage -- --scope=src/checkout. Report the current numbers and the 3 least-covered files, then stop. Do not write tests yet."

A11y Audit Until Clean

Run automated accessibility checks on changed routes, fix, and repeat until clean.

Quality loop6 steps · 15–40 min
List the changed routes (URLs or story paths) and the checker plus ruleset to use. Example: "Audit /signup and /checkout with axe-core, WCAG 2.2 AA. Report the violation count per route with no fixes yet, then stop."

CI Failure Watcher

Poll CI, read the red checks first, push small fixes until the pipeline is green.

Ops loop6 steps · 15–60 min
Fetch the latest pipeline result for the branch. List each failed job with its name, failed step, and the last 20 lines of its log. Do not fix anything yet — stop after the list.

Plan Then Execute

Write a short structured plan first, then execute it step by step with checkpoints.

Strategy loop7 steps · 30 min–2 hr
Write the goal as one verifiable sentence plus 3 acceptance checks. Example: "Done means X. Accept when: (1) ... (2) ... (3) ..." Ask two clarifying questions at most, then stop for approval. Do not plan yet.
§ 02

How to run one

same shape every time

Every loop follows the same contract: one prompt per turn, quoted evidence back, stop at the exit criteria. Open a loop, copy the first prompt box into your agent, paste the result where asked, and move to the next step only when the “why” line is satisfied. If a step fails twice, use the failure-mode guardrail instead of pushing through — that is what the guardrails are for.