Guide for creating effective subagents with concise prompts and skill integration. This skill should be used when users want to create a new subagent, improve existing subagent definitions, or need guidance on subagent architecture. Triggers on "create subagent", "create agent", "new subagent", "improve agent", or "subagent definition".
Create specialized, concise subagents that leverage existing skills for task-specific workflows.
Before creating or modifying subagents, fetch the latest Claude Code documentation for accurate, up-to-date guidance.
IMPORTANT: Use WebFetch on these URLs to load current documentation before proceeding with subagent creation.
agents/ directory structure, agent distribution via plugins--agents flag, --disallowedTools for restricting subagent capabilitiesSubagent prompts should be short and directive - typically 50-200 words. Avoid lengthy explanations.
Why: Subagents operate in separate contexts. Verbose prompts waste tokens and reduce effectiveness.
When subagents need specialized knowledge, create or reference skills instead of embedding instructions in the prompt.
Why: Skills are reusable, maintainable, and can include bundled resources. Prompts should orchestrate, not educate.
Each subagent should handle one clear domain with minimal scope creep.
Why: Focused subagents are more predictable and easier to maintain.
Clearly articulate what the subagent will do:
Critical step: Before writing the subagent prompt, determine if a skill should be created.
Create a skill when:
Use prompt-only when:
If skill needed: Create the skill first using Skill(command='creating-skills'), then reference it in the subagent with Skill() invocations.
Grant minimal necessary tools. Omit the tools field only if all tools are genuinely needed.
Common tool patterns:
Select an appropriate color from the color coding system (see references/color-codes.md):
Choose based on the agent's primary purpose.
Use the Skill(command='crafting-agentic-prompts') for prompt engineering guidance.
Structure:
---