Loading...
Loading...
Compare original and translation side by side
| Location | Scope | Priority |
|---|---|---|
| Current project | Highest |
| All projects | Lower |
---
name: agent-name
description: Description of when this agent should be used
tools: Read, Write, Bash, Glob, Grep # Optional - omit to inherit all
model: sonnet # Optional - sonnet, opus, haiku, or inherit
permissionMode: default # Optional - see permission modes below
skills: skill1, skill2 # Optional - skills to auto-load
---
Your agent's system prompt goes here. This defines the agent's
role, capabilities, approach, and constraints.
Include:
- Role definition and expertise areas
- Step-by-step workflow for common tasks
- Constraints and rules to follow
- Output format expectations
- Examples of good behavior| 位置 | 作用范围 | 优先级 |
|---|---|---|
| 当前项目 | 最高 |
| 所有项目 | 较低 |
---
name: agent-name
description: Description of when this agent should be used
tools: Read, Write, Bash, Glob, Grep # 可选 - 留空则继承所有工具
model: sonnet # 可选 - sonnet, opus, haiku,或继承会话模型
permissionMode: default # 可选 - 详见下方权限模式
skills: skill1, skill2 # 可选 - 自动加载的Skill
---
此处填写Agent的系统提示词。这将定义Agent的
角色、能力、工作方式和约束条件。
需包含:
- 角色定义与专业领域
- 常见任务的分步工作流
- 需要遵循的约束与规则
- 输出格式要求
- 良好行为示例teamsteams(action: 'delegate', tasks: [{
text: '<the agent\'s instructions and task>',
assignee: 'worker-name'
}])teamsteams(action: 'delegate', tasks: [{
text: '<the agent\'s instructions and task>',
assignee: 'worker-name'
}])| Field | Description |
|---|---|
| Unique identifier (lowercase letters, numbers, hyphens only, max 64 chars) |
| When the agent should be used (include "PROACTIVELY" for auto-invocation) |
| 字段 | 描述 |
|---|---|
| 唯一标识符(仅允许小写字母、数字、连字符,最长64字符) |
| Agent的适用场景(若需自动调用,需包含"PROACTIVELY") |
| Field | Options | Description |
|---|---|---|
| Comma-separated list | Specific tools to allow. Omit to inherit all. |
| | Model to use. Default: inherit from session. |
| See below | How permissions are handled |
| Comma-separated list | Skills to auto-load when agent starts |
| 字段 | 选项 | 描述 |
|---|---|---|
| 逗号分隔的列表 | 允许使用的特定工具。留空则继承所有工具。 |
| | 使用的模型。默认:继承会话模型。 |
| 详见下方 | 权限处理方式 |
| 逗号分隔的列表 | Agent启动时自动加载的Skill |
| Mode | Behavior |
|---|---|
| Normal permission prompting |
| Auto-accept file edits |
| Skip all permission prompts |
| Planning mode (research only) |
| Ignore this agent |
| 模式 | 行为 |
|---|---|
| 常规权限提示 |
| 自动接受文件编辑 |
| 跳过所有权限提示 |
| 规划模式(仅调研) |
| 忽略该Agent |
ReadWriteEditGlobGrepBashBashOutputWebFetchWebSearchTaskNotebookEditTodoWriteSkillReadWriteEditGlobGrepBashBashOutputWebFetchWebSearchTaskNotebookEditTodoWriteSkill<role>
Define who this agent is and what it excels at.
</role>
<constraints>
<hard-rules>
- ALWAYS do X
- NEVER do Y
</hard-rules>
<preferences>
- Prefer A over B
- Prefer C over D
</preferences>
</constraints>
<workflow><role>
定义该Agent的身份及其擅长的领域。
</role>
<constraints>
<hard-rules>
- 始终执行X
- 绝不执行Y
</hard-rules>
<preferences>
- 优先选择A而非B
- 优先选择C而非D
</preferences>
</constraints>
<workflow>tools: Read, Glob, Greptools: Read, Write, Edit, Bash, Glob, Grepundefinedtools: Read, Glob, Greptools: Read, Write, Edit, Bash, Glob, Grepundefinedundefinedundefined---
name: code-reviewer
description: Expert code review specialist. Use PROACTIVELY after any code changes. Reviews for quality, security, and maintainability.
tools: Read, Glob, Grep, Bash
model: inherit
---
<role>
You are a senior code reviewer ensuring high standards of code quality and security.
</role>
<workflow>---
name: code-reviewer
description: 专业代码评审专家。代码变更后自动调用(PROACTIVELY)。评审代码质量、安全性与可维护性。
tools: Read, Glob, Grep, Bash
model: inherit
---
<role>
你是一名资深代码评审专家,负责确保代码质量与安全的高标准。
</role>
<workflow>---
name: debugger
description: Debugging specialist for errors and unexpected behavior. Use PROACTIVELY when encountering failures, test errors, or bugs.
tools: Read, Edit, Bash, Glob, Grep
---
<role>
You are an expert debugger specializing in root cause analysis.
</role>
<workflow>---
name: debugger
description: 专注于错误与异常行为的调试专家。遇到故障、测试错误或Bug时自动调用(PROACTIVELY)。
tools: Read, Edit, Bash, Glob, Grep
---
<role>
你是一名擅长根因分析的资深调试专家。
</role>
<workflow>---
name: researcher
description: Deep research agent for complex questions requiring multi-source investigation. Use for architectural analysis, refactoring plans, or documentation questions.
tools: Read, Glob, Grep, WebSearch, WebFetch
model: opus
---
<role>
You are a research specialist who finds comprehensive answers through thorough investigation.
</role>
<workflow>---
name: researcher
description: 深度调研Agent,用于需要多源调查的复杂问题。适用于架构分析、重构计划或文档相关问题。
tools: Read, Glob, Grep, WebSearch, WebFetch
model: opus
---
<role>
你是一名调研专家,通过全面调查获取完整答案。
</role>
<workflow>teams(action: 'delegate', tasks: [
{text: 'Task 1: Review authentication module...', assignee: 'auth-reviewer'},
{text: 'Task 2: Review authorization module...', assignee: 'authz-reviewer'},
{text: 'Task 3: Review session handling...', assignee: 'session-reviewer'}
])teams(action: 'delegate', tasks: [
{text: '任务1:评审认证模块...', assignee: 'auth-reviewer'},
{text: '任务2:评审授权模块...', assignee: 'authz-reviewer'},
{text: '任务3:评审会话处理...', assignee: 'session-reviewer'}
])teams(action: 'delegate', tasks: [
{text: 'Investigate why API latency increased...', assignee: 'oracle-1'},
{text: 'Investigate why API latency increased...', assignee: 'oracle-2'},
{text: 'Investigate why API latency increased...', assignee: 'oracle-3'}
])teams(action: 'delegate', tasks: [
{text: '调查API延迟增加的原因...', assignee: 'oracle-1'},
{text: '调查API延迟增加的原因...', assignee: 'oracle-2'},
{text: '调查API延迟增加的原因...', assignee: 'oracle-3'}
])teams(action: 'delegate', tasks: [{
text: 'Read all review tickets and synthesize findings...',
assignee: 'synthesizer'
}])teams(action: 'delegate', tasks: [{
text: '阅读所有评审工单并综合分析结果...',
assignee: 'synthesizer'
}])Read, Glob, GrepRead, Glob, Grep| Anti-Pattern | Better Approach |
|---|---|
| Vague descriptions | Specific trigger conditions |
| Overly long prompts | Progressive disclosure via skills |
| All tools for every agent | Minimal necessary tools |
| Generic "helper" agents | Focused, specialized agents |
| No constraints | Clear hard rules and preferences |
| 反模式 | 优化方案 |
|---|---|
| 模糊的描述 | 明确的触发条件 |
| 过长的提示词 | 通过Skill实现渐进式披露 |
| 所有Agent都授予全部工具 | 仅授予必要的最小工具集 |
| 通用的"助手"Agent | 专注于特定领域的专业Agent |
| 无约束条件 | 清晰的硬规则与偏好设置 |
claude --agents '{
"quick-review": {
"description": "Fast code review. Use proactively after changes.",
"prompt": "You are a quick code reviewer. Focus on obvious issues only.",
"tools": ["Read", "Grep", "Glob"],
"model": "haiku"
}
}'claude --agents '{
"quick-review": {
"description": "快速代码评审。代码变更后自动调用。",
"prompt": "你是一名快速代码评审员,仅关注明显问题。",
"tools": ["Read", "Grep", "Glob"],
"model": "haiku"
}
}'---
name: data-analyst
description: Data analysis specialist
skills: query-builder, visualization
------
name: data-analyst
description: 数据分析专家
skills: query-builder, visualization
---mkdir -p .claude/agentsmkdir -p .claude/agents
**Create user agent:**
```bash
mkdir -p ~/.claude/agents
**创建用户级Agent:**
```bash
mkdir -p ~/.claude/agents
**Delegate via teams:**
**View/manage agents:**undefined
**通过teams委派:**
**查看/管理Agent:**undefined