Subagents Meta Skill
🚨 MANDATORY: Invoke docs-management First
STOP - Before providing ANY response about subagents/agents:
- INVOKE
docs-management skill
- QUERY for the user's specific topic
- BASE all responses EXCLUSIVELY on official documentation loaded
Skipping this step results in outdated or incorrect information.
Verification Checkpoint
Before responding, verify:
If ANY checkbox is unchecked, STOP and invoke docs-management first.
Overview
Central authority for Claude Code subagents (also called sub-agents). This skill uses 100% delegation to docs-management - it contains NO duplicated official documentation.
Architecture: Pure delegation with keyword registry. All official documentation is accessed via docs-management skill queries.
When to Use This Skill
Keywords: subagents, sub-agents, agents, agent file, agent YAML, agent frontmatter, agent tools, agent model, automatic delegation, agent lifecycle, agent resumption, /agents command, programmatic agents, agent SDK, built-in agents, Plan subagent, agent configuration
Use this skill when:
- Creating new agent definition files
- Configuring agent tool access
- Selecting agent models (inherit, sonnet, haiku, opus)
- Understanding automatic vs explicit agent invocation
- Working with agent resumption and lifecycle
- Using the /agents CLI command
- Integrating agents with Agent SDK
- Understanding priority resolution (project > CLI > user)
- Working with built-in agents (Plan subagent)
- Troubleshooting agent behavior
Keyword Registry for docs-management Queries
Use these keywords when querying docs-management skill for official documentation:
Core Concepts
| Topic |
Keywords |
| Overview |
"subagents", "sub-agents", "agent overview" |
| File Format |
"agent file format", "agent YAML frontmatter", "agent file structure" |
| File Locations |
"agent file locations", "agent directories", "where to put agents" |
Configuration
| Topic |
Keywords |
| YAML Frontmatter |
"agent YAML frontmatter", "agent configuration", "agent metadata" |
| Tool Access |
"agent tools", "agent tool access", "allowed-tools agents" |
| Model Selection |
"agent model selection", "inherit model", "sonnet haiku opus agents" |
| Permission Mode |
"permissionMode", "agent permission mode", "acceptEdits", "bypassPermissions" |
| Skills Field |
"agent skills field", "skills auto-load", "agent skills configuration" |
| Hooks (v2.1.x) |
"agent hooks", "hooks in agent", "agent PreToolUse", "agent PostToolUse" |
| Color (Undocumented) |
"agent color", "subagent color", "agent UI color" |
Behavior
| Topic |
Keywords |
| Automatic Delegation |
"automatic delegation", "agent automatic invocation" |
| Explicit Invocation |
"explicit agent invocation", "manual agent call" |
| Lifecycle |
"agent lifecycle", "agent execution", "agent completion" |
| Resumption |
"agent resumption", "resume agent", "continue agent", "agentId", "resumable agents" |
| Plugin Agents |
"plugin agents", "plugin-provided agents", "plugin subagents" |
| Chaining Agents |
"chaining subagents", "chain agents", "agent orchestration" |
| Performance |
"agent performance", "context efficiency", "agent latency", "parallel agents" |
CLI and SDK
| Topic |
Keywords |
| CLI Usage |
"/agents command", "agents CLI", "list agents" |
| Agent SDK |
"Agent SDK subagents", "programmatic agents", "SDK agent creation" |
| Priority Resolution |
"agent priority resolution", "project CLI user agents" |
Built-in Agents
| Topic |
Keywords |
| General-purpose |
"general-purpose subagent", "general purpose agent", "default subagent" |
| Plan Subagent |
"Plan subagent", "planning agent", "implementation planning" |
| Explore Subagent |
"Explore subagent", "explore agent", "codebase exploration", "read-only agent" |
| Thoroughness Levels |
"thoroughness levels", "quick medium thorough", "exploration depth" |
Official YAML Frontmatter Reference
Source: Query docs-management for sub-agents.md configuration fields or agent YAML frontmatter
⚠️ STALENESS WARNING: Do NOT hardcode field names, valid values, or requirements here.
ALWAYS query docs-management for the authoritative list of YAML frontmatter fields.
Query Pattern for Official Fields
docs-management: "sub-agents.md configuration fields"
docs-management: "agent YAML frontmatter required optional"
Expected Field Categories
| Category |
Query Pattern |
What You'll Find |
| Required fields |
"agent required fields" |
Fields that must be present |
| Optional fields |
"agent optional fields" |
Fields with default behavior |
| Model selection |
"agent model selection" |
Valid model values |
| Permission modes |
"agent permissionMode values" |
Valid permission mode values |
| Skills auto-load |
"agent skills field" |
Skills configuration syntax |
Important: The color property documented below is NOT in official Claude Code documentation.
Color Property (Undocumented)
The color property is an undocumented feature that sets the UI color for subagents. It is NOT in official Claude Code documentation and may change without notice.
Available Values: red, blue, green, yellow, purple, orange, pink, cyan
Placement: Typically placed after model or at the bottom of YAML frontmatter.
Example:
---
name: my-agent
description: Description of what this agent does
tools: Read, Grep, Glob
model: haiku
color: blue
---
Warning: As an undocumented feature, this property:
- May not work in all Claude Code versions
- May be removed or changed without notice
- Should not be relied upon for critical functionality
Repository Color Standard
This repository uses a semantic color categorization for subagents to provide visual consistency:
Category Assignments
| Category |
Color |
Purpose |
Agents |
| Documentation/Meta |
purple |
Documentation, auditing, meta-skills |
docs-researcher, docs-validator, skill-auditor |
| Code Quality |
blue |
Code analysis, review, debugging, testing |
code-reviewer, codebase-analyst, debugger, test-generator |
| Research |
green |
Research, information gathering, web content |
mcp-research, platform-docs-researcher, web-research |
Reserved Colors (Future Use)
| Color |
Reserved For |
| orange |
Generation/Creation agents |
| red |
Critical/Error handling agents |
| yellow |
Warning/Attention agents |
| pink |
User-facing/Communication agents |
| cyan |
Utility agents |
When to Assign Colors
When creating new agents for this repository:
- Identify the agent's primary purpose (documentation, code quality, research, etc.)
- Match to existing category if possible
- Use reserved colors only for new categories that match the reserved purpose
- Document new categories if creating a genuinely new type
Quick Decision Tree
What do you want to do?
- Create a new agent -> Query docs-management: "agent file format", "agent YAML frontmatter"
- Configure agent tools -> Query docs-management: "agent tools", "allowed-tools agents"
- Select agent model -> Query docs-management: "agent model selection", "inherit sonnet haiku opus"
- Configure permissionMode -> Query docs-management: "permissionMode", "agent permission mode"
- Auto-load skills in agent -> Query docs-management: "agent skills field", "skills auto-load"
- Understand automatic delegation -> Query docs-management: "automatic delegation agents"
- Resume an agent (agentId) -> Query docs-management: "agent resumption", "agentId", "resumable agents"
- Use /agents CLI -> Query docs-management: "/agents command", "agents CLI"
- Programmatic agents (SDK) -> Query docs-management: "Agent SDK subagents"
- Understand priority resolution -> Query docs-management: "agent priority resolution"
- Work with General-purpose agent -> Query docs-management: "general-purpose subagent"
- Work with Plan subagent -> Query docs-management: "Plan subagent", "planning agent"
- Work with Explore subagent -> Query docs-management: "Explore subagent", "thoroughness levels"
- Understand plugin agents -> Query docs-management: "plugin agents", "plugin-provided agents"
- Chain multiple agents -> Query docs-management: "chaining subagents", "agent orchestration"
- Optimize agent performance -> Query docs-management: "agent performance", "parallel agents"
- Troubleshoot agent issues -> Query docs-management: "agent troubleshooting" + specific issue keywords
- Add color to agent (undocumented) -> See "Color Property (Undocumented)" section above
- Choose color for new agent -> See "Repository Color Standard" section above
- Add lifecycle hooks to agent (v2.1.x) -> Query docs-management: "agent hooks", "hooks in agent frontmatter"
Topic Coverage
Agent Files
- File format and structure
- YAML frontmatter fields (name, description, tools, model)
- File locations (project, CLI, user directories)
- Naming conventions
Tool Configuration
- Specifying allowed tools
- Tool access inheritance
- Restricting dangerous tools
- MCP tools in agents
Model Selection
- Model options: inherit, sonnet, haiku, opus
- When to use each model
- Cost and performance considerations
- Inheritance from parent context
Invocation Patterns
- Automatic delegation (description matching)
- Explicit invocation via Task tool
- Agent discovery and selection
- Priority resolution order
Lifecycle Management
- Agent execution flow
- Context isolation
- Result reporting
- Error handling
Resumption
- Resuming existing agents
- Context preservation
- When to resume vs create new
- Resume parameter usage
CLI Integration
- /agents command
- Listing available agents
- Agent status and management
- CLI-defined agents
Agent SDK Integration
- Programmatic agent creation
- SDK patterns for subagents
- Custom agent implementations
- Advanced agent workflows
Default Agent Types
- General-purpose subagent: Complex multi-step tasks, autonomous execution
- Plan subagent: Implementation planning, architectural decisions
- Explore subagent: Codebase exploration, read-only research
- Thoroughness levels (quick, medium, very thorough) for Explore agent
- Default agent behaviors and when to use each
- Customizing built-in agent behavior
Plugin Agents
- Plugin-provided agents
- Plugin agent discovery and usage
- Plugin agent configuration
Performance Considerations
- Parallel agent execution
- Context efficiency and token usage
- Agent latency optimization
- When to use subagents vs direct tools
Test Scenarios
These scenarios should activate this skill:
- Direct activation: "Use the subagent-development skill to help me create an agent"
- Configuration question: "How do I restrict tools for my subagent?"
- Built-in agent question: "What is the Explore subagent and how do I use it?"
- Troubleshooting: "My agent isn't being invoked automatically"
- SDK question: "How do I define agents programmatically in the Agent SDK?"
Related Skills
| Skill |
Relationship |
| docs-management |
Primary delegation target (100%) - all official documentation |
| agent-sdk-development |
Agent SDK-specific guidance for programmatic agents |
| skill-development |
Skills can be auto-loaded by agents via skills field |
| current-date |
For audit timestamps and verification dates |
Delegation Patterns
Standard Query Pattern
User asks: "How do I create an agent?"
1. Invoke docs-management skill
2. Use keywords: "agent file format", "agent YAML frontmatter"
3. Load official documentation
4. Provide guidance based EXCLUSIVELY on official docs
Multi-Topic Query Pattern
User asks: "I want to create an agent with restricted tools that uses Haiku"
1. Invoke docs-management skill with multiple queries:
- "agent file format", "agent YAML frontmatter"
- "agent tools", "allowed-tools agents"
- "agent model selection", "haiku agents"
2. Synthesize guidance from official documentation
Troubleshooting Pattern
User reports: "My agent isn't being invoked automatically"
1. Invoke docs-management skill
2. Use keywords: "automatic delegation agents", "agent description"
3. Check official docs for automatic invocation requirements
4. Guide user based on official troubleshooting steps
Troubleshooting Quick Reference
| Issue |
Keywords for docs-management |
| Agent not found |
"agent file locations", "agent directories" |
| Agent not auto-invoked |
"automatic delegation", "agent description matching" |
| Wrong model used |
"agent model selection", "inherit model" |
| Tools not available |
"agent tools", "allowed-tools agents" |
| Resumption not working |
"agent resumption", "resume agent" |
| Priority conflicts |
"agent priority resolution", "project CLI user" |
Known Issues
CRLF Line Endings Cause Silent Loading Failures (v2.1.x)
GitHub Issues: #16916, #11205
Symptoms: Agent files exist but aren't available when spawning via Task tool. No error messages - agents silently fail to load.
Cause: Claude Code v2.1.x introduced stricter YAML parsing. Agent files with Windows-style CRLF line endings (\r\n) fail to parse correctly, causing the agent to be skipped during plugin loading.
Detection:
# Check if file has CRLF
file path/to/agent.md
# CRLF present: "ASCII text, with CRLF line terminators"
# LF only: "ASCII text" (no CRLF mention)
Fix:
# Convert CRLF to LF
sed -i 's/\r$//' path/to/agent.md
# Or using dos2unix
dos2unix path/to/agent.md
Prevention:
- Configure Git to use LF for
.md files: *.md text eol=lf in .gitattributes
- Configure your editor to use LF for markdown files
- Run
file *.md to check for CRLF before committing new agents
After Fix: Restart Claude Code session to pick up the corrected agent files.
Plugin Agents Not Registered in plugin.json
Symptoms: Agent file exists in plugin's agents/ directory but isn't available when spawning via Task tool. No error messages.
Cause: The plugin's plugin.json uses an explicit agents array instead of directory auto-discovery. New agent files must be manually added to the array.
Detection:
# Check if plugin.json uses explicit array vs directory
grep -A 5 '"agents"' .claude-plugin/plugin.json
# Array: "agents": ["./agents/foo.md", ...] <- Manual registration required
# Directory: "agents": "./agents" <- Auto-discovery
Fix: Add the new agent file to the agents array in plugin.json.
Cross-reference: See plugin-development skill → "Component Registration in plugin.json" for detailed guidance on explicit vs auto-discovery modes.
Repository-Specific Notes
This repository uses subagents for:
- Explore agents: Codebase exploration and research
- Plan agents: Implementation planning
- General-purpose agents: Complex multi-step tasks
When creating agents for this repository, follow patterns in .claude/settings.json and existing agent configurations.
Related Guidance
For comprehensive subagent usage guidance beyond configuration:
- When to use subagents: See
.claude/memory/operational-rules.md → "Agent Usage Principles"
- Parallelization strategies: See
.claude/memory/performance-quick-start.md → "Strategy 1: Parallelization"
- Context preservation patterns: See
.claude/memory/operational-rules.md → "Agent Communication Pattern"
- Proactive delegation rule: See
CLAUDE.md Quick Reference → "PROACTIVE DELEGATION"
Auditing Agents
This skill provides the validation criteria used by the agent-auditor agent for formal audits.
Audit Resources
| Resource |
Location |
Purpose |
| Validation Checklist |
references/validation-checklist.md |
Pre-creation verification checklist |
| Scoring Rubric |
references/validation-checklist.md#audit-scoring-rubric |
Formal audit scoring criteria |
| Undocumented Features |
references/undocumented-features.md |
Color, permissionMode, skills field details |
Scoring Categories
| Category |
Points |
Key Criteria |
| Name Field |
20 |
Lowercase, hyphens, max 64 chars, no reserved words |
| Description Field |
25 |
Third person, delegation triggers, when-to-use guidance |
| Tools Configuration |
20 |
Appropriate restrictions, not over/under restricted |
| Model Selection |
15 |
Appropriate for task complexity |
| Additional Fields |
20 |
Color, skills, permissionMode correctly configured |
Thresholds: 85+ = PASS, 70-84 = PASS WITH WARNINGS, <70 = FAIL
Related Agent
The agent-auditor agent (Haiku model) performs formal audits using this skill:
- Auto-loads this skill via
skills: subagent-development
- Uses validation checklist and scoring rubric
- Checks both official and undocumented features
- Generates structured audit reports
- Invoked by
/audit-agents command
External Technology Validation
When auditing agents that use external technologies (scripts, packages, runtimes), the auditor MUST validate claims using MCP servers before flagging findings.
Technologies Requiring MCP Validation:
- .NET/C# scripts: Validate with microsoft-learn + perplexity
- Node.js/npm packages: Validate with context7 + perplexity
- Python scripts/packages: Validate with context7 + perplexity
- Shell scripts: Validate with perplexity
- Any version-specific claims: ALWAYS validate with perplexity
Validation Rule:
Never flag a technology usage as incorrect without first:
- Querying appropriate MCP server(s) for current documentation
- Verifying with perplexity for recent changes (especially .NET 10+)
- Documenting MCP sources in the finding
Stale Data Warning:
- microsoft-learn can return cached/outdated documentation
- ALWAYS pair microsoft-learn with perplexity for version verification
- Trust perplexity for version numbers and recently-released features
References
Official Documentation (via docs-management skill):
- Primary: "sub-agents" documentation
- Related: "Agent SDK", "Task tool", "model selection"
Repository-Specific:
- Agent configurations:
.claude/settings.json
- Performance guidance:
.claude/memory/performance-quick-start.md
- Operational rules:
.claude/memory/operational-rules.md (Agent Usage Principles section)
Version History
- v1.4.0 (2026-01-10): Added Known Issues section
- Documented CRLF line ending issue causing silent agent loading failures in v2.1.x
- Documented plugin.json explicit array registration issue
- Added detection, fix, and prevention guidance for both issues
- Added cross-reference to plugin-development skill
- Referenced GitHub issues #16916 and #11205
- v1.3.0 (2026-01-09): Added v2.1.x agent hooks keyword registry entry
- Added "Hooks (v2.1.x)" to Configuration keywords table
- Added Quick Decision Tree entry #20 for agent lifecycle hooks
- v1.2.0 (2025-11-27): Color property documentation
- Added "Official YAML Frontmatter Reference" section with source reference to docs-management
- Added "Color Property (Undocumented)" section documenting available colors
- Added "Repository Color Standard" section with semantic color categories
- Added color keyword to Configuration registry
- Expanded Quick Decision Tree (19 entries, up from 17) with color entries
- v1.1.0 (2025-11-27): Audit and enhancement
- Added missing keyword registry entries (permissionMode, skills field, plugin agents, chaining, performance)
- Expanded Built-in Agents section (General-purpose, Plan, Explore, thoroughness levels)
- Added Test Scenarios section (5 scenarios)
- Added Related Skills section
- Expanded Quick Decision Tree (17 entries, up from 10)
- Added Plugin Agents and Performance Considerations to Topic Coverage
- Added Token Budget statement
- v1.0.0 (2025-11-26): Initial release
- Pure delegation architecture
- Comprehensive keyword registry
- Quick decision tree
- Topic coverage for all subagent features
- Troubleshooting quick reference
Last Updated
Date: 2026-01-10
Model: claude-opus-4-5-20251101
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: subagent-development3description: Central authority for Claude Code subagents (sub-agents). Covers agent file format, YAML frontmatter, tool access configuration, model selection (inherit, sonnet, haiku, opus), automatic delegation, agent lifecycle, resumption, command-line usage (/agents), Agent SDK programmatic agents, priority resolution, and built-in agents (Plan subagent). Assists with creating agents, configuring agent tools, understanding agent behavior, and troubleshooting agent issues. Delegates 100% to docs-management skill for official documentation. Use when this capability is needed.4---56# Subagents Meta Skill78> ## 🚨 MANDATORY: Invoke docs-management First9>10> **STOP - Before providing ANY response about subagents/agents:**11>12> 1. **INVOKE** `docs-management` skill13> 2. **QUERY** for the user's specific topic14> 3. **BASE** all responses EXCLUSIVELY on official documentation loaded15>16> **Skipping this step results in outdated or incorrect information.**17>18> ### Verification Checkpoint19>20> Before responding, verify:21>22> - [ ] Did I invoke docs-management skill?23> - [ ] Did official documentation load?24> - [ ] Is my response based EXCLUSIVELY on official docs?25>26> If ANY checkbox is unchecked, STOP and invoke docs-management first.2728## Overview2930Central authority for Claude Code subagents (also called sub-agents). This skill uses **100% delegation to docs-management** - it contains NO duplicated official documentation.3132**Architecture:** Pure delegation with keyword registry. All official documentation is accessed via docs-management skill queries.3334## When to Use This Skill3536**Keywords:** subagents, sub-agents, agents, agent file, agent YAML, agent frontmatter, agent tools, agent model, automatic delegation, agent lifecycle, agent resumption, /agents command, programmatic agents, agent SDK, built-in agents, Plan subagent, agent configuration3738**Use this skill when:**3940- Creating new agent definition files41- Configuring agent tool access42- Selecting agent models (inherit, sonnet, haiku, opus)43- Understanding automatic vs explicit agent invocation44- Working with agent resumption and lifecycle45- Using the /agents CLI command46- Integrating agents with Agent SDK47- Understanding priority resolution (project > CLI > user)48- Working with built-in agents (Plan subagent)49- Troubleshooting agent behavior5051## Keyword Registry for docs-management Queries5253Use these keywords when querying docs-management skill for official documentation:5455### Core Concepts5657| Topic | Keywords |58| --- | --- |59| Overview | "subagents", "sub-agents", "agent overview" |60| File Format | "agent file format", "agent YAML frontmatter", "agent file structure" |61| File Locations | "agent file locations", "agent directories", "where to put agents" |6263### Configuration6465| Topic | Keywords |66| --- | --- |67| YAML Frontmatter | "agent YAML frontmatter", "agent configuration", "agent metadata" |68| Tool Access | "agent tools", "agent tool access", "allowed-tools agents" |69| Model Selection | "agent model selection", "inherit model", "sonnet haiku opus agents" |70| Permission Mode | "permissionMode", "agent permission mode", "acceptEdits", "bypassPermissions" |71| Skills Field | "agent skills field", "skills auto-load", "agent skills configuration" |72| Hooks (v2.1.x) | "agent hooks", "hooks in agent", "agent PreToolUse", "agent PostToolUse" |73| Color (Undocumented) | "agent color", "subagent color", "agent UI color" |7475### Behavior7677| Topic | Keywords |78| --- | --- |79| Automatic Delegation | "automatic delegation", "agent automatic invocation" |80| Explicit Invocation | "explicit agent invocation", "manual agent call" |81| Lifecycle | "agent lifecycle", "agent execution", "agent completion" |82| Resumption | "agent resumption", "resume agent", "continue agent", "agentId", "resumable agents" |83| Plugin Agents | "plugin agents", "plugin-provided agents", "plugin subagents" |84| Chaining Agents | "chaining subagents", "chain agents", "agent orchestration" |85| Performance | "agent performance", "context efficiency", "agent latency", "parallel agents" |8687### CLI and SDK8889| Topic | Keywords |90| --- | --- |91| CLI Usage | "/agents command", "agents CLI", "list agents" |92| Agent SDK | "Agent SDK subagents", "programmatic agents", "SDK agent creation" |93| Priority Resolution | "agent priority resolution", "project CLI user agents" |9495### Built-in Agents9697| Topic | Keywords |98| --- | --- |99| General-purpose | "general-purpose subagent", "general purpose agent", "default subagent" |100| Plan Subagent | "Plan subagent", "planning agent", "implementation planning" |101| Explore Subagent | "Explore subagent", "explore agent", "codebase exploration", "read-only agent" |102| Thoroughness Levels | "thoroughness levels", "quick medium thorough", "exploration depth" |103104## Official YAML Frontmatter Reference105106**Source:** Query docs-management for `sub-agents.md configuration fields` or `agent YAML frontmatter`107108> ⚠️ **STALENESS WARNING:** Do NOT hardcode field names, valid values, or requirements here.109> ALWAYS query docs-management for the authoritative list of YAML frontmatter fields.110111### Query Pattern for Official Fields112113```text114docs-management: "sub-agents.md configuration fields"115docs-management: "agent YAML frontmatter required optional"116```117118### Expected Field Categories119120| Category | Query Pattern | What You'll Find |121| --- | --- | --- |122| Required fields | "agent required fields" | Fields that must be present |123| Optional fields | "agent optional fields" | Fields with default behavior |124| Model selection | "agent model selection" | Valid model values |125| Permission modes | "agent permissionMode values" | Valid permission mode values |126| Skills auto-load | "agent skills field" | Skills configuration syntax |127128**Important:** The `color` property documented below is NOT in official Claude Code documentation.129130## Color Property (Undocumented)131132The `color` property is an undocumented feature that sets the UI color for subagents. It is NOT in official Claude Code documentation and may change without notice.133134**Available Values:** red, blue, green, yellow, purple, orange, pink, cyan135136**Placement:** Typically placed after `model` or at the bottom of YAML frontmatter.137138**Example:**139140```yaml141---142name: my-agent143description: Description of what this agent does144tools: Read, Grep, Glob145model: haiku146color: blue147---148```149150**Warning:** As an undocumented feature, this property:151152- May not work in all Claude Code versions153- May be removed or changed without notice154- Should not be relied upon for critical functionality155156## Repository Color Standard157158This repository uses a semantic color categorization for subagents to provide visual consistency:159160### Category Assignments161162| Category | Color | Purpose | Agents |163| --- | --- | --- | --- |164| **Documentation/Meta** | purple | Documentation, auditing, meta-skills | docs-researcher, docs-validator, skill-auditor |165| **Code Quality** | blue | Code analysis, review, debugging, testing | code-reviewer, codebase-analyst, debugger, test-generator |166| **Research** | green | Research, information gathering, web content | mcp-research, platform-docs-researcher, web-research |167168### Reserved Colors (Future Use)169170| Color | Reserved For |171| --- | --- |172| orange | Generation/Creation agents |173| red | Critical/Error handling agents |174| yellow | Warning/Attention agents |175| pink | User-facing/Communication agents |176| cyan | Utility agents |177178### When to Assign Colors179180When creating new agents for this repository:1811821. **Identify the agent's primary purpose** (documentation, code quality, research, etc.)1832. **Match to existing category** if possible1843. **Use reserved colors** only for new categories that match the reserved purpose1854. **Document new categories** if creating a genuinely new type186187## Quick Decision Tree188189**What do you want to do?**1901911. **Create a new agent** -> Query docs-management: "agent file format", "agent YAML frontmatter"1922. **Configure agent tools** -> Query docs-management: "agent tools", "allowed-tools agents"1933. **Select agent model** -> Query docs-management: "agent model selection", "inherit sonnet haiku opus"1944. **Configure permissionMode** -> Query docs-management: "permissionMode", "agent permission mode"1955. **Auto-load skills in agent** -> Query docs-management: "agent skills field", "skills auto-load"1966. **Understand automatic delegation** -> Query docs-management: "automatic delegation agents"1977. **Resume an agent (agentId)** -> Query docs-management: "agent resumption", "agentId", "resumable agents"1988. **Use /agents CLI** -> Query docs-management: "/agents command", "agents CLI"1999. **Programmatic agents (SDK)** -> Query docs-management: "Agent SDK subagents"20010. **Understand priority resolution** -> Query docs-management: "agent priority resolution"20111. **Work with General-purpose agent** -> Query docs-management: "general-purpose subagent"20212. **Work with Plan subagent** -> Query docs-management: "Plan subagent", "planning agent"20313. **Work with Explore subagent** -> Query docs-management: "Explore subagent", "thoroughness levels"20414. **Understand plugin agents** -> Query docs-management: "plugin agents", "plugin-provided agents"20515. **Chain multiple agents** -> Query docs-management: "chaining subagents", "agent orchestration"20616. **Optimize agent performance** -> Query docs-management: "agent performance", "parallel agents"20717. **Troubleshoot agent issues** -> Query docs-management: "agent troubleshooting" + specific issue keywords20818. **Add color to agent (undocumented)** -> See "Color Property (Undocumented)" section above20919. **Choose color for new agent** -> See "Repository Color Standard" section above21020. **Add lifecycle hooks to agent (v2.1.x)** -> Query docs-management: "agent hooks", "hooks in agent frontmatter"211212## Topic Coverage213214### Agent Files215216- File format and structure217- YAML frontmatter fields (name, description, tools, model)218- File locations (project, CLI, user directories)219- Naming conventions220221### Tool Configuration222223- Specifying allowed tools224- Tool access inheritance225- Restricting dangerous tools226- MCP tools in agents227228### Model Selection229230- Model options: inherit, sonnet, haiku, opus231- When to use each model232- Cost and performance considerations233- Inheritance from parent context234235### Invocation Patterns236237- Automatic delegation (description matching)238- Explicit invocation via Task tool239- Agent discovery and selection240- Priority resolution order241242### Lifecycle Management243244- Agent execution flow245- Context isolation246- Result reporting247- Error handling248249### Resumption250251- Resuming existing agents252- Context preservation253- When to resume vs create new254- Resume parameter usage255256### CLI Integration257258- /agents command259- Listing available agents260- Agent status and management261- CLI-defined agents262263### Agent SDK Integration264265- Programmatic agent creation266- SDK patterns for subagents267- Custom agent implementations268- Advanced agent workflows269270### Default Agent Types271272- **General-purpose subagent**: Complex multi-step tasks, autonomous execution273- **Plan subagent**: Implementation planning, architectural decisions274- **Explore subagent**: Codebase exploration, read-only research275- Thoroughness levels (quick, medium, very thorough) for Explore agent276- Default agent behaviors and when to use each277- Customizing built-in agent behavior278279### Plugin Agents280281- Plugin-provided agents282- Plugin agent discovery and usage283- Plugin agent configuration284285### Performance Considerations286287- Parallel agent execution288- Context efficiency and token usage289- Agent latency optimization290- When to use subagents vs direct tools291292## Test Scenarios293294These scenarios should activate this skill:2952961. **Direct activation**: "Use the subagent-development skill to help me create an agent"2972. **Configuration question**: "How do I restrict tools for my subagent?"2983. **Built-in agent question**: "What is the Explore subagent and how do I use it?"2994. **Troubleshooting**: "My agent isn't being invoked automatically"3005. **SDK question**: "How do I define agents programmatically in the Agent SDK?"301302## Related Skills303304| Skill | Relationship |305| --- | --- |306| **docs-management** | Primary delegation target (100%) - all official documentation |307| **agent-sdk-development** | Agent SDK-specific guidance for programmatic agents |308| **skill-development** | Skills can be auto-loaded by agents via skills field |309| **current-date** | For audit timestamps and verification dates |310311## Delegation Patterns312313### Standard Query Pattern314315```text316User asks: "How do I create an agent?"3173181. Invoke docs-management skill3192. Use keywords: "agent file format", "agent YAML frontmatter"3203. Load official documentation3214. Provide guidance based EXCLUSIVELY on official docs322```323324### Multi-Topic Query Pattern325326```text327User asks: "I want to create an agent with restricted tools that uses Haiku"3283291. Invoke docs-management skill with multiple queries:330 - "agent file format", "agent YAML frontmatter"331 - "agent tools", "allowed-tools agents"332 - "agent model selection", "haiku agents"3332. Synthesize guidance from official documentation334```335336### Troubleshooting Pattern337338```text339User reports: "My agent isn't being invoked automatically"3403411. Invoke docs-management skill3422. Use keywords: "automatic delegation agents", "agent description"3433. Check official docs for automatic invocation requirements3444. Guide user based on official troubleshooting steps345```346347## Troubleshooting Quick Reference348349| Issue | Keywords for docs-management |350| --- | --- |351| Agent not found | "agent file locations", "agent directories" |352| Agent not auto-invoked | "automatic delegation", "agent description matching" |353| Wrong model used | "agent model selection", "inherit model" |354| Tools not available | "agent tools", "allowed-tools agents" |355| Resumption not working | "agent resumption", "resume agent" |356| Priority conflicts | "agent priority resolution", "project CLI user" |357358## Known Issues359360### CRLF Line Endings Cause Silent Loading Failures (v2.1.x)361362**GitHub Issues:** [#16916](https://github.com/anthropics/claude-code/issues/16916), [#11205](https://github.com/anthropics/claude-code/issues/11205)363364**Symptoms:** Agent files exist but aren't available when spawning via Task tool. No error messages - agents silently fail to load.365366**Cause:** Claude Code v2.1.x introduced stricter YAML parsing. Agent files with Windows-style CRLF line endings (`\r\n`) fail to parse correctly, causing the agent to be skipped during plugin loading.367368**Detection:**369370```bash371# Check if file has CRLF372file path/to/agent.md373# CRLF present: "ASCII text, with CRLF line terminators"374# LF only: "ASCII text" (no CRLF mention)375```376377**Fix:**378379```bash380# Convert CRLF to LF381sed -i 's/\r$//' path/to/agent.md382383# Or using dos2unix384dos2unix path/to/agent.md385```386387**Prevention:**388389- Configure Git to use LF for `.md` files: `*.md text eol=lf` in `.gitattributes`390- Configure your editor to use LF for markdown files391- Run `file *.md` to check for CRLF before committing new agents392393**After Fix:** Restart Claude Code session to pick up the corrected agent files.394395### Plugin Agents Not Registered in plugin.json396397**Symptoms:** Agent file exists in plugin's `agents/` directory but isn't available when spawning via Task tool. No error messages.398399**Cause:** The plugin's `plugin.json` uses an **explicit agents array** instead of directory auto-discovery. New agent files must be manually added to the array.400401**Detection:**402403```bash404# Check if plugin.json uses explicit array vs directory405grep -A 5 '"agents"' .claude-plugin/plugin.json406# Array: "agents": ["./agents/foo.md", ...] <- Manual registration required407# Directory: "agents": "./agents" <- Auto-discovery408```409410**Fix:** Add the new agent file to the `agents` array in `plugin.json`.411412**Cross-reference:** See `plugin-development` skill → "Component Registration in plugin.json" for detailed guidance on explicit vs auto-discovery modes.413414## Repository-Specific Notes415416This repository uses subagents for:417418- **Explore agents**: Codebase exploration and research419- **Plan agents**: Implementation planning420- **General-purpose agents**: Complex multi-step tasks421422When creating agents for this repository, follow patterns in `.claude/settings.json` and existing agent configurations.423424## Related Guidance425426For comprehensive subagent usage guidance beyond configuration:427428- **When to use subagents**: See `.claude/memory/operational-rules.md` → "Agent Usage Principles"429- **Parallelization strategies**: See `.claude/memory/performance-quick-start.md` → "Strategy 1: Parallelization"430- **Context preservation patterns**: See `.claude/memory/operational-rules.md` → "Agent Communication Pattern"431- **Proactive delegation rule**: See `CLAUDE.md` Quick Reference → "PROACTIVE DELEGATION"432433## Auditing Agents434435This skill provides the validation criteria used by the `agent-auditor` agent for formal audits.436437### Audit Resources438439| Resource | Location | Purpose |440| --- | --- | --- |441| Validation Checklist | `references/validation-checklist.md` | Pre-creation verification checklist |442| Scoring Rubric | `references/validation-checklist.md#audit-scoring-rubric` | Formal audit scoring criteria |443| Undocumented Features | `references/undocumented-features.md` | Color, permissionMode, skills field details |444445### Scoring Categories446447| Category | Points | Key Criteria |448| --- | --- | --- |449| Name Field | 20 | Lowercase, hyphens, max 64 chars, no reserved words |450| Description Field | 25 | Third person, delegation triggers, when-to-use guidance |451| Tools Configuration | 20 | Appropriate restrictions, not over/under restricted |452| Model Selection | 15 | Appropriate for task complexity |453| Additional Fields | 20 | Color, skills, permissionMode correctly configured |454455**Thresholds:** 85+ = PASS, 70-84 = PASS WITH WARNINGS, <70 = FAIL456457### Related Agent458459The `agent-auditor` agent (Haiku model) performs formal audits using this skill:460461- Auto-loads this skill via `skills: subagent-development`462- Uses validation checklist and scoring rubric463- Checks both official and undocumented features464- Generates structured audit reports465- Invoked by `/audit-agents` command466467### External Technology Validation468469When auditing agents that use external technologies (scripts, packages, runtimes), the auditor MUST validate claims using MCP servers before flagging findings.470471**Technologies Requiring MCP Validation:**472473- .NET/C# scripts: Validate with microsoft-learn + perplexity474- Node.js/npm packages: Validate with context7 + perplexity475- Python scripts/packages: Validate with context7 + perplexity476- Shell scripts: Validate with perplexity477- Any version-specific claims: ALWAYS validate with perplexity478479**Validation Rule:**480481Never flag a technology usage as incorrect without first:4824831. Querying appropriate MCP server(s) for current documentation4842. Verifying with perplexity for recent changes (especially .NET 10+)4853. Documenting MCP sources in the finding486487**Stale Data Warning:**488489- microsoft-learn can return cached/outdated documentation490- ALWAYS pair microsoft-learn with perplexity for version verification491- Trust perplexity for version numbers and recently-released features492493## References494495**Official Documentation (via docs-management skill):**496497- Primary: "sub-agents" documentation498- Related: "Agent SDK", "Task tool", "model selection"499500**Repository-Specific:**501502- Agent configurations: `.claude/settings.json`503- Performance guidance: `.claude/memory/performance-quick-start.md`504- Operational rules: `.claude/memory/operational-rules.md` (Agent Usage Principles section)505506## Version History507508- **v1.4.0** (2026-01-10): Added Known Issues section509 - Documented CRLF line ending issue causing silent agent loading failures in v2.1.x510 - Documented plugin.json explicit array registration issue511 - Added detection, fix, and prevention guidance for both issues512 - Added cross-reference to plugin-development skill513 - Referenced GitHub issues #16916 and #11205514- **v1.3.0** (2026-01-09): Added v2.1.x agent hooks keyword registry entry515 - Added "Hooks (v2.1.x)" to Configuration keywords table516 - Added Quick Decision Tree entry #20 for agent lifecycle hooks517- **v1.2.0** (2025-11-27): Color property documentation518 - Added "Official YAML Frontmatter Reference" section with source reference to docs-management519 - Added "Color Property (Undocumented)" section documenting available colors520 - Added "Repository Color Standard" section with semantic color categories521 - Added color keyword to Configuration registry522 - Expanded Quick Decision Tree (19 entries, up from 17) with color entries523- **v1.1.0** (2025-11-27): Audit and enhancement524 - Added missing keyword registry entries (permissionMode, skills field, plugin agents, chaining, performance)525 - Expanded Built-in Agents section (General-purpose, Plan, Explore, thoroughness levels)526 - Added Test Scenarios section (5 scenarios)527 - Added Related Skills section528 - Expanded Quick Decision Tree (17 entries, up from 10)529 - Added Plugin Agents and Performance Considerations to Topic Coverage530 - Added Token Budget statement531- **v1.0.0** (2025-11-26): Initial release532 - Pure delegation architecture533 - Comprehensive keyword registry534 - Quick decision tree535 - Topic coverage for all subagent features536 - Troubleshooting quick reference537538---539540## Last Updated541542**Date:** 2026-01-10543**Model:** claude-opus-4-5-20251101544545---546> Converted and distributed by [TomeVault](https://tomevault.io/claim/melodic-software) — claim your Tome and manage your conversions.547<!-- tomevault:4.0:skill_md:2026-04-11 -->