One rules file for every agent on the team - #223
Merged
Conversation
…eads The team drives this repo with four agents and they do not read the same file. Claude Code reads CLAUDE.md (already one line: @AGENTS.md), opencode reads AGENTS.md directly and prefers it over CLAUDE.md, and Copilot's coding agent reads AGENTS.md too. Only Copilot's EDITOR integrations - VS Code and Copilot for Xcode - do not: AGENTS.md support there is experimental and off by default, while .github/copilot-instructions.md is picked up automatically. So exactly one derived file is needed, and it is generated verbatim from AGENTS.md with a do-not-edit header. tool/check_agent_rules_sync.sh fails when the two drift and regenerates with --fix, matching the five gates already in tool/. Not a package: Ruler, rulesync and AgentSync all do this, and all would add a Node dependency and a build step to produce one file in a repo with no JS toolchain. Not a symlink either - a checkout without core.symlinks turns it into a text file containing a path, which Copilot would read as the literal string and apply no rules at all.
.claude/skills/ is read natively by BOTH Claude Code and opencode, so one
directory serves two of the four harnesses with no sync at all. Copilot's
agent mode reads SKILL.md too.
Three skills, all self-contained:
- open-pr: branch off develop, the checks that must pass, what the
description should say, and open as a draft
- merge-pr: rebase first, --force-with-lease, and the cases where rebase is
the wrong tool. Recorded as a change: #217..#221 all landed as
merge commits, and all three merge methods are still enabled, so
the convention is what enforces this rather than a setting
- review-pr: what a reviewer checks, ordered by consequence - wallet safety,
then correctness tests miss, then accessibility, then the design
system
Self-contained is the hard requirement. The GSD skills are NOT vendored here:
59 of the 69 load workflows from $HOME/.claude/gsd-core/, so copying them
would give everyone else skills that silently reference files they do not
have.
docs/ai-agents.md is the page a human reads to find which file their tool
looks at.
The table named who uses what, which goes stale the moment somebody switches tools or joins. It now says what each agent reads and what you have to do to use it - which for most of them is nothing. Adds an "Adding an agent" section: where to put a new target in the sync script, and the point at which a purpose-built tool beats another hand-rolled target.
braianxde
marked this pull request as ready for review
August 5, 2026 21:43
henriqueaklein
approved these changes
Aug 6, 2026
This was referenced Aug 7, 2026
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.
We drive this repo with several different AI agents and they don't all read the same file, so rules drift and each of us gets a different answer. This makes
AGENTS.mdthe one file anyone edits, and gets it in front of every tool.What each agent needs to do to pick up the rules
CLAUDE.md→ already one line,@AGENTS.mdAGENTS.mddirectly, in preference toCLAUDE.mdAGENTS.mddirectlyAGENTS.mddirectly.github/copilot-instructions.md, auto-detectedAGENTS.mdsetting to read the source instead..github/copilot-instructions.mddocs/ai-agents.md.Most of them read
AGENTS.mdalready. Copilot's editor integrations are the exception —AGENTS.mdsupport in VS Code is experimental and off by default, while.github/copilot-instructions.mdis picked up automatically.So the whole gap is one file, generated verbatim from
AGENTS.mdwith a do-not-edit header.Changing a rule
Without
--fixit verifies and fails on drift, so Copilot users can't quietly end up on different rules. It's the sixth gate intool/, same shape ascheck_brace_style.sh.Shared skills
.claude/skills/is read natively by both Claude Code and opencode — opencode loads it alongside its own.opencode/skills/. Copilot's agent mode readsSKILL.mdtoo. One directory, no sync, nothing to configure. If your agent supports skills but looks elsewhere, point it at that path rather than copying.open-pr— branch offdevelop, the checks that must pass first, what the description should say, open as draftmerge-pr— rebase first,--force-with-lease, and when rebase is the wrong toolreview-pr— what a reviewer checks, ordered by consequence: wallet safety, then correctness the tests miss, then accessibility, then the design systemOne thing to agree on
merge-prwrites down rebase-first as the default, and that's a change: #217 through #221 all landed as merge commits, and all three merge methods are still enabled on the repo. The convention is what enforces this, not a setting — so if we'd rather flip the repo settings too, or don't want rebase-first at all, this is the PR to say so on.Deliberately not here
docs/ai-agents.mdrecords where that tips: if we get past two or three generated targets, switch.core.symlinksturns it into a text file containing a path, which Copilot reads as a literal string and applies no rules at all. A copy plus a failing check is louder.$HOME/.claude/gsd-core/, so copying them here gives everyone else skills that reference files they don't have. Anyone who wants that workflow installs it themselves.Verification
All six gates pass,
flutter analyzeclean, 1000 tests passing. The sync gate was confirmed both ways: it fails on drift and--fixrepairs it.