complex-md
AGENTS.md1 starsChanged 17 days agoMITView on GitHub
complex-md has two parts: the cli/ npm package and the complex.md site. These rules are for a coding agent that works on either part. - Run cd cli && npm test before you finish a change. The exit code is the gate, not the printed summary. CI runs it on Ubuntu, Windows and macOS, each with Node 22 and 24. - Run npm run build at the root after a change to content/, site/ or scripts/build.mjs. It writes dist/. -…
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 31,843 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 repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- contentSkill
- complex-mdSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
10
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
- Very specific: line 8
Run cd cli && npm test before you finish a change.
- Very specific: line 11
Run npm run build at the root after a change to content/, site/ or scripts/build.mjs.
- Very specific: line 15
Add no runtime dependency to cli/package.json.
- Very specific: line 18
Add no network call. The only requests are the model calls in cli/src/generate.js, and cli/test/telemetry.test.js fails on any other.
- Very specific: line 21
When CLI behavior changes, run cd cli && node --test test/truth.test.js.
- Very specific: line 23
Do not run bench/run.mjs unless you are asked to.
- Very specific: line 25
Do not edit COMPLEX.md, .claude/rules/ or the section below by hand.
- Distinctive: line 32
Write a commit subject in conventional form, 72 characters at most.
- Very specific: line 36
Follow the AI assistance policy in CONTRIBUTING.md: disclose the tool in the pull request description, add an Assisted-by: or a …
- Very specific: line 54
When editing one file of a co_change pair, or a file in one side of a seams pair, open the partner and state in your change description …
- Very specific: line 63
After refactoring a listed hotspot, regenerate the map: npx complex-md, or run the complex-md skill.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md
Working on this repository
complex-md has two parts: the cli/ npm package and the complex.md site.
These rules are for a coding agent that works on either part.
- Run
cd cli && npm testbefore you finish a change. The exit code is the gate, not the printed summary. CI runs it on Ubuntu, Windows and macOS, each with Node 22 and 24. - Run
npm run buildat the root after a change tocontent/,site/orscripts/build.mjs. It writesdist/. - Edit the prompts in
prompts/. The files incli/prompts/are copies thatcli/scripts/sync-prompts.mjsmakes before each pack. - Add no runtime dependency to
cli/package.json. The core has none. The MCP server inpackages/complex-md-mcpimports the MCP SDK and zod only. Runcd packages/complex-md-mcp && npm testafter a change there. - Add no network call. The only requests are the model calls in
cli/src/generate.js, andcli/test/telemetry.test.jsfails on any other. - When CLI behavior changes, run
cd cli && node --test test/truth.test.js. It fails on a public sentence that the code contradicts. - Do not run
bench/run.mjsunless you are asked to. It drives a real agent and spends the account's usage. - Do not edit
COMPLEX.md,.claude/rules/or the section below by hand. They are generated. Regenerate them withnode cli/bin/complex-md.js, which prints the next step when no provider key is set. - The repository commits no edit hooks and no MCP server config. To try
the hooks on your own clone, run
node cli/bin/complex-md.js wire --hooks --local. It writes them to Claude Code's per user settings file, which stays out of commits. - Write a commit subject in conventional form, 72 characters at most. In the body, state the problem before the fix. Use numbers, not adjectives.
- A change to the spec or a signal cites a benchmark run or a source, and
adds a line to
CHANGELOG.md. - Follow the AI assistance policy in
CONTRIBUTING.md: disclose the tool in the pull request description, add anAssisted-by:or aCo-Authored-By:trailer, and leave the review of the diff and the answers to review comments to a person. Fill in each section of.github/PULL_REQUEST_TEMPLATE.md, including the AI assistance box.
<!-- BEGIN complex-md (spec 0.3) -->COMPLEX.md: the structural risk map
COMPLEX.md at the repository root is a computed map of where edits are
risky and where bugs get fixed, built from the dependency graph and the
commit history. Its hotspots, load_bearing, co_change and seams
lists name specific files and areas. When your work touches one of them:
- IMPORTANT: before editing a file listed under
hotspotsorload_bearing, read its paragraph in COMPLEX.md under "Why these files are hot" and do what that paragraph's last sentence says before you change the file. - When editing one file of a
co_changepair, or a file in one side of aseamspair, open the partner and state in your change description whether the partner also needed a change. - Fixing a bug whose location you do not yet know, check the
hotspotsrows with the highestfixescount before searching the whole repository; past fixes predict where the next one lands. - Entering this repository cold, read the files under "What to read first" in order before your first edit.
After refactoring a listed hotspot, regenerate the map: npx complex-md, or
run the complex-md skill.
<!-- END complex-md (spec 0.3) -->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.

