Repository navigation
fix(init): migrate legacy Antigravity rules on install and uninstall (#4317) - #4335
Open
Aayushyaash wants to merge 2 commits into
Open
Aayushyaash wants to merge 2 commits into
Aayushyaash wants to merge 2 commits into
Conversation
📊 Automated PR Analysis
SummaryThis PR migrates legacy Antigravity rules files (.agents/rules/antigravity-rtk-rules.md) left behind by earlier RTK versions when installing or uninstalling the native Antigravity plugin. It removes the legacy file if it contains only RTK-generated content, strips only the RTK-appended suffix while preserving user content when both are present, and leaves unrelated files untouched, with dry-run support. Review Checklist
Linked issues: #4317 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Migrate the legacy .agents/rules/antigravity-rtk-rules.md during Antigravity lifecycle operations: - Remove it when it contains only RTK's legacy awareness text. - Remove only RTK's appended awareness text when the file also contains user content, preserving the user content byte-for-byte. - Leave unrelated or foreign files untouched and silent. - Handle install, uninstall, and -g install from within a workspace. - Keep --dry-run non-mutating. - Add unit and process-level integration tests for each case.
Aayushyaash
force-pushed
the
fix/antigravity-legacy-rules-cleanup
branch
from
September 28, 2026 14:14
9e4ec73 to
69a04d6
Compare
Contributor
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4317
Description
This is a follow-up to the native Antigravity plugin support added in #3711.
Before #3711,
rtk init --agent antigravitycreated.agents/rules/antigravity-rtk-rules.md. After moving to the native plugin, that legacy file could still be left behind in existing workspaces. This could cause duplicate awareness text after an upgrade, and the file would remain after uninstall.This PR cleans up that legacy file during the Antigravity install/uninstall flow without touching user-owned content.
What changed
rtk init -g --agent antigravityfrom inside a workspace.--dry-runnon-mutating.Tests
Added unit and process-level tests covering:
-ginstall from a workspace.Also verified the full lifecycle manually against the built
rtkbinary.Verification
cargo fmt --all --check✓cargo clippy --all-targets -- -D warnings✓cargo test --bin rtk test_antigravity✓cargo test --test antigravity_hook_test✓