bmad-method 4.27.3 → 4.27.5

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.
@@ -224,6 +224,58 @@ async function promptInstallation() {
224
224
  answers.installType = selectedItems.includes('bmad-core') ? 'full' : 'expansion-only';
225
225
  answers.expansionPacks = selectedItems.filter(item => item !== 'bmad-core');
226
226
 
227
+ // Ask sharding questions if installing BMad core
228
+ if (selectedItems.includes('bmad-core')) {
229
+ console.log(chalk.cyan('\nšŸ“‹ Document Organization Settings'));
230
+ console.log(chalk.dim('Configure how your project documentation should be organized.\n'));
231
+
232
+ // Ask about PRD sharding
233
+ const { prdSharded } = await inquirer.prompt([
234
+ {
235
+ type: 'confirm',
236
+ name: 'prdSharded',
237
+ message: 'Will the PRD (Product Requirements Document) be sharded into multiple files?',
238
+ default: true
239
+ }
240
+ ]);
241
+ answers.prdSharded = prdSharded;
242
+
243
+ // Ask about architecture sharding
244
+ const { architectureSharded } = await inquirer.prompt([
245
+ {
246
+ type: 'confirm',
247
+ name: 'architectureSharded',
248
+ message: 'Will the architecture documentation be sharded into multiple files?',
249
+ default: true
250
+ }
251
+ ]);
252
+ answers.architectureSharded = architectureSharded;
253
+
254
+ // Show warning if architecture sharding is disabled
255
+ if (!architectureSharded) {
256
+ console.log(chalk.yellow.bold('\nāš ļø IMPORTANT: Architecture Sharding Disabled'));
257
+ console.log(chalk.yellow('With architecture sharding disabled, you should still create the files listed'));
258
+ console.log(chalk.yellow('in devLoadAlwaysFiles (like coding-standards.md, tech-stack.md, source-tree.md)'));
259
+ console.log(chalk.yellow('as these are used by the dev agent at runtime.'));
260
+ console.log(chalk.yellow('\nAlternatively, you can remove these files from the devLoadAlwaysFiles list'));
261
+ console.log(chalk.yellow('in your core-config.yaml after installation.'));
262
+
263
+ const { acknowledge } = await inquirer.prompt([
264
+ {
265
+ type: 'confirm',
266
+ name: 'acknowledge',
267
+ message: 'Do you acknowledge this requirement and want to proceed?',
268
+ default: false
269
+ }
270
+ ]);
271
+
272
+ if (!acknowledge) {
273
+ console.log(chalk.red('Installation cancelled.'));
274
+ process.exit(0);
275
+ }
276
+ }
277
+ }
278
+
227
279
  // Ask for IDE configuration
228
280
  const { ides } = await inquirer.prompt([
229
281
  {
@@ -246,6 +298,37 @@ async function promptInstallation() {
246
298
  // Use selected IDEs directly
247
299
  answers.ides = ides;
248
300
 
301
+ // Configure GitHub Copilot immediately if selected
302
+ if (ides.includes('github-copilot')) {
303
+ console.log(chalk.cyan('\nšŸ”§ GitHub Copilot Configuration'));
304
+ console.log(chalk.dim('BMad works best with specific VS Code settings for optimal agent experience.\n'));
305
+
306
+ const { configChoice } = await inquirer.prompt([
307
+ {
308
+ type: 'list',
309
+ name: 'configChoice',
310
+ message: chalk.yellow('How would you like to configure GitHub Copilot settings?'),
311
+ choices: [
312
+ {
313
+ name: 'Use recommended defaults (fastest setup)',
314
+ value: 'defaults'
315
+ },
316
+ {
317
+ name: 'Configure each setting manually (customize to your preferences)',
318
+ value: 'manual'
319
+ },
320
+ {
321
+ name: 'Skip settings configuration (I\'ll configure manually later)',
322
+ value: 'skip'
323
+ }
324
+ ],
325
+ default: 'defaults'
326
+ }
327
+ ]);
328
+
329
+ answers.githubCopilotConfig = { configChoice };
330
+ }
331
+
249
332
  // Ask for web bundles installation
250
333
  const { includeWebBundles } = await inquirer.prompt([
251
334
  {
@@ -271,6 +271,34 @@ class FileManager {
271
271
 
272
272
  return manifest;
273
273
  }
274
+
275
+ async modifyCoreConfig(installDir, config) {
276
+ const coreConfigPath = path.join(installDir, '.bmad-core', 'core-config.yaml');
277
+
278
+ try {
279
+ // Read the existing core-config.yaml
280
+ const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8');
281
+ const coreConfig = yaml.load(coreConfigContent);
282
+
283
+ // Modify sharding settings if provided
284
+ if (config.prdSharded !== undefined) {
285
+ coreConfig.prd.prdSharded = config.prdSharded;
286
+ }
287
+
288
+ if (config.architectureSharded !== undefined) {
289
+ coreConfig.architecture.architectureSharded = config.architectureSharded;
290
+ }
291
+
292
+ // Write back the modified config
293
+ await fs.writeFile(coreConfigPath, yaml.dump(coreConfig, { indent: 2 }));
294
+
295
+ return true;
296
+ } catch (error) {
297
+ await initializeModules();
298
+ console.error(chalk.red(`Failed to modify core-config.yaml:`), error.message);
299
+ return false;
300
+ }
301
+ }
274
302
  }
275
303
 
276
304
  module.exports = new FileManager();
@@ -41,7 +41,7 @@ class IdeSetup {
41
41
  }
42
42
  }
43
43
 
44
- async setup(ide, installDir, selectedAgent = null, spinner = null) {
44
+ async setup(ide, installDir, selectedAgent = null, spinner = null, preConfiguredSettings = null) {
45
45
  await initializeModules();
46
46
  const ideConfig = await configLoader.getIdeConfiguration(ide);
47
47
 
@@ -66,7 +66,7 @@ class IdeSetup {
66
66
  case "gemini":
67
67
  return this.setupGeminiCli(installDir, selectedAgent);
68
68
  case "github-copilot":
69
- return this.setupGitHubCopilot(installDir, selectedAgent, spinner);
69
+ return this.setupGitHubCopilot(installDir, selectedAgent, spinner, preConfiguredSettings);
70
70
  default:
71
71
  console.log(chalk.yellow(`\nIDE ${ide} not yet supported`));
72
72
  return false;
@@ -566,11 +566,11 @@ class IdeSetup {
566
566
  return true;
567
567
  }
568
568
 
569
- async setupGitHubCopilot(installDir, selectedAgent, spinner = null) {
569
+ async setupGitHubCopilot(installDir, selectedAgent, spinner = null, preConfiguredSettings = null) {
570
570
  await initializeModules();
571
571
 
572
572
  // Configure VS Code workspace settings first to avoid UI conflicts with loading spinners
573
- await this.configureVsCodeSettings(installDir, spinner);
573
+ await this.configureVsCodeSettings(installDir, spinner, preConfiguredSettings);
574
574
 
575
575
  const chatmodesDir = path.join(installDir, ".github", "chatmodes");
576
576
  const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir);
@@ -616,7 +616,7 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems
616
616
  return true;
617
617
  }
618
618
 
619
- async configureVsCodeSettings(installDir, spinner) {
619
+ async configureVsCodeSettings(installDir, spinner, preConfiguredSettings = null) {
620
620
  await initializeModules(); // Ensure inquirer is loaded
621
621
  const vscodeDir = path.join(installDir, ".vscode");
622
622
  const settingsPath = path.join(vscodeDir, "settings.json");
@@ -636,34 +636,42 @@ tools: ['changes', 'codebase', 'fetch', 'findTestFiles', 'githubRepo', 'problems
636
636
  }
637
637
  }
638
638
 
639
- // Clear any previous output and add spacing to avoid conflicts with loaders
640
- console.log('\n'.repeat(2));
641
- console.log(chalk.blue("šŸ”§ Github Copilot Agent Settings Configuration"));
642
- console.log(chalk.dim("BMad works best with specific VS Code settings for optimal agent experience."));
643
- console.log(''); // Add extra spacing
644
-
645
- const { configChoice } = await inquirer.prompt([
646
- {
647
- type: 'list',
648
- name: 'configChoice',
649
- message: 'How would you like to configure Github Copilot settings?',
650
- choices: [
651
- {
652
- name: 'Use recommended defaults (fastest setup)',
653
- value: 'defaults'
654
- },
655
- {
656
- name: 'Configure each setting manually (customize to your preferences)',
657
- value: 'manual'
658
- },
659
- {
660
- name: 'Skip settings configuration (I\'ll configure manually later)\n',
661
- value: 'skip'
662
- }
663
- ],
664
- default: 'defaults'
665
- }
666
- ]);
639
+ // Use pre-configured settings if provided, otherwise prompt
640
+ let configChoice;
641
+ if (preConfiguredSettings && preConfiguredSettings.configChoice) {
642
+ configChoice = preConfiguredSettings.configChoice;
643
+ console.log(chalk.dim(`Using pre-configured GitHub Copilot settings: ${configChoice}`));
644
+ } else {
645
+ // Clear any previous output and add spacing to avoid conflicts with loaders
646
+ console.log('\n'.repeat(2));
647
+ console.log(chalk.blue("šŸ”§ Github Copilot Agent Settings Configuration"));
648
+ console.log(chalk.dim("BMad works best with specific VS Code settings for optimal agent experience."));
649
+ console.log(''); // Add extra spacing
650
+
651
+ const response = await inquirer.prompt([
652
+ {
653
+ type: 'list',
654
+ name: 'configChoice',
655
+ message: chalk.yellow('How would you like to configure GitHub Copilot settings?'),
656
+ choices: [
657
+ {
658
+ name: 'Use recommended defaults (fastest setup)',
659
+ value: 'defaults'
660
+ },
661
+ {
662
+ name: 'Configure each setting manually (customize to your preferences)',
663
+ value: 'manual'
664
+ },
665
+ {
666
+ name: 'Skip settings configuration (I\'ll configure manually later)',
667
+ value: 'skip'
668
+ }
669
+ ],
670
+ default: 'defaults'
671
+ }
672
+ ]);
673
+ configChoice = response.configChoice;
674
+ }
667
675
 
668
676
  let bmadSettings = {};
669
677
 
@@ -373,10 +373,17 @@ class Installer {
373
373
  if (ides.length > 0) {
374
374
  for (const ide of ides) {
375
375
  spinner.text = `Setting up ${ide} integration...`;
376
- await ideSetup.setup(ide, installDir, config.agent, spinner);
376
+ const preConfiguredSettings = ide === 'github-copilot' ? config.githubCopilotConfig : null;
377
+ await ideSetup.setup(ide, installDir, config.agent, spinner, preConfiguredSettings);
377
378
  }
378
379
  }
379
380
 
381
+ // Modify core-config.yaml if sharding preferences were provided
382
+ if (config.installType !== "expansion-only" && (config.prdSharded !== undefined || config.architectureSharded !== undefined)) {
383
+ spinner.text = "Configuring document sharding settings...";
384
+ await fileManager.modifyCoreConfig(installDir, config);
385
+ }
386
+
380
387
  // Create manifest (skip for expansion-only installations)
381
388
  if (config.installType !== "expansion-only") {
382
389
  spinner.text = "Creating installation manifest...";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmad-method",
3
- "version": "4.27.3",
3
+ "version": "4.27.5",
4
4
  "description": "BMad Method installer - AI-powered Agile development framework",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {
@@ -1,26 +0,0 @@
1
- # Template Format Conventions
2
-
3
- Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation.
4
-
5
- ## Template Markup Elements
6
-
7
- - **{{placeholders}}**: Variables to be replaced with actual content
8
- - **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users)
9
- - **REPEAT** sections: Content blocks that may be repeated as needed
10
- - **^^CONDITION^^** blocks: Conditional content included only if criteria are met
11
- - **@{examples}**: Example content for guidance (never output to users)
12
-
13
- ## Processing Rules
14
-
15
- - Replace all {{placeholders}} with project-specific content
16
- - Execute all [[LLM: instructions]] internally without showing users
17
- - Process conditional and repeat blocks as specified
18
- - Use examples for guidance but never include them in final output
19
- - Present only clean, formatted content to users
20
-
21
- ## Critical Guidelines
22
-
23
- - **NEVER display template markup, LLM instructions, or examples to users**
24
- - Template elements are for AI processing only
25
- - Focus on faithful template execution and clean output
26
- - All template-specific instructions are embedded within templates