bmad-method 4.27.6 → 4.28.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [4.28.0](https://github.com/bmadcode/BMAD-METHOD/compare/v4.27.6...v4.28.0) (2025-07-12)
2
+
3
+
4
+ ### Features
5
+
6
+ * bmad-master can load kb properly ([3c13c56](https://github.com/bmadcode/BMAD-METHOD/commit/3c13c564988f9750e043939dd770aea4196a7e7a))
7
+
1
8
  ## [4.27.6](https://github.com/bmadcode/BMAD-METHOD/compare/v4.27.5...v4.27.6) (2025-07-08)
2
9
 
3
10
 
@@ -9,7 +9,7 @@ activation-instructions:
9
9
  - Greet the user with your name and role, and inform of the *help command.
10
10
  - CRITICAL: Do NOT scan filesystem or load any resources during startup, ONLY when commanded
11
11
  - CRITICAL: Do NOT run discovery tasks automatically
12
- - CRITICAL: NEVER LOAD data/bmad-kb.md UNLESS USER TYPES *kb
12
+ - CRITICAL: NEVER LOAD {root}/data/bmad-kb.md UNLESS USER TYPES *kb
13
13
  agent:
14
14
  name: BMad Master
15
15
  id: bmad-master
@@ -28,7 +28,7 @@ persona:
28
28
 
29
29
  commands:
30
30
  - help: Show these listed commands in a numbered list
31
- - kb: Toggle KB mode off (default) or on, when on will load and reference the data/bmad-kb.md and converse with the user answering his questions with this informational resource
31
+ - kb: Toggle KB mode off (default) or on, when on will load and reference the {root}/data/bmad-kb.md and converse with the user answering his questions with this informational resource
32
32
  - task {task}: Execute task, if not found or none specified, ONLY list available dependencies/tasks listed below
33
33
  - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below)
34
34
  - execute-checklist {checklist}: Run task execute-checklist (no checklist = ONLY show available checklists listed under dependencies/checklist below)
@@ -7,7 +7,7 @@ For the complete workflow, see the [BMad Workflow Guide](../bmad-workflow-guide.
7
7
  When running `npx bmad-method install`, select **Claude Code** as your IDE. This creates:
8
8
 
9
9
  - `.bmad-core/` folder with all agents
10
- - `.claude/commands/` folder with agent command files (`.md`)
10
+ - `.claude/commands/BMad` folder with agent command files (`.md`)
11
11
 
12
12
  ## Using BMad Agents in Claude Code
13
13
 
@@ -6,23 +6,22 @@ For the complete workflow, see the [BMad Workflow Guide](../bmad-workflow-guide.
6
6
 
7
7
  When running `npx bmad-method install`, select **Gemini CLI** as your IDE. This creates:
8
8
 
9
- - `.gemini/agents/` directory with all agent context files
10
- - `.gemini/settings.json` configured to load all agents automatically
9
+ - `.gemini/bmad-method/` directory with all agent context in GEMINI.md file
11
10
 
12
11
  ## Using BMad Agents with Gemini CLI
13
12
 
14
13
  Simply mention the agent in your prompt:
15
14
 
16
- - "As @dev, implement the login feature"
17
- - "Acting as @architect, review this system design"
18
- - "@sm, create the next story for our project"
15
+ - "As \*dev, implement the login feature"
16
+ - "Acting as \*architect, review this system design"
17
+ - "\*sm, create the next story for our project"
19
18
 
20
19
  The Gemini CLI automatically loads the appropriate agent context.
21
20
 
22
21
  ## Gemini CLI-Specific Features
23
22
 
24
- - **Context files**: All agents loaded as context in `.gemini/agents/`
25
- - **Automatic loading**: Settings.json ensures agents are always available
23
+ - **Context files**: All agents loaded as context in `.gemini/bmad-method/GEMINI.md`
24
+ - **Automatic loading**: GEMINI.md ensures agents are always available
26
25
  - **Natural language**: No special syntax needed, just mention the agent
27
26
 
28
27
  ## Tips for Gemini CLI Users
@@ -111,6 +111,7 @@ Follow the SM → Dev cycle for systematic story development:
111
111
 
112
112
  - **Claude Code**: `/agent-name` (e.g., `/bmad-master`)
113
113
  - **Cursor**: `@agent-name` (e.g., `@bmad-master`)
114
+ - **Gemini CLI**: `*agent-name` (e.g., `*bmad-master`)
114
115
  - **Windsurf**: `@agent-name` (e.g., `@bmad-master`)
115
116
  - **Trae**: `@agent-name` (e.g., `@bmad-master`)
116
117
  - **Roo Code**: Select mode from mode selector (e.g., `bmad-bmad-master`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmad-method",
3
- "version": "4.27.6",
3
+ "version": "4.28.0",
4
4
  "description": "Breakthrough Method of Agile AI-driven Development",
5
5
  "main": "tools/cli.js",
6
6
  "bin": {
@@ -21,7 +21,7 @@ ide-configurations:
21
21
  # 3. The agent will adopt that persona for the conversation
22
22
  claude-code:
23
23
  name: Claude Code
24
- rule-dir: .claude/commands/
24
+ rule-dir: .claude/commands/BMad/
25
25
  format: multi-file
26
26
  command-suffix: .md
27
27
  instructions: |
@@ -68,13 +68,14 @@ ide-configurations:
68
68
  # 4. Rules are stored in .clinerules/ directory in your project
69
69
  gemini:
70
70
  name: Gemini CLI
71
- rule-dir: .gemini/agents/
72
- format: context-files
71
+ rule-dir: .gemini/bmad-method/
72
+ format: single-file
73
+ command-suffix: .md
73
74
  instructions: |
74
75
  # To use BMad agents with the Gemini CLI:
75
- # 1. The installer creates a .gemini/ directory in your project.
76
- # 2. It also configures .gemini/settings.json to load all agent files.
77
- # 3. Simply mention the agent in your prompt (e.g., "As @dev, ...").
76
+ # 1. The installer creates a .gemini/bmad-method/ directory in your project.
77
+ # 2. It concatenates all agent files into a single GEMINI.md file.
78
+ # 3. Simply mention the agent in your prompt (e.g., "As *dev, ...").
78
79
  # 4. The Gemini CLI will automatically have the context for that agent.
79
80
  github-copilot:
80
81
  name: Github Copilot
@@ -131,7 +131,7 @@ class IdeSetup {
131
131
  }
132
132
 
133
133
  async setupClaudeCode(installDir, selectedAgent) {
134
- const commandsDir = path.join(installDir, ".claude", "commands");
134
+ const commandsDir = path.join(installDir, ".claude", "commands", "BMad");
135
135
  const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir);
136
136
 
137
137
  await fileManager.ensureDirectory(commandsDir);
@@ -512,12 +512,53 @@ class IdeSetup {
512
512
  async setupGeminiCli(installDir, selectedAgent) {
513
513
  await initializeModules();
514
514
  const geminiDir = path.join(installDir, ".gemini");
515
- const agentsContextDir = path.join(geminiDir, "agents");
516
- await fileManager.ensureDirectory(agentsContextDir);
515
+ const bmadMethodDir = path.join(geminiDir, "bmad-method");
516
+ await fileManager.ensureDirectory(bmadMethodDir);
517
+
518
+ // Update logic for existing settings.json
519
+ const settingsPath = path.join(geminiDir, "settings.json");
520
+ if (await fileManager.pathExists(settingsPath)) {
521
+ try {
522
+ const settingsContent = await fileManager.readFile(settingsPath);
523
+ const settings = JSON.parse(settingsContent);
524
+ let updated = false;
525
+
526
+ // Handle contextFileName property
527
+ if (settings.contextFileName && Array.isArray(settings.contextFileName)) {
528
+ const originalLength = settings.contextFileName.length;
529
+ settings.contextFileName = settings.contextFileName.filter(
530
+ (fileName) => !fileName.startsWith("agents/")
531
+ );
532
+ if (settings.contextFileName.length !== originalLength) {
533
+ updated = true;
534
+ }
535
+ }
536
+
537
+ if (updated) {
538
+ await fileManager.writeFile(
539
+ settingsPath,
540
+ JSON.stringify(settings, null, 2)
541
+ );
542
+ console.log(chalk.green("✓ Updated .gemini/settings.json - removed agent file references"));
543
+ }
544
+ } catch (error) {
545
+ console.warn(
546
+ chalk.yellow("Could not update .gemini/settings.json"),
547
+ error
548
+ );
549
+ }
550
+ }
551
+
552
+ // Remove old agents directory
553
+ const agentsDir = path.join(geminiDir, "agents");
554
+ if (await fileManager.pathExists(agentsDir)) {
555
+ await fileManager.removeDirectory(agentsDir);
556
+ console.log(chalk.green("✓ Removed old .gemini/agents directory"));
557
+ }
517
558
 
518
559
  // Get all available agents
519
560
  const agents = await this.getAllAgentIds(installDir);
520
- const agentContextFiles = [];
561
+ let concatenatedContent = "";
521
562
 
522
563
  for (const agentId of agents) {
523
564
  // Find the source agent file
@@ -525,43 +566,46 @@ class IdeSetup {
525
566
 
526
567
  if (agentPath) {
527
568
  const agentContent = await fileManager.readFile(agentPath);
528
- const contextFilePath = path.join(agentsContextDir, `${agentId}.md`);
529
-
530
- // Copy the agent content directly into its own context file
531
- await fileManager.writeFile(contextFilePath, agentContent);
532
-
533
- // Store the relative path for settings.json
534
- const relativePath = path.relative(geminiDir, contextFilePath);
535
- agentContextFiles.push(relativePath.replace(/\\/g, '/')); // Ensure forward slashes for consistency
536
- console.log(chalk.green(`✓ Created context file for @${agentId}`));
537
- }
538
- }
539
-
540
- console.log(chalk.green(`\n✓ Created individual agent context files in ${agentsContextDir}`));
541
-
542
- // Add GEMINI.md to the context files array
543
- agentContextFiles.push("GEMINI.md");
544
-
545
- // Create or update settings.json
546
- const settingsPath = path.join(geminiDir, "settings.json");
547
- let settings = {};
548
-
549
- if (await fileManager.pathExists(settingsPath)) {
550
- try {
551
- const existingSettings = await fileManager.readFile(settingsPath);
552
- settings = JSON.parse(existingSettings);
553
- console.log(chalk.yellow("Found existing .gemini/settings.json. Merging settings..."));
554
- } catch (e) {
555
- console.error(chalk.red("Error parsing existing settings.json. It will be overwritten."), e);
556
- settings = {};
569
+
570
+ // Create properly formatted agent rule content (similar to trae)
571
+ let agentRuleContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`;
572
+ agentRuleContent += `This rule is triggered when the user types \`*${agentId}\` and activates the ${await this.getAgentTitle(
573
+ agentId,
574
+ installDir
575
+ )} agent persona.\n\n`;
576
+ agentRuleContent += "## Agent Activation\n\n";
577
+ agentRuleContent +=
578
+ "CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n";
579
+ agentRuleContent += "```yaml\n";
580
+ // Extract just the YAML content from the agent file
581
+ const yamlContent = extractYamlFromAgent(agentContent);
582
+ if (yamlContent) {
583
+ agentRuleContent += yamlContent;
584
+ }
585
+ else {
586
+ // If no YAML found, include the whole content minus the header
587
+ agentRuleContent += agentContent.replace(/^#.*$/m, "").trim();
588
+ }
589
+ agentRuleContent += "\n```\n\n";
590
+ agentRuleContent += "## File Reference\n\n";
591
+ const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/');
592
+ agentRuleContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`;
593
+ agentRuleContent += "## Usage\n\n";
594
+ agentRuleContent += `When the user types \`*${agentId}\`, activate this ${await this.getAgentTitle(
595
+ agentId,
596
+ installDir
597
+ )} persona and follow all instructions defined in the YAML configuration above.\n`;
598
+
599
+ // Add to concatenated content with separator
600
+ concatenatedContent += agentRuleContent + "\n\n---\n\n";
601
+ console.log(chalk.green(`✓ Added context for @${agentId}`));
557
602
  }
558
603
  }
559
604
 
560
- // Set contextFileName to our new array of files
561
- settings.contextFileName = agentContextFiles;
562
-
563
- await fileManager.writeFile(settingsPath, JSON.stringify(settings, null, 2));
564
- console.log(chalk.green(`✓ Configured .gemini/settings.json to load all agent context files.`));
605
+ // Write the concatenated content to GEMINI.md
606
+ const geminiMdPath = path.join(bmadMethodDir, "GEMINI.md");
607
+ await fileManager.writeFile(geminiMdPath, concatenatedContent);
608
+ console.log(chalk.green(`\n✓ Created GEMINI.md in ${bmadMethodDir}`));
565
609
 
566
610
  return true;
567
611
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmad-method",
3
- "version": "4.27.6",
3
+ "version": "4.28.0",
4
4
  "description": "BMad Method installer - AI-powered Agile development framework",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {
@@ -558,7 +558,7 @@ class V3ToV4Upgrader {
558
558
  try {
559
559
  const ideMessages = {
560
560
  cursor: "Rules created in .cursor/rules/",
561
- "claude-code": "Commands created in .claude/commands/",
561
+ "claude-code": "Commands created in .claude/commands/BMad/",
562
562
  windsurf: "Rules created in .windsurf/rules/",
563
563
  trae: "Rules created in.trae/rules/",
564
564
  roo: "Custom modes created in .roomodes",