chore(rtk): AGENTS.md as the shared instruction file, project rtk filters - #473
Merged
Merged
Conversation
…ters Move CLAUDE.md's body into AGENTS.md so Grok, Cursor, Copilot and Codex read project rules directly instead of only Claude Code. CLAUDE.md becomes an @AGENTS.md stub, matching getmanza/app#4104. Add .rtk/filters.toml for `rake build` (CI's "Verify gem builds" step): the gem's packaged-file listing is ~300 lines of noise on every run and the global PreToolUse hook does not rewrite it.
A command that crashes writes to stderr only; rtk then printed '<name>: ok' under the stack trace. The message now says the output was filtered away and points at the exit code. Test seeds are needed to reproduce an order-dependent failure, so no filter strips them.
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.
Summary
Adopts getzazu/app#4104 for this repo.
CLAUDE.mdbody into a newAGENTS.md, with a short intro explainingit's the single instruction file: Claude Code imports it via
CLAUDE.md, and Grok, Cursor,Copilot and Codex read it directly. No existing
AGENTS.mdto merge with; no<!-- BEGIN docs-kit -->block in this repo. Added an adapted "Screenshots on PRs and issues"section, since the dashboard (
app/controllers/pgbus/,app/views/pgbus/*.html.erb,app/frontend/pgbus/— Tailwind + Turbo + ApexCharts) is a real UI.CLAUDE.mdis now the zazu-shaped stub (@AGENTS.md+ a two-line pointer). No nestedCLAUDE.mdfiles exist in this repo..claude/commands/plan.mdand.claude/commands/github-review-comments.mdthat pointed at
CLAUDE.mdmeaning "the project rules" — nowAGENTS.md. No.github/copilot-instructions.mdexists. Checkedpgbus.gemspec'sspec.files(git-ls-filesfiltered to
app/,config/,exe/,lib/+ a few root docs) — neitherCLAUDE.mdnorAGENTS.mdships in the gem, same as before..grok/or.cursor/directories, so the Grok/Cursor-specific hunks in thereference diff don't apply here.
.rtk/filters.toml: added one filter,rake-build, forbundle exec rake build(the"Verify gem builds" step CI runs) — the global PreToolUse hook does not rewrite it. The task
sh-echoes gem-build/unpack/find/rm commands and then lists every file in the unpacked gem(currently ~300 lines); on a real run that echo/list content is noisy for an agent (the number of
packaged files, not a violation, is the only signal). Filter: strips blank lines and the
/tmp/gem-verify/...file-listing lines, keeps the build/unpack confirmation, version/name/filemetadata and any failure output untouched.
Before → after on a real run (
rtk bundle exec rake build 2>&1 | wc -l): 326 → 10 lines(97% reduction). Verified a failing build (
rake build:nonexistent) still surfaces the fullerror and a non-zero exit code — the filter never touches stderr/failure output.
Considered and skipped as filter candidates (either already rewritten by the global hook, output
was already compact, or too slow to justify a line-stripping filter):
bin/rubocop— already refused by the hook (unknown to it);AGENTS.mdalready says to usebundle exec rubocop.bun run lint:herb— already rewritten by the global hook (rtk bun run lint:herb).bin/release list— 12 lines, no noise.bundle exec bundle-audit check --update— 9 lines, no noise.bundle exec rake bench/bench:*— every line is a real benchmark number, nothing to stripas boilerplate, and a full run takes minutes; not "cheap" to verify and not obviously "noise".
brakeman/lingo/rails-dbfilters don't apply — this repo runs none of thosecommands (it's a gem, not a Rails app; no
bin/lingo, novalidate_all, nodb:*tasks at therepo root).
Added the rtk paragraph to
AGENTS.md's Commands section, and an idempotentrtk trust --yes >/dev/null 2>&1 || truestep (only runs whenrtkis onPATH) tobin/setup.Test plan
rtk trust --yesin the worktree, thenrtk verify— 155/155 inline filter tests pass.rtk hook check "bundle exec rake build"→ rewrites tortk bundle exec rake build.rtk bundle exec rake buildend-to-end: exit 0, output 326 → 10 lines (captured above).rake build:nonexistentthrough the same filter still prints the full Rake backtrace andexits 1 — confirms the filter doesn't mask failures.
bash -n bin/setup— syntax OK. No Ruby files changed, sobundle exec rubocopdoesn'tapply; no markdown/yaml lint config in this repo.
grep -rn "CLAUDE.md"across the repo (excluding.git,vendor,node_modules,gitignored
.claude/worktrees/) — only the two command files above, both fixed.Summary by cubic
Project instructions now live in
AGENTS.mdinstead ofCLAUDE.md, so Grok, Cursor, Copilot, and Codex read the same rules as Claude Code. Adds a project-local rtk filter forrake buildso agents see gem metadata without the ~300-line file listing.Details
CLAUDE.mdis now a stub that importsAGENTS.md; Claude Code's behavior is unchanged..claudecommand files that referencedCLAUDE.mdas project rules now referenceAGENTS.md./tmp/gem-verify/listing lines and keeps the build and unpack confirmation plus gem metadata.bin/setupre-trusts rtk filters whenrtkis available.Side effects
ok.CLAUDE.mdnorAGENTS.mdships in the gem.Written for commit 45743f1. Summary will update on new commits.