Create Agent Skill
This skill guides you through creating a well-structured Claude agent with proper frontmatter, system prompt, and examples.
When to Use This Skill
Activate this skill when the user wants to:
- Create a new Claude agent
- Customize Claude's behavior for specific tasks
- Structure an agent definition file
- Understand agent components (frontmatter, prompts, examples)
Agent Creation Workflow
1. Understand Agent Purpose
Ask the user (or infer from context):
- What is the agent's primary role/expertise?
- What specific tasks should it handle?
- Does it need to be read-only or can it write files?
- What level of capability is needed? (quick responses vs deep analysis)
2. Determine Agent Configuration
Model Selection:
opus - Complex reasoning, deep analysis, architectural decisions
sonnet - Balanced tasks, code review, general development (most common)
haiku - Quick responses, simple tasks, high volume
Tool Selection (based on agent role):
- Read-only agents: Read, Grep, Glob
- Research agents: + mcp__context7__*, mcp__exa__*, WebSearch, WebFetch
- Code agents: + Write, Edit, mcp__ide__*, mcp__lsp-api__*
- Review agents: + mcp__ide__getDiagnostics, mcp__github__*
- Interactive agents: + AskUserQuestion, TodoWrite
Color Selection (for UI identification):
cyan - Architecture/design
purple - Code review/quality
green - Testing/verification
blue - Documentation/writing
red - Debugging/troubleshooting
yellow - Research/exploration
3. Generate Agent File
Create a markdown file with this structure:
---
name: descriptive-name
description: Brief 1-2 sentence description of when to use this agent
model: sonnet
color: purple
tools:
- Read
- Grep
- Glob
- [additional tools as needed]
---
# Role: [Agent Name]
[2-3 sentence description of agent's role and expertise]
## Core Responsibilities
1. **[Responsibility 1]** - [Description]
2. **[Responsibility 2]** - [Description]
3. **[Responsibility 3]** - [Description]
## [Methodology/Process Section]
[Detailed instructions on how the agent should approach tasks]
## Success Criteria
A successful [outcome] should:
- [ ] [Criterion 1]
- [ ] [Criterion 2]
- [ ] [Criterion 3]
4. Validation Checklist
Before saving, verify:
Agent File Naming
Save agent files as:
.claude/agents/[name].md (for local project)
- Or in your agent package's
templates/claude/agents/ directory
Use descriptive names that match the name field in frontmatter.
Quick Start Templates
For common agent types, consider using these templates as starting points:
templates/basic-agent.md - Generic structure
templates/research-agent.md - Read-only with research tools
templates/code-agent.md - Implementation with write access
templates/review-agent.md - Code review and quality
Access templates with: "Use the research agent template"
Reference Materials
For detailed information, consult:
reference.md - Complete agent structure documentation
examples.md - Real-world agent examples with pattern analysis
Tips for Effective Agents
- Be Specific: Clear, focused role beats general-purpose
- Match Model to Task: Don't use opus for simple tasks (cost consideration)
- Appropriate Tools: Only include tools agent actually needs
- Actionable Prompts: System prompt should give clear behavioral guidance
- Test with Examples: Try agent with realistic scenarios after creation
- Iterate: Refine based on actual usage patterns
Common Patterns
Read-Only Analysis Agent:
- Model: sonnet
- Tools: Read, Grep, Glob, mcp__context7__*
- Use case: Code review, documentation analysis
Implementation Agent:
- Model: sonnet or opus
- Tools: Read, Write, Edit, Grep, Glob
- Use case: Feature development, refactoring
Research Agent:
- Model: sonnet
- Tools: Read, Grep, mcp__context7__*, mcp__exa__*, WebSearch
- Use case: Library research, best practices investigation
Interactive Planning Agent:
- Model: opus
- Tools: Read, Grep, Glob, AskUserQuestion, TodoWrite
- Use case: Architecture decisions, technical planning
Example Invocations
Here are examples of how users might request different agents:
- "Create a code review agent for TypeScript"
- "I need an agent that helps with system architecture"
- "Make a debugging agent for Go services"
- "Create a test-driven development agent"
- "Build an agent for API documentation"
For each request, determine the appropriate model, tools, and structure based on the patterns above.
1---2name: create-agent3description: Create well-formed Claude agents with proper YAML frontmatter, system prompts, and examples. Use when user wants to create a new agent, customize Claude behavior, or needs help structuring an agent definition.4---56# Create Agent Skill78This skill guides you through creating a well-structured Claude agent with proper frontmatter, system prompt, and examples.910## When to Use This Skill1112Activate this skill when the user wants to:13- Create a new Claude agent14- Customize Claude's behavior for specific tasks15- Structure an agent definition file16- Understand agent components (frontmatter, prompts, examples)1718## Agent Creation Workflow1920### 1. Understand Agent Purpose2122Ask the user (or infer from context):23- What is the agent's primary role/expertise?24- What specific tasks should it handle?25- Does it need to be read-only or can it write files?26- What level of capability is needed? (quick responses vs deep analysis)2728### 2. Determine Agent Configuration2930**Model Selection**:31- `opus` - Complex reasoning, deep analysis, architectural decisions32- `sonnet` - Balanced tasks, code review, general development (most common)33- `haiku` - Quick responses, simple tasks, high volume3435**Tool Selection** (based on agent role):36- **Read-only agents**: Read, Grep, Glob37- **Research agents**: + mcp__context7__*, mcp__exa__*, WebSearch, WebFetch38- **Code agents**: + Write, Edit, mcp__ide__*, mcp__lsp-api__*39- **Review agents**: + mcp__ide__getDiagnostics, mcp__github__*40- **Interactive agents**: + AskUserQuestion, TodoWrite4142**Color Selection** (for UI identification):43- `cyan` - Architecture/design44- `purple` - Code review/quality45- `green` - Testing/verification46- `blue` - Documentation/writing47- `red` - Debugging/troubleshooting48- `yellow` - Research/exploration4950### 3. Generate Agent File5152Create a markdown file with this structure:5354```markdown55---56name: descriptive-name57description: Brief 1-2 sentence description of when to use this agent58model: sonnet59color: purple60tools:61 - Read62 - Grep63 - Glob64 - [additional tools as needed]65---6667# Role: [Agent Name]6869[2-3 sentence description of agent's role and expertise]7071## Core Responsibilities72731. **[Responsibility 1]** - [Description]742. **[Responsibility 2]** - [Description]753. **[Responsibility 3]** - [Description]7677## [Methodology/Process Section]7879[Detailed instructions on how the agent should approach tasks]8081## Success Criteria8283A successful [outcome] should:84- [ ] [Criterion 1]85- [ ] [Criterion 2]86- [ ] [Criterion 3]87```8889### 4. Validation Checklist9091Before saving, verify:92- [ ] YAML frontmatter is valid (use triple dashes `---`)93- [ ] Name is lowercase with hyphens (e.g., `code-reviewer`)94- [ ] Description is concise and actionable (< 200 chars)95- [ ] Model is appropriate for task complexity96- [ ] Tools match agent capabilities97- [ ] System prompt defines clear role98- [ ] Core responsibilities are specific (not vague)99- [ ] Success criteria are measurable100101## Agent File Naming102103Save agent files as:104- `.claude/agents/[name].md` (for local project)105- Or in your agent package's `templates/claude/agents/` directory106107Use descriptive names that match the `name` field in frontmatter.108109## Quick Start Templates110111For common agent types, consider using these templates as starting points:112- `templates/basic-agent.md` - Generic structure113- `templates/research-agent.md` - Read-only with research tools114- `templates/code-agent.md` - Implementation with write access115- `templates/review-agent.md` - Code review and quality116117Access templates with: "Use the research agent template"118119## Reference Materials120121For detailed information, consult:122- `reference.md` - Complete agent structure documentation123- `examples.md` - Real-world agent examples with pattern analysis124125## Tips for Effective Agents1261271. **Be Specific**: Clear, focused role beats general-purpose1282. **Match Model to Task**: Don't use opus for simple tasks (cost consideration)1293. **Appropriate Tools**: Only include tools agent actually needs1304. **Actionable Prompts**: System prompt should give clear behavioral guidance1315. **Test with Examples**: Try agent with realistic scenarios after creation1326. **Iterate**: Refine based on actual usage patterns133134## Common Patterns135136**Read-Only Analysis Agent**:137- Model: sonnet138- Tools: Read, Grep, Glob, mcp__context7__*139- Use case: Code review, documentation analysis140141**Implementation Agent**:142- Model: sonnet or opus143- Tools: Read, Write, Edit, Grep, Glob144- Use case: Feature development, refactoring145146**Research Agent**:147- Model: sonnet148- Tools: Read, Grep, mcp__context7__*, mcp__exa__*, WebSearch149- Use case: Library research, best practices investigation150151**Interactive Planning Agent**:152- Model: opus153- Tools: Read, Grep, Glob, AskUserQuestion, TodoWrite154- Use case: Architecture decisions, technical planning155156## Example Invocations157158Here are examples of how users might request different agents:159160- "Create a code review agent for TypeScript"161- "I need an agent that helps with system architecture"162- "Make a debugging agent for Go services"163- "Create a test-driven development agent"164- "Build an agent for API documentation"165166For each request, determine the appropriate model, tools, and structure based on the patterns above.