Skip to content

Conversation

@Parveen-Birthaliya
Copy link

Summary

Add native support for Google Antigravity workflows, enabling CodeGuard security rules to be triggered on-demand in the Antigravity IDE using /codeguard-* commands.

  • Followed Same structure as other IDEs
  • Maintain consistency with existing IDE integrations

Architecture

Following the established BaseFormat pattern used by Cursor, Windsurf, and other IDE integrations:

class AntigravityFormat(BaseFormat):
    - Output directory: `.agent/rules/`
    - File extension: `.md`
    - Frontmatter: description + tags (minimal, per Antigravity spec)

Files to Create

  1. src/formats/antigravity.py - AntigravityFormat class

Files to Modify

  1. src/formats/__init__.py - Register AntigravityFormat
  2. src/convert_to_ide_formats.py - Add to conversion pipeline
  3. README.md - Update supported IDEs list
  4. docs/getting-started.md - Updated supported IDEs list ,Add documentation link

Test

  • Unit tests for AntigravityFormat class
  • Integration tests for rule conversion
  • Manual validation in Antigravity IDE

Below is the Secreen shot from atigravity IDE that shows proper working of rules :

image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Google Antigravity IDE integration by implementing a new format converter that generates .md rule files compatible with Antigravity's workflow system.

Key changes:

  • New AntigravityFormat class following the established BaseFormat pattern used by other IDE integrations
  • Integration into the conversion pipeline alongside Cursor, Windsurf, Copilot, and Claude Code formats
  • Documentation updates in README and getting-started guide to include Antigravity in the list of supported IDEs

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/formats/antigravity.py New format implementation for Antigravity IDE that generates .md files with YAML frontmatter containing description and optional tags
src/formats/init.py Registers AntigravityFormat in the formats package exports
src/convert_to_ide_formats.py Adds AntigravityFormat to the list of formats generated during rule conversion
docs/getting-started.md Adds Antigravity to the prerequisites section and installation instructions with documentation link
README.md Updates the list of supported IDE formats to include Antigravity

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 21 to 22
Workflows are stored in .agent/workflows/ and can be triggered
on-demand with /workflow-name in the Antigravity interface.
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comments refer to "workflows" but the code uses "rules". According to the get_output_subpath() method (line 35), files are stored in .agent/rules/, not .agent/workflows/. The comment should be updated to say "Rules are stored in .agent/rules/ and can be triggered on-demand with /rule-name in the Antigravity interface" or similar.

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +65
# Optional: Add tags for categorization (if Antigravity supports it)
if rule.tags:
yaml_lines.append("tags:")
for tag in rule.tags:
yaml_lines.append(f"- {tag}")

Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "tags for categorization (if Antigravity supports it)" which suggests uncertainty about the feature support. Either verify that Antigravity supports tags and remove the conditional comment, or remove the tags implementation if support is unverified. Compare with other format implementations like ClaudeCodeFormat which don't include tags.

Suggested change
# Optional: Add tags for categorization (if Antigravity supports it)
if rule.tags:
yaml_lines.append("tags:")
for tag in rule.tags:
yaml_lines.append(f"- {tag}")
# (No tags: Antigravity does not support tags in frontmatter)

Copilot uses AI. Check for mistakes.

1. **Security rules** are written in unified markdown format (`sources/` directory)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code,antigravity)
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma in the list. The list should be "Cursor, Windsurf, Copilot, Claude Code, Antigravity" with a space after the comma before "antigravity". Additionally, "antigravity" should be capitalized to match the naming of other IDEs in the list.

Suggested change
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code,antigravity)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code, Antigravity)

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +64
yaml_lines = []

# Add description (required by Antigravity spec)
desc = self._format_yaml_field("description", rule.description)
if desc:
yaml_lines.append(desc)

# Optional: Add tags for categorization (if Antigravity supports it)
if rule.tags:
yaml_lines.append("tags:")
for tag in rule.tags:
yaml_lines.append(f"- {tag}")
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing version field in the YAML frontmatter. All other IDE format implementations (CursorFormat, WindsurfFormat, CopilotFormat, ClaudeCodeFormat) include a version field using self.version. Consider adding yaml_lines.append(f"version: {self.version}") for consistency, unless Antigravity specifically doesn't support version metadata.

Copilot uses AI. Check for mistakes.
Antigravity uses .md files with YAML frontmatter containing:
- description: Rule description (required by Antigravity spec)
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete frontmatter documentation. The docstring lists only description in the frontmatter (lines 18-20), but the implementation also includes tags (lines 60-64). Update the docstring to document all fields that may be included in the YAML frontmatter.

Suggested change
- tags: Optional list of tags for categorization (if present)

Copilot uses AI. Check for mistakes.

1. **Security rules** are written in unified markdown format (`sources/` directory)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code,antigravity)
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization: the code uses "antigravity" (lowercase) in README.md but "AntiGravity" in docs/getting-started.md. This should be standardized across all documentation. Use consistent casing (either "Antigravity" or "AntiGravity") throughout.

Suggested change
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code,antigravity)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code, AntiGravity)

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 10, 2025 03:22
This is true. We should be talking about `rule `files not `workflow` files here...

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +22
Rules are stored in .agent/rules/ and can be triggered
on-demand with /rule-name in the Antigravity interface.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation inconsistency: The comments mention "Workflows are stored in .agent/workflows/" but the actual implementation uses .agent/rules (line 35). These comments should be updated to match the implementation and use "rules" instead of "workflows".

Copilot uses AI. Check for mistakes.

class AntigravityFormat(BaseFormat):
"""
Google Antigravity format implementation (.md rule files).
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation inconsistency: The comment refers to "workflow files" but this implementation generates rule files stored in .agent/rules. The description should say "rule files" to match the actual implementation.

Copilot uses AI. Check for mistakes.

1. **Security rules** are written in unified markdown format (`sources/` directory)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code,antigravity)
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after comma. The list should be formatted as: (Cursor, Windsurf, Copilot, Claude Code, antigravity) with a space after "Claude Code,".

Suggested change
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code,antigravity)
2. **Conversion tools** translate rules to IDE-specific formats (Cursor, Windsurf, Copilot, Claude Code, antigravity)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@thomas-bartlett thomas-bartlett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding Antigravity support! The implementation looks good but needs a few fixes:

Main Issue - Missing Frontmatter: The antigravity.py implementation doesn't generate the required trigger and globs fields needed for proper activation. Currently it only outputs description and tags (tags aren't needed: they're just for CLI filtering, not rule output).

What's needed: Like Windsurf's implementation, it should generate:

  • trigger: always_on (for rules with always_apply: true)
  • trigger: glob + globs: [patterns] (for language-specific rules)
  • version field (for consistency)

Also: The PR description mentions /codeguard-* commands, but those are for Workflows, not Rules. Rules use activation types instead: Always On and Glob are the important ones for CodeGuard.

Quick Fixes:

  • Update generate() method to add trigger, globs, and version fields (see windsurf.py for reference)
  • Remove tags from output (not needed in rule files)
  • Update comments to explain Rules activation (not slash commands)
  • Fix doc link to https://antigravity.google/docs/rules-workflows
  • Standardize: "Antigravity" + add space: "Claude Code, Antigravity)"

Happy to help if you have questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants