Skip to content
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Get started in minutes:
## How It Works

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)
3. **Release automation** packages rules into downloadable ZIP files
4. **AI assistants** reference these rules when generating or reviewing code
5. **Secure code** is produced automatically without developer intervention
Expand Down
8 changes: 8 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Before you begin, familiarize yourself with how rules work in your IDE:

:material-book-open-page-variant: [GitHub Copilot Instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions)

=== "Google AntiGravity"
Google AntiGravity uses `.agent/rules` for rule configuration.

:material-book-open-page-variant: [Google AntiGravity Instructions](https://codelabs.developers.google.com/getting-started-google-antigravity#6)

## Installation

### Option 1: Download Pre-built Rules (Recommended)
Expand Down Expand Up @@ -95,6 +100,7 @@ uv run python src/convert_to_ide_formats.py --source core owasp
cp -r dist/.cursor/ /path/to/your/project/
cp -r dist/.windsurf/ /path/to/your/project/
cp -r dist/.github/ /path/to/your/project/
cp -r dist/.agent/ /path/to/your/project/
```

## Verify Installation
Expand All @@ -103,6 +109,8 @@ After installation, your project structure should include:

```
your-project/
├── .agent/
│ └── rules/
├── .cursor/
│ └── rules/
├── .windsurf/
Expand Down
3 changes: 2 additions & 1 deletion src/convert_to_ide_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import defaultdict

from converter import RuleConverter
from formats import CursorFormat, WindsurfFormat, CopilotFormat, ClaudeCodeFormat
from formats import CursorFormat, WindsurfFormat, CopilotFormat, ClaudeCodeFormat, AntigravityFormat
from utils import get_version_from_pyproject
from validate_versions import set_plugin_version, set_marketplace_version

Expand Down Expand Up @@ -128,6 +128,7 @@ def convert_rules(input_path: str, output_dir: str = "dist", include_claudecode:
CursorFormat(version),
WindsurfFormat(version),
CopilotFormat(version),
AntigravityFormat(version),
]

# Only include Claude Code for core rules (committed plugin)
Expand Down
2 changes: 2 additions & 0 deletions src/formats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from formats.windsurf import WindsurfFormat
from formats.copilot import CopilotFormat
from formats.claudecode import ClaudeCodeFormat
from formats.antigravity import AntigravityFormat

__all__ = [
"BaseFormat",
Expand All @@ -38,4 +39,5 @@
"WindsurfFormat",
"CopilotFormat",
"ClaudeCodeFormat",
"AntigravityFormat",
]
66 changes: 66 additions & 0 deletions src/formats/antigravity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2025 Cisco Systems, Inc. and its affiliates
#
# SPDX-License-Identifier: Apache-2.0

"""
Antigravity Format Implementation
Generates .md rule files for Google Antigravity with YAML frontmatter.
"""

from formats.base import BaseFormat, ProcessedRule


class AntigravityFormat(BaseFormat):
"""
Google Antigravity format implementation (.md rule files).
Antigravity uses .md files with YAML frontmatter containing:
- description: Rule description (required by Antigravity spec)
Rules are stored in .agent/rules/ and can be triggered
on-demand with /rule-name in the Antigravity interface.
"""

def get_format_name(self) -> str:
"""Return Antigravity format identifier."""
return "antigravity"

def get_file_extension(self) -> str:
"""Return Antigravity format file extension."""
return ".md"

def get_output_subpath(self) -> str:
"""Return Antigravity output subdirectory."""
return ".agent/rules"

def generate(self, rule: ProcessedRule, globs: str) -> str:
"""
Generate Antigravity .md format with YAML frontmatter.
Args:
rule: The processed rule to format
globs: Glob patterns for file matching (not used by Antigravity)
Returns:
Formatted .md content with minimal frontmatter
Note:
Antigravity workflows use simple markdown with description-only
frontmatter. Language/glob information is not needed as workflows
are triggered manually by the user.
"""
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}")

return self._build_yaml_frontmatter(yaml_lines, rule.content)