Skip to content

chore(rtk): AGENTS.md as the shared instruction file, project rtk filters - #473

Merged
mhenrixon merged 2 commits into
mainfrom
chore/agents-md-rtk
Sep 19, 2026
Merged

mhenrixon merged 2 commits into
mainfrom
chore/agents-md-rtk

Conversation

@mhenrixon

@mhenrixon mhenrixon commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adopts getzazu/app#4104 for this repo.

  • Moved the whole root CLAUDE.md body into a new AGENTS.md, with a short intro explaining
    it's the single instruction file: Claude Code imports it via CLAUDE.md, and Grok, Cursor,
    Copilot and Codex read it directly. No existing AGENTS.md to 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.
  • Root CLAUDE.md is now the zazu-shaped stub (@AGENTS.md + a two-line pointer). No nested
    CLAUDE.md files exist in this repo.
  • Fixed the 5 places across .claude/commands/plan.md and .claude/commands/github-review-comments.md
    that pointed at CLAUDE.md meaning "the project rules" — now AGENTS.md. No
    .github/copilot-instructions.md exists. Checked pgbus.gemspec's spec.files (git-ls-files
    filtered to app/, config/, exe/, lib/ + a few root docs) — neither CLAUDE.md nor
    AGENTS.md ships in the gem, same as before.
  • This repo has no .grok/ or .cursor/ directories, so the Grok/Cursor-specific hunks in the
    reference diff don't apply here.

.rtk/filters.toml: added one filter, rake-build, for bundle 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/file
metadata 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 full
error 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.md already says to use
    bundle 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 strip
    as boilerplate, and a full run takes minutes; not "cheap" to verify and not obviously "noise".
  • zazu's brakeman / lingo / rails-db filters don't apply — this repo runs none of those
    commands (it's a gem, not a Rails app; no bin/lingo, no validate_all, no db:* tasks at the
    repo root).

Added the rtk paragraph to AGENTS.md's Commands section, and an idempotent
rtk trust --yes >/dev/null 2>&1 || true step (only runs when rtk is on PATH) to bin/setup.

Test plan

  • rtk trust --yes in the worktree, then rtk verify — 155/155 inline filter tests pass.
  • rtk hook check "bundle exec rake build" → rewrites to rtk bundle exec rake build.
  • rtk bundle exec rake build end-to-end: exit 0, output 326 → 10 lines (captured above).
  • rake build:nonexistent through the same filter still prints the full Rake backtrace and
    exits 1 — confirms the filter doesn't mask failures.
  • bash -n bin/setup — syntax OK. No Ruby files changed, so bundle exec rubocop doesn't
    apply; 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.md instead of CLAUDE.md, so Grok, Cursor, Copilot, and Codex read the same rules as Claude Code. Adds a project-local rtk filter for rake build so agents see gem metadata without the ~300-line file listing.

Details

  • CLAUDE.md is now a stub that imports AGENTS.md; Claude Code's behavior is unchanged.
  • The two .claude command files that referenced CLAUDE.md as project rules now reference AGENTS.md.
  • The filter drops blank lines and /tmp/gem-verify/ listing lines and keeps the build and unpack confirmation plus gem metadata.
  • bin/setup re-trusts rtk filters when rtk is available.

Side effects

  • Failed builds still show the full error and exit non-zero because stderr is never filtered.
  • When nothing remains after filtering, the output says so and points at the exit code instead of printing ok.
  • Neither CLAUDE.md nor AGENTS.md ships in the gem.

Written for commit 45743f1. Summary will update on new commits.

Review in cubic

…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.
@mhenrixon
mhenrixon merged commit 5d9f2f2 into main Sep 19, 2026
13 checks passed
@mhenrixon
mhenrixon deleted the chore/agents-md-rtk branch September 19, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant