Implementing a plan
Run a plan task by task through delegated contexts, so the session that commits stays small. The enemy is reading the whole plan or building in the session: both spend the context the review and the pull request need. The overcorrection is delegating a decision: a task with a Design: line needs a judgment only the session can make.
Invoking /exo:implementing on a plan authorizes the workspace you pick at step 1, a wave's temporary worktrees beside it, commits there as steps 6 and 7 time them, and the review's fixes; a push or a pull request only after your answer to the finish question, and nothing else.
When to use
- A session opens on a plan written by
planning, or the user says to run or resume one. - Not for writing or repairing the plan (
planning), a change without a plan (implementing-batch), or a failure whose cause is unproven (debug).
The loop
- Resolve the plan, then the workspace. Use the path the user named; without one, take the plan under
docs/plans/or~/.claude/plans/whoseRepository:line equalsgit rev-parse --show-toplevel, prefer one whoseBranch:equals the current branch, and name the pick. Then settle where the run commits asreferences/workspace.mdsays, before any dispatch: a new branch takes the plan'sBranch:when it names a branch other than the default, otherwise<type>/<slug>from the plan's goal. A plan whoseRepository:folder is not a git repository yet and holds nothing butdocsis the exception: the run itself runsgit init -b mainthere, asks no workspace question and commits onmain, because a repository with no commit has nothing to branch from. The run commits only where that answer puts it. - Read the frame, not the plan. Read
## Goal,## Plan basis,## Non-goals,## Contextand## Visual direction, then list the tasks withgrep -n '^### Task [0-9]' <plan>; never open the whole file and never@-reference it. Open the run's list from that listing under the progress rule inusing-exo: one line per plan task, in plan order. - Ask the branch what landed. A task has landed when
git log --grep '^Plan-task: <n>$' --format=%hon the branch prints a commit. A task is ready when it has not landed and itsDepends on:all landed; the first ready task is current, and all landed sends you to step 7. When## Plan basiscarries aWorktree setup:line and the current task has noDesign:line, the wave is that task plus the next ready task withoutDesign:, two at most, because a third worktree and report crowd the session and independence is the plan's word, never a guess from paths; step 4 then runs once per task of the wave. Set every landed line to completed and the current task, or every task of the wave, to in progress, so the list reads as the branch does. - Extract that task alone, fence-aware, and route on its
Design:line:awk -v n=<n> '/^```/{fence=!fence} !fence && /^### Task [0-9]/{on=($3==n":")} on' <plan> - Dispatch the build. A wave of two or more tasks first gets one worktree per task,
git worktree add --detach "<root>-task-<n>" HEADand then the plan'sWorktree setup:command inside it, asreferences/workspace.mdsays under## Wave worktrees; its builds go out in one message so they run together, each brief naming its own worktree as the checkout, and a task alone builds in the run's checkout. A task withoutDesign:goes to ageneral-purposedelegate onsonnetwith a brief written fromimplementer-prompt.md; the model is named on every dispatch, because a dispatch that names no model runs on the session's model. A task withDesign:whose## Visual directionnames the chosen direction goes to ageneral-purposedelegate onopuswith a brief fromimplementer-prompt.md, which entersdesigningat its Build phase and takes that direction as given; one whose## Visual directionreadsDirection: pending at rung <n>builds here underdesigningfrom its Direction phase, and one that records no direction builds here underdesigningfrom its## Route. APLAN DRIFTreport goes to ageneral-purposedelegate onopusfromdrift-repairer-prompt.mdwith the plan path, the task number and the mismatch, then step 4 repeats; a failedRun:whose output names no causal line goes to ageneral-purposedelegate onopusfrombug-fixer-prompt.mdwith the command, the log path and the paths; a second drift or a second failure on one task ends the turn with both reports. Inside a wave none of these repair routes runs: step 6 discards the wave first. - Commit a green task. A task is green when the delegate returns
GREENwith onepassline perRun:the task section holds; a missing, extra orfailline is not green and goes back through step 5, never to a commit, with the report path as the evidence to open. Run the task'sCommit:block as written and push nothing, because a push leaves the machine and waits for the finish question. A wave commits only when every report in it is green: eachCommit:block runs inside its task's worktree,git cherry-pick <sha>brings the commits onto the branch in plan order, and the worktrees are removed. One report that is not green discards the whole wave as## Wave worktreessays, so no task of it commits; its first task that was not green then runs alone from step 4 and the rest of the run forms no wave, because a repair beside two landing commits is how a plan and a branch diverge. Set each landed task's line to completed and return to step 3 with no message between the two, because the list carries the run: only a blocked task, a failed check or a question for the user earns a message of its own. - The tail. With every task landed, run every command the plan's
## Final verificationnames in the run's checkout before any dispatch, redirecting output over forty lines to a log under the directorygit rev-parse --git-dirprints, and quote each command with its result: the review starts only on a green run, because a reviewer reading a red branch spends its pass on a failure the run already had. A failed command goes to ageneral-purposedelegate onopusfrombug-fixer-prompt.mdwith the command, the log path and the paths, then the commands run again; a second failure on one command ends the turn with both outputs and no review. Then dispatch theexo:branch-revieweragent once, giving it the plan path, the branch, the repository root, the basegit merge-base HEAD origin/<default>, the code standard path and the plan's## Final verification: one reading of the whole branch sees what crosses tasks and costs one review instead of one per task. ABLOCKEDverdict ends the turn with its report; otherwise, whengit status --porcelainlists its fixes, commit them asfix(<scope>): address the branch review. Then end onreferences/finishing.md: its overview is this turn's one report, its question is the only route to a push or a pull request, and the pull request carriesCloses #<n>when the plan's## Goalnames issue#<n>. Which tasks landed stays in the list.
Red flags
| The excuse | What holds |
|---|---|
| "I'll read the plan once to get the picture." | The frame plus one task is the picture; the rest is paid on every turn. |
| "This task is small, I'll build it here." | Small edits still fill the session; only a Design: task whose direction is not yet frozen belongs here. |
| "A reviewer per task catches more." | Run: and Expected: prove each task; the one branch review on opus reads what crosses tasks, once. |
| "A status line between two tasks is cheap." | It is written once and re-read on every later turn; the list already carries it. |
| "One commit at the end is cleaner." | The task's own commit, with its Plan-task: trailer, is how a cleared context finds where to resume. |
References
| File | Read it when |
|---|---|
references/workspace.md |
Step 1, before the first dispatch, and step 5, before a wave's first worktree. |
references/finishing.md |
Step 7, once the review's fixes are committed. |
../issuing/references/fields.md |
Step 7, before opening a pull request, for the body and the fields references/finishing.md takes from it. |
implementer-prompt.md |
Step 5, before every build dispatch. |
bug-fixer-prompt.md |
Step 5, before a dispatch on a failed Run: with no causal line. |
drift-repairer-prompt.md |
Step 5, before a dispatch on PLAN DRIFT. |
Judgment
- Explicit user instructions outrank this skill; a named plan path outranks the search.
- The plan's settled decisions outrank implementation defaults:
planningowns the plan's text, the build delegate owns the build, the branch reviewer owns its findings, this skill owns routing and commits. A choice the plan leaves open and the user would not notice is ruled here and recorded in the commit body, never sent back as a question. - Repository state outranks memory: only a
Plan-task:commit on the branch decides what has landed, and after a compaction notice step 3 runs again before any edit. - When the status line's context share passes about 45% inside one task, land that task, then name
/exo:handoffand a fresh session in one line: the tail's review, commit and pull request need the context the rest of the run would spend.