Switch language to English

Agents

Specialized AI agents for coding tasks. Define experts for your stack, design patterns, and workflows.

What are Agents?

Agents are specialized AI personas defined in markdown files. Each agent has expertise in specific domains and can delegate to other agents through handoff chains.

Location

~/.claude/agents/*.md

Global agents available everywhere

Project-Level

.claude/agents/*.md

Project-specific overrides

Agent Template

Agents use YAML frontmatter for metadata and markdown for detailed instructions.

architect.mdmarkdown
---
name: architect
description: System architecture expert for component design and patterns
model: opus
handoff: [nextjs, prisma, react]
skills: ["/component", "/page"]
memory: ["~/.claude/memory/patterns.json"]
mcps: [github, shadcn]
---

# Architect Agent

You are a system architecture expert specializing in:
- Component-driven modularity
- Mirror-pattern directory structure
- Prisma schema design
- Multi-tenant architecture

## When to Use
Use this agent when the user needs:
- Architectural guidance for new features
- Code structure reviews
- Component organization decisions

## Examples
<example>
Context: User needs to create a new feature
user: "I need to add user profile management"
assistant: Uses architect agent for structure guidance
</example>

Agent Categories

Organize agents by domain for easy discovery and delegation.

Agent Organizationmarkdown
| Category | Agents | Purpose |
|----------|--------|---------|
| **Stack** | nextjs, react, typescript, tailwind, prisma | Framework expertise |
| **Design** | orchestration, architecture, pattern | System design |
| **UI** | shadcn, atom, template, block | Component hierarchy |
| **DevOps** | build, deploy, test | Infrastructure |
| **VCS** | git, github | Version control |

Handoff Patterns

Agents can delegate tasks to other specialists through the handoff field.

orchestration.mdmarkdown
---
name: orchestration
handoff: [architecture, nextjs, prisma, react]
---

# Orchestration Agent (Master Coordinator)

When a task requires multiple domains:
1. Analyze the request
2. Delegate to specialized agents
3. Coordinate responses
4. Return unified solution

Handoff chain:
orchestration
├── architecture → pattern → structure
├── nextjs → react → typescript
└── prisma → database-optimizer

YAML Frontmatter Fields

FieldRequiredDescription
nameYesUnique identifier for the agent
descriptionYesWhen to invoke this agent
modelNoModel to use (opus, sonnet, haiku)
handoffNoArray of agents to delegate to
skillsNoArray of skill commands
memoryNoArray of memory file paths
mcpsNoArray of MCP servers to use