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
@@ -269,7 +269,6 @@ const knowledge = require('./lib/knowledge.cjs');
269
269
  const skillAlign = require('./lib/skill-align.cjs');
270
270
  const hygiene = require('./lib/hygiene.cjs');
271
271
  const whatif = require('./lib/whatif.cjs');
272
- const bridge = require('./lib/bridge.cjs');
273
272
  const optimize = require('./lib/optimize.cjs');
274
273
  const git = require('./lib/git.cjs');
275
274
  const distill = require('./lib/distill.cjs');
@@ -390,7 +389,7 @@ async function main() {
390
389
  + ' --planning-dir <path> act on an arbitrary project-relative planning tree\n'
391
390
  + ' --all-tracks (hygiene) act on the root tree AND every discovered track\n'
392
391
  + ' env: PAN_TRACK, PAN_PLANNING_DIR (flags win)\n'
393
- + '\nCommands: state, resolve-model, estimate-cost, find-phase, git, distill, experiment, commit, verify-summary, template, frontmatter, verify, test, review, research, usage, generate-slug, current-timestamp, list-todos, verify-path-exists, config-ensure-section, config-set, config-get, history-digest, phases, roadmap, requirements, phase, milestone, validate, progress, context-budget, todo, scaffold, init, phase-plan-index, state-snapshot, summary-extract, rollback-snapshot, batch-commit, websearch, focus, preflight, dashboard, hud, report, learnings, deps, drift-check, memory, bridge, whatif, knowledge, skills, hygiene, review-deep, findings, preview, cost, models, squad, worktree, campaign, bus, cache, retro, codebase, standards, optimize, doc-lint, learn, links, version';
392
+ + '\nCommands: state, resolve-model, estimate-cost, find-phase, git, distill, experiment, commit, verify-summary, template, frontmatter, verify, test, review, debug, uat, merge, research, usage, generate-slug, current-timestamp, list-todos, verify-path-exists, config-ensure-section, config-set, config-get, history-digest, phases, roadmap, requirements, phase, milestone, validate, progress, next-action, size, autodev, context-budget, todo, scaffold, init, phase-plan-index, state-snapshot, summary-extract, rollback-snapshot, batch-commit, websearch, focus, preflight, dashboard, hud, report, learnings, deps, drift-check, memory, whatif, knowledge, skills, hygiene, review-deep, findings, preview, cost, models, squad, worktree, campaign, bus, cache, retro, codebase, standards, optimize, doc-lint, learn, links, version';
394
393
 
395
394
  if (!command) {
396
395
  error(USAGE);
@@ -415,6 +414,29 @@ async function main() {
415
414
  state.cmdStateUpdate(cwd, args[2], args[3]);
416
415
  } else if (subcommand === 'get') {
417
416
  state.cmdStateGet(cwd, args[2], raw);
417
+ } else if (subcommand === 'init' || subcommand === 'section' || subcommand === 'quick-task' || subcommand === 'apply') {
418
+ // A7b: the wholesale and by-section writers of state.md.
419
+ const sw = require('./lib/state-write.cjs');
420
+ if (subcommand === 'init') {
421
+ sw.cmdStateInit(cwd, {
422
+ coreValue: getArgValue(args, '--core-value'), focus: getArgValue(args, '--focus'),
423
+ phase: getArgValue(args, '--phase'), phaseName: getArgValue(args, '--phase-name'),
424
+ totalPhases: getArgValue(args, '--total-phases'), status: getArgValue(args, '--status'),
425
+ activity: getArgValue(args, '--activity'),
426
+ force: args.includes('--force'), keepContext: args.includes('--keep-context'),
427
+ }, raw);
428
+ } else if (subcommand === 'section') {
429
+ sw.cmdStateSection(cwd, args[2] && !args[2].startsWith('--') ? args[2] : null, {
430
+ append: getArgValue(args, '--append'), set: getArgValue(args, '--set'), under: getArgValue(args, '--under'),
431
+ }, raw);
432
+ } else if (subcommand === 'quick-task') {
433
+ sw.cmdStateQuickTask(cwd, {
434
+ description: getArgValue(args, '--description'), commit: getArgValue(args, '--commit'),
435
+ directory: getArgValue(args, '--directory'), status: getArgValue(args, '--status'), date: getArgValue(args, '--date'),
436
+ }, raw);
437
+ } else {
438
+ sw.cmdStateApply(cwd, getArgValue(args, '--json'), raw);
439
+ }
418
440
  } else if (subcommand === 'patch') {
419
441
  const patches = {};
420
442
  for (let i = 2; i < args.length; i += 2) {
@@ -471,7 +493,7 @@ async function main() {
471
493
  } else if (subcommand === 'load' || !subcommand) {
472
494
  state.cmdStateLoad(cwd, raw);
473
495
  } else {
474
- error(`Unknown state subcommand: ${subcommand}. Available: json, update, get, patch, compact, advance-plan, record-metric, update-progress, add-decision, add-blocker, resolve-blocker, record-session, load, snapshot`);
496
+ error(`Unknown state subcommand: ${subcommand}. Available: json, update, get, patch, init, section, quick-task, apply, compact, advance-plan, record-metric, update-progress, add-decision, add-blocker, resolve-blocker, record-session, load, snapshot`);
475
497
  }
476
498
  break;
477
499
  }
@@ -705,6 +727,16 @@ async function main() {
705
727
  require('./lib/plan-lint.cjs').cmdVerifyReviewFocus(cwd, args[2], raw);
706
728
  } else if (subcommand === 'decisions') {
707
729
  require('./lib/plan-lint.cjs').cmdVerifyDecisions(cwd, args[2], raw);
730
+ } else if (subcommand === 'gates') {
731
+ require('./lib/plan-lint.cjs').cmdVerifyGates(cwd, args[2], raw);
732
+ } else if (subcommand === 'requirements') {
733
+ require('./lib/requirements-lint.cjs').cmdVerifyRequirements(cwd, raw);
734
+ } else if (subcommand === 'traceability') {
735
+ const named = args.slice(2).filter((a) => !a.startsWith('--'));
736
+ const ids = named.filter((a) => /^[A-Z][A-Z0-9]*-\d+$/.test(a));
737
+ // A misspelt id (auth-01) must not silently trace every requirement instead.
738
+ if (ids.length < named.length) error(`verify traceability: not a requirement id: ${named.filter((a) => !ids.includes(a)).join(', ')} (expected e.g. AUTH-01)`);
739
+ require('./lib/requirements-lint.cjs').cmdVerifyTrace(cwd, ids, raw);
708
740
  } else if (subcommand === 'mutate') {
709
741
  mutate.cmdVerifyMutate(cwd, {
710
742
  phase: getArgValue(args, '--phase') || (args[2] && !args[2].startsWith('--') ? args[2] : null),
@@ -713,7 +745,7 @@ async function main() {
713
745
  timeout: getArgValue(args, '--timeout'),
714
746
  }, raw);
715
747
  } else {
716
- error('Unknown verify subcommand. Available: plan-structure, phase-completeness, references, commits, artifacts, key-links, reconcile, stubs, scope, stale, plan-set, test-integrity, red, mutate, review-focus, decisions');
748
+ error('Unknown verify subcommand. Available: plan-structure, phase-completeness, references, commits, artifacts, key-links, reconcile, stubs, scope, stale, plan-set, test-integrity, red, mutate, review-focus, decisions, gates, requirements, traceability');
717
749
  }
718
750
  break;
719
751
  }
@@ -871,7 +903,7 @@ async function main() {
871
903
  const fullFlag = args.includes('--full');
872
904
  const driftFlag = args.includes('--drift');
873
905
  const linksFlag = args.includes('--links');
874
- verify.cmdValidateHealth(cwd, { repair: repairFlag, standards: standardsFlag, full: fullFlag, drift: driftFlag, links: linksFlag }, raw);
906
+ verify.cmdValidateHealth(cwd, { repair: repairFlag, standards: standardsFlag, full: fullFlag, drift: driftFlag, links: linksFlag, only: (getArgValue(args, '--only') || '').split(',').map((s) => s.trim()).filter(Boolean) }, raw);
875
907
  } else if (subcommand === 'deployment') {
876
908
  verify.cmdValidateDeployment(cwd, raw);
877
909
  } else {
@@ -880,6 +912,68 @@ async function main() {
880
912
  break;
881
913
  }
882
914
 
915
+ case 'autodev': {
916
+ // A1: the deterministic outer loop — a fresh host session per unit, stops in code.
917
+ require('./lib/autodev.cjs').cmdAutodev(cwd, args[1], {
918
+ host: getArgValue(args, '--host'), maxUsd: getArgValue(args, '--max-usd'), maxUsdDay: getArgValue(args, '--max-usd-day'),
919
+ maxTurns: getArgValue(args, '--max-turns'), run: getArgValue(args, '--run'), worktrees: args.includes('--worktrees'), quality: args.includes('--quality'),
920
+ ci: args.includes('--ci') ? (getArgValue(args, '--ci') === 'local' ? 'local' : 'pr') : false, ciRounds: getArgValue(args, '--ci-rounds'), ciPush: args.includes('--ci-push'), ciBase: getArgValue(args, '--ci-base'),
921
+ }, raw);
922
+ break;
923
+ }
924
+
925
+ case 'next-action': {
926
+ require('./lib/next-action.cjs').cmdNextAction(cwd, raw);
927
+ break;
928
+ }
929
+
930
+ case 'size': {
931
+ // Right-sized ceremony: lean or full for a phase or a quick task (sizing.cjs).
932
+ const S = require('./lib/sizing.cjs');
933
+ const subcommand = args[1];
934
+ const opts = { quality: args.includes('--quality'), full: args.includes('--full') };
935
+ if (subcommand === 'phase') {
936
+ if (!args[2] || args[2].startsWith('--')) error('Usage: size phase <N> [--quality] [--full]');
937
+ const r = S.sizePhase(cwd, args[2], opts);
938
+ output(r, raw, r.path);
939
+ } else if (subcommand === 'task') {
940
+ // --file <path>: size a document (new-project's idea or brief) instead of a description.
941
+ const file = getArgValue(args, '--file');
942
+ const text = file ? fs.readFileSync(require('path').resolve(cwd, file), 'utf8') : args.slice(2).filter((a) => a !== '--quality' && a !== '--full').join(' ');
943
+ if (!text.trim()) error('Usage: size task "<description>" | --file <path> [--quality] [--full]');
944
+ const r = S.sizeTask(cwd, text, opts);
945
+ output(r, raw, r.path);
946
+ } else if (subcommand === 'phase-plan') {
947
+ // size phase-plan <N>: the lean phase's plan, checked and recorded, with no planner.
948
+ if (!args[2] || args[2].startsWith('--')) error('Usage: size phase-plan <N> [--quality] [--full]');
949
+ const r = S.planLeanPhase(cwd, args[2], opts);
950
+ output(r, raw, r.ok ? r.path : (r.error || 'failed'), r.ok ? 0 : 1);
951
+ } else if (subcommand === 'quick-plan') {
952
+ // size quick-plan --out <file> --num <N> "<description>": the lean quick task's plan.
953
+ const out = getArgValue(args, '--out');
954
+ const num = getArgValue(args, '--num');
955
+ const skip = new Set(['--out', out, '--num', num]);
956
+ const text = args.slice(2).filter((a) => !skip.has(a)).join(' ');
957
+ if (!out || !text.trim()) error('Usage: size quick-plan --out <file> [--num N] "<description>"');
958
+ const outPath = require('path').resolve(cwd, out);
959
+ fs.mkdirSync(require('path').dirname(outPath), { recursive: true });
960
+ fs.writeFileSync(outPath, S.leanQuickPlan(cwd, text, num));
961
+ output({ written: true, path: out }, raw, out);
962
+ } else if (subcommand === 'plan-check') {
963
+ if (!args[2] || args[2].startsWith('--')) error('Usage: size plan-check <N>');
964
+ const r = S.engineCheckPlans(cwd, args[2]);
965
+ if (r.ok) {
966
+ const rec = S.recordEngineCheck(cwd, args[2], r);
967
+ r.recorded = !rec.error;
968
+ if (rec.error) r.record_error = rec.reason || rec.error;
969
+ }
970
+ output(r, raw, r.ok ? 'passed' : 'failed', r.ok && r.recorded ? 0 : 1);
971
+ } else {
972
+ error('Unknown size subcommand. Available: phase, task, phase-plan, quick-plan, plan-check');
973
+ }
974
+ break;
975
+ }
976
+
883
977
  case 'progress': {
884
978
  const subcommand = args[1] || 'json';
885
979
  commands.cmdProgressRender(cwd, subcommand, raw);
@@ -1036,7 +1130,7 @@ async function main() {
1036
1130
  break;
1037
1131
  }
1038
1132
  if (batch.error) {
1039
- // The newest batch is the one /pan:focus-exec runs; classifying another would
1133
+ // The newest batch is the one /pan:focus-auto --step exec runs; classifying another would
1040
1134
  // hand it waves for the wrong items, so an unusable newest batch is an error.
1041
1135
  output({ error: batch.error }, raw);
1042
1136
  break;
@@ -1196,23 +1290,6 @@ async function main() {
1196
1290
  break;
1197
1291
  }
1198
1292
 
1199
- case 'bridge': {
1200
- const subcommand = args[1];
1201
- if (subcommand === 'list') {
1202
- bridge.cmdBridgeList(cwd, raw);
1203
- } else if (subcommand === 'recommend') {
1204
- bridge.cmdBridgeRecommend(cwd, args[2], {
1205
- max_recommendations: Number(getArgValue(args, '--max') || 10),
1206
- min_score: Number(getArgValue(args, '--min-score') || 1),
1207
- }, raw);
1208
- } else if (subcommand === 'cache') {
1209
- bridge.cmdBridgeCache(cwd, getArgValue(args, '--servers'), getArgValue(args, '--runtime'), raw);
1210
- } else {
1211
- error('Unknown bridge subcommand. Available: list, recommend, cache');
1212
- }
1213
- break;
1214
- }
1215
-
1216
1293
  case 'whatif': {
1217
1294
  const subcommand = args[1];
1218
1295
  if (subcommand === 'prepare') {
@@ -1318,8 +1395,60 @@ async function main() {
1318
1395
  const subcommand = args[1];
1319
1396
  if (subcommand === 'scope') {
1320
1397
  verifyScope.cmdReviewScope(cwd, args[2], raw);
1398
+ } else if (subcommand === 'vote') {
1399
+ // R2: merge k reviewer passes; a finding survives only with a quorum of votes.
1400
+ const valued = new Set(['--phase', '--quorum', '--out']);
1401
+ const files = args.slice(2).filter((a, i, all) => !a.startsWith('--') && !valued.has(all[i - 1]));
1402
+ require('./lib/review-vote.cjs').cmdReviewVote(cwd, { files, phase: getArgValue(args, '--phase'), quorum: getArgValue(args, '--quorum'), out: getArgValue(args, '--out') }, raw);
1403
+ } else if (subcommand === 'cross-family') {
1404
+ // R4: the review on another host's CLI, read-only; off unless the project opts in.
1405
+ require('./lib/cross-family.cjs').cmdReviewCrossFamily(cwd, args[2], {
1406
+ host: getArgValue(args, '--host'), reps: getArgValue(args, '--reps'), dryRun: args.includes('--dry-run'),
1407
+ }, raw);
1408
+ } else {
1409
+ error('Unknown review subcommand. Available: scope, vote, cross-family');
1410
+ }
1411
+ break;
1412
+ }
1413
+
1414
+ case 'merge': {
1415
+ // L6a: the human merge gate on the CLI; confirm runs only in a person's terminal.
1416
+ const subcommand = args[1];
1417
+ const M = require('./lib/merge.cjs');
1418
+ if (subcommand === 'request') {
1419
+ M.cmdMergeRequest(cwd, args[2], { phase: getArgValue(args, '--phase'), ciGreen: args.includes('--ci-green') }, raw);
1420
+ } else if (subcommand === 'confirm') {
1421
+ M.cmdMergeConfirm(cwd, args[2], raw);
1422
+ } else {
1423
+ error('Unknown merge subcommand. Available: request, confirm');
1424
+ }
1425
+ break;
1426
+ }
1427
+
1428
+ case 'uat': {
1429
+ // L8: UAT results recorded through the engine, so every runtime leaves the same uat.md.
1430
+ const subcommand = args[1];
1431
+ const U = require('./lib/uat.cjs');
1432
+ if (subcommand === 'record') {
1433
+ U.cmdUatRecord(cwd, args[2], { test: getArgValue(args, '--test'), result: getArgValue(args, '--result'), reported: getArgValue(args, '--reported'), severity: getArgValue(args, '--severity'), reason: getArgValue(args, '--reason') }, raw);
1434
+ } else if (subcommand === 'status') {
1435
+ U.cmdUatStatus(cwd, args[2], raw);
1436
+ } else {
1437
+ error('Unknown uat subcommand. Available: record, status');
1438
+ }
1439
+ break;
1440
+ }
1441
+
1442
+ case 'debug': {
1443
+ // P5: a debug session's reproduction as the closing check, and the resolved case base.
1444
+ const subcommand = args[1];
1445
+ const D = require('./lib/debug-cases.cjs');
1446
+ if (subcommand === 'repro') {
1447
+ D.cmdDebugRepro(cwd, args[2], raw, { timeout: getArgValue(args, '--timeout') });
1448
+ } else if (subcommand === 'similar') {
1449
+ D.cmdDebugSimilar(cwd, args[2], raw, { limit: getArgValue(args, '--limit') });
1321
1450
  } else {
1322
- error('Unknown review subcommand. Available: scope');
1451
+ error('Unknown debug subcommand. Available: repro, similar');
1323
1452
  }
1324
1453
  break;
1325
1454
  }
@@ -1335,8 +1464,11 @@ async function main() {
1335
1464
  const subcommand = args[1];
1336
1465
  if (subcommand === 'lint') {
1337
1466
  require('./lib/research-lint.cjs').cmdResearchLint(cwd, args[2], { now: getArgValue(args, '--now') }, raw);
1467
+ } else if (subcommand === 'check') {
1468
+ // Research answers at most five blocking questions, each with a source or an assumption.
1469
+ require('./lib/research-lint.cjs').cmdResearchCheck(cwd, args[2], args[3], { market: args.includes('--market') }, raw);
1338
1470
  } else {
1339
- error('Unknown research subcommand. Available: lint');
1471
+ error('Unknown research subcommand. Available: lint, check');
1340
1472
  }
1341
1473
  break;
1342
1474
  }
@@ -1348,6 +1480,7 @@ async function main() {
1348
1480
  reviewerFile: getArgValue(args, '--reviewer-file'),
1349
1481
  hardenerFile: getArgValue(args, '--hardener-file'),
1350
1482
  metaFile: getArgValue(args, '--meta-file'),
1483
+ crossFile: getArgValue(args, '--cross-file'),
1351
1484
  };
1352
1485
  if (subcommand === 'merge') {
1353
1486
  reviewDeep.cmdReviewDeepMerge(cwd, phaseNum, opts, raw);
@@ -1393,8 +1526,10 @@ async function main() {
1393
1526
  findings.cmdFindingsDebt(cwd, { milestone: filters.milestone }, raw);
1394
1527
  } else if (subcommand === 'suppressions') {
1395
1528
  findings.cmdFindingsSuppressions(cwd, { phase: filters.phase, agent: filters.agent }, raw);
1529
+ } else if (subcommand === 'prove') {
1530
+ findings.cmdFindingsProve(cwd, { id: findings.findingIdsIn(args.slice(2))[0], test: getArgValue(args, '--test'), timeout: getArgValue(args, '--timeout') }, raw);
1396
1531
  } else {
1397
- error('Unknown findings subcommand. Available: record, list, dispose, debt, suppressions');
1532
+ error('Unknown findings subcommand. Available: record, list, dispose, debt, suppressions, prove');
1398
1533
  }
1399
1534
  break;
1400
1535
  }
@@ -1487,8 +1622,14 @@ async function main() {
1487
1622
  worktree.cmdWorktreeRemove(cwd, args[2], getArgValue(args, '--branch'), raw, { force: args.includes('--force') });
1488
1623
  } else if (subcommand === 'cleanup') {
1489
1624
  worktree.cmdWorktreeCleanup(cwd, raw, { force: args.includes('--force') });
1625
+ } else if (subcommand === 'preflight') {
1626
+ // A3: shadow-merge branches onto the base in a throwaway worktree and run the oracle.
1627
+ worktree.cmdWorktreePreflight(cwd, {
1628
+ base: getArgValue(args, '--base'), test: getArgValue(args, '--test'),
1629
+ branches: String(getArgValue(args, '--branches') || '').split(',').map((b) => b.trim()).filter(Boolean),
1630
+ }, raw);
1490
1631
  } else {
1491
- error('Unknown worktree subcommand. Available: list, create, remove, cleanup');
1632
+ error('Unknown worktree subcommand. Available: list, create, remove, cleanup, preflight');
1492
1633
  }
1493
1634
  break;
1494
1635
  }
@@ -79,7 +79,7 @@ patterns:
79
79
 
80
80
  ## P-360 — Campaign telemetry must be both captured and trustworthy
81
81
 
82
- **Evidence:** Three production projects showed campaign telemetry failing in *both* directions. (1) **Absent** — a full 5-mission army campaign (the compliance project v1.1) produced **zero** cost/trace/bus records, although the hooks were installed, registered on `SubagentStop`, and verified working in isolation; a main-loop coordinator's work never fired `SubagentStop`, so nothing was captured. (2) **Corrupted** — two projects that *did* capture (a weeks-long focus-auto loop and a phase-exec project) logged physically-impossible figures: a single subagent record claiming billions of cache-read tokens, cache-hit pinned at 100%, and many byte-identical rows. Root cause: the transcript fallback summed `usage` across *every* assistant message in a transcript whose `session_id` is shared by all subagents — so each event re-summed the whole growing transcript, and `cache_read` (re-read every turn) multiplied by the turn count. Either way the HUD, `/pan:cost`, and `/pan:optimize` consumed nothing usable.
82
+ **Evidence:** Three production projects showed campaign telemetry failing in *both* directions. (1) **Absent** — a full 5-mission army campaign (the compliance project v1.1) produced **zero** cost/trace/bus records, although the hooks were installed, registered on `SubagentStop`, and verified working in isolation; a main-loop coordinator's work never fired `SubagentStop`, so nothing was captured. (2) **Corrupted** — two projects that *did* capture (a weeks-long focus-auto loop and a phase-exec project) logged physically-impossible figures: a single subagent record claiming billions of cache-read tokens, cache-hit pinned at 100%, and many byte-identical rows. Root cause: the transcript fallback summed `usage` across *every* assistant message in a transcript whose `session_id` is shared by all subagents — so each event re-summed the whole growing transcript, and `cache_read` (re-read every turn) multiplied by the turn count. Either way the HUD, `/pan:cost`, and `/pan:learn --optimize` consumed nothing usable.
83
83
 
84
84
  **Rule:** For any long-running, multi-step autonomous campaign, telemetry must survive the spawn pattern *and* be numerically sane:
85
85
 
@@ -89,4 +89,4 @@ patterns:
89
89
  4. **Sanity-check before you trust the number.** A cache-hit pinned at 100%, or cache-read far exceeding input, is a miscount — not a triumph. Cap or flag implausible records instead of aggregating them.
90
90
  5. **Preflight a telemetry probe** at campaign start (write then read one record); treat empty *or* absurd telemetry as a defect, not a quiet state.
91
91
 
92
- **Applies in:** `/pan:army` Phase 0 + Learn step, `pan-conductor` campaign mode, `hooks/pan-cost-logger.js` + `pan-trace-logger.js`, the HUD telemetry panels, `/pan:cost`, `/pan:optimize`.
92
+ **Applies in:** `/pan:army` Phase 0 + Learn step, `pan-conductor` campaign mode, `hooks/pan-cost-logger.js` + `pan-trace-logger.js`, the HUD telemetry panels, `/pan:cost`, `/pan:learn --optimize`.
@@ -99,7 +99,7 @@ Add note that this is the last plan and what comes after:
99
99
 
100
100
  **Also available:**
101
101
  - `/pan:discuss-phase 2` — gather context first
102
- - `/pan:research-phase 2` — investigate unknowns
102
+ - `/pan:plan-phase --research-only 2` — investigate unknowns
103
103
  - Review roadmap
104
104
 
105
105
  ---
@@ -128,7 +128,7 @@ Show completion status before next action:
128
128
 
129
129
  **Also available:**
130
130
  - `/pan:discuss-phase 3` — gather context first
131
- - `/pan:research-phase 3` — investigate unknowns
131
+ - `/pan:plan-phase --research-only 3` — investigate unknowns
132
132
  - Review what Phase 2 built
133
133
 
134
134
  ---
@@ -149,7 +149,7 @@ When there's no clear primary action:
149
149
 
150
150
  **To discuss context first:** `/pan:discuss-phase 3`
151
151
 
152
- **To research unknowns:** `/pan:research-phase 3`
152
+ **To research unknowns:** `/pan:plan-phase --research-only 3`
153
153
 
154
154
  <sub>`/clear` first → fresh context window</sub>
155
155
 
@@ -11,7 +11,7 @@ phase — context compaction may have dropped earlier sections.
11
11
  |----------|--------------|----------------|
12
12
  | "User's request is clear, no need to clarify" | You're guessing at intent. Phase 0 catches misunderstandings before scaffolding. | Run the Phase 0 clarification check (see `new-project.md` / `plan-phase.md`). |
13
13
  | "Phase tests passed locally, /pan:verify-phase isn't needed" | One run isn't validation. verify-phase checks the phase goal against the code (must-haves, artifacts, wiring, requirements, anti-patterns) and runs the full test suite — not just the phase's own tests. | Always run `/pan:verify-phase` before marking a phase complete. |
14
- | "I'll skip /pan:focus-scan and pick the next item myself" | Manual selection ignores priority/budget logic in `focus.cjs`. You'll bias toward easy items and miss higher-priority work. | Use `/pan:focus-scan` → `/pan:focus-plan` → `/pan:focus-exec`. |
14
+ | "I'll skip /pan:focus-auto --step scan and pick the next item myself" | Manual selection ignores priority/budget logic in `focus.cjs`. You'll bias toward easy items and miss higher-priority work. | Use `/pan:focus-auto --step scan` → `/pan:focus-auto --step plan` → `/pan:focus-auto --step exec`. |
15
15
  | "I'll bump the model / add a flag / refactor while I'm here" | Scope creep. The user asked for one change; surrounding cleanup belongs in a separate item. | Do only the requested change. Note unrelated cleanup as a TODO for a future focus-scan. |
16
16
  | "I'll mark this phase complete; the docs can lag behind" | Doc/state drift compounds. By the next session, the agent reads stale docs and proceeds on false assumptions. | Run the doc-sync step (update CHANGELOG/state and commit via `pan-tools commit`) before phase completion. CHANGELOG and version bumps are part of the phase, not after it. |
17
17
  | "The tests pass, so the code is portable" | Tests run on one Node version on one OS. Modern Node auto-detects ESM syntax, so `import`/`export` in a project with no `package.json` passes locally and fails under `"type": "commonjs"` or older Node. | Declare the module type explicitly whenever you emit `import`/`export` or `require` — `"type"` in `package.json`, or `.mjs`/`.cjs` extensions. Never rely on syntax detection. |
@@ -65,7 +65,6 @@ Since the 2026-07 **COST RESET**, `quality` and `balanced` are identical — bot
65
65
  | pan-executor | reasoning | reasoning | mid |
66
66
  | pan-phase-researcher | reasoning | reasoning | fast |
67
67
  | pan-project-researcher | reasoning | reasoning | fast |
68
- | pan-research-synthesizer | reasoning | reasoning | fast |
69
68
  | pan-debugger | reasoning | reasoning | mid |
70
69
  | pan-document_code | reasoning | reasoning | fast |
71
70
  | pan-verifier | reasoning | reasoning | fast |
@@ -96,7 +95,7 @@ Relative cost per tier (fast = 1× baseline):
96
95
  | mid | 3× |
97
96
  | fast | 1× |
98
97
 
99
- Use `/pan:profile <profile>` to see estimated cost differences before switching.
98
+ Use `/pan:settings --profile <profile>` to see estimated cost differences before switching.
100
99
 
101
100
  ---
102
101
 
@@ -242,7 +241,7 @@ Full routing config in `.planning/config.json`:
242
241
 
243
242
  ## Switching Profiles
244
243
 
245
- Runtime: `/pan:profile <profile>`
244
+ Runtime: `/pan:settings --profile <profile>`
246
245
 
247
246
  ### Downgrade Confirmation
248
247
 
@@ -142,4 +142,28 @@ Loop until "Create project.md" selected.
142
142
 
143
143
  </anti_patterns>
144
144
 
145
+ <clarification_taxonomy>
146
+
147
+ Before asking anything, scan the idea or the phase against these categories and note where it is ambiguous: where two reasonable readings would build different things. A category with no ambiguity needs no question.
148
+
149
+ - **Scope**: what is in, what is explicitly out, where this ends
150
+ - **Users** and roles: who acts, with what permissions, how many of them
151
+ - **Behaviour** and flows: the main path, its order, what triggers it
152
+ - **Data** and state: what is stored, its shape, its lifetime, who owns it
153
+ - **Interfaces**: other systems, files, APIs and formats this touches
154
+ - **Errors and edge cases**: empty, missing, duplicate, too large, offline, concurrent
155
+ - **Non-functional**: speed, scale, security, accessibility, cost
156
+ - **Constraints**: stack, platform, deadlines, compliance, what must not change
157
+ - **Done**: how the user will know it works; what they would check first
158
+
159
+ </clarification_taxonomy>
160
+
161
+ <question_budget>
162
+
163
+ Ask at most five clarifying questions in one questioning session (a new-project round, or one discuss-phase). Rank the ambiguities by impact × uncertainty: how much the build would differ between readings, times how unsure you are which reading the user means. Ask the top ones, one question per call unless two are independent and short.
164
+
165
+ Everything you did not ask about is recorded, never silently guessed. Write it into the document you produce as a line the user can correct: `Assumed: <the reading you chose> (<category>)`. A wrong assumption in writing costs the user one correction; a wrong guess in code costs a rework.
166
+
167
+ </question_budget>
168
+
145
169
  </questioning_guide>
@@ -86,13 +86,11 @@ Plans: 3/5 complete
86
86
  ```
87
87
  ◆ Spawning researcher...
88
88
 
89
- ◆ Spawning 4 researchers in parallel...
90
- → Stack research
91
- → Features research
92
- → Architecture research
93
- → Pitfalls research
89
+ ◆ Spawning 2 mappers in parallel...
90
+ → Tech mapper
91
+ → Architecture mapper
94
92
 
95
- ✓ Researcher complete: STACK.md written
93
+ ✓ Researcher complete: 3 questions answered
96
94
  ```
97
95
 
98
96
  ---
@@ -25,8 +25,9 @@ A judging agent ends its report with one fenced `pan-verdict` block. The block i
25
25
  | `phase` | when you know it | the phase number you were asked about, e.g. `"03"` |
26
26
  | `verdict` | yes | your own verdict word (table below) |
27
27
  | `outcome` | yes | `pass`, `fail` or `needs_human` |
28
- | `findings` | yes (may be empty) | a list of `{class, severity, where, summary}` |
28
+ | `findings` | yes (may be empty) | a list of `{class, severity, where, summary}`, plus `pre_existing: true` on a finding in code the change did not touch (recorded as deferred debt, never a blocker) |
29
29
  | `resolutions` | on a re-check | a list of `{id, status, evidence}` answering each earlier open finding you were given in `<open_findings>`: `status` is `resolved` (with `evidence`: what you checked and saw), `still_present` or `cannot_tell`. A finding you leave out stays open, and `resolved` without evidence is recorded as `cannot_tell` |
30
+ | `declined` | when you set a behaviour aside | a list of `{behaviour, reason}`: something in scope you chose not to judge (outside your lens, outside the diff, no way to run it). It is recorded on the verdict, so silence about it is never read as a pass |
30
31
  | `not_checked` | when a check could not run | a list of `{check, reason}`: a check you were asked to make and could not run, and why (no test script, no browser, a file you could not read). Never fold it into `pass`: a verdict with entries here says what it did not see |
31
32
 
32
33
  | Agent | `verdict` → `outcome` |
@@ -2,7 +2,7 @@
2
2
  "mode": "interactive",
3
3
  "depth": "standard",
4
4
  "workflow": {
5
- "research": true,
5
+ "research": false,
6
6
  "plan_check": true,
7
7
  "verifier": true,
8
8
  "auto_advance": false,
@@ -10,6 +10,10 @@
10
10
  "phase_record_compact": false,
11
11
  "phase_gate": "enforce",
12
12
  "mutation_gate": "report",
13
+ "mutation_floor": 0.6,
14
+ "review_mode": "single",
15
+ "cross_family_review": "off",
16
+ "worktree_isolation": false,
13
17
  "phase_reports": { "enabled": false, "open": false, "theme": "auto", "index": true }
14
18
  },
15
19
  "cost": {
@@ -37,6 +37,7 @@ started: [when it broke / always broken]
37
37
  command: [one command you have RUN that fails on the reported symptom, or "none"]
38
38
  fails_with: [the output that shows the symptom, secrets redacted]
39
39
  deterministic: [yes / rate N of M runs for a flaky bug]
40
+ requirement: [the requirement or UAT truth this reproduces, e.g. REQ-4, when there is one]
40
41
  tried: [only when command is "none": what you tried and why it cannot be built]
41
42
 
42
43
  ## Eliminated
@@ -4,7 +4,7 @@ Template for `.planning/phases/XX-name/discovery.md` - shallow research for libr
4
4
 
5
5
  **Purpose:** Answer "which library/option should we use" questions when a phase needs a quick option comparison before planning.
6
6
 
7
- For deep ecosystem research ("how do experts build this"), use `/pan:research-phase` which produces research.md.
7
+ For deep ecosystem research ("how do experts build this"), use `/pan:plan-phase --research-only` which produces research.md.
8
8
 
9
9
  ---
10
10
 
@@ -142,5 +142,5 @@ Create `.planning/phases/XX-name/discovery.md`:
142
142
  - Niche/complex domains (3D, games, audio, shaders)
143
143
  - Need ecosystem knowledge, not just library choice
144
144
  - "How do experts build this" questions
145
- - Use `/pan:research-phase` for these
145
+ - Use `/pan:plan-phase --research-only` for these
146
146
  </guidelines>
@@ -17,6 +17,9 @@ Requirements for initial release. Each maps to roadmap phases.
17
17
  ### Authentication
18
18
 
19
19
  - [ ] **AUTH-01**: User can sign up with email and password
20
+ - WHEN a visitor submits a new email and a valid password THE SYSTEM SHALL create the account
21
+ - IF the email is already registered THEN THE SYSTEM SHALL refuse the sign-up without revealing the account
22
+ - Test: tests/auth/signup.test.ts
20
23
  - [ ] **AUTH-02**: User receives email verification after signup
21
24
  - [ ] **AUTH-03**: User can reset password via email link
22
25
  - [ ] **AUTH-04**: User session persists across browser refresh
@@ -74,6 +77,12 @@ Which phases cover which requirements. Updated during roadmap creation.
74
77
 
75
78
  </template>
76
79
 
80
+ <ears_criteria>
81
+ Each v1 requirement carries at least one acceptance criterion as an indented sub-bullet in an EARS form: `WHEN <trigger> THE SYSTEM SHALL <response>`, `WHILE <state> …`, `WHERE <feature> …`, `IF <unwanted condition> THEN THE SYSTEM SHALL …`, or `THE SYSTEM SHALL …`. `pan-tools verify requirements` fails a v1 requirement with none.
82
+
83
+ The tests that check a requirement go in `Test:` sub-bullets as the plans add them. `pan-tools verify traceability` runs them. A criterion with no mapped test reads `not_checked`, never met, and `phase complete` ticks a requirement only when its mapped tests pass. A requirement with no criteria at all is treated as legacy and keeps the old tick.
84
+ </ears_criteria>
85
+
77
86
  <guidelines>
78
87
 
79
88
  **Requirement Format:**
@@ -60,13 +60,11 @@ Extract from result: `phase_number`, `padded`, `name`, `slug`, `directory`.
60
60
  <step name="update_project_state">
61
61
  Update state.md to reflect the new phase:
62
62
 
63
- 1. Read `.planning/state.md`
64
- 2. Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
65
- ```
66
- - Phase {N} added: {description}
67
- ```
63
+ Append the entry under "## Accumulated Context" → "### Roadmap Evolution" (the engine creates the section when it is missing):
68
64
 
69
- If "Roadmap Evolution" section doesn't exist, create it.
65
+ ```bash
66
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state section "Roadmap Evolution" --append "- Phase {N} added: {description}"
67
+ ```
70
68
  </step>
71
69
 
72
70
  <step name="completion">
@@ -1,7 +1,7 @@
1
1
  <purpose>
2
2
  Surface Claude's assumptions about a phase before planning, enabling users to correct misconceptions early.
3
3
 
4
- Key difference from discuss-phase: This is ANALYSIS of what Claude thinks, not INTAKE of what user knows. No file output - purely conversational to prompt discussion.
4
+ Key difference from discuss-phase: This is ANALYSIS of what Claude thinks, not INTAKE of what user knows. The conversation ends with one file, `{phase_dir}/{phase_num}-assumptions.md`, holding the assumptions and the user's corrections, so discuss-phase and plan-phase start from them instead of losing them with the session.
5
5
  </purpose>
6
6
 
7
7
  <process>
@@ -145,6 +145,24 @@ This changes my understanding significantly. [Summarize new understanding]
145
145
  Assumptions validated.
146
146
  ```
147
147
 
148
+ **Either way, save them.** Write `{phase_dir}/{phase_num}-assumptions.md` once, in full:
149
+
150
+ ```markdown
151
+ # Phase {phase_num}: Assumptions
152
+
153
+ **Reviewed:** {date}
154
+
155
+ ## Assumptions
156
+
157
+ - {each assumption, as presented}
158
+
159
+ ## Corrections
160
+
161
+ - {each correction, in the user's words; "None: the user confirmed the assumptions" when there were none}
162
+ ```
163
+
164
+ `init phase-op` reports it as `assumptions_path`; discuss-phase and plan-phase read it. Commit it with the phase's docs when `commit_docs` is on.
165
+
148
166
  Continue to offer_next.
149
167
  </step>
150
168
 
@@ -98,6 +98,8 @@ Template placeholders (see `debug-subagent-prompt.md`):
98
98
  - `{timeline}`: "Discovered during UAT"
99
99
  - `{true_or_false}`: `true` (symptoms are prefilled from the UAT gap)
100
100
  - `{goal}`: `find_root_cause_only` (UAT flow - plan-phase --gaps handles fixes)
101
+
102
+ Each gap gets its own reproduction, one per requirement or UAT truth it breaks (the debugger records `requirement:` beside the command). That command is the gap's closing check: the fix plan from `/pan:plan-phase --gaps` is done only when `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs debug repro <slug>` turns green.
101
103
  - `{slug}`: Generated from the issue summary
102
104
  </step>
103
105
 
@@ -116,7 +116,9 @@ Phase number from argument (required).
116
116
  INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${PHASE}")
117
117
  ```
118
118
 
119
- Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`.
119
+ Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`, `assumptions_path`.
120
+
121
+ **If `assumptions_path` is set**, read it first: it holds the assumptions `/pan:assumptions` surfaced and the user's corrections to them. Treat each correction as already decided; do not ask it again.
120
122
 
121
123
  **If `phase_found` is false:**
122
124
  ```
@@ -283,7 +285,7 @@ Analyze the phase to identify gray areas worth discussing.
283
285
 
284
286
  1. **Domain boundary** — What capability is this phase delivering? State it clearly.
285
287
 
286
- 2. **Gray areas by category** — For each relevant category (UI, UX, Behavior, Empty States, Content), identify 1-2 specific ambiguities that would change implementation.
288
+ 2. **Gray areas by category**: scan the phase against the `<clarification_taxonomy>` in `references/questioning.md` (scope, users, behaviour, data, interfaces, errors and edge cases, non-functional, constraints, done), plus UI, UX, empty states and content for a user-facing phase. Identify the specific ambiguities that would change implementation, then keep to the `<question_budget>`: at most five questions, ranked by impact × uncertainty, and every ambiguity you do not ask about written into context.md as an `Assumed:` line the user can correct.
287
289
 
288
290
  3. **Skip assessment** — If no meaningful gray areas exist (pure infrastructure, clear-cut implementation), the phase may not need discussion.
289
291