pan-wizard 3.33.0 → 3.35.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 (214) hide show
  1. package/README.md +29 -26
  2. package/agents/pan-conductor.md +18 -17
  3. package/agents/pan-counterfactual.md +2 -2
  4. package/agents/pan-debugger.md +30 -9
  5. package/agents/pan-design-checker.md +2 -1
  6. package/agents/pan-designer.md +2 -2
  7. package/agents/pan-distiller.md +3 -3
  8. package/agents/pan-document_code.md +14 -14
  9. package/agents/pan-executor.md +30 -9
  10. package/agents/pan-experiment-runner.md +9 -8
  11. package/agents/pan-hardener.md +1 -1
  12. package/agents/pan-integration-checker.md +2 -2
  13. package/agents/pan-knowledge.md +1 -1
  14. package/agents/pan-meta-reviewer.md +4 -4
  15. package/agents/pan-optimizer.md +39 -43
  16. package/agents/pan-phase-researcher.md +10 -10
  17. package/agents/pan-plan-checker.md +37 -34
  18. package/agents/pan-planner.md +57 -44
  19. package/agents/pan-previewer.md +1 -1
  20. package/agents/pan-project-researcher.md +12 -12
  21. package/agents/pan-release.md +1 -1
  22. package/agents/pan-research-synthesizer.md +3 -3
  23. package/agents/pan-reviewer.md +26 -3
  24. package/agents/pan-roadmapper.md +15 -14
  25. package/agents/pan-verifier.md +33 -25
  26. package/bin/install-lib.cjs +176 -38
  27. package/bin/install.js +81 -63
  28. package/commands/pan/army.md +15 -11
  29. package/commands/pan/assumptions.md +2 -2
  30. package/commands/pan/audit-deployment.md +11 -12
  31. package/commands/pan/cost.md +8 -8
  32. package/commands/pan/dashboard.md +0 -3
  33. package/commands/pan/debug.md +10 -7
  34. package/commands/pan/design-phase.md +5 -5
  35. package/commands/pan/discuss-phase.md +2 -0
  36. package/commands/pan/exec-phase.md +21 -37
  37. package/commands/pan/experiment.md +9 -8
  38. package/commands/pan/focus-auto.md +22 -20
  39. package/commands/pan/focus-design.md +7 -6
  40. package/commands/pan/focus-doc-audit.md +4 -3
  41. package/commands/pan/focus-drift-walking.md +4 -3
  42. package/commands/pan/focus-exec.md +6 -6
  43. package/commands/pan/focus-plan.md +12 -11
  44. package/commands/pan/focus-scan.md +5 -3
  45. package/commands/pan/focus-sync.md +3 -2
  46. package/commands/pan/git.md +8 -8
  47. package/commands/pan/health.md +2 -2
  48. package/commands/pan/hud.md +4 -7
  49. package/commands/pan/hygiene.md +14 -7
  50. package/commands/pan/knowledge.md +9 -10
  51. package/commands/pan/learn.md +10 -7
  52. package/commands/pan/links.md +4 -1
  53. package/commands/pan/map-codebase.md +1 -1
  54. package/commands/pan/mcp-bridge.md +19 -21
  55. package/commands/pan/milestone-done.md +6 -3
  56. package/commands/pan/milestone-new.md +1 -1
  57. package/commands/pan/new-project.md +10 -10
  58. package/commands/pan/optimize.md +18 -14
  59. package/commands/pan/patches.md +2 -6
  60. package/commands/pan/pause.md +1 -1
  61. package/commands/pan/phase-tests.md +3 -2
  62. package/commands/pan/plan-phase.md +9 -19
  63. package/commands/pan/preview.md +2 -3
  64. package/commands/pan/profile.md +2 -2
  65. package/commands/pan/quick.md +1 -1
  66. package/commands/pan/remove-phase.md +1 -1
  67. package/commands/pan/report.md +3 -7
  68. package/commands/pan/research-phase.md +16 -15
  69. package/commands/pan/resume.md +9 -11
  70. package/commands/pan/retro.md +5 -3
  71. package/commands/pan/review-deep.md +7 -9
  72. package/commands/pan/settings.md +1 -1
  73. package/commands/pan/verify-phase.md +0 -11
  74. package/commands/pan/what-if.md +3 -4
  75. package/hooks/dist/pan-context-monitor.js +352 -44
  76. package/hooks/dist/pan-cost-logger.js +30 -0
  77. package/hooks/dist/pan-guard.js +244 -0
  78. package/hooks/dist/pan-statusline.js +73 -24
  79. package/hooks/dist/pan-stop-guard.js +7 -2
  80. package/package.json +1 -1
  81. package/pan-wizard-core/bin/lib/agents-md.cjs +44 -6
  82. package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
  83. package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
  84. package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
  85. package/pan-wizard-core/bin/lib/commands.cjs +57 -6
  86. package/pan-wizard-core/bin/lib/config.cjs +7 -1
  87. package/pan-wizard-core/bin/lib/constants.cjs +18 -6
  88. package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
  89. package/pan-wizard-core/bin/lib/core.cjs +53 -19
  90. package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
  91. package/pan-wizard-core/bin/lib/cost.cjs +142 -13
  92. package/pan-wizard-core/bin/lib/distill.cjs +6 -3
  93. package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
  94. package/pan-wizard-core/bin/lib/findings.cjs +135 -21
  95. package/pan-wizard-core/bin/lib/focus.cjs +13 -4
  96. package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
  97. package/pan-wizard-core/bin/lib/hygiene.cjs +184 -17
  98. package/pan-wizard-core/bin/lib/init.cjs +13 -4
  99. package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
  100. package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
  101. package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
  102. package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
  103. package/pan-wizard-core/bin/lib/memory.cjs +508 -54
  104. package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
  105. package/pan-wizard-core/bin/lib/optimize.cjs +97 -17
  106. package/pan-wizard-core/bin/lib/phase-gate.cjs +174 -0
  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 +39 -13
  110. package/pan-wizard-core/bin/lib/preview.cjs +34 -31
  111. package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
  112. package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
  113. package/pan-wizard-core/bin/lib/runner.cjs +2 -1
  114. package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
  115. package/pan-wizard-core/bin/lib/state.cjs +43 -28
  116. package/pan-wizard-core/bin/lib/template.cjs +11 -4
  117. package/pan-wizard-core/bin/lib/verdict.cjs +140 -10
  118. package/pan-wizard-core/bin/lib/verify-integrity.cjs +181 -0
  119. package/pan-wizard-core/bin/lib/verify-plan-set.cjs +230 -0
  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 +11 -7
  123. package/pan-wizard-core/bin/lib/verify.cjs +30 -28
  124. package/pan-wizard-core/bin/lib/whatif.cjs +53 -9
  125. package/pan-wizard-core/bin/pan-tools.cjs +114 -19
  126. package/pan-wizard-core/learnings/index.json +5 -5
  127. package/pan-wizard-core/mcp/merge-gate.cjs +14 -3
  128. package/pan-wizard-core/mcp/native-tools.cjs +3 -3
  129. package/pan-wizard-core/opencode/pan-wizard.js +139 -0
  130. package/pan-wizard-core/references/checkpoints.md +3 -3
  131. package/pan-wizard-core/references/continuation-format.md +3 -3
  132. package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
  133. package/pan-wizard-core/references/design-methodology.md +1 -1
  134. package/pan-wizard-core/references/git-integration.md +4 -6
  135. package/pan-wizard-core/references/git-planning-commit.md +2 -2
  136. package/pan-wizard-core/references/guardrails.md +2 -2
  137. package/pan-wizard-core/references/handoff-decisions.md +3 -3
  138. package/pan-wizard-core/references/model-profile-resolution.md +5 -5
  139. package/pan-wizard-core/references/model-profiles.md +15 -10
  140. package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
  141. package/pan-wizard-core/references/planning-config.md +7 -7
  142. package/pan-wizard-core/references/tdd.md +10 -1
  143. package/pan-wizard-core/references/verdict-contract.md +6 -1
  144. package/pan-wizard-core/references/verification-patterns.md +5 -5
  145. package/pan-wizard-core/templates/codebase/architecture.md +2 -2
  146. package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
  147. package/pan-wizard-core/templates/codebase/concerns.md +3 -3
  148. package/pan-wizard-core/templates/codebase/integrations.md +6 -6
  149. package/pan-wizard-core/templates/codebase/relationships.md +2 -2
  150. package/pan-wizard-core/templates/codebase/stack.md +2 -2
  151. package/pan-wizard-core/templates/codebase/structure.md +4 -4
  152. package/pan-wizard-core/templates/codebase/testing.md +4 -4
  153. package/pan-wizard-core/templates/config.json +2 -6
  154. package/pan-wizard-core/templates/continue-here.md +1 -1
  155. package/pan-wizard-core/templates/debug-subagent-prompt.md +5 -3
  156. package/pan-wizard-core/templates/debug.md +15 -1
  157. package/pan-wizard-core/templates/milestone-archive.md +6 -6
  158. package/pan-wizard-core/templates/milestone.md +1 -1
  159. package/pan-wizard-core/templates/phase-prompt.md +31 -17
  160. package/pan-wizard-core/templates/planner-subagent-prompt.md +5 -5
  161. package/pan-wizard-core/templates/preview-report.md +1 -1
  162. package/pan-wizard-core/templates/research-project/architecture.md +3 -3
  163. package/pan-wizard-core/templates/research-project/features.md +1 -1
  164. package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
  165. package/pan-wizard-core/templates/research-project/stack.md +3 -3
  166. package/pan-wizard-core/templates/research.md +5 -5
  167. package/pan-wizard-core/templates/retrospective.md +1 -1
  168. package/pan-wizard-core/templates/roadmap.md +15 -15
  169. package/pan-wizard-core/templates/state.md +4 -4
  170. package/pan-wizard-core/templates/summary-complex.md +1 -0
  171. package/pan-wizard-core/templates/summary-minimal.md +1 -0
  172. package/pan-wizard-core/templates/summary-standard.md +2 -1
  173. package/pan-wizard-core/templates/summary.md +18 -2
  174. package/pan-wizard-core/templates/uat.md +3 -3
  175. package/pan-wizard-core/templates/user-setup.md +8 -8
  176. package/pan-wizard-core/templates/verification-report.md +53 -8
  177. package/pan-wizard-core/workflows/add-phase.md +1 -1
  178. package/pan-wizard-core/workflows/assumptions.md +1 -1
  179. package/pan-wizard-core/workflows/diagnose-issues.md +4 -4
  180. package/pan-wizard-core/workflows/discuss-phase.md +10 -8
  181. package/pan-wizard-core/workflows/exec-phase.md +75 -95
  182. package/pan-wizard-core/workflows/execute-plan.md +8 -7
  183. package/pan-wizard-core/workflows/health.md +13 -12
  184. package/pan-wizard-core/workflows/help.md +8 -9
  185. package/pan-wizard-core/workflows/learn.md +13 -11
  186. package/pan-wizard-core/workflows/map-codebase.md +10 -10
  187. package/pan-wizard-core/workflows/milestone-audit.md +10 -10
  188. package/pan-wizard-core/workflows/milestone-gaps.md +18 -25
  189. package/pan-wizard-core/workflows/milestone-new.md +7 -6
  190. package/pan-wizard-core/workflows/new-project.md +17 -25
  191. package/pan-wizard-core/workflows/optimize.md +11 -9
  192. package/pan-wizard-core/workflows/pause.md +6 -1
  193. package/pan-wizard-core/workflows/phase-tests.md +4 -4
  194. package/pan-wizard-core/workflows/plan-phase.md +53 -42
  195. package/pan-wizard-core/workflows/profile.md +2 -2
  196. package/pan-wizard-core/workflows/progress.md +6 -8
  197. package/pan-wizard-core/workflows/quick.md +7 -5
  198. package/pan-wizard-core/workflows/remove-phase.md +1 -1
  199. package/pan-wizard-core/workflows/research-phase.md +9 -5
  200. package/pan-wizard-core/workflows/resume-project.md +4 -6
  201. package/pan-wizard-core/workflows/retro.md +3 -1
  202. package/pan-wizard-core/workflows/settings.md +16 -24
  203. package/pan-wizard-core/workflows/todo-check.md +4 -3
  204. package/pan-wizard-core/workflows/transition.md +16 -12
  205. package/pan-wizard-core/workflows/update.md +25 -17
  206. package/pan-wizard-core/workflows/verify-phase.md +22 -20
  207. package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
  208. package/pan-zcode/README.md +7 -7
  209. package/pan-zcode/bin/install-zcode.js +1 -1
  210. package/scripts/build-hooks.js +1 -0
  211. package/scripts/build-plugin.js +3 -1
  212. package/scripts/generate-skills-docs.py +15 -6
  213. package/scripts/prompt-lint.cjs +167 -0
  214. package/scripts/test-surface.cjs +1 -0
@@ -7,7 +7,7 @@ effort: medium
7
7
  ---
8
8
 
9
9
  <role>
10
- You are a PAN project researcher spawned by `/pan:new-project` or `/pan:milestone-new` (Phase 6: Research).
10
+ You are a PAN project researcher spawned by `/pan:new-project` or `/pan:milestone-new` (at their Research Decision step: 6 in new-project, 8 in milestone-new).
11
11
 
12
12
  Answer "What does this domain ecosystem look like?" Write research files in `.planning/research/` that inform roadmap creation.
13
13
 
@@ -77,7 +77,7 @@ Don't find articles supporting your initial guess — find what the ecosystem ac
77
77
  ### 1. Context7 (highest priority) — Library Questions
78
78
  Authoritative, current, version-aware documentation.
79
79
 
80
- ```
80
+ ```text
81
81
  1. mcp__context7__resolve-library-id with libraryName: "[library]"
82
82
  2. mcp__context7__query-docs with libraryId: [resolved ID], query: "[question]"
83
83
  ```
@@ -93,7 +93,7 @@ Use exact URLs (not search result pages). Check publication dates. Prefer /docs/
93
93
  For finding what exists, community patterns, real-world usage.
94
94
 
95
95
  **Query templates:**
96
- ```
96
+ ```text
97
97
  Ecosystem: "[tech] best practices [current year]", "[tech] recommended libraries [current year]"
98
98
  Patterns: "how to build [type] with [tech]", "[tech] architecture patterns"
99
99
  Problems: "[tech] common mistakes", "[tech] gotchas"
@@ -103,7 +103,7 @@ Always include current year. Use multiple query variations. Mark WebSearch-only
103
103
 
104
104
  ### Enhanced Web Search (Brave API)
105
105
 
106
- Check `brave_search` from orchestrator context. If `true`, use Brave Search for higher quality results:
106
+ If your prompt says `brave_search: true` (new-project and milestone-new do not pass it today), use Brave Search for higher quality results:
107
107
 
108
108
  ```bash
109
109
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs websearch "your query" --limit 10
@@ -111,7 +111,7 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs websearch "your query" --limit
111
111
 
112
112
  **Options:**
113
113
  - `--limit N` — Number of results (default: 10)
114
- - `--freshness day|week|month` — Restrict to recent content
114
+ - `--freshness day|week|month|year` — Restrict to recent content
115
115
 
116
116
  If `brave_search: false` (or not set), use built-in WebSearch tool instead.
117
117
 
@@ -121,7 +121,7 @@ Brave Search provides an independent index (not Google/Bing dependent) with less
121
121
 
122
122
  **WebSearch findings must be verified:**
123
123
 
124
- ```
124
+ ```text
125
125
  For each finding:
126
126
  1. Verify with Context7? YES → HIGH confidence
127
127
  2. Verify with official docs? YES → MEDIUM confidence
@@ -241,7 +241,7 @@ Services required for integration and E2E testing:
241
241
 
242
242
  **Docker Compose proposal** (for project-wide test infrastructure):
243
243
 
244
- ```yaml
244
+ \`\`\`yaml
245
245
  # test-infrastructure
246
246
  services:
247
247
  [service]:
@@ -251,7 +251,7 @@ services:
251
251
  test: [command]
252
252
  interval: 5s
253
253
  retries: 3
254
- ```
254
+ \`\`\`
255
255
 
256
256
  *(If project only needs unit tests: "None identified — reassess when integration phases begin")*
257
257
  ```
@@ -290,9 +290,9 @@ Features to explicitly NOT build.
290
290
 
291
291
  ## Feature Dependencies
292
292
 
293
- ```
293
+ \`\`\`
294
294
  Feature A → Feature B (B requires A)
295
- ```
295
+ \`\`\`
296
296
 
297
297
  ## MVP Recommendation
298
298
 
@@ -508,7 +508,7 @@ The other researchers write the other dimensions in parallel, and pan-research-s
508
508
 
509
509
  ## Step 6: Return Structured Result
510
510
 
511
- **DO NOT commit.** Spawned in parallel with other researchers. Orchestrator commits after all complete.
511
+ **DO NOT commit.** Spawned in parallel with other researchers. pan-research-synthesizer commits `.planning/research/` after all complete.
512
512
 
513
513
  </execution_flow>
514
514
 
@@ -588,7 +588,7 @@ Research is complete when:
588
588
  - [ ] All findings have confidence levels
589
589
  - [ ] Output files created in `.planning/research/`
590
590
  - [ ] Roadmap implications included in the structured return
591
- - [ ] Files written (DO NOT commit — orchestrator handles this)
591
+ - [ ] Files written (DO NOT commit — pan-research-synthesizer commits `.planning/research/`)
592
592
  - [ ] Structured return provided to orchestrator
593
593
 
594
594
  **Quality:** Comprehensive not shallow. Opinionated not wishy-washy. Verified not assumed. Honest about gaps. Actionable for roadmap. Current (year in searches).
@@ -2,7 +2,7 @@
2
2
  name: pan-release
3
3
  description: Release squad agent for the bot-army campaign. Ships approved, green work safely behind a human gate — squash-merge intent, tag, deploy hand-off, and fast rollback. Never merges to a protected branch itself; surfaces an always-ask approval request instead.
4
4
  tools: Read, Grep, Glob, Bash
5
- color: amber
5
+ color: orange
6
6
  effort: high
7
7
  ---
8
8
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pan-research-synthesizer
3
- description: Synthesizes research outputs from parallel researcher agents into summary.md. Spawned by /pan:new-project after 4 researcher agents complete.
3
+ description: Synthesizes research outputs from parallel researcher agents into summary.md. Spawned by /pan:new-project or /pan:milestone-new after 4 researcher agents complete.
4
4
  tools: Read, Write, Bash
5
5
  color: purple
6
6
  effort: medium
@@ -11,7 +11,7 @@ You are a PAN research synthesizer. You read the outputs from 4 parallel researc
11
11
 
12
12
  You are spawned by:
13
13
 
14
- - `/pan:new-project` orchestrator (after STACK, FEATURES, ARCHITECTURE, PITFALLS research completes)
14
+ - `/pan:new-project` or `/pan:milestone-new` orchestrator (after STACK, FEATURES, ARCHITECTURE, PITFALLS research completes)
15
15
 
16
16
  Your job: Create a unified research summary that informs roadmap creation. Extract key findings, identify patterns across research files, and produce roadmap implications.
17
17
 
@@ -59,7 +59,7 @@ cat .planning/research/features.md
59
59
  cat .planning/research/architecture.md
60
60
  cat .planning/research/pitfalls.md
61
61
 
62
- # Planning config loaded via pan-tools.cjs in commit step
62
+ # The commit step loads the planning config through pan-tools
63
63
  ```
64
64
 
65
65
  Parse each file to extract:
@@ -26,7 +26,7 @@ Before reviewing, discover project context:
26
26
  **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
27
27
 
28
28
  **Project skills:** Check `.agents/skills/` directory if it exists:
29
- 1. List available skills (subdirectories)
29
+ 1. List available skills (subdirectories), skipping PAN's own `pan-*` skills (a Codex or `--unified-skills` install puts one per PAN command there)
30
30
  2. Read `SKILL.md` for each skill
31
31
  3. Load specific `rules/*.md` files as needed during review
32
32
  4. Apply skill rules when checking conventions and quality
@@ -45,7 +45,7 @@ Discover project-specific conventions from these sources (in priority order):
45
45
 
46
46
  **CRITICAL: Project Scope Boundary**
47
47
  These directories are PAN Wizard infrastructure — NEVER review, flag, or suggest changes to files inside them:
48
- - `.claude/`, `.github/copilot-instructions.md`, `.opencode/`, `.gemini/`, `.codex/`
48
+ - `.claude/`, `.codex/`, `.gemini/`, `.opencode/`, `.agents/`, and PAN's files under `.github/`: `pan-wizard-core/`, `pan-local-patches/`, the `pan-*` entries in `agents/`, `skills/` and `hooks/`, `hooks/pan.json`, `package.json` and `pan-file-manifest.json`
49
49
  If a changed file path starts with any of these prefixes, **skip it silently**.
50
50
 
51
51
  ## Security Patterns
@@ -69,6 +69,28 @@ If a changed file path starts with any of these prefixes, **skip it silently**.
69
69
  | Duplicate code | > 10 identical lines across files | INFO |
70
70
  | TODO/FIXME/HACK | New instances added in this phase | INFO |
71
71
 
72
+ ## Design smells (baseline)
73
+
74
+ A fixed baseline that applies even when the project documents no standards (Fowler, *Refactoring*, ch. 3). Rules:
75
+ - Each is a judgement call: always **INFO**, written as "possible <smell>", never a reason for a non-PASS verdict on its own; its Category is `Design smell`.
76
+ - **The project wins.** Where a documented project standard, or an established pattern in the code, endorses what a smell would flag, do not report it. Skip anything a linter or formatter already enforces.
77
+ - Only for code this phase changed, and only with a file:line and the hunk that shows it.
78
+
79
+ | Smell | What it looks like in the diff | Usual fix |
80
+ |-------|-------------------------------|-----------|
81
+ | Mysterious Name | A name that does not say what it does or holds | Rename; if no honest name comes, the design is unclear |
82
+ | Duplicated Code | The same logic shape in more than one hunk or file | Extract it and call it from both |
83
+ | Feature Envy | A function reaching into another object's data more than its own | Move it onto the data it uses |
84
+ | Data Clumps | The same few fields or parameters always travelling together | Bundle them into one type |
85
+ | Primitive Obsession | A string or number standing in for a domain concept | Give the concept a small type |
86
+ | Repeated Switches | The same switch or if-chain on the same type in several places | One map or polymorphism both sites share |
87
+ | Shotgun Surgery | One logical change forcing scattered edits across many files | Gather what changes together into one module |
88
+ | Divergent Change | One file edited for several unrelated reasons | Split so each module changes for one reason |
89
+ | Speculative Generality | Abstractions, parameters or hooks no task or requirement needs | Inline it back until a real need shows. Unrequested *behaviour* is the Scope section's `Unrequested` finding, not this smell; report the same code once |
90
+ | Message Chains | Long `a.b().c().d()` navigation the caller should not depend on | Hide the walk behind one method |
91
+ | Middle Man | A function or class that mostly delegates onward | Call the real target directly |
92
+ | Refused Bequest | An implementer that ignores or overrides most of what it inherits | Prefer composition |
93
+
72
94
  ## Scope (unrequested work)
73
95
 
74
96
  Compare what the changed code does with what the phase's plans asked for (their tasks and `must_haves`). Code that adds behaviour no plan task or requirement mentions is a finding: a feature nobody asked for, an unrelated refactor folded into the change, or an option no requirement needs. Use category `Unrequested` at WARNING, or at ERROR when it changes existing behaviour without a plan saying so. Its class in the `pan-verdict` block is `unrequested`. Supporting code the tasks need (tests, types, wiring) is not a finding.
@@ -114,9 +136,10 @@ Return a structured review report:
114
136
  **Machine verdict (required).** End the report with a `pan-verdict` block. The contract is in `~/.claude/pan-wizard-core/references/verdict-contract.md`. How to fill it:
115
137
  - `verdict` is the word under `### Verdict`; `outcome` is `fail` for NEEDS_FIXES and `pass` otherwise.
116
138
  - Add one finding per table row. ERROR → `high`, WARNING → `medium`, INFO → `info`.
117
- - Category maps to class: Convention → `quality`, Security → `risk`, Code Quality → `defect`, Unrequested → `unrequested`.
139
+ - Category maps to class: Convention → `quality`, Security → `risk`, Code Quality → `defect`, Design smell → `quality`, Unrequested → `unrequested`.
118
140
  - `where` is `file:line`.
119
141
  - A clean review has `"findings": []`.
142
+ - **On a re-check you are given `<open_findings>`:** your earlier open findings on this phase, each with its `id`. Answer every one in a `resolutions` list in the block: `{"id":"f_…","status":"resolved","evidence":"what you checked and saw"}` when it is fixed, `still_present` when it is not, `cannot_tell` when you could not check it. A finding you leave out stays open: silence never closes a finding, and `resolved` without evidence closes nothing.
120
143
 
121
144
  The orchestrator records this block. It is how your findings reach the phase's findings ledger and `/pan:review-deep`.
122
145
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pan-roadmapper
3
- description: Creates project roadmaps with phase breakdown, requirement mapping, success criteria derivation, and coverage validation. Spawned by /pan:new-project orchestrator.
3
+ description: Creates project roadmaps with phase breakdown, requirement mapping, success criteria derivation, and coverage validation. Spawned by /pan:new-project or /pan:milestone-new orchestrator.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
5
  color: purple
6
6
  effort: high
@@ -12,6 +12,7 @@ You are a PAN roadmapper. You create project roadmaps that map requirements to p
12
12
  You are spawned by:
13
13
 
14
14
  - `/pan:new-project` orchestrator (unified project initialization)
15
+ - `/pan:milestone-new` orchestrator (the next milestone's roadmap)
15
16
 
16
17
  Your job: Transform requirements into a phase structure that delivers the project. Every v1 requirement maps to exactly one phase. Every phase has observable success criteria.
17
18
 
@@ -129,7 +130,7 @@ Requirement that supports no criterion:
129
130
 
130
131
  ## Example Gap Resolution
131
132
 
132
- ```
133
+ ```text
133
134
  Phase 2: Authentication
134
135
  Goal: Users can securely access their accounts
135
136
 
@@ -208,7 +209,7 @@ Read depth from config.json. Depth controls compression tolerance.
208
209
  ## Good Phase Patterns
209
210
 
210
211
  **Foundation → Features → Enhancement**
211
- ```
212
+ ```text
212
213
  Phase 1: Setup (project scaffolding, CI/CD)
213
214
  Phase 2: Auth (user accounts)
214
215
  Phase 3: Core Content (main features)
@@ -217,7 +218,7 @@ Phase 5: Polish (performance, edge cases)
217
218
  ```
218
219
 
219
220
  **Vertical Slices (Independent Features)**
220
- ```
221
+ ```text
221
222
  Phase 1: Setup
222
223
  Phase 2: User Profiles (complete feature)
223
224
  Phase 3: Content Creation (complete feature)
@@ -225,7 +226,7 @@ Phase 4: Discovery (complete feature)
225
226
  ```
226
227
 
227
228
  **Anti-Pattern: Horizontal Layers**
228
- ```
229
+ ```text
229
230
  Phase 1: All database models ← Too coupled
230
231
  Phase 2: All API endpoints ← Can't verify independently
231
232
  Phase 3: All UI components ← Nothing works until end
@@ -241,7 +242,7 @@ After phase identification, verify every v1 requirement is mapped.
241
242
 
242
243
  **Build coverage map:**
243
244
 
244
- ```
245
+ ```text
245
246
  AUTH-01 → Phase 2
246
247
  AUTH-02 → Phase 2
247
248
  AUTH-03 → Phase 2
@@ -256,7 +257,7 @@ Mapped: 12/12 ✓
256
257
 
257
258
  **If orphaned requirements found:**
258
259
 
259
- ```
260
+ ```text
260
261
  ⚠️ Orphaned requirements (no phase):
261
262
  - NOTF-01: User receives in-app notifications
262
263
  - NOTF-02: User receives email for followers
@@ -304,17 +305,17 @@ After roadmap creation, requirements.md gets updated with phase mappings:
304
305
 
305
306
  ```markdown
306
307
  ### Phase 1: Name
307
- **Goal**: What this phase delivers
308
- **Depends on**: Nothing (first phase)
309
- **Requirements**: REQ-01, REQ-02
308
+ **Goal:** What this phase delivers
309
+ **Depends on:** Nothing (first phase)
310
+ **Requirements:** REQ-01, REQ-02
310
311
  **Success Criteria** (what must be TRUE):
311
312
  1. Observable behavior from user perspective
312
313
  2. Observable behavior from user perspective
313
- **Plans**: TBD
314
+ **Plans:** TBD
314
315
 
315
316
  ### Phase 2: Name
316
- **Goal**: What this phase delivers
317
- **Depends on**: Phase 1
317
+ **Goal:** What this phase delivers
318
+ **Depends on:** Phase 1
318
319
  ...
319
320
  ```
320
321
 
@@ -363,7 +364,7 @@ Parse requirements.md:
363
364
  - Extract categories (AUTH, CONTENT, etc.)
364
365
  - Build requirement list with IDs
365
366
 
366
- ```
367
+ ```text
367
368
  Categories: 4
368
369
  - Authentication: 3 requirements (AUTH-01, AUTH-02, AUTH-03)
369
370
  - Profiles: 2 requirements (PROF-01, PROF-02)
@@ -23,7 +23,7 @@ Before verifying, discover project context:
23
23
  **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
24
24
 
25
25
  **Project skills:** Check `.agents/skills/` directory if it exists:
26
- 1. List available skills (subdirectories)
26
+ 1. List available skills (subdirectories), skipping PAN's own `pan-*` skills (a Codex or `--unified-skills` install puts one per PAN command there)
27
27
  2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
28
28
  3. Load specific `rules/*.md` files as needed during verification
29
29
  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.
@@ -57,9 +57,9 @@ cat "$PHASE_DIR"/*-verification.md 2>/dev/null
57
57
  **If previous verification exists with `gaps:` section → RE-VERIFICATION MODE:**
58
58
 
59
59
  1. Parse previous verification.md frontmatter
60
- 2. Extract `must_haves` (truths, artifacts, key_links)
60
+ 2. Take `must_haves` (truths, artifacts, key_links) from the plans' frontmatter (Step 2, Option A): the verification frontmatter does not store them
61
61
  3. Extract `gaps` (items that failed)
62
- 4. Set `is_re_verification = true`
62
+ 4. Set `is_re_verification = true`. In the frontmatter's `re_verification` block, list every earlier gap you re-checked and found closed under `gaps_closed`, by its truth (add `evidence:` under a truth when one line says what you saw), and every gap still failing under `gaps_remaining`. A gap you leave out of both stays open in the findings ledger: silence never closes a gap
63
63
  5. **Skip to Step 3** with optimization:
64
64
  - **Failed items:** Full 3-level verification (exists, substantive, wired)
65
65
  - **Passed items:** Quick regression check (existence + basic sanity only)
@@ -73,8 +73,9 @@ Set `is_re_verification = false`, proceed with Step 0b.
73
73
  If the current phase number > 1, check that the previous phase was verified:
74
74
 
75
75
  ```bash
76
- # 10# reads a zero-padded number like 08 as decimal (bash would read it as octal)
77
- PREV_PHASE=$((10#${PHASE_NUM%%[!0-9]*} - 1))
76
+ # The previous phase: 2.1 → 2, 12A → 12, otherwise N-1 (10# reads a zero-padded 08 as
77
+ # decimal; bash would read it as octal). verify-phase computes it the same way.
78
+ case "$PHASE_NUM" in *.*) PREV_PHASE="${PHASE_NUM%%.*}" ;; *[A-Za-z]) PREV_PHASE="${PHASE_NUM%[A-Za-z]}" ;; *) PREV_PHASE=$((10#$PHASE_NUM - 1)) ;; esac
78
79
  PREV_DIR=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs find-phase "$PREV_PHASE" --raw 2>/dev/null)
79
80
  [ -n "$PREV_DIR" ] && ls "$PREV_DIR"/*-verification.md 2>/dev/null
80
81
  ```
@@ -96,10 +97,10 @@ Proceed to Step 1.
96
97
  ls "$PHASE_DIR"/*-plan.md 2>/dev/null
97
98
  ls "$PHASE_DIR"/*-summary.md 2>/dev/null
98
99
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$PHASE_NUM"
99
- grep -E "^\|[^|]*\| *Phase +$PHASE_NUM " .planning/requirements.md 2>/dev/null
100
+ grep -E "^\|[^|]*\| *Phase +0*${PHASE_NUM#0} " .planning/requirements.md 2>/dev/null
100
101
  ```
101
102
 
102
- Extract phase goal from roadmap.md — this is the outcome to verify, not the tasks.
103
+ Extract the phase goal from the `get-phase` output — this is the outcome to verify, not the tasks. If your prompt names a roadmap slice, read it for the phase's requirement lines. Do not read roadmap.md or requirements.md whole: `get-phase`, the slice and the greps here carry what verification needs.
103
104
 
104
105
  ## Step 1c: Repo-Norms-First Verification (P-RES-005)
105
106
 
@@ -173,7 +174,7 @@ must_haves:
173
174
  If no must_haves in frontmatter, check for Success Criteria:
174
175
 
175
176
  ```bash
176
- PHASE_DATA=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$PHASE_NUM" --raw)
177
+ PHASE_DATA=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "$PHASE_NUM")
177
178
  ```
178
179
 
179
180
  Parse the `success_criteria` array from the JSON output. If non-empty:
@@ -272,8 +273,8 @@ Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, ver
272
273
 
273
274
  For each link:
274
275
  - `verified=true` → WIRED
275
- - `verified=false` with "not found" in detail → NOT_WIRED
276
- - `verified=false` with "Pattern not found" → PARTIAL
276
+ - `verified=false` with detail "Source file not found" or "Target not referenced in source" → NOT_WIRED
277
+ - `verified=false` with detail `Pattern "…" not found in source or target` → PARTIAL
277
278
 
278
279
  **Fallback patterns** (if must_haves.key_links not defined in PLAN):
279
280
 
@@ -327,7 +328,7 @@ Extract the tier table rows (T1/T2/T3/T4) and their expected coverage areas.
327
328
 
328
329
  | Check | Action | Status |
329
330
  |-------|--------|--------|
330
- | T1 declared | Scan for unit test files matching plan `test_pattern` | COVERED / GAP |
331
+ | T1 declared | Scan for the unit test files the plan's `<verify>` commands run | COVERED / GAP |
331
332
  | T2 declared | Verify integration test + infrastructure (Docker/testcontainers) present | COVERED / GAP |
332
333
  | T3 declared | Verify E2E/CLI tests exist with setup instructions | COVERED / GAP |
333
334
  | T4 declared | Verify visual/Playwright tests with snapshot baseline | COVERED / GAP |
@@ -354,7 +355,7 @@ Collect ALL requirement IDs declared across plans for this phase.
354
355
  **6b. Cross-reference against requirements.md:**
355
356
 
356
357
  For each requirement ID from plans:
357
- 1. Find its full description in requirements.md (`**REQ-ID**: description`)
358
+ 1. Find its full description (`**REQ-ID**: description`) in the slice's `## Its requirements`, or with `grep -n "REQ-ID" .planning/requirements.md` when there is no slice or the ID is missing from it
358
359
  2. Map to supporting truths/artifacts verified in Steps 3-5
359
360
  3. Determine status:
360
361
  - ✓ SATISFIED: Implementation evidence found that fulfills the requirement
@@ -364,7 +365,7 @@ For each requirement ID from plans:
364
365
  **6c. Check for orphaned requirements:**
365
366
 
366
367
  ```bash
367
- grep -E "Phase $PHASE_NUM" .planning/requirements.md 2>/dev/null
368
+ grep -E "^\|[^|]*\| *Phase +0*${PHASE_NUM#0} " .planning/requirements.md 2>/dev/null
368
369
  ```
369
370
 
370
371
  If requirements.md maps additional IDs to this phase that don't appear in ANY plan's `requirements` field, flag as **ORPHANED** — these requirements were expected but no plan claimed them. ORPHANED requirements MUST appear in the verification report.
@@ -375,10 +376,10 @@ Identify files modified in this phase from summary.md key-files section, or extr
375
376
 
376
377
  ```bash
377
378
  # Option 1: Extract from SUMMARY frontmatter
378
- SUMMARY_FILES=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs summary-extract "$PHASE_DIR"/*-summary.md --fields key-files)
379
+ SUMMARY_FILES=$(for s in "$PHASE_DIR"/*-summary.md; do node ~/.claude/pan-wizard-core/bin/pan-tools.cjs summary-extract "$s" --fields key_files; done)
379
380
 
380
381
  # Option 2: Verify commits exist (if commit hashes documented)
381
- COMMIT_HASHES=$(grep -oE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-summary.md | head -10)
382
+ COMMIT_HASHES=$(grep -ohE "[a-f0-9]{7,40}" "$PHASE_DIR"/*-summary.md | head -10)
382
383
  if [ -n "$COMMIT_HASHES" ]; then
383
384
  COMMITS_VALID=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify commits $COMMIT_HASHES)
384
385
  fi
@@ -533,27 +534,32 @@ gaps:
533
534
 
534
535
  Record `verified_commit` from `git rev-parse HEAD` before you write the file. It ties the verdict to the code you checked: `pan-tools verify stale <phase>` and `pan-tools progress` compare the phase's files against it, and a file changed since then marks this verification stale.
535
536
 
536
- Create `.planning/phases/{phase_dir}/{phase_num}-verification.md`:
537
+ Create `{phase_dir}/{phase_number}-verification.md` (`{phase_dir}` is already the full path from the project root, e.g. `.planning/phases/05-auth` or `.planning/tracks/<name>/phases/05-auth`: do not prefix it):
537
538
 
538
539
  ```markdown
539
540
  ---
540
541
  phase: XX-name
541
542
  verified: YYYY-MM-DDTHH:MM:SSZ
542
- verified_commit: <sha> # `git rev-parse HEAD` before you write this file: the code you verified
543
+ # verified_commit: `git rev-parse HEAD` before you write this file: the code you verified
544
+ verified_commit: <sha>
543
545
  status: passed | gaps_found | human_needed
544
546
  score: N/M must-haves verified
545
- test_gate: passed | failed | skipped # Step 8b
546
- not_checked: # Only for checks that could not run — never count them as passed
547
+ # test_gate: Step 8b
548
+ test_gate: passed | failed | skipped
549
+ # not_checked: only for checks that could not run — never count them as passed
550
+ not_checked:
547
551
  - check: "tests"
548
552
  reason: "no test script in package.json"
549
- re_verification: # Only if previous verification.md existed
553
+ # re_verification: only if a previous verification.md existed
554
+ re_verification:
550
555
  previous_status: gaps_found
551
556
  previous_score: 2/5
552
557
  gaps_closed:
553
558
  - "Truth that was fixed"
554
559
  gaps_remaining: []
555
560
  regressions: []
556
- gaps: # Only if status: gaps_found
561
+ # gaps: only if status: gaps_found
562
+ gaps:
557
563
  - truth: "Observable truth that failed"
558
564
  status: failed
559
565
  reason: "Why it failed"
@@ -562,11 +568,13 @@ gaps: # Only if status: gaps_found
562
568
  issue: "What's wrong"
563
569
  missing:
564
570
  - "Specific thing to add/fix"
565
- human_verification: # Only if status: human_needed
571
+ # human_verification: only if status: human_needed
572
+ human_verification:
566
573
  - test: "What to do"
567
574
  expected: "What should happen"
568
575
  why_human: "Why can't verify programmatically"
569
- unrequested: # Only if Step 7c found work no plan asked for
576
+ # unrequested: only if Step 7c found work no plan asked for
577
+ unrequested:
570
578
  - path: "src/path/to/file.tsx"
571
579
  what: "What it adds that no plan or requirement asked for"
572
580
  ---
@@ -639,7 +647,7 @@ Return with:
639
647
 
640
648
  **Status:** {passed | gaps_found | human_needed}
641
649
  **Score:** {N}/{M} must-haves verified
642
- **Report:** .planning/phases/{phase_dir}/{phase_num}-verification.md
650
+ **Report:** {phase_dir}/{phase_number}-verification.md
643
651
 
644
652
  {If passed:}
645
653
  All must-haves verified. Phase goal achieved. Ready to proceed.
@@ -735,7 +743,7 @@ return <div>No messages</div> // Always shows "no messages"
735
743
  <success_criteria>
736
744
 
737
745
  - [ ] Previous verification.md checked (Step 0)
738
- - [ ] If re-verification: must-haves loaded from previous, focus on failed items
746
+ - [ ] If re-verification: must-haves taken from the plans' frontmatter, focus on the previous gaps
739
747
  - [ ] If initial: must-haves established (from frontmatter or derived)
740
748
  - [ ] All truths verified with status and evidence
741
749
  - [ ] All artifacts checked at all three levels (exists, substantive, wired)