Create a new custom subagent (skill) for specialized tasks with proper configuration and system prompts.
/plugin marketplace add alexanderop/claude-code-builder/plugin install claude-code-builder@claude-code-builderCreate a new custom subagent (skill) for specialized tasks with proper configuration and system prompts.
Inputs:
$1 — AGENT_NAME (lowercase, kebab-case, e.g., "code-reviewer")$2 — DESCRIPTION (when this agent should be invoked, e.g., "Expert code reviewer. Use proactively after code changes.")--user — Create user-level agent in ~/.claude/agents/ (default: project-level in .claude/agents/)--tools — Comma-separated list of tools (e.g., "Read,Grep,Glob,Bash")--model — Model to use: "sonnet", "opus", "haiku", or "inherit" (default: sonnet)Outputs:
STATUS=<CREATED|EXISTS|FAIL> PATH=<path> AGENT=<name>Validate inputs:
--tools specified, validate tool names against available tools--model specified, validate it's one of: sonnet, opus, haiku, inheritDetermine file location:
.claude/agents/{AGENT_NAME}.md (project-level)--user: ~/.claude/agents/{AGENT_NAME}.md (user-level)Check for existing agent:
STATUS=EXISTS and exit/agents command to edit existing agentsGenerate agent file content:
---
name: {AGENT_NAME}
description: {DESCRIPTION}
tools: {TOOLS} # Optional - only include if specified
model: {MODEL} # Optional - only include if specified
---
You are a specialized agent for {purpose based on description}.
When invoked:
1. Understand the specific task or problem
2. Analyze the relevant context
3. Execute your specialized function
4. Provide clear, actionable results
Key responsibilities:
- {Responsibility 1 based on description}
- {Responsibility 2 based on description}
- {Responsibility 3 based on description}
Best practices:
- Be focused and efficient
- Provide specific, actionable feedback
- Document your reasoning
- Follow established patterns and conventions
For each task:
- Explain your approach
- Show your work
- Highlight key findings or changes
- Suggest next steps if applicable
Write the file:
Output result:
STATUS=CREATED PATH={path} AGENT={name}Use the {name} agent to.../create-skill code-reviewer "Expert code review specialist. Use proactively after code changes."
# Output: STATUS=CREATED PATH=.claude/agents/code-reviewer.md AGENT=code-reviewer
/create-skill debugger "Debugging specialist for errors and test failures" --user --tools "Read,Edit,Bash,Grep,Glob"
# Output: STATUS=CREATED PATH=~/.claude/agents/debugger.md AGENT=debugger
/create-skill data-scientist "Data analysis expert for SQL queries and insights" --tools "Bash,Read,Write" --model "sonnet"
# Output: STATUS=CREATED PATH=.claude/agents/data-scientist.md AGENT=data-scientist
/agents for complex cases/agents - Interactive interface for managing agents (recommended for editing)