Agent creator

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

Agent creator is an AI agent skill from the GitHub repository diegosouzapw/awesome-omni-skill. Create and optimize Claude Code subagent files (.claude/agents/*.md) following official best practices. Use when user asks to create a subagent, agent file, custom agent, or needs help structuring agent files with YAML frontmatter.

How to use this skill

Skill file

Creating Subagents (Agent Files)

Guide for creating Claude Code subagents following Anthropic's official best practices (January 2026).

File Format

Subagents are Markdown files with YAML frontmatter:

---
name: code-reviewer
description: Expert code review specialist. Use proactively after code changes.
tools: Read, Grep, Glob, Bash
model: sonnet
---

You are a senior code reviewer ensuring high standards.

When invoked:

1. Run git diff to see recent changes
2. Focus on modified files
3. Begin review immediately

Required Fields

Only two fields are required:

Directory Locations

Priority hierarchy (higher priority wins):

  1. --agents CLI flag (session only)
  2. .claude/agents/ (project-level, version-controlled)
  3. ~/.claude/agents/ (user-level, all projects)
  4. Plugin agents/ (lowest)

Frontmatter Fields

| Field | Required | Description |

| ----------------- | -------- | ---------------------------------------------------------------- |

| name | ✅ Yes | Unique identifier (kebab-case) |

| description | ✅ Yes | Delegation trigger description |

| tools | No | Allowlist (inherits all if omitted) |

| disallowedTools | No | Denylist to remove |

| model | No | sonnet, opus, haiku, or inherit (default) |

| permissionMode | No | default, acceptEdits, dontAsk, bypassPermissions, plan |

| skills | No | Skills to preload at startup |

| hooks | No | Lifecycle hooks scoped to this subagent |

Creating Subagents

Three methods:

  1. Interactive: /agents in Claude Code TUI
  2. Manual: Create .claude/agents/my-agent.md or ~/.claude/agents/my-agent.md
  3. CLI: claude --agents '{"agent-name": {...}}'

After manual creation, restart session or run /agents to load.

Writing Effective Descriptions

Critical for automatic delegation. Include:

  1. What the subagent does
  2. When to use it
  3. Proactive triggers (recommended)

Good:

description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.

Bad:

description: Code reviewer # Too vague, missing triggers

Tool Access Control

Allowlist:

tools: Read, Grep, Glob, Bash

Denylist:

disallowedTools: Write, Edit

Default: Inherits all tools from main conversation (including MCP tools) if tools omitted.

Model Selection

model: haiku      # Fast, read-only exploration
model: sonnet     # Balanced (code review, debugging)
model: opus       # Complex reasoning
model: inherit    # Match main conversation (default)

Permission Modes

| Mode | Behavior |

| ------------------- | --------------------------- |

| default | Standard permission prompts |

| acceptEdits | Auto-accept file edits only |

| dontAsk | Auto-deny prompts |

| bypassPermissions | Skip all checks |

| plan | Read-only (Plan mode) |

Note: Parent bypassPermissions takes precedence.

Preloading Skills

skills:
  - api-conventions
  - error-handling-patterns

Key: Full content injected at startup. Subagents don't inherit skills from parent conversation.

System Prompt Patterns

The Markdown body becomes the system prompt. Use:

Automatic Delegation

Claude delegates based on task description, description field, and context.

Encourage proactive delegation: Include "use proactively" in descriptions.

Explicit invocation:

Use the code-reviewer subagent to review my changes

When to Use Subagents

Use subagents when:

Use main conversation when:

Limitation: Subagents cannot spawn other subagents. Chain from main conversation or use Skills.

File Naming

Loading Behavior

Version Control

Project subagents (.claude/agents/): ✅ Check into version control, share with team

User subagents (~/.claude/agents/): Personal preferences, keep out of version control

Reference Files

Fundamental Principle

Focused, specialized assistants with clear delegation triggers and appropriate tool restrictions. Design them to solve specific, well-defined problems that benefit from isolated context or enforced constraints.

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.