agent-standards
AGENTS.md1 starsChanged 56 days agoMITView on GitHub
Instructions for agents working on agent-standards itself. This file is never shipped. Consumers get AGENTS.md.example, the only .example file, because every other configuration file ships unchanged. Before any code work on a task, name the skill(s) and subagent(s) that own it and invoke them, or state "none apply" and why, as the first line of your reply. This is a hard gate. Follow .agents/instructions/reply-rules.md when writing to the user. Name skills and ownership in the footer status tail it defines,…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository59 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- agentic-engineeringSkill
- ai-regression-testingSkill
- angularSkill
- ansibleSkill
- api-designSkill
- architecture-decision-recordsSkill
- ascend-memorySkill
- ascend-web-hunterSkill
- audio-scribeSkill
- automation-inventorySkill
- backend-patternsSkill
- bashSkill
- build-dependency-managementSkill
- code-formatterSkill
- code-reviewerSkill
- coding-standardsSkill
- dart-flutter-patternsSkill
- database-migrationsSkill
- deployment-patternsSkill
- design-systemSkill
- docker-patternsSkill
- e2e-runbooksSkill
- e2e-testingSkill
- embedded-c-arduinoSkill
- frontend-designSkill
- g-code-3d-printingSkill
- github-opsSkill
- git-workflowSkill
- golang-patternsSkill
- hexagonal-architectureSkill
- home-assistantSkill
- java-coding-standardsSkill
- jetbrains-ide-opsSkill
- jira-integrationSkill
- keycloak-patternsSkill
- kicadSkill
- markdown-writerSkill
- mongodb-patternsSkill
- nextjs-app-router-patternsSkill
- node-backend-patternsSkill
- observability-and-loggingSkill
- obsidianSkill
- performance-optimizationSkill
- postgres-patternsSkill
- powershellSkill
- project-trackingSkill
- python-patternsSkill
- pytorch-patternsSkill
- react-patternsSkill
- researchSkill
- review-duplicationSkill
- security-reviewSkill
- seoSkill
- soap-webservicesSkill
- springboot-patternsSkill
- tdd-workflowSkill
- unitySkill
- web-accessibilitySkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Before any code work on a task, name the skill(s) and subagent(s) that own it and invoke them, or state "none apply" and why, as the first …
- Distinctive: line 14
Follow .agents/instructions/reply-rules.md when writing to the user.
- Very specific: line 34
Every rule fires only on a caller positively identified as the main thread.
- Very specific: line 40
No MCP tool is gated, and playwright and chrome-devtools in .mcp.json can write local files.
- Very specific: line 63
Every hook runs on -S -E under python3, falling back to python.
- Very specific: line 64
No hook uses argparse, which exits 2 on a usage error.
- Distinctive: line 66
Every wiring moves to the project root before it calls a hook, and forces a zero exit where its format allows, so a missing script allows.
- Distinctive: line 88
Every wiring that can reach a subagent injects the subagent text and never the reminder.
- Distinctive: line 95
Test detail is in sandbox-agent/README.md.
- Very specific: line 188
There is no lock file: Every version in tools/pyproject.toml is an exact pin, and --group needs pip 25.1 or newer.
- Very specific: line 233
A skill: create .agents/skills/<name>/SKILL.md, with depth in references/.
- Very specific: line 241
An MCP server: add the block to all five MCP files (the ones listed under Repo conventions), document it in docs/MCP_SETUP.md, and bump the …
- Distinctive: line 273
Simplicity first: Write the minimum that solves the problem.
- Distinctive: line 285
Number every question: Every question put to the user is numbered, one continuous sequence per conversation, subpoints like 13.1.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
Instructions for agents working on agent-standards itself. This file is never shipped. Consumers get
AGENTS.md.example, the only .example file, because every other configuration file ships
unchanged.
Required opening move
Before any code work on a task, name the skill(s) and subagent(s) that own it and invoke them, or state "none apply" and why, as the first line of your reply. This is a hard gate.
Follow .agents/instructions/reply-rules.md when writing to the user. Name skills and ownership in the footer status tail it defines, never as the reply first line.
The gate is enforcing, not advisory. One shared rule in .agents/hooks/preflight_gate.py decides every tool call, on every agent:
- It denies the main thread a write of any file inside the repository, by any tool or shell, with no exemption for
markdown, configuration, or documentation, and tells it to delegate the change instead. The repository is the
process working directory, the project root the payload names in
cwd, and the gate's own project two folders up. A write outside it, a write to the null device, a write totasks.mdat the project root, and git branch switching stay allowed. How the gate places a path and reads commands, wrappers and inline code is in docs/agent-compatibility.md under "Hook enforcement". - It denies any tool call, not only an edit, from a subagent whose own definition declares no skills, because that
agent is not a specialist. The rule reads
agent_typeout of the payload and looks the definition up in the six agent trees, so an unknown or unreadableagent_typeallows rather than denies. - It denies the main thread a web fetch or web search tool on Claude Code, the one format whose tool names are confirmed. Codex has no confirmed tool name for this yet. The main thread spawns a subagent to do the research.
- It denies the main thread running a script or a module, because the gate cannot see what a script writes, unless
the command passes
MAIN_THREAD_ALLOWLISTin the gate or an entry of the project's ownmain-thread-allowlist.txt. The rules are in docs/GLOBAL_SETUP.md under "What the main thread may run". This repository's own checks sit in main-thread-allowlist.txt, which never ships. - Every rule fires only on a caller positively identified as the main thread. Claude Code and Codex send
agent_idonly inside a subagent. An unknown caller is allowed: GitHub Copilot on every call, and an OpenCode or Kilo Code call whose session the plugin could not read. - It fails open: a parse error, a missing key, an unexpected payload, an unknown
--format, or a top-level command it cannot lex allows the call. The exception is a path or write target the gate cannot place, such as the$finrm $f, which denies on the main thread. The list is in docs/agent-compatibility.md. - No MCP tool is gated, and
playwrightandchrome-devtoolsin .mcp.json can write local files. The vendor quotes are in docs/agent-compatibility.md. - Known limits of the write rule, accepted rather than open: a write form the gate does not know passes, a top-level command it cannot parse allows, MCP tools are not gated, code run by an allowlisted tool is trusted rather than read, Copilot's main thread is not gated, the risky variable and option lists come from knowledge rather than vendor documentation, and a loopback share whose folder cannot be determined denies. Re-audit only when the rule changes, and record a new limit here rather than chasing it.
Each agent wires that one script, and the hooks beside it, to its own hook surface. The events per surface are in docs/agent-compatibility.md.
| Agent | Wiring | Gate matcher |
| Claude Code | .claude/settings.json | ^(Edit|Write|MultiEdit|NotebookEdit|Bash|PowerShell|WebFetch|WebSearch)$ |
| Codex | inline [[hooks.*]] tables in .codex/config.toml | ^(Bash|shell|apply_patch|Edit|Write|NotebookEdit)$ |
| OpenCode and Kilo Code | .agents/plugin/hooks.js, declared once by path in the plugin array of opencode.json, which both tools read | none, every tool call |
| GitHub Copilot | .github/hooks/preflight.json | bash|powershell|create|edit|apply_patch |
Per-surface details worth knowing before you touch any of them:
- Claude Code's
SessionStartalso injects the subagent supervision text, plain context with no script behind it. docs/GLOBAL_SETUP.md and sandbox-agent/setup-global.sh carry it word for word. - Every hook runs on
-S -Eunderpython3, falling back topython. - No hook uses
argparse, which exits 2 on a usage error. Two is the deny code in the plain format, so a stray flag would read as a block. Each hook scanssys.argvby hand instead and treats an unknown flag as an allow. - Every wiring moves to the project root before it calls a hook, and forces a zero exit where its format allows, so a
missing script allows. A session started in a subdirectory once denied every call, because Python exits 2 on a
file it cannot open. Codex's
commandWindowsruns under PowerShell and ends in; exit 0, because Windows PowerShell 5.1 has no||. The plugin cannot force a zero exit, so it drops a hook file it cannot open. - Claude Code runs every command hook in shell form, Git Bash on Windows
(
https://code.claude.com/docs/en/hooks#exec-form-and-shell-form, measured on 2.1.281). Without Git Bash every Claude hook fails to parse and allows, so the setup docs require Git for Windows. - The Claude Code matcher names
PowerShellbesideBash, because on Windows "A hook that matches onlyBashnever fires there" (https://code.claude.com/docs/en/hooks#powershell). - Codex hooks live inline in
.codex/config.toml. Codex warns when one layer also carries ahooks.json, so.codex/hooks.jsondoes not exist. - Copilot hooks are no longer CLI-only. They run in VS Code and in JetBrains as well, from the same
.github/hooks/path. Event names are camelCase, and a hook entry carriesbashandpowershellas sibling string fields next totype, not a nestedcommandobject. A nested one is silently ignored, which leaves that surface ungated. - The Copilot CLI also runs the hooks in
.claude/settings.json, with a Claude-shaped payload and noagent_id. The gate reads a claude-format call carryingCOPILOT_CLI=1and notranscript_pathas an unknown caller. Do not widen the Claude matcher to Copilot's tool names. The measurements are in docs/hooks-contract.md. - The formatting checker fixes what it can on every surface that can rewrite the display, and blocks only on what is left. Detail is in docs/hooks-contract.md.
- OpenCode and Kilo Code run every hook directly in .agents/hooks/ on every
tool.execute.before, through the plugin runner. Adding a hook file is the whole registration step. The contract is in docs/hooks-contract.md. - Every wiring that can reach a subagent injects the subagent text and never the reminder. The per-agent evidence is in docs/hooks-contract.md.
- Copilot gets the reminder on every prompt from
userPromptTransformedthrough .agents/hooks/copilot/prompt_reminder.py, which sits in a subdirectory so the OpenCode and Kilo Code runner skips it. - sandbox-agent/live/ proves the wiring against a real model, run by the manual live workflow
under Repo conventions. On Copilot, tests 1 and 2 can report
KNOWN-GAP, as the Maintenance follow-ups record. Test detail is in sandbox-agent/README.md.
Verified against Claude Code 2.1.281, Codex 0.156.1, OpenCode 1.18.32, and Kilo Code 7.7.9. GitHub Copilot CLI was last verified on 1.0.81 and is not installed here, so nothing above was re-measured against it.
What this repo is
agent-standards is a single source of AI-agent configuration (skills, subagents, MCP servers, preflight hooks, shared
instructions) imported into other projects via Git selective checkout. Consumer projects pull production-ready folders
and pull updates with one git fetch. The canonical subagents/ source and the tools/ generator
stay here and are never imported downstream.
The load-bearing distinction is canonical vs generated. Some trees are hand-edited here, some are emitted by a script and must never be hand-edited, and some are symlinks the generator creates and repairs.
| Tree | Status | How to edit |
subagents/*.md | canonical | edit directly, then regenerate |
.agents/skills/*/SKILL.md and its references/*.md | canonical | edit directly, keep the manifest short and the depth in references/ |
.agents/hooks/preflight_gate.py, .agents/hooks/no_ai_markers_check.py, .agents/hooks/task_list_sync.py, .agents/hooks/markdown_lint_check.py, .agents/hooks/question_numbering_check.py, .agents/hooks/status_block_check.py, .agents/hooks/copilot/prompt_reminder.py | canonical | edit directly, then run the pytest suite |
tasks.md | runtime state, git-ignored | written by the hook and by the model, never committed |
.agents/plugin/hooks.js | canonical | edit directly |
AGENTS.md.example, docs/*.md | canonical | edit directly |
tools/*.py, tools/tests/*.py, tools/pyproject.toml | canonical | edit directly, then run the pytest suite |
global/bin/update-global.sh, global/bin/update-global.ps1 | canonical, shipped only by the global install to ~/.agents/bin | edit both together, then run python -m pytest tools/tests/test_update_global.py |
main-thread-allowlist.txt | canonical, this repo only, never shipped | edit directly, then run python -m pytest tools/ |
.claude/agents/*.md | generated (Claude front matter with a skills key) | never hand-edit, run the generator |
.agents/agents/*.md | generated (OpenCode format) | never hand-edit, run the generator |
.codex/agents/*.toml | generated (Codex TOML) | never hand-edit, run the generator |
.github/agents/*.agent.md | generated (Copilot *.agent.md) | never hand-edit, run the generator |
.opencode/agents, .kilo/agents | symlinks to ../.agents/agents | created and repaired by the generator |
.claude/skills | symlink to ../.agents/skills | never edit through the link |
The generated subagent trees are per tool because no shared subagent format exists.
Regenerate the subagent trees and repair the symlinks after any subagents/*.md change:
python tools/gen_subagents.pyOn Windows, turn on Developer Mode and set the Git option below before cloning, or every symlink checks out as a plain text file:
git config core.symlinks trueFull layout reference: docs/repository-layout.md. Which agent reads which part of
.agents/ is in docs/agent-compatibility.md. This repo does not use OpenSpec
itself. The OpenSpec sections in the .example are for consumers.
Repo conventions
On top of the global rules in ~/.claude/CLAUDE.md:
- The consumer boundary is the filename case. A consumer receives exactly two kinds of thing: the agent
configuration files the import pulls, and the UPPERCASE-named markdown documents under
docs/. Every lowercase document underdocs/is ours and never ships. README.md is the one uppercase file that stays here. e2e/, sandbox-agent/, subagents/, and tools/ are test and build material and never reach a consumer, so no shipped document may link into them. A shipped document linking to a lowercase one is the same defect: the link resolves here and 404s there. global/ ships only through the global install in docs/GLOBAL_SETUP.md, which copies global/bin/ to~/.agents/bin, and never through a project import, so no project-import pathspec may name it. main-thread-allowlist.txt is this repository's own and never ships by either route. - Markdown lint. tools/check-markdown.py checks
README.md,AGENTS.md.example,docs/*.md,.agents/skills/**/*.mdandsubagents/*.mdfor dashes, prose lines over 120 characters, level-2 headings, and skill and subagent front matter. ThisAGENTS.mdis out of scope, but match the style anyway. - One runnable command per fenced code block in any doc a human copies, with the matching language tag and no
#comment lines inside the block (global rule). - One server set, one schema per file. Change all five MCP files together: .mcp.json for Claude
Code, opencode.json for OpenCode and Kilo Code, .codex/config.toml for Codex,
.vscode/mcp.json for Copilot in VS Code, and .github/mcp.json for the
Copilot CLI. Only the top-level key, the
typevalue, and the environment-variable syntax differ. Why the CLI has its own file, and why.mcp.jsonstill shadows it, is in docs/MCP_SETUP.md. The per-surface matrix is in docs/agent-compatibility.md. - No substitution token may appear in opencode.json. Kilo Code rejects the whole file on a
{env:VAR}, which drops the MCP block and thepluginarray that declares the gate. Local servers inherit the environment instead, andcontext7ships with noheadersblock. The detail is in docs/MCP_SETUP.md and nowhere else. - One gate, one rule, one wording. A behaviour change is a change to .agents/hooks/preflight_gate.py plus a case in tools/tests/test_preflight_gate.py, never a second copy of the logic. The per-surface reminder text, where a surface still injects one, is kept in that surface's own wiring file, and tools/tests/test_prompt_reminder.py compares every copy to its canonical source.
- One tail, one check, one wording. .agents/instructions/reply-rules.md, .agents/hooks/status_block_check.py and its tests ship as one consistent set with no conflicts, and the hook is the enforcement.
- The tooling is a package under tools/. tools/pyproject.toml is the only place a dependency or a version is written by hand, and it holds the pytest configuration too.
- There is no lock file. Every version in tools/pyproject.toml is an exact pin, and
--groupneeds pip 25.1 or newer. - CI runs on every pull request and every push to
master, with three parallel jobs:actionlint,validatefor the local checks below, andsandboxfor the containerised suite. Verify locally before you push. - .github/workflows/agent-live-tests.yml is a separate workflow and never
part of CI. Its only trigger is
workflow_dispatch, so no push and no pull request ever starts it. It needs two repository secrets, because it drives each agent against a real model:REQUESTY_API_KEYfor Claude Code, OpenCode and Kilo Code on Requesty, andOPENAI_API_KEYfor Codex and GitHub Copilot on OpenAI's own API withgpt-6-luna. Each job receives only the key its agent needs. Every run spends money on those keys. Start it only with the user's explicit approval for that one run.
Local verification (the same checks CI runs). Install the pinned dependencies first, with pip 25.1 or newer:
pip install ./tools --group ./tools/pyproject.toml:devpython tools/gen_subagents.py --checkpython tools/check-markdown.pypython tools/check-badges.pypython -m pytest tools/python -c "import json; [json.load(open(f)) for f in ['.mcp.json','opencode.json','.vscode/mcp.json','.github/mcp.json','.claude/settings.json','.github/hooks/preflight.json']]"python -c "import tomllib; tomllib.load(open('.codex/config.toml','rb'))"Adding or changing things
- A skill: create
.agents/skills/<name>/SKILL.md, with depth inreferences/. No wiring is needed. The front matter carriesname,description, and optionallylicense,compatibilityormetadata(https://agentskills.io/specification). Write the description in trigger form: what it covers, the phrases a user says, and what it is not for. Prefer one hub with a reference file per topic. Bump the skill-count badge in README.md. - A subagent: edit
subagents/<name>.md, run the generator, and commit the source and the four generated trees together. The generator rejects a skill with no folder, an unknown tool, and an unknown model. Bump the subagent-count badge. - An MCP server: add the block to all five MCP files (the ones listed under Repo conventions), document it in docs/MCP_SETUP.md, and bump the MCP-count badge.
- A shipped document: name it in UPPERCASE under
docs/, add its path to everygit checkout agent-standards/master --pathspec that delivers documents (the Quickstart and all five per-agent blocks in README.md, the import in docs/AGENT_TOOLING.md, and both shell sections of docs/AGENTS-UPDATE.md), and list it under Shipped in the README docs map. A document a consumer cannot pull is not shipped, whatever its name says. - A gate rule: edit .agents/hooks/preflight_gate.py, add the case to tools/tests/test_preflight_gate.py, and leave the wiring files alone unless the hook surface itself changed. A wiring change also needs the containerised sandbox in sandbox-agent/.
Subagents and skills
For this repo specifically: agent-engineer owns the agent configuration itself, which is every skill, every subagent
definition, every hook wiring, every MCP server block, and this file. It is also the agent the main thread hands web
research to, because the gate denies the main thread a web fetch or web search directly. markdown-writer owns doc
work, python-patterns owns the generator, the hook scripts, and the lint scripts,
code-reviewer runs before any merge, and bash and powershell own the update scripts in
docs/AGENTS-UPDATE.md.
Working Principles
Apply these to every task, in order. They govern how you work, and the coding-standards skill governs what the code
should look like.
- Think before coding. State assumptions. When the prompt is ambiguous, surface the interpretations and ask rather than silently picking one. Propose a simpler approach if one exists.
- Simplicity first. Write the minimum that solves the problem. No unrequested features, abstractions, or configurability. If 200 lines could be 50, rewrite it.
- Surgical changes. Touch only what the task requires. Do not "improve" adjacent code or reformat untouched lines. Match existing style. Remove only the imports and helpers your own change orphans.
- Goal-driven execution. Convert vague asks into verifiable checks, state the plan, then loop until each check passes. Do not claim a task is done without running the verification.
- Live progress by tool, not prose. For any task with more than one step, create a todo list with the
todowrite tool and keep it current at every step. For long-running work, start a session goal with the goal
tool so the mobile app and widgets show live state. Use the notify_user tool only when the user must act
right now. The status tail at the end of every reply follows
.agents/instructions/reply-rules.md: one
Running:line per live agent, State in its own fenced block, andWaiting on:last. - Number every question. Every question put to the user is numbered, one continuous sequence per conversation, subpoints like 13.1. The question_numbering_check hook denies the next tool call when a reply carries an unnumbered question.
Maintenance follow-ups
- Copilot
userPromptTransformedis documented only for the CLI and the cloud agent (https://docs.github.com/en/copilot/reference/hooks-reference). Confirm that VS Code and JetBrains fire it, or at least tolerate the entry, and record the result here. - The Copilot
preToolUsepayload carries no agent identifier. The gate therefore cannot tell a Copilot subagent from the main thread, and no rule ever fires on that surface. Recheck the hooks reference for an agent identifier and pass it with--subagentfrom .github/hooks/preflight.json when one lands. In the same change setGATE_KNOWN_GAP=0in sandbox-agent/live/copilot.sh, so live test 1 has to pass there. - The Copilot CLI tells every custom subagent not to write files. Copilot CLI 1.0.81 appends
**CRITICAL: Do NOT write output to files.**to a custom subagent's system prompt, and in live run 36176881215 the subagent wrote nothing. Live test 2 reportsKNOWN-GAPfor it throughSUBAGENT_NO_WRITE_MARKERin sandbox-agent/live/copilot.sh. Recheck each CLI release, and remove that marker in the same change that sees the block gone. - Codex runs the formatting check on
Stop, but whether thatStopcan reject a reply is not measured. Confirm it and say so plainly here. The markdown lint stays Claude-only, because Codex has no post-tool event. - JetBrains Copilot MCP is global-only and officially undocumented. The plugin reads MCP from
~/.config/github-copilot/intellij/mcp.json. There is no per-project MCP file, and GitHub documents only the in-IDE UI rather than the path, so no JetBrains MCP file ships here. Recheck whether GitHub adds a documented per-project path (https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp/extend-copilot-chat-with-mcp) and ship one if it lands.
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.

