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

@@ -170,6 +170,77 @@ class KiloSetup extends BaseIdeSetup {
console.log(chalk.dim(`Removed ${removedCount} BMAD modes from .kilocodemodes`));
}
}
/**
* Install a custom agent launcher for Kilo
* @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 kilocodemodesPath = path.join(projectDir, this.configFile);
let existingContent = '';
// Read existing .kilocodemodes file
if (await this.pathExists(kilocodemodesPath)) {
existingContent = await this.readFile(kilocodemodesPath);
}
// 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: 'kilo',
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 .kilocodemodes file with customModes
finalContent = 'customModes:\n' + modeEntry;
}
// Write .kilocodemodes file
await this.writeFile(kilocodemodesPath, finalContent);
return {
ide: 'kilo',
path: this.configFile,
command: slug,
type: 'custom-agent-launcher',
};
}
}
module.exports = { KiloSetup };