trae-agent-writer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Trae 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 pattern
1. 识别 → 哪些独立任务需要agent?
2. 定义 → 角色、输入、流程、输出
3. 设计 → 分步执行指令
4. 创建 → 按照模板编写agent.md

Agent Format

Agent格式

markdown
undefined
markdown
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:{操作}

  1. Do this
  2. Then this
  1. 执行此操作
  2. 然后执行此操作

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
  • 保持客观:避免偏见
  • 引用证据:引用具体文本
undefined

Agent Locations

Agent存储位置

  • skill-name/agents/
    - Inside orchestrating skills
  • .trae/agents/
    - Project-level agents
  • ~/.trae/agents/
    - Global agents
  • skill-name/agents/
    - 编排技能内部
  • .trae/agents/
    - 项目级agent
  • ~/.trae/agents/
    - 全局agent

Good Agent Candidates

适合创建Agent的场景

PatternWhy Agent?Example
GraderNeeds objectivityOutput evaluator
ComparatorBlind comparisonA/B tester
AnalyzerDeep dive, isolated contextPerformance analyzer
TransformerParallel processingFile converter
ResearcherIndependent investigationDoc 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.md

Review 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:读取评审内容

  1. Read review file
  2. Extract all claims
  1. 读取评审文件
  2. 提取所有评审意见

Step 2: Check Expectations

步骤2:检查预期项

For each expectation:
  1. Search for evidence
  2. Mark PASS/FAIL
  3. Cite evidence
针对每个预期项:
  1. 搜索相关证据
  2. 标记通过/未通过
  3. 引用证据

Step 3: Write Results

步骤3:写入结果

Save to
{output_path}/grading.json
保存至
{output_path}/grading.json

Output 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
  • 保持客观:不偏向冗长或简洁的评审
  • 引用证据:引用具体文本
undefined

References

参考资料

  • Agent Patterns - Common archetypes
  • Agent Template - Starter template
  • Agent模式 - 常见架构类型
  • Agent模板 - 起始模板