/build
The orchestrator. Spawns a fresh sub-agent for each phase, enforces strict TDD, runs post-phase review, and manages the entire build lifecycle.
When to use
Section titled “When to use”- You have an approved plan from
/plan - Run as:
/build specs/[feature-name]-plan.md
What it does
Section titled “What it does”Pre-flight
Section titled “Pre-flight”Detects all ecosystems, verifies existing tools work, audits for missing tools with per-language checklists. Pushes hard for installation.
Worktree isolation
Section titled “Worktree isolation”Creates an isolated git worktree for the build. Main working tree stays clean. Failed builds = delete the worktree. No stash dance.
Seed test stubs
Section titled “Seed test stubs”Before Phase 1, generates skeleton test files from the spec’s requirements, error cases, concurrency concerns, and boundary values. Each test is a t.Skip("TODO") — a map of what to test before any code is written.
Per phase (1-9 steps)
Section titled “Per phase (1-9 steps)”- Announce with visual progress bar
- Spawn sub-agent with clean context (RALPH pattern)
- Review work — TDD followed? Scope respected? Error pattern forwarding for re-spawns.
- Automated verification — independent of sub-agent’s self-report
- Visual verification — screenshots via KaBOOM MCP for UI phases
- Code review — spec compliance, correctness, architecture
- Update progress file
- Commit with sequential IDs
- Auto-proceed if no manual verification needed
After all phases
Section titled “After all phases”- Integration sweep — verify pieces connect correctly
- Red team — adversarial agent breaks correctness, concurrency, boundaries, tests, security, and UI (with browser automation for visual attacks)
- Learning capture — appends to
specs/LEARNINGS.md - Compound — promotes durable patterns from LEARNINGS.md to CLAUDE.md as agent instructions
- Merge back — merge worktree branch, clean up
Human-writes mode (/build --human)
Section titled “Human-writes mode (/build --human)”AI writes the tests. You write the implementation. Full reporting: attempts to green, tests that caught bugs, time from stubs to green. Commits tagged [human-writes].
Crash recovery
Section titled “Crash recovery”Detects existing worktrees, uncommitted changes (keep/stash/discard), reconciles progress with git history, resumes from the right phase.
Key features
Section titled “Key features”- Stuck loop detection — 3-retry hard limit on any repeated operation
- Decimal phase insertion — insert Phase 2.5 for unexpected prerequisite work
- Constitutional enforcement — reads
specs/CONSTITUTION.mdas a hard constraint - Dev server — starts automatically for UI features, used for visual verification
Output
Section titled “Output”Committed phases on a feature branch, merged to base on success. Progress file, learnings, compounded patterns.
Next step
Section titled “Next step”/ship to create a PR.