ma-agents 2.22.1 → 3.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 (480) hide show
  1. package/.opencode/skills/.ma-agents.json +99 -99
  2. package/lib/bmad-cache/bmb/.claude-plugin/marketplace.json +22 -0
  3. package/lib/bmad-cache/bmb/.markdownlint-cli2.yaml +1 -0
  4. package/lib/bmad-cache/bmb/_git_preserved/index +0 -0
  5. package/lib/bmad-cache/bmb/_git_preserved/logs/HEAD +1 -1
  6. package/lib/bmad-cache/bmb/_git_preserved/logs/refs/heads/main +1 -1
  7. package/lib/bmad-cache/bmb/_git_preserved/logs/refs/remotes/origin/HEAD +1 -1
  8. package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-0de89e0854d5b2b3b3b0c1ee56eee73a739f15e7.idx +0 -0
  9. package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-0de89e0854d5b2b3b3b0c1ee56eee73a739f15e7.pack +0 -0
  10. package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-0de89e0854d5b2b3b3b0c1ee56eee73a739f15e7.rev +0 -0
  11. package/lib/bmad-cache/bmb/_git_preserved/packed-refs +1 -1
  12. package/lib/bmad-cache/bmb/_git_preserved/refs/heads/main +1 -1
  13. package/lib/bmad-cache/bmb/_git_preserved/shallow +1 -1
  14. package/lib/bmad-cache/bmb/package-lock.json +2 -2
  15. package/lib/bmad-cache/bmb/package.json +7 -4
  16. package/lib/bmad-cache/bmb/skills/bmad-agent-builder/scripts/generate-html-report.py +534 -0
  17. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-agent-builder/scripts/prepass-execution-deps.py +4 -35
  18. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-agent-builder/scripts/prepass-prompt-metrics.py +2 -75
  19. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-agent-builder/scripts/prepass-structure-capabilities.py +3 -194
  20. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-agent-builder/scripts/scan-path-standards.py +104 -18
  21. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/assets/module-help.csv +6 -0
  22. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/assets/module.yaml +20 -0
  23. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/scripts/cleanup-legacy.py +259 -0
  24. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/scripts/merge-config.py +408 -0
  25. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/scripts/merge-help-csv.py +220 -0
  26. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/scripts/tests/test-cleanup-legacy.py +429 -0
  27. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/scripts/tests/test-merge-config.py +644 -0
  28. package/lib/bmad-cache/bmb/skills/bmad-builder-setup/scripts/tests/test-merge-help-csv.py +237 -0
  29. package/lib/bmad-cache/bmb/skills/bmad-workflow-builder/scripts/generate-html-report.py +539 -0
  30. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-workflow-builder/scripts/prepass-execution-deps.py +5 -30
  31. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-workflow-builder/scripts/prepass-workflow-integrity.py +0 -5
  32. package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-workflow-builder/scripts/scan-path-standards.py +103 -16
  33. package/lib/bmad-cache/bmb/skills/module-help.csv +6 -0
  34. package/lib/bmad-cache/bmb/skills/module.yaml +20 -0
  35. package/lib/bmad-cache/bmb/tools/validate-doc-links.cjs +407 -0
  36. package/lib/bmad-cache/bmb/tools/validate-file-refs.mjs +1 -1
  37. package/lib/bmad-cache/cache-manifest.json +16 -10
  38. package/lib/bmad-cache/cis/.claude-plugin/marketplace.json +33 -0
  39. package/lib/bmad-cache/cis/_git_preserved/index +0 -0
  40. package/lib/bmad-cache/cis/_git_preserved/logs/HEAD +1 -1
  41. package/lib/bmad-cache/cis/_git_preserved/logs/refs/heads/main +1 -1
  42. package/lib/bmad-cache/cis/_git_preserved/logs/refs/remotes/origin/HEAD +1 -1
  43. package/lib/bmad-cache/cis/_git_preserved/objects/pack/pack-9d60aae6b09bbea0d0c5e79fdbe96e8f66de84e6.idx +0 -0
  44. package/lib/bmad-cache/cis/_git_preserved/objects/pack/{pack-157d7eb8d527233a8607d926fc74ebf87f2ae0d3.pack → pack-9d60aae6b09bbea0d0c5e79fdbe96e8f66de84e6.pack} +0 -0
  45. package/lib/bmad-cache/cis/_git_preserved/objects/pack/pack-9d60aae6b09bbea0d0c5e79fdbe96e8f66de84e6.rev +0 -0
  46. package/lib/bmad-cache/cis/_git_preserved/packed-refs +1 -1
  47. package/lib/bmad-cache/cis/_git_preserved/refs/heads/main +1 -1
  48. package/lib/bmad-cache/cis/_git_preserved/shallow +1 -1
  49. package/lib/bmad-cache/cis/package-lock.json +17015 -0
  50. package/lib/bmad-cache/cis/package.json +3 -4
  51. package/lib/bmad-cache/cis/src/module-help.csv +6 -6
  52. package/lib/bmad-cache/cis/src/skills/bmad-cis-agent-brainstorming-coach/bmad-skill-manifest.yaml +11 -0
  53. package/lib/bmad-cache/cis/src/skills/bmad-cis-agent-creative-problem-solver/bmad-skill-manifest.yaml +11 -0
  54. package/lib/bmad-cache/cis/src/skills/bmad-cis-agent-design-thinking-coach/bmad-skill-manifest.yaml +11 -0
  55. package/lib/bmad-cache/cis/src/skills/bmad-cis-agent-innovation-strategist/bmad-skill-manifest.yaml +11 -0
  56. package/lib/bmad-cache/cis/src/skills/bmad-cis-agent-presentation-master/bmad-skill-manifest.yaml +11 -0
  57. package/lib/bmad-cache/cis/src/skills/bmad-cis-agent-storyteller/bmad-skill-manifest.yaml +11 -0
  58. package/lib/bmad-cache/gds/.claude-plugin/marketplace.json +58 -0
  59. package/lib/bmad-cache/gds/_git_preserved/index +0 -0
  60. package/lib/bmad-cache/gds/_git_preserved/logs/HEAD +1 -1
  61. package/lib/bmad-cache/gds/_git_preserved/logs/refs/heads/main +1 -1
  62. package/lib/bmad-cache/gds/_git_preserved/logs/refs/remotes/origin/HEAD +1 -1
  63. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-8099a88fca0ad946a573316a00887a2921ca1712.idx +0 -0
  64. package/lib/bmad-cache/gds/_git_preserved/objects/pack/{pack-44faafb9245b4ca17ad81bd6c9e6fc52fb5915a1.pack → pack-8099a88fca0ad946a573316a00887a2921ca1712.pack} +0 -0
  65. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-8099a88fca0ad946a573316a00887a2921ca1712.rev +0 -0
  66. package/lib/bmad-cache/gds/_git_preserved/packed-refs +1 -1
  67. package/lib/bmad-cache/gds/_git_preserved/refs/heads/main +1 -1
  68. package/lib/bmad-cache/gds/_git_preserved/shallow +1 -1
  69. package/lib/bmad-cache/gds/package.json +1 -0
  70. package/lib/bmad-cache/gds/src/module-help.csv +35 -35
  71. package/lib/bmad-cache/tea/.claude-plugin/marketplace.json +33 -0
  72. package/lib/bmad-cache/tea/CHANGELOG.md +2 -14
  73. package/lib/bmad-cache/tea/README.md +31 -18
  74. package/lib/bmad-cache/tea/_git_preserved/index +0 -0
  75. package/lib/bmad-cache/tea/_git_preserved/objects/pack/pack-d243f64f83b36190434d68872a69a40870c53030.idx +0 -0
  76. package/lib/bmad-cache/tea/_git_preserved/objects/pack/{pack-96ec1ce3a9ef4c891e00e060795b4434ba8f7163.pack → pack-d243f64f83b36190434d68872a69a40870c53030.pack} +0 -0
  77. package/lib/bmad-cache/tea/_git_preserved/objects/pack/pack-d243f64f83b36190434d68872a69a40870c53030.rev +0 -0
  78. package/lib/bmad-cache/tea/_git_preserved/packed-refs +1 -1
  79. package/lib/bmad-cache/tea/_git_preserved/refs/heads/main +1 -1
  80. package/lib/bmad-cache/tea/_git_preserved/refs/tags/v1.7.3 +1 -0
  81. package/lib/bmad-cache/tea/_git_preserved/shallow +1 -1
  82. package/lib/bmad-cache/tea/docs/explanation/knowledge-base-system.md +5 -5
  83. package/lib/bmad-cache/tea/docs/explanation/step-file-architecture.md +2 -2
  84. package/lib/bmad-cache/tea/docs/explanation/tea-overview.md +3 -3
  85. package/lib/bmad-cache/tea/docs/glossary/index.md +1 -1
  86. package/lib/bmad-cache/tea/docs/how-to/customization/extend-tea-with-custom-workflows.md +73 -0
  87. package/lib/bmad-cache/tea/docs/how-to/workflows/teach-me-testing.md +7 -7
  88. package/lib/bmad-cache/tea/docs/index.md +2 -1
  89. package/lib/bmad-cache/tea/docs/reference/commands.md +4 -1
  90. package/lib/bmad-cache/tea/docs/reference/configuration.md +37 -15
  91. package/lib/bmad-cache/tea/docs/reference/knowledge-base.md +75 -73
  92. package/lib/bmad-cache/tea/docs/reference/troubleshooting.md +32 -19
  93. package/lib/bmad-cache/tea/docs/tutorials/learn-testing-tea-academy.md +3 -3
  94. package/lib/bmad-cache/tea/package-lock.json +2 -2
  95. package/lib/bmad-cache/tea/package.json +2 -1
  96. package/lib/bmad-cache/tea/src/agents/bmad-tea/SKILL.md +70 -0
  97. package/lib/bmad-cache/tea/src/agents/bmad-tea/bmad-skill-manifest.yaml +14 -0
  98. package/lib/bmad-cache/tea/src/module-help.csv +10 -10
  99. package/lib/bmad-cache/tea/src/module.yaml +8 -8
  100. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/checklist.md +1 -1
  101. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/data/curriculum.yaml +1 -1
  102. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/data/session-content-map.yaml +26 -14
  103. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/data/tea-resources-index.yaml +108 -73
  104. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/instructions.md +2 -2
  105. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-03-session-menu.md +1 -1
  106. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-01.md +3 -3
  107. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-04-session-07.md +14 -6
  108. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/steps-c/step-05-completion.md +3 -3
  109. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/templates/certificate-template.md +1 -1
  110. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-teach-me-testing/workflow-plan-teach-me-testing.md +8 -8
  111. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-atdd/atdd-checklist-template.md +1 -1
  112. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-01-preflight-and-context.md +3 -3
  113. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-atdd/steps-c/step-04a-subagent-api-failing.md +9 -1
  114. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-automate/steps-c/step-01-preflight-and-context.md +1 -1
  115. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-automate/steps-c/step-03b-subagent-e2e.md +2 -2
  116. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-ci/steps-c/step-02-generate-pipeline.md +6 -0
  117. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-ci/steps-c/step-03-configure-quality-gates.md +6 -1
  118. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-framework/steps-c/step-03-scaffold-framework.md +3 -2
  119. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-nfr/steps-c/step-01-load-context.md +1 -1
  120. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-test-design/steps-c/step-02-load-context.md +1 -1
  121. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-test-review/steps-c/step-01-load-context.md +1 -1
  122. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-test-review/test-review-template.md +11 -11
  123. package/lib/bmad-cache/tea/src/workflows/testarch/bmad-testarch-trace/steps-c/step-01-load-context.md +1 -1
  124. package/lib/bmad-cache/tea/test/test-installation-components.js +85 -21
  125. package/lib/bmad-cache/tea/test/test-knowledge-base.js +1 -1
  126. package/lib/bmad-cache/tea/tools/validate-agent-schema.js +105 -5
  127. package/lib/bmad-cache/wds/.claude-plugin/marketplace.json +35 -0
  128. package/lib/bmad-cache/wds/.markdownlint-cli2.yaml +38 -0
  129. package/lib/bmad-cache/wds/.nvmrc +1 -0
  130. package/lib/bmad-cache/wds/.prettierignore +9 -0
  131. package/lib/bmad-cache/wds/LICENSE +27 -0
  132. package/lib/bmad-cache/wds/README.md +126 -0
  133. package/lib/bmad-cache/wds/_git_preserved/HEAD +1 -0
  134. package/lib/bmad-cache/wds/_git_preserved/config +13 -0
  135. package/lib/bmad-cache/wds/_git_preserved/description +1 -0
  136. package/lib/bmad-cache/wds/_git_preserved/hooks/applypatch-msg.sample +15 -0
  137. package/lib/bmad-cache/wds/_git_preserved/hooks/commit-msg.sample +24 -0
  138. package/lib/bmad-cache/wds/_git_preserved/hooks/fsmonitor-watchman.sample +174 -0
  139. package/lib/bmad-cache/wds/_git_preserved/hooks/post-update.sample +8 -0
  140. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-applypatch.sample +14 -0
  141. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-commit.sample +49 -0
  142. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-merge-commit.sample +13 -0
  143. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-push.sample +53 -0
  144. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-rebase.sample +169 -0
  145. package/lib/bmad-cache/wds/_git_preserved/hooks/pre-receive.sample +24 -0
  146. package/lib/bmad-cache/wds/_git_preserved/hooks/prepare-commit-msg.sample +42 -0
  147. package/lib/bmad-cache/wds/_git_preserved/hooks/push-to-checkout.sample +78 -0
  148. package/lib/bmad-cache/wds/_git_preserved/hooks/sendemail-validate.sample +77 -0
  149. package/lib/bmad-cache/wds/_git_preserved/hooks/update.sample +128 -0
  150. package/lib/bmad-cache/wds/_git_preserved/index +0 -0
  151. package/lib/bmad-cache/wds/_git_preserved/info/exclude +6 -0
  152. package/lib/bmad-cache/wds/_git_preserved/logs/HEAD +1 -0
  153. package/lib/bmad-cache/wds/_git_preserved/logs/refs/heads/main +1 -0
  154. package/lib/bmad-cache/wds/_git_preserved/logs/refs/remotes/origin/HEAD +1 -0
  155. package/lib/bmad-cache/wds/_git_preserved/objects/pack/pack-92d32f26e3a97a0786dcea5cb2c24bf90384521c.idx +0 -0
  156. package/lib/bmad-cache/wds/_git_preserved/objects/pack/pack-92d32f26e3a97a0786dcea5cb2c24bf90384521c.pack +0 -0
  157. package/lib/bmad-cache/wds/_git_preserved/objects/pack/pack-92d32f26e3a97a0786dcea5cb2c24bf90384521c.rev +0 -0
  158. package/lib/bmad-cache/wds/_git_preserved/packed-refs +2 -0
  159. package/lib/bmad-cache/wds/_git_preserved/refs/heads/main +1 -0
  160. package/lib/bmad-cache/wds/_git_preserved/refs/remotes/origin/HEAD +1 -0
  161. package/lib/bmad-cache/wds/_git_preserved/shallow +1 -0
  162. package/lib/bmad-cache/wds/eslint.config.mjs +152 -0
  163. package/lib/bmad-cache/wds/package.json +82 -0
  164. package/lib/bmad-cache/wds/prettier.config.mjs +32 -0
  165. package/lib/bmad-cache/wds/src/agents/wds-agent-freya-ux/bmad-skill-manifest.yaml +12 -0
  166. package/lib/bmad-cache/wds/src/agents/wds-agent-saga-analyst/bmad-skill-manifest.yaml +12 -0
  167. package/lib/bmad-cache/wds/src/module-help.csv +18 -0
  168. package/lib/bmad-cache/wds/src/module.yaml +148 -0
  169. package/lib/bmad-cache/wds/src/workflows/wds-1-project-brief/bmad-skill-manifest.yaml +1 -0
  170. package/lib/bmad-cache/wds/src/workflows/wds-1-project-brief/templates/platform-requirements.template.yaml +69 -0
  171. package/lib/bmad-cache/wds/src/workflows/wds-2-trigger-mapping/bmad-skill-manifest.yaml +1 -0
  172. package/lib/bmad-cache/wds/src/workflows/wds-3-scenarios/bmad-skill-manifest.yaml +1 -0
  173. package/lib/bmad-cache/wds/src/workflows/wds-4-ux-design/bmad-skill-manifest.yaml +1 -0
  174. package/lib/bmad-cache/wds/src/workflows/wds-4-ux-design/templates/design-delivery.template.yaml +104 -0
  175. package/lib/bmad-cache/wds/src/workflows/wds-4-ux-design/templates/test-scenario.template.yaml +192 -0
  176. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/bmad-skill-manifest.yaml +1 -0
  177. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/components/dev-mode.css +164 -0
  178. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/components/dev-mode.html +18 -0
  179. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/components/dev-mode.js +430 -0
  180. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/demo-data-template.json +63 -0
  181. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/page-template.html +465 -0
  182. package/lib/bmad-cache/wds/src/workflows/wds-5-agentic-development/templates/work-file-template.yaml +264 -0
  183. package/lib/bmad-cache/wds/src/workflows/wds-6-asset-generation/bmad-skill-manifest.yaml +1 -0
  184. package/lib/bmad-cache/wds/src/workflows/wds-7-design-system/bmad-skill-manifest.yaml +1 -0
  185. package/lib/bmad-cache/wds/src/workflows/wds-7-design-system/templates/catalog.template.html +363 -0
  186. package/lib/bmad-cache/wds/src/workflows/wds-8-product-evolution/bmad-skill-manifest.yaml +1 -0
  187. package/lib/bmad-customize/bmm-architect.customize.yaml +6 -0
  188. package/lib/bmad-customize/bmm-bmad-master.customize.yaml +6 -0
  189. package/lib/bmad-customize/bmm-dev.customize.yaml +6 -0
  190. package/lib/bmad-customize/bmm-pm.customize.yaml +6 -0
  191. package/lib/bmad-customize/bmm-qa.customize.yaml +6 -0
  192. package/lib/bmad-customize/bmm-sm.customize.yaml +6 -0
  193. package/lib/bmad-customize/bmm-tech-writer.customize.yaml +6 -0
  194. package/lib/bmad-customize/bmm-ux-designer.customize.yaml +6 -0
  195. package/lib/bmad-extension/module-help.csv +37 -7
  196. package/lib/bmad-extension/module.yaml +4 -2
  197. package/lib/bmad-extension/skills/add-sprint/.gitkeep +0 -0
  198. package/lib/bmad-extension/skills/add-sprint/SKILL.md +121 -0
  199. package/lib/bmad-extension/skills/add-sprint/bmad-skill-manifest.yaml +3 -0
  200. package/lib/bmad-extension/skills/add-to-sprint/.gitkeep +0 -0
  201. package/lib/bmad-extension/skills/add-to-sprint/SKILL.md +215 -0
  202. package/lib/bmad-extension/skills/add-to-sprint/bmad-skill-manifest.yaml +3 -0
  203. package/lib/bmad-extension/skills/bmad-ma-agent-cyber/.gitkeep +0 -0
  204. package/lib/bmad-extension/skills/bmad-ma-agent-cyber/SKILL.md +44 -0
  205. package/lib/bmad-extension/skills/bmad-ma-agent-cyber/bmad-skill-manifest.yaml +11 -0
  206. package/lib/bmad-extension/skills/bmad-ma-agent-devops/.gitkeep +0 -0
  207. package/lib/bmad-extension/skills/bmad-ma-agent-devops/SKILL.md +44 -0
  208. package/lib/bmad-extension/skills/bmad-ma-agent-devops/bmad-skill-manifest.yaml +11 -0
  209. package/lib/bmad-extension/skills/bmad-ma-agent-mil498/.gitkeep +0 -0
  210. package/lib/bmad-extension/skills/bmad-ma-agent-mil498/SKILL.md +48 -0
  211. package/lib/bmad-extension/skills/bmad-ma-agent-mil498/bmad-skill-manifest.yaml +11 -0
  212. package/lib/bmad-extension/skills/bmad-ma-agent-sre/.gitkeep +0 -0
  213. package/lib/bmad-extension/skills/bmad-ma-agent-sre/SKILL.md +44 -0
  214. package/lib/bmad-extension/skills/bmad-ma-agent-sre/bmad-skill-manifest.yaml +11 -0
  215. package/lib/bmad-extension/skills/create-bug-story/.gitkeep +0 -0
  216. package/lib/bmad-extension/skills/create-bug-story/SKILL.md +195 -0
  217. package/lib/bmad-extension/skills/create-bug-story/bmad-skill-manifest.yaml +3 -0
  218. package/lib/bmad-extension/skills/cyber-generate-certs/.gitkeep +0 -0
  219. package/lib/bmad-extension/skills/cyber-generate-certs/SKILL.md +27 -0
  220. package/lib/bmad-extension/skills/cyber-generate-certs/bmad-skill-manifest.yaml +3 -0
  221. package/lib/bmad-extension/skills/cyber-immunity-estimation/.gitkeep +0 -0
  222. package/lib/bmad-extension/skills/cyber-immunity-estimation/SKILL.md +29 -0
  223. package/lib/bmad-extension/skills/cyber-immunity-estimation/bmad-skill-manifest.yaml +3 -0
  224. package/lib/bmad-extension/skills/cyber-security-audit/.gitkeep +0 -0
  225. package/lib/bmad-extension/skills/cyber-security-audit/SKILL.md +27 -0
  226. package/lib/bmad-extension/skills/cyber-security-audit/bmad-skill-manifest.yaml +3 -0
  227. package/lib/bmad-extension/skills/cyber-vault-secrets/.gitkeep +0 -0
  228. package/lib/bmad-extension/skills/cyber-vault-secrets/SKILL.md +28 -0
  229. package/lib/bmad-extension/skills/cyber-vault-secrets/bmad-skill-manifest.yaml +3 -0
  230. package/lib/bmad-extension/skills/cyber-verify-docker-users/.gitkeep +0 -0
  231. package/lib/bmad-extension/skills/cyber-verify-docker-users/SKILL.md +23 -0
  232. package/lib/bmad-extension/skills/cyber-verify-docker-users/bmad-skill-manifest.yaml +3 -0
  233. package/lib/bmad-extension/skills/cyber-verify-image-signature/.gitkeep +0 -0
  234. package/lib/bmad-extension/skills/cyber-verify-image-signature/SKILL.md +22 -0
  235. package/lib/bmad-extension/skills/cyber-verify-image-signature/bmad-skill-manifest.yaml +3 -0
  236. package/lib/bmad-extension/skills/cyber-vulnerability-scan/.gitkeep +0 -0
  237. package/lib/bmad-extension/skills/cyber-vulnerability-scan/SKILL.md +28 -0
  238. package/lib/bmad-extension/skills/cyber-vulnerability-scan/bmad-skill-manifest.yaml +3 -0
  239. package/lib/bmad-extension/skills/devops-configure-infrastructure/.gitkeep +0 -0
  240. package/lib/bmad-extension/skills/devops-configure-infrastructure/SKILL.md +27 -0
  241. package/lib/bmad-extension/skills/devops-configure-infrastructure/bmad-skill-manifest.yaml +3 -0
  242. package/lib/bmad-extension/skills/devops-disconnected-deployment/.gitkeep +0 -0
  243. package/lib/bmad-extension/skills/devops-disconnected-deployment/SKILL.md +27 -0
  244. package/lib/bmad-extension/skills/devops-disconnected-deployment/bmad-skill-manifest.yaml +3 -0
  245. package/lib/bmad-extension/skills/devops-docker-compose-setup/.gitkeep +0 -0
  246. package/lib/bmad-extension/skills/devops-docker-compose-setup/SKILL.md +26 -0
  247. package/lib/bmad-extension/skills/devops-docker-compose-setup/bmad-skill-manifest.yaml +3 -0
  248. package/lib/bmad-extension/skills/devops-manage-helm/.gitkeep +0 -0
  249. package/lib/bmad-extension/skills/devops-manage-helm/SKILL.md +28 -0
  250. package/lib/bmad-extension/skills/devops-manage-helm/bmad-skill-manifest.yaml +3 -0
  251. package/lib/bmad-extension/skills/devops-sign-docker-image/.gitkeep +0 -0
  252. package/lib/bmad-extension/skills/devops-sign-docker-image/SKILL.md +24 -0
  253. package/lib/bmad-extension/skills/devops-sign-docker-image/bmad-skill-manifest.yaml +3 -0
  254. package/lib/bmad-extension/skills/mil498-ocd/.gitkeep +0 -0
  255. package/lib/bmad-extension/skills/mil498-ocd/SKILL.md +30 -0
  256. package/lib/bmad-extension/skills/mil498-ocd/bmad-skill-manifest.yaml +5 -0
  257. package/lib/bmad-extension/skills/mil498-ocd/prompts/01-discover-project-artifacts.md +26 -0
  258. package/lib/bmad-extension/skills/mil498-ocd/prompts/02-load-template.md +10 -0
  259. package/lib/bmad-extension/skills/mil498-ocd/prompts/03-generate-document.md +90 -0
  260. package/lib/bmad-extension/skills/mil498-ocd/prompts/04-validate.md +14 -0
  261. package/lib/bmad-extension/skills/mil498-ocd/prompts/05-review.md +15 -0
  262. package/lib/bmad-extension/skills/mil498-ocd/prompts/06-save.md +15 -0
  263. package/lib/bmad-extension/skills/mil498-ocd/template.md +169 -0
  264. package/lib/bmad-extension/skills/mil498-sdd/.gitkeep +0 -0
  265. package/lib/bmad-extension/skills/mil498-sdd/SKILL.md +30 -0
  266. package/lib/bmad-extension/skills/mil498-sdd/bmad-skill-manifest.yaml +5 -0
  267. package/lib/bmad-extension/skills/mil498-sdd/prompts/01-discover-project-artifacts.md +50 -0
  268. package/lib/bmad-extension/skills/mil498-sdd/prompts/02-load-template.md +10 -0
  269. package/lib/bmad-extension/skills/mil498-sdd/prompts/03-generate-document.md +98 -0
  270. package/lib/bmad-extension/skills/mil498-sdd/prompts/04-validate.md +16 -0
  271. package/lib/bmad-extension/skills/mil498-sdd/prompts/05-review.md +15 -0
  272. package/lib/bmad-extension/skills/mil498-sdd/prompts/06-save.md +19 -0
  273. package/lib/bmad-extension/skills/mil498-sdd/template.md +163 -0
  274. package/lib/bmad-extension/skills/mil498-sdp/.gitkeep +0 -0
  275. package/lib/bmad-extension/skills/mil498-sdp/SKILL.md +30 -0
  276. package/lib/bmad-extension/skills/mil498-sdp/bmad-skill-manifest.yaml +5 -0
  277. package/lib/bmad-extension/skills/mil498-sdp/prompts/01-discover-project-artifacts.md +32 -0
  278. package/lib/bmad-extension/skills/mil498-sdp/prompts/02-load-template.md +10 -0
  279. package/lib/bmad-extension/skills/mil498-sdp/prompts/03-generate-document.md +187 -0
  280. package/lib/bmad-extension/skills/mil498-sdp/prompts/04-validate.md +13 -0
  281. package/lib/bmad-extension/skills/mil498-sdp/prompts/05-review.md +15 -0
  282. package/lib/bmad-extension/skills/mil498-sdp/prompts/06-save.md +14 -0
  283. package/lib/bmad-extension/skills/mil498-sdp/template.md +307 -0
  284. package/lib/bmad-extension/skills/mil498-srs/.gitkeep +0 -0
  285. package/lib/bmad-extension/skills/mil498-srs/SKILL.md +30 -0
  286. package/lib/bmad-extension/skills/mil498-srs/bmad-skill-manifest.yaml +5 -0
  287. package/lib/bmad-extension/skills/mil498-srs/prompts/01-discover-project-artifacts.md +42 -0
  288. package/lib/bmad-extension/skills/mil498-srs/prompts/02-load-template.md +10 -0
  289. package/lib/bmad-extension/skills/mil498-srs/prompts/03-generate-document.md +100 -0
  290. package/lib/bmad-extension/skills/mil498-srs/prompts/04-validate.md +16 -0
  291. package/lib/bmad-extension/skills/mil498-srs/prompts/05-review.md +15 -0
  292. package/lib/bmad-extension/skills/mil498-srs/prompts/06-save.md +18 -0
  293. package/lib/bmad-extension/skills/mil498-srs/template.md +219 -0
  294. package/lib/bmad-extension/skills/mil498-ssdd/.gitkeep +0 -0
  295. package/lib/bmad-extension/skills/mil498-ssdd/SKILL.md +32 -0
  296. package/lib/bmad-extension/skills/mil498-ssdd/bmad-skill-manifest.yaml +5 -0
  297. package/lib/bmad-extension/skills/mil498-ssdd/prompts/01-discover-project-artifacts.md +32 -0
  298. package/lib/bmad-extension/skills/mil498-ssdd/prompts/02-load-template.md +10 -0
  299. package/lib/bmad-extension/skills/mil498-ssdd/prompts/03-csci-discovery-interview.md +43 -0
  300. package/lib/bmad-extension/skills/mil498-ssdd/prompts/04-generate-document.md +96 -0
  301. package/lib/bmad-extension/skills/mil498-ssdd/prompts/05-validate.md +14 -0
  302. package/lib/bmad-extension/skills/mil498-ssdd/prompts/06-review.md +16 -0
  303. package/lib/bmad-extension/skills/mil498-ssdd/prompts/07-save.md +16 -0
  304. package/lib/bmad-extension/skills/mil498-ssdd/template.md +154 -0
  305. package/lib/bmad-extension/skills/mil498-sss/.gitkeep +0 -0
  306. package/lib/bmad-extension/skills/mil498-sss/SKILL.md +31 -0
  307. package/lib/bmad-extension/skills/mil498-sss/bmad-skill-manifest.yaml +5 -0
  308. package/lib/bmad-extension/skills/mil498-sss/prompts/01-discover-project-artifacts.md +31 -0
  309. package/lib/bmad-extension/skills/mil498-sss/prompts/02-load-template.md +10 -0
  310. package/lib/bmad-extension/skills/mil498-sss/prompts/03-generate-document.md +108 -0
  311. package/lib/bmad-extension/skills/mil498-sss/prompts/04-validate.md +16 -0
  312. package/lib/bmad-extension/skills/mil498-sss/prompts/05-review.md +15 -0
  313. package/lib/bmad-extension/skills/mil498-sss/prompts/06-save.md +15 -0
  314. package/lib/bmad-extension/skills/mil498-sss/template.md +225 -0
  315. package/lib/bmad-extension/skills/mil498-std/.gitkeep +0 -0
  316. package/lib/bmad-extension/skills/mil498-std/SKILL.md +30 -0
  317. package/lib/bmad-extension/skills/mil498-std/bmad-skill-manifest.yaml +5 -0
  318. package/lib/bmad-extension/skills/mil498-std/prompts/01-discover-project-artifacts.md +42 -0
  319. package/lib/bmad-extension/skills/mil498-std/prompts/02-load-template.md +10 -0
  320. package/lib/bmad-extension/skills/mil498-std/prompts/03-generate-document.md +117 -0
  321. package/lib/bmad-extension/skills/mil498-std/prompts/04-validate.md +15 -0
  322. package/lib/bmad-extension/skills/mil498-std/prompts/05-review.md +15 -0
  323. package/lib/bmad-extension/skills/mil498-std/prompts/06-save.md +15 -0
  324. package/lib/bmad-extension/skills/mil498-std/template.md +188 -0
  325. package/lib/bmad-extension/skills/modify-sprint/.gitkeep +0 -0
  326. package/lib/bmad-extension/skills/modify-sprint/SKILL.md +259 -0
  327. package/lib/bmad-extension/skills/modify-sprint/bmad-skill-manifest.yaml +3 -0
  328. package/lib/bmad-extension/skills/project-context-expansion/.gitkeep +0 -0
  329. package/lib/bmad-extension/skills/project-context-expansion/SKILL.md +238 -0
  330. package/lib/bmad-extension/skills/project-context-expansion/bmad-skill-manifest.yaml +3 -0
  331. package/lib/bmad-extension/skills/sprint-status-view/.gitkeep +0 -0
  332. package/lib/bmad-extension/skills/sprint-status-view/SKILL.md +202 -0
  333. package/lib/bmad-extension/skills/sprint-status-view/bmad-skill-manifest.yaml +3 -0
  334. package/lib/bmad-extension/skills/sre-check-deployment-status/.gitkeep +0 -0
  335. package/lib/bmad-extension/skills/sre-check-deployment-status/SKILL.md +32 -0
  336. package/lib/bmad-extension/skills/sre-check-deployment-status/bmad-skill-manifest.yaml +3 -0
  337. package/lib/bmad-extension/skills/sre-check-secrets/.gitkeep +0 -0
  338. package/lib/bmad-extension/skills/sre-check-secrets/SKILL.md +23 -0
  339. package/lib/bmad-extension/skills/sre-check-secrets/bmad-skill-manifest.yaml +3 -0
  340. package/lib/bmad-extension/skills/sre-check-system-status/.gitkeep +0 -0
  341. package/lib/bmad-extension/skills/sre-check-system-status/SKILL.md +27 -0
  342. package/lib/bmad-extension/skills/sre-check-system-status/bmad-skill-manifest.yaml +3 -0
  343. package/lib/bmad-extension/skills/sre-day-2-ops/.gitkeep +0 -0
  344. package/lib/bmad-extension/skills/sre-day-2-ops/SKILL.md +26 -0
  345. package/lib/bmad-extension/skills/sre-day-2-ops/bmad-skill-manifest.yaml +3 -0
  346. package/lib/bmad-extension/skills/sre-deployment-strategies/.gitkeep +0 -0
  347. package/lib/bmad-extension/skills/sre-deployment-strategies/SKILL.md +28 -0
  348. package/lib/bmad-extension/skills/sre-deployment-strategies/bmad-skill-manifest.yaml +3 -0
  349. package/lib/bmad-extension/skills/sre-fix-deployments/.gitkeep +0 -0
  350. package/lib/bmad-extension/skills/sre-fix-deployments/SKILL.md +25 -0
  351. package/lib/bmad-extension/skills/sre-fix-deployments/bmad-skill-manifest.yaml +3 -0
  352. package/lib/bmad-extension/skills/sre-gitops-status/.gitkeep +0 -0
  353. package/lib/bmad-extension/skills/sre-gitops-status/SKILL.md +25 -0
  354. package/lib/bmad-extension/skills/sre-gitops-status/bmad-skill-manifest.yaml +3 -0
  355. package/lib/bmad.js +541 -1
  356. package/lib/installer.js +12 -8
  357. package/opencode.json +1 -4
  358. package/package.json +3 -3
  359. package/test/bmad-extension.test.js +115 -69
  360. package/test/bmad-version-bump.test.js +313 -0
  361. package/test/convert-agents-to-skills.test.js +245 -0
  362. package/test/extension-module-restructure.test.js +359 -0
  363. package/test/integration-verification.test.js +71 -40
  364. package/test/migration-validation.test.js +499 -0
  365. package/test/migration.test.js +832 -0
  366. package/test/opencode-json-injection.test.js +25 -17
  367. package/test/opencode-json-merge.test.js +52 -33
  368. package/test/story-15-5-workflow-skills.test.js +311 -0
  369. package/test/yes-flag.test.js +8 -1
  370. package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-c6e539e2308f8ed764c5b54b6ab68a67f8a3796b.idx +0 -0
  371. package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-c6e539e2308f8ed764c5b54b6ab68a67f8a3796b.pack +0 -0
  372. package/lib/bmad-cache/bmb/_git_preserved/objects/pack/pack-c6e539e2308f8ed764c5b54b6ab68a67f8a3796b.rev +0 -0
  373. package/lib/bmad-cache/bmb/samples/bmad-agent-dream-weaver/bmad-manifest.json +0 -62
  374. package/lib/bmad-cache/bmb/samples/bmad-excalidraw/bmad-manifest.json +0 -18
  375. package/lib/bmad-cache/bmb/src/module-help.csv +0 -7
  376. package/lib/bmad-cache/bmb/src/module.yaml +0 -20
  377. package/lib/bmad-cache/bmb/src/skills/bmad-agent-builder/bmad-manifest.json +0 -24
  378. package/lib/bmad-cache/bmb/src/skills/bmad-agent-builder/scripts/bmad-manifest-schema.json +0 -103
  379. package/lib/bmad-cache/bmb/src/skills/bmad-agent-builder/scripts/generate-html-report.py +0 -1002
  380. package/lib/bmad-cache/bmb/src/skills/bmad-agent-builder/scripts/manifest.py +0 -420
  381. package/lib/bmad-cache/bmb/src/skills/bmad-workflow-builder/bmad-manifest.json +0 -23
  382. package/lib/bmad-cache/bmb/src/skills/bmad-workflow-builder/scripts/bmad-manifest-schema.json +0 -103
  383. package/lib/bmad-cache/bmb/src/skills/bmad-workflow-builder/scripts/generate-html-report.py +0 -1002
  384. package/lib/bmad-cache/bmb/src/skills/bmad-workflow-builder/scripts/manifest.py +0 -420
  385. package/lib/bmad-cache/cis/_git_preserved/objects/pack/pack-157d7eb8d527233a8607d926fc74ebf87f2ae0d3.idx +0 -0
  386. package/lib/bmad-cache/cis/_git_preserved/objects/pack/pack-157d7eb8d527233a8607d926fc74ebf87f2ae0d3.rev +0 -0
  387. package/lib/bmad-cache/cis/src/agents/brainstorming-coach.agent.yaml +0 -21
  388. package/lib/bmad-cache/cis/src/agents/creative-problem-solver.agent.yaml +0 -21
  389. package/lib/bmad-cache/cis/src/agents/design-thinking-coach.agent.yaml +0 -21
  390. package/lib/bmad-cache/cis/src/agents/innovation-strategist.agent.yaml +0 -21
  391. package/lib/bmad-cache/cis/src/agents/presentation-master.agent.yaml +0 -53
  392. package/lib/bmad-cache/cis/src/agents/storyteller/storyteller.agent.yaml +0 -25
  393. package/lib/bmad-cache/cis/src/teams/creative-squad.yaml +0 -7
  394. package/lib/bmad-cache/cis/src/teams/default-party.csv +0 -12
  395. package/lib/bmad-cache/cis/src/workflows/README.md +0 -175
  396. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-44faafb9245b4ca17ad81bd6c9e6fc52fb5915a1.idx +0 -0
  397. package/lib/bmad-cache/gds/_git_preserved/objects/pack/pack-44faafb9245b4ca17ad81bd6c9e6fc52fb5915a1.rev +0 -0
  398. package/lib/bmad-cache/gds/_git_preserved/refs/tags/v0.2.2 +0 -1
  399. package/lib/bmad-cache/tea/_git_preserved/objects/pack/pack-96ec1ce3a9ef4c891e00e060795b4434ba8f7163.idx +0 -0
  400. package/lib/bmad-cache/tea/_git_preserved/objects/pack/pack-96ec1ce3a9ef4c891e00e060795b4434ba8f7163.rev +0 -0
  401. package/lib/bmad-cache/tea/_git_preserved/refs/tags/v1.7.0 +0 -1
  402. package/lib/bmad-cache/tea/docs/MIGRATION.md +0 -488
  403. package/lib/bmad-cache/tea/src/agents/tea.agent.yaml +0 -67
  404. package/lib/bmad-cache/tea/src/teams/default-party.csv +0 -2
  405. package/lib/bmad-customizations/bmm-cyber.customize.yaml +0 -24
  406. package/lib/bmad-customizations/bmm-devops.customize.yaml +0 -24
  407. package/lib/bmad-customizations/bmm-mil498.customize.yaml +0 -36
  408. package/lib/bmad-customizations/bmm-sre.customize.yaml +0 -24
  409. package/lib/bmad-customizations/cyber.md +0 -71
  410. package/lib/bmad-customizations/devops.md +0 -71
  411. package/lib/bmad-customizations/mil498.md +0 -75
  412. package/lib/bmad-customizations/sre.md +0 -71
  413. package/lib/bmad-extension/agents/bmm-architect.customize.yaml +0 -5
  414. package/lib/bmad-extension/agents/bmm-bmad-master.customize.yaml +0 -5
  415. package/lib/bmad-extension/agents/bmm-cyber.customize.yaml +0 -30
  416. package/lib/bmad-extension/agents/bmm-dev.customize.yaml +0 -5
  417. package/lib/bmad-extension/agents/bmm-devops.customize.yaml +0 -30
  418. package/lib/bmad-extension/agents/bmm-mil498.customize.yaml +0 -42
  419. package/lib/bmad-extension/agents/bmm-pm.customize.yaml +0 -5
  420. package/lib/bmad-extension/agents/bmm-qa.customize.yaml +0 -5
  421. package/lib/bmad-extension/agents/bmm-sm.customize.yaml +0 -5
  422. package/lib/bmad-extension/agents/bmm-sre.customize.yaml +0 -30
  423. package/lib/bmad-extension/agents/bmm-tech-writer.customize.yaml +0 -5
  424. package/lib/bmad-extension/agents/bmm-ux-designer.customize.yaml +0 -5
  425. /package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-agent-builder/scripts/scan-scripts.py +0 -0
  426. /package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-workflow-builder/scripts/prepass-prompt-metrics.py +0 -0
  427. /package/lib/bmad-cache/bmb/{src/skills → skills}/bmad-workflow-builder/scripts/scan-scripts.py +0 -0
  428. /package/lib/bmad-cache/{bmb/src/skills/bmad-agent-builder → cis/src/skills/bmad-cis-design-thinking}/bmad-skill-manifest.yaml +0 -0
  429. /package/lib/bmad-cache/cis/src/{workflows → skills}/bmad-cis-design-thinking/design-methods.csv +0 -0
  430. /package/lib/bmad-cache/{bmb/src/skills/bmad-workflow-builder → cis/src/skills/bmad-cis-innovation-strategy}/bmad-skill-manifest.yaml +0 -0
  431. /package/lib/bmad-cache/cis/src/{workflows → skills}/bmad-cis-innovation-strategy/innovation-frameworks.csv +0 -0
  432. /package/lib/bmad-cache/cis/src/{workflows/bmad-cis-design-thinking → skills/bmad-cis-problem-solving}/bmad-skill-manifest.yaml +0 -0
  433. /package/lib/bmad-cache/cis/src/{workflows → skills}/bmad-cis-problem-solving/solving-methods.csv +0 -0
  434. /package/lib/bmad-cache/cis/src/{workflows/bmad-cis-innovation-strategy → skills/bmad-cis-storytelling}/bmad-skill-manifest.yaml +0 -0
  435. /package/lib/bmad-cache/cis/src/{workflows → skills}/bmad-cis-storytelling/story-types.csv +0 -0
  436. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/adr-quality-readiness-checklist.md +0 -0
  437. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/api-request.md +0 -0
  438. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/api-testing-patterns.md +0 -0
  439. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/auth-session.md +0 -0
  440. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/burn-in.md +0 -0
  441. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/ci-burn-in.md +0 -0
  442. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/component-tdd.md +0 -0
  443. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/contract-testing.md +0 -0
  444. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/data-factories.md +0 -0
  445. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/email-auth.md +0 -0
  446. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/error-handling.md +0 -0
  447. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/feature-flags.md +0 -0
  448. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/file-utils.md +0 -0
  449. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/fixture-architecture.md +0 -0
  450. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/fixtures-composition.md +0 -0
  451. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/intercept-network-call.md +0 -0
  452. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/log.md +0 -0
  453. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/network-error-monitor.md +0 -0
  454. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/network-first.md +0 -0
  455. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/network-recorder.md +0 -0
  456. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/nfr-criteria.md +0 -0
  457. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/overview.md +0 -0
  458. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pact-consumer-di.md +0 -0
  459. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pact-consumer-framework-setup.md +0 -0
  460. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pact-mcp.md +0 -0
  461. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pactjs-utils-consumer-helpers.md +0 -0
  462. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pactjs-utils-overview.md +0 -0
  463. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pactjs-utils-provider-verifier.md +0 -0
  464. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/pactjs-utils-request-filter.md +0 -0
  465. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/playwright-cli.md +0 -0
  466. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/playwright-config.md +0 -0
  467. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/probability-impact.md +0 -0
  468. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/recurse.md +0 -0
  469. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/risk-governance.md +0 -0
  470. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/selective-testing.md +0 -0
  471. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/selector-resilience.md +0 -0
  472. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/test-healing-patterns.md +0 -0
  473. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/test-levels-framework.md +0 -0
  474. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/test-priorities-matrix.md +0 -0
  475. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/test-quality.md +0 -0
  476. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/timing-debugging.md +0 -0
  477. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/knowledge/visual-debugging.md +0 -0
  478. /package/lib/bmad-cache/tea/src/{testarch → agents/bmad-tea/resources}/tea-index.csv +0 -0
  479. /package/lib/bmad-cache/{cis/src/workflows/bmad-cis-problem-solving → wds/src/workflows/wds-0-alignment-signoff}/bmad-skill-manifest.yaml +0 -0
  480. /package/lib/bmad-cache/{cis/src/workflows/bmad-cis-storytelling → wds/src/workflows/wds-0-project-setup}/bmad-skill-manifest.yaml +0 -0
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: sre-gitops-status
3
+ description: Monitor GitOps synchronization state and detect drift using ArgoCD or Flux
4
+ type: skill
5
+ triggers:
6
+ - "gitops status"
7
+ - "drift detection"
8
+ ---
9
+
10
+ # workflow-gitops-status.md
11
+ # GitOps Status & Drift Detection Workflow
12
+
13
+ This workflow monitors and reports the synchronization state between your git repository and the cluster using ArgoCD or Flux.
14
+
15
+ ## Instructions
16
+ 1. **Identify Tool**: Detect if ArgoCD or Flux is in use.
17
+ 2. **Sync Status**:
18
+ - **ArgoCD**: `argocd app list`, `argocd app get {app_name}`
19
+ - **Flux**: `flux get kustomizations`, `flux get helmreleases`
20
+ 3. **Drift Detection**:
21
+ - Identify "OutOfSync" resources.
22
+ - Compare live state with desired state in git.
23
+ 4. **Action**:
24
+ - Offer to trigger a sync: `argocd app sync {app_name}` or `flux reconcile kustomization {name}`.
25
+ - Analyze reasons for permanent drift (e.g., manual cluster changes).
@@ -0,0 +1,3 @@
1
+ type: skill
2
+ name: sre-gitops-status
3
+ module: ma-skills
package/lib/bmad.js CHANGED
@@ -77,11 +77,20 @@ function buildBmadArgs(ctx) {
77
77
  }
78
78
 
79
79
  async function installBmad(modules = ['bmm', 'bmb'], tools = [], projectRoot = process.cwd(), force = false, { userName = '', commLang = '', docLang = '', outputFolder = '' } = {}) {
80
+ // Detect migration need
81
+ const detection = detectMigrationNeed(projectRoot);
82
+
83
+ if (detection.migrate) {
84
+ const fromLabel = detection.fromVersion === 'unknown' ? 'unknown version' : detection.fromVersion;
85
+ console.log(chalk.yellow(` Upgrading BMAD from ${fromLabel} to ${BMAD_TARGET_VERSION}...`));
86
+ return await runMigration(modules, tools, projectRoot, force, { userName, commLang, docLang, outputFolder });
87
+ }
88
+
80
89
  const command = buildBmadArgs({
81
90
  projectRoot,
82
91
  modules,
83
92
  tools,
84
- action: 'install',
93
+ action: detection.action,
85
94
  userName,
86
95
  commLang,
87
96
  docLang,
@@ -101,6 +110,63 @@ async function installBmad(modules = ['bmm', 'bmb'], tools = [], projectRoot = p
101
110
  }
102
111
  }
103
112
 
113
+ /**
114
+ * Run the full migration pipeline: backup → update → merge → cleanup.
115
+ * Rolls back on failure (NFR29).
116
+ */
117
+ async function runMigration(modules, tools, projectRoot, force, { userName, commLang, docLang, outputFolder }) {
118
+ // Step 1: Backup existing customizations
119
+ console.log(chalk.cyan(' Step 1/4: Backing up existing customizations...'));
120
+ const backedUpFiles = await backupCustomizations(projectRoot);
121
+
122
+ // Step 2: Run bmad-method with --action update
123
+ console.log(chalk.cyan(' Step 2/4: Updating BMAD-METHOD...'));
124
+ const command = buildBmadArgs({
125
+ projectRoot,
126
+ modules,
127
+ tools,
128
+ action: 'update',
129
+ userName,
130
+ commLang,
131
+ docLang,
132
+ outputFolder,
133
+ });
134
+
135
+ await prePopulateBmadCache(force);
136
+
137
+ console.log(chalk.gray(` Running: ${command}`));
138
+ try {
139
+ execSync(command, { stdio: 'inherit', cwd: projectRoot, env: { ...process.env, GIT_TERMINAL_PROMPT: '0' } });
140
+ } catch (error) {
141
+ // Rollback on failure
142
+ console.error(chalk.red(` BMAD update failed: ${error.message}`));
143
+ if (backedUpFiles.length > 0) {
144
+ console.log(chalk.yellow(' Rolling back — restoring backed-up customizations...'));
145
+ await restoreCustomizations(projectRoot);
146
+ }
147
+ console.error(chalk.red(' Migration aborted. Your project remains on the previous version.'));
148
+ console.error(chalk.yellow(' Suggestion: Run "npm update bmad-method" manually, then retry installation.'));
149
+ return false;
150
+ }
151
+
152
+ // Step 3: Merge user customizations
153
+ if (backedUpFiles.length > 0) {
154
+ console.log(chalk.cyan(' Step 3/4: Merging user customizations...'));
155
+ await mergeUserCustomizations(projectRoot);
156
+ } else {
157
+ console.log(chalk.gray(' Step 3/4: No customizations to merge'));
158
+ }
159
+
160
+ // Step 4: Clean up legacy artifacts
161
+ console.log(chalk.cyan(' Step 4/4: Cleaning up legacy artifacts...'));
162
+ await cleanupLegacyArtifacts(projectRoot);
163
+
164
+ await deployMethodology(projectRoot, force);
165
+
166
+ console.log(chalk.green(` Migration to BMAD ${BMAD_TARGET_VERSION} complete!`));
167
+ return true;
168
+ }
169
+
104
170
  async function updateBmad(modules = ['bmm', 'bmb'], tools = [], projectRoot = process.cwd(), force = false, { userName = '', commLang = '', docLang = '', outputFolder = '' } = {}) {
105
171
  const command = buildBmadArgs({
106
172
  projectRoot,
@@ -214,6 +280,20 @@ async function applyCustomizations(projectRoot = process.cwd(), modules = ['bmm'
214
280
  console.log(chalk.cyan(' + Deployed BMAD extension module: ma-agents-skills'));
215
281
  }
216
282
 
283
+ // STAGE:CUSTOMIZE — Deploy built-in agent customizations from lib/bmad-customize/
284
+ // These add critical_actions to the 8 built-in BMM agents (pm, architect, dev, qa,
285
+ // sm, tech-writer, ux-designer, bmad-master) so they load project skills at startup.
286
+ // Runs AFTER --custom-content (extension module) and BEFORE quick-update.
287
+ const customizeSource = path.join(__dirname, 'bmad-customize');
288
+ if (fs.existsSync(customizeSource)) {
289
+ await fs.ensureDir(configTargetDir);
290
+ const customizeFiles = (await fs.readdir(customizeSource)).filter(f => f.endsWith('.customize.yaml'));
291
+ for (const file of customizeFiles) {
292
+ await fs.copy(path.join(customizeSource, file), path.join(configTargetDir, file));
293
+ console.log(chalk.cyan(` + Applied built-in customization: ${file}`));
294
+ }
295
+ }
296
+
217
297
  // STAGE:WORKFLOWS — Apply workflows (AFTER recompile so they persist)
218
298
  if (fs.existsSync(workflowSourceDir)) {
219
299
  await fs.ensureDir(workflowTargetDir);
@@ -439,6 +519,458 @@ async function prePopulateBmadCache(force = false) {
439
519
  }
440
520
  }
441
521
 
522
+ // ── Migration constants ─────────────────────────────────────────────────────
523
+
524
+ const BMAD_TARGET_VERSION = '6.2.1';
525
+ const BMAD_MIGRATION_THRESHOLD = '6.2.0'; // versions below this need migration
526
+ const BACKUP_DIR_NAME = '.backup-pre-migration';
527
+
528
+ /**
529
+ * Standard critical_actions injected by ma-agents (used to distinguish
530
+ * user-added entries from standard ones during merge).
531
+ */
532
+ const STANDARD_CRITICAL_ACTIONS = [
533
+ 'Read the skills MANIFEST at {project-root}',
534
+ 'For each skill marked always_load: true, read the skill file completely',
535
+ 'If _bmad-output/project-context.md exists, read it completely',
536
+ 'Follow all skill directives and project-context rules during this session',
537
+ ];
538
+
539
+ // ── Migration functions ─────────────────────────────────────────────────────
540
+
541
+ /**
542
+ * Compare two semver-style version strings (X.Y.Z only).
543
+ * Returns -1 if a < b, 0 if a == b, 1 if a > b.
544
+ *
545
+ * **Limitation:** Only supports strict X.Y.Z numeric versions.
546
+ * Pre-release suffixes (e.g. "6.2.1-beta.1") are ignored — the hyphen
547
+ * and everything after it will be parsed as NaN by Number(), which
548
+ * falls back to 0 via the `|| 0` guard. Two-segment versions like
549
+ * "6.2" are handled by treating the missing patch as 0.
550
+ *
551
+ * @param {string} a - First version string (X.Y.Z)
552
+ * @param {string} b - Second version string (X.Y.Z)
553
+ * @returns {number} -1 | 0 | 1
554
+ */
555
+ function compareVersions(a, b) {
556
+ const SEMVER_RE = /^\d+\.\d+\.\d+$/;
557
+ if (a && !SEMVER_RE.test(a)) {
558
+ console.log(chalk.yellow(` Warning: compareVersions received non-standard version "${a}" — only X.Y.Z is fully supported`));
559
+ }
560
+ if (b && !SEMVER_RE.test(b)) {
561
+ console.log(chalk.yellow(` Warning: compareVersions received non-standard version "${b}" — only X.Y.Z is fully supported`));
562
+ }
563
+ const pa = (a || '0.0.0').split('.').map(Number);
564
+ const pb = (b || '0.0.0').split('.').map(Number);
565
+ for (let i = 0; i < 3; i++) {
566
+ const va = pa[i] || 0;
567
+ const vb = pb[i] || 0;
568
+ if (va < vb) return -1;
569
+ if (va > vb) return 1;
570
+ }
571
+ return 0;
572
+ }
573
+
574
+ /**
575
+ * Detect whether a migration is needed by inspecting `_bmad/core/config.yaml`.
576
+ *
577
+ * @param {string} projectRoot - Absolute path to the project root
578
+ * @returns {{ action: 'install'|'update', migrate: boolean, fromVersion?: string }}
579
+ */
580
+ function detectMigrationNeed(projectRoot) {
581
+ const bmadPath = path.join(projectRoot, BMAD_DIR);
582
+ if (!fs.existsSync(bmadPath)) {
583
+ return { action: 'install', migrate: false };
584
+ }
585
+
586
+ // _bmad/ exists — try to read version from config.yaml
587
+ const configPath = path.join(bmadPath, 'core', 'config.yaml');
588
+ let version = null;
589
+
590
+ if (fs.existsSync(configPath)) {
591
+ try {
592
+ const content = fs.readFileSync(configPath, 'utf-8');
593
+ // Simple regex extraction — config.yaml is a simple key: value YAML
594
+ const match = content.match(/^version:\s*['"]?([^\s'"#]+)/m);
595
+ if (match) {
596
+ version = match[1];
597
+ }
598
+ } catch {
599
+ // Cannot read — treat as unknown version
600
+ }
601
+ }
602
+
603
+ // If _bmad/ exists but no version found (e.g. config.yaml is `{}` or missing),
604
+ // treat as needing migration since it's likely a pre-6.2.0 install
605
+ if (!version) {
606
+ console.log(chalk.yellow(' BMAD version not found in config.yaml — assuming pre-6.2.0 install'));
607
+ return { action: 'update', migrate: true, fromVersion: 'unknown' };
608
+ }
609
+
610
+ if (compareVersions(version, BMAD_MIGRATION_THRESHOLD) < 0) {
611
+ return { action: 'update', migrate: true, fromVersion: version };
612
+ }
613
+
614
+ return { action: 'update', migrate: false };
615
+ }
616
+
617
+ /**
618
+ * Back up existing customize.yaml files before migration.
619
+ *
620
+ * @param {string} projectRoot - Absolute path to the project root
621
+ * @returns {Promise<string[]>} List of backed-up file names
622
+ */
623
+ async function backupCustomizations(projectRoot) {
624
+ const configDir = path.join(projectRoot, CONFIG_DIR);
625
+ const backupDir = path.join(configDir, BACKUP_DIR_NAME);
626
+
627
+ if (!fs.existsSync(configDir)) {
628
+ console.log(chalk.gray(' No _bmad/_config/agents/ directory — nothing to back up'));
629
+ return [];
630
+ }
631
+
632
+ const files = await fs.readdir(configDir);
633
+ const customizeFiles = files.filter(f => f.endsWith('.customize.yaml'));
634
+
635
+ if (customizeFiles.length === 0) {
636
+ console.log(chalk.gray(' No customize.yaml files found — nothing to back up'));
637
+ return [];
638
+ }
639
+
640
+ // Remove previous backup before creating a new one
641
+ if (fs.existsSync(backupDir)) {
642
+ await fs.remove(backupDir);
643
+ console.log(chalk.dim(' Removed previous migration backup'));
644
+ }
645
+
646
+ await fs.ensureDir(backupDir);
647
+ const backedUp = [];
648
+
649
+ for (const file of customizeFiles) {
650
+ await fs.copy(path.join(configDir, file), path.join(backupDir, file));
651
+ backedUp.push(file);
652
+ console.log(chalk.cyan(` + Backed up: ${file}`));
653
+ }
654
+
655
+ console.log(chalk.green(` Backed up ${backedUp.length} customize.yaml file(s) to ${BACKUP_DIR_NAME}/`));
656
+ return backedUp;
657
+ }
658
+
659
+ /**
660
+ * Restore backed-up customize.yaml files (rollback on failure).
661
+ *
662
+ * @param {string} projectRoot - Absolute path to the project root
663
+ * @returns {Promise<boolean>} true if restore succeeded
664
+ */
665
+ async function restoreCustomizations(projectRoot) {
666
+ const configDir = path.join(projectRoot, CONFIG_DIR);
667
+ const backupDir = path.join(configDir, BACKUP_DIR_NAME);
668
+
669
+ if (!fs.existsSync(backupDir)) {
670
+ console.log(chalk.yellow(' No backup directory found — cannot restore'));
671
+ return false;
672
+ }
673
+
674
+ try {
675
+ const files = await fs.readdir(backupDir);
676
+ const customizeFiles = files.filter(f => f.endsWith('.customize.yaml'));
677
+
678
+ for (const file of customizeFiles) {
679
+ await fs.copy(path.join(backupDir, file), path.join(configDir, file), { overwrite: true });
680
+ console.log(chalk.cyan(` + Restored: ${file}`));
681
+ }
682
+
683
+ console.log(chalk.green(` Restored ${customizeFiles.length} customize.yaml file(s) from backup`));
684
+ return true;
685
+ } catch (err) {
686
+ console.error(chalk.red(` Failed to restore customizations: ${err.message}`));
687
+ return false;
688
+ }
689
+ }
690
+
691
+ /**
692
+ * Check whether a critical_action line is one of the standard ma-agents entries.
693
+ * Uses a substring match against STANDARD_CRITICAL_ACTIONS patterns.
694
+ */
695
+ function isStandardCriticalAction(line) {
696
+ const trimmed = (typeof line === 'string' ? line : '').trim().replace(/^["']|["']$/g, '');
697
+ return STANDARD_CRITICAL_ACTIONS.some(std => trimmed.includes(std));
698
+ }
699
+
700
+ /**
701
+ * Parse a simple YAML customize.yaml file into a structured object.
702
+ * Returns raw text sections for keys like persona, memories, critical_actions.
703
+ * This is intentionally simple — only parses the top-level keys we care about.
704
+ *
705
+ * @param {string} content - YAML file content
706
+ * @returns {{ memories: string[], criticalActions: string[], personaLines: string[], raw: string }}
707
+ */
708
+ function parseCustomizeYaml(content) {
709
+ const result = {
710
+ memories: [],
711
+ criticalActions: [],
712
+ personaLines: [],
713
+ raw: content,
714
+ };
715
+
716
+ const lines = content.split('\n');
717
+ let currentSection = null;
718
+
719
+ for (const line of lines) {
720
+ // Detect top-level keys
721
+ if (/^memories\s*:/.test(line)) {
722
+ currentSection = 'memories';
723
+ continue;
724
+ } else if (/^critical_actions\s*:/.test(line)) {
725
+ currentSection = 'criticalActions';
726
+ continue;
727
+ } else if (/^persona\s*:/.test(line)) {
728
+ currentSection = 'persona';
729
+ continue;
730
+ } else if (/^[a-z_]+\s*:/.test(line) && !line.startsWith(' ') && !line.startsWith('\t')) {
731
+ // New top-level key — stop current section
732
+ currentSection = null;
733
+ }
734
+
735
+ if (currentSection === 'memories' && /^\s+[-\d]/.test(line)) {
736
+ // Extract the value from list item (- "value") or numbered (1: "value")
737
+ const listMatch = line.match(/^\s+-\s*["']?(.+?)["']?\s*$/);
738
+ const numMatch = line.match(/^\s+\d+\s*:\s*["']?(.+?)["']?\s*$/);
739
+ const value = listMatch ? listMatch[1] : (numMatch ? numMatch[1] : null);
740
+ if (value) result.memories.push(value);
741
+ } else if (currentSection === 'criticalActions' && /^\s+[-\d]/.test(line)) {
742
+ const listMatch = line.match(/^\s+-\s*["']?(.+?)["']?\s*$/);
743
+ const numMatch = line.match(/^\s+\d+\s*:\s*["']?(.+?)["']?\s*$/);
744
+ const value = listMatch ? listMatch[1] : (numMatch ? numMatch[1] : null);
745
+ if (value) result.criticalActions.push(value);
746
+ } else if (currentSection === 'persona' && /^\s+/.test(line)) {
747
+ result.personaLines.push(line);
748
+ }
749
+ }
750
+
751
+ return result;
752
+ }
753
+
754
+ /**
755
+ * Merge user customizations from backed-up files into new customize.yaml files.
756
+ * Detects user-added memories, extra critical_actions, and persona overrides.
757
+ *
758
+ * @param {string} projectRoot - Absolute path to the project root
759
+ * @returns {Promise<{ merged: string[], skipped: string[] }>}
760
+ */
761
+ async function mergeUserCustomizations(projectRoot) {
762
+ const configDir = path.join(projectRoot, CONFIG_DIR);
763
+ const backupDir = path.join(configDir, BACKUP_DIR_NAME);
764
+ const result = { merged: [], skipped: [] };
765
+
766
+ if (!fs.existsSync(backupDir)) {
767
+ console.log(chalk.gray(' No backup directory — skipping customization merge'));
768
+ return result;
769
+ }
770
+
771
+ const backupFiles = (await fs.readdir(backupDir)).filter(f => f.endsWith('.customize.yaml'));
772
+
773
+ for (const file of backupFiles) {
774
+ const backupPath = path.join(backupDir, file);
775
+ const newPath = path.join(configDir, file);
776
+
777
+ const backupContent = await fs.readFile(backupPath, 'utf-8');
778
+ const oldParsed = parseCustomizeYaml(backupContent);
779
+
780
+ // Detect user additions
781
+ const userMemories = oldParsed.memories; // all memories are user content
782
+ const userCriticalActions = oldParsed.criticalActions.filter(ca => !isStandardCriticalAction(ca));
783
+
784
+ // Detect persona overrides — compare with defaults from our shipped customizations
785
+ const shippedDir = path.join(__dirname, 'bmad-customizations');
786
+ const shippedPath = path.join(shippedDir, file);
787
+ let hasPersonaOverride = false;
788
+
789
+ if (fs.existsSync(shippedPath)) {
790
+ const shippedContent = await fs.readFile(shippedPath, 'utf-8');
791
+ const shippedParsed = parseCustomizeYaml(shippedContent);
792
+ // If the user's persona section differs from shipped, they customized it
793
+ if (oldParsed.personaLines.join('\n').trim() !== shippedParsed.personaLines.join('\n').trim()
794
+ && oldParsed.personaLines.length > 0) {
795
+ hasPersonaOverride = true;
796
+ }
797
+ } else {
798
+ // No shipped version — any persona content is user-added
799
+ if (oldParsed.personaLines.length > 0) {
800
+ hasPersonaOverride = true;
801
+ }
802
+ }
803
+
804
+ const hasUserContent = userMemories.length > 0 || userCriticalActions.length > 0 || hasPersonaOverride;
805
+
806
+ if (!hasUserContent) {
807
+ result.skipped.push(file);
808
+ continue;
809
+ }
810
+
811
+ // Merge into new file
812
+ let newContent;
813
+ if (fs.existsSync(newPath)) {
814
+ newContent = await fs.readFile(newPath, 'utf-8');
815
+ } else {
816
+ // New file doesn't exist — use backup as base
817
+ newContent = backupContent;
818
+ }
819
+
820
+ // Append user memories
821
+ if (userMemories.length > 0) {
822
+ // Check if memories section already exists
823
+ if (/^memories\s*:/m.test(newContent)) {
824
+ // Append to existing memories section
825
+ const memoriesBlock = userMemories.map(m => ` - "${m}"`).join('\n');
826
+ newContent = newContent.replace(/^(memories\s*:.*)/m, `$1\n${memoriesBlock}`);
827
+ } else {
828
+ // Add new memories section
829
+ const memoriesBlock = '\nmemories:\n' + userMemories.map(m => ` - "${m}"`).join('\n') + '\n';
830
+ newContent = newContent.trimEnd() + '\n' + memoriesBlock;
831
+ }
832
+ console.log(chalk.cyan(` + Merged ${userMemories.length} user memories into ${file}`));
833
+ }
834
+
835
+ // Append user critical_actions (non-standard ones)
836
+ if (userCriticalActions.length > 0) {
837
+ if (/^critical_actions\s*:/m.test(newContent)) {
838
+ // Find the last numbered entry and continue from there
839
+ const caLines = newContent.split('\n');
840
+ let lastCaIdx = -1;
841
+ let lastNum = 0;
842
+ for (let i = 0; i < caLines.length; i++) {
843
+ const numMatch = caLines[i].match(/^\s+(\d+)\s*:/);
844
+ if (numMatch && parseInt(numMatch[1]) > lastNum) {
845
+ lastNum = parseInt(numMatch[1]);
846
+ lastCaIdx = i;
847
+ }
848
+ }
849
+ if (lastCaIdx >= 0) {
850
+ const extraLines = userCriticalActions.map((ca, idx) =>
851
+ ` ${lastNum + idx + 1}: "${ca}"`
852
+ );
853
+ caLines.splice(lastCaIdx + 1, 0, ...extraLines);
854
+ newContent = caLines.join('\n');
855
+ }
856
+ } else {
857
+ const caBlock = '\ncritical_actions:\n' + userCriticalActions.map((ca, idx) =>
858
+ ` ${idx + 1}: "${ca}"`
859
+ ).join('\n') + '\n';
860
+ newContent = newContent.trimEnd() + '\n' + caBlock;
861
+ }
862
+ console.log(chalk.cyan(` + Merged ${userCriticalActions.length} user critical_actions into ${file}`));
863
+ }
864
+
865
+ // If persona was overridden by the user, keep the user's persona block
866
+ if (hasPersonaOverride) {
867
+ // Replace persona section in new file with user's version
868
+ const personaBlock = 'persona:\n' + oldParsed.personaLines.join('\n');
869
+ if (/^persona\s*:/m.test(newContent)) {
870
+ // Replace existing persona section up to next top-level key
871
+ newContent = newContent.replace(
872
+ /^persona\s*:[\s\S]*?(?=\n[a-z_]+\s*:|$)/m,
873
+ personaBlock + '\n'
874
+ );
875
+ } else {
876
+ newContent = newContent.trimEnd() + '\n' + personaBlock + '\n';
877
+ }
878
+ console.log(chalk.cyan(` + Preserved user persona overrides in ${file}`));
879
+ }
880
+
881
+ await fs.writeFile(newPath, newContent, 'utf-8');
882
+
883
+ // Validate merged output: re-read and parse to ensure YAML integrity
884
+ try {
885
+ const written = await fs.readFile(newPath, 'utf-8');
886
+ const validated = parseCustomizeYaml(written);
887
+ if (validated.criticalActions.length === 0 && written.includes('critical_actions:')) {
888
+ // critical_actions section exists but parsed to nothing — likely corrupt
889
+ console.log(chalk.yellow(` ! Merge output validation failed for ${file} — restoring from backup`));
890
+ await fs.copy(backupPath, newPath, { overwrite: true });
891
+ result.skipped.push(file);
892
+ continue;
893
+ }
894
+ } catch (parseErr) {
895
+ console.log(chalk.yellow(` ! Merge output parse error for ${file}: ${parseErr.message} — restoring from backup`));
896
+ await fs.copy(backupPath, newPath, { overwrite: true });
897
+ result.skipped.push(file);
898
+ continue;
899
+ }
900
+
901
+ result.merged.push(file);
902
+ }
903
+
904
+ if (result.merged.length > 0) {
905
+ console.log(chalk.green(` Merged user customizations into ${result.merged.length} file(s)`));
906
+ }
907
+ if (result.skipped.length > 0) {
908
+ console.log(chalk.gray(` ${result.skipped.length} file(s) had no user customizations to merge`));
909
+ }
910
+
911
+ return result;
912
+ }
913
+
914
+ /**
915
+ * Clean up legacy artifacts after successful migration.
916
+ * Conservative approach: only removes known-replaced files.
917
+ *
918
+ * @param {string} projectRoot - Absolute path to the project root
919
+ * @returns {Promise<string[]>} List of cleaned-up paths (relative to projectRoot)
920
+ */
921
+ async function cleanupLegacyArtifacts(projectRoot) {
922
+ const cleaned = [];
923
+
924
+ // 1. Remove old custom agent XML definitions in _bmad/custom/agents/
925
+ const customAgentsDir = path.join(projectRoot, BMAD_DIR, 'custom', 'agents');
926
+ if (fs.existsSync(customAgentsDir)) {
927
+ const files = await fs.readdir(customAgentsDir);
928
+ for (const file of files) {
929
+ if (file.endsWith('.xml')) {
930
+ await fs.remove(path.join(customAgentsDir, file));
931
+ const relPath = path.join(BMAD_DIR, 'custom', 'agents', file);
932
+ cleaned.push(relPath);
933
+ }
934
+ }
935
+ }
936
+
937
+ // 2. Remove legacy YAML workflow files (engine artifacts, not extension workflows)
938
+ // These are in _bmad/bmm/workflows/ — only remove known legacy patterns
939
+ const legacyWorkflowDir = path.join(projectRoot, BMAD_DIR, 'bmm', 'workflows');
940
+ if (fs.existsSync(legacyWorkflowDir)) {
941
+ const entries = await fs.readdir(legacyWorkflowDir);
942
+ for (const entry of entries) {
943
+ const entryPath = path.join(legacyWorkflowDir, entry);
944
+ const stat = await fs.stat(entryPath);
945
+ // Only remove .yaml files at the root of workflows/ (legacy engine artifacts)
946
+ // Do NOT remove subdirectories (those contain current workflow content)
947
+ if (!stat.isDirectory() && entry.endsWith('.yaml')) {
948
+ await fs.remove(entryPath);
949
+ const relPath = path.join(BMAD_DIR, 'bmm', 'workflows', entry);
950
+ cleaned.push(relPath);
951
+ }
952
+ }
953
+ }
954
+
955
+ // NOTE: Backup directory (.backup-pre-migration/) is intentionally preserved
956
+ // after cleanup. It is only removed when a NEW backup is created by
957
+ // backupCustomizations() during the next migration cycle. This ensures
958
+ // users can manually recover customizations if needed.
959
+
960
+ // Print migration log
961
+ if (cleaned.length > 0) {
962
+ console.log(chalk.green(`\n Migration cleanup summary:`));
963
+ for (const item of cleaned) {
964
+ console.log(chalk.gray(` - Removed: ${item}`));
965
+ }
966
+ console.log(chalk.green(` Cleaned up ${cleaned.length} legacy artifact(s)`));
967
+ } else {
968
+ console.log(chalk.gray(' No legacy artifacts to clean up'));
969
+ }
970
+
971
+ return cleaned;
972
+ }
973
+
442
974
  /**
443
975
  * Restore _git_preserved → .git and set origin to a local file:// URL.
444
976
  *
@@ -478,4 +1010,12 @@ module.exports = {
478
1010
  applyCustomizations,
479
1011
  prePopulateBmadCache,
480
1012
  deployMethodology,
1013
+ // Migration functions (exported for testing)
1014
+ detectMigrationNeed,
1015
+ compareVersions,
1016
+ backupCustomizations,
1017
+ restoreCustomizations,
1018
+ mergeUserCustomizations,
1019
+ cleanupLegacyArtifacts,
1020
+ parseCustomizeYaml,
481
1021
  };
package/lib/installer.js CHANGED
@@ -254,17 +254,23 @@ async function updateAgentInstructions(agent, projectRoot) {
254
254
  if (!agent.instructionFiles || agent.instructionFiles.length === 0) return;
255
255
 
256
256
  // JSON merge strategy (e.g., OpenCode)
257
+ // OpenCode expects instructions to be plain strings, not objects.
258
+ // We identify our entries by a marker prefix in the string content,
259
+ // and also clean up legacy object-format entries from older versions.
257
260
  if (agent.injectionStrategy?.position === 'json-merge') {
258
261
  const targetKey = agent.injectionStrategy.targetKey || 'instructions';
259
262
  const filePath = path.join(projectRoot, agent.instructionFiles[0]);
260
263
  const agentProjectPath = agent.getProjectPath();
261
264
  const relManifestPath = path.relative(projectRoot, path.join(agentProjectPath, 'MANIFEST.yaml')).replace(/\\/g, '/');
262
- const instructionText = `# AI Agent Skills - Planning Instruction\n\nYou have access to a library of skills in your skills directory. Before starting any task:\n\n1. Read the skill manifest at ${relManifestPath}\n2. Based on the task description, select which skills are relevant\n3. Read only the selected skill files\n4. Then proceed with the task\n\nAlways load skills marked with always_load: true.\nDo not load skills that are not relevant to the current task.`;
265
+ const instructionText = `[${MA_AGENTS_SOURCE}] # AI Agent Skills - Planning Instruction\n\nYou have access to a library of skills in your skills directory. Before starting any task:\n\n1. Read the skill manifest at ${relManifestPath}\n2. Based on the task description, select which skills are relevant\n3. Read only the selected skill files\n4. Then proceed with the task\n\nAlways load skills marked with always_load: true.\nDo not load skills that are not relevant to the current task.`;
266
+
267
+ const isMaEntry = (entry) =>
268
+ (typeof entry === 'string' && entry.startsWith(`[${MA_AGENTS_SOURCE}]`)) ||
269
+ (typeof entry === 'object' && entry != null && entry._source === MA_AGENTS_SOURCE);
263
270
 
264
271
  if (!fs.existsSync(filePath)) {
265
272
  // File absent: create fresh (atomic write)
266
- const data = { [targetKey]: [] };
267
- data[targetKey].push({ _source: MA_AGENTS_SOURCE, text: instructionText });
273
+ const data = { [targetKey]: [instructionText] };
268
274
  const tmpPath = filePath + '.tmp';
269
275
  await fs.outputFile(tmpPath, JSON.stringify(data, null, 2), 'utf-8');
270
276
  await fs.rename(tmpPath, filePath);
@@ -278,11 +284,9 @@ async function updateAgentInstructions(agent, projectRoot) {
278
284
  if (!Array.isArray(data[targetKey])) {
279
285
  data[targetKey] = [];
280
286
  }
281
- // Filter out stale ma-agents entries, keep user entries (null-safe)
282
- const userEntries = data[targetKey].filter(entry => entry != null && entry._source !== MA_AGENTS_SOURCE);
283
- // Append fresh ma-agents entries
284
- const freshEntries = [{ _source: MA_AGENTS_SOURCE, text: instructionText }];
285
- data[targetKey] = [...userEntries, ...freshEntries];
287
+ // Filter out stale ma-agents entries (string or legacy object format), keep user entries
288
+ const userEntries = data[targetKey].filter(entry => entry != null && !isMaEntry(entry));
289
+ data[targetKey] = [...userEntries, instructionText];
286
290
  // Atomic write: temp file then rename
287
291
  const tmpPath = filePath + '.tmp';
288
292
  await fs.outputFile(tmpPath, JSON.stringify(data, null, 2), 'utf-8');
package/opencode.json CHANGED
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "instructions": [
3
- {
4
- "_source": "ma-agents",
5
- "text": "# AI Agent Skills - Planning Instruction\n\nYou have access to a library of skills in your skills directory. Before starting any task:\n\n1. Read the skill manifest at .opencode/skills/MANIFEST.yaml\n2. Based on the task description, select which skills are relevant\n3. Read only the selected skill files\n4. Then proceed with the task\n\nAlways load skills marked with always_load: true.\nDo not load skills that are not relevant to the current task."
6
- }
3
+ "[ma-agents] # AI Agent Skills - Planning Instruction\n\nYou have access to a library of skills in your skills directory. Before starting any task:\n\n1. Read the skill manifest at .opencode/skills/MANIFEST.yaml\n2. Based on the task description, select which skills are relevant\n3. Read only the selected skill files\n4. Then proceed with the task\n\nAlways load skills marked with always_load: true.\nDo not load skills that are not relevant to the current task."
7
4
  ]
8
5
  }