write-agents-md
Skill0 starsChanged 45 days agoMITView on GitHub
Write or refresh a repository's AGENTS.md by discovering its real setup, test, lint and style commands and recording them where coding agents will read them. Use when a repository has no AGENTS.md, when the existing one is stale, vague or aspirational, or when an agent keeps repeating the same setup mistakes.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- agentkitco/agentkit-dev-skillstheir own version, first seen Nov 1, 2026
- joshua-zyy/write-agents-mdtheir own version, first seen Oct 3, 2026
- AsakuraMizu/skillstheir own version, first seen Sep 18, 2026
- dzianisv/skillstheir own version, first seen Aug 18, 2026
- narumiruna/skillstheir own version, first seen Jul 15, 2026
- brandhaug/skillstheir own version, first seen Jul 3, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- narumiruna/skills★ 17same name
- dzianisv/skills★ 4same name
- AsakuraMizu/skills★ 2same name
- agentkitco/agentkit-dev-skills★ 0same name
- brandhaug/skills★ 0same name
- josecabralf/skills★ 0same name
- joshua-zyy/write-agents-md★ 0same name
- justinchoo93/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- report-token-budgetSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Run, at minimum: dependency install (if any), the test command, the lint/format command, and the "check everything" command.
- Very specific: line 65
Start from assets/AGENTS.md.template so no section is silently forgotten.
- Distinctive: line 75
Run the file's own check command one last time.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write an AGENTS.md
AGENTS.md is a README for agents: setup commands, checks, style rules and guardrails that a newcomer cannot infer from the code. Its value is not the prose. It is that every line is true and runnable, because the agent will run it.
Non-negotiables
- Run every command before you write it down. A command that was not executed from a clean checkout is a rumor. If it fails, either fix the command or record the failure and the workaround.
- One canonical command per job.
make checkbeats a four-item menu, because an agent will pick the cheapest-looking item on a menu. - Guardrails are prohibitions, not aspirations. "Never edit files under
src/gen/; regenerate withmake gen" is followable. "Keep the code clean" is not. - Never invent. Unknown → write
unknown — find out with <command>. - Budget the length. Aim under ~150 lines. AGENTS.md is context the agent carries on every task; every line you add is charged to every future run.
- Do not put secrets in it. Name the environment variable; never its value.
Steps
1. Look before you write
python scripts/scan_repo.py .The scan reports marker files, existing agent files, CI workflow commands, candidate test directories, the newest commits and a suggested command set. Treat the suggestions as hypotheses to verify, never as facts.
2. Verify each command by running it
Run, at minimum: dependency install (if any), the test command, the lint/format
command, and the "check everything" command. Capture the exact invocation that
worked, including the working directory and any environment variable. Note the
runtime: an agent that knows make check takes 90 seconds will not run it after
every keystroke.
3. Write the file, in this order
Order matters more than wording: agents read top-down and stop when they have what they need.
- What this is — one line, plus the layout in five lines or fewer.
- Setup — exact commands, from clean checkout to first test run.
- Checks — the command(s) that decide "done", and what they cover.
- Code style — rules a linter cannot enforce; point at the ones that are enforced.
- Guardrails — what must never happen, and how to recover when it does.
- PR / commit conventions — only if they exist.
- Known traps — the two or three things that bite everyone once.
Start from assets/AGENTS.md.template so no section is silently forgotten.
4. Check yourself before finishing
- Would a competent newcomer, following only this file, reach a green test run on the first try?
- Does every command exist, and is it the one CI actually runs?
- Is every guardrail stated as something an agent can do or avoid?
- Is anything in the file aspirational rather than true? Mark those explicitly as goals, or delete them.
- Run the file's own check command one last time. Then run
git diffand read it.
Output shape
A single AGENTS.md at the repository root, standard Markdown, no required
fields. For a monorepo, add a nested AGENTS.md per package: agents read the
nearest file in the directory tree, so the closest one wins.
Edge cases
- No build system — say so in one line ("no build step; the modules run directly"), because silence makes agents invent one.
- Commands that need a service — record the dependency and a mock/test
fallback (
make test-unitruns without Docker). - Generated code — name the generator command and forbid hand-edits; this is the most common agent-inflicted repository wound.
- Conflicting instructions — the nearest AGENTS.md wins, and an explicit prompt from the user overrides everything. Record your repo's exceptions.
- An existing AGENTS.md — diff its claims against reality first; keep the true lines, delete or fix the rest, and say what you changed.
Reference
- Best practices — the conventions and the precedence rules, condensed from the AGENTS.md project.
- Template — the section skeleton this skill writes.
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.

