Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 57
Feature Request: Add Google Antigravity Support to Project CodeGuard - #71#74
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
45c47ef624ffb3d9b69562897df05d53cdd95c24cb0d6c1d5b901eccd9d3e82File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -30,6 +30,7 @@ | ||
| from formats.windsurf import WindsurfFormat | ||
| from formats.copilot import CopilotFormat | ||
| from formats.claudecode import ClaudeCodeFormat | ||
| from formats.antigravity import AntigravityFormat | ||
Parveen-Birthaliya marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| __all__ = [ | ||
| "BaseFormat", | ||
| @@ -38,4 +39,5 @@ | ||
| "WindsurfFormat", | ||
| "CopilotFormat", | ||
| "ClaudeCodeFormat", | ||
| "AntigravityFormat", | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Copyright 2025 Cisco Systems, Inc. and its affiliates | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """ | ||
| Antigravity Format Implementation | ||
| Generates .md rule files for Antigravity with YAML frontmatter. | ||
| """ | ||
| from formats.base import BaseFormat, ProcessedRule | ||
| class AntigravityFormat(BaseFormat): | ||
| """ | ||
| Antigravity format implementation (.md rule files). | ||
| Antigravity uses .md files with YAML frontmatter containing: | ||
| - trigger: 'always_on' or 'glob' (activation type) | ||
| - globs: (if trigger is 'glob') File matching patterns | ||
| - description: Rule description | ||
| - version: Rule version | ||
thomas-bartlett marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Rules use activation types (Always On or Glob) to determine when | ||
| they apply, similar to Windsurf's implementation. | ||
| See: https://antigravity.google/docs/rules-workflows | ||
Parveen-Birthaliya marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| """ | ||
| 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 | ||
| Returns: | ||
| Formatted .md content with trigger, globs, description, and version | ||
| Note: | ||
| Antigravity rules use activation types: | ||
| - 'always_on': Rule applies to all files (when alwaysApply is true) | ||
| - 'glob': Rule applies to files matching glob patterns (language-specific) | ||
| """ | ||
| yaml_lines = [] | ||
| # Use trigger: always_on for rules that should always apply | ||
| if rule.always_apply: | ||
| yaml_lines.append("trigger: always_on") | ||
| else: | ||
| yaml_lines.append("trigger: glob") | ||
| yaml_lines.append(f"globs: {globs}") | ||
| # Add description (required by Antigravity spec) | ||
| desc = self._format_yaml_field("description", rule.description) | ||
| if desc: | ||
| yaml_lines.append(desc) | ||
| # Add version | ||
| yaml_lines.append(f"version: {self.version}") | ||
| return self._build_yaml_frontmatter(yaml_lines, rule.content) | ||
Parveen-Birthaliya marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.