Official agent skill

Claude Code Agent Development

by anthropics in anthropics/claude-plugins-official

Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

OfficialApache-2.0Auto-check passedAgent Workflows

Install Claude Code Agent Development

skills CLI
$ npx skills add anthropics/claude-plugins-official --skill agent-development -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install anthropics/claude-plugins-official agent-development --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/anthropics/claude-plugins-official.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/plugin-dev/skills/agent-development .claude/skills/agent-development && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-development
GitHub stars
37k
Used in
8 other repos
Token cost
~2.8k tokens
SKILL.md length
959 words
Files
7 (incl. scripts, references)
Skills in repo
29
Repo updated
First seen
Licence
Apache-2.0

At a glance

Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

  • Works in 3 steps: Triggering conditions ("Use this agent… → A short prose summary of the typical… → A pointer to a "When to invoke" section…
  • Creating a new agent for a Claude Code plugin
  • SKILL.md covers Overview, Agent File Structure, Frontmatter Fields and System Prompt Design, plus 5 more sections
  • Runs Shell scripts from its folder

What it does

The skill treats agents as autonomous subprocesses for complex, multi-step work, in contrast to commands, which cover actions you start yourself. An agent is a markdown file with YAML frontmatter followed by a system prompt that defines its behavior. The frontmatter covers a name, a description that tells Claude when to trigger the agent, a model, and a color.

The name must use lowercase letters, numbers and hyphens, run from 3 to 50 characters and start and end with an alphanumeric. The description is called the most critical field because it sits in context whenever the agent is registered and lets the harness decide when to dispatch it. A good one states the triggering conditions, summarizes two to four typical scenarios, covers both proactive and reactive triggering, and says when not to use the agent. The model field takes inherit, which is recommended, or a named model such as sonnet or opus.

Supporting material includes example agents and an agent-creation prompt, reference notes on system prompt design and triggering examples, and a validate-agent.sh script for checking an agent file.

When your agent uses it

  • Creating a new agent for a Claude Code plugin
  • Writing the description and trigger examples that decide when an agent runs
  • Choosing the model and color settings for an agent
  • Reviewing the system prompt design of an existing agent

Example prompts

  • “Create a code-reviewer agent for my plugin that triggers after I finish a feature.”
  • “Write the frontmatter for a test-generator subagent and explain what its description needs.”
  • “Check whether agents/api-docs-writer.md follows the naming and description rules.”

Requirements

  • A Claude Code plugin to hold the agent files

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Triggering conditions ("Use this agent when...")
  2. A short prose summary of the typical trigger scenarios
  3. A pointer to a "When to invoke" section in the agent body for the detailed worked scenarios

What it can do on your machine

Read from SKILL.md and the folder at commit d4226d0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Claude Code Agent Development loads about 2.8k tokens when it runs, and up to ~9.9k if it reads all its reference files. Until then it costs about 94 tokens; SKILL.md has 959 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from anthropics/claude-plugins-official at commit d4226d0, republished under its Apache-2.0 licence (© anthropics). 959 words, ~2,777 tokens.

Download SKILL.mdSave it as .claude/skills/agent-development/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
agent-development
description
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
version
0.1.0

Agent Development for Claude Code Plugins

Overview

Agents are autonomous subprocesses that handle complex, multi-step tasks independently. Understanding agent structure, triggering conditions, and system prompt design enables creating powerful autonomous capabilities.

Key concepts:

  • Agents are FOR autonomous work, commands are FOR user-initiated actions
  • Markdown file format with YAML frontmatter
  • Triggering via description field with examples
  • System prompt defines agent behavior
  • Model and color customization

Agent File Structure

Complete Format
markdown
---
name: agent-identifier
description: Use this agent when [triggering conditions]. Typical triggers include [scenario 1 in prose], [scenario 2 in prose], and [scenario 3 in prose]. See "When to invoke" in the agent body for worked scenarios.
model: inherit
color: blue
tools: ["Read", "Write", "Grep"]
---

You are [agent role description]...

## When to invoke

[Two to four representative scenarios written as prose, e.g.:]
- **[Scenario name].** [What the situation looks like and what the agent should do.]
- **[Scenario name].** [Same.]

**Your Core Responsibilities:**
1. [Responsibility 1]
2. [Responsibility 2]

**Analysis Process:**
[Step-by-step workflow]

**Output Format:**
[What to return]

Frontmatter Fields

name (required)

Agent identifier used for namespacing and invocation.

Format: lowercase, numbers, hyphens only Length: 3-50 characters Pattern: Must start and end with alphanumeric

Good examples:

  • code-reviewer
  • test-generator
  • api-docs-writer
  • security-analyzer

Bad examples:

  • helper (too generic)
  • -agent- (starts/ends with hyphen)
  • my_agent (underscores not allowed)
  • ag (too short, < 3 chars)
description (required)

Defines when Claude should trigger this agent. This is the most critical field — it is loaded into context whenever the agent is registered, so the harness can decide when to dispatch.

Must include:

  1. Triggering conditions ("Use this agent when...")
  2. A short prose summary of the typical trigger scenarios
  3. A pointer to a "When to invoke" section in the agent body for the detailed worked scenarios

Format:

Use this agent when [conditions]. Typical triggers include [scenario 1 in prose], [scenario 2 in prose], and [scenario 3 in prose]. See "When to invoke" in the agent body for worked scenarios.

Best practices:

  • Name 2-4 trigger scenarios in the prose summary
  • Cover both proactive (assistant invokes itself) and reactive (user requests) triggering
  • Cover different phrasings of the same intent
  • Be specific about when NOT to use the agent
  • Put detailed scenarios in the body under "When to invoke" as a bullet list of prose descriptions
model (required)

Which model the agent should use.

Options:

  • inherit - Use same model as parent (recommended)
  • sonnet - Claude Sonnet (balanced)
  • opus - Claude Opus (most capable, expensive)
  • haiku - Claude Haiku (fast, cheap)

Recommendation: Use inherit unless agent needs specific model capabilities.

color (required)

Visual identifier for agent in UI.

Options: blue, cyan, green, yellow, magenta, red

Guidelines:

  • Choose distinct colors for different agents in same plugin
  • Use consistent colors for similar agent types
  • Blue/cyan: Analysis, review
  • Green: Success-oriented tasks
  • Yellow: Caution, validation
  • Red: Critical, security
  • Magenta: Creative, generation
tools (optional)

Restrict agent to specific tools.

Format: Array of tool names

yaml
tools: ["Read", "Write", "Grep", "Bash"]

Default: If omitted, agent has access to all tools

Best practice: Limit tools to minimum needed (principle of least privilege)

Common tool sets:

  • Read-only analysis: ["Read", "Grep", "Glob"]
  • Code generation: ["Read", "Write", "Grep"]
  • Testing: ["Read", "Bash", "Grep"]
  • Full access: Omit field or use ["*"]

System Prompt Design

The markdown body becomes the agent's system prompt. Write in second person, addressing the agent directly.

Structure

Standard template:

markdown
You are [role] specializing in [domain].

**Your Core Responsibilities:**
1. [Primary responsibility]
2. [Secondary responsibility]
3. [Additional responsibilities...]

**Analysis Process:**
1. [Step one]
2. [Step two]
3. [Step three]
[...]

**Quality Standards:**
- [Standard 1]
- [Standard 2]

**Output Format:**
Provide results in this format:
- [What to include]
- [How to structure]

**Edge Cases:**
Handle these situations:
- [Edge case 1]: [How to handle]
- [Edge case 2]: [How to handle]
Best Practices

✅ DO:

  • Write in second person ("You are...", "You will...")
  • Be specific about responsibilities
  • Provide step-by-step process
  • Define output format
  • Include quality standards
  • Address edge cases
  • Keep under 10,000 characters

❌ DON'T:

  • Write in first person ("I am...", "I will...")
  • Be vague or generic
  • Omit process steps
  • Leave output format undefined
  • Skip quality guidance
  • Ignore error cases

Creating Agents

Method 1: AI-Assisted Generation

Use this prompt pattern (extracted from Claude Code):

Create an agent configuration based on this request: "[YOUR DESCRIPTION]"

Requirements:
1. Extract core intent and responsibilities
2. Design expert persona for the domain
3. Create comprehensive system prompt with:
   - Clear behavioral boundaries
   - Specific methodologies
   - Edge case handling
   - Output format
   - A "When to invoke" section listing 2-4 trigger scenarios as prose bullets
4. Create identifier (lowercase, hyphens, 3-50 chars)
5. Write description with triggering conditions and a short prose summary of trigger scenarios

Return JSON with:
{
  "identifier": "agent-name",
  "whenToUse": "Use this agent when... Typical triggers include [...]. See \"When to invoke\" in the agent body.",
  "systemPrompt": "You are..."
}

Then convert to agent file format with frontmatter.

See examples/agent-creation-prompt.md for complete template.

Method 2: Manual Creation
  1. Choose agent identifier (3-50 chars, lowercase, hyphens)
  2. Write description with examples
  3. Select model (usually inherit)
  4. Choose color for visual identification
  5. Define tools (if restricting access)
  6. Write system prompt with structure above
  7. Save as agents/agent-name.md

Validation Rules

Identifier Validation
✅ Valid: code-reviewer, test-gen, api-analyzer-v2
❌ Invalid: ag (too short), -start (starts with hyphen), my_agent (underscore)

Rules:

  • 3-50 characters
  • Lowercase letters, numbers, hyphens only
  • Must start and end with alphanumeric
  • No underscores, spaces, or special characters
Description Validation

Length: 10-5,000 characters Must include: Triggering conditions and examples Best: 200-1,000 characters with 2-4 examples

Show full SKILL.md (381 more words)Show less
System Prompt Validation

Length: 20-10,000 characters Best: 500-3,000 characters Structure: Clear responsibilities, process, output format

Agent Organization

Plugin Agents Directory
plugin-name/
└── agents/
    ├── analyzer.md
    ├── reviewer.md
    └── generator.md

All .md files in agents/ are auto-discovered.

Namespacing

Agents are namespaced automatically:

  • Single plugin: agent-name
  • With subdirectories: plugin:subdir:agent-name

Testing Agents

Test Triggering

Create test scenarios to verify agent triggers correctly:

  1. Write agent with specific triggering examples
  2. Use similar phrasing to examples in test
  3. Check Claude loads the agent
  4. Verify agent provides expected functionality
Test System Prompt

Ensure system prompt is complete:

  1. Give agent typical task
  2. Check it follows process steps
  3. Verify output format is correct
  4. Test edge cases mentioned in prompt
  5. Confirm quality standards are met

Quick Reference

Minimal Agent
markdown
---
name: simple-agent
description: Use this agent when [condition]. Typical triggers include [trigger 1] and [trigger 2]. See "When to invoke" in the agent body.
model: inherit
color: blue
---

You are an agent that [does X].

## When to invoke

- **[Scenario A].** [Description.]
- **[Scenario B].** [Description.]

Process:
1. [Step 1]
2. [Step 2]

Output: [What to provide]
Frontmatter Fields Summary
FieldRequiredFormatExample
nameYeslowercase-hyphenscode-reviewer
descriptionYesProse triggersUse when... Typical triggers include...
modelYesinherit/sonnet/opus/haikuinherit
colorYesColor nameblue
toolsNoArray of tool names["Read", "Grep"]
Best Practices

DO:

  • ✅ Name 2-4 trigger scenarios in the description (as prose)
  • ✅ Put detailed worked scenarios in a "When to invoke" body section, as prose bullets
  • ✅ Write specific triggering conditions
  • ✅ Use inherit for model unless specific need
  • ✅ Choose appropriate tools (least privilege)
  • ✅ Write clear, structured system prompts
  • ✅ Test agent triggering thoroughly

DON'T:

  • ❌ Use generic descriptions without trigger scenarios
  • ❌ Omit triggering conditions
  • ❌ Give all agents same color
  • ❌ Grant unnecessary tool access
  • ❌ Write vague system prompts
  • ❌ Skip testing

Additional Resources

Reference Files

For detailed guidance, consult:

  • references/system-prompt-design.md - Complete system prompt patterns
  • references/triggering-examples.md - Example formats and best practices
  • references/agent-creation-system-prompt.md - The exact prompt from Claude Code
Example Files

Working examples in examples/:

  • agent-creation-prompt.md - AI-assisted agent generation template
  • complete-agent-examples.md - Full agent examples for different use cases
Utility Scripts

Development tools in scripts/:

  • validate-agent.sh - Validate agent file structure
  • test-agent-trigger.sh - Test if agent triggers correctly

Implementation Workflow

To create an agent for a plugin:

  1. Define agent purpose and triggering conditions
  2. Choose creation method (AI-assisted or manual)
  3. Create agents/agent-name.md file
  4. Write frontmatter with all required fields
  5. Write system prompt following best practices
  6. Name 2-4 trigger scenarios in description (prose) and detail them in a "When to invoke" body section
  7. Validate with scripts/validate-agent.sh
  8. Test triggering with real scenarios
  9. Document agent in plugin README

Focus on clear triggering conditions and comprehensive system prompts for autonomous operation.

© anthropics, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in plugins/plugin-dev/skills/agent-development of anthropics/claude-plugins-official.

  • SKILL.md
  • examples/agent-creation-prompt.md
  • examples/complete-agent-examples.md
  • references/agent-creation-system-prompt.md
  • references/system-prompt-design.md
  • references/triggering-examples.md
  • scripts/validate-agent.sh

Open the folder on GitHubat commit d4226d0

Used in 8 other repositories

We found 46 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 8 other GitHub owners. This page covers the copy in anthropics/claude-plugins-official, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Claude Code Agent Development next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Claude Code Agent Development compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Claude Code Agent Development this skillanthropics/claude-plugins-official37k8 repos~2.8kAutomated safety check: PassApache-2.0
Prompt Template Authoringnicobailon/pi-prompt-template-model321—~1.3kAutomated safety check: PassMIT
Subagent CreatorgreatSumini/cc-system438—~958Automated safety check: PassMIT
Prompt OptimizerCranot/roam-code517—~1.1kAutomated safety check: PassApache-2.0
Agent Creatorsickn33/agentic-awesome-skills47k1 repos~2.7kAutomated safety check: PassMIT
Tapd Story ValidateTencentBlueKing/bk-bcs840—~1.7kAutomated safety check: PassCustom licence

Similar skills

  • Prompt Template Authoring

    nicobailon/pi-prompt-template-model

    Write and run custom Pi prompt templates (slash commands) for this extension.

    321 GitHub stars~1.3k tokensUpdated 15 days ago
    AI & LLM EngineeringAuto-check passed
  • Subagent Creator

    greatSumini/cc-system

    Create specialized Claude Code sub-agents with custom system prompts and tool configurations.

    438 GitHub stars~958 tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Prompt Optimizer

    Cranot/roam-code

    Optimize a vague subagent brief into a structured Agent task brief carrying falsifier, invariant, source-citation rule, and concrete-noun anchors.

    517 GitHub stars~1.1k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Agent Creator

    sickn33/agentic-awesome-skills

    Create custom AI subagents with proper plugin structure, persona generation, and companion routing skills.

    47k GitHub starsUsed in 1 repo~2.7k tokens
    Agent WorkflowsAuto-check passed
  • Tapd Story Validate

    TencentBlueKing/bk-bcs

    迭代执行流水线校验阶段。对 implement 产出的代码做四维度并行校验(架构 / 安全 / CodeReview / 测试覆盖), 再按汇总结果原地修复(fullstack 需求按受影响文件路径分派 backend-developer / frontend-developer)。

    840 GitHub stars~1.7k tokensUpdated 13 days ago
    Agent WorkflowsAuto-check passed
  • Tapd Story Plan

    TencentBlueKing/bk-bcs

    迭代执行流水线开发计划阶段。基于 spec.md 调用 /speckit.plan 以测试驱动开发模式构建 开发计划、技术调研与数据模型,并在同一 subagent 内就地做文档级合规自检,产出 plan-report.md。

    840 GitHub stars~886 tokensUpdated 13 days ago
    Agent WorkflowsAuto-check passed

More from anthropics/claude-plugins-official

All 29 skills in this repo
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    37k GitHub starsUsed in 11 repos~4.1k tokens
    Auto-check: notes
  • Plugin Settings Pattern

    anthropics/claude-plugins-official

    Official

    Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.

    37k GitHub starsUsed in 7 repos~3k tokens
    Auto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    37k GitHub starsUsed in 11 repos~3.1k tokens
    Auto-check passed
  • Claude Code Command Development

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code slash commands: Markdown files with YAML frontmatter, arguments, file references, bash context and interactive prompts.

    37k GitHub starsUsed in 10 repos~4.8k tokens
    Auto-check passed
  • Claude Code Plugin Structure

    anthropics/claude-plugins-official

    Official

    Explains the directory layout, plugin.json manifest and component organization of a Claude Code plugin, including auto-discovery and portable paths.

    37k GitHub starsUsed in 10 repos~3.4k tokens
    Auto-check passed
  • CLAUDE.md Improver

    anthropics/claude-plugins-official

    Official

    Finds every CLAUDE.md file in a repository, scores each against quality criteria, shows a report, then makes targeted updates after you approve.

    37k GitHub starsUsed in 5 repos~1.5k tokens
    Auto-check passed

Questions about Claude Code Agent Development

What does Claude Code Agent Development do?

Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design. The skill treats agents as autonomous subprocesses for complex, multi-step work, in contrast to commands, which cover actions you start yourself. An agent is a markdown file with YAML frontmatter followed by a system prompt that defines its behavior.

When should I use Claude Code Agent Development?

Claude Code Agent Development fits situations like: creating a new agent for a Claude Code plugin; writing the description and trigger examples that decide when an agent runs; choosing the model and color settings for an agent; reviewing the system prompt design of an existing agent.

How do I install Claude Code Agent Development in Claude Code?

Run `npx skills add anthropics/claude-plugins-official --skill agent-development -a claude-code`. Or copy the skill folder (plugins/plugin-dev/skills/agent-development in anthropics/claude-plugins-official) into .claude/skills/agent-development in your project. Claude Code loads it when a task matches its description.

How do I install Claude Code Agent Development in Codex?

Run `npx skills add anthropics/claude-plugins-official --skill agent-development -a codex`. Or copy the skill folder (plugins/plugin-dev/skills/agent-development in anthropics/claude-plugins-official) into .agents/skills/agent-development in your project. Codex loads it when a task matches its description.

Can I use Claude Code Agent Development in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add anthropics/claude-plugins-official --skill agent-development -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-development, .gemini/skills/agent-development, .github/skills/agent-development and .opencode/skills/agent-development in your project.

What does Claude Code Agent Development need to run?

Going by SKILL.md and its folder, Claude Code Agent Development needs a shell for the scripts in its folder. Our summary lists: A Claude Code plugin to hold the agent files.

Does Claude Code Agent Development access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Claude Code Agent Development safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Claude Code Agent Development use?

Claude Code Agent Development is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Claude Code Agent Development use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.2k tokens, read only when the agent opens those files.

What are the alternatives to Claude Code Agent Development?

Skills that share tags, products or a category with Claude Code Agent Development: Prompt Template Authoring (nicobailon/pi-prompt-template-model, 321 stars), Subagent Creator (greatSumini/cc-system, 438 stars), Prompt Optimizer (Cranot/roam-code, 517 stars) and Agent Creator (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Claude Code Agent Development?

anthropics (a GitHub organization, an official publisher) maintains it in anthropics/claude-plugins-official, which has 37,477 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 7, 2026.

Source: anthropics/claude-plugins-official on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.