Skip to content
Skills Library
AI & agents · Building & coding

agent-authoring

/agent-authoring

Creates and configures Claude Code subagents (custom agents). Covers frontmatter fields, tool restrictions, model selection, hooks, memory, skills preloading, and common patterns. Follows official Anthropic best practices. USE WHEN: user mentions "create agent", "subagent", "custom agent", ".claude/agents", "agent file", "delegate task", "isolated context", "agent memory", "agent hooks" DO NOT USE FOR: creating skills - use `skill-authoring`; creating hooks standalone - use `hook-authoring`; creating MCP servers - use `mcp-authoring`

Licence
MIT
Last repository change
21.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Creates and configures Claude Code subagents (custom agents). Covers frontmatter fields, tool restrictions, model selection, hooks, memory, skills preloading, and common patterns. Follows official Anthropic best practices. USE WHEN: user mentions "create agent", "subagent", "custom agent", ".claude/agents", "agent file", "delegate task", "isolated context", "agent memory", "agent hooks" DO NOT USE FOR: creating skills - use `skill-authoring`; creating hooks standalone - use `hook-authoring`; creating MCP servers - use `mcp-authoring`

Triggers from the description

create agentsubagentcustom agent.claude/agentsagent filedelegate taskisolated contextagent memory
Original author description

Creates and configures Claude Code subagents (custom agents). Covers frontmatter fields, tool restrictions, model selection, hooks, memory, skills preloading, and common patterns. Follows official Anthropic best practices. USE WHEN: user mentions "create agent", "subagent", "custom agent", ".claude/agents", "agent file", "delegate task", "isolated context", "agent memory", "agent hooks" DO NOT USE FOR: creating skills - use `skill-authoring`; creating hooks standalone - use `hook-authoring`; creating MCP servers - use `mcp-authoring`

How it works

  1. File Structure
  2. YAML Frontmatter — All Fields
  3. System Prompt (Body)
  4. Description — Critical for Delegation
  5. Key Design Decisions
  6. Common Patterns
  7. Memory
  8. Anti-Patterns
  9. Checklist
  10. Reference
Original SKILL.md headings · 149 lines, 750 words
SKILL.md preview
---
name: agent-authoring
description: |
  Creates and configures Claude Code subagents (custom agents). Covers frontmatter
  fields, tool restrictions, model selection, hooks, memory, skills preloading,
  and common patterns. Follows official Anthropic best practices.

  USE WHEN: user mentions "create agent", "subagent", "custom agent", ".claude/agents",
  "agent file", "delegate task", "isolated context", "agent memory", "agent hooks"

  DO NOT USE FOR: creating skills - use `skill-authoring`;
  creating hooks standalone - use `hook-authoring`;
  creating MCP servers - use `mcp-authoring`
allowed-tools: Read, Grep, Glob, Write, Edit
---
# Agent/Subagent Authoring — Official Best Practices

## File Structure

Agents are Markdown files with YAML frontmatter. The body becomes the system prompt.

```
.claude/agents/my-agent.md     # Project-scoped (commit to VCS)
~/.claude/agents/my-agent.md   # User-scoped (all projects)
```

## YAML Frontmatter — All Fields

See [quick-ref/frontmatter-reference.md](quick-ref/frontmatter-reference.md) for detailed field docs.

```yaml
---
name: code-reviewer                # Required. Lowercase + hyphens
description: |                     # Required. When Claude should delegate
  Expert code review specialist. Use proactively after code changes.
tools: Read, Grep, Glob, Bash     # Allowlist (inherits all if omitted)
disallowedTools: Write, Edit       # Denylist (removed from inherited/allowed)
model: sonnet                      # sonnet | opus | haiku | inherit (default)
permissionMode: default            # default | acceptEdits | dontAsk | bypassPermissions | plan
maxTurns: 50                       # Max agentic turns before stopping
skills:                            # Skills preloaded into context at startup
  - api-conventions
  - error-handling
mcpServers:                        # MCP servers available to this agent
  - slack                          # Reference existing server by name
memory: user                       # user | project | local — persistent memory
background: false                  # true = always run as background task
isolation: worktree                # Run in temporary git worktree
hooks:                             # Lifecycle hooks (scoped to this agent)
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: "./scripts/validate.sh"
---
```

## System Prompt (Body)

The markdown body IS the system prompt. Subagents receive ONLY this + basic env details (cwd, etc.), NOT the full Claude Code system prompt.

**Effective prompt structure:**
```markdown
You are a [role] specializing in [domain].

When invoked:
1. [First action]
2. [Second action]
3. [Third action]

[Domain-specific checklist or criteria]

Provide feedback organized by:
- Critical issues (must fix)
- Warnings (should fix)
- Suggestions (consider)

Include specific examples of how to fix issues.
```

## Description — Critical for Delegation

Claude delegates based on the description. Include "Use proactively" to encourage automatic delegation.

**Good:** `"Expert code review specialist. Use proactively after code changes."`
**Bad:** `"Reviews code"` — too vague, Claude won't know when to delegate.

## Key Design Decisions

### When to use agents vs skills vs main conversation

| Use Case | Mechanism |
|----------|-----------|
| Verbose output you don't need in main context | Agent |
| Enforce tool restrictions | Agent |
| Self-contained work returning a summary | Agent |
| Reusable knowledge/instructions inline | Skill |
| Frequent back-and-forth needed | Main conversation |
| Quick, targeted changes | Main conversation |

### Model selection

| Model | Use for |
|-------|---------|
| `haiku` | Fast exploration, simple search, low-cost |
| `sonnet` | Balanced — code review, analysis, most tasks |
| `opus` | Complex reasoning, architecture decisions |
| `inherit` | Same as main conversation (default) |

### Tool restrictions

- Read-only agent: `tools: Read, Grep, Glob, Bash`
- Full capabilities: omit `tools` (inherits all)
- Block specific tools: `disallowedTools: Write, Edit`
- Restrict spawning: `tools: Agent(worker, researcher), Read`

## Common Patterns

See [quick-ref/patterns.md](quick-ref/patterns.md) for detailed examples.

**Code reviewer** — Read-only, focused on quality
**Debugger** — Can edit, diagnosis-to-fix workflow
**Domain expert** — Specialized knowledge (data science, security)
**Parallel research** — Multiple agents exploring independently
**Chain** — Sequential agents, each building on previous results

## Memory

When `memory` is set, the agent gets a persistent directory across sessions.

| Scope | Location | Use when |
|-------|----------|----------|
| `user` | `~/.claude/agent-memory/<name>/` | Learnings across all projects |
| `project` | `.claude/agent-memory/<name>/` | Project-specific, shareable via VCS |
| `local` | `.claude/agent-memory-local/<name>/` | Project-specific, not committed |

The agent automatically gets Read/Write/Edit tools + instructions for managing MEMORY.md.

**Tip:** Include in prompt: "Update your agent memory as you discover patterns, codepaths, and architectural decisions."

## Anti-Patterns

| Anti-Pattern | Fix |
|--------------|-----|
| Too many responsibilities | One agent, one job. Create separate agents for different tasks |
| No description or vague description | Detailed description with "use proactively" |
| Overly permissive tools | Grant only what's needed |
| Expecting subagents to spawn subagents | Not supported. Use chains from main conversation |
| Forgetting subagents lose parent context | They start fresh. Preload skills or provide full instructions |

## Checklist

- [ ] `name` and `description` set (both required)
- [ ] Description explains WHEN to delegate, not just what
- [ ] Tools restricted to minimum necessary
- [ ] Model chosen based on task complexity
- [ ] System prompt has clear workflow steps
- [ ] Tested with real scenarios
- [ ] Committed to `.claude/agents/` (project) or `~/.claude/agents/` (user)

## Reference
- [All frontmatter fields](quick-ref/frontmatter-reference.md)
- [Common agent patterns](quick-ref/patterns.md)
Files in this package (3)
  • SKILL.md 6 KB
  • quick-ref/frontmatter-reference.md 4 KB
  • quick-ref/patterns.md 4 KB

Versions

RepositoryScoreLicence
This page · claude-dev-suite/claude-dev-suite100MIT
fabiensalles/claude-marketplace95MIT

Database snapshot: 13.11.2026 · package version 37c14d403d2d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100skill-authoring
    Creates and improves Claude Code Skills (SKILL.md files). Covers frontmatter, descriptions, progressive disclosure, bundled resources, and content guidelines. Follows official Anthropic best practices. USE WHEN: user mentions "create skill", "write skill", "SKILL.md", "skill…
  • 100plugin-authoring
    Creates Claude Code plugins that package skills, agents, hooks, and MCP servers into distributable bundles. Covers plugin.json manifest, directory structure, namespacing, and distribution. Follows official Anthropic best practices. USE WHEN: user mentions "create plugin",…
  • 100creating-skills
    Guide for creating Claude Code skills following Anthropic's official best practices. Use when user wants to create a new skill, build a skill, write SKILL.md, update an existing skill, or needs skill creation guidelines. Provides structure, frontmatter fields, naming…
  • 100subagent-authoring
    Create, review, refactor or slim down Claude Code subagents (`.claude/agents/*.md`). Use whenever the user mentions subagents, agent definitions, agent frontmatter (tools, model, skills, memory, hooks), a bloated or overlapping agent, splitting or merging agents, delegation not…
  • 100claude-agents
    Guide for creating custom agents (subagents) for Claude Code. Use when writing agents/*.md files, choosing agent frontmatter (tools, model, skills, permissionMode, maxTurns), restricting a subagent tool allowlist, preloading skills into an agent, or troubleshooting agent invocation.
  • 100create-agent-skills
    Expert guidance for creating, writing, building, and refining Claude Code Skills. Use when working with SKILL.md files, authoring new skills, improving existing skills, or understanding skill structure and best practices.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.