write-plan
Write plan — the contract every downstream agent works from
Your job is to turn a change that's understood into a plan that can be executed by parallel agents without them colliding, and to save it as a durable artifact under docs/plans/. The plan is not a summary of intentions; it's the contract each implementation and test agent works from, which is why it has to say exactly which files each task owns.
Where this sits
This is Phase 3 of the implement delivery loop, packaged to run on its own. It reads an investigate brief and a grill decision record when they exist; its output is what execute-plan (coding waves) and implement (the whole loop) execute.
Read-only on the repo. The only files you write are the plan and, when the source spec lives outside the repo, a copy of it under docs/specs/ (see §1). No code changes happen until someone approves the plan.
1. Gather the inputs
Look for, and read, whatever already exists for this feature:
docs/plans/<slug>-investigation.md— findings, spike verdicts, completeness inventory, runnability.docs/plans/<slug>-grill.md— the owner's decisions, dispositions, and open assumptions.- The source ask — a ticket, a PRD, a spec, or the conversation.
If there's no investigation, do a proportionate read-only grounding pass before writing: the files the change touches, sibling code paths to mirror, every caller of what's changing (including re-exports, barrels, and scripts or jobs outside the main source tree), how the app and its tests run. On Claude Code, a couple of parallel Explore agents cover this; on a small change, read inline. A plan without file:line anchors is guessing at the file ownership it's supposed to guarantee.