Agent Skill
2/7/2026

claude-code-subagent-builder

Create, edit, or audit Claude Code custom agents (subagents), including file locations, YAML frontmatter, tool/permission settings, skills preloading, and prompt design. Use when asked to define a new Claude Code subagent, update an existing one, or review subagent configs for correctness and best practices. Triggers on "create agent", "new subagent", "define custom agent", "audit agent".

T
thirdlf03
0GitHub Stars
1Views
npx skills add thirdlf03/claude-dev-toolkit

SKILL.md

Nameclaude-code-subagent-builder
DescriptionCreate, edit, or audit Claude Code custom agents (subagents), including file locations, YAML frontmatter, tool/permission settings, skills preloading, and prompt design. Use when asked to define a new Claude Code subagent, update an existing one, or review subagent configs for correctness and best practices. Triggers on "create agent", "new subagent", "define custom agent", "audit agent".

name: claude-code-subagent-builder description: Create, edit, or audit Claude Code custom agents (subagents), including file locations, YAML frontmatter, tool/permission settings, skills preloading, and prompt design. Use when asked to define a new Claude Code subagent, update an existing one, or review subagent configs for correctness and best practices. Triggers on "create agent", "new subagent", "define custom agent", "audit agent". allowed-tools:

  • Read
  • Write
  • Edit
  • Glob

Claude Code Subagent Builder

Define and refine Claude Code subagents with correct placement, frontmatter, and prompting so delegation is safe, fast, and predictable.

Usage

"Create a subagent for code review"
"Define a new agent for log analysis"
"Audit my existing subagents"

Workflow

  1. Clarify the subagent's goal, inputs, outputs, and success criteria.
  2. Choose the scope and location for the subagent file.
  3. Draft YAML frontmatter and the system prompt body.
  4. Constrain tools and permissions; add skills or hooks only when needed.
  5. Test with real tasks and iterate.

Requirements Intake

Ask for:

QuestionPurpose
Primary tasks + 2-3 examplesDefine scope
Expected output formatSet quality bar
Scope (user/project/session)Choose location
Tool access needsSecurity
Permission modeSafety
Skills to preloadCapabilities
Hooks neededAutomation
Display colorUX

Choose Scope and Location

ScopeLocationUse Case
Session--agents CLI JSONTemporary, experiments
Project.claude/agents/Repo-specific, team use
User~/.claude/agents/Personal workflows

Reload after edits: restart or use /agents command.

Author the Subagent File

Frontmatter Fields

FieldRequiredDescription
nameYesUnique, short, action-oriented
descriptionYesRouting hint (WHEN to use)
toolsRecommendedAllowlist, [] for none, omit for all
disallowedToolsOptionalDenylist
modelOptionalOverride model
permissionModeOptionaldefault/acceptEdits/dontAsk/bypassPermissions/plan
skillsOptionalSkills to preload
hooksOptionalHooks to run
colorOptionalcyan/blue/green/magenta/yellow/red/white
disabledOptionalSet true to disable

Template

---
name: example-helper
description: Handle concise summaries of logs and errors for quick triage.
tools: ["Read", "Grep", "Glob"]
permissionMode: default
color: cyan
---

You are a focused helper that:
- Summarizes error patterns and likely root causes.
- Calls tools only when evidence is needed.
- Outputs a short summary followed by 3-5 bullet findings.

## Constraints
- Maximum 500 tokens output
- Never modify files

## Output Format
1. Summary (1-2 sentences)
2. Findings (3-5 bullets)
3. Recommended next steps

Prompting Guidance

DoDon't
Include all constraints explicitlyAssume inherited global instructions
Specify output formatLeave format ambiguous
State when to use/avoid toolsLet agent decide freely
Include acceptance criteriaSkip validation criteria

Tooling and Permissions

PatternWhen to Use
tools: []Analysis-only, no file access
tools: ["Read", "Glob"]Read-only inspection
disallowedTools: ["Bash"]Remove risky tools
permissionMode: defaultStandard safety (recommended)
permissionMode: dontAskNon-tooling analysis only
permissionMode: planMandatory plan before tools

Avoid: bypassPermissions unless hooks require it in trusted environment.

Test and Iterate

Test Checklist

CheckPass Criteria
Format consistencyOutput matches specified format
Tool usageUses only necessary tools
Constraint adherenceRespects all stated limits
Error handlingGraceful failure on edge cases

Example Test Tasks

# For a code-review agent:
"Review the changes in src/components/Button.tsx"

# For a log-analysis agent:
"Summarize errors from the last 24 hours in app.log"

# For a documentation agent:
"Generate API docs for the UserService class"

Error Handling

IssueSolution
Agent file not foundCheck path, suggest correct location
Invalid YAMLReport parse error with line number
Missing required fieldList missing fields, provide template
Permission deniedCheck file permissions, suggest chmod
Agent not loadingVerify frontmatter syntax, restart Claude

References

Skills Info
Original Name:claude-code-subagent-builderAuthor:thirdlf03