Install any skill in seconds. Free to start, no credit card required.
Get Started Free →CRITICAL: Before deploying any subagent, spawn a reviewer agent with REVIEW.md to audit tools. Overly permissive tool access can cause data loss or leak secrets.
.claude/skills/majiayu000-write-subagent/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-16 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-21 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 90% | 0% |
| case-04 | ✓→✗ | ▼ Worse | 0% | 0% |
name: write-subagent description: Use when the user wants to create a new Claude Code subagent. Guides subagent creation with focused prompts and constrained tool access. argument-hint: "global|local] subagent-name] purpose...]" {{- template "bedrock-model" (dict "tier" "opus" "root" .) }} disable-model-invocation: true allowed-tools:
CRITICAL: Before deploying any subagent, spawn a reviewer agent with REVIEW.md to audit tools. Overly permissive tool access can cause data loss or leak secrets.
Create subagents as focused specialists, not general-purpose assistants.
$ARGUMENTSCheck if arguments specify global or local:
global or in ~/.claude/agents/ → Subagent goes in dotfiles via chezmoi, available everywherelocal or in .claude/agents/ → Subagent goes in current project's .claude/agents/, scoped to this repoIf scope is unclear, ask: > "Should this subagent be global (available in all projects via dotfiles) or local (scoped to this project only)?"
If arguments are empty, the user wants to codify a delegatable task:
If unclear, ask:
For global subagents: Create $(chezmoi source-path)/dot_claude/agents/<name>.md.tmpl (note .tmpl extension)
For local subagents: Create .claude/agents/<name>.md in the current working directory (plain .md, no template)
Global subagent template (.md.tmpl):
yaml--- name: <kebab-case> description: <When Claude should delegate + what it does. Use "proactively" for auto-use.> tools: <minimal subset - see REVIEW.md> disallowedTools: <explicit denials if inheriting> {{ "{{-" }} template "bedrock-model" (dict "tier" "<haiku|sonnet|opus>" "root" .) {{ "}}" }} permissionMode: <default|acceptEdits|dontAsk|plan> skills: <list of skills to preload> hooks: <optional lifecycle hooks> --- <System prompt: Who the subagent is, what it does, how it works>
Local subagent template (plain .md):
yaml--- name: <kebab-case> description: <When Claude should delegate + what it does. Use "proactively" for auto-use.> tools: <minimal subset - see REVIEW.md> disallowedTools: <explicit denials if inheriting> # model: omit to inherit, or use plain: model: sonnet permissionMode: <default|acceptEdits|dontAsk|plan> --- <System prompt: Who the subagent is, what it does, how it works>
For global subagents: After writing, run:
chezmoi diff to previewchezmoi apply ~/.claude/agents/<name>.md to deploychezmoi status to verifyFor local subagents: Restart Claude Code or run /agents to load immediately.
Frontmatter:
description: Include "proactively" or "Use immediately after..." for auto-delegationtools: Minimal subset—subagents inherit all tools by default, so use disallowedTools to restrictmodel: Match to task complexity (see MODEL-SELECTION.md)permissionMode: Use dontAsk for read-only, acceptEdits for trusted modificationSystem Prompt (body):
Key Differences from Skills:
tools/disallowedTools instead of allowed-toolsSpawn a reviewer agent with this skill's REVIEW.md file to audit:
tools against red flags (reject broad patterns like all tools when minimal set needed)disallowedTools used to restrict inherited capabilities?| Goal | Frontmatter | |------|-------------| | Auto-delegation | description with "proactively" | | Read-only | disallowedTools: Write, Edit or tools: Read, Glob, Grep | | Fast/cheap | model: haiku | | Capable | model: sonnet or model: opus | | Skip prompts | permissionMode: dontAsk (auto-deny) or acceptEdits | | Exploration | permissionMode: plan | | Inject knowledge | skills: [skill-name, ...] | | Validate operations | hooks: { PreToolUse: [...] } |
tools before deployment/write-subagent → extract subagent from current conversation (will ask about scope)
/write-subagent global code-reviewer → global subagent for code review (via chezmoi)
/write-subagent local db-query → project-local subagent for database queries
/write-subagent in ~/.claude/agents/ search → global subagent (explicit path)
/write-subagent in .claude/agents/ lint → local subagent (explicit path)| Choose global when... | Choose local when... | |---------------------------|--------------------------| | Subagent is useful across many projects | Subagent uses project-specific conventions | | General-purpose task (review, debug, test) | Requires project-specific tools/config | | You want it in your dotfiles | Team members should have it too | | Personal workflow preference | Repo-specific domain knowledge |
disallowedTools for write operations on read-only agents| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 7,041 | 14,548 | +107% | 1 | 1 | 0% | 346 | 2,388 | +590% | 0 | 0 | — |
case-02 | fail→fail | 20,925 | 15,363 | -27% | 1 | 1 | 0% | 2,398 | 2,168 | -10% | 0 | 0 | — |
case-03 | fail→fail | 21,420 | 16,873 | -21% | 1 | 1 | 0% | 2,660 | 3,145 | +18% | 0 | 0 | — |
case-04 | pass→fail | 18,745 | 18,799 | +0% | 1 | 1 | 0% | 2,422 | 2,413 | -0% | 0 | 0 | — |
case-05 | fail→fail | 3,283 | 10,977 | +234% | 1 | 1 | 0% | 335 | 1,984 | +492% | 0 | 0 | — |
case-06 | fail→fail | 11,944 | 21,271 | +78% | 1 | 1 | 0% | 2,269 | 2,535 | +12% | 0 | 0 | — |
case-07 | fail→fail | 18,696 | 24,170 | +29% | 1 | 1 | 0% | 2,933 | 2,652 | -10% | 0 | 0 | — |
case-08 | fail→fail | 8,527 | 10,929 | +28% | 1 | 1 | 0% | 271 | 2,046 | +655% | 0 | 0 | — |
case-09 | fail→fail | 21,281 | 10,661 | -50% | 1 | 1 | 0% | 2,830 | 2,051 | -28% | 0 | 0 | — |
case-10 | fail→fail | 26,771 | 18,824 | -30% | 1 | 1 | 0% | 4,255 | 2,191 | -49% | 0 | 0 | — |
case-11 | fail→fail | 18,750 | 18,114 | -3% | 1 | 1 | 0% | 2,287 | 2,244 | -2% | 0 | 0 | — |
case-12 | fail→fail | 14,264 | 2,637 | -82% | 1 | 1 | 0% | 2,054 | 2,147 | +5% | 0 | 0 | — |
case-13 | pass→fail | 12,623 | 13,406 | +6% | 1 | 1 | 0% | 2,024 | 2,065 | +2% | 0 | 0 | — |
case-14 | pass→pass | 13,598 | 5,377 | -60% | 1 | 1 | 0% | 1,422 | 2,812 | +98% | 0 | 0 | — |
case-15 | pass→pass | 11,048 | 6,546 | -41% | 1 | 1 | 0% | 868 | 2,840 | +227% | 0 | 0 | — |
case-16 | fail→pass | 14,334 | 14,934 | +4% | 1 | 1 | 0% | 2,210 | 3,310 | +50% | 0 | 0 | — |
case-17 | fail→fail | 14,738 | 13,797 | -6% | 1 | 1 | 0% | 2,609 | 2,284 | -12% | 0 | 0 | — |
case-18 | fail→fail | 12,572 | 7,689 | -39% | 1 | 1 | 0% | 2,008 | 3,015 | +50% | 0 | 0 | — |
case-19 | pass→pass | 9,555 | 4,549 | -52% | 1 | 1 | 0% | 1,454 | 2,503 | +72% | 0 | 0 | — |
case-20 | fail→pass | 19,241 | 6,225 | -68% | 1 | 1 | 0% | 2,215 | 2,787 | +26% | 0 | 0 | — |
case-21 | fail→pass | 22,235 | 23,080 | +4% | 1 | 1 | 0% | 3,223 | 3,045 | -6% | 0 | 0 | — |
case-22 | fail→pass | 8,853 | 3,742 | -58% | 1 | 1 | 0% | 1,244 | 2,369 | +90% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 10 counted toward the lift figure. The other 12 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +9 percentage points is the difference between those two pass rates over the 10 comparable cases. 6 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.