creating-agents
Use this skill when creating custom Claude Code subagents, designing agent configurations, deciding between agent scopes (user vs project), configuring tool restrictions, or setting up lifecycle hooks. Helps design focused agents with appropriate capabilities.
What this skill does
# Creating Custom Claude Code Subagents
This skill guides you through designing and creating custom subagent configurations for Claude Code CLI.
## Official Documentation
For the most current information, reference:
- https://code.claude.com/docs/en/sub-agents
## When to Create a Custom Agent
**Use Built-in Agents When:**
- **Explore**: Fast, read-only codebase exploration (uses Haiku)
- **Plan**: Research and planning tasks
- **General-purpose**: Complex multi-step tasks with full capabilities
- **Bash**: Terminal commands in separate context
**Create Custom Agents When:**
- You need a specialized domain expert (code reviewer, data scientist, security auditor)
- You require specific tool restrictions for safety or focus
- You want custom hooks for validation or lifecycle events
- You need a focused system prompt for consistent behavior
- You want to share configurations with your team via version control
## Agent Design Process
### 1. Gather Requirements
Ask the user to clarify:
- What specific task should this agent handle?
- What tools does it need? What tools should it NOT have?
- Should this be user-level (all projects) or project-level?
- Does it need hooks for validation or setup/cleanup?
### 2. Choose Location
| Location | Path | Scope | Use Case |
|----------|------|-------|----------|
| Project | `.claude/agents/` | Current project | Team-shared, version-controlled |
| User | `~/.claude/agents/` | All your projects | Personal preferences |
| Session | `--agents` CLI flag | Current session only | Temporary experimentation |
### 3. Write the Description (Critical!)
The description determines when Claude delegates to your agent. Write it like you're telling Claude: "Use this agent when..."
**Good descriptions:**
- "Expert code review specialist. Proactively reviews code for quality, security, and maintainability"
- "Execute read-only database queries with SQL validation"
- "Debugging specialist for errors, test failures, and unexpected behavior"
**Bad descriptions:**
- "Code helper" (too vague)
- "Does stuff with files" (no trigger keywords)
- "My agent" (meaningless)
### 4. Configure Tool Access
Three approaches:
- **Inherit all** (default): Omit `tools` field entirely
- **Allowlist**: Use `tools` to specify only permitted tools
- **Denylist**: Use `disallowedTools` to remove specific tools
Common tool sets:
- **Read-only**: `Read, Grep, Glob, Bash`
- **With editing**: `Read, Edit, Write, Bash, Grep, Glob`
- **Minimal**: `Read, Grep, Glob` (no Bash)
### 5. Set Permission Mode
| Mode | Behavior |
|------|----------|
| `default` | Standard permission prompts |
| `acceptEdits` | Auto-accept file edits |
| `dontAsk` | Auto-deny permission prompts |
| `bypassPermissions` | Skip all checks (use cautiously) |
| `plan` | Read-only exploration mode |
### 6. Add Hooks (Optional)
Hooks enable validation or lifecycle events. See `./references/hooks-and-validation-patterns.md` for examples.
## Quick Configuration Reference
```yaml
---
name: my-agent # Required: lowercase, hyphens only
description: When to use this # Required: determines delegation
model: sonnet # Optional: sonnet|opus|haiku|inherit
tools: Read, Grep, Glob # Optional: allowlist (inherits all if omitted)
disallowedTools: Write, Edit # Optional: denylist
permissionMode: default # Optional: permission handling
skills: my-skill, other-skill # Optional: preload skill context
hooks: # Optional: lifecycle hooks
PreToolUse: [...]
PostToolUse: [...]
---
Your system prompt goes here. This is the context and instructions
the agent receives when invoked.
```
For detailed field documentation, see `./references/agent-configuration-options.md`.
## Common Patterns
### Read-Only Reviewer
```yaml
---
name: code-reviewer
description: Expert code review specialist for quality, security, and maintainability
tools: Read, Grep, Glob, Bash
model: inherit
---
You are a senior code reviewer. Analyze code and provide specific, actionable feedback.
```
### Database Reader with Validation
```yaml
---
name: db-reader
description: Execute read-only database queries with SQL validation
tools: Bash
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/validate-readonly-query.sh"
---
You execute SQL queries. Only SELECT statements are permitted.
```
### Focused Domain Specialist
```yaml
---
name: security-auditor
description: Security specialist for vulnerability assessment and secure coding review
tools: Read, Grep, Glob, Bash
disallowedTools: Edit, Write
---
You are a security expert. Focus on OWASP Top 10, authentication, authorization,
input validation, and secure data handling.
```
For more examples, see `./references/agent-examples.md`.
## Validation Checklist
Before finalizing your agent:
- [ ] **Name**: Lowercase letters and hyphens only, unique identifier
- [ ] **Description**: Clear, specific, includes trigger keywords
- [ ] **Tools**: Minimally scoped for the task (principle of least privilege)
- [ ] **System prompt**: Focused instructions for the agent's role
- [ ] **Location**: Appropriate scope (project vs user)
- [ ] **Hooks**: If used, validation script tested and working
## Creating the Agent File
1. Create the file at the appropriate location:
```bash
# Project-level (version-controlled)
mkdir -p .claude/agents
# User-level (personal)
mkdir -p ~/.claude/agents
```
2. Write the agent file with `.md` extension:
```bash
# Example: .claude/agents/code-reviewer.md
```
3. Test by asking Claude to use the agent or let it auto-delegate based on description
## Using Agents
Once created, agents are available automatically:
- Claude delegates based on matching descriptions
- Explicitly invoke: "Use the code-reviewer agent to analyze this file"
- Manage via `/agents` command in Claude Code
## Reference Files
- `./references/agent-configuration-options.md` — All frontmatter fields explained
- `./references/hooks-and-validation-patterns.md` — Hook examples and validation scripts
- `./references/agent-examples.md` — Curated agent configurations for common use cases
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.