wizz-method 1.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 (761) hide show
  1. package/.claude-plugin/marketplace.json +80 -0
  2. package/AGENTS.md +12 -0
  3. package/LICENSE +30 -0
  4. package/README.md +72 -0
  5. package/bmad-modules.yaml +77 -0
  6. package/build/artifacts/llms-full.txt +4049 -0
  7. package/build/artifacts/llms.txt +28 -0
  8. package/build/site/404.html +55 -0
  9. package/build/site/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.hwBsy0Mo.js +1 -0
  10. package/build/site/_astro/Search.astro_astro_type_script_index_0_lang.cjYDvRdi.js +1 -0
  11. package/build/site/_astro/TableOfContents.astro_astro_type_script_index_0_lang.FuRcXuRY.js +1 -0
  12. package/build/site/_astro/ec.0vx5m.js +3 -0
  13. package/build/site/_astro/ec.v4551.css +1 -0
  14. package/build/site/_astro/index.DdjI3lF_.css +1 -0
  15. package/build/site/_astro/page.B1D-nYk3.js +1 -0
  16. package/build/site/_astro/print.DNXP8c50.css +1 -0
  17. package/build/site/_astro/ui-core.D_Lfcn_I.js +2 -0
  18. package/build/site/cs/404/index.html +42 -0
  19. package/build/site/cs/explanation/advanced-elicitation/index.html +105 -0
  20. package/build/site/cs/explanation/adversarial-review/index.html +109 -0
  21. package/build/site/cs/explanation/analysis-phase/index.html +129 -0
  22. package/build/site/cs/explanation/brainstorming/index.html +92 -0
  23. package/build/site/cs/explanation/checkpoint-preview/index.html +121 -0
  24. package/build/site/cs/explanation/established-projects-faq/index.html +107 -0
  25. package/build/site/cs/explanation/forensic-investigation/index.html +167 -0
  26. package/build/site/cs/explanation/named-agents/index.html +187 -0
  27. package/build/site/cs/explanation/party-mode/index.html +101 -0
  28. package/build/site/cs/explanation/preventing-agent-conflicts/index.html +185 -0
  29. package/build/site/cs/explanation/project-context/index.html +198 -0
  30. package/build/site/cs/explanation/quick-dev/index.html +113 -0
  31. package/build/site/cs/explanation/web-bundles/index.html +178 -0
  32. package/build/site/cs/explanation/why-solutioning-matters/index.html +168 -0
  33. package/build/site/cs/how-to/customize-bmad/index.html +197 -0
  34. package/build/site/cs/how-to/established-projects/index.html +165 -0
  35. package/build/site/cs/how-to/expand-bmad-for-your-org/index.html +245 -0
  36. package/build/site/cs/how-to/get-answers-about-bmad/index.html +179 -0
  37. package/build/site/cs/how-to/install-bmad/index.html +124 -0
  38. package/build/site/cs/how-to/install-custom-modules/index.html +197 -0
  39. package/build/site/cs/how-to/non-interactive-installation/index.html +255 -0
  40. package/build/site/cs/how-to/project-context/index.html +138 -0
  41. package/build/site/cs/how-to/quick-fixes/index.html +122 -0
  42. package/build/site/cs/how-to/shard-large-documents/index.html +103 -0
  43. package/build/site/cs/how-to/upgrade-to-v6/index.html +185 -0
  44. package/build/site/cs/how-to/use-web-bundles/index.html +99 -0
  45. package/build/site/cs/index.html +129 -0
  46. package/build/site/cs/reference/agents/index.html +173 -0
  47. package/build/site/cs/reference/commands/index.html +250 -0
  48. package/build/site/cs/reference/core-tools/index.html +337 -0
  49. package/build/site/cs/reference/modules/index.html +132 -0
  50. package/build/site/cs/reference/testing/index.html +218 -0
  51. package/build/site/cs/reference/workflow-map/index.html +240 -0
  52. package/build/site/cs/roadmap/index.html +77 -0
  53. package/build/site/cs/tutorials/getting-started/index.html +382 -0
  54. package/build/site/diagrams/checkpoint-preview-diagram-fr.webp +0 -0
  55. package/build/site/diagrams/checkpoint-preview-diagram.png +0 -0
  56. package/build/site/diagrams/quick-dev-diagram-fr.webp +0 -0
  57. package/build/site/diagrams/quick-dev-diagram.png +0 -0
  58. package/build/site/explanation/advanced-elicitation/index.html +105 -0
  59. package/build/site/explanation/adversarial-review/index.html +109 -0
  60. package/build/site/explanation/analysis-phase/index.html +129 -0
  61. package/build/site/explanation/brainstorming/index.html +92 -0
  62. package/build/site/explanation/checkpoint-preview/index.html +121 -0
  63. package/build/site/explanation/established-projects-faq/index.html +107 -0
  64. package/build/site/explanation/forensic-investigation/index.html +167 -0
  65. package/build/site/explanation/named-agents/index.html +187 -0
  66. package/build/site/explanation/party-mode/index.html +256 -0
  67. package/build/site/explanation/preventing-agent-conflicts/index.html +185 -0
  68. package/build/site/explanation/project-context/index.html +198 -0
  69. package/build/site/explanation/quick-dev/index.html +113 -0
  70. package/build/site/explanation/web-bundles/index.html +178 -0
  71. package/build/site/explanation/why-solutioning-matters/index.html +168 -0
  72. package/build/site/fr/404/index.html +42 -0
  73. package/build/site/fr/explanation/advanced-elicitation/index.html +105 -0
  74. package/build/site/fr/explanation/adversarial-review/index.html +126 -0
  75. package/build/site/fr/explanation/analysis-phase/index.html +137 -0
  76. package/build/site/fr/explanation/brainstorming/index.html +92 -0
  77. package/build/site/fr/explanation/checkpoint-preview/index.html +121 -0
  78. package/build/site/fr/explanation/established-projects-faq/index.html +107 -0
  79. package/build/site/fr/explanation/forensic-investigation/index.html +194 -0
  80. package/build/site/fr/explanation/named-agents/index.html +187 -0
  81. package/build/site/fr/explanation/party-mode/index.html +112 -0
  82. package/build/site/fr/explanation/preventing-agent-conflicts/index.html +196 -0
  83. package/build/site/fr/explanation/project-context/index.html +198 -0
  84. package/build/site/fr/explanation/quick-dev/index.html +127 -0
  85. package/build/site/fr/explanation/web-bundles/index.html +198 -0
  86. package/build/site/fr/explanation/why-solutioning-matters/index.html +191 -0
  87. package/build/site/fr/how-to/customize-bmad/index.html +277 -0
  88. package/build/site/fr/how-to/established-projects/index.html +176 -0
  89. package/build/site/fr/how-to/expand-bmad-for-your-org/index.html +245 -0
  90. package/build/site/fr/how-to/get-answers-about-bmad/index.html +129 -0
  91. package/build/site/fr/how-to/install-bmad/index.html +330 -0
  92. package/build/site/fr/how-to/install-custom-modules/index.html +197 -0
  93. package/build/site/fr/how-to/non-interactive-installation/index.html +73 -0
  94. package/build/site/fr/how-to/project-context/index.html +138 -0
  95. package/build/site/fr/how-to/quick-fixes/index.html +130 -0
  96. package/build/site/fr/how-to/shard-large-documents/index.html +103 -0
  97. package/build/site/fr/how-to/upgrade-to-v6/index.html +202 -0
  98. package/build/site/fr/how-to/use-web-bundles/index.html +99 -0
  99. package/build/site/fr/index.html +144 -0
  100. package/build/site/fr/reference/agents/index.html +179 -0
  101. package/build/site/fr/reference/commands/index.html +264 -0
  102. package/build/site/fr/reference/core-tools/index.html +392 -0
  103. package/build/site/fr/reference/modules/index.html +146 -0
  104. package/build/site/fr/reference/testing/index.html +229 -0
  105. package/build/site/fr/reference/workflow-map/index.html +282 -0
  106. package/build/site/fr/roadmap/index.html +77 -0
  107. package/build/site/fr/tutorials/getting-started/index.html +406 -0
  108. package/build/site/how-to/customize-bmad/index.html +277 -0
  109. package/build/site/how-to/established-projects/index.html +165 -0
  110. package/build/site/how-to/expand-bmad-for-your-org/index.html +245 -0
  111. package/build/site/how-to/get-answers-about-bmad/index.html +129 -0
  112. package/build/site/how-to/install-bmad/index.html +330 -0
  113. package/build/site/how-to/install-custom-modules/index.html +197 -0
  114. package/build/site/how-to/non-interactive-installation/index.html +73 -0
  115. package/build/site/how-to/project-context/index.html +141 -0
  116. package/build/site/how-to/quick-fixes/index.html +122 -0
  117. package/build/site/how-to/shard-large-documents/index.html +103 -0
  118. package/build/site/how-to/upgrade-to-v6/index.html +185 -0
  119. package/build/site/how-to/use-web-bundles/index.html +99 -0
  120. package/build/site/img/bmad-dark.png +0 -0
  121. package/build/site/img/bmad-light.png +0 -0
  122. package/build/site/index.html +128 -0
  123. package/build/site/llms-full.txt +4049 -0
  124. package/build/site/llms.txt +28 -0
  125. package/build/site/pagefind/fragment/cs-cz_178b946.pf_fragment +0 -0
  126. package/build/site/pagefind/fragment/cs-cz_19e1744.pf_fragment +0 -0
  127. package/build/site/pagefind/fragment/cs-cz_1b81518.pf_fragment +0 -0
  128. package/build/site/pagefind/fragment/cs-cz_24fd94a.pf_fragment +0 -0
  129. package/build/site/pagefind/fragment/cs-cz_25c5ff1.pf_fragment +0 -0
  130. package/build/site/pagefind/fragment/cs-cz_2a7d8c4.pf_fragment +0 -0
  131. package/build/site/pagefind/fragment/cs-cz_2b14d1f.pf_fragment +0 -0
  132. package/build/site/pagefind/fragment/cs-cz_34d3775.pf_fragment +0 -0
  133. package/build/site/pagefind/fragment/cs-cz_366f93d.pf_fragment +0 -0
  134. package/build/site/pagefind/fragment/cs-cz_4761b65.pf_fragment +0 -0
  135. package/build/site/pagefind/fragment/cs-cz_4d1a40a.pf_fragment +0 -0
  136. package/build/site/pagefind/fragment/cs-cz_57dfabb.pf_fragment +0 -0
  137. package/build/site/pagefind/fragment/cs-cz_5c68f33.pf_fragment +0 -0
  138. package/build/site/pagefind/fragment/cs-cz_5efaba9.pf_fragment +0 -0
  139. package/build/site/pagefind/fragment/cs-cz_5f63a83.pf_fragment +0 -0
  140. package/build/site/pagefind/fragment/cs-cz_73bbdce.pf_fragment +0 -0
  141. package/build/site/pagefind/fragment/cs-cz_7b6af37.pf_fragment +0 -0
  142. package/build/site/pagefind/fragment/cs-cz_7d51fe5.pf_fragment +0 -0
  143. package/build/site/pagefind/fragment/cs-cz_7db5922.pf_fragment +0 -0
  144. package/build/site/pagefind/fragment/cs-cz_83e7116.pf_fragment +0 -0
  145. package/build/site/pagefind/fragment/cs-cz_83fec4e.pf_fragment +0 -0
  146. package/build/site/pagefind/fragment/cs-cz_84972ee.pf_fragment +0 -0
  147. package/build/site/pagefind/fragment/cs-cz_94e9289.pf_fragment +0 -0
  148. package/build/site/pagefind/fragment/cs-cz_a0a122c.pf_fragment +0 -0
  149. package/build/site/pagefind/fragment/cs-cz_a3e7fad.pf_fragment +0 -0
  150. package/build/site/pagefind/fragment/cs-cz_af43e66.pf_fragment +0 -0
  151. package/build/site/pagefind/fragment/cs-cz_b4f4e0a.pf_fragment +0 -0
  152. package/build/site/pagefind/fragment/cs-cz_b51b8b3.pf_fragment +0 -0
  153. package/build/site/pagefind/fragment/cs-cz_ba705d5.pf_fragment +0 -0
  154. package/build/site/pagefind/fragment/cs-cz_c315625.pf_fragment +0 -0
  155. package/build/site/pagefind/fragment/cs-cz_cf5138a.pf_fragment +0 -0
  156. package/build/site/pagefind/fragment/cs-cz_df8bdfe.pf_fragment +0 -0
  157. package/build/site/pagefind/fragment/cs-cz_e1b56f8.pf_fragment +0 -0
  158. package/build/site/pagefind/fragment/cs-cz_e3e33bb.pf_fragment +0 -0
  159. package/build/site/pagefind/fragment/cs-cz_f9d07b3.pf_fragment +0 -0
  160. package/build/site/pagefind/fragment/en_026af96.pf_fragment +0 -0
  161. package/build/site/pagefind/fragment/en_132ea1f.pf_fragment +0 -0
  162. package/build/site/pagefind/fragment/en_15ee460.pf_fragment +0 -0
  163. package/build/site/pagefind/fragment/en_171773c.pf_fragment +0 -0
  164. package/build/site/pagefind/fragment/en_1a7ec42.pf_fragment +0 -0
  165. package/build/site/pagefind/fragment/en_1bb5ebb.pf_fragment +0 -0
  166. package/build/site/pagefind/fragment/en_229434b.pf_fragment +0 -0
  167. package/build/site/pagefind/fragment/en_22b33a0.pf_fragment +0 -0
  168. package/build/site/pagefind/fragment/en_38efcf3.pf_fragment +0 -0
  169. package/build/site/pagefind/fragment/en_3d17cef.pf_fragment +0 -0
  170. package/build/site/pagefind/fragment/en_426a8fd.pf_fragment +0 -0
  171. package/build/site/pagefind/fragment/en_446b27a.pf_fragment +0 -0
  172. package/build/site/pagefind/fragment/en_582ecad.pf_fragment +0 -0
  173. package/build/site/pagefind/fragment/en_5d6b1f1.pf_fragment +0 -0
  174. package/build/site/pagefind/fragment/en_6465dfb.pf_fragment +0 -0
  175. package/build/site/pagefind/fragment/en_66f3f7a.pf_fragment +0 -0
  176. package/build/site/pagefind/fragment/en_68872f8.pf_fragment +0 -0
  177. package/build/site/pagefind/fragment/en_6e9deef.pf_fragment +0 -0
  178. package/build/site/pagefind/fragment/en_70a6a7e.pf_fragment +0 -0
  179. package/build/site/pagefind/fragment/en_73f0b1e.pf_fragment +0 -0
  180. package/build/site/pagefind/fragment/en_768fd99.pf_fragment +0 -0
  181. package/build/site/pagefind/fragment/en_7e52baa.pf_fragment +0 -0
  182. package/build/site/pagefind/fragment/en_8068cdc.pf_fragment +0 -0
  183. package/build/site/pagefind/fragment/en_9385c94.pf_fragment +0 -0
  184. package/build/site/pagefind/fragment/en_95b9c04.pf_fragment +0 -0
  185. package/build/site/pagefind/fragment/en_9a95e82.pf_fragment +0 -0
  186. package/build/site/pagefind/fragment/en_a66c4ef.pf_fragment +0 -0
  187. package/build/site/pagefind/fragment/en_ac6318c.pf_fragment +0 -0
  188. package/build/site/pagefind/fragment/en_bba8f66.pf_fragment +0 -0
  189. package/build/site/pagefind/fragment/en_d9f7193.pf_fragment +0 -0
  190. package/build/site/pagefind/fragment/en_e0e52b1.pf_fragment +0 -0
  191. package/build/site/pagefind/fragment/en_ece4cbe.pf_fragment +0 -0
  192. package/build/site/pagefind/fragment/en_ed6969c.pf_fragment +0 -0
  193. package/build/site/pagefind/fragment/en_f12187d.pf_fragment +0 -0
  194. package/build/site/pagefind/fragment/en_f643df1.pf_fragment +0 -0
  195. package/build/site/pagefind/fragment/fr-fr_10fdc25.pf_fragment +0 -0
  196. package/build/site/pagefind/fragment/fr-fr_132e2e0.pf_fragment +0 -0
  197. package/build/site/pagefind/fragment/fr-fr_1529d31.pf_fragment +0 -0
  198. package/build/site/pagefind/fragment/fr-fr_1531e2c.pf_fragment +0 -0
  199. package/build/site/pagefind/fragment/fr-fr_1d51fb7.pf_fragment +0 -0
  200. package/build/site/pagefind/fragment/fr-fr_27d0aaf.pf_fragment +0 -0
  201. package/build/site/pagefind/fragment/fr-fr_583aea8.pf_fragment +0 -0
  202. package/build/site/pagefind/fragment/fr-fr_5c4f14f.pf_fragment +0 -0
  203. package/build/site/pagefind/fragment/fr-fr_654bb96.pf_fragment +0 -0
  204. package/build/site/pagefind/fragment/fr-fr_65e37ae.pf_fragment +0 -0
  205. package/build/site/pagefind/fragment/fr-fr_6898afa.pf_fragment +0 -0
  206. package/build/site/pagefind/fragment/fr-fr_68d0a0b.pf_fragment +0 -0
  207. package/build/site/pagefind/fragment/fr-fr_6ce4bc1.pf_fragment +0 -0
  208. package/build/site/pagefind/fragment/fr-fr_7ddd126.pf_fragment +0 -0
  209. package/build/site/pagefind/fragment/fr-fr_7f50a2e.pf_fragment +0 -0
  210. package/build/site/pagefind/fragment/fr-fr_8d2df1b.pf_fragment +0 -0
  211. package/build/site/pagefind/fragment/fr-fr_9b8d33d.pf_fragment +0 -0
  212. package/build/site/pagefind/fragment/fr-fr_9c7f851.pf_fragment +0 -0
  213. package/build/site/pagefind/fragment/fr-fr_9cf6892.pf_fragment +0 -0
  214. package/build/site/pagefind/fragment/fr-fr_a512e53.pf_fragment +0 -0
  215. package/build/site/pagefind/fragment/fr-fr_a7ad3f6.pf_fragment +0 -0
  216. package/build/site/pagefind/fragment/fr-fr_afeac81.pf_fragment +0 -0
  217. package/build/site/pagefind/fragment/fr-fr_b364826.pf_fragment +0 -0
  218. package/build/site/pagefind/fragment/fr-fr_bdb3e1e.pf_fragment +0 -0
  219. package/build/site/pagefind/fragment/fr-fr_c4884c3.pf_fragment +0 -0
  220. package/build/site/pagefind/fragment/fr-fr_c54c827.pf_fragment +0 -0
  221. package/build/site/pagefind/fragment/fr-fr_ca664c2.pf_fragment +0 -0
  222. package/build/site/pagefind/fragment/fr-fr_ce3562d.pf_fragment +0 -0
  223. package/build/site/pagefind/fragment/fr-fr_d086476.pf_fragment +0 -0
  224. package/build/site/pagefind/fragment/fr-fr_d0b4e62.pf_fragment +0 -0
  225. package/build/site/pagefind/fragment/fr-fr_df4c57f.pf_fragment +0 -0
  226. package/build/site/pagefind/fragment/fr-fr_e1c2fa8.pf_fragment +0 -0
  227. package/build/site/pagefind/fragment/fr-fr_eaa1363.pf_fragment +0 -0
  228. package/build/site/pagefind/fragment/fr-fr_f456c69.pf_fragment +0 -0
  229. package/build/site/pagefind/fragment/fr-fr_fe8d783.pf_fragment +0 -0
  230. package/build/site/pagefind/fragment/vi-vn_1e5b1da.pf_fragment +0 -0
  231. package/build/site/pagefind/fragment/vi-vn_3268948.pf_fragment +0 -0
  232. package/build/site/pagefind/fragment/vi-vn_37f0bf6.pf_fragment +0 -0
  233. package/build/site/pagefind/fragment/vi-vn_485232c.pf_fragment +0 -0
  234. package/build/site/pagefind/fragment/vi-vn_4d3bd13.pf_fragment +0 -0
  235. package/build/site/pagefind/fragment/vi-vn_4e578d2.pf_fragment +0 -0
  236. package/build/site/pagefind/fragment/vi-vn_4ed2533.pf_fragment +0 -0
  237. package/build/site/pagefind/fragment/vi-vn_533743c.pf_fragment +0 -0
  238. package/build/site/pagefind/fragment/vi-vn_5ffd258.pf_fragment +0 -0
  239. package/build/site/pagefind/fragment/vi-vn_6bfed03.pf_fragment +0 -0
  240. package/build/site/pagefind/fragment/vi-vn_6f2ed6d.pf_fragment +0 -0
  241. package/build/site/pagefind/fragment/vi-vn_71aa305.pf_fragment +0 -0
  242. package/build/site/pagefind/fragment/vi-vn_7577c2c.pf_fragment +0 -0
  243. package/build/site/pagefind/fragment/vi-vn_7883435.pf_fragment +0 -0
  244. package/build/site/pagefind/fragment/vi-vn_7f2e496.pf_fragment +0 -0
  245. package/build/site/pagefind/fragment/vi-vn_7fce614.pf_fragment +0 -0
  246. package/build/site/pagefind/fragment/vi-vn_86274a6.pf_fragment +0 -0
  247. package/build/site/pagefind/fragment/vi-vn_8c4fd62.pf_fragment +0 -0
  248. package/build/site/pagefind/fragment/vi-vn_a06c773.pf_fragment +0 -0
  249. package/build/site/pagefind/fragment/vi-vn_a2e535b.pf_fragment +0 -0
  250. package/build/site/pagefind/fragment/vi-vn_a4b9dbc.pf_fragment +0 -0
  251. package/build/site/pagefind/fragment/vi-vn_b2d8e01.pf_fragment +0 -0
  252. package/build/site/pagefind/fragment/vi-vn_b631cf6.pf_fragment +0 -0
  253. package/build/site/pagefind/fragment/vi-vn_c970ebb.pf_fragment +0 -0
  254. package/build/site/pagefind/fragment/vi-vn_d229f2a.pf_fragment +0 -0
  255. package/build/site/pagefind/fragment/vi-vn_d685e88.pf_fragment +0 -0
  256. package/build/site/pagefind/fragment/vi-vn_dab2c52.pf_fragment +0 -0
  257. package/build/site/pagefind/fragment/vi-vn_df5a829.pf_fragment +0 -0
  258. package/build/site/pagefind/fragment/vi-vn_dfcf280.pf_fragment +0 -0
  259. package/build/site/pagefind/fragment/vi-vn_e8ec8cf.pf_fragment +0 -0
  260. package/build/site/pagefind/fragment/vi-vn_e9f3439.pf_fragment +0 -0
  261. package/build/site/pagefind/fragment/vi-vn_f0bfe83.pf_fragment +0 -0
  262. package/build/site/pagefind/fragment/vi-vn_f5462f7.pf_fragment +0 -0
  263. package/build/site/pagefind/fragment/vi-vn_fcc9bb7.pf_fragment +0 -0
  264. package/build/site/pagefind/fragment/vi-vn_fd55264.pf_fragment +0 -0
  265. package/build/site/pagefind/fragment/vi-vn_ffd39df.pf_fragment +0 -0
  266. package/build/site/pagefind/fragment/zh-cn_119c5bb.pf_fragment +0 -0
  267. package/build/site/pagefind/fragment/zh-cn_198e8ce.pf_fragment +0 -0
  268. package/build/site/pagefind/fragment/zh-cn_19b87a8.pf_fragment +0 -0
  269. package/build/site/pagefind/fragment/zh-cn_1edc3a5.pf_fragment +0 -0
  270. package/build/site/pagefind/fragment/zh-cn_36ae67a.pf_fragment +0 -0
  271. package/build/site/pagefind/fragment/zh-cn_37ab313.pf_fragment +0 -0
  272. package/build/site/pagefind/fragment/zh-cn_3b56778.pf_fragment +0 -0
  273. package/build/site/pagefind/fragment/zh-cn_5735cd4.pf_fragment +0 -0
  274. package/build/site/pagefind/fragment/zh-cn_6110769.pf_fragment +0 -0
  275. package/build/site/pagefind/fragment/zh-cn_6d66d9e.pf_fragment +0 -0
  276. package/build/site/pagefind/fragment/zh-cn_731b3f5.pf_fragment +0 -0
  277. package/build/site/pagefind/fragment/zh-cn_82885ff.pf_fragment +0 -0
  278. package/build/site/pagefind/fragment/zh-cn_8be7aac.pf_fragment +0 -0
  279. package/build/site/pagefind/fragment/zh-cn_8c3fa9e.pf_fragment +0 -0
  280. package/build/site/pagefind/fragment/zh-cn_8f452f7.pf_fragment +0 -0
  281. package/build/site/pagefind/fragment/zh-cn_96ccc61.pf_fragment +0 -0
  282. package/build/site/pagefind/fragment/zh-cn_9f29932.pf_fragment +0 -0
  283. package/build/site/pagefind/fragment/zh-cn_a24d786.pf_fragment +0 -0
  284. package/build/site/pagefind/fragment/zh-cn_a598178.pf_fragment +0 -0
  285. package/build/site/pagefind/fragment/zh-cn_a603f17.pf_fragment +0 -0
  286. package/build/site/pagefind/fragment/zh-cn_a9cffcf.pf_fragment +0 -0
  287. package/build/site/pagefind/fragment/zh-cn_c1bebbd.pf_fragment +0 -0
  288. package/build/site/pagefind/fragment/zh-cn_c38cf84.pf_fragment +0 -0
  289. package/build/site/pagefind/fragment/zh-cn_c42a851.pf_fragment +0 -0
  290. package/build/site/pagefind/fragment/zh-cn_ce57c6e.pf_fragment +0 -0
  291. package/build/site/pagefind/fragment/zh-cn_d4b5cd5.pf_fragment +0 -0
  292. package/build/site/pagefind/fragment/zh-cn_da40e6b.pf_fragment +0 -0
  293. package/build/site/pagefind/fragment/zh-cn_da777ec.pf_fragment +0 -0
  294. package/build/site/pagefind/fragment/zh-cn_de145f9.pf_fragment +0 -0
  295. package/build/site/pagefind/fragment/zh-cn_e376bf7.pf_fragment +0 -0
  296. package/build/site/pagefind/fragment/zh-cn_e663978.pf_fragment +0 -0
  297. package/build/site/pagefind/fragment/zh-cn_e97a13b.pf_fragment +0 -0
  298. package/build/site/pagefind/fragment/zh-cn_f13873d.pf_fragment +0 -0
  299. package/build/site/pagefind/fragment/zh-cn_f25fad4.pf_fragment +0 -0
  300. package/build/site/pagefind/fragment/zh-cn_f7edf48.pf_fragment +0 -0
  301. package/build/site/pagefind/index/cs-cz_24147b6.pf_index +0 -0
  302. package/build/site/pagefind/index/cs-cz_82fc657.pf_index +0 -0
  303. package/build/site/pagefind/index/cs-cz_8f6a83c.pf_index +0 -0
  304. package/build/site/pagefind/index/en_432f933.pf_index +0 -0
  305. package/build/site/pagefind/index/en_70c744a.pf_index +0 -0
  306. package/build/site/pagefind/index/en_fd84991.pf_index +0 -0
  307. package/build/site/pagefind/index/fr-fr_7275484.pf_index +0 -0
  308. package/build/site/pagefind/index/fr-fr_8096dd3.pf_index +0 -0
  309. package/build/site/pagefind/index/fr-fr_b34df12.pf_index +0 -0
  310. package/build/site/pagefind/index/fr-fr_e6ad665.pf_index +0 -0
  311. package/build/site/pagefind/index/vi-vn_129cf7e.pf_index +0 -0
  312. package/build/site/pagefind/index/vi-vn_7f54472.pf_index +0 -0
  313. package/build/site/pagefind/index/vi-vn_c1f31ce.pf_index +0 -0
  314. package/build/site/pagefind/index/vi-vn_c56f634.pf_index +0 -0
  315. package/build/site/pagefind/index/zh-cn_5ed0486.pf_index +0 -0
  316. package/build/site/pagefind/index/zh-cn_ad4d724.pf_index +0 -0
  317. package/build/site/pagefind/index/zh-cn_bc9f7b6.pf_index +0 -0
  318. package/build/site/pagefind/pagefind-entry.json +1 -0
  319. package/build/site/pagefind/pagefind-highlight.js +1064 -0
  320. package/build/site/pagefind/pagefind-modular-ui.css +214 -0
  321. package/build/site/pagefind/pagefind-modular-ui.js +8 -0
  322. package/build/site/pagefind/pagefind-ui.css +1 -0
  323. package/build/site/pagefind/pagefind-ui.js +2 -0
  324. package/build/site/pagefind/pagefind.cs-cz_cd39a8505eabf.pf_meta +0 -0
  325. package/build/site/pagefind/pagefind.en_8ae84a1b9c.pf_meta +0 -0
  326. package/build/site/pagefind/pagefind.fr-fr_20fca6f342d9a.pf_meta +0 -0
  327. package/build/site/pagefind/pagefind.js +6 -0
  328. package/build/site/pagefind/pagefind.vi-vn_6a45d08c2bbc8.pf_meta +0 -0
  329. package/build/site/pagefind/pagefind.zh-cn_ae911ac338eae.pf_meta +0 -0
  330. package/build/site/pagefind/wasm.en.pagefind +0 -0
  331. package/build/site/pagefind/wasm.fr-fr.pagefind +0 -0
  332. package/build/site/pagefind/wasm.unknown.pagefind +0 -0
  333. package/build/site/reference/agents/index.html +168 -0
  334. package/build/site/reference/commands/index.html +254 -0
  335. package/build/site/reference/core-tools/index.html +384 -0
  336. package/build/site/reference/modules/index.html +132 -0
  337. package/build/site/reference/testing/index.html +218 -0
  338. package/build/site/reference/workflow-map/index.html +266 -0
  339. package/build/site/roadmap/index.html +77 -0
  340. package/build/site/robots.txt +37 -0
  341. package/build/site/sitemap-0.xml +1 -0
  342. package/build/site/sitemap-index.xml +1 -0
  343. package/build/site/tutorials/getting-started/index.html +386 -0
  344. package/build/site/vi-vn/404/index.html +42 -0
  345. package/build/site/vi-vn/bmad-developer-guide/index.html +794 -0
  346. package/build/site/vi-vn/explanation/advanced-elicitation/index.html +105 -0
  347. package/build/site/vi-vn/explanation/adversarial-review/index.html +109 -0
  348. package/build/site/vi-vn/explanation/analysis-phase/index.html +129 -0
  349. package/build/site/vi-vn/explanation/brainstorming/index.html +92 -0
  350. package/build/site/vi-vn/explanation/checkpoint-preview/index.html +121 -0
  351. package/build/site/vi-vn/explanation/established-projects-faq/index.html +107 -0
  352. package/build/site/vi-vn/explanation/forensic-investigation/index.html +167 -0
  353. package/build/site/vi-vn/explanation/named-agents/index.html +187 -0
  354. package/build/site/vi-vn/explanation/party-mode/index.html +101 -0
  355. package/build/site/vi-vn/explanation/preventing-agent-conflicts/index.html +185 -0
  356. package/build/site/vi-vn/explanation/project-context/index.html +198 -0
  357. package/build/site/vi-vn/explanation/quick-dev/index.html +113 -0
  358. package/build/site/vi-vn/explanation/web-bundles/index.html +178 -0
  359. package/build/site/vi-vn/explanation/why-solutioning-matters/index.html +168 -0
  360. package/build/site/vi-vn/how-to/customize-bmad/index.html +277 -0
  361. package/build/site/vi-vn/how-to/established-projects/index.html +165 -0
  362. package/build/site/vi-vn/how-to/expand-bmad-for-your-org/index.html +228 -0
  363. package/build/site/vi-vn/how-to/get-answers-about-bmad/index.html +129 -0
  364. package/build/site/vi-vn/how-to/install-bmad/index.html +124 -0
  365. package/build/site/vi-vn/how-to/install-custom-modules/index.html +197 -0
  366. package/build/site/vi-vn/how-to/non-interactive-installation/index.html +300 -0
  367. package/build/site/vi-vn/how-to/project-context/index.html +138 -0
  368. package/build/site/vi-vn/how-to/quick-fixes/index.html +122 -0
  369. package/build/site/vi-vn/how-to/shard-large-documents/index.html +103 -0
  370. package/build/site/vi-vn/how-to/upgrade-to-v6/index.html +185 -0
  371. package/build/site/vi-vn/how-to/use-web-bundles/index.html +99 -0
  372. package/build/site/vi-vn/index.html +129 -0
  373. package/build/site/vi-vn/reference/agents/index.html +173 -0
  374. package/build/site/vi-vn/reference/commands/index.html +250 -0
  375. package/build/site/vi-vn/reference/core-tools/index.html +337 -0
  376. package/build/site/vi-vn/reference/modules/index.html +132 -0
  377. package/build/site/vi-vn/reference/testing/index.html +218 -0
  378. package/build/site/vi-vn/reference/workflow-map/index.html +240 -0
  379. package/build/site/vi-vn/roadmap/index.html +77 -0
  380. package/build/site/vi-vn/tutorials/getting-started/index.html +382 -0
  381. package/build/site/wizz-icon-orange.svg +7 -0
  382. package/build/site/workflow-map-diagram-fr.html +375 -0
  383. package/build/site/workflow-map-diagram.html +375 -0
  384. package/build/site/zh-cn/404/index.html +42 -0
  385. package/build/site/zh-cn/explanation/advanced-elicitation/index.html +142 -0
  386. package/build/site/zh-cn/explanation/adversarial-review/index.html +132 -0
  387. package/build/site/zh-cn/explanation/analysis-phase/index.html +129 -0
  388. package/build/site/zh-cn/explanation/brainstorming/index.html +147 -0
  389. package/build/site/zh-cn/explanation/checkpoint-preview/index.html +121 -0
  390. package/build/site/zh-cn/explanation/established-projects-faq/index.html +122 -0
  391. package/build/site/zh-cn/explanation/forensic-investigation/index.html +167 -0
  392. package/build/site/zh-cn/explanation/named-agents/index.html +187 -0
  393. package/build/site/zh-cn/explanation/party-mode/index.html +144 -0
  394. package/build/site/zh-cn/explanation/preventing-agent-conflicts/index.html +191 -0
  395. package/build/site/zh-cn/explanation/project-context/index.html +153 -0
  396. package/build/site/zh-cn/explanation/quick-dev/index.html +139 -0
  397. package/build/site/zh-cn/explanation/web-bundles/index.html +178 -0
  398. package/build/site/zh-cn/explanation/why-solutioning-matters/index.html +175 -0
  399. package/build/site/zh-cn/how-to/customize-bmad/index.html +202 -0
  400. package/build/site/zh-cn/how-to/established-projects/index.html +166 -0
  401. package/build/site/zh-cn/how-to/expand-bmad-for-your-org/index.html +223 -0
  402. package/build/site/zh-cn/how-to/get-answers-about-bmad/index.html +198 -0
  403. package/build/site/zh-cn/how-to/install-bmad/index.html +126 -0
  404. package/build/site/zh-cn/how-to/install-custom-modules/index.html +197 -0
  405. package/build/site/zh-cn/how-to/non-interactive-installation/index.html +254 -0
  406. package/build/site/zh-cn/how-to/project-context/index.html +143 -0
  407. package/build/site/zh-cn/how-to/quick-fixes/index.html +122 -0
  408. package/build/site/zh-cn/how-to/shard-large-documents/index.html +110 -0
  409. package/build/site/zh-cn/how-to/upgrade-to-v6/index.html +198 -0
  410. package/build/site/zh-cn/how-to/use-web-bundles/index.html +99 -0
  411. package/build/site/zh-cn/index.html +129 -0
  412. package/build/site/zh-cn/reference/agents/index.html +178 -0
  413. package/build/site/zh-cn/reference/commands/index.html +245 -0
  414. package/build/site/zh-cn/reference/core-tools/index.html +313 -0
  415. package/build/site/zh-cn/reference/modules/index.html +181 -0
  416. package/build/site/zh-cn/reference/testing/index.html +226 -0
  417. package/build/site/zh-cn/reference/workflow-map/index.html +238 -0
  418. package/build/site/zh-cn/roadmap/index.html +77 -0
  419. package/build/site/zh-cn/tutorials/getting-started/index.html +381 -0
  420. package/evals/bmm-skills/bmad-product-brief/evals.json +237 -0
  421. package/evals/bmm-skills/bmad-product-brief/files/branfield-memo.md +46 -0
  422. package/evals/bmm-skills/bmad-product-brief/files/forkbird-brief/addendum.md +40 -0
  423. package/evals/bmm-skills/bmad-product-brief/files/forkbird-brief/brief.md +56 -0
  424. package/evals/bmm-skills/bmad-product-brief/files/forkbird-brief/decision-log.md +27 -0
  425. package/evals/bmm-skills/bmad-product-brief/files/meridian-mobility-report.md +116 -0
  426. package/evals/bmm-skills/bmad-product-brief/files/mossridge-brief/addendum.md +41 -0
  427. package/evals/bmm-skills/bmad-product-brief/files/mossridge-brief/brief.md +57 -0
  428. package/evals/bmm-skills/bmad-product-brief/files/mossridge-brief/decision-log.md +29 -0
  429. package/evals/bmm-skills/bmad-product-brief/files/pantry-bridge-interviews.md +90 -0
  430. package/evals/bmm-skills/bmad-product-brief/files/q2-brainstorm.md +101 -0
  431. package/evals/bmm-skills/bmad-product-brief/triggers.json +18 -0
  432. package/package.json +114 -0
  433. package/removals.txt +62 -0
  434. package/src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md +76 -0
  435. package/src/bmm-skills/1-analysis/bmad-agent-analyst/customize.toml +90 -0
  436. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/SKILL.md +76 -0
  437. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/customize.toml +81 -0
  438. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/explain-concept.md +20 -0
  439. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/mermaid-gen.md +20 -0
  440. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/validate-doc.md +19 -0
  441. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/write-document.md +20 -0
  442. package/src/bmm-skills/1-analysis/bmad-document-project/SKILL.md +62 -0
  443. package/src/bmm-skills/1-analysis/bmad-document-project/checklist.md +245 -0
  444. package/src/bmm-skills/1-analysis/bmad-document-project/customize.toml +41 -0
  445. package/src/bmm-skills/1-analysis/bmad-document-project/documentation-requirements.csv +12 -0
  446. package/src/bmm-skills/1-analysis/bmad-document-project/instructions.md +128 -0
  447. package/src/bmm-skills/1-analysis/bmad-document-project/templates/deep-dive-template.md +345 -0
  448. package/src/bmm-skills/1-analysis/bmad-document-project/templates/index-template.md +169 -0
  449. package/src/bmm-skills/1-analysis/bmad-document-project/templates/project-overview-template.md +103 -0
  450. package/src/bmm-skills/1-analysis/bmad-document-project/templates/project-scan-report-schema.json +160 -0
  451. package/src/bmm-skills/1-analysis/bmad-document-project/templates/source-tree-template.md +135 -0
  452. package/src/bmm-skills/1-analysis/bmad-document-project/workflows/deep-dive-instructions.md +300 -0
  453. package/src/bmm-skills/1-analysis/bmad-document-project/workflows/deep-dive-workflow.md +34 -0
  454. package/src/bmm-skills/1-analysis/bmad-document-project/workflows/full-scan-instructions.md +1108 -0
  455. package/src/bmm-skills/1-analysis/bmad-document-project/workflows/full-scan-workflow.md +34 -0
  456. package/src/bmm-skills/1-analysis/bmad-prfaq/SKILL.md +135 -0
  457. package/src/bmm-skills/1-analysis/bmad-prfaq/agents/artifact-analyzer.md +60 -0
  458. package/src/bmm-skills/1-analysis/bmad-prfaq/agents/web-researcher.md +49 -0
  459. package/src/bmm-skills/1-analysis/bmad-prfaq/assets/prfaq-template.md +62 -0
  460. package/src/bmm-skills/1-analysis/bmad-prfaq/bmad-manifest.json +16 -0
  461. package/src/bmm-skills/1-analysis/bmad-prfaq/customize.toml +41 -0
  462. package/src/bmm-skills/1-analysis/bmad-prfaq/references/customer-faq.md +55 -0
  463. package/src/bmm-skills/1-analysis/bmad-prfaq/references/internal-faq.md +51 -0
  464. package/src/bmm-skills/1-analysis/bmad-prfaq/references/press-release.md +60 -0
  465. package/src/bmm-skills/1-analysis/bmad-prfaq/references/verdict.md +83 -0
  466. package/src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md +91 -0
  467. package/src/bmm-skills/1-analysis/bmad-product-brief/assets/brief-template.md +41 -0
  468. package/src/bmm-skills/1-analysis/bmad-product-brief/customize.toml +99 -0
  469. package/src/bmm-skills/1-analysis/research/bmad-domain-research/SKILL.md +96 -0
  470. package/src/bmm-skills/1-analysis/research/bmad-domain-research/customize.toml +41 -0
  471. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-01-init.md +137 -0
  472. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-02-domain-analysis.md +229 -0
  473. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-03-competitive-landscape.md +238 -0
  474. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-04-regulatory-focus.md +206 -0
  475. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-05-technical-trends.md +234 -0
  476. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-06-research-synthesis.md +450 -0
  477. package/src/bmm-skills/1-analysis/research/bmad-domain-research/research.template.md +29 -0
  478. package/src/bmm-skills/1-analysis/research/bmad-market-research/SKILL.md +96 -0
  479. package/src/bmm-skills/1-analysis/research/bmad-market-research/customize.toml +41 -0
  480. package/src/bmm-skills/1-analysis/research/bmad-market-research/research.template.md +29 -0
  481. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-01-init.md +184 -0
  482. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-02-customer-behavior.md +239 -0
  483. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-03-customer-pain-points.md +251 -0
  484. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-04-customer-decisions.md +261 -0
  485. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-05-competitive-analysis.md +173 -0
  486. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-06-research-completion.md +484 -0
  487. package/src/bmm-skills/1-analysis/research/bmad-technical-research/SKILL.md +96 -0
  488. package/src/bmm-skills/1-analysis/research/bmad-technical-research/customize.toml +41 -0
  489. package/src/bmm-skills/1-analysis/research/bmad-technical-research/research.template.md +29 -0
  490. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-01-init.md +137 -0
  491. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-02-technical-overview.md +239 -0
  492. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-03-integration-patterns.md +248 -0
  493. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-04-architectural-patterns.md +202 -0
  494. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-05-implementation-research.md +233 -0
  495. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-06-research-synthesis.md +493 -0
  496. package/src/bmm-skills/2-plan-workflows/bmad-agent-pm/SKILL.md +76 -0
  497. package/src/bmm-skills/2-plan-workflows/bmad-agent-pm/customize.toml +75 -0
  498. package/src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/SKILL.md +76 -0
  499. package/src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/customize.toml +60 -0
  500. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/SKILL.md +30 -0
  501. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/customize.toml +41 -0
  502. package/src/bmm-skills/2-plan-workflows/bmad-edit-prd/SKILL.md +30 -0
  503. package/src/bmm-skills/2-plan-workflows/bmad-edit-prd/customize.toml +42 -0
  504. package/src/bmm-skills/2-plan-workflows/bmad-prd/SKILL.md +92 -0
  505. package/src/bmm-skills/2-plan-workflows/bmad-prd/assets/headless-schemas.md +76 -0
  506. package/src/bmm-skills/2-plan-workflows/bmad-prd/assets/prd-template.md +165 -0
  507. package/src/bmm-skills/2-plan-workflows/bmad-prd/assets/prd-validation-checklist.md +135 -0
  508. package/src/bmm-skills/2-plan-workflows/bmad-prd/assets/validation-report-template.html +325 -0
  509. package/src/bmm-skills/2-plan-workflows/bmad-prd/customize.toml +147 -0
  510. package/src/bmm-skills/2-plan-workflows/bmad-prd/references/headless.md +39 -0
  511. package/src/bmm-skills/2-plan-workflows/bmad-prd/references/validate.md +97 -0
  512. package/src/bmm-skills/2-plan-workflows/bmad-ux/SKILL.md +90 -0
  513. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/color-themes.md +9 -0
  514. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/design-directions.md +9 -0
  515. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/design-example-editorial.md +158 -0
  516. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/design-example-mobile.md +93 -0
  517. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/design-example-shadcn.md +109 -0
  518. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/excalidraw-wireframe.md +19 -0
  519. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/experience-example-mobile.md +112 -0
  520. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/experience-example-shadcn.md +133 -0
  521. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/headless-schemas.md +84 -0
  522. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/key-screens.md +29 -0
  523. package/src/bmm-skills/2-plan-workflows/bmad-ux/assets/validation-report-template.html +319 -0
  524. package/src/bmm-skills/2-plan-workflows/bmad-ux/customize.toml +100 -0
  525. package/src/bmm-skills/2-plan-workflows/bmad-ux/references/creative-tools.md +19 -0
  526. package/src/bmm-skills/2-plan-workflows/bmad-ux/references/design-md-spec.md +50 -0
  527. package/src/bmm-skills/2-plan-workflows/bmad-ux/references/headless.md +37 -0
  528. package/src/bmm-skills/2-plan-workflows/bmad-ux/references/validate.md +115 -0
  529. package/src/bmm-skills/2-plan-workflows/bmad-validate-prd/SKILL.md +30 -0
  530. package/src/bmm-skills/2-plan-workflows/bmad-validate-prd/customize.toml +42 -0
  531. package/src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md +76 -0
  532. package/src/bmm-skills/3-solutioning/bmad-agent-architect/customize.toml +65 -0
  533. package/src/bmm-skills/3-solutioning/bmad-architecture/SKILL.md +85 -0
  534. package/src/bmm-skills/3-solutioning/bmad-architecture/assets/spine-template.md +79 -0
  535. package/src/bmm-skills/3-solutioning/bmad-architecture/customize.toml +100 -0
  536. package/src/bmm-skills/3-solutioning/bmad-architecture/references/headless.md +26 -0
  537. package/src/bmm-skills/3-solutioning/bmad-architecture/references/reviewer-gate.md +13 -0
  538. package/src/bmm-skills/3-solutioning/bmad-architecture/scripts/lint_spine.py +257 -0
  539. package/src/bmm-skills/3-solutioning/bmad-architecture/scripts/tests/test_lint_spine.py +270 -0
  540. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/SKILL.md +91 -0
  541. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/customize.toml +41 -0
  542. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-01-document-discovery.md +179 -0
  543. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-02-prd-analysis.md +168 -0
  544. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +169 -0
  545. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-04-ux-alignment.md +129 -0
  546. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-05-epic-quality-review.md +241 -0
  547. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-06-final-assessment.md +132 -0
  548. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/templates/readiness-report-template.md +4 -0
  549. package/src/bmm-skills/3-solutioning/bmad-create-architecture/SKILL.md +30 -0
  550. package/src/bmm-skills/3-solutioning/bmad-create-architecture/customize.toml +41 -0
  551. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/SKILL.md +93 -0
  552. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/customize.toml +41 -0
  553. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +263 -0
  554. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-02-design-epics.md +242 -0
  555. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-03-create-stories.md +255 -0
  556. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-04-final-validation.md +143 -0
  557. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/templates/epics-template.md +61 -0
  558. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/SKILL.md +81 -0
  559. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/customize.toml +41 -0
  560. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/project-context-template.md +21 -0
  561. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/steps/step-01-discover.md +186 -0
  562. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/steps/step-02-generate.md +321 -0
  563. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/steps/step-03-complete.md +284 -0
  564. package/src/bmm-skills/4-implementation/bmad-agent-dev/SKILL.md +76 -0
  565. package/src/bmm-skills/4-implementation/bmad-agent-dev/customize.toml +95 -0
  566. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/SKILL.md +68 -0
  567. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/customize.toml +41 -0
  568. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/generate-trail.md +38 -0
  569. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-01-orientation.md +105 -0
  570. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-02-walkthrough.md +89 -0
  571. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-03-detail-pass.md +106 -0
  572. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-04-testing.md +74 -0
  573. package/src/bmm-skills/4-implementation/bmad-checkpoint-preview/step-05-wrapup.md +30 -0
  574. package/src/bmm-skills/4-implementation/bmad-code-review/SKILL.md +93 -0
  575. package/src/bmm-skills/4-implementation/bmad-code-review/customize.toml +41 -0
  576. package/src/bmm-skills/4-implementation/bmad-code-review/steps/step-01-gather-context.md +85 -0
  577. package/src/bmm-skills/4-implementation/bmad-code-review/steps/step-02-review.md +35 -0
  578. package/src/bmm-skills/4-implementation/bmad-code-review/steps/step-03-triage.md +49 -0
  579. package/src/bmm-skills/4-implementation/bmad-code-review/steps/step-04-present.md +132 -0
  580. package/src/bmm-skills/4-implementation/bmad-correct-course/SKILL.md +301 -0
  581. package/src/bmm-skills/4-implementation/bmad-correct-course/checklist.md +288 -0
  582. package/src/bmm-skills/4-implementation/bmad-correct-course/customize.toml +41 -0
  583. package/src/bmm-skills/4-implementation/bmad-create-story/SKILL.md +432 -0
  584. package/src/bmm-skills/4-implementation/bmad-create-story/checklist.md +357 -0
  585. package/src/bmm-skills/4-implementation/bmad-create-story/customize.toml +41 -0
  586. package/src/bmm-skills/4-implementation/bmad-create-story/discover-inputs.md +88 -0
  587. package/src/bmm-skills/4-implementation/bmad-create-story/template.md +49 -0
  588. package/src/bmm-skills/4-implementation/bmad-dev-story/SKILL.md +500 -0
  589. package/src/bmm-skills/4-implementation/bmad-dev-story/checklist.md +80 -0
  590. package/src/bmm-skills/4-implementation/bmad-dev-story/customize.toml +41 -0
  591. package/src/bmm-skills/4-implementation/bmad-investigate/SKILL.md +196 -0
  592. package/src/bmm-skills/4-implementation/bmad-investigate/customize.toml +62 -0
  593. package/src/bmm-skills/4-implementation/bmad-investigate/references/case-file-template.md +127 -0
  594. package/src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/SKILL.md +176 -0
  595. package/src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/checklist.md +33 -0
  596. package/src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/customize.toml +41 -0
  597. package/src/bmm-skills/4-implementation/bmad-quick-dev/SKILL.md +114 -0
  598. package/src/bmm-skills/4-implementation/bmad-quick-dev/compile-epic-context.md +62 -0
  599. package/src/bmm-skills/4-implementation/bmad-quick-dev/customize.toml +41 -0
  600. package/src/bmm-skills/4-implementation/bmad-quick-dev/spec-template.md +88 -0
  601. package/src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md +100 -0
  602. package/src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md +47 -0
  603. package/src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md +41 -0
  604. package/src/bmm-skills/4-implementation/bmad-quick-dev/step-04-review.md +50 -0
  605. package/src/bmm-skills/4-implementation/bmad-quick-dev/step-05-present.md +78 -0
  606. package/src/bmm-skills/4-implementation/bmad-quick-dev/step-oneshot.md +71 -0
  607. package/src/bmm-skills/4-implementation/bmad-quick-dev/sync-sprint-status.md +19 -0
  608. package/src/bmm-skills/4-implementation/bmad-retrospective/SKILL.md +1527 -0
  609. package/src/bmm-skills/4-implementation/bmad-retrospective/customize.toml +41 -0
  610. package/src/bmm-skills/4-implementation/bmad-sprint-planning/SKILL.md +319 -0
  611. package/src/bmm-skills/4-implementation/bmad-sprint-planning/checklist.md +34 -0
  612. package/src/bmm-skills/4-implementation/bmad-sprint-planning/customize.toml +41 -0
  613. package/src/bmm-skills/4-implementation/bmad-sprint-planning/sprint-status-template.yaml +69 -0
  614. package/src/bmm-skills/4-implementation/bmad-sprint-status/SKILL.md +311 -0
  615. package/src/bmm-skills/4-implementation/bmad-sprint-status/customize.toml +41 -0
  616. package/src/bmm-skills/module-help.csv +32 -0
  617. package/src/bmm-skills/module.yaml +95 -0
  618. package/src/core-skills/bmad-advanced-elicitation/SKILL.md +142 -0
  619. package/src/core-skills/bmad-advanced-elicitation/methods.csv +70 -0
  620. package/src/core-skills/bmad-brainstorming/SKILL.md +82 -0
  621. package/src/core-skills/bmad-brainstorming/analysis/catalog-analysis.md +239 -0
  622. package/src/core-skills/bmad-brainstorming/analysis/method-matrix.csv +109 -0
  623. package/src/core-skills/bmad-brainstorming/assets/brain-icons.json +166 -0
  624. package/src/core-skills/bmad-brainstorming/assets/brain-methods.csv +109 -0
  625. package/src/core-skills/bmad-brainstorming/assets/brain-selector.html +326 -0
  626. package/src/core-skills/bmad-brainstorming/customize.toml +84 -0
  627. package/src/core-skills/bmad-brainstorming/references/converge.md +24 -0
  628. package/src/core-skills/bmad-brainstorming/references/finalize.md +26 -0
  629. package/src/core-skills/bmad-brainstorming/references/headless.md +54 -0
  630. package/src/core-skills/bmad-brainstorming/references/in-chat-techniques.md +18 -0
  631. package/src/core-skills/bmad-brainstorming/references/mode-autonomous.md +10 -0
  632. package/src/core-skills/bmad-brainstorming/references/mode-facilitator.md +11 -0
  633. package/src/core-skills/bmad-brainstorming/references/mode-partner.md +16 -0
  634. package/src/core-skills/bmad-brainstorming/references/resume.md +5 -0
  635. package/src/core-skills/bmad-brainstorming/scripts/brain.py +740 -0
  636. package/src/core-skills/bmad-brainstorming/scripts/memlog.py +202 -0
  637. package/src/core-skills/bmad-brainstorming/scripts/tests/test_brain.py +217 -0
  638. package/src/core-skills/bmad-brainstorming/scripts/tests/test_memlog.py +265 -0
  639. package/src/core-skills/bmad-customize/SKILL.md +111 -0
  640. package/src/core-skills/bmad-customize/scripts/list_customizable_skills.py +231 -0
  641. package/src/core-skills/bmad-customize/scripts/tests/test_list_customizable_skills.py +249 -0
  642. package/src/core-skills/bmad-editorial-review-prose/SKILL.md +86 -0
  643. package/src/core-skills/bmad-editorial-review-structure/SKILL.md +179 -0
  644. package/src/core-skills/bmad-help/SKILL.md +75 -0
  645. package/src/core-skills/bmad-index-docs/SKILL.md +66 -0
  646. package/src/core-skills/bmad-party-mode/SKILL.md +77 -0
  647. package/src/core-skills/bmad-party-mode/customize.toml +150 -0
  648. package/src/core-skills/bmad-party-mode/references/create-party.md +65 -0
  649. package/src/core-skills/bmad-party-mode/references/mode-agent-team.md +11 -0
  650. package/src/core-skills/bmad-party-mode/references/mode-auto.md +13 -0
  651. package/src/core-skills/bmad-party-mode/references/mode-subagent.md +19 -0
  652. package/src/core-skills/bmad-party-mode/scripts/resolve_party.py +267 -0
  653. package/src/core-skills/bmad-party-mode/scripts/tests/test-resolve_party.py +138 -0
  654. package/src/core-skills/bmad-review-adversarial-general/SKILL.md +37 -0
  655. package/src/core-skills/bmad-review-edge-case-hunter/SKILL.md +67 -0
  656. package/src/core-skills/bmad-shard-doc/SKILL.md +105 -0
  657. package/src/core-skills/bmad-spec/SKILL.md +145 -0
  658. package/src/core-skills/bmad-spec/assets/headless-schemas.md +33 -0
  659. package/src/core-skills/bmad-spec/assets/spec-template.md +49 -0
  660. package/src/core-skills/bmad-spec/customize.toml +53 -0
  661. package/src/core-skills/module-help.csv +13 -0
  662. package/src/core-skills/module.yaml +33 -0
  663. package/src/modules/wizz/README.md +39 -0
  664. package/src/modules/wizz/_shared/cerebro.md +24 -0
  665. package/src/modules/wizz/_shared/encerramento.md +36 -0
  666. package/src/modules/wizz/_shared/token-economy.md +28 -0
  667. package/src/modules/wizz/agents/wizz-ads/SKILL.md +30 -0
  668. package/src/modules/wizz/agents/wizz-ads/customize.toml +53 -0
  669. package/src/modules/wizz/agents/wizz-copy/SKILL.md +30 -0
  670. package/src/modules/wizz/agents/wizz-copy/customize.toml +53 -0
  671. package/src/modules/wizz/agents/wizz-designer/SKILL.md +38 -0
  672. package/src/modules/wizz/agents/wizz-designer/customize.toml +60 -0
  673. package/src/modules/wizz/agents/wizz-growth/SKILL.md +31 -0
  674. package/src/modules/wizz/agents/wizz-growth/customize.toml +58 -0
  675. package/src/modules/wizz/agents/wizz-maestro/SKILL.md +77 -0
  676. package/src/modules/wizz/agents/wizz-maestro/customize.toml +78 -0
  677. package/src/modules/wizz/agents/wizz-memoria/SKILL.md +31 -0
  678. package/src/modules/wizz/agents/wizz-memoria/customize.toml +57 -0
  679. package/src/modules/wizz/agents/wizz-qa/SKILL.md +31 -0
  680. package/src/modules/wizz/agents/wizz-qa/customize.toml +63 -0
  681. package/src/modules/wizz/agents/wizz-seo/SKILL.md +31 -0
  682. package/src/modules/wizz/agents/wizz-seo/customize.toml +58 -0
  683. package/src/modules/wizz/module.yaml +117 -0
  684. package/src/modules/wizz/overrides/bmad-agent-analyst.toml +35 -0
  685. package/src/modules/wizz/overrides/bmad-agent-architect.toml +39 -0
  686. package/src/modules/wizz/overrides/bmad-agent-dev.toml +40 -0
  687. package/src/modules/wizz/overrides/bmad-agent-pm.toml +23 -0
  688. package/src/modules/wizz/overrides/bmad-agent-tech-writer.toml +30 -0
  689. package/src/modules/wizz/overrides/bmad-agent-ux-designer.toml +26 -0
  690. package/src/modules/wizz/scripts/wizz-init.mjs +163 -0
  691. package/src/scripts/memlog.py +224 -0
  692. package/src/scripts/resolve_config.py +176 -0
  693. package/src/scripts/resolve_customization.py +238 -0
  694. package/src/scripts/tests/test_memlog.py +306 -0
  695. package/src/scripts/tests/test_resolve_customization.py +50 -0
  696. package/tools/bundle-web-bundles.js +117 -0
  697. package/tools/format-workflow-md.js +263 -0
  698. package/tools/installer/README.md +60 -0
  699. package/tools/installer/bmad-cli.js +105 -0
  700. package/tools/installer/cli-utils.js +53 -0
  701. package/tools/installer/commands/install.js +149 -0
  702. package/tools/installer/commands/status.js +65 -0
  703. package/tools/installer/commands/uninstall.js +167 -0
  704. package/tools/installer/core/config.js +73 -0
  705. package/tools/installer/core/existing-install.js +121 -0
  706. package/tools/installer/core/install-paths.js +132 -0
  707. package/tools/installer/core/installer.js +1653 -0
  708. package/tools/installer/core/legacy-warnings.js +151 -0
  709. package/tools/installer/core/manifest-generator.js +859 -0
  710. package/tools/installer/core/manifest.js +433 -0
  711. package/tools/installer/core/python-check.js +199 -0
  712. package/tools/installer/core/wsl-node-check.js +109 -0
  713. package/tools/installer/file-ops.js +204 -0
  714. package/tools/installer/fs-native.js +116 -0
  715. package/tools/installer/ide/_config-driven.js +972 -0
  716. package/tools/installer/ide/manager.js +324 -0
  717. package/tools/installer/ide/platform-codes.js +80 -0
  718. package/tools/installer/ide/platform-codes.yaml +329 -0
  719. package/tools/installer/ide/shared/installed-skills.js +50 -0
  720. package/tools/installer/ide/shared/path-utils.js +219 -0
  721. package/tools/installer/ide/shared/skill-manifest.js +57 -0
  722. package/tools/installer/install-messages.yaml +32 -0
  723. package/tools/installer/list-options.js +210 -0
  724. package/tools/installer/message-loader.js +83 -0
  725. package/tools/installer/modules/channel-plan.js +203 -0
  726. package/tools/installer/modules/channel-resolver.js +241 -0
  727. package/tools/installer/modules/custom-module-manager.js +912 -0
  728. package/tools/installer/modules/external-manager.js +527 -0
  729. package/tools/installer/modules/module-help-schema.js +13 -0
  730. package/tools/installer/modules/official-modules.js +2217 -0
  731. package/tools/installer/modules/plugin-resolver.js +398 -0
  732. package/tools/installer/modules/version-resolver.js +336 -0
  733. package/tools/installer/project-root.js +224 -0
  734. package/tools/installer/prompts.js +852 -0
  735. package/tools/installer/set-overrides.js +330 -0
  736. package/tools/installer/ui.js +2077 -0
  737. package/tools/installer/yaml-format.js +245 -0
  738. package/tools/javascript-conventions.md +5 -0
  739. package/tools/migrate-custom-module-paths.js +124 -0
  740. package/tools/skill-validator.md +368 -0
  741. package/tools/validate-sidebar-order.js +388 -0
  742. package/tools/validate-skills.js +698 -0
  743. package/tools/validate-svg-changes.sh +356 -0
  744. package/web-bundles/README.md +46 -0
  745. package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +86 -0
  746. package/web-bundles/brainstorming-coach/SKILL.md +83 -0
  747. package/web-bundles/brainstorming-coach/brain-methods.csv +62 -0
  748. package/web-bundles/bundles.json +139 -0
  749. package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +88 -0
  750. package/web-bundles/market-and-industry-research/SKILL.md +59 -0
  751. package/web-bundles/prd-coach/INSTRUCTIONS.md +86 -0
  752. package/web-bundles/prd-coach/SKILL.md +101 -0
  753. package/web-bundles/prd-coach/prd-template.md +165 -0
  754. package/web-bundles/prd-coach/prd-validation-checklist.md +135 -0
  755. package/web-bundles/prfaq-coach/INSTRUCTIONS.md +86 -0
  756. package/web-bundles/prfaq-coach/SKILL.md +139 -0
  757. package/web-bundles/product-brief-coach/INSTRUCTIONS.md +86 -0
  758. package/web-bundles/product-brief-coach/SKILL.md +113 -0
  759. package/web-bundles/ux-coach/INSTRUCTIONS.md +92 -0
  760. package/web-bundles/ux-coach/SKILL.md +187 -0
  761. package/web-bundles/ux-coach/ux-validation.md +100 -0
@@ -0,0 +1,1653 @@
1
+ const path = require('node:path');
2
+ const fs = require('../fs-native');
3
+ const { Manifest } = require('./manifest');
4
+ const { OfficialModules } = require('../modules/official-modules');
5
+ const { IdeManager } = require('../ide/manager');
6
+ const { FileOps } = require('../file-ops');
7
+ const { Config } = require('./config');
8
+ const { getProjectRoot, getSourcePath } = require('../project-root');
9
+ const { ManifestGenerator } = require('./manifest-generator');
10
+ const prompts = require('../prompts');
11
+ const { BMAD_FOLDER_NAME } = require('../ide/shared/path-utils');
12
+ const { InstallPaths } = require('./install-paths');
13
+ const { ExternalModuleManager } = require('../modules/external-manager');
14
+ const { resolveModuleVersion } = require('../modules/version-resolver');
15
+ const { MODULE_HELP_CSV_HEADER } = require('../modules/module-help-schema');
16
+
17
+ const { ExistingInstall } = require('./existing-install');
18
+ const { warnPreNativeSkillsLegacy } = require('./legacy-warnings');
19
+
20
+ class Installer {
21
+ constructor() {
22
+ this.externalModuleManager = new ExternalModuleManager();
23
+ this.manifest = new Manifest();
24
+ this.ideManager = new IdeManager();
25
+ this.fileOps = new FileOps();
26
+ this.installedFiles = new Set(); // Track all installed files
27
+ this.bmadFolderName = BMAD_FOLDER_NAME;
28
+ }
29
+
30
+ /**
31
+ * Main installation method
32
+ * @param {Object} config - Installation configuration
33
+ * @param {string} config.directory - Target directory
34
+ * @param {string[]} config.modules - Modules to install (including 'core')
35
+ * @param {string[]} config.ides - IDEs to configure
36
+ */
37
+ async install(originalConfig) {
38
+ let updateState = null;
39
+
40
+ try {
41
+ const config = Config.build(originalConfig);
42
+ const paths = await InstallPaths.create(config);
43
+ const officialModules = await OfficialModules.build(config, paths);
44
+ const existingInstall = await ExistingInstall.detect(paths.bmadDir);
45
+
46
+ try {
47
+ await warnPreNativeSkillsLegacy({
48
+ projectRoot: paths.projectRoot,
49
+ existingVersion: existingInstall.installed ? existingInstall.version : null,
50
+ });
51
+ } catch (error) {
52
+ // Legacy-dir scan is informational; never let it abort install.
53
+ await prompts.log.warn(`Warning: Could not check for legacy BMAD entries: ${error.message}`);
54
+ }
55
+
56
+ if (existingInstall.installed) {
57
+ await this._removeDeselectedModules(existingInstall, config, paths, originalConfig._preserveModules || []);
58
+ updateState = await this._prepareUpdateState(paths, config, existingInstall, officialModules);
59
+ await this._removeDeselectedIdes(existingInstall, config, paths);
60
+ }
61
+
62
+ await this._validateIdeSelection(config);
63
+
64
+ // Capture pre-install module versions for from→to display
65
+ const preInstallVersions = new Map();
66
+ if (existingInstall.installed) {
67
+ const existingModules = await this.manifest.getAllModuleVersions(paths.bmadDir);
68
+ for (const mod of existingModules) {
69
+ if (mod.name && mod.version) {
70
+ preInstallVersions.set(mod.name, mod.version);
71
+ }
72
+ }
73
+ }
74
+
75
+ // Results collector for consolidated summary
76
+ const results = [];
77
+ const addResult = (step, status, detail = '', meta = {}) => results.push({ step, status, detail, ...meta });
78
+
79
+ // Capture previously installed skill rows before they get overwritten
80
+ const preservedModules = originalConfig._preserveModules || [];
81
+ const previousSkillManifestRows = await this._readSkillManifestRows(paths.bmadDir);
82
+ const previousSkillIds = this._getPreviousSkillIdsForCleanup(previousSkillManifestRows, preservedModules);
83
+
84
+ const allModules = config.modules || [];
85
+
86
+ await this._installAndConfigure(
87
+ config,
88
+ originalConfig,
89
+ paths,
90
+ allModules,
91
+ allModules,
92
+ addResult,
93
+ officialModules,
94
+ previousSkillManifestRows,
95
+ );
96
+
97
+ await this._setupIdes(config, allModules, paths, addResult, previousSkillIds);
98
+
99
+ // Skills are now in IDE directories — remove redundant copies from _bmad/.
100
+ // Also cleans up skill dirs left by older installer versions.
101
+ await this._cleanupSkillDirs(paths.bmadDir);
102
+
103
+ const restoreResult = await this._restoreUserFiles(paths, updateState);
104
+
105
+ // Render consolidated summary
106
+ await this.renderInstallSummary(results, {
107
+ bmadDir: paths.bmadDir,
108
+ modules: config.modules,
109
+ ides: config.ides,
110
+ customFiles: restoreResult.customFiles.length > 0 ? restoreResult.customFiles : undefined,
111
+ modifiedFiles: restoreResult.modifiedFiles.length > 0 ? restoreResult.modifiedFiles : undefined,
112
+ preInstallVersions,
113
+ });
114
+
115
+ return {
116
+ success: true,
117
+ path: paths.bmadDir,
118
+ modules: config.modules,
119
+ ides: config.ides,
120
+ projectDir: paths.projectRoot,
121
+ };
122
+ } catch (error) {
123
+ await prompts.log.error('Installation failed');
124
+
125
+ // Clean up any temp backup directories that were created before the failure
126
+ try {
127
+ if (updateState?.tempBackupDir && (await fs.pathExists(updateState.tempBackupDir))) {
128
+ await fs.remove(updateState.tempBackupDir);
129
+ }
130
+ if (updateState?.tempModifiedBackupDir && (await fs.pathExists(updateState.tempModifiedBackupDir))) {
131
+ await fs.remove(updateState.tempModifiedBackupDir);
132
+ }
133
+ } catch {
134
+ // Best-effort cleanup — don't mask the original error
135
+ }
136
+
137
+ throw error;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Remove modules that were previously installed but are no longer selected.
143
+ * No confirmation — the user's module selection is the decision.
144
+ */
145
+ async _removeDeselectedModules(existingInstall, config, paths, preservedModules = []) {
146
+ const previouslyInstalled = new Set(existingInstall.moduleIds);
147
+ const newlySelected = new Set(config.modules || []);
148
+ const preserved = new Set(preservedModules);
149
+ const toRemove = [...previouslyInstalled].filter((m) => !newlySelected.has(m) && m !== 'core' && !preserved.has(m));
150
+
151
+ for (const moduleId of toRemove) {
152
+ const modulePath = paths.moduleDir(moduleId);
153
+ try {
154
+ if (await fs.pathExists(modulePath)) {
155
+ await fs.remove(modulePath);
156
+ }
157
+ } catch (error) {
158
+ await prompts.log.warn(`Warning: Failed to remove ${moduleId}: ${error.message}`);
159
+ }
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Fail fast if all selected IDEs are suspended.
165
+ */
166
+ async _validateIdeSelection(config) {
167
+ if (!config.ides || config.ides.length === 0) return;
168
+
169
+ await this.ideManager.ensureInitialized();
170
+ const suspendedIdes = config.ides.filter((ide) => {
171
+ const handler = this.ideManager.handlers.get(ide);
172
+ return handler?.platformConfig?.suspended;
173
+ });
174
+
175
+ if (suspendedIdes.length > 0 && suspendedIdes.length === config.ides.length) {
176
+ for (const ide of suspendedIdes) {
177
+ const handler = this.ideManager.handlers.get(ide);
178
+ await prompts.log.error(`${handler.displayName || ide}: ${handler.platformConfig.suspended}`);
179
+ }
180
+ throw new Error(
181
+ `All selected tool(s) are suspended: ${suspendedIdes.join(', ')}. Installation aborted to prevent upgrading _bmad/ without a working IDE configuration.`,
182
+ );
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Remove IDEs that were previously installed but are no longer selected.
188
+ * No confirmation — the user's IDE selection is the decision.
189
+ */
190
+ async _removeDeselectedIdes(existingInstall, config, paths) {
191
+ const previouslyInstalled = new Set(existingInstall.ides);
192
+ const newlySelected = new Set(config.ides || []);
193
+ const toRemove = [...previouslyInstalled].filter((ide) => !newlySelected.has(ide));
194
+
195
+ if (toRemove.length === 0) return;
196
+
197
+ // Pass the newly-selected list as remainingIdes so cleanupByList skips
198
+ // target_dir wipes for IDEs whose directory is still owned by a peer
199
+ // (e.g. removing 'cursor' while 'gemini' remains — both share .agents/skills).
200
+ const results = await this.ideManager.cleanupByList(paths.projectRoot, toRemove, {
201
+ remainingIdes: [...newlySelected],
202
+ });
203
+
204
+ for (const result of results || []) {
205
+ if (result && result.success === false) {
206
+ await prompts.log.warn(`Warning: Failed to remove ${result.ide}: ${result.error || 'unknown error'}`);
207
+ }
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Install modules, create directories, generate configs and manifests.
213
+ */
214
+ async _installAndConfigure(
215
+ config,
216
+ originalConfig,
217
+ paths,
218
+ officialModuleIds,
219
+ allModules,
220
+ addResult,
221
+ officialModules,
222
+ previousSkillManifestRows = [],
223
+ ) {
224
+ const isQuickUpdate = config.isQuickUpdate();
225
+ const moduleConfigs = officialModules.moduleConfigs;
226
+
227
+ const dirResults = { createdDirs: [], movedDirs: [], createdWdsFolders: [] };
228
+
229
+ const installTasks = [];
230
+
231
+ installTasks.push({
232
+ title: 'Installing shared scripts',
233
+ task: async () => {
234
+ await this._installSharedScripts(paths);
235
+ addResult('Shared scripts', 'ok');
236
+ return 'Shared scripts installed';
237
+ },
238
+ });
239
+
240
+ if (allModules.length > 0) {
241
+ installTasks.push({
242
+ title: isQuickUpdate ? `Updating ${allModules.length} module(s)` : `Installing ${allModules.length} module(s)`,
243
+ task: async (message) => {
244
+ const installedModuleNames = new Set();
245
+
246
+ await this._installOfficialModules(config, paths, officialModuleIds, addResult, isQuickUpdate, officialModules, {
247
+ message,
248
+ installedModuleNames,
249
+ });
250
+
251
+ return `${allModules.length} module(s) ${isQuickUpdate ? 'updated' : 'installed'}`;
252
+ },
253
+ });
254
+ }
255
+
256
+ installTasks.push({
257
+ title: 'Creating module directories',
258
+ task: async (message) => {
259
+ const verboseMode = process.env.BMAD_VERBOSE_INSTALL === 'true' || config.verbose;
260
+ const moduleLogger = {
261
+ log: async (msg) => (verboseMode ? await prompts.log.message(msg) : undefined),
262
+ error: async (msg) => await prompts.log.error(msg),
263
+ warn: async (msg) => await prompts.log.warn(msg),
264
+ };
265
+
266
+ if (config.modules && config.modules.length > 0) {
267
+ for (const moduleName of config.modules) {
268
+ message(`Setting up ${moduleName}...`);
269
+ const result = await officialModules.createModuleDirectories(moduleName, paths.bmadDir, {
270
+ installedIDEs: config.ides || [],
271
+ moduleConfig: moduleConfigs[moduleName] || {},
272
+ existingModuleConfig: officialModules.existingConfig?.[moduleName] || {},
273
+ coreConfig: moduleConfigs.core || {},
274
+ logger: moduleLogger,
275
+ silent: true,
276
+ });
277
+ if (result) {
278
+ dirResults.createdDirs.push(...result.createdDirs);
279
+ dirResults.movedDirs.push(...(result.movedDirs || []));
280
+ dirResults.createdWdsFolders.push(...result.createdWdsFolders);
281
+ }
282
+ }
283
+ }
284
+
285
+ addResult('Module directories', 'ok');
286
+ return 'Module directories created';
287
+ },
288
+ });
289
+
290
+ const configTask = {
291
+ title: 'Generating configurations',
292
+ task: async (message) => {
293
+ await this.generateModuleConfigs(paths.bmadDir, moduleConfigs);
294
+ addResult('Configurations', 'ok', 'generated');
295
+
296
+ this.installedFiles.add(paths.manifestFile());
297
+ this.installedFiles.add(paths.centralConfig());
298
+ this.installedFiles.add(paths.centralUserConfig());
299
+
300
+ message('Generating manifests...');
301
+ const manifestGen = new ManifestGenerator();
302
+ const preservedModules = originalConfig._preserveModules || [];
303
+
304
+ const allModulesForManifest = config.isQuickUpdate()
305
+ ? originalConfig._existingModules || allModules || []
306
+ : preservedModules.length > 0
307
+ ? [...allModules, ...preservedModules]
308
+ : allModules || [];
309
+
310
+ let modulesForCsvPreserve;
311
+ if (config.isQuickUpdate()) {
312
+ modulesForCsvPreserve = originalConfig._existingModules || allModules || [];
313
+ } else {
314
+ modulesForCsvPreserve = preservedModules.length > 0 ? [...allModules, ...preservedModules] : allModules;
315
+ }
316
+
317
+ await this._trackPreservedModuleFiles(paths.bmadDir, preservedModules);
318
+
319
+ await manifestGen.generateManifests(paths.bmadDir, allModulesForManifest, [...this.installedFiles], {
320
+ ides: config.ides || [],
321
+ preservedModules: modulesForCsvPreserve,
322
+ moduleConfigs,
323
+ });
324
+ await this._appendPreservedSkillManifestRows(paths.bmadDir, previousSkillManifestRows, preservedModules);
325
+
326
+ // Apply post-install --set TOML patches. Runs after writeCentralConfig
327
+ // (inside generateManifests above) so the patch operates on the
328
+ // freshly written `_bmad/config.toml` / `_bmad/config.user.toml`.
329
+ // See `tools/installer/set-overrides.js` for routing rules.
330
+ if (config.setOverrides && Object.keys(config.setOverrides).length > 0) {
331
+ const { applySetOverrides } = require('../set-overrides');
332
+ const applied = await applySetOverrides(config.setOverrides, paths.bmadDir);
333
+ if (applied.length > 0) {
334
+ const summary = applied.map((a) => `${a.module}.${a.key} → ${a.file}`).join(', ');
335
+ await prompts.log.info(`Applied --set overrides: ${summary}`);
336
+ }
337
+ }
338
+
339
+ message('Generating help catalog...');
340
+ await this.mergeModuleHelpCatalogs(paths.bmadDir, manifestGen.agents);
341
+ addResult('Help catalog', 'ok');
342
+
343
+ return 'Configurations generated';
344
+ },
345
+ };
346
+ installTasks.push(configTask);
347
+
348
+ // Run install + dirs first, then render dir output, then run config generation
349
+ const mainTasks = installTasks.filter((t) => t !== configTask);
350
+ await prompts.tasks(mainTasks);
351
+
352
+ const color = await prompts.getColor();
353
+ if (dirResults.movedDirs.length > 0) {
354
+ const lines = dirResults.movedDirs.map((d) => ` ${d}`).join('\n');
355
+ await prompts.log.message(color.cyan(`Moved directories:\n${lines}`));
356
+ }
357
+ if (dirResults.createdDirs.length > 0) {
358
+ const lines = dirResults.createdDirs.map((d) => ` ${d}`).join('\n');
359
+ await prompts.log.message(color.yellow(`Created directories:\n${lines}`));
360
+ }
361
+ if (dirResults.createdWdsFolders.length > 0) {
362
+ const lines = dirResults.createdWdsFolders.map((f) => color.dim(` \u2713 ${f}/`)).join('\n');
363
+ await prompts.log.message(color.cyan(`Created WDS folder structure:\n${lines}`));
364
+ }
365
+
366
+ await prompts.tasks([configTask]);
367
+ }
368
+
369
+ /**
370
+ * Set up IDE integrations for each selected IDE.
371
+ */
372
+ async _setupIdes(config, allModules, paths, addResult, previousSkillIds = new Set()) {
373
+ if (config.skipIde || !config.ides || config.ides.length === 0) return;
374
+
375
+ await this.ideManager.ensureInitialized();
376
+ const validIdes = config.ides.filter((ide) => ide && typeof ide === 'string');
377
+
378
+ if (validIdes.length === 0) {
379
+ addResult('IDE configuration', 'warn', 'no valid IDEs selected');
380
+ return;
381
+ }
382
+
383
+ const setupResults = await this.ideManager.setupBatch(validIdes, paths.projectRoot, paths.bmadDir, {
384
+ selectedModules: allModules || [],
385
+ verbose: config.verbose,
386
+ previousSkillIds,
387
+ });
388
+
389
+ for (const setupResult of setupResults) {
390
+ const ide = setupResult.ide;
391
+ if (setupResult.success) {
392
+ addResult(ide, 'ok', setupResult.detail || '');
393
+ } else {
394
+ addResult(ide, 'error', setupResult.error || 'failed');
395
+ }
396
+ }
397
+ }
398
+
399
+ /**
400
+ * Remove skill directories from _bmad/ after IDE installation.
401
+ * Skills are self-contained in IDE directories, so _bmad/ only needs
402
+ * module-level files (config.yaml, _config/, etc.).
403
+ * Also cleans up skill dirs left by older installer versions.
404
+ * @param {string} bmadDir - BMAD installation directory
405
+ */
406
+ async _cleanupSkillDirs(bmadDir) {
407
+ const csv = require('csv-parse/sync');
408
+ const csvPath = path.join(bmadDir, '_config', 'skill-manifest.csv');
409
+ if (!(await fs.pathExists(csvPath))) return;
410
+
411
+ const csvContent = await fs.readFile(csvPath, 'utf8');
412
+ const records = csv.parse(csvContent, { columns: true, skip_empty_lines: true });
413
+ const bmadFolderName = path.basename(bmadDir);
414
+ const bmadPrefix = bmadFolderName + '/';
415
+
416
+ for (const record of records) {
417
+ if (!record.path) continue;
418
+ const relativePath = record.path.startsWith(bmadPrefix) ? record.path.slice(bmadPrefix.length) : record.path;
419
+ const sourceDir = path.dirname(path.join(bmadDir, relativePath));
420
+ if (await fs.pathExists(sourceDir)) {
421
+ await fs.remove(sourceDir);
422
+ await this._removeEmptyParents(path.dirname(sourceDir), bmadDir);
423
+ }
424
+ }
425
+ }
426
+
427
+ /**
428
+ * Remove now-empty parent directories left behind after skill dir cleanup.
429
+ * Walks up from dir, stopping at (and never removing) bmadDir. Best-effort:
430
+ * a directory that vanishes or fills in mid-walk just ends the walk.
431
+ * @param {string} dir - Directory to start walking up from
432
+ * @param {string} bmadDir - BMAD installation directory (boundary)
433
+ */
434
+ async _removeEmptyParents(dir, bmadDir) {
435
+ let current = dir;
436
+ while (true) {
437
+ // Path-boundary check (not a string prefix, so siblings like _bmad2 don't match).
438
+ const rel = path.relative(bmadDir, current);
439
+ if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel)) break;
440
+ try {
441
+ const entries = await fs.readdir(current);
442
+ if (entries.length > 0) break;
443
+ await fs.rmdir(current);
444
+ } catch {
445
+ break;
446
+ }
447
+ current = path.dirname(current);
448
+ }
449
+ }
450
+
451
+ async _readSkillManifestRows(bmadDir) {
452
+ const csvPath = path.join(bmadDir, '_config', 'skill-manifest.csv');
453
+ if (!(await fs.pathExists(csvPath))) return [];
454
+
455
+ try {
456
+ const csvParse = require('csv-parse/sync');
457
+ const content = await fs.readFile(csvPath, 'utf8');
458
+ return csvParse.parse(content, { columns: true, skip_empty_lines: true });
459
+ } catch (error) {
460
+ await prompts.log.warn(`Failed to parse skill-manifest.csv: ${error.message}`);
461
+ return [];
462
+ }
463
+ }
464
+
465
+ _getPreviousSkillIdsForCleanup(previousRows, preservedModules = []) {
466
+ const preservedModuleSet = new Set(preservedModules || []);
467
+ const ids = new Set();
468
+ for (const row of previousRows || []) {
469
+ if (row.canonicalId && !preservedModuleSet.has(row.module)) {
470
+ ids.add(row.canonicalId);
471
+ }
472
+ }
473
+ return ids;
474
+ }
475
+
476
+ async _appendPreservedSkillManifestRows(bmadDir, previousRows, preservedModules = []) {
477
+ if (!previousRows || previousRows.length === 0 || preservedModules.length === 0) return;
478
+
479
+ const preservedModuleSet = new Set(preservedModules);
480
+ const rowsToPreserve = previousRows.filter((row) => row.canonicalId && row.module && preservedModuleSet.has(row.module));
481
+ if (rowsToPreserve.length === 0) return;
482
+
483
+ const csvPath = path.join(bmadDir, '_config', 'skill-manifest.csv');
484
+ if (!(await fs.pathExists(csvPath))) return;
485
+
486
+ const currentRows = await this._readSkillManifestRows(bmadDir);
487
+ const activeIds = new Set(currentRows.map((row) => row.canonicalId).filter(Boolean));
488
+ const appendedRows = [];
489
+
490
+ for (const row of rowsToPreserve) {
491
+ if (activeIds.has(row.canonicalId)) continue;
492
+ activeIds.add(row.canonicalId);
493
+ appendedRows.push(
494
+ [row.canonicalId, row.name || row.canonicalId, row.description || '', row.module, row.path || '']
495
+ .map((field) => this.escapeCSVField(field))
496
+ .join(','),
497
+ );
498
+ }
499
+
500
+ if (appendedRows.length === 0) return;
501
+
502
+ const currentContent = await fs.readFile(csvPath, 'utf8');
503
+ const prefix = currentContent.endsWith('\n') ? currentContent : `${currentContent}\n`;
504
+ await fs.writeFile(csvPath, prefix + appendedRows.join('\n') + '\n', 'utf8');
505
+ }
506
+
507
+ /**
508
+ * Restore custom and modified files that were backed up before the update.
509
+ * No-op for fresh installs (updateState is null).
510
+ * @param {Object} paths - InstallPaths instance
511
+ * @param {Object|null} updateState - From _prepareUpdateState, or null for fresh installs
512
+ * @returns {Object} { customFiles, modifiedFiles } — lists of restored files
513
+ */
514
+ async _restoreUserFiles(paths, updateState) {
515
+ const noFiles = { customFiles: [], modifiedFiles: [] };
516
+
517
+ if (!updateState || (updateState.customFiles.length === 0 && updateState.modifiedFiles.length === 0)) {
518
+ return noFiles;
519
+ }
520
+
521
+ let restoredCustomFiles = [];
522
+ let restoredModifiedFiles = [];
523
+
524
+ await prompts.tasks([
525
+ {
526
+ title: 'Finalizing installation',
527
+ task: async (message) => {
528
+ if (updateState.customFiles.length > 0) {
529
+ message(`Restoring ${updateState.customFiles.length} custom files...`);
530
+
531
+ for (const originalPath of updateState.customFiles) {
532
+ const relativePath = path.relative(paths.bmadDir, originalPath);
533
+ const backupPath = path.join(updateState.tempBackupDir, relativePath);
534
+
535
+ if (await fs.pathExists(backupPath)) {
536
+ await fs.ensureDir(path.dirname(originalPath));
537
+ await fs.copy(backupPath, originalPath, { overwrite: true });
538
+ }
539
+ }
540
+
541
+ if (updateState.tempBackupDir && (await fs.pathExists(updateState.tempBackupDir))) {
542
+ await fs.remove(updateState.tempBackupDir);
543
+ }
544
+
545
+ restoredCustomFiles = updateState.customFiles;
546
+ }
547
+
548
+ if (updateState.modifiedFiles.length > 0) {
549
+ restoredModifiedFiles = updateState.modifiedFiles;
550
+
551
+ if (updateState.tempModifiedBackupDir && (await fs.pathExists(updateState.tempModifiedBackupDir))) {
552
+ message(`Restoring ${restoredModifiedFiles.length} modified files as .bak...`);
553
+
554
+ for (const modifiedFile of restoredModifiedFiles) {
555
+ const relativePath = path.relative(paths.bmadDir, modifiedFile.path);
556
+ const tempBackupPath = path.join(updateState.tempModifiedBackupDir, relativePath);
557
+ const bakPath = modifiedFile.path + '.bak';
558
+
559
+ if (await fs.pathExists(tempBackupPath)) {
560
+ await fs.ensureDir(path.dirname(bakPath));
561
+ await fs.copy(tempBackupPath, bakPath, { overwrite: true });
562
+ }
563
+ }
564
+
565
+ await fs.remove(updateState.tempModifiedBackupDir);
566
+ }
567
+ }
568
+
569
+ return 'Installation finalized';
570
+ },
571
+ },
572
+ ]);
573
+
574
+ return { customFiles: restoredCustomFiles, modifiedFiles: restoredModifiedFiles };
575
+ }
576
+
577
+ /**
578
+ * Common update preparation: detect files, preserve core config, back up.
579
+ * @param {Object} paths - InstallPaths instance
580
+ * @param {Object} config - Clean config (may have coreConfig updated)
581
+ * @param {Object} existingInstall - Detection result
582
+ * @param {Object} officialModules - OfficialModules instance
583
+ * @returns {Object} Update state: { customFiles, modifiedFiles, tempBackupDir, tempModifiedBackupDir }
584
+ */
585
+ async _prepareUpdateState(paths, config, existingInstall, officialModules) {
586
+ // Detect custom and modified files BEFORE updating (compare current files vs files-manifest.csv)
587
+ const existingFilesManifest = await this.readFilesManifest(paths.bmadDir);
588
+ const { customFiles, modifiedFiles } = await this.detectCustomFiles(paths.bmadDir, existingFilesManifest);
589
+
590
+ // Preserve existing core configuration during updates
591
+ // (no-op for quick-update which already has core config from collectModuleConfigQuick)
592
+ const coreConfigPath = paths.moduleConfig('core');
593
+ if ((await fs.pathExists(coreConfigPath)) && (!config.coreConfig || Object.keys(config.coreConfig).length === 0)) {
594
+ try {
595
+ const yaml = require('yaml');
596
+ const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8');
597
+ const existingCoreConfig = yaml.parse(coreConfigContent);
598
+
599
+ config.coreConfig = existingCoreConfig;
600
+ officialModules.moduleConfigs.core = existingCoreConfig;
601
+ } catch (error) {
602
+ await prompts.log.warn(`Warning: Could not read existing core config: ${error.message}`);
603
+ }
604
+ }
605
+
606
+ const backupDirs = await this._backupUserFiles(paths, customFiles, modifiedFiles);
607
+
608
+ return {
609
+ customFiles,
610
+ modifiedFiles,
611
+ tempBackupDir: backupDirs.tempBackupDir,
612
+ tempModifiedBackupDir: backupDirs.tempModifiedBackupDir,
613
+ };
614
+ }
615
+
616
+ /**
617
+ * Back up custom and modified files to temp directories before overwriting.
618
+ * Returns the temp directory paths (or undefined if no files to back up).
619
+ * @param {Object} paths - InstallPaths instance
620
+ * @param {string[]} customFiles - Absolute paths of custom (user-added) files
621
+ * @param {Object[]} modifiedFiles - Array of { path, relativePath } for modified files
622
+ * @returns {Object} { tempBackupDir, tempModifiedBackupDir } — undefined if no files
623
+ */
624
+ async _backupUserFiles(paths, customFiles, modifiedFiles) {
625
+ let tempBackupDir;
626
+ let tempModifiedBackupDir;
627
+
628
+ if (customFiles.length > 0) {
629
+ tempBackupDir = path.join(paths.projectRoot, '_bmad-custom-backup-temp');
630
+ await fs.ensureDir(tempBackupDir);
631
+
632
+ for (const customFile of customFiles) {
633
+ const relativePath = path.relative(paths.bmadDir, customFile);
634
+ const backupPath = path.join(tempBackupDir, relativePath);
635
+ await fs.ensureDir(path.dirname(backupPath));
636
+ await fs.copy(customFile, backupPath);
637
+ }
638
+ }
639
+
640
+ if (modifiedFiles.length > 0) {
641
+ tempModifiedBackupDir = path.join(paths.projectRoot, '_bmad-modified-backup-temp');
642
+ await fs.ensureDir(tempModifiedBackupDir);
643
+
644
+ for (const modifiedFile of modifiedFiles) {
645
+ const relativePath = path.relative(paths.bmadDir, modifiedFile.path);
646
+ const tempBackupPath = path.join(tempModifiedBackupDir, relativePath);
647
+ await fs.ensureDir(path.dirname(tempBackupPath));
648
+ await fs.copy(modifiedFile.path, tempBackupPath, { overwrite: true });
649
+ }
650
+ }
651
+
652
+ return { tempBackupDir, tempModifiedBackupDir };
653
+ }
654
+
655
+ /**
656
+ * Sync src/scripts/* → _bmad/scripts/ so shared Python scripts
657
+ * (e.g. resolve_customization.py) are available at install time.
658
+ * Excludes dev-only tests and Python caches so they don't ship to users.
659
+ * Wipes the destination first so files removed or renamed in source
660
+ * don't linger and get recorded as installed. Also seeds
661
+ * _bmad/custom/.gitignore on fresh installs so *.user.toml overrides
662
+ * stay out of version control.
663
+ */
664
+ async _installSharedScripts(paths) {
665
+ const srcScriptsDir = path.join(paths.srcDir, 'src', 'scripts');
666
+ if (!(await fs.pathExists(srcScriptsDir))) {
667
+ throw new Error(`Shared scripts source directory not found: ${srcScriptsDir}`);
668
+ }
669
+
670
+ await fs.remove(paths.scriptsDir);
671
+ await fs.ensureDir(paths.scriptsDir);
672
+ // Ship only the runtime scripts — dev-only tests and Python caches must not land in user projects.
673
+ const isInstallable = (srcPath) => {
674
+ const base = path.basename(srcPath);
675
+ return base !== 'tests' && base !== '__pycache__' && base !== '.pytest_cache' && !base.endsWith('.pyc');
676
+ };
677
+ await fs.copy(srcScriptsDir, paths.scriptsDir, { overwrite: true, filter: isInstallable });
678
+ await this._trackFilesRecursive(paths.scriptsDir);
679
+
680
+ const customGitignore = path.join(paths.customDir, '.gitignore');
681
+ if (!(await fs.pathExists(customGitignore))) {
682
+ await fs.writeFile(customGitignore, '*.user.toml\n', 'utf8');
683
+ this.installedFiles.add(customGitignore);
684
+ }
685
+ }
686
+
687
+ async _trackFilesRecursive(dir) {
688
+ const entries = await fs.readdir(dir, { withFileTypes: true });
689
+ for (const entry of entries) {
690
+ const full = path.join(dir, entry.name);
691
+ if (entry.isDirectory()) {
692
+ await this._trackFilesRecursive(full);
693
+ } else if (entry.isFile()) {
694
+ this.installedFiles.add(full);
695
+ }
696
+ }
697
+ }
698
+
699
+ async _trackPreservedModuleFiles(bmadDir, preservedModules = []) {
700
+ for (const moduleName of preservedModules) {
701
+ const modulePath = path.join(bmadDir, moduleName);
702
+ if (await fs.pathExists(modulePath)) {
703
+ await this._trackFilesRecursive(modulePath);
704
+ }
705
+ }
706
+ }
707
+
708
+ /**
709
+ * Install official (non-custom) modules.
710
+ * @param {Object} config - Installation configuration
711
+ * @param {Object} paths - InstallPaths instance
712
+ * @param {string[]} officialModuleIds - Official module IDs to install
713
+ * @param {Function} addResult - Callback to record installation results
714
+ * @param {boolean} isQuickUpdate - Whether this is a quick update
715
+ * @param {Object} ctx - Shared context: { message, installedModuleNames }
716
+ */
717
+ async _installOfficialModules(config, paths, officialModuleIds, addResult, isQuickUpdate, officialModules, ctx) {
718
+ const { message, installedModuleNames } = ctx;
719
+ const { CustomModuleManager } = require('../modules/custom-module-manager');
720
+
721
+ for (const moduleName of officialModuleIds) {
722
+ if (installedModuleNames.has(moduleName)) continue;
723
+ installedModuleNames.add(moduleName);
724
+
725
+ message(`${isQuickUpdate ? 'Updating' : 'Installing'} ${moduleName}...`);
726
+
727
+ const moduleConfig = officialModules.moduleConfigs[moduleName] || {};
728
+ const installResult = await officialModules.install(
729
+ moduleName,
730
+ paths.bmadDir,
731
+ (filePath) => {
732
+ this.installedFiles.add(filePath);
733
+ },
734
+ {
735
+ skipModuleInstaller: true,
736
+ moduleConfig: moduleConfig,
737
+ installer: this,
738
+ silent: true,
739
+ channelOptions: config.channelOptions,
740
+ },
741
+ );
742
+
743
+ // Get display name from source module.yaml and resolve the freshest version metadata we can find locally.
744
+ const sourcePath = await officialModules.findModuleSource(moduleName, {
745
+ silent: true,
746
+ channelOptions: config.channelOptions,
747
+ });
748
+ const moduleInfo = sourcePath ? await officialModules.getModuleInfo(sourcePath, moduleName, '') : null;
749
+ const displayName = moduleInfo?.name || moduleName;
750
+
751
+ const resolution = officialModules.externalModuleManager.getResolution(moduleName);
752
+ const cachedResolution = CustomModuleManager._resolutionCache.get(moduleName);
753
+ const versionInfo = await resolveModuleVersion(moduleName, {
754
+ moduleSourcePath: sourcePath,
755
+ fallbackVersion: resolution?.version || cachedResolution?.version,
756
+ marketplacePluginNames: cachedResolution?.pluginName ? [cachedResolution.pluginName] : [],
757
+ });
758
+ // Prefer the git tag recorded by the resolution (e.g. "v1.7.0") over
759
+ // the on-disk package.json (which may be ahead of the released tag).
760
+ const version = resolution?.version || versionInfo.version || '';
761
+ addResult(displayName, 'ok', '', {
762
+ moduleCode: moduleName,
763
+ newVersion: version,
764
+ newChannel: resolution?.channel || null,
765
+ newSha: resolution?.sha || null,
766
+ });
767
+ }
768
+ }
769
+
770
+ /**
771
+ * Read files-manifest.csv
772
+ * @param {string} bmadDir - BMAD installation directory
773
+ * @returns {Array} Array of file entries from files-manifest.csv
774
+ */
775
+ async readFilesManifest(bmadDir) {
776
+ const filesManifestPath = path.join(bmadDir, '_config', 'files-manifest.csv');
777
+ if (!(await fs.pathExists(filesManifestPath))) {
778
+ return [];
779
+ }
780
+
781
+ try {
782
+ const content = await fs.readFile(filesManifestPath, 'utf8');
783
+ const lines = content.split('\n');
784
+ const files = [];
785
+
786
+ for (let i = 1; i < lines.length; i++) {
787
+ // Skip header
788
+ const line = lines[i].trim();
789
+ if (!line) continue;
790
+
791
+ // Parse CSV line properly handling quoted values
792
+ const parts = [];
793
+ let current = '';
794
+ let inQuotes = false;
795
+
796
+ for (const char of line) {
797
+ if (char === '"') {
798
+ inQuotes = !inQuotes;
799
+ } else if (char === ',' && !inQuotes) {
800
+ parts.push(current);
801
+ current = '';
802
+ } else {
803
+ current += char;
804
+ }
805
+ }
806
+ parts.push(current); // Add last part
807
+
808
+ if (parts.length >= 4) {
809
+ files.push({
810
+ type: parts[0],
811
+ name: parts[1],
812
+ module: parts[2],
813
+ path: parts[3],
814
+ hash: parts[4] || null, // Hash may not exist in old manifests
815
+ });
816
+ }
817
+ }
818
+
819
+ return files;
820
+ } catch (error) {
821
+ await prompts.log.warn('Could not read files-manifest.csv: ' + error.message);
822
+ return [];
823
+ }
824
+ }
825
+
826
+ /**
827
+ * Detect custom and modified files
828
+ * @param {string} bmadDir - BMAD installation directory
829
+ * @param {Array} existingFilesManifest - Previous files from files-manifest.csv
830
+ * @returns {Object} Object with customFiles and modifiedFiles arrays
831
+ */
832
+ async detectCustomFiles(bmadDir, existingFilesManifest) {
833
+ const customFiles = [];
834
+ const modifiedFiles = [];
835
+
836
+ // Memory subtrees (v6.1: _bmad/_memory, current: _bmad/memory) hold
837
+ // per-user runtime data generated by agents with sidecars. These files
838
+ // aren't installer-managed and must never be reported as "custom" or
839
+ // "modified" — they're user state, not user overrides.
840
+ const bmadMemoryPaths = ['_memory', 'memory'];
841
+
842
+ // Check if the manifest has hashes - if not, we can't detect modifications
843
+ let manifestHasHashes = false;
844
+ if (existingFilesManifest && existingFilesManifest.length > 0) {
845
+ manifestHasHashes = existingFilesManifest.some((f) => f.hash);
846
+ }
847
+
848
+ // Build map of previously installed files from files-manifest.csv with their hashes
849
+ const installedFilesMap = new Map();
850
+ for (const fileEntry of existingFilesManifest) {
851
+ if (fileEntry.path) {
852
+ const absolutePath = path.join(bmadDir, fileEntry.path);
853
+ installedFilesMap.set(path.normalize(absolutePath), {
854
+ hash: fileEntry.hash,
855
+ relativePath: fileEntry.path,
856
+ });
857
+ }
858
+ }
859
+
860
+ // Recursively scan bmadDir for all files
861
+ const scanDirectory = async (dir) => {
862
+ try {
863
+ const entries = await fs.readdir(dir, { withFileTypes: true });
864
+ for (const entry of entries) {
865
+ const fullPath = path.join(dir, entry.name);
866
+
867
+ if (entry.isDirectory()) {
868
+ // Skip certain directories
869
+ if (entry.name === 'node_modules' || entry.name === '.git') {
870
+ continue;
871
+ }
872
+ await scanDirectory(fullPath);
873
+ } else if (entry.isFile()) {
874
+ const normalizedPath = path.normalize(fullPath);
875
+ const fileInfo = installedFilesMap.get(normalizedPath);
876
+
877
+ // Skip certain system files that are auto-generated
878
+ const relativePath = path.relative(bmadDir, fullPath);
879
+ const fileName = path.basename(fullPath);
880
+
881
+ // Skip _config directory EXCEPT for modified agent customizations
882
+ if (relativePath.startsWith('_config/') || relativePath.startsWith('_config\\')) {
883
+ // Special handling for .customize.yaml files - only preserve if modified
884
+ if (relativePath.includes('/agents/') && fileName.endsWith('.customize.yaml')) {
885
+ // Check if the customization file has been modified from manifest
886
+ const manifestPath = path.join(bmadDir, '_config', 'manifest.yaml');
887
+ if (await fs.pathExists(manifestPath)) {
888
+ const crypto = require('node:crypto');
889
+ const currentContent = await fs.readFile(fullPath, 'utf8');
890
+ const currentHash = crypto.createHash('sha256').update(currentContent).digest('hex');
891
+
892
+ const yaml = require('yaml');
893
+ const manifestContent = await fs.readFile(manifestPath, 'utf8');
894
+ const manifestData = yaml.parse(manifestContent);
895
+ const originalHash = manifestData.agentCustomizations?.[relativePath];
896
+
897
+ // Only add to customFiles if hash differs (user modified)
898
+ if (originalHash && currentHash !== originalHash) {
899
+ customFiles.push(fullPath);
900
+ }
901
+ }
902
+ }
903
+ continue;
904
+ }
905
+
906
+ if (bmadMemoryPaths.some((mp) => relativePath === mp || relativePath.startsWith(mp + '/'))) {
907
+ continue;
908
+ }
909
+
910
+ // Skip config.yaml files - these are regenerated on each install/update
911
+ if (fileName === 'config.yaml') {
912
+ continue;
913
+ }
914
+
915
+ if (!fileInfo) {
916
+ // File not in manifest = custom file
917
+ // EXCEPT: Agent .md files in module folders are generated files, not custom
918
+ // Only treat .md files under _config/agents/ as custom
919
+ if (!(fileName.endsWith('.md') && relativePath.includes('/agents/') && !relativePath.startsWith('_config/'))) {
920
+ customFiles.push(fullPath);
921
+ }
922
+ } else if (manifestHasHashes && fileInfo.hash) {
923
+ // File in manifest with hash - check if it was modified
924
+ const currentHash = await this.manifest.calculateFileHash(fullPath);
925
+ if (currentHash && currentHash !== fileInfo.hash) {
926
+ // Hash changed = file was modified
927
+ modifiedFiles.push({
928
+ path: fullPath,
929
+ relativePath: fileInfo.relativePath,
930
+ });
931
+ }
932
+ }
933
+ }
934
+ }
935
+ } catch {
936
+ // Ignore errors scanning directories
937
+ }
938
+ };
939
+
940
+ await scanDirectory(bmadDir);
941
+ return { customFiles, modifiedFiles };
942
+ }
943
+
944
+ /**
945
+ * Generate clean config.yaml files for each installed module
946
+ * @param {string} bmadDir - BMAD installation directory
947
+ * @param {Object} moduleConfigs - Collected configuration values
948
+ */
949
+ async generateModuleConfigs(bmadDir, moduleConfigs) {
950
+ const yaml = require('yaml');
951
+
952
+ // Extract core config values to share with other modules
953
+ const coreConfig = moduleConfigs.core || {};
954
+
955
+ // Get all installed module directories
956
+ const entries = await fs.readdir(bmadDir, { withFileTypes: true });
957
+ const nonModuleDirs = new Set(['_config', '_memory', 'memory', 'docs', 'scripts', 'custom']);
958
+ const installedModules = entries.filter((entry) => entry.isDirectory() && !nonModuleDirs.has(entry.name)).map((entry) => entry.name);
959
+
960
+ // Generate config.yaml for each installed module
961
+ for (const moduleName of installedModules) {
962
+ const modulePath = path.join(bmadDir, moduleName);
963
+
964
+ // Get module-specific config or use empty object if none
965
+ const config = moduleConfigs[moduleName] || {};
966
+
967
+ if (await fs.pathExists(modulePath)) {
968
+ const configPath = path.join(modulePath, 'config.yaml');
969
+
970
+ // Create header
971
+ const packageJson = require(path.join(getProjectRoot(), 'package.json'));
972
+ const header = `# ${moduleName.toUpperCase()} Module Configuration
973
+ # Generated by BMAD installer
974
+ # Version: ${packageJson.version}
975
+ # Date: ${new Date().toISOString()}
976
+
977
+ `;
978
+
979
+ // For non-core modules, add core config values directly
980
+ let finalConfig = { ...config };
981
+ let coreSection = '';
982
+
983
+ if (moduleName !== 'core' && coreConfig && Object.keys(coreConfig).length > 0) {
984
+ // Add core values directly to the module config
985
+ // These will be available for reference in the module
986
+ finalConfig = {
987
+ ...config,
988
+ ...coreConfig, // Spread core config values directly into the module config
989
+ };
990
+
991
+ // Create a comment section to identify core values
992
+ coreSection = '\n# Core Configuration Values\n';
993
+ }
994
+
995
+ // Clean the config to remove any non-serializable values (like functions)
996
+ const cleanConfig = structuredClone(finalConfig);
997
+
998
+ // Convert config to YAML
999
+ let yamlContent = yaml.stringify(cleanConfig, {
1000
+ indent: 2,
1001
+ lineWidth: 0,
1002
+ minContentWidth: 0,
1003
+ });
1004
+
1005
+ // If we have core values, reorganize the YAML to group them with their comment
1006
+ if (coreSection && moduleName !== 'core') {
1007
+ // Split the YAML into lines
1008
+ const lines = yamlContent.split('\n');
1009
+ const moduleConfigLines = [];
1010
+ const coreConfigLines = [];
1011
+
1012
+ // Separate module-specific and core config lines
1013
+ for (const line of lines) {
1014
+ const key = line.split(':')[0].trim();
1015
+ if (Object.prototype.hasOwnProperty.call(coreConfig, key)) {
1016
+ coreConfigLines.push(line);
1017
+ } else {
1018
+ moduleConfigLines.push(line);
1019
+ }
1020
+ }
1021
+
1022
+ // Rebuild YAML with module config first, then core config with comment
1023
+ yamlContent = moduleConfigLines.join('\n');
1024
+ if (coreConfigLines.length > 0) {
1025
+ yamlContent += coreSection + coreConfigLines.join('\n');
1026
+ }
1027
+ }
1028
+
1029
+ // Write the clean config file with POSIX-compliant final newline
1030
+ const content = header + yamlContent;
1031
+ await fs.writeFile(configPath, content.endsWith('\n') ? content : content + '\n', 'utf8');
1032
+
1033
+ // Track the config file in installedFiles
1034
+ this.installedFiles.add(configPath);
1035
+ }
1036
+ }
1037
+ }
1038
+
1039
+ /**
1040
+ * Merge all module-help.csv files into a single bmad-help.csv.
1041
+ * Scans all installed modules for module-help.csv and merges them.
1042
+ * Output preserves the source schema verbatim — see schema below.
1043
+ * @param {string} bmadDir - BMAD installation directory
1044
+ * @param {Array<Object>} _agentEntries - Unused; retained for call-site compatibility
1045
+ */
1046
+ async mergeModuleHelpCatalogs(bmadDir, _agentEntries = []) {
1047
+ const allRows = [];
1048
+ const headerRow = MODULE_HELP_CSV_HEADER;
1049
+ const COLUMN_COUNT = 13;
1050
+ const PHASE_INDEX = 7;
1051
+
1052
+ // Get all installed module directories
1053
+ const entries = await fs.readdir(bmadDir, { withFileTypes: true });
1054
+ const nonModuleDirs = new Set(['_config', '_memory', 'memory', 'docs', 'scripts', 'custom']);
1055
+ const installedModules = entries.filter((entry) => entry.isDirectory() && !nonModuleDirs.has(entry.name)).map((entry) => entry.name);
1056
+
1057
+ // Add core module to scan (it's installed at root level as _config, but we check src/core-skills)
1058
+ const coreModulePath = getSourcePath('core-skills');
1059
+ const modulePaths = new Map();
1060
+
1061
+ // Map all module source paths
1062
+ if (await fs.pathExists(coreModulePath)) {
1063
+ modulePaths.set('core', coreModulePath);
1064
+ }
1065
+
1066
+ // Map installed module paths
1067
+ for (const moduleName of installedModules) {
1068
+ const modulePath = path.join(bmadDir, moduleName);
1069
+ modulePaths.set(moduleName, modulePath);
1070
+ }
1071
+
1072
+ // Scan each module for module-help.csv
1073
+ for (const [moduleName, modulePath] of modulePaths) {
1074
+ const helpFilePath = path.join(modulePath, 'module-help.csv');
1075
+
1076
+ if (await fs.pathExists(helpFilePath)) {
1077
+ try {
1078
+ const content = await fs.readFile(helpFilePath, 'utf8');
1079
+ const lines = content.split('\n').filter((line) => line.trim() && !line.startsWith('#'));
1080
+
1081
+ let headerWarned = false;
1082
+ for (const line of lines) {
1083
+ // Header row: warn on drift from canonical schema, then skip.
1084
+ // Data rows are loaded positionally regardless, so the warning
1085
+ // is advisory — the maintainer should rename their columns.
1086
+ if (line.startsWith('module,')) {
1087
+ if (!headerWarned && line.trim() !== headerRow) {
1088
+ await prompts.log.warn(
1089
+ ` ${moduleName}/module-help.csv header does not match canonical schema. ` +
1090
+ `Expected: ${headerRow} | Found: ${line.trim()} | Data loaded positionally.`,
1091
+ );
1092
+ headerWarned = true;
1093
+ }
1094
+ continue;
1095
+ }
1096
+
1097
+ // Parse the line - handle quoted fields with commas
1098
+ const columns = this.parseCSVLine(line);
1099
+ if (columns.length < COLUMN_COUNT - 1) continue;
1100
+
1101
+ // Pad short rows; truncate over-long rows
1102
+ const padded = columns.slice(0, COLUMN_COUNT);
1103
+ while (padded.length < COLUMN_COUNT) padded.push('');
1104
+
1105
+ // If module column is empty, fill with this module's name
1106
+ // (core stays empty so its rows render as universal tools)
1107
+ if ((!padded[0] || padded[0].trim() === '') && moduleName !== 'core') {
1108
+ padded[0] = moduleName;
1109
+ }
1110
+
1111
+ allRows.push(padded.map((c) => this.escapeCSVField(c)).join(','));
1112
+ }
1113
+
1114
+ if (process.env.BMAD_VERBOSE_INSTALL === 'true') {
1115
+ await prompts.log.message(` Merged module-help from: ${moduleName}`);
1116
+ }
1117
+ } catch (error) {
1118
+ await prompts.log.warn(` Warning: Failed to read module-help.csv from ${moduleName}: ${error.message}`);
1119
+ }
1120
+ }
1121
+ }
1122
+
1123
+ // Sort by module, then phase. Stable sort preserves authored order within a phase.
1124
+ const decorated = allRows.map((row, index) => ({ row, index, cols: this.parseCSVLine(row) }));
1125
+ decorated.sort((a, b) => {
1126
+ const moduleA = (a.cols[0] || '').toLowerCase();
1127
+ const moduleB = (b.cols[0] || '').toLowerCase();
1128
+ if (moduleA !== moduleB) return moduleA.localeCompare(moduleB);
1129
+
1130
+ const phaseA = a.cols[PHASE_INDEX] || '';
1131
+ const phaseB = b.cols[PHASE_INDEX] || '';
1132
+ if (phaseA !== phaseB) return phaseA.localeCompare(phaseB);
1133
+
1134
+ return a.index - b.index;
1135
+ });
1136
+ const sortedRows = decorated.map((d) => d.row);
1137
+
1138
+ // Write merged catalog
1139
+ const outputDir = path.join(bmadDir, '_config');
1140
+ await fs.ensureDir(outputDir);
1141
+ const outputPath = path.join(outputDir, 'bmad-help.csv');
1142
+
1143
+ const mergedContent = [headerRow, ...sortedRows].join('\n');
1144
+ await fs.writeFile(outputPath, mergedContent, 'utf8');
1145
+
1146
+ // Track the installed file
1147
+ this.installedFiles.add(outputPath);
1148
+
1149
+ if (process.env.BMAD_VERBOSE_INSTALL === 'true') {
1150
+ await prompts.log.message(` Generated bmad-help.csv: ${sortedRows.length} workflows`);
1151
+ }
1152
+ }
1153
+
1154
+ /**
1155
+ * Render a consolidated install summary using prompts.note()
1156
+ * @param {Array} results - Array of {step, status: 'ok'|'error'|'warn', detail}
1157
+ * @param {Object} context - {bmadDir, modules, ides, customFiles, modifiedFiles}
1158
+ */
1159
+ async renderInstallSummary(results, context = {}) {
1160
+ const color = await prompts.getColor();
1161
+ const selectedIdes = new Set((context.ides || []).map((ide) => String(ide).toLowerCase()));
1162
+
1163
+ // Build step lines with status indicators
1164
+ const preVersions = context.preInstallVersions || new Map();
1165
+ const lines = [];
1166
+ for (const r of results) {
1167
+ const stepLabel = r.step;
1168
+
1169
+ let icon;
1170
+ if (r.status === 'ok') {
1171
+ icon = color.green('\u2713');
1172
+ } else if (r.status === 'warn') {
1173
+ icon = color.yellow('!');
1174
+ } else {
1175
+ icon = color.red('\u2717');
1176
+ }
1177
+
1178
+ // Build version detail for module results
1179
+ let detail = '';
1180
+ if (r.moduleCode && r.newVersion) {
1181
+ const oldVersion = preVersions.get(r.moduleCode);
1182
+ // Format a version label for display:
1183
+ // "main" → "main @ <short-sha>" (next channel shows what SHA landed)
1184
+ // "v1.7.0" or "1.7.0" → "v1.7.0" (prefix 'v' when missing)
1185
+ // anything else (legacy strings) → as-is
1186
+ const fmt = (v, sha) => {
1187
+ if (typeof v !== 'string' || !v) return '';
1188
+ if (v === 'main' || v === 'HEAD') return sha ? `main @ ${sha.slice(0, 7)}` : 'main';
1189
+ if (/^v?\d+\.\d+\.\d+/.test(v)) return v.startsWith('v') ? v : `v${v}`;
1190
+ return v;
1191
+ };
1192
+ const newV = fmt(r.newVersion, r.newSha);
1193
+ // 'main'/'HEAD' strings only identify the channel, not the commit, so
1194
+ // we can't assert "no change" without comparing SHAs — and preVersions
1195
+ // doesn't carry the old SHA. Render these as a refresh instead of a
1196
+ // false-negative "no change".
1197
+ const isMainLike = oldVersion === 'main' || oldVersion === 'HEAD';
1198
+ if (oldVersion && oldVersion === r.newVersion && !isMainLike) {
1199
+ detail = ` (${newV}, no change)`;
1200
+ } else if (oldVersion && isMainLike) {
1201
+ detail = ` (${newV}, refreshed)`;
1202
+ } else if (oldVersion) {
1203
+ detail = ` (${fmt(oldVersion, r.newSha)} → ${newV})`;
1204
+ } else {
1205
+ detail = ` (${newV}, installed)`;
1206
+ }
1207
+ } else if (r.detail) {
1208
+ detail = ` (${r.detail})`;
1209
+ }
1210
+ lines.push(` ${icon} ${stepLabel}${detail}`);
1211
+ }
1212
+
1213
+ if ((context.ides || []).length === 0) {
1214
+ lines.push(` ${color.green('\u2713')} No IDE selected (installed in _bmad only)`);
1215
+ }
1216
+
1217
+ // Context and warnings
1218
+ lines.push('');
1219
+ if (context.bmadDir) {
1220
+ lines.push(` Installed to: ${context.bmadDir}`);
1221
+ }
1222
+ if (context.customFiles && context.customFiles.length > 0) {
1223
+ lines.push(` ${color.cyan(`Custom files preserved: ${context.customFiles.length}`)}`);
1224
+ }
1225
+ if (context.modifiedFiles && context.modifiedFiles.length > 0) {
1226
+ lines.push(` ${color.yellow(`Modified files backed up (.bak): ${context.modifiedFiles.length}`)}`);
1227
+ }
1228
+
1229
+ // Next steps
1230
+ lines.push(
1231
+ '',
1232
+ ' Get started:',
1233
+ ` 1. Launch your AI agent from your project folder`,
1234
+ ` 2. Not sure what to do? Invoke the ${color.cyan('bmad-help')} skill and ask it what to do!`,
1235
+ '',
1236
+ ` Blog, Docs and Guides: ${color.blue('https://bmadcode.com/')}`,
1237
+ ` Community: ${color.blue('https://discord.gg/gk8jAdXWmj')}`,
1238
+ );
1239
+
1240
+ await prompts.box(lines.join('\n'), 'BMAD is ready to use!', {
1241
+ rounded: true,
1242
+ formatBorder: color.green,
1243
+ });
1244
+ }
1245
+
1246
+ /**
1247
+ * Quick update method - preserves all settings and only prompts for new config fields
1248
+ * @param {Object} config - Configuration with directory
1249
+ * @returns {Object} Update result
1250
+ */
1251
+ async quickUpdate(config) {
1252
+ const projectDir = path.resolve(config.directory);
1253
+ const { bmadDir } = await this.findBmadDir(projectDir);
1254
+
1255
+ // Check if bmad directory exists
1256
+ if (!(await fs.pathExists(bmadDir))) {
1257
+ throw new Error(`BMAD not installed at ${bmadDir}. Use regular install for first-time setup.`);
1258
+ }
1259
+
1260
+ // Detect existing installation
1261
+ const existingInstall = await ExistingInstall.detect(bmadDir);
1262
+ const installedModules = existingInstall.moduleIds;
1263
+ const configuredIdes = existingInstall.ides;
1264
+ const projectRoot = path.dirname(bmadDir);
1265
+
1266
+ // Get available modules (what we have source for)
1267
+ const availableModulesData = await new OfficialModules().listAvailable();
1268
+ const availableModules = [...availableModulesData.modules];
1269
+
1270
+ // Add external official modules to available modules
1271
+ const externalModules = await this.externalModuleManager.listAvailable();
1272
+ for (const externalModule of externalModules) {
1273
+ if (installedModules.includes(externalModule.code) && !availableModules.some((m) => m.id === externalModule.code)) {
1274
+ availableModules.push({
1275
+ id: externalModule.code,
1276
+ name: externalModule.name,
1277
+ isExternal: true,
1278
+ fromExternal: true,
1279
+ });
1280
+ }
1281
+ }
1282
+
1283
+ // Add installed custom modules to available modules
1284
+ const { CustomModuleManager } = require('../modules/custom-module-manager');
1285
+ const customMgr = new CustomModuleManager();
1286
+ for (const moduleId of installedModules) {
1287
+ if (!availableModules.some((m) => m.id === moduleId)) {
1288
+ const customSource = await customMgr.findModuleSourceByCode(moduleId, { bmadDir });
1289
+ if (customSource) {
1290
+ availableModules.push({
1291
+ id: moduleId,
1292
+ name: moduleId,
1293
+ isExternal: true,
1294
+ fromCustom: true,
1295
+ });
1296
+ }
1297
+ }
1298
+ }
1299
+
1300
+ const availableModuleIds = new Set(availableModules.map((m) => m.id));
1301
+
1302
+ // Only update modules that are BOTH installed AND available (we have source for)
1303
+ const modulesToUpdate = installedModules.filter((id) => availableModuleIds.has(id));
1304
+ const skippedModules = installedModules.filter((id) => !availableModuleIds.has(id));
1305
+
1306
+ if (skippedModules.length > 0) {
1307
+ await prompts.log.warn(`Skipping ${skippedModules.length} module(s) - no source available: ${skippedModules.join(', ')}`);
1308
+ }
1309
+
1310
+ // Build channel options from the existing manifest FIRST so the config
1311
+ // collector below (which triggers external-module clones via
1312
+ // findModuleSource) knows each module's recorded channel and doesn't
1313
+ // silently redecide it. Without this, modules previously on 'next' or
1314
+ // 'pinned' would trigger a stable-channel tag lookup at config-collection
1315
+ // time, burning GitHub API quota and potentially failing.
1316
+ const manifestData = await this.manifest.read(bmadDir);
1317
+ const channelOptions = { global: null, nextSet: new Set(), pins: new Map(), warnings: [] };
1318
+ if (manifestData?.modulesDetailed) {
1319
+ const { fetchStableTags, classifyUpgrade, parseGitHubRepo } = require('../modules/channel-resolver');
1320
+ for (const entry of manifestData.modulesDetailed) {
1321
+ if (!entry?.name || !entry?.channel) continue;
1322
+ if (entry.channel === 'pinned' && entry.version) {
1323
+ channelOptions.pins.set(entry.name, entry.version);
1324
+ continue;
1325
+ }
1326
+ if (entry.channel === 'next') {
1327
+ channelOptions.nextSet.add(entry.name);
1328
+ continue;
1329
+ }
1330
+ // Stable: classify the available upgrade. Patches and minors fall
1331
+ // through (stable default picks up the top tag). A major upgrade
1332
+ // requires opt-in, so under quick-update's non-interactive semantics
1333
+ // we pin to the current version to prevent a silent breaking jump.
1334
+ if (entry.channel === 'stable' && entry.version && entry.repoUrl) {
1335
+ const parsed = parseGitHubRepo(entry.repoUrl);
1336
+ if (!parsed) continue;
1337
+ try {
1338
+ const tags = await fetchStableTags(parsed.owner, parsed.repo);
1339
+ if (tags.length === 0) continue;
1340
+ const topTag = tags[0].tag;
1341
+ const cls = classifyUpgrade(entry.version, topTag);
1342
+ if (cls === 'major') {
1343
+ channelOptions.pins.set(entry.name, entry.version);
1344
+ await prompts.log.warn(
1345
+ `${entry.name} ${entry.version} → ${topTag} is a new major release; staying on ${entry.version}. ` +
1346
+ `Run \`bmad install\` (Modify) with \`--pin ${entry.name}=${topTag}\` to accept.`,
1347
+ );
1348
+ }
1349
+ } catch (error) {
1350
+ // Tag lookup failed (offline, rate-limited). Stay on the current
1351
+ // version rather than guessing — the existing cache is already
1352
+ // at that ref, so re-using it keeps the install stable.
1353
+ channelOptions.pins.set(entry.name, entry.version);
1354
+ await prompts.log.warn(`Could not check ${entry.name} for updates (${error.message}); staying on ${entry.version}.`);
1355
+ }
1356
+ }
1357
+ }
1358
+ }
1359
+
1360
+ // Load existing configs and collect new fields (if any)
1361
+ await prompts.log.info('Checking for new configuration options...');
1362
+ const quickModules = new OfficialModules({ channelOptions });
1363
+ await quickModules.loadExistingConfig(projectDir);
1364
+
1365
+ let promptedForNewFields = false;
1366
+
1367
+ const corePrompted = await quickModules.collectModuleConfigQuick('core', projectDir, true);
1368
+ if (corePrompted) {
1369
+ promptedForNewFields = true;
1370
+ }
1371
+
1372
+ for (const moduleName of modulesToUpdate) {
1373
+ if (moduleName === 'core') continue; // Already collected above
1374
+ const modulePrompted = await quickModules.collectModuleConfigQuick(moduleName, projectDir, true);
1375
+ if (modulePrompted) {
1376
+ promptedForNewFields = true;
1377
+ }
1378
+ }
1379
+
1380
+ if (!promptedForNewFields) {
1381
+ await prompts.log.success('All configuration is up to date, no new options to configure');
1382
+ }
1383
+
1384
+ quickModules.collectedConfig._meta = {
1385
+ version: require(path.join(getProjectRoot(), 'package.json')).version,
1386
+ installDate: new Date().toISOString(),
1387
+ lastModified: new Date().toISOString(),
1388
+ };
1389
+
1390
+ // Build config and delegate to install()
1391
+ const installConfig = {
1392
+ directory: projectDir,
1393
+ modules: modulesToUpdate,
1394
+ ides: configuredIdes,
1395
+ coreConfig: quickModules.collectedConfig.core,
1396
+ moduleConfigs: quickModules.collectedConfig,
1397
+ // Forward `--set` overrides so the post-install patch step
1398
+ // (`applySetOverrides`) runs at the end of quick-update too. The
1399
+ // installer.install path applies them after writeCentralConfig.
1400
+ setOverrides: config.setOverrides || {},
1401
+ actionType: 'install',
1402
+ _quickUpdate: true,
1403
+ _preserveModules: skippedModules,
1404
+ _existingModules: installedModules,
1405
+ channelOptions,
1406
+ };
1407
+
1408
+ await this.install(installConfig);
1409
+
1410
+ return {
1411
+ success: true,
1412
+ moduleCount: modulesToUpdate.length,
1413
+ hadNewFields: promptedForNewFields,
1414
+ modules: modulesToUpdate,
1415
+ skippedModules: skippedModules,
1416
+ ides: configuredIdes,
1417
+ };
1418
+ }
1419
+
1420
+ /**
1421
+ * Uninstall BMAD with selective removal options
1422
+ * @param {string} directory - Project directory
1423
+ * @param {Object} options - Uninstall options
1424
+ * @param {boolean} [options.removeModules=true] - Remove _bmad/ directory
1425
+ * @param {boolean} [options.removeIdeConfigs=true] - Remove IDE configurations
1426
+ * @param {boolean} [options.removeOutputFolder=false] - Remove user artifacts output folder
1427
+ * @returns {Object} Result with success status and removed components
1428
+ */
1429
+ async uninstall(directory, options = {}) {
1430
+ const projectDir = path.resolve(directory);
1431
+ const { bmadDir } = await this.findBmadDir(projectDir);
1432
+
1433
+ if (!(await fs.pathExists(bmadDir))) {
1434
+ return { success: false, reason: 'not-installed' };
1435
+ }
1436
+
1437
+ // 1. DETECT: Read state BEFORE deleting anything
1438
+ const existingInstall = await ExistingInstall.detect(bmadDir);
1439
+ const outputFolder = await this._readOutputFolder(bmadDir);
1440
+
1441
+ const removed = { modules: false, ideConfigs: false, outputFolder: false };
1442
+
1443
+ // 2. IDE CLEANUP (before _bmad/ deletion so configs are accessible)
1444
+ if (options.removeIdeConfigs !== false) {
1445
+ await this.uninstallIdeConfigs(projectDir, existingInstall, { silent: options.silent });
1446
+ removed.ideConfigs = true;
1447
+ }
1448
+
1449
+ // 3. OUTPUT FOLDER (only if explicitly requested)
1450
+ if (options.removeOutputFolder === true && outputFolder) {
1451
+ removed.outputFolder = await this.uninstallOutputFolder(projectDir, outputFolder);
1452
+ }
1453
+
1454
+ // 4. BMAD DIRECTORY (last, after everything that needs it)
1455
+ if (options.removeModules !== false) {
1456
+ removed.modules = await this.uninstallModules(projectDir);
1457
+ }
1458
+
1459
+ return { success: true, removed, version: existingInstall.installed ? existingInstall.version : null };
1460
+ }
1461
+
1462
+ /**
1463
+ * Uninstall IDE configurations only
1464
+ * @param {string} projectDir - Project directory
1465
+ * @param {Object} existingInstall - Detection result from detector.detect()
1466
+ * @param {Object} [options] - Options (e.g. { silent: true })
1467
+ * @returns {Promise<Object>} Results from IDE cleanup
1468
+ */
1469
+ async uninstallIdeConfigs(projectDir, existingInstall, options = {}) {
1470
+ await this.ideManager.ensureInitialized();
1471
+ const cleanupOptions = { isUninstall: true, silent: options.silent };
1472
+ const ideList = existingInstall.ides;
1473
+ if (ideList.length > 0) {
1474
+ return this.ideManager.cleanupByList(projectDir, ideList, cleanupOptions);
1475
+ }
1476
+ return this.ideManager.cleanup(projectDir, cleanupOptions);
1477
+ }
1478
+
1479
+ /**
1480
+ * Remove user artifacts output folder
1481
+ * @param {string} projectDir - Project directory
1482
+ * @param {string} outputFolder - Output folder name (relative)
1483
+ * @returns {Promise<boolean>} Whether the folder was removed
1484
+ */
1485
+ async uninstallOutputFolder(projectDir, outputFolder) {
1486
+ if (!outputFolder) return false;
1487
+ const resolvedProject = path.resolve(projectDir);
1488
+ const outputPath = path.resolve(resolvedProject, outputFolder);
1489
+ if (!outputPath.startsWith(resolvedProject + path.sep)) {
1490
+ return false;
1491
+ }
1492
+ if (await fs.pathExists(outputPath)) {
1493
+ await fs.remove(outputPath);
1494
+ return true;
1495
+ }
1496
+ return false;
1497
+ }
1498
+
1499
+ /**
1500
+ * Remove the _bmad/ directory
1501
+ * @param {string} projectDir - Project directory
1502
+ * @returns {Promise<boolean>} Whether the directory was removed
1503
+ */
1504
+ async uninstallModules(projectDir) {
1505
+ const { bmadDir } = await this.findBmadDir(projectDir);
1506
+ if (await fs.pathExists(bmadDir)) {
1507
+ await fs.remove(bmadDir);
1508
+ return true;
1509
+ }
1510
+ return false;
1511
+ }
1512
+
1513
+ /**
1514
+ * Get installation status
1515
+ */
1516
+ async getStatus(directory) {
1517
+ const projectDir = path.resolve(directory);
1518
+ const { bmadDir } = await this.findBmadDir(projectDir);
1519
+ return await ExistingInstall.detect(bmadDir);
1520
+ }
1521
+
1522
+ /**
1523
+ * Get available modules
1524
+ */
1525
+ async getAvailableModules() {
1526
+ return await new OfficialModules().listAvailable();
1527
+ }
1528
+
1529
+ /**
1530
+ * Get the configured output folder name for a project
1531
+ * Resolves bmadDir internally from projectDir
1532
+ * @param {string} projectDir - Project directory
1533
+ * @returns {string} Output folder name (relative, default: '_bmad-output')
1534
+ */
1535
+ async getOutputFolder(projectDir) {
1536
+ const { bmadDir } = await this.findBmadDir(projectDir);
1537
+ return this._readOutputFolder(bmadDir);
1538
+ }
1539
+
1540
+ /**
1541
+ * Find the bmad installation directory in a project
1542
+ * Always uses the standard _bmad folder name
1543
+ * @param {string} projectDir - Project directory
1544
+ * @returns {Promise<Object>} { bmadDir: string }
1545
+ */
1546
+ async findBmadDir(projectDir) {
1547
+ const bmadDir = path.join(projectDir, BMAD_FOLDER_NAME);
1548
+ return { bmadDir };
1549
+ }
1550
+
1551
+ /**
1552
+ * Read the output_folder setting from module config files
1553
+ * Checks bmm/config.yaml first, then other module configs
1554
+ * @param {string} bmadDir - BMAD installation directory
1555
+ * @returns {string} Output folder path or default
1556
+ */
1557
+ async _readOutputFolder(bmadDir) {
1558
+ const yaml = require('yaml');
1559
+
1560
+ // Check bmm/config.yaml first (most common)
1561
+ const bmmConfigPath = path.join(bmadDir, 'bmm', 'config.yaml');
1562
+ if (await fs.pathExists(bmmConfigPath)) {
1563
+ try {
1564
+ const content = await fs.readFile(bmmConfigPath, 'utf8');
1565
+ const config = yaml.parse(content);
1566
+ if (config && config.output_folder) {
1567
+ // Strip {project-root}/ prefix if present
1568
+ return config.output_folder.replace(/^\{project-root\}[/\\]/, '');
1569
+ }
1570
+ } catch {
1571
+ // Fall through to other modules
1572
+ }
1573
+ }
1574
+
1575
+ // Scan other module config.yaml files
1576
+ try {
1577
+ const entries = await fs.readdir(bmadDir, { withFileTypes: true });
1578
+ for (const entry of entries) {
1579
+ if (!entry.isDirectory() || entry.name === 'bmm' || entry.name.startsWith('_')) continue;
1580
+ const configPath = path.join(bmadDir, entry.name, 'config.yaml');
1581
+ if (await fs.pathExists(configPath)) {
1582
+ try {
1583
+ const content = await fs.readFile(configPath, 'utf8');
1584
+ const config = yaml.parse(content);
1585
+ if (config && config.output_folder) {
1586
+ return config.output_folder.replace(/^\{project-root\}[/\\]/, '');
1587
+ }
1588
+ } catch {
1589
+ // Continue scanning
1590
+ }
1591
+ }
1592
+ }
1593
+ } catch {
1594
+ // Directory scan failed
1595
+ }
1596
+
1597
+ // Default fallback
1598
+ return '_bmad-output';
1599
+ }
1600
+
1601
+ /**
1602
+ * Parse a CSV line, handling quoted fields
1603
+ * @param {string} line - CSV line to parse
1604
+ * @returns {Array} Array of field values
1605
+ */
1606
+ parseCSVLine(line) {
1607
+ const result = [];
1608
+ let current = '';
1609
+ let inQuotes = false;
1610
+
1611
+ for (let i = 0; i < line.length; i++) {
1612
+ const char = line[i];
1613
+ const nextChar = line[i + 1];
1614
+
1615
+ if (char === '"') {
1616
+ if (inQuotes && nextChar === '"') {
1617
+ // Escaped quote
1618
+ current += '"';
1619
+ i++; // Skip next quote
1620
+ } else {
1621
+ // Toggle quote mode
1622
+ inQuotes = !inQuotes;
1623
+ }
1624
+ } else if (char === ',' && !inQuotes) {
1625
+ result.push(current);
1626
+ current = '';
1627
+ } else {
1628
+ current += char;
1629
+ }
1630
+ }
1631
+ result.push(current);
1632
+ return result;
1633
+ }
1634
+
1635
+ /**
1636
+ * Escape a CSV field if it contains special characters
1637
+ * @param {string} field - Field value to escape
1638
+ * @returns {string} Escaped field
1639
+ */
1640
+ escapeCSVField(field) {
1641
+ if (field === null || field === undefined) {
1642
+ return '';
1643
+ }
1644
+ const str = String(field);
1645
+ // If field contains comma, quote, or newline, wrap in quotes and escape inner quotes
1646
+ if (str.includes(',') || str.includes('"') || str.includes('\n')) {
1647
+ return `"${str.replaceAll('"', '""')}"`;
1648
+ }
1649
+ return str;
1650
+ }
1651
+ }
1652
+
1653
+ module.exports = { Installer };