定制 Agent
10.1 Agent 定义文件格式
Agent 定义文件存放在.claude/agents/{name}.md,使用 YAML front matter:
10.2 Agent 可用工具和模型选择
可用工具:
模型选择:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
.claude/agents/{name}.md,使用 YAML front matter:
---
name: agent-name
description: |
One-line description of what this agent does.
tools: Read, Write, Edit, Bash, Glob, Grep
model: opus
---
# Agent Name
Agent instructions go here...
| 工具 | 说明 |
|---|---|
| Read | 读取文件 |
| Write | 写入文件 |
| Edit | 编辑文件 |
| Bash | 执行命令 |
| Glob | 文件搜索 |
| Grep | 内容搜索 |
| Task | 调用子 Agent |
| Skill | 调用 Skill |
| mcp__exa__web_search_exa | 网络搜索 |
| mcp__exa__get_code_context_exa | 代码搜索 |
| mcp__chrome-devtools__* | 浏览器自动化 |
| 模型 | 适用场景 |
|---|---|
opus | 复杂任务(实现、检查、调试) |
sonnet | 中等任务 |
haiku | 简单快速任务 |
---
name: check
description: |
Code quality check expert with 10-minute timeout.
tools: Read, Write, Edit, Bash, Glob, Grep
model: opus
timeout: 600000
---
---
name: test
description: |
Test writing expert. Writes comprehensive tests for code changes.
tools: Read, Write, Edit, Bash, Glob, Grep
model: opus
---
# Test Agent
You are the Test Agent in the Trellis workflow.
## Core Responsibilities
1. **Analyze code changes** - Understand what was modified
2. **Write unit tests** - Cover new functionality
3. **Write integration tests** - Test cross-module interactions
4. **Run tests** - Verify all tests pass
## Workflow
### Step 1: Get Changes
```bash
git diff --name-only
pnpm test