The Build Loop — From Idea to Committed Code
/do: One Task, Fully Verified
The Pipeline Behind a Single Task
/do executes one task through a fixed spine. The Main Agent owns the task list, the plan and every judgment call:
- Gather context — read the acceptance criteria and the actual current content of every file involved
- Recall memory — search prior decisions, patterns and rejected approaches
- Write the plan to disk first (
docs/.output/plans/{stamp}-do-{slug}.md) and open a run record, so a dead session can resume - Write tests from the acceptance criteria, record the red run and freeze them
- Implement — directly for small work, delegated for large
- Gate — build and test through
gate.js - Verify every acceptance criterion against evidence, not the implementer's report, then review once and seal
- Regenerate the handoff and commit through
commit.js --ship-check(the handoff rides in the same commit), then append the outcome to the plan
Who Implements?
A persisted Complexity score routes it. At 5 or below the Main Agent implements directly — no lossy hand-off. At 6 or above it delegates to an agent with a rich prompt (variable names, code snippets, constraints). --delegate forces delegation.
The Same Proof as a Full Run
When the task is a story from a TODO, /do runs the software factory's proof path (Module 3) for that one story:
ac-verify.js redrecords that the tests fail now, for the right reason;ac-verify.js freezelocks the story's test files andverify:lines- after the gate,
ac-verify.js runre-runs every binding - one review at the end, and every finding fixed in that pass — there is no later review to defer to
ship-check.js seal, thencommit.js --ship-check --sc-kind task
Two variations: an ad-hoc /do (no TODO) has no bindings, so it skips the red run and the freeze and seals the gate evidence alone; a docs-only change has no code to gate, so it commits with the audited --sc-skip "docs-only change: no code to verify". A run budget is off by default; --budget turns one on.
Related Commands
/todowrites an execution-ready checklist with acceptance criteria,verify:bindings and a wave plan/run-todoexecutes a whole checklist in waves with gates, proof and a commit per wave/run-testsruns manual/E2E testing with parallel browser agents/primeloads context at session start;/endsaves the handoff
Tests come from the acceptance criteria, not from reading the implementation. A test written after the fact tends to confirm what was built instead of what was specified — which is why the red run is recorded before a line of implementation exists.
A story carries `Complexity: 4`. How does /do implement it by default?