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
@@ -3,7 +3,7 @@ Orchestrate parallel codebase mapper agents to analyze codebase and produce stru
3
3
 
4
4
  Each agent has fresh context, explores a specific focus area, and **writes documents directly**. The orchestrator only receives confirmation + line counts, then writes a summary.
5
5
 
6
- Output: .planning/codebase/ folder with 9 structured documents about the codebase state.
6
+ Output: .planning/codebase/ folder with structured documents about the codebase state.
7
7
  </purpose>
8
8
 
9
9
  <philosophy>
@@ -109,7 +109,7 @@ Use Task tool with `subagent_type="pan-document_code"`, `model="{mapper_model}"`
109
109
  **CRITICAL:** Use the dedicated `pan-document_code` agent, NOT `Explore`. The mapper agent writes documents directly.
110
110
 
111
111
  **CRITICAL: Project Scope Boundary — include this line in EVERY agent prompt:**
112
- > SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
112
+ > SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
113
113
 
114
114
  **Agent 1: Tech Focus**
115
115
 
@@ -120,7 +120,7 @@ Task(
120
120
  run_in_background=true,
121
121
  description="Map codebase tech stack",
122
122
  prompt="Focus: tech
123
- SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
123
+ SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
124
124
 
125
125
  Analyze this codebase for technology stack and external integrations.
126
126
 
@@ -142,7 +142,7 @@ Task(
142
142
  run_in_background=true,
143
143
  description="Map codebase architecture",
144
144
  prompt="Focus: arch
145
- SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
145
+ SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
146
146
 
147
147
  Analyze this codebase architecture and directory structure.
148
148
 
@@ -164,7 +164,7 @@ Task(
164
164
  run_in_background=true,
165
165
  description="Map codebase conventions",
166
166
  prompt="Focus: quality
167
- SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
167
+ SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
168
168
 
169
169
  Analyze this codebase for coding conventions and testing patterns.
170
170
 
@@ -185,7 +185,7 @@ Task(
185
185
  run_in_background=true,
186
186
  description="Map codebase concerns",
187
187
  prompt="Focus: concerns
188
- SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
188
+ SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
189
189
 
190
190
  Analyze this codebase for technical debt, known issues, and areas of concern.
191
191
 
@@ -206,7 +206,7 @@ Task(
206
206
  run_in_background=true,
207
207
  description="Map module relationships",
208
208
  prompt="Focus: relationships
209
- SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
209
+ SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
210
210
 
211
211
  Analyze module dependencies using pre-computed import analysis.
212
212
 
@@ -230,7 +230,7 @@ Task(
230
230
  run_in_background=true,
231
231
  description="Map best practices",
232
232
  prompt="Focus: practices
233
- SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure directories: .claude/, .github/copilot-instructions.md, .opencode/, .gemini/, .codex/, .planning/
233
+ SCOPE: Only analyze project source code. EXCLUDE these PAN infrastructure paths: .claude/, .opencode/, .gemini/, .codex/, .agents/, .planning/, and the Copilot runtime paths PAN installs into under .github/ (agents/, skills/, hooks/, copilot/, pan-wizard-core/, pan-local-patches/, mcp.json, package.json, pan-file-manifest.json)
234
234
 
235
235
  Assess codebase best practices using pre-computed analysis.
236
236
 
@@ -284,7 +284,7 @@ wc -l .planning/codebase/*.md
284
284
  ```
285
285
 
286
286
  **Verification checklist:**
287
- - All 9 documents exist (lowercase filenames)
287
+ - All codebase documents the mapper prompts list exist (lowercase filenames)
288
288
  - No empty documents (each should have >20 lines)
289
289
 
290
290
  If any documents missing or empty, note which agents may have failed.
@@ -395,7 +395,7 @@ End workflow.
395
395
  - Relationships agent receives pre-computed import/dependency data
396
396
  - Practices agent receives pre-computed language and best-practices data
397
397
  - Read agent output files to collect confirmations
398
- - All 9 codebase documents exist (lowercase filenames)
398
+ - All codebase documents the mapper prompts list exist (lowercase filenames)
399
399
  - Clear completion summary with line counts
400
400
  - User offered clear next steps in PAN style
401
401
  </success_criteria>
@@ -14,7 +14,7 @@ Read all files referenced by the invoking prompt's execution_context before star
14
14
  INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init milestone-op)
15
15
  ```
16
16
 
17
- Extract from init JSON: `milestone_version`, `milestone_name`, `phase_count`, `completed_phases`, `commit_docs`.
17
+ Extract from init JSON: `milestone_version`, `milestone_name`, `phase_count`, `completed_phases`, `commit_docs`. `{version}` below is the version without its leading `v` (the argument, else `milestone_version` with the `v` removed: `v1.0` → `1.0`), so `v{version}-milestone-audit.md` names the `v1.0-milestone-audit.md` that `/pan:milestone-done` looks for.
18
18
 
19
19
  **Also extract `planning_root` and `track`, and use `$PLANNING_ROOT` for every planning path in this workflow** — the project may hold several planning trees, and auditing the wrong one produces a confident, plausible, wrong report:
20
20
 
@@ -26,7 +26,7 @@ PLANNING_ROOT=$(printf '%s' "$INIT" | node -e "let s='';process.stdin.on('data',
26
26
 
27
27
  **Always state the resolved `planning_root` at the top of the audit report.** If `planning_root_exists` is `false`, STOP — that is a mistyped `--track`, not an empty milestone.
28
28
 
29
- To audit a specific tree, pass `--track <name>`. To see every tree's milestone state before choosing:
29
+ To audit a specific tree, add `--track <name>` to every `pan-tools` call in this workflow (each call resolves its own planning root). To see every tree's milestone state before choosing:
30
30
 
31
31
  ```bash
32
32
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init milestone-op --all-tracks
@@ -38,12 +38,12 @@ That returns `{track_count, ambiguous_tracks, tracks[]}`, one entry per planning
38
38
 
39
39
  The init payload carries how the milestone was decided:
40
40
 
41
- - `milestone_basis` — `marked-current` (a `(current)` / 🚧 marker), `first-unshipped`, `last-shipped`, or `default`
41
+ - `milestone_basis` — `marked-current` (a `(current)` / 🚧 marker), `first-unshipped`, `last-shipped`, `state` (state.md's `milestone:`), `no-milestone-heading`, or `default` (no roadmap.md)
42
42
  - `milestone_ambiguous` — **`true` means the roadmap marks more than one milestone current**
43
43
 
44
44
  **If `milestone_ambiguous` is `true`, STOP and report the planning-state error.** Do not audit. Two milestones marked current is a roadmap defect the owner must resolve; picking one silently is how an audit ends up describing a milestone that does not exist.
45
45
 
46
- If `milestone_basis` is `default`, there is no milestone heading in the roadmap at all — say so rather than auditing `v1.0 milestone`.
46
+ If `milestone_basis` is `no-milestone-heading` (no milestone heading, none recorded in state.md) or `default` (no roadmap.md), say so rather than auditing `v1.0 milestone`; `state` means the version came from state.md's `milestone:`.
47
47
 
48
48
  Resolve integration checker model:
49
49
  ```bash
@@ -67,9 +67,9 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list
67
67
  For each phase directory, read the verification.md:
68
68
 
69
69
  ```bash
70
- # For each phase, use find-phase to resolve the directory (handles archived phases)
71
- PHASE_INFO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs find-phase 01 --raw)
72
- # Extract directory from JSON, then read verification.md from that directory
70
+ # For each phase, find-phase resolves its directory under phases/ (zero-padding handled; archived milestones are not searched)
71
+ PHASE_DIR=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs find-phase 01 --raw)
72
+ # --raw prints the directory itself (empty when not found); read verification.md from it
73
73
  # Repeat for each phase number from roadmap.md
74
74
  ```
75
75
 
@@ -87,7 +87,7 @@ If a phase is missing verification.md, flag it as "unverified phase" — this is
87
87
  What the judges found in this milestone, and what was decided about each finding, is on record. Read it rather than reconstructing it from prose:
88
88
 
89
89
  ```bash
90
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings debt --milestone "{version}"
90
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings debt --milestone "{version}" # with or without the leading v
91
91
  ```
92
92
 
93
93
  - **`deferred`** findings were continued past on purpose, and each carries the reason recorded at the time. They are the milestone's tech debt: put every one in `tech_debt`, with its id and reason.
@@ -115,7 +115,7 @@ MUST map each integration finding to affected requirement IDs where applicable.
115
115
 
116
116
  Verify cross-phase wiring and E2E user flows.",
117
117
  subagent_type="pan-integration-checker",
118
- model="{integration_checker_model}"
118
+ model="{CHECKER_MODEL}"
119
119
  )
120
120
  ```
121
121
 
@@ -145,7 +145,7 @@ For each phase's verification.md, extract the expanded requirements table:
145
145
  For each phase's summary.md, extract `requirements-completed` from YAML frontmatter:
146
146
  ```bash
147
147
  for summary in "$PLANNING_ROOT"/phases/*-*/*-summary.md; do
148
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs summary-extract "$summary" --fields requirements_completed | jq -r '.requirements_completed'
148
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs frontmatter get "$summary" --field requirements-completed --raw
149
149
  done
150
150
  ```
151
151
 
@@ -27,15 +27,15 @@ No audit gaps found. Run `/pan:milestone-audit` first.
27
27
 
28
28
  ## 2. Prioritize Gaps
29
29
 
30
- Group gaps by priority from requirements.md:
30
+ Group gaps by their audit status (requirements.md records no priority; each `gaps.requirements[]` entry carries `status`):
31
31
 
32
- | Priority | Action |
33
- |----------|--------|
34
- | `must` | Create phase, blocks milestone |
35
- | `should` | Create phase, recommended |
36
- | `nice` | Ask user: include or defer? |
32
+ | Status | Action |
33
+ |--------|--------|
34
+ | `unsatisfied` | Create phase, blocks milestone |
35
+ | `partial` | Create phase, recommended (the audit's FAIL gate forces `gaps_found` only for `unsatisfied` and `orphaned`) |
36
+ | `orphaned` | Create phase, blocks milestone (the audit treats an orphaned requirement as unsatisfied) |
37
37
 
38
- For integration/flow gaps, infer priority from affected requirements.
38
+ For integration/flow gaps, take the status of the requirements they affect.
39
39
 
40
40
  ## 3. Group Gaps into Phases
41
41
 
@@ -65,8 +65,7 @@ Gap: Flow "View dashboard" broken at data fetch
65
65
  Find highest existing phase:
66
66
  ```bash
67
67
  # Get sorted phase list, extract last one
68
- PHASES=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list)
69
- HIGHEST=$(echo "$PHASES" | jq -r '.directories[-1]')
68
+ HIGHEST=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phases list --raw | tail -1)
70
69
  ```
71
70
 
72
71
  New phases continue from there:
@@ -94,9 +93,9 @@ Closes:
94
93
  - Flow: {flow name}
95
94
  Tasks: {count}
96
95
 
97
- {If nice-to-have gaps exist:}
96
+ {If partial gaps exist:}
98
97
 
99
- ### Deferred (nice-to-have)
98
+ ### Recommended (partial — not one of the gaps that force the audit's `gaps_found`)
100
99
 
101
100
  These gaps are optional. Include them?
102
101
  - {gap description}
@@ -111,18 +110,14 @@ Wait for user confirmation.
111
110
 
112
111
  ## 6. Update roadmap.md
113
112
 
114
- Add new phases to current milestone:
113
+ Add each new phase with the CLI, which writes its checklist line (what `phase complete` ticks), its `### Phase N:` section and its directory:
115
114
 
116
- ```markdown
117
- ### Phase {N}: {Name}
118
- **Goal:** {derived from gaps being closed}
119
- **Requirements:** {REQ-IDs being satisfied}
120
- **Gap Closure:** Closes gaps from audit
121
-
122
- ### Phase {N+1}: {Name}
123
- ...
115
+ ```bash
116
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase add "{Name}"
124
117
  ```
125
118
 
119
+ Then edit the new section: set **Goal:** to {derived from gaps being closed}, **Requirements:** to {REQ-IDs being satisfied}, and add `**Gap Closure:** Closes gaps from audit`.
120
+
126
121
  ## 7. Update requirements.md Traceability Table (REQUIRED)
127
122
 
128
123
  For each REQ-ID assigned to a gap closure phase:
@@ -140,9 +135,7 @@ grep -c "Pending" .planning/requirements.md
140
135
 
141
136
  ## 8. Create Phase Directories
142
137
 
143
- ```bash
144
- mkdir -p ".planning/phases/{NN}-{name}"
145
- ```
138
+ `phase add` (step 6) already created each phase's directory.
146
139
 
147
140
  ## 9. Commit Roadmap and Requirements Update
148
141
 
@@ -261,7 +254,7 @@ becomes:
261
254
 
262
255
  <success_criteria>
263
256
  - [ ] milestone-audit.md loaded and gaps parsed
264
- - [ ] Gaps prioritized (must/should/nice)
257
+ - [ ] Gaps grouped by audit status (unsatisfied and orphaned block the milestone, partial is recommended)
265
258
  - [ ] Gaps grouped into logical phases
266
259
  - [ ] User confirmed phase plan
267
260
  - [ ] roadmap.md updated with new phases
@@ -58,20 +58,21 @@ Update Active requirements section and "Last updated" footer.
58
58
  ```markdown
59
59
  ## Current Position
60
60
 
61
- Phase: Not started (defining requirements)
62
- Plan: —
63
- Status: Defining requirements
64
- Last activity: [today] — Milestone v[X.Y] started
61
+ **Current Phase:** Not started (defining requirements)
62
+ **Current Plan:** —
63
+ **Status:** Defining requirements
64
+ **Last Activity:** [today]
65
+ **Last Activity Description:** Milestone v[X.Y] started
65
66
  ```
66
67
 
67
68
  Keep Accumulated Context section from previous milestone.
68
69
 
69
70
  ## 6. Cleanup and Commit
70
71
 
71
- Delete MILESTONE-context.md if exists (consumed).
72
+ Delete MILESTONE-context.md if exists (consumed). If git tracks it, add its path to `--files` so the deletion is committed (`--force` confirms it; a tracked deletion blocks the commit otherwise):
72
73
 
73
74
  ```bash
74
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs: start milestone v[X.Y] [Name]" --files .planning/project.md .planning/state.md
75
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs: start milestone v[X.Y] [Name]" --files .planning/project.md .planning/state.md [path of the deleted MILESTONE-context.md, if git tracked it] --force
75
76
  ```
76
77
 
77
78
  ## 7. Load Context and Resolve Models
@@ -34,7 +34,7 @@ Before scaffolding or coding anything, confirm with the user:
34
34
 
35
35
  **Do NOT proceed** until the user has answered. Do not assume, research, or fill in blanks yourself. The user's intent drives everything — skipping this step leads to wasted scaffolding and mis-aligned implementation.
36
36
 
37
- Save answers to `.planning/requirements.md` (or update if exists). Confirm with the user before scaffolding.
37
+ Ask these after Step 1's checks (Step 1 runs before any user interaction) and carry the answers into project.md (Step 4); requirements.md is written in Step 7 from its template. Confirm with the user before scaffolding.
38
38
 
39
39
  > **Auto mode exception:** If `--auto` is set with a provided idea document (see `<auto_mode>` below), the document IS the Phase 0 answer. Read it carefully and extract problem / success / scope / constraints from its contents.
40
40
 
@@ -46,7 +46,7 @@ Check if `--auto` flag is present in $ARGUMENTS.
46
46
  **If auto mode:**
47
47
  - Skip brownfield mapping offer (assume greenfield)
48
48
  - Skip deep questioning (extract context from provided document)
49
- - Config: YOLO mode is implicit (skip that question), but ask depth/git/agents FIRST (Step 2a)
49
+ - Config: YOLO mode is implicit; depth, git and agents take their defaults (or idea.md frontmatter overrides) silently in Step 2a — no questions
50
50
  - After config: run Steps 6-9 automatically with smart defaults:
51
51
  - Research: Always yes
52
52
  - Requirements: Include all table stakes + features from provided document
@@ -92,7 +92,7 @@ git init
92
92
 
93
93
  ## 2. Brownfield Offer
94
94
 
95
- **If auto mode:** Skip to Step 4 (assume greenfield, synthesize project.md from provided document).
95
+ **If auto mode:** Skip to Step 2a (assume greenfield); Step 2a applies the config defaults and continues at Step 4, which synthesizes project.md from the provided document.
96
96
 
97
97
  **If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
98
98
 
@@ -1016,7 +1016,7 @@ Parse JSON for `project_types` and `recommendations` arrays.
1016
1016
  **If auto mode (P-1601 v3.7.5):** Auto-select ONLY `priority: "high"` recommendations. These are recommendations from explicitly-detected non-general project types (e.g., a recognized `web` or `ai` project). For `general` fallback projects with no explicit type signal, **skip auto-selection entirely** — leave `standards.md` absent rather than impose unrelated standards.
1017
1017
 
1018
1018
  ```bash
1019
- HIGH_IDS=$(echo "$RECOMMEND" | jq -r '.recommendations[] | select(.priority=="high") | .id')
1019
+ HIGH_IDS=$(printf '%s' "$RECOMMEND" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log((JSON.parse(s).recommendations||[]).filter(r=>r.priority==='high').map(r=>r.id).join('\n')))")
1020
1020
  if [ -n "$HIGH_IDS" ]; then
1021
1021
  for id in $HIGH_IDS; do
1022
1022
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs standards select "$id"
@@ -1036,10 +1036,10 @@ Present recommendations:
1036
1036
 
1037
1037
  Based on your project type ([types]), these standards are recommended:
1038
1038
 
1039
- | Standard | Category | Why |
1039
+ | Standard | Priority | Why |
1040
1040
  |----------|----------|-----|
1041
- | [name] | [category] | [description] |
1042
- | [name] | [category] | [description] |
1041
+ | [name] | [priority] | [reason] |
1042
+ | [name] | [priority] | [reason] |
1043
1043
  ```
1044
1044
 
1045
1045
  Use AskUserQuestion:
@@ -1047,7 +1047,7 @@ Use AskUserQuestion:
1047
1047
  - question: "Which standards would you like to apply? (advisory — guides agents, doesn't block)"
1048
1048
  - multiSelect: true
1049
1049
  - options: (from recommendations, max 4)
1050
- - "[standard name]" — [description]
1050
+ - "[standard name]" — [reason]
1051
1051
 
1052
1052
  For each selected standard:
1053
1053
  ```bash
@@ -1110,7 +1110,7 @@ Present completion summary:
1110
1110
  ╚══════════════════════════════════════════╝
1111
1111
  ```
1112
1112
 
1113
- Exit skill and invoke SlashCommand("/pan:discuss-phase 1 --auto")
1113
+ Spawn discuss-phase for Phase 1 as a Task subagent, exactly as transition.md Route A does for a phase with no context.md (discuss-phase.md as execution_context, `ARGUMENTS='1 --auto'`); do not call SlashCommand.
1114
1114
 
1115
1115
  **If interactive mode:**
1116
1116
 
@@ -6,8 +6,8 @@ Manage the circular optimization loop — apply reports, check stats, control tr
6
6
 
7
7
  | Subcommand | Action |
8
8
  |------------|--------|
9
- | `apply` | Apply safe recommendations from most recent report |
10
- | `apply --report <file>` | Apply from a specific report |
9
+ | `apply` | Record the suggestions from the most recent report |
10
+ | `apply --report <file>` | Record them from a specific report |
11
11
  | `revert <apply_id>` / `revert --last` | Undo one apply exactly |
12
12
  | `list` | List all reports |
13
13
  | `stats` | Show cumulative stats |
@@ -40,17 +40,17 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize apply [--report <path>
40
40
  ### Step 3 — Present results
41
41
 
42
42
  Show the user:
43
- - **Applied** — each item that was written (memory entries, notes)
43
+ - **Applied** — each item that was recorded (suggestions, config notes)
44
44
  - **Skipped** — items that already exist, that an earlier apply already wrote, or that had unknown types
45
- - **Still needs review** — prompt/workflow suggestions in `suggestions.md`
45
+ - **Still needs a person** — every suggestion in `suggestions.md`
46
46
  - **The `apply_id`**, and how to undo the apply: `/pan:optimize revert <apply_id>`
47
47
 
48
- If memory entries were written, tell the user:
49
- > Memory entries have been added to `.planning/memory/`. They will be loaded on the next agent run, reducing future memory misses for these topics.
48
+ If an applied item carries a `warning`, pass it on. An older report's memory actions write to `.planning/memory/`, which PAN's workflows do not load into agents.
50
49
 
51
50
  ### Step 4 — Point to manual review items
52
51
 
53
52
  If `.planning/optimization/suggestions.md` exists, tell the user to review it for:
53
+ - Lessons (apply by writing them into the project's CLAUDE.md or AGENTS.md outside PAN's section, a test, or a comment at the cited code)
54
54
  - Agent prompt improvements (apply by editing `agents/pan-*.md`)
55
55
  - Workflow step additions (apply by editing `pan-wizard-core/workflows/*.md`)
56
56
 
@@ -125,7 +125,7 @@ Active session: sess_... (or none)
125
125
  ```
126
126
 
127
127
  If `total_optimizations_applied` > 0, note:
128
- > {N} optimizations have been applied across {apply_runs} apply runs. Each applied memory entry reduces future knowledge gaps.
128
+ > {N} suggestions have been recorded across {apply_runs} apply runs. Each helps once a person has written it where the agents read.
129
129
 
130
130
  ---
131
131
 
@@ -142,11 +142,13 @@ Every agent spawn → hook logs completion event
142
142
  ↓
143
143
  .planning/optimization/reports/{session}-opt-report.md
144
144
  ↓
145
- /pan:optimize apply → writes memory entries
145
+ /pan:optimize apply → records suggestions
146
+ ↓
147
+ A person writes each one where the agents read it
146
148
  ↓
147
149
  Next build has better context → fewer errors/gaps
148
150
  ↓
149
151
  (repeat, improving each time)
150
152
  ```
151
153
 
152
- The key insight: each apply run populates `.planning/memory/` with cached knowledge. Future agent runs load this memory and skip the research/inference that caused gaps. The error rate trends down. The optimization score trends up.
154
+ The key insight: a lesson changes the next run only from a place the next run's agents read: the project's instructions (CLAUDE.md or AGENTS.md, outside PAN's section), a test that fails when it is broken, or the code itself. PAN's workflows do not load `.planning/memory/` into agents (ADR-0036, amended `2026-10-04`). In the harness, a lesson recorded there changed nothing that the project's state, summaries and code did not already carry. The report says where each suggestion belongs, and a person puts it there.
@@ -91,8 +91,13 @@ timestamp=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs current-timestamp f
91
91
  </step>
92
92
 
93
93
  <step name="commit">
94
+ Record the stopping point in state.md too: the context monitor's note sends agents here to make state.md say where they are, and after a compaction PAN re-injects state.md's Stopped At and Resume File, not the handoff file.
95
+
94
96
  ```bash
95
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md
97
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state record-session \
98
+ --stopped-at "Phase [XX] plan [P], task [X]/[Y] — next: [next_action]" \
99
+ --resume-file ".planning/phases/[XX-name]/.continue-here.md"
100
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md .planning/state.md
96
101
  ```
97
102
  </step>
98
103
 
@@ -1,5 +1,5 @@
1
1
  <purpose>
2
- Generate unit and E2E tests for a completed phase based on its summary.md, context.md, and implementation. Classifies each changed file into TDD (unit), E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
2
+ Generate unit and E2E tests for a completed phase based on its summary.md, context.md, and implementation. Classifies each changed file into TDD (unit), Integration, E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
3
3
 
4
4
  Users currently hand-craft `/pan:quick` prompts for test generation after each phase. This workflow standardizes the process with proper classification, quality gates, and gap reporting.
5
5
  </purpose>
@@ -70,7 +70,7 @@ Extract the list of files modified by the phase from summary.md ("Files Changed"
70
70
 
71
71
  **CRITICAL: Project Scope Boundary**
72
72
  Skip any files inside PAN infrastructure directories — these are NOT project source code:
73
- - `.claude/`, `.github/copilot-instructions.md`, `.opencode/`, `.gemini/`, `.codex/`, `.planning/`
73
+ - `.claude/`, `.opencode/`, `.gemini/`, `.codex/`, `.agents/`, `.planning/`, and the Copilot runtime paths PAN installs into under `.github/` (`agents/`, `skills/`, `hooks/`, `copilot/`, `pan-wizard-core/`, `pan-local-patches/`, `mcp.json`, `package.json`, `pan-file-manifest.json`)
74
74
  If all changed files are inside these directories, report "No project source files to test" and exit.
75
75
 
76
76
  For each file, classify into one of four categories:
@@ -334,7 +334,7 @@ Create a test coverage report and present to user:
334
334
 
335
335
  Record test generation in project state:
336
336
  ```bash
337
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state-snapshot
337
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state update "Last Activity Description" "Phase ${phase_number} tests generated"
338
338
  ```
339
339
 
340
340
  If there are passing tests to commit:
@@ -374,7 +374,7 @@ Present next steps:
374
374
 
375
375
  <success_criteria>
376
376
  - [ ] Phase artifacts loaded (summary.md, context.md, optionally verification.md)
377
- - [ ] All changed files classified into TDD/E2E/Skip categories
377
+ - [ ] All changed files classified into TDD/Integration/E2E/Skip categories
378
378
  - [ ] Classification presented to user and approved
379
379
  - [ ] Project test structure discovered (directories, conventions, runners)
380
380
  - [ ] Test plan presented to user and approved