bmad-method 4.2.0 → 4.4.1

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 (176) hide show
  1. package/.claude/commands/analyst.md +14 -20
  2. package/.claude/commands/architect.md +15 -20
  3. package/.claude/commands/bmad-master.md +18 -26
  4. package/.claude/commands/bmad-orchestrator.md +80 -33
  5. package/.claude/commands/dev.md +5 -4
  6. package/.claude/commands/pm.md +11 -16
  7. package/.claude/commands/sm.md +20 -25
  8. package/.cursor/rules/analyst.mdc +13 -19
  9. package/.cursor/rules/architect.mdc +14 -19
  10. package/.cursor/rules/bmad-master.mdc +18 -26
  11. package/.cursor/rules/bmad-orchestrator.mdc +80 -33
  12. package/.cursor/rules/dev.mdc +5 -4
  13. package/.cursor/rules/pm.mdc +11 -16
  14. package/.cursor/rules/sm.mdc +19 -24
  15. package/.releaserc.json +2 -1
  16. package/.roo/README.md +0 -11
  17. package/.vscode/settings.json +4 -0
  18. package/.windsurf/rules/analyst.md +13 -19
  19. package/.windsurf/rules/architect.md +14 -19
  20. package/.windsurf/rules/bmad-master.md +18 -26
  21. package/.windsurf/rules/bmad-orchestrator.md +80 -33
  22. package/.windsurf/rules/dev.md +5 -4
  23. package/.windsurf/rules/pm.md +11 -16
  24. package/.windsurf/rules/sm.md +19 -24
  25. package/CHANGELOG.md +126 -2
  26. package/CONTRIBUTING.md +2 -0
  27. package/README.md +20 -2
  28. package/{.bmad-core → bmad-core}/agent-teams/team-all.yml +1 -3
  29. package/bmad-core/agent-teams/team-fullstack.yml +18 -0
  30. package/{.bmad-core → bmad-core}/agent-teams/team-no-ui.yml +0 -2
  31. package/{.bmad-core → bmad-core}/agents/analyst.md +14 -20
  32. package/{.bmad-core → bmad-core}/agents/architect.md +15 -20
  33. package/{.bmad-core → bmad-core}/agents/bmad-master.md +18 -26
  34. package/bmad-core/agents/bmad-orchestrator.md +128 -0
  35. package/{.bmad-core → bmad-core}/agents/dev.md +5 -4
  36. package/{.bmad-core → bmad-core}/agents/pm.md +11 -16
  37. package/{.bmad-core → bmad-core}/agents/qa.md +11 -17
  38. package/bmad-core/agents/sm.md +55 -0
  39. package/{.bmad-core → bmad-core}/agents/ux-expert.md +14 -20
  40. package/bmad-core/bmad-core-config.yml +60 -0
  41. package/bmad-core/data/bmad-kb.md +47 -0
  42. package/bmad-core/tasks/doc-migration-task.md +143 -0
  43. package/bmad-core/tasks/document-project.md +389 -0
  44. package/bmad-core/tasks/generate-ai-frontend-prompt.md +51 -0
  45. package/{.bmad-core → bmad-core}/tasks/index-docs.md +8 -3
  46. package/{.bmad-core → bmad-core}/tasks/shard-doc.md +5 -3
  47. package/{.bmad-core → bmad-core}/templates/architecture-tmpl.md +16 -13
  48. package/{.bmad-core → bmad-core}/templates/brownfield-architecture-tmpl.md +6 -6
  49. package/{.bmad-core → bmad-core}/templates/front-end-spec-tmpl.md +6 -6
  50. package/{.bmad-core → bmad-core}/templates/fullstack-architecture-tmpl.md +85 -103
  51. package/{.bmad-core → bmad-core}/templates/prd-tmpl.md +1 -1
  52. package/bmad-core/templates/simple-project-prd-tmpl.md +461 -0
  53. package/{.bmad-core → bmad-core}/templates/story-tmpl.md +2 -2
  54. package/{.bmad-core → bmad-core}/utils/agent-switcher.ide.md +6 -6
  55. package/{.bmad-core → bmad-core}/utils/workflow-management.md +14 -15
  56. package/{.bmad-core → bmad-core}/web-bundles/agents/analyst.txt +26 -21
  57. package/{.bmad-core → bmad-core}/web-bundles/agents/architect.txt +608 -236
  58. package/{.bmad-core → bmad-core}/web-bundles/agents/bmad-master.txt +467 -1049
  59. package/bmad-core/web-bundles/agents/bmad-orchestrator.txt +647 -0
  60. package/{.bmad-core → bmad-core}/web-bundles/agents/dev.txt +5 -4
  61. package/{.bmad-core → bmad-core}/web-bundles/agents/pm.txt +477 -18
  62. package/{.bmad-core → bmad-core}/web-bundles/agents/po.txt +3 -3
  63. package/{.bmad-core → bmad-core}/web-bundles/agents/qa.txt +11 -17
  64. package/{.bmad-core → bmad-core}/web-bundles/agents/sm.txt +22 -27
  65. package/{.bmad-core → bmad-core}/web-bundles/agents/ux-expert.txt +57 -70
  66. package/{.bmad-core → bmad-core}/workflows/greenfield-fullstack.yml +3 -3
  67. package/{.bmad-core → creator-tools}/tasks/create-agent.md +10 -12
  68. package/{.bmad-core/tasks/create-expansion-pack.md → creator-tools/tasks/generate-expansion-pack.md} +8 -6
  69. package/docs/bmad-workflow-guide.md +161 -0
  70. package/docs/claude-code-guide.md +119 -0
  71. package/docs/core-architecture.md +213 -0
  72. package/docs/cursor-guide.md +127 -0
  73. package/docs/how-to-contribute-with-pull-requests.md +141 -0
  74. package/docs/roo-code-guide.md +140 -0
  75. package/docs/user-guide.md +1044 -0
  76. package/docs/versioning-and-releases.md +4 -4
  77. package/docs/windsurf-guide.md +127 -0
  78. package/expansion-packs/README.md +1 -111
  79. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/team-game-dev.yml +12 -0
  80. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +58 -0
  81. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +66 -0
  82. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +51 -0
  83. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-design-checklist.md +201 -0
  84. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md +160 -0
  85. package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +254 -0
  86. package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +631 -0
  87. package/expansion-packs/bmad-2d-phaser-game-dev/manifest.yml +45 -0
  88. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +111 -0
  89. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +216 -0
  90. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +308 -0
  91. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md +560 -0
  92. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md +345 -0
  93. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md +331 -0
  94. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.md +235 -0
  95. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md +451 -0
  96. package/expansion-packs/bmad-2d-phaser-game-dev/web-bundles/agents/game-designer.txt +1758 -0
  97. package/expansion-packs/bmad-2d-phaser-game-dev/web-bundles/agents/game-developer.txt +1444 -0
  98. package/expansion-packs/bmad-2d-phaser-game-dev/web-bundles/agents/game-sm.txt +674 -0
  99. package/expansion-packs/bmad-2d-phaser-game-dev/web-bundles/team-game-dev.txt +4395 -0
  100. package/expansion-packs/bmad-2d-phaser-game-dev/web-bundles/teams/team-game-dev.txt +4395 -0
  101. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yml +183 -0
  102. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yml +175 -0
  103. package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/README.md +5 -5
  104. package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/agents/infra-devops-platform.md +3 -3
  105. package/expansion-packs/bmad-infrastructure-devops/manifest.yml +23 -0
  106. package/expansion-packs/bmad-infrastructure-devops/tasks/create-doc.md +74 -0
  107. package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
  108. package/expansion-packs/bmad-infrastructure-devops/web-bundles/agents/infra-devops-platform.txt +2021 -0
  109. package/package.json +20 -14
  110. package/tools/builders/web-builder.js +207 -17
  111. package/tools/cli.js +55 -7
  112. package/tools/installer/README.md +2 -2
  113. package/tools/installer/bin/bmad.js +107 -28
  114. package/tools/installer/config/install.config.yml +43 -43
  115. package/tools/installer/lib/config-loader.js +39 -2
  116. package/tools/installer/lib/file-manager.js +20 -3
  117. package/tools/installer/lib/ide-setup.js +11 -1
  118. package/tools/installer/lib/installer.js +275 -29
  119. package/tools/installer/package-lock.json +538 -336
  120. package/tools/installer/package.json +8 -8
  121. package/tools/lib/dependency-resolver.js +2 -2
  122. package/tools/semantic-release-sync-installer.js +31 -0
  123. package/tools/sync-installer-version.js +34 -0
  124. package/tools/upgraders/v3-to-v4-upgrader.js +18 -13
  125. package/tools/version-bump.js +33 -26
  126. package/tools/yaml-format.js +54 -25
  127. package/.bmad-core/agent-teams/team-fullstack.yml +0 -26
  128. package/.bmad-core/agents/bmad-orchestrator.md +0 -81
  129. package/.bmad-core/agents/sm.md +0 -60
  130. package/.bmad-core/data/bmad-kb.md +0 -36
  131. package/.bmad-core/schemas/agent-team-schema.yml +0 -153
  132. package/.bmad-core/tasks/create-team.md +0 -229
  133. package/.bmad-core/tasks/doc-migration-task.md +0 -198
  134. package/.bmad-core/tasks/generate-ai-frontend-prompt.md +0 -58
  135. package/.bmad-core/web-bundles/agents/bmad-orchestrator.txt +0 -1455
  136. package/.bmad-core/web-bundles/teams/team-all.txt +0 -10315
  137. package/.bmad-core/web-bundles/teams/team-fullstack.txt +0 -9663
  138. package/.bmad-core/web-bundles/teams/team-no-ui.txt +0 -8504
  139. package/.claude/settings.local.json +0 -22
  140. package/expansion-packs/infrastructure-devops/manifest.yml +0 -38
  141. /package/{.bmad-core → bmad-core}/agents/po.md +0 -0
  142. /package/{.bmad-core → bmad-core}/checklists/architect-checklist.md +0 -0
  143. /package/{.bmad-core → bmad-core}/checklists/change-checklist.md +0 -0
  144. /package/{.bmad-core → bmad-core}/checklists/pm-checklist.md +0 -0
  145. /package/{.bmad-core → bmad-core}/checklists/po-master-checklist.md +0 -0
  146. /package/{.bmad-core → bmad-core}/checklists/story-dod-checklist.md +0 -0
  147. /package/{.bmad-core → bmad-core}/checklists/story-draft-checklist.md +0 -0
  148. /package/{.bmad-core → bmad-core}/data/technical-preferences.md +0 -0
  149. /package/{.bmad-core → bmad-core}/tasks/advanced-elicitation.md +0 -0
  150. /package/{.bmad-core → bmad-core}/tasks/brainstorming-techniques.md +0 -0
  151. /package/{.bmad-core → bmad-core}/tasks/brownfield-create-epic.md +0 -0
  152. /package/{.bmad-core → bmad-core}/tasks/brownfield-create-story.md +0 -0
  153. /package/{.bmad-core → bmad-core}/tasks/core-dump.md +0 -0
  154. /package/{.bmad-core → bmad-core}/tasks/correct-course.md +0 -0
  155. /package/{.bmad-core → bmad-core}/tasks/create-deep-research-prompt.md +0 -0
  156. /package/{.bmad-core → bmad-core}/tasks/create-doc.md +0 -0
  157. /package/{.bmad-core → bmad-core}/tasks/create-next-story.md +0 -0
  158. /package/{.bmad-core → bmad-core}/tasks/execute-checklist.md +0 -0
  159. /package/{.bmad-core → bmad-core}/templates/agent-tmpl.md +0 -0
  160. /package/{.bmad-core → bmad-core}/templates/brownfield-prd-tmpl.md +0 -0
  161. /package/{.bmad-core → bmad-core}/templates/competitor-analysis-tmpl.md +0 -0
  162. /package/{.bmad-core → bmad-core}/templates/expansion-pack-plan-tmpl.md +0 -0
  163. /package/{.bmad-core → bmad-core}/templates/front-end-architecture-tmpl.md +0 -0
  164. /package/{.bmad-core → bmad-core}/templates/market-research-tmpl.md +0 -0
  165. /package/{.bmad-core → bmad-core}/templates/project-brief-tmpl.md +0 -0
  166. /package/{.bmad-core → bmad-core}/templates/web-agent-startup-instructions-template.md +0 -0
  167. /package/{.bmad-core → bmad-core}/utils/template-format.md +0 -0
  168. /package/{.bmad-core → bmad-core}/workflows/brownfield-fullstack.yml +0 -0
  169. /package/{.bmad-core → bmad-core}/workflows/brownfield-service.yml +0 -0
  170. /package/{.bmad-core → bmad-core}/workflows/brownfield-ui.yml +0 -0
  171. /package/{.bmad-core → bmad-core}/workflows/greenfield-service.yml +0 -0
  172. /package/{.bmad-core → bmad-core}/workflows/greenfield-ui.yml +0 -0
  173. /package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/checklists/infrastructure-checklist.md +0 -0
  174. /package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/tasks/review-infrastructure.md +0 -0
  175. /package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/tasks/validate-infrastructure.md +0 -0
  176. /package/expansion-packs/{infrastructure-devops → bmad-infrastructure-devops}/templates/infrastructure-architecture-tmpl.md +0 -0
@@ -1,18 +1,94 @@
1
- const path = require("path");
2
- const chalk = require("chalk");
3
- const ora = require("ora");
4
- const inquirer = require("inquirer");
1
+ const path = require("node:path");
5
2
  const fileManager = require("./file-manager");
6
3
  const configLoader = require("./config-loader");
7
4
  const ideSetup = require("./ide-setup");
8
5
 
6
+ // Dynamic imports for ES modules
7
+ let chalk, ora, inquirer;
8
+
9
+ // Initialize ES modules
10
+ async function initializeModules() {
11
+ if (!chalk) {
12
+ chalk = (await import("chalk")).default;
13
+ ora = (await import("ora")).default;
14
+ inquirer = (await import("inquirer")).default;
15
+ }
16
+ }
17
+
9
18
  class Installer {
10
19
  async install(config) {
20
+ // Initialize ES modules
21
+ await initializeModules();
22
+
11
23
  const spinner = ora("Analyzing installation directory...").start();
12
24
 
13
25
  try {
14
26
  // Resolve installation directory
15
- const installDir = path.resolve(config.directory);
27
+ let installDir = path.resolve(config.directory);
28
+ if (path.basename(installDir) === '.bmad-core') {
29
+ // If user points directly to .bmad-core, treat its parent as the project root
30
+ installDir = path.dirname(installDir);
31
+ }
32
+
33
+ // Check if directory exists and handle non-existent directories
34
+ if (!(await fileManager.pathExists(installDir))) {
35
+ spinner.stop();
36
+ console.log(chalk.yellow(`\nThe directory ${chalk.bold(installDir)} does not exist.`));
37
+
38
+ const { action } = await inquirer.prompt([
39
+ {
40
+ type: 'list',
41
+ name: 'action',
42
+ message: 'What would you like to do?',
43
+ choices: [
44
+ {
45
+ name: 'Create the directory and continue',
46
+ value: 'create'
47
+ },
48
+ {
49
+ name: 'Choose a different directory',
50
+ value: 'change'
51
+ },
52
+ {
53
+ name: 'Cancel installation',
54
+ value: 'cancel'
55
+ }
56
+ ]
57
+ }
58
+ ]);
59
+
60
+ if (action === 'cancel') {
61
+ console.log(chalk.red('Installation cancelled.'));
62
+ process.exit(0);
63
+ } else if (action === 'change') {
64
+ const { newDirectory } = await inquirer.prompt([
65
+ {
66
+ type: 'input',
67
+ name: 'newDirectory',
68
+ message: 'Enter the new directory path:',
69
+ validate: (input) => {
70
+ if (!input.trim()) {
71
+ return 'Please enter a valid directory path';
72
+ }
73
+ return true;
74
+ }
75
+ }
76
+ ]);
77
+ config.directory = newDirectory;
78
+ return await this.install(config); // Recursive call with new directory
79
+ } else if (action === 'create') {
80
+ try {
81
+ await fileManager.ensureDirectory(installDir);
82
+ console.log(chalk.green(`✓ Created directory: ${installDir}`));
83
+ } catch (error) {
84
+ console.error(chalk.red(`Failed to create directory: ${error.message}`));
85
+ console.error(chalk.yellow('You may need to check permissions or use a different path.'));
86
+ process.exit(1);
87
+ }
88
+ }
89
+
90
+ spinner.start("Analyzing installation directory...");
91
+ }
16
92
 
17
93
  // Detect current state
18
94
  const state = await this.detectInstallationState(installDir);
@@ -53,6 +129,8 @@ class Installer {
53
129
  }
54
130
 
55
131
  async detectInstallationState(installDir) {
132
+ // Ensure modules are initialized
133
+ await initializeModules();
56
134
  const state = {
57
135
  type: "clean",
58
136
  hasV4Manifest: false,
@@ -75,7 +153,7 @@ class Installer {
75
153
  state.type = "v4_existing";
76
154
  state.hasV4Manifest = true;
77
155
  state.hasBmadCore = true;
78
- state.manifest = await fileManager.readManifest(bmadCorePath);
156
+ state.manifest = await fileManager.readManifest(installDir);
79
157
  return state;
80
158
  }
81
159
 
@@ -103,15 +181,17 @@ class Installer {
103
181
  });
104
182
 
105
183
  if (files.length > 0) {
106
- state.type = "unknown_existing";
184
+ // Directory has other files, but no BMAD installation.
185
+ // Treat as clean install but record that it isn't empty.
107
186
  state.hasOtherFiles = true;
108
- return state;
109
187
  }
110
188
 
111
189
  return state; // clean install
112
190
  }
113
191
 
114
192
  async performFreshInstall(config, installDir, spinner) {
193
+ // Ensure modules are initialized
194
+ await initializeModules();
115
195
  spinner.text = "Installing BMAD Method...";
116
196
 
117
197
  let files = [];
@@ -181,10 +261,17 @@ class Installer {
181
261
  }
182
262
  }
183
263
 
264
+ // Install expansion packs if requested
265
+ const expansionFiles = await this.installExpansionPacks(installDir, config.expansionPacks, spinner);
266
+ files.push(...expansionFiles);
267
+
184
268
  // Set up IDE integration if requested
185
- if (config.ide) {
186
- spinner.text = `Setting up ${config.ide} integration...`;
187
- await ideSetup.setup(config.ide, installDir, config.agent);
269
+ const ides = config.ides || (config.ide ? [config.ide] : []);
270
+ if (ides.length > 0) {
271
+ for (const ide of ides) {
272
+ spinner.text = `Setting up ${ide} integration...`;
273
+ await ideSetup.setup(ide, installDir, config.agent);
274
+ }
188
275
  }
189
276
 
190
277
  // Create manifest
@@ -196,6 +283,8 @@ class Installer {
196
283
  }
197
284
 
198
285
  async handleExistingV4Installation(config, installDir, state, spinner) {
286
+ // Ensure modules are initialized
287
+ await initializeModules();
199
288
  spinner.stop();
200
289
 
201
290
  console.log(chalk.yellow("\n🔍 Found existing BMAD v4 installation"));
@@ -222,7 +311,7 @@ class Installer {
222
311
 
223
312
  switch (action) {
224
313
  case "update":
225
- return await this.performUpdate(installDir, state.manifest, spinner);
314
+ return await this.performUpdate(config, installDir, state.manifest, spinner);
226
315
  case "reinstall":
227
316
  return await this.performReinstall(config, installDir, spinner);
228
317
  case "cancel":
@@ -232,6 +321,8 @@ class Installer {
232
321
  }
233
322
 
234
323
  async handleV3Installation(config, installDir, state, spinner) {
324
+ // Ensure modules are initialized
325
+ await initializeModules();
235
326
  spinner.stop();
236
327
 
237
328
  console.log(
@@ -253,11 +344,12 @@ class Installer {
253
344
  ]);
254
345
 
255
346
  switch (action) {
256
- case "upgrade":
347
+ case "upgrade": {
257
348
  console.log(chalk.cyan("\n📦 Starting v3 to v4 upgrade process..."));
258
349
  const V3ToV4Upgrader = require("../../upgraders/v3-to-v4-upgrader");
259
350
  const upgrader = new V3ToV4Upgrader();
260
351
  return await upgrader.upgrade({ projectPath: installDir });
352
+ }
261
353
  case "alongside":
262
354
  return await this.performFreshInstall(config, installDir, spinner);
263
355
  case "cancel":
@@ -267,6 +359,8 @@ class Installer {
267
359
  }
268
360
 
269
361
  async handleUnknownInstallation(config, installDir, state, spinner) {
362
+ // Ensure modules are initialized
363
+ await initializeModules();
270
364
  spinner.stop();
271
365
 
272
366
  console.log(chalk.yellow("\n⚠️ Directory contains existing files"));
@@ -295,7 +389,7 @@ class Installer {
295
389
  switch (action) {
296
390
  case "force":
297
391
  return await this.performFreshInstall(config, installDir, spinner);
298
- case "different":
392
+ case "different": {
299
393
  const { newDir } = await inquirer.prompt([
300
394
  {
301
395
  type: "input",
@@ -306,13 +400,14 @@ class Installer {
306
400
  ]);
307
401
  config.directory = newDir;
308
402
  return await this.install(config);
403
+ }
309
404
  case "cancel":
310
405
  console.log("Installation cancelled.");
311
406
  return;
312
407
  }
313
408
  }
314
409
 
315
- async performUpdate(installDir, manifest, spinner) {
410
+ async performUpdate(newConfig, installDir, manifest, spinner) {
316
411
  spinner.start("Checking for updates...");
317
412
 
318
413
  try {
@@ -326,7 +421,9 @@ class Installer {
326
421
  if (modifiedFiles.length > 0) {
327
422
  spinner.warn("Found modified files");
328
423
  console.log(chalk.yellow("\nThe following files have been modified:"));
329
- modifiedFiles.forEach((file) => console.log(` - ${file}`));
424
+ for (const file of modifiedFiles) {
425
+ console.log(` - ${file}`);
426
+ }
330
427
 
331
428
  const { action } = await inquirer.prompt([
332
429
  {
@@ -364,7 +461,7 @@ class Installer {
364
461
  installType: manifest.install_type,
365
462
  agent: manifest.agent,
366
463
  directory: installDir,
367
- ide: manifest.ide_setup,
464
+ ide: newConfig.ide || manifest.ide_setup, // Use new IDE choice if provided
368
465
  };
369
466
 
370
467
  await this.performFreshInstall(config, installDir, spinner);
@@ -389,13 +486,16 @@ class Installer {
389
486
  showSuccessMessage(config, installDir) {
390
487
  console.log(chalk.green("\n✓ BMAD Method installed successfully!\n"));
391
488
 
392
- if (config.ide) {
393
- const ideConfig = configLoader.getIdeConfiguration(config.ide);
394
- if (ideConfig && ideConfig.instructions) {
395
- console.log(
396
- chalk.bold("To use BMAD agents in " + ideConfig.name + ":")
397
- );
398
- console.log(ideConfig.instructions);
489
+ const ides = config.ides || (config.ide ? [config.ide] : []);
490
+ if (ides.length > 0) {
491
+ for (const ide of ides) {
492
+ const ideConfig = configLoader.getIdeConfiguration(ide);
493
+ if (ideConfig?.instructions) {
494
+ console.log(
495
+ chalk.bold(`To use BMAD agents in ${ideConfig.name}:`)
496
+ );
497
+ console.log(ideConfig.instructions);
498
+ }
399
499
  }
400
500
  } else {
401
501
  console.log(chalk.yellow("No IDE configuration was set up."));
@@ -405,6 +505,30 @@ class Installer {
405
505
  );
406
506
  }
407
507
 
508
+ // Information about installation components
509
+ console.log(chalk.bold("\n🎯 Installation Summary:"));
510
+ console.log(chalk.green("✓ .bmad-core framework installed with all agents and workflows"));
511
+
512
+ if (config.expansionPacks && config.expansionPacks.length > 0) {
513
+ const packNames = config.expansionPacks.join(", ");
514
+ console.log(chalk.green(`✓ Expansion packs installed: ${packNames}`));
515
+ }
516
+
517
+ if (ides.length > 0) {
518
+ const ideNames = ides.map(ide => {
519
+ const ideConfig = configLoader.getIdeConfiguration(ide);
520
+ return ideConfig?.name || ide;
521
+ }).join(", ");
522
+ console.log(chalk.green(`✓ IDE rules and configurations set up for: ${ideNames}`));
523
+ }
524
+
525
+ // Information about web bundles
526
+ console.log(chalk.bold("\n📦 Web Bundles Available:"));
527
+ console.log("Self-contained web bundles have been included in your installation:");
528
+ console.log(chalk.cyan(` ${installDir}/.bmad-core/web-bundles/`));
529
+ console.log("These bundles work independently without this installation and can be");
530
+ console.log("shared, moved, or used in other projects as standalone files.");
531
+
408
532
  if (config.installType === "single-agent") {
409
533
  console.log(
410
534
  chalk.dim(
@@ -418,7 +542,9 @@ class Installer {
418
542
  }
419
543
 
420
544
  // Legacy method for backward compatibility
421
- async update(options) {
545
+ async update() {
546
+ // Initialize ES modules
547
+ await initializeModules();
422
548
  console.log(chalk.yellow('The "update" command is deprecated.'));
423
549
  console.log(
424
550
  'Please use "install" instead - it will detect and offer to update existing installations.'
@@ -432,26 +558,56 @@ class Installer {
432
558
  ide: null,
433
559
  };
434
560
  return await this.install(config);
435
- } else {
436
- console.log(chalk.red("No BMAD installation found."));
437
561
  }
562
+ console.log(chalk.red("No BMAD installation found."));
438
563
  }
439
564
 
440
565
  async listAgents() {
566
+ // Initialize ES modules
567
+ await initializeModules();
441
568
  const agents = await configLoader.getAvailableAgents();
442
569
 
443
570
  console.log(chalk.bold("\nAvailable BMAD Agents:\n"));
444
571
 
445
- agents.forEach((agent) => {
572
+ for (const agent of agents) {
446
573
  console.log(chalk.cyan(` ${agent.id.padEnd(20)}`), agent.description);
447
- });
574
+ }
448
575
 
449
576
  console.log(
450
577
  chalk.dim("\nInstall with: npx bmad-method install --agent=<id>\n")
451
578
  );
452
579
  }
453
580
 
581
+ async listExpansionPacks() {
582
+ // Initialize ES modules
583
+ await initializeModules();
584
+ const expansionPacks = await this.getAvailableExpansionPacks();
585
+
586
+ console.log(chalk.bold("\nAvailable BMAD Expansion Packs:\n"));
587
+
588
+ if (expansionPacks.length === 0) {
589
+ console.log(chalk.yellow("No expansion packs found."));
590
+ return;
591
+ }
592
+
593
+ for (const pack of expansionPacks) {
594
+ console.log(chalk.cyan(` ${pack.id.padEnd(20)}`),
595
+ `${pack.name} v${pack.version}`);
596
+ console.log(chalk.dim(` ${' '.repeat(22)}${pack.description}`));
597
+ if (pack.author && pack.author !== 'Unknown') {
598
+ console.log(chalk.dim(` ${' '.repeat(22)}by ${pack.author}`));
599
+ }
600
+ console.log();
601
+ }
602
+
603
+ console.log(
604
+ chalk.dim("Install with: npx bmad-method install --full --expansion-packs <id>\n")
605
+ );
606
+ }
607
+
454
608
  async showStatus() {
609
+ // Initialize ES modules
610
+ await initializeModules();
455
611
  const installDir = await this.findInstallation();
456
612
 
457
613
  if (!installDir) {
@@ -504,6 +660,96 @@ class Installer {
504
660
  return configLoader.getAvailableAgents();
505
661
  }
506
662
 
663
+ async getAvailableExpansionPacks() {
664
+ return configLoader.getAvailableExpansionPacks();
665
+ }
666
+
667
+ async installExpansionPacks(installDir, selectedPacks, spinner) {
668
+ if (!selectedPacks || selectedPacks.length === 0) {
669
+ return [];
670
+ }
671
+
672
+ const installedFiles = [];
673
+ const glob = require('glob');
674
+
675
+ for (const packId of selectedPacks) {
676
+ spinner.text = `Installing expansion pack: ${packId}...`;
677
+
678
+ try {
679
+ const expansionPacks = await this.getAvailableExpansionPacks();
680
+ const pack = expansionPacks.find(p => p.id === packId);
681
+
682
+ if (!pack) {
683
+ console.warn(`Expansion pack ${packId} not found, skipping...`);
684
+ continue;
685
+ }
686
+
687
+ const expansionPackDir = path.dirname(pack.manifestPath);
688
+
689
+ // Define the folders to copy from expansion packs to .bmad-core
690
+ const foldersToSync = [
691
+ 'agents',
692
+ 'agent-teams',
693
+ 'templates',
694
+ 'tasks',
695
+ 'checklists',
696
+ 'workflows',
697
+ 'data',
698
+ 'utils',
699
+ 'schemas'
700
+ ];
701
+
702
+ // Copy each folder if it exists
703
+ for (const folder of foldersToSync) {
704
+ const sourceFolder = path.join(expansionPackDir, folder);
705
+
706
+ // Check if folder exists in expansion pack
707
+ if (await fileManager.pathExists(sourceFolder)) {
708
+ // Get all files in this folder
709
+ const files = glob.sync('**/*', {
710
+ cwd: sourceFolder,
711
+ nodir: true
712
+ });
713
+
714
+ // Copy each file to the destination
715
+ for (const file of files) {
716
+ const sourcePath = path.join(sourceFolder, file);
717
+ const destPath = path.join(installDir, '.bmad-core', folder, file);
718
+
719
+ if (await fileManager.copyFile(sourcePath, destPath)) {
720
+ installedFiles.push(path.join('.bmad-core', folder, file));
721
+ }
722
+ }
723
+ }
724
+ }
725
+
726
+ // Also copy web-bundles if they exist (to a different location)
727
+ const webBundlesSource = path.join(expansionPackDir, 'web-bundles');
728
+ if (await fileManager.pathExists(webBundlesSource)) {
729
+ const files = glob.sync('**/*', {
730
+ cwd: webBundlesSource,
731
+ nodir: true
732
+ });
733
+
734
+ for (const file of files) {
735
+ const sourcePath = path.join(webBundlesSource, file);
736
+ const destPath = path.join(installDir, '.bmad-core', 'web-bundles', 'expansion-packs', packId, file);
737
+
738
+ if (await fileManager.copyFile(sourcePath, destPath)) {
739
+ installedFiles.push(path.join('.bmad-core', 'web-bundles', 'expansion-packs', packId, file));
740
+ }
741
+ }
742
+ }
743
+
744
+ console.log(chalk.green(`✓ Installed expansion pack: ${pack.name}`));
745
+ } catch (error) {
746
+ console.error(chalk.red(`Failed to install expansion pack ${packId}: ${error.message}`));
747
+ }
748
+ }
749
+
750
+ return installedFiles;
751
+ }
752
+
507
753
  async findInstallation() {
508
754
  // Look for .bmad-core in current directory or parent directories
509
755
  let currentDir = process.cwd();