Meta Agent
Creates complete, ready-to-use Claude Code subagent configuration files. This skill acts as an expert agent architect that analyzes requirements and generates properly structured subagent definitions with appropriate tools, prompts, and workflows.
Instructions
Prerequisites
- Understanding of the task or domain the subagent should handle
- Access to Claude Code documentation for latest features
.claude/agents/ directory for project-level agents (recommended)
Workflow
Get latest documentation:
Analyze the user's requirements:
- Understand the subagent's purpose and primary tasks
- Identify the domain or specialization
- Determine what tools will be needed
- Consider when this agent should be invoked
Generate the subagent name:
- Use kebab-case format (e.g.,
code-reviewer, api-tester)
- Make it descriptive but concise
- Ensure it clearly indicates the agent's purpose
- Must use only lowercase letters and hyphens
Select appropriate color:
- Choose from: red, blue, green, yellow, purple, orange, pink, cyan
- Use color to indicate agent type or domain:
- cyan/blue: technical/code tasks
- green: testing/validation
- yellow: documentation/analysis
- red: debugging/critical tasks
- purple: data/research tasks
Write the delegation description:
- This is CRITICAL for automatic delegation
- State clearly WHEN to use the agent
- Use action-oriented language
- Include trigger phrases
- Examples:
- "Expert code reviewer. Use proactively after code changes to check quality, security, and maintainability."
- "Debugging specialist. Use when errors occur or tests fail to analyze and fix issues."
- Keep under 200 characters but be specific
Determine minimal tool set:
- IMPORTANT: If tools aren't specifically mentioned by the user, OMIT the tools field entirely
- Omitting tools allows the agent to inherit ALL tools from the parent thread
- Only restrict tools if the user explicitly wants to limit capabilities
- Available tools (if restricting):
- Read: Read file contents
- Write: Create new files
- Edit: Modify existing files
- Bash: Execute shell commands
- Glob: Find files by pattern
- Grep: Search file contents
- WebFetch: Fetch web content
- WebSearch: Search the web
- TodoWrite: Manage task lists
- Task: Invoke other subagents
- NotebookRead: Read Jupyter notebooks
- NotebookEdit: Edit Jupyter notebooks
- Common restricted tool combinations (only use if specified):
- Code reviewer:
Read, Grep, Glob
- Debugger:
Read, Edit, Bash, Grep, Glob
- File creator:
Write, Read, Glob
- Data analyst:
Bash, Read, Write
Select the model:
- Default to
sonnet if not specified by the user
- sonnet: Balanced performance (recommended default)
- opus: Maximum capability for complex tasks
- haiku: Fast, lightweight for simple tasks
Construct the system prompt:
- Read the template: templates/subagent-template.md
- Fill in placeholders:
{{AGENT_NAME}}: kebab-case name
{{DESCRIPTION}}: Delegation description
{{TOOLS}}: Comma-separated tool list OR omit the entire tools: line if inheriting all tools
{{COLOR}}: Selected color
{{MODEL}}: Selected model (default: sonnet)
{{AGENT_TITLE}}: Title case name for display
{{PURPOSE_DEFINITION}}: Role definition (e.g., "a senior code reviewer focused on quality and security")
{{INSTRUCTIONS}}: Bullet-point list of additional guidance, constraints, or best practices
{{WORKFLOW_STEPS}}: Numbered step-by-step instructions
{{REPORT_FORMAT}}: Structure for the agent's output
Write instructions section:
Write detailed workflow steps:
Provide clear, numbered instructions
Be specific about what to do at each step
Include examples where helpful
Consider edge cases and error handling
Format as a numbered list:
1. **First action**: Description of what to do
- Additional context
- Sub-steps if needed
2. **Second action**: Next step
```bash
command to run
- Final action: Conclusion
Define the report structure:
- Specify how the agent should communicate results back
- Include sections like:
- Summary
- Findings/Results
- Recommendations
- Next steps
- Use markdown formatting
- Make it easy for the main agent to parse
Write the file:
- Save to
.claude/agents/<agent-name>.md
- Use the generated kebab-case name for the filename
- Verify the file was created successfully
Confirm creation:
- Inform the user the subagent was created
- Show the file path
- Explain how to use it (automatic or explicit invocation)
- Suggest testing with a sample task
Available Tools Reference
File Operations:
Read - Read file contents
Write - Create new files
Edit - Modify existing files
Glob - Find files by pattern
Grep - Search file contents
Execution:
Bash - Run shell commands
Web:
WebFetch - Fetch URL content
WebSearch - Search the web
Specialized:
NotebookRead - Read Jupyter notebooks
NotebookEdit - Edit Jupyter notebooks
TodoWrite - Manage task lists
Task - Invoke subagents
SlashCommand - Execute slash commands
Skill - Use other skills
Best Practice: By default, OMIT the tools field to inherit all parent tools. Only restrict tools if the user explicitly requests limitations for security or focus.
Color Guide
- cyan: Technical, code-focused agents
- blue: Architecture, design, planning
- green: Testing, validation, verification
- yellow: Documentation, analysis, research
- red: Debugging, critical fixes, urgent tasks
- purple: Data science, research, investigation
- orange: Build, deployment, DevOps
- pink: UI/UX, design, creative tasks
Examples
See examples.md for comprehensive examples covering:
Engineering Use Cases:
- Code reviewer (inherit all tools)
- Debugging specialist (inherit all tools)
- Read-only code analyzer (restricted tools)
- SQL data analyst (custom model)
Content & Creative Use Cases:
- Transcription specialist (audio/video to text)
- YouTube script writer (hooks, structure, CTAs)
- Social media strategist (multi-platform content)
- Technical documentation writer (clear, comprehensive docs)
Research & Analysis:
- Research synthesizer (gather and synthesize information)
Each example includes detailed step-by-step walkthroughs showing how to analyze requirements, select appropriate settings, fill the template, and create the agent file.
Tips
- Single responsibility: Each agent should do one thing well
- Default to inheriting tools: Omit the tools field unless user explicitly requests restrictions
- Default to sonnet: Use sonnet model unless user specifies haiku (fast) or opus (complex)
- Clear delegation: Write descriptions that clearly indicate when to use the agent
- Detailed workflows: More specific instructions lead to better results
- Test immediately: Create and test with a sample task to verify behavior
- Version control: Commit project agents to git for team sharing
- Iterate: Refine based on actual usage and feedback
Best Practices from Documentation
- Start with Claude-generated configs: Let this skill create the initial structure, then customize
- Use project agents for teams: Store in
.claude/agents/ and commit to git
- Write detailed prompts: Include specific instructions, examples, and constraints
- Default to full tool access: Omit tools field to inherit all tools; only restrict when explicitly needed
- Consider model choice: Use haiku for speed, opus for complexity, sonnet as default
- Test delegation: Ensure the description triggers automatic invocation correctly
1---2name: meta-agent3description: Generates new Claude Code subagent configuration files from user descriptions. Use proactively when the user asks to create a new subagent or agent. Keywords include create subagent, new agent, build agent, agent architecture.4---5
6# Meta Agent
7
8Creates complete, ready-to-use Claude Code subagent configuration files. This skill acts as an expert agent architect that analyzes requirements and generates properly structured subagent definitions with appropriate tools, prompts, and workflows.
9
10## Instructions
11
12### Prerequisites
13
14- Understanding of the task or domain the subagent should handle
15- Access to Claude Code documentation for latest features
16- `.claude/agents/` directory for project-level agents (recommended)
17
18### Workflow
19
201. **Get latest documentation**:
21 - Fetch updated subagent documentation:
22 ```
23 https://docs.claude.com/en/docs/claude-code/sub-agents
24 ```
25 - Fetch available tools reference:
26 ```
27 https://docs.claude.com/en/docs/claude-code/settings
28 ```
29 - Use Firecrawl Scrap (if available) or WebFetch to ensure you have current information
30
312. **Analyze the user's requirements**:
32 - Understand the subagent's purpose and primary tasks
33 - Identify the domain or specialization
34 - Determine what tools will be needed
35 - Consider when this agent should be invoked
36
373. **Generate the subagent name**:
38 - Use kebab-case format (e.g., `code-reviewer`, `api-tester`)
39 - Make it descriptive but concise
40 - Ensure it clearly indicates the agent's purpose
41 - Must use only lowercase letters and hyphens
42
434. **Select appropriate color**:
44 - Choose from: red, blue, green, yellow, purple, orange, pink, cyan
45 - Use color to indicate agent type or domain:
46 - cyan/blue: technical/code tasks
47 - green: testing/validation
48 - yellow: documentation/analysis
49 - red: debugging/critical tasks
50 - purple: data/research tasks
51
525. **Write the delegation description**:
53 - This is CRITICAL for automatic delegation
54 - State clearly WHEN to use the agent
55 - Use action-oriented language
56 - Include trigger phrases
57 - Examples:
58 - "Expert code reviewer. Use proactively after code changes to check quality, security, and maintainability."
59 - "Debugging specialist. Use when errors occur or tests fail to analyze and fix issues."
60 - Keep under 200 characters but be specific
61
626. **Determine minimal tool set**:
63 - **IMPORTANT**: If tools aren't specifically mentioned by the user, OMIT the tools field entirely
64 - Omitting tools allows the agent to inherit ALL tools from the parent thread
65 - Only restrict tools if the user explicitly wants to limit capabilities
66 - Available tools (if restricting):
67 - **Read**: Read file contents
68 - **Write**: Create new files
69 - **Edit**: Modify existing files
70 - **Bash**: Execute shell commands
71 - **Glob**: Find files by pattern
72 - **Grep**: Search file contents
73 - **WebFetch**: Fetch web content
74 - **WebSearch**: Search the web
75 - **TodoWrite**: Manage task lists
76 - **Task**: Invoke other subagents
77 - **NotebookRead**: Read Jupyter notebooks
78 - **NotebookEdit**: Edit Jupyter notebooks
79 - Common restricted tool combinations (only use if specified):
80 - Code reviewer: `Read, Grep, Glob`
81 - Debugger: `Read, Edit, Bash, Grep, Glob`
82 - File creator: `Write, Read, Glob`
83 - Data analyst: `Bash, Read, Write`
84
857. **Select the model**:
86 - **Default to `sonnet`** if not specified by the user
87 - **sonnet**: Balanced performance (recommended default)
88 - **opus**: Maximum capability for complex tasks
89 - **haiku**: Fast, lightweight for simple tasks
90
918. **Construct the system prompt**:
92 - Read the template: [templates/subagent-template.md](templates/subagent-template.md)
93 - Fill in placeholders:
94 - `{{AGENT_NAME}}`: kebab-case name
95 - `{{DESCRIPTION}}`: Delegation description
96 - `{{TOOLS}}`: Comma-separated tool list OR omit the entire `tools:` line if inheriting all tools
97 - `{{COLOR}}`: Selected color
98 - `{{MODEL}}`: Selected model (default: `sonnet`)
99 - `{{AGENT_TITLE}}`: Title case name for display
100 - `{{PURPOSE_DEFINITION}}`: Role definition (e.g., "a senior code reviewer focused on quality and security")
101 - `{{INSTRUCTIONS}}`: Bullet-point list of additional guidance, constraints, or best practices
102 - `{{WORKFLOW_STEPS}}`: Numbered step-by-step instructions
103 - `{{REPORT_FORMAT}}`: Structure for the agent's output
104
1059. **Write instructions section**:
106 - Include arbitrary bullet points that add useful context
107 - Examples of what to include:
108 - Important constraints or limitations
109 - Best practices specific to this agent's domain
110 - Edge cases to watch for
111 - Preferred approaches or patterns
112 - Things to avoid
113 - Format as bullet points:
114 ```markdown
115 - Focus on security-critical issues first
116 - Use industry-standard naming conventions
117 - Avoid making assumptions about user intent
118 - When in doubt, ask for clarification
119 ```
120
12110. **Write detailed workflow steps**:
122 - Provide clear, numbered instructions
123 - Be specific about what to do at each step
124 - Include examples where helpful
125 - Consider edge cases and error handling
126 - Format as a numbered list:
127 ```markdown
128 1. **First action**: Description of what to do
129 - Additional context
130 - Sub-steps if needed
131
132 2. **Second action**: Next step
133 ```bash
134 command to run
135 ```
136
137 3. **Final action**: Conclusion
138 ```
139
14011. **Define the report structure**:
141 - Specify how the agent should communicate results back
142 - Include sections like:
143 - Summary
144 - Findings/Results
145 - Recommendations
146 - Next steps
147 - Use markdown formatting
148 - Make it easy for the main agent to parse
149
15012. **Write the file**:
151 - Save to `.claude/agents/<agent-name>.md`
152 - Use the generated kebab-case name for the filename
153 - Verify the file was created successfully
154
15513. **Confirm creation**:
156 - Inform the user the subagent was created
157 - Show the file path
158 - Explain how to use it (automatic or explicit invocation)
159 - Suggest testing with a sample task
160
161### Available Tools Reference
162
163**File Operations:**
164- `Read` - Read file contents
165- `Write` - Create new files
166- `Edit` - Modify existing files
167- `Glob` - Find files by pattern
168- `Grep` - Search file contents
169
170**Execution:**
171- `Bash` - Run shell commands
172
173**Web:**
174- `WebFetch` - Fetch URL content
175- `WebSearch` - Search the web
176
177**Specialized:**
178- `NotebookRead` - Read Jupyter notebooks
179- `NotebookEdit` - Edit Jupyter notebooks
180- `TodoWrite` - Manage task lists
181- `Task` - Invoke subagents
182- `SlashCommand` - Execute slash commands
183- `Skill` - Use other skills
184
185**Best Practice:** By default, OMIT the tools field to inherit all parent tools. Only restrict tools if the user explicitly requests limitations for security or focus.
186
187### Color Guide
188
189- **cyan**: Technical, code-focused agents
190- **blue**: Architecture, design, planning
191- **green**: Testing, validation, verification
192- **yellow**: Documentation, analysis, research
193- **red**: Debugging, critical fixes, urgent tasks
194- **purple**: Data science, research, investigation
195- **orange**: Build, deployment, DevOps
196- **pink**: UI/UX, design, creative tasks
197
198## Examples
199
200See [examples.md](examples.md) for comprehensive examples covering:
201
202**Engineering Use Cases:**
203- Code reviewer (inherit all tools)
204- Debugging specialist (inherit all tools)
205- Read-only code analyzer (restricted tools)
206- SQL data analyst (custom model)
207
208**Content & Creative Use Cases:**
209- Transcription specialist (audio/video to text)
210- YouTube script writer (hooks, structure, CTAs)
211- Social media strategist (multi-platform content)
212- Technical documentation writer (clear, comprehensive docs)
213
214**Research & Analysis:**
215- Research synthesizer (gather and synthesize information)
216
217Each example includes detailed step-by-step walkthroughs showing how to analyze requirements, select appropriate settings, fill the template, and create the agent file.
218
219## Tips
220
221- **Single responsibility**: Each agent should do one thing well
222- **Default to inheriting tools**: Omit the tools field unless user explicitly requests restrictions
223- **Default to sonnet**: Use sonnet model unless user specifies haiku (fast) or opus (complex)
224- **Clear delegation**: Write descriptions that clearly indicate when to use the agent
225- **Detailed workflows**: More specific instructions lead to better results
226- **Test immediately**: Create and test with a sample task to verify behavior
227- **Version control**: Commit project agents to git for team sharing
228- **Iterate**: Refine based on actual usage and feedback
229
230## Best Practices from Documentation
231
2321. **Start with Claude-generated configs**: Let this skill create the initial structure, then customize
2332. **Use project agents for teams**: Store in `.claude/agents/` and commit to git
2343. **Write detailed prompts**: Include specific instructions, examples, and constraints
2354. **Default to full tool access**: Omit tools field to inherit all tools; only restrict when explicitly needed
2365. **Consider model choice**: Use haiku for speed, opus for complexity, sonnet as default
2376. **Test delegation**: Ensure the description triggers automatic invocation correctly