pan-wizard 3.33.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 (197) hide show
  1. package/README.md +23 -20
  2. package/agents/pan-conductor.md +17 -16
  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 +14 -14
  9. package/agents/pan-executor.md +12 -8
  10. package/agents/pan-experiment-runner.md +8 -7
  11. package/agents/pan-integration-checker.md +2 -2
  12. package/agents/pan-knowledge.md +1 -1
  13. package/agents/pan-meta-reviewer.md +3 -3
  14. package/agents/pan-optimizer.md +39 -43
  15. package/agents/pan-phase-researcher.md +8 -8
  16. package/agents/pan-plan-checker.md +30 -28
  17. package/agents/pan-planner.md +54 -43
  18. package/agents/pan-previewer.md +1 -1
  19. package/agents/pan-project-researcher.md +11 -11
  20. package/agents/pan-release.md +1 -1
  21. package/agents/pan-research-synthesizer.md +2 -2
  22. package/agents/pan-reviewer.md +24 -2
  23. package/agents/pan-roadmapper.md +15 -14
  24. package/agents/pan-verifier.md +32 -24
  25. package/bin/install-lib.cjs +58 -23
  26. package/bin/install.js +47 -1
  27. package/commands/pan/army.md +15 -11
  28. package/commands/pan/assumptions.md +2 -2
  29. package/commands/pan/audit-deployment.md +11 -12
  30. package/commands/pan/cost.md +8 -4
  31. package/commands/pan/debug.md +10 -7
  32. package/commands/pan/design-phase.md +3 -3
  33. package/commands/pan/discuss-phase.md +2 -0
  34. package/commands/pan/exec-phase.md +21 -37
  35. package/commands/pan/experiment.md +9 -8
  36. package/commands/pan/focus-auto.md +22 -20
  37. package/commands/pan/focus-design.md +7 -6
  38. package/commands/pan/focus-doc-audit.md +4 -3
  39. package/commands/pan/focus-drift-walking.md +4 -3
  40. package/commands/pan/focus-exec.md +6 -6
  41. package/commands/pan/focus-plan.md +12 -11
  42. package/commands/pan/focus-scan.md +5 -3
  43. package/commands/pan/focus-sync.md +3 -2
  44. package/commands/pan/git.md +8 -8
  45. package/commands/pan/health.md +2 -2
  46. package/commands/pan/hud.md +3 -2
  47. package/commands/pan/hygiene.md +14 -7
  48. package/commands/pan/knowledge.md +9 -9
  49. package/commands/pan/learn.md +10 -7
  50. package/commands/pan/links.md +4 -1
  51. package/commands/pan/map-codebase.md +1 -1
  52. package/commands/pan/mcp-bridge.md +18 -18
  53. package/commands/pan/milestone-done.md +6 -3
  54. package/commands/pan/milestone-new.md +1 -1
  55. package/commands/pan/new-project.md +10 -10
  56. package/commands/pan/optimize.md +16 -14
  57. package/commands/pan/patches.md +2 -6
  58. package/commands/pan/pause.md +1 -1
  59. package/commands/pan/phase-tests.md +2 -1
  60. package/commands/pan/plan-phase.md +9 -19
  61. package/commands/pan/preview.md +1 -1
  62. package/commands/pan/profile.md +2 -2
  63. package/commands/pan/quick.md +1 -1
  64. package/commands/pan/remove-phase.md +1 -1
  65. package/commands/pan/report.md +2 -2
  66. package/commands/pan/research-phase.md +12 -11
  67. package/commands/pan/resume.md +9 -11
  68. package/commands/pan/retro.md +5 -3
  69. package/commands/pan/review-deep.md +7 -7
  70. package/commands/pan/settings.md +1 -1
  71. package/commands/pan/verify-phase.md +0 -11
  72. package/commands/pan/what-if.md +2 -2
  73. package/hooks/dist/pan-context-monitor.js +343 -44
  74. package/hooks/dist/pan-cost-logger.js +30 -0
  75. package/hooks/dist/pan-statusline.js +68 -22
  76. package/hooks/dist/pan-stop-guard.js +7 -2
  77. package/package.json +1 -1
  78. package/pan-wizard-core/bin/lib/agents-md.cjs +44 -6
  79. package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
  80. package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
  81. package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
  82. package/pan-wizard-core/bin/lib/commands.cjs +33 -4
  83. package/pan-wizard-core/bin/lib/config.cjs +2 -1
  84. package/pan-wizard-core/bin/lib/constants.cjs +18 -6
  85. package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
  86. package/pan-wizard-core/bin/lib/core.cjs +53 -19
  87. package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
  88. package/pan-wizard-core/bin/lib/cost.cjs +142 -13
  89. package/pan-wizard-core/bin/lib/distill.cjs +6 -3
  90. package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
  91. package/pan-wizard-core/bin/lib/findings.cjs +9 -2
  92. package/pan-wizard-core/bin/lib/focus.cjs +13 -4
  93. package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
  94. package/pan-wizard-core/bin/lib/hygiene.cjs +178 -17
  95. package/pan-wizard-core/bin/lib/init.cjs +7 -4
  96. package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
  97. package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
  98. package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
  99. package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
  100. package/pan-wizard-core/bin/lib/memory.cjs +508 -54
  101. package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
  102. package/pan-wizard-core/bin/lib/optimize.cjs +84 -16
  103. package/pan-wizard-core/bin/lib/phase-remove.cjs +85 -21
  104. package/pan-wizard-core/bin/lib/phase-report.cjs +8 -2
  105. package/pan-wizard-core/bin/lib/phase.cjs +15 -13
  106. package/pan-wizard-core/bin/lib/preview.cjs +3 -1
  107. package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
  108. package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
  109. package/pan-wizard-core/bin/lib/runner.cjs +2 -1
  110. package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
  111. package/pan-wizard-core/bin/lib/state.cjs +43 -28
  112. package/pan-wizard-core/bin/lib/template.cjs +11 -4
  113. package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -13
  114. package/pan-wizard-core/bin/lib/verify-retro.cjs +5 -3
  115. package/pan-wizard-core/bin/lib/verify-scope.cjs +5 -2
  116. package/pan-wizard-core/bin/lib/verify.cjs +30 -28
  117. package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
  118. package/pan-wizard-core/bin/pan-tools.cjs +101 -15
  119. package/pan-wizard-core/learnings/index.json +5 -5
  120. package/pan-wizard-core/opencode/pan-wizard.js +111 -0
  121. package/pan-wizard-core/references/checkpoints.md +3 -3
  122. package/pan-wizard-core/references/continuation-format.md +3 -3
  123. package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
  124. package/pan-wizard-core/references/design-methodology.md +1 -1
  125. package/pan-wizard-core/references/git-integration.md +4 -6
  126. package/pan-wizard-core/references/git-planning-commit.md +2 -2
  127. package/pan-wizard-core/references/guardrails.md +2 -2
  128. package/pan-wizard-core/references/handoff-decisions.md +3 -3
  129. package/pan-wizard-core/references/model-profile-resolution.md +5 -5
  130. package/pan-wizard-core/references/model-profiles.md +14 -9
  131. package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
  132. package/pan-wizard-core/references/planning-config.md +4 -4
  133. package/pan-wizard-core/references/tdd.md +10 -1
  134. package/pan-wizard-core/references/verification-patterns.md +5 -5
  135. package/pan-wizard-core/templates/codebase/architecture.md +2 -2
  136. package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
  137. package/pan-wizard-core/templates/codebase/concerns.md +3 -3
  138. package/pan-wizard-core/templates/codebase/integrations.md +6 -6
  139. package/pan-wizard-core/templates/codebase/relationships.md +2 -2
  140. package/pan-wizard-core/templates/codebase/stack.md +2 -2
  141. package/pan-wizard-core/templates/codebase/structure.md +4 -4
  142. package/pan-wizard-core/templates/codebase/testing.md +4 -4
  143. package/pan-wizard-core/templates/continue-here.md +1 -1
  144. package/pan-wizard-core/templates/debug-subagent-prompt.md +3 -2
  145. package/pan-wizard-core/templates/debug.md +15 -1
  146. package/pan-wizard-core/templates/milestone-archive.md +6 -6
  147. package/pan-wizard-core/templates/milestone.md +1 -1
  148. package/pan-wizard-core/templates/phase-prompt.md +29 -17
  149. package/pan-wizard-core/templates/planner-subagent-prompt.md +3 -5
  150. package/pan-wizard-core/templates/research-project/architecture.md +3 -3
  151. package/pan-wizard-core/templates/research-project/features.md +1 -1
  152. package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
  153. package/pan-wizard-core/templates/research-project/stack.md +3 -3
  154. package/pan-wizard-core/templates/research.md +5 -5
  155. package/pan-wizard-core/templates/retrospective.md +1 -1
  156. package/pan-wizard-core/templates/roadmap.md +15 -15
  157. package/pan-wizard-core/templates/summary-complex.md +1 -0
  158. package/pan-wizard-core/templates/summary-minimal.md +1 -0
  159. package/pan-wizard-core/templates/summary-standard.md +2 -1
  160. package/pan-wizard-core/templates/summary.md +18 -2
  161. package/pan-wizard-core/templates/uat.md +3 -3
  162. package/pan-wizard-core/templates/user-setup.md +8 -8
  163. package/pan-wizard-core/templates/verification-report.md +53 -8
  164. package/pan-wizard-core/workflows/add-phase.md +1 -1
  165. package/pan-wizard-core/workflows/assumptions.md +1 -1
  166. package/pan-wizard-core/workflows/discuss-phase.md +9 -8
  167. package/pan-wizard-core/workflows/exec-phase.md +26 -57
  168. package/pan-wizard-core/workflows/execute-plan.md +8 -7
  169. package/pan-wizard-core/workflows/health.md +13 -12
  170. package/pan-wizard-core/workflows/help.md +8 -9
  171. package/pan-wizard-core/workflows/learn.md +13 -11
  172. package/pan-wizard-core/workflows/map-codebase.md +10 -10
  173. package/pan-wizard-core/workflows/milestone-audit.md +10 -10
  174. package/pan-wizard-core/workflows/milestone-gaps.md +17 -24
  175. package/pan-wizard-core/workflows/milestone-new.md +7 -6
  176. package/pan-wizard-core/workflows/new-project.md +9 -9
  177. package/pan-wizard-core/workflows/optimize.md +11 -9
  178. package/pan-wizard-core/workflows/pause.md +6 -1
  179. package/pan-wizard-core/workflows/phase-tests.md +4 -4
  180. package/pan-wizard-core/workflows/plan-phase.md +31 -34
  181. package/pan-wizard-core/workflows/profile.md +2 -2
  182. package/pan-wizard-core/workflows/progress.md +5 -7
  183. package/pan-wizard-core/workflows/quick.md +5 -3
  184. package/pan-wizard-core/workflows/remove-phase.md +1 -1
  185. package/pan-wizard-core/workflows/research-phase.md +9 -5
  186. package/pan-wizard-core/workflows/resume-project.md +4 -6
  187. package/pan-wizard-core/workflows/retro.md +3 -1
  188. package/pan-wizard-core/workflows/settings.md +16 -24
  189. package/pan-wizard-core/workflows/todo-check.md +1 -1
  190. package/pan-wizard-core/workflows/transition.md +12 -12
  191. package/pan-wizard-core/workflows/update.md +25 -17
  192. package/pan-wizard-core/workflows/verify-phase.md +17 -15
  193. package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
  194. package/pan-zcode/README.md +7 -7
  195. package/pan-zcode/bin/install-zcode.js +1 -1
  196. package/scripts/build-plugin.js +3 -1
  197. package/scripts/generate-skills-docs.py +13 -4
@@ -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
 
@@ -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,7 +57,7 @@ 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
62
  4. Set `is_re_verification = true`
63
63
  5. **Skip to Step 3** with optimization:
@@ -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)
@@ -564,6 +564,8 @@ function rewriteSharedCoreMarkdown(content, { corePrefix, pathPrefix, projectDir
564
564
  content = content.replace(/\.\/\.claude\/agents\//g, `${corePrefix}pan-wizard-core/agents/`);
565
565
  content = content.replace(/~\/\.claude\//g, pathPrefix);
566
566
  content = content.replace(/\.\/\.claude\//g, projectDirPrefix);
567
+ // No `pan-tools` bin is on PATH: invoke it via node, as the skill rewrite does.
568
+ content = content.replace(/\bpan-tools\b(?=\s+[a-z])/g, `node ${corePrefix}pan-wizard-core/bin/pan-tools.cjs`);
567
569
  content = processAttribution(content, attribution);
568
570
  return convertSlashCommandsToCopilotSkillMentions(content);
569
571
  }
@@ -573,9 +575,29 @@ function rewriteSharedCoreMarkdown(content, { corePrefix, pathPrefix, projectDir
573
575
  * under `<shared core>/agents/` — reading material for agents, not a runtime
574
576
  * registration (ADR-0028 agent-ref canonicalization).
575
577
  */
578
+ /**
579
+ * Name the agent file this runtime actually installs. A prompt that says "read
580
+ * ~/.claude/agents/pan-planner.md for your role" becomes `<prefix>agents/pan-planner.md`
581
+ * after the prefix rewrite, but Codex installs agents as `pan-planner.toml` and Copilot
582
+ * as `pan-planner.agent.md`, so the spawned agent read nothing and ran with no role.
583
+ * Idempotent; other runtimes keep `.md`.
584
+ * @param {string} content
585
+ * @param {string} runtime - claude | codex | gemini | opencode | copilot
586
+ * @param {string} pathPrefix - the runtime's rewritten config-dir prefix (ends in `/`)
587
+ * @returns {string}
588
+ */
589
+ function rewriteAgentFileRefs(content, runtime, pathPrefix) {
590
+ const ext = runtime === 'codex' ? '.toml' : runtime === 'copilot' ? '.agent.md' : null;
591
+ if (!ext || !pathPrefix) return content;
592
+ const prefix = pathPrefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
593
+ return content.replace(new RegExp(`(${prefix}agents/pan-[a-z0-9_-]+)\\.md\\b`, 'g'), (_, base) => base + ext);
594
+ }
595
+
576
596
  function rewriteAgentReferenceCopy(content, corePrefix) {
577
597
  content = content.replace(/~\/\.claude\/pan-wizard-core\//g, `${corePrefix}pan-wizard-core/`);
578
598
  content = content.replace(/\.\/\.claude\/pan-wizard-core\//g, `${corePrefix}pan-wizard-core/`);
599
+ // No `pan-tools` bin is on PATH: invoke it via node, as the skill rewrite does.
600
+ content = content.replace(/\bpan-tools\b(?=\s+[a-z])/g, `node ${corePrefix}pan-wizard-core/bin/pan-tools.cjs`);
579
601
  return convertSlashCommandsToCopilotSkillMentions(content);
580
602
  }
581
603
 
@@ -1654,6 +1676,12 @@ function detectModelCapabilities(modelName) {
1654
1676
  if (n.includes('sonnet-5')) {
1655
1677
  return { has_1m_ctx: true, has_thinking: true, has_cache: true, tier: 'mid' };
1656
1678
  }
1679
+ // Haiku 5 family (Haiku 5.5): 1M context and adaptive thinking (pricing page and
1680
+ // Claude Code 2.1.293 changelog, read 2026-10-10). It is a forward release, so
1681
+ // without this it took the fallback's Haiku profile, which is Haiku 4's.
1682
+ if (n.includes('haiku-5')) {
1683
+ return { has_1m_ctx: true, has_thinking: true, has_cache: true, tier: 'fast' };
1684
+ }
1657
1685
  if (n.includes('opus-4-8') || n.includes('opus-4.8')
1658
1686
  || n.includes('opus-4-7') || n.includes('opus-4.7')
1659
1687
  || n.includes('opus-4-6') || n.includes('opus-4.6')) {
@@ -1673,10 +1701,9 @@ function detectModelCapabilities(modelName) {
1673
1701
  if (n.includes('sonnet-4') && !isForwardRelease) {
1674
1702
  return { has_1m_ctx: false, has_thinking: true, has_cache: true, tier: 'mid' };
1675
1703
  }
1676
- // Haiku 4.x — fast tier, no extended thinking. Guarded for the same reason,
1677
- // though today it is behavior-neutral: the fallback's Haiku profile is
1678
- // identical to this one, so a forward Haiku release lands on the same answer
1679
- // either way. The guard is here so that stops being true only deliberately.
1704
+ // Haiku 4.x — fast tier, no extended thinking. Guarded for the same reason: a
1705
+ // Haiku release newer than 4.5 takes the fallback's modern Haiku profile, which
1706
+ // since Haiku 5.5 has 1M context and thinking.
1680
1707
  if ((n.includes('haiku-4-5') || n.includes('haiku-4.5') || n.includes('haiku-4')) && !isForwardRelease) {
1681
1708
  return { has_1m_ctx: false, has_thinking: false, has_cache: true, tier: 'fast' };
1682
1709
  }
@@ -1749,7 +1776,8 @@ function detectModelCapabilities(modelName) {
1749
1776
  const MODERN = {
1750
1777
  opus: { has_1m_ctx: true, has_thinking: true, has_cache: true, tier: 'reasoning' },
1751
1778
  sonnet: { has_1m_ctx: true, has_thinking: true, has_cache: true, tier: 'mid' },
1752
- haiku: { has_1m_ctx: false, has_thinking: false, has_cache: true, tier: 'fast' },
1779
+ // Haiku 5.5 (the branch above) is the newest Haiku with known capabilities.
1780
+ haiku: { has_1m_ctx: true, has_thinking: true, has_cache: true, tier: 'fast' },
1753
1781
  };
1754
1782
  return { ...MODERN[family] };
1755
1783
  }
@@ -2035,11 +2063,11 @@ so the result is greppable out of the transcript.
2035
2063
  /**
2036
2064
  * Build the plugin's MCP registration (`.mcp.json` at the plugin root).
2037
2065
  *
2038
- * Plugins may declare MCP servers in a plugin-root `.mcp.json`, and unlike
2039
- * command markdown — where `${CLAUDE_PLUGIN_ROOT}` expansion is unverified and
2040
- * is why marketplace publishing is still gated — hook and MCP *configs* are the
2041
- * documented place the variable is substituted. So the same form
2042
- * `buildPluginHooksConfig()` relies on is correct here.
2066
+ * Plugins may declare MCP servers in a plugin-root `.mcp.json`. Hook and MCP
2067
+ * *configs* are the documented place `${CLAUDE_PLUGIN_ROOT}` is substituted (it
2068
+ * expands in plugin command markdown too: measured 2026-08-14, which lifted the
2069
+ * marketplace-publishing gate). So the same form `buildPluginHooksConfig()` relies
2070
+ * on is correct here.
2043
2071
  *
2044
2072
  * No `env` block: a plugin serves whatever project the session is in, so pinning
2045
2073
  * PAN_PROJECT_ROOT would be wrong, and the server resolves its engine from its
@@ -2097,7 +2125,7 @@ function buildNativeWorkflowScripts() {
2097
2125
  const reviewPipeline = `export const meta = {
2098
2126
  name: 'pan-review-pipeline',
2099
2127
  description: 'PAN deep review: reviewer + hardener fan-out, meta-reviewer merge',
2100
- whenToUse: 'Deterministic version of the /pan-review-deep fan-out. Pass the phase number or a description of the change set as args.',
2128
+ whenToUse: 'Deterministic version of the /pan:review-deep fan-out. Pass the phase number or a description of the change set as args.',
2101
2129
  phases: [
2102
2130
  { title: 'Find', detail: 'reviewer + security hardener in parallel' },
2103
2131
  { title: 'Merge', detail: 'meta-reviewer dedupes, disputes, and issues the verdict' },
@@ -2162,7 +2190,7 @@ return merged
2162
2190
  const mapCodebase = `export const meta = {
2163
2191
  name: 'pan-map-codebase',
2164
2192
  description: 'PAN codebase mapping: shard fan-out per top-level area, then synthesis',
2165
- whenToUse: 'Deterministic version of the /pan-map-codebase shard pattern for repositories too large for a single pass.',
2193
+ whenToUse: 'Deterministic version of the /pan:map-codebase shard pattern for repositories too large for a single pass.',
2166
2194
  phases: [
2167
2195
  { title: 'Scan', detail: 'discover top-level areas worth documenting' },
2168
2196
  { title: 'Map', detail: 'one documenter per area, in parallel' },
@@ -2223,7 +2251,7 @@ return { areas_mapped: maps.filter(Boolean).length, synthesis }
2223
2251
  const execWaves = `export const meta = {
2224
2252
  name: 'pan-exec-waves',
2225
2253
  description: 'PAN phase execution: wave-grouped executor fan-out for a checkpoint-free phase, then verification',
2226
- whenToUse: 'Deterministic version of the /pan-exec-phase wave dispatch. Pass the phase number as args. Refuses a phase that contains checkpoint plans (a workflow cannot pause for a human) — run /pan-exec-phase for those.',
2254
+ whenToUse: 'Deterministic version of the /pan:exec-phase wave dispatch. Pass the phase number as args. Refuses a phase that contains checkpoint plans (a workflow cannot pause for a human) — run /pan:exec-phase for those.',
2227
2255
  phases: [
2228
2256
  { title: 'Index', detail: 'plan inventory with wave grouping, from the PAN engine' },
2229
2257
  { title: 'Execute', detail: 'one executor per plan; waves in order, plans within a wave in parallel' },
@@ -2249,6 +2277,7 @@ const INDEX = {
2249
2277
  phase_name: { type: 'string' },
2250
2278
  phase_dir: { type: 'string' },
2251
2279
  parallelization: { type: 'boolean' },
2280
+ verifier_enabled: { type: 'boolean' },
2252
2281
  has_checkpoints: { type: 'boolean' },
2253
2282
  plans: {
2254
2283
  type: 'array',
@@ -2269,11 +2298,11 @@ const INDEX = {
2269
2298
  required: ['phase_found', 'has_checkpoints', 'plans'],
2270
2299
  }
2271
2300
  const index = await agent(
2272
- 'Index phase ' + phaseArg + ' for execution using the ' + PAN_TOOLS + ' Run two verbs and merge their JSON: (1) init execute-phase ' + phaseArg + ' — take phase_found, phase_number, phase_name, phase_dir, parallelization; (2) phase-plan-index ' + phaseArg + ' — take has_checkpoints and plans[] (id, wave, autonomous, has_summary, objective; include each plan file path as file). Do not execute anything; return only the merged index.',
2301
+ 'Index phase ' + phaseArg + ' for execution using the ' + PAN_TOOLS + ' Run two verbs and merge their JSON: (1) init execute-phase ' + phaseArg + ' — take phase_found, phase_number, phase_name, phase_dir, parallelization, verifier_enabled; (2) phase-plan-index ' + phaseArg + ' — take has_checkpoints and plans[] (id, wave, autonomous, has_summary, objective; include each plan file path as file). Do not execute anything; return only the merged index.',
2273
2302
  { label: 'index', phase: 'Index', schema: INDEX })
2274
2303
  if (!index || !index.phase_found) return { error: 'phase ' + phaseArg + ' not found' }
2275
2304
  if (index.has_checkpoints) {
2276
- return { error: 'phase ' + phaseArg + ' contains checkpoint plans (autonomous: false). A workflow cannot pause for a human — run /pan-exec-phase ' + phaseArg + ' instead.', plans: index.plans.map(p => p.id) }
2305
+ return { error: 'phase ' + phaseArg + ' contains checkpoint plans (autonomous: false). A workflow cannot pause for a human — run /pan:exec-phase ' + phaseArg + ' instead.', plans: index.plans.map(p => p.id) }
2277
2306
  }
2278
2307
  const pending = index.plans.filter(p => !p.has_summary)
2279
2308
  if (pending.length === 0) return { phase: phaseArg, done: true, message: 'every plan already has a summary — nothing to execute' }
@@ -2297,7 +2326,7 @@ const EXEC_RESULT = {
2297
2326
  const executorPrompt = (p) =>
2298
2327
  'Execute plan ' + p.id + ' of phase ' + (index.phase_number || phaseArg) + (index.phase_name ? '-' + index.phase_name : '') + '. Commit each task atomically. Create summary.md. Update state.md and roadmap.md (via roadmap update-plan-progress).\\n\\n'
2299
2328
  + 'Read first, in this order: ' + CORE_DOCS + '\\n\\n'
2300
- + 'Then read: ' + (p.file || (index.phase_dir + '/' + p.id)) + ' (the plan), .planning/state.md, .planning/config.json (if present), ./CLAUDE.md (if present — follow its conventions), .agents/skills/ (if present — follow relevant skills), and every .planning/memory/*.md (apply every rule without exception).\\n\\n'
2329
+ + 'Then read: ' + (p.file || (index.phase_dir + '/' + p.id)) + ' (the plan), .planning/state.md, .planning/config.json (if present), ./CLAUDE.md (if present — follow its conventions), and .agents/skills/ (if present — follow relevant skills).\\n\\n'
2301
2330
  + 'Report plan_id, status (complete | failed | checkpoint), summary_path, the number of commits you made, and self_check (passed if your summary carries no "Self-Check: FAILED" marker).'
2302
2331
  const executed = []
2303
2332
  let halted = null
@@ -2326,7 +2355,11 @@ for (const w of waveNumbers) {
2326
2355
  }
2327
2356
  }
2328
2357
  if (halted) {
2329
- return { phase: phaseArg, halted, executed, next: 'Inspect the failed plan(s), then re-run /pan-exec-waves ' + phaseArg + ' (completed plans are skipped) or fall back to /pan-exec-phase ' + phaseArg }
2358
+ return { phase: phaseArg, halted, executed, next: 'Inspect the failed plan(s), then re-run /pan-exec-waves ' + phaseArg + ' (completed plans are skipped) or fall back to /pan:exec-phase ' + phaseArg }
2359
+ }
2360
+ // workflow.verifier: false (/pan:settings) turns the phase verifier off, as in exec-phase.
2361
+ if (index.verifier_enabled === false) {
2362
+ return { phase: phaseArg, waves_run: waveNumbers.length, plans_complete: executed.length, verification: null, next: 'Verification skipped: workflow.verifier is off. /pan:verify-phase ' + phaseArg + ' verifies on demand; then continue with /pan:exec-phase ' + phaseArg + ' (transition)' }
2330
2363
  }
2331
2364
 
2332
2365
  phase('Verify')
@@ -2344,13 +2377,13 @@ const verdict = await agent(
2344
2377
  'Verify phase ' + phaseArg + ' following the PAN verify-phase protocol (PAN core: workflows/verify-phase.md — ' + PAN_TOOLS + '). Check the phase goals against what the plans delivered, write the verification file the protocol prescribes, and report status (passed | gaps_found | human_needed | failed), the verification file path, any gaps, and a summary. Do not mark the phase complete or advance state — that decision stays with the user.',
2345
2378
  { agentType: 'pan-verifier', label: 'verify', phase: 'Verify', schema: VERIFY })
2346
2379
 
2347
- return { phase: phaseArg, waves_run: waveNumbers.length, plans_complete: executed.length, verification: verdict, next: 'Review the verification, then continue with /pan-exec-phase ' + phaseArg + ' (transition) or /pan-plan-phase for the next phase' }
2380
+ return { phase: phaseArg, waves_run: waveNumbers.length, plans_complete: executed.length, verification: verdict, next: 'Review the verification, then continue with /pan:exec-phase ' + phaseArg + ' (transition) or /pan:plan-phase for the next phase' }
2348
2381
  `;
2349
2382
 
2350
2383
  const diagnoseIssues = `export const meta = {
2351
2384
  name: 'pan-diagnose-issues',
2352
2385
  description: 'PAN UAT diagnosis: one debugger per failed UAT truth, in parallel, then root causes written back',
2353
- whenToUse: 'Deterministic version of /pan-diagnose-issues. Pass the phase number as args. Investigates only — fixes come from /pan-plan-phase --gaps.',
2386
+ whenToUse: 'Deterministic version of the diagnose-issues workflow. Pass the phase number as args. Investigates only — fixes come from /pan:plan-phase --gaps.',
2354
2387
  phases: [
2355
2388
  { title: 'Gaps', detail: 'read the phase UAT file and list the failed truths' },
2356
2389
  { title: 'Diagnose', detail: 'one pan-debugger per gap, in parallel, root cause only' },
@@ -2404,6 +2437,7 @@ const DIAGNOSIS = {
2404
2437
  issue_id: { type: 'string' },
2405
2438
  status: { type: 'string', enum: ['root_cause_found', 'inconclusive'] },
2406
2439
  root_cause: { type: 'string' },
2440
+ reproduction: { type: 'string' },
2407
2441
  evidence: { type: 'array', items: { type: 'string' } },
2408
2442
  files: { type: 'array', items: { type: 'string' } },
2409
2443
  suggested_fix: { type: 'string' },
@@ -2413,9 +2447,9 @@ const DIAGNOSIS = {
2413
2447
  required: ['issue_id', 'status'],
2414
2448
  }
2415
2449
  const diagnoses = await parallel(gaps.map(g => () => agent(
2416
- 'Debug issue UAT-' + g.test_num + ' for phase ' + phaseArg + ' — root cause ONLY, do not fix (fixes come from /pan-plan-phase --gaps).\\n\\n'
2450
+ 'Debug issue UAT-' + g.test_num + ' for phase ' + phaseArg + ' — root cause ONLY, do not fix (fixes come from /pan:plan-phase --gaps).\\n\\n'
2417
2451
  + 'Symptoms (pre-filled from UAT, treat as given): expected: ' + (g.expected || g.truth) + '. actual: ' + (g.reason || 'not recorded') + '. reproduction: test ' + g.test_num + ' in ' + found.uat_path + '. severity: ' + g.severity + '.\\n\\n'
2418
- + 'Follow the PAN debugger protocol: create the debug session file under .planning/debug/ named from the issue, investigate autonomously (read code, form hypotheses, test them), and report issue_id, status (root_cause_found | inconclusive), root_cause with evidence, files involved, a suggested fix direction, and the debug session path. If inconclusive, list the remaining possibilities. Also read ' + found.uat_path + ' and .planning/state.md for context.',
2452
+ + 'Follow the PAN debugger protocol: create the debug session file under .planning/debug/ named from the issue, build and run a command that fails on the symptom before forming any hypothesis, investigate autonomously (read code, form hypotheses, test them), and report issue_id, status (root_cause_found | inconclusive), the reproduction command (or none, with what you tried), root_cause with evidence, files involved, a suggested fix direction, and the debug session path. If inconclusive, list the remaining possibilities. Also read ' + found.uat_path + ' and .planning/state.md for context.',
2419
2453
  { agentType: 'pan-debugger', label: 'debug:UAT-' + g.test_num, phase: 'Diagnose', schema: DIAGNOSIS })))
2420
2454
  const results = diagnoses.filter(Boolean)
2421
2455
  log(results.filter(r => r.status === 'root_cause_found').length + ' root cause(s) found, ' + results.filter(r => r.status === 'inconclusive').length + ' inconclusive')
@@ -2427,10 +2461,10 @@ const RECORDED = {
2427
2461
  required: ['uat_path', 'gaps_updated'],
2428
2462
  }
2429
2463
  const recorded = await agent(
2430
- 'Update the Gaps section of ' + found.uat_path + ' with these diagnoses, following the PAN diagnose-issues protocol: for each gap add root_cause, artifacts (the debug session path), the files involved, and the suggested fix direction; mark inconclusive ones as needing manual review with their remaining possibilities. Edit in place — do not rewrite unrelated content. Report the path and how many gaps you updated.\\n\\nDiagnoses:\\n' + JSON.stringify(results, null, 2),
2464
+ 'Update the Gaps section of ' + found.uat_path + ' with these diagnoses, following the PAN diagnose-issues protocol: for each gap add root_cause, artifacts (each file involved, with its issue), missing (the suggested fix direction) and debug_session (the debug session path); mark inconclusive ones as needing manual review with their remaining possibilities. Edit the Gaps section in place and set the frontmatter status to diagnosed (the --gaps mode of pan-planner reads UAT gaps only from a diagnosed file); do not rewrite other content. Report the path and how many gaps you updated.\\n\\nDiagnoses:\\n' + JSON.stringify(results, null, 2),
2431
2465
  { label: 'record', phase: 'Record', schema: RECORDED })
2432
2466
 
2433
- return { phase: phaseArg, uat_path: found.uat_path, gaps: gaps.length, root_causes_found: results.filter(r => r.status === 'root_cause_found').length, inconclusive: results.filter(r => r.status === 'inconclusive').length, recorded, next: 'Run /pan-plan-phase ' + phaseArg + ' --gaps to plan the fixes' }
2467
+ return { phase: phaseArg, uat_path: found.uat_path, gaps: gaps.length, root_causes_found: results.filter(r => r.status === 'root_cause_found').length, inconclusive: results.filter(r => r.status === 'inconclusive').length, recorded, next: 'Run /pan:plan-phase ' + phaseArg + ' --gaps to plan the fixes' }
2434
2468
  `;
2435
2469
 
2436
2470
  return [
@@ -2532,6 +2566,7 @@ module.exports = {
2532
2566
  rewriteUnifiedSkillCommandContent,
2533
2567
  rewriteSharedCoreMarkdown,
2534
2568
  rewriteAgentReferenceCopy,
2569
+ rewriteAgentFileRefs,
2535
2570
  stripInternalLearningsTopics,
2536
2571
  AGENT_PLUGINS_VERSION,
2537
2572
  AGENT_PLUGIN_MANIFEST_SCHEMA,