mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
feat: add custom agent support to more IDEs
## Added installCustomAgentLauncher function to: ✅ Cline (.clinerules/workflows/) - Creates workflow files with custom agent launchers - Format: bmad-custom-{agent-name}.md ✅ Crush (.crush/commands/bmad/) - Creates command files with custom agent launchers - Format: custom-{agent-name}.md ✅ Gemini (.gemini/commands/) - Creates TOML command files with custom agent launchers - Format: bmad-custom-{agent-name}.toml ✅ iFlow (.iflow/commands/bmad/) - Creates command files with custom agent launchers - Format: custom-{agent-name}.md ## All Custom Agent Launchers Include: - @agentPath reference to load complete agent - Usage instructions for loading first, then activating - Proper IDE-specific formatting and file structure - Return values for tracking installations Now custom agents install to 8+ IDEs instead of just 4!
This commit is contained in:
@@ -201,6 +201,53 @@ ${contentWithoutFrontmatter}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a custom agent launcher for Gemini
|
||||
* @param {string} projectDir - Project directory
|
||||
* @param {string} agentName - Agent name (e.g., "fred-commit-poet")
|
||||
* @param {string} agentPath - Path to compiled agent (relative to project root)
|
||||
* @param {Object} metadata - Agent metadata
|
||||
* @returns {Object} Installation result
|
||||
*/
|
||||
async installCustomAgentLauncher(projectDir, agentName, agentPath, metadata) {
|
||||
const geminiDir = path.join(projectDir, this.configDir);
|
||||
const commandsDir = path.join(geminiDir, this.commandsDir);
|
||||
|
||||
// Create .gemini/commands directory if it doesn't exist
|
||||
await fs.ensureDir(commandsDir);
|
||||
|
||||
// Create custom agent launcher in TOML format
|
||||
const launcherContent = `description = "Custom BMAD Agent: ${agentName}"
|
||||
prompt = """
|
||||
**⚠️ IMPORTANT**: Run @${agentPath} first to load the complete agent!
|
||||
|
||||
This is a launcher for the custom BMAD agent "${agentName}".
|
||||
|
||||
## Usage
|
||||
1. First run: \`${agentPath}\` to load the complete agent
|
||||
2. Then use this command to activate ${agentName}
|
||||
|
||||
The agent will follow the persona and instructions from the main agent file.
|
||||
|
||||
---
|
||||
|
||||
*Generated by BMAD Method*
|
||||
"""`;
|
||||
|
||||
const fileName = `bmad-custom-${agentName.toLowerCase()}.toml`;
|
||||
const launcherPath = path.join(commandsDir, fileName);
|
||||
|
||||
// Write the launcher file
|
||||
await fs.writeFile(launcherPath, launcherContent, 'utf8');
|
||||
|
||||
return {
|
||||
ide: 'gemini',
|
||||
path: path.relative(projectDir, launcherPath),
|
||||
command: agentName,
|
||||
type: 'custom-agent-launcher',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { GeminiSetup };
|
||||
|
||||
Reference in New Issue
Block a user