一键导入
create-subagents
ALWAYS invoke this skill when creating, editing, or configuring subagents. NEVER create subagents without this skill.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
ALWAYS invoke this skill when creating, editing, or configuring subagents. NEVER create subagents without this skill.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ALWAYS invoke this skill when diagnosing the health of a spec-tree or spx environment, when checking whether the SessionStart hook fired for the current session, or when troubleshooting a missing session identity, worktree claim, or unreachable spx CLI. NEVER guess why session state is missing without running these checks first.
ALWAYS invoke this skill when diagnosing the health of a spec-tree or spx environment, when checking whether the SessionStart hook fired for the current session, or when troubleshooting a missing session identity, worktree claim, or unreachable spx CLI. NEVER guess why session state is missing without running these checks first.
ALWAYS invoke this skill when diagnosing the health of a spec-tree or spx environment, when checking whether the SessionStart hook fired for the current session, or when troubleshooting a missing session identity, worktree claim, or unreachable spx CLI. NEVER guess why session state is missing without running these checks first.
ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill.
ALWAYS invoke this skill when selecting the next executable slice to implement or deciding which spec-tree nodes /apply should build next from an implementation plan. NEVER choose the next nodes by ad hoc selection — this skill scopes an existing plan to demonstrable value before /apply runs.
ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill.
| name | create-subagents |
| description | ALWAYS invoke this skill when creating, editing, or configuring subagents. NEVER create subagents without this skill. |
Invoke the instructions:agent-prompt-standards skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
<quick_start>
/agents command.claude/agents/) or user-scope (~/.claude/agents/)opus, sonnet, haiku, or inherit)<file_structure>
<claude_storage_locations>
Priority order:
.claude/agents/ for the current product--agents flag for the current session~/.claude/agents/ for all projectsagents/ directory for all projects</claude_storage_locations>
Product-scope subagents override user-scope when names conflict. </file_structure>
Read, Write, Edit, Bash, Grep/agents interface to see all available toolsskills:
- audit-typescript-code
- testing
<execution_model> <critical_constraint>
Subagents are black boxes that cannot interact with users.
Subagents run in isolated contexts and return their final output to the main conversation. They:
The main conversation sees only the isolated workflow's final report/output. </critical_constraint>
<workflow_design> Designing workflows with subagents:
Use main chat for:
Use subagents for:
Example workflow pattern:
Main Chat: Ask user for requirements (AskUserQuestion)
↓
subagent: Research API and create documentation (no user interaction)
↓
Main Chat: Review research with user, confirm approach
↓
subagent: Generate code based on confirmed plan
↓
Main Chat: Present results, handle testing/deployment
</workflow_design> </execution_model>
<system_prompt_guidelines> Clearly define the subagent's role, capabilities, and constraints.
Structure the system prompt with pure XML tags. Remove ALL markdown headings from the body.---
name: security-reviewer
description: Reviews code for security vulnerabilities
tools: Read, Grep, Glob, Bash
model: sonnet
---
<role>
Claude is a senior code reviewer specializing in security.
</role>
<focus_areas>
- SQL injection vulnerabilities
- XSS attack vectors
- Authentication/authorization issues
- Sensitive data exposure
</focus_areas>
<workflow>
1. Read the modified files
2. Identify security risks
3. Provide specific remediation steps
4. Rate severity (Critical/High/Medium/Low)
</workflow>
Tailor instructions to the specific task domain. Don't create generic "helper" subagents.
❌ Bad: "Helpful assistant for code" ✅ Good: "Claude is a React component refactoring specialist. Analyze components for hooks best practices, performance anti-patterns, and accessibility issues." </system_prompt_guidelines>
<configured_agent_xml_structure> subagent file bodies are system prompts consumed by the target runtime. Like skills and slash commands, they should use pure XML structure for parsing and token efficiency.
<recommended_tags> Common tags for subagent structure:
<role> - Who the subagent is and what it does<constraints> - Hard rules (NEVER/MUST/ALWAYS)<focus_areas> - What to prioritize<workflow> - Step-by-step process<output_format> - How to structure deliverables<success_criteria> - Completion criteria<validation> - How to verify work</recommended_tags>
<intelligence_rules> Simple subagents (single focused task):
Medium subagents (multi-step process):
Complex subagents (research + generation + validation):
</intelligence_rules>
<critical_rule> Remove ALL markdown headings (##, ###) from subagent body. Use semantic XML tags instead.
Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
For XML structure principles and token efficiency details, read /skill-standards — the same principles apply to subagents.
</critical_rule>
</configured_agent_xml_structure>
> Use the code-reviewer subagent to check my recent changes
> Have the test-writer subagent create tests for the new API endpoints
Run /agents for an interactive interface to:
</using_agents_command>
<manual_editing> Edit subagent files directly:
.claude/agents/subagent-name.md~/.claude/agents/subagent-name.md</manual_editing>
**Core references**:<failure_modes>
Failure: Runtime-specific examples made SKILL.md exceed the line budget
What happened: Claude added target-specific TOML/YAML examples directly to this SKILL.md until the authored source exceeded /skill-standards' 500-line cap.
Why it failed: The fast path stopped being an overview and absorbed detail that belongs in references.
How to avoid: Keep SKILL.md under 500 lines; move extended examples and configuration matrices to the cited references, then run wc -l "${CLAUDE_SKILL_DIR}/SKILL.md" before audit.
</failure_modes>
<success_criteria> A well-configured subagent has:
Valid YAML frontmatter (name matches file, description includes triggers)
Clear role definition in system prompt
Appropriate tool restrictions (least privilege)
XML-structured system prompt with role, approach, and constraints
Description field optimized for automatic routing
At least one verification run or documented dry-run against the subagent's intended workflow
Model selection appropriate for task complexity, cost, and reproducibility needs
</success_criteria>