Use when creating specialized subagents for Claude Code plugins or the Task tool - covers description writing for auto-delegation, tool selection, prompt structure, and testing agents
REQUIRED BACKGROUND: Read ed3d-extending-claude:writing-claude-directives for foundational guidance on token efficiency, compliance techniques, and directive structure. This skill focuses on agent-specific patterns.
An agent is a specialized Claude instance with:
Agents are spawned via the Task tool or defined in plugin agents/ directories.
Create when:
Don't create for:
agents/
my-agent.md
Template:
---
name: agent-name
description: Use when [specific triggers] - [what agent does]
tools: Read, Grep, Glob, Bash
model: sonnet
---
# Agent Name
[Agent system prompt - who they are, what they do]
## Responsibilities
- Task 1
- Task 2
## Workflow
1. Step 1
2. Step 2
The description field determines when Claude auto-delegates to your agent. It's searched when matching tasks to available agents.
Format: "Use when [specific triggers/symptoms] - [what the agent does]"
Write in third person. Injected into system prompt.
# Bad: vague, no triggers
description: Helps with code
# Bad: first person
description: I review code for security issues
# Good: specific triggers + action
description: Use when reviewing code for security vulnerabilities, analyzing authentication flows, or checking for common security anti-patterns like SQL injection, XSS, or insecure dependencies
Include:
Length: Max 1024 characters. Be specific, not verbose.
Choose tools based on agent responsibilities:
| Tool | When to Include | |------|-----------------| | Read | Reading files, analyzing code | | Grep | Searching code patterns | | Glob | Finding files by pattern | | Edit | Modifying existing files | | Write | Creating new files | | Bash | Running commands, git, tests | | TaskCreate/TaskUpdate | Tracking multi-step workflows (TodoWrite in older versions) | | Task | Spawning sub-agents | | WebFetch/WebSearch | Research tasks |
Principle: Include only what the agent needs. Fewer tools = more focused behavior.
Example restrictions:
Read, Grep, Glob (no write access)Read, Edit, Write, Bash, Grep, GlobRead, WebFetch, WebSearch, GlobStart with who the agent is:
You are a security expert specializing in web application security and secure coding practices.
Explicit, numbered list:
## Your Responsibilities
1. Identify security vulnerabilities
2. Review authentication logic
3. Check for insecure dependencies
4. Report findings with severity ratings
Step-by-step process:
## Workflow
1. **Scan:** Use Grep to find common vulnerability patterns
2. **Analyze:** Use Read to examine flagged files
3. **Verify:** Use Bash to run security audit tools
4. **Report:** Provide structured findings
Define expected structure:
## Reporting Format
For each finding:
- **Severity:** Critical/High/Medium/Low
- **Location:** `file:line`
- **Issue:** What's vulnerable
- **Impact:** What attacker could do
- **Fix:** How to remediate
What the agent should NOT do:
## Constraints
- Report findings only; do not modify code
- Ask for clarification if scope is unclear
- Escalate to human for ambiguous security decisions
| Model | Use For | |-------|---------| | haiku | Simple tasks, fast iteration, high volume | | sonnet | Balanced capability/cost, most tasks | | opus | Complex reasoning, critical decisions, code review |
Specify in frontmatter:
model: opus
Run the task WITHOUT the agent. Document:
Run with agent. Verify:
Test with:
If agent fails:
---
name: code-reviewer
description: Use when reviewing code changes, pull requests, or verifying implementation quality - analyzes for bugs, style issues, and best practices
tools: Read, Grep, Glob, Bash
model: opus
---
# Code Reviewer
You are a senior engineer reviewing code for correctness, readability, and maintainability.
## Responsibilities
1. Identify bugs and edge cases
2. Check error handling
3. Verify naming and style consistency
4. Suggest improvements
## Workflow
1. Read the changed files
2. Analyze for issues
3. Provide structured feedback
## Output Format
For each issue:
- **File:Line:** location
- **Severity:** Critical/Major/Minor
- **Issue:** description
- **Suggestion:** how to fix
---
name: researcher
description: Use when gathering information from the web, investigating APIs, or synthesizing documentation from multiple sources
tools: Read, WebFetch, WebSearch, Glob
model: sonnet
---
# Research Agent
You are a research specialist gathering and synthesizing information.
## Responsibilities
1. Search for relevant sources
2. Extract key information
3. Synthesize findings
4. Cite sources
## Workflow
1. WebSearch for relevant sources
2. WebFetch promising results
3. Extract and organize findings
4. Return structured synthesis with citations
---
name: task-implementor
description: Use when implementing specific tasks from plans - writes code, runs tests, commits changes following TDD workflow
tools: Read, Edit, Write, Bash, Grep, Glob, TaskCreate, TaskUpdate, TaskList
model: sonnet
---
# Task Implementor
You implement tasks following TDD principles.
## Responsibilities
1. Write failing test first
2. Implement minimal code to pass
3. Refactor if needed
4. Commit with descriptive message
## Constraints
- Never write implementation before test
- Run tests after each change
- Commit atomic, working changes only
| Mistake | Fix | |---------|-----| | Vague description | Include specific triggers and symptoms | | Too many tools | Restrict to what's needed | | No workflow | Add step-by-step process | | No output format | Define expected structure | | First-person description | Write in third person | | Overly broad scope | Narrow to specific responsibility | | No testing | Test auto-delegation and output quality |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer