Compare commits

..

4 Commits

Author SHA1 Message Date
semantic-release-bot
f32a5fe08a chore(release): 4.28.0 [skip ci]
# [4.28.0](https://github.com/bmadcode/BMAD-METHOD/compare/v4.27.6...v4.28.0) (2025-07-12)

### Features

* bmad-master can load kb properly ([3c13c56](3c13c56498))
2025-07-12 15:27:50 +00:00
Brian Madison
3c13c56498 feat: bmad-master can load kb properly 2025-07-12 10:27:21 -05:00
Gabriel Lemire
97f01f6931 refactor: nest Claude Code commands under BMad subdirectory (#307)
- Update installer config to use .claude/commands/BMad/ path
- Modify setupClaudeCode function to create nested directory structure
- Update documentation and upgrader to reflect new command location
- Improves organization by grouping all BMad commands together
2025-07-12 10:02:46 -05:00
Davor Racic
c42002f1ea refactor(gemini-cli): change agent storage from multiple files to single (#308)
* refactor(gemini-cli): change agent storage from multiple files to single concatenated file

- Update configuration to use .gemini/bmad-method/ directory instead of .gemini/agents/
- Implement new logic to concatenate all agent files into single GEMINI.md
- Add backward compatibility for existing settings.json
- Remove old agents directory and update related documentation
- Ensure all agent settings are properly loaded

* fix(ide-setup): change agent trigger symbol from @ to *

The change was made to standardize the agent trigger symbol across the system and avoid confusion with other special characters.

* docs: update gemini cli syntax and file structure

- Change agent mention syntax from @ to * in docs and config
- Update file structure documentation from .gemini/agents/ to .gemini/bmad-method/
- Add gemini cli syntax to workflow guide

* fix(ide-setup): remove redundant contextFileNames handling
2025-07-12 09:55:12 -05:00
11 changed files with 111 additions and 59 deletions

View File

@@ -1,3 +1,10 @@
# [4.28.0](https://github.com/bmadcode/BMAD-METHOD/compare/v4.27.6...v4.28.0) (2025-07-12)
### Features
* bmad-master can load kb properly ([3c13c56](https://github.com/bmadcode/BMAD-METHOD/commit/3c13c564988f9750e043939dd770aea4196a7e7a))
## [4.27.6](https://github.com/bmadcode/BMAD-METHOD/compare/v4.27.5...v4.27.6) (2025-07-08)

View File

@@ -9,7 +9,7 @@ activation-instructions:
- Greet the user with your name and role, and inform of the *help command.
- CRITICAL: Do NOT scan filesystem or load any resources during startup, ONLY when commanded
- CRITICAL: Do NOT run discovery tasks automatically
- CRITICAL: NEVER LOAD data/bmad-kb.md UNLESS USER TYPES *kb
- CRITICAL: NEVER LOAD {root}/data/bmad-kb.md UNLESS USER TYPES *kb
agent:
name: BMad Master
id: bmad-master
@@ -28,7 +28,7 @@ persona:
commands:
- help: Show these listed commands in a numbered list
- 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
- 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
- task {task}: Execute task, if not found or none specified, ONLY list available dependencies/tasks listed below
- create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below)
- execute-checklist {checklist}: Run task execute-checklist (no checklist = ONLY show available checklists listed under dependencies/checklist below)

View File

@@ -7,7 +7,7 @@ For the complete workflow, see the [BMad Workflow Guide](../bmad-workflow-guide.
When running `npx bmad-method install`, select **Claude Code** as your IDE. This creates:
- `.bmad-core/` folder with all agents
- `.claude/commands/` folder with agent command files (`.md`)
- `.claude/commands/BMad` folder with agent command files (`.md`)
## Using BMad Agents in Claude Code

View File

@@ -6,23 +6,22 @@ For the complete workflow, see the [BMad Workflow Guide](../bmad-workflow-guide.
When running `npx bmad-method install`, select **Gemini CLI** as your IDE. This creates:
- `.gemini/agents/` directory with all agent context files
- `.gemini/settings.json` configured to load all agents automatically
- `.gemini/bmad-method/` directory with all agent context in GEMINI.md file
## Using BMad Agents with Gemini CLI
Simply mention the agent in your prompt:
- "As @dev, implement the login feature"
- "Acting as @architect, review this system design"
- "@sm, create the next story for our project"
- "As \*dev, implement the login feature"
- "Acting as \*architect, review this system design"
- "\*sm, create the next story for our project"
The Gemini CLI automatically loads the appropriate agent context.
## Gemini CLI-Specific Features
- **Context files**: All agents loaded as context in `.gemini/agents/`
- **Automatic loading**: Settings.json ensures agents are always available
- **Context files**: All agents loaded as context in `.gemini/bmad-method/GEMINI.md`
- **Automatic loading**: GEMINI.md ensures agents are always available
- **Natural language**: No special syntax needed, just mention the agent
## Tips for Gemini CLI Users

View File

@@ -111,6 +111,7 @@ Follow the SM → Dev cycle for systematic story development:
- **Claude Code**: `/agent-name` (e.g., `/bmad-master`)
- **Cursor**: `@agent-name` (e.g., `@bmad-master`)
- **Gemini CLI**: `*agent-name` (e.g., `*bmad-master`)
- **Windsurf**: `@agent-name` (e.g., `@bmad-master`)
- **Trae**: `@agent-name` (e.g., `@bmad-master`)
- **Roo Code**: Select mode from mode selector (e.g., `bmad-bmad-master`)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bmad-method",
"version": "4.27.6",
"version": "4.28.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bmad-method",
"version": "4.27.6",
"version": "4.28.0",
"license": "MIT",
"dependencies": {
"@kayvan/markdown-tree-parser": "^1.5.0",

View File

@@ -1,6 +1,6 @@
{
"name": "bmad-method",
"version": "4.27.6",
"version": "4.28.0",
"description": "Breakthrough Method of Agile AI-driven Development",
"main": "tools/cli.js",
"bin": {

View File

@@ -21,7 +21,7 @@ ide-configurations:
# 3. The agent will adopt that persona for the conversation
claude-code:
name: Claude Code
rule-dir: .claude/commands/
rule-dir: .claude/commands/BMad/
format: multi-file
command-suffix: .md
instructions: |
@@ -68,13 +68,14 @@ ide-configurations:
# 4. Rules are stored in .clinerules/ directory in your project
gemini:
name: Gemini CLI
rule-dir: .gemini/agents/
format: context-files
rule-dir: .gemini/bmad-method/
format: single-file
command-suffix: .md
instructions: |
# To use BMad agents with the Gemini CLI:
# 1. The installer creates a .gemini/ directory in your project.
# 2. It also configures .gemini/settings.json to load all agent files.
# 3. Simply mention the agent in your prompt (e.g., "As @dev, ...").
# 1. The installer creates a .gemini/bmad-method/ directory in your project.
# 2. It concatenates all agent files into a single GEMINI.md file.
# 3. Simply mention the agent in your prompt (e.g., "As *dev, ...").
# 4. The Gemini CLI will automatically have the context for that agent.
github-copilot:
name: Github Copilot

View File

@@ -131,7 +131,7 @@ class IdeSetup {
}
async setupClaudeCode(installDir, selectedAgent) {
const commandsDir = path.join(installDir, ".claude", "commands");
const commandsDir = path.join(installDir, ".claude", "commands", "BMad");
const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir);
await fileManager.ensureDirectory(commandsDir);
@@ -512,12 +512,53 @@ class IdeSetup {
async setupGeminiCli(installDir, selectedAgent) {
await initializeModules();
const geminiDir = path.join(installDir, ".gemini");
const agentsContextDir = path.join(geminiDir, "agents");
await fileManager.ensureDirectory(agentsContextDir);
const bmadMethodDir = path.join(geminiDir, "bmad-method");
await fileManager.ensureDirectory(bmadMethodDir);
// Update logic for existing settings.json
const settingsPath = path.join(geminiDir, "settings.json");
if (await fileManager.pathExists(settingsPath)) {
try {
const settingsContent = await fileManager.readFile(settingsPath);
const settings = JSON.parse(settingsContent);
let updated = false;
// Handle contextFileName property
if (settings.contextFileName && Array.isArray(settings.contextFileName)) {
const originalLength = settings.contextFileName.length;
settings.contextFileName = settings.contextFileName.filter(
(fileName) => !fileName.startsWith("agents/")
);
if (settings.contextFileName.length !== originalLength) {
updated = true;
}
}
if (updated) {
await fileManager.writeFile(
settingsPath,
JSON.stringify(settings, null, 2)
);
console.log(chalk.green("✓ Updated .gemini/settings.json - removed agent file references"));
}
} catch (error) {
console.warn(
chalk.yellow("Could not update .gemini/settings.json"),
error
);
}
}
// Remove old agents directory
const agentsDir = path.join(geminiDir, "agents");
if (await fileManager.pathExists(agentsDir)) {
await fileManager.removeDirectory(agentsDir);
console.log(chalk.green("✓ Removed old .gemini/agents directory"));
}
// Get all available agents
const agents = await this.getAllAgentIds(installDir);
const agentContextFiles = [];
let concatenatedContent = "";
for (const agentId of agents) {
// Find the source agent file
@@ -525,43 +566,46 @@ class IdeSetup {
if (agentPath) {
const agentContent = await fileManager.readFile(agentPath);
const contextFilePath = path.join(agentsContextDir, `${agentId}.md`);
// Copy the agent content directly into its own context file
await fileManager.writeFile(contextFilePath, agentContent);
// Store the relative path for settings.json
const relativePath = path.relative(geminiDir, contextFilePath);
agentContextFiles.push(relativePath.replace(/\\/g, '/')); // Ensure forward slashes for consistency
console.log(chalk.green(`✓ Created context file for @${agentId}`));
// Create properly formatted agent rule content (similar to trae)
let agentRuleContent = `# ${agentId.toUpperCase()} Agent Rule\n\n`;
agentRuleContent += `This rule is triggered when the user types \`*${agentId}\` and activates the ${await this.getAgentTitle(
agentId,
installDir
)} agent persona.\n\n`;
agentRuleContent += "## Agent Activation\n\n";
agentRuleContent +=
"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";
agentRuleContent += "```yaml\n";
// Extract just the YAML content from the agent file
const yamlContent = extractYamlFromAgent(agentContent);
if (yamlContent) {
agentRuleContent += yamlContent;
}
else {
// If no YAML found, include the whole content minus the header
agentRuleContent += agentContent.replace(/^#.*$/m, "").trim();
}
agentRuleContent += "\n```\n\n";
agentRuleContent += "## File Reference\n\n";
const relativePath = path.relative(installDir, agentPath).replace(/\\/g, '/');
agentRuleContent += `The complete agent definition is available in [${relativePath}](${relativePath}).\n\n`;
agentRuleContent += "## Usage\n\n";
agentRuleContent += `When the user types \`*${agentId}\`, activate this ${await this.getAgentTitle(
agentId,
installDir
)} persona and follow all instructions defined in the YAML configuration above.\n`;
// Add to concatenated content with separator
concatenatedContent += agentRuleContent + "\n\n---\n\n";
console.log(chalk.green(`✓ Added context for @${agentId}`));
}
}
console.log(chalk.green(`\n✓ Created individual agent context files in ${agentsContextDir}`));
// Add GEMINI.md to the context files array
agentContextFiles.push("GEMINI.md");
// Create or update settings.json
const settingsPath = path.join(geminiDir, "settings.json");
let settings = {};
if (await fileManager.pathExists(settingsPath)) {
try {
const existingSettings = await fileManager.readFile(settingsPath);
settings = JSON.parse(existingSettings);
console.log(chalk.yellow("Found existing .gemini/settings.json. Merging settings..."));
} catch (e) {
console.error(chalk.red("Error parsing existing settings.json. It will be overwritten."), e);
settings = {};
}
}
// Set contextFileName to our new array of files
settings.contextFileName = agentContextFiles;
await fileManager.writeFile(settingsPath, JSON.stringify(settings, null, 2));
console.log(chalk.green(`✓ Configured .gemini/settings.json to load all agent context files.`));
// Write the concatenated content to GEMINI.md
const geminiMdPath = path.join(bmadMethodDir, "GEMINI.md");
await fileManager.writeFile(geminiMdPath, concatenatedContent);
console.log(chalk.green(`\n✓ Created GEMINI.md in ${bmadMethodDir}`));
return true;
}

View File

@@ -1,6 +1,6 @@
{
"name": "bmad-method",
"version": "4.27.6",
"version": "4.28.0",
"description": "BMad Method installer - AI-powered Agile development framework",
"main": "lib/installer.js",
"bin": {

View File

@@ -558,7 +558,7 @@ class V3ToV4Upgrader {
try {
const ideMessages = {
cursor: "Rules created in .cursor/rules/",
"claude-code": "Commands created in .claude/commands/",
"claude-code": "Commands created in .claude/commands/BMad/",
windsurf: "Rules created in .windsurf/rules/",
trae: "Rules created in.trae/rules/",
roo: "Custom modes created in .roomodes",