pan-wizard 3.33.0 → 3.35.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 (214) hide show
  1. package/README.md +29 -26
  2. package/agents/pan-conductor.md +18 -17
  3. package/agents/pan-counterfactual.md +2 -2
  4. package/agents/pan-debugger.md +30 -9
  5. package/agents/pan-design-checker.md +2 -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 +30 -9
  10. package/agents/pan-experiment-runner.md +9 -8
  11. package/agents/pan-hardener.md +1 -1
  12. package/agents/pan-integration-checker.md +2 -2
  13. package/agents/pan-knowledge.md +1 -1
  14. package/agents/pan-meta-reviewer.md +4 -4
  15. package/agents/pan-optimizer.md +39 -43
  16. package/agents/pan-phase-researcher.md +10 -10
  17. package/agents/pan-plan-checker.md +37 -34
  18. package/agents/pan-planner.md +57 -44
  19. package/agents/pan-previewer.md +1 -1
  20. package/agents/pan-project-researcher.md +12 -12
  21. package/agents/pan-release.md +1 -1
  22. package/agents/pan-research-synthesizer.md +3 -3
  23. package/agents/pan-reviewer.md +26 -3
  24. package/agents/pan-roadmapper.md +15 -14
  25. package/agents/pan-verifier.md +33 -25
  26. package/bin/install-lib.cjs +176 -38
  27. package/bin/install.js +81 -63
  28. package/commands/pan/army.md +15 -11
  29. package/commands/pan/assumptions.md +2 -2
  30. package/commands/pan/audit-deployment.md +11 -12
  31. package/commands/pan/cost.md +8 -8
  32. package/commands/pan/dashboard.md +0 -3
  33. package/commands/pan/debug.md +10 -7
  34. package/commands/pan/design-phase.md +5 -5
  35. package/commands/pan/discuss-phase.md +2 -0
  36. package/commands/pan/exec-phase.md +21 -37
  37. package/commands/pan/experiment.md +9 -8
  38. package/commands/pan/focus-auto.md +22 -20
  39. package/commands/pan/focus-design.md +7 -6
  40. package/commands/pan/focus-doc-audit.md +4 -3
  41. package/commands/pan/focus-drift-walking.md +4 -3
  42. package/commands/pan/focus-exec.md +6 -6
  43. package/commands/pan/focus-plan.md +12 -11
  44. package/commands/pan/focus-scan.md +5 -3
  45. package/commands/pan/focus-sync.md +3 -2
  46. package/commands/pan/git.md +8 -8
  47. package/commands/pan/health.md +2 -2
  48. package/commands/pan/hud.md +4 -7
  49. package/commands/pan/hygiene.md +14 -7
  50. package/commands/pan/knowledge.md +9 -10
  51. package/commands/pan/learn.md +10 -7
  52. package/commands/pan/links.md +4 -1
  53. package/commands/pan/map-codebase.md +1 -1
  54. package/commands/pan/mcp-bridge.md +19 -21
  55. package/commands/pan/milestone-done.md +6 -3
  56. package/commands/pan/milestone-new.md +1 -1
  57. package/commands/pan/new-project.md +10 -10
  58. package/commands/pan/optimize.md +18 -14
  59. package/commands/pan/patches.md +2 -6
  60. package/commands/pan/pause.md +1 -1
  61. package/commands/pan/phase-tests.md +3 -2
  62. package/commands/pan/plan-phase.md +9 -19
  63. package/commands/pan/preview.md +2 -3
  64. package/commands/pan/profile.md +2 -2
  65. package/commands/pan/quick.md +1 -1
  66. package/commands/pan/remove-phase.md +1 -1
  67. package/commands/pan/report.md +3 -7
  68. package/commands/pan/research-phase.md +16 -15
  69. package/commands/pan/resume.md +9 -11
  70. package/commands/pan/retro.md +5 -3
  71. package/commands/pan/review-deep.md +7 -9
  72. package/commands/pan/settings.md +1 -1
  73. package/commands/pan/verify-phase.md +0 -11
  74. package/commands/pan/what-if.md +3 -4
  75. package/hooks/dist/pan-context-monitor.js +352 -44
  76. package/hooks/dist/pan-cost-logger.js +30 -0
  77. package/hooks/dist/pan-guard.js +244 -0
  78. package/hooks/dist/pan-statusline.js +73 -24
  79. package/hooks/dist/pan-stop-guard.js +7 -2
  80. package/package.json +1 -1
  81. package/pan-wizard-core/bin/lib/agents-md.cjs +44 -6
  82. package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
  83. package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
  84. package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
  85. package/pan-wizard-core/bin/lib/commands.cjs +57 -6
  86. package/pan-wizard-core/bin/lib/config.cjs +7 -1
  87. package/pan-wizard-core/bin/lib/constants.cjs +18 -6
  88. package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
  89. package/pan-wizard-core/bin/lib/core.cjs +53 -19
  90. package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
  91. package/pan-wizard-core/bin/lib/cost.cjs +142 -13
  92. package/pan-wizard-core/bin/lib/distill.cjs +6 -3
  93. package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
  94. package/pan-wizard-core/bin/lib/findings.cjs +135 -21
  95. package/pan-wizard-core/bin/lib/focus.cjs +13 -4
  96. package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
  97. package/pan-wizard-core/bin/lib/hygiene.cjs +184 -17
  98. package/pan-wizard-core/bin/lib/init.cjs +13 -4
  99. package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
  100. package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
  101. package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
  102. package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
  103. package/pan-wizard-core/bin/lib/memory.cjs +508 -54
  104. package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
  105. package/pan-wizard-core/bin/lib/optimize.cjs +97 -17
  106. package/pan-wizard-core/bin/lib/phase-gate.cjs +174 -0
  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 +39 -13
  110. package/pan-wizard-core/bin/lib/preview.cjs +34 -31
  111. package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
  112. package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
  113. package/pan-wizard-core/bin/lib/runner.cjs +2 -1
  114. package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
  115. package/pan-wizard-core/bin/lib/state.cjs +43 -28
  116. package/pan-wizard-core/bin/lib/template.cjs +11 -4
  117. package/pan-wizard-core/bin/lib/verdict.cjs +140 -10
  118. package/pan-wizard-core/bin/lib/verify-integrity.cjs +181 -0
  119. package/pan-wizard-core/bin/lib/verify-plan-set.cjs +230 -0
  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 +11 -7
  123. package/pan-wizard-core/bin/lib/verify.cjs +30 -28
  124. package/pan-wizard-core/bin/lib/whatif.cjs +53 -9
  125. package/pan-wizard-core/bin/pan-tools.cjs +114 -19
  126. package/pan-wizard-core/learnings/index.json +5 -5
  127. package/pan-wizard-core/mcp/merge-gate.cjs +14 -3
  128. package/pan-wizard-core/mcp/native-tools.cjs +3 -3
  129. package/pan-wizard-core/opencode/pan-wizard.js +139 -0
  130. package/pan-wizard-core/references/checkpoints.md +3 -3
  131. package/pan-wizard-core/references/continuation-format.md +3 -3
  132. package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
  133. package/pan-wizard-core/references/design-methodology.md +1 -1
  134. package/pan-wizard-core/references/git-integration.md +4 -6
  135. package/pan-wizard-core/references/git-planning-commit.md +2 -2
  136. package/pan-wizard-core/references/guardrails.md +2 -2
  137. package/pan-wizard-core/references/handoff-decisions.md +3 -3
  138. package/pan-wizard-core/references/model-profile-resolution.md +5 -5
  139. package/pan-wizard-core/references/model-profiles.md +15 -10
  140. package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
  141. package/pan-wizard-core/references/planning-config.md +7 -7
  142. package/pan-wizard-core/references/tdd.md +10 -1
  143. package/pan-wizard-core/references/verdict-contract.md +6 -1
  144. package/pan-wizard-core/references/verification-patterns.md +5 -5
  145. package/pan-wizard-core/templates/codebase/architecture.md +2 -2
  146. package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
  147. package/pan-wizard-core/templates/codebase/concerns.md +3 -3
  148. package/pan-wizard-core/templates/codebase/integrations.md +6 -6
  149. package/pan-wizard-core/templates/codebase/relationships.md +2 -2
  150. package/pan-wizard-core/templates/codebase/stack.md +2 -2
  151. package/pan-wizard-core/templates/codebase/structure.md +4 -4
  152. package/pan-wizard-core/templates/codebase/testing.md +4 -4
  153. package/pan-wizard-core/templates/config.json +2 -6
  154. package/pan-wizard-core/templates/continue-here.md +1 -1
  155. package/pan-wizard-core/templates/debug-subagent-prompt.md +5 -3
  156. package/pan-wizard-core/templates/debug.md +15 -1
  157. package/pan-wizard-core/templates/milestone-archive.md +6 -6
  158. package/pan-wizard-core/templates/milestone.md +1 -1
  159. package/pan-wizard-core/templates/phase-prompt.md +31 -17
  160. package/pan-wizard-core/templates/planner-subagent-prompt.md +5 -5
  161. package/pan-wizard-core/templates/preview-report.md +1 -1
  162. package/pan-wizard-core/templates/research-project/architecture.md +3 -3
  163. package/pan-wizard-core/templates/research-project/features.md +1 -1
  164. package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
  165. package/pan-wizard-core/templates/research-project/stack.md +3 -3
  166. package/pan-wizard-core/templates/research.md +5 -5
  167. package/pan-wizard-core/templates/retrospective.md +1 -1
  168. package/pan-wizard-core/templates/roadmap.md +15 -15
  169. package/pan-wizard-core/templates/state.md +4 -4
  170. package/pan-wizard-core/templates/summary-complex.md +1 -0
  171. package/pan-wizard-core/templates/summary-minimal.md +1 -0
  172. package/pan-wizard-core/templates/summary-standard.md +2 -1
  173. package/pan-wizard-core/templates/summary.md +18 -2
  174. package/pan-wizard-core/templates/uat.md +3 -3
  175. package/pan-wizard-core/templates/user-setup.md +8 -8
  176. package/pan-wizard-core/templates/verification-report.md +53 -8
  177. package/pan-wizard-core/workflows/add-phase.md +1 -1
  178. package/pan-wizard-core/workflows/assumptions.md +1 -1
  179. package/pan-wizard-core/workflows/diagnose-issues.md +4 -4
  180. package/pan-wizard-core/workflows/discuss-phase.md +10 -8
  181. package/pan-wizard-core/workflows/exec-phase.md +75 -95
  182. package/pan-wizard-core/workflows/execute-plan.md +8 -7
  183. package/pan-wizard-core/workflows/health.md +13 -12
  184. package/pan-wizard-core/workflows/help.md +8 -9
  185. package/pan-wizard-core/workflows/learn.md +13 -11
  186. package/pan-wizard-core/workflows/map-codebase.md +10 -10
  187. package/pan-wizard-core/workflows/milestone-audit.md +10 -10
  188. package/pan-wizard-core/workflows/milestone-gaps.md +18 -25
  189. package/pan-wizard-core/workflows/milestone-new.md +7 -6
  190. package/pan-wizard-core/workflows/new-project.md +17 -25
  191. package/pan-wizard-core/workflows/optimize.md +11 -9
  192. package/pan-wizard-core/workflows/pause.md +6 -1
  193. package/pan-wizard-core/workflows/phase-tests.md +4 -4
  194. package/pan-wizard-core/workflows/plan-phase.md +53 -42
  195. package/pan-wizard-core/workflows/profile.md +2 -2
  196. package/pan-wizard-core/workflows/progress.md +6 -8
  197. package/pan-wizard-core/workflows/quick.md +7 -5
  198. package/pan-wizard-core/workflows/remove-phase.md +1 -1
  199. package/pan-wizard-core/workflows/research-phase.md +9 -5
  200. package/pan-wizard-core/workflows/resume-project.md +4 -6
  201. package/pan-wizard-core/workflows/retro.md +3 -1
  202. package/pan-wizard-core/workflows/settings.md +16 -24
  203. package/pan-wizard-core/workflows/todo-check.md +4 -3
  204. package/pan-wizard-core/workflows/transition.md +16 -12
  205. package/pan-wizard-core/workflows/update.md +25 -17
  206. package/pan-wizard-core/workflows/verify-phase.md +22 -20
  207. package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
  208. package/pan-zcode/README.md +7 -7
  209. package/pan-zcode/bin/install-zcode.js +1 -1
  210. package/scripts/build-hooks.js +1 -0
  211. package/scripts/build-plugin.js +3 -1
  212. package/scripts/generate-skills-docs.py +15 -6
  213. package/scripts/prompt-lint.cjs +167 -0
  214. package/scripts/test-surface.cjs +1 -0
@@ -35,10 +35,10 @@ See: .planning/project.md (updated [date])
35
35
  - Average duration: [X] min
36
36
  - Total execution time: [X.X] hours
37
37
 
38
- **By Phase:**
38
+ **By Plan:** (one row per plan, written by `state record-metric`)
39
39
 
40
- | Phase | Plans | Total | Avg/Plan |
41
- |-------|-------|-------|----------|
40
+ | Plan | Duration | Tasks | Files |
41
+ |------|----------|-------|-------|
42
42
  | - | - | - | - |
43
43
 
44
44
  **Recent Trend:**
@@ -139,7 +139,7 @@ Progress calculation: (completed plans) / (total plans across all phases) × 100
139
139
  Track velocity to understand execution patterns:
140
140
  - Total plans completed
141
141
  - Average duration per plan
142
- - Per-phase breakdown
142
+ - Per-plan rows (phase, plan, duration, tasks, files)
143
143
  - Recent trend (improving/stable/degrading)
144
144
 
145
145
  Updated after each plan completion.
@@ -19,6 +19,7 @@ key-decisions:
19
19
  - "Decision 1"
20
20
  patterns-established:
21
21
  - "Pattern 1: description"
22
+ requirements-completed: []
22
23
  duration: Xmin
23
24
  completed: YYYY-MM-DD
24
25
  ---
@@ -13,6 +13,7 @@ key-files:
13
13
  created: [important files created]
14
14
  modified: [important files modified]
15
15
  key-decisions: []
16
+ requirements-completed: []
16
17
  duration: Xmin
17
18
  completed: YYYY-MM-DD
18
19
  ---
@@ -6,7 +6,8 @@ tags: [searchable tech]
6
6
  provides:
7
7
  - [bullet list of what was built/delivered]
8
8
  affects: [list of phase names or keywords]
9
- test-tiers: [] # Optional — Test tiers exercised: [unit, integration, e2e, visual]
9
+ requirements-completed: []
10
+ test-tiers: []
10
11
  tech-stack:
11
12
  added: [libraries/tools]
12
13
  patterns: [architectural/code patterns]
@@ -38,8 +38,10 @@ patterns-established:
38
38
  - "Pattern 1: description"
39
39
  - "Pattern 2: description"
40
40
 
41
- requirements-completed: [] # REQUIRED — Copy ALL requirement IDs from this plan's `requirements` frontmatter field.
42
- test-tiers: [] # Optional — Test tiers exercised in this plan: [unit, integration, e2e, visual]
41
+ # requirements-completed: REQUIRED — copy ALL requirement IDs from this plan's `requirements` frontmatter field
42
+ requirements-completed: []
43
+ # test-tiers: optional — the test tiers this plan exercised (unit, integration, e2e, visual)
44
+ test-tiers: []
43
45
 
44
46
  # Metrics
45
47
  duration: Xmin
@@ -79,6 +81,20 @@ _Note: TDD tasks may have multiple commits (test → feat → refactor)_
79
81
  - `path/to/file.ts` - What it does
80
82
  - `path/to/another.ts` - What it does
81
83
 
84
+ ## Implementation Decisions
85
+ <!-- Schema: @~/.claude/pan-wizard-core/references/handoff-decisions.md -->
86
+
87
+ ### Taken (within plan's discretion)
88
+ - DT-1: Chose [option] for O-N. Reason: [rationale].
89
+
90
+ ### Deviations (from plan; must explain)
91
+ - DV-1: Plan said [X]; I did [Y]. Reason: [rationale]. Verification: [how I confirmed Y is acceptable].
92
+
93
+ ### Open questions for verifier
94
+ - Q-1: [question]. Why it matters: [stake].
95
+
96
+ <!-- If none: replace ALL three buckets with "No deviations or open questions — implementation followed plan exactly." -->
97
+
82
98
  ## Decisions Made
83
99
  [Key decisions with brief rationale, or "None - followed plan as specified"]
84
100
 
@@ -8,7 +8,7 @@ Template for `.planning/phases/XX-name/{phase_num}-uat.md` — persistent UAT se
8
8
 
9
9
  ```markdown
10
10
  ---
11
- status: testing | complete | diagnosed
11
+ status: testing | complete | diagnosed | resolved
12
12
  phase: XX-name
13
13
  source: [list of summary.md files tested]
14
14
  started: [ISO timestamp]
@@ -74,7 +74,7 @@ skipped: [N]
74
74
  <section_rules>
75
75
 
76
76
  **Frontmatter:**
77
- - `status`: OVERWRITE - "testing" or "complete"
77
+ - `status`: OVERWRITE - "testing", "complete", "diagnosed" (after diagnosis) or "resolved" (exec-phase closes the gaps)
78
78
  - `phase`: IMMUTABLE - set on creation
79
79
  - `source`: IMMUTABLE - SUMMARY files being tested
80
80
  - `started`: IMMUTABLE - set on creation
@@ -106,7 +106,7 @@ skipped: [N]
106
106
 
107
107
  **After testing complete (status: complete), if gaps exist:**
108
108
 
109
- 1. User runs diagnosis (from verify-phase offer or manually)
109
+ 1. User runs diagnosis (on Claude Code, the native `/pan-diagnose-issues <phase>`; no `/pan:` command or verify-phase step runs it)
110
110
  2. diagnose-issues workflow spawns parallel debug agents
111
111
  3. Each agent investigates one gap, returns root cause
112
112
  4. uat.md Gaps section updated with diagnosis:
@@ -8,7 +8,7 @@ Template for `.planning/phases/XX-name/{phase}-USER-SETUP.md` - human-required c
8
8
 
9
9
  ## File Template
10
10
 
11
- ```markdown
11
+ ~~~markdown
12
12
  # Phase {X}: User Setup Required
13
13
 
14
14
  **Generated:** [YYYY-MM-DD]
@@ -55,7 +55,7 @@ Expected results:
55
55
  ---
56
56
 
57
57
  **Once all items complete:** Mark status as "Complete" at top of file.
58
- ```
58
+ ~~~
59
59
 
60
60
  ---
61
61
 
@@ -117,7 +117,7 @@ user_setup:
117
117
  ## Service-Specific Examples
118
118
 
119
119
  <stripe_example>
120
- ```markdown
120
+ ~~~markdown
121
121
  # Phase 10: User Setup Required
122
122
 
123
123
  **Generated:** 2025-01-14
@@ -188,11 +188,11 @@ Expected: Build passes, webhook returns 400 (signature validation working).
188
188
  ---
189
189
 
190
190
  **Once all items complete:** Mark status as "Complete" at top of file.
191
- ```
191
+ ~~~
192
192
  </stripe_example>
193
193
 
194
194
  <supabase_example>
195
- ```markdown
195
+ ~~~markdown
196
196
  # Phase 2: User Setup Required
197
197
 
198
198
  **Generated:** 2025-01-14
@@ -242,11 +242,11 @@ npx supabase status
242
242
  ---
243
243
 
244
244
  **Once all items complete:** Mark status as "Complete" at top of file.
245
- ```
245
+ ~~~
246
246
  </supabase_example>
247
247
 
248
248
  <sendgrid_example>
249
- ```markdown
249
+ ~~~markdown
250
250
  # Phase 5: User Setup Required
251
251
 
252
252
  **Generated:** 2025-01-14
@@ -297,7 +297,7 @@ curl -X POST http://localhost:3000/api/test-email \
297
297
  ---
298
298
 
299
299
  **Once all items complete:** Mark status as "Complete" at top of file.
300
- ```
300
+ ~~~
301
301
  </sendgrid_example>
302
302
 
303
303
  ---
@@ -10,16 +10,34 @@ Template for `.planning/phases/XX-name/{phase_num}-verification.md` — phase go
10
10
  ---
11
11
  phase: XX-name
12
12
  verified: YYYY-MM-DDTHH:MM:SSZ
13
- verified_commit: <sha> # git rev-parse HEAD before writing this file; `pan-tools verify stale` compares against it
13
+ # verified_commit: git rev-parse HEAD before writing this file; `pan-tools verify stale` compares against it
14
+ verified_commit: <sha>
14
15
  status: passed | gaps_found | human_needed
15
16
  score: N/M must-haves verified
16
17
  test_gate: passed | failed | skipped
17
- not_checked: # Only for checks that could not run, with why — a skipped test gate is one
18
- - check: "tests"
19
- reason: "no test script in package.json"
20
- unrequested: # Only when the scope check (`pan-tools verify scope <phase>`) found work no plan asked for
21
- - path: "src/admin/panel.tsx"
22
- what: "An admin panel no plan or requirement asked for"
18
+ # Only for checks that could not run, with why (a skipped test gate is one): write not_checked uncommented
19
+ # not_checked:
20
+ # - check: "tests"
21
+ # reason: "no test script in package.json"
22
+ # Only if status: gaps_found; read by `findings record` and /pan:plan-phase --gaps: write gaps uncommented
23
+ # gaps:
24
+ # - truth: "Observable truth that failed"
25
+ # status: failed
26
+ # reason: "Why it failed"
27
+ # artifacts:
28
+ # - path: "src/path/to/file.tsx"
29
+ # issue: "What's wrong"
30
+ # missing:
31
+ # - "Specific thing to add/fix"
32
+ # Only if status: human_needed: write human_verification uncommented
33
+ # human_verification:
34
+ # - test: "What to do"
35
+ # expected: "What should happen"
36
+ # why_human: "Why it cannot be verified programmatically"
37
+ # Only when the scope check (`pan-tools verify scope <phase>`) found work no plan asked for: write unrequested uncommented
38
+ # unrequested:
39
+ # - path: "src/admin/panel.tsx"
40
+ # what: "An admin panel no plan or requirement asked for"
23
41
  ---
24
42
 
25
43
  # Phase {X}: {Name} Verification Report
@@ -212,8 +230,35 @@ Unrequested work is recorded, not blocking: the status does not change because o
212
230
  ---
213
231
  phase: 03-chat
214
232
  verified: 2025-01-15T14:30:00Z
233
+ verified_commit: 4f2a9c1
215
234
  status: gaps_found
216
- score: 2/5 must-haves verified
235
+ score: 1/5 must-haves verified
236
+ test_gate: passed
237
+ gaps:
238
+ - truth: "User can see existing messages"
239
+ status: failed
240
+ reason: "Chat.tsx renders a placeholder, not message data"
241
+ artifacts:
242
+ - path: "src/components/Chat.tsx"
243
+ issue: "Returns a placeholder div and fetches nothing"
244
+ missing:
245
+ - "Fetch from /api/chat and render the messages"
246
+ - truth: "User can send a message"
247
+ status: failed
248
+ reason: "The onSubmit handler only logs"
249
+ artifacts:
250
+ - path: "src/components/ChatInput.tsx"
251
+ issue: "onSubmit calls console.log, no fetch"
252
+ missing:
253
+ - "POST to /api/chat on submit"
254
+ - truth: "Sent message appears in list"
255
+ status: failed
256
+ reason: "No state update after send, and the API routes return hardcoded values"
257
+ artifacts:
258
+ - path: "src/app/api/chat/route.ts"
259
+ issue: "GET returns [], POST returns { ok: true }, no database call"
260
+ missing:
261
+ - "prisma.message.findMany and create in the route handlers, and a list refresh after send"
217
262
  ---
218
263
 
219
264
  # Phase 3: Chat Interface Verification Report
@@ -52,7 +52,7 @@ The CLI handles:
52
52
  - Calculating next phase number (max + 1)
53
53
  - Generating slug from description
54
54
  - Creating the phase directory (`.planning/phases/{NN}-{slug}/`)
55
- - Inserting the phase entry into roadmap.md with Goal, Depends on, and Plans sections
55
+ - Inserting the phase into roadmap.md: its checklist line, and a section with Goal, Requirements, Depends on and Plans lines
56
56
 
57
57
  Extract from result: `phase_number`, `padded`, `name`, `slug`, `directory`.
58
58
  </step>
@@ -24,7 +24,7 @@ Exit workflow.
24
24
  Validate phase exists in roadmap:
25
25
 
26
26
  ```bash
27
- cat .planning/roadmap.md | grep -i "Phase ${PHASE}"
27
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}" # found, phase_name, goal, success_criteria, section
28
28
  ```
29
29
 
30
30
  **If phase not found:**
@@ -81,6 +81,7 @@ For each gap, fill the debug-subagent-prompt template and spawn:
81
81
  Task(
82
82
  prompt=filled_debug_subagent_prompt + "\n\n<files_to_read>\n- {phase_dir}/{phase_num}-uat.md\n- .planning/state.md\n</files_to_read>",
83
83
  subagent_type="pan-debugger",
84
+ model="{debugger_model}", # node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-debugger --raw
84
85
  description="Debug: {issue_summary_short}"
85
86
  )
86
87
  ```
@@ -181,11 +182,10 @@ Display:
181
182
 
182
183
  Debug sessions: ${DEBUG_DIR}/
183
184
 
184
- Proceeding to plan fixes...
185
+ Next: /pan:plan-phase {phase_num} --gaps
185
186
  ```
186
187
 
187
- Return to verify-phase orchestrator for automatic planning.
188
- Do NOT offer manual next steps - verify-phase handles the rest.
188
+ No command runs this workflow as a sub-step, so end by giving the user the next step: `/pan:plan-phase {phase_num} --gaps` (it reads the diagnosed uat.md).
189
189
  </step>
190
190
 
191
191
  </process>
@@ -217,5 +217,5 @@ Agents only diagnose—plan-phase --gaps handles fixes (no fix application).
217
217
  - [ ] Root causes collected from all agents
218
218
  - [ ] uat.md gaps updated with artifacts and missing
219
219
  - [ ] Debug sessions saved to ${DEBUG_DIR}/
220
- - [ ] Hand off to verify-phase for automatic planning
220
+ - [ ] Next step shown: /pan:plan-phase {phase_num} --gaps
221
221
  </success_criteria>
@@ -130,7 +130,7 @@ Exit workflow.
130
130
  </step>
131
131
 
132
132
  <step name="auto_mode_bypass">
133
- **P-1803 fix (v3.7.8):** When `--auto` is set or `workflow.auto_advance: true`, **skip the entire question-driven discussion** and synthesize a minimal `context.md` directly from upstream artifacts. The 6 unguarded `AskUserQuestion` calls in this workflow (lines ~140, 156, 208, 261, 264, 278) all stall headless `claude -p` sessions immediately. Surfaced by the wookie autonomous build (v3.7.7): retry attempts via `/pan:discuss-phase 3 --auto` exited in 75s with $0.42 cost and zero commits before plan-phase auto-mode was patched to bypass discuss-phase entirely. This step makes discuss-phase itself auto-mode-safe, so it can be re-introduced into the auto pipeline cleanly.
133
+ **P-1803 fix (v3.7.8):** When `--auto` is set or `workflow.auto_advance: true`, **skip the entire question-driven discussion** and synthesize a minimal `context.md` directly from upstream artifacts. The unguarded `AskUserQuestion` calls in `check_existing`, `present_gray_areas` and `discuss_areas` all stall headless `claude -p` sessions immediately. Surfaced by the wookie autonomous build (v3.7.7): retry attempts via `/pan:discuss-phase 3 --auto` exited in 75s with 42 cents of cost and zero commits before plan-phase auto-mode was patched to bypass discuss-phase entirely. This step makes discuss-phase itself auto-mode-safe, so it can be re-introduced into the auto pipeline cleanly.
134
134
 
135
135
  Detect auto mode:
136
136
 
@@ -152,7 +152,7 @@ Skip the interactive flow. Generate `context.md` from the roadmap goal + idea.md
152
152
 
153
153
  2. Read inputs:
154
154
  ```bash
155
- ROADMAP_GOAL=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}" --raw | sed -n '/^Goal:/,/^$/p')
155
+ PHASE_JSON=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}") # JSON: goal, success_criteria, section
156
156
  IDEA_PATH=".planning/idea.md"
157
157
  PROJECT_PATH=".planning/project.md"
158
158
  REQ_PATH=".planning/requirements.md"
@@ -170,7 +170,7 @@ REQ_PATH=".planning/requirements.md"
170
170
  <domain>
171
171
  ## Phase Boundary
172
172
 
173
- [Goal extracted verbatim from roadmap.md]
173
+ [The `goal` from PHASE_JSON, verbatim]
174
174
 
175
175
  </domain>
176
176
 
@@ -181,7 +181,7 @@ REQ_PATH=".planning/requirements.md"
181
181
  [For each item in idea.md "Constraints" / "Scope" / "Notes for the planner" sections that mentions Phase ${PHASE} or its domain keywords (e.g., "image pipeline" for Phase 3) — extract as a locked decision, prefixed with the domain name]
182
182
 
183
183
  ### From requirements.md
184
- [For each requirement marked Active that maps to Phase ${PHASE} via `requirements.md`'s phase column — list as a locked decision]
184
+ [For each requirement the phase's slice lists under "Its requirements" (`pan-tools roadmap slice ${PHASE} --raw`) — list as a locked decision]
185
185
 
186
186
  ### Claude's Discretion
187
187
  - Implementation patterns within the constraints above (the planner decides specific libraries / file layouts / function shapes)
@@ -213,7 +213,8 @@ None — auto-mode synthesis honors the original idea.md scope.
213
213
 
214
214
  Write the file:
215
215
  ```bash
216
- mkdir -p "${phase_dir}"
216
+ # phase_dir is null when the phase has no directory yet: create it (the printed path is phase_dir)
217
+ case "{phase_dir}" in ""|null) node ~/.claude/pan-wizard-core/bin/pan-tools.cjs scaffold phase-dir --phase "${PHASE}" --name "{phase_name}" --raw ;; esac
217
218
  # Use Write tool (NOT heredoc) to create ${phase_dir}/${PADDED_PHASE}-context.md
218
219
  ```
219
220
 
@@ -278,7 +279,7 @@ If "Cancel": Exit workflow.
278
279
  <step name="analyze_phase">
279
280
  Analyze the phase to identify gray areas worth discussing.
280
281
 
281
- **Read the phase description from roadmap.md and determine:**
282
+ **Read the phase's section (`roadmap get-phase "${PHASE}"`: `goal`, `success_criteria`, `section`) and determine:**
282
283
 
283
284
  1. **Domain boundary** — What capability is this phase delivering? State it clearly.
284
285
 
@@ -416,9 +417,9 @@ Create context.md capturing decisions made.
416
417
 
417
418
  Use values from init: `phase_dir`, `phase_slug`, `padded_phase`.
418
419
 
419
- If `phase_dir` is null (phase exists in roadmap but no directory):
420
+ If `phase_dir` is null (phase exists in roadmap but no directory), create it and use the printed path as `phase_dir`:
420
421
  ```bash
421
- mkdir -p ".planning/phases/${padded_phase}-${phase_slug}"
422
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs scaffold phase-dir --phase "${PHASE}" --name "{phase_name}" --raw
422
423
  ```
423
424
 
424
425
  **File location:** `${phase_dir}/${padded_phase}-context.md`
@@ -598,6 +599,7 @@ Task(
598
599
  </instructions>
599
600
  ",
600
601
  subagent_type="general-purpose",
602
+ model="$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-conductor --raw)",
601
603
  description="Plan Phase ${PHASE}"
602
604
  )
603
605
  ```