Skip to content

Commit 7fa3d3a

Browse files
joeylee12629-starjoey
andauthored
feat: translate all 22 guide articles to Chinese (#38)
Co-authored-by: joey <joey@joeydeMacBook-Air.local>
1 parent d994a1e commit 7fa3d3a

22 files changed

Lines changed: 981 additions & 981 deletions

zh-guide/agents-md.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# The AGENTS.md Pattern
1+
# AGENTS.md 模式
22

3-
AGENTS.md is a plain-text file that defines how an AI agent should behave. Drop it in a directory, and any compatible harness will read it automatically — no config UI, no API calls, just a file.
3+
AGENTS.md 是一个纯文本文件,定义 AI Agent 应该如何行为。把它放到目录里,任何兼容的 Harness 都会自动读取 — 不需要配置 UI,不需要 API 调用,就是一个文件。
44

5-
## Why It Matters
5+
## 为什么重要
66

7-
Before AGENTS.md, agent behavior was configured through platform UIs, JSON configs, or scattered across code. The file-based approach solves three problems:
7+
AGENTS.md 出现之前,Agent 行为通过平台 UI、JSON 配置或分散在代码各处来配置。基于文件的方案解决了三个问题:
88

9-
1. **Version control** — Agent behavior lives in Git, reviewable in PRs
10-
2. **Portability**Switch harness implementations without rewriting config
11-
3. **Transparency**Anyone can read what the agent does and doesn't do
9+
1. **版本控制** — Agent 行为存在 Git 里,可以在 PR 中审查
10+
2. **可移植性**切换 Harness 实现不需要重写配置
11+
3. **透明性**任何人都能看到 Agent 做什么、不做什么
1212

13-
## Basic Structure
13+
## 基本结构
1414

1515
```markdown
1616
# AGENTS.md
@@ -32,13 +32,13 @@ and follow the project's existing patterns.
3232
5. Commit with a descriptive message
3333
```
3434

35-
That's a working AGENTS.md. The agent reads it at session start and follows it throughout.
35+
这就是一个可用的 AGENTS.md。Agent 在会话开始时读取,全程遵循。
3636

37-
## Real-World Examples
37+
## 真实案例
3838

39-
### Claude Code (Anthropic)
39+
### Claude CodeAnthropic
4040

41-
Claude Code reads `CLAUDE.md`same pattern, different filename:
41+
Claude Code 读取 `CLAUDE.md`同样的模式,不同的文件名:
4242

4343
```markdown
4444
# CLAUDE.md
@@ -59,7 +59,7 @@ This is a Next.js 14 app with TypeScript, Tailwind, and Prisma.
5959

6060
### OpenClaw / Nexu
6161

62-
OpenClaw uses `AGENTS.md` plus companion files:
62+
OpenClaw 使用 `AGENTS.md` 加配套文件:
6363

6464
```markdown
6565
# AGENTS.md
@@ -79,11 +79,11 @@ Capture what matters. Skip secrets.
7979
- When in doubt, ask
8080
```
8181

82-
The companion files (`SOUL.md`, `USER.md`, `MEMORY.md`) are the agent's persistent context. The harness reads them at session start.
82+
配套文件(`SOUL.md``USER.md``MEMORY.md`)是 Agent 的持久化上下文。Harness 在会话开始时读取它们。
8383

84-
## Advanced Patterns
84+
## 进阶用法
8585

86-
### Conditional Rules
86+
### 条件规则
8787

8888
```markdown
8989
## Rules
@@ -92,7 +92,7 @@ The companion files (`SOUL.md`, `USER.md`, `MEMORY.md`) are the agent's persiste
9292
- If CI fails: fix it before asking for review
9393
```
9494

95-
### Tool Restrictions
95+
### 工具限制
9696

9797
```markdown
9898
## Allowed Tools
@@ -105,7 +105,7 @@ The companion files (`SOUL.md`, `USER.md`, `MEMORY.md`) are the agent's persiste
105105
- No `rm -rf` ever
106106
```
107107

108-
### Multi-Agent Setup
108+
### Agent 设置
109109

110110
```markdown
111111
## Sub-Agents
@@ -114,30 +114,30 @@ The companion files (`SOUL.md`, `USER.md`, `MEMORY.md`) are the agent's persiste
114114
- Deploy: requires human approval
115115
```
116116

117-
## Common Pitfalls
117+
## 常见陷阱
118118

119-
- **Too vague** — "Be helpful" is useless. "Run `pytest` after every code change" is useful.
120-
- **Too long**The file goes into the context window. Every line costs tokens. Be concise.
121-
- **Contradictory rules** — "Always commit" + "Never commit without tests" + "Tests are optional" → agent confusion.
119+
- **太模糊** — "Be helpful" 没用。"Run `pytest` after every code change" 才有用。
120+
- **太长**文件会进 Context Window。每一行都消耗 Token。保持精简。
121+
- **矛盾的规则** — "Always commit" + "Never commit without tests" + "Tests are optional" → Agent 会混乱。
122122

123-
## The Ecosystem
123+
## 生态系统
124124

125-
| Harness | Config File | Auto-loaded? |
126-
|---------|------------|-------------|
125+
| Harness | 配置文件 | 自动加载? |
126+
|---------|---------|----------|
127127
| Claude Code | CLAUDE.md ||
128128
| OpenClaw | AGENTS.md ||
129129
| Codex | codex.md ||
130130
| Aider | .aider.conf.yml ||
131131
| Cline | .clinerules ||
132132
| Cursor | .cursorrules ||
133133

134-
The naming varies, but the pattern is universal: **a human-readable file in the repo root that defines agent behavior**.
134+
命名各有不同,但模式是通用的:**一个在仓库根目录的、人类可读的文件,定义 Agent 行为**
135135

136-
## Further Reading
136+
## 延伸阅读
137137

138-
- [OpenAI: AGENTS.md as table of contents](https://openai.com/index/harness-engineering/)How OpenAI uses AGENTS.md in Codex
139-
- [MEMORY.md Pattern](memory-md.md)The companion file for persistent memory
138+
- [OpenAI: AGENTS.md as table of contents](https://openai.com/index/harness-engineering/) — OpenAI 在 Codex 中如何使用 AGENTS.md
139+
- [MEMORY.md 模式](memory-md.md)持久化记忆的配套文件
140140

141141
---
142142

143-
*Next: [The MEMORY.md Pattern](memory-md.md)*
143+
*下一篇: [MEMORY.md 模式](memory-md.md)*

zh-guide/comparison.md

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,121 @@
1-
# Comparison of Major Harness Implementations
1+
# 主流 Harness 实现对比
22

3-
This is a factual comparison of prominent agent harnesses as of mid-2025. The field moves fast — specifics may change, but the architectural patterns are stable.
3+
这是截至 2025 年中主要 Agent Harness 的事实性对比。这个领域变化很快——细节可能过时,但架构模式是稳定的。
44

5-
## Overview Table
5+
## 概览表
66

7-
| Project | Context Management | Memory | Skills / Tools | Multi-Agent | Open Source |
7+
| 项目 | 上下文管理 | 记忆 | Skill / 工具 | Agent | 开源 |
88
|---|---|---|---|---|---|
9-
| **OpenClaw** | AGENTS.md-driven context injection. Loads workspace files, skills, and memory on each session. Context compression via summarization. | File-based: MEMORY.md (long-term), daily logs (memory/YYYY-MM-DD.md), wiki/ for structured knowledge. Fully portable. | Skill system: each skill is a SKILL.md + supporting files. Installable from ClawdHub. MCP protocol support. | Sub-agent spawning with push-based completion. Orchestrator delegates tasks, results auto-announce. |Open source |
10-
| **Claude Code** | 512K context window. Loads files on demand via read tool. CLAUDE.md for project-level instructions. Compacts old messages when context fills. | Session-based. No persistent memory across sessions by default. CLAUDE.md provides project continuity. User-managed files. | Built-in tools: read, write, edit, exec, web search. Extensible via MCP servers. Permission system (allow/deny/ask). | Single-agent. No native sub-agent support. Can invoke other CLI tools via exec. |Open source |
11-
| **Codex (OpenAI CLI)** | Loads repo structure + relevant files. AGENTS.md for instructions. Sandboxed execution environment. | No persistent memory. Reads project files (README, AGENTS.md) for context. Session state resets on each run. | Built-in: file read/write, exec, web search. Runs in network-disabled sandbox by default. Can enable network per session. | Single-agent. No multi-agent orchestration. Designed for single-task execution. |Open source |
12-
| **Cline** | VS Code extension. Loads open files + relevant workspace files. Custom instructions file. Sliding window for context management. | No built-in persistent memory. Relies on workspace files and conversation history within VS Code session. | File operations, terminal commands, browser automation. MCP server support for extensibility. Approval workflow for actions. | Single-agent. No multi-agent support. Human-in-the-loop via approval prompts in VS Code. |Open source |
13-
| **Aider** | Git-aware context. Explicitly add files to context with /add. Repo map provides project-wide overview. Diff-based editing. | Git history as implicit memory. No dedicated memory system. Session history persists within terminal session. | Focused tool set: file editing (diff format), git operations, linting, testing. No plugin system. | Single-agent. No multi-agent. Designed for paired programming (human + one agent). |Open source |
14-
| **Cursor** | IDE-integrated. Full repo indexing with embeddings. Loads relevant files based on semantic search. @-mentions for explicit context. | No persistent agent memory. Codebase index serves as implicit knowledge. .cursorrules for project config. | Code editing, terminal, file operations, documentation lookup. Integrated debugger context. No plugin marketplace. | Single-agent. No multi-agent. Background indexing is async but not agent-based. |Proprietary |
15-
| **Nexu** | Agent-native IM platform. Per-agent workspace with AGENTS.md, SOUL.md, USER.md, MEMORY.md. Skills inject specialized context. | Comprehensive: MEMORY.md (curated long-term), daily logs, wiki/ knowledge base, TOOLS.md (environment-specific notes). Cross-session continuity by design. | Skill marketplace. Each skill is self-contained with SKILL.md instructions. Platform-level tools: calendar, email, messaging, browser, camera, nodes. | Multi-agent native. Sub-agent spawning, cross-channel messaging, cron scheduling. Agents can coordinate across IM channels. |Proprietary (platform) |
9+
| **OpenClaw** | 基于 AGENTS.md 的上下文注入。每次会话加载工作区文件、Skill 和记忆。通过摘要实现上下文压缩。 | 基于文件:MEMORY.md(长期)、每日日志(memory/YYYY-MM-DD.md)、wiki/ 存放结构化知识。完全可迁移。 | Skill 体系:每个 Skill 由 SKILL.md + 支撑文件组成。可从 ClawdHub 安装。支持 MCP 协议。 | 子 Agent 生成,完成后推送通知。协调者委派任务,结果自动回报。 |开源 |
10+
| **Claude Code** | 512K Context Window。按需通过 read 工具加载文件。CLAUDE.md 提供项目级指令。上下文满时压缩旧消息。 | 基于会话。默认不支持跨会话持久记忆。CLAUDE.md 提供项目连续性。用户自行管理文件。 | 内置工具:readwriteeditexecweb search。可通过 MCP 服务器扩展。权限系统(allow/deny/ask)。 | 单 Agent。不支持原生子 Agent。可通过 exec 调用其他 CLI 工具。 |开源 |
11+
| **Codex (OpenAI CLI)** | 加载仓库结构和相关文件。AGENTS.md 提供指令。沙箱执行环境。 | 无持久记忆。读取项目文件(READMEAGENTS.md)获取上下文。每次运行会话状态重置。 | 内置:文件读写、execweb search。默认在禁用网络的沙箱中运行。可按会话启用网络。 | 单 Agent。不支持多 Agent 编排。设计为单任务执行。 |开源 |
12+
| **Cline** | VS Code 扩展。加载打开的文件和相关工作区文件。自定义指令文件。滑动窗口管理上下文。 | 无内置持久记忆。依赖工作区文件和 VS Code 会话内的对话历史。 | 文件操作、终端命令、浏览器自动化。支持 MCP 服务器扩展。通过 VS Code 内的审批流程进行操作确认。 | 单 Agent。不支持多 Agent。通过 VS Code 中的审批提示实现人机协作。 |开源 |
13+
| **Aider** | Git 感知上下文。通过 /add 显式添加文件到上下文。仓库地图提供项目全局概览。基于 diff 编辑。 | Git 历史作为隐式记忆。无专用记忆系统。会话历史在终端会话内持久。 | 聚焦的工具集:文件编辑(diff 格式)、Git 操作、lint、测试。无插件系统。 | 单 Agent。不支持多 Agent。设计为结对编程(人 + 一个 Agent)。 |开源 |
14+
| **Cursor** | IDE 集成。基于 embedding 的全仓库索引。根据语义搜索加载相关文件。通过 @-mention 显式指定上下文。 | 无持久 Agent 记忆。代码库索引作为隐式知识。.cursorrules 用于项目配置。 | 代码编辑、终端、文件操作、文档查找。集成调试器上下文。无插件市场。 | 单 Agent。不支持多 Agent。后台索引是异步的但不基于 Agent。 |闭源 |
15+
| **Nexu** | Agent 原生 IM 平台。每个 Agent 拥有独立工作区:AGENTS.mdSOUL.mdUSER.mdMEMORY.md。Skill 注入专业上下文。 | 完整体系:MEMORY.md(长期精选)、每日日志、wiki/ 知识库、TOOLS.md(环境相关笔记)。跨会话连续性是核心设计。 | Skill 市场。每个 Skill 自包含,带有 SKILL.md 指令。平台级工具:日历、邮件、消息、浏览器、相机、节点。 | 原生多 Agent。子 Agent 生成、跨频道消息、定时任务。Agent 可跨 IM 频道协作。 |闭源(平台) |
1616

17-
## Deep Dive: Key Differentiators
17+
## 深入解析:核心差异
1818

19-
### Context Strategy
19+
### 上下文策略
2020

21-
How each harness decides what to show the model:
21+
各 Harness 如何决定给模型展示什么:
2222

2323
```
24-
Aider : Explicituser adds files manually (/add, /drop)
25-
Claude Code : On-demandagent reads files as needed
26-
Cursor : Semanticembeddings index, auto-retrieves relevant code
27-
OpenClaw/Nexu : Config-driven — AGENTS.md declares what to load
28-
Codex : Repo-awarescans structure, loads relevant files
29-
Cline : IDE-aware — open tabs + workspace files
24+
Aider : 显式用户手动添加文件(/add, /drop
25+
Claude Code : 按需Agent 根据需要读取文件
26+
Cursor : 语义embedding 索引,自动检索相关代码
27+
OpenClaw/Nexu : 配置驱动 — AGENTS.md 声明加载内容
28+
Codex : 仓库感知扫描结构,加载相关文件
29+
Cline : IDE 感知 — 打开的标签页 + 工作区文件
3030
```
3131

32-
**Trade-off:** Explicit control (Aider) gives precision but requires user effort. Semantic retrieval (Cursor) is automatic but can miss or include wrong files. Config-driven (OpenClaw) is predictable but needs upfront setup.
32+
**权衡:** 显式控制(Aider)精确但需要用户操作。语义检索(Cursor)自动但可能遗漏或引入错误文件。配置驱动(OpenClaw)可预测但需要前期配置。
3333

34-
### Memory Architecture
34+
### 记忆架构
3535

3636
```python
37-
# Type 1: No memory (Claude Code, Codex, Cursor, Cline)
38-
# Each session starts fresh. Context comes from project files.
37+
# 类型 1:无记忆(Claude Code, Codex, Cursor, Cline
38+
# 每次会话从零开始。上下文来自项目文件。
3939
context = load_project_files() # That's it
4040

41-
# Type 2: File-based memory (OpenClaw, Nexu)
42-
# Persistent knowledge across sessions, user-editable.
41+
# 类型 2:基于文件的记忆(OpenClaw, Nexu
42+
# 跨会话持久化知识,用户可编辑。
4343
context = (
4444
load_project_files()
4545
+ load_memory("MEMORY.md")
4646
+ load_daily_log(today)
4747
+ load_wiki_if_relevant(task)
4848
)
4949

50-
# Type 3: Embedded memory (proprietary platforms)
51-
# Stored in vector DB, retrieved by similarity.
50+
# 类型 3:嵌入式记忆(闭源平台)
51+
# 存储在向量数据库中,按相似度检索。
5252
context = (
5353
load_project_files()
5454
+ vector_search(task, memory_store)
5555
)
5656
```
5757

58-
### Tool Extensibility
58+
### 工具扩展性
5959

60-
| Approach | Projects | Pros | Cons |
60+
| 方式 | 项目 | 优点 | 缺点 |
6161
|---|---|---|---|
62-
| **MCP Protocol** | OpenClaw, Claude Code, Cline | Standard protocol, interoperable | Server setup overhead |
63-
| **Skill Files** | OpenClaw, Nexu | Self-contained, shareable, marketplace | Custom format |
64-
| **Built-in Only** | Aider, Codex | Simple, predictable | Limited extensibility |
65-
| **IDE Integration** | Cursor, Cline | Rich editor context | Tied to IDE |
62+
| **MCP 协议** | OpenClaw, Claude Code, Cline | 标准协议,可互操作 | 服务器配置有开销 |
63+
| **Skill 文件** | OpenClaw, Nexu | 自包含、可共享、有市场 | 自定义格式 |
64+
| **仅内置** | Aider, Codex | 简单、可预测 | 扩展性有限 |
65+
| **IDE 集成** | Cursor, Cline | 丰富的编辑器上下文 | 绑定 IDE |
6666

67-
### Multi-Agent Patterns
67+
### Agent 模式
6868

69-
Most harnesses are single-agent. Multi-agent support varies significantly:
69+
大多数 Harness 是单 Agent 的。多 Agent 支持差异很大:
7070

7171
```python
72-
# OpenClaw/Nexu: First-class sub-agent spawning
72+
# OpenClaw/Nexu: 一等公民的子 Agent 生成
7373
subagent = spawn(
7474
task="Research competitor pricing",
7575
model="gpt-4o",
7676
tools=["web_search", "web_fetch"],
7777
)
7878
# Result auto-announces when done — no polling needed
7979

80-
# Claude Code: Indirect multi-agent via exec
80+
# Claude Code: 通过 exec 间接实现多 Agent
8181
result = exec("claude-code --print 'Review this PR'")
8282
# Works but no structured communication
8383

84-
# Others: No native multi-agent
85-
# Workaround: multiple terminal sessions, manual coordination
84+
# 其他: 无原生多 Agent
85+
# 变通方案: 多个终端会话,手动协调
8686
```
8787

88-
## Choosing the Right Harness
88+
## 如何选择合适的 Harness
8989

90-
| If you need... | Consider |
90+
| 如果你需要…… | 考虑 |
9191
|---|---|
92-
| Deep code editing with IDE integration | **Cursor** or **Cline** |
93-
| Terminal-based coding agent | **Claude Code** or **Aider** |
94-
| Sandboxed task execution | **Codex** |
95-
| Multi-agent orchestration | **OpenClaw** or **Nexu** |
96-
| Persistent memory across sessions | **OpenClaw** or **Nexu** |
97-
| Extensible tool ecosystem | **OpenClaw** (skills + MCP) |
98-
| Minimal setup, just works | **Aider** |
92+
| 深度代码编辑 + IDE 集成 | **Cursor** **Cline** |
93+
| 终端编码 Agent | **Claude Code** **Aider** |
94+
| 沙箱化任务执行 | **Codex** |
95+
| 多 Agent 编排 | **OpenClaw** **Nexu** |
96+
| 跨会话持久记忆 | **OpenClaw** **Nexu** |
97+
| 可扩展的工具生态 | **OpenClaw**(Skill + MCP |
98+
| 最小配置,开箱即用 | **Aider** |
9999

100-
## What the Table Doesn't Show
100+
## 表格之外
101101

102-
- **Model support**Most harnesses are model-agnostic (OpenClaw, Cline, Aider support many providers). Codex is OpenAI-only. Claude Code is Anthropic-focused.
103-
- **Cost**Varies wildly based on model choice, context size, and task complexity. Not a harness feature, but a usage pattern.
104-
- **Speed**Depends more on model latency than harness architecture. Streaming support is universal.
105-
- **Community**Open-source projects (Aider, Claude Code, Cline, OpenClaw) have active communities. Community size doesn't equal quality.
102+
- **模型支持**多数 Harness 与模型无关(OpenClawClineAider 支持多种提供商)。Codex 仅限 OpenAIClaude Code 聚焦 Anthropic
103+
- **成本**因模型选择、上下文大小和任务复杂度而异。不是 Harness 特性,而是使用模式的问题。
104+
- **速度**更多取决于模型延迟而非 Harness 架构。流式输出已普遍支持。
105+
- **社区**开源项目(AiderClaude CodeClineOpenClaw)都有活跃社区。社区规模不等于质量。
106106

107-
## Common Pitfalls
107+
## 常见陷阱
108108

109-
- **Choosing based on hype**Pick the harness that fits your workflow, not the one with the most GitHub stars.
110-
- **Ignoring memory**If your tasks span sessions, a harness without persistent memory means re-explaining context every time.
111-
- **Assuming "open source" means "free"**The harness is free; the model API calls are not. Budget for API costs.
112-
- **Locking into one harness**File-based configurations (AGENTS.md, MEMORY.md) are portable. Proprietary memory is not. See [Memory Portability ](memory-portability.md).
109+
- **跟风选择**选适合你工作流的 Harness,而不是 GitHub star 最多的。
110+
- **忽视记忆**如果你的任务跨会话,没有持久记忆的 Harness 意味着每次都要重新解释上下文。
111+
- **以为"开源"等于"免费"**Harness 免费,模型 API 调用不免费。要预估 API 成本。
112+
- **锁定单一 Harness**基于文件的配置(AGENTS.mdMEMORY.md)可迁移。闭源的记忆系统则不行。参见 [记忆可迁移性 ](memory-portability.md)
113113

114-
## Further Reading
114+
## 延伸阅读
115115

116-
- [Scaling Dimensions ](scaling-dimensions.md)How these harnesses scale across time, space, and interaction
117-
- [Glossary](glossary.md)Key terms used throughout this guide
116+
- [扩展维度 ](scaling-dimensions.md)这些 Harness 如何在时间、空间和交互维度上扩展
117+
- [术语表](glossary.md)本指南中使用的关键术语
118118

119119
---
120120

121-
*Next: [Glossary](glossary.md)*
121+
*下一篇:[术语表](glossary.md)*

0 commit comments

Comments
 (0)