Produce structured implementation plans (goal, approach, test strategy, blast radius, parallelism, approval gate before code) in PLAN.md for fresh-session handoff, plus `review` (audit existing plan) and `close-out`. Use to write implementation plan/approach ('plan this', 'architect this', 'review this plan'). Not for options: /planning:brainstorm.
$npx -y skills add melodic-software/claude-code-plugins --skill plan --agent claude-code
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Plan?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/melodic-software-plan)
---
description: "Produce structured implementation plans (goal, approach, test strategy, blast radius, parallelism, approval gate before code) in PLAN.md for fresh-session handoff, plus `review` (audit existing plan) and `close-out`. Use to write implementation plan/approach ('plan this', 'architect this', 'review this plan'). Not for options: /planning:brainstorm."
argument-hint: "[task description|review|close-out] [--unattended] [--reader guardrails|standard|step-by-step]"
user-invocable: true
disable-model-invocation: false
metadata:
workflow-stage: plan
summary: Produce a structured implementation plan with an approval gate
allowed-tools: ["Workflow(planning:plan-panel)"]
---
# Plan
**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](https://code.claude.com/docs/en/worktrees#how-claude-code-enforces-isolation)).
Keep any bound in the command's own pipe ([output limits](https://code.claude.com/docs/en/tools-reference#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](https://github.com/melodic-software/claude-code-plugins/blob/main/docs/conventions/gather-block/README.md#the-pre-compute-block-runs-as-one-shell-invocation)).
<!-- 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](https://code.claude.com/docs/en/permission-modes#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](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](https://code.claude.com/docs/en/skills#skill-content-lifecycle).
- **Reviewer.** Before presenting, dispatch a fresh-context plan-reviewer sub-agent only when the first matching rule says so: the `verification` level (Step 3) `light` or `off` skips it, unless the user's own words in this request ask for a plan review or stress-test (a `/planning:plan review` re-plan, or a request to run numbered steps, is not such a request); `plan_stress_test` (Step 3) `devils-advocate` for the draft's mode skips it; `reviewer` or `both`, or the `verification` level `strict`, runs it; under `auto` it 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 (here a `/planning:plan review` re-plan counts as asking), 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](https://code.claude.com/docs/en/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 prints `mapped=<n>` (see [context/tag-decisions.md](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](context/plan-template.md)) sits in a phase section, names a kind of `build`, `tests` or `lint`, a later `### Phase` heading to stay red until, and the failing paths or test filter: the `planned-breakage` criterion. 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; the `criteria` criterion names each id no phase satisfies (`unmapped=`), per [context/plan-template.md](context/plan-template.md) "Criterion ids". A `warning=criteria-without-ids` line means the criteria still need ids: add them, then rerun.
- **The plan opens with its behavior list**. `### Behavior` is the first `###` under `## Plan`; every criterion id is cited by a behavior or listed on its `Process criteria:` line, never both, and every behavior is delivered by a phase's `**Delivers:**` line: the `behaviors` criterion, which names each failure (`list=missing`, `list=not-first`, `uncited=`, `undelivered=`, ...) per [context/plan-template.md](context/plan-template.md) "Criterion ids". A plan with no criterion id passes it with a `warning=behaviors-without-criterion-ids` line.
- **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](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_order` step 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-tag` line, 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 reports `open=0` and `superseded=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:**
1. The structured plan (Step 2, updated by Steps 3-4 if applicable)
2. Blast-radius assessment (Step 3b)
3. Reviewer line (Step 3): `Reviewer: ran (<reason>)` or `Reviewer: 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_test` is `reviewer`"
4. **Execution shape** (Step 4.5): the four-dimension table, parallelism shape and per-phase routing table, with each `multi-shape` phase's attempt constraints and selection rule. Skipped for single-phase plans
5. **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`, or `stress-test finding`); a change with no answer behind it leads with `none` in place of `Q<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
6. **Decisions made (gate-passed)** (Step 4.6). Table per [context/tag-decisions.md](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 (Source `deferred 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
7. **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
8. **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: [`${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md`](${CLAUDE_PLUGIN_ROOT}/reference/rendered-view.md). A pasted `page-input` block follows its "Reader input". The plan view's choices are the `data-rv-choice` selects in `${CLAUDE_PLUGIN_ROOT}/skills/plan/templates/plan-view.html`; when `page-input.mjs` cannot run, Read that one file for them, and never search the plugin directory.
If 2–4 named alternatives surfaced during the stress-test, present them side by side via `AskUserQuestion` when the plugin's `use_ask_user_question` user config (`${user_config.use_ask_user_question}`; unexpanded or empty means off) is on, numbered inline prose otherwise. For open-ended approval (single proposal, no alternatives) use prose.
**After approval. Branch-name check:** verify the branch name matches the approved scope before handing off.
| Current branch | Action |
|----------------|--------|
| `main` or `master` | Stop. Cannot implement on the default branch. Suggest `git checkout -b <type>/<topic-slug>` derived from the plan topic + conventional prefix |
| Auto-generated or placeholder name | Derive the name from the plan: `<type>/<topic-slug>` (`feat/`, `fix/`, `refactor/`, `chore/`, etc.). Suggest the rename; let the user execute unless the environment is isolated (worktree or remote session), where renaming directly is safe |
| Matches a conventional prefix (`feat/`, `fix/`, etc.) | OK. No action needed |
Derive the type from plan content: new capability → `feat/`, bug fix → `fix/`, restructuring → `refactor/`, tooling/maintenance → `chore/`, docs-only → `docs/`, tests-only → `test/`, build config → `build/`, performance → `perf/`.
**After approval:** suggest the consuming environment's implementation workflow (a skill like `/implementation:implement` (if enabled) if it ships one, otherwise structured inline execution reading PLAN.md). If implementation diverges from the plan, chain back to `/planning:plan review` to re-plan rather than pushing through a broken approach.
Step 5, the approval gate, is placed with the gates above so a compaction re-attach keeps it. The approval gate is the point.
### Steps 1 to 4.6: the create route
Full planning and plan-from-a-map run Steps 1 to 4.6 before Step 4.7: read [context/create.md](context/create.md) now and follow it, in order: Step 1 (Prerequisite Check), Step 2 (Formulate the Plan), Step 3 (Plan Stress-Test), Step 3b (Assess Blast Radius), Step 4 (Formal Stress-Test and Research-Iterate), "Plan changes after the Brief", Step 4.5 (Execution-Shape Analysis) and Step 4.6 (Tag unilateral decisions). `review` and `close-out` skip it.
Step 2 starts with "Ground in consumer standards": the binding's Resolution ladder in [`${CLAUDE_PLUGIN_ROOT}/reference/standards-contract.md`](${CLAUDE_PLUGIN_ROOT}/reference/standards-contract.md), and its "Guidance layer (every rung)".
Values that spoke uses, resolved here: `<plugin-root>` is `${CLAUDE_PLUGIN_ROOT}`; `time_units` is `${user_config.time_units}`; `phase_order` is `${user_config.phase_order}`; `scaffold_stubs` is `${user_config.scaffold_stubs}`. An unexpanded value means that user layer is unset.
## Plan Mode Integration
We use built-in plan mode to keep planning from editing (what it permits: [Analyze before you edit with plan mode](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode)):
- **During formulation (Steps 1-2):** if already in plan mode when this skill triggers, stay in it
- **During stress-test (Step 4):** plan mode is appropriate
- **After approval (Step 5):** exit plan mode to begin execution. The user's approval is the gate
The skill does not enter plan mode itself; the user controls permission modes. Before planning a complex change outside plan mode, suggest it: "Consider entering plan mode for safe exploration while we design this." How the person switches modes: [Switch permission modes](https://code.claude.com/docs/en/permission-modes#switch-permission-modes).
Entering plan mode licenses a **scoping confirm**: a short round of questions that settle what this plan covers, no more than one `AskUserQuestion` call holds (the per-call question limit: <https://code.claude.com/docs/en/agent-sdk/user-input#limitations>), as one numbered round before proposing it. The round renders via `AskUserQuestion` only when the plugin's `use_ask_user_question` user config is on and the questions are independent. Inline prose otherwise.
**Substantive rounds do not belong in plan mode.** A question that resolves *what we are building* (real tradeoffs, contested requirements, anything whose answer changes the plan's shape) routes to `/planning:interview` via the Skill tool, run with **plan mode off**: that skill writes its open-question register to disk at ask time (what plan mode permits: [Analyze before you edit with plan mode](https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode)), and plan mode primes the run toward producing the plan when the job is still reaching shared understanding. **Getting there is the user's move, not yours**: when plan mode is active and a substantive round comes due, say why and ask the user to exit it, then invoke the interview once they have. Do not invoke it from inside plan mode.
## Boundary, the built-in `/plan` command
The command and this skill share a name, so "plan this" can mean either.
- **`/plan` (built-in command)**: enters plan mode. Its forms are in the `/plan` row of [All commands](https://code.claude.com/docs/en/commands#all-commands). This skill offers it to the person and never runs it.
- **This skill (marketplace plugin).** The planning discipline: stress-test, blast radius, an approval gate, and a persisted PLAN.md a cleared session can execute.
**Native suggestions** are on unless `native_suggestions` resolves `off`: a personal `<home>/planning.local.yaml` value wins over the team `<home>/planning.yaml` value (`<home>` resolved as in [`${CLAUDE_PLUGIN_ROOT}/reference/config.md`](../../reference/config.md) "Convention-home keys"), which wins over the per-user value `${user_config.native_suggestions}` (a literal unexpanded token means unset); with none set they are on. A value other than `on` or `off` is named and that layer dropped: a valid higher layer still wins, otherwise `on`, never a lower layer's value. When off, skip the offer below and write nothing in its place, not even a note that it was skipped or why.
**Routing.** Where Plan Mode Integration says to suggest plan mode, offer it to the person: If /plan is available in your session (gate basis: the records in [reference/native-plan.md](reference/native-plan.md)) and native suggestions are on (`native_suggestions`, [Configuration](../../README.md#configuration)), you can run it alongside this skill (other ways to switch modes: [Switch permission modes](https://code.claude.com/docs/en/permission-modes#switch-permission-modes)). Prefer this skill for the plan itself. When the caller passes `--unattended`, omit the offer, write `Withheld suggestion (unattended): /plan` in the output, and do not ask; without that flag it asks.
**Mutation gate.** This skill writes PLAN.md and its checklist; `/plan` changes the permission mode. This skill never toggles the mode on the person's behalf.
**Availability is never assumed.** This section states what to do when the person can run `/plan`, never that it is present. The four-part records live in [reference/native-plan.md](reference/native-plan.md).
## Boundary, the built-in `Plan` agent
Both produce an implementation plan, so "plan this" can also route to the subagent.
- **`Plan` (built-in subagent)**: reached through the Agent tool's `subagent_type`; this skill's approval gate does not apply to it. Its purpose, context and tools are in [Built-in subagents](https://code.claude.com/docs/en/sub-agents#built-in-subagents).
- **This skill (marketplace plugin)**: the plan the person approves: stress-test, blast radius, decision gates, and a persisted PLAN.md.
**Routing.** When the built-in `Plan` agent resolves in this session, dispatch it for a throwaway approach sketch or read-only context-gathering whose result feeds other work; use this skill when the plan needs the person's approval or must outlive the session. This skill may dispatch `Plan` to gather context, but the plan it presents is its own.
**Mutation gate.** This skill writes PLAN.md and its checklist; a dispatched `Plan` agent never writes them.
The four-part records live in [reference/native-plan-agent.md](reference/native-plan-agent.md).
## Plan Review Mode
Read [context/review-mode.md](context/review-mode.md) when invoked with `review`. It holds the review procedure, the re-plan branch for a review invoked after an implementation divergence, and how review differs from `/planning:devils-advocate`.
## Final step: persist the approved plan for handoff
After the user approves in Step 5, update the draft `<memory_dir>/<topic-slug>/PLAN.md` (default `.work/`; persisted at Step 4.7) with any approval-round changes and its `Approval:` line (who approved and when, or the unattended basis Step 5 names), and write each `superseded-by-plan` row's result to the ledger once the user has replied to that row (an "approve" of the request that listed it counts; reconfirmed or restored, per "Plan changes after the Brief"). The plan is not approved while any listed change lacks its reply: when an interview ledger exists, rerun `bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-open-questions.sh" --ledger <ledger>` before handing off and require exit 0 (no `open` or `superseded-by-plan` row left); with or without a ledger, a listed change still lacking its reply means asking for it and not handing off. After writing the `Approval:` line, run `bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-plan-outcome.sh" --approval-only <PLAN.md>` and require exit 0 before handoff; on an unattended run a failure means reporting the plan as unapproved. The script checks only that the line exists and its value is neither empty, the template placeholder, nor TBD; whether the recorded mandate is adequate stays a judgment.
Derive `<topic-slug>` from the task or branch name (kebab-case, ≤40 chars; shared with `/planning:prd`, `/planning:interview`, `/planning:design`); placement per the lifecycle artifact protocol [`${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md`](${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md). PLAN.md lives in the self-ignored memory slice and is never staged; paste its published copy (see "Reader depth") into the pull request body or the linked issue so reviewers see it, and refresh that paste when an implementation phase changes the plan. Every link written to the tracker (that paste, the `publish-plan` comment, a close-out paste) is the item's title linked to its absolute URL, never a bare `#<n>`, so it resolves from any page that quotes it. It is the **living source of truth** for the stage: a fresh cleared session in this checkout must be able to execute the plan reading only this file (plus the exploration and research artifacts in `<memory_dir>/<topic-slug>/`, default `.work/`). Its `## Design` section carries the design decisions, so neither that session nor a worker it dispatches needs the `design/` directory.
**Plan store.** After the `Approval:` check passes, resolve `plan_store`, lowest layer first: the default `local`; the plugin's `plan_store` user config (`${user_config.plan_store}`); then the `plan_store` key of the repository's `docs/conventions/planning.yaml`, which wins when set (schema: [`${CLAUDE_PLUGIN_ROOT}/schemas/planning.schema.json`](${CLAUDE_PLUGIN_ROOT}/schemas/planning.schema.json)). Read that key from the file in this checkout, under the same root rule as `phase_order` (Step 2); a missing file or key means the layer is unset. No `~/.claude` file, `.claude/` fallback or personal override sets this key. A user config value of `local` is reported as the default, since the two cannot be told apart, and a literal unexpanded `${user_config.plan_store}` means the user config layer is unset, not invalid. A value other than `local` or `tracker` in either layer is named with its file (or user config), key and value, and that layer is dropped: a valid higher layer still wins, with none the key is `local`, and a lower layer's value never replaces it. Report one line naming the value and its layer, e.g. `plan_store: tracker (docs/conventions/planning.yaml)`.
- `local`: nothing more; PLAN.md stays in the memory slice.
- `tracker`: publish the approved plan to the work item this session claimed (through `/work-items:work` (if enabled) or `/work-items:track start` (if enabled)) by invoking `/work-items:track publish-plan <id> <published copy>` (if enabled) through the Skill tool. That comment is the issue copy of the plan. With no claimed item, without that skill, or when `publish-plan` stops because the bound tracker cannot hold the comment, keep the plan local and say which applied. Only the approved plan is published; the Step 4.7 draft never is.
**Reader depth.** Before publishing or pasting, resolve `plan_reader`, lowest layer first: the default `step-by-step`; the plugin's `plan_reader` user config (`${user_config.plan_reader}`); the `plan_reader` key of `docs/conventions/planning.yaml`; PLAN.md's `Reader depth:` line, when an earlier publish wrote one; then a `--reader <depth>` argument on this run, which wins. Both config layers follow `plan_store`'s root rule, unset and invalid-value handling, and report line. An argument outside `guardrails`, `standard` and `step-by-step` is named and dropped the same way, so it resolves the default, not a lower layer's value. Report e.g. `plan_reader: guardrails (--reader)`, and write the value and its layer to PLAN.md's `Reader depth:` line, so close-out and a mid-flight refresh in a later session publish at the same depth. `step-by-step` publishes PLAN.md itself. `guardrails` and `standard` render `PLAN.<depth>.md` beside it, keeping its `Approval:` line, and that derived file is the published copy for `publish-plan` and the pull request paste; PLAN.md stays whole. Delete a derived file of any other depth. The sections each depth keeps: [`${CLAUDE_PLUGIN_ROOT}/skills/plan/templates/plan-md-anatomy.md`](templates/plan-md-anatomy.md) "Reader-depth renders".
**PLAN.md anatomy.** PLAN holds Brief + Design + Plan; per-phase status lives in the phase tags (`[TODO]` / `[DOING]` / `[DONE]`), never in a separate status block. Copy the skeleton from [`${CLAUDE_PLUGIN_ROOT}/skills/plan/templates/plan-md-anatomy.md`](templates/plan-md-anatomy.md) when first writing the file, the Step 4.7 draft (Read the template, then write PLAN.md with the Write tool; never `cp`, `sed` or a shell redirect from a plugin file), and read it again when a phase tag changes: it owns the section order, the tag grammar, and what each section must contain for a cleared session to execute the plan from this file alone.
PLAN.md is a multi-turn shared artifact: re-read it from disk before every write, since another turn or agent may have modified it. Prefer appending or refining sections over wholesale rewrites.
Write the plan even for small changes; only the one-sentence skip (Purpose) writes none.
**Close-out (PR time).** Read [context/close-out.md](context/close-out.md) when invoked with `close-out`. It holds the three-step procedure, the ADR handoff to `/architecture:adr` (if enabled), and the spec-container ship ritual.
**Mid-flight pivots:** when scope changes after approval, append a dated scope-change note to the affected PLAN.md section capturing the rationale, and strikethrough+link the obsolete content. PLAN.md is never committed, so these notes are its only history; re-render any derived copy ("Reader depth") and refresh the pull request body or linked issue paste so the published copy carries them (under `plan_store: tracker`, rerun `publish-plan`, which edits its comment in place). Do not silently rewrite history.
**After writing, recommend:** begin implementation in a fresh session. The implementing session reads PLAN.md for the execution roadmap. `/session-flow:workflow` (if enabled) names how that session starts (`/clear`, or on the desktop app a new session the user starts from the handoff); otherwise clear context.
## What This Skill Does Not Do
- **Does not replace `/planning:devils-advocate`**. It decides when to invoke it, based on blast radius and `plan_stress_test`
- **Does not replace research**. It uses research findings as input and may trigger more research in Step 4
- **Does not replace built-in plan mode**, a permission mode; the two complement each other
- **Does not write code**. Execution is a separate stage
- **Does not block execution or make decisions**. It structures the decision and gates on user approval; the user can always override
## Next
- The approved plan is built inline by one session: /implementation:implement.
- The execution shape routes phases to worker subagents: /implementation:implement-dispatch.
- The plan holds more than one independently shippable ticket, or a later session, an AFK lane or another person picks it up: /work-items:decompose.
## Gotchas
- **The Step 3 reviewer brief is the lever, not the step.** If the user finds a gap in 5 seconds that the fresh-context reviewer missed, tighten the reviewer brief rather than adding an inline self-critique
- **Don't skip the prerequisite check.** Plans built without exploration miss existing patterns; plans without research repeat solved mistakes. The prerequisite check is 30 seconds; the rework is 30 minutes
- **Scale the plan to the task.** A 50-line plan for a typo fix is over-engineering; a 3-bullet plan for a cross-cutting refactor is under-engineering
- **Don't confuse this skill with built-in plan mode.** If a user types "plan this", they want the discipline, not the permission mode
- **Research-iterate has a ceiling.** 3 iterations max before escalating to the user. If 3 rounds can't resolve it, the approach may need to change, not just the evidence
- **The plan is a proposal.** Never start executing without user approval
- **Step 4.5 (Execution shape) is default on for ≥2-phase plans.** Skip explicitly only for single-phase plans or trivial fixes, stated in one line
- **Open Decisions resolved before the plan body is authored.** Surfacing them mid-plan-body forces re-iteration during Step 5
- **Sanity Check criteria are mechanically verifiable.** Write the exact command a reviewer would run (grep, Read assertion, build/test exit)