pan-wizard 3.36.0 → 3.37.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 (314) hide show
  1. package/CHANGELOG.md +3645 -0
  2. package/README.md +36 -48
  3. package/agents/pan-conductor.md +2 -3
  4. package/agents/pan-counterfactual.md +1 -2
  5. package/agents/pan-debugger.md +14 -3
  6. package/agents/pan-design-checker.md +1 -2
  7. package/agents/pan-designer.md +1 -2
  8. package/agents/pan-document_code.md +1 -2
  9. package/agents/pan-hardener.md +2 -3
  10. package/agents/pan-integration-checker.md +1 -2
  11. package/agents/pan-knowledge.md +1 -2
  12. package/agents/pan-meta-reviewer.md +3 -3
  13. package/agents/pan-optimizer.md +4 -4
  14. package/agents/pan-phase-researcher.md +79 -488
  15. package/agents/pan-plan-checker.md +12 -2
  16. package/agents/pan-planner.md +10 -6
  17. package/agents/pan-previewer.md +1 -2
  18. package/agents/pan-project-researcher.md +70 -499
  19. package/agents/pan-release.md +1 -1
  20. package/agents/pan-reviewer.md +9 -3
  21. package/agents/pan-roadmapper.md +12 -7
  22. package/agents/pan-verifier.md +7 -2
  23. package/bin/install-lib.cjs +134 -14
  24. package/bin/install.js +59 -12
  25. package/commands/pan/army.md +1 -1
  26. package/commands/pan/autodev.md +76 -0
  27. package/commands/pan/exec-phase.md +3 -4
  28. package/commands/pan/focus-auto.md +14 -7
  29. package/commands/pan/focus-design.md +4 -5
  30. package/commands/pan/focus-docs.md +24 -0
  31. package/commands/pan/learn.md +13 -6
  32. package/commands/pan/milestone-audit.md +8 -1
  33. package/commands/pan/milestone-done.md +10 -5
  34. package/commands/pan/milestone-new.md +2 -2
  35. package/commands/pan/new-project.md +15 -12
  36. package/commands/pan/plan-phase.md +15 -9
  37. package/commands/pan/quick.md +1 -1
  38. package/commands/pan/review-deep.md +11 -5
  39. package/commands/pan/settings.md +6 -0
  40. package/commands/pan/verify-phase.md +6 -2
  41. package/docs/AGENTS.md +917 -0
  42. package/docs/ARCHITECTURE.md +1054 -0
  43. package/docs/CLI-REFERENCE.md +4582 -0
  44. package/docs/COMPARISON.md +116 -0
  45. package/docs/DEVELOPMENT.md +490 -0
  46. package/docs/ECOSYSTEM-REVIEW-2026-06.md +107 -0
  47. package/docs/ECOSYSTEM-REVIEW-2026-08.md +349 -0
  48. package/docs/EXAMPLES.md +584 -0
  49. package/docs/FAQ.md +254 -0
  50. package/docs/FIELD-HARVEST-2026-07.md +88 -0
  51. package/docs/FIELD-REPORT-army-2026-06.md +121 -0
  52. package/docs/HOOKS.md +638 -0
  53. package/docs/IMPROVEMENT-TODO.md +246 -0
  54. package/docs/INTERNALS.md +485 -0
  55. package/docs/MIGRATION-v2-to-v3.md +258 -0
  56. package/docs/SECURITY-HARDENING.md +230 -0
  57. package/docs/SKILLS-ENHANCEMENT-PLAN-V2.md +122 -0
  58. package/docs/SKILLS-FULL-TEXT.md +9685 -0
  59. package/docs/SKILLS-REFERENCE.md +1037 -0
  60. package/docs/TROUBLESHOOTING.md +1084 -0
  61. package/docs/USER-GUIDE.md +1437 -0
  62. package/docs/archive/SKILLS-ENHANCEMENT-PLAN.md +230 -0
  63. package/docs/audits/AUDIT-2026-08-e2e-ROADMAP.md +117 -0
  64. package/docs/audits/AUDIT-2026-08-e2e-VERIFICATION.md +693 -0
  65. package/docs/audits/AUDIT-2026-08-e2e.md +1546 -0
  66. package/docs/audits/OUTSTANDING-2026-08.md +275 -0
  67. package/docs/audits/STABILITY-TEST-2026-08.md +640 -0
  68. package/docs/branding/README-brand-draft.md +119 -0
  69. package/docs/branding/handoff/IMPLEMENTATION.md +205 -0
  70. package/docs/branding/handoff/README-brand-draft.md +119 -0
  71. package/docs/branding/handoff/image-prompts.md +46 -0
  72. package/docs/branding/image-prompts.md +46 -0
  73. package/docs/branding/nano-banana-prompts.txt +60 -0
  74. package/docs/context-monitor.md +13 -0
  75. package/docs/decisions/ADR-0001-strategic-feature-prioritization.md +83 -0
  76. package/docs/decisions/ADR-0002-copilot-cli-runtime.md +71 -0
  77. package/docs/decisions/ADR-0003-smart-execution.md +84 -0
  78. package/docs/decisions/ADR-0004-copilot-cli-interaction.md +89 -0
  79. package/docs/decisions/ADR-0005-command-naming.md +80 -0
  80. package/docs/decisions/ADR-0006-focus-commands.md +101 -0
  81. package/docs/decisions/ADR-0007-ship-v1.md +73 -0
  82. package/docs/decisions/ADR-0008-map-codebase-mermaid-togaf.md +80 -0
  83. package/docs/decisions/ADR-0009-production-deployment-checklist.md +68 -0
  84. package/docs/decisions/ADR-0010-standards-integration.md +79 -0
  85. package/docs/decisions/ADR-0011-help-commands-rewrite.md +64 -0
  86. package/docs/decisions/ADR-0012-contributors-attribution-index.md +42 -0
  87. package/docs/decisions/ADR-0013-strategic-feature-additions.md +53 -0
  88. package/docs/decisions/ADR-0014-internal-cleanup-code-quality.md +53 -0
  89. package/docs/decisions/ADR-0015-focus-auto-runner.md +296 -0
  90. package/docs/decisions/ADR-0016-enhanced-doc-sync.md +54 -0
  91. package/docs/decisions/ADR-0017-enhanced-focus-design.md +69 -0
  92. package/docs/decisions/ADR-0018-user-reality-testing.md +84 -0
  93. package/docs/decisions/ADR-0019-end-to-end-user-acceptance-testing.md +113 -0
  94. package/docs/decisions/ADR-0020-ai-drift-prevention.md +55 -0
  95. package/docs/decisions/ADR-0021-codebase-mapper-v2.md +76 -0
  96. package/docs/decisions/ADR-0022-lifecycle-completeness.md +63 -0
  97. package/docs/decisions/ADR-0023-opus-4-7-adoption.md +89 -0
  98. package/docs/decisions/ADR-0024-spec-b-v2-completion.md +137 -0
  99. package/docs/decisions/ADR-0025-behavioral-guardrails-layer.md +129 -0
  100. package/docs/decisions/ADR-0026-self-improvement-loop.md +171 -0
  101. package/docs/decisions/ADR-0027-doc-code-link-graph.md +164 -0
  102. package/docs/decisions/ADR-0028-unified-agents-skills-target.md +46 -0
  103. package/docs/decisions/ADR-0029-experiment-evaluator.md +76 -0
  104. package/docs/decisions/ADR-0030-planning-concurrency.md +37 -0
  105. package/docs/decisions/ADR-0031-focus-auto-backlog-source.md +47 -0
  106. package/docs/decisions/ADR-0032-squad-model.md +64 -0
  107. package/docs/decisions/ADR-0033-army-campaign.md +40 -0
  108. package/docs/decisions/ADR-0034-scheduled-campaigns.md +57 -0
  109. package/docs/decisions/ADR-0035-army-hud-dashboard.md +40 -0
  110. package/docs/decisions/ADR-0036-agentic-memory-architecture.md +106 -0
  111. package/docs/decisions/ADR-0037-pin-security-agents-to-opus.md +51 -0
  112. package/docs/decisions/ADR-0038-skill-aligned-decomposition.md +41 -0
  113. package/docs/decisions/ADR-0039-worktree-as-project-variant.md +37 -0
  114. package/docs/decisions/ADR-0040-memory-injection-defense.md +55 -0
  115. package/docs/decisions/ADR-0041-mcp-dual-era-bridge.md +47 -0
  116. package/docs/decisions/ADR-0042-design-parity-both-flows.md +45 -0
  117. package/docs/decisions/ADR-0043-addressable-planning-roots.md +56 -0
  118. package/docs/decisions/ADR-0044-bound-the-cached-context.md +104 -0
  119. package/docs/decisions/ADR-0045-agent-plugins-bundle.md +76 -0
  120. package/docs/decisions/ADR-0046-subagent-frontmatter-decisions.md +39 -0
  121. package/docs/decisions/ADR-0047-pan-harness.md +76 -0
  122. package/docs/decisions/ADR-0048-one-core-per-project.md +43 -0
  123. package/docs/decisions/ADR-0049-machine-verdicts-and-findings-ledger.md +116 -0
  124. package/docs/specs/ai_drift_prevention_featureai.md +286 -0
  125. package/docs/specs/codebase_mapper_v2_featureai.md +930 -0
  126. package/docs/specs/command_naming_optimization_featureai.md +930 -0
  127. package/docs/specs/comp_analysis_markdown_v1.md +149 -0
  128. package/docs/specs/continuous_autonomous_execution_featureai.md +304 -0
  129. package/docs/specs/contributors_attribution_index_featureai.md +476 -0
  130. package/docs/specs/copilot_cli_interaction_featureai.md +868 -0
  131. package/docs/specs/copilot_cli_runtime_featureai.md +647 -0
  132. package/docs/specs/custom-skills-assessment.md +461 -0
  133. package/docs/specs/deployment_audit_findings_featureai.md +243 -0
  134. package/docs/specs/doc_code_link_graph_featureai.md +253 -0
  135. package/docs/specs/documentation_alignment_cleanup_featureai.md +69 -0
  136. package/docs/specs/e2e_visual_testing_featureai.md +615 -0
  137. package/docs/specs/end_to_end_user_acceptance_testing_featureai.md +810 -0
  138. package/docs/specs/evidence-loop-plan.md +76 -0
  139. package/docs/specs/evidence_loop_featureai.md +497 -0
  140. package/docs/specs/focus-auto-optimize-category.md +449 -0
  141. package/docs/specs/focus-auto-optimize-superplan.md +188 -0
  142. package/docs/specs/focus_auto_runner_featureai.md +1102 -0
  143. package/docs/specs/focus_design_v2_featureai.md +197 -0
  144. package/docs/specs/focus_sync_v2_featureai.md +202 -0
  145. package/docs/specs/git_integration_overhaul_featureai.md +326 -0
  146. package/docs/specs/glm_zai_provider_featureai.md +200 -0
  147. package/docs/specs/googlecli_adoption_featureai.md +661 -0
  148. package/docs/specs/help_commands_rewrite_featureai.md +860 -0
  149. package/docs/specs/industry_analysis_strategic_additions_featureai.md +231 -0
  150. package/docs/specs/industry_comparison_and_feature_gaps_featureai.md +674 -0
  151. package/docs/specs/internal_cleanup_code_quality_featureai.md +486 -0
  152. package/docs/specs/investigations/README.md +31 -0
  153. package/docs/specs/investigations/digests/2026-09-28.md +47 -0
  154. package/docs/specs/investigations/digests/2026-10-08.md +62 -0
  155. package/docs/specs/investigations/digests/2026-10-10.md +61 -0
  156. package/docs/specs/investigations/features/debugger-red-loop-first.md +55 -0
  157. package/docs/specs/investigations/features/harness-cross-host-behaviour.md +93 -0
  158. package/docs/specs/investigations/features/optimize-apply-regression-gate.md +66 -0
  159. package/docs/specs/investigations/features/reviewer-smell-baseline.md +57 -0
  160. package/docs/specs/investigations/features/trace-failure-capture.md +69 -0
  161. package/docs/specs/lifecycle_completeness_featureai.md +754 -0
  162. package/docs/specs/local-first-ci.md +42 -0
  163. package/docs/specs/map_codebase_mermaid_togaf_featureai.md +805 -0
  164. package/docs/specs/market-delta-2026-09-superplan.md +310 -0
  165. package/docs/specs/market-ideas-2026-09.md +131 -0
  166. package/docs/specs/market-ideas-2026-10.md +428 -0
  167. package/docs/specs/market-ideas-ledger.md +177 -0
  168. package/docs/specs/memory-optimization-2026-10.md +285 -0
  169. package/docs/specs/multi-track-planning-roots.md +143 -0
  170. package/docs/specs/multi_model_routing_featureai.md +687 -0
  171. package/docs/specs/multi_model_routing_superplan.md +197 -0
  172. package/docs/specs/opus_47_existing_enhancements_featureai.md +247 -0
  173. package/docs/specs/opus_47_extended_features_featureai.md +363 -0
  174. package/docs/specs/opus_47_extended_features_v2_featureai.md +397 -0
  175. package/docs/specs/pan_focus_commands_featureai.md +2336 -0
  176. package/docs/specs/pan_zcode_mcp_bridge_featureai.md +120 -0
  177. package/docs/specs/product-excellence-superplan.md +315 -0
  178. package/docs/specs/product_excellence_program_2026_q4_featureai.md +365 -0
  179. package/docs/specs/production_deployment_readiness_featureai.md +433 -0
  180. package/docs/specs/production_readiness_ship_v1_featureai.md +698 -0
  181. package/docs/specs/real_test_enforcement_featureai.md +213 -0
  182. package/docs/specs/reality-check-2026-09-superplan.md +362 -0
  183. package/docs/specs/right-sized-ceremony.md +74 -0
  184. package/docs/specs/roadmap_and_competition_2026_q4_featureai.md +390 -0
  185. package/docs/specs/self_improvement_loop_featureai.md +875 -0
  186. package/docs/specs/skill-aligned-decomposition.md +155 -0
  187. package/docs/specs/standards_integration_featureai.md +833 -0
  188. package/docs/specs/testing-system-redesign-2026-09.md +267 -0
  189. package/docs/specs/user_reality_testing_system_featureai.md +788 -0
  190. package/docs/specs/watch-triggers.json +22 -0
  191. package/docs/specs/workflow-integration-redesign.md +742 -0
  192. package/docs/specs/workflow_state_consistency_featureai.md +183 -0
  193. package/hooks/dist/pan-context-monitor.js +9 -2
  194. package/hooks/dist/pan-cost-logger.js +5 -0
  195. package/hooks/dist/pan-guard.js +28 -5
  196. package/hooks/dist/pan-stop-guard.js +9 -9
  197. package/hooks/dist/pan-trace-logger.js +5 -0
  198. package/package.json +10 -2
  199. package/pan-wizard-core/bin/lib/agents-md.cjs +57 -8
  200. package/pan-wizard-core/bin/lib/autodev-report.cjs +180 -0
  201. package/pan-wizard-core/bin/lib/autodev.cjs +642 -0
  202. package/pan-wizard-core/bin/lib/ci.cjs +143 -0
  203. package/pan-wizard-core/bin/lib/commands.cjs +1 -1
  204. package/pan-wizard-core/bin/lib/config.cjs +31 -2
  205. package/pan-wizard-core/bin/lib/constants.cjs +27 -1
  206. package/pan-wizard-core/bin/lib/core.cjs +22 -10
  207. package/pan-wizard-core/bin/lib/cost.cjs +14 -4
  208. package/pan-wizard-core/bin/lib/cross-family.cjs +164 -0
  209. package/pan-wizard-core/bin/lib/debug-cases.cjs +104 -0
  210. package/pan-wizard-core/bin/lib/failure-class.cjs +81 -0
  211. package/pan-wizard-core/bin/lib/findings.cjs +34 -4
  212. package/pan-wizard-core/bin/lib/focus.cjs +1 -1
  213. package/pan-wizard-core/bin/lib/hosts.cjs +88 -0
  214. package/pan-wizard-core/bin/lib/init.cjs +7 -2
  215. package/pan-wizard-core/bin/lib/knowledge.cjs +2 -0
  216. package/pan-wizard-core/bin/lib/merge.cjs +50 -0
  217. package/pan-wizard-core/bin/lib/mutate.cjs +16 -5
  218. package/pan-wizard-core/bin/lib/next-action.cjs +112 -0
  219. package/pan-wizard-core/bin/lib/optimize.cjs +2 -2
  220. package/pan-wizard-core/bin/lib/phase.cjs +48 -4
  221. package/pan-wizard-core/bin/lib/plan-lint.cjs +150 -1
  222. package/pan-wizard-core/bin/lib/preview.cjs +23 -4
  223. package/pan-wizard-core/bin/lib/requirements-lint.cjs +130 -0
  224. package/pan-wizard-core/bin/lib/research-lint.cjs +150 -3
  225. package/pan-wizard-core/bin/lib/review-deep.cjs +14 -22
  226. package/pan-wizard-core/bin/lib/review-vote.cjs +105 -0
  227. package/pan-wizard-core/bin/lib/runner.cjs +2 -16
  228. package/pan-wizard-core/bin/lib/sizing.cjs +356 -0
  229. package/pan-wizard-core/bin/lib/squads.cjs +1 -1
  230. package/pan-wizard-core/bin/lib/state-write.cjs +247 -0
  231. package/pan-wizard-core/bin/lib/uat.cjs +149 -0
  232. package/pan-wizard-core/bin/lib/verdict.cjs +26 -3
  233. package/pan-wizard-core/bin/lib/verify-plan-set.cjs +30 -1
  234. package/pan-wizard-core/bin/lib/verify-preflight.cjs +2 -2
  235. package/pan-wizard-core/bin/lib/verify-red.cjs +37 -1
  236. package/pan-wizard-core/bin/lib/verify-retro.cjs +3 -2
  237. package/pan-wizard-core/bin/lib/verify.cjs +59 -4
  238. package/pan-wizard-core/bin/lib/worktree.cjs +70 -0
  239. package/pan-wizard-core/bin/pan-tools.cjs +168 -27
  240. package/pan-wizard-core/learnings/universal/autonomous-loop.md +2 -2
  241. package/pan-wizard-core/references/continuation-format.md +3 -3
  242. package/pan-wizard-core/references/guardrails.md +1 -1
  243. package/pan-wizard-core/references/model-profiles.md +2 -3
  244. package/pan-wizard-core/references/questioning.md +24 -0
  245. package/pan-wizard-core/references/ui-brand.md +4 -6
  246. package/pan-wizard-core/references/verdict-contract.md +2 -1
  247. package/pan-wizard-core/templates/config.json +5 -1
  248. package/pan-wizard-core/templates/debug.md +1 -0
  249. package/pan-wizard-core/templates/discovery.md +2 -2
  250. package/pan-wizard-core/templates/requirements.md +9 -0
  251. package/pan-wizard-core/workflows/add-phase.md +4 -6
  252. package/pan-wizard-core/workflows/assumptions.md +19 -1
  253. package/pan-wizard-core/workflows/diagnose-issues.md +2 -0
  254. package/pan-wizard-core/workflows/discuss-phase.md +4 -2
  255. package/pan-wizard-core/workflows/exec-lean.md +69 -0
  256. package/pan-wizard-core/workflows/exec-phase.md +36 -8
  257. package/{commands/pan → pan-wizard-core/workflows}/focus-doc-audit.md +13 -29
  258. package/{commands/pan → pan-wizard-core/workflows}/focus-drift-walking.md +3 -18
  259. package/{commands/pan → pan-wizard-core/workflows}/focus-exec.md +8 -23
  260. package/{commands/pan → pan-wizard-core/workflows}/focus-plan.md +6 -20
  261. package/{commands/pan → pan-wizard-core/workflows}/focus-scan.md +3 -16
  262. package/{commands/pan → pan-wizard-core/workflows}/focus-sync.md +7 -21
  263. package/pan-wizard-core/workflows/health.md +6 -0
  264. package/pan-wizard-core/workflows/help.md +31 -53
  265. package/pan-wizard-core/workflows/insert-phase.md +4 -6
  266. package/pan-wizard-core/workflows/learn.md +3 -3
  267. package/pan-wizard-core/workflows/milestone-audit.md +2 -2
  268. package/pan-wizard-core/workflows/milestone-new.md +38 -95
  269. package/pan-wizard-core/workflows/new-project.md +96 -258
  270. package/pan-wizard-core/workflows/optimize.md +107 -5
  271. package/pan-wizard-core/workflows/phase-tests.md +10 -0
  272. package/pan-wizard-core/workflows/plan-phase.md +86 -43
  273. package/pan-wizard-core/workflows/profile.md +50 -0
  274. package/pan-wizard-core/workflows/progress.md +10 -0
  275. package/pan-wizard-core/workflows/quick.md +34 -43
  276. package/pan-wizard-core/workflows/research-phase.md +118 -40
  277. package/pan-wizard-core/workflows/resume-project.md +18 -2
  278. package/pan-wizard-core/workflows/settings.md +21 -24
  279. package/pan-wizard-core/workflows/todo-check.md +6 -2
  280. package/pan-wizard-core/workflows/transition.md +22 -4
  281. package/pan-wizard-core/workflows/uat-walkthrough.md +90 -0
  282. package/pan-wizard-core/workflows/update.md +1 -1
  283. package/pan-wizard-core/workflows/verify-phase.md +2 -2
  284. package/scripts/build-agent-plugin.js +35 -15
  285. package/scripts/build-plugin.js +10 -1
  286. package/scripts/deprecate-old-versions.js +70 -3
  287. package/scripts/generate-skills-docs.py +1 -1
  288. package/scripts/git-hooks/pre-push +27 -0
  289. package/scripts/install-git-hooks.js +7 -5
  290. package/scripts/install-pre-push.cjs +38 -0
  291. package/scripts/land.cjs +151 -0
  292. package/scripts/local-ci.cjs +501 -0
  293. package/scripts/local-schedule.cjs +277 -0
  294. package/scripts/prompt-lint.cjs +32 -0
  295. package/scripts/prompt-rules.cjs +156 -0
  296. package/scripts/run-tests.cjs +7 -1
  297. package/scripts/test-quality-lint.cjs +3 -3
  298. package/scripts/test-surface.cjs +9 -2
  299. package/agents/pan-research-synthesizer.md +0 -246
  300. package/commands/pan/audit-deployment.md +0 -386
  301. package/commands/pan/dashboard.md +0 -22
  302. package/commands/pan/discord.md +0 -19
  303. package/commands/pan/mcp-bridge.md +0 -143
  304. package/commands/pan/milestone-cleanup.md +0 -19
  305. package/commands/pan/milestone-gaps.md +0 -35
  306. package/commands/pan/optimize.md +0 -115
  307. package/commands/pan/profile.md +0 -76
  308. package/commands/pan/research-phase.md +0 -189
  309. package/pan-wizard-core/bin/lib/bridge.cjs +0 -269
  310. package/pan-wizard-core/templates/research-project/architecture.md +0 -210
  311. package/pan-wizard-core/templates/research-project/features.md +0 -153
  312. package/pan-wizard-core/templates/research-project/pitfalls.md +0 -206
  313. package/pan-wizard-core/templates/research-project/stack.md +0 -126
  314. package/pan-wizard-core/templates/research-project/summary.md +0 -170
@@ -1,77 +1,155 @@
1
- <purpose>
2
- Research how to implement a phase. Spawns pan-phase-researcher with phase context.
1
+ <objective>
2
+ Answer the open questions that block planning a phase (at most 5). Spawns one pan-phase-researcher agent with the questions and the phase context.
3
3
 
4
- Standalone research command. For most workflows, use `/pan:plan-phase` which integrates research automatically.
5
- </purpose>
4
+ **Note:** This is the standalone research mode. `/pan:plan-phase` researches only with `--research` or `workflow.research: true`.
6
5
 
7
- <process>
6
+ **Use this command when:**
7
+ - You want to research without planning yet
8
+ - You want to re-research after planning is complete
9
+ - You need to investigate before deciding if a phase is feasible
10
+
11
+ **Orchestrator role:** Parse phase, validate against roadmap, check existing research, gather context, spawn researcher agent, present results.
8
12
 
9
- ## Step 0: Resolve Model Profile
13
+ **Why subagent:** Searching burns context. A fresh context window answers the questions, at most 4 searches or fetches each; the main context stays lean for user interaction.
14
+ </objective>
10
15
 
11
- @~/.claude/pan-wizard-core/references/model-profile-resolution.md
16
+ <context>
17
+ Phase number: $ARGUMENTS (required)
12
18
 
13
- Resolve model for:
14
- - `pan-phase-researcher`
19
+ Normalize phase input in step 1 before any directory lookups.
20
+ </context>
15
21
 
16
- ## Step 1: Normalize and Validate Phase
22
+ <process>
17
23
 
18
- @~/.claude/pan-wizard-core/references/phase-argument-parsing.md
24
+ ## 0. Initialize Context
19
25
 
20
26
  ```bash
21
- PHASE_INFO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}")
27
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "$ARGUMENTS")
22
28
  ```
23
29
 
24
- If `found` is false: Error and exit.
30
+ 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.
25
31
 
26
- ## Step 2: Check Existing Research
32
+ Resolve researcher model:
33
+ ```bash
34
+ RESEARCHER_MODEL=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-phase-researcher --raw)
35
+ ```
36
+
37
+ ## 1. Validate Phase
27
38
 
28
39
  ```bash
29
- ls .planning/phases/*/*-research.md 2>/dev/null | grep -E "/0*${PHASE}-[^/]*/"
40
+ PHASE_INFO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${phase_number}")
30
41
  ```
31
42
 
32
- If exists: Offer update/view/skip options.
43
+ **If `found` is false:** Error and exit. **If `found` is true:** Extract `phase_number`, `phase_name`, `goal` from JSON.
33
44
 
34
- ## Step 3: Gather Phase Context
45
+ ## 2. Check Existing Research
35
46
 
36
- ```bash
37
- INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${PHASE}")
38
- # Extract: phase_dir, padded_phase, phase_slug, phase_number, state_path, requirements_path, context_path
39
- # phase_dir is null when the phase has no directory yet: create it (scaffold pads the number and honours the planning root) and use the printed path as phase_dir
40
- case "{phase_dir}" in ""|null) node ~/.claude/pan-wizard-core/bin/pan-tools.cjs scaffold phase-dir --phase "${PHASE}" --name "{phase_name}" --raw ;; esac
47
+ Use `has_research` and `research_path` from INIT.
48
+
49
+ **If exists:** Offer: 1) Update research, 2) View existing (`research_path`), 3) Skip. Wait for response.
50
+
51
+ **If doesn't exist:** Continue.
52
+
53
+ ## 3. Gather Phase Context
41
54
 
42
- # This phase's roadmap and requirements, written into the phase directory
43
- SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${PHASE}" --write --raw)
55
+ 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):
56
+ ```bash
57
+ SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${phase_number}" --write --raw)
44
58
  ```
59
+ - `slice_path` (from the command above; `requirements_path` if it is empty)
60
+ - `context_path`
61
+ - `state_path`
62
+
63
+ Present summary with phase description and what files the researcher will load.
64
+
65
+ ## 4. Write the Questions and Spawn pan-phase-researcher
45
66
 
46
- ## Step 4: Spawn Researcher
67
+ Research answers questions; it does not survey the phase's domain. List at most **5** open questions the phase's requirements leave unanswered and that block building (a technology choice, an external API's behaviour, a data format, a limit or rule), as a numbered list in `{phase_dir}/{padded_phase}-research-questions.md`:
47
68
 
69
+ ```markdown
70
+ # Phase {phase_number} research questions
71
+
72
+ 1. [question] — blocks: [the task or decision it settles]
48
73
  ```
49
- Task(
50
- prompt="<objective>
51
- Research implementation approach for Phase {phase}: {name}
74
+
75
+ **No questions → no research.** If nothing blocks building, write no file, say `No open questions block Phase {phase_number} — research skipped`, and stop.
76
+
77
+ ```markdown
78
+ <objective>
79
+ Answer the research questions for Phase {phase_number}: {phase_name}, and nothing else.
52
80
  </objective>
53
81
 
54
82
  <files_to_read>
55
- - {context_path} (USER DECISIONS from /pan:discuss-phase)
56
- - {slice_path} (This phase's roadmap and requirements; if SLICE_PATH is empty, {requirements_path} instead)
57
- - {state_path} (Project decisions and history)
83
+ - {phase_dir}/{padded_phase}-research-questions.md (The questions)
84
+ - {slice_path} (This phase's roadmap and requirements)
85
+ - {context_path} (Phase context from discuss-phase, if exists)
58
86
  </files_to_read>
59
87
 
60
- <additional_context>
61
- Phase description: {description}
62
- </additional_context>
63
-
64
88
  <output>
65
89
  Write to: {phase_dir}/{padded_phase}-research.md
66
- </output>",
90
+ One row per question: | # | Question | Answer | Source | Confidence | Decision it settles |, or `unknown — assume: …`. At most 4 searches or fetches per question. Anything that suggests new scope goes under ## Ideas (v2 candidates).
91
+ </output>
92
+ ```
93
+
94
+ ```
95
+ Task(
96
+ prompt=filled_prompt,
67
97
  subagent_type="pan-phase-researcher",
68
- model="{researcher_model}"
98
+ model="{researcher_model}",
99
+ description="Research Phase {phase}"
69
100
  )
70
101
  ```
71
102
 
72
- ## Step 5: Handle Return
103
+ Then check the answers:
104
+
105
+ ```bash
106
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs research check "{phase_dir}/{padded_phase}-research-questions.md" "{phase_dir}/{padded_phase}-research.md"
107
+ ```
108
+
109
+ Exit 1: send its `errors` to the researcher once as a revision. One revision at most; then proceed, with each question still unsourced recorded under `## Unknowns` in the research file with the assumption the plan uses.
110
+
111
+ ## 5. Handle Agent Return
112
+
113
+ **`## RESEARCH COMPLETE`:** Display the decisions it settled and any unknowns, offer: Plan phase, Review full, Done.
114
+
115
+ **`## RESEARCH BLOCKED`:** Show the blocker and what was attempted, offer: Provide context (then spawn a continuation, step 6), Skip research, Abort.
116
+
117
+ ## 6. Spawn Continuation Agent
118
+
119
+ ```markdown
120
+ <objective>
121
+ Continue research for Phase {phase_number}: {phase_name}
122
+ </objective>
123
+
124
+ <prior_state>
125
+ <files_to_read>
126
+ - {phase_dir}/{padded_phase}-research.md (Existing research)
127
+ </files_to_read>
128
+ </prior_state>
73
129
 
74
- - `## RESEARCH COMPLETE` — Display summary, offer: Plan/Dig deeper/Review/Done
75
- - `## RESEARCH BLOCKED` — Display the blocker, offer: Provide context / Skip research / Abort
130
+ <checkpoint_response>
131
+ **Type:** {checkpoint_type}
132
+ **Response:** {user_response}
133
+ </checkpoint_response>
134
+ ```
135
+
136
+ ```
137
+ Task(
138
+ prompt=continuation_prompt,
139
+ subagent_type="pan-phase-researcher",
140
+ model="{researcher_model}",
141
+ description="Continue research Phase {phase}"
142
+ )
143
+ ```
76
144
 
77
145
  </process>
146
+
147
+ <success_criteria>
148
+ - [ ] Phase validated against roadmap
149
+ - [ ] Existing research checked
150
+ - [ ] At most 5 questions written (none: no research)
151
+ - [ ] One pan-phase-researcher spawned with the questions
152
+ - [ ] `research check` run, one revision at most
153
+ - [ ] Checkpoints handled correctly
154
+ - [ ] User knows next steps
155
+ </success_criteria>
@@ -138,6 +138,16 @@ Present complete project status to user:
138
138
  </step>
139
139
 
140
140
  <step name="determine_next_action">
141
+ An interrupted agent or a `.continue-here` checkpoint comes first (below). Otherwise ask the router:
142
+
143
+ ```bash
144
+ NEXT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs next-action)
145
+ ```
146
+
147
+ It returns `{action, phase, reason, command}`, read from roadmap.md and the phase directories by the same state machine the MCP `pan_next_action` tool uses, so progress, resume and transition never disagree about what comes next. `action` is one of `plan`, `execute`, `verify`, `complete_phase`, `plan_gaps`, `audit_milestone`, `new_milestone`, `new_project` or `stop`, and `command` is the command that carries it out.
148
+
149
+ Offer its `command` as the primary option.
150
+
141
151
  Based on project state, determine the most logical next action:
142
152
 
143
153
  **If interrupted agent exists:**
@@ -237,7 +247,7 @@ Based on user selection, route to appropriate workflow:
237
247
 
238
248
  **Also available:**
239
249
  - `/pan:discuss-phase [N]` — gather context first
240
- - `/pan:research-phase [N]` — investigate unknowns
250
+ - `/pan:plan-phase --research-only [N]` — investigate unknowns
241
251
 
242
252
  ---
243
253
  ```
@@ -274,7 +284,13 @@ If state.md is missing but other artifacts exist:
274
284
  4. Count pending todos in .planning/todos/pending/
275
285
  5. Check for .continue-here files → Session continuity
276
286
 
277
- Reconstruct and write state.md, then proceed normally.
287
+ Reconstruct state.md through the engine, never with the Write tool:
288
+
289
+ ```bash
290
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state init --core-value "<from project.md>" --focus "<current phase name>" --phase <current phase> --phase-name "<its name>" --total-phases <N> --activity "Reconstructed from artifacts"
291
+ ```
292
+
293
+ Then add what the summaries and todos hold, one section at a time: `state section "Decisions" --append "- [Phase X]: ..."`, `state section "Blockers/Concerns" --append "..."`, `state section "Pending Todos" --set "<N> pending"`. Proceed normally.
278
294
 
279
295
  This handles cases where:
280
296
 
@@ -24,13 +24,13 @@ Creates `.planning/config.json` with defaults if missing and loads current confi
24
24
  cat .planning/config.json
25
25
  ```
26
26
 
27
- Parse current values (when a key is absent, use PAN's default: `true` for research, plan_check and verifier; `false` for nyquist_validation):
28
- - `workflow.research` — spawn researcher during plan-phase
27
+ Parse current values (when a key is absent, use PAN's default: `false` for research and nyquist_validation; `true` for plan_check and verifier):
28
+ - `workflow.research` — spawn researcher during plan-phase (off by default: research is opt-in, and when on it answers at most 5 open questions per phase)
29
29
  - `workflow.plan_check` — spawn plan checker during plan-phase
30
30
  - `workflow.verifier` — spawn verifier during execute-phase
31
31
  - `workflow.nyquist_validation` — validation architecture research during plan-phase
32
- - `model_profile` — which model each agent uses (default: `balanced`)
33
- - `routing.strategy` — how model tiers are adjusted at runtime (default: `static`)
32
+ - `model_profile` — how much ceremony and which model each agent uses (default: `balanced`; `quality` keeps the full ceremony everywhere)
33
+ - `routing.strategy` — not asked here (default: `static`). The `complexity` strategy reaches no workflow, so offering it would be a choice that changes nothing; `config-set routing.strategy complexity` still sets it for `resolve-model --metadata` callers. A `quality` profile in an existing config keeps working: it is identical to `balanced`
34
34
  - `cost.phase_budget_usd` — spend per phase PAN warns about, in API-equivalent dollars (default: `20`; `0` = off). It never stops a run
35
35
  - `branching_strategy` — branching approach (default: `"none"`; a top-level key — a nested `git.branching_strategy` is ignored when the top-level key exists, as it does in every config `config-ensure-section` creates — write the top-level key)
36
36
  </step>
@@ -45,18 +45,18 @@ AskUserQuestion([
45
45
  header: "Model",
46
46
  multiSelect: false,
47
47
  options: [
48
- { label: "Quality", description: "reasoning tier for every agent — identical to balanced, so switching between the two changes nothing" },
49
- { label: "Balanced (Recommended)", description: "reasoning tier for every agent (quality and balanced are identical post-COST-RESET); use budget to step down" },
50
- { label: "Budget", description: "mid tier for writing, fast tier for research/verification (lowest cost)" }
48
+ { label: "Balanced (Recommended)", description: "right-sized: a small, well-specified phase or quick task skips research and the planner/checker loop; plan-checker and researchers on the mid tier; one plan revision" },
49
+ { label: "Quality", description: "the full ceremony on every piece of work, every agent on the reasoning tier (the behaviour before right-sizing; costs several times more)" },
50
+ { label: "Budget", description: "right-sized like balanced, plus mid tier for writing and fast tier for research/verification (lowest cost)" }
51
51
  ]
52
52
  },
53
53
  {
54
- question: "Spawn Plan Researcher? (researches domain before planning)",
54
+ question: "Spawn Plan Researcher? (off by default; answers up to 5 open questions before planning)",
55
55
  header: "Research",
56
56
  multiSelect: false,
57
57
  options: [
58
- { label: "Yes", description: "Research phase goals before planning" },
59
- { label: "No", description: "Skip research, plan directly" }
58
+ { label: "No (default)", description: "Plan directly from requirements; /pan:plan-phase N --research researches one phase" },
59
+ { label: "Yes", description: "Before each phase, answer up to 5 open questions that block building, each with a source" }
60
60
  ]
61
61
  },
62
62
  {
@@ -76,7 +76,14 @@ AskUserQuestion([
76
76
  { label: "Yes", description: "Verify must-haves after execution" },
77
77
  { label: "No", description: "Skip post-execution verification" }
78
78
  ]
79
- },
79
+ }
80
+ ])
81
+ ```
82
+
83
+ Then the next batch (the host takes at most four questions per call):
84
+
85
+ ```
86
+ AskUserQuestion([
80
87
  {
81
88
  question: "Auto-advance pipeline? (discuss → plan → execute automatically)",
82
89
  header: "Auto",
@@ -105,15 +112,6 @@ AskUserQuestion([
105
112
  { label: "Per Milestone", description: "Create branch for entire milestone (pan/{version}-{name})" }
106
113
  ]
107
114
  },
108
- {
109
- question: "Model routing strategy?",
110
- header: "Routing",
111
- multiSelect: false,
112
- options: [
113
- { label: "Static (Recommended)", description: "Profile assigns fixed tiers to each agent. Predictable and simple." },
114
- { label: "Complexity", description: "Adjust tiers by task complexity, only where a model is resolved with the task passed (resolve-model --metadata); the *_model values workflows pass are not, so it changes nothing there" }
115
- ]
116
- },
117
115
  {
118
116
  question: "Warn when a phase's spend passes how much? (API-equivalent dollars; warns only, never stops)",
119
117
  header: "Phase budget",
@@ -136,14 +134,13 @@ A dollar amount typed under Other is used as given.
136
134
  Write each answer with `config-set`, which keeps every other key in the `workflow` and `routing` objects:
137
135
 
138
136
  ```bash
139
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set model_profile <quality|balanced|budget>
137
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set model_profile <balanced|quality|budget>
140
138
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set workflow.research <true|false>
141
139
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set workflow.plan_check <true|false>
142
140
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set workflow.verifier <true|false>
143
141
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set workflow.auto_advance <true|false>
144
142
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set workflow.nyquist_validation <true|false>
145
143
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set branching_strategy <none|phase|milestone>
146
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set routing.strategy <static|complexity>
147
144
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-set cost.phase_budget_usd <20|50|10|0|amount>
148
145
  ```
149
146
  </step>
@@ -216,8 +213,8 @@ Display:
216
213
  These settings apply to future /pan:plan-phase and /pan:exec-phase runs.
217
214
 
218
215
  Quick commands:
219
- - /pan:profile <profile> — switch model profile
220
- - /pan:plan-phase --research — force research
216
+ - /pan:settings --profile <profile> — switch model profile
217
+ - /pan:plan-phase --research — research one phase (up to 5 open questions)
221
218
  - /pan:plan-phase --skip-research — skip research
222
219
  - /pan:plan-phase --skip-verify — skip plan check
223
220
  ```
@@ -129,7 +129,7 @@ Use AskUserQuestion:
129
129
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs todo complete "[filename]"
130
130
  ```
131
131
  This moves it out of `.planning/todos/pending/` (the directory `init todos` and `/pan:progress` count) into `.planning/todos/completed/` with a `completed:` date.
132
- Update state.md todo count. Present problem/solution context. Begin work or ask how to proceed.
132
+ Update the todo count in state.md (the `update_state` step). Present problem/solution context. Begin work or ask how to proceed.
133
133
 
134
134
  **Add to phase plan:**
135
135
  Note todo reference in phase planning notes. Keep in pending. Return to list or exit.
@@ -148,7 +148,11 @@ Return to list_todos step.
148
148
  <step name="update_state">
149
149
  After any action that changes todo count:
150
150
 
151
- Re-run `init todos` to get updated count, then update state.md "### Pending Todos" section if exists.
151
+ Re-run `init todos` to get the updated count, then set state.md's "### Pending Todos" section through the engine:
152
+
153
+ ```bash
154
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state section "Pending Todos" --set "{count} pending — /pan:todo-check to review"
155
+ ```
152
156
  </step>
153
157
 
154
158
  <step name="git_commit">
@@ -25,7 +25,7 @@ Mark current phase complete and advance to next. This is the natural point where
25
25
  **Required pattern from v3.7.5 onward:**
26
26
 
27
27
  1. Run the steps below to *plan* each state.md update, but **do not write or commit** between them. Hold the changes in memory.
28
- 2. After `update_session_continuity_after_transition` (the last state.md-touching step before `offer_next_phase`), perform a **single Edit** that applies all four section updates (Project Reference, Accumulated Context, Session Continuity, plus the progress bar from `update_current_position_after_transition`).
28
+ 2. After `update_session_continuity_after_transition` (the last state.md-touching step before `offer_next_phase`), make a **single `pan-tools state apply` call** that applies all four section updates in one write (Project Reference, Accumulated Context, Session Continuity, plus the progress bar from `update_current_position_after_transition`).
29
29
  3. Then issue **one** commit:
30
30
  ```bash
31
31
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs(transition): phase ${current_phase} → ${next_phase} (state, progress, context)"
@@ -34,6 +34,14 @@ Mark current phase complete and advance to next. This is the natural point where
34
34
 
35
35
  Net result per transition: 2 commits instead of 5. Reduces git noise and keeps `/pan:learn` overhead metrics (commits_per_minute) honest. Substantive content of each step below is unchanged — only the **timing of the write** changes.
36
36
 
37
+ The batched call, with the values the steps below planned (fields are bold `**Name:**` lines; a section is appended to or replaced):
38
+
39
+ ```bash
40
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state apply --json '{"fields": {"Progress": "<bar from progress bar --raw>", "Current focus": "<next phase name>", "Core value": "<current core value>", "Last session": "<YYYY-MM-DD HH:MM>", "Resume File": "None"}, "sections": {"Decisions": {"append": ["- [Phase X]: <decision>"]}, "Blockers/Concerns": {"set": "<the reviewed list>"}}}'
41
+ ```
42
+
43
+ It reports any field it could not find in `failed`. Never edit state.md with the Edit tool: the engine keeps the frontmatter in sync, and under `hooks.guard: enforce` the guard denies a direct write.
44
+
37
45
  </state_write_policy>
38
46
 
39
47
  <process>
@@ -355,7 +363,7 @@ Update Session Continuity section in state.md to reflect transition completion.
355
363
  node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state update "Stopped at" "Phase ${current_phase} complete, ready to plan Phase ${next_phase}"
356
364
  ```
357
365
 
358
- Then Edit state.md (still under the P-1604 batched-write policy — fold this Edit into the final batched Edit at the end of the workflow):
366
+ Then fold the other two lines into the batched `state apply` call at the end of the workflow (P-1604):
359
367
 
360
368
  **Format:**
361
369
 
@@ -387,6 +395,16 @@ The `is_last_phase` field from the phase complete result tells you directly:
387
395
 
388
396
  The `next_phase` and `next_phase_name` fields give you the next phase details.
389
397
 
398
+ To name the next command, ask the router after `phase complete`:
399
+
400
+ ```bash
401
+ NEXT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs next-action)
402
+ ```
403
+
404
+ It returns `{action, phase, reason, command}`, read from roadmap.md and the phase directories by the same state machine the MCP `pan_next_action` tool uses, so progress, resume and transition never disagree about what comes next. `action` is one of `plan`, `execute`, `verify`, `complete_phase`, `plan_gaps`, `audit_milestone`, `new_milestone`, `new_project` or `stop`, and `command` is the command that carries it out.
405
+
406
+ For the next phase it returns `plan` (or `execute` when the phase is already planned); at the milestone boundary it returns `audit_milestone`.
407
+
390
408
  If you need additional context, use:
391
409
  ```bash
392
410
  ROADMAP=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap analyze)
@@ -530,7 +548,7 @@ Task(
530
548
 
531
549
  **Also available:**
532
550
  - `/pan:plan-phase [X+1]` — skip discussion, plan directly
533
- - `/pan:research-phase [X+1]` — investigate unknowns
551
+ - `/pan:plan-phase --research-only [X+1]` — investigate unknowns
534
552
 
535
553
  ---
536
554
  ```
@@ -555,7 +573,7 @@ Task(
555
573
 
556
574
  **Also available:**
557
575
  - `/pan:discuss-phase [X+1]` — revisit context
558
- - `/pan:research-phase [X+1]` — investigate unknowns
576
+ - `/pan:plan-phase --research-only [X+1]` — investigate unknowns
559
577
 
560
578
  ---
561
579
  ```
@@ -0,0 +1,90 @@
1
+ <purpose>
2
+ Walk the user through user acceptance testing for one phase, one test at a time, on any runtime. Record each answer through the engine, so every runtime leaves the same `{phase_num}-uat.md`. When the walkthrough finds issues, diagnose them, then hand the gaps to `/pan:plan-phase {phase_num} --gaps`.
3
+ </purpose>
4
+
5
+ <core_principle>
6
+ The user is the oracle here. You present what they should be able to observe, they say whether they observed it, and the engine writes it down. Never mark a test passed on their behalf, and never rephrase their report: an issue is recorded in their words.
7
+ </core_principle>
8
+
9
+ <process>
10
+
11
+ <step name="initialize">
12
+ ```bash
13
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${PHASE_ARG}")
14
+ ```
15
+ Take `phase_dir`, `phase_number` and `phase_name` from the JSON. Look for an existing session:
16
+
17
+ ```bash
18
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs uat status "${PHASE_NUMBER}"
19
+ ```
20
+
21
+ - **A session exists with tests pending:** resume at the first pending test.
22
+ - **A session exists and is complete:** show its summary. If it has gaps, go to `diagnose`; otherwise go to `done`.
23
+ - **No session (`uat_not_found`):** go to `build_tests`.
24
+ </step>
25
+
26
+ <step name="build_tests">
27
+ Create the file, then fill in its tests:
28
+
29
+ ```bash
30
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs scaffold uat --phase "${PHASE_NUMBER}"
31
+ ```
32
+
33
+ Read the phase's summaries (`{phase_dir}/*-summary.md`) and its plans' `must_haves`. Write one test per user-observable truth into the file's `## Tests` section, each as:
34
+
35
+ ```markdown
36
+ ### N. <short name>
37
+ expected: <what the user should be able to see or do, concretely: the command, the screen, the output>
38
+ result: [pending]
39
+ ```
40
+
41
+ Keep to what a person can observe without reading the code. Write the test list once, in full, then leave every result to the engine.
42
+ </step>
43
+
44
+ <step name="walk">
45
+ For each pending test, in order:
46
+
47
+ 1. Show the test: its name and its `expected` behaviour, with the exact steps to observe it.
48
+ 2. Ask for the result:
49
+ ```
50
+ AskUserQuestion([
51
+ { question: "Test N: <name>. Did you observe the expected behaviour?", header: "UAT", multiSelect: false, options: [
52
+ { label: "Pass", description: "It behaves as expected" },
53
+ { label: "Issue", description: "Something differs; describe what you saw" },
54
+ { label: "Skip", description: "Cannot test this now" }
55
+ ] }
56
+ ])
57
+ ```
58
+ Runtimes without AskUserQuestion ask the same question in plain text and take the answer from the reply.
59
+ 3. Record it, in the user's own words for an issue:
60
+ ```bash
61
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs uat record "${PHASE_NUMBER}" --test N --result pass
62
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs uat record "${PHASE_NUMBER}" --test N --result issue --reported "<their words>" --severity major
63
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs uat record "${PHASE_NUMBER}" --test N --result skipped --reason "<why>"
64
+ ```
65
+ Severity: `blocker` (cannot use the feature), `major` (wrong behaviour), `minor` (works, but rough), `cosmetic`.
66
+
67
+ When no test is pending, the engine marks the session `complete`.
68
+ </step>
69
+
70
+ <step name="diagnose">
71
+ ```bash
72
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs uat status "${PHASE_NUMBER}"
73
+ ```
74
+
75
+ If `gaps` is empty, go to `done`. Otherwise follow the diagnose-issues workflow (@~/.claude/pan-wizard-core/workflows/diagnose-issues.md). On Claude Code the native `/pan-diagnose-issues {phase_num}` script does the same in parallel. Diagnosis fills each gap's `root_cause`, `artifacts`, `missing` and `debug_session`, and the engine keeps those fields across any later re-record.
76
+ </step>
77
+
78
+ <step name="done">
79
+ Report the summary (`passed`, `issues`, `skipped`). With gaps:
80
+
81
+ ```
82
+ UAT found {issues} issue(s), diagnosed in {phase_num}-uat.md.
83
+
84
+ Next: /pan:plan-phase {phase_num} --gaps
85
+ ```
86
+
87
+ Without gaps: "UAT passed. Continue with `/pan:exec-phase {phase_num}` (transition) or the next phase."
88
+ </step>
89
+
90
+ </process>
@@ -197,7 +197,7 @@ Format completion message (changelog was already shown in confirmation step):
197
197
 
198
198
  ⚠️ Restart your AI coding tool to pick up the new commands.
199
199
 
200
- [View full changelog](https://github.com/oharms/PanWizard/blob/main/CHANGELOG.md)
200
+ Full changelog: ~/.claude/pan-wizard-core/CHANGELOG.md
201
201
  ```
202
202
  </step>
203
203
 
@@ -119,7 +119,7 @@ from the exit code and the runner's output, and you copy it.
119
119
  </step>
120
120
 
121
121
  <step name="mutation_report">
122
- **Measure whether the tests pin the code the phase wrote** (a report, never a gate).
122
+ **Measure whether the tests pin the code the phase wrote** (a report, unless the project chose gate mode).
123
123
 
124
124
  Only when the test gate passed: a mutant cannot be read against a suite that already fails.
125
125
  With `workflow.mutation_gate: off` the command runs nothing and says so.
@@ -134,7 +134,7 @@ commits changed, in a throwaway worktree at HEAD, and runs the suite against eac
134
134
 
135
135
  Write a **Test strength** section in verification.md: `killed/sampled`, and each survivor as
136
136
  `file:line — before → after`, framed as a test the phase could add. A survivor is a lead, not a
137
- gap: it never changes the status. `aborted: flaky` (the unmutated suite passed once and failed
137
+ gap: in `report` mode it never changes the status. In `gate` mode (`workflow.mutation_gate: gate`) the result carries `gate`: when `gate.failed` is true (the score is below `workflow.mutation_floor`), set the status to `gaps_found` and list each survivor as a gap; `verify reconcile` refuses a passed verification over a failed gate. `aborted: flaky` (the unmutated suite passed once and failed
138
138
  once) is worth reporting as a finding of its own; `checked: false` with its `reason` goes in
139
139
  `not_checked` as `check: "mutation"`.
140
140
  </step>
@@ -15,9 +15,17 @@
15
15
  * canonical agent reference copies under agents/
16
16
  *
17
17
  * hooks/pan-*.js PAN's hook scripts (pure Node), shared by every vendor
18
- * hooks/hooks.json Codex: default plugin hooks location; matcher-group
18
+ * hooks/hooks.json Codex's default plugin hooks location; matcher-group
19
19
  * shape with `${PLUGIN_ROOT}` paths and `async` observers
20
- * (developers.openai.com/plugins/build/plugins, 2026-09-10)
20
+ * (developers.openai.com/plugins/build/plugins, 2026-09-10).
21
+ * NOT LOADED BY CODEX for this bundle: a root plugin.json
22
+ * with the agent-plugins.org schema makes Codex treat the
23
+ * plugin as an Agent Plugin, and its loader then skips
24
+ * hooks entirely (codex-rs/core-plugins/src/loader.rs,
25
+ * "Enforce Agent Plugin runtime boundaries" #37027,
26
+ * 2026-08-05; same at rust-v0.163.0; read 2026-10-19, R55).
27
+ * Codex users get PAN's hooks from a `--codex` install
28
+ * (.codex/hooks.json). Kept for the other consumers.
21
29
  * com.github.copilot/ Copilot's reverse-domain namespace (ADR-0045 D5):
22
30
  * agents/pan-*.agent.md agents in Copilot's format
23
31
  * hooks/hooks.json flat PascalCase format, `${CLAUDE_PLUGIN_ROOT}` paths
@@ -90,25 +98,35 @@ function emitSkills(srcDir, skillsDir, prefix) {
90
98
  if (entry.isDirectory()) { recurse(srcPath, `${currentPrefix}-${entry.name}`); continue; }
91
99
  if (!entry.name.endsWith('.md')) continue;
92
100
  const skillName = `${currentPrefix}-${entry.name.replace(/\.md$/, '')}`;
93
- const skillDir = path.join(skillsDir, skillName);
94
- fs.mkdirSync(skillDir, { recursive: true });
95
- let content = fs.readFileSync(srcPath, 'utf8');
96
- content = lib.rewriteUnifiedSkillCommandContent(content, REWRITE);
97
- content = lib.convertClaudeCommandToUnifiedSkill(content, skillName, { adapterNote: lib.agentPluginSkillAdapterNote() });
98
- const { skill, reference } = lib.splitOversizedSkill(content, skillName);
99
- fs.writeFileSync(path.join(skillDir, 'SKILL.md'), skill);
100
- if (reference) {
101
- const refPath = path.join(skillDir, ...lib.AGENT_PLUGIN_SKILL_REFERENCE.split('/'));
102
- fs.mkdirSync(path.dirname(refPath), { recursive: true });
103
- fs.writeFileSync(refPath, reference);
104
- split++;
105
- }
101
+ if (emitSkill(fs.readFileSync(srcPath, 'utf8'), skillsDir, skillName)) split++;
106
102
  count++;
107
103
  }
108
104
  })(srcDir, prefix);
105
+ // Renamed commands keep their old names as aliases, as the installer writes them (L7).
106
+ const { COMMAND_ALIASES } = require(path.join(ROOT, 'pan-wizard-core', 'bin', 'lib', 'constants.cjs'));
107
+ for (const [oldName, alias] of Object.entries(COMMAND_ALIASES)) {
108
+ const target = fs.readFileSync(path.join(srcDir, `${alias.to}.md`), 'utf8');
109
+ if (emitSkill(lib.renderCommandAlias(target, oldName, alias), skillsDir, `${prefix}-${oldName}`)) split++;
110
+ count++;
111
+ }
109
112
  return { count, split };
110
113
  }
111
114
 
115
+ /** One command → skills/<name>/SKILL.md (plus a reference file when split). Returns true when split. */
116
+ function emitSkill(content, skillsDir, skillName) {
117
+ const skillDir = path.join(skillsDir, skillName);
118
+ fs.mkdirSync(skillDir, { recursive: true });
119
+ content = lib.rewriteUnifiedSkillCommandContent(content, REWRITE);
120
+ content = lib.convertClaudeCommandToUnifiedSkill(content, skillName, { adapterNote: lib.agentPluginSkillAdapterNote() });
121
+ const { skill, reference } = lib.splitOversizedSkill(content, skillName);
122
+ fs.writeFileSync(path.join(skillDir, 'SKILL.md'), skill);
123
+ if (!reference) return false;
124
+ const refPath = path.join(skillDir, ...lib.AGENT_PLUGIN_SKILL_REFERENCE.split('/'));
125
+ fs.mkdirSync(path.dirname(refPath), { recursive: true });
126
+ fs.writeFileSync(refPath, reference);
127
+ return true;
128
+ }
129
+
112
130
  /** pan-wizard-core → bundle, markdown rewritten, everything else verbatim. */
113
131
  function emitCore(srcDir, destDir) {
114
132
  (function recurse(currentSrc, currentDest) {
@@ -133,6 +151,8 @@ function emitCore(srcDir, destDir) {
133
151
  if (err.code !== 'ENOENT') throw err;
134
152
  }
135
153
  fs.writeFileSync(path.join(destDir, 'VERSION'), pkg.version);
154
+ // `/pan:update` points at the installed changelog, as a loose-file install carries it.
155
+ fs.copyFileSync(path.join(ROOT, 'CHANGELOG.md'), path.join(destDir, 'CHANGELOG.md'));
136
156
  }
137
157
 
138
158
  /** Canonical agent reference copies under <core>/agents/ (ADR-0028). */