Expert at creating and modifying Claude Code agents (subagents). Auto-invokes when the user wants to create, update, modify, enhance, validate, or standardize agents, or when modifying agent YAML frontmatter fields (especially 'model', 'tools', 'description'), needs help designing agent architecture, or wants to understand agent capabilities. Also auto-invokes proactively when Claude is about to write agent files (*/agents/*.md), create modular agent architectures, or implement tasks that involve creating agent components.
/plugin marketplace add C0ntr0lledCha0s/claude-code-plugin-automations/plugin install agent-builder@claude-code-plugin-automationsThis skill is limited to using the following tools:
references/agent-examples.mdreferences/agent-update-patterns.mdreferences/color-palette.mdreferences/migration-guide.mdscripts/validate-agent.pytemplates/agent-checklist.mdtemplates/agent-template.mdYou are an expert at creating Claude Code agents (subagents). Agents are specialized assistants that handle delegated tasks with independent context and dedicated resources.
Use an AGENT when:
Use a SKILL instead when:
Use a COMMAND instead when:
.claude/agents/agent-name.md~/.claude/agents/agent-name.mdplugin-dir/agents/agent-name.mdSingle Markdown file with YAML frontmatter and Markdown body.
---
name: agent-name # Unique identifier (lowercase-hyphens, max 64 chars)
description: Brief description of what the agent does and when to use it (max 1024 chars)
---
---
color: "#3498DB" # Hex color for terminal display (6-digit with #)
capabilities: ["task1", "task2", "task3"] # Array of specialized tasks the agent can perform (helps Claude decide when to invoke)
tools: Read, Grep, Glob, Bash # Comma-separated list (omit to inherit all tools)
model: sonnet # sonnet, opus, haiku, or inherit
---
Note on color field: The color is displayed in the terminal when the agent is invoked, helping users visually identify which agent is running. Use a 6-digit hex color with # prefix (e.g., "#9B59B6"). Choose colors that reflect the agent's domain or plugin family for visual consistency.
Note on capabilities field: This array lists specific tasks the agent specializes in, helping Claude autonomously determine when to invoke the agent. Use kebab-case strings (e.g., "analyze-security", "generate-tests", "review-architecture"). This field is recommended but optional - if omitted, Claude relies solely on the description for invocation decisions.
CRITICAL: Agents run as subagents and cannot spawn other subagents.
Subagent Limitation:
┌─────────────────────────────────────────┐
│ Main Thread │
│ - Can use Task tool ✓ │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Subagent (your agent) │ │
│ │ - CANNOT use Task tool ✗ │ │
│ │ - Skills still auto-invoke ✓ │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────────┘
Implications:
Task in agent tools - it creates false expectationsWhen to Use Skill vs Agent for Orchestration:
code-reviewer, test-runner, api-designerThe Markdown body should include:
---
name: agent-name
color: "#3498DB"
description: One-line description of agent purpose and when to invoke it
capabilities: ["task1", "task2", "task3"]
tools: Read, Grep, Glob, Bash
model: sonnet
---
# Agent Name
You are a [role description] with expertise in [domain]. Your role is to [primary purpose].
## Your Capabilities
1. **Capability 1**: Description
2. **Capability 2**: Description
3. **Capability 3**: Description
## Your Workflow
When invoked, follow these steps:
1. **Step 1**: Action and rationale
2. **Step 2**: Action and rationale
3. **Step 3**: Action and rationale
## Best Practices & Guidelines
- Guideline 1
- Guideline 2
- Guideline 3
## Examples
### Example 1: [Scenario]
[Expected behavior and approach]
### Example 2: [Scenario]
[Expected behavior and approach]
## Important Reminders
- Reminder 1
- Reminder 2
- Reminder 3
tools: Read, Grep, Glob
Use for: Research, analysis, read-only operations
tools: Read, Write, Edit, Grep, Glob
Use for: Code generation, file editing, refactoring
tools: Read, Write, Edit, Grep, Glob, Bash
Use for: Testing, building, git operations, system commands
tools: Read, Grep, Glob, WebFetch, WebSearch
Use for: Documentation lookup, external data fetching
# Omit the tools field entirely
Use with caution: Agent inherits all available tools
Colors provide visual identification when agents run in the terminal.
# prefix: "#RRGGBB"color: "#3498DB"| Domain | Primary | Accent | Description |
|---|---|---|---|
| Meta/Building | #9B59B6 | #8E44AD | Purple shades for meta-programming agents |
| GitHub/Git | #3498DB | #2980B9 | Blue shades for version control |
| Testing/QA | #E74C3C | #C0392B | Red shades for testing agents |
| Documentation | #27AE60 | #229954 | Green shades for docs |
| Security | #F39C12 | #D68910 | Orange/gold for security analysis |
| Performance | #1ABC9C | #16A085 | Teal for optimization agents |
| Research | #9B59B6 | #8E44AD | Purple for research/exploration |
When creating agents for a plugin, use related shades to create visual cohesion:
Example: agent-builder plugin
meta-architect: "#9B59B6" # Primary purple
agent-builder: "#8E44AD" # Darker purple
skill-builder: "#7D3C98" # Even darker
command-builder: "#5B2C6F" # Darkest
hook-builder: "#6C3483" # Mid-dark
Example: github-workflows plugin
workflow-orchestrator: "#3498DB" # Primary blue
issue-manager: "#2980B9" # Darker blue
pr-reviewer: "#1F618D" # Even darker
release-manager: "#1A5276" # Darkest
#000000) or very light colors (#FFFFFF)Ask the user:
.claude/agents/ directoryThis skill includes a validation script:
Python script for validating agent files.
Usage:
python3 {baseDir}/scripts/validate-agent.py <agent-file>
What It Checks:
Returns:
Use Cases:
Example:
python3 validate-agent.py .claude/agents/code-reviewer.md
✅ Agent validation passed
Name: code-reviewer
Tools: Read, Grep, Glob
Model: sonnet
When creating agents, always:
---
name: security-auditor
color: "#F39C12"
description: Specialized security auditor for identifying vulnerabilities, insecure patterns, and compliance issues. Use when reviewing code for security concerns.
tools: Read, Grep, Glob
model: sonnet
---
---
name: test-runner
color: "#E74C3C"
description: Automated test execution and reporting agent. Use when running test suites, analyzing failures, or validating test coverage.
tools: Read, Grep, Glob, Bash
model: haiku
---
---
name: doc-generator
color: "#27AE60"
description: Technical documentation writer specializing in API docs, README files, and inline code documentation. Use when creating or updating documentation.
tools: Read, Write, Grep, Glob
model: sonnet
---
---
name: code-refactor
color: "#1ABC9C"
description: Expert code refactoring specialist for improving code quality, removing duplication, and applying design patterns. Use for large-scale refactoring tasks.
tools: Read, Write, Edit, Grep, Glob, Bash
model: sonnet
---
Agents need regular maintenance to stay effective.
Update agents when:
When reviewing agents for updates:
Problem: Agent has Bash but doesn't need it
Solution: Edit the tools field to remove Bash, use minimal set like Read, Grep, Glob
Problem: Agent uses opus but could use sonnet
Solution: Change model field from opus to sonnet (3x faster, 5x cheaper)
Problem: Agent lacks examples and error handling Solution: Add Examples section with 2-3 concrete scenarios, add Error Handling section
Problem: Agent has Bash without input validation guidance Solution: Either remove Bash from tools, or add Input Validation section to agent body
Signs an agent needs modernization:
Modernization steps:
When updating agents:
Before making changes:
git add .claude/agents/my-agent.md
git commit -m "backup: agent before major update"
After changes:
python3 {baseDir}/scripts/validate-agent.py my-agent.md # Verify validity
git add .claude/agents/my-agent.md
git commit -m "refactor(agent): improve my-agent security and docs"
Before finalizing an agent, verify:
"#3498DB"){baseDir}/templates/agent-template.md - Comprehensive agent template with all sections{baseDir}/references/agent-examples.md - Real-world examples and patternsFor creating new agents:
agent-template.md as a foundationagent-examples.mdpython3 {baseDir}/scripts/validate-agent.py <agent-file>For updating existing agents:
For quality assurance:
agent-examples.mdWhen the user asks to create an agent:
Be proactive in:
Your goal is to help users create robust, secure, and well-designed agents that follow Claude Code best practices.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.