mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
feat: complete custom agent support for ALL remaining IDEs
## Added installCustomAgentLauncher to remaining IDEs: ✅ Qwen (.qwen/commands/BMad/) - TOML format with proper description and prompt fields - Uses existing processAgentLauncherContent method - Format: custom-{agent-name}.toml ✅ Trae (.trae/rules/) - Markdown format with bmad-agent-custom- prefix - Follows existing BMAD naming pattern - Format: bmad-agent-custom-{agent-name}.md ✅ Roo (.roomodes) - YAML format appends to existing customModes section - Creates customModes section if missing - Format: bmad-custom-{agent-name} (slug-based) ✅ Kilo (.kilocodemodes) - YAML format identical to Roo pattern - Handles existing customModes gracefully - Format: bmad-custom-{agent-name} (slug-based) ✅ Auggie (.augment/commands/bmad/) - Frontmatter + Markdown format - Follows existing Auggie command pattern - Format: custom-{agent-name}.md ## Complete IDE Coverage: ALL IDEs now support custom agent installation: - 16 total IDEs with custom agent support - Various formats: TOML, YAML, Markdown, file-based - All include @agentPath references and usage instructions - Proper IDE-specific naming and directory structures Custom agents from .bmad/custom/src/agents/ now install to EVERY configured IDE!
This commit is contained in:
@@ -248,6 +248,77 @@ class RooSetup extends BaseIdeSetup {
|
||||
console.log(chalk.dim(`Removed ${removedCount} BMAD modes from .roomodes`));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Install a custom agent launcher for Roo
|
||||
* @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 roomodesPath = path.join(projectDir, this.configFile);
|
||||
let existingContent = '';
|
||||
|
||||
// Read existing .roomodes file
|
||||
if (await this.pathExists(roomodesPath)) {
|
||||
existingContent = await this.readFile(roomodesPath);
|
||||
}
|
||||
|
||||
// Create custom agent mode entry
|
||||
const slug = `bmad-custom-${agentName.toLowerCase()}`;
|
||||
const modeEntry = ` - slug: ${slug}
|
||||
name: 'BMAD Custom: ${agentName}'
|
||||
description: |
|
||||
Custom BMAD agent: ${agentName}
|
||||
|
||||
**⚠️ IMPORTANT**: Run @${agentPath} first to load the complete agent!
|
||||
|
||||
This is a launcher for the custom BMAD agent "${agentName}". The agent will follow the persona and instructions from the main agent file.
|
||||
prompt: |
|
||||
@${agentPath}
|
||||
always: false
|
||||
permissions: all
|
||||
`;
|
||||
|
||||
// Check if mode already exists
|
||||
if (existingContent.includes(slug)) {
|
||||
return {
|
||||
ide: 'roo',
|
||||
path: this.configFile,
|
||||
command: agentName,
|
||||
type: 'custom-agent-launcher',
|
||||
alreadyExists: true,
|
||||
};
|
||||
}
|
||||
|
||||
// Build final content
|
||||
let finalContent = '';
|
||||
if (existingContent) {
|
||||
// Find customModes section or add it
|
||||
if (existingContent.includes('customModes:')) {
|
||||
// Append to existing customModes
|
||||
finalContent = existingContent + modeEntry;
|
||||
} else {
|
||||
// Add customModes section
|
||||
finalContent = existingContent.trim() + '\n\ncustomModes:\n' + modeEntry;
|
||||
}
|
||||
} else {
|
||||
// Create new .roomodes file with customModes
|
||||
finalContent = 'customModes:\n' + modeEntry;
|
||||
}
|
||||
|
||||
// Write .roomodes file
|
||||
await this.writeFile(roomodesPath, finalContent);
|
||||
|
||||
return {
|
||||
ide: 'roo',
|
||||
path: this.configFile,
|
||||
command: slug,
|
||||
type: 'custom-agent-launcher',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { RooSetup };
|
||||
|
||||
Reference in New Issue
Block a user