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:
Brian Madison
2025-11-22 17:10:53 -06:00
parent 98342f2174
commit efc2b6d0df
5 changed files with 292 additions and 0 deletions

View File

@@ -261,6 +261,52 @@ Part of the BMAD ${workflow.module.toUpperCase()} module.
}
}
}
/**
* Install a custom agent launcher for Trae
* @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 traeDir = path.join(projectDir, this.configDir);
const rulesDir = path.join(traeDir, this.rulesDir);
// Create .trae/rules directory if it doesn't exist
await fs.ensureDir(rulesDir);
// Create custom agent launcher
const launcherContent = `# ${agentName} Custom Agent
**⚠️ 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 rule to activate ${agentName}
The agent will follow the persona and instructions from the main agent file.
---
*Generated by BMAD Method*`;
const fileName = `bmad-agent-custom-${agentName.toLowerCase()}.md`;
const launcherPath = path.join(rulesDir, fileName);
// Write the launcher file
await fs.writeFile(launcherPath, launcherContent, 'utf8');
return {
ide: 'trae',
path: path.relative(projectDir, launcherPath),
command: agentName,
type: 'custom-agent-launcher',
};
}
}
module.exports = { TraeSetup };