bmad-method 6.12.4 → 7.1.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 (389) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +107 -54
  3. package/agents.json +640 -0
  4. package/bin/bmad-method.js +4 -0
  5. package/messages.yaml +267 -0
  6. package/modules.yaml +56 -0
  7. package/package.json +32 -110
  8. package/src/agent-picks.js +77 -0
  9. package/src/agents.js +141 -0
  10. package/src/bmad-scripts.js +167 -0
  11. package/src/cli.js +266 -0
  12. package/src/commands/agent-choice.js +67 -0
  13. package/src/commands/apply.js +38 -0
  14. package/src/commands/deps.js +25 -0
  15. package/src/commands/ending.js +66 -0
  16. package/src/commands/existing-install.js +50 -0
  17. package/src/commands/install-plan.js +130 -0
  18. package/src/commands/install-steps.js +66 -0
  19. package/src/commands/install.js +86 -0
  20. package/src/commands/status.js +39 -0
  21. package/src/commands/update.js +106 -0
  22. package/src/installed.js +48 -0
  23. package/src/messages.js +84 -0
  24. package/src/modules.js +221 -0
  25. package/src/preflight.js +124 -0
  26. package/src/project-lock.js +68 -0
  27. package/src/prompts.js +626 -0
  28. package/src/report.js +199 -0
  29. package/src/run.js +128 -0
  30. package/src/self-update.js +88 -0
  31. package/src/skills-cli.js +133 -0
  32. package/src/version.js +11 -0
  33. package/.claude-plugin/marketplace.json +0 -53
  34. package/AGENTS.md +0 -24
  35. package/CLAUDE.md +0 -1
  36. package/README_CN.md +0 -98
  37. package/README_KR.md +0 -90
  38. package/README_VN.md +0 -99
  39. package/bmad-modules.yaml +0 -140
  40. package/body.md +0 -17
  41. package/greptile.json +0 -52
  42. package/pr2.md +0 -11
  43. package/removals.txt +0 -87
  44. package/src/bmm-skills/agents/bmad-agent-analyst/SKILL.md +0 -76
  45. package/src/bmm-skills/agents/bmad-agent-analyst/customize.toml +0 -103
  46. package/src/bmm-skills/agents/bmad-agent-architect/SKILL.md +0 -76
  47. package/src/bmm-skills/agents/bmad-agent-architect/customize.toml +0 -63
  48. package/src/bmm-skills/agents/bmad-agent-dev/SKILL.md +0 -76
  49. package/src/bmm-skills/agents/bmad-agent-dev/customize.toml +0 -81
  50. package/src/bmm-skills/agents/bmad-agent-pm/SKILL.md +0 -76
  51. package/src/bmm-skills/agents/bmad-agent-pm/customize.toml +0 -73
  52. package/src/bmm-skills/agents/bmad-agent-ux-designer/SKILL.md +0 -76
  53. package/src/bmm-skills/agents/bmad-agent-ux-designer/customize.toml +0 -58
  54. package/src/bmm-skills/module-help.csv +0 -19
  55. package/src/bmm-skills/module.yaml +0 -85
  56. package/src/bmm-skills/plan/bmad-architecture/SKILL.md +0 -85
  57. package/src/bmm-skills/plan/bmad-architecture/assets/spine-template.md +0 -79
  58. package/src/bmm-skills/plan/bmad-architecture/customize.toml +0 -101
  59. package/src/bmm-skills/plan/bmad-architecture/references/headless.md +0 -26
  60. package/src/bmm-skills/plan/bmad-architecture/references/reviewer-gate.md +0 -13
  61. package/src/bmm-skills/plan/bmad-architecture/scripts/lint_spine.py +0 -261
  62. package/src/bmm-skills/plan/bmad-architecture/scripts/tests/test_lint_spine.py +0 -270
  63. package/src/bmm-skills/plan/bmad-create-epics-and-stories/SKILL.md +0 -93
  64. package/src/bmm-skills/plan/bmad-create-epics-and-stories/customize.toml +0 -39
  65. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -263
  66. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-02-design-epics.md +0 -242
  67. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-03-create-stories.md +0 -255
  68. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-04-final-validation.md +0 -141
  69. package/src/bmm-skills/plan/bmad-create-epics-and-stories/templates/epics-template.md +0 -62
  70. package/src/bmm-skills/plan/bmad-generate-project-context/SKILL.md +0 -12
  71. package/src/bmm-skills/plan/bmad-prd/SKILL.md +0 -94
  72. package/src/bmm-skills/plan/bmad-prd/assets/headless-schemas.md +0 -76
  73. package/src/bmm-skills/plan/bmad-prd/assets/prd-template.md +0 -165
  74. package/src/bmm-skills/plan/bmad-prd/assets/prd-validation-checklist.md +0 -135
  75. package/src/bmm-skills/plan/bmad-prd/assets/validation-report-template.html +0 -325
  76. package/src/bmm-skills/plan/bmad-prd/customize.toml +0 -148
  77. package/src/bmm-skills/plan/bmad-prd/references/headless.md +0 -39
  78. package/src/bmm-skills/plan/bmad-prd/references/validate.md +0 -97
  79. package/src/bmm-skills/plan/bmad-prfaq/SKILL.md +0 -135
  80. package/src/bmm-skills/plan/bmad-prfaq/agents/artifact-analyzer.md +0 -60
  81. package/src/bmm-skills/plan/bmad-prfaq/agents/web-researcher.md +0 -49
  82. package/src/bmm-skills/plan/bmad-prfaq/assets/prfaq-template.md +0 -62
  83. package/src/bmm-skills/plan/bmad-prfaq/bmad-manifest.json +0 -16
  84. package/src/bmm-skills/plan/bmad-prfaq/customize.toml +0 -39
  85. package/src/bmm-skills/plan/bmad-prfaq/references/customer-faq.md +0 -55
  86. package/src/bmm-skills/plan/bmad-prfaq/references/internal-faq.md +0 -51
  87. package/src/bmm-skills/plan/bmad-prfaq/references/press-release.md +0 -60
  88. package/src/bmm-skills/plan/bmad-prfaq/references/verdict.md +0 -83
  89. package/src/bmm-skills/plan/bmad-product-brief/SKILL.md +0 -91
  90. package/src/bmm-skills/plan/bmad-product-brief/assets/brief-template.md +0 -41
  91. package/src/bmm-skills/plan/bmad-product-brief/customize.toml +0 -100
  92. package/src/bmm-skills/plan/bmad-project-context/SKILL.md +0 -121
  93. package/src/bmm-skills/plan/bmad-project-context/customize.toml +0 -24
  94. package/src/bmm-skills/plan/bmad-project-context/references/best-practices.md +0 -84
  95. package/src/bmm-skills/plan/bmad-project-context/references/template.md +0 -55
  96. package/src/bmm-skills/plan/bmad-spec/SKILL.md +0 -160
  97. package/src/bmm-skills/plan/bmad-spec/assets/headless-schemas.md +0 -33
  98. package/src/bmm-skills/plan/bmad-spec/assets/spec-template.md +0 -49
  99. package/src/bmm-skills/plan/bmad-spec/assets/stories-schema.md +0 -44
  100. package/src/bmm-skills/plan/bmad-spec/customize.toml +0 -52
  101. package/src/bmm-skills/plan/bmad-sprint-planning/SKILL.md +0 -62
  102. package/src/bmm-skills/plan/bmad-sprint-planning/customize.toml +0 -39
  103. package/src/bmm-skills/plan/bmad-sprint-planning/references/fix-sprint-status.md +0 -30
  104. package/src/bmm-skills/plan/bmad-sprint-planning/references/generate-tracking.md +0 -25
  105. package/src/bmm-skills/plan/bmad-sprint-planning/references/readiness-gate.md +0 -20
  106. package/src/bmm-skills/plan/bmad-sprint-planning/references/status-view.md +0 -14
  107. package/src/bmm-skills/plan/bmad-sprint-planning/references/validate.md +0 -10
  108. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/__pycache__/sprint_plan.cpython-311.pyc +0 -0
  109. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/sprint_plan.py +0 -701
  110. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/__pycache__/test_sprint_plan.cpython-311-pytest-9.1.1.pyc +0 -0
  111. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/test_sprint_plan.py +0 -524
  112. package/src/bmm-skills/plan/bmad-sprint-planning/sprint-status-template.yaml +0 -71
  113. package/src/bmm-skills/plan/bmad-ux/SKILL.md +0 -90
  114. package/src/bmm-skills/plan/bmad-ux/assets/color-themes.md +0 -9
  115. package/src/bmm-skills/plan/bmad-ux/assets/design-directions.md +0 -9
  116. package/src/bmm-skills/plan/bmad-ux/assets/design-example-editorial.md +0 -158
  117. package/src/bmm-skills/plan/bmad-ux/assets/design-example-mobile.md +0 -93
  118. package/src/bmm-skills/plan/bmad-ux/assets/design-example-shadcn.md +0 -109
  119. package/src/bmm-skills/plan/bmad-ux/assets/excalidraw-wireframe.md +0 -19
  120. package/src/bmm-skills/plan/bmad-ux/assets/experience-example-mobile.md +0 -112
  121. package/src/bmm-skills/plan/bmad-ux/assets/experience-example-shadcn.md +0 -133
  122. package/src/bmm-skills/plan/bmad-ux/assets/headless-schemas.md +0 -84
  123. package/src/bmm-skills/plan/bmad-ux/assets/key-screens.md +0 -29
  124. package/src/bmm-skills/plan/bmad-ux/assets/validation-report-template.html +0 -319
  125. package/src/bmm-skills/plan/bmad-ux/customize.toml +0 -100
  126. package/src/bmm-skills/plan/bmad-ux/references/creative-tools.md +0 -19
  127. package/src/bmm-skills/plan/bmad-ux/references/design-md-spec.md +0 -50
  128. package/src/bmm-skills/plan/bmad-ux/references/headless.md +0 -37
  129. package/src/bmm-skills/plan/bmad-ux/references/validate.md +0 -115
  130. package/src/bmm-skills/ship/bmad-build/SKILL.md +0 -13
  131. package/src/bmm-skills/ship/bmad-build/compile-epic-context.md +0 -62
  132. package/src/bmm-skills/ship/bmad-build/customize.toml +0 -152
  133. package/src/bmm-skills/ship/bmad-build/references/claims-check.md +0 -14
  134. package/src/bmm-skills/ship/bmad-build/references/deletion-check.md +0 -14
  135. package/src/bmm-skills/ship/bmad-build/review-prompts/edge-case-hunter.md +0 -112
  136. package/src/bmm-skills/ship/bmad-build/review-prompts/verification-gap.md +0 -113
  137. package/src/bmm-skills/ship/bmad-build/spec-template.md +0 -111
  138. package/src/bmm-skills/ship/bmad-build/step-01-clarify-and-route.md +0 -100
  139. package/src/bmm-skills/ship/bmad-build/step-02-plan.md +0 -62
  140. package/src/bmm-skills/ship/bmad-build/step-03-implement.md +0 -51
  141. package/src/bmm-skills/ship/bmad-build/step-04-review.md +0 -85
  142. package/src/bmm-skills/ship/bmad-build/step-05-present.md +0 -43
  143. package/src/bmm-skills/ship/bmad-build/step-oneshot.md +0 -107
  144. package/src/bmm-skills/ship/bmad-build/sync-sprint-status.md +0 -5
  145. package/src/bmm-skills/ship/bmad-build/workflow.md +0 -84
  146. package/src/bmm-skills/ship/bmad-build-auto/SKILL.md +0 -13
  147. package/src/bmm-skills/ship/bmad-build-auto/compile-epic-context.md +0 -62
  148. package/src/bmm-skills/ship/bmad-build-auto/customize.toml +0 -119
  149. package/src/bmm-skills/ship/bmad-build-auto/references/claims-check.md +0 -14
  150. package/src/bmm-skills/ship/bmad-build-auto/references/deletion-check.md +0 -14
  151. package/src/bmm-skills/ship/bmad-build-auto/review-prompts/edge-case-hunter.md +0 -112
  152. package/src/bmm-skills/ship/bmad-build-auto/review-prompts/verification-gap.md +0 -113
  153. package/src/bmm-skills/ship/bmad-build-auto/spec-template.md +0 -96
  154. package/src/bmm-skills/ship/bmad-build-auto/step-01-clarify-and-route.md +0 -84
  155. package/src/bmm-skills/ship/bmad-build-auto/step-02-plan.md +0 -27
  156. package/src/bmm-skills/ship/bmad-build-auto/step-03-implement.md +0 -48
  157. package/src/bmm-skills/ship/bmad-build-auto/step-04-review.md +0 -116
  158. package/src/bmm-skills/ship/bmad-build-auto/workflow.md +0 -104
  159. package/src/bmm-skills/ship/bmad-code-review/SKILL.md +0 -90
  160. package/src/bmm-skills/ship/bmad-code-review/customize.toml +0 -110
  161. package/src/bmm-skills/ship/bmad-code-review/references/claims-check.md +0 -14
  162. package/src/bmm-skills/ship/bmad-code-review/references/deletion-check.md +0 -14
  163. package/src/bmm-skills/ship/bmad-code-review/review-prompts/edge-case-hunter.md +0 -112
  164. package/src/bmm-skills/ship/bmad-code-review/review-prompts/verification-gap.md +0 -113
  165. package/src/bmm-skills/ship/bmad-code-review/steps/step-01-gather-context.md +0 -94
  166. package/src/bmm-skills/ship/bmad-code-review/steps/step-02-review.md +0 -32
  167. package/src/bmm-skills/ship/bmad-code-review/steps/step-03-triage.md +0 -54
  168. package/src/bmm-skills/ship/bmad-code-review/steps/step-04-present.md +0 -134
  169. package/src/bmm-skills/ship/bmad-correct-course/SKILL.md +0 -308
  170. package/src/bmm-skills/ship/bmad-correct-course/checklist.md +0 -288
  171. package/src/bmm-skills/ship/bmad-correct-course/customize.toml +0 -39
  172. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/SKILL.md +0 -176
  173. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/checklist.md +0 -33
  174. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/customize.toml +0 -39
  175. package/src/bmm-skills/ship/bmad-retrospective/SKILL.md +0 -94
  176. package/src/bmm-skills/ship/bmad-retrospective/customize.toml +0 -39
  177. package/src/bmm-skills/ship/bmad-retrospective/references/acceptance-verdict.md +0 -55
  178. package/src/bmm-skills/ship/bmad-retrospective/references/aggregate-views.md +0 -17
  179. package/src/bmm-skills/ship/bmad-retrospective/references/evidence-gathering.md +0 -30
  180. package/src/bmm-skills/ship/bmad-retrospective/references/retro-document.md +0 -84
  181. package/src/bmm-skills/ship/bmad-retrospective/references/team-discussion.md +0 -22
  182. package/src/bmm-skills/ship/bmad-retrospective/scripts/__pycache__/sprint_status.cpython-311.pyc +0 -0
  183. package/src/bmm-skills/ship/bmad-retrospective/scripts/git_evidence.py +0 -308
  184. package/src/bmm-skills/ship/bmad-retrospective/scripts/sprint_status.py +0 -750
  185. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_git_evidence.cpython-311-pytest-9.1.1.pyc +0 -0
  186. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_sprint_status.cpython-311-pytest-9.1.1.pyc +0 -0
  187. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/fixtures/sprint-status-template.yaml +0 -71
  188. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_git_evidence.py +0 -750
  189. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_sprint_status.py +0 -1579
  190. package/src/bmm-skills/ship/bmad-walkthrough/SKILL.md +0 -68
  191. package/src/bmm-skills/ship/bmad-walkthrough/customize.toml +0 -39
  192. package/src/bmm-skills/ship/bmad-walkthrough/generate-trail.md +0 -38
  193. package/src/bmm-skills/ship/bmad-walkthrough/step-01-orientation.md +0 -105
  194. package/src/bmm-skills/ship/bmad-walkthrough/step-02-walkthrough.md +0 -89
  195. package/src/bmm-skills/ship/bmad-walkthrough/step-03-detail-pass.md +0 -106
  196. package/src/bmm-skills/ship/bmad-walkthrough/step-04-testing.md +0 -74
  197. package/src/bmm-skills/ship/bmad-walkthrough/step-05-wrapup.md +0 -30
  198. package/src/bmm-skills/v6-shims/README.md +0 -29
  199. package/src/bmm-skills/v6-shims/bmad-checkpoint-preview/SKILL.md +0 -21
  200. package/src/bmm-skills/v6-shims/bmad-create-architecture/SKILL.md +0 -32
  201. package/src/bmm-skills/v6-shims/bmad-create-architecture/customize.toml +0 -39
  202. package/src/bmm-skills/v6-shims/bmad-create-prd/SKILL.md +0 -32
  203. package/src/bmm-skills/v6-shims/bmad-create-prd/customize.toml +0 -39
  204. package/src/bmm-skills/v6-shims/bmad-create-story/SKILL.md +0 -436
  205. package/src/bmm-skills/v6-shims/bmad-create-story/checklist.md +0 -357
  206. package/src/bmm-skills/v6-shims/bmad-create-story/customize.toml +0 -39
  207. package/src/bmm-skills/v6-shims/bmad-create-story/discover-inputs.md +0 -88
  208. package/src/bmm-skills/v6-shims/bmad-create-story/template.md +0 -49
  209. package/src/bmm-skills/v6-shims/bmad-dev-auto/SKILL.md +0 -21
  210. package/src/bmm-skills/v6-shims/bmad-dev-story/SKILL.md +0 -504
  211. package/src/bmm-skills/v6-shims/bmad-dev-story/checklist.md +0 -80
  212. package/src/bmm-skills/v6-shims/bmad-dev-story/customize.toml +0 -39
  213. package/src/bmm-skills/v6-shims/bmad-document-project/SKILL.md +0 -16
  214. package/src/bmm-skills/v6-shims/bmad-domain-research/SKILL.md +0 -16
  215. package/src/bmm-skills/v6-shims/bmad-edit-prd/SKILL.md +0 -32
  216. package/src/bmm-skills/v6-shims/bmad-edit-prd/customize.toml +0 -40
  217. package/src/bmm-skills/v6-shims/bmad-market-research/SKILL.md +0 -16
  218. package/src/bmm-skills/v6-shims/bmad-quick-dev/SKILL.md +0 -21
  219. package/src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md +0 -28
  220. package/src/bmm-skills/v6-shims/bmad-sprint-status/customize.toml +0 -39
  221. package/src/bmm-skills/v6-shims/bmad-technical-research/SKILL.md +0 -16
  222. package/src/bmm-skills/v6-shims/bmad-validate-prd/SKILL.md +0 -32
  223. package/src/bmm-skills/v6-shims/bmad-validate-prd/customize.toml +0 -40
  224. package/src/core-skills/bmad-advanced-elicitation/SKILL.md +0 -64
  225. package/src/core-skills/bmad-advanced-elicitation/assets/methods.csv +0 -72
  226. package/src/core-skills/bmad-advanced-elicitation/customize.toml +0 -54
  227. package/src/core-skills/bmad-advanced-elicitation/scripts/pick_methods.py +0 -233
  228. package/src/core-skills/bmad-advanced-elicitation/scripts/tests/test_pick_methods.py +0 -228
  229. package/src/core-skills/bmad-brainstorming/SKILL.md +0 -80
  230. package/src/core-skills/bmad-brainstorming/assets/brain-icons.json +0 -166
  231. package/src/core-skills/bmad-brainstorming/assets/brain-methods.csv +0 -109
  232. package/src/core-skills/bmad-brainstorming/assets/brain-selector.html +0 -328
  233. package/src/core-skills/bmad-brainstorming/customize.toml +0 -83
  234. package/src/core-skills/bmad-brainstorming/references/converge.md +0 -24
  235. package/src/core-skills/bmad-brainstorming/references/finalize.md +0 -26
  236. package/src/core-skills/bmad-brainstorming/references/headless.md +0 -54
  237. package/src/core-skills/bmad-brainstorming/references/in-chat-techniques.md +0 -18
  238. package/src/core-skills/bmad-brainstorming/references/mode-autonomous.md +0 -10
  239. package/src/core-skills/bmad-brainstorming/references/mode-facilitator.md +0 -11
  240. package/src/core-skills/bmad-brainstorming/references/mode-partner.md +0 -16
  241. package/src/core-skills/bmad-brainstorming/references/resume.md +0 -5
  242. package/src/core-skills/bmad-brainstorming/scripts/brain.py +0 -789
  243. package/src/core-skills/bmad-brainstorming/scripts/tests/test_brain.py +0 -289
  244. package/src/core-skills/bmad-customize/SKILL.md +0 -111
  245. package/src/core-skills/bmad-customize/scripts/list_customizable_skills.py +0 -235
  246. package/src/core-skills/bmad-customize/scripts/tests/test_list_customizable_skills.py +0 -249
  247. package/src/core-skills/bmad-deep-recon/SKILL.md +0 -82
  248. package/src/core-skills/bmad-deep-recon/assets/research.template.md +0 -18
  249. package/src/core-skills/bmad-deep-recon/customize.toml +0 -212
  250. package/src/core-skills/bmad-deep-recon/references/draft.md +0 -8
  251. package/src/core-skills/bmad-deep-recon/references/finalize.md +0 -11
  252. package/src/core-skills/bmad-deep-recon/references/html-briefing.md +0 -16
  253. package/src/core-skills/bmad-deep-recon/references/lifecycle.md +0 -11
  254. package/src/core-skills/bmad-deep-recon/references/process.md +0 -10
  255. package/src/core-skills/bmad-deep-recon/references/run.md +0 -73
  256. package/src/core-skills/bmad-deep-recon/references/selection.md +0 -13
  257. package/src/core-skills/bmad-deep-recon/references/synthesis.md +0 -16
  258. package/src/core-skills/bmad-deep-recon/references/verification.md +0 -29
  259. package/src/core-skills/bmad-deep-recon/scripts/recon_kit.py +0 -326
  260. package/src/core-skills/bmad-deep-recon/scripts/tests/test_recon_kit.py +0 -144
  261. package/src/core-skills/bmad-deep-recon/types/academic-lit.md +0 -19
  262. package/src/core-skills/bmad-deep-recon/types/competitive.md +0 -19
  263. package/src/core-skills/bmad-deep-recon/types/domain.md +0 -19
  264. package/src/core-skills/bmad-deep-recon/types/market.md +0 -19
  265. package/src/core-skills/bmad-deep-recon/types/technical.md +0 -19
  266. package/src/core-skills/bmad-deep-recon/types/user-voice.md +0 -19
  267. package/src/core-skills/bmad-forge-idea/SKILL.md +0 -107
  268. package/src/core-skills/bmad-forge-idea/customize.toml +0 -41
  269. package/src/core-skills/bmad-forge-idea/scripts/resolve_personas.py +0 -277
  270. package/src/core-skills/bmad-forge-idea/scripts/tests/test_resolve_personas.py +0 -160
  271. package/src/core-skills/bmad-help/SKILL.md +0 -77
  272. package/src/core-skills/bmad-party-mode/SKILL.md +0 -60
  273. package/src/core-skills/bmad-party-mode/customize.toml +0 -211
  274. package/src/core-skills/bmad-party-mode/references/create-party.md +0 -70
  275. package/src/core-skills/bmad-party-mode/references/mode-agent-team.md +0 -13
  276. package/src/core-skills/bmad-party-mode/references/mode-auto.md +0 -13
  277. package/src/core-skills/bmad-party-mode/references/mode-subagent.md +0 -31
  278. package/src/core-skills/bmad-party-mode/references/party-memory.md +0 -51
  279. package/src/core-skills/bmad-party-mode/scripts/resolve_party.py +0 -300
  280. package/src/core-skills/bmad-party-mode/scripts/tests/test_resolve_party.py +0 -183
  281. package/src/core-skills/bmad-review/SKILL.md +0 -50
  282. package/src/core-skills/bmad-review/customize.toml +0 -141
  283. package/src/core-skills/bmad-review/references/editorial-common.md +0 -56
  284. package/src/core-skills/bmad-review/references/lens-adversarial.md +0 -19
  285. package/src/core-skills/bmad-review/references/lens-edge-case-hunter.md +0 -72
  286. package/src/core-skills/bmad-review/references/lens-prose.md +0 -7
  287. package/src/core-skills/bmad-review/references/lens-structure.md +0 -9
  288. package/src/core-skills/bmad-review/references/lens-verification-gap.md +0 -92
  289. package/src/core-skills/bmad-review/references/structure-models.md +0 -44
  290. package/src/core-skills/bmad-review/scripts/tests/test_word_metrics.py +0 -62
  291. package/src/core-skills/bmad-review/scripts/word_metrics.py +0 -102
  292. package/src/core-skills/module-help.csv +0 -10
  293. package/src/core-skills/module.yaml +0 -38
  294. package/src/core-skills/v6-shims/README.md +0 -25
  295. package/src/core-skills/v6-shims/bmad-editorial-review/SKILL.md +0 -8
  296. package/src/core-skills/v6-shims/bmad-editorial-review/customize.toml +0 -31
  297. package/src/core-skills/v6-shims/bmad-editorial-review-prose/SKILL.md +0 -8
  298. package/src/core-skills/v6-shims/bmad-editorial-review-structure/SKILL.md +0 -8
  299. package/src/core-skills/v6-shims/bmad-review-adversarial-general/SKILL.md +0 -8
  300. package/src/core-skills/v6-shims/bmad-review-edge-case-hunter/SKILL.md +0 -8
  301. package/src/core-skills/v6-shims/bmad-review-verification-gap/SKILL.md +0 -8
  302. package/src/scripts/__pycache__/config_utils.cpython-311.pyc +0 -0
  303. package/src/scripts/config_utils.py +0 -119
  304. package/src/scripts/memlog.py +0 -228
  305. package/src/scripts/render_skill.py +0 -401
  306. package/src/scripts/resolve_config.py +0 -82
  307. package/src/scripts/resolve_customization.py +0 -164
  308. package/src/scripts/tests/__pycache__/test_config_utils.cpython-311.pyc +0 -0
  309. package/src/scripts/tests/__pycache__/test_resolve_config.cpython-311.pyc +0 -0
  310. package/src/scripts/tests/__pycache__/test_resolve_customization.cpython-311.pyc +0 -0
  311. package/src/scripts/tests/test_config_utils.py +0 -85
  312. package/src/scripts/tests/test_memlog.py +0 -306
  313. package/src/scripts/tests/test_resolve_config.py +0 -117
  314. package/src/scripts/tests/test_resolve_customization.py +0 -179
  315. package/tools/bundle-web-bundles.js +0 -117
  316. package/tools/format-workflow-md.js +0 -263
  317. package/tools/installer/README.md +0 -60
  318. package/tools/installer/bmad-cli.js +0 -105
  319. package/tools/installer/cli-utils.js +0 -57
  320. package/tools/installer/commands/install.js +0 -151
  321. package/tools/installer/commands/status.js +0 -65
  322. package/tools/installer/commands/uninstall.js +0 -167
  323. package/tools/installer/core/config.js +0 -76
  324. package/tools/installer/core/existing-install.js +0 -121
  325. package/tools/installer/core/install-paths.js +0 -132
  326. package/tools/installer/core/installer.js +0 -1826
  327. package/tools/installer/core/legacy-warnings.js +0 -151
  328. package/tools/installer/core/manifest-generator.js +0 -883
  329. package/tools/installer/core/manifest.js +0 -439
  330. package/tools/installer/core/shim-policy.js +0 -159
  331. package/tools/installer/core/uv-check.js +0 -195
  332. package/tools/installer/core/wsl-node-check.js +0 -109
  333. package/tools/installer/file-ops.js +0 -204
  334. package/tools/installer/fs-native.js +0 -116
  335. package/tools/installer/ide/_config-driven.js +0 -972
  336. package/tools/installer/ide/manager.js +0 -324
  337. package/tools/installer/ide/platform-codes.js +0 -80
  338. package/tools/installer/ide/platform-codes.yaml +0 -363
  339. package/tools/installer/ide/shared/installed-skills.js +0 -50
  340. package/tools/installer/ide/shared/path-utils.js +0 -219
  341. package/tools/installer/ide/shared/skill-manifest.js +0 -57
  342. package/tools/installer/install-messages.yaml +0 -44
  343. package/tools/installer/list-options.js +0 -210
  344. package/tools/installer/message-loader.js +0 -83
  345. package/tools/installer/modules/channel-plan.js +0 -216
  346. package/tools/installer/modules/channel-resolver.js +0 -241
  347. package/tools/installer/modules/custom-module-manager.js +0 -924
  348. package/tools/installer/modules/external-manager.js +0 -673
  349. package/tools/installer/modules/git-env.js +0 -47
  350. package/tools/installer/modules/module-help-schema.js +0 -13
  351. package/tools/installer/modules/official-modules.js +0 -2289
  352. package/tools/installer/modules/plugin-resolver.js +0 -398
  353. package/tools/installer/modules/version-resolver.js +0 -336
  354. package/tools/installer/project-root.js +0 -224
  355. package/tools/installer/prompts.js +0 -804
  356. package/tools/installer/set-overrides.js +0 -330
  357. package/tools/installer/ui.js +0 -2262
  358. package/tools/installer/yaml-format.js +0 -245
  359. package/tools/javascript-conventions.md +0 -5
  360. package/tools/migrate-custom-module-paths.js +0 -124
  361. package/tools/skill-validator.md +0 -312
  362. package/tools/tests/__pycache__/test_validate_skills.cpython-311.pyc +0 -0
  363. package/tools/tests/fixtures/validate-skills/bmad/SKILL.md +0 -8
  364. package/tools/tests/fixtures/validate-skills/deprecated-shim/SKILL.md +0 -9
  365. package/tools/tests/fixtures/validate-skills/missing-trigger/SKILL.md +0 -9
  366. package/tools/tests/fixtures/validate-skills/with-trigger/SKILL.md +0 -8
  367. package/tools/tests/test_validate_skills.py +0 -476
  368. package/tools/validate-published-implementation-model.mjs +0 -59
  369. package/tools/validate-sidebar-order.js +0 -388
  370. package/tools/validate-svg-changes.sh +0 -356
  371. package/tools/validate_skills.py +0 -698
  372. package/web-bundles/README.md +0 -46
  373. package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +0 -86
  374. package/web-bundles/brainstorming-coach/SKILL.md +0 -83
  375. package/web-bundles/brainstorming-coach/brain-methods.csv +0 -62
  376. package/web-bundles/bundles.json +0 -139
  377. package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +0 -88
  378. package/web-bundles/market-and-industry-research/SKILL.md +0 -59
  379. package/web-bundles/prd-coach/INSTRUCTIONS.md +0 -86
  380. package/web-bundles/prd-coach/SKILL.md +0 -101
  381. package/web-bundles/prd-coach/prd-template.md +0 -165
  382. package/web-bundles/prd-coach/prd-validation-checklist.md +0 -135
  383. package/web-bundles/prfaq-coach/INSTRUCTIONS.md +0 -86
  384. package/web-bundles/prfaq-coach/SKILL.md +0 -139
  385. package/web-bundles/product-brief-coach/INSTRUCTIONS.md +0 -86
  386. package/web-bundles/product-brief-coach/SKILL.md +0 -113
  387. package/web-bundles/ux-coach/INSTRUCTIONS.md +0 -92
  388. package/web-bundles/ux-coach/SKILL.md +0 -187
  389. package/web-bundles/ux-coach/ux-validation.md +0 -100
package/src/prompts.js ADDED
@@ -0,0 +1,626 @@
1
+ import { stripVTControlCharacters, styleText } from 'node:util'
2
+ import { MultiSelectPrompt } from '@clack/core'
3
+ import {
4
+ MULTISELECT_INSTRUCTIONS,
5
+ S_BAR,
6
+ S_CHECKBOX_ACTIVE,
7
+ S_CHECKBOX_INACTIVE,
8
+ S_CHECKBOX_SELECTED,
9
+ autocompleteMultiselect,
10
+ box,
11
+ cancel,
12
+ confirm as confirmPrompt,
13
+ formatInstructionFooter,
14
+ intro,
15
+ isCancel,
16
+ limitOptions,
17
+ log,
18
+ note,
19
+ outro,
20
+ select,
21
+ spinner,
22
+ symbol,
23
+ symbolBar,
24
+ text,
25
+ unicodeOr,
26
+ } from '@clack/prompts'
27
+ import { UNIVERSAL_AGENT } from './agents.js'
28
+ import { message } from './messages.js'
29
+ import { stripBrandPrefix } from './report.js'
30
+
31
+ const WIDE_LOGO_COLUMNS = 116
32
+ const NARROW_LOGO_COLUMNS = 78
33
+ const BA_SPLIT_COLUMN = 11
34
+ const POINTER_ACTIVE = unicodeOr('›', '>')
35
+
36
+ const TILE_COBALT = /** @type {const} */ ([29, 55, 122])
37
+ const LOGO_WHITE = /** @type {const} */ ([255, 255, 255])
38
+ const ACCENT_PERIWINKLE = /** @type {const} */ ([147, 180, 255])
39
+ const BOX_SLATE = /** @type {const} */ ([56, 67, 87])
40
+
41
+ /** @typedef {readonly [number, number, number]} Rgb */
42
+ /** @typedef {Parameters<typeof styleText>[0]} StyleFormat */
43
+ /** @typedef {'none' | 'ansi' | 'truecolor'} ColorLevel */
44
+ /** @typedef {import('node:stream').Writable & { columns?: number, hasColors?: (count?: number) => boolean }} PromptOutput */
45
+ /** @typedef {import('node:stream').Readable} PromptInput */
46
+ /** @typedef {import('./agents.js').Agent} Agent */
47
+ /** @typedef {import('./modules.js').ModuleDefinition} ModuleDefinition */
48
+ /** @typedef {{ value: string, label: string, hint: string }} PickerOption */
49
+ /** @typedef {PickerOption & { tag: string, requires: string[] }} ModulePickerOption */
50
+ /** @typedef {{ options: PickerOption[], initialValues: string[] }} Picker */
51
+ /** @typedef {{ options: ModulePickerOption[], initialValues: string[], initialNotice: string }} ModulePicker */
52
+
53
+ export class Cancelled extends Error {
54
+ name = 'Cancelled'
55
+ }
56
+
57
+ /**
58
+ * @template T
59
+ * @param {T} value
60
+ * @returns {Exclude<T, symbol>}
61
+ */
62
+ function ensure(value) {
63
+ if (isCancel(value)) throw new Cancelled()
64
+ return /** @type {Exclude<T, symbol>} */ (/** @type {unknown} */ (value))
65
+ }
66
+
67
+ /**
68
+ * Resolves colour capability from env overrides first, then the target output stream.
69
+ * @param {PromptOutput} [output]
70
+ * @returns {ColorLevel}
71
+ */
72
+ export function colorLevel(output = process.stdout) {
73
+ const { FORCE_COLOR, NO_COLOR, NODE_DISABLE_COLORS, COLORTERM } = process.env
74
+ if (FORCE_COLOR !== undefined) {
75
+ if (FORCE_COLOR === '0' || FORCE_COLOR === 'false') return 'none'
76
+ if (FORCE_COLOR === '3') return 'truecolor'
77
+ return COLORTERM === 'truecolor' || COLORTERM === '24bit' ? 'truecolor' : 'ansi'
78
+ }
79
+ if ((NO_COLOR !== undefined && NO_COLOR !== '') || (NODE_DISABLE_COLORS !== undefined && NODE_DISABLE_COLORS !== '')) {
80
+ return 'none'
81
+ }
82
+ if (typeof output.hasColors === 'function') {
83
+ if (output.hasColors(2 ** 24)) return 'truecolor'
84
+ if (output.hasColors()) return 'ansi'
85
+ return 'none'
86
+ }
87
+ return 'none'
88
+ }
89
+
90
+ /**
91
+ * @param {StyleFormat} fmt
92
+ * @param {string} str
93
+ * @param {PromptOutput} [output]
94
+ */
95
+ function tone(fmt, str, output = process.stdout) {
96
+ return colorLevel(output) === 'none' ? str : styleText(fmt, str, { validateStream: false })
97
+ }
98
+
99
+ /**
100
+ * 24-bit TrueColor styling on truecolor streams, falling back to 16-colour ANSI on older terminals
101
+ * and plain text when colour is disabled (`NO_COLOR`, `FORCE_COLOR=0`, or non-TTY streams).
102
+ * @param {string} str
103
+ * @param {{ fg?: Rgb, bg?: Rgb, bold?: boolean, fallback?: StyleFormat }} codes
104
+ * @param {PromptOutput} [output]
105
+ */
106
+ function paint(str, { fg, bg, bold = false, fallback }, output = process.stdout) {
107
+ const level = colorLevel(output)
108
+ if (level === 'none') return str
109
+ if (level === 'ansi') {
110
+ const fmt = fallback ?? (bold ? 'bold' : undefined)
111
+ return fmt ? styleText(fmt, str, { validateStream: false }) : str
112
+ }
113
+ const open = [
114
+ ...(bold ? ['1'] : []),
115
+ ...(fg ? [`38;2;${fg[0]};${fg[1]};${fg[2]}`] : []),
116
+ ...(bg ? [`48;2;${bg[0]};${bg[1]};${bg[2]}`] : []),
117
+ ]
118
+ const close = [
119
+ ...(bold ? ['22'] : []),
120
+ ...(fg ? ['39'] : []),
121
+ ...(bg ? ['49'] : []),
122
+ ]
123
+ return open.length > 0 ? `\x1b[${open.join(';')}m${str}\x1b[${close.join(';')}m` : str
124
+ }
125
+
126
+ /**
127
+ * Word-wraps a plain line to `maxWidth` columns so narrow guide-rail fallbacks keep the rail intact.
128
+ * @param {string} line
129
+ * @param {number} maxWidth
130
+ * @returns {string[]}
131
+ */
132
+ function wrapPlain(line, maxWidth) {
133
+ const words = line.split(' ')
134
+ /** @type {string[]} */
135
+ const out = []
136
+ let current = ''
137
+ for (const word of words) {
138
+ if (!current) current = word
139
+ else if ([...current].length + 1 + [...word].length <= maxWidth) current = `${current} ${word}`
140
+ else {
141
+ out.push(current)
142
+ current = word
143
+ }
144
+ }
145
+ if (current || out.length === 0) out.push(current)
146
+ return out
147
+ }
148
+
149
+ /**
150
+ * @param {Record<string, any>} messages
151
+ * @param {PromptOutput} [output]
152
+ */
153
+ export function showIntro(messages, output = process.stdout) {
154
+ const columns = output.columns || 80
155
+ if (columns >= NARROW_LOGO_COLUMNS) showLogo(messages, columns, output)
156
+ intro(
157
+ paint(` ${message(messages, 'title')} `, { fg: LOGO_WHITE, bg: TILE_COBALT, bold: true, fallback: ['bgBlue', 'whiteBright', 'bold'] }, output),
158
+ { output },
159
+ )
160
+ if (columns < NARROW_LOGO_COLUMNS) {
161
+ const maxWidth = Math.max(20, columns - 3)
162
+ const eyebrowLines = wrapPlain(message(messages, 'eyebrow'), maxWidth)
163
+ .map((line) => paint(line, { fg: ACCENT_PERIWINKLE, fallback: 'cyan' }, output))
164
+ const introLines = message(messages, 'intro')
165
+ .split('\n')
166
+ .flatMap((line) => wrapPlain(line, maxWidth))
167
+ const creditLines = wrapPlain(message(messages, 'credit'), maxWidth)
168
+ .map((line) => tone('dim', line, output))
169
+ log.message([...eyebrowLines, ...introLines, ...creditLines].join('\n'), { output })
170
+ }
171
+ }
172
+
173
+ /**
174
+ * @param {Record<string, any>} messages
175
+ * @param {number} columns
176
+ * @param {PromptOutput} output
177
+ */
178
+ function showLogo(messages, columns, output) {
179
+ const markLines = message(messages, 'logoMark').split('\n')
180
+ const markWidth = Math.max(...markLines.map((line) => [...line].length))
181
+ const tileWidth = markWidth + 2
182
+ const blankTile = ' '.repeat(tileWidth)
183
+ const tile = [
184
+ { plain: blankTile, styled: paint(blankTile, { bg: TILE_COBALT, fallback: 'bgBlue' }, output) },
185
+ ...markLines.map((line) => {
186
+ const padded = [...`${line}${' '.repeat(markWidth - [...line].length)}`]
187
+ const leftBa = ` ${padded.slice(0, BA_SPLIT_COLUMN).join('')}`
188
+ const rightMd = `${padded.slice(BA_SPLIT_COLUMN).join('')} `
189
+ return {
190
+ plain: `${leftBa}${rightMd}`,
191
+ styled:
192
+ paint(leftBa, { fg: LOGO_WHITE, bg: TILE_COBALT, fallback: ['bgBlue', 'whiteBright'] }, output) +
193
+ paint(rightMd, { fg: ACCENT_PERIWINKLE, bg: TILE_COBALT, fallback: ['bgBlue', 'cyanBright'] }, output),
194
+ }
195
+ }),
196
+ { plain: blankTile, styled: paint(blankTile, { bg: TILE_COBALT, fallback: 'bgBlue' }, output) },
197
+ ]
198
+
199
+ const eyebrow = message(messages, 'eyebrow')
200
+ const introLines = message(messages, 'intro').split('\n')
201
+ const credit = message(messages, 'credit')
202
+ const copyRows = [
203
+ { plain: eyebrow, styled: paint(eyebrow, { fg: ACCENT_PERIWINKLE, fallback: 'cyan' }, output) },
204
+ ...introLines.map((line) => ({ plain: line, styled: line })),
205
+ { plain: '', styled: '' },
206
+ { plain: credit, styled: tone('dim', credit, output) },
207
+ ]
208
+
209
+ const wide = columns >= WIDE_LOGO_COLUMNS
210
+ /** @type {{ plain: string, styled: string }[]} */
211
+ let rows
212
+ if (wide) {
213
+ const wordmark = message(messages, 'logoWide').split('\n')
214
+ const rightRows = [
215
+ ...wordmark.map((line) => ({
216
+ plain: line,
217
+ styled: paint(line, { fg: LOGO_WHITE, bold: true, fallback: ['whiteBright', 'bold'] }, output),
218
+ })),
219
+ { plain: '', styled: '' },
220
+ ...copyRows,
221
+ ]
222
+ const count = Math.max(tile.length, rightRows.length)
223
+ rows = Array.from({ length: count }, (_, i) => {
224
+ const left = tile[i] ?? { plain: blankTile, styled: blankTile }
225
+ const right = rightRows[i] ?? { plain: '', styled: '' }
226
+ return right.plain
227
+ ? { plain: `${left.plain} ${right.plain}`, styled: `${left.styled} ${right.styled}` }
228
+ : left
229
+ })
230
+ } else {
231
+ const narrowWordmark = message(messages, 'logoNarrow').split('\n')
232
+ const count = Math.max(tile.length, narrowWordmark.length)
233
+ const topRows = Array.from({ length: count }, (_, i) => {
234
+ const left = tile[i] ?? { plain: blankTile, styled: blankTile }
235
+ const word = narrowWordmark[i] ?? ''
236
+ return word
237
+ ? {
238
+ plain: `${left.plain} ${word}`,
239
+ styled: `${left.styled} ${paint(word, { fg: LOGO_WHITE, bold: true, fallback: ['whiteBright', 'bold'] }, output)}`,
240
+ }
241
+ : left
242
+ })
243
+ rows = [...topRows, { plain: '', styled: '' }, ...copyRows]
244
+ }
245
+
246
+ let width = Math.max(...rows.map((row) => [...row.plain].length))
247
+ if (width % 2 !== 0) width += 1
248
+ const body = ['', ...rows.map((row) => row.styled + ' '.repeat(width - [...row.plain].length)), ''].join('\n')
249
+ box(body, '', {
250
+ contentAlign: 'center',
251
+ contentPadding: wide ? 3 : 2,
252
+ width: 'auto',
253
+ rounded: true,
254
+ withGuide: false,
255
+ formatBorder: (border) => paint(border, { fg: BOX_SLATE, fallback: 'gray' }, output),
256
+ output,
257
+ })
258
+ }
259
+
260
+ /**
261
+ * Renders a Clack note box. When `accentAfterBlank` is set (used by the closing install/update
262
+ * summary), the block after the blank separator line is highlighted without dimming other notes.
263
+ * @param {string} body
264
+ * @param {string} [title]
265
+ * @param {{ accentAfterBlank?: boolean, output?: PromptOutput }} [options]
266
+ */
267
+ export function showNote(body, title, options) {
268
+ const output = options?.output ?? process.stdout
269
+ let content = body
270
+ if (options?.accentAfterBlank) {
271
+ let afterBlank = false
272
+ content = body
273
+ .split('\n')
274
+ .map((line) => {
275
+ if (line === '') {
276
+ afterBlank = true
277
+ return ''
278
+ }
279
+ return afterBlank && line
280
+ ? paint(line, { fg: ACCENT_PERIWINKLE, bold: true, fallback: ['cyan', 'bold'] }, output)
281
+ : line
282
+ })
283
+ .join('\n')
284
+ }
285
+ note(content, title, { output })
286
+ }
287
+
288
+ /** @param {string} text */
289
+ export function say(text) {
290
+ log.info(text)
291
+ }
292
+
293
+ /**
294
+ * Plain lines on the guide bar, with no icon.
295
+ * @param {string} text
296
+ */
297
+ export function plain(text) {
298
+ log.message(text)
299
+ }
300
+
301
+ /** @param {string} text */
302
+ export function warn(text) {
303
+ log.warn(text)
304
+ }
305
+
306
+ /**
307
+ * `cancel` puts the guide prefix in front of the first line only, and most stops here are
308
+ * several lines, so the lines go through `log.error` and `cancel` just closes the guide.
309
+ * @param {string} text
310
+ */
311
+ export function fail(text) {
312
+ log.error(text)
313
+ cancel()
314
+ }
315
+
316
+ /**
317
+ * Stopping clears the line: the report that follows says what happened. One spinner can carry
318
+ * several steps with `update`, so a run leaves one blank line, not one per step.
319
+ * @param {string} text
320
+ * @returns {{ stop(): void, update(text: string): void }}
321
+ */
322
+ export function startSpinner(text) {
323
+ const active = spinner()
324
+ active.start(text)
325
+ return { stop: () => active.clear(), update: (next) => active.message(next) }
326
+ }
327
+
328
+ /**
329
+ * @param {Record<string, any>} messages
330
+ * @param {string} defaultDir
331
+ * @returns {Promise<string>}
332
+ */
333
+ export async function askDirectory(messages, defaultDir) {
334
+ const answer = ensure(await text({
335
+ message: message(messages, 'directoryPrompt'),
336
+ placeholder: defaultDir,
337
+ defaultValue: defaultDir,
338
+ }))
339
+ return answer.trim() === '' ? defaultDir : answer.trim()
340
+ }
341
+
342
+ /**
343
+ * @param {string} question
344
+ * @param {boolean} [initial]
345
+ * @returns {Promise<boolean>}
346
+ */
347
+ export async function confirm(question, initial = true) {
348
+ return ensure(await confirmPrompt({ message: question, initialValue: initial }))
349
+ }
350
+
351
+ /**
352
+ * @param {string} code
353
+ * @param {Map<string, ModulePickerOption>} byCode
354
+ * @returns {string[]}
355
+ */
356
+ function dependenciesOf(code, byCode) {
357
+ /** @type {Set<string>} */
358
+ const seen = new Set()
359
+ const queue = [...(byCode.get(code)?.requires ?? [])]
360
+ while (queue.length > 0) {
361
+ const next = queue.shift()
362
+ if (!next || seen.has(next) || !byCode.has(next)) continue
363
+ seen.add(next)
364
+ queue.push(...(byCode.get(next)?.requires ?? []))
365
+ }
366
+ return [...seen]
367
+ }
368
+
369
+ /**
370
+ * Maps each required module code to the display names of currently selected modules that depend on it.
371
+ * @param {readonly string[]} selected
372
+ * @param {readonly ModulePickerOption[]} shown
373
+ * @returns {Map<string, string[]>}
374
+ */
375
+ export function requiredByNames(selected, shown) {
376
+ const byCode = new Map(shown.map((opt) => [opt.value, opt]))
377
+ /** @type {Map<string, string[]>} */
378
+ const map = new Map()
379
+ for (const code of selected) {
380
+ const owner = byCode.get(code)
381
+ if (!owner) continue
382
+ for (const dep of dependenciesOf(code, byCode)) {
383
+ const list = map.get(dep) ?? []
384
+ list.push(owner.label)
385
+ map.set(dep, list)
386
+ }
387
+ }
388
+ return map
389
+ }
390
+
391
+ /**
392
+ * Keeps module dependencies selected as the user toggles checkboxes: ticking a module auto-selects
393
+ * what it requires, and trying to untick a required module while its dependent stays ticked keeps
394
+ * it selected with an inline explanation.
395
+ * @param {readonly string[]} previous
396
+ * @param {readonly string[]} next
397
+ * @param {readonly ModulePickerOption[]} shown
398
+ * @param {Record<string, any>} messages
399
+ * @returns {{ values: string[], notice: string }}
400
+ */
401
+ export function reconcileModuleSelection(previous, next, shown, messages) {
402
+ const prevSet = new Set(previous)
403
+ const nextSet = new Set(next)
404
+ const byCode = new Map(shown.map((opt) => [opt.value, opt]))
405
+ let notice = ''
406
+
407
+ for (const opt of shown) {
408
+ if (!prevSet.has(opt.value) || nextSet.has(opt.value)) continue
409
+ const dependents = shown.filter(
410
+ (other) => nextSet.has(other.value) && prevSet.has(other.value) && dependenciesOf(other.value, byCode).includes(opt.value),
411
+ )
412
+ if (dependents.length > 0) {
413
+ nextSet.add(opt.value)
414
+ notice = message(messages, 'moduleLockedBy', {
415
+ module: opt.label,
416
+ by: dependents.map((dep) => dep.label).join(', '),
417
+ })
418
+ }
419
+ }
420
+
421
+ /** @type {Set<string>} */
422
+ const missing = new Set()
423
+ for (const opt of shown) {
424
+ if (!nextSet.has(opt.value)) continue
425
+ for (const dep of dependenciesOf(opt.value, byCode)) {
426
+ if (!nextSet.has(dep)) missing.add(dep)
427
+ }
428
+ }
429
+ if (missing.size > 0) {
430
+ for (const dep of missing) nextSet.add(dep)
431
+ const pulled = shown.filter((opt) => missing.has(opt.value)).map((opt) => opt.label)
432
+ const triggers = shown
433
+ .filter((opt) => !missing.has(opt.value) && nextSet.has(opt.value) && dependenciesOf(opt.value, byCode).some((dep) => missing.has(dep)))
434
+ .map((opt) => opt.label)
435
+ notice = message(messages, 'moduleAutoSelected', {
436
+ modules: pulled.join(', '),
437
+ by: triggers.join(', '),
438
+ })
439
+ }
440
+
441
+ return {
442
+ values: shown.filter((opt) => nextSet.has(opt.value)).map((opt) => opt.value),
443
+ notice,
444
+ }
445
+ }
446
+
447
+ /**
448
+ * @param {Record<string, any>} messages
449
+ * @param {ModuleDefinition[]} modules
450
+ * @param {{ installedCodes: string[], installedVersions: Record<string, string> }} options
451
+ * @returns {ModulePicker}
452
+ */
453
+ export function modulePicker(messages, modules, options) {
454
+ const { installedCodes, installedVersions } = options
455
+ const fresh = installedCodes.length === 0
456
+ const shown = modules.filter((module) => !module.always)
457
+ const pickerOptions = shown.map((module) => {
458
+ const installed = installedCodes.includes(module.code)
459
+ const version = installedVersions[module.code]
460
+ const tag = installed
461
+ ? (version ? message(messages, 'installedVersionTag', { version }) : message(messages, 'installedTagNoVersion'))
462
+ : ''
463
+ return {
464
+ value: module.code,
465
+ label: module.name,
466
+ tag,
467
+ hint: module.description,
468
+ requires: module.requires ?? [],
469
+ }
470
+ })
471
+ const rawInitial = shown
472
+ .filter((module) => [module.code, ...(module.aliases ?? [])].some((code) => installedCodes.includes(code)) || (fresh && module.default))
473
+ .map((module) => module.code)
474
+ const reconciled = reconcileModuleSelection([], rawInitial, pickerOptions, messages)
475
+ return {
476
+ options: pickerOptions,
477
+ initialValues: reconciled.values,
478
+ initialNotice: reconciled.notice,
479
+ }
480
+ }
481
+
482
+ /**
483
+ * @param {Record<string, any>} messages
484
+ * @param {ModuleDefinition[]} modules
485
+ * @param {{ installedCodes: string[], installedVersions: Record<string, string> }} options
486
+ * @param {{ input?: PromptInput, output?: PromptOutput }} [io]
487
+ * @returns {Promise<string[]>}
488
+ */
489
+ export async function chooseModules(messages, modules, options, io) {
490
+ const input = io?.input ?? process.stdin
491
+ const output = io?.output ?? process.stdout
492
+ const picker = modulePicker(messages, modules, options)
493
+ const nameWidth = Math.max(...picker.options.map((opt) => opt.label.length)) + 2
494
+ const maxTag = Math.max(0, ...picker.options.map((opt) => opt.tag.length))
495
+ const tagWidth = maxTag > 0 ? maxTag + 2 : 0
496
+ const title = message(messages, 'modulesPrompt')
497
+
498
+ let previous = [...picker.initialValues]
499
+ let notice = picker.initialNotice
500
+
501
+ const prompt = new MultiSelectPrompt({
502
+ options: picker.options,
503
+ initialValues: picker.initialValues,
504
+ input,
505
+ output,
506
+ render() {
507
+ const selected = this.value ?? []
508
+ const header = `${tone('gray', S_BAR, output)}\n${symbol(this.state)} ${title}\n`
509
+ if (this.state === 'submit') {
510
+ const picked = this.options
511
+ .filter((opt) => selected.includes(opt.value))
512
+ .map((opt) => tone('dim', opt.label, output))
513
+ .join(tone('dim', ', ', output)) || tone('dim', message(messages, 'modulesNone'), output)
514
+ return `${header}${tone('gray', S_BAR, output)} ${picked}`
515
+ }
516
+ if (this.state === 'cancel') {
517
+ const cancelled = this.options
518
+ .filter((opt) => selected.includes(opt.value))
519
+ .map((opt) => tone(['strikethrough', 'dim'], opt.label, output))
520
+ .join(tone('dim', ', ', output))
521
+ return cancelled
522
+ ? `${header}${tone('gray', S_BAR, output)} ${cancelled}\n${tone('gray', S_BAR, output)}`
523
+ : `${header}${tone('gray', S_BAR, output)}`
524
+ }
525
+
526
+ const reqMap = requiredByNames(selected, this.options)
527
+ const bar = `${symbolBar(this.state) ?? tone('cyan', S_BAR, output)} `
528
+ const footerLines = formatInstructionFooter(output, MULTISELECT_INSTRUCTIONS, true)
529
+ const rows = limitOptions({
530
+ output,
531
+ options: this.options,
532
+ cursor: this.cursor,
533
+ columnPadding: stripVTControlCharacters(bar).length,
534
+ rowPadding: header.split('\n').length + footerLines.length + (notice ? 2 : 1),
535
+ style: (opt, active) => {
536
+ const pointer = active ? paint(POINTER_ACTIVE, { fg: ACCENT_PERIWINKLE, fallback: 'cyan' }, output) : ' '
537
+ const ticked = selected.includes(opt.value)
538
+ const check = ticked
539
+ ? tone('green', S_CHECKBOX_SELECTED, output)
540
+ : active
541
+ ? tone('cyan', S_CHECKBOX_ACTIVE, output)
542
+ : tone('dim', S_CHECKBOX_INACTIVE, output)
543
+ const paddedName = opt.label.padEnd(nameWidth)
544
+ const name = active ? paddedName : ticked ? tone('white', paddedName, output) : tone('dim', paddedName, output)
545
+ const tag = tagWidth > 0 ? paint(opt.tag.padEnd(tagWidth), { fg: ACCENT_PERIWINKLE, fallback: 'cyan' }, output) : ''
546
+ const desc = tone('dim', opt.hint, output)
547
+ const owners = reqMap.get(opt.value) ?? []
548
+ const reqBadge = owners.length > 0
549
+ ? ` ${tone('yellow', message(messages, 'moduleRequiredTag', { by: owners.map(stripBrandPrefix).join(', ') }), output)}`
550
+ : ''
551
+ return `${pointer} ${check} ${name}${tag}${desc}${reqBadge}`
552
+ },
553
+ })
554
+ const noticeLine = notice ? `\n${bar}${tone('yellow', message(messages, 'moduleNotice', { notice }), output)}` : ''
555
+ return `${header}${bar}${rows.join(`\n${bar}`)}${noticeLine}\n${footerLines.join('\n')}\n`
556
+ },
557
+ })
558
+
559
+ prompt.on('key', () => {
560
+ const next = reconcileModuleSelection(previous, prompt.value ?? [], picker.options, messages)
561
+ prompt.value = next.values
562
+ previous = [...next.values]
563
+ notice = next.notice
564
+ })
565
+
566
+ return ensure(await prompt.prompt()) ?? []
567
+ }
568
+
569
+ /**
570
+ * Every agent under its own name; the skills CLI writes `.agents/skills` once however many of the
571
+ * agents that share it are picked. Preselected agents come first, then the rest by name.
572
+ * Nothing is marked as installed: an agent's config folder often outlives the agent.
573
+ * @param {Agent[]} agents
574
+ * @param {{ initial: string[] }} options
575
+ * @returns {Picker}
576
+ */
577
+ export function agentPicker(agents, options) {
578
+ const listed = agents
579
+ .filter((agent) => agent.id !== UNIVERSAL_AGENT)
580
+ .sort((a, b) => a.name.localeCompare(b.name, 'en', { sensitivity: 'base' }))
581
+ const ordered = [
582
+ ...listed.filter((agent) => options.initial.includes(agent.id)),
583
+ ...listed.filter((agent) => !options.initial.includes(agent.id)),
584
+ ]
585
+ return {
586
+ options: ordered.map((agent) => ({ value: agent.id, label: agent.name, hint: agent.skillsDir })),
587
+ initialValues: options.initial,
588
+ }
589
+ }
590
+
591
+ /**
592
+ * @param {Record<string, any>} messages
593
+ * @param {Agent[]} agents
594
+ * @param {{ initial: string[] }} options
595
+ * @returns {Promise<string[]>}
596
+ */
597
+ export async function chooseAgents(messages, agents, options) {
598
+ const picker = agentPicker(agents, options)
599
+ const search = Object.fromEntries(agents.map((agent) => [agent.id, `${agent.id} ${agent.name}`.toLowerCase()]))
600
+ return ensure(await autocompleteMultiselect({
601
+ message: message(messages, 'agentsPrompt'),
602
+ placeholder: message(messages, 'agentsPlaceholder'),
603
+ ...picker,
604
+ filter: (query, option) => (search[option.value] ?? '').includes(query.trim().toLowerCase()),
605
+ maxItems: 12,
606
+ required: true,
607
+ }))
608
+ }
609
+
610
+ /**
611
+ * @param {Record<string, any>} messages
612
+ * @returns {Promise<'modify' | 'update'>}
613
+ */
614
+ export async function chooseExistingAction(messages) {
615
+ /** @type {Array<{ value: 'modify' | 'update', label: string }>} */
616
+ const options = [
617
+ { value: 'modify', label: message(messages, 'existingInstallModify') },
618
+ { value: 'update', label: message(messages, 'existingInstallUpdate') },
619
+ ]
620
+ return ensure(await select({ message: message(messages, 'existingInstallPrompt'), options }))
621
+ }
622
+
623
+ /** @param {string} text */
624
+ export function finish(text) {
625
+ outro(text)
626
+ }