trae-agent-writer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTrae Agent Writer
Trae Agent Writer
Create agent definitions for tasks that need independent, isolated execution.
为需要独立、隔离执行的任务创建agent定义。
What is an Agent?
什么是Agent?
A focused, autonomous instruction set for a subagent to execute independently:
- Spawned as subagents - Run with isolated context
- Single-purpose - One agent, one job
- Stateless - No memory between invocations
- Composable - Orchestrated by parent agents/skills
Agent是供子代理独立执行的专注、自主的指令集:
- 以子代理形式生成 - 基于隔离上下文运行
- 单一用途 - 一个agent对应一项任务
- 无状态 - 调用之间不保留记忆
- 可组合 - 由父级agent/技能编排
Workflow
工作流程
1. IDENTIFY → What independent task needs an agent?
2. DEFINE → Role, inputs, process, outputs
3. DESIGN → Step-by-step instructions
4. CREATE → Write agent.md following the pattern1. 识别 → 哪些独立任务需要agent?
2. 定义 → 角色、输入、流程、输出
3. 设计 → 分步执行指令
4. 创建 → 按照模板编写agent.mdAgent Format
Agent格式
markdown
undefinedmarkdown
undefined{Agent Name} Agent
{Agent名称} Agent
{One-sentence role}
{一句话角色描述}
Role
角色
{What this agent does and why}
{该agent的功能及作用}
Inputs
输入
- param_name: Description
- output_path: Where to save results
- param_name: 描述
- output_path: 结果保存路径
Process
流程
Step 1: {Action}
步骤1:{操作}
- Do this
- Then this
- 执行此操作
- 然后执行此操作
Step N: Write Results
步骤N:写入结果
Save to .
{output_path}保存至。
{output_path}Output Format
输出格式
json
{
"field": "value"
}json
{
"field": "value"
}Guidelines
指南
- Be objective: Avoid bias
- Cite evidence: Quote specific text
undefined- 保持客观:避免偏见
- 引用证据:引用具体文本
undefinedAgent Locations
Agent存储位置
- - Inside orchestrating skills
skill-name/agents/ - - Project-level agents
.trae/agents/ - - Global agents
~/.trae/agents/
- - 编排技能内部
skill-name/agents/ - - 项目级agent
.trae/agents/ - - 全局agent
~/.trae/agents/
Good Agent Candidates
适合创建Agent的场景
| Pattern | Why Agent? | Example |
|---|---|---|
| Grader | Needs objectivity | Output evaluator |
| Comparator | Blind comparison | A/B tester |
| Analyzer | Deep dive, isolated context | Performance analyzer |
| Transformer | Parallel processing | File converter |
| Researcher | Independent investigation | Doc researcher |
Don't make agents for: Simple inline tasks, tasks needing conversation history, single-step operations.
| 模式 | 为何选择Agent? | 示例 |
|---|---|---|
| 评分器 | 需要客观性 | 输出评估器 |
| 比较器 | 盲态比较 | A/B测试器 |
| 分析器 | 深度分析、隔离上下文 | 性能分析器 |
| 转换器 | 并行处理 | 文件转换器 |
| 研究员 | 独立调研 | 文档研究员 |
请勿为以下场景创建Agent: 简单内联任务、需要对话历史的任务、单步操作。
Example
示例
User: "I need an agent to grade code review outputs"
📄 review-grader.md用户:"我需要一个agent来评估代码评审输出"
📄 review-grader.mdReview Grader Agent
评审评分Agent
Grade code reviews against quality expectations.
根据质量标准评估代码评审内容。
Role
角色
Assess reviews for completeness, accuracy, helpfulness. Operates blindly to prevent bias.
评估评审内容的完整性、准确性、实用性。以盲态运行以避免偏见。
Inputs
输入
- review_path: Path to review file
- expectations: List of expected findings
- output_path: Where to save grading.json
- review_path: 评审文件路径
- expectations: 预期检查项列表
- output_path: grading.json的保存路径
Process
流程
Step 1: Read Review
步骤1:读取评审内容
- Read review file
- Extract all claims
- 读取评审文件
- 提取所有评审意见
Step 2: Check Expectations
步骤2:检查预期项
For each expectation:
- Search for evidence
- Mark PASS/FAIL
- Cite evidence
针对每个预期项:
- 搜索相关证据
- 标记通过/未通过
- 引用证据
Step 3: Write Results
步骤3:写入结果
Save to
{output_path}/grading.json保存至
{output_path}/grading.jsonOutput Format
输出格式
json
{
"expectations": [
{"text": "...", "passed": true, "evidence": "..."}
],
"summary": {"passed": 4, "failed": 1, "pass_rate": 0.80}
}json
{
"expectations": [
{"text": "...", "passed": true, "evidence": "..."}
],
"summary": {"passed": 4, "failed": 1, "pass_rate": 0.80}
}Guidelines
指南
- Be objective: Don't favor verbose or brief
- Cite evidence: Quote specific text
undefined- 保持客观:不偏向冗长或简洁的评审
- 引用证据:引用具体文本
undefinedReferences
参考资料
- Agent Patterns - Common archetypes
- Agent Template - Starter template
- Agent模式 - 常见架构类型
- Agent模板 - 起始模板