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,647 @@
1
+ # Feature Specification: GitHub Copilot CLI Runtime Support
2
+
3
+ **Feature:** Add GitHub Copilot CLI as PAN Wizard's 5th supported runtime
4
+ **Generated:** 2026-02-28
5
+ **Status:** Proposed
6
+ **ADR:** ADR-0002
7
+
8
+ ---
9
+
10
+ ## Phase 0: Problem Framing & Demand Validation
11
+
12
+ ### 0.1 Problem Statement
13
+
14
+ GitHub Copilot CLI — the terminal-native coding agent — went GA on February 25, 2026 and is included in all Copilot plans (Free, Pro, Pro+, Business, Enterprise). PAN Wizard currently supports 4 runtimes (Claude Code, OpenCode, Gemini CLI, Codex) but not Copilot CLI, which means the largest commercial AI developer tool ecosystem is partially locked out. Copilot CLI supports custom agents (`.agent.md`), skills (`SKILL.md`), hooks, and MCP servers — all concepts PAN already maps to. The cost of NOT doing this is losing access to GitHub's 150M+ developer install base and ceding the "structured workflow orchestration" space on Copilot CLI to competitors or GitHub's own native planning features.
15
+
16
+ ### 0.2 Demand Evidence
17
+
18
+ | Evidence Type | Source | Finding |
19
+ |--------------|--------|---------|
20
+ | User-stated pain | This conversation | User asked "do we cater for copilot" — direct demand signal |
21
+ | Competitor parity | GitHub Copilot CLI GA | Copilot CLI ships plan mode, skills, agents, hooks — same concepts PAN uses |
22
+ | Market timing | GitHub Changelog 2026-02-25 | GA just 3 days ago — first-mover window for structured workflow tools |
23
+ | Community signals | github.com/github/copilot-cli/issues/783 | Feature request for "Native Plan Mode Support" — users want structured planning on Copilot CLI |
24
+
25
+ ### 0.3 Scope Definition
26
+
27
+ | In Scope | Out of Scope (and why) |
28
+ |----------|------------------------|
29
+ | Installer support: `--copilot` flag for Copilot CLI runtime | Copilot coding agent (cloud-based PR agent) — different product, different API |
30
+ | All 32 commands converted to Copilot CLI format | VS Code Copilot integration — IDE-based, not terminal CLI |
31
+ | All 11 agents converted to `.agent.md` format | Copilot Extensions marketplace — requires GitHub App registration |
32
+ | Hook installation (Copilot CLI supports hooks natively) | MCP server bundling — PAN doesn't ship MCP servers |
33
+ | Global (`~/.copilot/`) and local (`.github/`) install paths | GitHub Enterprise Server support — standard Copilot CLI only |
34
+ | Uninstall support (`--uninstall`) | Plugin distribution via `/plugin install` — future enhancement |
35
+ | Documentation updates (README, USER-GUIDE, CHANGELOG) | Custom model configuration — Copilot CLI handles models internally |
36
+
37
+ ### 0.4 Success Criteria
38
+
39
+ ```
40
+ SC-1: User can install PAN for Copilot CLI with `npx pan-wizard --copilot --global`
41
+ SC-2: All 32 commands work as skills via /pan-command-name in Copilot CLI
42
+ SC-3: All 11 agents available via /agent menu or @pan-agent-name invocation
43
+ SC-4: Hooks (statusline, context monitor, update check) installed and functional
44
+ SC-5: No regression in existing 644+ tests
45
+ SC-6: Installation works on Windows, Mac, and Linux
46
+ SC-7: Uninstall cleanly removes all PAN artifacts from Copilot CLI directories
47
+ ```
48
+
49
+ ### 0.5 User Stories
50
+
51
+ ```
52
+ As a developer using GitHub Copilot CLI, I want to install PAN Wizard,
53
+ so that I get structured workflow automation (plan-execute-verify),
54
+ instead of ad-hoc prompting without context management.
55
+
56
+ As a team using GitHub Copilot Business, I want PAN Wizard in our Copilot CLI,
57
+ so that every developer gets consistent project workflows across sessions,
58
+ instead of each person managing their own prompt patterns.
59
+
60
+ As a developer switching between Claude Code and Copilot CLI, I want PAN to work in both,
61
+ so that I can use the same workflow regardless of which AI tool I'm using,
62
+ instead of learning different project management approaches per tool.
63
+ ```
64
+
65
+ ### 0.6 Cannibalization Check
66
+
67
+ | Existing Command/Agent | Overlap? | Impact |
68
+ |-----------------------|----------|--------|
69
+ | Codex runtime support | Partial | Codex (OpenAI) and Copilot CLI (GitHub/Microsoft) are different products with different file formats. No cannibalization — additive. |
70
+ | `pan:help` command | None | Help already lists multi-runtime info. Just needs a 5th entry. |
71
+ | `pan:update` command | None | Update flow is runtime-agnostic. |
72
+
73
+ **No full overlap.** This is a new runtime, not a new command.
74
+
75
+ ### 0.7 Cognitive Load Assessment
76
+
77
+ | Metric | Before | After | Delta |
78
+ |--------|--------|-------|-------|
79
+ | Commands a new user must learn | 32 | 32 | +0 |
80
+ | New concepts introduced | 0 | 0 | +0 |
81
+ | Runtimes supported | 4 | 5 | +1 |
82
+ | Score | -- | -- | **neutral (0)** |
83
+
84
+ No new commands or concepts. Same PAN workflow, one more runtime option.
85
+
86
+ ---
87
+
88
+ ## Phase 1: Internal Reconnaissance
89
+
90
+ ### 1.1 Existing Capabilities Inventory
91
+
92
+ | Capability | Status | Location | Relevance |
93
+ |------------|--------|----------|-----------|
94
+ | Multi-runtime installer | Complete | `bin/install.js` | Core — must add 5th runtime branch |
95
+ | Runtime flag parsing | Complete | `bin/install.js:20-42` | Add `--copilot` flag |
96
+ | Directory name mapping | Complete | `getDirName()` | Add Copilot CLI mapping |
97
+ | Global dir resolution | Complete | `getGlobalDir()` | Add `COPILOT_CONFIG_DIR` / `~/.copilot/` |
98
+ | Command → skill conversion | Complete | `convertClaudeCommandToCodexSkill()` | Template for Copilot CLI converter |
99
+ | Agent format conversion | Complete | `convertClaudeToCodexMarkdown()` | Template — but Copilot CLI uses `.agent.md` natively |
100
+ | Hook installation | Complete | Lines 1768-1814 | Copilot CLI supports hooks natively (unlike Codex) |
101
+ | Settings.json construction | Complete | Lines 1834-1901 | Copilot CLI uses `config.json` not `settings.json` |
102
+ | Tool name mapping | Complete | Lines 327-390 | Need new Claude → Copilot CLI mapping |
103
+ | Uninstall logic | Complete | Lines 975-1225 | Add Copilot CLI cleanup paths |
104
+ | Frontmatter conversion | Complete | Multiple functions | Need Copilot CLI-specific converter |
105
+ | Attribution handling | Complete | `getCommitAttribution()` | Add Copilot CLI attribution check |
106
+
107
+ ### 1.2 Key File Format Differences
108
+
109
+ | Aspect | Claude Code | Copilot CLI |
110
+ |--------|------------|-------------|
111
+ | **Commands** | `commands/pan/*.md` with YAML frontmatter | `skills/pan-*/SKILL.md` with YAML frontmatter |
112
+ | **Agents** | `agents/*.md` with YAML frontmatter | `agents/*.agent.md` with YAML frontmatter |
113
+ | **Hooks** | `settings.json` hooks section | `.github/hooks/*.json` or `~/.copilot/hooks/` |
114
+ | **Config** | `settings.json` | `config.json` |
115
+ | **Instructions** | `CLAUDE.md` | `.github/copilot-instructions.md` or `~/.copilot/copilot-instructions.md` |
116
+ | **Command prefix** | `/pan:` | `/pan-` (skills use `/skill-name`) |
117
+ | **Agent invocation** | `Task(subagent_type="pan-planner")` | `/agent` menu or `copilot --agent=pan-planner` |
118
+ | **Tool names** | `Read`, `Write`, `Edit`, `Bash`, `Glob`, `Grep` | `read`/`view`, `edit`, `bash`/`execute`, `glob`, `grep`/`search` |
119
+ | **Global path** | `~/.claude/` | `~/.copilot/` |
120
+ | **Local path** | `.claude/` | `.github/` (or `.copilot/`) |
121
+ | **MCP config** | `settings.json` mcpServers | `~/.copilot/mcp-config.json` |
122
+
123
+ ### 1.3 Convention Enforcement
124
+
125
+ - [x] No new core module needed — installer-only change
126
+ - [x] No new pan-tools.cjs commands
127
+ - [x] Zero runtime dependencies maintained
128
+ - [x] CommonJS only
129
+ - [x] All paths through `toPosix()` in output
130
+ - [x] Install/uninstall follows existing patterns
131
+
132
+ ### 1.4 Dependency Map
133
+
134
+ ```
135
+ [Copilot CLI Runtime]
136
+ ├── depends on: bin/install.js (installer — primary change)
137
+ ├── depends on: pan-wizard-core/ (shared, unchanged)
138
+ ├── extends: Runtime selection (--copilot flag)
139
+ ├── conflicts with: nothing
140
+ └── enables: GitHub Copilot ecosystem access
141
+ ```
142
+
143
+ No new modules. No circular dependencies. Pure installer enhancement.
144
+
145
+ ---
146
+
147
+ ## Phase 2: Competitive Intelligence
148
+
149
+ ### 2.1 Copilot CLI Native Capabilities vs PAN
150
+
151
+ | Capability | Copilot CLI Native | PAN Wizard Adds |
152
+ |------------|-------------------|-----------------|
153
+ | Plan mode | Basic: analyze → plan → execute | Structured: research → plan → verify → execute → verify |
154
+ | Context management | Auto-compact at 95%, memory across sessions | Phase-scoped 200K windows, state.md persistence |
155
+ | Multi-agent | Built-in sub-agents (Explore, Task, Code Review, Plan) | 11 specialized agents with model profile control |
156
+ | Session persistence | Built-in memory | state.md + pause/resume + handoff docs |
157
+ | Hooks | Full hook support (7 event types) | 3 PAN hooks (statusline, context monitor, update check) |
158
+ | Skills | User-created SKILL.md files | 32 pre-built workflow commands |
159
+ | Git integration | Basic commit support | Atomic commits per task, branching strategies, conventional commits |
160
+ | Verification | No post-execution verification | Auto-verifier + human UAT workflow |
161
+ | Requirement tracing | None | REQ-ID tracing from definition through implementation |
162
+
163
+ ### 2.2 Why PAN on Copilot CLI Makes Sense
164
+
165
+ Copilot CLI has the infrastructure (agents, skills, hooks) but lacks structured workflow orchestration. It's like having a powerful engine without a transmission. PAN provides:
166
+
167
+ 1. **Structure** — Break work into phases that fit context windows
168
+ 2. **Verification** — Check work was done correctly, not just done
169
+ 3. **Persistence** — `.planning/` directory survives any session boundary
170
+ 4. **Reproducibility** — Same workflow regardless of developer
171
+
172
+ ### 2.3 Competitive Matrix (Runtime Support)
173
+
174
+ | Tool | Claude Code | OpenCode | Gemini CLI | Codex | Copilot CLI |
175
+ |------|-----------|----------|-----------|-------|-------------|
176
+ | **PAN Wizard** | Yes | Yes | Yes | Yes | **Proposed** |
177
+ | **Aider** | No | No | No | No | No (own CLI) |
178
+ | **Cline** | No | No | No | No | No (VS Code) |
179
+ | **Cursor** | No | No | No | No | No (own IDE) |
180
+ | **Windsurf** | No | No | No | No | No (own IDE) |
181
+
182
+ PAN Wizard is unique in multi-runtime support. Adding Copilot CLI extends the lead.
183
+
184
+ ---
185
+
186
+ ## Phase 3: Strategic Analysis
187
+
188
+ ### 3.1 Blue Ocean Four Actions Framework
189
+
190
+ | Action | Decision |
191
+ |--------|----------|
192
+ | **ELIMINATE** | Runtime lock-in — PAN should work everywhere |
193
+ | **REDUCE** | Installation friction — one command for any runtime |
194
+ | **RAISE** | Runtime coverage — from 4 to 5, covering GitHub's massive ecosystem |
195
+ | **CREATE** | First structured workflow tool for Copilot CLI — nobody else has this |
196
+
197
+ ### 3.2 Wardley Evolution
198
+
199
+ ```
200
+ Genesis ──── Custom-Built ──── Product ──── Commodity
201
+ ↑
202
+ PAN Wizard
203
+ (multi-runtime workflow)
204
+ ```
205
+
206
+ Multi-runtime workflow orchestration is in the **Product** phase. GitHub building native plan mode pushes it toward commodity. PAN must differentiate on **depth** (research → plan → verify → execute → verify) vs GitHub's simpler plan-execute.
207
+
208
+ ### 3.3 Strategic Moat Analysis
209
+
210
+ | Moat Type | Contribution | Score |
211
+ |-----------|-------------|-------|
212
+ | **Context Engineering** | Phase-scoped windows prevent rot; Copilot CLI's auto-compact is weaker | 4 |
213
+ | **Cross-Platform** | 5th runtime — unmatched coverage | 5 |
214
+ | **Developer Experience** | Same `/pan:` workflow on any AI tool | 4 |
215
+ | **Zero Dependencies** | Maintained — installer is pure Node builtins | 5 |
216
+ | **State Persistence** | `.planning/` works across all runtimes | 4 |
217
+ | **Verification Quality** | Post-execution verification unique to PAN | 4 |
218
+ | **Total** | | **26/30** |
219
+
220
+ ### 3.4 Strategic Recommendation
221
+
222
+ **BUILD — High Priority.** Copilot CLI went GA 3 days ago with full skill/agent/hook support matching PAN's architecture. The implementation is a proven pattern (4 runtimes already working), the effort is bounded (installer changes only, no core logic), and the strategic value is enormous (GitHub's entire developer ecosystem). PAN should NOT copy Copilot CLI's native plan mode — instead, position PAN as the structured orchestration layer that turns Copilot CLI's raw agent power into a repeatable, verifiable workflow. Ship within 1-2 sessions while the first-mover window is open.
223
+
224
+ ---
225
+
226
+ ## Phase 3.5: Architecture & Implementation
227
+
228
+ ### 3.5.1 Feature Type
229
+
230
+ **Installer Enhancement** — Modify `bin/install.js` to handle a 5th runtime. No new core modules, no new commands, no new agents.
231
+
232
+ ### 3.5.2 Layer Violation Check
233
+
234
+ - [x] No command .md changes (content is converted at install time)
235
+ - [x] No core module changes
236
+ - [x] No agent definition changes
237
+ - [x] No upward dependencies
238
+ - [x] Pure installer-layer change
239
+
240
+ ### 3.5.3 Output Contract
241
+
242
+ No new JSON output. The installer produces files on disk, not JSON API responses.
243
+
244
+ ### 3.5.4 State Transitions
245
+
246
+ N/A — The installer does not mutate `.planning/` state files.
247
+
248
+ ### 3.5.5 Breaking Change Assessment
249
+
250
+ | Question | Answer |
251
+ |----------|--------|
252
+ | Changes any existing command's JSON output schema? | No |
253
+ | Changes file formats? | No |
254
+ | Changes directory structure? | No |
255
+ | Changes installer output? | **Yes** — adds `--copilot` flag, new install target |
256
+
257
+ **Migration:** None needed. Additive change. Existing runtimes unchanged.
258
+
259
+ ### 3.5.6 Composability
260
+
261
+ | Interaction | Works? | How |
262
+ |-------------|--------|-----|
263
+ | All 32 PAN commands available | Yes | Installed as SKILL.md files |
264
+ | All 11 agents available | Yes | Installed as .agent.md files |
265
+ | Hooks functional | Yes | Copilot CLI supports preToolUse, postToolUse, sessionStart |
266
+ | pan-wizard-core shared | Yes | Same lib directory, unchanged |
267
+
268
+ ### 3.5.7 Performance Budget
269
+
270
+ | Operation | Cost | Notes |
271
+ |-----------|------|-------|
272
+ | File reads (32 commands + 11 agents) | ~215ms | Read source .md files |
273
+ | Frontmatter conversion | ~50ms | String replacements per file |
274
+ | File writes (32 skills + 11 agents + hooks) | ~230ms | Write converted files |
275
+ | Settings/config merge | ~10ms | Read + write config.json |
276
+ | **Total** | **~505ms** | Acceptable for one-time install |
277
+
278
+ ### 3.5.8 Cross-Platform
279
+
280
+ | Platform | Consideration |
281
+ |----------|---------------|
282
+ | Windows | `~/.copilot/` resolves via `os.homedir()` — already handled for other runtimes |
283
+ | Mac/Linux | Standard `~/.copilot/` path |
284
+ | All | `path.join()` for all paths, `toPosix()` for any output |
285
+
286
+ ---
287
+
288
+ ## Phase 4: Design Synthesis
289
+
290
+ ### 4.1 Guide-Level Explanation
291
+
292
+ **GitHub Copilot CLI Runtime Support**
293
+
294
+ PAN Wizard now works with GitHub Copilot CLI — the terminal-native coding agent included in all Copilot plans. Install PAN once and get all 37 workflow commands, 11 specialized agents, and 3 hooks directly in Copilot CLI.
295
+
296
+ **Install:**
297
+ ```bash
298
+ npx pan-wizard --copilot --global # Install to ~/.copilot/
299
+ npx pan-wizard --copilot --local # Install to ./.github/
300
+ ```
301
+
302
+ **Use:**
303
+ ```
304
+ copilot
305
+ > /pan-new-project # Start a new project
306
+ > /pan-plan-phase 1 # Research + plan + verify
307
+ > /pan-execute-phase 1 # Parallel execution
308
+ > /pan-verify-work 1 # Manual UAT
309
+ ```
310
+
311
+ **Agents appear in Copilot CLI's agent menu:**
312
+ ```
313
+ > /agent
314
+ pan-planner
315
+ pan-executor
316
+ pan-verifier
317
+ ...
318
+ ```
319
+
320
+ **What it does NOT do:**
321
+ - Does not integrate with Copilot coding agent (the cloud PR bot)
322
+ - Does not publish to GitHub's plugin marketplace
323
+ - Does not replace Copilot CLI's native plan mode (PAN adds structure on top)
324
+
325
+ ### 4.2 Technical Details
326
+
327
+ #### 4.2.1 Installation Paths
328
+
329
+ | Scope | Path | Notes |
330
+ |-------|------|-------|
331
+ | Global skills | `~/.copilot/skills/pan-*/SKILL.md` | 37 skill directories |
332
+ | Global agents | `~/.copilot/agents/pan-*.agent.md` | 11 agent files |
333
+ | Global hooks | `~/.copilot/hooks/pan-*.json` | 3 hook configs |
334
+ | Global core | `~/.copilot/pan-wizard-core/` | Shared library |
335
+ | Global instructions | `~/.copilot/copilot-instructions.md` | Appended, not replaced |
336
+ | Local skills | `.github/skills/pan-*/SKILL.md` | Project-scoped |
337
+ | Local agents | `.github/agents/pan-*.agent.md` | Project-scoped |
338
+ | Local hooks | `.github/hooks/pan-*.json` | Project-scoped |
339
+ | Local core | `.github/pan-wizard-core/` | Project-scoped |
340
+
341
+ #### 4.2.2 File Format Conversions
342
+
343
+ **Commands → Skills (`SKILL.md`):**
344
+ ```yaml
345
+ ---
346
+ name: pan-new-project
347
+ description: Initialize a new project with deep context gathering and project.md
348
+ ---
349
+
350
+ [converted command content]
351
+ ```
352
+
353
+ Key conversions:
354
+ - `/pan:command` → `/pan-command`
355
+ - `$ARGUMENTS` → user prompt text (skills receive context naturally)
356
+ - Tool names: `Read` → `read`, `Write` → `edit`, `Bash` → `bash`, `Glob` → `glob`, `Grep` → `search`, `WebSearch` → `web`, `AskUserQuestion` → (natural conversation)
357
+ - `Task(subagent_type="pan-planner")` → `/agent pan-planner` or delegate pattern
358
+
359
+ **Agents → `.agent.md`:**
360
+ ```yaml
361
+ ---
362
+ name: pan-planner
363
+ description: Creates detailed phase execution plans with task breakdown and verification
364
+ tools: ["read", "edit", "bash", "glob", "search", "web"]
365
+ ---
366
+
367
+ [converted agent instructions]
368
+ ```
369
+
370
+ **Hooks → JSON config:**
371
+ ```json
372
+ {
373
+ "name": "pan-context-monitor",
374
+ "event": "postToolUse",
375
+ "command": "node ~/.copilot/hooks/pan-context-monitor.js"
376
+ }
377
+ ```
378
+
379
+ #### 4.2.3 Tool Name Mapping
380
+
381
+ | Claude Code | Copilot CLI | Notes |
382
+ |------------|-------------|-------|
383
+ | `Read` | `read` | Also aliased as `view` |
384
+ | `Write` | `edit` | Copilot CLI uses `edit` for both write and edit |
385
+ | `Edit` | `edit` | Same tool |
386
+ | `Bash` | `bash` | Also aliased as `execute` |
387
+ | `Glob` | `glob` | Same |
388
+ | `Grep` | `search` | Aliased as `grep` |
389
+ | `WebSearch` | `web` | Web search tool |
390
+ | `WebFetch` | `web` | Same web tool |
391
+ | `TodoWrite` | `todo` | Todo management |
392
+ | `AskUserQuestion` | (native) | Copilot CLI handles conversation natively |
393
+ | `Task` / `Agent` | `agent` | Sub-agent spawning |
394
+ | MCP tools (`mcp__*`) | MCP tools | Pass through unchanged |
395
+
396
+ ### 4.3 Design Decisions
397
+
398
+ | Decision | Rationale | What We Did NOT Copy |
399
+ |----------|-----------|---------------------|
400
+ | Use `/pan-` prefix for skills (not `/pan:`) | Copilot CLI skills use simple names; colons not standard | Codex's `$pan-` prefix (Copilot CLI uses `/`) |
401
+ | Install agents as `.agent.md` (not `.md`) | Copilot CLI convention for agent files | Claude's plain `.md` agent format |
402
+ | Use native hook system (not settings.json) | Copilot CLI has its own hook JSON format | Claude's settings.json hook registration |
403
+ | Local install to `.github/` (not `.copilot/`) | Copilot CLI reads skills/agents from `.github/` for project scope | Claude's `.claude/` pattern |
404
+
405
+ ### 4.4 Feature Ladder
406
+
407
+ | Version | Scope | Value | Effort |
408
+ |---------|-------|-------|--------|
409
+ | **v0 (MVP)** | Installer: `--copilot` flag, all 32 commands as skills, all 11 agents as .agent.md, core lib, docs | Full PAN workflow on Copilot CLI | **M** |
410
+ | **v1 (Complete)** | Hooks installation, `copilot-instructions.md` integration, uninstall support | Hooks + instructions + clean removal | **S** |
411
+ | **v2 (Enhanced)** | Plugin distribution (`/plugin install oharms/PanWizard`), MCP server bundling | One-command install from within Copilot CLI | **L** |
412
+
413
+ ### 4.5 Adoption Analysis
414
+
415
+ | Question | Answer |
416
+ |----------|--------|
417
+ | Discovery | `npx pan-wizard` interactive menu shows "GitHub Copilot CLI" as 5th option |
418
+ | Learning curve | Zero — same PAN commands, different runtime prefix |
419
+ | Workflow change | None — drop-in, same discuss → plan → execute → verify loop |
420
+ | Aha moment | Running `/pan-new-project` in Copilot CLI and seeing the full workflow work |
421
+
422
+ ---
423
+
424
+ ## Phase 5: Architecture Decision Record
425
+
426
+ See `docs/decisions/ADR-0002-copilot-cli-runtime.md`.
427
+
428
+ ---
429
+
430
+ ## Phase 6: Error Handling & Diagnostics
431
+
432
+ ### 6.1 Failure Modes
433
+
434
+ | Failure Mode | Category | Detection | Recovery | User Sees |
435
+ |-------------|----------|-----------|----------|-----------|
436
+ | Copilot CLI not installed | User error | `which copilot` check | Warning message, install anyway | "Warning: copilot command not found. Files installed but verify Copilot CLI is installed." |
437
+ | `~/.copilot/` doesn't exist | First install | `fs.existsSync()` | Create directory | Silent creation |
438
+ | `.github/` doesn't exist | First local install | `fs.existsSync()` | Create directory | Silent creation |
439
+ | Skills dir has existing non-PAN skills | Normal usage | Check for `pan-` prefix only | Only modify PAN skills | Non-PAN skills untouched |
440
+ | Config.json has existing settings | Normal usage | Read-merge-write | Merge PAN settings, preserve existing | Clean merge |
441
+ | Permission denied on `~/.copilot/` | Environment | try-catch on write | Error message with sudo hint | "Permission denied writing to ~/.copilot/. Try with elevated permissions." |
442
+ | Copilot CLI version too old | Compatibility | Check for skills/agents/hooks support | Warning with version requirement | "Warning: Copilot CLI may not support skills. Version X.Y+ required." |
443
+
444
+ ### 6.2 Diagnostics
445
+
446
+ | Diagnostic | How | When |
447
+ |------------|-----|------|
448
+ | `--copilot` flag | Runtime selection | Install time |
449
+ | Verification output | Lists installed skills/agents count | Post-install |
450
+ | `npx pan-wizard --copilot --global --uninstall` | Clean removal | Uninstall |
451
+
452
+ ---
453
+
454
+ ## Phase 7: Security & Threat Model
455
+
456
+ ### 7.1 Attack Surface
457
+
458
+ | Asset | Access | Trust Level |
459
+ |-------|--------|-------------|
460
+ | `~/.copilot/skills/pan-*/SKILL.md` | Write (install), Read (Copilot CLI) | System-generated, user-writable |
461
+ | `~/.copilot/agents/pan-*.agent.md` | Write (install), Read (Copilot CLI) | System-generated, user-writable |
462
+ | `~/.copilot/hooks/pan-*.js` | Write (install), Execute (Copilot CLI) | System-generated — **executable code** |
463
+ | `~/.copilot/config.json` | Read-Modify-Write | User-controlled |
464
+
465
+ ### 7.2 Key Risks
466
+
467
+ | Risk | Mitigation |
468
+ |------|-----------|
469
+ | Hook scripts execute arbitrary code | Hooks are copied from PAN's `hooks/dist/` (built from audited source). No user input in hook content. |
470
+ | Config.json tampering | Read-merge-write pattern preserves existing config. PAN only adds its own keys. |
471
+ | Path traversal in install | All paths constructed via `path.join()` from known base directories. No user-supplied path components in file content. |
472
+ | Skills injecting malicious prompts | Skills contain static PAN workflow instructions. No dynamic content injection. |
473
+
474
+ ### 7.3 Output Sanitization
475
+
476
+ - [x] No absolute paths in skill/agent content (use relative references)
477
+ - [x] No environment variables exposed in skill content
478
+ - [x] No secrets in any installed file
479
+ - [x] Hook scripts use same hardened code as Claude Code hooks
480
+
481
+ ---
482
+
483
+ ## Phase 8: Implementation Roadmap
484
+
485
+ ### 8.1 Tasks
486
+
487
+ #### Task 1: Add `--copilot` flag and runtime constants
488
+ **Files:** `bin/install.js`
489
+ **Changes:** Add flag parsing, `getDirName()`, `getGlobalDir()`, `getConfigDirFromHome()`, runtime labels
490
+ **Estimate:** S
491
+ **Priority:** P3
492
+
493
+ #### Task 2: Create Copilot CLI frontmatter converter
494
+ **Files:** `bin/install.js`
495
+ **Changes:** New function `convertClaudeToCopilotSkill()` — converts command .md to SKILL.md format with Copilot CLI tool names and conventions
496
+ **Estimate:** S
497
+ **Priority:** P3
498
+
499
+ #### Task 3: Create Copilot CLI agent converter
500
+ **Files:** `bin/install.js`
501
+ **Changes:** New function `convertClaudeToCopilotAgent()` — converts agent .md to .agent.md format with Copilot CLI YAML frontmatter (tools list, description)
502
+ **Estimate:** S
503
+ **Priority:** P3
504
+
505
+ #### Task 4: Create Copilot CLI tool name mapping
506
+ **Files:** `bin/install.js`
507
+ **Changes:** New mapping table `CLAUDE_TO_COPILOT_TOOLS` — maps Claude Code tool names to Copilot CLI equivalents
508
+ **Estimate:** XS
509
+ **Priority:** P3
510
+
511
+ #### Task 5: Implement skill installation
512
+ **Files:** `bin/install.js`
513
+ **Changes:** Function `copyCommandsAsCopilotSkills()` — creates `skills/pan-*/SKILL.md` directories, similar to existing `copyCommandsAsCodexSkills()`
514
+ **Estimate:** S
515
+ **Priority:** P3
516
+
517
+ #### Task 6: Implement agent installation
518
+ **Files:** `bin/install.js`
519
+ **Changes:** Copy agents as `.agent.md` files with converted frontmatter
520
+ **Estimate:** XS
521
+ **Priority:** P3
522
+
523
+ #### Task 7: Implement hook installation
524
+ **Files:** `bin/install.js`
525
+ **Changes:** Copy hook JS files, create hook JSON configs for Copilot CLI's hook format (sessionStart, postToolUse events)
526
+ **Estimate:** S
527
+ **Priority:** P3
528
+
529
+ #### Task 8: Implement config.json handling
530
+ **Files:** `bin/install.js`
531
+ **Changes:** Read/merge/write `~/.copilot/config.json` (or `.github/config.json` for local) — register hooks, set any required settings
532
+ **Estimate:** S
533
+ **Priority:** P3
534
+
535
+ #### Task 9: Implement uninstall
536
+ **Files:** `bin/install.js`
537
+ **Changes:** Remove PAN skills, agents, hooks, core lib from Copilot CLI directories
538
+ **Estimate:** S
539
+ **Priority:** P3
540
+
541
+ #### Task 10: Update interactive prompts
542
+ **Files:** `bin/install.js`
543
+ **Changes:** Add "GitHub Copilot CLI" to runtime selection menu, update `--all` to include copilot, add help text
544
+ **Estimate:** XS
545
+ **Priority:** P3
546
+
547
+ #### Task 11: Update documentation
548
+ **Files:** `README.md`, `docs/USER-GUIDE.md`, `CHANGELOG.md`
549
+ **Changes:** Add Copilot CLI to all runtime lists, command syntax tables, installation examples, feature availability matrix
550
+ **Estimate:** S
551
+ **Priority:** P3
552
+
553
+ #### Task 12: Add installer tests
554
+ **Files:** `tests/installer-copilot.test.cjs` (new)
555
+ **Changes:** Test skill generation, agent conversion, tool name mapping, hook installation, config merge, uninstall. Integration tests using the installer's conversion functions.
556
+ **Estimate:** M
557
+ **Priority:** P3
558
+
559
+ ### 8.2 Dependency Graph
560
+
561
+ ```
562
+ Task 4 (Tool mapping)
563
+ ├─→ Task 2 (Skill converter) ─→ Task 5 (Skill install)
564
+ └─→ Task 3 (Agent converter) ─→ Task 6 (Agent install)
565
+ │
566
+ Task 1 (Flags/constants) ───────────────┤
567
+ │
568
+ Task 7 (Hook install) ─→ Task 8 (Config) ─→ Task 9 (Uninstall)
569
+ │
570
+ Task 10 (Interactive prompts) ──────────────────────┤
571
+ │
572
+ Task 11 (Docs) ────────────────────────────────────┘
573
+ │
574
+ Task 12 (Tests) ───────────────────────────────────┘
575
+ ```
576
+
577
+ ### 8.3 Risk Register
578
+
579
+ | Risk | Probability | Impact | Mitigation |
580
+ |------|------------|--------|------------|
581
+ | Copilot CLI file format changes post-GA | Low | Medium | Monitor GitHub Changelog; format is stable post-GA |
582
+ | Hook JS execution differences | Medium | Low | Same Node.js hooks; Copilot CLI runs them via `node` |
583
+ | `.github/` conflicts with existing repo files | Medium | Low | Only create `skills/pan-*/` and `agents/pan-*.agent.md` — namespaced |
584
+ | Installer grows too large | Low | Low | Install.js is already 2,157 lines for 4 runtimes; +200-300 lines is manageable |
585
+ | Tool name mapping incomplete | Medium | Medium | Start with documented aliases; iterate based on testing |
586
+
587
+ ---
588
+
589
+ ## Phase 9: Test Plan
590
+
591
+ ### 9.1 Test Pyramid
592
+
593
+ | Level | Count | What |
594
+ |-------|-------|------|
595
+ | **Unit** | 8+ | Converter functions: skill, agent, tool mapping, hook config generation |
596
+ | **Integration** | 6+ | Full install/uninstall cycle, file existence checks, content validation |
597
+ | **E2E** | 2+ | Install → verify skills exist → uninstall → verify clean |
598
+
599
+ ### 9.2 Key Test Cases
600
+
601
+ 1. `convertClaudeToCopilotSkill()` — correct YAML frontmatter, tool names converted, prefix converted
602
+ 2. `convertClaudeToCopilotAgent()` — `.agent.md` format, tools list, description
603
+ 3. Tool name mapping — all Claude tools mapped to Copilot equivalents
604
+ 4. Skill directory structure — `skills/pan-{name}/SKILL.md` created correctly
605
+ 5. Agent file naming — `pan-{name}.agent.md` (not `.md`)
606
+ 6. Hook JSON config — correct event types, command paths
607
+ 7. Config.json merge — existing settings preserved, PAN settings added
608
+ 8. Uninstall — all PAN files removed, non-PAN files untouched
609
+ 9. `--all` flag — includes Copilot CLI in the list
610
+ 10. Interactive menu — Copilot CLI appears as option 5
611
+
612
+ ### 9.3 Regression
613
+
614
+ - [x] All existing 644 tests pass unchanged
615
+ - [x] Claude Code, OpenCode, Gemini, Codex installation paths unchanged
616
+ - [x] No core module changes — zero regression risk on pan-tools
617
+
618
+ ---
619
+
620
+ ## Summary Statistics
621
+
622
+ | Metric | Value |
623
+ |--------|-------|
624
+ | Tasks | 12 |
625
+ | New files | 1 (test file) |
626
+ | Modified files | 4 (install.js, README.md, USER-GUIDE.md, CHANGELOG.md) |
627
+ | Effort | M (total ~30-40 pts across tasks) |
628
+ | Tests planned | 16+ (unit: 8, integration: 6, e2e: 2) |
629
+ | Breaking changes | None |
630
+ | New dependencies | None |
631
+
632
+ ---
633
+
634
+ ## Feature Reality Score
635
+
636
+ ```
637
+ User Value (UV): 4 — Common usage, most Copilot CLI users benefit
638
+ Time Criticality (TC): 4 — Copilot CLI just went GA, first-mover advantage
639
+ Risk Reduction (RR): 3 — Unblocks entire GitHub ecosystem
640
+ Job Size (JS): 3 — M effort
641
+
642
+ RS = (4 + 4 + 3) / 3 = 3.67 → DO
643
+ ```
644
+
645
+ ---
646
+
647
+ *Generated by /featureAI*