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
@@ -19,7 +19,7 @@ Create executable phase prompts (plan.md files) for a roadmap phase with integra
19
19
 
20
20
  **Default flow:** Research (if needed) → Plan → Verify → Done
21
21
 
22
- **Design input (ADR-0042):** if `{phase}-design.md` exists (from `/pan:design-phase`, verified by `pan-design-checker`), it is an authoritative upstream input — `pan-planner` implements its approved architecture/decisions and `pan-plan-checker` verifies conformance (Design Conformance dimension). It is optional: a phase without a design.md plans exactly as before.
22
+ **Design input (ADR-0042):** if `{phase}-design.md` exists (from `/pan:design-phase`, verified by `pan-design-checker`), it is an authoritative upstream input — `pan-planner` implements its approved architecture/decisions and `pan-plan-checker` verifies conformance (Design Conformance dimension). It is optional: a phase without a design.md plans exactly as before. The plan-phase workflow does not list it in the planner's or checker's `<files_to_read>`, so they use it only when they find it in the phase directory themselves.
23
23
 
24
24
  **Orchestrator role:** Parse arguments, validate phase, research domain (unless skipped), spawn pan-planner, verify with pan-plan-checker, iterate until pass or max iterations, present results.
25
25
  </objective>
@@ -38,6 +38,7 @@ Phase number: $ARGUMENTS (optional — auto-detects next unplanned phase if omit
38
38
  - `--gaps` — Gap closure mode (reads verification.md, skips research)
39
39
  - `--skip-verify` — Skip verification loop
40
40
  - `--prd <file>` — Use a PRD/acceptance criteria file instead of discuss-phase. Parses requirements into context.md automatically. Skips discuss-phase entirely.
41
+ - `--auto` — Autonomous mode: sets `workflow.auto_advance` and asks nothing (with no context.md it plans from the project-level research, requirements and idea.md); after planning it runs `/pan:exec-phase N --auto --no-transition` and, once the phase completes, prints `Next: /pan:discuss-phase <next phase> --auto` and stops.
41
42
 
42
43
  Normalize phase input in step 2 before any directory lookups.
43
44
  </context>
@@ -48,7 +49,7 @@ During the plan-checker verification iteration:
48
49
  2. For each identified gap: verify it is a genuine gap by re-reading the relevant requirement
49
50
  3. Do not blindly accept all critiques — some may be false positives from missing context
50
51
  4. Revise the plan to address genuine gaps only
51
- 5. Maximum 2 revision iterations (plan → check → revise → check → final)
52
+ 5. At most 2 revisions: the workflow checks up to three times (plan → check → revise → check → revise → check); after the third check the user chooses force proceed, guidance or abandon
52
53
  This prevents over-revision while ensuring real gaps are closed.
53
54
  </reflexion_loop>
54
55
 
@@ -57,7 +58,7 @@ Planning is complete when ALL conditions are met:
57
58
  1. At least one plan.md file created in the phase directory
58
59
  2. Plan-checker passed (or max 2 revision iterations exhausted with final approval)
59
60
  3. Each plan contains: objective, task breakdown with estimates, dependency ordering, and key file links
60
- 4. Research.md exists (unless --skip-research was used)
61
+ 4. Research.md exists, unless research was skipped (`--skip-research`, `--gaps`, `workflow.research: false`, or the single-plan lightweight-phase bypass)
61
62
  5. User presented with results and next-step options
62
63
 
63
64
  Planning FAILS if: phase not found in roadmap, or planner agent returns empty/malformed output after retries.
@@ -67,7 +68,7 @@ Planning FAILS if: phase not found in roadmap, or planner agent returns empty/ma
67
68
  Avoid these planning anti-patterns:
68
69
  ```
69
70
  BAD: Plan has 25 tasks for a single phase → too granular, executor loses context
70
- GOOD: 5-8 tasks per plan, each with clear scope and testable outcome
71
+ GOOD: 2-3 tasks per plan, each with clear scope and testable outcome (more work means more plans)
71
72
 
72
73
  BAD: Task says "Implement the feature" with no file links or acceptance criteria
73
74
  → Executor guesses at scope, misses edge cases
@@ -92,7 +93,7 @@ IF --gaps flag is set:
92
93
  ELSE IF --prd <file> flag is set:
93
94
  → SKIP discuss-phase entirely
94
95
  → PARSE PRD file into context.md
95
- → SKIP research (PRD provides requirements)
96
+ → RUN research as usual (step 3.5 writes context.md from the PRD, then continues to step 5)
96
97
  → PLAN from parsed requirements
97
98
  → VERIFY (unless --skip-verify)
98
99
 
@@ -120,23 +121,12 @@ IF --skip-verify:
120
121
  ELSE:
121
122
  → Spawn pan-plan-checker
122
123
  → IF checker PASSES: done
123
- → IF checker finds gaps (iteration 1): revise plan, re-check
124
- → IF checker finds gaps (iteration 2): final revision, present with caveats
125
- → Max 2 revision iterations
124
+ → IF checker finds gaps (check 1 or 2): revise plan, re-check
125
+ → IF checker finds gaps (check 3): stop revising; the user chooses force proceed (open issues recorded as deferred), guidance and retry, or abandon
126
+ → Max 2 revisions, so at most 3 checks
126
127
  ```
127
128
  </routing_decision_tree>
128
129
 
129
- <cache_priming>
130
- **Before spawning research + planner agents, prime the prompt cache.** All sub-agents spawned within the next 5 minutes hit cached context instead of re-reading project.md / requirements.md / roadmap.md / state.md / standards.md.
131
-
132
- Run once per invocation:
133
- ```
134
- pan-tools cache prime --summary
135
- ```
136
-
137
- Returns `{blocks: [{path, bytes, cache}], total_bytes, sha}`. On a host runtime that supports prompt caching (Claude Code does), the host translates these block references into `cache_control: ephemeral`. Where prompt caching is unavailable this is a no-op — nothing breaks.
138
- </cache_priming>
139
-
140
130
  <process>
141
131
  Execute the plan-phase workflow from @~/.claude/pan-wizard-core/workflows/plan-phase.md end-to-end.
142
132
  Preserve all workflow gates (validation, research, planning, verification loop, routing).
@@ -60,7 +60,7 @@ Consolidates Spec B v1's architect + simulate + predict-milestone into one entry
60
60
  ```
61
61
 
62
62
  **What it does:**
63
- 1. `pan-tools preview milestone` returns `{phases_total, completed, remaining, avg_phase_duration_days, eta_date, confidence_pct, bottleneck, sample_size}`.
63
+ 1. `pan-tools preview milestone` returns `{current_milestone, phases_total, phases_completed, phases_remaining, avg_phase_duration_days, velocity_phases_per_week, eta_date, confidence_pct, bottleneck, sample_size}`.
64
64
  2. Spawn `pan-previewer` with `mode: milestone`.
65
65
  3. Agent writes `.planning/milestones/preview-<today>.md` with ETA + confidence + bottleneck + caveats + bottom line.
66
66
 
@@ -10,7 +10,7 @@ allowed-tools:
10
10
  ---
11
11
 
12
12
  <objective>
13
- Switch the model profile used by PAN agents. Controls which Claude model each agent uses, balancing quality vs token spend.
13
+ Switch the model profile used by PAN agents. Sets the model tier PAN's workflows pass when they spawn an agent (mapped to the detected provider's models), balancing quality vs token spend. `/pan:army` and `pan-conductor` spawn with no model, so the agents they run use their own `model:` pin, else the session model, under every profile.
14
14
 
15
15
  Routes to the profile workflow which handles:
16
16
  - Argument validation (quality/balanced/budget)
@@ -37,7 +37,7 @@ The workflow handles all logic including:
37
37
  </process>
38
38
 
39
39
  <tier_decision_tree>
40
- **Capability-aware routing** (shipped v2.10.0 — E-7). Even within a single profile, PAN picks a tier per-call based on three hints: context estimate, whether the task needs extended thinking, and whether prompt cache is warm.
40
+ **Capability-aware routing** (shipped v2.10.0 — E-7). `resolveModel` can adjust the profile's tier per call from three hints — context estimate, whether the task needs extended thinking, and whether prompt cache is warm — but only when the caller passes them (`resolve-model <agent> --metadata '{…}'`). No shipped workflow, command or agent passes them, so the tree and the quick guide below describe what a caller's hints would do.
41
41
 
42
42
  The decision order `resolveModel` applies after the baseline profile pick:
43
43
 
@@ -2,7 +2,7 @@
2
2
  name: pan:quick
3
3
  group: Session & Progress
4
4
  description: Execute a quick task with PAN guarantees (atomic commits, state tracking) but skip optional agents
5
- argument-hint: "[--full]"
5
+ argument-hint: "[--full] [description]"
6
6
  allowed-tools:
7
7
  - Read
8
8
  - Write
@@ -28,5 +28,5 @@ Roadmap and state are resolved in-workflow via `init phase-op` and targeted read
28
28
 
29
29
  <process>
30
30
  Execute the remove-phase workflow from @~/.claude/pan-wizard-core/workflows/remove-phase.md end-to-end.
31
- Preserve all validation gates (future phase check, work check), renumbering logic, and commit.
31
+ Preserve all validation gates (future phase check, work check), renumbering logic, and commit. The removal deletes tracked files, so commit with `--force` once the user has confirmed it: without it `pan-tools commit` refuses any pending deletion (`deleted_files_detected`).
32
32
  </process>
@@ -2,7 +2,7 @@
2
2
  name: pan:report
3
3
  group: Observability
4
4
  description: Generate a self-contained HTML report for one phase, or a project-level timeline index linking every phase report
5
- argument-hint: "phase <N> | index [--bundle] | all [--out <file>] [--open] [--stdout]"
5
+ argument-hint: "phase <N> [--out <file>] [--open] [--stdout] | index [--out <file>] [--open] [--stdout] [--bundle] | all [--open]"
6
6
  allowed-tools:
7
7
  - Read
8
8
  - Bash
@@ -48,7 +48,7 @@ pan-tools report all [--open]
48
48
  {
49
49
  "action": "phase",
50
50
  "phase": "03",
51
- "path": ".planning/phases/03-auth-sessions/03-report.html",
51
+ "path": "/abs/path/to/project/.planning/phases/03-auth-sessions/03-report.html",
52
52
  "bytes": 16183,
53
53
  "status": "complete",
54
54
  "written": true,
@@ -2,7 +2,7 @@
2
2
  name: pan:research-phase
3
3
  group: Phase Lifecycle
4
4
  description: Research how to implement a phase (standalone - usually use /pan:plan-phase instead)
5
- argument-hint: "[phase]"
5
+ argument-hint: "<phase>"
6
6
  allowed-tools:
7
7
  - Read
8
8
  - Bash
@@ -38,7 +38,7 @@ Normalize phase input in step 1 before any directory lookups.
38
38
  INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "$ARGUMENTS")
39
39
  ```
40
40
 
41
- Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `phase_found`, `commit_docs`, `has_research`, `state_path`, `requirements_path`, `context_path`, `research_path`.
41
+ Extract from init JSON: `phase_dir`, `padded_phase`, `phase_slug`, `phase_number`, `phase_name`, `phase_found`, `commit_docs`, `has_research`, `state_path`, `requirements_path`, `context_path`, `research_path`. `phase_dir` is null when the phase is in the roadmap but has no directory yet: create it (`mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"`) and use that path as `phase_dir`, as discuss-phase does.
42
42
 
43
43
  Resolve researcher model:
44
44
  ```bash
@@ -63,8 +63,11 @@ Use `has_research` and `research_path` from INIT.
63
63
 
64
64
  ## 3. Gather Phase Context
65
65
 
66
- Use paths from INIT (do not inline file contents in orchestrator context):
67
- - `requirements_path`
66
+ Write this phase's roadmap slice (its section, its dependencies' goals and its requirement lines), then use paths from INIT (do not inline file contents in orchestrator context):
67
+ ```bash
68
+ SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${phase_number}" --write --raw)
69
+ ```
70
+ - `slice_path` (from the command above; `requirements_path` if it is empty)
68
71
  - `context_path`
69
72
  - `state_path`
70
73
 
@@ -72,7 +75,7 @@ Present summary with phase description and what files the researcher will load.
72
75
 
73
76
  ## 4. Spawn pan-phase-researcher Agent
74
77
 
75
- Research modes: ecosystem (default), feasibility, implementation, comparison.
78
+ Research mode: the prompt below names `ecosystem`; pan-phase-researcher defines no modes, so treat it as context, not a switch.
76
79
 
77
80
  ```markdown
78
81
  <research_type>
@@ -98,7 +101,7 @@ Mode: ecosystem
98
101
  </objective>
99
102
 
100
103
  <files_to_read>
101
- - {requirements_path} (Requirements)
104
+ - {slice_path} (This phase's roadmap and requirements)
102
105
  - {context_path} (Phase context from discuss-phase, if exists)
103
106
  - {state_path} (Prior project decisions and blockers)
104
107
  </files_to_read>
@@ -128,7 +131,7 @@ Before declaring complete, verify:
128
131
  </quality_gate>
129
132
 
130
133
  <output>
131
- Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-research.md
134
+ Write to: {phase_dir}/{padded_phase}-research.md
132
135
  </output>
133
136
  ```
134
137
 
@@ -145,9 +148,7 @@ Task(
145
148
 
146
149
  **`## RESEARCH COMPLETE`:** Display summary, offer: Plan phase, Dig deeper, Review full, Done.
147
150
 
148
- **`## CHECKPOINT REACHED`:** Present to user, get response, spawn continuation.
149
-
150
- **`## RESEARCH INCONCLUSIVE`:** Show what was attempted, offer: Add context, Try different mode, Manual.
151
+ **`## RESEARCH BLOCKED`:** Show the blocker and what was attempted, offer: Provide context (then spawn a continuation, step 6), Skip research, Abort.
151
152
 
152
153
  ## 6. Spawn Continuation Agent
153
154
 
@@ -158,7 +159,7 @@ Continue research for Phase {phase_number}: {phase_name}
158
159
 
159
160
  <prior_state>
160
161
  <files_to_read>
161
- - .planning/phases/${PHASE}-{slug}/${PHASE}-research.md (Existing research)
162
+ - {phase_dir}/{padded_phase}-research.md (Existing research)
162
163
  </files_to_read>
163
164
  </prior_state>
164
165
 
@@ -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
 
@@ -114,8 +114,8 @@ Verdict is driven by the highest-severity finding across all three sources. Meta
114
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
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
 
@@ -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>
@@ -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.