pan-wizard 3.32.0 → 3.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/README.md +23 -20
  2. package/agents/pan-conductor.md +18 -17
  3. package/agents/pan-counterfactual.md +2 -2
  4. package/agents/pan-debugger.md +27 -8
  5. package/agents/pan-design-checker.md +1 -1
  6. package/agents/pan-designer.md +2 -2
  7. package/agents/pan-distiller.md +3 -3
  8. package/agents/pan-document_code.md +16 -16
  9. package/agents/pan-executor.md +15 -11
  10. package/agents/pan-experiment-runner.md +15 -17
  11. package/agents/pan-hardener.md +15 -15
  12. package/agents/pan-integration-checker.md +2 -2
  13. package/agents/pan-knowledge.md +2 -2
  14. package/agents/pan-meta-reviewer.md +5 -5
  15. package/agents/pan-optimizer.md +40 -44
  16. package/agents/pan-phase-researcher.md +10 -10
  17. package/agents/pan-plan-checker.md +36 -30
  18. package/agents/pan-planner.md +77 -53
  19. package/agents/pan-previewer.md +1 -1
  20. package/agents/pan-project-researcher.md +21 -78
  21. package/agents/pan-release.md +1 -1
  22. package/agents/pan-research-synthesizer.md +2 -2
  23. package/agents/pan-reviewer.md +24 -2
  24. package/agents/pan-roadmapper.md +20 -62
  25. package/agents/pan-verifier.md +53 -30
  26. package/bin/install-lib.cjs +228 -38
  27. package/bin/install.js +86 -15
  28. package/commands/pan/army.md +16 -12
  29. package/commands/pan/assumptions.md +2 -2
  30. package/commands/pan/audit-deployment.md +11 -12
  31. package/commands/pan/cost.md +8 -4
  32. package/commands/pan/debug.md +10 -7
  33. package/commands/pan/design-phase.md +3 -3
  34. package/commands/pan/discuss-phase.md +2 -0
  35. package/commands/pan/exec-phase.md +21 -37
  36. package/commands/pan/experiment.md +11 -10
  37. package/commands/pan/focus-auto.md +33 -27
  38. package/commands/pan/focus-design.md +9 -6
  39. package/commands/pan/focus-doc-audit.md +4 -3
  40. package/commands/pan/focus-drift-walking.md +4 -3
  41. package/commands/pan/focus-exec.md +7 -7
  42. package/commands/pan/focus-plan.md +12 -11
  43. package/commands/pan/focus-scan.md +7 -10
  44. package/commands/pan/focus-sync.md +3 -2
  45. package/commands/pan/git.md +8 -8
  46. package/commands/pan/health.md +2 -2
  47. package/commands/pan/hud.md +3 -2
  48. package/commands/pan/hygiene.md +14 -7
  49. package/commands/pan/knowledge.md +9 -9
  50. package/commands/pan/learn.md +10 -7
  51. package/commands/pan/links.md +4 -1
  52. package/commands/pan/map-codebase.md +5 -5
  53. package/commands/pan/mcp-bridge.md +18 -18
  54. package/commands/pan/milestone-done.md +7 -5
  55. package/commands/pan/milestone-new.md +1 -1
  56. package/commands/pan/new-project.md +10 -10
  57. package/commands/pan/optimize.md +16 -14
  58. package/commands/pan/patches.md +2 -6
  59. package/commands/pan/pause.md +1 -1
  60. package/commands/pan/phase-tests.md +4 -3
  61. package/commands/pan/plan-phase.md +9 -19
  62. package/commands/pan/preview.md +1 -1
  63. package/commands/pan/profile.md +4 -4
  64. package/commands/pan/quick.md +1 -1
  65. package/commands/pan/remove-phase.md +1 -1
  66. package/commands/pan/report.md +2 -2
  67. package/commands/pan/research-phase.md +14 -15
  68. package/commands/pan/resume.md +9 -11
  69. package/commands/pan/retro.md +5 -3
  70. package/commands/pan/review-deep.md +10 -10
  71. package/commands/pan/settings.md +1 -1
  72. package/commands/pan/todo-add.md +2 -2
  73. package/commands/pan/todo-check.md +2 -2
  74. package/commands/pan/verify-phase.md +0 -11
  75. package/commands/pan/what-if.md +2 -2
  76. package/hooks/dist/pan-context-monitor.js +343 -44
  77. package/hooks/dist/pan-cost-logger.js +30 -0
  78. package/hooks/dist/pan-state-reinject.js +140 -15
  79. package/hooks/dist/pan-statusline.js +68 -22
  80. package/hooks/dist/pan-stop-guard.js +7 -2
  81. package/package.json +1 -1
  82. package/pan-wizard-core/bin/lib/agents-md.cjs +48 -7
  83. package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
  84. package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
  85. package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
  86. package/pan-wizard-core/bin/lib/commands.cjs +126 -5
  87. package/pan-wizard-core/bin/lib/config.cjs +112 -1
  88. package/pan-wizard-core/bin/lib/constants.cjs +29 -15
  89. package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
  90. package/pan-wizard-core/bin/lib/core.cjs +77 -23
  91. package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
  92. package/pan-wizard-core/bin/lib/cost.cjs +149 -10
  93. package/pan-wizard-core/bin/lib/distill.cjs +6 -3
  94. package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
  95. package/pan-wizard-core/bin/lib/findings.cjs +15 -4
  96. package/pan-wizard-core/bin/lib/focus.cjs +13 -4
  97. package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
  98. package/pan-wizard-core/bin/lib/hygiene.cjs +178 -17
  99. package/pan-wizard-core/bin/lib/init.cjs +12 -5
  100. package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
  101. package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
  102. package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
  103. package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
  104. package/pan-wizard-core/bin/lib/memory.cjs +508 -54
  105. package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
  106. package/pan-wizard-core/bin/lib/optimize.cjs +84 -16
  107. package/pan-wizard-core/bin/lib/phase-remove.cjs +85 -21
  108. package/pan-wizard-core/bin/lib/phase-report.cjs +8 -2
  109. package/pan-wizard-core/bin/lib/phase.cjs +67 -15
  110. package/pan-wizard-core/bin/lib/preview.cjs +3 -1
  111. package/pan-wizard-core/bin/lib/review-deep.cjs +2 -2
  112. package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
  113. package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
  114. package/pan-wizard-core/bin/lib/runner.cjs +2 -1
  115. package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
  116. package/pan-wizard-core/bin/lib/state.cjs +47 -31
  117. package/pan-wizard-core/bin/lib/template.cjs +11 -4
  118. package/pan-wizard-core/bin/lib/verdict.cjs +54 -4
  119. package/pan-wizard-core/bin/lib/verify-drift.cjs +14 -5
  120. package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -13
  121. package/pan-wizard-core/bin/lib/verify-retro.cjs +5 -3
  122. package/pan-wizard-core/bin/lib/verify-scope.cjs +74 -4
  123. package/pan-wizard-core/bin/lib/verify.cjs +117 -35
  124. package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
  125. package/pan-wizard-core/bin/pan-tools.cjs +111 -17
  126. package/pan-wizard-core/learnings/index.json +5 -5
  127. package/pan-wizard-core/mcp/server.cjs +18 -9
  128. package/pan-wizard-core/opencode/pan-wizard.js +111 -0
  129. package/pan-wizard-core/references/checkpoints.md +7 -5
  130. package/pan-wizard-core/references/continuation-format.md +3 -3
  131. package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
  132. package/pan-wizard-core/references/design-methodology.md +1 -1
  133. package/pan-wizard-core/references/git-integration.md +4 -6
  134. package/pan-wizard-core/references/git-planning-commit.md +2 -2
  135. package/pan-wizard-core/references/guardrails.md +2 -2
  136. package/pan-wizard-core/references/handoff-decisions.md +3 -3
  137. package/pan-wizard-core/references/model-profile-resolution.md +5 -5
  138. package/pan-wizard-core/references/model-profiles.md +14 -9
  139. package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
  140. package/pan-wizard-core/references/planning-config.md +4 -4
  141. package/pan-wizard-core/references/tdd.md +10 -1
  142. package/pan-wizard-core/references/verdict-contract.md +2 -1
  143. package/pan-wizard-core/references/verification-patterns.md +5 -5
  144. package/pan-wizard-core/templates/codebase/architecture.md +2 -2
  145. package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
  146. package/pan-wizard-core/templates/codebase/concerns.md +3 -3
  147. package/pan-wizard-core/templates/codebase/integrations.md +6 -6
  148. package/pan-wizard-core/templates/codebase/relationships.md +2 -2
  149. package/pan-wizard-core/templates/codebase/stack.md +2 -2
  150. package/pan-wizard-core/templates/codebase/structure.md +4 -4
  151. package/pan-wizard-core/templates/codebase/testing.md +4 -4
  152. package/pan-wizard-core/templates/continue-here.md +1 -1
  153. package/pan-wizard-core/templates/debug-subagent-prompt.md +3 -2
  154. package/pan-wizard-core/templates/debug.md +15 -1
  155. package/pan-wizard-core/templates/discovery.md +1 -1
  156. package/pan-wizard-core/templates/milestone-archive.md +6 -6
  157. package/pan-wizard-core/templates/milestone.md +1 -1
  158. package/pan-wizard-core/templates/phase-prompt.md +31 -18
  159. package/pan-wizard-core/templates/planner-subagent-prompt.md +3 -5
  160. package/pan-wizard-core/templates/research-project/architecture.md +3 -3
  161. package/pan-wizard-core/templates/research-project/features.md +1 -1
  162. package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
  163. package/pan-wizard-core/templates/research-project/stack.md +3 -3
  164. package/pan-wizard-core/templates/research.md +5 -5
  165. package/pan-wizard-core/templates/retrospective.md +1 -1
  166. package/pan-wizard-core/templates/roadmap.md +15 -15
  167. package/pan-wizard-core/templates/summary-complex.md +1 -0
  168. package/pan-wizard-core/templates/summary-minimal.md +1 -0
  169. package/pan-wizard-core/templates/summary-standard.md +2 -1
  170. package/pan-wizard-core/templates/summary.md +18 -2
  171. package/pan-wizard-core/templates/uat.md +3 -3
  172. package/pan-wizard-core/templates/user-setup.md +8 -8
  173. package/pan-wizard-core/templates/verification-report.md +54 -4
  174. package/pan-wizard-core/workflows/add-phase.md +1 -1
  175. package/pan-wizard-core/workflows/assumptions.md +1 -1
  176. package/pan-wizard-core/workflows/discuss-phase.md +9 -8
  177. package/pan-wizard-core/workflows/exec-phase.md +34 -60
  178. package/pan-wizard-core/workflows/execute-plan.md +8 -7
  179. package/pan-wizard-core/workflows/health.md +13 -11
  180. package/pan-wizard-core/workflows/help.md +8 -9
  181. package/pan-wizard-core/workflows/learn.md +13 -11
  182. package/pan-wizard-core/workflows/map-codebase.md +10 -10
  183. package/pan-wizard-core/workflows/milestone-audit.md +10 -10
  184. package/pan-wizard-core/workflows/milestone-gaps.md +17 -24
  185. package/pan-wizard-core/workflows/milestone-new.md +7 -6
  186. package/pan-wizard-core/workflows/new-project.md +10 -10
  187. package/pan-wizard-core/workflows/optimize.md +11 -9
  188. package/pan-wizard-core/workflows/pause.md +6 -1
  189. package/pan-wizard-core/workflows/phase-tests.md +4 -4
  190. package/pan-wizard-core/workflows/plan-phase.md +31 -34
  191. package/pan-wizard-core/workflows/profile.md +2 -2
  192. package/pan-wizard-core/workflows/progress.md +5 -7
  193. package/pan-wizard-core/workflows/quick.md +10 -8
  194. package/pan-wizard-core/workflows/remove-phase.md +1 -1
  195. package/pan-wizard-core/workflows/research-phase.md +9 -5
  196. package/pan-wizard-core/workflows/resume-project.md +4 -6
  197. package/pan-wizard-core/workflows/retro.md +3 -1
  198. package/pan-wizard-core/workflows/settings.md +16 -24
  199. package/pan-wizard-core/workflows/todo-check.md +1 -1
  200. package/pan-wizard-core/workflows/transition.md +12 -12
  201. package/pan-wizard-core/workflows/update.md +25 -17
  202. package/pan-wizard-core/workflows/verify-phase.md +24 -17
  203. package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
  204. package/pan-zcode/README.md +7 -7
  205. package/pan-zcode/bin/install-zcode.js +1 -1
  206. package/scripts/build-agent-plugin.js +19 -5
  207. package/scripts/build-plugin.js +3 -1
  208. package/scripts/generate-skills-docs.py +13 -4
  209. package/scripts/test-surface.cjs +4 -0
@@ -62,22 +62,20 @@ ELSE IF .continue-here.md exists:
62
62
  → PRESENT: position, blockers, next action
63
63
  → ROUTE to the command that was paused (exec-phase, plan-phase, etc.)
64
64
 
65
- ELSE IF state.md exists AND has status "in_progress":
65
+ ELSE IF state.md exists (its Status is free text — Ready to plan, Ready to execute, In progress, Phase complete, Milestone complete and the like; none says "blocked"):
66
+ → IF state.md's `### Blockers/Concerns` lists a blocker:
67
+ → PRESENT the blockers first
68
+ → OFFER: debug (/pan:debug) or unblock manually
66
69
  → FIND incomplete work: plans without summaries, phases mid-execution
67
70
  → IF incomplete phase found:
68
71
  → PRESENT phase status + what remains
69
72
  → OFFER: continue execution (/pan:exec-phase) or verify (/pan:verify-phase)
70
- → IF no incomplete work but active milestone:
73
+ → ELSE IF roadmap phases remain incomplete (`roadmap analyze`):
71
74
  → PRESENT milestone progress
72
- → OFFER: next unplanned phase (/pan:plan-phase) or audit (/pan:milestone-audit)
73
-
74
- ELSE IF state.md exists AND has status "blocked":
75
- → PRESENT blockers from state.md
76
- → OFFER: debug (/pan:debug) or unblock manually
77
-
78
- ELSE IF state.md exists AND has status "completed":
79
- → "Current milestone is complete. Run /pan:milestone-done or /pan:milestone-new."
80
- → STOP
75
+ → OFFER: next unplanned phase (/pan:discuss-phase, or /pan:plan-phase when it has a context.md) or audit (/pan:milestone-audit)
76
+ → ELSE (every roadmap phase complete):
77
+ → "Current milestone is complete. Run /pan:milestone-audit, then /pan:milestone-done, or /pan:milestone-new."
78
+ → STOP
81
79
 
82
80
  ELSE (state.md missing or unreadable):
83
81
  → ATTEMPT reconstruction from .planning/ artifacts
@@ -2,7 +2,7 @@
2
2
  name: pan:retro
3
3
  group: Milestone Lifecycle
4
4
  description: Milestone retrospective — analyze estimation accuracy, verification patterns, and common gaps
5
- argument-hint: ""
5
+ argument-hint: "[--write-memory] [--max N]"
6
6
  allowed-tools:
7
7
  - Read
8
8
  - Bash
@@ -14,7 +14,7 @@ Analyze completed milestone work to identify process improvement opportunities.
14
14
 
15
15
  Examines roadmap phases (planned vs completed, gap closures), verification results (pass rates, common gaps), and estimation accuracy. Output guides future planning improvements.
16
16
 
17
- This is a reflection command — **read-only by default**: with no flags it does not modify any files. Passing `--write-memory` (as `/pan:army` does) is the one exception — it appends recurring-pattern entries to agent memory so they persist into the next mission.
17
+ This is a reflection command — **read-only by default**: with no flags it does not modify any files. Passing `--write-memory` is the one exception: it appends recurring-pattern entries to the agent logs in `.planning/memory/`, which `/pan:knowledge` reads. PAN's workflows do not load those logs into agents, so a pattern meant to change the next plan goes into that plan's brief or the project's instructions.
18
18
  </objective>
19
19
 
20
20
  <execution_context>
@@ -24,8 +24,10 @@ This is a reflection command — **read-only by default**: with no flags it does
24
24
  <context>
25
25
  No arguments required. Operates on the current `.planning/` directory.
26
26
 
27
+ Flags: $ARGUMENTS
28
+
27
29
  **Flags:**
28
- - `--write-memory` — after analysis, append recurring-pattern entries to agent memory (used by `/pan:army`). Without this flag the command is strictly read-only.
30
+ - `--write-memory` — after analysis, append recurring-pattern entries to the agent logs in `.planning/memory/` (stored for `/pan:knowledge`, not loaded into agents). `--max N` caps the planner lessons (default 3). Without `--write-memory` the command is strictly read-only.
29
31
 
30
32
  The retro command is typically run after `/pan:milestone-done` to reflect on the milestone before starting the next one.
31
33
  </context>
@@ -54,7 +54,7 @@ Runs the normal exec → reviewer pipeline, then runs this command's process inl
54
54
  /pan:focus-exec --deep-review
55
55
  ```
56
56
 
57
- Per-item deep review during focus campaigns. Useful for high-stakes batches.
57
+ Per-item deep review during focus campaigns: focus-exec runs the hardener and meta-reviewer on the item's changed files and merges them under the item's id (`review-deep merge <item-id>` with no `--reviewer-file`), since an item has no phase or first-pass review. Useful for high-stakes batches.
58
58
 
59
59
  </invocation_modes>
60
60
 
@@ -67,7 +67,7 @@ Per-item deep review during focus campaigns. Useful for high-stakes batches.
67
67
  - Agent writes its findings to the output path, returns confirmation.
68
68
 
69
69
  3. **Spawn pan-meta-reviewer**:
70
- - Prompt includes: `<files_to_read>` with both reviewer.md AND hardener.md (and representative diff snippets); `<output_path>` = `.planning/reviews/<N>/meta.md`.
70
+ - Prompt includes: `<files_to_read>` with both `{directory}/{phase_number}-review.md` AND `.planning/reviews/<N>/hardener.md` (and representative diff snippets); `<output_path>` = `.planning/reviews/<N>/meta.md`.
71
71
  - Agent reads both first-pass reports, identifies missed patterns, disputes overstated severities, writes to output path.
72
72
 
73
73
  4. **Merge** — call:
@@ -87,13 +87,13 @@ Per-item deep review during focus campaigns. Useful for high-stakes batches.
87
87
 
88
88
  | Verdict | Meaning | Action |
89
89
  |---------|---------|--------|
90
- | `ok` | No findings at any severity | Merge freely |
91
- | `ok_with_minor` | Only low/info findings | Merge with noted follow-ups |
90
+ | `ok` | No findings, or info findings only | Merge freely |
91
+ | `ok_with_minor` | Only low findings (info alone gives `ok`) | Merge with noted follow-ups |
92
92
  | `fix_before_merge` | Medium findings present | Fix or document before merge |
93
93
  | `review_required` | High findings present | Human sign-off required |
94
94
  | `block` | At least one critical | Do not merge |
95
95
 
96
- Verdict is driven by the highest-severity finding across all three sources. Meta-reviewer disputes can downgrade severity on specific findings but don't change the headline verdict — the merger trusts the consensus of the explicit severity labels.
96
+ Verdict is driven by the highest-severity finding across all three sources. Meta-reviewer disputes are listed in the conflict table but change no severity, so they never lower the headline verdict; the meta-reviewer's own findings count toward it like the other two sources'.
97
97
 
98
98
  </verdict_semantics>
99
99
 
@@ -111,18 +111,18 @@ Verdict is driven by the highest-severity finding across all three sources. Meta
111
111
 
112
112
  | Runtime | hardener | meta-reviewer | merge |
113
113
  |---------|----------|---------------|-------|
114
- | Claude Code | Full, thinking enabled (6000/4000 budget) | Full | Full |
114
+ | Claude Code | Full; reasoning depth from the agent's `effort:` frontmatter | Full | Full |
115
115
  | OpenCode | Prose "think step-by-step" preamble substitutes for thinking | Same | Full (runtime-agnostic CLI) |
116
116
  | Gemini | Same | Same | Full |
117
- | Codex | Same | Same | Full |
118
- | Copilot | Same | Same | Full |
117
+ | Codex | Native — `effort:` becomes the agent TOML's `model_reasoning_effort` | Same | Full |
118
+ | Copilot | Prose "think step-by-step" preamble, as on OpenCode | Same | Full |
119
119
 
120
- The merger CLI (`pan-tools review-deep merge`) is pure Node.js and works identically across runtimes. Only the *quality* of the hardener and meta-reviewer outputs varies with model capability — an Opus-class model with extended thinking produces the richest findings.
120
+ The merger CLI (`pan-tools review-deep merge`) is pure Node.js and works identically across runtimes. Only the *quality* of the hardener and meta-reviewer outputs varies with model capability.
121
121
 
122
122
  </runtime_compatibility>
123
123
 
124
124
  <calibration_note>
125
125
 
126
- Deep review is opt-in for a reason: it costs roughly 3× a normal review (hardener + meta + merge adds two agent spawns per phase). Use it for high-stakes phases, not every phase. `--deep-review` gating by phase tags is a v3.4 candidate enhancement.
126
+ Deep review is opt-in for a reason: it costs roughly 3× a normal review (hardener + meta + merge adds two agent spawns per phase). Use it for high-stakes phases, not every phase.
127
127
 
128
128
  </calibration_note>
@@ -15,7 +15,7 @@ Interactive configuration of PAN workflow agents and model profile via multi-que
15
15
  Routes to the settings workflow which handles:
16
16
  - Config existence ensuring
17
17
  - Current settings reading and parsing
18
- - Interactive 5-question prompt (model, research, plan_check, verifier, branching)
18
+ - Interactive multi-question prompt (model profile, research, plan_check, verifier, auto_advance, nyquist_validation, branching strategy, routing strategy)
19
19
  - Config merging and writing
20
20
  - Confirmation display with quick command references
21
21
  </objective>
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  <objective>
14
14
  Capture an idea, task, or issue that surfaces during a PAN session as a structured todo for later work.
15
15
 
16
- Routes to the add-todo workflow which handles:
16
+ Routes to the todo-add workflow which handles:
17
17
  - Directory structure creation
18
18
  - Content extraction from arguments or conversation
19
19
  - Area inference from file paths
@@ -34,7 +34,7 @@ State is resolved in-workflow via `init todos` and targeted reads.
34
34
  </context>
35
35
 
36
36
  <process>
37
- **Follow the add-todo workflow** from `@~/.claude/pan-wizard-core/workflows/todo-add.md`.
37
+ **Follow the todo-add workflow** from `@~/.claude/pan-wizard-core/workflows/todo-add.md`.
38
38
 
39
39
  The workflow handles all logic including:
40
40
  1. Directory ensuring
@@ -13,7 +13,7 @@ allowed-tools:
13
13
  <objective>
14
14
  List all pending todos, allow selection, load full context for the selected todo, and route to appropriate action.
15
15
 
16
- Routes to the check-todos workflow which handles:
16
+ Routes to the todo-check workflow which handles:
17
17
  - Todo counting and listing with area filtering
18
18
  - Interactive selection with full context loading
19
19
  - Roadmap correlation checking
@@ -32,7 +32,7 @@ Todo state and roadmap correlation are loaded in-workflow using `init todos` and
32
32
  </context>
33
33
 
34
34
  <process>
35
- **Follow the check-todos workflow** from `@~/.claude/pan-wizard-core/workflows/todo-check.md`.
35
+ **Follow the todo-check workflow** from `@~/.claude/pan-wizard-core/workflows/todo-check.md`.
36
36
 
37
37
  The workflow handles all logic including:
38
38
  1. Todo existence checking
@@ -74,17 +74,6 @@ After initial verification of each requirement:
74
74
  This prevents premature FAIL verdicts from incomplete investigation.
75
75
  </reflexion_loop>
76
76
 
77
- <cache_priming>
78
- **Before the verifier agent runs**, prime the prompt cache once. The verifier reads project.md / requirements.md / roadmap.md every run; caching avoids ~15-50K input tokens per invocation.
79
-
80
- Run once:
81
- ```
82
- pan-tools cache prime --summary
83
- ```
84
-
85
- See [plan-phase.md](plan-phase.md) or [exec-phase.md](exec-phase.md) for the full explanation. No-op on non-Claude runtimes.
86
- </cache_priming>
87
-
88
77
  <process>
89
78
  Execute the verify-phase workflow from @~/.claude/pan-wizard-core/workflows/verify-phase.md end-to-end.
90
79
  Preserve all workflow gates (the test-suite gate, the truth/artifact/wiring checks, status determination, the verification report).
@@ -56,7 +56,7 @@ If worktree creation fails (not a git repo, dirty tree blocking, etc.), abort wi
56
56
 
57
57
  ### Stage 2 — Spawn pan-counterfactual
58
58
 
59
- Spawn the agent with its working directory set to `worktree_path`. Prompt includes:
59
+ Spawn the agent. A spawn cannot set its working directory — it starts in the main project — so the prompt's `<worktree_path>` is where it must work. Prompt includes:
60
60
  - `<files_to_read>` — the phase plan, any existing summary, the main project's `CLAUDE.md` so the agent understands conventions.
61
61
  - `<scenario>` — the user's scenario text verbatim.
62
62
  - `<worktree_path>` — so the agent knows the safe boundary.
@@ -69,7 +69,7 @@ The agent explores, then returns a JSON payload with `{summary, differences, rec
69
69
  Run (from main tree, NOT worktree):
70
70
 
71
71
  ```
72
- pan-tools whatif report <phase> "<scenario>" --comparison '<agent-json>'
72
+ pan-tools whatif report <phase> "<scenario>" --comparison "$(cat <comparison-json-file>)"
73
73
  ```
74
74
 
75
75
  This writes `.planning/counterfactuals/<phase>-<slug>.md`. The file belongs to the main tree and survives worktree cleanup.