Build
Role: orchestrator. This command implements an approved plan — it does not create plans or specs.
You have been invoked with the /build command.
Orchestrator constraints
MUST — confirm agent-dispatch capability before any review-agent dispatch (issue #1461). This skill dispatches review agents at four points: Step 3 (spec-compliance-review acceptance-criteria gate), sub-step 4 (per-step review checkpoint for complex steps), sub-step 6 (slice review checkpoint), and Step 7.6 (acceptance-examiner dispatch). Before any of those dispatches, you MUST confirm the Agent (or Task) tool is actually present and available in your current toolset. If it is not: STOP at that point — do not self-apply the reviewer's checklist inline as a substitute for independent dispatch, and do not mark the gate/checkpoint passed on that basis. Report to the user/operator plainly: this review checkpoint cannot run in this environment because no agent-dispatch capability (Agent/Task tool) is available; name exactly what's missing; and state that the build cannot proceed past this gate (nor reach the Step 6 /code-review backstop, which independently enforces the same rule) until it is run from a session with that capability. This is a hard requirement, not a preference.
- Follow the plan exactly. If the plan is wrong, stop and ask the user — do not deviate silently.
- Every step is small per-behavior batches, one agent. The cadence is Code-First Small Batches — each behavior follows IMPLEMENT → TEST → REFACTOR (the statistically separated winner of the workflow experiments;
docs/experiments/RECOMMENDATIONS.mdRec 3). There is no cadence to resolve and no per-plan opt-in (ADR 0017) — Code-First Small Batches is the only cycle a step follows. One agent writes the code, the test, and the refactor for a unit of work; the refactor runs on every green — never deferred to an end-of-build pass, never skipped, never made conditional on task size or complexity (Rec 4); tests are frozen during REFACTOR; and big-batch shapes are prohibited — never all the code then all the tests, never all the tests then all the code. - Incremental. Each step must leave the codebase in a working, committable state.
- Verification evidence required. Paste fresh test output before claiming a step is done.
- Review checkpoints (granularity scales with complexity). Run inline review (static self-heal pass first, then spec-compliance, then quality agents) per step for
complexsteps; batchstandard/trivialsteps into one review at the slice boundary. When~/.claude/telemetry.jsonconsent is enabled (andDEV_TEAM_REVIEW_VALUEis notoff), record each checkpoint's find/fix/no-op outcome to.claude/metrics/review-value.jsonl. The final/code-reviewis the backstop. - Be concise. Report step status and verification evidence, no narration.
- Diagnose before retry. When any bash command run during the build fails (a script, a test run, a build-tooling invocation), read the exit code and error text and state a one-line cause hypothesis before correcting and re-issuing it. Never re-run a failed command unmodified. If the shallow diagnosis reveals a real defect rather than a shell-level mistake (bad path, typo, missing arg), escalate to Systematic Debugging per the Escalation section below.
Parse Arguments
Arguments: $ARGUMENTS
--plan <path>: Path to the plan file. If omitted, searchplans/for the most recently modified plan with statusapproved.--yes: Auto-approve the build's approval gates (steps 2 and 3) without prompting (non-interactive opt-in).--backstop-review=skip: Suppress only Step 6's backstop/code-review(#1962). Legal only when the caller has its own review pass over a diff that strictly contains this build's — an enclosing orchestrator's end-of-phase review loop, not a human running/builddirectly. Default off: an unflagged/buildruns Step 6 exactly as before. Everything else is untouched — the inline checkpoints (sub-steps 4/6), the full-suite run (Step 5), runtime verification (4.9), invariants (4.10), and the Farley Score (Step 7) all still run, so this narrows one duplicated layer rather than trading review for speed. When set, print an audit line into the build output naming the enclosing reviewer:Step-6 backstop review skipped (--backstop-review=skip) — enclosing reviewer: <name>.Never set it on a/buildwhose diff nothing else reviews.--candidates N: experimental. Applies only to steps whose**Complexity**iscomplex; N is between 1 and 8, and 1 is the unchanged build. The--max-cost-usdcap bounds candidate dispatch spend, not screening, and the skill checks it between batches, so one batch may overrun it. The cap bounds one step; a wave of W speculative steps may spend up to W times the cap, where W is their count. With N ≥ 2,--jobsgreater than 1 is rejected (exit 2); setDEV_TEAM_MAX_PARALLEL_BUILDSfor wave fan-out. The procedure is in