Skip to content

chore(rtk): AGENTS.md as the shared instruction file, docs rtk filter - #44

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.

  • AGENTS.md is now the single instruction file. Moved the whole root CLAUDE.md body (131
    lines) into a new AGENTS.md, with a short intro explaining it's shared by Claude Code, Grok,
    Cursor, Copilot and Codex. Root CLAUDE.md is now a 4-line stub that @-imports AGENTS.md
    (same shape as zazu's). No content was dropped or duplicated. docs/AGENTS.md (the docs
    authoring contract) is a separate, unrelated file and was left untouched, as were .claude/rules/
    and .claude/commands/.
  • Fixed 4 stale CLAUDE.md pointers in .claude/commands/{lfg,plan,github-review-pr,github-review-comments}.md
    that meant "the project rules" — they now say AGENTS.md. Repo-wide grep confirms no other
    CLAUDE.md references remain outside the stub itself. importmap-plus.gemspec's spec.files
    list never included either file, so neither ships in the published gem — nothing to fix there.
    No .github/copilot-instructions.md exists in this repo.
  • .rtk/filters.toml — one filter, scoped to docs/. cd docs && bundle exec rake lint is
    the only command in the verification workflow the global rtk hook doesn't already rewrite
    (rspec, rubocop and rake test are already covered). The rake lint task sh-echoes the
    full 53-file rubocop invocation as one very long line, and on failure also dumps a rake/bundler
    backtrace through Bundler::CLI/Thor internals — neither is useful signal. New filter
    docs-lint strips both; verified against real captured output for a clean pass and for a real
    RuboCop offense (Layout/TrailingEmptyLines), both rtk trust --yes + rtk verify clean
    (156/156 inline tests, including this filter's 2).
    • Line counts (real captured output, not estimates): clean pass 5 → 3 lines; offense/failure
      30 → 7 lines (plus a rtk recall pointer). The bigger win is the ~950-character echoed
      file-list line disappearing from both cases.
    • Filter placement note: the file lives at docs/.rtk/filters.toml, not the repo root. rtk
      resolves project-local filters against the directory a command is actually invoked from, with
      no upward walk — and rake lint only runs with docs/ as the working directory (it needs
      docs/Gemfile and docs/Rakefile). A root-level .rtk/filters.toml matched in rtk hook check but silently failed to apply end-to-end once the shell actually cd'd into docs/
      first; moving the file to docs/.rtk/ fixed it. Documented this in AGENTS.md so the next
      person doesn't rediscover it.
    • Added an idempotent rtk trust --yes step to docs/bin/setup (the only bin/setup in this
      repo — there's none at the gem root) — it no-ops when rtk isn't installed.
    • Did not add filters for bundle exec ruby -Itest test/*_test.rb or bin/release --dry-run: ran both for real, output is already a handful of clean lines. Did not run
      bundle exec appraisal generate (10 gemfiles, several against rails/rails branches over
      git/bundle install — not cheap) or the live-CDN bin/importmap commands, so no filter was
      built or claimed for those.
  • Screenshots section: added, scoped to docs/. The gem's CLI itself has no visual output,
    but docs/ is a real deployed Phlex/docs-kit Rails site — I verified this by reading its
    app/views, app/components, app/assets structure before deciding. Added a trimmed
    "Screenshots on PRs and issues" section to AGENTS.md covering docs/ UI changes: the four
    gh … --attach examples, the quoting rule, create-vs-comment, agent-browser screenshot against
    cd docs && bin/dev, save under the scratchpad, brew upgrade gh. Dropped the native/simulator
    and bin/claude-setup mentions from zazu's version (neither applies here).

Test plan

  • rtk trust --yes + rtk verify from docs/ — 156/156 inline tests pass
  • rtk hook check "bundle exec rake lint" (from docs/) rewrites to rtk bundle exec rake lint
  • rtk bundle exec rake lint end-to-end, clean tree — condensed output, exit 0
  • rtk bundle exec rake lint end-to-end, with an injected Layout/TrailingEmptyLines offense
    — condensed output, exit 1 preserved, offense reverted before commit
  • bundle exec ruby -Itest test/importmap_test.rb — 45 runs, 0 failures (gem root, unaffected
    by this PR)
  • ruby -c docs/bin/setup — syntax OK
  • Repo-wide grep -rn "CLAUDE.md" (outside .git) shows only the intentional @AGENTS.md
    stub reference
  • git diff --stat reviewed — only the intended 8 files touched, docs/Gemfile.lock reverted
    after an unrelated local bundle install diff
  • Did not run bundle exec rake test (full suite, live CDNs) or bundle exec appraisal generate — docs/config-only change, out of scope per this repo's own "don't run full test
    suites for docs/config PRs" guidance

Summary by cubic

Makes AGENTS.md the shared project instruction file and condenses docs lint output in agent runs.

What changed

  • Moved the full instruction body from root CLAUDE.md into AGENTS.md; CLAUDE.md is now a stub that imports it.
  • AGENTS.md is read directly by Grok, Cursor, Copilot, and Codex; Claude Code gets the same file through the stub.
  • Updated four .claude/commands/*.md files that referenced CLAUDE.md to reference AGENTS.md.
  • Added a screenshots requirement to AGENTS.md: PRs that change docs/ UI must attach before/after captures.
  • Added docs/.rtk/filters.toml for bundle exec rake lint and made docs/bin/setup trust it idempotently when rtk is installed.
  • The filter's empty-output message now points at the exit code instead of printing ok when a crash writes only to stderr.

Side effects

  • No content was dropped or duplicated; docs/AGENTS.md remains the separate docs authoring contract.
  • No gem code, dependencies, or release behavior changed.
  • The filter lives under docs/.rtk, not the repo root, because rtk resolves filters only in the directory a command runs from.
  • Clean lint output drops from 5 to 3 lines; failure output drops from 30 to 7, and both lose the ~950-character echoed file list.
  • Test seed output is intentionally left unfiltered so order-dependent failures can be reproduced.

Written for commit e7b81e0. Summary will update on new commits.

Review in cubic

Adopts getmanza/app#4104. Moves the root CLAUDE.md body into AGENTS.md so
Grok, Cursor, Copilot and Codex read the same project instructions Claude
Code imports; CLAUDE.md becomes a stub. Adds docs/.rtk/filters.toml for the
docs site's `rake lint` task, whose sh-echoed rubocop invocation and
rake/bundler backtrace are pure noise on both a clean pass and a failure.
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 eefcd31 into main Sep 19, 2026
47 checks passed
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