Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to "create an agent", "write a subagent", "generate agent definition", "add agent to plugin", "write agent frontmatter", "create autonomous agent", "build subagent", needs agent structure guidance, YAML frontmatter configuration, invocation criteria with examples, or wants to add specialized subagents to Claude Code plugins with proper capabilities lists and tool access definitions.
.claude/skills/majiayu000-agent-creator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 333% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 206% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 257% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 193% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 252% | 0% |
name: agent-creator description: Use this skill when architecting new Claude Code agents following Anthropic best practices. Guides through YAML frontmatter creation, agent structure definition, role boundaries, and validation. Critical for creating minimal agent files (~150 lines) with proper skill invocations. Examples: <example>Context: User wants to create a new agent for security auditing user: "Create a security-auditor agent" assistant: "I'll use the agent-creator skill to build this agent following Anthropic best practices" <commentary>New agent creation requires the agent-creator skill to ensure proper structure and YAML frontmatter.</commentary></example> <example>Context: Existing agent file is too verbose and needs refactoring user: "The architect agent is 2000 lines, refactor it to minimal structure" assistant: "I'll use the agent-creator skill to refactor this into a minimal ~150 line agent with a separate skill file" <commentary>Agent refactoring requires the agent-creator skill to separate identity from technical procedures.</commentary></example> color: orange
Purpose: Guide creation of Claude Code agents following Anthropic official best practices.
When to use: Creating new agents, refactoring existing agents, validating agent structure.
Agent .md (150 lines) Skill SKILL.md (varies)
├─ YAML frontmatter ├─ Technical workflows
├─ Identity & role ├─ Context7 checkpoints
├─ Authority & boundaries ├─ MCP integrations
├─ Workspace isolation ├─ Best practices
├─ Mandatory skill call ├─ Code patterns
└─ Quick reference └─ References/ (on demand)Objective: Understand the agent's purpose and role in the system.
Steps:
Questions to answer:
Deliverable: Written notes on agent's role, triggers, and boundaries
Objective: Consult official Anthropic documentation for latest best practices.
⚠️ CRITICAL: You MUST query Context7 before creating or refactoring agents.
Required queries:
bash# Query 1: General agent best practices mcp__context7__resolve-library-id "claude code" mcp__context7__get-library-docs "/anthropics/claude-code" topic="custom agents creation best practices" # Query 2: Agent templates and examples mcp__context7__resolve-library-id "claude code templates" mcp__context7__get-library-docs "/davila7/claude-code-templates" topic="agent creation yaml structure examples" # Query 3: YAML frontmatter validation (if uncertain) mcp__context7__get-library-docs "/anthropics/claude-code" topic="yaml frontmatter agent configuration"
What to look for:
Reference documents (consult if Context7 unavailable):
references/context7-queries.md - Pre-built query patternsreferences/yaml-frontmatter-guide.md - YAML validation rulesDeliverable: Notes on any differences from existing patterns, new requirements
Objective: Create valid, descriptive YAML frontmatter for the agent.
Required fields:
yaml--- name: {agent-name} # kebab-case REQUIRED description: ... # Trigger + examples REQUIRED model: sonnet # Default REQUIRED color: {color} # Visual ID REQUIRED ---
Description structure (CRITICAL):
Use this agent when {trigger scenario}. Specializes in {expertise}.
Examples:
<example>
Context: {situation}
user: '{request}'
assistant: '{response}'
<commentary>{reasoning}</commentary>
</example>
<example>
Context: {another situation}
user: '{another request}'
assistant: '{another response}'
<commentary>{more reasoning}</commentary>
</example>Naming conventions:
references/color-conventions.md)Examples reference: assets/yaml-examples.yml
Validation checklist:
<example> blocks<commentary>Deliverable: Complete YAML frontmatter block
Objective: Create the minimal ~150 line agent body following standard structure.
Template: Use assets/agent-minimal-template.md as base.
Required sections (in order):
markdown# IDENTITY & ROLE You are the **{Agent Title}**—{one-sentence mission}. ## Core Mission {2-3 paragraphs explaining: - What this agent does - Why it exists - How it fits in the system} ## Authority & Boundaries **YOU ARE THE ONLY AGENT AUTHORIZED TO**: - {Specific responsibility 1} - {Specific responsibility 2} - {Specific responsibility 3} **YOU ARE STRICTLY PROHIBITED FROM**: - {Specific prohibition 1} - {Specific prohibition 2} - {Specific prohibition 3}
Tips:
markdown# ITERATIVE WORKFLOW v2.0 ## Your Workspace **Isolated folder**: `PRDs/{domain}/{feature}/{agent-name}/` **Files YOU read**: - ✅ `{agent-name}/00-request.md` (Architect writes) - ✅ `architect/00-master-prd.md` (reference) - ✅ `{previous-agent}/handoff-XXX.md` (if enabled) **Files you CANNOT read**: - ❌ Other agent folders (Architect coordinates information)
Purpose: Establish workspace isolation and file access boundaries.
markdown# 🎯 MANDATORY SKILL INVOCATION **CRITICAL**: Before ANY work, invoke your technical skill: \``` Skill: {agent-name}-skill \``` **The skill provides**: - ✅ Step-by-step technical procedures - ✅ Context7 consultation checkpoints (MANDATORY phases) - ✅ MCP integration workflows - ✅ Technology-specific references (loaded on demand) - ✅ Code patterns and best practices **This skill is NOT optional—it is your complete technical manual.**
Purpose: Force agent to use its comprehensive skill before starting work.
markdown# QUICK REFERENCE **Triggers**: {When to use this agent - 1-2 sentences} **Deliverables**: {What this agent produces - bulleted list} **Success metrics**: {How to measure completion - 2-3 criteria} --- **Complete technical guide**: `.claude/skills/{agent-name}-skill/SKILL.md`
Purpose: Fast lookup for triggers and expected outputs.
Validation checklist:
Deliverable: Complete agent .md file
Objective: Verify the agent file is valid and follows best practices.
Automated validation:
bash# Run validation script ./scripts/validate-agent.sh .claude/agents/{agent-name}.md
The script checks:
Manual validation checklist:
Common mistakes to avoid:
Reference documents:
references/agent-structure.md - Complete structure guidereferences/yaml-frontmatter-guide.md - YAML validation detailsDeliverable: Validated agent file passing all checks
Objective: Create the companion skill structure for this agent.
⚠️ NOTE: This phase creates the STRUCTURE only. The skill content is created separately using the skill-creator skill.
Directory structure to create:
.claude/skills/{agent-name}-skill/
├── SKILL.md # Main skill file (create with skill-creator)
├── metadata.json # Skill metadata
├── references/ # Reference documents (loaded on demand)
│ └── README.md # Index of references
├── scripts/ # Automation scripts
│ └── README.md # Script documentation
└── assets/ # Templates, examples, diagrams
└── README.md # Asset catalogMetadata template (metadata.json):
json{ "name": "{agent-name}-skill", "version": "1.0.0", "description": "Technical workflow and best practices for {agent-name} agent", "agent": "{agent-name}", "technologies": ["list", "of", "technologies"], "mcps_required": ["context7", "supabase", "chrome-devtools"], "references_count": 0, "last_updated": "2025-10-24" }
Reference README template (references/README.md):
markdown# {Agent Name} Skill References References are loaded **on demand** when specific technical guidance is needed. ## Available References 1. **{reference-name}.md** - {Brief description} - When to consult: {Trigger} - Context7 equivalent: {Query if applicable} ## Update Policy References should be refreshed when: - Context7 documentation changes - New best practices emerge - Technology versions change - Common mistakes are identified
Validation checklist:
Deliverable: Skill directory structure ready for content population
⚠️ CRITICAL: Agent creation is NOT complete until the skill is populated with technical content.
Now invoke the skill-creator to complete the skill:
Skill: skill-creatorProvide the skill-creator with this information:
markdownAgent: {agent-name} Color: {color} Role: {role from agent mission} Primary Responsibilities (from agent authorities): - {Authority 1} - {Authority 2} - {Authority 3} Technologies Involved: - {List technologies this agent works with} - {e.g., Vitest, Playwright for test-architect} - {e.g., Supabase, PostgreSQL, RLS for supabase-agent} Required MCP Integrations: - context7 (MANDATORY for all agents) - {Other MCPs: supabase, chrome-devtools, etc.} Skill Content to Include: - 6-phase workflow specific to this agent's role - Context7 checkpoints (mandatory consultation phases) - Technology-specific references (loaded on demand) - Code pattern examples and best practices - Common mistakes and troubleshooting guides - Automation scripts (if applicable) Reference the existing agent structure for consistency.
Expected skill-creator deliverables:
Once skill-creator completes:
Phase 6 Complete ✅ Next: Invoke Skill: skill-creator to populate the skill with technical content
Use the initialization script:
bash./scripts/init-agent.sh <agent-name> <color> "<role-description>" # Example: ./scripts/init-agent.sh security-auditor purple "Security review and vulnerability scanning"
What it does:
Then:
./scripts/validate-agent.sh .claude/agents/{agent-name}.mdSteps:
assets/agent-minimal-template.md./scripts/validate-agent.shBefore/After example:
BEFORE:
- architect-agent.md: 2078 lines (identity + workflows + examples + references)
AFTER:
- architect-agent.md: 150 lines (identity + skill invocation only)
- .claude/skills/architect-agent-skill/
├── SKILL.md: Workflows and procedures
├── references/: Best practices documents
└── assets/: Templates and examplesAvailable references:
references/agent-structure.mdreferences/yaml-frontmatter-guide.mdreferences/context7-queries.mdreferences/color-conventions.mdLoading pattern:
references/color-conventions.md for color selection guide"Agent creation is complete when:
./scripts/validate-agent.sh passes without errors/anthropics/claude-code/davila7/claude-code-templates.claude/agents/README-ITERATIVE-V2.md.claude/agents/ (architect-agent, test-architect, etc.)PRDs/WORKFLOW-ITERATIVO.mdscripts/init-agent.sh - Initialize new agent from templatescripts/validate-agent.sh - Validate agent structure and YAMLassets/agent-minimal-template.md - Complete agent templateassets/yaml-examples.yml - Working YAML frontmatter examplesLast Updated: 2025-10-24 Maintained by: Agent Creator Skill (self-referential)
Other measured skills in the registry, with their headline benchmark lift.