model-router
AGENTS.md1 starsChanged 8 days agoMITView on GitHub
These rules bind every coding agent that works in this repository. CLAUDE.md is a symbolic link to this file, so both names give one text. CONTRIBUTING.md holds the rules for every contributor. This file adds what an agent gets wrong without being told. - Before a change: - Repository layout and Build and check; - the README of each plugin it touches. - Look up when the case comes: - docs/clients.md for a harness fact, by its headings, never whole.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,117 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- add-providerSkill
- live-runSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 13 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 15
Look up when the case comes:
- Distinctive: line 51
Add no effort rule for one harness alone.
- Distinctive: line 57
When you change one adapter, check the other three.
- Distinctive: line 76
Write a test for such a rule only when Biome cannot hold it cheaply:
- Distinctive: line 84
Write the failing test first.
- Distinctive: line 90
Before you delete a test as a repeat, name the test that still holds its fact, and check that a wrong implementation still fails.
- Very specific: line 96
Follow [No package.json in the Claude Code plugin][no-package-json].
- Distinctive: line 100
Run every command of Build and check, the Hermes Python tests too when you touched that plugin.
- Very specific: line 102
Run node scripts/scan-owner-setup.ts and cog check --from-latest-tag.
- Distinctive: line 110
Never force-push. Never amend a pushed commit.
- Very specific: line 112
Keep a pull request at 100 reviewable files or fewer, counted after the filters of .coderabbit.yaml.
- Distinctive: line 114
Never drop a part of the change to fit.
- Distinctive: line 122
No file, comment, test, commit, pull request, issue or review comment holds a fact about the setup of the maintainer or of your own run: a …
- Distinctive: line 133
Start no live run without the maintainer's word.
- Distinctive: line 134
Never start an interactive harness session from an agent session.
- Distinctive: line 135
Never change a user's settings, auto-update choice or installed plugin versions.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rules for agents
These rules bind every coding agent that works in this repository.
CLAUDE.md is a symbolic link to this file, so both names give one text.
CONTRIBUTING.md holds the rules for every contributor. This file adds what an agent gets wrong without being told.
Read first
- Before a change:
- Repository layout and Build and check;
- the README of each plugin it touches.
- Look up when the case comes:
- docs/clients.md for a harness fact, by its headings, never whole.
- docs/design.md when the build or CI changes.
- In CONTRIBUTING.md: Calibration for a tier or work text, Dependencies for a pin, Type declarations for the plugin tests, Try the OpenClaw plugin from a checkout to run OpenClaw on your edit, and Publishing to npm for a release.
What the plugins do and never do
- They route subagents only. They never change the model of the main session.
- They never override a model or an effort the user set for a call or for
all subagents, with two exceptions that each plugin README lists. Under the
extendedscope the routed effort replaces one that an agent's definition or config entry sets, and in Claude Code the routed model replaces the definition's model too. In Claude Code the routed model outranksCLAUDE_CODE_SUBAGENT_MODEL. - They track no spend and no cost budget.
- They migrate a stored setting by code only through the ladder. A value that no step can read skips routing with the setup line, except in Claude Code, which hands the plugin the default in its place.
- They hold no code for a job that a text instruction to an agent can do. A step in a skill replaces a tool that lists or sets what the harness owns.
- The routing code is TypeScript in
src/: the questions, the pick rule, the ladder, the slot choice and the line. The Python of the Hermes plugin reads Hermes's state, runs the gates that need it, and applies the answer, or the model of a level the task sets. Add nothing else to it. - The effort ladder is one table in the core. model-choice.md explains it. Add no effort rule for one harness alone.
Four harnesses, one behaviour
- The Claude Code, omp, OpenClaw and Hermes plugins behave the same wherever the harness allows: options, defaults, wording and setup steps.
- When you change one adapter, check the other three. Change them in the same pull request, or say in its text why one differs.
- Shared logic lives once. Repository layout says where.
- A claim about a harness needs a source: a permalink at a pinned commit, a documentation page, or the client version and date of a run. The fact goes into docs/clients.md as a plain statement, and its source onto the client's evidence page on the wiki, in the form that Adding evidence gives.
A rule about the source goes to Biome first
- A rule about what the source text may hold is a lint rule, not a test: which file imports what, which call takes a literal, which form a statement may take.
- Build it as Repository layout
describes:
overridesinbiome.json, or a GritQL plugin inscripts/lint/, and a planted fault inscripts/lint.test.ts. A pattern that matches nothing would otherwise switch the rule off unseen. - Write a test for such a rule only when Biome cannot hold it cheaply:
- the rule needs a value the code computes;
- the rule counts across files;
- Biome does not read the file: a generated bundle, a manifest, a workflow.
- Behaviour stays with tests: what the code returns, prints or sends.
Tests
- Write the failing test first.
- An expected value is a literal. Never build it with the function under test.
- Each call site of a shared predicate keeps its own edge rows: a blank
string, a string of spaces and
null. A table in the predicate's own test does not prove that a caller calls it. - Before you delete a test as a repeat, name the test that still holds its fact, and check that a wrong implementation still fails.
Generated files
- Follow Generated files.
- Follow No package.json in the Claude Code plugin.
Before you push
- Run every command of Build and check, the Hermes Python tests too when you touched that plugin.
- Run
node scripts/scan-owner-setup.tsandcog check --from-latest-tag.
Commits and pull requests
- Commits states the format.
- A change that a plugin user can see is
fixorfeat, in the commit and in the pull request title.build,ci,chore,docs,refactorandtestrelease nothing. Never put a user-visible change under them. - Never force-push. Never amend a pushed commit. Take a newer
mainwith a merge commit, then rebuild. - Keep a pull request at 100 reviewable files or fewer, counted after the
filters of
.coderabbit.yaml. Split a larger change into pull requests. Never drop a part of the change to fit. - A larger change that must release whole follows Changes larger than one pull request.
- The pull request text says what changed, why, and the verification commands with their results. It holds no session history.
Nothing about anyone's own setup
- No file, comment, test, commit, pull request, issue or review comment holds a fact about the setup of the maintainer or of your own run: a key, an account, which key or account ran something, a budget, an employer, the state of a machine, a local path, an installed tool.
- Describe work by what was done and measured: models, samples, dates, the shape of a request, commands and their output.
- Continuous integration says what the scan reads and where CI runs it.
Live runs
- Start no live run without the maintainer's word.
- Never start an interactive harness session from an agent session.
- Never change a user's settings, auto-update choice or installed plugin versions.
.agents/skills/live-run/SKILL.mdholds the procedure.
Writing
- One copy of each text. Every other place links to it.
- A fact about one harness lives in that harness's plugin README. A fact
about all four lives in the root README or in
docs/providers.md. - The root README links to a plugin README by its file, never by its folder.
- A plugin README links outside its own folder by absolute address. The npm README uses absolute addresses only.
- Each link has its own text. No two links on a page read the same.
- Tracked files, commits and pull request text are in English.
- A code comment explains a why that the code does not show.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

