Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to "create a subagent", "validate a subagent", "generate subagent schema", "check subagent configuration", "write subagent specification", or mentions subagent development, validation, or protocol documentation for Claude Code.
.claude/skills/majiayu000-claude-subagent-development/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 134% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 134% | 0% |
Comprehensive guidance for creating, validating, and documenting Claude Code subagents with schemas and protocol specifications.
This skill provides structured workflows for developing production-ready Claude Code subagents. Use when creating new subagents, validating existing configurations, generating JSON schemas for validation, or writing technical specifications for subagent protocols.
This skill should be used when:
Subagents are Markdown files with YAML frontmatter:
markdown--- name: subagent-identifier description: When and how to use this subagent tools: Tool1, Tool2 model: sonnet permissionMode: default skills: skill1, skill2 --- System prompt content in Markdown format.
^[a-z0-9-]+$)sonnet, opus, haiku, or inheritdefault, acceptEdits, bypassPermissions, plan, ignorebash cp assets/template.md .claude/agents/your-subagent.md
name (lowercase, hyphens)description with trigger phrasestools needed (or omit for all)model and permissionModebash scripts/validate-subagent.sh .claude/agents/your-subagent.md
Use the validation script to check:
bashscripts/validate-subagent.sh path/to/subagent.md
The script validates against the JSON schema in assets/subagent-schema.json.
When needing a validation schema for tooling:
assets/subagent-schema.jsonThe schema includes:
For technical documentation:
references/protocol-specification.mdscripts/validate-subagent.sh checks:
Usage:
bashscripts/validate-subagent.sh <subagent-file>
Exit codes:
scripts/create-subagent.sh scaffolds a new subagent:
bashscripts/create-subagent.sh <name> <scope>
Arguments:
name: Subagent identifier (lowercase, hyphens)scope: project (.claude/agents/) or user (~/.claude/agents/)Creates file from template and opens in editor.
assets/subagent-schema.json provides:
Use with validation tools:
bash# With ajv-cli ajv validate -s assets/subagent-schema.json -d your-subagent.json # With Python jsonschema python -c "import json, jsonschema; \ jsonschema.validate( \ json.load(open('subagent.json')), \ json.load(open('assets/subagent-schema.json')))"
Include specific trigger phrases:
Good:
yamldescription: Expert code reviewer. Use PROACTIVELY after code changes to review quality, security, and best practices. Checks for vulnerabilities, performance issues, style violations.
Poor:
yamldescription: Helps with code
Grant only necessary tools:
yaml# Read-only analysis tools: Read, Grep, Glob # Code modification tools: Read, Edit, Write # Full workflow tools: Read, Edit, Write, Bash
Structure prompts with:
Choose appropriate model:
Comprehensive documentation in references/:
protocol-specification.md: Complete subagent protocol spec (20,000+ words)field-reference.md: Detailed field-by-field referencebest-practices.md: Advanced best practicesProduction-ready examples in examples/:
code-reviewer.md: Comprehensive code review subagentdebugger.md: Systematic debugging specialisttest-runner.md: Test automation expertTemplates and schemas in assets/:
subagent-schema.json: Complete JSON Schema for validationtemplate.md: Base template for new subagents.claude/agents/name.md~/.claude/agents/name.mdplugin-dir/agents/name.mdWhen names conflict:
Common tools for subagents:
Task - Delegate to subagentsBash - Execute shell commandsRead, Edit, Write - File operationsGrep, Glob - Search operationsWebFetch, WebSearch - Web operationsTodoWrite - Task managementmcp__<server>__<tool>default: Standard permission flow (recommended)acceptEdits: Auto-approve edit operationsbypassPermissions: Skip all permissions (use cautiously)plan: Read-only explorationignore: Ignore permission dialogsCheck:
^[a-z0-9-]+$Run validation:
bashscripts/validate-subagent.sh path/to/subagent.md
Improve description:
Example:
yamldescription: Security auditor. Use PROACTIVELY when reviewing code, checking for vulnerabilities, or analyzing security. Checks OWASP Top 10, injection attacks, authentication issues.
Verify:
tools specifiedmcp__server__toolCheck available tools:
Task, Bash, Glob, Grep, Read, Edit, Write, NotebookEdit,
WebFetch, WebSearch, BashOutput, KillShell, AskUserQuestion,
TodoWrite, Skill, SlashCommandAdjust permissionMode:
default: User approves operationsacceptEdits: Auto-approve edits onlybypassPermissions: Auto-approve all (use carefully)Or grant specific tools in tools field.
Before deploying a subagent:
Structure:
Configuration:
^[a-z0-9-]+$Content Quality:
Validation:
Testing:
Other measured skills in the registry, with their headline benchmark lift.