| name | meta-agent |
| description | 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. |
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:
- Fetch updated subagent documentation:
https://docs.claude.com/en/docs/claude-code/sub-agents - Fetch available tools reference:
https://docs.claude.com/en/docs/claude-code/settings - Use Firecrawl Scrap (if available) or WebFetch to ensure you have current information
- Fetch updated subagent 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
- Use kebab-case format (e.g.,
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
- Code reviewer:
Select the model:
- Default to
sonnetif not specified by the user - sonnet: Balanced performance (recommended default)
- opus: Maximum capability for complex tasks
- haiku: Fast, lightweight for simple tasks
- Default to
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 entiretools: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:
- Include arbitrary bullet points that add useful context
- Examples of what to include:
- Important constraints or limitations
- Best practices specific to this agent's domain
- Edge cases to watch for
- Preferred approaches or patterns
- Things to avoid
- Format as bullet points:
- Focus on security-critical issues first - Use industry-standard naming conventions - Avoid making assumptions about user intent - When in doubt, ask for clarification
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
- Save to
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 contentsWrite- Create new filesEdit- Modify existing filesGlob- Find files by patternGrep- Search file contents
Execution:
Bash- Run shell commands
Web:
WebFetch- Fetch URL contentWebSearch- Search the web
Specialized:
NotebookRead- Read Jupyter notebooksNotebookEdit- Edit Jupyter notebooksTodoWrite- Manage task listsTask- Invoke subagentsSlashCommand- Execute slash commandsSkill- 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