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,336 +0,0 @@
1
- const path = require('node:path');
2
- const semver = require('semver');
3
- const yaml = require('yaml');
4
- const fs = require('../fs-native');
5
- const { getExternalModuleCachePath, getModulePath, resolveInstalledModuleYaml } = require('../project-root');
6
-
7
- const DEFAULT_PARENT_DEPTH = 8;
8
-
9
- /**
10
- * Resolve a module version from authoritative on-disk metadata.
11
- * Preference order:
12
- * 1. package.json nearest the module source/cache root
13
- * 2. module.yaml in the module source directory
14
- * 3. .claude-plugin/marketplace.json
15
- * 4. caller-provided fallback version
16
- *
17
- * @param {string} moduleName - Module code/name
18
- * @param {Object} [options]
19
- * @param {string} [options.moduleSourcePath] - Directory containing module.yaml
20
- * @param {string} [options.fallbackVersion] - Final fallback when no metadata is found
21
- * @param {string[]} [options.marketplacePluginNames] - Preferred marketplace plugin names
22
- * @returns {Promise<{version: string|null, source: string|null, path: string|null}>}
23
- */
24
- async function resolveModuleVersion(moduleName, options = {}) {
25
- const moduleSourcePath = await normalizeDirectoryPath(options.moduleSourcePath);
26
- const packageJsonPath = await findPackageJsonPath(moduleName, moduleSourcePath);
27
-
28
- if (packageJsonPath) {
29
- const packageVersion = await readPackageJsonVersion(packageJsonPath);
30
- if (packageVersion) {
31
- return {
32
- version: packageVersion,
33
- source: 'package.json',
34
- path: packageJsonPath,
35
- };
36
- }
37
- }
38
-
39
- const moduleYamlPath = await findModuleYamlPath(moduleName, moduleSourcePath);
40
- if (moduleYamlPath) {
41
- const moduleVersion = await readModuleYamlVersion(moduleYamlPath);
42
- if (moduleVersion) {
43
- return {
44
- version: moduleVersion,
45
- source: 'module.yaml',
46
- path: moduleYamlPath,
47
- };
48
- }
49
- }
50
-
51
- const marketplaceVersion = await findMarketplaceVersion(moduleName, moduleSourcePath, options.marketplacePluginNames || []);
52
- if (marketplaceVersion) {
53
- return marketplaceVersion;
54
- }
55
-
56
- const fallbackVersion = normalizeVersion(options.fallbackVersion);
57
- if (fallbackVersion) {
58
- return {
59
- version: fallbackVersion,
60
- source: 'fallback',
61
- path: null,
62
- };
63
- }
64
-
65
- return {
66
- version: null,
67
- source: null,
68
- path: null,
69
- };
70
- }
71
-
72
- async function findPackageJsonPath(moduleName, moduleSourcePath) {
73
- const roots = await buildSearchRoots(moduleName, moduleSourcePath);
74
-
75
- for (const root of roots) {
76
- const packageJsonPath = await findNearestUpwardFile(root.searchDir, 'package.json', { boundaryDir: root.boundaryDir });
77
- if (packageJsonPath) {
78
- return packageJsonPath;
79
- }
80
- }
81
-
82
- return null;
83
- }
84
-
85
- async function findModuleYamlPath(moduleName, moduleSourcePath) {
86
- if (moduleSourcePath) {
87
- const directModuleYamlPath = path.join(moduleSourcePath, 'module.yaml');
88
- if (await fs.pathExists(directModuleYamlPath)) {
89
- return directModuleYamlPath;
90
- }
91
- }
92
-
93
- return resolveInstalledModuleYaml(moduleName);
94
- }
95
-
96
- async function findMarketplaceVersion(moduleName, moduleSourcePath, marketplacePluginNames) {
97
- const roots = await buildSearchRoots(moduleName, moduleSourcePath);
98
-
99
- for (const root of roots) {
100
- const marketplacePath = await findNearestUpwardFile(root.searchDir, path.join('.claude-plugin', 'marketplace.json'), {
101
- boundaryDir: root.boundaryDir,
102
- });
103
- if (!marketplacePath) {
104
- continue;
105
- }
106
-
107
- const data = await readJsonFile(marketplacePath);
108
- if (!data) {
109
- continue;
110
- }
111
-
112
- const version = extractMarketplaceVersion(data, moduleName, marketplacePluginNames);
113
- if (version) {
114
- return {
115
- version,
116
- source: 'marketplace.json',
117
- path: marketplacePath,
118
- };
119
- }
120
- }
121
-
122
- return null;
123
- }
124
-
125
- async function buildSearchRoots(moduleName, moduleSourcePath) {
126
- const roots = [];
127
- const seen = new Set();
128
-
129
- const addRoot = async (candidate) => {
130
- const normalized = await normalizeExistingDirectory(candidate);
131
- if (!normalized || seen.has(normalized)) {
132
- return;
133
- }
134
-
135
- seen.add(normalized);
136
- roots.push({
137
- searchDir: normalized,
138
- boundaryDir: await findSearchBoundary(normalized),
139
- });
140
- };
141
-
142
- await addRoot(moduleSourcePath);
143
-
144
- if (moduleName === 'core' || moduleName === 'bmm') {
145
- await addRoot(getModulePath(moduleName));
146
- } else {
147
- await addRoot(getExternalModuleCachePath(moduleName));
148
- }
149
-
150
- return roots;
151
- }
152
-
153
- async function findNearestUpwardFile(startDir, relativeFilePath, options = {}) {
154
- const normalizedStartDir = await normalizeExistingDirectory(startDir);
155
- if (!normalizedStartDir) {
156
- return null;
157
- }
158
-
159
- const maxDepth = options.maxDepth ?? DEFAULT_PARENT_DEPTH;
160
- const normalizedBoundaryDir = await normalizeDirectoryPath(options.boundaryDir);
161
- let currentDir = normalizedStartDir;
162
- for (let depth = 0; depth <= maxDepth; depth++) {
163
- const candidate = path.join(currentDir, relativeFilePath);
164
- if (await fs.pathExists(candidate)) {
165
- return candidate;
166
- }
167
-
168
- if (normalizedBoundaryDir && currentDir === normalizedBoundaryDir) {
169
- break;
170
- }
171
-
172
- const parentDir = path.dirname(currentDir);
173
- if (parentDir === currentDir) {
174
- break;
175
- }
176
- currentDir = parentDir;
177
- }
178
-
179
- return null;
180
- }
181
-
182
- async function findSearchBoundary(startDir) {
183
- const normalizedStartDir = await normalizeExistingDirectory(startDir);
184
- if (!normalizedStartDir) {
185
- return null;
186
- }
187
-
188
- let currentDir = normalizedStartDir;
189
- for (let depth = 0; depth <= DEFAULT_PARENT_DEPTH; depth++) {
190
- if (
191
- (await fs.pathExists(path.join(currentDir, 'package.json'))) ||
192
- (await fs.pathExists(path.join(currentDir, '.claude-plugin', 'marketplace.json'))) ||
193
- (await fs.pathExists(path.join(currentDir, '.git')))
194
- ) {
195
- return currentDir;
196
- }
197
-
198
- const parentDir = path.dirname(currentDir);
199
- if (parentDir === currentDir) {
200
- break;
201
- }
202
- currentDir = parentDir;
203
- }
204
-
205
- return normalizedStartDir;
206
- }
207
-
208
- async function normalizeDirectoryPath(candidate) {
209
- if (!candidate) {
210
- return null;
211
- }
212
-
213
- const resolvedPath = path.resolve(candidate);
214
- try {
215
- const stats = await fs.stat(resolvedPath);
216
- return stats.isDirectory() ? resolvedPath : path.dirname(resolvedPath);
217
- } catch {
218
- return resolvedPath;
219
- }
220
- }
221
-
222
- async function normalizeExistingDirectory(candidate) {
223
- const normalized = await normalizeDirectoryPath(candidate);
224
- if (!normalized) {
225
- return null;
226
- }
227
-
228
- if (!(await fs.pathExists(normalized))) {
229
- return null;
230
- }
231
-
232
- return normalized;
233
- }
234
-
235
- async function readPackageJsonVersion(packageJsonPath) {
236
- const data = await readJsonFile(packageJsonPath);
237
- return normalizeVersion(data?.version);
238
- }
239
-
240
- async function readModuleYamlVersion(moduleYamlPath) {
241
- try {
242
- const content = await fs.readFile(moduleYamlPath, 'utf8');
243
- const data = yaml.parse(content);
244
- return normalizeVersion(data?.version || data?.module_version || data?.moduleVersion);
245
- } catch {
246
- return null;
247
- }
248
- }
249
-
250
- async function readJsonFile(filePath) {
251
- try {
252
- const content = await fs.readFile(filePath, 'utf8');
253
- return JSON.parse(content);
254
- } catch {
255
- return null;
256
- }
257
- }
258
-
259
- function extractMarketplaceVersion(data, moduleName, marketplacePluginNames = []) {
260
- const plugins = Array.isArray(data?.plugins) ? data.plugins : [];
261
- if (plugins.length === 0) {
262
- return null;
263
- }
264
-
265
- const preferredNames = new Set(
266
- [moduleName, ...marketplacePluginNames]
267
- .filter((value) => typeof value === 'string')
268
- .map((value) => value.trim())
269
- .filter(Boolean),
270
- );
271
-
272
- const exactMatches = [];
273
- const fallbackVersions = [];
274
-
275
- for (const plugin of plugins) {
276
- const version = normalizeVersion(plugin?.version);
277
- if (!version) {
278
- continue;
279
- }
280
-
281
- fallbackVersions.push(version);
282
-
283
- const pluginNames = [plugin?.name, plugin?.code].filter((value) => typeof value === 'string').map((value) => value.trim());
284
- if (pluginNames.some((name) => preferredNames.has(name))) {
285
- exactMatches.push(version);
286
- }
287
- }
288
-
289
- return pickBestVersion(exactMatches.length > 0 ? exactMatches : fallbackVersions);
290
- }
291
-
292
- function pickBestVersion(versions) {
293
- const candidates = versions.map(normalizeVersion).filter(Boolean);
294
- if (candidates.length === 0) {
295
- return null;
296
- }
297
-
298
- candidates.sort(compareVersionsDescending);
299
- return candidates[0];
300
- }
301
-
302
- function compareVersionsDescending(left, right) {
303
- const leftSemver = normalizeSemver(left);
304
- const rightSemver = normalizeSemver(right);
305
-
306
- if (leftSemver && rightSemver) {
307
- return semver.rcompare(leftSemver, rightSemver);
308
- }
309
-
310
- if (leftSemver) {
311
- return -1;
312
- }
313
-
314
- if (rightSemver) {
315
- return 1;
316
- }
317
-
318
- return right.localeCompare(left, undefined, { numeric: true, sensitivity: 'base' });
319
- }
320
-
321
- function normalizeSemver(version) {
322
- return semver.valid(version) || semver.valid(semver.coerce(version));
323
- }
324
-
325
- function normalizeVersion(version) {
326
- if (typeof version !== 'string') {
327
- return null;
328
- }
329
-
330
- const trimmed = version.trim();
331
- return trimmed || null;
332
- }
333
-
334
- module.exports = {
335
- resolveModuleVersion,
336
- };
@@ -1,224 +0,0 @@
1
- const path = require('node:path');
2
- const os = require('node:os');
3
- const yaml = require('yaml');
4
- const fs = require('./fs-native');
5
-
6
- /**
7
- * Find the BMAD project root directory by looking for package.json
8
- * or specific BMAD markers
9
- */
10
- function findProjectRoot(startPath = __dirname) {
11
- let currentPath = path.resolve(startPath);
12
-
13
- // Keep going up until we find package.json with bmad-method
14
- while (currentPath !== path.dirname(currentPath)) {
15
- const packagePath = path.join(currentPath, 'package.json');
16
-
17
- if (fs.existsSync(packagePath)) {
18
- try {
19
- const pkg = fs.readJsonSync(packagePath);
20
- // Check if this is the BMAD project
21
- if (pkg.name === 'bmad-method' || fs.existsSync(path.join(currentPath, 'src', 'core-skills'))) {
22
- return currentPath;
23
- }
24
- } catch {
25
- // Continue searching
26
- }
27
- }
28
-
29
- // Also check for src/core-skills as a marker
30
- if (fs.existsSync(path.join(currentPath, 'src', 'core-skills', 'agents'))) {
31
- return currentPath;
32
- }
33
-
34
- currentPath = path.dirname(currentPath);
35
- }
36
-
37
- // If we can't find it, use process.cwd() as fallback
38
- return process.cwd();
39
- }
40
-
41
- // Cache the project root after first calculation
42
- let cachedRoot = null;
43
-
44
- function getProjectRoot() {
45
- if (!cachedRoot) {
46
- cachedRoot = findProjectRoot();
47
- }
48
- return cachedRoot;
49
- }
50
-
51
- /**
52
- * Get path to source directory
53
- */
54
- function getSourcePath(...segments) {
55
- return path.join(getProjectRoot(), 'src', ...segments);
56
- }
57
-
58
- /**
59
- * Get path to a module's directory
60
- * bmm is a built-in module directly under src/
61
- * core is also directly under src/
62
- * All other modules are stored remote
63
- */
64
- function getModulePath(moduleName, ...segments) {
65
- if (moduleName === 'core') {
66
- return getSourcePath('core-skills', ...segments);
67
- }
68
- if (moduleName === 'bmm') {
69
- return getSourcePath('bmm-skills', ...segments);
70
- }
71
- return getSourcePath('modules', moduleName, ...segments);
72
- }
73
-
74
- /**
75
- * Path to the local external-module clone cache.
76
- * External official modules (bmb, cis, gds, tea, wds, etc.) are cloned here
77
- * by ExternalModuleManager during install and are not copied into <src>/modules/.
78
- */
79
- function getExternalModuleCachePath(moduleName, ...segments) {
80
- const base = process.env.BMAD_EXTERNAL_MODULES_CACHE || path.join(os.homedir(), '.bmad', 'cache', 'external-modules');
81
- return path.join(base, moduleName, ...segments);
82
- }
83
-
84
- /**
85
- * Locate an installed module's `module.yaml` by filesystem lookup only.
86
- *
87
- * Built-in modules (core, bmm) live under <src>. External official modules are
88
- * cloned into ~/.bmad/cache/external-modules/<name>/ with varying internal
89
- * layouts (some at src/module.yaml, some at skills/module.yaml, some nested).
90
- * Url-source custom modules are cloned into ~/.bmad/cache/custom-modules/<host>/<owner>/<repo>/
91
- * and are resolved by walking the cache and matching `code` or `name` from the
92
- * discovered module.yaml. Local custom-source modules are not cached; their
93
- * path is read from the CustomModuleManager resolution cache set during the
94
- * same install run.
95
- * This mirrors the candidate-path search in
96
- * ExternalModuleManager.findExternalModuleSource but performs no git/network
97
- * work, which keeps it safe to call during manifest writing.
98
- *
99
- * @param {string} moduleName
100
- * @returns {Promise<string|null>} Absolute path to module.yaml, or null if not found.
101
- */
102
- async function resolveInstalledModuleYaml(moduleName) {
103
- const builtIn = path.join(getModulePath(moduleName), 'module.yaml');
104
- if (await fs.pathExists(builtIn)) return builtIn;
105
-
106
- // Collect every module.yaml under a root using the standard candidate paths.
107
- // Url-source repos can host multiple plugins (discovery mode), so we need all
108
- // matches, not just the first. Returned in priority order.
109
- async function searchRootAll(root) {
110
- const results = [];
111
- for (const dir of ['skills', 'src']) {
112
- const direct = path.join(root, dir, 'module.yaml');
113
- if (await fs.pathExists(direct)) results.push(direct);
114
-
115
- const dirPath = path.join(root, dir);
116
- if (await fs.pathExists(dirPath)) {
117
- const entries = await fs.readdir(dirPath, { withFileTypes: true });
118
- for (const entry of entries) {
119
- if (!entry.isDirectory()) continue;
120
- const nested = path.join(dirPath, entry.name, 'module.yaml');
121
- if (await fs.pathExists(nested)) results.push(nested);
122
- }
123
- }
124
- }
125
-
126
- // BMB standard: {setup-skill}/assets/module.yaml (setup skill is any *-setup directory).
127
- // Check at the repo root, and also under src/skills/ and skills/ since
128
- // marketplace plugins commonly nest skills under src/skills/<name>/.
129
- const setupSearchRoots = [root, path.join(root, 'src', 'skills'), path.join(root, 'skills')];
130
- for (const setupRoot of setupSearchRoots) {
131
- if (!(await fs.pathExists(setupRoot))) continue;
132
- const entries = await fs.readdir(setupRoot, { withFileTypes: true });
133
- for (const entry of entries) {
134
- if (!entry.isDirectory() || !entry.name.endsWith('-setup')) continue;
135
- const setupAssets = path.join(setupRoot, entry.name, 'assets', 'module.yaml');
136
- if (await fs.pathExists(setupAssets)) results.push(setupAssets);
137
- }
138
- }
139
-
140
- const atRoot = path.join(root, 'module.yaml');
141
- if (await fs.pathExists(atRoot)) results.push(atRoot);
142
- return results;
143
- }
144
-
145
- // Backwards-compatible single-result variant for the existing external-cache
146
- // and resolution-cache fallbacks (one module per root by construction).
147
- async function searchRoot(root) {
148
- const all = await searchRootAll(root);
149
- return all.length > 0 ? all[0] : null;
150
- }
151
-
152
- const cacheRoot = getExternalModuleCachePath(moduleName);
153
- if (await fs.pathExists(cacheRoot)) {
154
- const found = await searchRoot(cacheRoot);
155
- if (found) return found;
156
- }
157
-
158
- // Community modules are cloned to ~/.bmad/cache/community-modules/<name>/
159
- // (parallel to the external-modules cache used above). Search there too so
160
- // collectAgentsFromModuleYaml and writeCentralConfig can locate community
161
- // module.yaml files regardless of how nested the layout is.
162
- const communityCacheRoot = path.join(os.homedir(), '.bmad', 'cache', 'community-modules', moduleName);
163
- if (await fs.pathExists(communityCacheRoot)) {
164
- const found = await searchRoot(communityCacheRoot);
165
- if (found) return found;
166
- }
167
-
168
- // Fallback: local custom-source modules store their source path in the
169
- // CustomModuleManager resolution cache populated during the same install run.
170
- // Match by code OR name since callers may use either form.
171
- try {
172
- const { CustomModuleManager } = require('./modules/custom-module-manager');
173
- for (const [, mod] of CustomModuleManager._resolutionCache) {
174
- if ((mod.code === moduleName || mod.name === moduleName) && mod.localPath) {
175
- const found = await searchRoot(mod.localPath);
176
- if (found) return found;
177
- }
178
- }
179
- } catch {
180
- // Resolution cache unavailable — continue
181
- }
182
-
183
- // Fallback: url-source custom modules cloned to ~/.bmad/cache/custom-modules/.
184
- // Walk every cached repo, enumerate ALL module.yaml files via searchRootAll
185
- // (a single repo can host multiple plugins in discovery mode), and match by
186
- // the yaml's `code` or `name` field. This works on re-install runs where
187
- // _resolutionCache is empty and covers both discovery-mode (with marketplace.json)
188
- // and direct-mode modules, since we identify repo roots by .bmad-source.json
189
- // (written by cloneRepo) or .claude-plugin/ rather than by marketplace.json.
190
- try {
191
- const customCacheDir = path.join(os.homedir(), '.bmad', 'cache', 'custom-modules');
192
- if (await fs.pathExists(customCacheDir)) {
193
- const { CustomModuleManager } = require('./modules/custom-module-manager');
194
- const customMgr = new CustomModuleManager();
195
- const repoRoots = await customMgr._findCacheRepoRoots(customCacheDir);
196
- for (const { repoPath } of repoRoots) {
197
- const candidates = await searchRootAll(repoPath);
198
- for (const candidate of candidates) {
199
- try {
200
- const parsed = yaml.parse(await fs.readFile(candidate, 'utf8'));
201
- if (parsed && (parsed.code === moduleName || parsed.name === moduleName)) {
202
- return candidate;
203
- }
204
- } catch {
205
- // Malformed yaml — skip
206
- }
207
- }
208
- }
209
- }
210
- } catch {
211
- // Custom-modules cache walk failed — continue
212
- }
213
-
214
- return null;
215
- }
216
-
217
- module.exports = {
218
- getProjectRoot,
219
- getSourcePath,
220
- getModulePath,
221
- getExternalModuleCachePath,
222
- resolveInstalledModuleYaml,
223
- findProjectRoot,
224
- };