-
Notifications
You must be signed in to change notification settings - Fork 50
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
Merged
thomas-bartlett
merged 9 commits into
project-codeguard:main
from
Parveen-Birthaliya:antigravity-feature
Jan 6, 2026
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
45c47ef
add feature support of antigravity,with unit test and integration te…
Parveen-Birthaliya 624ffb3
Update src/formats/antigravity.py
santosomar d9b6956
Update src/formats/antigravity.py
santosomar 2897df0
Enhance Antigravity YAML frontmatter structure
Parveen-Birthaliya 5d53cdd
Fix typo in README.md for Antigravity
Parveen-Birthaliya 95c24cb
Fix capitalization in Google Antigravity section
Parveen-Birthaliya 0d6c1d5
Fix link to Google Antigravity Instructions
Parveen-Birthaliya b901ecc
Refine Antigravity format documentation
Parveen-Birthaliya d9d3e82
Update Google Antigravity to Antigravity in docs
Parveen-Birthaliya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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). | ||
thomas-bartlett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Antigravity uses .md files with YAML frontmatter containing: | ||
| - description: Rule description (required by Antigravity spec) | ||
thomas-bartlett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Rules are stored in .agent/rules/ and can be triggered | ||
| on-demand with /rule-name in the Antigravity interface. | ||
thomas-bartlett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| 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. | ||
santosomar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
| 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}") | ||
thomas-bartlett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
Parveen-Birthaliya marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return self._build_yaml_frontmatter(yaml_lines, rule.content) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.