amplifier-docs / user_guide
AGENTS.md5 starsChanged 5 months agoMITView on GitHub
Specialized sub-agents for focused tasks
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,439 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.
The file
We split this agents.md into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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 55
When you invoke an agent:
- Distinctive: line 68
Curated tools: - Only the tools needed for their specific tasks
- Very specific: line 113
No preference — session default (resolved from the general role)
- Very specific: line 115
If both model_role and provider_preferences are provided in the same call, provider_preferences wins.
- Distinctive: line 318
Check the agent file syntax (YAML frontmatter + markdown)
- Distinctive: line 319
Ensure required tools are available
- Distinctive: line 324
Check for name collisions in search paths
- Very specific: line 326
Use amplifier agent show <name> to verify which agent will be used
≈ “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
Agents
Agents are specialized configurations that can be invoked as sub-sessions for focused tasks. Each agent has its own tools, system instructions, and capabilities.
Built-in Agents
| Agent | Purpose | Best For |
explorer | Deep codebase exploration and reconnaissance | Understanding new codebases |
bug-hunter | Systematic debugging | Finding and fixing bugs |
zen-architect | System design with simplicity | Architecture decisions |
modular-builder | Code implementation | Writing new code |
security-guardian | Security review and auditing | Pre-deployment security checks |
test-coverage | Test coverage analysis | Identifying test gaps |
foundation-expert | Foundation ecosystem navigation and guidance | Finding examples, patterns, and concepts |
post-task-cleanup | Post-task codebase hygiene | Cleaning up after task completion |
Using Agents
In Interactive Mode
Agents are invoked automatically by the AI when you describe a task that matches an agent's expertise. The system uses the tool-task module to delegate to the appropriate agent:
amplifier
amplifier> What is the architecture of this project?
# → AI delegates to explorer agent via task tool
amplifier> Find issues in the authentication module
# → AI delegates to bug-hunter agent via task tool
amplifier> Design a caching system
# → AI delegates to zen-architect agent via task toolList Available Agents
amplifier agent listShow Agent Details
amplifier agent show explorerHow Agents Work
When you invoke an agent:
- A sub-session is created with the agent's configuration
- The agent inherits base settings from your current session
- The agent executes with its specialized tools and instructions
- Results are returned to your main session
- The sub-session state is preserved for potential resumption
Agent Configuration
Agents are bundles (using the same file format as regular bundles) with:
- Specialized instructions - Domain expertise and operating procedures
- Curated tools - Only the tools needed for their specific tasks
- Provider preferences - Optimal model selections for their work
- Model role - Declared model role preference (e.g.,
reasoning,general) resolved via routing matrix - Context loading - Heavy documentation loaded only when the agent runs
Agent Delegation Patterns
Context Sink Pattern
Agents serve as context sinks - they carry heavy documentation that would bloat your main session if always loaded.
Benefits:
- Main session stays lightweight
- Agent consumes tokens doing specialized work
- Results return with minimal context overhead
- Critical strategy for long-running sessions
Tool Inheritance
Agents inherit tools from your main session, with optional filtering via spawn policies:
# In bundle configuration
spawn:
exclude_tools: [tool-task] # Agents inherit all tools EXCEPT theseThis prevents delegation loops (agents delegating to other agents).
Model Role Override
Agents can declare a preferred model role in their frontmatter:
model_role: reasoning # Single role
# or
model_role: [reasoning, general] # Multiple roles with fallbackThe routing matrix resolves the role to a concrete provider/model. The caller can override this per-delegation.
Precedence (highest to lowest):
provider_preferenceson the delegation callmodel_roleon the delegation call- Agent's declared
model_rolein frontmatter - No preference — session default (resolved from the
generalrole)
If both model_role and provider_preferences are provided in the same call, provider_preferences wins.
Available roles:
| Role | Use for |
general | Versatile catch-all, no specialization needed |
fast | Quick parsing, classification, file ops, bulk work |
coding | Code generation, implementation, debugging |
ui-coding | Frontend/UI code — components, layouts, styling, spatial reasoning |
security-audit | Vulnerability assessment, attack surface analysis, code auditing |
reasoning | Deep architectural reasoning, system design, complex multi-step analysis |
critique | Analytical evaluation — finding flaws in existing work |
creative | Design direction, aesthetic judgment, high-quality creative output |
writing | Long-form content — documentation, marketing, case studies, storytelling |
research | Deep investigation, information synthesis across multiple sources |
vision | Understanding visual input — screenshots, diagrams, UI mockups |
image-gen | Image generation, visual mockup creation, visual ideation |
critical-ops | High-reliability operational tasks — infrastructure, orchestration |
Agent Search Paths
Agents are discovered from multiple locations (first-match-wins):
- Environment variables -
AMPLIFIER_AGENT_<NAME>for testing - User directory -
~/.amplifier/agents/for personal overrides - Project directory -
.amplifier/agents/for project-specific agents - Bundle agents - Agents included in your active bundles
Example: Testing an agent modification:
export AMPLIFIER_AGENT_ZEN_ARCHITECT=~/test-zen.md
amplifier run "design system" # Uses test versionCommon Agent Workflows
Exploration → Architecture → Implementation
amplifier
# First, understand the codebase
amplifier> Survey the authentication system
# → delegates to explorer agent
# Design the changes
amplifier> Design improvements to the auth system
# → delegates to zen-architect agent
# Implement
amplifier> Implement the auth improvements from the spec
# → delegates to modular-builder agentBug Hunting → Fix → Review
# Find the issue
amplifier> Debug the login timeout issue
# → delegates to bug-hunter agent
# Review the fix
amplifier> Review the authentication fix for vulnerabilities
# → delegates to security-guardian agentResearch → Design → Build
# Design the solution
amplifier> Design a rate limiting system
# → delegates to zen-architect agent
# Implement
amplifier> Build the rate limiter from the spec
# → delegates to modular-builder agentCreating Custom Agents
Agents are bundles - they use the same file format and composition model. To create a custom agent:
- Create an agent file (markdown with YAML frontmatter):
---
meta:
name: my-agent
description: "Clear description with WHY, WHEN, WHAT, HOW"
model_role: general # Optional: semantic role for model selection
tools:
- module: tool-filesystem
- module: tool-search
---
# My Agent Instructions
Your agent's system instructions here...- Place in search path:
- User-wide:
~/.amplifier/agents/my-agent.md - Project-specific:
.amplifier/agents/my-agent.md
- User-wide:
- Invoke: The AI will automatically delegate to your agent when the task matches its description
Agent Description Requirements
The meta.description field is critical - it's how the system matches requests to agents. Include:
- WHY: Value proposition (what problem it solves)
- WHEN: Activation triggers (when to use this agent)
- WHAT: Domain concepts and capabilities
- HOW: Examples with context/user/assistant/commentary
See Also: Bundle Guide - Agent Authoring
Multi-Turn Agent Conversations
Agents support multi-turn conversations through automatic state persistence:
amplifier> Survey the API endpoints
# → delegates to explorer agent, completes first task
amplifier> Now check which endpoints handle authentication
# → explorer agent resumes with previous contextThe system automatically:
- Persists agent sub-session state after each execution
- Restores conversation history on subsequent invocations
- Maintains the same configuration and tools
Agent Tool Access
LSP (Language Server Protocol)
Several agents have access to LSP for semantic code intelligence:
explorer- Understands code structure semanticallyzen-architect- Analyzes dependencies and contractspython-dev:code-intel- Python-specific semantic analysis
LSP provides:
hover- Type signatures and documentationgoToDefinition- Jump to implementationfindReferences- Find all usages of a symbolincomingCalls/outgoingCalls- Trace call graphs
This enables agents to understand code relationships beyond text search.
Tips
When to Delegate
- Complex tasks requiring specialized expertise
- Context-heavy work that would bloat your main session
- Multi-step workflows where each step needs focused attention
- Domain-specific tasks where an expert agent exists
When NOT to Delegate
- Simple queries you can answer directly
- Quick file reads or edits
- Tasks requiring main session context that agents won't have
Efficient Delegation
# ✅ Good: Specific task with clear scope
amplifier> Find all authentication-related files in src/
# ❌ Less effective: Vague request
amplifier> Look around
# ✅ Good: Clear design objective
amplifier> Design a caching layer for the API
# ❌ Less effective: Open-ended
amplifier> Make things betterTroubleshooting
Agent Not Found
# Check available agents
amplifier agent list
# Check search paths (in order):
# 1. $AMPLIFIER_AGENT_<NAME>
# 2. ~/.amplifier/agents/
# 3. .amplifier/agents/
# 4. Bundle agentsAgent Fails to Execute
- Check the agent file syntax (YAML frontmatter + markdown)
- Ensure required tools are available
- Review agent logs in session events
Wrong Agent Invoked
- Check for name collisions in search paths
- More specific agents in higher-priority paths override bundled agents
- Use
amplifier agent show <name>to verify which agent will be used
Advanced: Agent Composition
Since agents ARE bundles, they use the same file format and composition model as regular bundles:
# custom-agent.md
---
meta:
name: custom-agent
description: "My specialized agent"
model_role: general
tools:
- module: tool-filesystem
- module: tool-search
---
# Custom Agent
Specialized instructions...See Also: Bundle System Documentation
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.

