---
name: agent-creator-63345ca329a5
description: Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.
version: 2.1.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit, Glob, Grep, WebSearch, WebFetch, Bash, Task]
best_practices:
  - Verify no existing agent matches first
  - Research domain before creating agent
  - Assign relevant skills to new agents
error_handling: graceful
streaming: supported
output_location: .claude/agents/
---

# Agent Creator Skill

Creates specialized AI agents on-demand for capabilities that don't have existing agents.

## ROUTER UPDATE REQUIRED (CRITICAL - DO NOT SKIP)

**After creating ANY agent, you MUST update CLAUDE.md Section 3 "AGENT ROUTING TABLE":**

```markdown
| Request Type | agent-name | `.claude/agents/<category>/<name>.md` |
```

**Verification:**

```bash
grep "<agent-name>" .claude/CLAUDE.md || echo "ERROR: CLAUDE.md ROUTING TABLE NOT UPDATED!"
```

**WHY**: Agents not in the routing table will NEVER be spawned by the Router.

---

## When This Skill Is Triggered

1. **Router finds no matching agent** for a user request
2. **User explicitly requests** creating a new agent
3. **Specialized expertise needed** that existing agents don't cover

## Quick Reference

| Operation             | Method                                         |
| --------------------- | ---------------------------------------------- |
| Check existing agents | `Glob: .claude/agents/**/*.md`                 |
| Research domain       | `WebSearch: "<topic> best practices 2026"`     |
| Find relevant skills  | `Glob: .claude/skills/*/SKILL.md`              |
| Create agent          | Write to `.claude/agents/<category>/<name>.md` |
| Spawn agent           | `Task` tool with new `subagent_type`           |
| Run in terminal       | `claude -p "prompt" --allowedTools "..."`      |

## Agent Creation Process

### Step 1: Verify No Existing Agent

```bash
# Search for relevant agents
Glob: .claude/agents/**/*.md
Grep: "<topic>" in .claude/agents/
```

If a suitable agent exists, use it instead. Check:

- Core agents: `.claude/agents/core/`
- Specialized agents: `.claude/agents/specialized/`
- Orchestrators: `.claude/agents/orchestrators/`

### Step 2: Research the Domain

**Use web search to gather current information:**

```
WebSearch: "<topic> expert techniques best practices 2026"
WebSearch: "<topic> tools frameworks methodologies"
```

**Research goals:**

- Current best practices and industry standards
- Popular tools, frameworks, and methodologies
- Expert techniques and evaluation criteria
- Common workflows and deliverables

### Step 2.5: Research Keywords (MANDATORY - DO NOT SKIP)

Before designing the agent, you MUST research keywords that users will use to invoke this agent.

#### Required Actions

1. **Execute Exa Searches** (minimum 3 queries):

   ```javascript
   // Query 1: Role-specific tasks
   mcp__Exa__web_search_exa({ query: '[agent-role] common tasks responsibilities' });

   // Query 2: Industry terminology
   mcp__Exa__web_search_exa({ query: '[agent-role] terminology keywords phrases' });

   // Query 3: Problem types
   mcp__Exa__web_search_exa({ query: '[agent-role] problem types use cases' });
   ```

2. **Document Keywords** (save to research report):
   - High-Confidence Keywords: Unique to this agent
   - Medium-Confidence Keywords: May overlap with other agents
   - Action Verbs: Common verbs for this role
   - Problem Indicators: Phrases users say when needing this agent

3. **Save Research Report**:
   Save to: `.claude/context/artifacts/research-reports/agent-keywords-[agent-name].md`

#### Validation Gate

- [ ] Minimum 3 Exa searches executed
- [ ] Keywords documented with confidence levels
- [ ] Research report saved

**BLOCKING**: Agent creation CANNOT proceed without completing keyword research.

### Step 3: Find Relevant Skills to Assign (CRITICAL)

**Every agent MUST have relevant skills assigned and include skill loading in their workflow.**

**Search existing skills the agent should use:**

```bash
Glob: .claude/skills/*/SKILL.md
Grep: "<related-term>" in .claude/skills/
```

**Skill categories available:**
| Domain | Skills |
|--------|--------|
| Documentation | doc-generator, diagram-generator |
| Testing | test-generator, tdd |
| DevOps | docker-compose, kubernetes-flux, terraform-infra |
| Cloud | aws-cloud-ops, gcloud-cli |
| Code Quality | code-analyzer, code-style-validator |
| Project Management | linear-pm, jira-pm, github-ops |
| Debugging | debugging, smart-debug |
| Communication | slack-notifications |
| Data | text-to-sql, repo-rag |
| Task Management | task-management-protocol |

**Skill Discovery Process:**

1. **Scan all skills**: `Glob: .claude/skills/*/SKILL.md`
2. **Read each SKILL.md** to understand what it does
3. **Match skills to agent domain**:
   - If agent does code → consider: tdd, debugging, git-expert, code-analyzer
   - If agent does planning → consider: plan-generator, sequential-thinking, diagram-generator
   - If agent does security → consider: security-related skills
   - If agent does documentation → consider: doc-generator, diagram-generator
   - **ALL agents** should include: task-management-protocol (for task tracking)
4. **Include ALL relevant skills** in the agent's frontmatter

### Step 4: Determine Agent Configuration

| Agent Type | Use When                       | Model  | Temperature |
| ---------- | ------------------------------ | ------ | ----------- |
| Worker     | Executes tasks directly        | sonnet | 0.3         |
| Analyst    | Research, review, evaluation   | sonnet | 0.4         |
| Specialist | Deep domain expertise          | opus   | 0.4         |
| Advisor    | Strategic guidance, consulting | opus   | 0.5         |

| Category      | Directory                       | Examples                      |
| ------------- | ------------------------------- | ----------------------------- |
| Core          | `.claude/agents/core/`          | developer, planner, architect |
| Specialized   | `.claude/agents/specialized/`   | security-architect, devops    |
| Domain Expert | `.claude/agents/domain/`        | ux-reviewer, data-scientist   |
| Orchestrator  | `.claude/agents/orchestrators/` | master-orchestrator           |

### Step 5: Generate Agent Definition (WITH SKILL LOADING)

**CRITICAL**: The generated agent MUST include:

1. Skills listed in frontmatter `skills:` array
2. "Step 0: Load Skills" in the Workflow section with ACTUAL skill paths

Write to `.claude/agents/<category>/<agent-name>.md`:

````yaml
---
name: <agent-name>
description: <One sentence: what it does AND when to use it. Be specific about trigger conditions.>
tools: [Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch, TaskUpdate, TaskList, TaskCreate, TaskGet, Skill]
model: sonnet
temperature: 0.4
context_strategy: lazy_load  # REQUIRED: minimal, lazy_load, or full
priority: medium
skills:
  - <skill-1>
  - <skill-2>
  - task-management-protocol
context_files:
  - .claude/context/memory/learnings.md
---

# <Agent Title>

## Core Persona
**Identity**: <Role title>
**Style**: <Working style adjectives>
**Approach**: <Methodology>
**Values**: <Core principles>

## Responsibilities
1. **<Area 1>**: Description
2. **<Area 2>**: Description
3. **<Area 3>**: Description

## Capabilities
Based on current best practices:
- <Capability from web research>
- <Capability from web research>
- <Capability from web research>

## Tools & Frameworks
- <Tool/Framework from research>
- <Tool/Framework from research>
- <Pattern/Practice from research>

## Workflow

### Step 0: Load Skills (FIRST)

Invoke your assigned skills using the Skill tool:

```javascript
Skill({ skill: 'doc-generator' });
Skill({ skill: 'diagram-generator' });
````

> **CRITICAL**: Do NOT just read SKILL.md files. Use the `Skill()` tool to invoke skill workflows.
> Reading a skill file does not apply it. Invoking with `Skill()` loads AND applies the workflow.
>
> **NOTE FOR AGENT-CREATOR**: Replace these skill names with the ACTUAL skills
> you assigned in the frontmatter. Every skill in `skills:` must have
> its invocation listed here.

### Step 1-5: Execute Task

1. **Analyze**: Understand the request and context
2. **Research**: Gather relevant information
3. **Execute**: Perform the task using available tools AND skill workflows
4. **Deliver**: Produce deliverables in appropriate format
5. **Document**: Record findings to memory

> **Skill Protocol**: Your skills define specialized workflows.
> Apply them throughout your task execution.

## Response Approach

When executing tasks, follow this 8-step approach:

1. **Acknowledge**: Confirm understanding of the task
2. **Discover**: Read memory files, check task list
3. **Analyze**: Understand requirements and constraints
4. **Plan**: Determine approach and tools needed
5. **Execute**: Perform the work using tools and skills
6. **Verify**: Check output quality and completeness
7. **Document**: Update memory with learnings
8. **Report**: Summarize what was done and results

## Behavioral Traits

- <Trait 1: Domain-specific behavior>
- <Trait 2: Quality focus>
- <Trait 3: Communication style>
- <Trait 4: Error handling approach>
- <Trait 5: Testing philosophy>
- <Trait 6: Documentation practices>
- <Trait 7: Collaboration style>
- <Trait 8: Performance consideration>
- <Trait 9: Security awareness>
- <Trait 10: Continuous improvement>

> **NOTE FOR AGENT-CREATOR**: Replace these with ACTUAL behavioral traits
> specific to the agent's domain. Reference python-pro.md for examples.
> Minimum 10 traits required.

## Example Interactions

| User Request          | Agent Action         |
| --------------------- | -------------------- |
| "<example request 1>" | <how agent responds> |
| "<example request 2>" | <how agent responds> |
| "<example request 3>" | <how agent responds> |
| "<example request 4>" | <how agent responds> |
| "<example request 5>" | <how agent responds> |
| "<example request 6>" | <how agent responds> |
| "<example request 7>" | <how agent responds> |
| "<example request 8>" | <how agent responds> |

> **NOTE FOR AGENT-CREATOR**: Replace these with ACTUAL example interactions
> specific to the agent's domain. Reference python-pro.md for examples.
> Minimum 8 examples required.

## Output Locations

- Deliverables: `.claude/context/artifacts/`
- Reports: `.claude/context/reports/`
- Temporary files: `.claude/context/tmp/`

## Task Progress Protocol (MANDATORY)

**When assigned a task, use TaskUpdate to track progress:**

```javascript
// 1. Check available tasks
TaskList();

// 2. Claim your task (mark as in_progress)
TaskUpdate({
  taskId: '<your-task-id>',
  status: 'in_progress',
});

// 3. Do the work...

// 4. Mark complete when done
TaskUpdate({
  taskId: '<your-task-id>',
  status: 'completed',
  metadata: {
    summary: 'Brief description of what was done',
    filesModified: ['list', 'of', 'files'],
  },
});

// 5. Check for next available task
TaskList();
```

**The Three Iron Laws of Task Tracking:**

1. **LAW 1**: ALWAYS call TaskUpdate({ status: "in_progress" }) when starting
2. **LAW 2**: ALWAYS call TaskUpdate({ status: "completed", metadata: {...} }) when done
3. **LAW 3**: ALWAYS call TaskList() after completion to find next work

**Why This Matters:**

- Progress is visible to Router and other agents
- Work survives context resets
- No duplicate work (tasks have owners)
- Dependencies are respected (blocked tasks can't start)

## Memory Protocol (MANDATORY)

**Before starting any task:**

```bash
cat .claude/context/memory/learnings.md
```

**After completing work, record findings:**

- New pattern/solution -> Append to `.claude/context/memory/learnings.md`
- Roadblock/issue -> Append to `.claude/context/memory/issues.md`
- Decision made -> Append to `.claude/context/memory/decisions.md`

**During long tasks:** Use `.claude/context/memory/active_context.md` as scratchpad.

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

```

### Reference Agent (MANDATORY COMPARISON)

**Use `.claude/agents/domain/python-pro.md` as the canonical reference agent.**

Before finalizing any agent, compare against python-pro.md structure:

```

[ ] Has all sections python-pro has (Core Persona, Capabilities, Workflow, Response Approach, Behavioral Traits, Example Interactions, Skill Invocation Protocol, Memory Protocol)
[ ] Section order matches python-pro
[ ] Level of detail is comparable
[ ] Behavioral Traits has 10+ items (domain-specific)
[ ] Example Interactions has 8+ items (domain-specific)
[ ] Response Approach has 8 numbered steps
[ ] Skill Invocation Protocol includes Automatic and Contextual skills tables

```

**Why python-pro is the reference:**
- Most complete implementation of all required sections
- Demonstrates proper skill invocation protocol
- Shows appropriate level of detail for capabilities
- Has proper Response Approach structure

**BLOCKING**: Do not proceed if agent is missing sections that python-pro has.

### Step 6: Validate Required Fields (BLOCKING)

**Before writing agent file, verify ALL required fields are present.**

| Field | Required | Default | Notes |
|-------|----------|---------|-------|
| `name` | YES | - | lowercase-with-hyphens |
| `description` | YES | - | Single line, include trigger conditions |
| `model` | YES | sonnet | sonnet, opus, or haiku |
| `context_strategy` | YES | lazy_load | minimal, lazy_load, or full |
| `tools` | YES | [] | At least [Read] required |
| `skills` | YES | [] | List relevant skills |
| `context_files` | YES | [learnings.md] | Memory files to load |
| `temperature` | NO | 0.4 | 0.0-1.0 |
| `priority` | NO | medium | low, medium, high |

**BLOCKING**: Do not write agent file if any required field is missing.

**Validation checklist before writing:**
```

[ ] name: defined and kebab-case
[ ] description: single line, describes trigger conditions
[ ] model: one of sonnet/opus/haiku
[ ] context_strategy: one of minimal/lazy_load/full
[ ] tools: array with at least Read
[ ] skills: array (can be empty but must exist)
[ ] context_files: array with at least learnings.md
[ ] Response Approach section present with 8 steps
[ ] Behavioral Traits section present with 10+ traits
[ ] Example Interactions section present with 8+ examples

````

**Model Validation (CRITICAL):**
- model field MUST be base name only: `haiku`, `sonnet`, or `opus`
- DO NOT use dated versions like `claude-opus-4-5-20251101`
- DO NOT use full version strings like `claude-3-sonnet-20240229`
- The orchestration layer handles model resolution automatically

**Extended Thinking (NOT STANDARD):**
- `extended_thinking: true` is NOT documented in CLAUDE.md
- DO NOT add this field unless explicitly documented and requested
- If used, must have documented justification in the agent definition
- This field may cause unexpected behavior in agent spawning

**Tools Array Validation:**
- Standard tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch, TaskUpdate, TaskList, TaskCreate, TaskGet, Skill
- DO NOT add MCP tools (mcp__*) unless whitelisted in router-enforcer.cjs
- MCP tools (mcp__Exa__*, mcp__GitHub__*, etc.) cause router enforcement failures
- If MCP integration is needed, document it explicitly and verify hook compatibility

After writing, validate file was saved:

1. **YAML frontmatter is valid** - No syntax errors
2. **Required fields present** - All fields from checklist above
3. **Skills exist** - All referenced skills are in `.claude/skills/`
4. **File saved correctly** - Glob to verify file exists

### Step 7: Update CLAUDE.md Routing Table (MANDATORY - BLOCKING)

**This step is AUTOMATIC and BLOCKING. Do not skip.**

After agent file is written, you MUST update the CLAUDE.md routing table:

1. **Parse CLAUDE.md Section 3** ("AGENT ROUTING TABLE")
2. **Generate routing entry**:
   ```markdown
   | {request_type} | `{agent_name}` | `.claude/agents/{category}/{agent_name}.md` |
````

3. **Find correct insertion point** (alphabetical within category, or at end of relevant section)
4. **Insert using Edit tool**
5. **Verify with**:
   ```bash
   grep "{agent-name}" .claude/CLAUDE.md || echo "ERROR: CLAUDE.md ROUTING TABLE NOT UPDATED!"
   ```

**BLOCKING**: If routing table update fails, agent creation is INCOMPLETE. Do NOT proceed to spawning the agent.

**Why this is mandatory**: Agents not in the routing table will NEVER be spawned by the Router. An agent without a routing entry is effectively invisible to the system.

### Step 7.5: Update Router-Enforcer (MANDATORY - BLOCKING)

**This step is MANDATORY and BLOCKING. Without it, the Router cannot discover the agent.**

After updating CLAUDE.md, you MUST register the agent in router-enforcer.cjs:

#### Required Updates

1. **Add to `intentKeywords` object** with keywords from Step 2.5:

   ```javascript
   // In router-enforcer.cjs intentKeywords section
   '<agent-name>': [
     // High-confidence keywords (unique to this agent)
     'keyword1', 'keyword2',
     // Action verbs
     'review', 'analyze',
     // Problem indicators
     'need help with X'
   ],
   ```

2. **Add to `ROUTING_TABLE` object**:

   ```javascript
   // In router-enforcer.cjs ROUTING_TABLE section
   '<agent-name>': {
     path: '.claude/agents/<category>/<agent-name>.md',
     primaryKeywords: ['keyword1', 'keyword2'],  // High-confidence from Step 2.5
     secondaryKeywords: ['keyword3', 'keyword4']  // Medium-confidence from Step 2.5
   },
   ```

3. **Add to `SCORING_BOOSTS` if needed** (for high-priority agents):
   ```javascript
   // In router-enforcer.cjs SCORING_BOOSTS section
   '<agent-name>': { boost: 5, condition: 'specific_intent_type' },
   ```

#### Verification

```bash
grep "<agent-name>" .claude/hooks/routing/router-enforcer.cjs || echo "ERROR: Agent not in router-enforcer.cjs - AGENT CREATION INCOMPLETE"
```

**BLOCKING**: If router-enforcer update fails, agent creation is INCOMPLETE. The agent will never be discovered by the Router.

**Why this is mandatory**: The router-enforcer.cjs uses keyword matching to select agents. Without keyword registration, the Router's scoring algorithm cannot consider this agent for any request.

### Step 8: Create Workflow & Update Memory

The CLI tool automatically:

1. **Creates a workflow example** in `.claude/workflows/<agent-name>-workflow.md`
2. **Updates memory** in `.claude/context/memory/learnings.md` with routing hints

```bash
# Create agent with full self-evolution
node .claude/tools/agent-creator/create-agent.mjs \
  --name "ux-reviewer" \
  --description "Reviews mobile app UX and accessibility" \
  --original-request "Review the UX of my iOS app"
```

This outputs a spawn command for the Task tool to immediately execute the original request.

### Step 9: Execute the Agent

**Option A: Use output spawn command (recommended for self-evolution)**
The CLI outputs a Task spawn command when `--original-request` is provided:

```javascript
Task({
  subagent_type: 'general-purpose',
  description: 'ux-reviewer executing original task',
  prompt: 'You are the UX-REVIEWER agent...',
});
```

**Option B: Spawn via Task tool manually**

```javascript
Task({
  subagent_type: 'general-purpose',
  description: 'Execute task with new agent',
  prompt: 'You are <AGENT>. Read .claude/agents/domain/<name>.md and complete: <task>',
});
```

**Option C: Run in separate terminal (new session)**

```bash
node .claude/tools/agent-creator/spawn-agent.mjs --agent "<name>" --prompt "<task>"
```

## Agent Naming Conventions

- **Format**: `lowercase-with-hyphens`
- **Pattern**: `<domain>-<role>` (e.g., `ux-reviewer`, `data-analyst`)
- **Avoid**: Generic names like `helper`, `assistant`, `agent`

## Examples

### Example 1: UX Reviewer for Mobile Apps (Complete Flow)

**User**: "I need a UX review of an Apple mobile app"

1. **Check**: No `ux-reviewer*.md` or `mobile*.md` agent exists
2. **Research**:
   - `WebSearch: "mobile UX review best practices 2026 iOS"`
   - `WebSearch: "Apple Human Interface Guidelines evaluation criteria"`
3. **Find skills**: Scan `.claude/skills/*/SKILL.md`:
   - `diagram-generator` for wireframes
   - `doc-generator` for reports
   - `task-management-protocol` for task tracking
4. **Create** `.claude/agents/domain/mobile-ux-reviewer.md`:

````yaml
---
name: mobile-ux-reviewer
description: Reviews mobile app UX against Apple HIG and accessibility standards. Use for UX audits and accessibility compliance checks.
tools: [Read, WebSearch, WebFetch, TaskUpdate, TaskList, TaskCreate, TaskGet, Skill]
model: sonnet
temperature: 0.4
context_strategy: lazy_load
skills:
  - diagram-generator
  - doc-generator
  - task-management-protocol
context_files:
  - .claude/context/memory/learnings.md
---

# Mobile UX Reviewer

## Core Persona
**Identity**: UX/Accessibility Specialist
...

## Workflow

### Step 0: Load Skills (FIRST)

Invoke your assigned skills using the Skill tool:

```javascript
Skill({ skill: 'diagram-generator' });
Skill({ skill: 'doc-generator' });
````

> **CRITICAL**: Use `Skill()` tool, not `Read()`. Skill() loads AND applies the workflow.

### Step 1-5: Execute Task

...

````

5. **Execute**: Spawn via Task tool

### Example 2: Data Scientist Agent

**User**: "Analyze this dataset and build a prediction model"

1. **Check**: No `data-scientist*.md` agent exists
2. **Research**:
   - `WebSearch: "data science workflow best practices 2026"`
   - `WebSearch: "machine learning model evaluation techniques"`
3. **Find skills**: `text-to-sql`, `diagram-generator`, `doc-generator`, `task-management-protocol`
4. **Create**: `.claude/agents/domain/data-scientist.md`
5. **Execute**: Task tool with new agent

### Example 3: API Integration Specialist

**User**: "Help me integrate with the Stripe API"

1. **Check**: No `stripe*.md` or `api-integration*.md` agent exists
2. **Research**:
   - `WebSearch: "Stripe API integration best practices 2026"`
   - `WebFetch: "https://stripe.com/docs"` (extract key patterns)
3. **Find skills**: `github-ops`, `test-generator`, `doc-generator`, `task-management-protocol`
4. **Create**: `.claude/agents/domain/api-integrator.md`
5. **Execute**: Spawn agent to complete integration

## Integration with Router

The Router should output this when no agent matches:

```json
{
  "intent": "specialized_task",
  "complexity": "medium",
  "target_agent": "agent-creator",
  "reasoning": "No existing agent matches UX review for mobile apps. Creating specialized agent.",
  "original_request": "<user's original request>"
}
````

## Persistence

- Agents saved to `.claude/agents/` persist across sessions
- Next session automatically discovers new agents via `/agents` command
- Skills assigned in frontmatter are available to the agent

## File Placement & Standards

### Output Location Rules

This skill outputs to: `.claude/agents/<category>/`

Categories:

- `core/` - fundamental agents (developer, planner, architect, etc.)
- `domain/` - language/framework specialists (python-pro, etc.)
- `specialized/` - task-specific agents (security-architect, etc.)
- `orchestrators/` - multi-agent coordinators

### Mandatory References

- **File Placement**: See `.claude/docs/FILE_PLACEMENT_RULES.md`
- **Developer Workflow**: See `.claude/docs/DEVELOPER_WORKFLOW.md`
- **Artifact Naming**: See `.claude/docs/ARTIFACT_NAMING.md`

### Enforcement

File placement is enforced by `file-placement-guard.cjs` hook.
Invalid placements will be blocked in production mode.

---

## Memory Protocol (MANDATORY)

**Before creating an agent:**

```bash
cat .claude/context/memory/learnings.md
```

Check for patterns in previous agent creations.

**After creating an agent:**

- Record the new agent pattern to `.claude/context/memory/learnings.md`
- If the domain is new, add to `.claude/context/memory/decisions.md`

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

## Iron Laws of Agent Creation

These rules are INVIOLABLE. Breaking them causes silent failures.

```
1. NO AGENT WITHOUT TOOLS FIELD
   - Every agent MUST have tools: [Read, ...] in frontmatter
   - Agents without tools cannot perform actions

2. NO AGENT WITHOUT SKILLS FIELD
   - Every agent SHOULD have skills: [...] in frontmatter
   - Skills provide specialized workflows

3. NO MULTI-LINE YAML DESCRIPTIONS
   - description: | causes parsing failures
   - Always use single-line description

4. NO SKILLS THAT DON'T EXIST
   - Every skill in skills: array must exist at .claude/skills/<skill>/SKILL.md
   - Run: node .claude/tools/validate-agents.mjs to catch broken pointers

5. NO AGENT WITHOUT MEMORY PROTOCOL
   - Every agent MUST have Memory Protocol section in body
   - Without it, learnings are lost

6. NO AGENT WITHOUT ROUTING TABLE ENTRY
   - After creating agent, add to CLAUDE.md routing table
   - Unrouted agents are never spawned

7. NO CREATION WITHOUT SYSTEM IMPACT ANALYSIS
   - Update CLAUDE.md routing table (MANDATORY)
   - Update router.md agent tables (MANDATORY)
   - Check if new workflows are needed
   - Check if related agents need skill updates
   - Document all system changes made

8. NO AGENT WITHOUT TASK TRACKING
   - Every agent MUST include Task Progress Protocol section
   - Every agent MUST have task tools in tools: array
   - Without task tracking, work is invisible to Router

9. NO AGENT WITHOUT ROUTER KEYWORDS
   - Every agent MUST have researched keywords (Step 2.5)
   - Keywords must be documented in research report
   - Agent must be registered in router-enforcer.cjs with keywords
   - Without router keywords, agent will never be discovered by Router

10. NO AGENT WITHOUT RESPONSE APPROACH
    - Every agent MUST have Response Approach section with 8 numbered steps
    - Every agent MUST have Behavioral Traits section with 10+ domain-specific traits
    - Every agent MUST have Example Interactions section with 8+ examples
    - Without these sections, execution strategy is undefined
    - Reference python-pro.md for canonical structure
```

## System Impact Analysis (MANDATORY)

**After creating ANY agent, you MUST analyze and update system-wide impacts.**

### Impact Checklist

Run this analysis after every agent creation:

```
[AGENT-CREATOR] System Impact Analysis for: <agent-name>

1. ROUTING TABLE UPDATE (MANDATORY)
   - Add entry to CLAUDE.md routing table
   - Format: | Request Type | agent-name | .claude/agents/<category>/<name>.md |
   - Choose appropriate request type keywords

2. ROUTER AGENT UPDATE (MANDATORY)
   - Update router.md Core/Specialized/Domain agent tables
   - Add to Planning Orchestration Matrix if applicable
   - Add example spawn pattern if complex

3. SKILL ASSIGNMENT CHECK
   - Are all assigned skills valid? (validate-agents.mjs checks this)
   - Should any existing skills be assigned to this agent?
   - Scan .claude/skills/ for relevant unassigned skills

4. WORKFLOW CHECK
   - Does this agent need a dedicated workflow?
   - Should it be added to existing enterprise workflows?
   - Create/update .claude/workflows/ as needed

5. RELATED AGENT CHECK
   - Does this agent overlap with existing agents?
   - Should existing agents reference this one?
   - Update Planning Orchestration Matrix for multi-agent patterns
```

### Example: Creating a "technical-writer" Agent

```
[AGENT-CREATOR] Created: .claude/agents/core/technical-writer.md

[AGENT-CREATOR] System Impact Analysis...

1. ROUTING TABLE UPDATE
   Added to CLAUDE.md:
   | Documentation, docs | technical-writer | .claude/agents/core/technical-writer.md |

2. ROUTER AGENT UPDATE
   Added to router.md Core Agents table
   Added to Planning Orchestration Matrix:
   | Documentation (new/update) | technical-writer | - | Single |

3. SKILL ASSIGNMENT CHECK
   Assigned skills: writing, doc-generator, writing-skills, task-management-protocol
   All skills exist and validated

4. WORKFLOW CHECK
   Consider creating: .claude/workflows/documentation-workflow.md

5. RELATED AGENT CHECK
   No overlap with existing agents
   Planner may delegate doc tasks to this agent
```

### System Update Commands

```bash
# Add to CLAUDE.md routing table (edit manually)
# Look for "## 3. AGENT ROUTING TABLE" section

# Update router.md agent tables (edit manually)
# Look for "Core Agents:" or "Specialized Agents:" sections

# Verify routing table entry exists
grep "<agent-name>" .claude/CLAUDE.md || echo "ERROR: Not in routing table!"

# Verify router.md entry exists
grep "<agent-name>" .claude/agents/core/router.md || echo "ERROR: Not in router!"

# Full validation
node .claude/tools/validate-agents.mjs
```

### Validation Checklist (Run After Every Creation) - BLOCKING

**This checklist is BLOCKING. All items must pass before agent creation is complete.**

```bash
# Verify keyword research report exists (Step 2.5) - MANDATORY
[ -f ".claude/context/artifacts/research-reports/agent-keywords-<agent-name>.md" ] || echo "ERROR: Keyword research report missing - AGENT CREATION INCOMPLETE"

# Validate the new agent
node .claude/tools/validate-agents.mjs 2>&1 | grep "<agent-name>"

# Verify skills exist
for skill in $(grep -A10 "^skills:" .claude/agents/<category>/<agent>.md | grep "  - " | sed 's/  - //'); do
  [ -f ".claude/skills/$skill/SKILL.md" ] || echo "BROKEN: $skill"
done

# Check CLAUDE.md routing table - MANDATORY
grep "<agent-name>" .claude/CLAUDE.md || echo "ERROR: Not in routing table - AGENT CREATION INCOMPLETE"

# Check router-enforcer.cjs keywords registration (Step 7.5) - MANDATORY
grep "<agent-name>" .claude/hooks/routing/router-enforcer.cjs || echo "ERROR: Agent not in router-enforcer.cjs - AGENT CREATION INCOMPLETE"
```

**Completion Checklist** (all must be checked):

```
[ ] Step 2.5 keyword research completed (3+ Exa searches)
[ ] Keyword research report saved to .claude/context/artifacts/research-reports/agent-keywords-<name>.md
[ ] Agent file created at .claude/agents/<category>/<name>.md
[ ] All required YAML fields present (name, description, model, context_strategy, tools, skills, context_files)
[ ] model field is base name only (sonnet/opus/haiku) - NO dated versions
[ ] NO extended_thinking field unless explicitly documented
[ ] NO MCP tools (mcp__*) unless whitelisted
[ ] All assigned skills exist in .claude/skills/
[ ] CLAUDE.md routing table updated
[ ] Routing table entry verified with grep
[ ] validate-agents.mjs passes for new agent
[ ] Task Progress Protocol section included in agent body
[ ] Task tools included in tools: array
[ ] Router keywords registered in router-enforcer.cjs (Iron Law #9)
[ ] Response Approach section present with 8 numbered steps (Iron Law #10)
[ ] Behavioral Traits section present with 10+ domain-specific traits (Iron Law #10)
[ ] Example Interactions section present with 8+ examples (Iron Law #10)
[ ] Compared against python-pro.md reference agent structure
```

**BLOCKING**: If ANY item fails, agent creation is INCOMPLETE. Fix all issues before proceeding.

---

## Workflow Integration

This skill is part of the unified artifact lifecycle. For complete multi-agent orchestration:

**Router Decision:** `.claude/workflows/core/router-decision.md`

- How the Router discovers and invokes this skill's artifacts

**Artifact Lifecycle:** `.claude/workflows/core/skill-lifecycle.md`

- Discovery, creation, update, deprecation phases
- Version management and registry updates
- CLAUDE.md integration requirements

**External Integration:** `.claude/workflows/core/external-integration.md`

- Safe integration of external artifacts
- Security review and validation phases

---

## Cross-Reference: Creator Ecosystem

This skill is part of the **Creator Ecosystem**. After creating an agent, consider whether companion creators are needed:

| Creator              | When to Use                                     | Invocation                             |
| -------------------- | ----------------------------------------------- | -------------------------------------- |
| **skill-creator**    | Agent needs new skills not in `.claude/skills/` | `Skill({ skill: 'skill-creator' })`    |
| **workflow-creator** | Agent needs orchestration workflow              | `Skill({ skill: 'workflow-creator' })` |
| **template-creator** | Agent needs code templates                      | `Skill({ skill: 'template-creator' })` |
| **schema-creator**   | Agent needs input/output validation schemas     | `Skill({ skill: 'schema-creator' })`   |
| **hook-creator**     | Agent needs pre/post execution hooks            | `Skill({ skill: 'hook-creator' })`     |

### Integration Workflow

After creating an agent that needs additional capabilities:

```javascript
// 1. Agent created but needs new skill
Skill({ skill: 'skill-creator' });
// Create the skill, then update agent's skills: array

// 2. Agent needs MCP server integration
// Use skill-creator to convert MCP server to skill
// node .claude/skills/skill-creator/scripts/convert.cjs --server "@modelcontextprotocol/server-xyz"

// 3. Agent needs workflow
// Create workflow in .claude/workflows/<agent-name>-workflow.md
// Update CLAUDE.md Section 8.6 if enterprise workflow
```

### Post-Creation Checklist for Ecosystem Integration

After agent is fully created and validated:

```
[ ] Does agent need skills that don't exist? -> Use skill-creator
[ ] Does agent need multi-phase orchestration? -> Create workflow
[ ] Does agent need code scaffolding? -> Create templates
[ ] Does agent interact with external services? -> Consider MCP integration
[ ] Should agent be part of enterprise workflows? -> Update Section 8.6
```


---
Source attribution: David-Li0406
Original project: https://github.com/David-Li0406/meta-skill-evloving/blob/ca3a335628981df10c36e00cb9850df2c247ab9a/skill-flow/data/skills-refined-36k/skillsmp/agent-creator-6/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Mega AI Hub resource metadata

Creator / publisher: David-Li0406
Original project: https://github.com/David-Li0406/meta-skill-evloving/blob/ca3a335628981df10c36e00cb9850df2c247ab9a/skill-flow/data/skills-refined-36k/skillsmp/agent-creator-6/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: ML / AI Engineer, Product Manager, Technical Product Manager
Specialties: API
Tools: Glob, Task, Websearch
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: f0c6a6d72f482d3ae46efa178646dfb9615e3ff8158284ec5ddc7aa7ed82c559
