From plugin-master
Guides agent development for Claude Code plugins: file format, YAML frontmatter (name, description, model, color, tools), triggering examples, naming rules, and best practices.
npx claudepluginhub josiahsiegel/claude-plugin-marketplace --plugin plugin-masterThis skill uses the workspace's default tool permissions.
---
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Agents are autonomous subprocesses that handle complex, multi-step tasks independently. Each agent is a markdown file in the agents/ directory with YAML frontmatter defining its configuration and a markdown body serving as its system prompt.
---
name: agent-identifier
description: |
Use this agent when [triggering conditions].
<example>
Context: [Situation]
user: "[User request]"
assistant: "[How to respond and invoke agent]"
<commentary>
[Why this agent should trigger]
</commentary>
</example>
model: inherit
color: blue
tools:
- Read
- Write
- Grep
---
System prompt body in second person ("You are...")
Agent identifier for namespacing and invocation.
| Rule | Detail |
|---|---|
| Length | 3-50 characters |
| Format | Lowercase letters, numbers, hyphens only |
| Start/end | Must be alphanumeric (not hyphen) |
| Convention | Role-based: code-reviewer, test-generator, domain-expert |
Invalid names: ag (too short), -agent- (starts/ends with hyphen), my_agent (underscores)
Defines WHEN Claude should trigger this agent. Poor descriptions = agent never triggers.
Must include:
<example> blocks showing usage scenariosGood description pattern:
description: |
Use this agent when the user needs help with [domain]. Trigger for:
- [Scenario 1]
- [Scenario 2]
- [Scenario 3]
<example>
Context: [Specific situation]
user: "[What user says]"
assistant: "[How Claude responds and invokes agent]"
<commentary>
[Why this is the right agent for this request]
</commentary>
</example>
Common mistake: Vague descriptions without examples. "Helps with code review" will rarely trigger. Include concrete examples with exact user phrases.
Example block rules:
Skill coverage requirement (CRITICAL):
When the agent delegates to skills, every skill MUST have at least one <example> block that would route to it. Count skills, count examples, and verify full coverage. If the plugin has 9 skills and only 7 trigger examples, 2 skills will have reduced activation reliability. Add examples until every skill has explicit coverage. When there are more skills than the 7-example limit allows, combine related skills into shared examples that mention both domains.
| Value | When to use |
|---|---|
inherit | Default choice - uses parent session's model |
sonnet | Balanced capability/speed |
opus | Most capable, for complex reasoning |
haiku | Fast/cheap, for simple validation |
Always use inherit unless the agent specifically needs a different capability level.
Visual identifier in UI. Choose based on agent function:
| Color | Use for |
|---|---|
blue / cyan | Analysis, review, research |
green | Success-oriented, generation, creation |
yellow | Caution, validation, checking |
red | Critical, security, destructive operations |
magenta | Creative, design, architecture |
Use distinct colors for different agents within the same plugin.
Restrict agent to specific tools. Principle of least privilege - only grant what's needed.
# Read-only analysis
tools: ["Read", "Grep", "Glob"]
# Code generation
tools: ["Read", "Write", "Edit", "Grep", "Glob"]
# Full access (omit field entirely)
# tools: (not specified)
Common tool names: Read, Write, Edit, Grep, Glob, Bash, WebSearch, WebFetch, Skill, Agent
MCP tools use format: mcp__server-name__tool-name
The markdown body becomes the agent's system prompt. Write in second person ("You are...", "You will...").
You are [role] specializing in [domain].
## Core Responsibilities
1. [Primary responsibility]
2. [Secondary responsibility]
## Process
1. [Step one]
2. [Step two]
3. [Step three]
## Quality Standards
- [Standard 1]
- [Standard 2]
## Output Format
- [What to include]
- [How to structure results]
## Edge Cases
- [Situation]: [How to handle]
DO:
DON'T:
An agent body must be a lean orchestrator, NOT a domain knowledge dump. The agent delegates to skills for detailed knowledge.
| Metric | Target | Hard Maximum |
|---|---|---|
| Word count | 1,500-2,500 words | 3,000 words |
| Character count | ~10,000-15,000 chars | 20,000 chars |
| Section | Required | Purpose |
|---|---|---|
| Role identity | Yes | "You are [role] specializing in [domain]" |
| Skill activation rules | Yes | Topic-to-skill mapping table |
| High-level process | Yes | Design/workflow steps |
| Output format | Yes | What to include in responses |
| Brief service summaries | Optional | 2-3 sentences per area to help decide which skill to load |
| Edge cases / troubleshooting tips | Optional | Quick reference only |
NEVER duplicate content between the agent body and skills. This is the most common mistake and causes massive context bloat.
Bad: Agent body contains a full "Plugin.json Schema" section AND the plugin-master skill also contains it.
Good: Agent body says "For plugin.json schema details, load plugin-master:plugin-master" and keeps only a 1-sentence summary.
You are [role] specializing in [domain].
## Skill Activation - CRITICAL
[Topic-to-skill mapping table — this is the heart of the agent]
## Core Responsibilities
[2-5 bullet points on what this agent does]
## Process
[5-7 step workflow for handling user requests]
## Quality Standards
[Brief checklist — 5-10 items]
## Output Format
[What to include in responses]
Agent descriptions should be concise and effective:
| Element | Guideline |
|---|---|
| Intro text | 1-2 sentences on when to trigger |
| Example blocks | 3-7 blocks covering diverse scenarios |
| Total description | Should fit naturally — focus on quality trigger examples over length |
{domain}-expertdocker-master → agent named docker-expertEach agent should have a clear, focused purpose. Don't create "do everything" agents. If a plugin needs multiple capabilities, use one expert agent that loads different skills based on context.
Expert agents should load relevant skills before answering. Include skill activation instructions in the system prompt:
## Skill Activation
When the user asks about [topic], load `plugin-name:skill-name` before responding.
When a plugin has multiple skills, their trigger phrases and description terms must not create ambiguity. If two skills both claim the same keyword (e.g., both "programmatic-development" and "tmdl-mastery" claim "TMDL"), the agent cannot reliably route requests.
Disambiguation rules:
Before finalizing an agent:
<example> blocksinherit (unless specific need)agents/agent-name.md| Mistake | Fix |
|---|---|
| Vague description without examples | Add 2-4 <example> blocks with concrete user phrases |
| Skills without trigger examples | Every skill must have at least one example that routes to it — count and verify |
| Trigger phrase overlap between skills | Audit all skill descriptions for shared keywords; assign exclusive ownership or add disambiguation |
model: sonnet when inherit works | Use inherit unless agent needs specific capability |
| Too many tools granted | Restrict to minimum needed tools |
| Generic system prompt | Be specific about process, output format, quality standards |
| No skill activation | Add skill loading instructions for knowledge-dependent agents |
| Multiple agents in one plugin | Use one expert agent with skills for different topics |
| Example blocks with full code/JSON | Keep examples concise (1-2 sentence responses); code belongs in skills |
| Same cross-cutting block in every skill | Put platform guidelines in agent body or one shared reference, not each SKILL.md |