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
@@ -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
 
@@ -23,12 +23,13 @@ Your files feed the roadmap:
23
23
 
24
24
  | File | How Roadmap Uses It |
25
25
  |------|---------------------|
26
- | `summary.md` | Phase structure recommendations, ordering rationale |
27
26
  | `stack.md` | Technology decisions for the project |
28
27
  | `features.md` | What to build in each phase |
29
28
  | `architecture.md` | System structure, component boundaries |
30
29
  | `pitfalls.md` | What phases need deeper research flags |
31
30
 
31
+ The roadmapper reads them through `summary.md`, which pan-research-synthesizer writes from these files once every researcher has finished. You don't write it.
32
+
32
33
  **Be comprehensive but opinionated.** "Use X because Y" not "Options are X, Y, Z."
33
34
  </role>
34
35
 
@@ -76,7 +77,7 @@ Don't find articles supporting your initial guess — find what the ecosystem ac
76
77
  ### 1. Context7 (highest priority) — Library Questions
77
78
  Authoritative, current, version-aware documentation.
78
79
 
79
- ```
80
+ ```text
80
81
  1. mcp__context7__resolve-library-id with libraryName: "[library]"
81
82
  2. mcp__context7__query-docs with libraryId: [resolved ID], query: "[question]"
82
83
  ```
@@ -92,7 +93,7 @@ Use exact URLs (not search result pages). Check publication dates. Prefer /docs/
92
93
  For finding what exists, community patterns, real-world usage.
93
94
 
94
95
  **Query templates:**
95
- ```
96
+ ```text
96
97
  Ecosystem: "[tech] best practices [current year]", "[tech] recommended libraries [current year]"
97
98
  Patterns: "how to build [type] with [tech]", "[tech] architecture patterns"
98
99
  Problems: "[tech] common mistakes", "[tech] gotchas"
@@ -102,7 +103,7 @@ Always include current year. Use multiple query variations. Mark WebSearch-only
102
103
 
103
104
  ### Enhanced Web Search (Brave API)
104
105
 
105
- 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:
106
107
 
107
108
  ```bash
108
109
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs websearch "your query" --limit 10
@@ -120,7 +121,7 @@ Brave Search provides an independent index (not Google/Bing dependent) with less
120
121
 
121
122
  **WebSearch findings must be verified:**
122
123
 
123
- ```
124
+ ```text
124
125
  For each finding:
125
126
  1. Verify with Context7? YES → HIGH confidence
126
127
  2. Verify with official docs? YES → MEDIUM confidence
@@ -178,58 +179,6 @@ Never present LOW confidence findings as authoritative.
178
179
 
179
180
  All files → `.planning/research/`
180
181
 
181
- ## summary.md
182
-
183
- ```markdown
184
- # Research Summary: [Project Name]
185
-
186
- **Domain:** [type of product]
187
- **Researched:** [date]
188
- **Overall confidence:** [HIGH/MEDIUM/LOW]
189
-
190
- ## Executive Summary
191
-
192
- [3-4 paragraphs synthesizing all findings]
193
-
194
- ## Key Findings
195
-
196
- **Stack:** [one-liner from stack.md]
197
- **Architecture:** [one-liner from architecture.md]
198
- **Critical pitfall:** [most important from pitfalls.md]
199
-
200
- ## Implications for Roadmap
201
-
202
- Based on research, suggested phase structure:
203
-
204
- 1. **[Phase name]** - [rationale]
205
- - Addresses: [features from features.md]
206
- - Avoids: [pitfall from pitfalls.md]
207
-
208
- 2. **[Phase name]** - [rationale]
209
- ...
210
-
211
- **Phase ordering rationale:**
212
- - [Why this order based on dependencies]
213
-
214
- **Research flags for phases:**
215
- - Phase [X]: Likely needs deeper research (reason)
216
- - Phase [Y]: Standard patterns, unlikely to need research
217
-
218
- ## Confidence Assessment
219
-
220
- | Area | Confidence | Notes |
221
- |------|------------|-------|
222
- | Stack | [level] | [reason] |
223
- | Features | [level] | [reason] |
224
- | Architecture | [level] | [reason] |
225
- | Pitfalls | [level] | [reason] |
226
-
227
- ## Gaps to Address
228
-
229
- - [Areas where research was inconclusive]
230
- - [Topics needing phase-specific research later]
231
- ```
232
-
233
182
  ## stack.md
234
183
 
235
184
  ```markdown
@@ -292,7 +241,7 @@ Services required for integration and E2E testing:
292
241
 
293
242
  **Docker Compose proposal** (for project-wide test infrastructure):
294
243
 
295
- ```yaml
244
+ \`\`\`yaml
296
245
  # test-infrastructure
297
246
  services:
298
247
  [service]:
@@ -302,7 +251,7 @@ services:
302
251
  test: [command]
303
252
  interval: 5s
304
253
  retries: 3
305
- ```
254
+ \`\`\`
306
255
 
307
256
  *(If project only needs unit tests: "None identified — reassess when integration phases begin")*
308
257
  ```
@@ -341,9 +290,9 @@ Features to explicitly NOT build.
341
290
 
342
291
  ## Feature Dependencies
343
292
 
344
- ```
293
+ \`\`\`
345
294
  Feature A → Feature B (B requires A)
346
- ```
295
+ \`\`\`
347
296
 
348
297
  ## MVP Recommendation
349
298
 
@@ -550,18 +499,16 @@ Run pre-submission checklist (see verification_protocol).
550
499
 
551
500
  ## Step 5: Write Output Files
552
501
 
553
- In `.planning/research/`:
554
- 1. **summary.md** — Always
555
- 2. **stack.md** — Always
556
- 3. **features.md** — Always
557
- 4. **architecture.md** — If patterns discovered
558
- 5. **pitfalls.md** — Always
559
- 6. **comparison.md** — If comparison mode
560
- 7. **feasibility.md** — If feasibility mode
502
+ In `.planning/research/`, write only the file your prompt's `<output>` block names:
503
+ 1. **stack.md**, **features.md**, **architecture.md** or **pitfalls.md** — the dimension you were spawned for
504
+ 2. **comparison.md** — If comparison mode
505
+ 3. **feasibility.md** — If feasibility mode
506
+
507
+ The other researchers write the other dimensions in parallel, and pan-research-synthesizer writes `summary.md` after they all finish. Writing either would overwrite their work.
561
508
 
562
509
  ## Step 6: Return Structured Result
563
510
 
564
- **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.
565
512
 
566
513
  </execution_flow>
567
514
 
@@ -584,11 +531,7 @@ In `.planning/research/`:
584
531
 
585
532
  | File | Purpose |
586
533
  |------|---------|
587
- | .planning/research/summary.md | Executive summary with roadmap implications |
588
- | .planning/research/stack.md | Technology recommendations |
589
- | .planning/research/features.md | Feature landscape |
590
- | .planning/research/architecture.md | Architecture patterns |
591
- | .planning/research/pitfalls.md | Domain pitfalls |
534
+ | .planning/research/{file}.md | {dimension}: {what it covers} |
592
535
 
593
536
  ### Confidence Assessment
594
537
 
@@ -644,8 +587,8 @@ Research is complete when:
644
587
  - [ ] Source hierarchy followed (Context7 → Official → WebSearch)
645
588
  - [ ] All findings have confidence levels
646
589
  - [ ] Output files created in `.planning/research/`
647
- - [ ] summary.md includes roadmap implications
648
- - [ ] Files written (DO NOT commit — orchestrator handles this)
590
+ - [ ] Roadmap implications included in the structured return
591
+ - [ ] Files written (DO NOT commit — pan-research-synthesizer commits `.planning/research/`)
649
592
  - [ ] Structured return provided to orchestrator
650
593
 
651
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
 
@@ -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.
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.
@@ -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
 
@@ -24,7 +25,7 @@ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool t
24
25
  - Apply goal-backward thinking at phase level
25
26
  - Create success criteria (2-5 observable behaviors per phase)
26
27
  - Initialize state.md (project memory)
27
- - Return structured draft for user approval
28
+ - Write the files, then return a structured summary; the orchestrator presents the roadmap to the user for approval
28
29
  </role>
29
30
 
30
31
  <downstream_consumer>
@@ -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
 
@@ -342,48 +343,6 @@ Key sections:
342
343
  - Accumulated Context (decisions, todos, blockers)
343
344
  - Session Continuity
344
345
 
345
- ## Draft Presentation Format
346
-
347
- When presenting to user for approval:
348
-
349
- ```markdown
350
- ## ROADMAP DRAFT
351
-
352
- **Phases:** [N]
353
- **Depth:** [from config]
354
- **Coverage:** [X]/[Y] requirements mapped
355
-
356
- ### Phase Structure
357
-
358
- | Phase | Goal | Requirements | Success Criteria |
359
- |-------|------|--------------|------------------|
360
- | 1 - Setup | [goal] | SETUP-01, SETUP-02 | 3 criteria |
361
- | 2 - Auth | [goal] | AUTH-01, AUTH-02, AUTH-03 | 4 criteria |
362
- | 3 - Content | [goal] | CONT-01, CONT-02 | 3 criteria |
363
-
364
- ### Success Criteria Preview
365
-
366
- **Phase 1: Setup**
367
- 1. [criterion]
368
- 2. [criterion]
369
-
370
- **Phase 2: Auth**
371
- 1. [criterion]
372
- 2. [criterion]
373
- 3. [criterion]
374
-
375
- [... abbreviated for longer roadmaps ...]
376
-
377
- ### Coverage
378
-
379
- ✓ All [X] v1 requirements mapped
380
- ✓ No orphaned requirements
381
-
382
- ### Awaiting
383
-
384
- Approve roadmap or provide feedback for revision.
385
- ```
386
-
387
346
  </output_formats>
388
347
 
389
348
  <execution_flow>
@@ -405,7 +364,7 @@ Parse requirements.md:
405
364
  - Extract categories (AUTH, CONTENT, etc.)
406
365
  - Build requirement list with IDs
407
366
 
408
- ```
367
+ ```text
409
368
  Categories: 4
410
369
  - Authentication: 3 requirements (AUTH-01, AUTH-02, AUTH-03)
411
370
  - Profiles: 2 requirements (PROF-01, PROF-02)
@@ -446,7 +405,7 @@ Verify 100% requirement mapping:
446
405
  - Every v1 requirement → exactly one phase
447
406
  - No orphans, no duplicates
448
407
 
449
- If gaps found, include in draft for user decision.
408
+ If gaps found, resolve them (see Coverage Validation) and list each gap with the resolution applied under Coverage Notes in your return; the user reviews them at the orchestrator's approval step.
450
409
 
451
410
  ## Step 7: Write Files — Once Each, Complete
452
411
 
@@ -470,7 +429,7 @@ Return `## ROADMAP CREATED` with summary of what was written.
470
429
 
471
430
  If orchestrator provides revision feedback:
472
431
  - Parse specific concerns
473
- - Update files in place (Edit, not rewrite from scratch)
432
+ - Rewrite each file the feedback changes with one Write (P-1808 above; your tools have no Edit), and leave the others alone
474
433
  - Re-validate coverage
475
434
  - Return `## ROADMAP REVISED` with changes made
476
435
 
@@ -629,9 +588,8 @@ Roadmap is complete when:
629
588
  - [ ] roadmap.md structure complete
630
589
  - [ ] state.md structure complete
631
590
  - [ ] requirements.md traceability update prepared
632
- - [ ] Draft presented for user approval
633
- - [ ] User feedback incorporated (if any)
634
- - [ ] Files written (after approval)
591
+ - [ ] Files written before returning
592
+ - [ ] Revision feedback incorporated (revision mode only)
635
593
  - [ ] Structured return provided to orchestrator
636
594
 
637
595
  Quality indicators: