-
Notifications
You must be signed in to change notification settings - Fork 954
Add Antigravity workflow support #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds Antigravity as a native AI tool, including a new slash-command configurator and registry registration. CLI init now generates three Antigravity workflow files at Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as OpenSpec CLI
participant Registry as SlashCommandRegistry
participant Configurator as AntigravityConfigurator
participant FS as FileSystem
User->>CLI: openspec init (select Antigravity)
CLI->>Registry: resolve configurators
Registry->>Configurator: instantiate/register antigravity
CLI->>Configurator: generate slash commands
Configurator->>FS: create `.agent/workflows/openspec-proposal.md` (description frontmatter + managed body)
FS-->>Configurator: created
Configurator->>FS: create `.agent/workflows/openspec-apply.md`
FS-->>Configurator: created
Configurator->>FS: create `.agent/workflows/openspec-archive.md`
FS-->>Configurator: created
Configurator-->>CLI: success
CLI-->>User: workflows created
sequenceDiagram
actor User
participant CLI as OpenSpec CLI
participant Registry as SlashCommandRegistry
participant Configurator as AntigravityConfigurator
participant FS as FileSystem
User->>CLI: openspec update
CLI->>Registry: list registered configurators
Registry->>Configurator: antigravity
Configurator->>FS: read existing `.agent/workflows/openspec-apply.md`
FS-->>Configurator: file content (includes description frontmatter + managed block)
Configurator->>Configurator: preserve frontmatter, refresh managed block
Configurator->>FS: write updated file (frontmatter + new managed body)
FS-->>Configurator: updated
Configurator-->>CLI: report updated files
CLI-->>User: update complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
CHANGELOG.md(1 hunks)README.md(1 hunks)openspec/changes/add-antigravity-support/proposal.md(1 hunks)openspec/changes/add-antigravity-support/specs/cli-init/spec.md(1 hunks)openspec/changes/add-antigravity-support/specs/cli-update/spec.md(1 hunks)openspec/changes/add-antigravity-support/tasks.md(1 hunks)src/core/config.ts(1 hunks)src/core/configurators/slash/antigravity.ts(1 hunks)src/core/configurators/slash/registry.ts(3 hunks)test/core/init.test.ts(2 hunks)test/core/update.test.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/core/config.ts (1)
src/core/init.ts (2)
formatToolNames(919-934)promptForAITools(559-630)
src/core/configurators/slash/registry.ts (1)
src/core/configurators/slash/antigravity.ts (1)
AntigravitySlashCommandConfigurator(16-28)
test/core/init.test.ts (1)
src/utils/file-system.ts (1)
fileExists(76-86)
🔇 Additional comments (16)
README.md (1)
105-105: LGTM! Documentation addition looks correct.The Antigravity entry follows the same format as other tools and correctly documents the commands and workflow path.
CHANGELOG.md (1)
3-8: LGTM! Clear and comprehensive changelog entry.The entry accurately describes the Antigravity integration, including both init and update behaviors, and provides helpful context by comparing to Windsurf.
src/core/config.ts (1)
33-33: LGTM! Configuration entry is properly structured.The Antigravity tool entry follows the established pattern with all required fields correctly populated.
test/core/init.test.ts (2)
216-258: LGTM! Comprehensive test coverage for Antigravity workflow generation.The test properly validates:
- All three workflow files are created in the correct location
- YAML frontmatter contains only the description field
- OpenSpec managed markers are present
- Workflow bodies contain expected content
- Critically, it verifies the absence of
auto_execution_mode, distinguishing Antigravity from Windsurf
901-911: LGTM! Extend mode detection test is properly implemented.The test correctly verifies that Antigravity is marked as already configured during extend mode, following the same pattern as other tools.
openspec/changes/add-antigravity-support/specs/cli-update/spec.md (1)
1-8: LGTM! Clear and comprehensive spec for update behavior.The spec properly documents:
- Refresh semantics for existing files only
- Preservation of description frontmatter (critical for not losing user customizations)
- Consistency with Windsurf behavior (no creation of missing files)
openspec/changes/add-antigravity-support/specs/cli-init/spec.md (1)
1-9: LGTM! Well-documented init behavior specification.The spec clearly defines:
- File creation locations and names
- Frontmatter structure (description-only YAML)
- Reuse of shared workflow templates
- Behavioral alignment with Windsurf
src/core/configurators/slash/registry.ts (1)
20-20: Antigravity configurator integration is complete and verified.The import statement, instantiation, and registration all follow the established pattern. Verification confirms
AntigravitySlashCommandConfiguratoris properly exported withtoolId = 'antigravity'.openspec/changes/add-antigravity-support/proposal.md (3)
4-7: LGTM - Clear and comprehensive change description.The "What Changes" section clearly outlines the scope: adding Antigravity as a selectable tool, generating three workflow files with appropriate frontmatter, and ensuring update behavior mirrors existing Windsurf functionality.
9-11: LGTM - Appropriate impact scope.The impact section correctly identifies the affected CLI specs and expected code areas (registries, templates, tests).
2-2: Based on my verification, I found that:
Antigravity is led by Varun Mohan, the former CEO of Windsurf, as part of Google's $2.4 billion talent acquisition of Windsurf employees, but the product is not "Windsurf-derived"—rather, Google built a new IDE with Windsurf team expertise.
The claim about discovering workflows from
.agent/workflows/*.mdlacks documentation support. All available sources describe Antigravity as having browser control capabilities and executing tasks autonomously across editor, terminal, and browser, but no sources mention discovering workflows from that specific path convention.Correct the Antigravity description and verify workflow discovery claim.
The proposal should clarify that Antigravity is a Google-built IDE (not Windsurf-derived, though it benefits from Windsurf team expertise). More importantly, verify whether Antigravity actually discovers workflows from
.agent/workflows/*.md—this detail appears unsupported by current documentation.openspec/changes/add-antigravity-support/tasks.md (1)
1-12: LGTM - Comprehensive and well-structured task breakdown.The task checklist effectively covers all aspects of Antigravity integration:
- CLI init and update flows
- Frontmatter and body management
- Template reuse and test coverage
All tasks appropriately marked complete for this PR.
src/core/configurators/slash/antigravity.ts (4)
4-14: LGTM - Well-defined constants with clear mappings.The FILE_PATHS and DESCRIPTIONS constants provide clear mappings for all three workflow stages. The file paths correctly target
.agent/workflows/with the expected naming convention, and the descriptions appropriately describe each stage's purpose.
16-18: LGTM - Proper class structure and properties.The class correctly extends SlashCommandConfigurator with appropriate toolId and availability settings. This follows the established pattern for other IDE configurators in the codebase.
20-22: LGTM - Type-safe path resolution.The getRelativePath method correctly delegates to the FILE_PATHS mapping. Since FILE_PATHS is typed as
Record<SlashCommandId, string>, TypeScript ensures all valid SlashCommandId values have corresponding paths.
24-27: LGTM - Correct YAML frontmatter generation.The getFrontmatter method properly generates YAML frontmatter with the description field. The format
---\ndescription: ${description}\n---is correct and matches the specification for description-only frontmatter.
| it('should refresh existing Antigravity workflows', async () => { | ||
| const agPath = path.join( | ||
| testDir, | ||
| '.agent/workflows/openspec-apply.md' | ||
| ); | ||
| await fs.mkdir(path.dirname(agPath), { recursive: true }); | ||
| const initialContent = `--- | ||
| description: Implement an approved OpenSpec change and keep tasks in sync. | ||
| --- | ||
| <!-- OPENSPEC:START --> | ||
| Old body | ||
| <!-- OPENSPEC:END -->`; | ||
| await fs.writeFile(agPath, initialContent); | ||
|
|
||
| const consoleSpy = vi.spyOn(console, 'log'); | ||
|
|
||
| await updateCommand.execute(testDir); | ||
|
|
||
| const updated = await fs.readFile(agPath, 'utf-8'); | ||
| expect(updated).toContain('Work through tasks sequentially'); | ||
| expect(updated).not.toContain('Old body'); | ||
| expect(updated).toContain('description: Implement an approved OpenSpec change and keep tasks in sync.'); | ||
| expect(updated).not.toContain('auto_execution_mode: 3'); | ||
|
|
||
| const [logMessage] = consoleSpy.mock.calls[0]; | ||
| expect(logMessage).toContain( | ||
| 'Updated slash commands: .agent/workflows/openspec-apply.md' | ||
| ); | ||
| consoleSpy.mockRestore(); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
LGTM! Comprehensive update test for Antigravity workflows.
The test properly validates:
- Workflow body is refreshed with latest content
- Description frontmatter is preserved (critical!)
- Old content is removed
auto_execution_modeis not added (distinguishing from Windsurf)- Console output confirms the update
Verify that there's a test ensuring missing Antigravity workflow files are NOT created during update (following the pattern from other tools):
🏁 Script executed:
#!/bin/bash
# Search for a test that verifies missing Antigravity files aren't created on update
rg -n -A10 "should not create missing.*Antigravity" test/core/update.test.tsLength of output: 0
🏁 Script executed:
#!/bin/bash
# Search for all Antigravity-related tests to understand what's covered
rg -n "Antigravity" test/core/update.test.ts | head -20Length of output: 71
🏁 Script executed:
#!/bin/bash
# Search for all "should not create missing" tests to see the pattern used
rg -n -B2 "should not create missing" test/core/update.test.tsLength of output: 1270
🏁 Script executed:
#!/bin/bash
# Search for all Windsurf tests to compare patterns (mentioned in original comment)
rg -n "Windsurf" test/core/update.test.ts | head -20Length of output: 370
🏁 Script executed:
#!/bin/bash
# Check if there are any other Antigravity tests after line 470
rg -n "Antigravity" test/core/update.test.tsLength of output: 71
🏁 Script executed:
#!/bin/bash
# Also search for tests after line 500 to confirm coverage
rg -n "should not create missing" test/core/update.test.ts | tail -5Length of output: 441
Add missing test for Antigravity file creation prevention.
The test at lines 470-500 is comprehensive and correct. However, verification confirms that a corresponding test is missing: should not create missing Antigravity workflows on update.
All other tools in the test file (Windsurf, Qwen, Codex, GitHub Copilot, Factory, Amazon Q Developer, Auggie, CodeBuddy, Crush, RooCode, CoStrict, Qoder) include both a refresh test and a "should not create missing" test. Antigravity should follow the same pattern.
🤖 Prompt for AI Agents
In test/core/update.test.ts around lines 470 to 500, add a new unit test named
"should not create missing Antigravity workflows on update" that mirrors the
pattern used for other tools: ensure the .agent/workflows/openspec-apply.md file
does not exist beforehand, run updateCommand.execute(testDir), assert the file
was not created (fs.exists or attempting to read should fail), and verify no
"Updated slash commands: .agent/workflows/openspec-apply.md" console log was
emitted; use the same setup/teardown and console spying conventions as the
existing Antigravity refresh test so behavior is consistent with other tools'
"should not create missing" tests.
Summary
Testing
Summary by CodeRabbit
New Features
Documentation
Tests