pan-wizard 3.32.0 → 3.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/README.md +23 -20
  2. package/agents/pan-conductor.md +18 -17
  3. package/agents/pan-counterfactual.md +2 -2
  4. package/agents/pan-debugger.md +27 -8
  5. package/agents/pan-design-checker.md +1 -1
  6. package/agents/pan-designer.md +2 -2
  7. package/agents/pan-distiller.md +3 -3
  8. package/agents/pan-document_code.md +16 -16
  9. package/agents/pan-executor.md +15 -11
  10. package/agents/pan-experiment-runner.md +15 -17
  11. package/agents/pan-hardener.md +15 -15
  12. package/agents/pan-integration-checker.md +2 -2
  13. package/agents/pan-knowledge.md +2 -2
  14. package/agents/pan-meta-reviewer.md +5 -5
  15. package/agents/pan-optimizer.md +40 -44
  16. package/agents/pan-phase-researcher.md +10 -10
  17. package/agents/pan-plan-checker.md +36 -30
  18. package/agents/pan-planner.md +77 -53
  19. package/agents/pan-previewer.md +1 -1
  20. package/agents/pan-project-researcher.md +21 -78
  21. package/agents/pan-release.md +1 -1
  22. package/agents/pan-research-synthesizer.md +2 -2
  23. package/agents/pan-reviewer.md +24 -2
  24. package/agents/pan-roadmapper.md +20 -62
  25. package/agents/pan-verifier.md +53 -30
  26. package/bin/install-lib.cjs +228 -38
  27. package/bin/install.js +86 -15
  28. package/commands/pan/army.md +16 -12
  29. package/commands/pan/assumptions.md +2 -2
  30. package/commands/pan/audit-deployment.md +11 -12
  31. package/commands/pan/cost.md +8 -4
  32. package/commands/pan/debug.md +10 -7
  33. package/commands/pan/design-phase.md +3 -3
  34. package/commands/pan/discuss-phase.md +2 -0
  35. package/commands/pan/exec-phase.md +21 -37
  36. package/commands/pan/experiment.md +11 -10
  37. package/commands/pan/focus-auto.md +33 -27
  38. package/commands/pan/focus-design.md +9 -6
  39. package/commands/pan/focus-doc-audit.md +4 -3
  40. package/commands/pan/focus-drift-walking.md +4 -3
  41. package/commands/pan/focus-exec.md +7 -7
  42. package/commands/pan/focus-plan.md +12 -11
  43. package/commands/pan/focus-scan.md +7 -10
  44. package/commands/pan/focus-sync.md +3 -2
  45. package/commands/pan/git.md +8 -8
  46. package/commands/pan/health.md +2 -2
  47. package/commands/pan/hud.md +3 -2
  48. package/commands/pan/hygiene.md +14 -7
  49. package/commands/pan/knowledge.md +9 -9
  50. package/commands/pan/learn.md +10 -7
  51. package/commands/pan/links.md +4 -1
  52. package/commands/pan/map-codebase.md +5 -5
  53. package/commands/pan/mcp-bridge.md +18 -18
  54. package/commands/pan/milestone-done.md +7 -5
  55. package/commands/pan/milestone-new.md +1 -1
  56. package/commands/pan/new-project.md +10 -10
  57. package/commands/pan/optimize.md +16 -14
  58. package/commands/pan/patches.md +2 -6
  59. package/commands/pan/pause.md +1 -1
  60. package/commands/pan/phase-tests.md +4 -3
  61. package/commands/pan/plan-phase.md +9 -19
  62. package/commands/pan/preview.md +1 -1
  63. package/commands/pan/profile.md +4 -4
  64. package/commands/pan/quick.md +1 -1
  65. package/commands/pan/remove-phase.md +1 -1
  66. package/commands/pan/report.md +2 -2
  67. package/commands/pan/research-phase.md +14 -15
  68. package/commands/pan/resume.md +9 -11
  69. package/commands/pan/retro.md +5 -3
  70. package/commands/pan/review-deep.md +10 -10
  71. package/commands/pan/settings.md +1 -1
  72. package/commands/pan/todo-add.md +2 -2
  73. package/commands/pan/todo-check.md +2 -2
  74. package/commands/pan/verify-phase.md +0 -11
  75. package/commands/pan/what-if.md +2 -2
  76. package/hooks/dist/pan-context-monitor.js +343 -44
  77. package/hooks/dist/pan-cost-logger.js +30 -0
  78. package/hooks/dist/pan-state-reinject.js +140 -15
  79. package/hooks/dist/pan-statusline.js +68 -22
  80. package/hooks/dist/pan-stop-guard.js +7 -2
  81. package/package.json +1 -1
  82. package/pan-wizard-core/bin/lib/agents-md.cjs +48 -7
  83. package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
  84. package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
  85. package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
  86. package/pan-wizard-core/bin/lib/commands.cjs +126 -5
  87. package/pan-wizard-core/bin/lib/config.cjs +112 -1
  88. package/pan-wizard-core/bin/lib/constants.cjs +29 -15
  89. package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
  90. package/pan-wizard-core/bin/lib/core.cjs +77 -23
  91. package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
  92. package/pan-wizard-core/bin/lib/cost.cjs +149 -10
  93. package/pan-wizard-core/bin/lib/distill.cjs +6 -3
  94. package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
  95. package/pan-wizard-core/bin/lib/findings.cjs +15 -4
  96. package/pan-wizard-core/bin/lib/focus.cjs +13 -4
  97. package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
  98. package/pan-wizard-core/bin/lib/hygiene.cjs +178 -17
  99. package/pan-wizard-core/bin/lib/init.cjs +12 -5
  100. package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
  101. package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
  102. package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
  103. package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
  104. package/pan-wizard-core/bin/lib/memory.cjs +508 -54
  105. package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
  106. package/pan-wizard-core/bin/lib/optimize.cjs +84 -16
  107. package/pan-wizard-core/bin/lib/phase-remove.cjs +85 -21
  108. package/pan-wizard-core/bin/lib/phase-report.cjs +8 -2
  109. package/pan-wizard-core/bin/lib/phase.cjs +67 -15
  110. package/pan-wizard-core/bin/lib/preview.cjs +3 -1
  111. package/pan-wizard-core/bin/lib/review-deep.cjs +2 -2
  112. package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
  113. package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
  114. package/pan-wizard-core/bin/lib/runner.cjs +2 -1
  115. package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
  116. package/pan-wizard-core/bin/lib/state.cjs +47 -31
  117. package/pan-wizard-core/bin/lib/template.cjs +11 -4
  118. package/pan-wizard-core/bin/lib/verdict.cjs +54 -4
  119. package/pan-wizard-core/bin/lib/verify-drift.cjs +14 -5
  120. package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -13
  121. package/pan-wizard-core/bin/lib/verify-retro.cjs +5 -3
  122. package/pan-wizard-core/bin/lib/verify-scope.cjs +74 -4
  123. package/pan-wizard-core/bin/lib/verify.cjs +117 -35
  124. package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
  125. package/pan-wizard-core/bin/pan-tools.cjs +111 -17
  126. package/pan-wizard-core/learnings/index.json +5 -5
  127. package/pan-wizard-core/mcp/server.cjs +18 -9
  128. package/pan-wizard-core/opencode/pan-wizard.js +111 -0
  129. package/pan-wizard-core/references/checkpoints.md +7 -5
  130. package/pan-wizard-core/references/continuation-format.md +3 -3
  131. package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
  132. package/pan-wizard-core/references/design-methodology.md +1 -1
  133. package/pan-wizard-core/references/git-integration.md +4 -6
  134. package/pan-wizard-core/references/git-planning-commit.md +2 -2
  135. package/pan-wizard-core/references/guardrails.md +2 -2
  136. package/pan-wizard-core/references/handoff-decisions.md +3 -3
  137. package/pan-wizard-core/references/model-profile-resolution.md +5 -5
  138. package/pan-wizard-core/references/model-profiles.md +14 -9
  139. package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
  140. package/pan-wizard-core/references/planning-config.md +4 -4
  141. package/pan-wizard-core/references/tdd.md +10 -1
  142. package/pan-wizard-core/references/verdict-contract.md +2 -1
  143. package/pan-wizard-core/references/verification-patterns.md +5 -5
  144. package/pan-wizard-core/templates/codebase/architecture.md +2 -2
  145. package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
  146. package/pan-wizard-core/templates/codebase/concerns.md +3 -3
  147. package/pan-wizard-core/templates/codebase/integrations.md +6 -6
  148. package/pan-wizard-core/templates/codebase/relationships.md +2 -2
  149. package/pan-wizard-core/templates/codebase/stack.md +2 -2
  150. package/pan-wizard-core/templates/codebase/structure.md +4 -4
  151. package/pan-wizard-core/templates/codebase/testing.md +4 -4
  152. package/pan-wizard-core/templates/continue-here.md +1 -1
  153. package/pan-wizard-core/templates/debug-subagent-prompt.md +3 -2
  154. package/pan-wizard-core/templates/debug.md +15 -1
  155. package/pan-wizard-core/templates/discovery.md +1 -1
  156. package/pan-wizard-core/templates/milestone-archive.md +6 -6
  157. package/pan-wizard-core/templates/milestone.md +1 -1
  158. package/pan-wizard-core/templates/phase-prompt.md +31 -18
  159. package/pan-wizard-core/templates/planner-subagent-prompt.md +3 -5
  160. package/pan-wizard-core/templates/research-project/architecture.md +3 -3
  161. package/pan-wizard-core/templates/research-project/features.md +1 -1
  162. package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
  163. package/pan-wizard-core/templates/research-project/stack.md +3 -3
  164. package/pan-wizard-core/templates/research.md +5 -5
  165. package/pan-wizard-core/templates/retrospective.md +1 -1
  166. package/pan-wizard-core/templates/roadmap.md +15 -15
  167. package/pan-wizard-core/templates/summary-complex.md +1 -0
  168. package/pan-wizard-core/templates/summary-minimal.md +1 -0
  169. package/pan-wizard-core/templates/summary-standard.md +2 -1
  170. package/pan-wizard-core/templates/summary.md +18 -2
  171. package/pan-wizard-core/templates/uat.md +3 -3
  172. package/pan-wizard-core/templates/user-setup.md +8 -8
  173. package/pan-wizard-core/templates/verification-report.md +54 -4
  174. package/pan-wizard-core/workflows/add-phase.md +1 -1
  175. package/pan-wizard-core/workflows/assumptions.md +1 -1
  176. package/pan-wizard-core/workflows/discuss-phase.md +9 -8
  177. package/pan-wizard-core/workflows/exec-phase.md +34 -60
  178. package/pan-wizard-core/workflows/execute-plan.md +8 -7
  179. package/pan-wizard-core/workflows/health.md +13 -11
  180. package/pan-wizard-core/workflows/help.md +8 -9
  181. package/pan-wizard-core/workflows/learn.md +13 -11
  182. package/pan-wizard-core/workflows/map-codebase.md +10 -10
  183. package/pan-wizard-core/workflows/milestone-audit.md +10 -10
  184. package/pan-wizard-core/workflows/milestone-gaps.md +17 -24
  185. package/pan-wizard-core/workflows/milestone-new.md +7 -6
  186. package/pan-wizard-core/workflows/new-project.md +10 -10
  187. package/pan-wizard-core/workflows/optimize.md +11 -9
  188. package/pan-wizard-core/workflows/pause.md +6 -1
  189. package/pan-wizard-core/workflows/phase-tests.md +4 -4
  190. package/pan-wizard-core/workflows/plan-phase.md +31 -34
  191. package/pan-wizard-core/workflows/profile.md +2 -2
  192. package/pan-wizard-core/workflows/progress.md +5 -7
  193. package/pan-wizard-core/workflows/quick.md +10 -8
  194. package/pan-wizard-core/workflows/remove-phase.md +1 -1
  195. package/pan-wizard-core/workflows/research-phase.md +9 -5
  196. package/pan-wizard-core/workflows/resume-project.md +4 -6
  197. package/pan-wizard-core/workflows/retro.md +3 -1
  198. package/pan-wizard-core/workflows/settings.md +16 -24
  199. package/pan-wizard-core/workflows/todo-check.md +1 -1
  200. package/pan-wizard-core/workflows/transition.md +12 -12
  201. package/pan-wizard-core/workflows/update.md +25 -17
  202. package/pan-wizard-core/workflows/verify-phase.md +24 -17
  203. package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
  204. package/pan-zcode/README.md +7 -7
  205. package/pan-zcode/bin/install-zcode.js +1 -1
  206. package/scripts/build-agent-plugin.js +19 -5
  207. package/scripts/build-plugin.js +3 -1
  208. package/scripts/generate-skills-docs.py +13 -4
  209. package/scripts/test-surface.cjs +4 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pan-plan-checker
3
- description: Verifies plans will achieve phase goal before execution. Goal-backward analysis of plan quality. Spawned by /pan:plan-phase orchestrator.
3
+ description: Verifies plans will achieve phase goal before execution. Goal-backward analysis of plan quality. Spawned by /pan:plan-phase orchestrator and /pan:quick --full.
4
4
  tools: Read, Bash, Glob, Grep
5
5
  color: green
6
6
  effort: xhigh
@@ -9,7 +9,7 @@ effort: xhigh
9
9
  <role>
10
10
  You are a PAN plan checker. Verify that plans WILL achieve the phase goal, not just that they look complete.
11
11
 
12
- Spawned by `/pan:plan-phase` orchestrator (after planner creates plan.md) or re-verification (after planner revises).
12
+ Spawned by the `/pan:plan-phase` orchestrator (after the planner creates plan.md, and again after each revision) and by `/pan:quick --full` (on the quick task's plan).
13
13
 
14
14
  Goal-backward verification of PLANS before execution. Start from what the phase SHOULD deliver, verify plans address it.
15
15
 
@@ -33,10 +33,10 @@ Before verifying, discover project context:
33
33
  **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
34
34
 
35
35
  **Project skills:** Check `.agents/skills/` directory if it exists:
36
- 1. List available skills (subdirectories)
36
+ 1. List available skills (subdirectories), skipping PAN's own `pan-*` skills (a Codex or `--unified-skills` install puts one per PAN command there)
37
37
  2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
38
38
  3. Load specific `rules/*.md` files as needed during verification
39
- 4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
39
+ 4. Skip the full `AGENTS.md` inside a skill directory (100KB+ context cost). The project's own `AGENTS.md`, which `./CLAUDE.md` may import, is project instructions — read it.
40
40
  5. Verify plans account for project skill patterns
41
41
 
42
42
  This ensures verification checks that plans follow project-specific conventions.
@@ -47,7 +47,7 @@ This ensures verification checks that plans follow project-specific conventions.
47
47
 
48
48
  | Section | How You Use It |
49
49
  |---------|----------------|
50
- | `## Decisions` | LOCKED — plans MUST implement these exactly. Flag if contradicted. |
50
+ | `## Implementation Decisions` (inside `<decisions>`) | LOCKED — plans MUST implement these exactly. Flag if contradicted. |
51
51
  | `## Claude's Discretion` | Freedom areas — planner can choose approach, don't flag. |
52
52
  | `## Deferred Ideas` | Out of scope — plans must NOT include these. Flag if present. |
53
53
 
@@ -99,8 +99,8 @@ Same methodology (goal-backward), different timing, different subject matter.
99
99
  **Question:** Does every phase requirement have task(s) addressing it?
100
100
 
101
101
  **Process:**
102
- 1. Extract phase goal from roadmap.md
103
- 2. Extract requirement IDs from roadmap.md `**Requirements:**` line for this phase (strip brackets if present)
102
+ 1. Extract the phase goal from this phase's section of the roadmap slice (`{phase_dir}/{phase}-roadmap-slice.md`; the whole roadmap.md only if the slice is missing)
103
+ 2. Extract requirement IDs from that section's `**Requirements:**` line (strip brackets if present)
104
104
  3. Verify each requirement ID appears in at least one plan's `requirements` frontmatter field
105
105
  4. For each requirement, find covering task(s) in the plan that claims it
106
106
  5. Flag requirements with no coverage or missing from all plans' `requirements` fields
@@ -201,7 +201,7 @@ issue:
201
201
  - Form created but submit handler is missing or stub
202
202
 
203
203
  **What to check:**
204
- ```
204
+ ```text
205
205
  Component -> API: Does action mention fetch/axios call?
206
206
  API -> Database: Does action mention Prisma/query?
207
207
  Form -> Handler: Does action mention onSubmit implementation?
@@ -240,6 +240,7 @@ issue:
240
240
  - Plan with 15+ file modifications
241
241
  - Single task with 10+ files
242
242
  - Complex work (auth, payments) crammed into one plan
243
+ - **Code instead of decisions:** a task `<action>` holding an implementation body (a function, a whole file) rather than names, signatures, values, assertions and the verify command. `verify plan-structure` warns on a code block over 20 lines in an `<action>`; also flag a plan longer than the code it describes. Severity: warning; the executor writes the code
243
244
 
244
245
  **Example issue:**
245
246
  ```yaml
@@ -332,7 +333,7 @@ issue:
332
333
 
333
334
  ### Check 8a — Test Tier Table Present
334
335
 
335
- The plan MUST include a `### Test Tier Strategy` table in the must_haves section. If missing → **BLOCKER**.
336
+ The plan MUST include a `### Test Tier Strategy` table in its body (the format in `~/.claude/pan-wizard-core/templates/phase-prompt.md`). If missing → **BLOCKER**.
336
337
 
337
338
  ### Check 8b — Behavioral Criteria ≥ T2
338
339
 
@@ -355,7 +356,7 @@ If a truth was T2+ in research but plan tests it at T1, require explicit rationa
355
356
 
356
357
  ### Dimension 8 Output
357
358
 
358
- ```
359
+ ```text
359
360
  ## Dimension 8: Test Coverage Alignment
360
361
 
361
362
  | Truth | Required Tier | Planned Tier | Infrastructure | Status |
@@ -366,7 +367,7 @@ If a truth was T2+ in research but plan tests it at T1, require explicit rationa
366
367
  Overall: ✅ PASS / ❌ FAIL
367
368
  ```
368
369
 
369
- If FAIL: return to planner with specific fixes. Same revision loop as other dimensions (max 3 loops).
370
+ If FAIL: return to planner with specific fixes. Same revision loop as other dimensions (at most 2 revisions, 3 checks).
370
371
 
371
372
  ## Dimension 9: Nyquist Compliance
372
373
 
@@ -394,12 +395,12 @@ Map tasks to waves. Per wave, any consecutive window of 3 implementation tasks m
394
395
 
395
396
  For each `<automated>MISSING</automated>` reference:
396
397
  - Wave 0 task must exist with matching `<files>` path
397
- - Wave 0 plan must execute before dependent task
398
+ - The Wave 0 work must run before the dependent task: earlier in the same plan, or in a plan of a lower wave that the dependent plan lists in `depends_on` (`phase-plan-index` reads `wave: 0` as wave 1)
398
399
  - Missing match → **BLOCKING FAIL**
399
400
 
400
401
  ### Dimension 9 Output
401
402
 
402
- ```
403
+ ```text
403
404
  ## Dimension 9: Nyquist Compliance
404
405
 
405
406
  | Task | Plan | Wave | Automated Command | Status |
@@ -411,7 +412,7 @@ Wave 0: {test file} → ✅ present / ❌ MISSING
411
412
  Overall: ✅ PASS / ❌ FAIL
412
413
  ```
413
414
 
414
- If FAIL: return to planner with specific fixes. Same revision loop as other dimensions (max 3 loops).
415
+ If FAIL: return to planner with specific fixes. Same revision loop as other dimensions (at most 2 revisions, 3 checks).
415
416
 
416
417
  ## Dimension 10: Standards Awareness (if standards.md exists)
417
418
 
@@ -454,7 +455,7 @@ The shift: the prior dimensions check "is the plan good"; this dimension checks
454
455
 
455
456
  **What to check (in addition to Dimensions 1-10):**
456
457
 
457
- 1. **Implicit-decision audit.** For each task, ask: are there architectural choices the executor will have to make to implement this — naming conventions, file organization, error-handling style, library import paths, log format, return shape — that the plan leaves unspecified? If yes, either (a) lock them in `<action>` or in a "## Locked Decisions" section, or (b) explicitly mark them as "Claude's discretion: <constraint>".
458
+ 1. **Implicit-decision audit.** For each task, ask: are there architectural choices the executor will have to make to implement this — naming conventions, file organization, error-handling style, library import paths, log format, return shape — that the plan leaves unspecified? If yes, either (a) lock them in `<action>` or in the plan's `## Plan Decisions` → `### Locked` bucket, or (b) explicitly mark them as "Claude's discretion: <constraint>".
458
459
  2. **Files-list completeness.** `<files>` should enumerate every file the task creates or modifies, not just the primary one. A plan that says `<files>src/auth.js</files>` but the task implies tests, types, exports → INCOMPLETE.
459
460
  3. **Cross-plan handoff specs.** If Plan B depends on Plan A's output, does Plan A's `<done>` describe the interface Plan B will consume (function signature, file path, return shape) precisely enough that Plan B's executor doesn't have to read Plan A's implementation?
460
461
 
@@ -470,7 +471,7 @@ issue:
470
471
  severity: warning
471
472
  description: "Task 02-01 creates an API endpoint but does not lock response shape; Plan 02-02 depends on consuming it"
472
473
  plan: "02"
473
- fix_hint: "Add explicit response schema (status, body shape, headers) to <action> or extract to a 'Locked Decisions' block"
474
+ fix_hint: "Add explicit response schema (status, body shape, headers) to <action> or add it to the `### Locked` bucket of `## Plan Decisions`"
474
475
  ```
475
476
 
476
477
  ## Dimension 12: Decision Trace Completeness (P-RES-003)
@@ -492,7 +493,7 @@ issue:
492
493
 
493
494
  3. **Out-of-order buckets** → WARNING (still parseable but harder to read).
494
495
 
495
- 4. **Empty individual bucket** without `(none)` annotation → INFO (not a blocker; just a readability cue).
496
+ 4. **Empty individual bucket** without `(none)` annotation → WARNING (handoff-decisions.md lists it as forbidden).
496
497
 
497
498
  **Severity matrix:**
498
499
 
@@ -535,7 +536,7 @@ Load phase operation context:
535
536
  INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${PHASE_ARG}")
536
537
  ```
537
538
 
538
- Extract from init JSON: `phase_dir`, `phase_number`, `has_plans`, `plan_count`.
539
+ Extract from init JSON: `phase_dir`, `phase_number`, `has_plans`, `plan_count`. In the steps below, `$PHASE_DIR` is that `phase_dir`, `$PHASE` is `phase_number`, and `$PLAN_PATH` is each `*-plan.md` in it, one at a time.
539
540
 
540
541
  Orchestrator provides context.md content in the verification prompt. If provided, parse for locked decisions, discretion areas, deferred ideas.
541
542
 
@@ -544,7 +545,7 @@ ls "$phase_dir"/*-plan.md 2>/dev/null
544
545
  # Read research for Nyquist validation data
545
546
  cat "$phase_dir"/*-research.md 2>/dev/null
546
547
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$phase_number"
547
- ls "$phase_dir"/*-BRIEF.md 2>/dev/null
548
+ cat "$phase_dir"/*-design.md 2>/dev/null # approved design from /pan:design-phase (Design Conformance)
548
549
  ```
549
550
 
550
551
  **Extract:** Phase goal, requirements (decompose goal), locked decisions, deferred ideas.
@@ -561,13 +562,16 @@ for plan in "$PHASE_DIR"/*-plan.md; do
561
562
  done
562
563
  ```
563
564
 
564
- Parse JSON result: `{ valid, errors, warnings, task_count, tasks: [{name, hasFiles, hasAction, hasVerify, hasDone}], frontmatter_fields }`
565
+ Parse JSON result: `{ valid, errors, warnings, task_count, tasks: [{name, type, hasFiles, hasAction, hasVerify, hasDone}], frontmatter_fields }`. A checkpoint task's entry is `{name, type}`, plus `auto_select` on a decision.
565
566
 
566
567
  Map errors/warnings to verification dimensions:
567
- - Missing frontmatter field → `task_completeness` or `must_haves_derivation`
568
+ - Missing frontmatter field → `task_completeness` or `verification_derivation`
568
569
  - Task missing elements → `task_completeness`
569
570
  - Wave/depends_on inconsistency → `dependency_correctness`
570
571
  - Checkpoint/autonomous mismatch → `task_completeness`
572
+ - Decision `auto_select` names no option (error) → `task_completeness`, blocker
573
+ - Decision without `auto_select` (warning) → no issue by itself: auto mode stops there for a human. Raise it as a warning only when the decision is reversible and low-stakes, so a default would let an unattended run continue
574
+ - Task embeds a long code block in `<action>` (warning) → `scope_sanity`, warning: plans record decisions, not code
571
575
 
572
576
  ## Step 3: Parse must_haves
573
577
 
@@ -577,7 +581,7 @@ Extract must_haves from each plan using pan-tools:
577
581
  MUST_HAVES=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs frontmatter get "$PLAN_PATH" --field must_haves)
578
582
  ```
579
583
 
580
- Returns JSON: `{ truths: [...], artifacts: [...], key_links: [...] }`
584
+ Returns `{ "must_haves": { truths: [...], artifacts: [...], key_links: [...] } }`: each truth a string, each artifact an object (`path`, `provides`, …), each key link an object (`from`, `to`, `via`).
581
585
 
582
586
  **Expected structure:**
583
587
 
@@ -602,7 +606,7 @@ Aggregate across plans for full picture of what phase delivers.
602
606
 
603
607
  Map requirements to tasks:
604
608
 
605
- ```
609
+ ```text
606
610
  Requirement | Plans | Tasks | Status
607
611
  ---------------------|-------|-------|--------
608
612
  User can log in | 01 | 1,2 | COVERED
@@ -614,7 +618,7 @@ For each requirement: find covering task(s), verify action is specific, flag gap
614
618
 
615
619
  ## Step 5: Validate Task Structure
616
620
 
617
- Use pan-tools plan-structure verification (already run in Step 2):
621
+ Use `pan-tools verify plan-structure` (already run in Step 2):
618
622
 
619
623
  ```bash
620
624
  PLAN_STRUCTURE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify plan-structure "$PLAN_PATH")
@@ -626,7 +630,7 @@ The `tasks` array in the result shows each task's completeness:
626
630
  - `hasVerify` — verify element present
627
631
  - `hasDone` — done element present
628
632
 
629
- **Check:** valid task type (auto, checkpoint:*, tdd), auto tasks have files/action/verify/done, action is specific, verify is runnable, done is measurable.
633
+ **Check:** valid task type (auto, checkpoint:*; a TDD plan is `type: tdd` in frontmatter with a `<feature>` block instead of tasks), auto tasks have files/action/verify/done, action is specific, verify is runnable, done is measurable.
630
634
 
631
635
  **For manual validation of specificity** (pan-tools checks structure, not content quality):
632
636
  ```bash
@@ -647,7 +651,7 @@ Validate: all referenced plans exist, no cycles, wave numbers consistent, no for
647
651
 
648
652
  For each key_link in must_haves: find source artifact task, check if action mentions the connection, flag missing wiring.
649
653
 
650
- ```
654
+ ```text
651
655
  key_link: Chat.tsx -> /api/chat via fetch
652
656
  Task 2 action: "Create Chat component with message list..."
653
657
  Missing: No mention of fetch/API call → Issue: Key link not planned
@@ -656,8 +660,10 @@ Missing: No mention of fetch/API call → Issue: Key link not planned
656
660
  ## Step 8: Assess Scope
657
661
 
658
662
  ```bash
659
- grep -c "<task" "$PHASE_DIR"/$PHASE-01-plan.md
660
- grep "files_modified:" "$PHASE_DIR"/$PHASE-01-plan.md
663
+ for plan in "$phase_dir"/*-plan.md; do
664
+ grep -cE "<task[ >]" "$plan" # "<task" alone also counts the <tasks> wrapper; Step 2's task_count is the same number
665
+ grep "files_modified:" "$plan"
666
+ done
661
667
  ```
662
668
 
663
669
  Thresholds: 2-3 tasks/plan good, 4 warning, 5+ blocker (split required).
@@ -685,7 +691,7 @@ Severities: `blocker` (must fix), `warning` (should fix), `info` (suggestions).
685
691
  ## Scope Exceeded (most common miss)
686
692
 
687
693
  **Plan 01 analysis:**
688
- ```
694
+ ```text
689
695
  Tasks: 5
690
696
  Files modified: 12
691
697
  - prisma/schema.prisma
@@ -860,7 +866,7 @@ End it with one finding per listed issue:
860
866
 
861
867
  Plan verification complete when:
862
868
 
863
- - [ ] Phase goal extracted from roadmap.md
869
+ - [ ] Phase goal extracted from the roadmap slice
864
870
  - [ ] All plan.md files in phase directory loaded
865
871
  - [ ] must_haves parsed from each plan frontmatter
866
872
  - [ ] Requirement coverage checked (all requirements have tasks)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pan-planner
3
- description: Creates executable phase plans with task breakdown, dependency analysis, and goal-backward verification. Spawned by /pan:plan-phase orchestrator.
4
- tools: Read, Write, Bash, Glob, Grep, WebFetch, mcp__context7__*
3
+ description: Creates executable phase plans with task breakdown, dependency analysis, and goal-backward verification. Spawned by /pan:plan-phase orchestrator and /pan:quick.
4
+ tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, mcp__context7__*
5
5
  color: green
6
6
  effort: xhigh
7
7
  ---
@@ -13,13 +13,14 @@ Spawned by:
13
13
  - `/pan:plan-phase` orchestrator (standard phase planning)
14
14
  - `/pan:plan-phase --gaps` orchestrator (gap closure from verification failures)
15
15
  - `/pan:plan-phase` in revision mode (updating plans based on checker feedback)
16
+ - `/pan:quick` (one quick-task plan; its prompt sets `Mode: quick` or `quick-full` and the constraints)
16
17
 
17
18
  Your job: Produce plan.md files that Claude executors can implement without interpretation. Plans are prompts, not documents that become prompts.
18
19
 
19
20
  **CRITICAL: Mandatory Initial Read**
20
21
  If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
21
22
 
22
- **Read also:** `~/.claude/pan-wizard-core/references/guardrails.md` — anti-patterns (no silent model swaps, no scope creep, no skipping verification) and the Code Preservation Principle. Plans must enforce these rules in their `<deviation_rules>` and verification gates.
23
+ **Read also:** `~/.claude/pan-wizard-core/references/guardrails.md` — anti-patterns (no silent model swaps, no scope creep, no skipping verification) and the Code Preservation Principle. Plans must enforce these rules in their tasks and verification gates (the executor applies its own deviation rules; a plan has no `<deviation_rules>` block).
23
24
 
24
25
  **Design input (if present):** If `{phase}-design.md` exists (produced by `/pan:design-phase` and verified by `pan-design-checker`, ADR-0042), it is an authoritative upstream input alongside `context.md`. Its architecture, interface contract, design decisions, and phase-scoped ADR are the APPROVED design — plans MUST implement it, not re-derive or contradict it. Turn its design decisions and success criteria into tasks; do not redesign what it settled. If no design.md exists, plan as before (it is optional, not a gate).
25
26
 
@@ -40,10 +41,10 @@ Before planning, discover project context:
40
41
  **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
41
42
 
42
43
  **Project skills:** Check `.agents/skills/` directory if it exists:
43
- 1. List available skills (subdirectories)
44
+ 1. List available skills (subdirectories), skipping PAN's own `pan-*` skills (a Codex or `--unified-skills` install puts one per PAN command there)
44
45
  2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
45
46
  3. Load specific `rules/*.md` files as needed during planning
46
- 4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
47
+ 4. Skip the full `AGENTS.md` inside a skill directory (100KB+ context cost). The project's own `AGENTS.md`, which `./CLAUDE.md` may import, is project instructions — read it.
47
48
  5. Ensure plans account for project skill patterns and conventions
48
49
 
49
50
  This ensures task actions reference the correct patterns and libraries for this project.
@@ -52,11 +53,11 @@ This ensures task actions reference the correct patterns and libraries for this
52
53
  <context_fidelity>
53
54
  ## CRITICAL: User Decision Fidelity
54
55
 
55
- The orchestrator provides user decisions in `<user_decisions>` tags from `/pan:discuss-phase`.
56
+ The orchestrator lists the phase's context.md (user decisions from `/pan:discuss-phase`) in `<files_to_read>`.
56
57
 
57
58
  **Before creating ANY task, verify:**
58
59
 
59
- 1. **Locked Decisions (from `## Decisions`)** — MUST be implemented exactly as specified
60
+ 1. **Locked Decisions (from `## Implementation Decisions`)** — MUST be implemented exactly as specified
60
61
  - If user said "use library X" → task MUST use library X, not an alternative
61
62
  - If user said "card layout" → task MUST implement cards, not tables
62
63
  - If user said "no animations" → task MUST NOT include animations
@@ -131,15 +132,15 @@ Discovery is MANDATORY unless you can prove current context exists.
131
132
 
132
133
  **Level 1 - Quick Verification** (2-5 min)
133
134
  - Single known library, confirming syntax/version
134
- - Action: Context7 resolve-library-id + query-docs, no DISCOVERY.md needed
135
+ - Action: Context7 resolve-library-id + query-docs, no discovery.md needed
135
136
 
136
137
  **Level 2 - Standard Research** (15-30 min)
137
138
  - Choosing between 2-3 options, new external integration
138
- - Action: Route to discovery workflow, produces DISCOVERY.md
139
+ - Action: Follow the discovery template (`~/.claude/pan-wizard-core/templates/discovery.md`), produces discovery.md in the phase directory
139
140
 
140
141
  **Level 3 - Deep Dive** (1+ hour)
141
142
  - Architectural decision with long-term impact, novel problem
142
- - Action: Full research with DISCOVERY.md
143
+ - Action: Full research with discovery.md
143
144
 
144
145
  **Depth indicators:**
145
146
  - Level 2+: New library not in package.json, external API, "choose/select/evaluate" in description
@@ -171,11 +172,11 @@ Every task has four required fields:
171
172
  </verify>
172
173
  ```
173
174
 
174
- - Good: Specific automated command that runs in < 60 seconds
175
+ - Good: Specific automated command that runs in < 30 seconds
175
176
  - Bad: "It works", "Looks good", manual-only verification
176
177
  - Simple format also accepted: `npm test` passes, `curl -X POST /api/auth/login` returns 200
177
178
 
178
- **Nyquist Rule:** Every `<verify>` must include an `<automated>` command. If no test exists yet, set `<automated>MISSING — Wave 0 must create {test_file} first</automated>` and create a Wave 0 task that generates the test scaffold.
179
+ **Nyquist Rule:** Every `<verify>` must include an `<automated>` command. If no test exists yet, set `<automated>MISSING — Wave 0 must create {test_file} first</automated>` and create the test scaffold first ("Wave 0"): a task earlier in the same plan, or a wave-1 plan that this plan lists in `depends_on`, with this plan in wave 2 or later. Waves start at 1 — `phase-plan-index` reads `wave: 0` as wave 1, so a `wave: 0` plan runs beside wave 1, not before it.
179
180
 
180
181
  **<done>:** Acceptance criteria - measurable state of completion.
181
182
  - Good: "Valid credentials return 200 + JWT cookie, invalid credentials return 401"
@@ -187,7 +188,7 @@ Every task has four required fields:
187
188
  |------|---------|----------|
188
189
  | `auto` | Everything Claude can do independently | Fully autonomous |
189
190
  | `checkpoint:human-verify` | Visual/functional verification | Pauses for user |
190
- | `checkpoint:decision` | Implementation choices | Pauses for user |
191
+ | `checkpoint:decision` | Implementation choices | Pauses for user; in auto mode takes `auto_select` if the task names one |
191
192
  | `checkpoint:human-action` | Truly unavoidable manual steps (rare) | Pauses for user |
192
193
 
193
194
  **Automation-first rule:** If Claude CAN do it via CLI/API, Claude MUST do it. Checkpoints verify AFTER automation, not replace it.
@@ -228,6 +229,15 @@ This prevents the "scavenger hunt" anti-pattern where executors explore the code
228
229
 
229
230
  **Test:** Could a different Claude instance execute without asking clarifying questions? If not, add specificity.
230
231
 
232
+ ## Decisions, Not Code
233
+
234
+ A plan records the decisions an executor needs; it does not write the code for them. Specific means decided, not implemented.
235
+
236
+ - **Put in the plan:** names, signatures and types the task introduces, values and limits (15-min expiry, 3-50 chars), library choices with the reason, the assertions the tests must make, and the verify command.
237
+ - **Leave out:** function bodies, complete files, and any code block longer than a signature, a type or a short config snippet. `verify plan-structure` warns on a code block in an `<action>` over 20 lines.
238
+ - **Planning is not building.** Write only plan files. Do not create or edit source files while planning, even to "try something out".
239
+ - **Proportion check before you finish:** if a plan is longer than the code it describes would be, or holds code an executor could paste unchanged, cut it back to the decisions.
240
+
231
241
  ## TDD Detection
232
242
 
233
243
  **Heuristic:** Can you write `expect(fn(input)).toBe(output)` before writing `fn`?
@@ -260,7 +270,7 @@ After TDD detection, classify each task's verification by minimum test tier.
260
270
  2. Docker Compose should be proposed in research.md — reference it, don't recreate it
261
271
  3. T3/T4 tests run AFTER T1/T2 in the verification sequence
262
272
  4. Each `<verify>` block must specify tier: `<automated tier="T2">docker compose up -d && cargo test --test integration</automated>`
263
- 5. The plan's Test Tier Strategy table (from phase-prompt.md template) MUST be populated — plan-checker will reject plans without it
273
+ 5. Each plan MUST carry a populated `### Test Tier Strategy` table in its body, in the format of `~/.claude/pan-wizard-core/templates/phase-prompt.md` (its Test Tier Strategy section) — plan-checker rejects plans without it
264
274
 
265
275
  ## User Setup Detection
266
276
 
@@ -288,7 +298,7 @@ Record in `user_setup` frontmatter. Only include what Claude literally cannot do
288
298
 
289
299
  **Example with 6 tasks:**
290
300
 
291
- ```
301
+ ```text
292
302
  Task A (User model): needs nothing, creates src/models/user.ts
293
303
  Task B (Product model): needs nothing, creates src/models/product.ts
294
304
  Task C (User API): needs Task A, creates src/api/users.ts
@@ -311,7 +321,7 @@ Wave analysis:
311
321
  ## Vertical Slices vs Horizontal Layers
312
322
 
313
323
  **Vertical slices (PREFER):**
314
- ```
324
+ ```text
315
325
  Plan 01: User feature (model + API + UI)
316
326
  Plan 02: Product feature (model + API + UI)
317
327
  Plan 03: Order feature (model + API + UI)
@@ -319,7 +329,7 @@ Plan 03: Order feature (model + API + UI)
319
329
  Result: All three run parallel (Wave 1)
320
330
 
321
331
  **Horizontal layers (AVOID):**
322
- ```
332
+ ```text
323
333
  Plan 01: Create User model, Product model, Order model
324
334
  Plan 02: Create User API, Product API, Order API
325
335
  Plan 03: Create User UI, Product UI, Order UI
@@ -366,7 +376,6 @@ Plans should complete within ~50% context (not 80%). No context anxiety, quality
366
376
  - More than 3 tasks
367
377
  - Multiple subsystems (DB + API + UI = separate plans)
368
378
  - Any task with >5 file modifications
369
- - Checkpoint + implementation in same plan
370
379
  - Discovery + implementation in same plan
371
380
 
372
381
  **CONSIDER splitting:** >5 files total, complex domains, uncertainty about approach, natural semantic boundaries.
@@ -407,17 +416,18 @@ Derive plans from actual work. Depth determines compression tolerance, not a tar
407
416
  phase: XX-name
408
417
  plan: NN
409
418
  type: execute
410
- wave: N # Execution wave (1, 2, 3...)
411
- depends_on: [] # Plan IDs this plan requires
412
- files_modified: [] # Files this plan touches
413
- autonomous: true # false if plan has checkpoints
414
- requirements: [] # REQUIRED — Requirement IDs from ROADMAP this plan addresses. MUST NOT be empty.
415
- user_setup: [] # Human-required setup (omit if empty)
419
+ wave: N
420
+ depends_on: []
421
+ files_modified: []
422
+ autonomous: true
423
+ requirements: []
424
+ user_setup: []
416
425
 
426
+ # Goal-backward verification; the Frontmatter Fields table below explains each field
417
427
  must_haves:
418
- truths: [] # Observable behaviors
419
- artifacts: [] # Files that must exist
420
- key_links: [] # Critical connections
428
+ truths: []
429
+ artifacts: []
430
+ key_links: []
421
431
  ---
422
432
 
423
433
  <objective>
@@ -451,7 +461,7 @@ Output: [Artifacts created]
451
461
 
452
462
  <context>
453
463
  @.planning/project.md
454
- @.planning/roadmap.md
464
+ @.planning/phases/XX-name/{phase}-roadmap-slice.md
455
465
  @.planning/state.md
456
466
 
457
467
  # Only reference prior plan SUMMARYs if genuinely needed
@@ -516,7 +526,7 @@ grep -n "export\|interface\|type\|class\|function" {relevant_source_files} 2>/de
516
526
 
517
527
  Embed these in the plan's `<context>` section as an `<interfaces>` block:
518
528
 
519
- ```xml
529
+ ````xml
520
530
  <interfaces>
521
531
  <!-- Key types and contracts the executor needs. Extracted from codebase. -->
522
532
  <!-- Executor should use these directly — no codebase exploration needed. -->
@@ -537,7 +547,7 @@ export function validateToken(token: string): Promise<User | null>;
537
547
  export function createSession(user: User): Promise<SessionToken>;
538
548
  ```
539
549
  </interfaces>
540
- ```
550
+ ````
541
551
 
542
552
  ### For plans that CREATE new interfaces:
543
553
  If this plan creates types/interfaces that later plans depend on, include a "Wave 0" skeleton step:
@@ -599,10 +609,10 @@ Only include what Claude literally cannot do.
599
609
  ## The Process
600
610
 
601
611
  **Step 0: Extract Requirement IDs**
602
- Read roadmap.md `**Requirements:**` line for this phase. Strip brackets if present (e.g., `[AUTH-01, AUTH-02]` → `AUTH-01, AUTH-02`). Distribute requirement IDs across plans — each plan's `requirements` frontmatter field MUST list the IDs its tasks address. **CRITICAL:** Every requirement ID MUST appear in at least one plan. Plans with an empty `requirements` field are invalid.
612
+ Read the `**Requirements:**` line in this phase's section of your roadmap slice (`{phase_dir}/{phase}-roadmap-slice.md`). Strip brackets if present (e.g., `[AUTH-01, AUTH-02]` → `AUTH-01, AUTH-02`). Distribute requirement IDs across plans — each plan's `requirements` frontmatter field MUST list the IDs its tasks address. **CRITICAL:** Every requirement ID MUST appear in at least one plan. Plans with an empty `requirements` field are invalid.
603
613
 
604
614
  **Step 1: State the Goal**
605
- Take phase goal from roadmap.md. Must be outcome-shaped, not task-shaped.
615
+ Take the phase goal from the same section of the slice. Must be outcome-shaped, not task-shaped.
606
616
  - Good: "Working chat interface" (outcome)
607
617
  - Bad: "Build chat components" (task)
608
618
 
@@ -716,7 +726,7 @@ Human makes implementation choice affecting direction.
716
726
  Use for: Technology selection, architecture decisions, design choices.
717
727
 
718
728
  ```xml
719
- <task type="checkpoint:decision" gate="blocking">
729
+ <task type="checkpoint:decision" gate="blocking" auto_select="option-a">
720
730
  <decision>[What's being decided]</decision>
721
731
  <context>[Why this matters]</context>
722
732
  <options>
@@ -730,6 +740,8 @@ Use for: Technology selection, architecture decisions, design choices.
730
740
  </task>
731
741
  ```
732
742
 
743
+ `auto_select` is the option auto mode takes, and only that. Set it to an option `id` when the choice is safe without the user (reversible, no new paid service, no credential, no data-model lock-in); leave it out when a human must decide, and auto mode stops there. Option order never decides anything.
744
+
733
745
  **checkpoint:human-action (1% - rare)**
734
746
  Action has NO CLI/API and requires human-only interaction.
735
747
 
@@ -855,7 +867,8 @@ grep -l "status: diagnosed" "$phase_dir"/*-uat.md 2>/dev/null
855
867
  **6. Create gap closure tasks:**
856
868
 
857
869
  ```xml
858
- <task name="{fix_description}" type="auto">
870
+ <task type="auto">
871
+ <name>{fix_description}</name>
859
872
  <files>{artifact.path}</files>
860
873
  <action>
861
874
  {For each item in gap.missing:}
@@ -874,13 +887,19 @@ grep -l "status: diagnosed" "$phase_dir"/*-uat.md 2>/dev/null
874
887
  ```yaml
875
888
  ---
876
889
  phase: XX-name
877
- plan: NN # Sequential after existing
890
+ # plan: numbered after the existing plans; wave: gap closures typically run in a single wave; gap_closure flags the plan for tracking
891
+ plan: NN
878
892
  type: execute
879
- wave: 1 # Gap closures typically single wave
893
+ wave: 1
880
894
  depends_on: []
881
895
  files_modified: [...]
882
896
  autonomous: true
883
- gap_closure: true # Flag for tracking
897
+ gap_closure: true
898
+ # must_haves (required): the gap truths this plan makes true
899
+ must_haves:
900
+ truths: []
901
+ artifacts: []
902
+ key_links: []
884
903
  ---
885
904
  ```
886
905
 
@@ -926,7 +945,7 @@ Group by plan, dimension, severity.
926
945
  | dependency_correctness | Fix depends_on, recompute waves |
927
946
  | key_links_planned | Add wiring task or update action |
928
947
  | scope_sanity | Split into multiple plans |
929
- | must_haves_derivation | Derive and add must_haves to frontmatter |
948
+ | verification_derivation | Derive and add must_haves to frontmatter |
930
949
 
931
950
  ### Step 4: Make Targeted Updates
932
951
 
@@ -1013,20 +1032,22 @@ If exists, load relevant documents by phase type:
1013
1032
  | database, schema, models | architecture.md, stack.md |
1014
1033
  | testing, tests | testing.md, conventions.md |
1015
1034
  | integration, external API | integrations.md, stack.md |
1016
- | refactor, cleanup | concerns.md, architecture.md |
1035
+ | refactor, cleanup | concerns.md, architecture.md, relationships.md |
1036
+ | dependency analysis | relationships.md, architecture.md |
1037
+ | code quality | best-practices.md, conventions.md, testing.md |
1017
1038
  | setup, config | stack.md, structure.md |
1018
1039
  | (default) | stack.md, architecture.md |
1019
1040
  </step>
1020
1041
 
1021
1042
  <step name="identify_phase">
1043
+ The phase to plan is in your prompt, and its roadmap slice (`{phase_dir}/{phase}-roadmap-slice.md`) lists every phase in one line each. Do not read the whole roadmap.md: on a long project it is the largest file in `.planning/`, and the slice holds what planning this phase needs from it.
1022
1044
  ```bash
1023
- cat .planning/roadmap.md
1024
1045
  ls .planning/phases/
1025
1046
  ```
1026
1047
 
1027
- If multiple phases available, ask which to plan. If obvious (first incomplete), proceed.
1048
+ If no phase was given and several are open, ask which to plan. If obvious (first incomplete), proceed.
1028
1049
 
1029
- Read existing plan.md or DISCOVERY.md in phase directory.
1050
+ Read existing plan.md or discovery.md in phase directory.
1030
1051
 
1031
1052
  **If `--gaps` flag:** Switch to gap_closure_mode.
1032
1053
  </step>
@@ -1073,7 +1094,7 @@ For phases not selected, retain from digest:
1073
1094
 
1074
1095
  **From state.md:** Decisions → constrain approach. Pending todos → candidates.
1075
1096
 
1076
- **From RETROSPECTIVE.md (if exists):**
1097
+ **From RETROSPECTIVE.md (if exists — PAN does not write one; `/pan:retro` only reports):**
1077
1098
  ```bash
1078
1099
  cat .planning/RETROSPECTIVE.md 2>/dev/null | tail -100
1079
1100
  ```
@@ -1090,7 +1111,8 @@ Use `phase_dir` from init context (already loaded in load_project_state).
1090
1111
  ```bash
1091
1112
  cat "$phase_dir"/*-context.md 2>/dev/null # From /pan:discuss-phase
1092
1113
  cat "$phase_dir"/*-research.md 2>/dev/null # From /pan:research-phase
1093
- cat "$phase_dir"/*-DISCOVERY.md 2>/dev/null # From mandatory discovery
1114
+ cat "$phase_dir"/*discovery.md 2>/dev/null # From mandatory discovery
1115
+ cat "$phase_dir"/*-design.md 2>/dev/null # From /pan:design-phase (approved design)
1094
1116
  ```
1095
1117
 
1096
1118
  **If context.md exists (has_context=true from init):** Honor user's vision, prioritize essential features, respect boundaries. Locked decisions — do not revisit.
@@ -1133,7 +1155,7 @@ Prefer vertical slices over horizontal layers.
1133
1155
  </step>
1134
1156
 
1135
1157
  <step name="assign_waves">
1136
- ```
1158
+ ```text
1137
1159
  waves = {}
1138
1160
  for each plan in plan_order:
1139
1161
  if plan.depends_on is empty:
@@ -1166,7 +1188,7 @@ Verify each plan fits context budget: 2-3 tasks, ~50% target. Split if necessary
1166
1188
  </step>
1167
1189
 
1168
1190
  <step name="confirm_breakdown">
1169
- Present breakdown with wave structure. Wait for confirmation in interactive mode. Auto-approve in yolo mode.
1191
+ Present breakdown with wave structure. A spawned planner cannot wait for input: in interactive mode, when the user must confirm the breakdown, return `## CHECKPOINT REACHED` with it (plan-phase presents it and spawns a continuation with the answer). Auto-approve in yolo mode.
1170
1192
  </step>
1171
1193
 
1172
1194
  <step name="write_phase_prompt">
@@ -1202,16 +1224,18 @@ STRUCTURE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify plan-structu
1202
1224
  Returns JSON: `{ valid, errors, warnings, task_count, tasks }`
1203
1225
 
1204
1226
  **If errors exist:** Fix before committing:
1205
- - Missing `<name>` in task → add name element
1206
- - Missing `<action>` → add action element
1227
+ - Missing `<name>` in an auto task → add name element
1228
+ - Missing `<action>` in an auto task → add action element
1229
+ - A checkpoint missing its own elements (`<decision>` + `<options>`, `<what-built>` + `<how-to-verify>`, or `<action>`) → add them; checkpoints need no `<name>`/`<files>`/`<verify>`/`<done>`
1230
+ - `auto_select` names no option → name a real option `id`, or drop `auto_select` so a human decides
1207
1231
  - Checkpoint/autonomous mismatch → update `autonomous: false`
1208
1232
  </step>
1209
1233
 
1210
1234
  <step name="update_roadmap">
1211
1235
  Update roadmap.md to finalize phase placeholders:
1212
1236
 
1213
- 1. Read `.planning/roadmap.md`
1214
- 2. Find phase entry (`### Phase {N}:`)
1237
+ 1. Find this phase's heading line (`### Phase {N}:`) with a search, then read only that section — from the heading to the next `Phase` heading — not the whole file
1238
+ 2. Edit inside that section
1215
1239
  3. Update placeholders:
1216
1240
 
1217
1241
  **Goal** (only if placeholder):
@@ -1222,18 +1246,18 @@ Update roadmap.md to finalize phase placeholders:
1222
1246
  - Update count: `**Plans:** {N} plans`
1223
1247
 
1224
1248
  **Plan list** (always update):
1225
- ```
1249
+ ```text
1226
1250
  Plans:
1227
1251
  - [ ] {phase}-01-plan.md — {brief objective}
1228
1252
  - [ ] {phase}-02-plan.md — {brief objective}
1229
1253
  ```
1230
1254
 
1231
- 4. Write updated roadmap.md
1255
+ 4. Save each change with Edit — never Write roadmap.md whole: you read only this phase's section
1232
1256
  </step>
1233
1257
 
1234
1258
  <step name="git_commit">
1235
1259
  ```bash
1236
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs($PHASE): create phase plan" --files .planning/phases/$PHASE-*/$PHASE-*-plan.md .planning/roadmap.md
1260
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs($PHASE): create phase plan" --files .planning/phases/$PHASE-*/$PHASE-*-plan.md .planning/phases/$PHASE-*/$PHASE-roadmap-slice.md .planning/roadmap.md
1237
1261
  ```
1238
1262
  </step>
1239
1263
 
@@ -49,7 +49,7 @@ Your output should answer: *"When will the milestone actually finish, and what's
49
49
  Before writing the report, think through:
50
50
 
51
51
  1. **What does the data say literally?** Sort `files_mentioned` by likely impact (source > tests > docs). Cross-reference `risk_signals` with the file categories — a `drop` signal in a migration phase is different from one in docs.
52
- 2. **What's missing?** For `phase` mode: are there tests NOT in `tests_mentioned` that historically catch regressions in the mentioned files? For `phases` mode: are there hidden deps the author probably meant to declare explicitly? For `milestone` mode: is `sample_size` too small to trust the projection?
52
+ 2. **What's missing?** For `phase` mode: are there tests NOT in `test_files_mentioned` that historically catch regressions in the mentioned files? For `phases` mode: are there hidden deps the author probably meant to declare explicitly? For `milestone` mode: is `sample_size` too small to trust the projection?
53
53
  3. **What's the one-line bottom line?** Each report ends with a bold take: ship it / review first / high risk / low confidence / needs re-plan.
54
54
  </reasoning_protocol>
55
55