/dev:write-planfrom dev
Turn a clear development request into a self-contained plan under `wiki/plans/` for dev:execute-plan or another agent to implement — a record of the requirement, the decisions with their tradeoffs, and the discussion that settled them; an execution brief telling the executor what to change, where, and what the result looks like, at the depth its model tier needs; and the orchestrator's verification contract. A decomposable requirement may become a plan group (contract plan, parallel members with disjoint scopes, integration plan) whose members execute concurrently. Use when the user asks to plan, design an implementation approach, convert a bug/feature request into an executable plan, or continue after dev:explore. Planning is read-only except for files under `wiki/plans/`; from the repository's main worktree it first cuts a branch and worktree named after the requirement and continues there.
Ships in dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write one plan for one requirement. A plan has three readers, and each gets its own part: the Record tells reviewers and future readers why — the requirement, the decisions with their tradeoffs, and the discussion that settled them — and outlives the code; the Execution brief tells the executor what to change, where, and what the result looks like, and is the only part a delegated executor receives; Verification tells the orchestrator how to judge the result.
The implementation design happens here, not in the executor. You have read the code and usually run the stronger model; the executor is often a faster, weaker one, and every decision left to it is made by the weakest participant. The brief therefore settles the implementation to the depth the executor's tier needs (step 4) and names what remains the executor's own call. The plan must be complete enough for an agent with no conversation context to implement it, verify it, and stop safely.
A requirement that genuinely decomposes may become a small plan group whose members can execute concurrently (see step 2); each member is still a self-contained plan. Independent milestones inside one plan need no group: dev:execute-plan fans them out into concurrent work packages at dispatch, reading their independence off the plan's Execution brief.
wiki/plans/.wiki/plans/: it may create one worktree and one branch from HEAD, append to the local .git/info/exclude, and switch the session into that worktree. It never changes the main worktree's branch or tracked files, and never installs dependencies.These four items must carry a resolved value before work passes to the next phase. Resolve them from the current request, earlier user decisions, and inspected facts; whatever is genuinely the user's to decide is put to them at dev:explore's two fixed gates — the product confirmation for a perceptible change, and the departure check — and is never re-asked afterwards. Resolving internally applies to factual questions only; it never cancels either gate. Record the source of each result briefly in the handoff or plan. Do not create a separate state file.
discussion or implementation (including verification). A discussion request ends in chat; an implementation request continues through planning and execution. No endpoint stops the chain once a plan is written. Derive discussion from the request — that path ends at the report and never reaches the departure check; implementation is set at the departure check's autopilot item, which also sets Plan review (none or audit): with audit, dev:write-plan sends the finished plan to a top-tier subagent for an independent audit, revises it on the findings, and continues to implementation without stopping. Readiness is not authorization to expand scope, and silence is not approval.subagent(sonnet), subagent(opus), subagent(fable), or self. Reuse a recorded selection without re-asking. Use deferred only for work no departure check settled, such as a discussion; resolve it when execution is actually needed, using dev:execute-plan's "Choose execution mode" rules. A mode the host cannot support falls back per those rules and is reported, never silently.<dev-workspace> block (kind main or linked) and apply the planning/execution isolation rules to it: from the main worktree dev:write-plan cuts the requirement's branch and worktree and continues there (isolated); inside a linked worktree the work continues where it already is (current). Only an explicit request to stay changes that. Check cleanliness, dependencies, and drift yourself at the phase that needs them; report concrete blockers instead of asking the user to perform routine checks.For each item, retain a value and its basis: departure-check answer, later user instruction, applicable default, inspected fact, or not applicable. A later explicit user instruction overrides an older handoff or plan field; update the affected fields without reopening settled items. Do not advance dependent work while a user decision remains unresolved.
Once the departure check is answered, downstream skills treat its answers as standing authorization and run to the recorded endpoint without asking again. Discussion summaries carry the endpoint, the selected execution mode, and where the work will live; plans record Execution:, Stop after:, Plan review:, and Workspace: with a short basis. Pushing and opening PRs require an explicit user request, with one exception inside the implementation endpoint: dev:execute-plan pushes the branch and opens one pull request at close when its hook-injected publish block allows it, unless the user asked to leave the branch unpublished. Merging always requires an explicit user request; STOP and BLOCK conditions still apply.
dev:explore, reuse the explored terrain, clarified requirement, the product conclusions when the change is perceptible to its consumer, and the departure-check answers. The grilling and all confirmations already happened there: do not re-interrogate settled decisions and do not re-confirm anything. If the handoff records no departure check at all, the check did not happen: run dev:explore's departure check now, before the first write. An item the check legitimately omitted — execution mode when dev:execute-plan is absent — is not a missing answer; any other missing item is an unanswered confirmation, not a settled default.dev:explore to converge on a direction before writing the plan. Switch likewise when the request is perceptible to its consumer — it changes what they see or do — and no product conclusions (interaction flow, states, UI structure, scope) have been settled: dev:explore clarifies the product before the design, and this skill does not repeat that stage. Decide this before asking anything, so the departure check happens once, in whichever skill owns it.dev:explore (one at a time, each with a recommended answer; honor "don't grill me"), and finish with dev:explore's departure check — direction, execution mode, plain autopilot or plan audit — so nothing needs confirmation later. The workspace is not among its items: step 3 below settles it from the injected block. For the execution-mode item, ask the execution-mode question defined in the installed dev:execute-plan skill's "Choose execution mode" section (the canonical definition); if that skill cannot be located, omit the item — dev:execute-plan asks at dispatch time.(decided while planning); when it contradicts the approved direction or the code's current state, stop and report instead of guessing or re-asking piecemeal.dev:explore they are in the conversation, so take them from there rather than reconstructing them.Default: one plan for one requirement. A plan group is for a split that needs a designed boundary — a contract plan a human reviews before the members build on it. Independent milestones do not need a group: dev:execute-plan fans them out at dispatch as work packages. Split into a plan group only when the requirement genuinely decomposes, the split needs such a contract, and it passes all three parallel-safety criteria:
The canonical shape is contract-first:
20260821-contract contract: shared types, API schema, stubs (serial)
20260821-module-a module A — depends on contract (parallel group)
20260821-module-b module B — depends on contract (parallel group)
20260821-integration integration — depends on module-a, module-b (serial)
Parallelism is never the reason to form a group — a plan whose milestones are independent already runs concurrently as work packages. Never force a split to manufacture parallelism: a forced split trades visible wall-clock time for deferred merge-conflict and interface-drift costs. If any criterion fails, write one plan.
Group membership lives only in wiki/plans/README.md; each member stays self-contained and declares just its Depends on: edges.
Plans and their execution never land on the repository's main worktree. Before the first write, check where the session is. In Claude Code the plugin's hooks inject a <dev-workspace> block — kind main or linked, path, branch, and at skill start pending — at session start and again when this skill starts: read the latest one, unless a worktree switch you performed since supersedes it. Without such a block, the main worktree is the first entry of git worktree list; compare it with git rev-parse --show-toplevel. When they match — whatever the branch — cut a working branch and worktree named after the requirement and continue there. This needs no confirmation — the block says which case applies, and the departure check does not ask about it. Skip this step outside a git repository, inside a linked worktree (one created earlier by this step or by dev:execute-plan already isolates the work), or when the user asked in this conversation to stay put.
YYYYMMDD-short-slug: the date from date +%Y%m%d, the slug derived from the requirement — for a plan group, the requirement's slug, not a member's. Step 4 reuses it verbatim as the plan filename; the members of a group share its date and carry their own slugs..claude/worktrees/ is ignored: git check-ignore -q .claude/worktrees — if not, append .claude/worktrees/ to the local .git/info/exclude, never to the tracked .gitignore.<dev-workspace> block injected at skill start carries pending, the git status --porcelain entry count; when it is absent, or anything touched the tree since, run that command yourself — it must be empty. Anything pending means stop and report what is pending: exploration read the working tree, so a branch cut from HEAD without those changes would plan against code nobody looked at. The user commits, stashes, or asks to plan here.HEAD: git worktree add .claude/worktrees/<id> -b dev/<id> HEAD. Never let the host's enter-worktree tool create it — Claude Code's EnterWorktree branches from the remote default branch unless configured otherwise, so unpushed local commits would be missing. A branch or path left by an earlier attempt: enter it when its tip is HEAD, otherwise choose a more specific slug. When a host guard denies the command, follow "Host-managed worktrees" below instead of improvising.EnterWorktree with path), otherwise address every file and every command through the absolute path, since a cd does not persist between commands. Confirm with git rev-parse --show-toplevel and git rev-parse --abbrev-ref HEAD before writing anything.Host-managed worktrees. Some hosts manage worktrees themselves and deny git worktree add, remove, and move through a guard hook. Such a denial names the replacement: follow exactly what it hands you and nothing more — do not retry the denied command, do not work around the guard, and do not let the host's enter-worktree tool create the worktree (it branches from the remote default branch). The requirement does not change: the worktree must start at the intended start point, on the intended branch. When the replacement tool would pick the start point itself, create the branch first — git branch <branch> <start> is not guarded — and ask the tool for a worktree on that existing branch. Take the path from the tool's result or the host's listing, and accept it only once git worktree list shows it with its HEAD at the intended start point; otherwise stop and report. The worktree lives wherever the host puts it, so the .claude/worktrees/ exclusion does not apply to it, and the host's enter-worktree tool may refuse a path outside .claude/worktrees/ from a subagent or on a second switch — address every file and every command through the absolute path then. Remove such a worktree through the replacement the guard names for removal, never with git worktree remove; deleting the merged branch with git branch -d afterwards is not guarded.
Say in one line where the work now lives — the absolute worktree path and the branch. From here on "the current branch" means dev/<id>: the plan commit, the execution, and the status updates all land there, and the main worktree keeps its branch untouched; merging back is the user's call. The new worktree has no installed dependencies — do not install them (Rule 7); dev:execute-plan does at preflight.
git rev-parse --short HEAD.wiki/plans/YYYYMMDD-short-slug.md — the id fixed in step 3, otherwise the date from date +%Y%m%d plus a distinct slug. Never derive the name by scanning the directory for the next number: that read-modify-write has no mutual exclusion, so concurrent planners collide on the same name. A date plus a distinct slug needs no coordination.wiki/plans/README.md with execution order, dependencies, and status; when step 2 produced a plan group, mark the group there (members of one group are safe to execute concurrently).Execution: value — the reader it is written for:
subagent(sonnet): one task per edit site. Run the searches yourself and list every site; never write "there may be others". Give each site its target state — the behaviour or output, the invariant it must hold, the tests to write as input → expected — and leave the code that reaches it to the executor. Write code or exact text only where the decision lives at that level: an order of checks, whether a key exists, a format string or user-facing text the requirement fixes. The brief locates and constrains the change; it does not write it a second time.subagent(opus), subagent(fable), self, or deferred: one task per milestone outcome, naming its files, the constraints that govern it, and the target state; the edits inside it are the executor's design. dev:execute-plan refines the brief before dispatching a lower tier than it was written for.D2) so the reviewer can trace it. A rejected alternative appears only where it is tempting, as one Don't line; the reasoning stays in the Record.After, never a command that checks it: the executor runs no validation.Use this structure:
# Plan YYYYMMDD-short-slug: <outcome-focused title>
> Three parts for three readers. The Record says why and stays true after the
> code moves on. The Execution brief is the only part a delegated executor
> receives. Verification is the orchestrator's. At close, `dev:execute-plan`
> appends an Outcome and updates `wiki/plans/README.md`.
>
> Drift check: `git diff --stat <planned-sha>..HEAD -- <in-scope paths> <files cited under Decisions & tradeoffs>`
## Status
- Priority: P1 | P2 | P3
- Effort: S | M | L
- Risk: LOW | MED | HIGH
- Depends on: none | wiki/plans/YYYYMMDD-*.md
- Category: bug | feature | tests | refactor | docs | dx | migration
- Execution: subagent(sonnet) | subagent(opus) | subagent(fable) | self | deferred — from the departure check; `deferred` only when no check settled it, and `dev:execute-plan` resolves it at dispatch
- Stop after: implementation — from the departure check's autopilot item (plain autopilot or plan audit)
- Plan review: none | audit — from the departure check's autopilot item; `audit` means step 5 ran before handoff, or notes why it was skipped
- Workspace: isolated | current — from the inspected workspace: `isolated` when step 3 moved the session, `current` when it was already in a linked worktree or the user asked to stay
- Planned at: `<short-sha>`, <YYYY-MM-DD>
## Record
### Requirement
The problem, its impact, and what is true once this is done — written so a
reviewer can tell a correct solution from an adjacent wrong one. For a change
its consumer can perceive, this section also carries the product conclusions
settled in exploration: the interaction flow, the states, the UI structure,
the scope cut, and what the consumer can observe when done. They live in the
plan, not in a separate artifact.
### Decisions & tradeoffs
The most expensive information in the workflow: what exploration and grilling
settled. One entry per decision, numbered so the brief can cite it:
- **D1 <Decision>**: <chosen option>. Rejected: <alternative> — <why>.
Based on: <fact with `file:line`, or the answer in the Discussion log>.
Cite the facts each decision depends on. These citations are the drift
surface: if one no longer holds, the decision needs revisiting.
### Discussion log
How the decisions were reached, in order: each question put to the user — at
the product confirmation, while grilling, at the departure check — with the
options offered, the answer in the user's key words, and what it settled;
then what planning decided on its own `(decided while planning)` and what the
plan audit changed `(revised on plan audit)`. One or two lines per entry;
keep the turns that changed or confirmed something and drop the rest.
### Maintenance notes
What future maintainers or reviewers should watch.
## Execution brief
> Written for `<Execution value>` at `<planned-sha>`. Implement the tasks in
> order. Decide only what Your call leaves to you; on anything else that is
> unclear, stop and report.
### Goal
What changes and why, in a few sentences — enough for the executor to make
sense of the tasks — and the architecture and conventions to follow,
including the formatter command it runs on the files it changes when the
project has one (the format check itself belongs under Verification).
### Milestone 1: <outcome>
Depends on: none | Milestone N
#### T1 · <what is true after this task>
- Where: `<path>` — <anchor: a quoted line, a heading, or a symbol name>
- Change: <what to do, in the imperative>
- After: <the target state: behaviour or output, the invariant it holds, tests as input → expected; exact code or text only where the decision lives there>
- Don't: <a tempting wrong move> (D<n>) — omit the line when there is none
State how the milestones depend on each other, and say so when they are
independent: `dev:execute-plan` reads independence off this part when
deciding whether to fan the plan out into concurrent work packages, and a
plan that leaves it unstated runs as one.
### Your call
What the executor decides itself — naming, internal structure, wording within
the stated constraints. Anything neither a task nor this list settles is a
stop-and-report.
### Landmines
Only hazards that cut across tasks, with `file:line`; a hazard that bites one
task is that task's `Don't`. Delete this section if empty.
### Scope
In scope:
- `<path>`
Out of scope:
- `<path or behavior>` — reason; include look-alikes that must not change
### Stop and report if
- A task's anchor is missing, or the code there differs from what the task describes.
- A task needs a file outside the in-scope list.
- Two tasks contradict each other, or a task contradicts the code it changes.
- <plan-specific condition>
## Verification
### Milestone validations
- Milestone 1: `<command>` -> expected result
Fast, in-process, exit-code-checkable commands (unit tests, typecheck, lint),
run by whoever verifies: the orchestrator under delegation, the implementer
itself only in self-execution. Anything needing a runtime environment —
e2e/UI suites, a running app, browser, or external service, a project verify
flow — is acceptance-tier: list it under Commands marked `(acceptance)`, never
as a milestone validation; it runs last, after code review.
### Commands
| Purpose | Command | Expected result |
| --- | --- | --- |
| Unit tests | `<command>` | exit 0 |
| Typecheck | `<command>` | exit 0 |
| E2E (acceptance) | `<command>` | exit 0 |
Mark every command that needs a runtime environment — e2e/UI suites, anything
requiring a running app, browser, or external service — with `(acceptance)`:
the orchestrator runs those at verification. Drop the row if the project has
none.
### Done criteria
- [ ] All listed commands pass.
- [ ] Every task's `After` state holds.
- [ ] <plan-specific observable behavior>
- [ ] Required tests exist and assert meaningful behavior.
- [ ] Implementation follows every entry in Decisions & tradeoffs.
- [ ] No out-of-scope files changed.
- [ ] The Outcome is appended and `wiki/plans/README.md` status is updated.
### Merge and deploy
What the diff will not tell a reviewer, found during exploration and planning:
checks before merging that CI will not run, and what deployment needs —
environment variables and secrets by name only, migrations and their order,
configuration or infrastructure changes, feature flags, rollout ordering across
services, how to roll back. `dev:execute-plan` builds the pull request body
from this section. Delete it if empty.
Only when Plan review: audit. Otherwise skip to step 6.
Skip it as well when the latest injected <dev-orchestrator> block (in Claude Code the plugin's hooks inject one at session start and when this skill starts) says top-tier: yes: the audit dispatches the top Claude tier, and a reviewer at the orchestrator's own tier is worse than none. Record Plan review: audit — skipped, orchestrator already at the top tier and go to step 6. Do not probe the model yourself; without a block, or with top-tier: no, run the review.
references/plan-audit.md and dispatch the audit once, following its brief contract. Point it at the plan file (and the whole group, for a plan group) and the repository — it verifies the plan's claims against the code itself. Include the approved direction and the departure-check answers as settled constraints it is not asked to reopen, plus git status --short. The question is the one dev:explore's stress-test mode answers: is this plan safe to execute as written, and revision notes keyed to the plan's sections where it is not — decisions that do not hold or leave a reasonable misreading, missing landmines, scope holes, done criteria that would pass a wrong implementation, validation commands that do not exist, and an Execution brief that an executor at the recorded tier, following it literally, would turn into a wrong or incomplete change — a missing edit site, a stale anchor, a task that contradicts a decision.(revised on plan audit) under Decisions & tradeoffs and note the change in the Discussion log, so the record shows its origin. Findings you reject need a reason in the plan's Maintenance notes, one line each; a finding contradicted by evidence you already hold goes back in one reconcile call, as references/plan-audit.md describes, and that call is the last one.Planned at: if HEAD moved, and relay in chat what the review changed — the user cannot see the reviewer's report.dev:execute-plan, and state the plan's absolute path — when step 3 moved the session, the plan exists only on dev/<id> in that worktree, and a fresh session in the main worktree will not find it. Leave the plan uncommitted: dev:execute-plan commits pending wiki/plans/ files itself during preflight.dev:explore or here — do not ask anything. Directly, or after step 5 under Plan review: audit, summarize the plan for the record — naming the worktree path and branch when step 3 moved the session — commit only wiki/plans/, and start dev:execute-plan with the recorded execution mode. For a plan group, hand over the whole group — its concurrent dispatch is defined in dev:execute-plan.dev:execute-plan was absent: ask once how to execute — self-execution or a subagent — then proceed accordingly.Before finishing, check each part against its reader:
Hold each entry in Decisions & tradeoffs to a no-reasonable-misreading bar: an unreported deviation from a decision fails review, so the wording must not leave room for a good-faith reading that lands somewhere unintended. The cheapest test: check that the rejected alternative is actually excluded by the words, not merely disfavored. If a decision cannot be written that precisely, it is not settled — resolve it, or explicitly delegate it under Your call.
The Record outlives its execution, so write it to still make sense after the code has changed. The brief is a snapshot valid at Planned at: and is not maintained after execution. Keep implementation detail out of the Record, and rationale out of the brief beyond a because clause where a constraint would otherwise look arbitrary.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mywsq/plugins --plugin dev3 skills in this plugin
/execute-planExecute an implementation plan written by dev:write-plan under `wiki/plans/` on the current branch — fanning it out into concurrent work packages in per-package worktrees when its milestones are independent — or a parallel plan group concurrently in per-plan worktrees. Use when the user asks to implement, run, execute, or delegate a plan such as `wiki/plans/20260821-share-link-claim`, `execute share-link-claim`, `run the next TODO plan`, or `run the two 20260821 plans in parallel` — match a partial name against the plan filenames. Implements directly or delegates to a host subagent, then verifies and reviews the diff./exploreRead-only requirement and codebase exploration before planning. Use when the user asks how code works, wants relevant files and validation commands identified, has an unclear or open-ended development request, needs implementation approaches compared before dev:write-plan, or wants a plan or design grilled/stress-tested. For a change its consumer can perceive — a page, a flow, copy, a CLI command or output, an API call shape — clarifies the product first (interaction flow, states, UI structure, scope) from the product surface, confirms it, and only then reads the implementation and grills the technical design. Clarifies by grilling by default — one question at a time with a recommended answer until the design holds up; say "don't grill me" for minimal questioning. Never edits files; reports findings, product conclusions, clarified requirements, and an approved design direction in chat.