creating-an-agent
БесплатноБез исполняемых скриптовНе проверенUse when creating specialized subagents for Claude Code plugins or the Task tool - covers description writing for auto-delegation, tool selection, prompt…
от ed3dai★ 253 звезды на GitHubОб этом скилле
Creating an Agent
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.
What is an Agent?
An agent is a specialized Claude instance with:
- Defined tools (Read, Edit, Bash, etc.)
- Specific responsibilities (code review, security audit, research)
- A focused system prompt
Agents are spawned via the Task tool or defined in plugin agents/ directories.
When to Create an Agent
Create when:
- Task requires specialized expertise
- Workflow benefits from tool restrictions
- You want consistent behavior across invocations
- Task is complex enough to warrant context isolation
Don't create for:
- Simple, one-off tasks
- Tasks the main Claude handles well
- Purely conversational interactions
Agent File Structure
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
Description: The Critical Field
The description field determines when Claude auto-delegates to your agent. It's searched when matching tasks to available agents.
Writing Effective Descriptions
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:
- Specific symptoms that trigger use
- Domain keywords (security, performance, testing)
- File types or patterns if relevant
- Actions the agent performs
Length: Max 1024 characters. Be specific, not verbose.
Tool Selection
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:
- Code reviewer:
Read, Grep, Glob(no write access) - Implementor:
Read, Edit, Write, Bash, Grep, Glob - Researcher:
Read, WebFetch, WebSearch, Glob
Agent Prompt Structure
Role Definition
Start with who the agent is:
You are a security expert specializing in web application security and secure coding practices.
Responsibilities
Explicit, numbered list:
## Your Responsibilities
1. Identify security vulnerabilities
2. Review authentication logic
3. Check for insecure dependencies
4. Report findings with severity ratings
Workflow
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
Output Format
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
Constraints
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 Selection
| 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
Testing Agents
1. Baseline Test
Run the task WITHOUT the agent. Document:
- What went wrong
- What was missing
- How long it took
2. Agent Test
Run with agent. Verify:
- Agent is auto-delegated (description triggers correctly)
- Workflow is followed
- Output matches expected format
- Tool restrictions are respected
3. Edge Case Testing
Test with:
- Ambiguous inputs
- Missing context
- Large/complex inputs
- Tasks outside scope (should refuse gracefully)
4. Iteration
If agent fails:
- Identify root cause (description? workflow? constraints?)
- Update agent defini
Установить creating-an-agent в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл creating-an-agent?
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
Как установить скилл creating-an-agent?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл creating-an-agent запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic