docs: split language by audience, add Codex / AGENTS.md spec
Language policy: Chinese for human-facing files (README, docs/, human-fillable templates), English for AI-facing files (CLAUDE.md, AGENTS.md, AI templates). Commits / PRs / branches / tags stay English. - Translate docs/01-06 to Chinese - Translate README.md, PR / handoff / project README templates to Chinese - Drop README.en.md (redundant once language policy is explicit) - Rewrite CLAUDE.md and CLAUDE.md.template under the new policy - Add AGENTS.md (root) and templates/AGENTS.md.template for Codex - Add docs/07-codex.md covering Codex usage and AGENTS.md / CLAUDE.md sync rules Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
411f0b8182
commit
154f592f3c
16 files changed
+901
-690
No files matched your search
+57
-64
@@ -1,84 +1,77 @@
|
||||
# 01 — Vibe coding
|
||||
# 01 — Vibe coding(人机协作)
|
||||
|
||||
How humans and AI split the work on this team.
|
||||
人和 AI 在团队里怎么分工。
|
||||
|
||||
## The premise
|
||||
## 前提
|
||||
|
||||
Claude Code writes most of the code. Humans steer: framing problems,
|
||||
making decisions, deciding what's good enough to ship. We're not racing
|
||||
the AI — we're using it to skip typing so we can spend more time
|
||||
thinking.
|
||||
Claude / Codex 写大部分代码。人负责把方向:定义问题、做决策、判断
|
||||
什么算"够好可以发"。我们不是在跟 AI 比谁打字快——是用 AI 把打字时间
|
||||
省下来,多花点时间在思考上。
|
||||
|
||||
## The split
|
||||
## 分工
|
||||
|
||||
**Claude does:**
|
||||
**AI 干的:**
|
||||
|
||||
- Read code and explain it
|
||||
- Write first-pass implementations against a clear spec
|
||||
- Refactor mechanically (renames, extractions, type changes)
|
||||
- Run tests, builds, linters; iterate on errors
|
||||
- Generate boilerplate (configs, fixtures, templates, CRUD)
|
||||
- Search across the workspace and summarize findings
|
||||
- 读代码、解释代码
|
||||
- 拿到清晰 spec 后写第一版实现
|
||||
- 机械重构(重命名、抽函数、改类型)
|
||||
- 跑测试 / build / lint,按报错迭代
|
||||
- 生成模板代码(配置、fixture、CRUD)
|
||||
- 跨工作区搜索、汇总
|
||||
|
||||
**Humans do:**
|
||||
**人干的:**
|
||||
|
||||
- Decide what to build and why
|
||||
- Frame the spec before Claude touches code
|
||||
- Approve any change with non-local consequences (deps, schema, infra, auth, secrets)
|
||||
- Read every diff before merging
|
||||
- Make the call when Claude has tried twice and is going in circles
|
||||
- Write the commit message and PR description (Claude drafts; you sign off)
|
||||
- 决定要做什么、为什么做
|
||||
- 在 AI 动手前把 spec 写清楚
|
||||
- 批准任何有外溢影响的改动(依赖、schema、infra、auth、密钥)
|
||||
- 合并前读完每一行 diff
|
||||
- AI 已经试错两次还在打转时,叫停
|
||||
- 写 commit message 和 PR description(AI 起草,你定稿)
|
||||
|
||||
If a task feels like it's drifting toward "Claude decides", stop and
|
||||
write a short spec yourself first.
|
||||
如果你觉得任务正在朝"AI 替我决策"漂移,先停下来自己写一段 spec。
|
||||
|
||||
## Prompt habits
|
||||
## 提示词习惯
|
||||
|
||||
- **Frame, don't dictate.** Tell Claude the goal, the constraints, and
|
||||
what you've already ruled out. Don't prescribe steps unless the steps
|
||||
are the point.
|
||||
- **Name the file.** "Fix the bug in `eval-agent/runner.py`" is better
|
||||
than "fix the bug." Save Claude a search.
|
||||
- **Say what done looks like.** "Tests pass and the new flag defaults to
|
||||
off" — measurable. "Make it cleaner" — not.
|
||||
- **One task per turn.** If you have three unrelated asks, send three
|
||||
messages or open three sessions. Mixed contexts produce mixed results.
|
||||
- **Push back on bad output.** If the diff is wrong, say so plainly and
|
||||
point at the part that's wrong. Don't accept code you wouldn't write
|
||||
yourself.
|
||||
- **给框架,不给步骤。** 告诉 AI 目标、约束、你已经否决了哪些方案。
|
||||
除非步骤本身就是关键,否则别一步步指挥。
|
||||
- **点名文件。** "修一下 `eval-agent/runner.py` 里的 bug"比"修一下那个
|
||||
bug"省一次搜索。
|
||||
- **说清楚什么算完成。** "测试通过、新 flag 默认关"——可衡量。
|
||||
"干净一点"——不行。
|
||||
- **一轮一件事。** 三个不相关的请求就开三条对话或三个 session。
|
||||
上下文混在一起,输出也会混。
|
||||
- **看到不对就 push back。** diff 写错了就直说哪里错。别接受你自己
|
||||
不会写出来的代码。
|
||||
|
||||
## When to stop and take over
|
||||
## 什么时候叫停 AI、自己上
|
||||
|
||||
Stop letting Claude drive when:
|
||||
出现以下情况停手:
|
||||
|
||||
- It's failed the same approach twice and the error is unchanged.
|
||||
- It's adding code "for safety" that the task didn't ask for.
|
||||
- The diff has grown past what you can read in one sitting.
|
||||
- You can't explain the change to a teammate without re-reading the diff.
|
||||
- It's about to do something irreversible (delete data, force-push,
|
||||
change auth) — confirm explicitly.
|
||||
- 同一个方案试了两次,错误信息都没变。
|
||||
- AI 在加任务里没要求的"防御性代码"。
|
||||
- diff 已经长到你一次坐下来读不完。
|
||||
- 你没法在不重新看 diff 的情况下跟同事讲清楚改了什么。
|
||||
- 它马上要做不可逆的事(删数据、force push、动 auth)——必须明确
|
||||
确认。
|
||||
|
||||
If you stop and take over, write down *why* in the PR description so
|
||||
the next person doesn't repeat the loop.
|
||||
如果你叫停了自己上,把"为什么叫停"写进 PR description——下一个人
|
||||
不至于重蹈覆辙。
|
||||
|
||||
## Verifying AI output
|
||||
## 验收 AI 产出
|
||||
|
||||
Treat every Claude diff like a PR from a fast junior:
|
||||
把 AI 的每一份 diff 当一个跑得快的实习生 PR 来 review:
|
||||
|
||||
1. Does it build?
|
||||
2. Do the tests pass — and do new tests actually test the new code?
|
||||
3. Did it touch files outside the stated scope? Look at every one.
|
||||
4. Did it add deps? Check the lockfile diff.
|
||||
5. Read every comment Claude added. Half of them are noise — delete those.
|
||||
6. Run the feature end-to-end if it's user-facing. Type checks ≠ working software.
|
||||
1. 能 build 吗?
|
||||
2. 测试过吗——新写的测试是不是真的覆盖了新代码?
|
||||
3. 改没改 spec 范围之外的文件?每个都看一遍。
|
||||
4. 加依赖了吗?看 lockfile diff。
|
||||
5. AI 加的注释一条条读。一半是噪音,删掉。
|
||||
6. 用户可见的功能要端到端跑一遍。类型检查通过 ≠ 功能正常。
|
||||
|
||||
## Anti-patterns
|
||||
## 反模式
|
||||
|
||||
- **Snowballing context.** Long sessions accumulate stale assumptions.
|
||||
Start a new session for a new task.
|
||||
- **Approval-by-default.** "Looks good" without reading the diff is how
|
||||
bugs ship. Read it.
|
||||
- **Outsourcing the spec.** "Figure out what we should do" is not a
|
||||
prompt — it's avoidance.
|
||||
- **Letting AI rewrite history.** If Claude wants to refactor unrelated
|
||||
code "while we're here", say no. Open a separate task.
|
||||
- **上下文滚雪球。** 长 session 会带进过期假设。新任务开新 session。
|
||||
- **闭眼批准。** 不读 diff 就说"看着没问题"是 bug 上线的标准姿势。
|
||||
读 diff。
|
||||
- **把 spec 也外包了。** "你看着办"不是提示词,是逃避。
|
||||
- **顺手改无关代码。** AI 想"既然来了顺便重构一下"——拒绝。开新任务。
|
||||
Reference in new issue
Block a user