From 2edadd11ae4535c5ae3e289c963ca28b6786d853 Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Sat, 22 Nov 2025 16:49:42 -0600 Subject: [PATCH] fix: add custom agent support to Antigravity IDE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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! --- tools/cli/installers/lib/ide/antigravity.js | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tools/cli/installers/lib/ide/antigravity.js b/tools/cli/installers/lib/ide/antigravity.js index 9f35d0f7..52d2e5ed 100644 --- a/tools/cli/installers/lib/ide/antigravity.js +++ b/tools/cli/installers/lib/ide/antigravity.js @@ -458,6 +458,53 @@ class AntigravitySetup extends BaseIdeSetup { 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. + +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 + + +--- + +⚠️ **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 };