Skip to content
Back to skills

Plan The Work

ASecurity

Turns a spec or refined ticket into a concrete, execution-ready implementation plan — the plan-the-work step of the spec → plan-the-work → write-the-tests → execute → review pipeline. Loads the project's skills, investigates the affected code across one or more repos, and writes an atomic, per-step plan file with no placeholders. Defines concrete per-step test coverage for the separate write-the-tests skill; never writes tests or stubs. Use when planning how to implement a ticket, epic, or sp...

  • 14 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 6, 2026
developmentgobashnodetestingrefactoringgitapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add insideout-ai/make-it-work --skill plan-the-work --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Plan The Work?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Plan The Work
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/insideout-ai-plan-the-work/badge)](https://www.skillsdirectory.com/skills/insideout-ai-plan-the-work)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: plan-the-work
description: "Turns a spec or refined ticket into a concrete, execution-ready implementation plan — the plan-the-work step of the spec → plan-the-work → write-the-tests → execute → review pipeline. Loads the project's skills, investigates the affected code across one or more repos, and writes an atomic, per-step plan file with no placeholders. Defines concrete per-step test coverage for the separate write-the-tests skill; never writes tests or stubs. Use when planning how to implement a ticket, epic, or spec before any code is written."
disable-model-invocation: true
---

# Implementation Planning Session

**Completion contract:** before claiming successful plan completion, reopen the
saved candidate and perform [bounded artifact quality review](../../docs/artifact-quality-review.md),
then save and link its review record in the final response. This applies in
Autopilot too; structural validation, writing the artifact and remembering its
contents do not substitute for review. For Implement-owned refinement only, the
parent defers spec review until TDD mode selection; Lightweight skips it. Existing
incomplete-draft/question waits remain waits rather than completed artifacts.

For generated files under `make-it-work/`, follow the [artifact naming, Git protection, usage and timing contract](../../docs/artifact-observability.md). Use helper-returned paths; new runs use `miw-` filenames and existing runs retain their saved convention. Before manually writing a new Markdown/JSON artifact, resolve its actual output with `node "<base>/../../scripts/artifact-output.mjs" resolve --root <project-root> --directory <artifact-directory-relative-to-project> --name <logical-filename>` and write/link the returned `file`/`relative`. Literal filenames below identify logical roles; do not bypass this resolver by writing those examples directly.

**Role:** Act as a senior engineer turning an agreed spec into an implementation plan another engineer (or a subagent) can execute step by step.

**Goal:** Read a spec or refined ticket, understand the requirement, load the project's own skills, investigate the real code paths that will change, and write an execution-ready plan to `make-it-work/<TICKET>/<TICKET>-plan.md`. **Define tests without writing test files, stubs or production code** — a later step implements the rest and executes the plan one atomic step at a time, so every step must be independently verifiable.

This is the planning step of a pipeline: a spec already exists (e.g. from `close-the-gaps`), and after planning/approval write-the-tests prepares coverage before execute implements it, then `review-the-code` reviews it.

**When owned by implement:** follow [ticket-scoped context discovery](../implement/references/context-discovery.md) for absent or partial go-deep context. Use available guidance and scoped code/test evidence; do not require optional go-deep files, invent missing rules, or create onboarding structure. Explicit mandatory loading gates remain binding. This overrides the go-deep layout assumptions below only for implement-owned runs and must be forwarded to nested delegates.

---

## Load the applicable guides

Resolve links in this entrypoint from this skill’s directory; links inside a guide resolve from that guide. Read only the guides required by the current route, in full before the action they govern; follow linked routes when entered. A missing required guide is a blocker, not permission to improvise.

- **Implement-owned invocation:** read [implement integration](references/implement-integration.md) before any workflow action; its overrides take precedence over standalone procedures below.
- **Effective Autopilot:** read [Autopilot policy](references/autopilot.md) before starting or making an automatic decision, including after a saved-mode change.

## Usage

```
/make-it-work:plan-the-work [TICKET-ID | path/to/spec.md] [--autopilot]
```

- Pass a ticket key (e.g. `PROJ-123`), an explicit path to a spec file, or nothing (the skill derives the key from the current branch). `--autopilot` can appear anywhere in the arguments — strip it out before resolving the ticket-key/path argument above, so a bare `--autopilot` with no other argument is treated exactly like no argument at all.
- **No `--autopilot`** — interactive. Every `AskUserQuestion` and checkpoint below pauses for a human, exactly as documented.
- **`--autopilot`** — unattended. At every interactive point below, apply the Autopilot Mode policy instead of pausing. Exception: an existing-plan-file collision (see Autopilot Mode) is never silently overwritten.

**Rules before you begin:**

- Do NOT make assumptions silently — every inference becomes an explicit line in the plan's Assumptions. The accepted refined spec defines the "what"; assumptions and technical choices may fill implementation gaps only when consistent with it. The original ticket is context, not an authority that overrides refinement.
- **Evidence for design-critical assumptions:** when a technical assumption being wrong could cause data loss, break compatibility, or invalidate substantial implementation work, inspect the relevant code, tests, or authoritative contract before treating it as established. Record the evidence and its limits in the existing Assumptions/Risks and affected steps. If still unverified, identify a bounded validation task before dependent implementation, including the observation that would require changing the approach; keep those steps blocked until the result supports them, or return an actionable blocker when validation is unavailable. Stay within planning's read-only permissions: do not perform live writes or install tooling to prove an assumption. A user-selected approach or Autopilot recommendation does not establish a technical guarantee, and mocks cannot prove an external provider's behavior. Already-supported guarantees need no redundant probe; ordinary low-risk implementation choices retain the existing Assumptions/Q&A flow. Product decisions and requirements conflicts retain their existing resolution rules.
- **Requirements conflicts:** if investigation reveals a contradiction that needs a requirements decision, stop dependent planning before writing tests/stubs for that behavior. Cite the spec criterion and evidence; return to `close-the-gaps` for explicit resolution in every autonomy mode. Do not encode a changed requirement as an Assumption or infer approval from overall plan approval. Standalone, explain the conflict and request refinement. Under `implement`, return `Spec conflict: <criterion, evidence, decision needed>` with a blocked handoff (no completed plan); the parent owns the refinement route. A technical defect with a clear solution consistent with the spec remains planning work.
- Always adhere to the coding rules and skill-loading instructions of each affected repo (its `CLAUDE.md`, `.claude/rules/`, etc.).
- Investigation is read-only. Writes are limited to planning artifacts and factual context updates under Step 5.6. Test and stub authoring belongs to write-the-tests after plan approval.

## Planning progress

Before each major activity, narrate one concrete sentence describing the upcoming work. For implement-owned runs, first read [the activity contract](../implement/references/activity.md) and save that exact sentence through its activity helper **before** the work starts. Use the supplied state path and implement directory. Standalone runs narrate in chat only; never create workflow state or a dashboard for narration, including for older implement runs without one.

Report these boundaries when applicable, in the order the work actually happens:

| Activity | Describe the upcoming work |
| --- | --- |
| Discovery | Loading relevant project guidance and tracing affected code, dependencies and existing tests. |
| Drafting | Defining or amending implementation steps and their coverage. |
| Final validation | Reviewing coverage, consistency and the plan's structural checks. |

These are activity boundaries, not new workflow phases or a fixed checklist. Coverage definition runs per step; activities can recur. Use major work chunks rather than per-tool updates or a mandatory entry for every step, and name the step/repo/behavior when useful. A sentence already covering the upcoming chunk needs no duplicate checkpoint. Skip inapplicable activities; if tests cannot run, describe checking prerequisites or recording the unavailable verification instead of claiming to run them. Keep observed results in the existing step evidence and result/transition mechanisms; an activity is not proof of success or expected red.

The same guidance applies to initial planning, replanning and amendments. For delegated work, the main session checkpoints the dispatch and keeps that description while waiting under the activity contract; delegates do not write workflow activity or dashboards. Do not invent intermediate milestones or heartbeats while a delegate runs. After its actual handback, report the next activity before continuing.

## Autopilot Mode

When `--autopilot` is effective, read this guide before Step 1 or any automatic decision/log initialization. In an implement-owned run, use the saved current mode and load it before the first automatic decision after a mode change. Never fabricate missing input or overwrite an existing standalone plan; use the guide’s non-destructive collision route. Read and follow the complete [## Autopilot Mode guide](references/autopilot.md).

## Step 1 — Locate the workspace and the spec

### 1a. Detect the repo layout

Run `pwd`, then decide whether this is a **single repo** or a **coordinated multi-repo workspace**, because it changes how many "Affected Code" sections the plan has. The distinction is not "does the parent hold other repos" — a bare folder of unrelated clones is not a workspace. It is "are these repos documented as one system": a **workspace-root orientation file** (a top-level `CLAUDE.md` / service map describing the sibling repos and how they call each other) is the signal that turns a folder of repos into a workspace.

1. **`.git` exists here.** This repo is a project root. Then:
   - If the **parent** holds a workspace-root orientation file that describes this repo as one service among siblings → you are inside one service of a multi-repo workspace; the **workspace root** is the parent (`..`).
   - Otherwise → **single-repo project**, root is here — even if the parent happens to contain other, unrelated repos.
2. **No `.git` here, but subdirectories have their own `.git`.** If a workspace-root orientation file ties them together → multi-repo workspace, root is here. If they are just unrelated clones with no unifying doc → ask the user which repo (or workspace) to plan for, rather than guessing (autopilot: see Autopilot Mode — remains a hard stop).
3. **None of these resolve** → tell the user: "Could not identify the project root. Please launch from the repo root, a service subdirectory, or the workspace root." and stop (autopilot: see Autopilot Mode — remains a hard stop).

All paths below are relative to the root identified here. In a single-repo project, "each affected repo" simply means the one repo. When unsure between single and multi, prefer single-repo and widen only if the investigation in Step 4 shows the change genuinely crosses into a sibling repo.

**Test-scope repos.** A repo named in an affected repo's test-strategy `## Test Locations` (Step 3), or explicitly confirmed as an external test location by implement's readiness report when no strategy exists, joins the plan as `` ### `<repo>` (test scope only) `` in Affected Code **only when a step writes or changes tests there**. Its root is that row's `Run from`, and its Affected Code paths are relative to that root. It never counts as a product change, and it does not turn a single-repo plan into a multi-repo workspace.

### 1b. Locate the spec

Resolve the spec from the argument. **If the argument is an explicit path to a file, use it directly, skip the rest of this resolution, and do NOT touch any issue tracker** — the MCP fallback below is reachable only when no path was given and no local spec exists.

Otherwise determine the `<TICKET>` key:

- If the argument looks like a ticket key, use it.
- If the argument is empty, derive the key from `git branch --show-current` in the current (or most recently modified) repo, e.g. `feature/PROJ-123-add-x` → `PROJ-123`.
- If no argument was given and no key can be derived from the branch (e.g. on `main` or a branch that doesn't encode a key), do not proceed with an undefined `<TICKET>`: ask the user for the ticket key or an explicit spec path, and stop until they answer (autopilot: see Autopilot Mode — remains a hard stop).

Then resolve the spec file **local-first, with an issue-tracker fallback**, using the first that exists:

1. `make-it-work/<TICKET>/<TICKET>-spec.md` — the output of `close-the-gaps` (richest spec; preferred).
2. `_specs/<TICKET>.md` — the output of a `/spec`-style step, if the project uses one.

**If neither exists, check for a pending offline refinement before falling back to the tracker:** if `make-it-work/<TICKET>/<TICKET>-questions.md` exists and its `**Status:**` marker is not `Answered` (i.e. it still reads `Awaiting Answers`), warn the user: "TICKET is mid-refinement — `make-it-work/<TICKET>/<TICKET>-questions.md` has unanswered offline questions from `close-the-gaps`." and ask them to choose: **stop here and finish `close-the-gaps <path>` first** (recommended), or **proceed anyway** using whatever ticket content can be found below. Do not continue past this check silently (autopilot: see Autopilot Mode). If the file doesn't exist, or its status is `Answered`, continue below without asking anything.

**If neither local spec file exists (or the user chose to proceed anyway above), fall back to the issue tracker:**

> **Guard:** This fallback is reachable ONLY when no explicit path was passed AND neither local spec file exists. If an explicit path was given, you already used it and stopped.

3. Fetch the ticket via whatever MCP integration is available for this project's tracker (Jira, Linear, GitHub Issues, etc.), including comments. A refined spec is often **pasted into a ticket comment** — scan comments (newest first) and pick the one carrying refinement signals: Gherkin `Scenario:` blocks, an `Acceptance Criteria` list, or a `TBD` / `Open Questions` / `Resolved Items` section.
   - If several qualify, prefer the most recent.
   - **Cache it locally:** write the chosen content to `make-it-work/<TICKET>/<TICKET>-spec.md` so it's reviewable, diffable, and not re-fetched next run. Tell the user you did this.
   - If the ticket has only a raw description with no refinement, tell the user: "No refined spec found locally or in the ticket comments. Run `close-the-gaps <TICKET>` to produce one." and stop (autopilot: see Autopilot Mode — remains a hard stop).
4. If the fetch fails (no MCP access, ticket not found), tell the user to run `close-the-gaps <TICKET>` first and stop (autopilot: see Autopilot Mode — remains a hard stop).

Read the resolved spec in full before proceeding.

**Scope check:** If the spec covers two or more independent subsystems that could be built, tested, and deployed separately, stop and suggest splitting it into one plan per subsystem — each should produce working, testable software on its own. Wait for the user to confirm before continuing (autopilot: see Autopilot Mode).

---

## Step 2 — Understand the requirement

Extract from the spec and hold onto these — they become sections of the plan. Do not proceed if a critical blocker exists.

- **Business goal** — what problem this solves and for whom.
- **Technical requirements** — what the system must do.
- **In scope / out of scope** — what is explicitly included or excluded.
- **Assumptions** — anything you are inferring that the spec does not state. List each one.
- **Open questions / blockers** — ambiguities in the spec. Stop and ask now only for *critical blockers* that make planning impossible (autopilot: see Autopilot Mode). Do not carry the rest into Step 4.5 unchanged: send each through Step 4.5's triage, where most become Assumptions or are dropped because the spec already settles them.

---

## Epic architecture context

When a refined ticket or slice explicitly links an Epic architecture document, read it before choosing the implementation approach. Carry forward applicable phase IDs, accepted responsibilities, key contracts, compatibility constraints and unresolved decisions. Keep architecture phases separate from implementation steps. Verify consequential assumptions against actual code and authoritative contracts; accepted direction is not proof of a technical guarantee. Surface material contradictions for architecture revision rather than silently choosing a conflicting design. If the link is inaccessible, state the evidence limit and block only work whose correctness depends on it. Do not require an architecture document when none was supplied.

## Step 3 — Load the project's skills

**Progress:** narrate discovery before loading guidance and investigating the affected code; checkpoint it for participating implement runs.

Read whatever orientation docs and skills each affected repo actually has — its `CLAUDE.md` or `README`, any `docs/`, architecture notes, or ADRs, and any skills it ships — plus the coding rules the plan must respect, and lean on Step 4's code investigation for anything undocumented. Do not start planning a domain or flow you have loaded no context for.

**If the project was set up with `go-deep`, expect a predictable layout** and use it directly:

- A per-repo **`CLAUDE.md`** listing a skill inventory with trigger conditions, plus the coding rules the plan must respect.
- Two orientation files — a **product** view (the business / end-to-end use-case rules) and an **architecture** view (the structural / domain rules and constraints) — typically under `.claude/rules/`.
- Two layers of skills under **`.claude/skills/`**:
  - **domain skills** — one per functional domain: the architectural invariants, data contracts, and status/state rules that domain owns.
  - **use-case skills** — one per end-to-end flow: the step-by-step behavior, field mappings, and edge cases that flow must preserve.

**Read skills with the Read tool — do NOT use the Skill tool** — so you control exactly what you pull in and when.

### Discovery (repeat for every affected repo)

0. In a multi-repo workspace, **start with the workspace-root orientation file** (if any) — the service map, shared conventions, and cross-service call flow that frame the whole plan.
1. Read the repo's **`CLAUDE.md`** for its skill inventory and trigger conditions, then the **product** and **architecture** orientation files for the use-case list and the domain list.
2. Match the ticket's key nouns, verbs, and domain terms against the skill names and descriptions. Load the relevant **domain** skills first, then the **use-case** skills whose flow overlaps the ticket. When a use-case skill references a domain skill (or vice versa), load both — cross-referenced skills carry the constraints that matter most. Load a guide only when its rules apply to the active behavior; keep adjacent guidance behind references until needed.
3. If there is no `CLAUDE.md`, list `.claude/skills/` directly — each subdirectory is a skill — and match by name/description.
4. Read the repo's **`.claude/skills/test-strategy/SKILL.md`** with the Read tool when it exists — it supplies locations, layers, commands, prerequisites, destinations and the maintained test map. Read `<base>/../../docs/test-map-contract.md` before querying/refreshing mappings. Validate registration/freshness, reuse unchanged entries and reassess affected tests/evidence. Planning reads mappings without persisting map updates; record per-test strategy layers (or `unknown`) on discovered/reassessed entries, regenerate `.claude/testing/TEST-MAP.md` per the contract, and add both paths to Affected Code or the accepted setup baseline, without adding another product/test-scope repo solely for metadata. Never modify source/tests for annotations. Missing/malformed maps under the current strategy use temporary discovery until metadata is saved. If Repo ID differs from the directory name, warn about repo resolution and continue. Older strategies without `## Test Map` need regeneration through define-test-strategy; record an Assumption and proceed using actual runner configuration, not tag guidance. Never convert or delete old testing-rule metadata.

---

## Step 4 — Investigate the codebase

For substantial delegated surveys, follow the [bounded survey handback contract](../../docs/survey-handbacks.md). Keep source read-only, save detailed evidence in an artifact and return a concise decision-focused summary with pointers, uncertainty and blockers.

**Under Implement:** Announce this investigation in chat, then copy that sentence unchanged into the activity helper in its own Bash call. For new Implement TDD runs, include `--planning-activity discovery`. Start code/guidance reads only after that call succeeds. Reusing a completed readiness baseline does not cover the later planning discovery activity.

**Investigation discipline (read first):**

- **grep before read.** To locate a symbol, `grep -n` for it and Read only the matching window — never read a large file top-to-bottom hunting for a definition.
- **Repos touched only to confirm a fact get grep-only treatment.** If you enter a repo just to answer "does X route through Y?" or "does function Z exist?", answer with a grep. Do NOT read that repo's onboarding docs (`CLAUDE.md`, `architecture.md`, `product.md`) — read those in depth only in repos that will actually change.
- **Fork substantial exploration to a subagent.** When the investigation spans multiple files, multiple loaded skills, or multiple repos — an independently reviewable unit of work, not a single targeted lookup — dispatch it to a fresh subagent (the `Explore` or `general-purpose` agent type, via the Agent tool) and work from its returned report, rather than reading every file directly in this session. A single grep-and-confirm check stays inline, same as the bullet above.
- **Write the skeleton early.** Before deep investigation, ensure a `make-it-work/<TICKET>/` directory exists at the root (create it if it doesn't). Then check whether `make-it-work/<TICKET>/<TICKET>-plan.md` already exists **from a previous run** — if it does, ask whether to overwrite, suffix (`-v2`), or abort, and resolve that before writing anything (autopilot: see Autopilot Mode). Once the target path is settled, write the skeleton with the sections you can already fill (Goal, Requirement Summary, Open Questions, a draft Affected Code table) **and the full `## Execution Status` block verbatim as given in Step 5's template — not an abbreviated form** — and mark unknowns `[INVESTIGATE: <question>]`. Then resolve only those markers. This caps scope and means a partial plan survives even if context runs out — including a died-mid-creation plan a fresh session later picks up cold, which is exactly why Execution Status must exist, in full, from the skeleton onward, not only once Step 5 fleshes the plan out.

Read the actual code paths the spec implies will change across **all affected repos**. Use Grep/Glob/Read to confirm:

**Direct impact** — what will change:

- Exact files, classes, functions, and types to modify in each repo.
- Existing patterns (architecture, logging, error handling, test structure) to follow in each repo. When the repo has a test-strategy skill, test destinations come from Where New Tests Go, including selected planned destinations that require setup. Read their Status alongside Layers; a directory choice is not evidence the layer is runnable.

**Indirect impact** — what the direct changes affect:

- Hidden dependencies, callers, shared types, and tests that will be affected. Query current test-map relationships for every touched UC/domain across all Test Locations, following How to Scan and the shared contract. Reassess affected dependencies incrementally; missing/malformed maps under the current strategy use discovery of all placements without adding annotations. Keep uncertain relationships unresolved.
- Cross-service interfaces (API contracts, event schemas, shared packages) that must stay in sync.
- Downstream consumers of the changed APIs or events.

**Codebase gaps** — distinguish missing prerequisites from observations outside this ticket's scope:

- Missing validations or invariants the spec assumes exist but do not.
- Missing test coverage on paths this ticket touches — assess it using the regression selection policy below rather than automatically adding work. With a strategy, confirm gaps across all Test Locations; distinguish unresolved/stale mappings and incomplete discovery from confirmed gaps. Absence of annotations is never a coverage gap.
- Missing logging or error handling in affected code.
- Technical debt relevant to this ticket that must be addressed.

---

## Step 4.5 — Resolve open questions & confirm approach (interactive)

`close-the-gaps` already closed the product / **"what"** gaps upstream. Planning surfaces a second layer — the **"how"**: technical and scoping decisions the spec leaves open that would change the plan materially. Resolve those with the user now, once investigation has sharpened them, rather than guessing silently.

**Triage every candidate first.** Classify each possible gap from Step 2's open questions and Step 4's findings before it can become a question:

1. **Already settled.** The spec's ACs, Decision Log, Resolved Items or TBD list already cover it. Drop it. A TBD is an accepted open item, not an invitation to ask again. Never re-ask something close-the-gaps already recorded.
2. **"What" gap.** The answer would change behavior someone can observe, or an acceptance criterion, and the spec says nothing about it. (If the spec contradicts itself or the code, that's a requirements conflict and follows **Rules before you begin**, not this triage.)
   - *Minor:* the spec's intent, an equivalent existing flow, or a loaded skill points to one behavior. Record it as an Assumption that starts with `Spec gap:`.
   - *Material:* reasonable readings of the spec lead to different user-visible behavior, and none is clearly implied. Ask it as a **Spec gap question** (below).
3. **"How" gap.** The answer changes only the implementation. Apply the asking bar below.

**Asking bar for "how" gaps.** Ask only when all three are true:

- (a) Two or more workable options differ clearly in cost, risk or how easily they can be undone.
- (b) The codebase, the loaded skills and the project's conventions don't already point to one.
- (c) A wrong choice would be expensive to undo after execution (data shape, a public contract, the order of changes across repos).

Everything else becomes an Assumption, with the reason. Most plans need one wave of questions or none. If more than 4 questions survive triage, check each against the bar again before asking.

**Build the question list.** The "how" gaps that pass the bar fall into these types:

1. **Approach** — two or more viable implementations (use the tradeoff format below).
2. **Change surface** — which modules or services have to change to meet the spec, when the investigation shows the one the spec names can't do it alone. *Whether* to widen scope is a "what" gap.
3. **Data / migration** — backfill existing rows? default for a new non-null column? migrate in place, dual-write, or lazily?
4. **Contract compatibility** — whether an existing API, event or schema can change shape or has to stay compatible, given the consumers the investigation found. Whether a consumer *should* see different behavior is a "what" gap.
5. **Placement / pattern** — where a new field, flag or config lives, and which existing pattern to follow when several compete.
6. **Missing prerequisite** — a technical prerequisite (validation, endpoint, invariant) the spec assumes exists but the code (per Codebase Gaps) does not have. If the missing piece changes what users get, it's a "what" gap.
7. **Sequencing / rollout** — feature flag? cross-repo deploy order? staged rollout?

**Spec gap questions.** Ask material "what" gaps in the same waves as the other questions:

- `header`: `Spec gap`
- `question`: `"Spec gap: <question>\n\n<what the spec leaves out, and the code evidence>"`
- `options`: the recommended behavior, labeled `(Recommended)`; one alternative; and `{ label: "Needs PM — route to close-the-gaps", description: "Pause planning for this behavior and refine the spec with close-the-gaps (offline/Slack available)." }`. Spec gap questions have no "Proceed with the recommended assumption" option.

If the user chooses to route the question, stop planning anything that depends on it, as for a requirements conflict. Standalone, tell the user to run `close-the-gaps <TICKET>` and bring the question with them. Under `implement`, return it through the existing `Spec conflict: <criterion, evidence, decision needed>` handoff.

If the user picks a behavior, record the answer in the plan's Decision Log with Gap Type `Spec gap`. Standalone runs also add a row to the spec's `## Decision Log`, marked `_(answered during planning)_`. Under `implement`, leave the spec unchanged, because `implement` owns spec revisions.

**Ask in dependency-ordered waves** (same mechanics as `close-the-gaps`): `AskUserQuestion` can batch up to 4 questions into one call, rendered as navigable tabs the user can jump between and revise before submitting — but only when those questions don't depend on each other's answers.

After identifying those semantic dependencies, use `scripts/questions.mjs waves` under [the question-helper contract](../../docs/deterministic-artifacts.md#refinement-questions) to validate IDs/cycles and compute batches; do not manually schedule the graph.

- Before asking anything, check each gap against every other pending gap: does answering one change another's wording, options, or whether it's still needed? If so, the dependent one goes in a **later** wave, never the same batch. Common dependency: a `Change surface`, `Data / migration` or `Spec gap` answer often gates the options for a later `Sequencing / rollout` question. Independent gap types (most `Placement / pattern`, `Missing prerequisite`, unrelated `Approach` choices) default to Wave 1.
- Use **`AskUserQuestion`** for gaps with pre-enumerable answers; ask a genuinely open-ended gap as one concise plain-text question instead — outside the batch (autopilot: see Autopilot Mode).
- Batch each wave's independent questions into a single `AskUserQuestion` call (≤4 per call); if a wave has more than 4, split into consecutive calls of ≤4 in that wave — order between them doesn't matter.
- Per question — `header`: a ≤12-char topic — e.g. `Approach`, `Migration`, `Surface`, `Compat`, `Rollout`, `Spec gap`.
- `question`: `"[Gap type]: [the question]\n\n[one sentence on why it changes the plan]"`.
- `options`: up to 3 substantive choices with the **recommended one first**, its label suffixed `(Recommended)` — base the recommendation on what the codebase already supports, the smallest safe scope, and the invariants in the loaded skills. For "how" gaps, always end with a final option:
  `{ label: "Proceed with the recommended assumption", description: "Don't decide now — I'll document the default choice in the plan's Assumptions." }` (autopilot: see Autopilot Mode — never auto-selected, since a substantive recommended option is always available to pick instead)
- Wait for the whole wave's answers before building the next wave. If a wave's answers open a new gap or unblock a dependent question, fold it into the next wave rather than re-opening one already asked.

**For an `Approach` gap specifically**, present the tradeoffs in full rather than as a one-line option list:

```
## Approach options

### Option A — <name>
<one-paragraph description>
**Pros:** …
**Cons:** …

### Option B — <name>
…

**Recommendation:** Option X — <one sentence why>
```

**Feed each answer into the plan:** an approach decision → the `## Approach` section; a scope / compatibility / migration / sequencing decision → the relevant Steps, Risks, or Pre-flight; a "proceed with the recommended assumption" answer → an explicit line in **Assumptions**. Additionally, record every question asked in this step — regardless of where else it fed in — into the `## Decision Log` section, in the order asked.

If no gap rises to this bar, say "No open planning questions — proceeding to draft." and continue.

---

## Step 5 — Draft the plan

**Under Implement:** Announce drafting now and checkpoint the identical sentence with `--planning-activity drafting` in a separate Bash call before resolving or writing the plan. Narrating that you are reading this skill does not announce the later drafting work.

**Progress:** narrate drafting or amendment before fleshing out the steps and coverage, following Planning progress above.

Fill in the skeleton you wrote in Step 4 at `make-it-work/<TICKET>/<TICKET>-plan.md` (the folder and any overwrite/`-v2`/abort decision were already handled there). Flesh every section out to full detail.

Guidelines:

- Reference exact file paths and function names from your investigation.
- No large code blocks — short snippets only where they clarify intent.
- Respect invariants surfaced by the loaded skills (status transitions, data-handling/compliance rules, ID/reference integrity, etc.).
- Discover the project's real **build / type-check / lint / test** commands (from `package.json` scripts, `Makefile`, `CLAUDE.md`, CI config, etc.) and use those in Verify/Pre-flight/Definition of Done — do not assume `npm`/`tsc`. When a repo has a test-strategy skill, its selected layers/destinations come from Layers and Where New Tests Go, while runnable commands come only from configured rows and Test Locations → Run from. Planned/deferred rows and Recommended Setup are not runnable command sources. Legacy layer/destination rows without Status retain their previous configured-only meaning, subject to the actual setup and Run Prerequisites.
- When `implement` supplies testing readiness, copy its per-repo `## Verification Policy` table into the plan. Active automated rows must describe actual configured tooling; a `## Recommended Setup` section is a proposal, never a source of runnable commands. Manual rows require a user's choice, an explicit project policy, or implement's recorded missing-strategy/absent-tooling `autonomy-default`. Copy that source unchanged; never create a late manual fallback. Without a strategy, use readiness's actual commands, prerequisites, test destinations and scoped code/test evidence; do not require or generate strategy/map metadata. Record the supplied setup files as an accepted baseline in Pre-flight and Affected Code; do not discard them or treat their intentional dirty worktree as a failed clean-tree check. Outside `implement`, record a policy only when the modes and manual authorization have actually been resolved; otherwise write `None` and retain legacy behavior.

### Define each step's coverage

**Regression selection: reuse first, add by justification.** Inspect relevant existing assertions and supported selectors before proposing new regression tests. Reuse adequate coverage unchanged; do not duplicate or restructure tests merely to match this plan. Missing coverage, a touched file, domain membership or an absent mapping alone does not require a new test.

For each proposed new or extended regression test, record in Regression Impact's existing **Reason / evidence** field: the existing behavior at risk, how the planned change could break it, and why existing assertions are insufficient. When important affected behavior lacks protection, select the smallest useful test through an existing interface and plan a passing pre-implementation baseline. A test depending on a future helper cannot establish that baseline. Tests of new helpers are Progression coverage even when they preserve old semantics; use an existing entry point if a regression baseline is needed.

Leave unrelated or low-value historical gaps outside the feature, with a brief reason where relevant; do not enumerate the codebase's testing debt. Document substantial test setup or refactoring explicitly in the proposed scope and use existing scope/readiness decisions. Routine selection needs no additional user confirmation. This policy does not weaken feature acceptance coverage, configured verification policies, required suites or failure triage. Select supported scoped commands, reuse command observations where adequate, and retain full-suite checks already required by the project.

Define concrete progression and regression scenarios, expected assertions, test layer, repo-relative test paths, supported selectors/commands, working directories and prerequisites. Inspect existing assertions to identify reusable coverage. Every new method, branch and enumerated error/status/fallback needs named coverage that reaches the layer owning that behavior. Stubbing, mocking or bypassing that layer covers its callers rather than the new behavior; name which layer each test exercises and stub only below it. Use selected configured layers and preserve manual-policy decisions; a required layer needing setup returns to implement's testing readiness before completing the plan.

Declare each intended test path in backticks in the step's **Tests:** field and Affected Code. Record intended progression/regression roles and expected outcomes, never an observed red/pass claim. Put every scenario in Test Plan with its originating step; preserve clause-level AC traceability. For manual/no-framework verification specify actions and expected observations. Record product repo UC/domain tokens in Domains/UCs Touched.

Write `**Test preparation contract:** 1` immediately after the plan header, outside Execution Status. After approval, `write-the-tests` authors/reuses coverage and saves observed evidence separately. Planning does not invoke that skill, run its test preparation, modify test files, update test maps, or create stubs. Required test/map/stub changes are declarations for later authorized stages. Missing behavior is an expected result, not evidence that tests have already run.

### Plan structure

Reproduce the exact structure in `references/plan-template.md` — keep every section (write "None" where empty rather than deleting it).

**Visual overview:** after What This Changes, assess whether one compact diagram would help the user understand the proposed behavior, interactions, architecture or dependencies. Follow the template's Visual Overview guidance: choose the most useful diagram type, add a short explanation, and keep editable source in a fenced `mermaid` block in the plan itself. Diagram the actual change rather than a generic spec → plan → execute workflow. A simple change may use `None — <brief reason>` instead. Keep the written plan sufficient without rendering. Do not generate images, separate diagram artifacts, install tools or add rendering dependencies. Reassess the visual on replans and amendments; update it when the proposed approach changes. Existing plans without this section remain valid; add it when revising a plan if a visual helps.

The skeleton's `## Execution Status` block starts with `Step 0 of N complete`. Once the final numbered steps are known, resolve `<base>` to this skill's directory and set the concrete total with `node "<base>/../execute/scripts/plan-status.mjs" set-total --plan "<plan path>" --total <step count>`. Use this command for the initial plan and each new replan; never hand-edit the Progress line. It preserves Mode and the completed count and rejects a shrinking total. Do not choose Mode or advance Progress here; `execute` owns those decisions and updates.
Run `set-total` as its own Bash tool call after the plan file has been saved; do not join it with a `.claude/` decision-log write or another command. If the script fails, correct the plan and rerun it before reporting the plan ready.

**No Placeholders rule** — the plan must be execution-ready. Never write:

- "TBD", "TODO", "implement later", "fill in details"
- "Add appropriate error handling / validation / handle edge cases" without specifying what
- "Write tests for the above" without naming the scenarios
- "Similar to Step N" — repeat the specifics (the executor may read steps out of order)
- Steps that say _what_ without _which file, function, and how_
- References to types/functions/methods not introduced elsewhere in the plan

---

## Step 5.5 — Self-review the plan

**Under Implement:** Before normalization, structural checks or semantic self-review, announce validation and checkpoint that identical sentence with `--planning-activity validation` in its own Bash call. Run the validation commands afterward; do not bundle them with the activity checkpoint or suppress its output.

**Progress:** narrate final validation before the structural checks and semantic coverage review.

First run `node "<base>/../../scripts/validate-plan.mjs" normalize-risk --plan "<plan path>"`, then `check --plan "<plan path>"`. Fix structural errors before returning a completed plan/handoff. This required validator owns section/step/dependency/file/scenario checks and risk arithmetic; retain the semantic coverage, naming intent and readability review below. A High calculated residual still requires the actual phasing alternative. The helper does not prove adequate behavioral coverage or resolve open decisions.

**Resolve contradictions before rating risk.** Review every Assumption and Risk against the accepted spec and its examples. If a recorded assumption predicts a different observable result, resolve the design or raise the missing product decision through refinement; documenting the mismatch or assigning Low residual risk is not a mitigation. Record the invariant, the chosen behavior and a boundary test/scenario. For date changes, distinguish a calendar date from an instant, name the authoritative timezone or date-only input, and cover a local/UTC day boundary (plus seasonal offsets when relevant). Apply the same reasoning to rounding, ordering and defaults; do not invent a timezone when the context does not establish one.

**Verification feasibility.** Identify deployment, account, integration and running-app prerequisites before adding verification steps. For an automated-policy repo, supplemental checks known to be unavailable in-session belong in `## Post-delivery Verification`, not a numbered execution step. Keep their concrete Test Plan scenarios and clause traceability, mark them not performed, and name the prerequisite and responsible actor. Do not downgrade an explicitly manual verification policy or move a required release check out of execution without authorization: surface that blocker/decision. When a layer is deferred, list exactly which clauses have only static/manual evidence. Test pure logic with existing supported tooling where practical; respect platform isolation and required duplication rather than extracting an unsupported shared helper or silently activating a deferred layer.

Before handing off, use these checks in the integrated review below:

1. **Spec coverage** — for each requirement and acceptance criterion, can you point to a step that implements it? Add steps for any gaps.
2. **Placeholder scan** — search for the anti-patterns above and fix every instance.
3. **Name and contract consistency** — do method/type/field names agree across steps? Trace each changed signature, result or prop through its immediate production and test callers; include required caller, callback-forwarding and type/context edits in the relevant step's Files. A dialog option needs the component that opens it to pass it; a direct dialog test alone does not prove that wiring.
4. **Decision Log completeness** — does every question actually asked in Step 4.5 have a row in `## Decision Log`? Add any missing rows.
5. **Readability scan** — does `## What This Changes` (and `## Approach`) stay in plain prose with no file paths, function/class/method names, or code snippets? Fix any that slipped in.
6. **Test scope** — is `## Domains/UCs Touched` filled (or `None — <reason>`)? Is every `(test scope only)` Affected Code section referenced by at least one step's `**Tests:**` line? Drop any that isn't. For test-support edits under Implement, reconcile Files/Tests and choose compatible destinations using the existing [pre-edit eligibility rules](../implement/references/planning-tests.md) before approval; listing a path alone does not establish eligibility. Use private helpers in an already permitted test file when suitable, preserving existing authorization boundaries.
7. **Behavior reachability** — for every test-required step, list each new method, branch and enumerated case in its instructions and point to the named test that runs it with its owning layer unstubbed (Step 5's point 3). Flag any step whose only tests stub, mock or bypass the layer that owns the new behavior, or that cover fewer cases than the instructions list, and add or redirect tests until each item is reached.
8. **Visual consistency** — is Visual Overview either a useful, compact Mermaid diagram with a short explanation or a justified omission? Check its labels, interactions, ordering and dependencies against the accepted requirements and final steps; refresh stale visuals on replans and amendments. Keep it readable and do not invent components or behavior for the diagram. Legacy plans need no section retrofit solely to pass validation.

Follow [bounded artifact quality review](../../docs/artifact-quality-review.md) for the plan before completion/approval. Use a fresh read-only reviewer, with the documented self-review fallback, one correction round and one confirmation review. Retain existing validation and authorization. Return unresolved blockers through the existing routes; do not emit a successful plan handoff.

---

## Step 5.6 — Context update

Skip this step silently when the project has no `go-deep` context to update (no `uc-*` / `domain-*` skills under `.claude/skills/` and no `.claude/rules/` files).

**Scope — current facts only.** Record facts about the *existing* code that Step 4's investigation confirmed and that a loaded skill or rules file states wrongly or omits: a function that moved or was renamed, an undocumented invariant, a stale file path, a caller the skill doesn't list. **Never** record the changes this plan intends to make — those enter the knowledge base only once they have actually been built.

- Record: "the refund service is now called from the nightly batch job, which the domain skill doesn't list."
- Do not record: "Step 3 will add a retry to the refund service."

**Where it goes** — follow `go-deep`'s layout and its UC-vs-domain separation and size targets:

- User-facing flow facts → the matching `uc-*` skill.
- Implementation facts (files, functions, data contracts) → the matching `domain-*` skill.
- Cross-cutting rules or constraints → `.claude/rules/product.md` or `.claude/rules/architecture.md`.

Write the updates directly, without a confirmation step. Most plans will have nothing to record; that is expected, not a gap.

---

## Step 6 — Final output

After saving and self-reviewing, respond with:

```
Ticket: <TICKET>
Spec: <resolved spec path — e.g. make-it-work/<TICKET>/<TICKET>-spec.md, _specs/<TICKET>.md, or "fetched from ticket comment, cached to make-it-work/<TICKET>/<TICKET>-spec.md">
Plan: make-it-work/<TICKET>/<TICKET>-plan.md
Repositories: <comma-separated list>
Test scope: <comma-separated test-only repos | none>
Assumptions: <count>
Open questions: <count>
Overall risk: <before mitigations> → <after mitigations>
Context updated: <each file changed in Step 5.6, with a one-line reason | none>
```

Under the output block, list every `Spec gap:` Assumption, and every Assumption that Step 4.5's triage turned into an assumption instead of a question, one line each, so the user can override any of them before running `execute`. Omit the list when there are none.

Provide a clickable Markdown link to the actual saved plan file (an absolute local path). When it includes a diagram, point the user to its **Visual Overview** section. The HTML preview renders supported Mermaid diagrams offline and provides expandable source; other Markdown viewers may show source. Do not promise inline rendering in chat. No separate image is needed.

If Overall risk (after mitigations) is High, also print the plan's `### Phasing alternative` summary in chat here — that's where the user actually decides, not buried in the file.

Then tell the user the plan is ready — this skill never drives step execution itself, so it never asks the Subagent-Driven-vs-Inline question or touches `## Execution Status` beyond the skeleton it already wrote:

**"Plan saved. Review the coverage, then run `/make-it-work:write-the-tests <plan-path>` to prepare it. After preparation succeeds, run `/make-it-work:execute <plan-path>` to implement it; execute owns the execution-mode choice and step progress."**

Leave `## Execution Status` with `Mode: Not yet chosen` and `Progress: Step 0 of <final step count> complete`, set through the status script above. `execute` owns asking for Mode (once, the first time it runs against this plan) and owns updating both Mode and Progress from that point on — `plan-the-work` never edits this section after setting its initial total, except in amend mode below.



Do not paste the full plan in chat unless the user asks.

---

## When run by implement

When called by `implement`, read this guide before root/spec resolution, readiness inspection, investigation, or writes. Standalone runs skip it. Its initial/replan/amend and caller-owned overrides apply throughout the workflow. Read and follow the complete [Implement integration guide](references/implement-integration.md).

## Coverage visibility

For fresh standalone plans and Implement states with `test_coverage_version: 1`, follow the coverage-contract fields in the plan template. Preserve existing contracts on saved runs. Trace expected changed code through domain key-code-area mappings and UC cross-references, confirm impact against callers/contracts/assertions, and record Required/Excluded/Unresolved decisions in Regression Impact. Purpose metadata explains existing selection; do not broaden testing solely for this report. Summarize progression/regression scenario counts, protected UCs and mapping limitations before implementation. Run the existing plan validator before handoff. Metadata-only errors return precise planning corrections while preserving execution progress/evidence; substantive coverage changes use existing replan rules.

Files in this skill

  • SKILL.md42.6 KB
  • references/plan-template.md8.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.