一键导入
claude-agents
Guide for creating custom agents for Claude Code. Use when creating specialized agents, configuring agent tools.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for creating custom agents for Claude Code. Use when creating specialized agents, configuring agent tools.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guide for creating Agent Skills with progressive disclosure and best practices. Use when creating new skills, understanding skill structure, or implementing progressive disclosure.
Guide for using mise to manage development tools and runtime versions. Use when configuring project tooling, managing environment variables, or defining project tasks.
Guide for using Nushell for structured data pipelines and scripting. Use when writing shell scripts, processing structured data, or working with cross-platform automation.
Guide for 12-Factor cloud-native applications. Use when designing microservices, configuring containers, deploying to Kubernetes, or following cloud-native patterns.
Guide for creating custom slash commands for Claude Code. Use when adding a new slash command, writing $ARGUMENTS or $N argument substitutions, setting argument-hint or arguments in command frontmatter, choosing command frontmatter fields, injecting shell output into a command, or migrating .claude/commands/ files to skills.
Guide for implementing web accessibility (WCAG). Use when designing UI components, reviewing interfaces for accessibility, or ensuring compliance with W3C WAI standards.
| name | claude-agents |
| description | Guide for creating custom agents for Claude Code. Use when creating specialized agents, configuring agent tools. |
Guide for creating custom agents that provide specialized behaviors and tool access for specific tasks.
Invoke /core:agent-loop for the 4-phase / 6-tier execution model.
Invoke /claude-code:claude-teams if the agent joins a multi-agent team.
Invoke /core:anti-fabrication always — every claim about a tool, file, or test result requires tool execution.
Glob patterns like /core:* do not expand in Agent prompts. List skill names explicitly.
Activate this skill when:
Agents are specialized Claude instances with:
| Feature | Agents | Skills |
|---|---|---|
| Activation | Explicitly launched via Agent tool | Auto-activated based on context |
| Tool Access | Configurable, can be restricted | Inherit from parent context |
| State | Independent, isolated | Share parent context |
| Use Case | Complex multi-step tasks | Knowledge and guidelines |
| Persistence | Single execution | Always available when loaded |
Agents are defined in markdown files located in:
<plugin-root>/agents/.claude/agents/code-reviewer.md---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Grep, Glob
model: sonnet
---
You are a code reviewer. Analyze code for quality, security, and best practices.
## Workflow
1. **Find files**: Glob to locate target files
2. **Read code**: Examine contents
3. **Check patterns**: Grep for anti-patterns
4. **Report**: Provide prioritized feedback
## Guidelines
- **Specific**: Reference file:line locations
- **Actionable**: Suggest concrete fixes
- **Prioritized**: Critical issues first
Effective agents use direct, imperative language:
Complete field reference (source: https://code.claude.com/docs/en/sub-agents):
| Field | Required | Meaning |
|---|---|---|
name | yes | Unique identifier, lowercase letters and hyphens. Hooks receive this value as agent_type. The filename does not need to match. |
description | yes | When Claude delegates to this subagent. |
tools | no | Tool allowlist. Omit to inherit all tools. To preload skill content use skills — never list Skill here. |
disallowedTools | no | Denylist removed from the inherited or specified tool set. |
model | no | sonnet, opus, haiku, fable, a full model ID (e.g. claude-opus-4-8), or inherit. Defaults to inherit. |
permissionMode | no | default, acceptEdits, auto, dontAsk, bypassPermissions, plan, or manual (alias of default, v2.1.200+). Ignored for plugin subagents. |
maxTurns | no | Maximum agentic turns before the subagent stops. |
skills | no | Skills preloaded into context at startup. See Preloading Skills below. |
mcpServers | no | MCP servers available to this subagent (name reference or inline config). Ignored for plugin subagents. |
hooks | no | Lifecycle hooks scoped to this subagent. Ignored for plugin subagents. |
memory | no | Persistent memory scope: user, project, or local. |
background | no | true forces background execution. Unset lets Claude choose; defaults to background as of v2.1.198. |
effort | no | low, medium, high, xhigh, or max (model-dependent). |
isolation | no | worktree runs the subagent in a temporary git worktree, auto-cleaned if the subagent makes no changes. |
color | no | red, blue, green, yellow, purple, orange, pink, cyan. |
initialPrompt | no | Auto-submitted first user turn when run as a main-session agent (--agent). |
Example:
---
name: agent-name # Required: kebab-case identifier
description: Brief description # Required: What this agent does
tools: # Optional: tool allowlist, inherits all if omitted
- Read
- Write
- Bash
model: sonnet # Optional: model to use, defaults to inherit
---
Restrict agent to specific tools:
Example:
---
tools: Read, Grep, Glob
---
No tool restrictions (access to all tools):
---
# Omit tools field entirely
---
Choose the model for the task, or inherit the parent session's model:
---
model: haiku # Fast, cost-effective for simple tasks
# model: sonnet # Balanced
# model: opus # Complex reasoning
# model: fable # Fable 5 tier
# model: claude-opus-4-8 # Full model ID pins an exact version
# model: inherit # Default — matches the parent session's model
---
The skills field preloads full skill content into the subagent's context at startup — not just the description shown during discovery. Use the namespaced form for plugin skills:
---
name: phoenix-reviewer
description: Reviews Phoenix application code
tools: Read, Glob, Grep
skills:
- elixir:phoenix
- elixir:testing
---
Skills not listed in skills remain invocable through the Skill tool during the run — skills only controls what loads automatically at startup. Never list Skill in tools: to enable this; skills is the dedicated field.
For security scans, code reviews, or audits. Restricted to Read, Grep, Glob.
See: templates/read-only-analyzer.md
For generating tests, documentation, or code. Includes Write tool.
See: templates/write-capable-agent.md
For refactoring, migrations, or complex modifications. Omit tools field entirely for no restrictions.
See: templates/full-access-agent.md
For browser automation, external APIs, or specialized MCP server tools. Mix core tools with MCP tools.
See: templates/mcp-agent.md
{
"agents": [
"./agents/code-reviewer.md",
"./agents/test-generator.md",
"./agents/security-analyzer.md"
]
}
{
"agents": "./agents"
}
Loads all .md files in agents/ directory.
Agents are launched via the Agent tool (Task remains a deprecated alias, renamed in v2.1.63):
# In parent Claude conversation
Agent(
subagent_type="code-reviewer",
description="Review authentication module",
prompt="""
Review the authentication module for:
- Security vulnerabilities
- Error handling
- Input validation
- Best practices
"""
)
Each agent has a specific, well-defined purpose:
---
name: migration-helper
description: Assists with database schema migrations
---
# Database Migration Agent
Specialized in creating and validating database migrations.
Only grant necessary tools:
---
# Analysis agent - read-only
tools: Read, Grep, Glob
---
---
# Implementation agent - can modify
tools: Read, Write, Edit, Glob, Grep
---
Match model to task complexity:
model is omitted — matches the parent sessionSet maxTurns for task complexity:
---
maxTurns: 5 # Simple, focused task
# maxTurns: 20 # Complex, multi-step workflow
---
Provide explicit behavior guidelines:
# Testing Agent
## Mandatory Requirements
- Generate tests for ALL public methods
- Achieve minimum 80% code coverage
- Include edge cases and error scenarios
- Use project's testing framework conventions
## Constraints
- Do not modify source code
- Follow existing test file naming patterns
- Use appropriate assertions
Limit dangerous operations:
---
# Don't give Bash access to untrusted agents
tools:
- Read
- Write # Safer than arbitrary shell commands
---
Validate agent inputs:
# Deployment Agent
Before deploying:
1. Verify target environment is valid
2. Check deployment permissions
3. Validate configuration
4. Confirm destructive operations
Never hardcode:
For complete, production-ready agent templates:
templates/basic-agent.md - Official minimal exampletemplates/read-only-analyzer.md - Security analyzer patterntemplates/write-capable-agent.md - Test generator patterntemplates/full-access-agent.md - Refactoring pattern (no tool restrictions)templates/mcp-agent.md - Browser testing with MCP toolsTemplates directory:
templates/basic-agent.md - Official minimal exampletemplates/read-only-analyzer.md - Security analysis patterntemplates/write-capable-agent.md - Test generation patterntemplates/full-access-agent.md - Refactoring pattern (no tool restrictions)templates/mcp-agent.md - MCP tools pattern (browser automation)Documentation: