fix: add custom agent support to Antigravity IDE

## Problem
Custom agents were only installing to Claude Code (.claude/commands/)
but not to Antigravity (.agent/) or other IDEs that lack installCustomAgentLauncher function.

## Root Cause
Antigravity was missing the installCustomAgentLauncher function that the
IdeManager calls to install custom agents during agent installation.

## Solution
Added installCustomAgentLauncher function to Antigravity that:
- Creates .agent directory if needed
- Generates custom agent launchers with @agentPath references
- Uses same pattern as existing Antigravity agent launchers
- Returns proper installation result for tracking

## Result
Custom agents now install to:
- Claude Code: .claude/commands/bmad/custom/agents/ 
- Antigravity: .agent/bmad-custom-agents-{agentName}.md 
- Codex: (already working) 

All configured IDEs now receive custom agent installations!
This commit is contained in:
Brian Madison 2025-11-22 16:49:42 -06:00
parent 0aeaa5b2ea
commit 2edadd11ae
1 changed files with 47 additions and 0 deletions

View File

@ -458,6 +458,53 @@ class AntigravitySetup extends BaseIdeSetup {
console.log(chalk.dim(` Total subagents installed: ${copiedCount}`)); console.log(chalk.dim(` Total subagents installed: ${copiedCount}`));
} }
} }
/**
* Install a custom agent launcher for Antigravity
* @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 agentDir = path.join(projectDir, this.configDir);
// Create .agent directory if it doesn't exist
await fs.ensureDir(agentDir);
// Create custom agent launcher with same pattern as regular agents
const launcherContent = `name: '${agentName}'
description: '${agentName} agent'
usage: |
Custom BMAD agent: ${agentName}
Launch with: /${agentName}
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from @${agentPath}
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
3. EXECUTE as ${agentName} with full persona adoption
</agent-activation>
---
**IMPORTANT**: Run @${agentPath} to load the complete agent before using this launcher!`;
const fileName = `bmad-custom-agents-${agentName}.md`;
const launcherPath = path.join(agentDir, fileName);
// Write the launcher file
await fs.writeFile(launcherPath, launcherContent, 'utf8');
return {
ide: 'antigravity',
path: path.relative(projectDir, launcherPath),
command: `/${agentName}`,
type: 'custom-agent-launcher',
};
}
} }
module.exports = { AntigravitySetup }; module.exports = { AntigravitySetup };