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".
Creates specialized subagents with concise prompts and integrated skills for task-specific workflows.
/plugin marketplace add Mission42-ai/m42-claude-plugins/plugin install mission42-ai-m42-meta-toolkit-plugins-m42-meta-toolkit@Mission42-ai/m42-claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/color-codes.mdreferences/subagent-examples.mdreferences/subagent-quality-review.mdscripts/validate_subagent.pyCreate specialized, concise subagents that leverage existing skills for task-specific workflows.
Subagent 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:
---
name: subagent-name
description: When to invoke this subagent (proactive triggers)
tools: Tool1, Tool2, Tool3
model: inherit # or sonnet/opus/haiku
color: blue # See references/color-codes.md for color system
---
[Role: 1 sentence]
[Core instructions: 3-5 directive statements]
[Constraints or workflow if needed: 2-3 lines]
[Skill references: Skill(command='skill-name') if applicable]
Example of concise prompt:
---
name: api-tester
description: Test API endpoints and validate responses. Use proactively after API implementation or when endpoints mentioned.
tools: Bash, Read, Grep
model: inherit
color: green
---
Test API endpoints systematically using curl or HTTPie.
Verify:
- Response status codes match expectations
- Response schemas are valid
- Error handling works correctly
- Authentication flows properly
Invoke Skill(command='api-validation') for schema validation patterns.
Choose storage location:
.claude/agents/ - Task-specific to this codebase~/.claude/agents/ - Reusable across projectsCreate the agent file:
# For project agents
mkdir -p .claude/agents
# Write agent definition to .claude/agents/agent-name.md
# For user agents
mkdir -p ~/.claude/agents
# Write agent definition to ~/.claude/agents/agent-name.md
Testing approach:
After testing:
When subagents need specialized knowledge:
Invoke skills explicitly:
Invoke Skill(command='crafting-agentic-prompts') for prompt optimization.
Invoke Skill(command='api-security') for authentication patterns.
Invoke Skill(command='database-schema') for table relationships.
Benefits:
Avoid:
references/)Prefer:
Before finalizing the subagent:
references/color-codes.md)scripts/validate_subagent.pyreferences/subagent-quality-review.md criteriaSee references/subagent-examples.md for complete examples demonstrating skill integration patterns.
color-codes.md - Comprehensive color coding system for categorizing subagents by purpose. Use this to select appropriate colors for subagents.
subagent-examples.md - Collection of well-designed subagents showing various patterns, skill integration approaches, and color coding.
subagent-quality-review.md - Comprehensive quality review framework with automated validation, scoring rubrics, and approval criteria.
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.