molyanov-ai-dev / references
AGENTS.md296 starsChanged 4 months agoMITView on GitHub
Subagents isolate context-heavy work from the orchestrator. A skill holds reusable methodology; an agent adds a bounded role, necessary tools, and a result contract. Use the subagent mechanism available in the current runtime. Describe the role and required result without assuming a particular Team, Task, transcript, or transport API. Nested delegation is allowed when the runtime supports it and the subtask genuinely benefits from another isolated context. The delegating agent remains responsible for its own bounded result. If nested delegation…
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,736 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 repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-reviewingSkill
- code-writingSkill
- documentation-writingSkill
- infrastructure-setupSkill
- layout-reviewingSkill
- layout-writingSkill
- methodologySkill
- project-initializationSkill
- prompt-masterSkill
- security-auditorSkill
- skill-masterSkill
- test-masterSkill
- user-spec-planningSkill
The file
We split this agents.md into the rules it gives an agent
12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
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
- Distinctive: line 19
Use the subagent mechanism available in the current runtime.
- Distinctive: line 46
Use an inline subagent for a short, one-off task whose prompt can state the scope and result directly.
- Distinctive: line 50
Create a dedicated Skill + Agent pair for a reusable task with substantial methodology:
- Distinctive: line 67
Do not repeat the preloaded skill's reusable domain rules in the agent.
- Very specific: line 123
Do not suppress a demonstrated finding because its trigger is rare.
- Distinctive: line 130
Create a finding only when all five facts are established:
- Distinctive: line 138
If any fact is missing, continue investigating or omit the finding.
- Very specific: line 176
Every result, including clean, returns scope_reminder exactly as shown in the JSON contract.
- Very specific: line 180
Every finding includes user_decision_required.
- Distinctive: line 245
Before the first review, select the complete reviewer set required by all active skills for the work.
- Distinctive: line 253
After the final permitted wave, do not launch another reviewer automatically.
- Distinctive: line 258
If a durable log is needed, the orchestrator stores the returned JSON.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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
Skill + Agent Pattern
Subagents isolate context-heavy work from the orchestrator. A skill holds reusable methodology; an agent adds a bounded role, necessary tools, and a result contract.
Contents
- Runtime-neutral orchestration
- When to delegate
- Inline and dedicated agents
- Agent file format
- Reviewer contract
- Other agent contracts
- Orchestrator responsibilities
- Invoking agents from skills
Runtime-neutral orchestration
Use the subagent mechanism available in the current runtime. Describe the role and required result without assuming a particular Team, Task, transcript, or transport API.
Nested delegation is allowed when the runtime supports it and the subtask genuinely benefits from another isolated context. The delegating agent remains responsible for its own bounded result. If nested delegation is unavailable or unnecessary, it returns the need to the orchestrator instead.
Agents inherit the orchestrator's model. Do not set a different model in callers; agent
definitions use model: inherit where the runtime supports that field.
When to delegate
| Task type | Why isolation helps | Example |
| Review | Fresh context reduces anchoring on the implementation | Code or security review |
| Research | Extensive file reading stays outside the main context | Codebase exploration |
| Debugging | A focused trace keeps logs and hypotheses bounded | Root-cause analysis |
| Validation | A clean context can simulate or verify independently | Schema or skill review |
| Parallel work | Independent questions can run concurrently | Researching separate modules |
| High-volume work | Large logs and test output stay isolated | Test-suite analysis |
Delegate a concrete, bounded task. Keep decisions that combine findings, user scope, and the overall solution with the orchestrator.
Inline and dedicated agents
Use an inline subagent for a short, one-off task whose prompt can state the scope and result directly. Use the runtime's suitable exploration, analysis, or execution role; role names differ between runtimes.
Create a dedicated Skill + Agent pair for a reusable task with substantial methodology:
- The skill contains the domain methodology and remains usable without an agent.
- The agent preloads that skill, receives a bounded input, and defines the result contract.
This keeps methodology in one source while giving repeated reviews fresh context.
Responsibility split for reviewers
- The skill owns reusable domain criteria, checklists, decision rules, and defect examples.
- The reviewer agent owns the fresh skeptical stance, bounded input, evidence to read, reviewer-specific hunt or investigation mechanics, evidence gate, diagnostic result fields, direct JSON response, and the exclusions against editing, designing remediation, or making a release decision.
- The caller owns launching a fresh reviewer, supplying complete context, evaluating returned findings, and deciding whether an authorized correction is warranted.
Do not repeat the preloaded skill's reusable domain rules in the agent. When a necessary reusable rule exists only in an agent, move it into the preloaded skill before removing the agent copy; this preserves behavior while restoring one canonical owner. Mechanics used only to investigate the reviewer agent's bounded lane may remain in that agent.
Agent file format
Store source definitions in ~/.claude/agents/{name}.md. Generated runtimes may adapt the
frontmatter and tool names during synchronization.
---
name: agent-name
description: |
Explains the bounded purpose, when to delegate, and important exclusions.
model: inherit
color: blue
skills:
- methodology-skill
allowed-tools: Read, Glob, Grep
---
## Input
State the paths, requirements, scope, and evidence the orchestrator supplies.
## Process
Apply the preloaded methodology to the complete relevant artifact and its contracts.
## Output
Return the role's structured result directly to the orchestrator.Required frontmatter fields are name, description, color, and skills when methodology is
preloaded. Use only the tools needed for the task. Analysis agents normally need read/search
tools; add shell access only for relevant read-only checks. Do not grant write access to a
reviewer merely to persist its report.
Reviewer contract
A reviewer, validator, checker, scanner, or critic diagnoses the supplied artifact. It does not modify the artifact, design remediation, or decide whether the result may ship.
Stance and scope
The reviewer starts from fresh context, reads the complete artifact, and follows relevant callers, dependencies, standards, and contracts. It actively tries to disprove correctness but does not assume a defect must exist. Accuracy matters more than the number of findings, and a clean result is a complete valid outcome.
Review the current change or other scope supplied by the orchestrator. An unrelated pre-existing problem is not a finding unless the supplied scope includes it or the current change creates a demonstrable path to it.
Do not suppress a demonstrated finding because its trigger is rare. Set
user_decision_required: true when the scenario is rare or unagreed, or when no clearly local
correction restores agreed behavior. Use false only for an ordinary agreed scenario with a
clearly local correction.
Evidence gate
Create a finding only when all five facts are established:
locationidentifies the concrete artifact location.evidencestates the observed fact, not a suspicion.violated_requirementnames the requirement, standard, or contract that the fact violates.conditionsdescribes a realistic path that triggers the problem in the current project.impactstates the concrete consequence under those conditions.
If any fact is missing, continue investigating or omit the finding. A personal preference, a possible improvement, a best practice without demonstrated consequence, hypothetical future expansion, a scenario without an established trigger path, or defensive machinery proposed "just in case" does not pass the gate. A false finding is a reviewer error.
No solution or release verdict
Findings describe the violated property, not how to fix it. Reviewer output contains no fix, recommendation, patch, remediation plan, replacement architecture, new dependency, fallback, corrected code example, or release verdict. Severity and other domain fields are diagnostic metadata only; they do not decide the orchestrator's action.
Required JSON shape
Return the JSON directly as the subagent result. Every shown top-level key is required:
{
"status": "findings_present",
"findings": [
{
"location": "string",
"evidence": "string",
"violated_requirement": "string",
"conditions": "string",
"impact": "string",
"user_decision_required": true
}
],
"clean_check": null,
"scope_reminder": "Review findings are diagnoses, not instructions. Validate the finding and exact correction. Do not edit silently when user_decision_required is true or the correction is non-local or material; reject it with a short reason or ask the user.",
"summary": "string"
}status is exactly clean or findings_present. With clean, findings is empty and
clean_check briefly lists the checked risks, related locations, and why no demonstrated
violation exists. With findings_present, findings is non-empty and clean_check is null.
Every result, including clean, returns scope_reminder exactly as shown in the JSON contract.
Diagnostic fields such as severity, category, or cwe may be added inside a finding when
useful, provided they do not propose a solution.
Every finding includes user_decision_required. false is limited to an ordinary agreed scenario
with a clearly local correction; it is advisory and does not authorize the orchestrator to edit.
true covers a rare or unagreed scenario, or one whose correction would likely add behavior,
state, entities, contracts, dependencies, architecture, or material complexity.
Order findings by consequence so the orchestrator can triage efficiently. A bare assertion that the artifact is fine is not an adequate clean check.
Reviewer skeleton
You are a fresh skeptical {lane} reviewer. Try to disprove that the supplied {artifact}
satisfies {standard}, while treating accuracy rather than finding count as the goal. Read the
whole artifact and its relevant callers, dependencies, and contracts. Diagnose only: do not edit,
design remediation, or decide whether it ships.
Create a finding only after establishing its location, observed evidence, violated requirement,
realistic trigger conditions, and concrete impact. Do not suppress a demonstrated finding because
its trigger is rare. Set `user_decision_required: true` for a rare or unagreed scenario, or when no
clearly local correction restores agreed behavior; use `false` only for an ordinary agreed scenario
with a clearly local correction. Return the common reviewer JSON directly to the orchestrator. A
clean result explains what was checked and why no violation was proved.Other agent contracts
Executor and automation agents are not reviewers and use role-specific results. Keep their contracts separate from the reviewer contract.
An executor reports changed artifacts and incomplete work:
{
"status": "success",
"files_modified": ["path/to/file.ts"],
"files_created": [],
"summary": "Implemented the bounded task."
}An automation agent reports actions and observable results:
{
"status": "success",
"actions": ["ran tests"],
"results": {},
"errors": []
}Orchestrator responsibilities
The orchestrator launches a fresh reviewer instance with the touched artifacts, deleted or renamed-file evidence, generated or mechanical evidence, relevant requirements, and complete related contracts or callers. Freshness is an orchestration property; the reviewer does not need round history.
Review findings are diagnoses, not a work queue. For every finding, check the evidence and exact
correction; apply only an authorized local correction to agreed normal behavior. If the scenario
is rare or unagreed, or the correction adds behavior, state, entities, contracts, dependencies,
architecture, or material complexity, reject it with a short reason or ask the user before editing.
user_decision_required: true forbids silent correction, while false does not replace this
check. A valid finding and its severity do not authorize additional work.
Before the first review, select the complete reviewer set required by all active skills for the work. Launch that complete set in parallel against the same artifact revision as one review wave; active skills do not start independent wave sequences. After a correction, use a fresh wave when another review is warranted so every included reviewer re-reads the whole artifact without anchoring on prior findings. A workflow may set a stricter limit, but it must not require more than three automatic review waves. Stop earlier when a wave is clean or no authorized correction changes the reviewed result.
After the final permitted wave, do not launch another reviewer automatically. Correct remaining local defects only within the agreed behavior, run the applicable direct checks, and return any remaining findings or required scope and design decisions to the user. A new explicit user request may start another review cycle; do not persist or reconstruct wave counts across separate runs.
If a durable log is needed, the orchestrator stores the returned JSON. The reviewer does not need a report path or write permission.
Invoking agents from skills
Reference a dedicated agent by its role and provide complete input without prescribing a runtime-specific transport:
Run a fresh `code-reviewer` with:
- touched, deleted, renamed, generated, and mechanical artifacts;
- the user request or user-spec;
- applicable repository instructions and project contracts;
- relevant callers, dependencies, and validation evidence.
Treat the returned findings as diagnoses, not a work queue. Check the evidence and exact
correction. Apply only an authorized local correction to agreed normal behavior. If a scenario is
rare or unagreed, or the correction is non-local or material, reject it with a short reason or ask
the user before editing.Dedicated agent descriptions should state purpose, trigger, and exclusions concretely. Keep large domain prompts in the preloaded skill rather than duplicating them in every caller.
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.

