Agent creator majiayu000

From diegosouzapw/awesome-omni-skill · View interactive version

Agent creator majiayu000 is an AI agent skill from the GitHub repository diegosouzapw/awesome-omni-skill. 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>

How to use this skill

Skill file

Agent Creator Skill

Purpose: Guide creation of Claude Code agents following Anthropic official best practices.

When to use: Creating new agents, refactoring existing agents, validating agent structure.


🎯 Core Principles

Agent Structure Philosophy

Separation of Concerns

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)

πŸ“‹ 6-PHASE WORKFLOW

PHASE 1: Discovery & Analysis

Objective: Understand the agent's purpose and role in the system.

Steps:

  1. Identify the agent's primary responsibility
  2. Determine where it fits in the workflow (Architect β†’ Test β†’ Implementer β†’ Supabase β†’ UI/UX)
  3. Define clear trigger scenarios (when should this agent activate?)
  4. List exclusive authorizations (what ONLY this agent can do)
  5. Define strict prohibitions (what this agent must NEVER do)

Questions to answer:

Deliverable: Written notes on agent's role, triggers, and boundaries


PHASE 2: Context7 Research (MANDATORY)

Objective: Consult official Anthropic documentation for latest best practices.

⚠️ CRITICAL: You MUST query Context7 before creating or refactoring agents.

Required queries:

# 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):

Deliverable: Notes on any differences from existing patterns, new requirements


PHASE 3: YAML Frontmatter Design

Objective: Create valid, descriptive YAML frontmatter for the agent.

Required fields:

---
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:

Examples reference: assets/yaml-examples.yml

Validation checklist:

Deliverable: Complete YAML frontmatter block


PHASE 4: Agent Body Structure

Objective: Create the minimal ~150 line agent body following standard structure.

Template: Use assets/agent-minimal-template.md as base.

Required sections (in order):

1. IDENTITY & ROLE
# 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:

2. ITERATIVE WORKFLOW v2.0
# 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.

3. MANDATORY SKILL INVOCATION
# 🎯 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.

4. QUICK REFERENCE
# 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


PHASE 5: Validation & Testing

Objective: Verify the agent file is valid and follows best practices.

Automated validation:

# Run validation script
./scripts/validate-agent.sh .claude/agents/{agent-name}.md

The script checks:

Manual validation checklist:

Common mistakes to avoid:

Reference documents:

Deliverable: Validated agent file passing all checks


PHASE 6: Skill Scaffold Creation

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 catalog

Metadata template (metadata.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):

# {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


🎯 AUTOMATIC HANDOFF TO SKILL-CREATOR

⚠️ 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-creator

Provide the skill-creator with this information:

Agent: {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:

  1. Validate the complete agent + skill package
  2. Test agent invocation in Claude Code
  3. Verify skill invocation from agent works
  4. Update project documentation

Phase 6 Complete βœ…

Next: Invoke Skill: skill-creator to populate the skill with technical content


πŸ› οΈ UTILITIES & HELPERS

Quick Start: New Agent from Scratch

Use the initialization script:

./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:

  1. Edit the created file to fill in FILL_THIS placeholders
  2. Add 2-3 examples to YAML description
  3. Complete Core Mission section
  4. Define Authority & Boundaries
  5. Run validation: ./scripts/validate-agent.sh .claude/agents/{agent-name}.md
  6. Create skill structure (Phase 6)

Quick Start: Refactor Existing Agent

Steps:

  1. Backup the current agent file
  2. Extract identity information:
  1. Extract technical content:
  1. Create minimal agent using assets/agent-minimal-template.md
  2. Validate new structure: ./scripts/validate-agent.sh
  3. Create skill with extracted technical content

Before/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 examples

Reference Documents (Load on Demand)

Available references:

  1. references/agent-structure.md
  1. references/yaml-frontmatter-guide.md
  1. references/context7-queries.md
  1. references/color-conventions.md

Loading pattern:


βœ… SUCCESS CRITERIA

Agent creation is complete when:


πŸ“š ADDITIONAL RESOURCES

Official Documentation (via Context7)

Project-Specific

Scripts

Templates


Last Updated: 2025-10-24

Maintained by: Agent Creator Skill (self-referential)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.