Skill Writing

agent-development

A skill that guides you through creating autonomous agents for Claude Code plugins. It covers the agent file structure, frontmatter fields, triggering descriptions, system prompt design, validation rules and testing.

  • 37.6k GitHub stars
agent-development preview image

What it is

Agent Development is a Claude Code skill (version 0.1.0) from the plugin-dev plugin. It activates when a user asks to "create an agent", "add an agent", "write a subagent", or asks about agent frontmatter, descriptions, examples, tools, colors or autonomous agents. It also applies when someone needs guidance on agent structure, system prompts, triggering conditions or best practices for Claude Code plugins. The skill describes agents as autonomous subprocesses that handle complex, multi-step tasks independently. It distinguishes them from commands: agents are for autonomous work, while commands are for user-initiated actions. An agent is a Markdown file with YAML frontmatter, saved under a plugin's agents/ directory, where all .md files are auto-discovered. The frontmatter has these fields: - name (required): 3-50 characters of lowercase letters, numbers and hyphens, starting and ending with an alphanumeric character. - description (required): described as the most critical field because it is loaded into context so the harness can decide when to dispatch the agent. - model (required): inherit, sonnet, opus or haiku, with inherit recommended. - color (required): blue, cyan, green, yellow, magenta or red. - tools (optional): an array of tool names. If omitted, the agent has access to all tools. The Markdown body becomes the agent's system prompt and should be written in second person. The skill provides a standard template with these sections: Core Responsibilities, Analysis Process, Quality Standards, Output Format and Edge Cases. It also recommends a "When to invoke" section that lists 2-4 trigger scenarios as prose bullets. The description should state the triggering conditions, summarize the typical trigger scenarios in prose, and point to the "When to invoke" section. The skill offers two creation methods. The first is AI-assisted generation using a prompt pattern extracted from Claude Code. The second is manual creation. It also defines validation rules: - Description: 10-5,000 characters, best at 200-1,000. - System prompt: 20-10,000 characters, best at 500-3,000. It covers namespacing and how to test triggering and system prompts. It points to reference files, example files and utility scripts, including scripts/validate-agent.sh and scripts/test-agent-trigger.sh.

Who it's for

  • Claude Code plugin developers who want to add autonomous agents to their plugins
  • Users asking how to write subagents, agent frontmatter, descriptions, tools or colors
  • Developers who need guidance on agent system prompt design and triggering conditions

Requirements

Requirements

  • A Claude Code plugin with an agents/ directory where agent .md files are placed

هالسكيل بتساعدك تبني agents مستقلين لبلَغنات Claude Code، من كتابة الـfrontmatter والوصف اللي بيحدد إمتى ينشغّل الـagent، لتصميم الـsystem prompt. وفيها كمان قواعد التحقق وطرق التجريب.

Examples

AI-assisted agent generation prompt

Prompt
prompt
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..."
}

Expected output: A prompt pattern extracted from Claude Code for generating an agent configuration. You then convert the returned JSON into the agent file format with frontmatter.

Minimal agent file

markdown
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]

What it does: The smallest complete agent: the required frontmatter fields plus a short system prompt with a "When to invoke" section.

Restricting agent tools

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

What it does: The optional tools field limits the agent to specific tools. If it is omitted, the agent has access to all tools.

Plugin agents directory layout

text
text
plugin-name/
└── agents/
    ├── analyzer.md
    ├── reviewer.md
    └── generator.md

What it does: All .md files in the agents/ directory are auto-discovered as agents.