eng-kit / references
AGENTS.md1 starsChanged 13 days agoMITView on GitHub
A subagent is a role with its own context window, its own tools and a fixed report. Write one when isolation is the point; write a skill when the main agent should learn a technique. agents/<name>.md in a plugin, .claude/agents/ in a project, ~/.claude/agents/ for the user. Frontmatter, then the system prompt: Plugin agents can't set hooks, mcpServers or permissionMode; put hooks in the plugin's hooks/hooks.json. The user calls one explicitly with @agent-<plugin>:<name>. Check the current field list in the…
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,266 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 repository36 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- backend-servicesSkill
- brainstormingSkill
- changing-legacy-codeSkill
- choosing-a-stackSkill
- ci-quality-gatesSkill
- database-changesSkill
- desktop-developmentSkill
- dispatching-parallel-agentsSkill
- docsSkill
- executing-plansSkill
- finishSkill
- git-workflowSkill
- implementSkill
- kit-initSkill
- mobile-developmentSkill
- new-taskSkill
- observabilitySkill
- onboarding-existing-codebaseSkill
- payments-and-moneySkill
- pos-systemsSkill
- publishing-documentsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- security-reviewSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- ui-motionSkill
- updating-dependenciesSkill
- using-skillsSkill
- verification-before-completionSkill
- verifySkill
- web-frontendSkill
- writing-documentationSkill
- writing-plansSkill
- writing-skillsSkill
The file
We split this agents.md into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
Check the tool limits hold: ask the read-only agent to edit a file and confirm it can't.
- Distinctive: line 45
Check delegation: describe the task in plain words and see whether the main agent picks this agent.
≈ “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
Writing subagents
A subagent is a role with its own context window, its own tools and a fixed report. Write one when isolation is the point; write a skill when the main agent should learn a technique.
Agent or skill
| Need | Use |
| Know-how the main agent applies in its own context | a skill |
| Work whose transcript would flood the main context (search, review, a long investigation) | an agent |
| A fresh view that must not see the author's reasoning (review) | an agent |
| Narrower permissions than the session (read-only review, no network) | an agent |
| A self-contained task that returns one result | a skill with context: fork, or an agent |
Format
agents/<name>.md in a plugin, .claude/agents/ in a project, ~/.claude/agents/ for the user. Frontmatter, then the system prompt:
---
name: api-auditor # lowercase, hyphens
description: Read-only API auditor. Use after … to … # decides delegation
tools: Read, Grep, Glob, Bash # allowlist; omitted = every tool the session has
disallowedTools: Edit, Write # removed from what is inherited
model: opus # sonnet | opus | haiku | inherit | a full id
effort: xhigh
---Plugin agents can't set hooks, mcpServers or permissionMode; put hooks in the plugin's hooks/hooks.json. The user calls one explicitly with @agent-<plugin>:<name>. Check the current field list in the Claude Code sub-agents docs before using a field not shown here.
The prompt
- One responsibility. "Review a git range against its requirements", not "review and fix".
- Least privilege. Grant only the tools the role needs. A reviewer gets no edit tools; a researcher gets no shell. A shell can write files, so a read-only role that needs one also needs a hook or guard rule that limits its commands. Nesting (an agent dispatching agents) stays off unless the role is an orchestrator: leave
Agentout oftoolsor add it todisallowedTools. - Model by stakes: the most capable model for writing code, review, security and design judgment; a fast one for search and mechanical work.
- Self-contained input. The agent never sees the conversation. Its prompt says what it receives (task text, paths, ranges, commands) and what to do when something is missing: report
NEEDS_CONTEXT, don't guess. - A fixed report. End with machine-readable lines the caller or a hook can parse (a status word, a verdict, the SHAs reviewed) and a short human summary. Say what counts as evidence (commands run with their output,
file:line). Bound the report (at most N items, M words), say how many items were left out, and report a source it could not read instead of inventing one. - Boundaries. What it must never do (push, edit outside the task, weaken tests) and when it stops and returns.
Test it
- Dispatch it on a real task from this repo and on one with missing input. Check that the report has every required line and that missing input produces the stop status, not a guess.
- Check the tool limits hold: ask the read-only agent to edit a file and confirm it can't.
- Check delegation: describe the task in plain words and see whether the main agent picks this agent. Rewrite the description if it doesn't.
- A change to an agent's prompt or tools is reviewed like code; a hook that parses its report has a test with a sample report.
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.

