agentic-workflow / references
AGENTS.md4 starsChanged 30 days agoMITView on GitHub
Subagents handle context-heavy subtasks for orchestrator skills. Each runs in isolated context, performs work, and returns results (or modifies files directly). The orchestrator's context window is limited. Loading a skill, conversation history, and project context already consumes significant space. If the orchestrator opens many files, runs extensive analysis, or generates verbose output, context fills up and quality degrades. Solution: Delegate heavy work to subagents. Each runs in isolated context, performs its task, and returns a structured result. The orchestrator receives…
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,774 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 repository48 other files it gives its agents.
- skills/dev-methodology/references/agents.mdAGENTS.md
- acceptance-protocolSkill
- agency-intakeSkill
- ai-visibility-methodologySkill
- banner-design-guideSkill
- benchmark-researchSkill
- brand-methodologySkill
- code-reviewingSkill
- code-writingSkill
- codex-bridgeSkill
- deploy-pipelineSkill
- design-assets-guideSkill
- design-system-methodologySkill
- design-task-decompositionSkill
- dev-methodologySkill
- docs-pipelineSkill
- documentation-writingSkill
- engagement-contractSkill
- engagement-protocolSkill
- feature-researchSkill
- human-voiceSkill
- infrastructure-setupSkill
- marketing-task-decompositionSkill
- post-deploy-qaSkill
- pre-deploy-qaSkill
- presentation-designSkill
- project-planningSkill
- prompt-engineeringSkill
- security-auditingSkill
- semantic-drift-methodologySkill
- seo-auditingSkill
- skill-authoringSkill
- skill-test-designSkill
- skill-testingSkill
- system-optimization-protocolSkill
- task-decompositionSkill
- tech-spec-planningSkill
- testing-methodologySkill
- ui-styling-guideSkill
- ui-ux-methodologySkill
- user-spec-planningSkill
- validation-pipelineSkill
- yandex-analytics-methodologySkill
- yandex-direct-guideSkill
- yandex-metrika-guideSkill
- yandex-search-guideSkill
- yandex-webmaster-guideSkill
- yandex-wordstat-guideSkill
The file
We split this agents.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If subagent needs more work → return to orchestrator → orchestrator launches another subagent.
- Distinctive: line 110
No methodology duplication — skill is single source of truth
- Very specific: line 154
All agents must have a color for visual identification.
- Very specific: line 209
After agent completes, orchestrator receives agentId.
≈ “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
Skill + Agent Pattern
Subagents handle context-heavy subtasks for orchestrator skills. Each runs in isolated context, performs work, and returns results (or modifies files directly).
Why Subagents
The orchestrator's context window is limited. Loading a skill, conversation history, and project context already consumes significant space. If the orchestrator opens many files, runs extensive analysis, or generates verbose output, context fills up and quality degrades.
Solution: Delegate heavy work to subagents. Each runs in isolated context, performs its task, and returns a structured result. The orchestrator receives only what it needs.
Impact: According to Anthropic research, multi-agent systems with Claude Opus orchestrator and Claude Sonnet subagents outperform single-agent Claude Opus by 90.2% on research tasks.
Orchestration Rules
Subagents cannot call other subagents — Claude Code supports only one level of orchestration. Nested calls fail silently:
Orchestrator (main skill)
├── code-reviewer (subagent) ✓
├── security-auditor (subagent) ✓
└── test-reviewer (subagent) ✓
code-reviewer
└── another-agent ✗ FORBIDDENIf subagent needs more work → return to orchestrator → orchestrator launches another subagent.
When to Use Subagents
| Task Type | Why Subagent Helps | Example |
| Reviews | Fresh context for objective assessment | code-reviewer, security-auditing |
| Research | Extensive file reading stays isolated | Exploring codebase, reading docs |
| Debugging | Isolated diagnosis without polluting main context | Error analysis, root cause |
| Validation | Schema/format checking with clean slate | skill-checker, schema-validator |
| Parallel work | Multiple independent directions | Research 3 modules simultaneously |
| High-volume output | Tests, logs don't bloat main context | Running test suite, log analysis |
Inline Agents (Ad-hoc Tasks)
For simple, one-off tasks — use Task tool with built-in subagent types:
Use Explore subagent to find all files related to authentication
Use general-purpose subagent to analyze the error and suggest fixes
Use Plan subagent to design implementation approach for {feature}The orchestrator calls Task tool with arbitrary prompt and subagent_type. No agent file needed.
Built-in subagent types:
Explore— fast codebase exploration, file search, pattern matchinggeneral-purpose— flexible tasks, research, analysisPlan— designing implementation approaches
When to use:
- Simple research/exploration
- One-off file operations
- Tasks under 50 lines of instructions
- No reuse needed
Dedicated Agents (Skill + Agent Pattern)
For complex, reusable tasks — create Skill + Agent pair:
- Skill — holds methodology (WHAT to do, HOW to analyze)
- Usable inline via
/skill-name - Contains knowledge
- Usable inline via
- Agent — adds isolation + output contract
- Uses
skills:to preload methodology - Defines output: JSON, file changes, or actions
- Runs in isolated context
- Uses
Example:
# skills/code-reviewing/SKILL.md — methodology
---
name: code-reviewing
description: Code review methodology and quality standards.
---
## What to Check
- Architecture, error handling, edge cases...
## Severity Levels
- Critical, Major, Minor...# agents/code-reviewer.md — isolation + format
---
name: code-reviewer
description: Review code quality after implementation.
color: blue
skills:
- code-reviewing # Full SKILL.md content loaded
allowed-tools: Read, Glob, Grep
---
Follow code-reviewing methodology.
## Output
{ "findings": [...], "summary": {...} }Benefits:
- Methodology usable inline (
/code-reviewing) OR in isolation (via agent) - Multiple agents can run in parallel
- No methodology duplication — skill is single source of truth
- Agent adds structure (output contract) without bloating skill
Agent File Format
Agent files use YAML frontmatter + Markdown body. Store in ~/.claude/agents/{name}.md.
---
name: agent-name
description: |
When Claude should delegate to this agent. Include:
- Purpose and capabilities
- Example triggers
- What NOT to use it for
color: blue
skills:
- methodology-skill
allowed-tools: Read, Glob, Grep
---
# Agent Instructions
## Input
[What the agent receives from the orchestrator]
## Process
[Step-by-step methodology — or reference preloaded skill]
## Output
[Output contract: JSON schema, file changes, or actions]Required Fields
| Field | Description |
name | Unique identifier (kebab-case) |
description | When/why to use — Claude reads this to decide delegation |
color | Badge color for visual identification (see below) |
skills | Skill(s) to preload — agent must have methodology from skill |
Color Recommendations
All agents must have a color for visual identification. Valid values: red, blue, green, yellow, purple, orange, pink, cyan.
| Color | Agent Type |
| blue/cyan | Analysis, review (code-reviewer, test-reviewer) |
| red | Security, critical (security-auditor) |
| yellow | Validation, caution (skill-checker, schema-validator) |
| green | Success-oriented, exploration (Explore) |
| purple/pink | Creative, generation, research |
| orange | Infrastructure, deployment |
Optional Fields
| Field | Default | Description |
model | inherit | Always use inherit to match orchestrator's model |
allowed-tools | All tools | Restrict to necessary tools (e.g., Read, Glob, Grep) |
permissionMode | default | Permission handling: default, acceptEdits, bypassPermissions, plan |
hooks | None | Lifecycle hooks for validation |
Output Contracts
Agents always return JSON report — even if they modify files or execute commands. Work is the process, output is the report.
Analysis agents — findings and recommendations:
{
"status": "approved" | "changes_required",
"findings": [...],
"summary": "..."
}Executor agents — report of changes made:
{
"status": "success" | "partial" | "failed",
"files_modified": ["path/to/file.ts", ...],
"files_created": ["path/to/new.ts", ...],
"summary": "Created 2 files, modified 3 files"
}Automation agents — report of actions taken:
{
"status": "success" | "failed",
"actions": ["ran tests", "deployed to staging"],
"results": {...},
"errors": []
}Resuming Agents
After agent completes, orchestrator receives agentId. Use it to continue work with same context:
Resume agent {agentId} to ask follow-up question about findingsWhen to resume:
- Need clarification on agent's findings
- Iterative refinement (agent found X, now do Y based on X)
When NOT to resume (start fresh):
- Different task, unrelated to previous
- Context would confuse agent
- Previous work is complete, new work begins
Writing Effective Descriptions
The description field is critical — Claude uses it to decide when to delegate. Include:
- Purpose — what the agent does
- Triggers — when to use (with examples)
- Exclusions — what NOT to use it for
Example from code-reviewer:
description: |
Use this agent when code has been written or modified and needs quality assessment.
**Examples of when to use:**
- After implementing a feature
- After refactoring code
- Before committing changes
**Proactive usage**: Invoke automatically after any code implementation task.Invoking from Skills
Reference agents by name in skill workflow:
## Post-work
1. **Run Reviews** (launch in parallel)
- `code-reviewer` — quality, architecture, patterns
- `security-auditing` — OWASP Top 10, vulnerabilities
2. **Process Findings**
Evaluate each finding on merit — severity is metadata, not a filter.
- Valid, improves result → apply (any severity)
- Disagree or uncertain → discuss with user
Log each finding with action taken.For agents needing specific input:
Use `code-reviewer` subagent with:
- files: {list of modified files}
- userspec: {user requirements document}
- techspec: {technical specifications}Best Practices
- Define clear output contract — JSON for analysis, file changes for executors
- Restrict tools — Most agents only need
Read, Glob, Grep - Use
model: inherit— Ensures maximum quality from orchestrator's model - Always preload skill — Agent must have methodology, not just output format
- Include examples in description — Helps Claude know when to invoke
- One level of orchestration — Subagents cannot call other subagents
Example Agents
See existing agents for full examples:
~/.claude/agents/code-reviewer.md— Detailed methodology with review dimensions~/.claude/agents/security-auditor.md— OWASP-based security analysis~/.claude/agents/skill-checker.md— Skill validation against standards
References
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.

