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
@@ -0,0 +1,69 @@
1
+ <purpose>
2
+ Execute a lean phase in this one session: you do the work the executor agent would do, then one reviewer pass and a verifier check it. Autodev runs this for a phase the engine sized lean (its requirements say precisely what to build, and the engine wrote and checked its plan), so the full exec-phase orchestration (an orchestrating session, a separate executor, test generation) is not needed. The reviewer stays: on the brief test (2026-10-25) a lean build and a bare host's build each carried one high-severity defect the hidden checks could not see, and the reviewer found both. The phase gate still decides when autodev runs `phase complete`.
3
+ </purpose>
4
+
5
+ <rules>
6
+ - **The plan is the specification.** Do what each task's `<action>` says, nothing more. Do not widen scope; log anything else to `{phase_dir}/deferred-items.md`.
7
+ - **Tests are the spec.** Test files the plan does not list in `files_modified` are read-only. Never delete, rename or skip a test, remove an assertion, or add one that cannot fail. A plan's `supersedes_tests` are the exception it declares: update their expectations to what the named requirements now require, and record each change as a deviation. A test you cannot satisfy without weakening it means stop and reply `## BLOCKED_SPEC_CONFLICT` with the test, the requirement and why both cannot hold.
8
+ - **Commit each task** when its verify command passes: `node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "feat({padded}-{plan}): <what the task did>" --files <the files it changed>`.
9
+ - **Unattended:** do not ask questions; take the recommended default and record what you assumed in the summary. Do not start another phase or command.
10
+ </rules>
11
+
12
+ <process>
13
+ 1. **Load the phase:**
14
+ ```bash
15
+ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init execute-phase "{phase}")
16
+ ```
17
+ Read `phase_dir`, `phase_number`, `incomplete_plans`, `plan_check` and `verifier_enabled`. When `plan_check.status` is not `ok` or `disabled`, stop and reply `EXECUTION HALTED: plan check {status}`.
18
+
19
+ 2. **Record the test baseline** (what the suite does before this phase):
20
+ ```bash
21
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs test run --phase "{phase_number}" --baseline > /dev/null
22
+ ```
23
+
24
+ 3. **Execute each incomplete plan, in order.** Read the plan. For each task: make the change, write or update the tests its action names, run its `<verify>` command until it passes (at most three fix attempts, then record the task as an issue and continue), and commit it. Then write `{phase_dir}/{padded}-{plan}-summary.md` from `~/.claude/pan-wizard-core/templates/summary.md`: what was built, the files, every deviation (including each superseded test expectation: file, what it asserted, what it asserts now, which requirement) and every assumption. Then record progress and commit the summary:
25
+ ```bash
26
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state advance-plan
27
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs state update-progress
28
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap update-plan-progress "{phase_number}"
29
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs requirements mark-complete {the plan's requirements}
30
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "docs({padded}-{plan}): complete plan" --files {phase_dir}/{padded}-{plan}-summary.md .planning/state.md .planning/roadmap.md .planning/requirements.md
31
+ ```
32
+
33
+ 4. **Review.** One pass of the code reviewer over what the phase changed; it looks for what the tests and the verifier do not (a save that is not crash-safe, unchecked arithmetic, state left wrong after an error). Collect the scope, then spawn it:
34
+ ```bash
35
+ REVIEW_SCOPE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs review scope "{phase_number}")
36
+ CHANGED_FILES_LIST=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs review scope "{phase_number}" --raw)
37
+ ```
38
+ ```
39
+ Task(
40
+ subagent_type="pan-reviewer",
41
+ model="{reviewer_model from: node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-reviewer --raw}",
42
+ prompt="<objective>Review the code changed in phase {phase_number} for defects: behaviour that contradicts the requirements, data loss or corruption (including a crash mid-write), inputs that must throw and do not, state left wrong after an error, security problems. Real defects only, each with a concrete input that shows it.</objective> <files_to_read>./CLAUDE.md (if it exists); changed files: ${CHANGED_FILES_LIST}</files_to_read> <intent>${REVIEW_SCOPE}</intent> <executor_concerns>{what you finished but were not sure of, with why; empty when none}</executor_concerns>"
43
+ )
44
+ ```
45
+ Write its returned text, verbatim and in full with its `pan-verdict` block, to `{phase_dir}/{phase_number}-review.md` (the reviewer is read-only), then record it:
46
+ ```bash
47
+ REVIEW_VERDICT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings record --phase "{phase_number}" --agent pan-reviewer --file "{phase_dir}/{phase_number}-review.md" --raw)
48
+ ```
49
+ `PASS`: go on. `PASS_WITH_WARNINGS`: go on, recording that the phase continues past them:
50
+ ```bash
51
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings dispose --phase "{phase_number}" --agent pan-reviewer --open --as deferred --reason "accepted at review: PASS_WITH_WARNINGS"
52
+ ```
53
+ `NEEDS_FIXES`: fix each ERROR finding (the tests stay the spec: a fix adds a test for the defect, never weakens one), commit the fixes as `fix({padded}): review findings`, and run the review once more. A second `NEEDS_FIXES` does not loop: record what stays open with `findings dispose ... --as deferred --reason "open after one fix round (unattended)"`, go on to verification, and name those findings in the reply. Never continue past findings silently: an open finding without a recorded reason is what the milestone audit cannot see.
54
+
55
+ 5. **Verify** (skip only when `verifier_enabled` is false, and say so). Spawn the verifier; it is a second pair of eyes, so give it paths, not your conclusions:
56
+ ```
57
+ Task(
58
+ subagent_type="pan-verifier",
59
+ model="{verifier_model from: node ~/.claude/pan-wizard-core/bin/pan-tools.cjs resolve-model pan-verifier --raw}",
60
+ prompt="Verify phase {phase_number} goal achievement. Phase directory: {phase_dir}. Check the plans' must_haves and requirement IDs against the code. Run the project's test suite as the test gate and record test_gate in the frontmatter. Create verification.md."
61
+ )
62
+ ```
63
+ Then record its verdict:
64
+ ```bash
65
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings record --phase "{phase_number}" --file "$(ls {phase_dir}/*-verification.md | head -1)" --raw
66
+ ```
67
+
68
+ 6. **Reply** in a few lines: the plans executed, the commits, the review verdict and any finding left open, the verification status, and any deviation, assumption or issue. Do not run `phase complete`: autodev runs it next and the phase gate decides.
69
+ </process>
@@ -52,6 +52,14 @@ Parse JSON for: `executor_model`, `verifier_model`, `reviewer_model`, `commit_do
52
52
 
53
53
  **Drift.** For each `plan_drift` entry, tell the executor of that plan, in its prompt, which of its `files_modified` changed since it was planned (`files`), so it re-reads them before editing. An entry with `error` means its `planned_commit` is unknown: say so and continue.
54
54
 
55
+ **Size the ceremony** (pass `--quality` or `--full` through when `$ARGUMENTS` has them):
56
+
57
+ ```bash
58
+ SIZING=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs size phase "${PHASE_ARG}" [--quality] [--full])
59
+ ```
60
+
61
+ Show `Ceremony: {path} ({reasons joined by "; "})`. When `SIZING.path` is `lean`, the phase runs without the test-generation agent (`generate_tests`); the executor's own tests, the engine's test gate, one code review pass (`code_review`) and the verifier (`verify_phase_goal`) still run, and the phase gate still decides.
62
+
55
63
  When `parallelization` is false, plans within a wave execute sequentially.
56
64
 
57
65
  **Circular optimization — start trace session for this exec:**
@@ -96,6 +104,8 @@ PLAN_INDEX=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase-plan-index "
96
104
 
97
105
  Parse JSON for: `phase`, `plans[]` (each with `id`, `wave`, `autonomous`, `objective`, `files_modified`, `task_count`, `has_summary`), `waves` (map of wave number → plan IDs), `incomplete`, `has_checkpoints`.
98
106
 
107
+ **One plan (`--plan <id>`).** Execute only that plan: skip every other plan, then stop after its summary and commits, with no code review, verification or phase routing. `pan-tools autodev run --worktrees` runs each plan this way in its own git worktree and merges the plans back behind a shadow-merge preflight; the phase-level steps run later on the merged result. If the plan already has a summary, say so and stop.
108
+
99
109
  **Filtering:** Skip plans where `has_summary: true`. If `--gaps-only`: also skip plans whose frontmatter lacks `gap_closure: true` (`phase-plan-index` does not report it; `frontmatter get <plan> --field gap_closure` exits 1 when it is absent). If all filtered: "No matching incomplete plans" → exit.
100
110
 
101
111
  **If `--gaps-only`:** this run is the fix round after a verification found gaps — a second attempt at work that failed once. Resolve the executor for that attempt and use it in place of `executor_model` for every spawn in this run:
@@ -186,6 +196,11 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
186
196
  - .agents/skills/ (Project skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
187
197
  </files_to_read>
188
198
 
199
+ {Only when the plan's frontmatter has `supersedes_tests`, include:}
200
+ <superseded_tests>
201
+ This plan changes behaviour earlier phases built ({supersedes_requirements}). These test files assert the old behaviour and the plan declares them: {supersedes_tests}. Updating their expectations to what those requirements now require is part of the task, not a spec conflict. Record each changed expectation as a deviation in the summary (file, what it asserted, what it asserts now, which requirement). Deleting, skipping or weakening a test is still forbidden, and `verify test-integrity` still checks it.
202
+ </superseded_tests>
203
+
189
204
  If the plan's `<context>` names `@.planning/roadmap.md`, read `{slice_path}` in its place: it carries this phase's section, its dependencies' goals and its requirements, and the whole roadmap is the largest file in `.planning/` on a long project. Open the whole file only for something the slice leaves out.
190
205
 
191
206
  <success_criteria>
@@ -353,7 +368,7 @@ Concerns go into the review too: the code_review step passes them to the reviewe
353
368
  <step name="generate_tests">
354
369
  **Auto-invoke test generation after execution completes.**
355
370
 
356
- **Skip if** `--skip-tests` or `--fast` flag is present in $ARGUMENTS.
371
+ **Skip if** `--skip-tests` or `--fast` flag is present in $ARGUMENTS, or `SIZING.path` is `lean`.
357
372
 
358
373
  1. Record baseline test count:
359
374
  ```bash
@@ -363,12 +378,9 @@ TEST_BASELINE=$(npm test 2>&1 | grep -E "^(ℹ|#) tests" | awk '{print $NF}')
363
378
  2. Invoke phase-tests workflow for the completed phase:
364
379
  ```
365
380
  Task(
366
- prompt="Generate tests for phase ${PHASE_NUMBER}.
381
+ prompt="Follow the phase-tests workflow (~/.claude/pan-wizard-core/workflows/phase-tests.md) for phase ${PHASE_NUMBER}.
367
382
  Phase directory: ${phase_dir}
368
- Read each summary.md to understand what was built.
369
- Generate unit and integration tests for the new code.
370
- Discover the project's existing test patterns, directories, frameworks, and helpers before writing tests.
371
- Follow whatever conventions the project already uses.",
383
+ It classifies each changed file, discovers the project's test patterns, writes the tests the plan approves, and commits them.",
372
384
  subagent_type="general-purpose",
373
385
  model="{executor_model}",
374
386
  )
@@ -379,7 +391,13 @@ Alternatively, if the user's AI tool supports it, invoke the command directly:
379
391
  /pan:phase-tests ${PHASE_NUMBER}
380
392
  ```
381
393
 
382
- 3. Record new test count:
394
+ 3. Prove the new tests catch something (V4). A test that passes without the phase's code is tautological:
395
+ ```bash
396
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify red "${PHASE_NUMBER}"
397
+ ```
398
+ Rewrite or drop each test it reports as `not_red`; `not_checked` names a runner that cannot run one file and is reported, not failed.
399
+
400
+ 4. Record new test count:
383
401
  ```bash
384
402
  TEST_AFTER=$(npm test 2>&1 | grep -E "^(ℹ|#) tests" | awk '{print $NF}')
385
403
  ```
@@ -400,7 +418,7 @@ TEST_AFTER=$(npm test 2>&1 | grep -E "^(ℹ|#) tests" | awk '{print $NF}')
400
418
  <step name="code_review">
401
419
  **Spawn pan-reviewer agent to review changed files.**
402
420
 
403
- **Skip if** `--skip-review` or `--fast` flag is present in $ARGUMENTS.
421
+ **Skip if** `--skip-review` or `--fast` flag is present in $ARGUMENTS. A lean phase (`SIZING.path`) keeps this step: the review finds what the tests and the verifier do not.
404
422
 
405
423
  1. Collect the review scope: the files the phase's commits changed plus any uncommitted or untracked work, whether or not a summary lists them, and the intent to judge them against:
406
424
  ```bash
@@ -457,6 +475,16 @@ Task(
457
475
 
458
476
  3. **Save the report.** Use the Write tool to write the reviewer's returned text, verbatim and in full (including its closing `pan-verdict` block), to `{phase_dir}/{phase_number}-review.md`. The reviewer is read-only by design, so the orchestrator saves the report. `/pan:review-deep` and the findings ledger read this file.
459
477
 
478
+ **Lenses (opt-in).** Check the review mode first:
479
+ ```bash
480
+ REVIEW_MODE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs config-get workflow.review_mode 2>/dev/null || echo single)
481
+ ```
482
+ When it is `lenses`, run step 2 three times instead of once. Each spawn's prompt carries one `<lens>` (`correctness`, `security`, `maintainability`), and each report is saved to `{phase_dir}/{phase_number}-review-{lens}.md`. Then merge them in code. A finding survives only when at least two of the three passes reported it, and the verdict is recomputed from what survives:
483
+ ```bash
484
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs review vote --phase "${PHASE_NUMBER}" --out "{phase_dir}/{phase_number}-review.md" "{phase_dir}/{phase_number}-review-correctness.md" "{phase_dir}/{phase_number}-review-security.md" "{phase_dir}/{phase_number}-review-maintainability.md"
485
+ ```
486
+ Step 4 records the merged `{phase_number}-review.md` as usual. `single`, the default, is the one pass above.
487
+
460
488
  4. **Record the verdict, then act on it.** The record is what this step branches on. It also adds the findings to the ledger (`.planning/findings.jsonl`) and logs the verdict to the trace, so no separate trace call is needed:
461
489
  ```bash
462
490
  REVIEW_FILE="{phase_dir}/{phase_number}-review.md"
@@ -1,20 +1,4 @@
1
- ---
2
- name: focus-doc-audit
3
- group: Focus
4
- description: Multi-dimensional document audit — accuracy, freshness, links, cross-consistency, and structural quality
5
- argument-hint: "[file|directory] [--deep] [--links] [--fix] [--all] [--score-only] [--min-score N] [--format markdown|json|checklist]"
6
- allowed-tools:
7
- - Read
8
- - Write
9
- - Edit
10
- - Bash
11
- - Grep
12
- - Glob
13
- - Agent
14
- - WebFetch
15
- ---
16
-
17
- # /pan:focus-doc-audit — Deep Document Audit & Quality Assessment
1
+ # /pan:focus-docs — Deep Document Audit & Quality Assessment
18
2
 
19
3
  Audit project documentation for accuracy, freshness, broken links, structural quality, cross-document consistency, and code alignment. $ARGUMENTS
20
4
 
@@ -24,7 +8,7 @@ Audit project documentation for accuracy, freshness, broken links, structural qu
24
8
 
25
9
  ---
26
10
 
27
- ## CRITICAL: Project Scope Boundary
11
+ ## Project Scope Boundary
28
12
 
29
13
  This command audits the **host project's documentation** — NOT PAN Wizard's own infrastructure files.
30
14
 
@@ -41,20 +25,20 @@ If you find yourself auditing a PAN command file — STOP. Refocus on the projec
41
25
 
42
26
  ## MANDATORY: Execute ALL Phases Automatically
43
27
 
44
- When `/pan:focus-doc-audit` is invoked, execute ALL phases for the selected mode without stopping. Do NOT ask questions between phases. Do NOT skip phases beyond what the mode specifies. Produce a complete audit report at the end.
28
+ When `/pan:focus-docs` is invoked, execute ALL phases for the selected mode without stopping. Do NOT ask questions between phases. Do NOT skip phases beyond what the mode specifies. Produce a complete audit report at the end.
45
29
 
46
30
  **Usage:**
47
31
  ```
48
- /pan:focus-doc-audit # Audit core docs (README, main docs)
49
- /pan:focus-doc-audit <file> # Audit a specific file
50
- /pan:focus-doc-audit <directory> # Audit all markdown files in directory
51
- /pan:focus-doc-audit --deep # Deep audit: verify every claim against code
52
- /pan:focus-doc-audit --links # Link validation pass only
53
- /pan:focus-doc-audit --fix # Auto-fix simple issues (counts, versions, dates, links)
54
- /pan:focus-doc-audit --all # Audit ALL documentation files project-wide
55
- /pan:focus-doc-audit --score-only # Skip fix suggestions, just output scores
56
- /pan:focus-doc-audit --min-score <N> # Only report files scoring below N% (default: 100 = report all)
57
- /pan:focus-doc-audit --format <type> # Output: markdown (default), json, checklist
32
+ /pan:focus-docs # Audit core docs (README, main docs)
33
+ /pan:focus-docs <file> # Audit a specific file
34
+ /pan:focus-docs <directory> # Audit all markdown files in directory
35
+ /pan:focus-docs --deep # Deep audit: verify every claim against code
36
+ /pan:focus-docs --links # Link validation pass only
37
+ /pan:focus-docs --fix # Auto-fix simple issues (counts, versions, dates, links)
38
+ /pan:focus-docs --all # Audit ALL documentation files project-wide
39
+ /pan:focus-docs --score-only # Skip fix suggestions, just output scores
40
+ /pan:focus-docs --min-score <N> # Only report files scoring below N% (default: 100 = report all)
41
+ /pan:focus-docs --format <type> # Output: markdown (default), json, checklist
58
42
  ```
59
43
 
60
44
  ---
@@ -1,19 +1,4 @@
1
- ---
2
- name: focus-drift-walking
3
- group: Focus
4
- description: Deep documentation-code drift detection, CLAUDE.md alignment, and auto-repair across all project directories
5
- argument-hint: "[--create] [--audit] [--repair] [--report] [--dir <path>] [--depth N] [--severity critical|high|medium|low|info] [--format markdown|json|checklist] [--quick]"
6
- allowed-tools:
7
- - Read
8
- - Write
9
- - Edit
10
- - Bash
11
- - Grep
12
- - Glob
13
- - Agent
14
- ---
15
-
16
- # /pan:focus-drift-walking — Documentation-Code Drift Detection & Alignment
1
+ # /pan:focus-auto --step drift — Documentation-Code Drift Detection & Alignment
17
2
 
18
3
  Walk every directory in the project, detect drift between documentation and code reality, create missing documentation, repair drifted files, and synchronize the truth hierarchy. $ARGUMENTS
19
4
 
@@ -23,7 +8,7 @@ Walk every directory in the project, detect drift between documentation and code
23
8
 
24
9
  ---
25
10
 
26
- ## CRITICAL: Project Scope Boundary
11
+ ## Project Scope Boundary
27
12
 
28
13
  This command walks the **host project's directories and documentation** — NOT PAN Wizard's own infrastructure.
29
14
 
@@ -41,7 +26,7 @@ If a drift finding points to a file inside a PAN or build directory — DROP IT.
41
26
 
42
27
  ## MANDATORY: Execute ALL Phases Automatically
43
28
 
44
- When `/pan:focus-drift-walking` is invoked, execute ALL phases for the selected mode without stopping. Do NOT ask questions between phases. Do NOT skip phases beyond what the mode specifies. Produce a complete drift report at the end.
29
+ When `/pan:focus-auto --step drift` is invoked, execute ALL phases for the selected mode without stopping. Do NOT ask questions between phases. Do NOT skip phases beyond what the mode specifies. Produce a complete drift report at the end.
45
30
 
46
31
  **Flags:**
47
32
  - `--create` — Create missing documentation files in directories that lack them
@@ -1,19 +1,4 @@
1
- ---
2
- name: focus-exec
3
- group: Focus
4
- description: Automated batch execution pipeline with 6 stages, behavioral rules, 3 execution tiers
5
- argument-hint: "[--budget N] [--mode bugfix|balanced|features|full] [--priority P0-P6] [--dry-run] [--no-commit] [--continue] [--deep-review]"
6
- allowed-tools:
7
- - Read
8
- - Write
9
- - Edit
10
- - Bash
11
- - Grep
12
- - Glob
13
- - Agent
14
- ---
15
-
16
- # /pan:focus-exec — Automated Batch Execution Pipeline
1
+ # /pan:focus-auto --step exec — Automated Batch Execution Pipeline
17
2
 
18
3
  Execute items from the current focus batch with capacity-based sizing, full session lifecycle, and verification. $ARGUMENTS
19
4
 
@@ -36,7 +21,7 @@ Execution FAILS if: test baseline cannot be established (Stage 1), or test count
36
21
  ## Pipeline Overview
37
22
 
38
23
  ```
39
- /pan:focus-exec
24
+ /pan:focus-auto --step exec
40
25
 
41
26
  Stage 1: SESSION START
42
27
  - Check project status, record baseline
@@ -95,7 +80,7 @@ This command executes work on the **host project's source code** — not on PAN
95
80
 
96
81
  ## Execute All Stages Sequentially
97
82
 
98
- When `/pan:focus-exec` is invoked, run all 6 stages in order. Do not skip stages or stop between them unless tests regress.
83
+ When `/pan:focus-auto --step exec` is invoked, run all 6 stages in order. Do not skip stages or stop between them unless tests regress.
99
84
 
100
85
  <stage_dependencies>
101
86
  Stage 1 → Stage 2: Baseline MUST exist before batch loads (regression detection requires it)
@@ -106,7 +91,7 @@ Stage 5 → Stage 6: Docs MUST be updated before commit (commit captures the com
106
91
 
107
92
  HARD STOP conditions (do not proceed to next stage):
108
93
  - Stage 1: Test suite fails → fix tests before proceeding
109
- - Stage 2: No batch file found → tell user to run /pan:focus-plan
94
+ - Stage 2: No batch file found → tell user to run /pan:focus-auto --step plan
110
95
  - Stage 4: Test count below baseline → revert last changes, re-verify
111
96
  </stage_dependencies>
112
97
 
@@ -235,7 +220,7 @@ baseline_commit: <current HEAD>
235
220
 
236
221
  ### 2.1 Find Active Batch
237
222
  Search for: `.planning/focus/batch-*.json`
238
- Pick the newest. If none exists, tell user to run `/pan:focus-plan` first.
223
+ Pick the newest. If none exists, tell user to run `/pan:focus-auto --step plan` first.
239
224
 
240
225
  ### 2.2 Read and Validate the Batch
241
226
  Extract all items: ID, Title, Priority, Effort, Points, Tier, Files.
@@ -409,7 +394,7 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace end 2>/dev/null
409
394
  ### 6.4 Final Report
410
395
 
411
396
  ```markdown
412
- ## /pan:focus-exec Complete
397
+ ## /pan:focus-auto --step exec Complete
413
398
 
414
399
  | Stage | Status |
415
400
  |-------|--------|
@@ -427,8 +412,8 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace end 2>/dev/null
427
412
  - **Tests:** Before N -> After M (+K new)
428
413
 
429
414
  ### Resume
430
- Run `/pan:focus-exec --continue` for remaining items.
431
- Run `/pan:focus-scan` to regenerate the scan.
415
+ Run `/pan:focus-auto --step exec --continue` for remaining items.
416
+ Run `/pan:focus-auto --step scan` to regenerate the scan.
432
417
  ```
433
418
 
434
419
  ---
@@ -1,18 +1,4 @@
1
- ---
2
- name: focus-plan
3
- group: Focus
4
- description: Create capacity-budgeted work batch with spec coverage verification and 4 execution modes
5
- argument-hint: "[--budget N] [--mode bugfix|balanced|features|full] [--priority P0-P6] [--lean] [--no-spec-check]"
6
- allowed-tools:
7
- - Read
8
- - Write
9
- - Edit
10
- - Bash
11
- - Grep
12
- - Glob
13
- ---
14
-
15
- # /pan:focus-plan — Capacity-Budgeted Work Batch Planner with Spec Coverage Verification
1
+ # /pan:focus-auto --step plan — Capacity-Budgeted Work Batch Planner with Spec Coverage Verification
16
2
 
17
3
  Create a capacity-budgeted work batch from focus-scan results **with mandatory verification that planned work covers all relevant spec and ADR requirements.** $ARGUMENTS
18
4
 
@@ -20,7 +6,7 @@ Create a capacity-budgeted work batch from focus-scan results **with mandatory v
20
6
 
21
7
  ---
22
8
 
23
- ## CRITICAL: Project Scope Boundary
9
+ ## Project Scope Boundary
24
10
 
25
11
  This command plans work batches for the **host project** — NOT for PAN Wizard's own infrastructure.
26
12
 
@@ -34,7 +20,7 @@ If a scan item points to a PAN infrastructure file, DROP it from the batch. PAN'
34
20
 
35
21
  ## MANDATORY: Run focus-scan first
36
22
 
37
- If no recent scan exists, run `/pan:focus-scan` automatically before proceeding.
23
+ If no recent scan exists, run `/pan:focus-auto --step scan` automatically before proceeding.
38
24
 
39
25
  **Flags:**
40
26
  - `--budget N` — Override capacity budget in points (default: 50, min: 5, max: 100)
@@ -215,13 +201,13 @@ For each success criterion in the batch, specify HOW it will be verified after e
215
201
  | SC-2 | Keywords >= 500 | `SELECT COUNT(*) FROM stx_keyword` | >= 500 |
216
202
  | SC-5 | No regression | `dotnet test` | All pass, count >= N |
217
203
 
218
- This becomes the post-execution checklist for `/pan:focus-exec`.
204
+ This becomes the post-execution checklist for `/pan:focus-auto --step exec`.
219
205
 
220
206
  ---
221
207
 
222
208
  ## Phase 5: Output
223
209
 
224
- Write the batch to `.planning/focus/batch-<YYYY-MM-DD>.json` yourself — `{date, mode, budget, allocated, items: [...]}`, each item `{id, title, priority, effort, points, tier, files}` with `tier` one of `MICRO`, `STANDARD`, `FULL` (`focus exec` and `focus classify-stages` group items by it, and an item without it lands in no wave); `focus exec`, `focus classify-stages` and `/pan:focus-exec` read an `items` or `batch` array. Do not hand this step to `pan-tools focus plan`: it ignores the scan and the spec mapping, batches only incomplete roadmap phases, pending todos and `.planning/patterns.md` entries, and overwrites the day's batch file:
210
+ Write the batch to `.planning/focus/batch-<YYYY-MM-DD>.json` yourself — `{date, mode, budget, allocated, items: [...]}`, each item `{id, title, priority, effort, points, tier, files}` with `tier` one of `MICRO`, `STANDARD`, `FULL` (`focus exec` and `focus classify-stages` group items by it, and an item without it lands in no wave); `focus exec`, `focus classify-stages` and `/pan:focus-auto --step exec` read an `items` or `batch` array. Do not hand this step to `pan-tools focus plan`: it ignores the scan and the spec mapping, batches only incomplete roadmap phases, pending todos and `.planning/patterns.md` entries, and overwrites the day's batch file:
225
211
 
226
212
  ```markdown
227
213
  ## Focus Batch — <date>
@@ -267,7 +253,7 @@ Write the batch to `.planning/focus/batch-<YYYY-MM-DD>.json` yourself — `{date
267
253
  Execution Order: MICRO first, then STANDARD, then FULL
268
254
  ```
269
255
 
270
- Ready for `/pan:focus-exec`.
256
+ Ready for `/pan:focus-auto --step exec`.
271
257
 
272
258
  ---
273
259
 
@@ -1,17 +1,4 @@
1
- ---
2
- name: focus-scan
3
- group: Focus
4
- description: Deep-dive strategic work scan with prioritized items and Reality Score filtering
5
- argument-hint: "[--focus <area>] [--quick] [--refresh] [--lean]"
6
- allowed-tools:
7
- - Read
8
- - Write
9
- - Bash
10
- - Grep
11
- - Glob
12
- ---
13
-
14
- # /pan:focus-scan — Deep-Dive Strategic Work Scan
1
+ # /pan:focus-auto --step scan — Deep-Dive Strategic Work Scan
15
2
 
16
3
  Survey the project for prioritized work items with evidence-based scoring. $ARGUMENTS
17
4
 
@@ -48,7 +35,7 @@ Do not read entire files when Grep can find the relevant lines. Do not use Bash
48
35
 
49
36
  ## Execute All Phases Automatically
50
37
 
51
- When `/pan:focus-scan` is invoked, execute all phases without stopping. Do not ask questions between phases or skip phases. The output is a prioritized work list with Reality Score filtering.
38
+ When `/pan:focus-auto --step scan` is invoked, execute all phases without stopping. Do not ask questions between phases or skip phases. The output is a prioritized work list with Reality Score filtering.
52
39
 
53
40
  **Flags:**
54
41
  - `--focus <area>` — Weight items toward a specific area (e.g., `--focus commands`, `--focus hooks`, `--focus tests`)
@@ -237,7 +224,7 @@ Gather items from:
237
224
  ## Phase 5: Scan Assembly
238
225
 
239
226
  ### 5.1 Output
240
- Write the scan to `.planning/focus/scan-<YYYY-MM-DD>.md`, where `/pan:focus-plan` builds from it and `/pan:focus-exec` updates it (Stage 5.2). `pan-tools focus scan` does not take these items: it lists only incomplete roadmap phases that have a directory, pending todos and `.planning/patterns.md` entries.
227
+ Write the scan to `.planning/focus/scan-<YYYY-MM-DD>.md`, where `/pan:focus-auto --step plan` builds from it and `/pan:focus-auto --step exec` updates it (Stage 5.2). `pan-tools focus scan` does not take these items: it lists only incomplete roadmap phases that have a directory, pending todos and `.planning/patterns.md` entries.
241
228
 
242
229
  ### 5.2 Document Structure
243
230
 
@@ -1,18 +1,4 @@
1
- ---
2
- name: focus-sync
3
- group: Focus
4
- description: Synchronize documentation after changes — check staleness and update counts
5
- argument-hint: "[--readme | --docs | --arch | --all]"
6
- allowed-tools:
7
- - Read
8
- - Bash
9
- - Grep
10
- - Glob
11
- - Edit
12
- - Write
13
- ---
14
-
15
- # /pan:focus-sync — Documentation Synchronization
1
+ # /pan:focus-docs --sync — Documentation Synchronization
16
2
 
17
3
  Synchronize project documentation across all files. $ARGUMENTS
18
4
 
@@ -20,7 +6,7 @@ Synchronize project documentation across all files. $ARGUMENTS
20
6
 
21
7
  ---
22
8
 
23
- ## CRITICAL: Project Scope Boundary
9
+ ## Project Scope Boundary
24
10
 
25
11
  This command synchronizes the **host project's documentation** — NOT PAN Wizard's own infrastructure files.
26
12
 
@@ -35,11 +21,11 @@ This command synchronizes the **host project's documentation** — NOT PAN Wizar
35
21
  ## Usage
36
22
 
37
23
  ```
38
- /pan:focus-sync # Full sync check: report staleness
39
- /pan:focus-sync --readme # Check README.md only
40
- /pan:focus-sync --docs # Verify documentation matches implementations
41
- /pan:focus-sync --arch # Verify architecture docs match actual structure
42
- /pan:focus-sync --all # Full sync of everything + auto-fix
24
+ /pan:focus-docs --sync # Full sync check: report staleness
25
+ /pan:focus-docs --sync --readme # Check README.md only
26
+ /pan:focus-docs --sync --docs # Verify documentation matches implementations
27
+ /pan:focus-docs --sync --arch # Verify architecture docs match actual structure
28
+ /pan:focus-docs --sync --all # Full sync of everything + auto-fix
43
29
  ```
44
30
 
45
31
  ---
@@ -72,6 +72,12 @@ Status: HEALTHY | DEGRADED | BROKEN
72
72
  Errors: N | Warnings: N | Info: N
73
73
  ```
74
74
 
75
+ **Ask per repair class before repairing.** With `--repair`, run `validate health` without it first and read `repairs_available` (for example `resetConfig`, `regenerateState`, `syncRequirements`, `syncRoadmap`). Ask about each class on its own, saying what it rewrites (state.md is backed up before regeneration; config.json is reset to defaults). Then repair only the classes the user accepted:
76
+ ```bash
77
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs validate health --repair --only <class>,<class>
78
+ ```
79
+ A class the user declines is not touched.
80
+
75
81
  **If repairs were performed:**
76
82
  ```
77
83
  ## Repairs Performed