Arguments. [task description|review|close-out] [--unattended] [--reader guardrails|standard|step-by-step]. e.g., /planning:plan add caching to query handlers, /planning:plan #<map>, /planning:plan review, /planning:plan close-out --reader guardrails. Take --reader <depth> out of $ARGUMENTS before routing; it sets the "Reader depth" of the published copy.
Repository context. Gather first
<!-- BEGIN GENERATED: gather-block. Edit docs/conventions/gather-block/block.md, then run scripts/sync-gather-block.py -->
Run each command below as its own Bash call, all sent together in one message (worktree isolation).
Keep any bound in the command's own pipe (output limits).
Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).
<!-- END GENERATED: gather-block -->
- Current branch,
git branch --show-current - Recent commits,
git log --oneline -5 - Working tree status (empty = clean),
git status --porcelain | head -10
Variables
Arguments: $ARGUMENTS
Purpose
Every implementation starts with a clear design, evidence, a test strategy, and user sign-off before any code is written. This is not Claude Code's built-in plan mode (what that mode does: Analyze before you edit with plan mode); this skill is a separate planning discipline that can run inside it. It consumes exploration, research, and /planning:design (types, interface contracts, module boundaries, package topology) and produces a plan the user approves before execution. A 2-minute plan prevents a 20-minute rework cycle. Match planning depth to blast radius: a one-file fix gets a brief plan; a cross-cutting architecture change gets a full plan with stress-testing and research-iterate loops.
Level this skill decides: files and symbols, which files change and which functions, types and tests each phase touches; behavior is the interview's Brief, and interfaces and interface contracts are /planning:design's.
Skip the plan when one sentence covers the change. First try to write the whole diff as one sentence. The test passes when no design question is open and that sentence describes every edit. How this skill was reached decides what happens next:
- Invoked proactively (nobody asked for a plan): say the change fits one sentence, give the sentence, and skip the plan. No checklist, no plan-reviewer, no PLAN.md draft.
- Invoked on an explicit request (
/planning:plan, "plan this"): say the change fits one sentence, give the sentence, and ask whether to plan it anyway. Write a plan only after a yes; then the Trivial row of the Step 2 scale table applies. A run with nobody to ask records the sentence and skips the plan.
Emit checklist
For multi-step planning (almost always steps 1-5), copy ${CLAUDE_PLUGIN_ROOT}/skills/plan/templates/checklist.md to <memory_dir>/<topic-slug>/plan-checklist.md (default .work/) by reading the template with the Read tool and writing the copy with the Write tool, never cp, sed or a shell redirect from a plugin file, and tick each - [ ] as its step completes. Step 5 (present for approval) is a non-negotiable tick. Step 3 is ticked once the reviewer rule (Gates) is applied: the reviewer ran, or its skip and reason are recorded.
Skip when: the one-sentence skip (Purpose) applied, so no plan is written. On a mid-flight review replan, append a dated scope-change note and revise the PLAN phases instead; do not spawn a second checklist file.
For non-trivial / multi-layer plans, Step 2 walks its design-default checklist against the plan: confirm the plan carries the resolved threads in PLAN.md's ## Design section (and the design artifacts behind it) rather than re-deriving the axes. Configurability, extension points, observability, and testability are design threads owned by /planning:design's "Design defaults"; type-collaboration shape is its type modeling. The principle and lifecycle-and-reversibility threads /planning:design-handoff requires are audited the same way: resolved, directional or tagged-deferred (at quality bar prototype, named as deferred); a missing one routes back through /planning:design-handoff, except under an early-exit design-resolution.md, which carries neither. Audit that the plan carries their resolutions, don't re-open them. When a phase is tagged for a phase-boundary review, confirm the Brief carries a Quality bar: line: that review rates at it (context/plan-template.md "Phase Review tags"). Magic-literal hygiene stays plan's own review check against the consuming project's review conventions when it declares them.
Action Router
Parse $ARGUMENTS to determine the action, after taking out --unattended wherever it appears (the caller declaring that nobody is present; it governs the /plan offer under "Routing"):
| Argument | Action | Use case |
|----------|--------|----------|
| (empty) | Smart default | If a plan exists in conversation, offer to finalize/review; if exploration and research are done, start planning; otherwise suggest prerequisites |
| <task description> | Full planning | Run the complete planning process for the described task |
| #<map> [task description] | Plan from a map issue | Full planning with a tracker item (#<n>, qualified ID or URL) as its source; Step 1 reads its decisions |
| review | Plan review | Critique an existing plan for completeness, feasibility, and alignment with the project's conventions |
| close-out | Close-out | Run the PR-time close-out (below) for an approved plan: publish PLAN.md to the PR body and the linked issue, record durable decisions as an ADR, file follow-ups to the tracker |
Planning Process
Gates
These hold after a compaction re-attach. Later steps say how to carry them out.
Verification. These gates sit near the top so they stay inside the part of this skill that is re-attached after auto-compaction; tests/reattach-slice.test.sh stands in for that part with the first 20,000 bytes. How much is re-attached: Skill content lifecycle.
- Reviewer. Before presenting, dispatch a fresh-context plan-reviewer sub-agent only when the first matching rule says so: the
verificationlevel (Step 3)lightoroffskips it;plan_stress_test(Step 3)devils-advocatefor the draft's mode skips it;reviewerorboth, or theverificationlevelstrict, runs it; underautoit runs when the Step 3b blast radius is MEDIUM or higher, any stress-test trigger matches, or the user asks for a plan review or stress-test (a/planning:plan reviewre-plan included), and is skipped otherwise. A skip is stated, never filled by the producing thread self-attacking the plan inline. A change skipped under the one-sentence rule (Purpose) has no plan to review. - Hard-to-reverse decisions escalate EARLY regardless of confidence. Below-bar judgment calls go to an interview round before the plan locks.
- Agent teams. Route a phase to an agent team only when the parallel-safe workers must message each other and agent teams are enabled; otherwise use sub-agent workers or sequential. Disjoint file ownership between teammates is mandatory; for why, see agent teams: avoid file conflicts.
Step 4.7: Outcome gate (before Step 5. Verify the PLAN, not a recap)
Before presenting at Step 5, persist the composed plan as a draft to <memory_dir>/<topic-slug>/PLAN.md (default .work/; the final-persist step updates the same file after approval and applies plan_store; the draft is never published), then check the artifact against binary criteria read off it, not a holistic "is the plan good?" recap. Any FAIL → fix the PLAN before presenting.
Run bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-plan-outcome.sh" <PLAN.md> and require exit 0. It prints one criterion=<name> status=<pass|fail> line per mechanical criterion:
- Every phase has ≥1
Sanity Check, counted per phase section. - Every phase carries a valid status tag. Each
### Phase N:ends in[TODO],[DOING], or[DONE]. - Every unilateral decision has a table row. When the plan carries an
[EXEC-SHAPE]/[FALLBACK]tag from Step 4.6, the "Decisions made (gate-passed)" table (| Decision | What it changes in the plan | ...) is in PLAN.md with at least one row. A tag may carry an id ([EXEC-SHAPE D4]) that its row starts its first column with; the script fails a tag id with no row and a row id no tag cites, and printsmapped=<n>(see context/tag-decisions.md "Presentation contract"). - Blast radius assessed. A Blast-radius line naming LOW, MEDIUM, HIGH, or CRITICAL exists (from Step 3b).
- Planned breakage is well formed. Each
**Planned breakage:**line (the optional per-phase line in context/plan-template.md) sits in a phase section, names a kind ofbuild,testsorlint, a later### Phaseheading to stay red until, and the failing paths or test filter: theplanned-breakagecriterion. A plan with no such line passes. - Every acceptance criterion maps to a phase. Each criterion opens with its id (
AC1:) and each phase names the ids it satisfies on a**Satisfies:**line; thecriteriacriterion names each id no phase satisfies (unmapped=), per context/plan-template.md "Criterion ids". Awarning=criteria-without-idsline means the criteria still need ids: add them, then rerun. - The plan opens with its behavior list.
### Behavioris the first###under## Plan; every criterion id is cited by a behavior or listed on itsProcess criteria:line, never both, and every behavior is delivered by a phase's**Delivers:**line: thebehaviorscriterion, which names each failure (list=missing,list=not-first,uncited=,undelivered=, ...) per context/plan-template.md "Criterion ids". A plan with no criterion id passes it with awarning=behaviors-without-criterion-idsline. - Paths are portable. No drive-letter path and no
/Users/<name>or/home/<name>path, since a published PLAN.md is read on other machines; a deliberate example carries<!-- path-example -->on its line.
Then run bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-plan-citations.sh" --commit HEAD <PLAN.md> from the repository the plan cites and require exit 0: every path:line citation (a path from the repository root, then a line, a start-end range, or a comma list of them) names a file and lines that exist at that commit, and each one that does not prints a citation= line with its reason. Each outermost shape fence's anchor is checked at the same commit; a failing or warned anchor prints a shape= line with its reason, and only the shape-line warning passes (reasons: context/plan-template.md "Shape fences"). Cite lines as they stand at that commit, and cite a file outside it (a memory-slice file) without a line number. Write the commit= value it prints into PLAN.md's Citations checked at: line, so a reader knows which tree the line numbers describe. A deliberate example, or a host and port the script reads as a citation, carries <!-- citation-example --> on its line.
Checked by reading, or by their own script:
- Every phase traces to a criterion. Walk the phases against the Brief's Out-of-scope section: no phase does work it lists, and every phase and work item serves a criterion or something a criterion needs (a test, a migration, a dead-code removal the
phase_orderstep calls for). Cut anything else, or surface it as an Open Decision for the user to keep: work beyond the criteria otherwise surfaces only in review. - Each tag has its own row. Every tagged decision appears in that table with its what-it-changes column filled; below-bar decisions were interviewed, not decided. The script maps only tags that carry an id; a bare tag passes with a
warning=bare-tagline, so map those by reading. - Displaced answers are listed at Step 5. When an interview ledger exists, run
bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-open-questions.sh" --ledger <ledger>. It passes when the verdict reportsopen=0andsuperseded=N(exit 1 is expected when N > 0) and every id on the ledger's| superseded-by-plan |rows (the verdict prints only the count) appears in the Step 5 "Displaced answers and new external effects" block.
This self-check does not replace the human approval at Step 5; the user is the terminal gate.
The gate does not vanish when no human is present. On an unattended run (a routine, a dispatched worker, any session with nobody to answer), approval proceeds only under a standing mandate that covers this plan, recorded in PLAN.md's Approval: line: the mandate, who granted it and where, and the review surface that stands in for the human (for example the PR). With no such mandate, stop here and report the plan as unapproved. Listed changes stay uncleared either way ("Plan changes after the Brief", its "Unattended run" bullet). The default run above does not look for the Approval: line; the final persist step checks it with --approval-only.
Step 5: Present for Approval
The plan is a proposal, not a commitment. The user approves, modifies, or rejects it before execution begins. Unattended approval follows the Gates rule above.
Include in the presentation:
- The structured plan (Step 2, updated by Steps 3-4 if applicable)
- Blast-radius assessment (Step 3b)
- Reviewer line (Step 3):
Reviewer: ran (<reason>)orReviewer: skipped (<reason>), e.g.Reviewer: skipped (blast radius LOW, no trigger); then the stress-test summary (Step 4, if run), or "Skipped: blast radius LOW, no triggers matched", or "Skipped:plan_stress_testisreviewer" - Execution shape (Step 4.5): the four-dimension table, parallelism shape and per-phase routing table, with each
multi-shapephase's attempt constraints and selection rule. Skipped for single-phase plans - Displaced answers and new external effects ("Plan changes after the Brief"). One bullet per changed answer,
Q<N> (<plain name>): you answered <was>; the plan proposes <new>, then the new external effect and the source (reviewer fix,research update, orstress-test finding); a change with no answer behind it leads withnonein place ofQ<N>. Omit the block when empty. The approval request says one "approve" reconfirms every listed row, and a reply naming a row handles that row alone - Decisions made (gate-passed) (Step 4.6). Table per context/tag-decisions.md "Presentation contract":
Decision | What it changes in the plan | Basis (evidence) | Source, one row per gate-passed[EXEC-SHAPE]/[FALLBACK]tag and per deferred Brief question the plan resolved (Sourcedeferred Q<N>), written for a cold reader (no session shorthand). Below-bar decisions never appear here. An empty section ("no unilateral decisions. Every PLAN item traces to brief") is valid - Explicit approval request: "Approve this plan to proceed to execution, or provide feedback to revise. Anything tagged
[EXEC-SHAPE]or[FALLBACK]above is /planning:plan's discretion. Flag any you want changed." When item 5 lists rows, add: "One 'approve' also reconfirms every changed answer listed above; name a row to restore it instead." Then name each Brief deferred question still open with arbiter: USER-RESERVED, with the plan's proposal, as needing its own reply - Highest-leverage replies: close with 2-4 pre-drafted one-line revision replies, one per flagged close call or gate-passed decision, each a copyable sentence that flips exactly that decision (e.g. "Switch phase 2 to the queue-based alternative"). The user's cheapest possible reaction is pasting one back; a presentation whose flagged decisions have no pre-drafted flip line makes the user compose the revision themselves
Presentation order: tweak-likelihood first. Lead with what the user is most likely to change: data-model/schema choices, type interfaces and public APIs, and user-facing surfaces (flag close calls with their alternatives); mechanical, low-judgment work goes last. Phase execution order stays as phase_order set it in Step 2. After the presentation, offer an interactive plan view built from the draft PLAN.md (its Brief, behaviors, acceptance criteria, decisions and phases, each linked from the page, and a reply that names the phases to change, sent to this session through session-bridge when connected). PLAN.md stays the record, and the view writes nothing back to it. Build it only with ${CLAUDE_PLUGIN_ROOT}/scripts/build-view.mjs plan --record <PLAN.md>, never hand-written; it runs the shared medium resolver and publish gate with this plugin's medium option ${user_config.medium}, or "" when that reads empty or unsubstituted (never put a ${user_config.*} string in a shell command), and you print the report line it prints. Procedure and what the page shows: