phase-build
Skill2 starsChanged 53 days agoMITView on GitHub
Orchestrate a full CADENCE phase build end-to-end — worktree isolation, wave-based subagent dispatch from the approved DRAFT, an independent reviewer per task, main-thread re-verification of every completion claim, a whole-branch review, the single-commit settle, and a PR carrying its changeset. Use when a DRAFT is approved and the user says "build this phase", "execute the draft", "run the dispatch loop", or when resuming a partially built phase.
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- pr-landSkill
- release-cutSkill
- systematic-debuggingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Read the DRAFT: .cadence/phases/<phase>/<id>-DRAFT.md.
- Very specific: line 27
If this build is deliberately running parallel agents (this phase and another in flight at once), isolate to a worktree/branch from task 1 …
- Very specific: line 35
Plan waves: Run cadence dispatch plan --json.
- Distinctive: line 53
Whole-branch review: After all waves: one fresh subagent reviews the entire branch diff against the DRAFT's Objective + ACs.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Phase build (subagent-driven, verification-first)
The core rule this pipeline exists to enforce: a subagent's "done, all tests passing" is not evidence. Subagents in this repo have twice claimed all-green over real failures. Every completion claim gets re-verified in the main thread before it is recorded.
Preconditions
- Loop position is BUILD (or DRAFT with an approved draft — run
cadence progress). - Read the DRAFT:
.cadence/phases/<phase>/<id>-DRAFT.md. Note each task'sfiles:boundary,verify:command, anddone: AC-Nmapping. Respect## Boundaries(the Do-NOT list) absolutely.
Pipeline
- Isolate. Enter a git worktree for the phase (native worktree tool
preferred over manual
git worktree add; convention: branchfeat/<slug>, worktree under.claude/worktrees/<slug>). Before any commit in this pipeline, confirmgit rev-parse --show-toplevelpoints at the worktree — a subagent has committed to the primary checkout by mistake. If this build is deliberately running parallel agents (this phase and another in flight at once), isolate to a worktree/branch from task 1 — before any subagent touches a file — not reactively after afiles:conflict is noticed. Also confirm no other live session already holds this phase/draft (check for a runningcadenceprocess, an open terminal, or recentPROGRESS.jsonactivity viacadence doctor) before dispatching into it; if one might still be running, resume that session in place instead of starting a second one against the same draft. - Plan waves. Run
cadence dispatch plan --json. It computes dispatch waves fromdepends:edges andfiles:-overlap edges. Never parallelize two tasks whosefiles:overlap, even if the plan seems to allow it. - Per wave — implement. Dispatch one implementer subagent per task in
the wave (parallel Task-tool calls). Each prompt must contain: the task's
full DRAFT text, its
files:boundary ("touch nothing else"), TDD order (failing test referencing theAC-Ntoken inside an assertingit()/test()block, then implementation), the exactverify:command, and an instruction to report the commands it ran with their real output. - Per task — review. Dispatch a fresh, independent reviewer subagent per
completed task: adversarial, diff-scoped, checks boundary compliance, test
honesty (assertions, not
AC-Ncomment drops), and DRAFT conformance. Findings go back to a fix round, then re-review. - Per task — re-verify yourself. In the main thread: read the actual
diff, then run the full pipeline yourself —
pnpm turbo run lint typecheck test build(package-filtered while iterating; full before the wave closes). Only after this passes, recordcadence done <T>. Never record DONE from a report. - Whole-branch review. After all waves: one fresh subagent reviews the entire branch diff against the DRAFT's Objective + ACs. It must return "ready to merge" with zero Critical/Important findings. History says this pass catches real defects the per-task reviews miss (an ordering bug, doc prose describing a pre-fix algorithm, stale code comments) — do not skip it for "simple" phases.
- Settle, one commit. First write the phase's
### Phase N — <title>entry in.cadence/ROADMAP.mdand its- **Phase N** — <summary>bullet in.cadence/MILESTONES.md, in final form — no(in progress)marker (the PR number may be absent until merge). Roadmap prose is never auto-generated: a successful settle only prints a stderr notice naming a missing entry. In this reporoadmap-per-phase-entries.test.tsrequires both entries for every settled phase (one whose directory holds a-SUMMARY.json), so a missing entry turns the PR's CI red — and after a refused settle has written its SUMMARY, the retry'sbuild-test-must-passtoo. Then runcadence settle run --auto— if it refuses, the gate is right until proven otherwise; fix the cause, don't reach for--force/--allow-*. Once it passes, stage everything together — source, tests, docs, the ROADMAP/MILESTONES entries, the.changeset/*.mdfor this phase (feature PRs carry their own changeset, never deferred to the release PR), and the phase artifacts (-DRAFT.md,-PROGRESS.json,-SUMMARY.*, and-SUMMARY-snapshot.*if the phase produced any refused-attempt siblings — phase 247) — and make one commit (feat:/fix:, phase id in the subject).state.json/STATE.mdstay gitignored, never committed. If the phase closes a Praxis recommendation, promote it toshippedin this same commit. - Land. Exit the worktree, then invoke the
pr-landskill.
Known failure modes to actively watch
- Subagent misreports test results → step 5 is non-negotiable.
- Subagent escapes its
files:boundary → reviewer checks the diff file list against the DRAFT; boundary enforcement may also refuse at edit time. - Two phases in parallel worktrees touching the same schema/parser files
(
packages/types/src/plan.ts,packages/core/src/parse/draft-parser.tsare repeat offenders) → expect a manual conflict resolution on the second merge; re-run the full suite after resolving. - Docs written before a mid-build design change still describe the old design → the whole-branch review explicitly re-reads doc diffs last.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

