bmad-method 6.12.3 → 7.0.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 (388) 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 +260 -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 +54 -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 +124 -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/removals.txt +0 -87
  43. package/src/bmm-skills/agents/bmad-agent-analyst/SKILL.md +0 -76
  44. package/src/bmm-skills/agents/bmad-agent-analyst/customize.toml +0 -103
  45. package/src/bmm-skills/agents/bmad-agent-architect/SKILL.md +0 -76
  46. package/src/bmm-skills/agents/bmad-agent-architect/customize.toml +0 -63
  47. package/src/bmm-skills/agents/bmad-agent-dev/SKILL.md +0 -76
  48. package/src/bmm-skills/agents/bmad-agent-dev/customize.toml +0 -81
  49. package/src/bmm-skills/agents/bmad-agent-pm/SKILL.md +0 -76
  50. package/src/bmm-skills/agents/bmad-agent-pm/customize.toml +0 -73
  51. package/src/bmm-skills/agents/bmad-agent-ux-designer/SKILL.md +0 -76
  52. package/src/bmm-skills/agents/bmad-agent-ux-designer/customize.toml +0 -58
  53. package/src/bmm-skills/module-help.csv +0 -19
  54. package/src/bmm-skills/module.yaml +0 -85
  55. package/src/bmm-skills/plan/bmad-architecture/SKILL.md +0 -85
  56. package/src/bmm-skills/plan/bmad-architecture/assets/spine-template.md +0 -79
  57. package/src/bmm-skills/plan/bmad-architecture/customize.toml +0 -101
  58. package/src/bmm-skills/plan/bmad-architecture/references/headless.md +0 -26
  59. package/src/bmm-skills/plan/bmad-architecture/references/reviewer-gate.md +0 -13
  60. package/src/bmm-skills/plan/bmad-architecture/scripts/lint_spine.py +0 -261
  61. package/src/bmm-skills/plan/bmad-architecture/scripts/tests/test_lint_spine.py +0 -270
  62. package/src/bmm-skills/plan/bmad-create-epics-and-stories/SKILL.md +0 -93
  63. package/src/bmm-skills/plan/bmad-create-epics-and-stories/customize.toml +0 -39
  64. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -263
  65. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-02-design-epics.md +0 -242
  66. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-03-create-stories.md +0 -255
  67. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-04-final-validation.md +0 -141
  68. package/src/bmm-skills/plan/bmad-create-epics-and-stories/templates/epics-template.md +0 -62
  69. package/src/bmm-skills/plan/bmad-generate-project-context/SKILL.md +0 -12
  70. package/src/bmm-skills/plan/bmad-prd/SKILL.md +0 -94
  71. package/src/bmm-skills/plan/bmad-prd/assets/headless-schemas.md +0 -76
  72. package/src/bmm-skills/plan/bmad-prd/assets/prd-template.md +0 -165
  73. package/src/bmm-skills/plan/bmad-prd/assets/prd-validation-checklist.md +0 -135
  74. package/src/bmm-skills/plan/bmad-prd/assets/validation-report-template.html +0 -325
  75. package/src/bmm-skills/plan/bmad-prd/customize.toml +0 -148
  76. package/src/bmm-skills/plan/bmad-prd/references/headless.md +0 -39
  77. package/src/bmm-skills/plan/bmad-prd/references/validate.md +0 -97
  78. package/src/bmm-skills/plan/bmad-prfaq/SKILL.md +0 -135
  79. package/src/bmm-skills/plan/bmad-prfaq/agents/artifact-analyzer.md +0 -60
  80. package/src/bmm-skills/plan/bmad-prfaq/agents/web-researcher.md +0 -49
  81. package/src/bmm-skills/plan/bmad-prfaq/assets/prfaq-template.md +0 -62
  82. package/src/bmm-skills/plan/bmad-prfaq/bmad-manifest.json +0 -16
  83. package/src/bmm-skills/plan/bmad-prfaq/customize.toml +0 -39
  84. package/src/bmm-skills/plan/bmad-prfaq/references/customer-faq.md +0 -55
  85. package/src/bmm-skills/plan/bmad-prfaq/references/internal-faq.md +0 -51
  86. package/src/bmm-skills/plan/bmad-prfaq/references/press-release.md +0 -60
  87. package/src/bmm-skills/plan/bmad-prfaq/references/verdict.md +0 -83
  88. package/src/bmm-skills/plan/bmad-product-brief/SKILL.md +0 -91
  89. package/src/bmm-skills/plan/bmad-product-brief/assets/brief-template.md +0 -41
  90. package/src/bmm-skills/plan/bmad-product-brief/customize.toml +0 -100
  91. package/src/bmm-skills/plan/bmad-project-context/SKILL.md +0 -121
  92. package/src/bmm-skills/plan/bmad-project-context/customize.toml +0 -24
  93. package/src/bmm-skills/plan/bmad-project-context/references/best-practices.md +0 -84
  94. package/src/bmm-skills/plan/bmad-project-context/references/template.md +0 -55
  95. package/src/bmm-skills/plan/bmad-spec/SKILL.md +0 -160
  96. package/src/bmm-skills/plan/bmad-spec/assets/headless-schemas.md +0 -33
  97. package/src/bmm-skills/plan/bmad-spec/assets/spec-template.md +0 -49
  98. package/src/bmm-skills/plan/bmad-spec/assets/stories-schema.md +0 -44
  99. package/src/bmm-skills/plan/bmad-spec/customize.toml +0 -52
  100. package/src/bmm-skills/plan/bmad-sprint-planning/SKILL.md +0 -62
  101. package/src/bmm-skills/plan/bmad-sprint-planning/customize.toml +0 -39
  102. package/src/bmm-skills/plan/bmad-sprint-planning/references/fix-sprint-status.md +0 -30
  103. package/src/bmm-skills/plan/bmad-sprint-planning/references/generate-tracking.md +0 -25
  104. package/src/bmm-skills/plan/bmad-sprint-planning/references/readiness-gate.md +0 -20
  105. package/src/bmm-skills/plan/bmad-sprint-planning/references/status-view.md +0 -14
  106. package/src/bmm-skills/plan/bmad-sprint-planning/references/validate.md +0 -10
  107. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/__pycache__/sprint_plan.cpython-311.pyc +0 -0
  108. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/sprint_plan.py +0 -701
  109. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/__pycache__/test_sprint_plan.cpython-311-pytest-9.1.1.pyc +0 -0
  110. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/test_sprint_plan.py +0 -524
  111. package/src/bmm-skills/plan/bmad-sprint-planning/sprint-status-template.yaml +0 -71
  112. package/src/bmm-skills/plan/bmad-ux/SKILL.md +0 -90
  113. package/src/bmm-skills/plan/bmad-ux/assets/color-themes.md +0 -9
  114. package/src/bmm-skills/plan/bmad-ux/assets/design-directions.md +0 -9
  115. package/src/bmm-skills/plan/bmad-ux/assets/design-example-editorial.md +0 -158
  116. package/src/bmm-skills/plan/bmad-ux/assets/design-example-mobile.md +0 -93
  117. package/src/bmm-skills/plan/bmad-ux/assets/design-example-shadcn.md +0 -109
  118. package/src/bmm-skills/plan/bmad-ux/assets/excalidraw-wireframe.md +0 -19
  119. package/src/bmm-skills/plan/bmad-ux/assets/experience-example-mobile.md +0 -112
  120. package/src/bmm-skills/plan/bmad-ux/assets/experience-example-shadcn.md +0 -133
  121. package/src/bmm-skills/plan/bmad-ux/assets/headless-schemas.md +0 -84
  122. package/src/bmm-skills/plan/bmad-ux/assets/key-screens.md +0 -29
  123. package/src/bmm-skills/plan/bmad-ux/assets/validation-report-template.html +0 -319
  124. package/src/bmm-skills/plan/bmad-ux/customize.toml +0 -100
  125. package/src/bmm-skills/plan/bmad-ux/references/creative-tools.md +0 -19
  126. package/src/bmm-skills/plan/bmad-ux/references/design-md-spec.md +0 -50
  127. package/src/bmm-skills/plan/bmad-ux/references/headless.md +0 -37
  128. package/src/bmm-skills/plan/bmad-ux/references/validate.md +0 -115
  129. package/src/bmm-skills/ship/bmad-build/SKILL.md +0 -13
  130. package/src/bmm-skills/ship/bmad-build/compile-epic-context.md +0 -62
  131. package/src/bmm-skills/ship/bmad-build/customize.toml +0 -152
  132. package/src/bmm-skills/ship/bmad-build/references/claims-check.md +0 -14
  133. package/src/bmm-skills/ship/bmad-build/references/deletion-check.md +0 -14
  134. package/src/bmm-skills/ship/bmad-build/review-prompts/edge-case-hunter.md +0 -112
  135. package/src/bmm-skills/ship/bmad-build/review-prompts/verification-gap.md +0 -113
  136. package/src/bmm-skills/ship/bmad-build/spec-template.md +0 -111
  137. package/src/bmm-skills/ship/bmad-build/step-01-clarify-and-route.md +0 -100
  138. package/src/bmm-skills/ship/bmad-build/step-02-plan.md +0 -62
  139. package/src/bmm-skills/ship/bmad-build/step-03-implement.md +0 -51
  140. package/src/bmm-skills/ship/bmad-build/step-04-review.md +0 -85
  141. package/src/bmm-skills/ship/bmad-build/step-05-present.md +0 -43
  142. package/src/bmm-skills/ship/bmad-build/step-oneshot.md +0 -107
  143. package/src/bmm-skills/ship/bmad-build/sync-sprint-status.md +0 -5
  144. package/src/bmm-skills/ship/bmad-build/workflow.md +0 -84
  145. package/src/bmm-skills/ship/bmad-build-auto/SKILL.md +0 -13
  146. package/src/bmm-skills/ship/bmad-build-auto/compile-epic-context.md +0 -62
  147. package/src/bmm-skills/ship/bmad-build-auto/customize.toml +0 -119
  148. package/src/bmm-skills/ship/bmad-build-auto/references/claims-check.md +0 -14
  149. package/src/bmm-skills/ship/bmad-build-auto/references/deletion-check.md +0 -14
  150. package/src/bmm-skills/ship/bmad-build-auto/review-prompts/edge-case-hunter.md +0 -112
  151. package/src/bmm-skills/ship/bmad-build-auto/review-prompts/verification-gap.md +0 -113
  152. package/src/bmm-skills/ship/bmad-build-auto/spec-template.md +0 -96
  153. package/src/bmm-skills/ship/bmad-build-auto/step-01-clarify-and-route.md +0 -84
  154. package/src/bmm-skills/ship/bmad-build-auto/step-02-plan.md +0 -27
  155. package/src/bmm-skills/ship/bmad-build-auto/step-03-implement.md +0 -48
  156. package/src/bmm-skills/ship/bmad-build-auto/step-04-review.md +0 -116
  157. package/src/bmm-skills/ship/bmad-build-auto/workflow.md +0 -104
  158. package/src/bmm-skills/ship/bmad-code-review/SKILL.md +0 -90
  159. package/src/bmm-skills/ship/bmad-code-review/customize.toml +0 -110
  160. package/src/bmm-skills/ship/bmad-code-review/references/claims-check.md +0 -14
  161. package/src/bmm-skills/ship/bmad-code-review/references/deletion-check.md +0 -14
  162. package/src/bmm-skills/ship/bmad-code-review/review-prompts/edge-case-hunter.md +0 -112
  163. package/src/bmm-skills/ship/bmad-code-review/review-prompts/verification-gap.md +0 -113
  164. package/src/bmm-skills/ship/bmad-code-review/steps/step-01-gather-context.md +0 -94
  165. package/src/bmm-skills/ship/bmad-code-review/steps/step-02-review.md +0 -32
  166. package/src/bmm-skills/ship/bmad-code-review/steps/step-03-triage.md +0 -54
  167. package/src/bmm-skills/ship/bmad-code-review/steps/step-04-present.md +0 -134
  168. package/src/bmm-skills/ship/bmad-correct-course/SKILL.md +0 -308
  169. package/src/bmm-skills/ship/bmad-correct-course/checklist.md +0 -288
  170. package/src/bmm-skills/ship/bmad-correct-course/customize.toml +0 -39
  171. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/SKILL.md +0 -176
  172. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/checklist.md +0 -33
  173. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/customize.toml +0 -39
  174. package/src/bmm-skills/ship/bmad-retrospective/SKILL.md +0 -94
  175. package/src/bmm-skills/ship/bmad-retrospective/customize.toml +0 -39
  176. package/src/bmm-skills/ship/bmad-retrospective/references/acceptance-verdict.md +0 -55
  177. package/src/bmm-skills/ship/bmad-retrospective/references/aggregate-views.md +0 -17
  178. package/src/bmm-skills/ship/bmad-retrospective/references/evidence-gathering.md +0 -30
  179. package/src/bmm-skills/ship/bmad-retrospective/references/retro-document.md +0 -84
  180. package/src/bmm-skills/ship/bmad-retrospective/references/team-discussion.md +0 -22
  181. package/src/bmm-skills/ship/bmad-retrospective/scripts/__pycache__/sprint_status.cpython-311.pyc +0 -0
  182. package/src/bmm-skills/ship/bmad-retrospective/scripts/git_evidence.py +0 -308
  183. package/src/bmm-skills/ship/bmad-retrospective/scripts/sprint_status.py +0 -750
  184. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_git_evidence.cpython-311-pytest-9.1.1.pyc +0 -0
  185. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_sprint_status.cpython-311-pytest-9.1.1.pyc +0 -0
  186. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/fixtures/sprint-status-template.yaml +0 -71
  187. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_git_evidence.py +0 -750
  188. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_sprint_status.py +0 -1579
  189. package/src/bmm-skills/ship/bmad-walkthrough/SKILL.md +0 -68
  190. package/src/bmm-skills/ship/bmad-walkthrough/customize.toml +0 -39
  191. package/src/bmm-skills/ship/bmad-walkthrough/generate-trail.md +0 -38
  192. package/src/bmm-skills/ship/bmad-walkthrough/step-01-orientation.md +0 -105
  193. package/src/bmm-skills/ship/bmad-walkthrough/step-02-walkthrough.md +0 -89
  194. package/src/bmm-skills/ship/bmad-walkthrough/step-03-detail-pass.md +0 -106
  195. package/src/bmm-skills/ship/bmad-walkthrough/step-04-testing.md +0 -74
  196. package/src/bmm-skills/ship/bmad-walkthrough/step-05-wrapup.md +0 -30
  197. package/src/bmm-skills/v6-shims/README.md +0 -29
  198. package/src/bmm-skills/v6-shims/bmad-checkpoint-preview/SKILL.md +0 -21
  199. package/src/bmm-skills/v6-shims/bmad-create-architecture/SKILL.md +0 -32
  200. package/src/bmm-skills/v6-shims/bmad-create-architecture/customize.toml +0 -39
  201. package/src/bmm-skills/v6-shims/bmad-create-prd/SKILL.md +0 -32
  202. package/src/bmm-skills/v6-shims/bmad-create-prd/customize.toml +0 -39
  203. package/src/bmm-skills/v6-shims/bmad-create-story/SKILL.md +0 -436
  204. package/src/bmm-skills/v6-shims/bmad-create-story/checklist.md +0 -357
  205. package/src/bmm-skills/v6-shims/bmad-create-story/customize.toml +0 -39
  206. package/src/bmm-skills/v6-shims/bmad-create-story/discover-inputs.md +0 -88
  207. package/src/bmm-skills/v6-shims/bmad-create-story/template.md +0 -49
  208. package/src/bmm-skills/v6-shims/bmad-dev-auto/SKILL.md +0 -21
  209. package/src/bmm-skills/v6-shims/bmad-dev-story/SKILL.md +0 -504
  210. package/src/bmm-skills/v6-shims/bmad-dev-story/checklist.md +0 -80
  211. package/src/bmm-skills/v6-shims/bmad-dev-story/customize.toml +0 -39
  212. package/src/bmm-skills/v6-shims/bmad-document-project/SKILL.md +0 -16
  213. package/src/bmm-skills/v6-shims/bmad-domain-research/SKILL.md +0 -16
  214. package/src/bmm-skills/v6-shims/bmad-edit-prd/SKILL.md +0 -32
  215. package/src/bmm-skills/v6-shims/bmad-edit-prd/customize.toml +0 -40
  216. package/src/bmm-skills/v6-shims/bmad-market-research/SKILL.md +0 -16
  217. package/src/bmm-skills/v6-shims/bmad-quick-dev/SKILL.md +0 -21
  218. package/src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md +0 -28
  219. package/src/bmm-skills/v6-shims/bmad-sprint-status/customize.toml +0 -39
  220. package/src/bmm-skills/v6-shims/bmad-technical-research/SKILL.md +0 -16
  221. package/src/bmm-skills/v6-shims/bmad-validate-prd/SKILL.md +0 -32
  222. package/src/bmm-skills/v6-shims/bmad-validate-prd/customize.toml +0 -40
  223. package/src/core-skills/bmad-advanced-elicitation/SKILL.md +0 -64
  224. package/src/core-skills/bmad-advanced-elicitation/assets/methods.csv +0 -72
  225. package/src/core-skills/bmad-advanced-elicitation/customize.toml +0 -54
  226. package/src/core-skills/bmad-advanced-elicitation/scripts/pick_methods.py +0 -233
  227. package/src/core-skills/bmad-advanced-elicitation/scripts/tests/test_pick_methods.py +0 -228
  228. package/src/core-skills/bmad-brainstorming/SKILL.md +0 -80
  229. package/src/core-skills/bmad-brainstorming/assets/brain-icons.json +0 -166
  230. package/src/core-skills/bmad-brainstorming/assets/brain-methods.csv +0 -109
  231. package/src/core-skills/bmad-brainstorming/assets/brain-selector.html +0 -328
  232. package/src/core-skills/bmad-brainstorming/customize.toml +0 -83
  233. package/src/core-skills/bmad-brainstorming/references/converge.md +0 -24
  234. package/src/core-skills/bmad-brainstorming/references/finalize.md +0 -26
  235. package/src/core-skills/bmad-brainstorming/references/headless.md +0 -54
  236. package/src/core-skills/bmad-brainstorming/references/in-chat-techniques.md +0 -18
  237. package/src/core-skills/bmad-brainstorming/references/mode-autonomous.md +0 -10
  238. package/src/core-skills/bmad-brainstorming/references/mode-facilitator.md +0 -11
  239. package/src/core-skills/bmad-brainstorming/references/mode-partner.md +0 -16
  240. package/src/core-skills/bmad-brainstorming/references/resume.md +0 -5
  241. package/src/core-skills/bmad-brainstorming/scripts/brain.py +0 -789
  242. package/src/core-skills/bmad-brainstorming/scripts/tests/test_brain.py +0 -289
  243. package/src/core-skills/bmad-customize/SKILL.md +0 -111
  244. package/src/core-skills/bmad-customize/scripts/list_customizable_skills.py +0 -235
  245. package/src/core-skills/bmad-customize/scripts/tests/test_list_customizable_skills.py +0 -249
  246. package/src/core-skills/bmad-deep-recon/SKILL.md +0 -82
  247. package/src/core-skills/bmad-deep-recon/assets/research.template.md +0 -18
  248. package/src/core-skills/bmad-deep-recon/customize.toml +0 -212
  249. package/src/core-skills/bmad-deep-recon/references/draft.md +0 -8
  250. package/src/core-skills/bmad-deep-recon/references/finalize.md +0 -11
  251. package/src/core-skills/bmad-deep-recon/references/html-briefing.md +0 -16
  252. package/src/core-skills/bmad-deep-recon/references/lifecycle.md +0 -11
  253. package/src/core-skills/bmad-deep-recon/references/process.md +0 -10
  254. package/src/core-skills/bmad-deep-recon/references/run.md +0 -73
  255. package/src/core-skills/bmad-deep-recon/references/selection.md +0 -13
  256. package/src/core-skills/bmad-deep-recon/references/synthesis.md +0 -16
  257. package/src/core-skills/bmad-deep-recon/references/verification.md +0 -29
  258. package/src/core-skills/bmad-deep-recon/scripts/recon_kit.py +0 -326
  259. package/src/core-skills/bmad-deep-recon/scripts/tests/test_recon_kit.py +0 -144
  260. package/src/core-skills/bmad-deep-recon/types/academic-lit.md +0 -19
  261. package/src/core-skills/bmad-deep-recon/types/competitive.md +0 -19
  262. package/src/core-skills/bmad-deep-recon/types/domain.md +0 -19
  263. package/src/core-skills/bmad-deep-recon/types/market.md +0 -19
  264. package/src/core-skills/bmad-deep-recon/types/technical.md +0 -19
  265. package/src/core-skills/bmad-deep-recon/types/user-voice.md +0 -19
  266. package/src/core-skills/bmad-forge-idea/SKILL.md +0 -107
  267. package/src/core-skills/bmad-forge-idea/customize.toml +0 -41
  268. package/src/core-skills/bmad-forge-idea/scripts/resolve_personas.py +0 -277
  269. package/src/core-skills/bmad-forge-idea/scripts/tests/test_resolve_personas.py +0 -160
  270. package/src/core-skills/bmad-help/SKILL.md +0 -77
  271. package/src/core-skills/bmad-party-mode/SKILL.md +0 -60
  272. package/src/core-skills/bmad-party-mode/customize.toml +0 -211
  273. package/src/core-skills/bmad-party-mode/references/create-party.md +0 -70
  274. package/src/core-skills/bmad-party-mode/references/mode-agent-team.md +0 -13
  275. package/src/core-skills/bmad-party-mode/references/mode-auto.md +0 -13
  276. package/src/core-skills/bmad-party-mode/references/mode-subagent.md +0 -31
  277. package/src/core-skills/bmad-party-mode/references/party-memory.md +0 -51
  278. package/src/core-skills/bmad-party-mode/scripts/resolve_party.py +0 -300
  279. package/src/core-skills/bmad-party-mode/scripts/tests/test_resolve_party.py +0 -183
  280. package/src/core-skills/bmad-review/SKILL.md +0 -50
  281. package/src/core-skills/bmad-review/customize.toml +0 -141
  282. package/src/core-skills/bmad-review/references/editorial-common.md +0 -56
  283. package/src/core-skills/bmad-review/references/lens-adversarial.md +0 -19
  284. package/src/core-skills/bmad-review/references/lens-edge-case-hunter.md +0 -72
  285. package/src/core-skills/bmad-review/references/lens-prose.md +0 -7
  286. package/src/core-skills/bmad-review/references/lens-structure.md +0 -9
  287. package/src/core-skills/bmad-review/references/lens-verification-gap.md +0 -92
  288. package/src/core-skills/bmad-review/references/structure-models.md +0 -44
  289. package/src/core-skills/bmad-review/scripts/tests/test_word_metrics.py +0 -62
  290. package/src/core-skills/bmad-review/scripts/word_metrics.py +0 -102
  291. package/src/core-skills/module-help.csv +0 -10
  292. package/src/core-skills/module.yaml +0 -38
  293. package/src/core-skills/v6-shims/README.md +0 -25
  294. package/src/core-skills/v6-shims/bmad-editorial-review/SKILL.md +0 -8
  295. package/src/core-skills/v6-shims/bmad-editorial-review/customize.toml +0 -31
  296. package/src/core-skills/v6-shims/bmad-editorial-review-prose/SKILL.md +0 -8
  297. package/src/core-skills/v6-shims/bmad-editorial-review-structure/SKILL.md +0 -8
  298. package/src/core-skills/v6-shims/bmad-review-adversarial-general/SKILL.md +0 -8
  299. package/src/core-skills/v6-shims/bmad-review-edge-case-hunter/SKILL.md +0 -8
  300. package/src/core-skills/v6-shims/bmad-review-verification-gap/SKILL.md +0 -8
  301. package/src/scripts/__pycache__/config_utils.cpython-311.pyc +0 -0
  302. package/src/scripts/config_utils.py +0 -119
  303. package/src/scripts/memlog.py +0 -228
  304. package/src/scripts/render_skill.py +0 -401
  305. package/src/scripts/resolve_config.py +0 -82
  306. package/src/scripts/resolve_customization.py +0 -164
  307. package/src/scripts/tests/__pycache__/test_config_utils.cpython-311.pyc +0 -0
  308. package/src/scripts/tests/__pycache__/test_resolve_config.cpython-311.pyc +0 -0
  309. package/src/scripts/tests/__pycache__/test_resolve_customization.cpython-311.pyc +0 -0
  310. package/src/scripts/tests/test_config_utils.py +0 -85
  311. package/src/scripts/tests/test_memlog.py +0 -306
  312. package/src/scripts/tests/test_resolve_config.py +0 -117
  313. package/src/scripts/tests/test_resolve_customization.py +0 -179
  314. package/tools/bundle-web-bundles.js +0 -117
  315. package/tools/format-workflow-md.js +0 -263
  316. package/tools/installer/README.md +0 -60
  317. package/tools/installer/bmad-cli.js +0 -105
  318. package/tools/installer/cli-utils.js +0 -57
  319. package/tools/installer/commands/install.js +0 -151
  320. package/tools/installer/commands/status.js +0 -65
  321. package/tools/installer/commands/uninstall.js +0 -167
  322. package/tools/installer/core/config.js +0 -76
  323. package/tools/installer/core/existing-install.js +0 -121
  324. package/tools/installer/core/install-paths.js +0 -132
  325. package/tools/installer/core/installer.js +0 -1826
  326. package/tools/installer/core/legacy-warnings.js +0 -151
  327. package/tools/installer/core/manifest-generator.js +0 -883
  328. package/tools/installer/core/manifest.js +0 -439
  329. package/tools/installer/core/shim-policy.js +0 -159
  330. package/tools/installer/core/uv-check.js +0 -195
  331. package/tools/installer/core/wsl-node-check.js +0 -109
  332. package/tools/installer/file-ops.js +0 -204
  333. package/tools/installer/fs-native.js +0 -116
  334. package/tools/installer/ide/_config-driven.js +0 -972
  335. package/tools/installer/ide/manager.js +0 -324
  336. package/tools/installer/ide/platform-codes.js +0 -80
  337. package/tools/installer/ide/platform-codes.yaml +0 -363
  338. package/tools/installer/ide/shared/installed-skills.js +0 -50
  339. package/tools/installer/ide/shared/path-utils.js +0 -219
  340. package/tools/installer/ide/shared/skill-manifest.js +0 -57
  341. package/tools/installer/install-messages.yaml +0 -44
  342. package/tools/installer/list-options.js +0 -210
  343. package/tools/installer/message-loader.js +0 -83
  344. package/tools/installer/modules/channel-plan.js +0 -216
  345. package/tools/installer/modules/channel-resolver.js +0 -241
  346. package/tools/installer/modules/custom-module-manager.js +0 -924
  347. package/tools/installer/modules/external-manager.js +0 -673
  348. package/tools/installer/modules/git-env.js +0 -47
  349. package/tools/installer/modules/module-help-schema.js +0 -13
  350. package/tools/installer/modules/official-modules.js +0 -2289
  351. package/tools/installer/modules/plugin-resolver.js +0 -398
  352. package/tools/installer/modules/version-resolver.js +0 -336
  353. package/tools/installer/project-root.js +0 -224
  354. package/tools/installer/prompts.js +0 -804
  355. package/tools/installer/set-overrides.js +0 -330
  356. package/tools/installer/ui.js +0 -2225
  357. package/tools/installer/yaml-format.js +0 -245
  358. package/tools/javascript-conventions.md +0 -5
  359. package/tools/migrate-custom-module-paths.js +0 -124
  360. package/tools/skill-validator.md +0 -312
  361. package/tools/tests/__pycache__/test_validate_skills.cpython-311.pyc +0 -0
  362. package/tools/tests/fixtures/validate-skills/bmad/SKILL.md +0 -8
  363. package/tools/tests/fixtures/validate-skills/deprecated-shim/SKILL.md +0 -9
  364. package/tools/tests/fixtures/validate-skills/missing-trigger/SKILL.md +0 -9
  365. package/tools/tests/fixtures/validate-skills/with-trigger/SKILL.md +0 -8
  366. package/tools/tests/test_validate_skills.py +0 -476
  367. package/tools/validate-published-implementation-model.mjs +0 -59
  368. package/tools/validate-sidebar-order.js +0 -388
  369. package/tools/validate-svg-changes.sh +0 -356
  370. package/tools/validate_skills.py +0 -698
  371. package/web-bundles/README.md +0 -46
  372. package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +0 -86
  373. package/web-bundles/brainstorming-coach/SKILL.md +0 -83
  374. package/web-bundles/brainstorming-coach/brain-methods.csv +0 -62
  375. package/web-bundles/bundles.json +0 -139
  376. package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +0 -88
  377. package/web-bundles/market-and-industry-research/SKILL.md +0 -59
  378. package/web-bundles/prd-coach/INSTRUCTIONS.md +0 -86
  379. package/web-bundles/prd-coach/SKILL.md +0 -101
  380. package/web-bundles/prd-coach/prd-template.md +0 -165
  381. package/web-bundles/prd-coach/prd-validation-checklist.md +0 -135
  382. package/web-bundles/prfaq-coach/INSTRUCTIONS.md +0 -86
  383. package/web-bundles/prfaq-coach/SKILL.md +0 -139
  384. package/web-bundles/product-brief-coach/INSTRUCTIONS.md +0 -86
  385. package/web-bundles/product-brief-coach/SKILL.md +0 -113
  386. package/web-bundles/ux-coach/INSTRUCTIONS.md +0 -92
  387. package/web-bundles/ux-coach/SKILL.md +0 -187
  388. package/web-bundles/ux-coach/ux-validation.md +0 -100
@@ -1,44 +0,0 @@
1
- # BMAD Installer Messages
2
- # These messages are displayed during installation
3
- # Edit this file to change what users see during the install process
4
-
5
- # Display at the START of installation (after logo, before prompts)
6
- startMessage: |
7
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8
-
9
- The Breakthrough Method of Agile AI-Driven Development - the original and best AI SDLC. Powered by BMad Core and a growing module ecosystem.
10
- Install official and community modules during setup to customize your experience.
11
-
12
- 🌟 100% free. 100% open source. Always.
13
- No paywalls. No gated content. Knowledge shared, not sold.
14
-
15
- 🚀 BMad v7 is close, and you can preview and test it now:
16
- npx skills add bmad-code-org/BMAD-METHOD
17
- then ask your agent for `bmad setup`. After setup, `bmad migrate`
18
- tests the v6 to v7 migration (still in beta).
19
-
20
- 🐍 REQUIRED: uv (https://docs.astral.sh/uv/) runs the Python scripts BMAD
21
- skills rely on. If it's not set up yet, ask your AI agent to "install and set up uv for me".
22
-
23
- 🌐 CONNECT:
24
- Website: https://bmadcode.com/
25
- Discord: https://discord.gg/gk8jAdXWmj
26
- YouTube: https://www.youtube.com/@BMadCode
27
- X: https://x.com/BMadCode
28
- Facebook: https://facebook.com/@BMadCode
29
-
30
- ⭐ SUPPORT THE PROJECT:
31
- Star us: https://github.com/bmad-code-org/BMAD-METHOD/
32
- Donate: https://buymeacoffee.com/bmad
33
- Corporate sponsorship and speaking inquiries: contact@bmadcode.com
34
-
35
- Docs, blog, and latest updates: https://bmadcode.com/
36
-
37
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
-
39
- # Display at the END of installation (after the install summary)
40
- endMessage: |
41
- 🚀 BMad v7 is close, and you can preview and test it now:
42
- npx skills add bmad-code-org/BMAD-METHOD
43
- then ask your agent for `bmad setup`. After setup, `bmad migrate`
44
- tests the v6 to v7 migration (still in beta).
@@ -1,210 +0,0 @@
1
- const path = require('node:path');
2
- const fs = require('./fs-native');
3
- const yaml = require('yaml');
4
- const { getProjectRoot, getModulePath, getExternalModuleCachePath } = require('./project-root');
5
-
6
- /**
7
- * Read a module.yaml and return its declared `code:` field, or null if missing/unparseable.
8
- */
9
- async function readModuleCode(yamlPath) {
10
- try {
11
- const parsed = yaml.parse(await fs.readFile(yamlPath, 'utf8'));
12
- if (parsed && typeof parsed === 'object' && typeof parsed.code === 'string') {
13
- return parsed.code;
14
- }
15
- } catch {
16
- // fall through
17
- }
18
- return null;
19
- }
20
-
21
- /**
22
- * Discover module.yaml files for officials we can read locally:
23
- * - core, bmm: bundled in src/ (always present)
24
- * - external officials: only if previously cloned to ~/.bmad/cache/external-modules/
25
- *
26
- * Each result's `code` is the `code:` field from the module.yaml when present;
27
- * that's the value `--set <module>.<key>=<value>` matches against.
28
- *
29
- * Community/custom modules are not enumerated; users reference their own
30
- * module.yaml directly per the design (see issue #1663).
31
- *
32
- * @returns {Promise<Array<{code: string, yamlPath: string, source: string}>>}
33
- */
34
- async function discoverOfficialModuleYamls() {
35
- const found = [];
36
- // Dedupe is case-insensitive because module caches occasionally retain a
37
- // legacy UPPERCASE-named directory alongside the canonical lowercase one
38
- // (same module, different cache key from an older schema). We pick whichever
39
- // entry we see first and skip the alternate-case duplicate. NOTE: `--set`
40
- // matching itself is case-sensitive (it keys on `moduleName` from the install
41
- // flow's selected list, which is always lowercase short codes), so the
42
- // surfaced `code` here is what users should type. Don't change to
43
- // case-sensitive dedupe without revisiting that contract.
44
- const seenCodes = new Set();
45
-
46
- const addFound = async (yamlPath, source, fallbackCode) => {
47
- const declaredCode = await readModuleCode(yamlPath);
48
- const code = declaredCode || fallbackCode;
49
- if (!code) return;
50
- const lower = code.toLowerCase();
51
- if (seenCodes.has(lower)) return;
52
- seenCodes.add(lower);
53
- found.push({ code, yamlPath, source });
54
- };
55
-
56
- // Built-ins.
57
- for (const code of ['core', 'bmm']) {
58
- const yamlPath = path.join(getModulePath(code), 'module.yaml');
59
- if (await fs.pathExists(yamlPath)) {
60
- // Built-ins use their well-known short codes regardless of what the
61
- // module.yaml `code:` says, since the install flow keys on these.
62
- seenCodes.add(code.toLowerCase());
63
- found.push({ code, yamlPath, source: 'built-in' });
64
- }
65
- }
66
-
67
- // Bundled in src/modules/<code>/module.yaml (rare, but supported by getModulePath).
68
- const srcModulesDir = path.join(getProjectRoot(), 'src', 'modules');
69
- if (await fs.pathExists(srcModulesDir)) {
70
- const entries = await fs.readdir(srcModulesDir, { withFileTypes: true });
71
- for (const entry of entries) {
72
- if (!entry.isDirectory()) continue;
73
- const yamlPath = path.join(srcModulesDir, entry.name, 'module.yaml');
74
- if (await fs.pathExists(yamlPath)) {
75
- await addFound(yamlPath, 'bundled', entry.name);
76
- }
77
- }
78
- }
79
-
80
- // External cache (~/.bmad/cache/external-modules/<code>/...).
81
- const cacheRoot = getExternalModuleCachePath('').replace(/\/$/, '');
82
- if (await fs.pathExists(cacheRoot)) {
83
- const rawEntries = await fs.readdir(cacheRoot, { withFileTypes: true });
84
- for (const entry of rawEntries) {
85
- if (!entry.isDirectory()) continue;
86
- const candidates = [
87
- path.join(cacheRoot, entry.name, 'module.yaml'),
88
- path.join(cacheRoot, entry.name, 'src', 'module.yaml'),
89
- path.join(cacheRoot, entry.name, 'skills', 'module.yaml'),
90
- ];
91
- for (const candidate of candidates) {
92
- if (await fs.pathExists(candidate)) {
93
- await addFound(candidate, 'cached', entry.name);
94
- break;
95
- }
96
- }
97
- }
98
- }
99
-
100
- return found;
101
- }
102
-
103
- function formatPromptText(item) {
104
- if (Array.isArray(item.prompt)) return item.prompt.join(' ');
105
- return String(item.prompt || '').trim();
106
- }
107
-
108
- function inferType(item) {
109
- if (item['single-select']) return 'single-select';
110
- if (item['multi-select']) return 'multi-select';
111
- if (typeof item.default === 'boolean') return 'boolean';
112
- if (typeof item.default === 'number') return 'number';
113
- return 'string';
114
- }
115
-
116
- function formatModuleOptions(code, parsed, source) {
117
- const lines = [];
118
- const header = source === 'built-in' ? code : `${code} (${source})`;
119
- lines.push(header + ':');
120
-
121
- let count = 0;
122
- for (const [key, item] of Object.entries(parsed)) {
123
- if (!item || typeof item !== 'object' || !('prompt' in item)) continue;
124
- count++;
125
- const type = inferType(item);
126
- const scope = item.scope === 'user' ? ' [user-scope]' : '';
127
- const defaultStr = item.default === undefined || item.default === null ? '(none)' : String(item.default);
128
- lines.push(` ${code}.${key} (${type}${scope}) default: ${defaultStr}`);
129
- const promptText = formatPromptText(item);
130
- if (promptText) lines.push(` ${promptText}`);
131
- if (Array.isArray(item['single-select'])) {
132
- const values = item['single-select'].map((v) => (typeof v === 'object' ? v.value : v)).filter((v) => v !== undefined);
133
- if (values.length > 0) lines.push(` values: ${values.join(' | ')}`);
134
- }
135
- lines.push('');
136
- }
137
-
138
- if (count === 0) {
139
- lines.push(' (no configurable options)', '');
140
- }
141
- return lines.join('\n');
142
- }
143
-
144
- /**
145
- * Render `--list-options` output.
146
- *
147
- * Returns `{ text, ok }` so callers can surface a non-zero exit code on
148
- * a typo'd module-code lookup. Discovery dedupes case-insensitively, so
149
- * the lookup is also case-insensitive — typing `--list-options BMM` and
150
- * `--list-options bmm` both find the bmm built-in.
151
- *
152
- * @param {string|null} moduleCode - if non-null, restrict to this module
153
- * @returns {Promise<{text: string, ok: boolean}>}
154
- */
155
- async function formatOptionsList(moduleCode) {
156
- const discovered = await discoverOfficialModuleYamls();
157
- const needle = moduleCode ? moduleCode.toLowerCase() : null;
158
- const filtered = needle ? discovered.filter((d) => d.code.toLowerCase() === needle) : discovered;
159
-
160
- if (filtered.length === 0) {
161
- if (moduleCode) {
162
- const text = [
163
- `No locally-known module.yaml for '${moduleCode}'.`,
164
- '',
165
- 'Built-in modules (core, bmm) are always available. External officials',
166
- 'appear here after they have been installed at least once on this machine',
167
- '(they are cached under ~/.bmad/cache/external-modules/).',
168
- '',
169
- 'For community or custom modules, read the module.yaml file in that',
170
- "module's source repository directly.",
171
- ].join('\n');
172
- return { text, ok: false };
173
- }
174
- return { text: 'No modules found.', ok: false };
175
- }
176
-
177
- const sections = [];
178
- // Track when a module-scoped lookup couldn't actually be rendered (yaml
179
- // unparseable or empty after parse). The full `--list-options` output is
180
- // tolerant of one bad entry, but `--list-options <module>` against a single
181
- // unreadable module should still fail tooling so a CI script catches it.
182
- let moduleScopedFailure = false;
183
- sections.push('Available --set keys', 'Format: --set <module>.<key>=<value> (repeatable)', '');
184
- for (const { code, yamlPath, source } of filtered) {
185
- let parsed;
186
- try {
187
- parsed = yaml.parse(await fs.readFile(yamlPath, 'utf8'));
188
- } catch {
189
- sections.push(`${code} (${source}): could not parse module.yaml`, '');
190
- if (moduleCode) moduleScopedFailure = true;
191
- continue;
192
- }
193
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
194
- sections.push(`${code} (${source}): module.yaml is not a valid object (got ${Array.isArray(parsed) ? 'array' : typeof parsed})`, '');
195
- if (moduleCode) moduleScopedFailure = true;
196
- continue;
197
- }
198
- sections.push(formatModuleOptions(code, parsed, source));
199
- }
200
-
201
- if (!moduleCode) {
202
- sections.push(
203
- 'Community and custom modules are not listed here — read their module.yaml directly. Unknown keys still persist with a warning.',
204
- );
205
- }
206
-
207
- return { text: sections.join('\n'), ok: !moduleScopedFailure };
208
- }
209
-
210
- module.exports = { formatOptionsList, discoverOfficialModuleYamls };
@@ -1,83 +0,0 @@
1
- const fs = require('./fs-native');
2
- const path = require('node:path');
3
- const yaml = require('yaml');
4
- const prompts = require('./prompts');
5
-
6
- /**
7
- * Load and display installer messages from messages.yaml
8
- */
9
- class MessageLoader {
10
- constructor() {}
11
-
12
- /**
13
- * Load messages from the YAML file
14
- * @returns {Object|null} Messages object or null if not found
15
- */
16
- load() {
17
- if (this.messages) {
18
- return this.messages;
19
- }
20
-
21
- const messagesPath = path.join(__dirname, 'install-messages.yaml');
22
-
23
- try {
24
- const content = fs.readFileSync(messagesPath, 'utf8');
25
- this.messages = yaml.parse(content);
26
- return this.messages;
27
- } catch {
28
- // File doesn't exist or is invalid - return null
29
- return null;
30
- }
31
- }
32
-
33
- /**
34
- * Get the start message for display
35
- * @returns {string|null} Start message or null
36
- */
37
- getStartMessage() {
38
- const messages = this.load();
39
- return messages?.startMessage || null;
40
- }
41
-
42
- /**
43
- * Get the end message for display
44
- * @returns {string|null} End message or null
45
- */
46
- getEndMessage() {
47
- const messages = this.load();
48
- return messages?.endMessage || null;
49
- }
50
-
51
- /**
52
- * Display the start message (after logo, before prompts)
53
- */
54
- async displayStartMessage() {
55
- const message = this.getStartMessage();
56
- if (message) {
57
- await prompts.log.info(message);
58
- }
59
- }
60
-
61
- /**
62
- * Display the end message (after installation completes)
63
- */
64
- async displayEndMessage() {
65
- const message = this.getEndMessage();
66
- if (message) {
67
- await prompts.log.info(message);
68
- }
69
- }
70
-
71
- /**
72
- * Check if messages exist for the current version
73
- * @param {string} currentVersion - Current package version
74
- * @returns {boolean} True if messages match current version
75
- */
76
- isCurrent(currentVersion) {
77
- const messages = this.load();
78
- return messages && messages.version === currentVersion;
79
- }
80
- messages = null;
81
- }
82
-
83
- module.exports = { MessageLoader };
@@ -1,216 +0,0 @@
1
- /**
2
- * Channel plan: the per-module resolution decision applied at install time.
3
- *
4
- * A "plan entry" for a module is:
5
- * { channel: 'stable'|'next'|'pinned', pin?: string }
6
- *
7
- * We build the plan from:
8
- * 1. CLI flags (--channel / --all-* / --next=CODE / --pin CODE=TAG)
9
- * 2. Interactive answers (the "all stable?" gate + per-module picker)
10
- * 3. Registry defaults (default_channel from bmad-modules.yaml)
11
- * 4. Hardcoded fallback 'stable'
12
- *
13
- * Precedence: --pin > explicit per-module choice (--next=CODE, picker next/stable) > registry pin
14
- * > --channel (global) > registry default > 'stable'.
15
- *
16
- * This module is pure. No prompts, no git, no filesystem.
17
- */
18
-
19
- const VALID_CHANNELS = new Set(['stable', 'next']);
20
-
21
- /**
22
- * Parse raw commander options into a structured channel options object.
23
- *
24
- * @param {Object} options - raw command-line options
25
- * @returns {{
26
- * global: 'stable'|'next'|null,
27
- * nextSet: Set<string>,
28
- * stableSet: Set<string>,
29
- * pins: Map<string, string>,
30
- * warnings: string[]
31
- * }}
32
- */
33
- function parseChannelOptions(options = {}) {
34
- const warnings = [];
35
-
36
- // Global channel from --channel / --all-stable / --all-next.
37
- let global = null;
38
- const aliases = [];
39
- if (options.channel) aliases.push({ flag: '--channel', value: normalizeChannel(options.channel, warnings, '--channel') });
40
- if (options.allStable) aliases.push({ flag: '--all-stable', value: 'stable' });
41
- if (options.allNext) aliases.push({ flag: '--all-next', value: 'next' });
42
-
43
- const distinct = new Set(aliases.map((a) => a.value).filter(Boolean));
44
- if (distinct.size > 1) {
45
- warnings.push(
46
- `Conflicting channel flags: ${aliases
47
- .filter((a) => a.value)
48
- .map((a) => a.flag + '=' + a.value)
49
- .join(', ')}. Using first: ${aliases.find((a) => a.value).flag}.`,
50
- );
51
- }
52
- const firstValid = aliases.find((a) => a.value);
53
- if (firstValid) global = firstValid.value;
54
-
55
- // --next=CODE (repeatable)
56
- const nextSet = new Set();
57
- for (const code of options.next || []) {
58
- const trimmed = String(code).trim();
59
- if (!trimmed) continue;
60
- nextSet.add(trimmed);
61
- }
62
-
63
- // Filled only by the interactive per-module picker (no CLI flag).
64
- const stableSet = new Set();
65
-
66
- // --pin CODE=TAG (repeatable)
67
- const pins = new Map();
68
- for (const spec of options.pin || []) {
69
- const parsed = parsePinSpec(spec);
70
- if (!parsed) {
71
- warnings.push(`Ignoring malformed --pin value '${spec}'. Expected CODE=TAG.`);
72
- continue;
73
- }
74
- if (pins.has(parsed.code)) {
75
- warnings.push(`--pin specified multiple times for '${parsed.code}'. Using last: ${parsed.tag}.`);
76
- }
77
- pins.set(parsed.code, parsed.tag);
78
- }
79
-
80
- // --yes auto-confirms the community-module curator-bypass prompt so
81
- // headless installs with --next=/--pin for a community module don't hang.
82
- const acceptBypass = options.yes === true || options.acceptBypass === true;
83
-
84
- return { global, nextSet, stableSet, pins, warnings, acceptBypass };
85
- }
86
-
87
- function normalizeChannel(raw, warnings, flagName) {
88
- if (typeof raw !== 'string') return null;
89
- const lower = raw.trim().toLowerCase();
90
- if (VALID_CHANNELS.has(lower)) return lower;
91
- warnings.push(`Ignoring invalid ${flagName} value '${raw}'. Expected one of: stable, next.`);
92
- return null;
93
- }
94
-
95
- function parsePinSpec(spec) {
96
- if (typeof spec !== 'string') return null;
97
- const idx = spec.indexOf('=');
98
- if (idx <= 0 || idx === spec.length - 1) return null;
99
- const code = spec.slice(0, idx).trim();
100
- const tag = spec.slice(idx + 1).trim();
101
- if (!code || !tag) return null;
102
- return { code, tag };
103
- }
104
-
105
- /**
106
- * Build a per-module plan entry, applying precedence.
107
- *
108
- * @param {Object} args
109
- * @param {string} args.code
110
- * @param {Object} args.channelOptions - from parseChannelOptions
111
- * @param {string} [args.registryDefault] - module's default_channel, if any
112
- * @param {string} [args.registryPin] - module's registry pin, if any
113
- * @returns {{channel: 'stable'|'next'|'pinned', pin?: string, source: string}}
114
- * source describes where the decision came from, for logging / debugging.
115
- */
116
- function decideChannelForModule({ code, channelOptions, registryDefault, registryPin }) {
117
- const { global, nextSet, stableSet, pins } = channelOptions || { nextSet: new Set(), stableSet: new Set(), pins: new Map() };
118
-
119
- if (pins && pins.has(code)) {
120
- return { channel: 'pinned', pin: pins.get(code), source: 'flag:--pin' };
121
- }
122
- if (nextSet && nextSet.has(code)) {
123
- return { channel: 'next', source: 'flag:--next' };
124
- }
125
- if (stableSet && stableSet.has(code)) {
126
- return { channel: 'stable', source: 'picker:stable' };
127
- }
128
- if (registryPin) {
129
- return { channel: 'pinned', pin: registryPin, source: 'registry:pin' };
130
- }
131
- if (global) {
132
- return { channel: global, source: 'flag:--channel' };
133
- }
134
- if (registryDefault && VALID_CHANNELS.has(registryDefault)) {
135
- return { channel: registryDefault, source: 'registry' };
136
- }
137
- return { channel: 'stable', source: 'default' };
138
- }
139
-
140
- /**
141
- * Build a full channel plan map for a set of modules.
142
- *
143
- * @param {Object} args
144
- * @param {Array<{code: string, defaultChannel?: string, builtIn?: boolean}>} args.modules
145
- * Only the modules that need a channel entry; callers should filter out
146
- * bundled modules (core/bmm) before calling.
147
- * @param {Object} args.channelOptions - from parseChannelOptions
148
- * @returns {Map<string, {channel: string, pin?: string, source: string}>}
149
- */
150
- function buildPlan({ modules, channelOptions }) {
151
- const plan = new Map();
152
- for (const mod of modules || []) {
153
- plan.set(
154
- mod.code,
155
- decideChannelForModule({
156
- code: mod.code,
157
- channelOptions,
158
- registryDefault: mod.defaultChannel,
159
- registryPin: mod.pin,
160
- }),
161
- );
162
- }
163
- return plan;
164
- }
165
-
166
- /**
167
- * Report any --pin CODE=TAG entries that don't correspond to a selected module.
168
- * These get warned about but don't abort the install.
169
- */
170
- function orphanPinWarnings(channelOptions, selectedCodes) {
171
- const warnings = [];
172
- const selected = new Set(selectedCodes || []);
173
- for (const code of channelOptions?.pins?.keys() || []) {
174
- if (!selected.has(code)) {
175
- warnings.push(`--pin for '${code}' has no effect (module not selected).`);
176
- }
177
- }
178
- for (const code of channelOptions?.nextSet || []) {
179
- if (!selected.has(code)) {
180
- warnings.push(`--next for '${code}' has no effect (module not selected).`);
181
- }
182
- }
183
- return warnings;
184
- }
185
-
186
- /**
187
- * Warn when --pin / --next targets a bundled module (core, bmm). Those are
188
- * shipped inside the installer binary — there's no git clone to override, so
189
- * the flag has no effect. Users who actually want a prerelease core/bmm
190
- * should use `npx bmad-method@next install`.
191
- */
192
- function bundledTargetWarnings(channelOptions, bundledCodes) {
193
- const warnings = [];
194
- const bundled = new Set(bundledCodes || []);
195
- const hint = '(bundled module; use `npx bmad-method@next install` for a prerelease)';
196
- for (const code of channelOptions?.pins?.keys() || []) {
197
- if (bundled.has(code)) {
198
- warnings.push(`--pin for '${code}' has no effect ${hint}.`);
199
- }
200
- }
201
- for (const code of channelOptions?.nextSet || []) {
202
- if (bundled.has(code)) {
203
- warnings.push(`--next for '${code}' has no effect ${hint}.`);
204
- }
205
- }
206
- return warnings;
207
- }
208
-
209
- module.exports = {
210
- parseChannelOptions,
211
- decideChannelForModule,
212
- buildPlan,
213
- orphanPinWarnings,
214
- bundledTargetWarnings,
215
- parsePinSpec,
216
- };