build
Use when a session opens on a plan file to run, after a clear, or the user says to run or resume a plan, or a decided change this session touches over two files, a dependency, a public signature, a pe
Files1
View on GitHubSKILL.mdskills/build/SKILL.md
GitHubBuild
Build lands a plan one task at a time. A task lands when its proof passes after the change and the plan's Land gate passes; land-task.mjs checks both and commits. It runs the proof on the code before the change too and refuses the task when it passes there. A task that changes structure but not behaviour proves itself by the same command giving the same output at the base and at the head; a type check or lint alone shows nothing about behaviour.
The loop
A plan path runs this loop. With no path and no decided change, run step 2's script with --plan on each file in docs/specs/; when exactly one prints a Next: task, use that plan and say so, and ask for the path when several or none do. --land pushes at the end without asking.
- Settle the workspace. A branch or worktree the request names is the answer; otherwise build on the current branch; on
main, create a branch named after the plan topic and say so, without asking. Invoking build authorizes commits there; a push waits forexo:ship, except with--land. - Ask the branch what landed. Run
node "${CLAUDE_SKILL_DIR}/scripts/next-task.mjs" --plan <path> --root <checkout>. It prints the landed tasks, then the next task with its text and the plan's Decisions, Non-goals and Assumptions. Only aPlan-task:commit shows what landed, so on a restart rerun it.Next: nonegoes to the end of the run. - Build one task. Send the task of the
Next:line to a freshexo:builderin the background, with the plan path, the task number, the checkout, the report path thatnode "${CLAUDE_PLUGIN_ROOT}/lib/scratch-path.mjs" implementer-<n>.mdprints when run in the checkout, andrun-task-prompt.mdby path, and wait for its completion notification. The builder edits, then runsland-task.mjs, which proves red then green, runs the Land gate and commits. - Route the return.
GREENgoes back to step 2.BLOCKED <n> NEEDS ANSWER: <question>: ask the user, then re-dispatch that task with the answer in its prompt.PLAN DRIFT: append a## Logline to the plan, then stop and hand the plan back toexo:specwith the builder's reason.BLOCKED <reason>: append a## Logline to the plan before you report it.- A build that fails once goes back to a fresh
exo:builderwith the first builder's report path,node "${CLAUDE_PLUGIN_ROOT}/lib/scratch-path.mjs" implementer-<n>.mdrun in the checkout, in its prompt, on the second-attempt row of the table below. BLOCKED proof <command> did not fail first:land-taskrefused the task: its proof passes without the change. Send a freshexo:builderto tighten that test, or hand the plan toexo:specfor aRed: none (<reason>), and name the task in the final report.BLOCKED proof flaky: the Proof passed once and failed on the second run. Send a freshexo:builderto remove the cause of the flip (shared state, timing, order) without sleeps or retries, or hand the plan toexo:spec, and name the task in the final report.- A build that fails twice, or a repair that must change a module outside the task's
Files:: stop, report both and hand it toexo:diagnose. - A repair names the rule the code broke and fixes the hits the finding names; one guard that fails on a new instance, at most one new test per cause.
- Read
references/agent-cases.mdfor aDeferred:proof or a missingProof:.
- Stay thin. This session writes at most 2 product files in a run; send anything larger to a builder, one per independent part. Run no check of your own after a landing. Only a block, a failure or a question speaks.
Models
| Job | Who | Model, effort |
|---|---|---|
| Build a task | exo:builder |
Sonnet, medium |
| Second attempt after a failure | exo:builder with the Agent tool's model: opus and effort: high |
Opus, high |
| A design choice the plan leaves open | this session | its own model, high |
| Find a cause (diagnose investigator) | exo:builder with the Agent tool's model: opus and effort: high |
Opus, high |
| Research | exo:researcher |
Sonnet, medium |
End of the run
- Review the branch diff first, so the last code written is the code checked: call the built-in
code-reviewskill once through the Skill tool with argsmedium <branch>, name the plan path and ask it to check the diff against the plan's Decisions and Acceptance, read the test-file diffs first, name every assertion changed since the base, look for what a passing Proof hides (unseen inputs, unhandled parameters, needless complexity), and use each finding's severity field (important, nit or pre_existing), counting a finding with no severity as important. Send each important finding to one freshexo:builder, all in one message, briefed "write the failing test or repro for this finding in a new test file named for its finding, so parallel builders never share a file; with no repro, drop it", because a finding nobody reproduced may be wrong. Fix only the reproduced findings, in one builder fix round that commits with the land command's--fix <subject>, and list the dropped ones as unproven, and the nit and pre_existing ones, in the report. With nocode-reviewskill listed, say no review ran. - Run the plan's
Success criterioncommand once, in the background, to a log, and read only the failing lines. Then run the plan'sLand gate:command once the same way unless it isnone:land-task.mjsskips a gate whose last pass took 60 s or more, so this is the one run of a slow gate. A failure goes to one builder fix and one rerun; a second failure ends with what still fails. - Build the report from
git diff --stat <base>..HEADand thePlan-task:commits, not from the builders' summaries. Say in plain words whether the branch is ready, the findings and what the user does next, and label each claim measured, inferred or guess. KeepProof:lines and## Manual checksout of the message; the task reports in the temp folder hold them. - End on
exo:ship, unless the request rules out a push; then say nothing left the machine.--landpasses--landtoship.
No plan
A decided change with no plan file runs these steps, so a small change gets the same proof.
- Orient. Read only the ranges the request names. Otherwise dispatch
exo:researcherwithSources: repoand read only itsRead nextranges. Upstream decisions are settled. - Decide the route. An open product decision goes to
exo:specfirst. Count these facts: over two source, test or config files change, a dependency is added, a public signature changes, a persisted format or security boundary is crossed. With none, readreferences/code-rules.md, which every builder reads too, then edit directly, run the check and end onexo:shipas in the end of the run, so the edit does not sit uncommitted. A test-first request continues at any count. - Workspace. Settle where the change commits, as in step 1 above. For a multi-file change, confirm a clean working tree or name its changed paths.
- Build. Over 2 files, send each independent part to
exo:builderin dependency order; otherwise read the same code rules and edit in dependency order. - Prove. Done needs a
Proof: <command> -> <output>line from a real call on input this session did not write; otherwise writeUnverified: <reason>. A test runner is no proof unlesspackage.jsonnames nobinand noscripts.start. For a test-first bug, commit the failing test alone, because a test committed with its fix does not show it failed. Run runners unpiped, so the failing command shows. - Review and commit. Run
code-reviewas in the end of the run, commit where step 3 placed it, leaving out paths that were already changed, then end onexo:shipunless the request rules out a push.
When the goal command is red, change the project until the command as typed is green without destroying anything; ask the user only about a destructive step.