feat: Add Google Antigravity IDE installer (#938)

Implements installer for Google Antigravity IDE with flattened slash command
naming to match Antigravity's namespace requirements.

Key features:
- Flattened file naming (bmad-module-agents-name.md) for proper slash commands
- Subagent installation support (project-level or user-level)
- Module-specific injection configuration
- Agent, workflow, task, and tool command generation

Implementation:
- Added AntigravitySetup class extending BaseIdeSetup
- Extracted flattenFilename() to BaseIdeSetup for reuse across IDE handlers
- Uses .agent/workflows directory structure
- Supports both interactive and non-interactive configuration

Fixes:
- Proper namespace isolation: /bmad-module-agents-dev instead of /dev
- Prevents conflicts between modules with same agent names

Note: This installer shares 95% of its code with claude-code.js.
Future refactoring could extract common patterns to IdeWithSlashCommandsSetup
base class (see design documents for details).
This commit is contained in:
Alex Verkhovsky
2025-11-18 18:09:06 -08:00
committed by GitHub
parent 073597a8ff
commit 7b7f984cd2
3 changed files with 475 additions and 5 deletions

View File

@@ -601,6 +601,18 @@ class BaseIdeSetup {
.join(' ');
}
/**
* Flatten a relative path to a single filename for flat slash command naming
* Example: 'module/agents/name.md' -> 'bmad-module-agents-name.md'
* Used by IDEs that ignore directory structure for slash commands (e.g., Antigravity, Codex)
* @param {string} relativePath - Relative path to flatten
* @returns {string} Flattened filename with 'bmad-' prefix
*/
flattenFilename(relativePath) {
const sanitized = relativePath.replaceAll(/[/\\]/g, '-');
return `bmad-${sanitized}`;
}
/**
* Create agent configuration file
* @param {string} bmadDir - BMAD installation directory