/do-it:loop-runnerfrom do-it
Configures and explains Do-it's autonomous loop drivers — /do-it:loop (Claude Code's native loop with deterministic guard) and /do-it:ralph (legacy in-session stop hook). Covers preflight, settings resolution, and stop report.
Ships in do-it. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
An interactive command steers. An autonomous loop lets you walk away.
Write everything this skill produces in the house voice: ${CLAUDE_PLUGIN_ROOT}/references/voice.md.
/do-it:loop (recommended) | /do-it:ralph (legacy) | |
|---|---|---|
| Driver | Claude Code's native loop | bundled Stop hook (hooks/stop-hook.sh) |
| State | .do-it/loop-state (owned by scripts/loop-guard.sh) | .claude/do-it-ralph.local.md |
| Stop condition | the guard exit code — 0 working, 10 complete, 20 stop. The guard reads the disk. | a literal-token grep of the transcript for the COMPLETE or PAUSE promise tag |
| Ceiling and breaker | in the guard | in the hook |
| Re-fed each iteration | a 30-line prompt | the iteration contract (scripts/PROMPT.md) |
| Needs | the native loop skill | nothing more than the plugin |
Both drive the same build-loop and review-work discipline. Both write the same progress.md, the same memo,
and the same loop.log. Both light the same status line. Optional wiki work and retrospective work follow the
effective knowledge_maintenance. /do-it:status, scripts/loop-metrics.sh, and a manual /do-it:retrospect
read either driver the same way.
Prefer /do-it:loop. A stop condition must be a deterministic check, not a model's sense of doneness. The
smaller re-fed prompt also costs much less each iteration. Fall back to /do-it:ralph when the native loop is
absent. Never run both at once — two drivers, two stop rules, one project.
Both fan out. Each iteration dispatches a band of build subagents in one message
(${CLAUDE_PLUGIN_ROOT}/references/parallel-loop.md).
/do-it:loop uses Steps 1 and 2 only, and then hands off to the native loop. Steps 3 to 5 belong to the Ralph
driver. The Stop report below belongs to both.
A loop that stops without a reason is a loop the user cannot clear. Print one of these two blocks before any other text, every time the loop ends.
Use it on guard exit 10 and on guard exit 20.
The guard returns exit {exit_code} ({state}).
reason={the guard's reason= line, exactly}
next={the guard's next= line, exactly}
Use it when the guard did not decide. Four cases reach it:
checkpoint: slot that is not NONEreview_mode: manual at a green gateThe loop stopped. The guard did not stop it. The loop thread did.
reason={one sentence that names the cause}
next={the command that clears it}
### Decision needed block or the ### Needs grill block to
.do-it/progress.md before you print. The guard then agrees on the next run, and the loop stays stopped
until a human appends ### Resolved — ….stop_class the guard printed. Never guess either one.The guard prints exit_code= and stop_class= beside reason= and next=, so the block needs no arithmetic
and no memory. Read the four lines and print them.
stop_class values: blocked · rejected · empty · ceiling · stalled · none
Refuse to start, and name exactly what is missing, unless all of these are true:
.do-it/specs/_meta.json exists and parses, with the required identity. meta-config.sh validate exit 0
(current) or exit 6 (valid legacy drift) may run. Any other exit goes to /do-it:config.F0-foundation.branch_name exists as a git branch, or the user approved a new one.### Decision needed block and no ### Needs grill block is open in progress.md.Max iterations: $1, then _meta.json.max_iterations_default, then 20. Refuse a value over 100. A 0 means
no ceiling. Warn that the breaker and the blocked states then become the only automatic stops.
Ask once with AskUserQuestion for any absent key, and write the answer to _meta.json. Use a key that is
already present without a word: review_mode, safety_stops, ui_verify, subagent_concurrency (the band
width, default 4; above 1 it needs use_worktrees: true).
Read ${CLAUDE_PLUGIN_ROOT}/skills/loop-runner/scripts/PROMPT.md and substitute from _meta.json and the repo:
{PROJECT_NAME} · {PROJECT_TYPE} · {BRANCH_NAME} · {CWD} (the absolute project root) · {PLUGIN_ROOT}
(the literal absolute path of this plugin).
{PLUGIN_ROOT} matters most. A later iteration re-feeds the contract body as plain text, where
${CLAUDE_PLUGIN_ROOT} does not resolve. Every skill pointer, brief pointer, and script pointer in the contract
depends on that substitution.
.claude/do-it-ralph.local.md. Create .claude/ when it is absent.
---
active: true
iteration: 1
max_iterations: <resolved>
completion_promise: "COMPLETE"
pause_promise: "PAUSE"
no_progress_limit: <_meta.json.no_progress_limit, default 3>
last_state_hash: ""
stall_count: 0
started_at: "<UTC ISO-8601>"
project: "<PROJECT_NAME>"
branch: "<BRANCH_NAME or empty>"
---
<the substituted contract>
This file is the only thing the hook reads. Keep the frontmatter keys exactly as they are here.
stop-hook.sh greps iteration:, max_iterations:, completion_promise:, and pause_promise:, and it owns
the breaker fields.
To resume a disarmed loop: a fail-safe pause writes paused: true to the file. The hook stays quiet while
that key stays there. On /do-it:ralph with an existing state file, treat the run as a resume. Clear paused.
Keep iteration at its current value. Set stall_count: 0. Say that you resume at iteration N.
Never print a literal promise tag in user-facing text. Not here, not in a status line, and not when you explain the loop. The hook scans your last messages for that exact string. A tag you print as an example looks the same as a real stop signal. It ends the loop on iteration 1. Name a token in prose instead. Write "the COMPLETE token".
Ralph loop active — iteration 1 of {MAX_ITERATIONS}, band width {N}.
It runs in THIS session. After each turn the Stop hook feeds the same contract
back and I work the next band. I stop automatically when:
• every spec is satisfied → the COMPLETE token
• something needs you → the PAUSE token (a failed gate, a REJECT, a
safety checkpoint, or review_mode: manual at a UI gate)
• the iteration ceiling is hit → {MAX_ITERATIONS}
Every stop prints the reason and the next command. You never get a silent stop.
You see the shell run after the first iteration; F0 builds the shared component
foundation before F1. Every UI task adds a screenshot. Every task gets a failing
test first, then typecheck, lint, tests, and a credential scan. Product review
runs once per feature; knowledge maintenance follows the project config.
Cancel with /do-it:cancel-ralph. Watch .do-it/loop-memo.md (now),
.do-it/progress.md (history), .do-it/preview/ (screenshots). A no-progress
breaker stops the loop after {no_progress_limit} unchanged iterations.
Then start iteration 1 at once. The hook takes over when the turn ends.
On every Stop event hooks/stop-hook.sh does this. It exits quietly when the state file is absent. It stops at
the ceiling. It runs the no-progress breaker (a repo-content hash, stall_count, no_progress_limit). It scans
the assistant messages after the last real user prompt for the newest promise token. On COMPLETE or on PAUSE it
removes the state file and exits. If none of that applies, it bumps the iteration, appends a loop.log line,
and re-feeds the contract. A transcript failure or a parse failure goes to a fail-safe pause that keeps the
state file. Each path prints a stop report. The script is the specification — read it there, not here.
build-loop and review-work emit the COMPLETE token under three conditions only. Do-it archived the required
F0 foundation. The code implements every spec requirement. No change is open. PAUSE means a human is genuinely
needed. The hook computes neither one. It matches the literal tag.
The prompt is the program. Treat a change to scripts/PROMPT.md as a code change. Diff it, review it, and
test it on a low-iteration run first.
doit.sh, claude --print, a while wrapper) when the native loop is
absent. Use /do-it:ralph./do-it:loop and /do-it:ralph on one project at once..do-it/loop-state or of the Ralph state file frontmatter.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/build-loopExecute Do-it tasks. Reads .do-it/specs/ (current truth) and .do-it/changes/ (proposals), picks the next buildable band, builds under TDD discipline (software) or acceptance-driven (generic), respects the UI-first layer gate, and keeps the loop memo current. Product review runs per feature; optional knowledge maintenance never blocks code-first delivery. Triggered by /do-it:build or an autonomous loop each iteration.
/designEmit the compact design state the build loop consumes: tokens, the F0 foundation manifest, and per-entity contracts. Narrative design docs defer to --full.
/do-itRun the Do-it spec-driven MVP workflow in Codex. Use for PRD, brownfield mapping, config migration, grilling, design, preview, building, review, iteration, project status, retrospectives, or autonomous delivery./grillAdversarially challenge a spec-layer artifact — PRD, change proposal, or design system — before code exists. Hunts gaps, contradictions, ambiguity, scope creep. Triggered by /do-it:grill or "challenge the PRD", "poke holes".
/iterate-fixApply fixes after a REVISE verdict, or after a task's mechanical gate goes red. Root-cause discipline only — no symptom fixes, no test-softening. Triggered by /iterate, or by the Ralph loop on a red gate or a REVISE.
/llm-wikiMaintain docs/ as an optional LLM Wiki. Direct Pass/Query always work; automatic passes run only when project knowledge maintenance enables them.
npx claudepluginhub flyingwebie/skills --plugin do-itOther plugins' skills for the same job