All skills
Skillintermediate

/customaize-agent:create-agent - Agent Creation Guide

Comprehensive guide for creating Claude Code agents with proper structure, triggering conditions, system prompts, and validation. Combines official Anthropic best practices with proven patterns.

Claude Code Knowledge Pack7/10/2026

Overview

/customaize-agent:create-agent - Agent Creation Guide

Comprehensive guide for creating Claude Code agents with proper structure, triggering conditions, system prompts, and validation. Combines official Anthropic best practices with proven patterns.

  • Purpose - Create autonomous agents that handle complex, multi-step tasks independently
  • Output - Complete agent file with frontmatter, triggering examples, and system prompt
/customaize-agent:create-agent [agent-name] [optional description]

Arguments

Optional agent name (kebab-case) and description of the agent's purpose.

Usage Examples

# Create a code review agent
> /customaize-agent:create-agent code-reviewer "Review code for quality and security"

# Create a test generation agent
> /customaize-agent:create-agent test-generator

# Start interactive agent creation
> /customaize-agent:create-agent

How It Works

  1. Gather Requirements: Collects agent specifications

    • Agent name (kebab-case, 3-50 characters)
    • Purpose and core responsibilities
    • Triggering conditions (when Claude should use this agent)
    • Required tools (principle of least privilege)
    • Model requirements (inherit/sonnet/opus/haiku)
  2. Design Triggering: Creates proper description field

    • Starts with "Use this agent when..."
    • Includes 2-4 <example> blocks with:
      • Context (situation description)
      • User request (exact message)
      • Assistant response (how Claude triggers)
      • Commentary (reasoning for triggering)
  3. Write System Prompt: Generates comprehensive prompt

    • Role statement with specialization
    • Core responsibilities (numbered list)
    • Analysis/work process (step-by-step)
    • Quality standards (measurable criteria)
    • Output format (specific structure)
    • Edge cases handling
  4. Validate & Test: Ensures agent quality

    • Structural validation (frontmatter, name, description)
    • Triggering tests with various scenarios
    • Verification of agent behavior

Triggering Patterns

PatternDescriptionExample
Explicit RequestUser directly asks for function"Review my code"
Implicit NeedContext suggests agent needed"This code is confusing"
Proactive TriggerAfter completing relevant workCode written → review
Tool Usage PatternBased on prior tool usageMultiple edits → test analyzer

Frontmatter Fields

FieldRequiredFormatExample
nameYeslowercase, hyphens, 3-50 charscode-reviewer
descriptionYes10-5000 chars with examplesUse this agent when...
modelYesinherit/sonnet/opus/haikuinherit
colorYesblue/cyan/green/yellow/magenta/redblue
toolsNoArray of tool names["Read", "Grep"]