pan-wizard 3.35.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 (339) hide show
  1. package/CHANGELOG.md +3645 -0
  2. package/README.md +46 -52
  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 +2 -3
  8. package/agents/pan-document_code.md +1 -2
  9. package/agents/pan-executor.md +25 -0
  10. package/agents/pan-hardener.md +4 -3
  11. package/agents/pan-integration-checker.md +1 -2
  12. package/agents/pan-knowledge.md +1 -2
  13. package/agents/pan-meta-reviewer.md +3 -3
  14. package/agents/pan-optimizer.md +4 -4
  15. package/agents/pan-phase-researcher.md +80 -475
  16. package/agents/pan-plan-checker.md +40 -3
  17. package/agents/pan-planner.md +21 -7
  18. package/agents/pan-previewer.md +3 -2
  19. package/agents/pan-project-researcher.md +72 -493
  20. package/agents/pan-release.md +1 -1
  21. package/agents/pan-reviewer.md +14 -3
  22. package/agents/pan-roadmapper.md +12 -7
  23. package/agents/pan-verifier.md +9 -4
  24. package/bin/install-lib.cjs +134 -14
  25. package/bin/install.js +59 -12
  26. package/commands/pan/army.md +1 -1
  27. package/commands/pan/autodev.md +76 -0
  28. package/commands/pan/cost.md +21 -1
  29. package/commands/pan/exec-phase.md +3 -4
  30. package/commands/pan/focus-auto.md +14 -7
  31. package/commands/pan/focus-design.md +4 -5
  32. package/commands/pan/focus-docs.md +24 -0
  33. package/commands/pan/learn.md +13 -6
  34. package/commands/pan/milestone-audit.md +8 -1
  35. package/commands/pan/milestone-done.md +10 -5
  36. package/commands/pan/milestone-new.md +2 -2
  37. package/commands/pan/new-project.md +15 -12
  38. package/commands/pan/plan-phase.md +15 -9
  39. package/commands/pan/preview.md +1 -1
  40. package/commands/pan/quick.md +1 -1
  41. package/commands/pan/review-deep.md +11 -5
  42. package/commands/pan/settings.md +6 -0
  43. package/commands/pan/verify-phase.md +6 -2
  44. package/docs/AGENTS.md +917 -0
  45. package/docs/ARCHITECTURE.md +1054 -0
  46. package/docs/CLI-REFERENCE.md +4582 -0
  47. package/docs/COMPARISON.md +116 -0
  48. package/docs/DEVELOPMENT.md +490 -0
  49. package/docs/ECOSYSTEM-REVIEW-2026-06.md +107 -0
  50. package/docs/ECOSYSTEM-REVIEW-2026-08.md +349 -0
  51. package/docs/EXAMPLES.md +584 -0
  52. package/docs/FAQ.md +254 -0
  53. package/docs/FIELD-HARVEST-2026-07.md +88 -0
  54. package/docs/FIELD-REPORT-army-2026-06.md +121 -0
  55. package/docs/HOOKS.md +638 -0
  56. package/docs/IMPROVEMENT-TODO.md +246 -0
  57. package/docs/INTERNALS.md +485 -0
  58. package/docs/MIGRATION-v2-to-v3.md +258 -0
  59. package/docs/SECURITY-HARDENING.md +230 -0
  60. package/docs/SKILLS-ENHANCEMENT-PLAN-V2.md +122 -0
  61. package/docs/SKILLS-FULL-TEXT.md +9685 -0
  62. package/docs/SKILLS-REFERENCE.md +1037 -0
  63. package/docs/TROUBLESHOOTING.md +1084 -0
  64. package/docs/USER-GUIDE.md +1437 -0
  65. package/docs/archive/SKILLS-ENHANCEMENT-PLAN.md +230 -0
  66. package/docs/audits/AUDIT-2026-08-e2e-ROADMAP.md +117 -0
  67. package/docs/audits/AUDIT-2026-08-e2e-VERIFICATION.md +693 -0
  68. package/docs/audits/AUDIT-2026-08-e2e.md +1546 -0
  69. package/docs/audits/OUTSTANDING-2026-08.md +275 -0
  70. package/docs/audits/STABILITY-TEST-2026-08.md +640 -0
  71. package/docs/branding/README-brand-draft.md +119 -0
  72. package/docs/branding/handoff/IMPLEMENTATION.md +205 -0
  73. package/docs/branding/handoff/README-brand-draft.md +119 -0
  74. package/docs/branding/handoff/image-prompts.md +46 -0
  75. package/docs/branding/image-prompts.md +46 -0
  76. package/docs/branding/nano-banana-prompts.txt +60 -0
  77. package/docs/context-monitor.md +13 -0
  78. package/docs/decisions/ADR-0001-strategic-feature-prioritization.md +83 -0
  79. package/docs/decisions/ADR-0002-copilot-cli-runtime.md +71 -0
  80. package/docs/decisions/ADR-0003-smart-execution.md +84 -0
  81. package/docs/decisions/ADR-0004-copilot-cli-interaction.md +89 -0
  82. package/docs/decisions/ADR-0005-command-naming.md +80 -0
  83. package/docs/decisions/ADR-0006-focus-commands.md +101 -0
  84. package/docs/decisions/ADR-0007-ship-v1.md +73 -0
  85. package/docs/decisions/ADR-0008-map-codebase-mermaid-togaf.md +80 -0
  86. package/docs/decisions/ADR-0009-production-deployment-checklist.md +68 -0
  87. package/docs/decisions/ADR-0010-standards-integration.md +79 -0
  88. package/docs/decisions/ADR-0011-help-commands-rewrite.md +64 -0
  89. package/docs/decisions/ADR-0012-contributors-attribution-index.md +42 -0
  90. package/docs/decisions/ADR-0013-strategic-feature-additions.md +53 -0
  91. package/docs/decisions/ADR-0014-internal-cleanup-code-quality.md +53 -0
  92. package/docs/decisions/ADR-0015-focus-auto-runner.md +296 -0
  93. package/docs/decisions/ADR-0016-enhanced-doc-sync.md +54 -0
  94. package/docs/decisions/ADR-0017-enhanced-focus-design.md +69 -0
  95. package/docs/decisions/ADR-0018-user-reality-testing.md +84 -0
  96. package/docs/decisions/ADR-0019-end-to-end-user-acceptance-testing.md +113 -0
  97. package/docs/decisions/ADR-0020-ai-drift-prevention.md +55 -0
  98. package/docs/decisions/ADR-0021-codebase-mapper-v2.md +76 -0
  99. package/docs/decisions/ADR-0022-lifecycle-completeness.md +63 -0
  100. package/docs/decisions/ADR-0023-opus-4-7-adoption.md +89 -0
  101. package/docs/decisions/ADR-0024-spec-b-v2-completion.md +137 -0
  102. package/docs/decisions/ADR-0025-behavioral-guardrails-layer.md +129 -0
  103. package/docs/decisions/ADR-0026-self-improvement-loop.md +171 -0
  104. package/docs/decisions/ADR-0027-doc-code-link-graph.md +164 -0
  105. package/docs/decisions/ADR-0028-unified-agents-skills-target.md +46 -0
  106. package/docs/decisions/ADR-0029-experiment-evaluator.md +76 -0
  107. package/docs/decisions/ADR-0030-planning-concurrency.md +37 -0
  108. package/docs/decisions/ADR-0031-focus-auto-backlog-source.md +47 -0
  109. package/docs/decisions/ADR-0032-squad-model.md +64 -0
  110. package/docs/decisions/ADR-0033-army-campaign.md +40 -0
  111. package/docs/decisions/ADR-0034-scheduled-campaigns.md +57 -0
  112. package/docs/decisions/ADR-0035-army-hud-dashboard.md +40 -0
  113. package/docs/decisions/ADR-0036-agentic-memory-architecture.md +106 -0
  114. package/docs/decisions/ADR-0037-pin-security-agents-to-opus.md +51 -0
  115. package/docs/decisions/ADR-0038-skill-aligned-decomposition.md +41 -0
  116. package/docs/decisions/ADR-0039-worktree-as-project-variant.md +37 -0
  117. package/docs/decisions/ADR-0040-memory-injection-defense.md +55 -0
  118. package/docs/decisions/ADR-0041-mcp-dual-era-bridge.md +47 -0
  119. package/docs/decisions/ADR-0042-design-parity-both-flows.md +45 -0
  120. package/docs/decisions/ADR-0043-addressable-planning-roots.md +56 -0
  121. package/docs/decisions/ADR-0044-bound-the-cached-context.md +104 -0
  122. package/docs/decisions/ADR-0045-agent-plugins-bundle.md +76 -0
  123. package/docs/decisions/ADR-0046-subagent-frontmatter-decisions.md +39 -0
  124. package/docs/decisions/ADR-0047-pan-harness.md +76 -0
  125. package/docs/decisions/ADR-0048-one-core-per-project.md +43 -0
  126. package/docs/decisions/ADR-0049-machine-verdicts-and-findings-ledger.md +116 -0
  127. package/docs/specs/ai_drift_prevention_featureai.md +286 -0
  128. package/docs/specs/codebase_mapper_v2_featureai.md +930 -0
  129. package/docs/specs/command_naming_optimization_featureai.md +930 -0
  130. package/docs/specs/comp_analysis_markdown_v1.md +149 -0
  131. package/docs/specs/continuous_autonomous_execution_featureai.md +304 -0
  132. package/docs/specs/contributors_attribution_index_featureai.md +476 -0
  133. package/docs/specs/copilot_cli_interaction_featureai.md +868 -0
  134. package/docs/specs/copilot_cli_runtime_featureai.md +647 -0
  135. package/docs/specs/custom-skills-assessment.md +461 -0
  136. package/docs/specs/deployment_audit_findings_featureai.md +243 -0
  137. package/docs/specs/doc_code_link_graph_featureai.md +253 -0
  138. package/docs/specs/documentation_alignment_cleanup_featureai.md +69 -0
  139. package/docs/specs/e2e_visual_testing_featureai.md +615 -0
  140. package/docs/specs/end_to_end_user_acceptance_testing_featureai.md +810 -0
  141. package/docs/specs/evidence-loop-plan.md +76 -0
  142. package/docs/specs/evidence_loop_featureai.md +497 -0
  143. package/docs/specs/focus-auto-optimize-category.md +449 -0
  144. package/docs/specs/focus-auto-optimize-superplan.md +188 -0
  145. package/docs/specs/focus_auto_runner_featureai.md +1102 -0
  146. package/docs/specs/focus_design_v2_featureai.md +197 -0
  147. package/docs/specs/focus_sync_v2_featureai.md +202 -0
  148. package/docs/specs/git_integration_overhaul_featureai.md +326 -0
  149. package/docs/specs/glm_zai_provider_featureai.md +200 -0
  150. package/docs/specs/googlecli_adoption_featureai.md +661 -0
  151. package/docs/specs/help_commands_rewrite_featureai.md +860 -0
  152. package/docs/specs/industry_analysis_strategic_additions_featureai.md +231 -0
  153. package/docs/specs/industry_comparison_and_feature_gaps_featureai.md +674 -0
  154. package/docs/specs/internal_cleanup_code_quality_featureai.md +486 -0
  155. package/docs/specs/investigations/README.md +31 -0
  156. package/docs/specs/investigations/digests/2026-09-28.md +47 -0
  157. package/docs/specs/investigations/digests/2026-10-08.md +62 -0
  158. package/docs/specs/investigations/digests/2026-10-10.md +61 -0
  159. package/docs/specs/investigations/features/debugger-red-loop-first.md +55 -0
  160. package/docs/specs/investigations/features/harness-cross-host-behaviour.md +93 -0
  161. package/docs/specs/investigations/features/optimize-apply-regression-gate.md +66 -0
  162. package/docs/specs/investigations/features/reviewer-smell-baseline.md +57 -0
  163. package/docs/specs/investigations/features/trace-failure-capture.md +69 -0
  164. package/docs/specs/lifecycle_completeness_featureai.md +754 -0
  165. package/docs/specs/local-first-ci.md +42 -0
  166. package/docs/specs/map_codebase_mermaid_togaf_featureai.md +805 -0
  167. package/docs/specs/market-delta-2026-09-superplan.md +310 -0
  168. package/docs/specs/market-ideas-2026-09.md +131 -0
  169. package/docs/specs/market-ideas-2026-10.md +428 -0
  170. package/docs/specs/market-ideas-ledger.md +177 -0
  171. package/docs/specs/memory-optimization-2026-10.md +285 -0
  172. package/docs/specs/multi-track-planning-roots.md +143 -0
  173. package/docs/specs/multi_model_routing_featureai.md +687 -0
  174. package/docs/specs/multi_model_routing_superplan.md +197 -0
  175. package/docs/specs/opus_47_existing_enhancements_featureai.md +247 -0
  176. package/docs/specs/opus_47_extended_features_featureai.md +363 -0
  177. package/docs/specs/opus_47_extended_features_v2_featureai.md +397 -0
  178. package/docs/specs/pan_focus_commands_featureai.md +2336 -0
  179. package/docs/specs/pan_zcode_mcp_bridge_featureai.md +120 -0
  180. package/docs/specs/product-excellence-superplan.md +315 -0
  181. package/docs/specs/product_excellence_program_2026_q4_featureai.md +365 -0
  182. package/docs/specs/production_deployment_readiness_featureai.md +433 -0
  183. package/docs/specs/production_readiness_ship_v1_featureai.md +698 -0
  184. package/docs/specs/real_test_enforcement_featureai.md +213 -0
  185. package/docs/specs/reality-check-2026-09-superplan.md +362 -0
  186. package/docs/specs/right-sized-ceremony.md +74 -0
  187. package/docs/specs/roadmap_and_competition_2026_q4_featureai.md +390 -0
  188. package/docs/specs/self_improvement_loop_featureai.md +875 -0
  189. package/docs/specs/skill-aligned-decomposition.md +155 -0
  190. package/docs/specs/standards_integration_featureai.md +833 -0
  191. package/docs/specs/testing-system-redesign-2026-09.md +267 -0
  192. package/docs/specs/user_reality_testing_system_featureai.md +788 -0
  193. package/docs/specs/watch-triggers.json +22 -0
  194. package/docs/specs/workflow-integration-redesign.md +742 -0
  195. package/docs/specs/workflow_state_consistency_featureai.md +183 -0
  196. package/hooks/dist/pan-context-monitor.js +9 -2
  197. package/hooks/dist/pan-cost-logger.js +5 -0
  198. package/hooks/dist/pan-guard.js +28 -5
  199. package/hooks/dist/pan-stop-guard.js +9 -9
  200. package/hooks/dist/pan-trace-logger.js +5 -0
  201. package/package.json +10 -2
  202. package/pan-wizard-core/bin/lib/agents-md.cjs +57 -8
  203. package/pan-wizard-core/bin/lib/autodev-report.cjs +180 -0
  204. package/pan-wizard-core/bin/lib/autodev.cjs +642 -0
  205. package/pan-wizard-core/bin/lib/ci.cjs +143 -0
  206. package/pan-wizard-core/bin/lib/commands.cjs +1 -1
  207. package/pan-wizard-core/bin/lib/config.cjs +41 -5
  208. package/pan-wizard-core/bin/lib/constants.cjs +27 -1
  209. package/pan-wizard-core/bin/lib/core.cjs +31 -14
  210. package/pan-wizard-core/bin/lib/cost.cjs +160 -4
  211. package/pan-wizard-core/bin/lib/cross-family.cjs +164 -0
  212. package/pan-wizard-core/bin/lib/debug-cases.cjs +104 -0
  213. package/pan-wizard-core/bin/lib/doc-lint.cjs +5 -3
  214. package/pan-wizard-core/bin/lib/failure-class.cjs +81 -0
  215. package/pan-wizard-core/bin/lib/findings.cjs +148 -9
  216. package/pan-wizard-core/bin/lib/focus.cjs +1 -1
  217. package/pan-wizard-core/bin/lib/git.cjs +1 -1
  218. package/pan-wizard-core/bin/lib/hosts.cjs +88 -0
  219. package/pan-wizard-core/bin/lib/init.cjs +7 -2
  220. package/pan-wizard-core/bin/lib/knowledge.cjs +2 -0
  221. package/pan-wizard-core/bin/lib/merge.cjs +50 -0
  222. package/pan-wizard-core/bin/lib/mutate.cjs +268 -0
  223. package/pan-wizard-core/bin/lib/next-action.cjs +112 -0
  224. package/pan-wizard-core/bin/lib/optimize.cjs +2 -2
  225. package/pan-wizard-core/bin/lib/phase-gate.cjs +15 -9
  226. package/pan-wizard-core/bin/lib/phase-remove.cjs +91 -11
  227. package/pan-wizard-core/bin/lib/phase.cjs +85 -13
  228. package/pan-wizard-core/bin/lib/plan-lint.cjs +310 -0
  229. package/pan-wizard-core/bin/lib/preview.cjs +26 -4
  230. package/pan-wizard-core/bin/lib/requirements-lint.cjs +130 -0
  231. package/pan-wizard-core/bin/lib/research-lint.cjs +268 -0
  232. package/pan-wizard-core/bin/lib/review-deep.cjs +14 -22
  233. package/pan-wizard-core/bin/lib/review-vote.cjs +105 -0
  234. package/pan-wizard-core/bin/lib/roadmap.cjs +1 -0
  235. package/pan-wizard-core/bin/lib/runner.cjs +2 -16
  236. package/pan-wizard-core/bin/lib/sizing.cjs +356 -0
  237. package/pan-wizard-core/bin/lib/squads.cjs +1 -1
  238. package/pan-wizard-core/bin/lib/state-write.cjs +247 -0
  239. package/pan-wizard-core/bin/lib/test-gate.cjs +433 -0
  240. package/pan-wizard-core/bin/lib/uat.cjs +149 -0
  241. package/pan-wizard-core/bin/lib/usage.cjs +104 -0
  242. package/pan-wizard-core/bin/lib/verdict.cjs +26 -3
  243. package/pan-wizard-core/bin/lib/verify-plan-set.cjs +30 -1
  244. package/pan-wizard-core/bin/lib/verify-preflight.cjs +2 -2
  245. package/pan-wizard-core/bin/lib/verify-red.cjs +174 -0
  246. package/pan-wizard-core/bin/lib/verify-retro.cjs +3 -2
  247. package/pan-wizard-core/bin/lib/verify-scope.cjs +143 -2
  248. package/pan-wizard-core/bin/lib/verify.cjs +86 -31
  249. package/pan-wizard-core/bin/lib/worktree.cjs +70 -0
  250. package/pan-wizard-core/bin/pan-tools.cjs +257 -28
  251. package/pan-wizard-core/learnings/universal/autonomous-loop.md +2 -2
  252. package/pan-wizard-core/mcp/orchestrator.cjs +4 -1
  253. package/pan-wizard-core/references/continuation-format.md +3 -3
  254. package/pan-wizard-core/references/design-methodology.md +1 -1
  255. package/pan-wizard-core/references/guardrails.md +1 -1
  256. package/pan-wizard-core/references/handoff-decisions.md +1 -1
  257. package/pan-wizard-core/references/model-profiles.md +2 -3
  258. package/pan-wizard-core/references/questioning.md +24 -0
  259. package/pan-wizard-core/references/ui-brand.md +4 -6
  260. package/pan-wizard-core/references/verdict-contract.md +2 -1
  261. package/pan-wizard-core/templates/config.json +10 -2
  262. package/pan-wizard-core/templates/debug.md +1 -0
  263. package/pan-wizard-core/templates/design.md +5 -4
  264. package/pan-wizard-core/templates/discovery.md +2 -2
  265. package/pan-wizard-core/templates/phase-prompt.md +7 -0
  266. package/pan-wizard-core/templates/requirements.md +9 -0
  267. package/pan-wizard-core/templates/research.md +10 -0
  268. package/pan-wizard-core/templates/summary-complex.md +5 -1
  269. package/pan-wizard-core/templates/summary-minimal.md +4 -0
  270. package/pan-wizard-core/templates/summary-standard.md +5 -1
  271. package/pan-wizard-core/templates/summary.md +8 -1
  272. package/pan-wizard-core/workflows/add-phase.md +4 -6
  273. package/pan-wizard-core/workflows/assumptions.md +19 -1
  274. package/pan-wizard-core/workflows/diagnose-issues.md +2 -0
  275. package/pan-wizard-core/workflows/discuss-phase.md +4 -2
  276. package/pan-wizard-core/workflows/exec-lean.md +69 -0
  277. package/pan-wizard-core/workflows/exec-phase.md +79 -15
  278. package/pan-wizard-core/workflows/execute-plan.md +3 -1
  279. package/{commands/pan → pan-wizard-core/workflows}/focus-doc-audit.md +13 -29
  280. package/{commands/pan → pan-wizard-core/workflows}/focus-drift-walking.md +3 -18
  281. package/{commands/pan → pan-wizard-core/workflows}/focus-exec.md +8 -23
  282. package/{commands/pan → pan-wizard-core/workflows}/focus-plan.md +6 -20
  283. package/{commands/pan → pan-wizard-core/workflows}/focus-scan.md +3 -16
  284. package/{commands/pan → pan-wizard-core/workflows}/focus-sync.md +7 -21
  285. package/pan-wizard-core/workflows/health.md +6 -0
  286. package/pan-wizard-core/workflows/help.md +114 -77
  287. package/pan-wizard-core/workflows/insert-phase.md +4 -6
  288. package/pan-wizard-core/workflows/learn.md +3 -3
  289. package/pan-wizard-core/workflows/milestone-audit.md +2 -2
  290. package/pan-wizard-core/workflows/milestone-new.md +38 -95
  291. package/pan-wizard-core/workflows/new-project.md +96 -258
  292. package/pan-wizard-core/workflows/optimize.md +107 -5
  293. package/pan-wizard-core/workflows/phase-tests.md +10 -0
  294. package/pan-wizard-core/workflows/plan-phase.md +106 -45
  295. package/pan-wizard-core/workflows/profile.md +50 -0
  296. package/pan-wizard-core/workflows/progress.md +10 -0
  297. package/pan-wizard-core/workflows/quick.md +34 -43
  298. package/pan-wizard-core/workflows/remove-phase.md +11 -1
  299. package/pan-wizard-core/workflows/research-phase.md +118 -40
  300. package/pan-wizard-core/workflows/resume-project.md +18 -2
  301. package/pan-wizard-core/workflows/settings.md +33 -19
  302. package/pan-wizard-core/workflows/todo-check.md +6 -2
  303. package/pan-wizard-core/workflows/transition.md +22 -4
  304. package/pan-wizard-core/workflows/uat-walkthrough.md +90 -0
  305. package/pan-wizard-core/workflows/update.md +1 -1
  306. package/pan-wizard-core/workflows/verify-phase.md +39 -46
  307. package/scripts/build-agent-plugin.js +35 -15
  308. package/scripts/build-help.cjs +106 -0
  309. package/scripts/build-plugin.js +10 -1
  310. package/scripts/deprecate-old-versions.js +70 -3
  311. package/scripts/generate-skills-docs.py +1 -1
  312. package/scripts/git-hooks/pre-push +27 -0
  313. package/scripts/install-git-hooks.js +7 -5
  314. package/scripts/install-pre-push.cjs +38 -0
  315. package/scripts/land.cjs +151 -0
  316. package/scripts/local-ci.cjs +501 -0
  317. package/scripts/local-schedule.cjs +277 -0
  318. package/scripts/mutation-probe.cjs +7 -80
  319. package/scripts/prompt-lint.cjs +32 -0
  320. package/scripts/prompt-rules.cjs +156 -0
  321. package/scripts/run-tests.cjs +7 -1
  322. package/scripts/test-quality-lint.cjs +3 -3
  323. package/scripts/test-surface.cjs +175 -6
  324. package/agents/pan-research-synthesizer.md +0 -246
  325. package/commands/pan/audit-deployment.md +0 -386
  326. package/commands/pan/dashboard.md +0 -22
  327. package/commands/pan/discord.md +0 -19
  328. package/commands/pan/mcp-bridge.md +0 -143
  329. package/commands/pan/milestone-cleanup.md +0 -19
  330. package/commands/pan/milestone-gaps.md +0 -35
  331. package/commands/pan/optimize.md +0 -115
  332. package/commands/pan/profile.md +0 -76
  333. package/commands/pan/research-phase.md +0 -189
  334. package/pan-wizard-core/bin/lib/bridge.cjs +0 -269
  335. package/pan-wizard-core/templates/research-project/architecture.md +0 -204
  336. package/pan-wizard-core/templates/research-project/features.md +0 -147
  337. package/pan-wizard-core/templates/research-project/pitfalls.md +0 -200
  338. package/pan-wizard-core/templates/research-project/stack.md +0 -120
  339. package/pan-wizard-core/templates/research-project/summary.md +0 -170
@@ -0,0 +1,230 @@
1
+ # Skills Enhancement Plan
2
+
3
+ Systematic review of all 42 shipped PAN Wizard skills against 20 modern prompting
4
+ techniques researched from 2025-2026 best practices. Each enhancement is one
5
+ self-contained change, applied and verified individually.
6
+
7
+ **Sources:** Anthropic Prompting Best Practices, Claude Code Best Practices,
8
+ Paxrel (10 Agent Patterns), Agentic AI Design Patterns 2026, BrightCoding
9
+ System Prompts Guide, PromptLayer Flow Engineering, Deepset Context Engineering.
10
+
11
+ ---
12
+
13
+ ## Current State Assessment
14
+
15
+ **What PAN already does well:**
16
+ - Phase-gated execution (Plan-Act-Verify) in exec-phase, focus-auto
17
+ - State handover protocol in pause/resume (state.md)
18
+ - Structured JSON output enforcement in focus-scan, focus-plan
19
+ - Guard rails (PAN_SOURCE_ROOT, NEVER DO sections in focus-auto)
20
+ - Parallel tool directives in exec-phase (wave-based)
21
+ - Supervisor/orchestrator pattern in plan-phase, map-codebase
22
+
23
+ **What's missing or weak across multiple skills:**
24
+
25
+ | # | Enhancement | Technique | Skills Affected | Priority |
26
+ |---|-------------|-----------|----------------|----------|
27
+ | 1 | Add Chain of Verification checklists | Self-Check Before Commit | exec-phase, quick, focus-exec | HIGH |
28
+ | 2 | Add Error Recovery Classification | Recoverable vs Unrecoverable | exec-phase, focus-auto, focus-exec, debug | HIGH |
29
+ | 3 | Add Motivation to Constraints | Explain the "Why" | focus-auto (NEVER DO), focus-exec (9 rules) | HIGH |
30
+ | 4 | Add Investigate-Before-Answering directive | Anti-hallucination | verify-phase, assumptions, audit-deployment | HIGH |
31
+ | 5 | Add Tool Selection Heuristics | Priority-ordered routing | focus-scan, focus-design, map-codebase | MEDIUM |
32
+ | 6 | Soften aggressive directive language | Claude 4.6 calibration | focus-auto, focus-exec, focus-scan | MEDIUM |
33
+ | 7 | Add Dry-Run verification step | Simulate Before Execute | exec-phase, quick, focus-exec | MEDIUM |
34
+ | 8 | Add Context Window Management rules | Retention policies | focus-auto, focus-design, exec-phase | MEDIUM |
35
+ | 9 | Add Reflexion Loop to verification | Generate-Critique-Revise | verify-phase, plan-phase (plan-checker) | MEDIUM |
36
+ | 10 | Standardize XML structural tags | XML-First Architecture | Inconsistent across skills — some use XML, some don't | LOW |
37
+ | 11 | Add Anti-Overengineering directive | Scope containment | exec-phase, quick, focus-exec | LOW |
38
+ | 12 | Add Thinking Tags guidance | Mandatory reasoning | debug, focus-design, assumptions | LOW |
39
+
40
+ ---
41
+
42
+ ## Enhancement Details
43
+
44
+ ### Enhancement 1: Chain of Verification Checklists
45
+ **Technique:** Self-Check Before Commit
46
+ **Target skills:** exec-phase, quick, focus-exec
47
+ **What to add:** A numbered verification checklist that the agent MUST run through
48
+ before committing any code change. Currently these skills say "test after changes"
49
+ but don't have a structured self-check protocol.
50
+ **Checklist template:**
51
+ ```
52
+ Before committing, verify ALL:
53
+ 1. All modified files were read before editing
54
+ 2. Tests pass (run test suite, record count)
55
+ 3. No unintended files in git diff
56
+ 4. Commit message accurately describes only verified changes
57
+ 5. No TODO/FIXME introduced without tracking
58
+ If any check fails: fix and re-verify. Do not commit until all pass.
59
+ ```
60
+
61
+ ### Enhancement 2: Error Recovery Classification
62
+ **Technique:** Recoverable vs Unrecoverable errors
63
+ **Target skills:** exec-phase, focus-auto, focus-exec, debug
64
+ **What to add:** Explicit classification of error types with recovery protocols.
65
+ Currently focus-auto has "revert fast" (5 min limit) but doesn't distinguish
66
+ error types. exec-phase delegates to workflows but has no error taxonomy.
67
+ **Classification template:**
68
+ ```
69
+ RECOVERABLE (retry with analysis, max 3 attempts):
70
+ - Test failure after code change → read error, fix, re-test
71
+ - File not found → search for moved/renamed file
72
+ - Merge conflict → attempt auto-resolution, then checkpoint
73
+
74
+ UNRECOVERABLE (halt, report to user):
75
+ - Persistent test regression after revert
76
+ - Permission/auth errors on critical paths
77
+ - State corruption (malformed JSON in planning files)
78
+ - Build system failure unrelated to current changes
79
+ ```
80
+
81
+ ### Enhancement 3: Motivation-Enriched Constraints
82
+ **Technique:** Explain the "Why" behind rules
83
+ **Target skills:** focus-auto (NEVER DO section), focus-exec (9 Behavioral Rules)
84
+ **What to add:** A "Why" annotation to each constraint. Currently the NEVER DO
85
+ list in focus-auto has 11 bare rules with no reasoning. Adding motivation helps
86
+ the model generalize to edge cases.
87
+ **Example transformation:**
88
+ ```
89
+ Before: "- Skip the baseline test capture (Phase 1)"
90
+ After: "- Skip the baseline test capture (Phase 1) — without a baseline, the
91
+ regression circuit breaker cannot detect test count decreases"
92
+ ```
93
+
94
+ ### Enhancement 4: Investigate-Before-Answering Directive
95
+ **Technique:** Anti-hallucination through evidence requirement
96
+ **Target skills:** verify-phase, assumptions, audit-deployment
97
+ **What to add:** Explicit directive to read referenced files before making claims.
98
+ verify-phase currently says "validate built features" but doesn't mandate reading
99
+ the actual implementation before judging. assumptions should read the codebase
100
+ before surfacing assumptions.
101
+ **Directive:**
102
+ ```
103
+ NEVER claim a feature works or doesn't work without reading the implementation.
104
+ Before each verification judgment:
105
+ 1. Read the source file(s) that implement the feature
106
+ 2. Read the test file(s) that cover it
107
+ 3. Run the tests
108
+ 4. Only THEN state your assessment with file:line evidence
109
+ ```
110
+
111
+ ### Enhancement 5: Tool Selection Heuristics
112
+ **Technique:** Priority-ordered tool routing
113
+ **Target skills:** focus-scan, focus-design, map-codebase
114
+ **What to add:** Explicit tool priority ordering. focus-scan currently says
115
+ "Grep for patterns" but doesn't prioritize which tools to try first. focus-design
116
+ has 10 phases with many tool options but no routing guidance.
117
+ **Heuristic:**
118
+ ```
119
+ Tool priority (use the simplest sufficient tool):
120
+ 1. Grep/Glob — for finding specific patterns or files
121
+ 2. Read — for examining known files
122
+ 3. Bash — only for commands that dedicated tools can't do
123
+ 4. Agent (subagent) — only for exploration spanning >5 file reads
124
+ 5. WebSearch/WebFetch — only when local sources are exhausted
125
+ ```
126
+
127
+ ### Enhancement 6: Soften Aggressive Directive Language
128
+ **Technique:** Claude 4.6 calibration
129
+ **Target skills:** focus-auto, focus-exec, focus-scan
130
+ **What to change:** Replace over-emphasized "CRITICAL", "MUST", "ABSOLUTELY"
131
+ language with normal direct instructions. Claude 4.6 overtriggers on aggressive
132
+ directives — they can cause overreaction or over-caution.
133
+ **Example transformations:**
134
+ - "You MUST ask the user" → "Ask the user"
135
+ - "Do NOT proceed past this point" → "Wait for the user's reply before proceeding"
136
+ - "ALWAYS EXCLUDE these directories" → "Exclude these directories from scanning"
137
+ Note: Keep NEVER DO / ALWAYS DO sections — those are structural, not tonal.
138
+
139
+ ### Enhancement 7: Dry-Run Verification Step
140
+ **Technique:** Simulate Before Execute
141
+ **Target skills:** exec-phase, quick, focus-exec
142
+ **What to add:** For STANDARD and FULL tier items, state the intended changes
143
+ before implementing them. Currently exec-phase goes straight to execution.
144
+ **Template:**
145
+ ```
146
+ For M+ items, before implementing:
147
+ 1. State: "I will modify [files], adding [what], to achieve [goal]"
148
+ 2. Identify risks: "This could break [X] if [Y]"
149
+ 3. Then implement
150
+ ```
151
+
152
+ ### Enhancement 8: Context Window Management Rules
153
+ **Technique:** Retention policies for long sessions
154
+ **Target skills:** focus-auto, focus-design, exec-phase
155
+ **What to add:** Explicit guidance on what to keep vs. summarize vs. discard
156
+ as context accumulates. focus-auto can run 10+ cycles; focus-design has 10
157
+ phases. Both risk context rot without management rules.
158
+ **Template:**
159
+ ```
160
+ Context management across cycles/phases:
161
+ KEEP: Current task goals, test baselines, error states, file paths being modified
162
+ SUMMARIZE: Previous cycle results (1-line per cycle), completed sub-tasks
163
+ DISCARD: Raw tool output from previous cycles, superseded scan results
164
+ ```
165
+
166
+ ### Enhancement 9: Reflexion Loop in Verification
167
+ **Technique:** Generate-Critique-Revise
168
+ **Target skills:** verify-phase, plan-phase (plan-checker interaction)
169
+ **What to add:** After initial verification judgment, explicitly re-evaluate
170
+ against the phase goals. Currently verify-phase checks features against UAT
171
+ but doesn't self-critique its assessment.
172
+ **Template:**
173
+ ```
174
+ After initial assessment:
175
+ 1. Score each requirement: PASS / PARTIAL / FAIL
176
+ 2. For PARTIAL/FAIL: state what specifically is missing
177
+ 3. Re-read the requirement and the code — did you miss anything?
178
+ 4. Revise scores if needed
179
+ 5. Only report final scores after this review cycle
180
+ ```
181
+
182
+ ### Enhancement 10: Standardize XML Structural Tags — SKIPPED
183
+ **Technique:** XML-First Architecture
184
+ **Target skills:** Many — inconsistent usage across skills
185
+ **Decision:** Keep the current split. Short workflow-delegating skills (30-80 lines)
186
+ use XML tags (`<objective>`, `<process>`, `<context>`). Long focus skills (200-1000+
187
+ lines) use markdown headings for navigability. This is a sensible natural split —
188
+ forcing XML on 1000-line files adds noise, forcing markdown on 40-line files loses
189
+ structure. No change needed.
190
+
191
+ ### Enhancement 11: Anti-Overengineering Directive
192
+ **Technique:** Scope containment
193
+ **Target skills:** exec-phase, quick, focus-exec
194
+ **What to add:** Explicit instruction not to expand scope beyond the task.
195
+ focus-auto already has "Follow the Plan — no scope creep" but exec-phase and
196
+ quick lack this. Claude 4.6 tends to over-engineer.
197
+ **Directive:**
198
+ ```
199
+ Implement exactly what was planned. Do not:
200
+ - Add features not in the plan
201
+ - Refactor surrounding code
202
+ - Add comments to unchanged code
203
+ - Create abstractions for one-time operations
204
+ - Add error handling for impossible scenarios
205
+ ```
206
+
207
+ ### Enhancement 12: Thinking Tags Guidance
208
+ **Technique:** Mandatory reasoning before complex actions
209
+ **Target skills:** debug, focus-design, assumptions
210
+ **What to add:** Encourage explicit reasoning before tool use in investigative
211
+ skills. debug already uses scientific method but could benefit from structured
212
+ observe-think-act loops.
213
+
214
+ ---
215
+
216
+ ## Execution Order
217
+
218
+ Apply enhancements in priority order, one at a time:
219
+ 1. Chain of Verification (exec-phase, quick, focus-exec)
220
+ 2. Error Recovery Classification (exec-phase, focus-auto, focus-exec)
221
+ 3. Motivation-Enriched Constraints (focus-auto, focus-exec)
222
+ 4. Investigate-Before-Answering (verify-phase, assumptions, audit-deployment)
223
+ 5. Tool Selection Heuristics (focus-scan, focus-design, map-codebase)
224
+ 6. Soften Aggressive Language (focus-auto, focus-exec, focus-scan)
225
+ 7. Dry-Run Verification (exec-phase, quick, focus-exec)
226
+ 8. Context Window Management (focus-auto, focus-design, exec-phase)
227
+ 9. Reflexion Loop (verify-phase, plan-phase)
228
+ 10. XML Standardization (all skills — needs design decision)
229
+ 11. Anti-Overengineering (exec-phase, quick, focus-exec)
230
+ 12. Thinking Tags (debug, focus-design, assumptions)
@@ -0,0 +1,117 @@
1
+ # E2E Audit 2026-08 — Remediation Roadmap (Part 2)
2
+
3
+ **Companion to:** [`AUDIT-2026-08-e2e.md`](AUDIT-2026-08-e2e.md) (findings) · **Created:** 2026-08-05
4
+
5
+ > Point-in-time planning doc; counts describe the audit run and are exempt from the live-counts policy.
6
+
7
+ ## Status — Round-5 FINAL: all 137 original findings resolved; 2-item fix-pass ledger + a 14-item consistency tail (2026-08-06, uncommitted working tree)
8
+
9
+ > **Round 5** verified the Round-4 consolidation (see the Round 5 section of [`AUDIT-2026-08-e2e-VERIFICATION.md`](AUDIT-2026-08-e2e-VERIFICATION.md)): **17 findings — 1 High fixed immediately, 2 record errors corrected in place, 14 documentation/lint-hardening items recorded and deliberately deferred.** The High was in `.gitignore`: the ADR-0026 `!experiments/**` carve-out is the last matching pattern for everything under `experiments/`, so it undid **every** blanket rule above it — `.env`, `.env.*`, `node_modules/`, `*.log`, `.DS_Store`, `.vscode-test/`, `.codex/` were all committable in a public repo. Every safety-critical rule is now re-asserted after the negation and verified in both directions (secrets and junk ignored, including nested; harvested telemetry still committable). No product defect above Low is open. The Round-4 status below stands otherwise unchanged.
10
+
11
+ ## Status — Round-4: all 137 original findings resolved; 2-item fix-pass ledger (2026-08-06, uncommitted working tree)
12
+
13
+ > **Round 4** (see the Round 4 section of [`AUDIT-2026-08-e2e-VERIFICATION.md`](AUDIT-2026-08-e2e-VERIFICATION.md)) closed the Round-3 ledger and is entirely **working-tree work** — there is no commit to cite for it yet. **7 of the 8 items open at the end of Round 3 are closed:** **M6** (the prescribed `hooks/` migration anchor landed at `bin/install.js:849`, first clean verdict after three PARTIALs), **N20** (new `tests/statusline-guard.test.cjs` with all three prescribed tests), **N16** (outside-sandbox assertion in the Codex `--global` test), **N24** (platform-aware win32 bridge test), **N25** + **N27** (the single-slot idempotency marker replaced by a bounded per-transcript FIFO signature set, preserved through the L40 prune), and **N12** (the model-version phrasing pass). **Still open (2), both in the cost/trace-logger ledger row:** **N26** (PARTIAL — same-type sibling rows can still collapse in the pre-existing last-row dedup, because the per-invocation discriminator that distinguishes their signatures is never written into the row) and new **N29** (Low — byte-identical legitimate spawns stay suppressed on runtimes that supply no per-invocation field). They want one ledger-schema decision, not two patches. Round 4 also carried a **user-directed model-version-agnostic sweep** (capability phrasing instead of hardcoded model gates in shipped content and live docs; new `tests/model-version-drift.test.cjs` as the anti-drift lint; a real code fix so `detectModelCapabilities` no longer returns an all-false `unknown` — and a false "lacks 1M context" installer warning — for unrecognized Claude ids), a **correction pass** for three High false claims that sweep introduced (an invented capability probe, a false future-model promise, and an invented model gate for `--hierarchical` in five docs — no model gate exists; the constraint is the runtime), and a final consolidation after a verification pass over that correction. **Cumulative: all 137 original audit findings resolved; the open ledger holds only fix-pass items N26 and N29. No Critical ever found; no High open anywhere.** History below is preserved verbatim; do not re-inflate.
14
+
15
+ ## Status — Round-3 verdict: 136/137 original findings resolved; 7-item residual ledger (2026-08-05, N12 closed 2026-08-06)
16
+
17
+ > *Superseded by the Round-4 block above; kept as the Round-3 record.*
18
+ >
19
+ > **Round-3 final verification** of the `05e8f5b` sweep (see the Round 3 section of [`AUDIT-2026-08-e2e-VERIFICATION.md`](AUDIT-2026-08-e2e-VERIFICATION.md)): **7/11 verified FIXED** (N15 win32 bridge live-verified on Windows, N17-core, N14, N10, N18, N19, N22) — the first round of this chain with **no new High regressions**. Still open: **M6** (narrowed residual: exact-basename `statusline.js` customs still clobbered/corrupted — fix by anchoring the Fix #330 migration on `hooks/statusline.js`), **N20** (the sweep's "statusline-guard coverage" claim was FALSE — the diff contains zero statusline tests; three prescribed tests in the report), **N16** (missing outside-sandbox assertion), and new **N24–N27** (win32-bridge test gap; cost/trace-logger idempotency-marker redesign: interleaved dual-registration phantom re-admission, same-agent sibling drops, L40 prune erasing the marker). **N12 was closed post-sweep on 2026-08-06** by the model-version phrasing pass: the three named spots (TROUBLESHOOTING.md's hierarchical section, `commands/pan/plan-phase.md:137`) no longer gate on a model version, and both generated SKILLS docs were regenerated via `scripts/generate-skills-docs.py` — no `Opus 4.7`/`Opus 4.8` string survives in either. That closure drops the ledger from **8 items to 7** and changes no other item's status. *(Arithmetic corrected in the Round-4 consolidation: the ledger standing at the end of Round 3 was M6, N12, N16, N20, N24, N25, N26, N27 — eight findings; the earlier "7 items to 6" counted the grouped N25/N26/N27 entry once. The per-ID enumeration in the verification report is authoritative.)* **Cumulative: 136 of the original 137 audit findings fully verified resolved; M6 alone partially open. No Critical ever found; no High open anywhere.** Suite at `05e8f5b`: **3473 / 744 / 0 fail**. History below is preserved verbatim; do not re-inflate.
20
+
21
+ ## Status — Round-2 re-audit of the `b1fa91f` sweep: 25/29 verified; 11 items open (2026-08-05)
22
+
23
+ > **History (do not re-inflate):** the original banner falsely claimed "ALL 137 RESOLVED." The independent fix-verification re-audit ([`AUDIT-2026-08-e2e-VERIFICATION.md`](AUDIT-2026-08-e2e-VERIFICATION.md) @ `4baf609`) corrected that to **122/137 verified**, with **15 outstanding** (H7, M6, M26, M33, M34, M45, M57, M60, M61, M62, M64, M65, L34, L47 + L36) and **14 fix-pass regressions (2 High: N1 uninstall-deletes-unparseable-settings, N2 update.md local/global collapse)**.
24
+ >
25
+ > **The `b1fa91f` sweep** claimed all 29 (15 outstanding + N1–N14). The **Round-2 independent re-audit** (see the Round 2 section of the verification report) verified **25 of 29 FIXED** — including both High regressions with live repro across all 5 runtimes in local and global modes, and the previously-missing M30/M32 CLI exit-code tests (N5). **Still open (4):** M6 (root cause is the untouched Fix #330 migration at `bin/install.js:840-850`, which renames non-PAN `*statusline.js` commands and defeats the new guard), N10 (verify-stubs scan-scope doc claim), N12 residual (Opus 4.7 refs in USER-GUIDE/MIGRATION), N14 (L2 guard test un-gitignored fixture + swallowed assertion). **The sweep introduced N15–N23** (9 unique; **2 High:** N15 — the M60 mode check kills the hook bridge on Windows entirely; N16 — the new Codex global-install test deletes/overwrites the developer's real `~/.agents/skills` on every suite run). Full suite at `b1fa91f`: **3466 / 742 / 0 fail** — green, but N15/N16/N20 show the suite is blind to exactly these classes. **Open ledger: M6, N10, N12, N14, N15, N16, N17, N18, N19, N20, N22** (N21/N23 were doc errors, corrected).
26
+
27
+ - **Part 1 (9 High):** 8 fully verified fixed via live reproduction; **H7 PARTIAL** (Example 6's closing "Continue normally" block still shows the old renumbering flow).
28
+ - **Part 2 (80 Medium + 48 Low):** all 7 batches below were executed, but verification upheld **14 outstanding items**: NOT_FIXED M33, M61, M62, L36; PARTIAL M6, M26, M34, M45, M57, M60, M64, M65, L34, L47.
29
+ - **A** parity lint + path sweep (M37/M41/M52/M54/M55) + preventive `tests/shipped-content-prefix.test.cjs`
30
+ - **B** dead gates & exit codes (M5/M9/M28/M30/M31/M32)
31
+ - **C** core correctness/robustness/security (M3/M6/M8/M10–M29/M79)
32
+ - **D** shipped-content drift (M1/M2/M4/M7/M34–M56/M80)
33
+ - **E** docs corrections (M63–M78)
34
+ - **F** test-coverage holes (M57/M58/M59)
35
+ - **G** Low-tail hygiene (L1–L48)
36
+ - **The fix pass introduced 14 new confirmed issues (N1–N14** in the verification report**)**, including 2 High: uninstall can delete a user's unparseable `settings.json` (`bin/install.js`), and the M55 fix collapsed `update.md`'s local/global detection so global installs update as LOCAL.
37
+
38
+ Full suite: **3445 tests / 733 suites / 0 failures** at `4baf609` — but N5 (promised M30/M32 exit-code tests never added), N13 (vacuous traversal assertion), and N14 (swallowed guard assertion) meant green CI under-covered the fixed gates. The remainder of this document is the original planning record.
39
+
40
+ ---
41
+
42
+ The audit's own "highest-leverage" guidance drives the ordering: close whole *classes* systemically (with a lint that prevents recurrence) before grinding individual items.
43
+
44
+ ---
45
+
46
+ ## Batch A — Runtime-parity lint + path sweep (systemic; do first)
47
+
48
+ **Why first:** this is the dominant High theme (H4/H6) and it recurs across the Medium tail. The root cause is that the installer's path-rewrite only recognizes the canonical `~/.claude/` prefix; any other prefix ships verbatim and breaks the 4 non-Claude runtimes + global installs. Fix the sources **and add a shipped-content lint** so the class can never come back.
49
+
50
+ - **A0 (preventive):** new test/lint asserting shipped content (`commands/`, `agents/`, `pan-wizard-core/workflows|templates|references/`) contains only the canonical `~/.claude/` prefix — no `./.claude/`, bare `.claude/`, or `$HOME/.claude/`. This guards H4, H6, and every item below.
51
+ - **Items:** M37 (`/pan:learn` `.claude/workflows/learn.md`), M41 (`/pan:settings` `@./.claude/…`), M52 (new-project.md `./.claude/` everywhere), M55 (update.md `$HOME/.claude/` not rewritten), M54 (global defaults path mismatch `~/.pan-wizard-core` vs `~/.pan-wizard`, stray `~/.gsd`).
52
+
53
+ **Effort:** M · **Risk:** low (mechanical) · closes a class + prevents recurrence.
54
+
55
+ ## Batch B — Dead gates & wrong exit codes (trust-critical)
56
+
57
+ **Why:** same class as H3 — commands that *claim* to gate but always exit 0, so orchestrators/CI can't rely on them. Audit every CLI path routed through `output()` (which now takes an `exitCode` arg after H3).
58
+
59
+ - M9 (`campaign due` always exits 0), M30 (`verify stubs --gate` no-op on blocking findings), M32 (`learn lint` never non-zero despite docs), M28 (`dashboard --raw` discards output via raw=false), M31 (`validate health --repair` writes legacy config that disables the verifier gate), M5 (installer model-capability warning is dead code — `finishInstall` undefined `targetDir` in a swallowed catch).
60
+ - **Add CLI-level exit-code tests** for each (the H3 gap: pure functions were tested, the exit path was not).
61
+
62
+ **Effort:** M · **Risk:** medium (behavior change on exit codes — check CI/scenario consumers).
63
+
64
+ ## Batch C — Core-module correctness & robustness
65
+
66
+ Crashes on malformed input, silent no-ops, and false "success" returns. User-facing bugs.
67
+
68
+ - **Crashes / injection / containment (do first, security-adjacent):** M22 (regex injection in `requirements mark-complete` — unescaped ID → `new RegExp`), M23 (`optimize apply` writes report-supplied relative paths with no containment check — path escape), M79 (Windows backslash `..` bypasses `saveLocalPatches` traversal guard), M10 (`scaffold` without `--phase` → raw TypeError), M24 (`phases list --include-archived` ENOENT), M3 (unguarded `fs.unlinkSync` aborts whole install).
69
+ - **Silent no-ops / false success:** M11 (`config-set` missing value reports updated:true), M27 (`state resolve-blocker` resolved:true with no match), M20 (`git commit` leaks subcommand token into files list — stages stray paths), M33 (executor blocker example omits `--text` → never recorded).
70
+ - **Wrong results / dead code:** M12 (phase-number normalization mismatch), M13 (`cost.rates` overrides skipped for versioned model ids), M19 (frontmatter inline-array lossy on `, `), M21 (`memory optimize` agent-log consolidation dead code), M26 (`experiment stop` can never stop — pid persisted too late), M8 (`isDreamDue` contract contradiction, no consumer), M14/M15 (distill false "phantom try/catch" + "REGRESSED" labels), M16 (`experiment new` installer step always fails in installed projects), M17/M38 (counts computed from source-repo layout → wrong in host projects), M18 (`prompts_complete` stop reason unreachable), M6 (statusline clobbers Gemini/Copilot custom statuslines), M25 (review-deep ignores `--cwd`), M29 (`validate deployment` hook-path check validates nothing).
71
+
72
+ **Effort:** L (largest batch) · **Risk:** medium · split across 2-3 sub-PRs by sub-group.
73
+
74
+ ## Batch D — Shipped-content drift (commands / agents / workflows / templates)
75
+
76
+ Stale cross-refs, renamed-command leftovers, contradictory instructions, nonexistent-file references.
77
+
78
+ - **Commands/agents:** M1 (Copilot converter reads `allowed_tools:` no agent uses → no tool restrictions), M2 (`--copilot` missing from `--help`), M4 (upgrade never sweeps stale Claude skill shims), M7 (`--type plan|summary` vs code `plans`/`summaries`), M34 (`audit-deployment` false CRITICALs on healthy installs), M35/M36 (`experiment` stale status + `/pan:check` doesn't exist), M39 (`optimize` `trace status` → `trace current`), M40 (`retro` "modifies no files" false), M42 (`what-if` overwrite claim false), M43 (`help` phantom `--dry-run`), M44/M48 (`help`/help.md "42 commands" table omits 17 of 59 + embeds a count).
79
+ - **Workflows/templates:** M45 (diagnose-issues wrong agent), M46 (exec-phase nonexistent continuation-prompt template), M47 (execute-plan resume detection dead), M49 (milestone-audit doubled `v{version}-v{version}` prefix), M50 (milestone-new cites nonexistent `/pan:discuss-milestone`), M51 (uppercase researcher filenames), M53 (resume-project case-mismatched substitution), M56 (verify-phase wrong glob).
80
+ - **pan-zcode:** M80 (merge-approval instruction tells operator to use request id, not the nonce — no gated merge can be approved).
81
+
82
+ **Effort:** M-L (high volume, mostly mechanical) · **Risk:** low.
83
+
84
+ ## Batch E — Docs correction batch
85
+
86
+ Prose that contradicts code. Several overlap themes already fixed in Part 1 (balanced-tier, install-from-source, Codex skills path) — fold in the same corrections.
87
+
88
+ - M63/M75 (ARCHITECTURE/USER-GUIDE stale map-codebase agent counts + UPPERCASE filenames), M64 (ARCHITECTURE "Codex hooks not supported" — contradicted), M65/M66/M67/M68 (CLI-REFERENCE phantom experiment/doc-lint flags), M69 (DEVELOPMENT local-testing refused by guard — same as H8), M70 (EXAMPLES milestone-done mid-milestone), M71/M76 (FAQ/README balanced=Opus — same as H5), M72 (FAQ Codex skills path — same as H9), M73 (MIGRATION impossible v2.10.0 rollback), M74 (TROUBLESHOOTING "no locking" — false since ADR-0030), M77/M78 (ADR-0027 status vs shipped; GLM/z.ai spec unmarked).
89
+
90
+ **Effort:** M · **Risk:** low.
91
+
92
+ ## Batch F — Test-coverage holes
93
+
94
+ - M57: global-install mode (`--global`/`--config-dir`/env-var) — no positive coverage on any runtime. Add a scenario test per resolution path.
95
+ - M58: extract `pan-check-update.js`'s update-check logic out of the inline `node -e` string into a testable module, then cover it.
96
+ - M59: `pan-context-monitor.js` (134 lines threshold/debounce/escalation) — add behavioral tests.
97
+
98
+ **Effort:** M · **Risk:** low · high long-term value (these holes hid H1/H3-class bugs).
99
+
100
+ ## Batch G — Low tail (48) — hygiene sweep
101
+
102
+ Embedded counts (count-SSoT violations), link rot, cosmetic drift. Largely mechanical; run the `doc-lint` count/flag scanners, delete embedded counts, fix stale links. Can piggyback on the next scheduled doc-audit rather than a dedicated PR.
103
+
104
+ **Effort:** S-M · **Risk:** trivial.
105
+
106
+ ---
107
+
108
+ ## Suggested sequencing
109
+
110
+ 1. **A** (systemic parity lint — prevents recurrence, closes a class)
111
+ 2. **B** (dead gates — trust) + **C-security** (M22/M23/M79 injection/containment)
112
+ 3. **C-rest** (core correctness, 2-3 sub-PRs)
113
+ 4. **D** + **E** (drift + docs — high volume, mechanical, parallelizable)
114
+ 5. **F** (coverage holes)
115
+ 6. **G** (Low hygiene — fold into routine doc-audit)
116
+
117
+ Each batch: fix → add/extend tests → `npm run test:all` green → live-verify installer-facing items in `d:\pantesting` → PR. Batches A–C are the real bug-fix value; D–G are drift/hygiene/coverage.