Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#4317·rtk

`rtk init --agent antigravity` leaves the rules file written by earlier releases in place, on install and on uninstall

Author: KuShCreated Sep 28, 2026Updated Sep 28, 2026
Labelsbughelp wantedarea:clipriority:medium

What happens

Every release up to now answers rtk init --agent antigravity by writing .agents/rules/antigravity-rtk-rules.md: the full awareness text in a new file, or that text appended after a blank line to a file that already existed (run_antigravity_mode_at in src/hooks/init/instructions_agents.rs; a file already mentioning rtk or RTK is skipped). #3711 replaces that mode with a plugin bundle at .agents/plugins/rtk/ whose rules/AGENTS.md carries the awareness text at the configured awareness.level, and it no longer knows about the old file:

$ rtk init --agent antigravity          # earlier release
$ rtk init --agent antigravity          # after #3711
$ find .agents -type f
.agents/plugins/rtk/hooks.json
.agents/plugins/rtk/plugin.json
.agents/plugins/rtk/rules/AGENTS.md
.agents/rules/antigravity-rtk-rules.md   # still there
$ rtk init --agent antigravity --uninstall
$ find .agents -type f
.agents/rules/antigravity-rtk-rules.md   # still there

An upgraded workspace can then carry two awareness texts, the old full one and the plugin's configured level, and uninstall leaves a file RTK wrote. The Antigravity docs bundled with agy 1.2.12 list .agents/rules/*.md among the rule paths; #2916 reports such a file needs trigger: always_on frontmatter to load at startup, so whether the old file is still active depends on the release that wrote it.

What a fix has to do

The sibling agents migrate their own legacy artefacts (remove_legacy_settings_entries in claude.rs, the Cursor and Droid equivalents). For this file:

  • A file whose content is exactly an awareness text an earlier release wrote: remove it, on install and on uninstall, in the workspace the command runs in, including a -g install run from inside that workspace.
  • A file where that text follows the user's own content after a blank line: remove only RTK's suffix and keep the rest byte-identical.
  • Any other file at that path, including one the earlier writer skipped because it already mentioned rtk: leave it alone and say nothing.
  • Dry runs report what would be removed and change nothing.
  • Pin each case with a process-level test.

Found while reviewing #3711, which lands without the migration.

Source: rtk-ai/rtk

View original on GitHubView discussion on GitHub