bmad-method 6.12.4 → 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 (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 +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/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
@@ -1,883 +0,0 @@
1
- const path = require('node:path');
2
- const fs = require('../fs-native');
3
- const yaml = require('yaml');
4
- const crypto = require('node:crypto');
5
- const { resolveInstalledModuleYaml } = require('../project-root');
6
- const prompts = require('../prompts');
7
-
8
- // Load package.json for version info
9
- const packageJson = require('../../../package.json');
10
-
11
- /**
12
- * Generates manifest files for installed skills and agents
13
- */
14
- class ManifestGenerator {
15
- constructor() {
16
- this.skills = [];
17
- this.agents = [];
18
- this.modules = [];
19
- this.files = [];
20
- this.selectedIdes = [];
21
- }
22
-
23
- /**
24
- * Clean text for CSV output by normalizing whitespace.
25
- * Note: Quote escaping is handled by escapeCsv() at write time.
26
- * @param {string} text - Text to clean
27
- * @returns {string} Cleaned text
28
- */
29
- cleanForCSV(text) {
30
- if (!text) return '';
31
- return text.trim().replaceAll(/\s+/g, ' '); // Normalize all whitespace (including newlines) to single space
32
- }
33
-
34
- /**
35
- * Generate all manifests for the installation
36
- * @param {string} bmadDir - _bmad
37
- * @param {Array} selectedModules - Selected modules for installation
38
- * @param {Array} installedFiles - All installed files (optional, for hash tracking)
39
- */
40
- async generateManifests(bmadDir, selectedModules, installedFiles = [], options = {}) {
41
- // Create _config directory if it doesn't exist
42
- const cfgDir = path.join(bmadDir, '_config');
43
- await fs.ensureDir(cfgDir);
44
-
45
- // Store modules list (all modules including preserved ones)
46
- const preservedModules = options.preservedModules || [];
47
-
48
- // Scan the bmad directory to find all actually installed modules
49
- const installedModules = await this.scanInstalledModules(bmadDir);
50
-
51
- // Since custom modules are now installed the same way as regular modules,
52
- // we don't need to exclude them from manifest generation
53
- const allModules = [...new Set(['core', ...selectedModules, ...preservedModules, ...installedModules])];
54
-
55
- this.modules = allModules;
56
- this.updatedModules = allModules; // Include ALL modules (including custom) for scanning
57
-
58
- this.bmadDir = bmadDir;
59
- this.bmadFolderName = path.basename(bmadDir); // Get the actual folder name (e.g., '_bmad' or 'bmad')
60
- this.allInstalledFiles = installedFiles;
61
- this.installShims = options.installShims === true;
62
- this.shimsAvailable = options.shimsAvailable === true;
63
-
64
- if (!Object.prototype.hasOwnProperty.call(options, 'ides')) {
65
- throw new Error('ManifestGenerator requires `options.ides` to be provided – installer should supply the selected IDEs array.');
66
- }
67
-
68
- const resolvedIdes = options.ides ?? [];
69
- if (!Array.isArray(resolvedIdes)) {
70
- throw new TypeError('ManifestGenerator expected `options.ides` to be an array.');
71
- }
72
-
73
- // Filter out any undefined/null values from IDE list
74
- this.selectedIdes = resolvedIdes.filter((ide) => ide && typeof ide === 'string');
75
-
76
- // Reset files list (defensive: prevent stale data if instance is reused)
77
- this.files = [];
78
-
79
- // Collect skills first (populates skillClaimedDirs before legacy collectors run)
80
- await this.collectSkills();
81
-
82
- // Collect agent essence from each module's source module.yaml `agents:` array
83
- await this.collectAgentsFromModuleYaml();
84
-
85
- // Write manifest files and collect their paths
86
- const [teamConfigPath, userConfigPath] = await this.writeCentralConfig(bmadDir, options.moduleConfigs || {});
87
- const manifestFiles = [
88
- await this.writeMainManifest(cfgDir),
89
- await this.writeSkillManifest(cfgDir),
90
- teamConfigPath,
91
- userConfigPath,
92
- await this.writeFilesManifest(cfgDir),
93
- ];
94
-
95
- await this.ensureCustomConfigStubs(bmadDir);
96
-
97
- return {
98
- skills: this.skills.length,
99
- agents: this.agents.length,
100
- files: this.files.length,
101
- manifestFiles: manifestFiles,
102
- };
103
- }
104
-
105
- /**
106
- * Recursively walk a module directory tree, collecting native SKILL.md entrypoints.
107
- * A directory is discovered as a skill when it contains a SKILL.md file with
108
- * valid name/description frontmatter (name must match directory name).
109
- * Manifest YAML is loaded only when present — for agent metadata.
110
- * Populates this.skills[] and this.skillClaimedDirs (Set of absolute paths).
111
- */
112
- async collectSkills() {
113
- this.skills = [];
114
- this.skillClaimedDirs = new Set();
115
- const debug = process.env.BMAD_DEBUG_MANIFEST === 'true';
116
-
117
- for (const moduleName of this.updatedModules) {
118
- const modulePath = path.join(this.bmadDir, moduleName);
119
- if (!(await fs.pathExists(modulePath))) continue;
120
-
121
- // Recursive walk skipping . and _ prefixed dirs
122
- const walk = async (dir) => {
123
- let entries;
124
- try {
125
- entries = await fs.readdir(dir, { withFileTypes: true });
126
- } catch {
127
- return;
128
- }
129
-
130
- // SKILL.md with valid frontmatter is the primary discovery gate
131
- const skillFile = 'SKILL.md';
132
- const skillMdPath = path.join(dir, skillFile);
133
- const dirName = path.basename(dir);
134
-
135
- const skillMeta = await this.parseSkillMd(skillMdPath, dir, dirName, debug);
136
-
137
- if (skillMeta) {
138
- // Build path relative from module root (points to SKILL.md — the permanent entrypoint)
139
- const relativePath = path.relative(modulePath, dir).split(path.sep).join('/');
140
- const installPath = relativePath
141
- ? `${this.bmadFolderName}/${moduleName}/${relativePath}/${skillFile}`
142
- : `${this.bmadFolderName}/${moduleName}/${skillFile}`;
143
-
144
- // Native SKILL.md entrypoints always derive canonicalId from directory name.
145
- const canonicalId = dirName;
146
-
147
- this.skills.push({
148
- name: skillMeta.name,
149
- description: this.cleanForCSV(skillMeta.description),
150
- module: moduleName,
151
- path: installPath,
152
- canonicalId,
153
- });
154
-
155
- // Add to files list
156
- this.files.push({
157
- type: 'skill',
158
- name: skillMeta.name,
159
- module: moduleName,
160
- path: installPath,
161
- });
162
-
163
- this.skillClaimedDirs.add(dir);
164
-
165
- if (debug) {
166
- console.log(`[DEBUG] collectSkills: claimed skill "${skillMeta.name}" as ${canonicalId} at ${dir}`);
167
- }
168
- }
169
-
170
- // Recurse into subdirectories — but not inside a discovered skill
171
- if (!skillMeta) {
172
- for (const entry of entries) {
173
- if (!entry.isDirectory()) continue;
174
- if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue;
175
- await walk(path.join(dir, entry.name));
176
- }
177
- }
178
- };
179
-
180
- await walk(modulePath);
181
- }
182
-
183
- if (debug) {
184
- console.log(`[DEBUG] collectSkills: total skills found: ${this.skills.length}, claimed dirs: ${this.skillClaimedDirs.size}`);
185
- }
186
- }
187
-
188
- /**
189
- * Parse and validate SKILL.md for a skill directory.
190
- * Returns parsed frontmatter object with name/description, or null if invalid.
191
- * @param {string} skillMdPath - Absolute path to SKILL.md
192
- * @param {string} dir - Skill directory path (for error messages)
193
- * @param {string} dirName - Expected name (must match frontmatter name)
194
- * @param {boolean} debug - Whether to emit debug-level messages
195
- * @returns {Promise<Object|null>} Parsed frontmatter or null
196
- */
197
- async parseSkillMd(skillMdPath, dir, dirName, debug = false) {
198
- if (!(await fs.pathExists(skillMdPath))) {
199
- if (debug) console.log(`[DEBUG] parseSkillMd: "${dir}" is missing SKILL.md — skipping`);
200
- return null;
201
- }
202
-
203
- try {
204
- const rawContent = await fs.readFile(skillMdPath, 'utf8');
205
- const content = rawContent.replaceAll('\r\n', '\n').replaceAll('\r', '\n');
206
-
207
- const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
208
- if (frontmatterMatch) {
209
- const skillMeta = yaml.parse(frontmatterMatch[1]);
210
-
211
- if (
212
- !skillMeta ||
213
- typeof skillMeta !== 'object' ||
214
- typeof skillMeta.name !== 'string' ||
215
- typeof skillMeta.description !== 'string' ||
216
- !skillMeta.name ||
217
- !skillMeta.description
218
- ) {
219
- if (debug) console.log(`[DEBUG] parseSkillMd: SKILL.md in "${dir}" is missing name or description (or wrong type) — skipping`);
220
- return null;
221
- }
222
-
223
- if (skillMeta.name !== dirName) {
224
- console.error(`Error: SKILL.md name "${skillMeta.name}" does not match directory name "${dirName}" — skipping`);
225
- return null;
226
- }
227
-
228
- return skillMeta;
229
- }
230
-
231
- if (debug) console.log(`[DEBUG] parseSkillMd: SKILL.md in "${dir}" has no frontmatter — skipping`);
232
- return null;
233
- } catch (error) {
234
- if (debug) console.log(`[DEBUG] parseSkillMd: failed to parse SKILL.md in "${dir}": ${error.message} — skipping`);
235
- return null;
236
- }
237
- }
238
-
239
- /**
240
- * Collect agents from each installed module's source module.yaml `agents:` array.
241
- * Essence fields (code, name, title, icon, description) are authored in module.yaml;
242
- * `team` defaults to module code when not set; `module` is always the owning module.
243
- */
244
- async collectAgentsFromModuleYaml() {
245
- this.agents = [];
246
- const debug = process.env.BMAD_DEBUG_MANIFEST === 'true';
247
-
248
- for (const moduleName of this.updatedModules) {
249
- const moduleYamlPath = await resolveInstalledModuleYaml(moduleName);
250
- if (!moduleYamlPath) {
251
- // External modules live in ~/.bmad/cache/external-modules, not src/modules.
252
- // Warn rather than silently skip so missing agent rosters don't vanish
253
- // from config.toml without notice.
254
- console.warn(
255
- `[warn] collectAgentsFromModuleYaml: could not locate module.yaml for '${moduleName}'. ` +
256
- `Agents declared by this module will not be written to config.toml.`,
257
- );
258
- continue;
259
- }
260
-
261
- let moduleDef;
262
- try {
263
- moduleDef = yaml.parse(await fs.readFile(moduleYamlPath, 'utf8'));
264
- } catch (error) {
265
- if (debug) console.log(`[DEBUG] collectAgentsFromModuleYaml: failed to parse ${moduleYamlPath}: ${error.message}`);
266
- continue;
267
- }
268
-
269
- if (!moduleDef || !Array.isArray(moduleDef.agents)) continue;
270
-
271
- for (const entry of moduleDef.agents) {
272
- if (!entry || typeof entry.code !== 'string') continue;
273
- this.agents.push({
274
- code: entry.code,
275
- name: entry.name || '',
276
- title: entry.title || '',
277
- icon: entry.icon || '',
278
- description: entry.description || '',
279
- module: moduleName,
280
- team: entry.team || moduleName,
281
- });
282
- }
283
-
284
- if (debug) {
285
- console.log(
286
- `[DEBUG] collectAgentsFromModuleYaml: ${moduleName} contributed ${moduleDef.agents.length} agents from ${moduleYamlPath}`,
287
- );
288
- }
289
- }
290
-
291
- if (debug) {
292
- console.log(`[DEBUG] collectAgentsFromModuleYaml: total agents found: ${this.agents.length}`);
293
- }
294
- }
295
-
296
- /**
297
- * Write main manifest as YAML with installation info only
298
- * Fetches fresh version info for all modules
299
- * @returns {string} Path to the manifest file
300
- */
301
- async writeMainManifest(cfgDir) {
302
- const manifestPath = path.join(cfgDir, 'manifest.yaml');
303
- const installedModuleSet = new Set(this.modules);
304
-
305
- // Read existing manifest to preserve install date
306
- let existingInstallDate = null;
307
- const existingModulesMap = new Map();
308
- if (await fs.pathExists(manifestPath)) {
309
- try {
310
- const existingContent = await fs.readFile(manifestPath, 'utf8');
311
- const existingManifest = yaml.parse(existingContent);
312
-
313
- // Preserve original install date
314
- if (existingManifest.installation?.installDate) {
315
- existingInstallDate = existingManifest.installation.installDate;
316
- }
317
-
318
- // Build map of existing modules for quick lookup
319
- if (existingManifest.modules && Array.isArray(existingManifest.modules)) {
320
- for (const m of existingManifest.modules) {
321
- if (typeof m === 'object' && m.name) {
322
- existingModulesMap.set(m.name, m);
323
- } else if (typeof m === 'string') {
324
- existingModulesMap.set(m, { installDate: existingInstallDate });
325
- }
326
- }
327
- }
328
- } catch {
329
- // If we can't read existing manifest, continue with defaults
330
- }
331
- }
332
-
333
- // Fetch fresh version info for all modules
334
- const { Manifest } = require('./manifest');
335
- const manifestObj = new Manifest();
336
- const updatedModules = [];
337
-
338
- for (const moduleName of this.modules) {
339
- // Get fresh version info from source
340
- const versionInfo = await manifestObj.getModuleVersionInfo(moduleName, this.bmadDir);
341
-
342
- // Get existing install date if available
343
- const existing = existingModulesMap.get(moduleName);
344
-
345
- const moduleEntry = {
346
- name: moduleName,
347
- version: versionInfo.version,
348
- installDate: existing?.installDate || new Date().toISOString(),
349
- lastUpdated: new Date().toISOString(),
350
- source: versionInfo.source,
351
- npmPackage: versionInfo.npmPackage,
352
- repoUrl: versionInfo.repoUrl,
353
- };
354
- // Preserve channel/sha from the resolution (external/community/custom)
355
- // or from the existing entry if this is a no-change rewrite.
356
- const channel = versionInfo.channel ?? existing?.channel;
357
- const sha = versionInfo.sha ?? existing?.sha;
358
- if (channel) moduleEntry.channel = channel;
359
- if (sha) moduleEntry.sha = sha;
360
- if (versionInfo.localPath || existing?.localPath) {
361
- moduleEntry.localPath = versionInfo.localPath || existing.localPath;
362
- }
363
- if (versionInfo.rawSource || existing?.rawSource) {
364
- moduleEntry.rawSource = versionInfo.rawSource || existing.rawSource;
365
- }
366
- const regTag = versionInfo.registryApprovedTag ?? existing?.registryApprovedTag;
367
- const regSha = versionInfo.registryApprovedSha ?? existing?.registryApprovedSha;
368
- if (regTag) moduleEntry.registryApprovedTag = regTag;
369
- if (regSha) moduleEntry.registryApprovedSha = regSha;
370
- updatedModules.push(moduleEntry);
371
- }
372
-
373
- const manifest = {
374
- installation: {
375
- version: packageJson.version,
376
- installDate: existingInstallDate || new Date().toISOString(),
377
- lastUpdated: new Date().toISOString(),
378
- },
379
- modules: updatedModules,
380
- ides: this.selectedIdes,
381
- };
382
-
383
- if (this.shimsAvailable) {
384
- manifest.installation.installShims = this.installShims;
385
- }
386
-
387
- // Clean the manifest to remove any non-serializable values
388
- const cleanManifest = structuredClone(manifest);
389
-
390
- const yamlStr = yaml.stringify(cleanManifest, {
391
- indent: 2,
392
- lineWidth: 0,
393
- sortKeys: false,
394
- });
395
-
396
- // Ensure POSIX-compliant final newline
397
- const content = yamlStr.endsWith('\n') ? yamlStr : yamlStr + '\n';
398
- await fs.writeFile(manifestPath, content);
399
- return manifestPath;
400
- }
401
-
402
- /**
403
- * Write skill manifest CSV
404
- * @returns {string} Path to the manifest file
405
- */
406
- async writeSkillManifest(cfgDir) {
407
- const csvPath = path.join(cfgDir, 'skill-manifest.csv');
408
- const escapeCsv = (value) => `"${String(value ?? '').replaceAll('"', '""')}"`;
409
-
410
- let csvContent = 'canonicalId,name,description,module,path\n';
411
-
412
- for (const skill of this.skills) {
413
- const row = [
414
- escapeCsv(skill.canonicalId),
415
- escapeCsv(skill.name),
416
- escapeCsv(skill.description),
417
- escapeCsv(skill.module),
418
- escapeCsv(skill.path),
419
- ].join(',');
420
- csvContent += row + '\n';
421
- }
422
-
423
- await fs.writeFile(csvPath, csvContent);
424
- return csvPath;
425
- }
426
-
427
- /**
428
- * Write central _bmad/config.toml with [core], [modules.<code>], [agents.<code>] tables.
429
- * Install-owned. Team-scope answers → config.toml; user-scope answers → config.user.toml.
430
- * User-scope keys also get their module.yaml default in config.toml, so a
431
- * clone without config.user.toml still resolves them.
432
- * Both files are regenerated on every install. User overrides live in
433
- * _bmad/custom/config.toml and _bmad/custom/config.user.toml (never touched by installer).
434
- * @returns {string[]} Paths to the written config files
435
- */
436
- async writeCentralConfig(bmadDir, moduleConfigs) {
437
- const teamPath = path.join(bmadDir, 'config.toml');
438
- const userPath = path.join(bmadDir, 'config.user.toml');
439
-
440
- // Load each module's source module.yaml to determine scope per prompt key.
441
- // Default scope is 'team' when the prompt doesn't declare one.
442
- // When a module.yaml is unreadable we warn — for known official modules
443
- // this means user-scoped keys (e.g. user_name) could mis-file into the
444
- // team config, so the operator should notice.
445
- const scopeByModuleKey = {};
446
- // Maps installer moduleName (may be full display name) → module code field
447
- // from module.yaml, so TOML sections use [modules.<code>] not [modules.<name>].
448
- const codeByModuleName = {};
449
- // Module.yaml defaults for user-scope keys, written to config.toml as the
450
- // team fallback; config.user.toml overrides them.
451
- const userDefaultsByModule = {};
452
- for (const moduleName of this.updatedModules) {
453
- const moduleYamlPath = await resolveInstalledModuleYaml(moduleName);
454
- if (!moduleYamlPath) {
455
- console.warn(
456
- `[warn] writeCentralConfig: could not locate module.yaml for '${moduleName}'. ` +
457
- `Answers from this module will default to team scope — user-scoped keys may mis-file into config.toml.`,
458
- );
459
- continue;
460
- }
461
- try {
462
- const parsed = yaml.parse(await fs.readFile(moduleYamlPath, 'utf8'));
463
- if (!parsed || typeof parsed !== 'object') continue;
464
- if (parsed.code) codeByModuleName[moduleName] = parsed.code;
465
- scopeByModuleKey[moduleName] = {};
466
- userDefaultsByModule[moduleName] = {};
467
- for (const [key, value] of Object.entries(parsed)) {
468
- if (value && typeof value === 'object' && 'prompt' in value) {
469
- scopeByModuleKey[moduleName][key] = value.scope === 'user' ? 'user' : 'team';
470
- // Only plain defaults: no placeholders like {directory_name}, no result transform.
471
- if (
472
- value.scope === 'user' &&
473
- value.default !== undefined &&
474
- !String(value.default).includes('{') &&
475
- (value.result === undefined || value.result === '{value}')
476
- ) {
477
- userDefaultsByModule[moduleName][key] = value.default;
478
- }
479
- }
480
- }
481
- } catch (error) {
482
- console.warn(
483
- `[warn] writeCentralConfig: could not parse module.yaml for '${moduleName}' (${error.message}). ` +
484
- `Answers from this module will default to team scope — user-scoped keys may mis-file into config.toml.`,
485
- );
486
- }
487
- }
488
-
489
- // Core keys are always known (core module.yaml is built-in). These are
490
- // the only keys allowed in [core]; they must be stripped from every
491
- // non-core module bucket because legacy _bmad/{mod}/config.yaml files
492
- // spread core values into each module. Core belongs in [core] only —
493
- // workflows that need user_name/language/etc. read [core] directly.
494
- const coreKeys = new Set(Object.keys(scopeByModuleKey.core || {}));
495
-
496
- // Partition a module's answered config into team vs user buckets.
497
- // For non-core modules: strip core keys always; when we know the module's
498
- // own schema, also drop keys it doesn't declare. Unknown-schema modules
499
- // (external / marketplace) fall through with their remaining answers as
500
- // team so they don't vanish from the config.
501
- const partition = (moduleName, cfg, onlyDeclaredKeys = false) => {
502
- const team = {};
503
- const user = {};
504
- const scopes = scopeByModuleKey[moduleName] || {};
505
- const isCore = moduleName === 'core';
506
- for (const [key, value] of Object.entries(userDefaultsByModule[moduleName] || {})) {
507
- if (isCore || !coreKeys.has(key)) team[key] = value;
508
- }
509
- for (const [key, value] of Object.entries(cfg || {})) {
510
- if (!isCore && coreKeys.has(key)) continue;
511
- if (onlyDeclaredKeys && !(key in scopes)) continue;
512
- if (scopes[key] === 'user') {
513
- user[key] = value;
514
- } else {
515
- team[key] = value;
516
- }
517
- }
518
- return { team, user };
519
- };
520
-
521
- const teamHeader = [
522
- '# ─────────────────────────────────────────────────────────────────',
523
- '# Installer-managed. Regenerated on every install — treat as read-only.',
524
- '#',
525
- '# Direct edits to this file will be overwritten on the next install.',
526
- '# To change an install answer durably, re-run the installer (your prior',
527
- '# answers are remembered as defaults). To pin a value regardless of',
528
- '# install answers, or to add custom agents / override descriptors, use:',
529
- '# _bmad/custom/config.toml (team, committed)',
530
- '# _bmad/custom/config.user.toml (personal, gitignored)',
531
- '# Those files are never touched by the installer.',
532
- '# ─────────────────────────────────────────────────────────────────',
533
- '',
534
- ];
535
-
536
- const userHeader = [
537
- '# ─────────────────────────────────────────────────────────────────',
538
- '# Installer-managed. Regenerated on every install — treat as read-only.',
539
- '# Holds install answers scoped to YOU personally.',
540
- '#',
541
- '# Direct edits to this file will be overwritten on the next install.',
542
- '# To change an answer durably, re-run the installer (your prior answers',
543
- '# are remembered as defaults). For pinned overrides or custom sections',
544
- '# the installer does not know about, use _bmad/custom/config.user.toml',
545
- '# — it is never touched by the installer.',
546
- '# ─────────────────────────────────────────────────────────────────',
547
- '',
548
- ];
549
-
550
- const teamLines = [...teamHeader];
551
- const userLines = [...userHeader];
552
-
553
- // [core] — split into team and user
554
- const coreConfig = moduleConfigs.core || {};
555
- const { team: coreTeam, user: coreUser } = partition('core', coreConfig);
556
- if (Object.keys(coreTeam).length > 0) {
557
- teamLines.push('[core]');
558
- for (const [key, value] of Object.entries(coreTeam)) {
559
- teamLines.push(`${key} = ${formatTomlValue(value)}`);
560
- }
561
- teamLines.push('');
562
- }
563
- if (Object.keys(coreUser).length > 0) {
564
- userLines.push('[core]');
565
- for (const [key, value] of Object.entries(coreUser)) {
566
- userLines.push(`${key} = ${formatTomlValue(value)}`);
567
- }
568
- userLines.push('');
569
- }
570
-
571
- // [modules.<code>] — split per module
572
- for (const moduleName of this.updatedModules) {
573
- if (moduleName === 'core') continue;
574
- const cfg = moduleConfigs[moduleName];
575
- if (!cfg || Object.keys(cfg).length === 0) continue;
576
- // Use the module's code field from module.yaml as the TOML key so the
577
- // section is [modules.mdo] not [modules.MDO: Maxio DevOps Operations].
578
- const sectionKey = codeByModuleName[moduleName] || moduleName;
579
- // Only filter out spread-from-core pollution when we actually know
580
- // this module's prompt schema. For external/marketplace modules whose
581
- // module.yaml isn't in the src tree, fall through as all-team so we
582
- // don't drop their real answers.
583
- const haveSchema = Object.keys(scopeByModuleKey[moduleName] || {}).length > 0;
584
- const { team: modTeam, user: modUser } = partition(moduleName, cfg, haveSchema);
585
- if (Object.keys(modTeam).length > 0) {
586
- teamLines.push(`[modules.${sectionKey}]`);
587
- for (const [key, value] of Object.entries(modTeam)) {
588
- teamLines.push(`${key} = ${formatTomlValue(value)}`);
589
- }
590
- teamLines.push('');
591
- }
592
- if (Object.keys(modUser).length > 0) {
593
- userLines.push(`[modules.${sectionKey}]`);
594
- for (const [key, value] of Object.entries(modUser)) {
595
- userLines.push(`${key} = ${formatTomlValue(value)}`);
596
- }
597
- userLines.push('');
598
- }
599
- }
600
-
601
- // [agents.<code>] — always team (agent roster is organizational).
602
- // Freshly collected agents come from module.yaml this run. If a module
603
- // was preserved (e.g. during quickUpdate when its source isn't available),
604
- // its module.yaml wasn't read — so its agents aren't in `this.agents` and
605
- // would silently disappear from the roster. Preserve those existing
606
- // [agents.*] blocks verbatim from the prior config.toml.
607
- const freshAgentCodes = new Set(this.agents.map((a) => a.code));
608
- const contributingModules = new Set(this.agents.map((a) => a.module));
609
- const preservedModules = this.updatedModules.filter((m) => !contributingModules.has(m));
610
- const preservedBlocks = [];
611
- if (preservedModules.length > 0 && (await fs.pathExists(teamPath))) {
612
- try {
613
- const prev = await fs.readFile(teamPath, 'utf8');
614
- for (const block of extractAgentBlocks(prev)) {
615
- if (freshAgentCodes.has(block.code)) continue;
616
- if (block.module && preservedModules.includes(block.module)) {
617
- preservedBlocks.push(block.body);
618
- }
619
- }
620
- } catch (error) {
621
- console.warn(`[warn] writeCentralConfig: could not read prior config.toml to preserve agents: ${error.message}`);
622
- }
623
- }
624
-
625
- for (const agent of this.agents) {
626
- const agentLines = [`[agents.${agent.code}]`, `module = ${formatTomlValue(agent.module)}`, `team = ${formatTomlValue(agent.team)}`];
627
- if (agent.name) agentLines.push(`name = ${formatTomlValue(agent.name)}`);
628
- if (agent.title) agentLines.push(`title = ${formatTomlValue(agent.title)}`);
629
- if (agent.icon) agentLines.push(`icon = ${formatTomlValue(agent.icon)}`);
630
- if (agent.description) agentLines.push(`description = ${formatTomlValue(agent.description)}`);
631
- agentLines.push('');
632
- teamLines.push(...agentLines);
633
- }
634
-
635
- for (const body of preservedBlocks) {
636
- teamLines.push(body, '');
637
- }
638
-
639
- const teamContent = teamLines.join('\n').replace(/\n+$/, '\n');
640
- const userContent = userLines.join('\n').replace(/\n+$/, '\n');
641
- await fs.writeFile(teamPath, teamContent);
642
- await fs.writeFile(userPath, userContent);
643
- return [teamPath, userPath];
644
- }
645
-
646
- /**
647
- * Create empty _bmad/custom/config.toml and _bmad/custom/config.user.toml stubs
648
- * on first install only. Installer never touches these files again after creation.
649
- */
650
- async ensureCustomConfigStubs(bmadDir) {
651
- const customDir = path.join(bmadDir, 'custom');
652
- await fs.ensureDir(customDir);
653
-
654
- const stubs = [
655
- {
656
- file: path.join(customDir, 'config.toml'),
657
- header: [
658
- '# Team / enterprise overrides for _bmad/config.toml.',
659
- '# Committed to the repo — applies to every developer on the project.',
660
- '# Tables deep-merge over base config; keyed entries merge by key.',
661
- '# Example: override an agent descriptor, or add a new agent.',
662
- '#',
663
- '# [agents.bmad-agent-pm]',
664
- '# description = "Prefers short, bulleted PRDs over narrative drafts."',
665
- '',
666
- ],
667
- },
668
- {
669
- file: path.join(customDir, 'config.user.toml'),
670
- header: [
671
- '# Personal overrides for _bmad/config.toml.',
672
- '# NOT committed (gitignored) — applies only to your local install.',
673
- '# Wins over both base config and team overrides.',
674
- '',
675
- ],
676
- },
677
- ];
678
-
679
- for (const { file, header } of stubs) {
680
- if (await fs.pathExists(file)) continue;
681
- await fs.writeFile(file, header.join('\n'));
682
- }
683
- }
684
-
685
- /**
686
- * Write files manifest CSV
687
- */
688
- /**
689
- * Calculate SHA256 hash of a file
690
- * @param {string} filePath - Path to file
691
- * @returns {string} SHA256 hash
692
- */
693
- async calculateFileHash(filePath) {
694
- try {
695
- const content = await fs.readFile(filePath);
696
- return crypto.createHash('sha256').update(content).digest('hex');
697
- } catch {
698
- return '';
699
- }
700
- }
701
-
702
- /**
703
- * @returns {string} Path to the manifest file
704
- */
705
- async writeFilesManifest(cfgDir) {
706
- const csvPath = path.join(cfgDir, 'files-manifest.csv');
707
-
708
- // Create CSV header with hash column
709
- let csv = 'type,name,module,path,hash\n';
710
-
711
- // If we have ALL installed files, use those instead of just workflows/agents/tasks
712
- const allFiles = [];
713
- if (this.allInstalledFiles && this.allInstalledFiles.length > 0) {
714
- // Process all installed files
715
- for (const filePath of this.allInstalledFiles) {
716
- // Store paths relative to bmadDir (no folder prefix)
717
- const relativePath = filePath.replace(this.bmadDir, '').replaceAll('\\', '/').replace(/^\//, '');
718
- const ext = path.extname(filePath).toLowerCase();
719
- const fileName = path.basename(filePath, ext);
720
-
721
- // Determine module from path (first directory component)
722
- const pathParts = relativePath.split('/');
723
- const module = pathParts.length > 0 ? pathParts[0] : 'unknown';
724
-
725
- // Calculate hash
726
- const hash = await this.calculateFileHash(filePath);
727
-
728
- allFiles.push({
729
- type: ext.slice(1) || 'file',
730
- name: fileName,
731
- module: module,
732
- path: relativePath,
733
- hash: hash,
734
- });
735
- }
736
- } else {
737
- // Fallback: use the collected workflows/agents/tasks
738
- for (const file of this.files) {
739
- // Strip the folder prefix if present (for consistency)
740
- const relPath = file.path.replace(this.bmadFolderName + '/', '');
741
- const filePath = path.join(this.bmadDir, relPath);
742
- const hash = await this.calculateFileHash(filePath);
743
- allFiles.push({
744
- ...file,
745
- path: relPath,
746
- hash: hash,
747
- });
748
- }
749
- }
750
-
751
- // Sort files by module, then type, then name
752
- allFiles.sort((a, b) => {
753
- if (a.module !== b.module) return a.module.localeCompare(b.module);
754
- if (a.type !== b.type) return a.type.localeCompare(b.type);
755
- return a.name.localeCompare(b.name);
756
- });
757
-
758
- // Add all files
759
- for (const file of allFiles) {
760
- csv += `"${file.type}","${file.name}","${file.module}","${file.path}","${file.hash}"\n`;
761
- }
762
-
763
- await fs.writeFile(csvPath, csv);
764
- return csvPath;
765
- }
766
-
767
- /**
768
- * Scan the bmad directory to find all installed modules
769
- * @param {string} bmadDir - Path to bmad directory
770
- * @returns {Array} List of module names
771
- */
772
- async scanInstalledModules(bmadDir) {
773
- const modules = [];
774
-
775
- try {
776
- const entries = await fs.readdir(bmadDir, { withFileTypes: true });
777
-
778
- for (const entry of entries) {
779
- // Skip if not a directory or is a special directory
780
- if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name === '_config' || entry.name === 'render') {
781
- continue;
782
- }
783
-
784
- // Check if this looks like a module (has agents directory or skill manifests)
785
- const modulePath = path.join(bmadDir, entry.name);
786
- const hasAgents = await fs.pathExists(path.join(modulePath, 'agents'));
787
- const hasSkills = await this._hasSkillMdRecursive(modulePath);
788
-
789
- if (hasAgents || hasSkills) {
790
- modules.push(entry.name);
791
- }
792
- }
793
- } catch (error) {
794
- await prompts.log.warn(`Could not scan for installed modules: ${error.message}`);
795
- }
796
-
797
- return modules;
798
- }
799
-
800
- /**
801
- * Recursively check if a directory tree contains a SKILL.md file.
802
- * Skips directories starting with . or _.
803
- * @param {string} dir - Directory to search
804
- * @returns {boolean} True if a SKILL.md is found
805
- */
806
- async _hasSkillMdRecursive(dir) {
807
- let entries;
808
- try {
809
- entries = await fs.readdir(dir, { withFileTypes: true });
810
- } catch {
811
- return false;
812
- }
813
-
814
- // Check for SKILL.md in this directory
815
- if (entries.some((e) => !e.isDirectory() && e.name === 'SKILL.md')) return true;
816
-
817
- // Recurse into subdirectories
818
- for (const entry of entries) {
819
- if (!entry.isDirectory()) continue;
820
- if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue;
821
- if (await this._hasSkillMdRecursive(path.join(dir, entry.name))) return true;
822
- }
823
-
824
- return false;
825
- }
826
- }
827
-
828
- /**
829
- * Format a JS scalar as a TOML value literal.
830
- * Handles strings (quoted + escaped), booleans, numbers, and arrays of scalars.
831
- * Objects are not expected at this emit path.
832
- */
833
- function formatTomlValue(value) {
834
- if (value === null || value === undefined) return '""';
835
- if (typeof value === 'boolean') return value ? 'true' : 'false';
836
- if (typeof value === 'number' && Number.isFinite(value)) return String(value);
837
- if (Array.isArray(value)) return `[${value.map((v) => formatTomlValue(v)).join(', ')}]`;
838
- const str = String(value);
839
- const escaped = str
840
- .replaceAll('\\', '\\\\')
841
- .replaceAll('"', String.raw`\"`)
842
- .replaceAll('\n', String.raw`\n`)
843
- .replaceAll('\r', String.raw`\r`)
844
- .replaceAll('\t', String.raw`\t`);
845
- return `"${escaped}"`;
846
- }
847
-
848
- /**
849
- * Extract [agents.<code>] blocks from a previously-emitted config.toml.
850
- * We only need this for roster preservation — the file is our own controlled
851
- * output, so a simple line scanner is safer than adding a TOML parser
852
- * dependency. Each block runs from its `[agents.<code>]` header until the
853
- * next `[` heading or EOF; the `module = "..."` line inside drives which
854
- * entries we keep on the next write.
855
- * @returns {Array<{code: string, module: string | null, body: string}>}
856
- */
857
- function extractAgentBlocks(tomlContent) {
858
- const blocks = [];
859
- const lines = tomlContent.split('\n');
860
- let i = 0;
861
- while (i < lines.length) {
862
- const header = lines[i].match(/^\[agents\.([^\]]+)]\s*$/);
863
- if (!header) {
864
- i++;
865
- continue;
866
- }
867
- const code = header[1];
868
- const blockLines = [lines[i]];
869
- let moduleName = null;
870
- i++;
871
- while (i < lines.length && !lines[i].startsWith('[')) {
872
- blockLines.push(lines[i]);
873
- const m = lines[i].match(/^module\s*=\s*"((?:[^"\\]|\\.)*)"\s*$/);
874
- if (m) moduleName = m[1];
875
- i++;
876
- }
877
- while (blockLines.length > 1 && blockLines.at(-1) === '') blockLines.pop();
878
- blocks.push({ code, module: moduleName, body: blockLines.join('\n') });
879
- }
880
- return blocks;
881
- }
882
-
883
- module.exports = { ManifestGenerator };