Skip to content

feat: Antigravity/Kilo Code support, GCP filters, wire 21 orphaned filters, add bun/yarn/bazel/flutter/eza/podman - #1128

Open
Lyther wants to merge 9 commits into
rtk-ai:developfrom
Lyther:develop
Open

Lyther wants to merge 9 commits into
rtk-ai:developfrom
Lyther:develop

Conversation

@Lyther

@Lyther Lyther commented Apr 10, 2026 •

Copy link
Copy Markdown

Summary

Antigravity + Kilo Code agent support

  • Add Google Antigravity integration: project-scoped rules via .agents/rules/ (confirmed against Antigravity 1.107.0)
  • Add Kilo Code rules support (project-scoped only)
  • Real-env testing confirmed Antigravity is a Windsurf/Codeium fork with NO hooks.json — dead hook code removed
Vector Command Mechanism
Cascade AI rules rtk init --agent antigravity .agents/rules/antigravity-rtk-rules.md
Claude Code hooks rtk init -g ~/.claude/settings.json PreToolUse (works inside Antigravity)

GCP filters

  • gsutil.toml, bq.toml, expand gcloud.toml with 7 subcommand filters
  • pip-install.toml, expand uv-sync.toml with init/add/lock, conda.toml

Wire 21 orphaned TOML filters

gcc, gradle, jq, oxlint, basedpyright, jira, jj, just, mise, nx,
ollama, skopeo, spring-boot, ssh, stat, task, turbo, ty, xcodebuild, yadm
(all had TOML filters but no rules.rs entries — dead code until now)

New ecosystem TOML filters

File Filters Savings Tests Closes
bun.toml install, test, build 60-70% 3 #832
yarn.toml install, test 60-80% 3 #902
bazel.toml build, test, query 70-75% 3 #1061
flutter.toml build, analyze, test, pub 90-100% 5 #1098
eza.toml ls replacement 65% 1 #1030

Other

Closes #832 #902 #1030 #1034 #1061 #1098

Token Savings (measured on rtk repo)

Command Raw Filtered Savings
cargo test 5,568 9 99.8%
cargo clippy 457 46 89.9%
ls -la src/ 101 10 90.1%
git status 59 9 84.7%
git log -20 1,162 696 40.1%
Session total 9,985 2,606 73.9%

Stats

  • Filter count: 58 → 86 (+28)
  • Rule count: 72 → 97 (+25)
  • 18/18 new rewrite tests pass
  • Startup: <1ms | Binary: 5.8MB | RSS: 5.9MB

Test plan

  • cargo test — 1368 passed, 0 failed
  • cargo clippy --all-targets — zero warnings from changed files
  • All 86 TOML filters have inline tests
  • Rewrite verified: bun, yarn, bazel, flutter, dart, eza, podman, gcc, gradle, jq, just, oxlint, turbo, xcodebuild, conda, python3 -m pip
  • E2E: rtk init --agent antigravity verified against local Antigravity 1.107.0
  • E2E: gcloud/gsutil/bq rewrite works
  • Performance unchanged: <1ms startup, 5.8MB binary, 5.9MB RSS

aeppling and others added 6 commits April 6, 2026 12:54
feat(): batch fixs + aws extended + filter quality batch
…master--components--rtk

chore(master): release 0.35.0
…ters

- Add Antigravity hook: project-scoped rules + global hooks.json mode
- Add Kilo Code rules support (project-scoped only)
- Add gsutil.toml, bq.toml filters and expand gcloud.toml subcommands
- Harden hooks.json patching: backup-before-mutation, Result<()> over expect()
- Document unverified global hook assumptions in README
- Remove dead code: duplicate remove_var in trust.rs, orphan subcmd_savings
- Fix let-else lints in hook_check.rs
…sting

Real-environment testing against Antigravity 1.107.0 revealed that
Antigravity is a Windsurf/Codeium fork with NO hooks.json support.
The global hook mode (install_antigravity_hooks, patch_antigravity_hooks_json)
was writing to a path Antigravity never reads.

- Remove rtk-rewrite.sh, ANTIGRAVITY_DIR, and all hooks.json functions
- --global now bails with guidance to use rtk init -g (Claude Code hooks)
- Keep project-scoped rules (.agents/rules/) — confirmed working via
  Antigravity's ruleEditor registration for .agents/rules/**/*.md
- Update README with verified integration paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Apr 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Antigravity's Cascade runs pip/uv/conda with verbose progress bars
that flood LLM context. Add TOML filters to strip download noise:

- pip-install.toml: strip progress bars, download lines, version warnings
- uv-sync.toml: expand from sync-only to init/add/lock (3 new filters)
- conda.toml: strip solver, download, extract progress (install + list)
- rules.rs: register python -m pip, uv init/add/lock, conda commands

Filter count: 67 → 73 (+6 new filters)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aeppling

Copy link
Copy Markdown
Contributor

Hello, Antigravity and KiloCode support already on develop branch and will be in next release.

But new gcp filters are welcome !

Thanks for contributing

@aeppling aeppling added duplicate This issue or pull request already exists awaiting-changes labels Apr 10, 2026
…za/podman

Wire 21 existing TOML filters that had no rules.rs entries (dead code):
gcc, gradle, jq, oxlint, basedpyright, jira, jj, just, mise, nx,
ollama, skopeo, spring-boot, ssh, stat, task, turbo, ty, xcodebuild, yadm

Add 5 new ecosystem TOML filters (13 filter sections):
- bun.toml: install, test, build (Bun runtime)
- yarn.toml: install, test (Yarn package manager)
- bazel.toml: build, test, query (Google build system)
- flutter.toml: build, analyze, test, pub (Flutter/Dart)
- eza.toml: modern ls replacement

Add podman as alias to docker rule in rules.rs.
Add python -m pip to pip rewrite rule.

Filter count: 73 → 86 (+13 new). Rule count: +26 entries.
@Lyther Lyther changed the title feat(hooks): Antigravity + Kilo Code support with GCP filters feat: Antigravity/Kilo Code support, GCP filters, wire 21 orphaned filters, add bun/yarn/bazel/flutter/eza/podman Apr 10, 2026
@Lyther

Lyther commented Apr 10, 2026

Copy link
Copy Markdown
Author

The upstream develop branch already has d0a3797 which added basic project-scoped rules for Antigravity and Kilo Code (by @Yosoyepa). This patch builds on that foundation in three layers:

1. Antigravity hardening — Tested against a local Antigravity 1.107.0 install and discovered it's a Windsurf/Codeium fork, not Cursor. The original commit assumed a hooks.json protocol that doesn't exist. We added the global hook code, validated it was dead, then removed it — leaving only the confirmed-working .agents/rules/ path plus guidance to use rtk init -g (Claude Code hooks) for transparent rewriting.

2. GCP ecosystem — Expanded gcloud.toml with 7 subcommand filters, added gsutil.toml, bq.toml, pip-install.toml, conda.toml, and expanded uv-sync.toml to cover init/add/lock. These are the noisy commands Antigravity's Cascade actually runs.

3. Broad filter coverage — Wired 21 existing TOML filters that had no rules.rs entries (completely unreachable dead code), and added 5 new ecosystem filters (bun, yarn, bazel, flutter/dart, eza) plus podman as a docker alias. Closes #832 #902 #1030 #1034 #1061 #1098.

Net: 58 → 86 TOML filters, 72 → 97 rules, 73.9% token savings measured on real sessions.

Comment thread src/filters/bazel.toml

[filters.bazel-query]
description = "Compact bazel query output"
match_command = "^bazel\\s+query\\b"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
match_command = "^bazel\\s+query\\b"
match_command = "^bazel(isk)?\\s+[ca]?query\\b"

Also all of these should probably be made to handle startup flags between bazel and the verb.

Comment thread src/filters/bazel.toml
Comment on lines +46 to +61
[[tests.bazel-build]]
name = "strips progress and action noise"
input = """
Loading: 0 packages loaded
Analyzing: target //src:main (3 packages loaded, 12 targets configured)
INFO: Analyzed target //src:main (3 packages loaded, 12 targets configured).
INFO: Found 1 target...
[3 / 7] Compiling src/main.cc
[5 / 7] Linking src/main
INFO: Elapsed time: 4.234s, Critical Path: 2.31s
INFO: 7 processes: 3 internal, 4 darwin-sandbox.
INFO: Build completed successfully, 7 total actions
Target //src:main up-to-date:
bazel-bin/src/main
"""
expected = "INFO: Build completed successfully, 7 total actions\nTarget //src:main up-to-date:\n bazel-bin/src/main"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this test accurately reflects the reality of whether it's going to work correctly in production; as #1061 points out, most of bazel's output is stderr, not stdout. You need to add filter_stderr:

rtk/src/core/toml_filter.rs

Lines 105 to 108 in 4c278d1

/// When true, stderr is captured and merged with stdout before filtering.
/// Use for tools like liquibase that emit banners/logs to stderr.
#[serde(default)]
filter_stderr: bool,

Comment thread src/filters/bazel.toml
[filters.bazel-query]
description = "Compact bazel query output"
match_command = "^bazel\\s+query\\b"
strip_ansi = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip_ansi is going to be doing the wrong thing here. We do want to strip out colors, but bazel makes extensive use of ansi escape sequences to overwrite progress lines. It's possible that you can catch all such lines with regexes, but it would be more reliable to just remove anything that gets overridden, before proceeding to regex-match remaining lines that are not of interest. rtk arguably should just do that for everything, before it gets to the point of these regex matchers.

@KuSh

KuSh commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Heads-up: #988 adds native bun/deno command support (Rust filters, not TOML) and is close to landing. It overlaps two things here, and only two:

Not asking you to close this PR — the other 21 files (Antigravity/Kilo Code hooks, the GCP filters, bazel/conda/eza/flutter/pip-install/uv-sync/yarn, the toml_filter.rs changes) are independent and unaffected. Dropping just those two pieces on your next rebase should be enough.

One thing worth knowing if you'd rather keep a TOML path for bun: bun-install strips ^\s*\+, which removes bun's + package@version lines — those are the substantive output of an install, so the filter as written discards the part worth keeping. #988 keeps them and strips the version header and resolution lines instead, measured at ~70% on a real capture.

This PR is currently marked conflicting, so it needs a rebase regardless.

@KuSh

KuSh commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

Antigravity and Kilo Code support landed on develop with commit d0a3797 (2026-04-08), and #988 (merged 2026-09-03) added native Rust filters for bun, so bun.toml and the bun discover rule here are no longer needed. Most of the orphaned filters you wired also rewrite on develop now. What develop still lacks from this branch is the TOML filters and rewrite rules for yarn, bazel, flutter/dart, eza, gsutil, bq, conda and pip-install, the gcloud subcommand expansion, uv-sync init/add/lock, podman as a docker alias, the python -m pip rewrite, and the rewrite wiring for mise and ollama. Could you rebase onto current develop and narrow the PR to those parts? It currently conflicts with develop, so expect to resolve conflicts in src/discover/rules.rs and the init code, and to drop the release and version files. Thanks for all the work on these filters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-changes duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Bun runtime support (bun test, bun run, bunx)

5 participants