bmad-method 6.0.0-alpha.17 → 6.0.0-alpha.18

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 (186) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/package.json +1 -1
  3. package/src/modules/bmgd/_module-installer/installer.js +160 -0
  4. package/src/modules/bmgd/_module-installer/platform-specifics/claude-code.js +23 -0
  5. package/src/modules/bmgd/_module-installer/platform-specifics/windsurf.js +18 -0
  6. package/src/modules/bmgd/agents/game-architect.agent.yaml +23 -8
  7. package/src/modules/bmgd/agents/game-designer.agent.yaml +38 -18
  8. package/src/modules/bmgd/agents/game-dev.agent.yaml +30 -14
  9. package/src/modules/bmgd/agents/game-qa.agent.yaml +64 -0
  10. package/src/modules/bmgd/agents/game-scrum-master.agent.yaml +27 -39
  11. package/src/modules/bmgd/agents/game-solo-dev.agent.yaml +56 -0
  12. package/src/modules/bmgd/docs/README.md +180 -0
  13. package/src/modules/bmgd/docs/agents-guide.md +407 -0
  14. package/src/modules/bmgd/docs/game-types-guide.md +503 -0
  15. package/src/modules/bmgd/docs/glossary.md +294 -0
  16. package/src/modules/bmgd/docs/quick-flow-guide.md +288 -0
  17. package/src/modules/bmgd/docs/quick-start.md +250 -0
  18. package/src/modules/bmgd/docs/troubleshooting.md +259 -0
  19. package/src/modules/bmgd/docs/workflow-overview.jpg +0 -0
  20. package/src/modules/bmgd/docs/workflows-guide.md +463 -0
  21. package/src/modules/bmgd/gametest/knowledge/balance-testing.md +220 -0
  22. package/src/modules/bmgd/gametest/knowledge/certification-testing.md +319 -0
  23. package/src/modules/bmgd/gametest/knowledge/compatibility-testing.md +228 -0
  24. package/src/modules/bmgd/gametest/knowledge/godot-testing.md +376 -0
  25. package/src/modules/bmgd/gametest/knowledge/input-testing.md +315 -0
  26. package/src/modules/bmgd/gametest/knowledge/localization-testing.md +304 -0
  27. package/src/modules/bmgd/gametest/knowledge/multiplayer-testing.md +322 -0
  28. package/src/modules/bmgd/gametest/knowledge/performance-testing.md +204 -0
  29. package/src/modules/bmgd/gametest/knowledge/playtesting.md +384 -0
  30. package/src/modules/bmgd/gametest/knowledge/qa-automation.md +190 -0
  31. package/src/modules/bmgd/gametest/knowledge/regression-testing.md +280 -0
  32. package/src/modules/bmgd/gametest/knowledge/save-testing.md +280 -0
  33. package/src/modules/bmgd/gametest/knowledge/smoke-testing.md +404 -0
  34. package/src/modules/bmgd/gametest/knowledge/test-priorities.md +271 -0
  35. package/src/modules/bmgd/gametest/knowledge/unity-testing.md +383 -0
  36. package/src/modules/bmgd/gametest/knowledge/unreal-testing.md +388 -0
  37. package/src/modules/bmgd/gametest/qa-index.csv +17 -0
  38. package/src/modules/bmgd/module.yaml +25 -9
  39. package/src/modules/bmgd/teams/default-party.csv +2 -0
  40. package/src/modules/bmgd/teams/team-gamedev.yaml +12 -1
  41. package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-01-init.md +164 -0
  42. package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-02-context.md +210 -0
  43. package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-03-ideation.md +289 -0
  44. package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/steps/step-04-complete.md +275 -0
  45. package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/workflow.md +49 -0
  46. package/src/modules/bmgd/workflows/1-preproduction/brainstorm-game/workflow.yaml +29 -8
  47. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-01-init.md +223 -0
  48. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-01b-continue.md +151 -0
  49. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-02-vision.md +218 -0
  50. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-03-market.md +218 -0
  51. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-04-fundamentals.md +231 -0
  52. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-05-scope.md +242 -0
  53. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-06-references.md +224 -0
  54. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-07-content.md +282 -0
  55. package/src/modules/bmgd/workflows/1-preproduction/game-brief/steps/step-08-complete.md +296 -0
  56. package/src/modules/bmgd/workflows/1-preproduction/game-brief/workflow.md +62 -0
  57. package/src/modules/bmgd/workflows/1-preproduction/game-brief/workflow.yaml +40 -9
  58. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-01-init.md +248 -0
  59. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-01b-continue.md +173 -0
  60. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-02-context.md +332 -0
  61. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-03-platforms.md +245 -0
  62. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-04-vision.md +229 -0
  63. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-05-core-gameplay.md +258 -0
  64. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-06-mechanics.md +249 -0
  65. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-07-game-type.md +266 -0
  66. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-08-progression.md +272 -0
  67. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-09-levels.md +264 -0
  68. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-10-art-audio.md +255 -0
  69. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-11-technical.md +275 -0
  70. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-12-epics.md +284 -0
  71. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-13-metrics.md +250 -0
  72. package/src/modules/bmgd/workflows/2-design/gdd/steps/step-14-complete.md +335 -0
  73. package/src/modules/bmgd/workflows/2-design/gdd/workflow.md +61 -0
  74. package/src/modules/bmgd/workflows/2-design/gdd/workflow.yaml +27 -7
  75. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-01-init.md +228 -0
  76. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-01b-continue.md +163 -0
  77. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-02-foundation.md +262 -0
  78. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-03-story.md +238 -0
  79. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-04-characters.md +297 -0
  80. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-05-world.md +262 -0
  81. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-06-dialogue.md +250 -0
  82. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-07-environmental.md +244 -0
  83. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-08-delivery.md +264 -0
  84. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-09-integration.md +254 -0
  85. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-10-production.md +262 -0
  86. package/src/modules/bmgd/workflows/2-design/narrative/steps/step-11-complete.md +331 -0
  87. package/src/modules/bmgd/workflows/2-design/narrative/workflow.md +57 -0
  88. package/src/modules/bmgd/workflows/2-design/narrative/workflow.yaml +53 -8
  89. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-01-init.md +223 -0
  90. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-01b-continue.md +153 -0
  91. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-02-context.md +262 -0
  92. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-03-starter.md +290 -0
  93. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-04-decisions.md +300 -0
  94. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-05-crosscutting.md +319 -0
  95. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-06-structure.md +304 -0
  96. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-07-patterns.md +349 -0
  97. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-08-validation.md +293 -0
  98. package/src/modules/bmgd/workflows/3-technical/game-architecture/steps/step-09-complete.md +302 -0
  99. package/src/modules/bmgd/workflows/3-technical/game-architecture/workflow.md +55 -0
  100. package/src/modules/bmgd/workflows/3-technical/game-architecture/workflow.yaml +50 -21
  101. package/src/modules/bmgd/workflows/4-production/code-review/checklist.md +23 -0
  102. package/src/modules/bmgd/workflows/4-production/code-review/instructions.xml +225 -0
  103. package/src/modules/bmgd/workflows/4-production/code-review/workflow.yaml +18 -15
  104. package/src/modules/bmgd/workflows/4-production/correct-course/checklist.md +1 -1
  105. package/src/modules/bmgd/workflows/4-production/correct-course/instructions.md +1 -1
  106. package/src/modules/bmgd/workflows/4-production/correct-course/workflow.yaml +11 -6
  107. package/src/modules/bmgd/workflows/4-production/create-story/checklist.md +332 -214
  108. package/src/modules/bmgd/workflows/4-production/create-story/instructions.xml +298 -0
  109. package/src/modules/bmgd/workflows/4-production/create-story/template.md +3 -5
  110. package/src/modules/bmgd/workflows/4-production/create-story/workflow.yaml +12 -7
  111. package/src/modules/bmgd/workflows/4-production/dev-story/checklist.md +65 -23
  112. package/src/modules/bmgd/workflows/4-production/dev-story/instructions.xml +409 -0
  113. package/src/modules/bmgd/workflows/4-production/dev-story/workflow.yaml +13 -3
  114. package/src/modules/bmgd/workflows/4-production/retrospective/instructions.md +4 -4
  115. package/src/modules/bmgd/workflows/4-production/retrospective/workflow.yaml +12 -7
  116. package/src/modules/bmgd/workflows/4-production/sprint-planning/instructions.md +32 -41
  117. package/src/modules/bmgd/workflows/4-production/sprint-planning/sprint-status-template.yaml +13 -13
  118. package/src/modules/bmgd/workflows/4-production/sprint-planning/workflow.yaml +6 -1
  119. package/src/modules/bmgd/workflows/4-production/sprint-status/instructions.md +229 -0
  120. package/src/modules/bmgd/workflows/4-production/sprint-status/workflow.yaml +35 -0
  121. package/src/modules/bmgd/workflows/bmgd-quick-flow/create-tech-spec/instructions.md +140 -0
  122. package/src/modules/bmgd/workflows/bmgd-quick-flow/create-tech-spec/workflow.yaml +27 -0
  123. package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-dev/checklist.md +37 -0
  124. package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-dev/instructions.md +220 -0
  125. package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-dev/workflow.yaml +45 -0
  126. package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-prototype/checklist.md +26 -0
  127. package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-prototype/instructions.md +156 -0
  128. package/src/modules/bmgd/workflows/bmgd-quick-flow/quick-prototype/workflow.yaml +36 -0
  129. package/src/modules/bmgd/workflows/gametest/automate/checklist.md +93 -0
  130. package/src/modules/bmgd/workflows/gametest/automate/instructions.md +317 -0
  131. package/src/modules/bmgd/workflows/gametest/automate/workflow.yaml +50 -0
  132. package/src/modules/bmgd/workflows/gametest/performance/checklist.md +96 -0
  133. package/src/modules/bmgd/workflows/gametest/performance/instructions.md +323 -0
  134. package/src/modules/bmgd/workflows/gametest/performance/performance-template.md +256 -0
  135. package/src/modules/bmgd/workflows/gametest/performance/workflow.yaml +48 -0
  136. package/src/modules/bmgd/workflows/gametest/playtest-plan/checklist.md +93 -0
  137. package/src/modules/bmgd/workflows/gametest/playtest-plan/instructions.md +297 -0
  138. package/src/modules/bmgd/workflows/gametest/playtest-plan/playtest-template.md +208 -0
  139. package/src/modules/bmgd/workflows/gametest/playtest-plan/workflow.yaml +59 -0
  140. package/src/modules/bmgd/workflows/gametest/test-design/checklist.md +98 -0
  141. package/src/modules/bmgd/workflows/gametest/test-design/instructions.md +280 -0
  142. package/src/modules/bmgd/workflows/gametest/test-design/test-design-template.md +205 -0
  143. package/src/modules/bmgd/workflows/gametest/test-design/workflow.yaml +47 -0
  144. package/src/modules/bmgd/workflows/gametest/test-framework/checklist.md +103 -0
  145. package/src/modules/bmgd/workflows/gametest/test-framework/instructions.md +348 -0
  146. package/src/modules/bmgd/workflows/gametest/test-framework/workflow.yaml +48 -0
  147. package/src/modules/bmgd/workflows/gametest/test-review/checklist.md +87 -0
  148. package/src/modules/bmgd/workflows/gametest/test-review/instructions.md +272 -0
  149. package/src/modules/bmgd/workflows/gametest/test-review/test-review-template.md +203 -0
  150. package/src/modules/bmgd/workflows/gametest/test-review/workflow.yaml +48 -0
  151. package/src/modules/bmgd/workflows/workflow-status/init/instructions.md +299 -0
  152. package/src/modules/bmgd/workflows/workflow-status/init/workflow.yaml +29 -0
  153. package/src/modules/bmgd/workflows/workflow-status/instructions.md +395 -0
  154. package/src/modules/bmgd/workflows/workflow-status/paths/gamedev-brownfield.yaml +65 -0
  155. package/src/modules/bmgd/workflows/workflow-status/paths/gamedev-greenfield.yaml +71 -0
  156. package/src/modules/bmgd/workflows/workflow-status/paths/quickflow-brownfield.yaml +29 -0
  157. package/src/modules/bmgd/workflows/workflow-status/paths/quickflow-greenfield.yaml +39 -0
  158. package/src/modules/bmgd/workflows/workflow-status/project-levels.yaml +63 -0
  159. package/src/modules/bmgd/workflows/workflow-status/workflow-status-template.yaml +24 -0
  160. package/src/modules/bmgd/workflows/workflow-status/workflow.yaml +30 -0
  161. package/tools/cli/commands/install.js +9 -0
  162. package/tools/cli/installers/lib/core/installer.js +109 -109
  163. package/tools/cli/installers/lib/core/installer.js.bak +3204 -0
  164. package/tools/cli/installers/lib/modules/manager.js +16 -4
  165. package/tools/cli/lib/agent/compiler.js +99 -0
  166. package/tools/cli/lib/ui.js +78 -27
  167. package/src/modules/bmgd/workflows/2-design/gdd/instructions-gdd.md +0 -502
  168. package/src/modules/bmgd/workflows/4-production/code-review/instructions.md +0 -398
  169. package/src/modules/bmgd/workflows/4-production/create-story/instructions.md +0 -256
  170. package/src/modules/bmgd/workflows/4-production/dev-story/instructions.md +0 -267
  171. package/src/modules/bmgd/workflows/4-production/epic-tech-context/checklist.md +0 -17
  172. package/src/modules/bmgd/workflows/4-production/epic-tech-context/instructions.md +0 -164
  173. package/src/modules/bmgd/workflows/4-production/epic-tech-context/template.md +0 -76
  174. package/src/modules/bmgd/workflows/4-production/epic-tech-context/workflow.yaml +0 -58
  175. package/src/modules/bmgd/workflows/4-production/story-context/checklist.md +0 -16
  176. package/src/modules/bmgd/workflows/4-production/story-context/context-template.xml +0 -34
  177. package/src/modules/bmgd/workflows/4-production/story-context/instructions.md +0 -209
  178. package/src/modules/bmgd/workflows/4-production/story-context/workflow.yaml +0 -63
  179. package/src/modules/bmgd/workflows/4-production/story-done/instructions.md +0 -111
  180. package/src/modules/bmgd/workflows/4-production/story-done/workflow.yaml +0 -28
  181. package/src/modules/bmgd/workflows/4-production/story-ready/instructions.md +0 -117
  182. package/src/modules/bmgd/workflows/4-production/story-ready/workflow.yaml +0 -25
  183. /package/src/modules/bmgd/workflows/1-preproduction/game-brief/{template.md → templates/game-brief-template.md} +0 -0
  184. /package/src/modules/bmgd/workflows/2-design/gdd/{gdd-template.md → templates/gdd-template.md} +0 -0
  185. /package/src/modules/bmgd/workflows/2-design/narrative/{narrative-template.md → templates/narrative-template.md} +0 -0
  186. /package/src/modules/bmgd/workflows/3-technical/game-architecture/{architecture-template.md → templates/architecture-template.md} +0 -0
@@ -731,7 +731,7 @@ class ModuleManager {
731
731
  async compileModuleAgents(sourcePath, targetPath, moduleName, bmadDir, installer = null) {
732
732
  const sourceAgentsPath = path.join(sourcePath, 'agents');
733
733
  const targetAgentsPath = path.join(targetPath, 'agents');
734
- const cfgAgentsDir = path.join(bmadDir, '_config', 'agents');
734
+ const cfgAgentsDir = path.join(bmadDir, '_bmad', '_config', 'agents');
735
735
 
736
736
  // Check if agents directory exists in source
737
737
  if (!(await fs.pathExists(sourceAgentsPath))) {
@@ -809,9 +809,9 @@ class ModuleManager {
809
809
  const customizeData = yaml.parse(customizeContent);
810
810
  customizedFields = customizeData.customized_fields || [];
811
811
 
812
- // Build answers object from customizations (filter empty values)
812
+ // Build answers object from customizations
813
813
  if (customizeData.persona) {
814
- Object.assign(answers, filterCustomizationData(customizeData.persona));
814
+ answers.persona = customizeData.persona;
815
815
  }
816
816
  if (customizeData.agent?.metadata) {
817
817
  const filteredMetadata = filterCustomizationData(customizeData.agent.metadata);
@@ -825,6 +825,12 @@ class ModuleManager {
825
825
  if (customizeData.memories && customizeData.memories.length > 0) {
826
826
  answers.memories = customizeData.memories;
827
827
  }
828
+ if (customizeData.menu && customizeData.menu.length > 0) {
829
+ answers.menu = customizeData.menu;
830
+ }
831
+ if (customizeData.prompts && customizeData.prompts.length > 0) {
832
+ answers.prompts = customizeData.prompts;
833
+ }
828
834
  }
829
835
 
830
836
  // Check if agent has sidecar
@@ -839,8 +845,14 @@ class ModuleManager {
839
845
  // Compile with customizations if any
840
846
  const { xml } = await compileAgent(yamlContent, answers, agentName, relativePath, { config: this.coreConfig || {} });
841
847
 
848
+ // Process TTS injection points if installer is available
849
+ let finalXml = xml;
850
+ if (installer && installer.processTTSInjectionPoints) {
851
+ finalXml = installer.processTTSInjectionPoints(xml, targetMdPath);
852
+ }
853
+
842
854
  // Write the compiled agent
843
- await fs.writeFile(targetMdPath, xml, 'utf8');
855
+ await fs.writeFile(targetMdPath, finalXml, 'utf8');
844
856
 
845
857
  // Handle sidecar copying if present
846
858
  if (hasSidecar) {
@@ -98,6 +98,25 @@ function buildPromptsXml(prompts) {
98
98
  return xml;
99
99
  }
100
100
 
101
+ /**
102
+ * Build memories XML section
103
+ * @param {Array} memories - Memories array
104
+ * @returns {string} Memories XML
105
+ */
106
+ function buildMemoriesXml(memories) {
107
+ if (!memories || memories.length === 0) return '';
108
+
109
+ let xml = ' <memories>\n';
110
+
111
+ for (const memory of memories) {
112
+ xml += ` <memory>${escapeXml(String(memory))}</memory>\n`;
113
+ }
114
+
115
+ xml += ' </memories>\n';
116
+
117
+ return xml;
118
+ }
119
+
101
120
  /**
102
121
  * Build menu XML section
103
122
  * Supports both legacy and multi format menu items
@@ -285,6 +304,11 @@ async function compileToXml(agentYaml, agentName = '', targetPath = '') {
285
304
  xml += buildPromptsXml(agent.prompts);
286
305
  }
287
306
 
307
+ // Memories section (if present)
308
+ if (agent.memories && agent.memories.length > 0) {
309
+ xml += buildMemoriesXml(agent.memories);
310
+ }
311
+
288
312
  // Menu section
289
313
  xml += buildMenuXml(agent.menu || []);
290
314
 
@@ -323,6 +347,80 @@ async function compileAgent(yamlContent, answers = {}, agentName = '', targetPat
323
347
  answers = templateAnswers;
324
348
  }
325
349
 
350
+ // Handle other customization properties
351
+ // These should be merged into the agent structure, not processed as template variables
352
+ const customizationKeys = ['persona', 'critical_actions', 'memories', 'menu', 'prompts'];
353
+ const customizations = {};
354
+ const remainingAnswers = { ...answers };
355
+
356
+ for (const key of customizationKeys) {
357
+ if (answers[key]) {
358
+ let filtered;
359
+
360
+ // Handle different data types
361
+ if (Array.isArray(answers[key])) {
362
+ // For arrays, filter out empty/null/undefined values
363
+ filtered = answers[key].filter((item) => item !== null && item !== undefined && item !== '');
364
+ } else {
365
+ // For objects, use filterCustomizationData
366
+ filtered = filterCustomizationData(answers[key]);
367
+ }
368
+
369
+ // Check if we have valid content
370
+ const hasContent = Array.isArray(filtered) ? filtered.length > 0 : Object.keys(filtered).length > 0;
371
+
372
+ if (hasContent) {
373
+ customizations[key] = filtered;
374
+ }
375
+ delete remainingAnswers[key];
376
+ }
377
+ }
378
+
379
+ // Merge customizations into agentYaml
380
+ if (Object.keys(customizations).length > 0) {
381
+ // For persona: replace entire section
382
+ if (customizations.persona) {
383
+ agentYaml.agent.persona = customizations.persona;
384
+ }
385
+
386
+ // For critical_actions: append to existing or create new
387
+ if (customizations.critical_actions) {
388
+ const existing = agentYaml.agent.critical_actions || [];
389
+ agentYaml.agent.critical_actions = [...existing, ...customizations.critical_actions];
390
+ }
391
+
392
+ // For memories: append to existing or create new
393
+ if (customizations.memories) {
394
+ const existing = agentYaml.agent.memories || [];
395
+ agentYaml.agent.memories = [...existing, ...customizations.memories];
396
+ }
397
+
398
+ // For menu: append to existing or create new
399
+ if (customizations.menu) {
400
+ const existing = agentYaml.agent.menu || [];
401
+ agentYaml.agent.menu = [...existing, ...customizations.menu];
402
+ }
403
+
404
+ // For prompts: append to existing or create new (by id)
405
+ if (customizations.prompts) {
406
+ const existing = agentYaml.agent.prompts || [];
407
+ // Merge by id, with customizations taking precedence
408
+ const mergedPrompts = [...existing];
409
+ for (const customPrompt of customizations.prompts) {
410
+ const existingIndex = mergedPrompts.findIndex((p) => p.id === customPrompt.id);
411
+ if (existingIndex === -1) {
412
+ mergedPrompts.push(customPrompt);
413
+ } else {
414
+ mergedPrompts[existingIndex] = customPrompt;
415
+ }
416
+ }
417
+ agentYaml.agent.prompts = mergedPrompts;
418
+ }
419
+ }
420
+
421
+ // Use remaining answers for template processing
422
+ answers = remainingAnswers;
423
+
326
424
  // Extract install_config
327
425
  const installConfig = extractInstallConfig(agentYaml);
328
426
 
@@ -460,6 +558,7 @@ module.exports = {
460
558
  buildFrontmatter,
461
559
  buildPersonaXml,
462
560
  buildPromptsXml,
561
+ buildMemoriesXml,
463
562
  buildMenuXml,
464
563
  filterCustomizationData,
465
564
  };
@@ -189,6 +189,14 @@ class UI {
189
189
  });
190
190
  }
191
191
 
192
+ // Add custom agent compilation option
193
+ if (installedVersion !== 'unknown') {
194
+ choices.push({
195
+ name: 'Recompile Agents (apply customizations only)',
196
+ value: 'compile-agents',
197
+ });
198
+ }
199
+
192
200
  // Common actions
193
201
  choices.push({ name: 'Modify BMAD Installation', value: 'update' });
194
202
 
@@ -215,6 +223,16 @@ class UI {
215
223
  };
216
224
  }
217
225
 
226
+ // Handle compile agents separately
227
+ if (actionType === 'compile-agents') {
228
+ // Only recompile agents with customizations, don't update any files
229
+ return {
230
+ actionType: 'compile-agents',
231
+ directory: confirmedDirectory,
232
+ customContent: { hasCustomContent: false },
233
+ };
234
+ }
235
+
218
236
  // If actionType === 'update', handle it with the new flow
219
237
  // Return early with modify configuration
220
238
  if (actionType === 'update') {
@@ -241,7 +259,35 @@ class UI {
241
259
  }
242
260
 
243
261
  // After module selection, ask about custom modules
244
- const customModuleResult = await this.handleCustomModulesInModifyFlow(confirmedDirectory, selectedModules);
262
+ console.log('');
263
+ const { changeCustomModules } = await inquirer.prompt([
264
+ {
265
+ type: 'confirm',
266
+ name: 'changeCustomModules',
267
+ message: 'Modify custom module selection (add, update, or remove custom modules/agents/workflows)?',
268
+ default: false,
269
+ },
270
+ ]);
271
+
272
+ let customModuleResult = { selectedCustomModules: [], customContentConfig: { hasCustomContent: false } };
273
+ if (changeCustomModules) {
274
+ customModuleResult = await this.handleCustomModulesInModifyFlow(confirmedDirectory, selectedModules);
275
+ } else {
276
+ // Preserve existing custom modules if user doesn't want to modify them
277
+ const { Installer } = require('../installers/lib/core/installer');
278
+ const installer = new Installer();
279
+ const { bmadDir } = await installer.findBmadDir(confirmedDirectory);
280
+
281
+ const cacheDir = path.join(bmadDir, '_config', 'custom');
282
+ if (await fs.pathExists(cacheDir)) {
283
+ const entries = await fs.readdir(cacheDir, { withFileTypes: true });
284
+ for (const entry of entries) {
285
+ if (entry.isDirectory()) {
286
+ customModuleResult.selectedCustomModules.push(entry.name);
287
+ }
288
+ }
289
+ }
290
+ }
245
291
 
246
292
  // Merge any selected custom modules
247
293
  if (customModuleResult.selectedCustomModules.length > 0) {
@@ -1322,26 +1368,35 @@ class UI {
1322
1368
  customContentConfig: { hasCustomContent: false },
1323
1369
  };
1324
1370
 
1325
- if (cachedCustomModules.length === 0) {
1326
- return result;
1327
- }
1328
-
1329
1371
  // Ask user about custom modules
1330
1372
  console.log(chalk.cyan('\n⚙️ Custom Modules'));
1331
- console.log(chalk.dim('Found custom modules in your installation:'));
1373
+ if (cachedCustomModules.length > 0) {
1374
+ console.log(chalk.dim('Found custom modules in your installation:'));
1375
+ } else {
1376
+ console.log(chalk.dim('No custom modules currently installed.'));
1377
+ }
1378
+
1379
+ // Build choices dynamically based on whether we have existing modules
1380
+ const choices = [];
1381
+ if (cachedCustomModules.length > 0) {
1382
+ choices.push(
1383
+ { name: 'Keep all existing custom modules', value: 'keep' },
1384
+ { name: 'Select which custom modules to keep', value: 'select' },
1385
+ { name: 'Add new custom modules', value: 'add' },
1386
+ { name: 'Remove all custom modules', value: 'remove' },
1387
+ );
1388
+ } else {
1389
+ choices.push({ name: 'Add new custom modules', value: 'add' }, { name: 'Cancel (no custom modules)', value: 'cancel' });
1390
+ }
1332
1391
 
1333
1392
  const { customAction } = await inquirer.prompt([
1334
1393
  {
1335
1394
  type: 'list',
1336
1395
  name: 'customAction',
1337
- message: 'What would you like to do with custom modules?',
1338
- choices: [
1339
- { name: 'Keep all existing custom modules', value: 'keep' },
1340
- { name: 'Select which custom modules to keep', value: 'select' },
1341
- { name: 'Add new custom modules', value: 'add' },
1342
- { name: 'Remove all custom modules', value: 'remove' },
1343
- ],
1344
- default: 'keep',
1396
+ message:
1397
+ cachedCustomModules.length > 0 ? 'What would you like to do with custom modules?' : 'Would you like to add custom modules?',
1398
+ choices: choices,
1399
+ default: cachedCustomModules.length > 0 ? 'keep' : 'add',
1345
1400
  },
1346
1401
  ]);
1347
1402
 
@@ -1374,19 +1429,9 @@ class UI {
1374
1429
  }
1375
1430
 
1376
1431
  case 'add': {
1377
- // First ask to keep existing ones
1378
- const { keepExisting } = await inquirer.prompt([
1379
- {
1380
- type: 'confirm',
1381
- name: 'keepExisting',
1382
- message: 'Keep existing custom modules?',
1383
- default: true,
1384
- },
1385
- ]);
1386
-
1387
- if (keepExisting) {
1388
- result.selectedCustomModules = cachedCustomModules.map((m) => m.id);
1389
- }
1432
+ // By default, keep existing modules when adding new ones
1433
+ // User chose "Add new" not "Replace", so we assume they want to keep existing
1434
+ result.selectedCustomModules = cachedCustomModules.map((m) => m.id);
1390
1435
 
1391
1436
  // Then prompt for new ones (reuse existing method)
1392
1437
  const newCustomContent = await this.promptCustomContentSource();
@@ -1402,6 +1447,12 @@ class UI {
1402
1447
  console.log(chalk.yellow('All custom modules will be removed from the installation'));
1403
1448
  break;
1404
1449
  }
1450
+
1451
+ case 'cancel': {
1452
+ // User cancelled - no custom modules
1453
+ console.log(chalk.dim('No custom modules will be added'));
1454
+ break;
1455
+ }
1405
1456
  }
1406
1457
 
1407
1458
  return result;