creating-subagents
БесплатноБез исполняемых скриптовНе проверенExpert knowledge on creating Claude Code subagents. Use when designing or creating subagent .md files, understanding subagent structure, tool restrictions, or…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
Creating Subagents
This Skill provides comprehensive knowledge about creating effective subagents in Claude Code.
What Are Subagents?
Subagents are specialized AI assistants that Claude Code can delegate tasks to. Each subagent:
- Has a specific purpose and expertise area
- Uses its own context window separate from the main conversation
- Can be configured with specific tools it's allowed to use
- Includes a custom system prompt that guides its behavior
File Structure
Location: .claude/agents/{name}.md
Format:
---
name: agent-name
description: When to invoke this agent
tools: Read, Write, Edit # Optional
model: sonnet # Optional
---
# System Prompt
Agent's instructions, approach, and constraints.
YAML Frontmatter Fields
Required Fields
name (string)
- Unique identifier for the subagent
- Use lowercase letters and hyphens only
- Examples:
code-reviewer,test-runner,backend-engineer - ❌ Avoid: Spaces, underscores, capitals
description (string)
- Natural language description of the subagent's purpose
- Must include when/why to invoke the agent
- Should contain keywords users would mention
- Used by Claude to decide when to delegate tasks
Optional Fields
tools (comma-separated string)
- Specific tools this subagent can use
- If omitted, inherits all tools from main thread
- Examples:
Read, Write, Edit, Bash, Grep, Glob - Use principle of least privilege
model (string)
- AI model for this subagent to use
- Options:
sonnet,opus,haiku,inherit inherit- Use same model as main conversation- If omitted, uses default subagent model (sonnet)
Writing Effective Descriptions
The description is critical for automatic invocation. Claude reads descriptions to decide which subagent to use.
Good Descriptions
# Specific + Proactive Trigger
description: Expert code reviewer. Use PROACTIVELY after code changes to review quality, security, and maintainability.
# Clear Purpose + When to Use
description: Debugging specialist for errors, test failures, and unexpected behavior. Use when encountering any issues or when tests fail.
# Multiple Triggers
description: Backend development specialist that enforces KISS, DRY, and YAGNI. Use when creating or modifying Python/FastAPI code, database models, API endpoints, or backend logic.
Bad Descriptions
# Too vague
description: Helps with code
# Missing trigger
description: Reviews code for quality
# No "when to use"
description: Testing expert
Key Elements
- Role - What kind of expert is this?
- Purpose - What specific tasks?
- Triggers - When should Claude invoke it?
- Keywords - Terms users would mention
Proactive Invocation
Add these phrases to encourage automatic invocation:
- "Use PROACTIVELY"
- "MUST BE USED"
- "Use immediately after"
- "Use automatically when"
Example:
description: Test coverage guardian. Use PROACTIVELY to remind about tests when code changes are made. MUST BE USED when implementing new features.
System Prompt Structure
The system prompt (Markdown content after frontmatter) defines the subagent's behavior.
Essential Sections
# Agent Name
Brief overview of role and capabilities.
## Your Role
What this agent does and its expertise.
## When Invoked
Specific situations that trigger this agent.
## Your Process
Step-by-step workflow:
1. First action
2. Second action
3. Final action
## Best Practices
Guidelines and principles to follow.
## Red Flags
What to watch for or challenge.
Example: Code Reviewer
---
name: code-reviewer
description: Expert code reviewer. Use PROACTIVELY after writing or modifying code. Reviews quality, security, and maintainability.
tools: Read, Grep, Glob, Bash
model: sonnet
---
# Code Reviewer
You are a senior code reviewer ensuring high standards of code quality and security.
## When Invoked
Use immediately after:
- Writing new code
- Modifying existing code
- Before committing changes
- When user asks for code review
## Your Process
1. **Understand Changes**
- Run `git diff` to see modifications
- Identify affected files and functions
2. **Review Systematically**
- Code readability and simplicity
- Proper naming conventions
- No code duplication
- Error handling present
- Security considerations
- Test coverage
3. **Provide Feedback**
- Critical issues (must fix immediately)
- Warnings (should address)
- Suggestions (nice to have)
## Review Checklist
### Readability
- [ ] Functions are small and focused
- [ ] Variable names are clear
- [ ] Complex logic is commented
### Quality
- [ ] No code duplication (DRY)
- [ ] Proper error handling
- [ ] Edge cases handled
### Security
- [ ] No exposed secrets
- [ ] Input validation present
- [ ] Authentication/authorization checked
## Red Flags
- Copy-pasted code blocks
- Overly complex solutions
- Missing erro
Установить creating-subagents в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobВложенные файлы
FAQ
Что делает скилл creating-subagents?
Expert knowledge on creating Claude Code subagents. Use when designing or creating subagent .md files, understanding subagent structure, tool restrictions, or model selection.
Как установить скилл creating-subagents?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл creating-subagents запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic