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:
阿白叔andClaude Opus 4.7 committed 2026-05-20 09:44:15 +08:00
1 parent 411f0b8182
commit 2c3b0d73ec
16 files changed
+901 -690

No files matched your search

+91
View File
@@ -0,0 +1,91 @@
# AGENTS.md — team-guide
Context for AI coding agents (Codex CLI, Codex in IDEs, other
AGENTS.md-aware tools) working in this repository.
> Sister file: `CLAUDE.md` (read by Claude Code). The two files cover
> the same ground — keep them in sync. Whichever tool runs reads its
> own file.
## Project
This repo holds our team's working agreements (1–3 person team,
AI-assisted "vibe coding" development). It is **documentation, not code**.
There is no build, test, or lint step. Acceptance is "a human can read
the change and would have written the same."
## Editing rules
When editing files in this repo:
- One rule per bullet. If a rule needs a paragraph of justification,
split the rule out and put the justification on a `**Why:**` line.
- Lead with the rule, then `**Why:**`, then `**How to apply:**` only
when non-obvious. Skip them when the rule speaks for itself.
- No emoji. No decorative headers. No "🚀 Getting started!" energy.
- Keep each doc under ~150 lines. Past that, split.
- Examples beat prose. A 3-line code block beats a paragraph of
description.
## Language policy
- **Human-facing**: Chinese. `README.md`, `docs/*.md`, and the
human-fillable templates (`templates/README.md.template`,
`templates/PR_DESCRIPTION.template.md`,
`templates/HANDOFF_CHECKLIST.template.md`) are in Chinese.
- **AI-facing**: English. `CLAUDE.md`, `AGENTS.md`,
`templates/CLAUDE.md.template`, `templates/AGENTS.md.template`, and
`docs/07-codex.md`'s code blocks / examples are in English.
- **Commit messages, PR titles, branch names, tag annotations**: English.
AI tools and search work better on English Git metadata.
If you're an agent and you're about to write Chinese into a file the
human would never read, stop — you have the wrong file.
## What goes where
| Topic | File |
| ---------------------------------------------- | --------------------------------- |
| Human + AI work split | `docs/01-vibe-coding.md` |
| Claude Code config (CLAUDE.md, hooks, memory) | `docs/02-claude-code.md` |
| Branches, commits, PRs, tagging | `docs/03-git-workflow.md` |
| Skill catalog, planning cadence | `docs/04-skills-and-planning.md` |
| Naming, comments, code style | `docs/05-code-style.md` |
| Task packages, handoff checklists | `docs/06-handoff.md` |
| Codex usage and AGENTS.md conventions | `docs/07-codex.md` |
## What NOT to do
- Don't add a doc for a rule we've used once. Wait until it's bitten
twice — then write it.
- Don't write process for processes' sake. If nobody would read or
follow it, don't write it.
- Don't quote external sources at length (license / copyright). Link
instead.
- Don't translate `CLAUDE.md` / `AGENTS.md` into Chinese. They're for
AI tools.
- Don't translate Chinese docs into English "for completeness." Pick
one language per file and stick with it.
## Commits
- Format: `<area>: <imperative summary under 60 chars>`. Examples:
`git-workflow: clarify branch naming`, `docs: add Codex section`.
- One topic per commit. "and" in the summary means split it.
- Always include the `Co-Authored-By` trailer when AI-assisted.
## Versioning / releases
- Tags follow `YYYYMMDD` (e.g. `20260520`). Multiple tags on the same
day get a `-N` suffix (`20260520-2`).
- Annotated tags only. Tag messages summarize what changed since the
previous tag.
- Tags are immutable once pushed. If a tag is wrong, cut a new one.
- Tag only on `main`.
## Working directory expectations
- The repo is small (10–20 files). You can `Read` everything before
acting; you don't need to spawn a sub-agent for exploration.
- Do not introduce `package.json`, `Makefile`, CI configs, or other
toolchain files unless explicitly asked. This is a docs repo.
+79 -28
View File
@@ -1,46 +1,97 @@
# CLAUDE.md — team-guide # CLAUDE.md — team-guide
This repo holds our team's working agreements. When editing it, behave like Context for Claude Code working in this repository.
a careful technical writer, not a coder.
## Context > Sister file: `AGENTS.md` (read by Codex). The two files cover the
> same ground — keep them in sync. Whichever tool runs reads its own
> file. See `docs/07-codex.md` for the sync rules.
- **Audience**: 1–3 person team, AI-assisted development ("vibe coding"). ## Project
- **Language**: English. All docs, all commits, all PR titles.
- **Tone**: short, declarative, opinionated. No fluff, no hedging, no marketing voice. This repo holds our team's working agreements (1–3 person team,
AI-assisted "vibe coding" development). It is **documentation, not code**.
There is no build, test, or lint step. Acceptance is "a human can read
the change and would have written the same."
## Editing rules ## Editing rules
- One rule per bullet. If a rule needs a paragraph of justification, split When editing files in this repo:
the rule out and put the justification in a *Why* line.
- Lead with the rule, then `**Why:**`, then `**How to apply:**` only when - One rule per bullet. If a rule needs a paragraph of justification,
the rule is non-obvious. Skip them when the rule speaks for itself. split the rule out and put the justification on a `**Why:**` line.
- Lead with the rule, then `**Why:**`, then `**How to apply:**` only
when non-obvious. Skip them when the rule speaks for itself.
- No emoji. No decorative headers. No "🚀 Getting started!" energy. - No emoji. No decorative headers. No "🚀 Getting started!" energy.
- Keep each doc under ~150 lines. If it's growing past that, the doc is - Keep each doc under ~150 lines. Past that, split.
probably two docs. - Examples beat prose. A 3-line code block beats a paragraph of
- Examples beat prose. Prefer a 3-line code block over a paragraph description.
describing the code.
## Language policy
- **Human-facing**: Chinese. `README.md`, `docs/*.md`, and the
human-fillable templates (`templates/README.md.template`,
`templates/PR_DESCRIPTION.template.md`,
`templates/HANDOFF_CHECKLIST.template.md`) are in Chinese.
- **AI-facing**: English. `CLAUDE.md`, `AGENTS.md`,
`templates/CLAUDE.md.template`, `templates/AGENTS.md.template`. Code
blocks and command examples inside Chinese docs also stay English.
- **Commit messages, PR titles, branch names, tag annotations**: English.
AI tools and search work better on English Git metadata.
If you're an agent and you're about to write Chinese into a file the
human would never read (or vice versa), stop — you have the wrong file.
## What goes where ## What goes where
| If you're writing about… | Put it in… | | Topic | File |
| ---------------------------------------- | -------------------------------- | | ---------------------------------------------- | --------------------------------- |
| How humans and AI split a task | `docs/01-vibe-coding.md` | | Human + AI work split | `docs/01-vibe-coding.md` |
| Claude Code config (CLAUDE.md, hooks…) | `docs/02-claude-code.md` | | Claude Code config (CLAUDE.md, hooks, memory) | `docs/02-claude-code.md` |
| Branches, commits, PRs | `docs/03-git-workflow.md` | | Branches, commits, PRs, tagging | `docs/03-git-workflow.md` |
| Which skills to install, planning cadence| `docs/04-skills-and-planning.md` | | Skill catalog, planning cadence | `docs/04-skills-and-planning.md` |
| Naming, comments, file structure | `docs/05-code-style.md` | | Naming, comments, code style | `docs/05-code-style.md` |
| Task packages, handoff between members | `docs/06-handoff.md` | | Task packages, handoff checklists | `docs/06-handoff.md` |
| Codex usage and AGENTS.md conventions | `docs/07-codex.md` |
## What NOT to do ## What NOT to do
- Don't add a doc for a rule we've used once. Wait until it's bitten us - Don't add a doc for a rule we've used once. Wait until it's bitten
twice — then write it. twice — then write it.
- Don't write process for processes' sake. If nobody would read or follow - Don't write process for processes' sake. If nobody would read or
it, don't write it. follow it, don't write it.
- Don't quote external sources at length (license/copyright). Link instead. - Don't quote external sources at length (license / copyright). Link
instead.
- Don't translate `CLAUDE.md` / `AGENTS.md` into Chinese. They're for
AI tools.
- Don't translate Chinese docs into English "for completeness." Pick
one language per file and stick with it.
## Commits ## Commits
- Commit message: `<area>: <imperative summary>` — e.g. `git-workflow: clarify branch naming`. - Format: `<area>: <imperative summary under 60 chars>`. Examples:
- One topic per commit. If a commit message has "and" in it, it's two commits. `git-workflow: clarify branch naming`, `docs: add Codex section`.
- One topic per commit. "and" in the summary means split it.
- Always include the `Co-Authored-By` trailer when AI-assisted.
## Versioning / releases
- Tags follow `YYYYMMDD` (e.g. `20260520`). Multiple tags on the same
day get a `-N` suffix (`20260520-2`).
- Annotated tags only. Tag messages summarize what changed since the
previous tag.
- Tags are immutable once pushed. If a tag is wrong, cut a new one.
- Tag only on `main`.
## Sync with AGENTS.md
If you change this file, update `AGENTS.md` to match (and vice versa).
The two files describe the same project to different tools — drift
breaks one of them silently. Reviewer should block PRs that touch only
one side.
## Working directory expectations
- The repo is small (≈20 files). You can `Read` everything before
acting; you don't need to spawn a sub-agent for exploration.
- Do not introduce `package.json`, `Makefile`, CI configs, or other
toolchain files unless explicitly asked. This is a docs repo.
-58
View File
@@ -1,58 +0,0 @@
# team-guide
> 中文版:[README.md](README.md)
Working agreements for our team's AI-assisted ("vibe coding") development.
Small team, English docs, opinionated but light.
## What this repo is
A single source of truth for **how we work**, not what we build. It covers:
- How we use Claude Code (CLAUDE.md, permissions, hooks, memory, skills)
- How we collaborate with AI when writing code (vibe coding norms)
- Git workflow (branches, commits, PRs, review)
- Skill management and project planning rhythm
- Code & deliverable style (naming, comments, READMEs, task packages, handoffs)
Every doc is short. If a rule needs more than half a page to justify, it
probably isn't a rule yet — it's a discussion.
## Layout
```
team-guide/
├── README.md ← you are here
├── CLAUDE.md ← context Claude Code loads when working in this repo
├── docs/
│ ├── 01-vibe-coding.md ← how humans + AI split the work
│ ├── 02-claude-code.md ← CLAUDE.md / permissions / hooks / memory / skills
│ ├── 03-git-workflow.md ← branches, commits, PRs, review
│ ├── 04-skills-and-planning.md ← skill catalog + planning cadence
│ ├── 05-code-style.md ← naming, comments, structure
│ └── 06-handoff.md ← task packages, handoff checklists
└── templates/
├── CLAUDE.md.template
├── README.md.template
├── PR_DESCRIPTION.template.md
└── HANDOFF_CHECKLIST.template.md
```
## How to use it
1. **New team member** — read `docs/01-vibe-coding.md` and `docs/03-git-workflow.md` first. The rest is reference.
2. **Starting a new project** — copy the templates from `templates/` into the new repo and fill them in. Drop a top-level `CLAUDE.md` that points back here.
3. **Disagreeing with a rule** — open a PR against this repo. Don't silently diverge.
## Versioning
Releases are tagged by date: `YYYYMMDD` (e.g. `20260520`). Each tag is a
snapshot of `main` from that day, suitable for "this is the version we
agreed to follow." See `docs/03-git-workflow.md` for the tagging rules.
- Latest tag: see [`git tag --sort=-creatordate`](https://git.simgreek.com/simgreek/team-guide/tags) on the remote
- `main` is always the working copy; tags are checkpoints
## License
Internal.
+27 -21
View File
@@ -1,55 +1,61 @@
# team-guide # team-guide
> English: [README.en.md](README.en.md)
我们小团队的 AI 协作(vibe coding)开发约定。 我们小团队的 AI 协作(vibe coding)开发约定。
1–3 人规模,英文写文档,规则不多但都是真踩过的坑。 1–3 人规模,规则不多但都是真踩过的坑。
## 这个仓库是什么 ## 这个仓库是什么
工作方式的唯一来源——不是项目代码,是**怎么干活**。覆盖: 工作方式的唯一来源——不是项目代码,是**怎么干活**。覆盖:
- 怎么用 Claude Code(CLAUDE.md、permission、hook、memory、skill) - 怎么用 Claude Code(CLAUDE.md、permission、hook、memory、skill)
- 怎么用 Codex(AGENTS.md、approval 模式、与 Claude Code 的分工)
- 写代码时人和 AI 怎么分工(vibe coding 守则) - 写代码时人和 AI 怎么分工(vibe coding 守则)
- Git 工作流(分支、commit、PR、review) - Git 工作流(分支、commit、PR、review、tag)
- Skill 管理与项目规划节奏 - Skill 管理与项目规划节奏
- 代码与产出风格(命名、注释、README、任务包、handoff) - 代码与产出风格(命名、注释、README、任务包、handoff)
每篇都很短。一条规则要超过半页才能解释清楚的,多半还不是规则——是个待讨论项。 每篇都很短。一条规则要超过半页才能解释清楚的,多半还不是规则——是个待讨论项。
## 语言策略
- **给人看的**:中文。`README.md`、`docs/*.md`、人填的 template
(README、PR、handoff)都是中文。
- **给 AI 看的**:英文。`CLAUDE.md`、`AGENTS.md`、对应 template、
以及中文文档里的代码块 / 命令示例。
- **Commit / PR / 分支 / tag**:英文。AI 工具和搜索都更吃英文 metadata。
## 目录 ## 目录
``` ```
team-guide/ team-guide/
├── README.md ← 中文版(你正在看) ├── README.md ← 你正在看(中文,给人)
├── README.en.md ← English version ├── CLAUDE.md ← Claude Code 读的项目上下文(英文)
├── CLAUDE.md ← Claude Code 在本仓库工作时加载的上下文 ├── AGENTS.md ← Codex 读的项目上下文(英文)
├── docs/ ├── docs/
│ ├── 01-vibe-coding.md ← 人 + AI 怎么分工 │ ├── 01-vibe-coding.md ← 人 + AI 怎么分工
│ ├── 02-claude-code.md ← CLAUDE.md / permission / hook / memory / skill │ ├── 02-claude-code.md ← CLAUDE.md / permission / hook / memory / skill
│ ├── 03-git-workflow.md ← 分支、commit、PR、review、tag │ ├── 03-git-workflow.md ← 分支、commit、PR、review、tag
│ ├── 04-skills-and-planning.md ← skill 目录 + 规划节奏 │ ├── 04-skills-and-planning.md ← skill 目录 + 规划节奏
│ ├── 05-code-style.md ← 命名、注释、结构 │ ├── 05-code-style.md ← 命名、注释、结构
│ └── 06-handoff.md ← 任务包、handoff 清单 │ ├── 06-handoff.md ← 任务包、handoff 清单
│ └── 07-codex.md ← Codex 使用、AGENTS.md 同步规则
└── templates/ └── templates/
├── CLAUDE.md.template ├── CLAUDE.md.template ← 给 AI 看(英文)
├── README.md.template ├── AGENTS.md.template ← 给 AI 看(英文)
├── PR_DESCRIPTION.template.md ├── README.md.template ← 给人填(中文)
└── HANDOFF_CHECKLIST.template.md ├── PR_DESCRIPTION.template.md ← 给人填(中文)
└── HANDOFF_CHECKLIST.template.md ← 给人填(中文)
``` ```
## 怎么用 ## 怎么用
1. **新成员** —— 先读 [`docs/01-vibe-coding.md`](docs/01-vibe-coding.md) 和 [`docs/03-git-workflow.md`](docs/03-git-workflow.md),其他当参考手册查。 1. **新成员** —— 先读 [`docs/01-vibe-coding.md`](docs/01-vibe-coding.md) 和
2. **新项目** —— 从 `templates/` 复制模板到新仓库填上,再在新仓库根目录放一个 `CLAUDE.md` 指回这里。 [`docs/03-git-workflow.md`](docs/03-git-workflow.md),其他当参考手册查。
2. **新项目** —— 从 `templates/` 复制对应模板到新仓库填上。新仓库
根目录同时放 `CLAUDE.md` 和 `AGENTS.md`,两个文件保持同步
(见 [`docs/07-codex.md`](docs/07-codex.md))。
3. **不同意某条规则** —— 在本仓库开 PR 改它,不要私下绕开。 3. **不同意某条规则** —— 在本仓库开 PR 改它,不要私下绕开。
## 文档语言约定
- 仓库内所有 `.md` 用**英文**,包括 commit message、PR 标题、tag 注释。
- 这个 README 提供中文入口;剩下的内容直接读英文版本。
- 跟外部团队/客户的交付物按对方语言来——本仓库的规则只管内部。
## 版本管理 ## 版本管理
按日期打 tag,格式 `YYYYMMDD`,比如 `20260520`。 按日期打 tag,格式 `YYYYMMDD`,比如 `20260520`。
@@ -60,7 +66,7 @@ team-guide/
- 大改写新 tag,不动旧 tag。 - 大改写新 tag,不动旧 tag。
- 谁要"用某一版",告诉对方 tag 名(例:`team-guide @ 20260520`)就行。 - 谁要"用某一版",告诉对方 tag 名(例:`team-guide @ 20260520`)就行。
打 tag 的具体命令和场景见 [`docs/03-git-workflow.md`](docs/03-git-workflow.md) 的 Tagging 一节。 打 tag 的具体命令和场景见 [`docs/03-git-workflow.md`](docs/03-git-workflow.md) 的 Tag 一节。
最近 tag 列表:[git.simgreek.com/simgreek/team-guide/tags](https://git.simgreek.com/simgreek/team-guide/tags) 最近 tag 列表:[git.simgreek.com/simgreek/team-guide/tags](https://git.simgreek.com/simgreek/team-guide/tags)
+57 -64
View File
@@ -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, Claude / Codex 写大部分代码。人负责把方向:定义问题、做决策、判断
making decisions, deciding what's good enough to ship. We're not racing 什么算"够好可以发"。我们不是在跟 AI 比谁打字快——是用 AI 把打字时间
the AI — we're using it to skip typing so we can spend more time 省下来,多花点时间在思考上。
thinking.
## The split ## 分工
**Claude does:** **AI 干的:**
- Read code and explain it - 读代码、解释代码
- Write first-pass implementations against a clear spec - 拿到清晰 spec 后写第一版实现
- Refactor mechanically (renames, extractions, type changes) - 机械重构(重命名、抽函数、改类型)
- Run tests, builds, linters; iterate on errors - 跑测试 / build / lint,按报错迭代
- Generate boilerplate (configs, fixtures, templates, CRUD) - 生成模板代码(配置、fixture、CRUD)
- Search across the workspace and summarize findings - 跨工作区搜索、汇总
**Humans do:** **人干的:**
- Decide what to build and why - 决定要做什么、为什么做
- Frame the spec before Claude touches code - 在 AI 动手前把 spec 写清楚
- Approve any change with non-local consequences (deps, schema, infra, auth, secrets) - 批准任何有外溢影响的改动(依赖、schema、infra、auth、密钥)
- Read every diff before merging - 合并前读完每一行 diff
- Make the call when Claude has tried twice and is going in circles - AI 已经试错两次还在打转时,叫停
- Write the commit message and PR description (Claude drafts; you sign off) - 写 commit message 和 PR description(AI 起草,你定稿)
If a task feels like it's drifting toward "Claude decides", stop and 如果你觉得任务正在朝"AI 替我决策"漂移,先停下来自己写一段 spec。
write a short spec yourself first.
## Prompt habits ## 提示词习惯
- **Frame, don't dictate.** Tell Claude the goal, the constraints, and - **给框架,不给步骤。** 告诉 AI 目标、约束、你已经否决了哪些方案。
what you've already ruled out. Don't prescribe steps unless the steps 除非步骤本身就是关键,否则别一步步指挥。
are the point. - **点名文件。** "修一下 `eval-agent/runner.py` 里的 bug"比"修一下那个
- **Name the file.** "Fix the bug in `eval-agent/runner.py`" is better bug"省一次搜索。
than "fix the bug." Save Claude a search. - **说清楚什么算完成。** "测试通过、新 flag 默认关"——可衡量。
- **Say what done looks like.** "Tests pass and the new flag defaults to "干净一点"——不行。
off" — measurable. "Make it cleaner" — not. - **一轮一件事。** 三个不相关的请求就开三条对话或三个 session。
- **One task per turn.** If you have three unrelated asks, send three 上下文混在一起,输出也会混。
messages or open three sessions. Mixed contexts produce mixed results. - **看到不对就 push back。** diff 写错了就直说哪里错。别接受你自己
- **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.
## 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. - AI 在加任务里没要求的"防御性代码"。
- The diff has grown past what you can read in one sitting. - diff 已经长到你一次坐下来读不完。
- You can't explain the change to a teammate without re-reading the diff. - 你没法在不重新看 diff 的情况下跟同事讲清楚改了什么。
- It's about to do something irreversible (delete data, force-push, - 它马上要做不可逆的事(删数据、force push、动 auth)——必须明确
change auth) — confirm explicitly. 确认。
If you stop and take over, write down *why* in the PR description so 如果你叫停了自己上,把"为什么叫停"写进 PR description——下一个人
the next person doesn't repeat the loop. 不至于重蹈覆辙。
## Verifying AI output ## 验收 AI 产出
Treat every Claude diff like a PR from a fast junior: 把 AI 的每一份 diff 当一个跑得快的实习生 PR 来 review:
1. Does it build? 1. 能 build 吗?
2. Do the tests pass — and do new tests actually test the new code? 2. 测试过吗——新写的测试是不是真的覆盖了新代码?
3. Did it touch files outside the stated scope? Look at every one. 3. 改没改 spec 范围之外的文件?每个都看一遍。
4. Did it add deps? Check the lockfile diff. 4. 加依赖了吗?看 lockfile diff。
5. Read every comment Claude added. Half of them are noise — delete those. 5. AI 加的注释一条条读。一半是噪音,删掉。
6. Run the feature end-to-end if it's user-facing. Type checks ≠ working software. 6. 用户可见的功能要端到端跑一遍。类型检查通过 ≠ 功能正常。
## Anti-patterns ## 反模式
- **Snowballing context.** Long sessions accumulate stale assumptions. - **上下文滚雪球。** 长 session 会带进过期假设。新任务开新 session。
Start a new session for a new task. - **闭眼批准。** 不读 diff 就说"看着没问题"是 bug 上线的标准姿势。
- **Approval-by-default.** "Looks good" without reading the diff is how 读 diff。
bugs ship. Read it. - **把 spec 也外包了。** "你看着办"不是提示词,是逃避。
- **Outsourcing the spec.** "Figure out what we should do" is not a - **顺手改无关代码。** AI 想"既然来了顺便重构一下"——拒绝。开新任务。
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.
+78 -85
View File
@@ -1,129 +1,122 @@
# 02 — Claude Code # 02 — Claude Code
How we configure and use Claude Code across projects. 我们在每个项目里怎么配置和使用 Claude Code。
## Configuration files ## 配置文件
Each project should have: 每个项目应该有:
``` ```
<repo>/ <repo>/
├── CLAUDE.md ← project context (committed) ├── CLAUDE.md ← 项目上下文(提交进仓库)
├── AGENTS.md ← Codex / 通用 agent 上下文(提交)
└── .claude/ └── .claude/
├── settings.json ← shared settings (committed) ├── settings.json ← 共享设置(提交)
├── settings.local.json ← personal overrides (gitignored) ├── settings.local.json ← 个人覆盖(gitignore)
└── skills/ ← project-local skills (committed) └── skills/ ← 项目级 skill(提交)
``` ```
`settings.local.json` is **always** gitignored. Personal API keys, local `settings.local.json` **永远** gitignore。个人 API key、本地路径、
paths, and individual hook tweaks live there. 个人 hook 调整都放这里。
## CLAUDE.md content `AGENTS.md` 见 [docs/07-codex.md](07-codex.md)——给 Claude 看 `CLAUDE.md`,
给 Codex 看 `AGENTS.md`,两个文件内容大体一致,工具读各自的。
Every `CLAUDE.md` answers, in this order: ## CLAUDE.md 的内容
1. **What is this project?** Two sentences max. 每个 `CLAUDE.md` 按这个顺序回答:
2. **How do I run it?** Build, test, lint commands as bash blocks.
3. **Architecture in one paragraph.** Where the entry points are and
how data flows. No diagrams unless they save words.
4. **Conventions specific to this repo.** Naming, layout, patterns
that aren't obvious from the code.
5. **Don'ts.** Things Claude has gotten wrong before. One line each.
A new contributor (human or AI) should be productive after reading it 1. **这是个什么项目?** 最多两句话。
once. If a `CLAUDE.md` is over 100 lines, it's drifted into documentation 2. **怎么跑?** Build、test、lint 命令,写成 bash 块。
and should be split. 3. **架构一段话。** 入口在哪、数据怎么流。除非能省字,否则不画图。
4. **本仓库特有的约定。** 命名、目录、那些不看注释看不出来的模式。
5. **不要做的事。** Claude 以前在这里翻过的车,每条一行。
Use `templates/CLAUDE.md.template` as the starting point. 新人(人或 AI)读一遍就该能上手干活。`CLAUDE.md` 超过 100 行,说明
它已经偷偷变成"文档"了,应该拆出去。
## Permissions 用 `templates/CLAUDE.md.template` 起手。
Default permission posture: **prompt for everything risky, allow read-only ## 权限(permission)
freely.**
In `.claude/settings.json`, allow these without prompting: 默认姿态:**只读自由放行,能改的都问一下。**
- All `Read`, `Glob`, `Grep` tools `.claude/settings.json` 里可以无提示放行:
- `Bash(git status)`, `Bash(git diff)`, `Bash(git log)`, `Bash(git branch)`
- Project-specific read-only commands (e.g. `Bash(npm test)`, `Bash(pytest)`)
Always prompt for: - 所有 `Read`、`Glob`、`Grep`
- `Bash(git status)`、`Bash(git diff)`、`Bash(git log)`、`Bash(git branch)`
- 项目特定的只读命令(`Bash(npm test)`、`Bash(pytest)` 这类)
- File `Edit` / `Write` outside the working tree 永远要弹窗确认:
- `Bash` with destructive verbs (`rm`, `mv`, `git push`, `git reset --hard`, package installs)
- Any MCP tool that talks to a remote service
When you find yourself approving the same prompt over and over, run the - 工作树之外的 `Edit` / `Write`
`fewer-permission-prompts` skill — it scans your transcripts and - 带破坏动词的 `Bash`(`rm`、`mv`、`git push`、`git reset --hard`、装包)
proposes an allowlist. - 任何会跟外部服务对话的 MCP 工具
## Hooks 如果你发现自己在反复批准同一类提示,跑一下 `fewer-permission-prompts`
skill——它会扫 transcript 给你列一份允许列表。
Hooks are how the harness enforces rules automatically — Claude itself ## Hook(钩子)
won't reliably remember a "from now on…" instruction across sessions.
Use hooks for: Hook 是让 harness 自动执行规则的方式——AI 自己**不可靠地**记住"以后
都要 X",跨 session 会忘。
- Auto-formatting on file edit (Prettier, ruff, gofmt) 适合用 hook 的事:
- Blocking edits to protected paths (`.env`, generated files, `dist/`)
- Auto-running tests after a write to a known test path
- Notifying on session stop / long-running task completion
Don't use hooks for: - 文件保存后自动格式化(Prettier、ruff、gofmt)
- 阻止改受保护路径(`.env`、生成文件、`dist/`)
- 写测试路径后自动跑测试
- session 结束 / 长任务完成时通知
- One-off checks ("just remember to do X this week") 不适合用 hook 的:
- Anything that depends on Claude's judgment ("only run if it makes sense")
Configure via the `update-config` skill or edit `.claude/settings.json` - 一次性检查("这周记得 X 一下")
directly. Document each hook with a one-line comment in the JSON. - 任何依赖 AI 判断的("觉得有必要就跑")
## Memory 通过 `update-config` skill 配置,或者直接编辑 `.claude/settings.json`。
JSON 里每个 hook 加一行注释说明。
The harness has a per-machine memory system. Use it for: ## Memory(记忆)
- **User**: who you are, your role, your preferences. Harness 有按机器的记忆系统。用法:
- **Feedback**: corrections you've given Claude that should stick across
sessions (with the *why*).
- **Project**: facts about ongoing work that aren't in the code (deadlines,
stakeholder decisions, why a refactor is happening).
- **Reference**: pointers to external resources (Linear projects, Grafana
dashboards, internal wikis).
Don't put memory content in `CLAUDE.md`. CLAUDE.md is project context, - **User**:你是谁、角色、偏好。
shared with the team. Memory is personal, per-machine, and lives outside - **Feedback**:你给 AI 的纠正,要跨 session 保留的(带上**为什么**)。
the repo. - **Project**:进行中工作的事实,代码里没写的(截止日期、相关方决策、
为什么要重构)。
- **Reference**:外部资源指针(Linear 项目、Grafana dashboard、内网 wiki)。
Don't use memory as a notes app. If it's task-scoped, it goes in a plan or 不要把 memory 内容塞进 `CLAUDE.md`。CLAUDE.md 是项目上下文,团队共享。
PR description. Memory 是个人的、按机器的,不进仓库。
## Skills 不要把 memory 当便签本用。任务级别的东西塞进 plan 或 PR description。
Skills live in three places: ## Skill(技能)
- **User skills** (`~/.claude/skills/`) — installed once, available everywhere Skill 在三个地方:
- **Project skills** (`<repo>/.claude/skills/`) — committed, shared with team
- **Plugin skills** — installed via marketplace
Promote a workflow to a skill once you've done it the same way three - **用户级**(`~/.claude/skills/`)—— 装一次到处可用
times. See `docs/04-skills-and-planning.md` for the catalog. - **项目级**(`<repo>/.claude/skills/`)—— 提交进仓库,团队共享
- **插件**—— 通过 marketplace 安装
## Sub-agents 同一个流程做了三次都一样,就提升成 skill。目录见
[docs/04-skills-and-planning.md](04-skills-and-planning.md)。
Spawn a sub-agent (via the `Agent` tool) when: ## Sub-agent(子 agent)
- The task needs a search across many files and you don't want the 什么时候开 sub-agent(用 `Agent` 工具):
results in your main context.
- You want a second, independent read on a design or diff.
- The work is genuinely parallel (e.g. researching three options).
Don't spawn sub-agents for tasks the main agent can do in two tool calls. - 任务要跨很多文件搜索,又不想把搜索结果塞进主上下文。
The handoff overhead isn't free. - 想让另一个独立视角再看一遍设计或 diff。
- 工作真的并行(比如同时调研三个方案)。
## Sessions 主 agent 两次工具调用就能搞定的事,别开 sub-agent。交接成本不是免费
的。
- One task per session. Open a new session for a new task. ## Session
- If a session is running long and the context bar is filling, finish
the current step, summarize state into a plan or PR draft, then start - 一个 session 一个任务。新任务开新 session。
fresh. - session 跑长了、上下文条快满了:先收尾当前步骤,把状态总结进 plan
- Don't use `--continue` to resume a session from yesterday on a new 或 PR draft,然后开新 session。
topic. The stale context will leak in. - 别用 `--continue` 把昨天的 session 拉回来做新主题。陈旧上下文会
渗进来。
+76 -87
View File
@@ -1,35 +1,35 @@
# 03 — Git workflow # 03 — Git 工作流
Small team, light process. Branches, commits, PRs, review. 小团队,流程从轻。分支、commit、PR、review、tag。
## Branches ## 分支
- `main` is always shippable. No direct pushes. No exceptions. - `main` 永远可发。不直接 push,没有例外。
- Feature branches: `<owner>/<short-slug>` — e.g. `bai/auth-retry`, - 功能分支:`<owner>/<short-slug>` —— 比如 `bai/auth-retry`、
`bai/eval-agent-rerun`. Lowercase, hyphens, your handle as prefix. `bai/eval-agent-rerun`。小写、连字符、你的 handle 做前缀。
- Long-lived integration branches: `integration/<topic>` — only with - 长期集成分支:`integration/<topic>` —— 团队同意才用。
team agreement. - 合并完删分支。老分支会污染搜索结果。
- Delete branches after merge. Old branches confuse search.
## Commits ## Commit
Format: 格式:
``` ```
<area>: <imperative summary under 60 chars> <area>: <祈使句小结,60 字符以内>
<optional body — what changed and why, not how> <可选 body —— 写改了什么、为什么,不写怎么改>
``` ```
- `<area>` is a directory or component, lowercase: `eval-agent`, - `<area>` 是目录或组件,小写:`eval-agent`、`task_assistant`、
`task_assistant`, `docs`, `git-workflow`. `docs`、`git-workflow`。
- Imperative: "add", "fix", "rename" — not "added" / "adding". - 祈使句:`add`、`fix`、`rename`,不要 `added` / `adding`。
- Body wraps at ~72 chars. Skip it for trivial commits. - Body 在 ~72 字符换行。普通改动跳过 body。
- One topic per commit. "and" in the summary means split it. - 一个 commit 一个主题。摘要里出现"and"——拆。
- AI-assisted commits get the `Co-Authored-By` trailer Claude Code adds - AI 协作的 commit 保留 Claude Code 默认加的 `Co-Authored-By` trailer。
by default. Don't strip it. 别去掉。
- Commit message 用英文(vibe coding 守则之一:给 AI 看的内容用英文)。
Examples: 例:
``` ```
eval-agent: rerun failed tasks with stable seed eval-agent: rerun failed tasks with stable seed
@@ -37,64 +37,55 @@ docs: clarify branch naming in git-workflow
task_assistant: drop unused legacy export path task_assistant: drop unused legacy export path
``` ```
## Pull requests ## Pull Request
- One PR per topic. If you can't describe it in one sentence, it's - 一个 PR 一个主题。一句话说不清楚——拆成多个 PR。
multiple PRs. - 标题 70 字符以内,跟 commit 摘要同一形态。
- Title under 70 chars, same shape as a commit summary. - Description 用 `templates/PR_DESCRIPTION.template.md`。
- Description uses `templates/PR_DESCRIPTION.template.md`. - 第一次 push feature 分支用 `-u`,让它跟踪远端。
- Push to your feature branch with `-u` the first time so it tracks - 有可跑的东西就开 PR,draft 也行。边写边 review 比写完再 review 好。
remote.
- Open the PR as soon as you have something runnable, even if it's a
draft. Review-as-you-go beats review-at-the-end.
## Review ## Review
We review every PR before merge, even our own AI-assisted ones. 每个 PR 都要 review,包括 AI 协作出的,自己也不能跳。
Reviewer checks: Reviewer 检查清单:
1. Does the description match the diff? If the diff has surprises, ask. 1. Description 跟 diff 对得上吗?diff 有惊喜——发问。
2. Read every file changed. If a file isn't related to the stated 2. 改的每个文件都看一遍。文件跟主题无关——发问为什么进了 PR。
topic, ask why it's in the PR. 3. 改动不是显而易见就本地跑一遍。
3. Run the change locally if it's not obviously correct from reading. 4. 新依赖、schema 变更、env var、动 auth 的代码——讲清楚理由前
4. New deps, schema changes, env vars, or auth-touching code → block block。
until justified. 5. 评论先发**最不重要**的;merge-blocker 留到最后,让它明显是闸门。
5. Comment on the *least* important issue first; save the merge-blocker
for last so it's clearly the gate.
Author follow-ups: 作者收尾:
- Address every comment, even with "agreed, fixed in <commit>". - 每条评论都回应,哪怕只是"同意,已在 <commit> 修"。
- If you disagree, push back in writing. Don't silently ignore. - 不同意写出来 push back,不要默默忽略。
- Squash fixup commits before merge if the history is noisy. - 合并前把噪音 commit 压一下(squash fixup commits)。
## Merging ## 合并
- Squash for feature branches. Merge commits are reserved for - Feature 分支用 squash。Merge commit 留给集成分支。
integration branches. - 最终 squash message 按 commit 格式写。PR 标题通常就是好起点。
- Final squash message follows the commit format above. The PR title is - 合并完删分支。
usually the right starting point.
- Delete the branch on merge.
## Tagging (versioning) ## Tag(版本管理)
We tag by date: `YYYYMMDD` (e.g. `20260520`). Each tag is a snapshot of 按日期打 tag:`YYYYMMDD`(比如 `20260520`)。每个 tag 是 `main`
`main` worth pointing at — "this is the version we agreed to follow." 某一时刻的快照——值得指着说"我们就按这版来"。
Rules: 规则:
- Tag only on `main`. Tagging a feature branch is a smell. - 只在 `main` 上打 tag。功能分支打 tag 是 smell。
- One tag per day max. If you cut a second one the same day, suffix with - 一天最多一个 tag。同一天再切一个,加 `-N` 后缀:`20260520-2`、
`-N`: `20260520-2`, `20260520-3`. `20260520-3`。
- Tag messages are annotated, not lightweight. Use `git tag -a` and - 用 annotated tag,不用 lightweight。`git tag -a` 加一两句说自上次
write one or two sentences about what changed since the last tag. tag 以来改了什么。
- A tag, once pushed, is immutable. No deleting, no moving, no force-tag. - Tag 一旦推到远端就不能改、不能删、不能 force-tag。错了就再切一个。
If the tag is wrong, cut a new one. - Tag commit、push tag、告诉大家 tag 名字——这就是发布。
- Tag the commit, push the tag, and announce the tag name. That's the
release.
Cut a tag: 切 tag:
```bash ```bash
git checkout main git checkout main
@@ -103,35 +94,33 @@ git tag -a 20260520 -m "team-guide 20260520: bilingual README, dated tags"
git push origin 20260520 git push origin 20260520
``` ```
List / inspect: 查看 / 对比:
```bash ```bash
git tag --sort=-creatordate # newest first git tag --sort=-creatordate # 按时间倒序
git show 20260520 # show what's in a tag git show 20260520 # 看一个 tag 里有什么
git log --oneline 20260513..20260520 # what changed between tags git log --oneline 20260513..20260520 # 两个 tag 之间改了什么
``` ```
When to cut a tag: 什么时候切 tag:
- The docs in this repo changed in a way teammates need to read. - 本仓库的 docs 改了,队友需要重新读。
- A template was added, removed, or restructured. - 加了、删了或重组了 template。
- A new convention is now in effect (not just proposed). - 新的约定正式生效(不是还在讨论)。
When NOT to cut a tag: 什么时候**不**切 tag:
- Typo fixes, formatting, broken links → just push to `main`. - 改错别字、调格式、修死链 → 直接 push 到 `main`。
- Drafts under discussion → use a PR, don't tag. - 还在讨论的草稿 → 走 PR,不打 tag。
## What NOT to do ## 不要做的事
- No `git push --force` to `main`. Period. To your own branch, only if - 不要 `git push --force` 到 `main`。永远不要。push 到自己分支
nobody else has pulled it. 也只在确定没人 pull 过的情况下。
- No `--no-verify` to skip hooks. Fix what the hook is complaining - 不要 `--no-verify` 跳 hook。修 hook 报的问题。
about. - 不要 amend 已经 push 的 commit。已经在远端的就加新 commit。
- No amending pushed commits. Once it's on the remote, add a new commit. - 不要删或移已经 push 的 tag。错了就切新的。
- No deleting or moving tags after they've been pushed. Cut a new one - 不要提交 `.env`、密钥、或者 ~5 MB 以上的文件——大文件先聊
instead. Git LFS。
- No committing `.env`, credentials, or files larger than ~5 MB without - 有不认识的 untracked 文件时,不要 `git add .` / `git add -A`。
a Git LFS conversation first. 按文件名加。
- No staging with `git add .` or `git add -A` when there are untracked
files you don't recognize. Stage by name.
+66 -77
View File
@@ -1,112 +1,101 @@
# 04 — Skills and planning # 04 — Skill 与规划
How we manage the skill catalog and how we plan work as a small team. 我们怎么管 skill 目录、小团队怎么排活。
## Skill catalog ## Skill 目录
A "skill" is a reusable, named workflow Claude Code can invoke. We keep "Skill"是 Claude Code 能调用的、命名好的可复用流程。我们维护三份:
three catalogs:
- **Personal** (`~/.claude/skills/`) — private, per developer. - **个人**(`~/.claude/skills/`)—— 私人,每人自己管。
- **Team** (`<repo>/.claude/skills/`) — committed, shared via the project. - **团队**(`<repo>/.claude/skills/`)—— 提交进仓库,跟项目共享。
- **Bundled / plugin** — installed from a marketplace. - **打包 / 插件** —— 从 marketplace 装。
### When to make a skill ### 什么时候做 skill
Promote a workflow to a skill when **all three** are true: 工作流提升成 skill 要**同时**满足三条:
1. You've done it the same way three times. 1. 你已经用同样的方式做过三次。
2. The steps are stable enough to write down. 2. 步骤稳定到能写下来。
3. Someone else on the team would do it the same way if shown. 3. 别人按你写的也会做出同样的东西。
If only two are true, leave it as a prompt snippet in your notes. 只满足两条——留在你的提示词笔记里。
### Skill design rules ### Skill 设计规则
- One skill, one job. Skills that branch on "what does the user want?" - 一个 skill 一件事。要分支判断"用户想干什么"——拆成两个。
are two skills. - 用动词短语命名:`review-pr`、`cut-release`、`rebuild-fixtures`。
- Name the skill as a verb phrase: `review-pr`, `cut-release`, 不要 `pr-helper`。
`rebuild-fixtures`. Not `pr-helper`. - Description(模型看的那行字)说**什么时候触发**,不是 skill 干啥。
- Description (the one-liner the model sees) must say *when to invoke*, 触发由模型判断。
not what the skill does. The model decides on the *when*. - `SKILL.md` 200 行以内。长 skill 拆成阶段。
- Keep `SKILL.md` under 200 lines. Long skills get broken into stages. - 例子比说明强。给一个跑通的 run。
- Examples beat instructions. Show one good run.
### Reviewing skills ### Skill review
Treat a new skill like a PR: read it, run it once on a real task, then 新 skill 当 PR 看:读、在真实任务上跑一次、merge。一个月没人用的
merge. Skills that nobody runs after a month get archived (move to skill 归档(移到 `.claude/skills/_archive/`)。
`.claude/skills/_archive/`).
### Active skills (this team) ### 当前活跃 skill(团队)
Maintain this list as we go. Drop a one-line description and the path. 边走边维护。每条一行说明 + 路径。
``` ```
# Personal recommendations (install with marketplace or copy): # 推荐安装的(marketplace 或拷贝):
# anthropic-skills:consolidate-memory — periodic memory cleanup # anthropic-skills:consolidate-memory — 周期性 memory 整理
# simplify — review changed code for reuse/quality # simplify — review 改动找复用 / 质量问题
# fewer-permission-prompts — propose allowlist from transcripts # fewer-permission-prompts — 从 transcript 提议 allowlist
# review — review a pull request # review — review pull request
# security-review — security pass on pending changes # security-review — 对 pending 改动做安全 pass
# Team skills (in this repo): # 团队 skill(本仓库):
# (none yet — add as we promote workflows) # (还没有 —— 提升成 skill 后加进来)
``` ```
## Planning cadence ## 规划节奏
We're 1–3 people. Process should be the lightest thing that keeps us 我们 1–3 人。流程能保持对齐就够轻。当下做法:
aligned. Right now that's:
### Weekly ### 每周
- One short async written sync (Mon morning). Each person posts: - 一次异步书面同步(周一上午)。每人发:
1. What I shipped last week (one line per item). 1. 上周交付了什么(每条一行)。
2. What I'm picking up this week (one line per item). 2. 这周准备捡什么(每条一行)。
3. What's blocked or unclear (the only section worth reading carefully). 3. 哪儿卡住或不清楚(**唯一**值得仔细读的部分)。
- 30-minute live call mid-week. Agenda comes from the "blocked or - 周中 30 分钟实时会。议题来自上面那条"卡住或不清楚"。
unclear" lines.
### Per-task ### 每个任务
Before starting work that will take more than ~half a day: 要超过半天的活,开工前:
1. Write a 5-line spec: *Goal / Why / Done when / Out of scope / Risks*. 1. 写 5 行 spec:*目标 / 为什么 / 完成标准 / 范围外 / 风险*。
2. Drop it in the PR description (draft PR is fine) **before** writing 2. 在 PR description 里贴上(draft PR 也行),**写代码前**。
code. 3. AI 要替你打字的话,这段 spec 就是提示词——直接喂进去。
3. If Claude is going to do most of the typing, the spec is also the
prompt — paste it in.
After finishing: 收尾:
1. PR description updated to match what actually shipped. 1. PR description 更新到跟实际交付一致。
2. Anything you learned that future-you would want goes into Claude 2. 学到的、未来你想看到的,进 Claude memory(feedback / project 类型)
memory (feedback / project type) — see `docs/02-claude-code.md`. —— 见 [docs/02-claude-code.md](02-claude-code.md)。
### Per-quarter ### 每季度
One half-day to: 留半天:
- Re-read this `team-guide` repo. Open PRs for what's stale. - 重读本仓库。过期的开 PR 改。
- Review the skill catalog. Archive what we don't use. - 重审 skill 目录。不用的归档。
- Run `consolidate-memory` against personal memory files. - 跑 `consolidate-memory` 整理个人 memory 文件。
## Project structure ## 项目结构
When starting a new project under this workspace: 工作区下开新项目:
1. Copy `templates/README.md.template` and `templates/CLAUDE.md.template`. 1. 复制 `templates/README.md.template` 和 `templates/CLAUDE.md.template`。
2. `git init` immediately, even if the project is throwaway. Throwaway 2. 立刻 `git init`,哪怕项目是一次性的。一次性项目活得比你想的久。
projects survive longer than you expect. 3. 第一个 commit 只放脚手架,没有真实代码。让 `git log` 后续好读。
3. First commit: scaffolding only, no real code. Makes future `git log` 4. 把项目加进工作区 README(有了之后),让别人能发现。
readable.
4. Add the project to the workspace `README` (when we have one) so it's
discoverable.
## What planning is *not* ## 规划**不是**
- It's not Jira tickets. We don't need a board for two people. - 不是 Jira ticket。两个人不需要看板。
- It's not Gantt charts. If we need one, we're building the wrong thing. - 不是 Gantt 图。需要 Gantt 说明在做错的东西。
- It's not status theater. The Monday post is for spotting blocks, not - 不是状态秀。周一帖是为了发现卡点,不是证明你干了活。
for proving you worked.
+70 -85
View File
@@ -1,111 +1,96 @@
# 05 — Code & deliverable style # 05 — 代码与产出风格
Naming, comments, structure. Same rules apply whether a human or Claude 命名、注释、结构。不论是人写的还是 AI 写的代码,都按这套来。
typed the code.
## Naming ## 命名
- **Files** — lowercase, hyphens for docs (`git-workflow.md`), - **文件** —— 小写。文档用连字符(`git-workflow.md`),Python 用
underscores for Python (`task_runner.py`), kebab for JS/TS where the 下划线(`task_runner.py`),JS/TS 跟生态走 kebab。匹配周围项目。
ecosystem prefers it. Match the surrounding project. - **函数** —— 动词短语。`loadConfig` 不是 `config`;`runTask`
- **Functions** — verb phrases. `loadConfig`, not `config`. `runTask`, 不是 `taskRunner`。
not `taskRunner`. - **变量** —— 写它**是什么**,不写它的类型。`users` 不是
- **Variables** — say what they are, not their type. `users`, not `userArray`;`retryCount` 不是 `n`。
`userArray`. `retryCount`, not `n`. - **布尔** —— `is*`、`has*`、`should*`。`isReady` 不是 `ready`。
- **Booleans** — `is*`, `has*`, `should*`. `isReady`, not `ready`. - **常量** —— `UPPER_SNAKE_CASE` 仅用于真正的模块级常量。函数内用
- **Constants** — `UPPER_SNAKE_CASE` only when truly module-level 普通 `const`。
constants. Inside functions, just use a normal `const`. - **不要缩写**——除非是领域术语。`database` 不是 `db`,`request`
- **No abbreviations** unless they're a domain term. `database`, not 不是 `req`。(Express handler 里的 `req`/`res` 是领域约定,可以。)
`db`. `request`, not `req`. (`req`/`res` in Express handlers is fine —
domain convention.)
## Comments ## 注释
Default to none. A comment is justified when **all** are true: 默认不写。要写注释,**全部**条件成立:
- The *why* is non-obvious from the code. - "为什么"从代码里看不出来。
- A future reader would otherwise misread the code. - 未来读代码的人不写注释会读错。
- The code itself can't be made clearer (rename, extract, restructure). - 代码本身改不清晰(重命名、抽函数、重组都试过)。
Don't write: 不要写:
- `// increment counter` next to `counter++` - `// increment counter` 紧挨着 `counter++`
- `// added for the auth refactor` — belongs in the commit message - `// added for the auth refactor` —— 这话该在 commit message 里
- Block comments restating function signatures - 一大段 docstring 只是把签名复述一遍
- TODOs without an owner or a date — they rot. Either fix it now, file - 没有 owner 没有日期的 TODO —— 它们会烂掉。要么现在修,要么开
an issue, or delete the comment. issue,要么删了。
Do write: 可以写:
- One-liners explaining a non-obvious workaround, with the *why*. - 一行解释一个非显而易见的 workaround,带上**为什么**。
- A `# NOTE:` when behavior would surprise a reader. - `# NOTE:` 标注会让读者意外的行为。
- Module headers only when a file does something the directory layout - 文件头注释,仅限于这个文件做的事目录结构没说清楚。
doesn't already explain.
## File structure ## 文件结构
- One concept per file. If you can't summarize the file in one sentence, - 一个文件一个概念。一句话说不清这个文件干啥——拆。
split it. - 测试文件挨着代码放,除非项目本来就是平行测试树。
- Keep tests next to the code, not in a parallel tree, unless the - 生成文件进 `dist/` / `build/` 这类目录,进 `.gitignore`。永远
project already does the parallel tree. 不改生成文件。
- Generated files go in `dist/`, `build/`, or similar — and into - Lockfile 必须 commit,永远。
`.gitignore`. Never edit a generated file.
- Lockfiles are checked in. Always.
## Errors ## 错误
- Fail loudly at boundaries (user input, external APIs, file I/O). - 在边界处(用户输入、外部 API、文件 I/O)大声失败。
- Don't `try/except` to silence errors. If you catch, you handle. - 不要 `try/except` 吞错。捕了就处理。
- Internal functions trust their callers. Don't validate the same input - 内部函数信任调用方,不要在三层深度上重复校验同一个输入。
three layers deep. - 日志里的错要带够上下文,光看日志能调试——做的什么操作、输入是
- Logged errors include enough context to debug from logs alone — what 什么、走的哪条路径。
was being attempted, which inputs, which path.
## Tests ## 测试
- Test the behavior, not the implementation. If a refactor that - 测行为,不测实现。一个保留行为的重构把测试搞挂了——是测试错。
preserves behavior breaks a test, the test was wrong. - 一个测试一个断言为佳。"啥都测的测试,挂了你不知道是哪一个挂了。"
- One assertion per test, ideally. "Tests that test many things at once - Fixture 和用它的测试放一起。
fail unhelpfully." - 慢 / flaky 的测试加标记或隔离,不要默默重试。
- Fixtures live next to the tests that use them. - 没测试的新代码就是没写完——除非项目真的没有测试基础设施
- Slow / flaky tests get marked or quarantined, not silently retried. (罕见,而且这本身是个 bug)。
- New code without a test is incomplete unless the project genuinely
has no test infrastructure (rare, and a bug in itself).
## READMEs ## README
Every repo has a `README.md`. It answers, in order: 每个仓库都要有 `README.md`。按这个顺序回答:
1. **What is this?** One paragraph. 1. **这是什么?** 一段话。
2. **How do I run it?** Bash blocks for setup, run, test. 2. **怎么跑?** Setup / run / test 的 bash 块。
3. **How do I develop on it?** Where the code lives, what the conventions 3. **怎么开发?** 代码在哪,约定是什么。
are. 4. **数据从哪来 / 去哪?** 仅当不显然才写。
4. **Where does the data come from / go to?** Only if non-obvious. 5. **指针。** 关联仓库、dashboard、文档。
5. **Pointers.** Related repos, dashboards, docs.
Use `templates/README.md.template`. If the README is shorter than the 用 `templates/README.md.template`。如果你的 README 比模板短,没问题
template, that's fine — delete the unused sections. ——把没用的 section 删掉。
## Deliverables (task packages, datasets, exports) ## 交付物(任务包、数据集、导出)
When we ship a deliverable to a partner or downstream consumer: 给伙伴或下游交付时:
1. Versioned filename: `<name>-v<n>.<ext>` or `<name>-<YYYYMMDD>.<ext>`. 1. 文件名带版本:`<name>-v<n>.<ext>` 或 `<name>-<YYYYMMDD>.<ext>`。
Pick one convention per project and stick to it. 一个项目一种约定,定了别变。
2. Ships with a `README` describing schema, generation date, known 2. 配 `README` 写明 schema、生成日期、已知限制。
limitations. 3. 配验证报告(计数、checksum、合理性检查),跟交付物一起打包。
3. Ships with a verification report (counts, checksums, sanity checks) 4. 生成它的 commit hash 写进 README。
in the same archive.
4. Exact commit hash that produced it goes in the README.
See `docs/06-handoff.md` for the full checklist. 完整 checklist 见 [docs/06-handoff.md](06-handoff.md)。
## What NOT to do ## 不要做的事
- Don't introduce a third way to do something we already do two ways. - 不要引入第三种做某件事的方式——已经有两种了。挑一种统一。
Pick one and migrate. - 不要"为了灵活性"加配置开关,没有真实用例就别加。YAGNI。
- Don't add config options "for flexibility" without a real use case. - 不要在功能 PR 里顺手重构无关代码。开新 PR。
YAGNI. - 不要没量就先优化。"可能慢"不是测量结果。
- Don't refactor unrelated code in a feature PR. Open a separate PR.
- Don't optimize before measuring. "It might be slow" is not a
measurement.
+61 -79
View File
@@ -1,41 +1,37 @@
# 06 — Handoff # 06 — Handoff(交接)
Task packages, deliverables, and how we hand work between team members 任务包、交付物、团队成员之间或对外部消费方的交接。
or to external consumers.
## Why this matters ## 为什么这事重要
Handoff failures cost more than the original work. A package that's 交接出问题的成本比原工作高。作者觉得"显然就是这么用的"的包,到接收方
"obviously how it works" to the author is a half-day of confusion for 手里是半天的迷茫。把交接当**交付物的一部分**对待,不是事后包装。
the recipient. Treat handoff as part of the deliverable, not as
afterthought packaging.
## Two kinds of handoff ## 两种 handoff
1. **Internal** — passing work to another team member (or future-you). 1. **内部** —— 把工作交给队友(或未来的你)。通常是分支、PR、半成品
Usually a branch, a PR, or a half-finished prototype. 原型。
2. **External** — shipping a versioned artifact to a partner, customer, 2. **外部** —— 给伙伴、客户或下游 pipeline 发版本化产物。通常是 zip、
or downstream pipeline. Usually a zip, a dataset, or a release. 数据集、release。
Both use the checklist in `templates/HANDOFF_CHECKLIST.template.md`. The 两种都用 `templates/HANDOFF_CHECKLIST.template.md`。外部的标准更高。
external case has a higher bar.
## Task packages ## 任务包
When we ship a task package (e.g. `praxis-sample-5.zip`, 我们发的任务包(比如 `praxis-sample-5.zip`、
`task-assistant-v0.2-handoff-*.zip`), it must contain: `task-assistant-v0.2-handoff-*.zip`)必须包含:
``` ```
<package>/ <package>/
├── README.md ← what this is, who it's for, how to use it ├── README.md ← 这是什么、给谁用、怎么用
├── CHANGELOG.md ← what changed since the last version ├── CHANGELOG.md ← 自上一版改了什么
├── VERIFICATION.md ← counts, checksums, sanity checks ├── VERIFICATION.md ← 计数、checksum、合理性检查
├── manifest.json ← machine-readable metadata ├── manifest.json ← 机器可读的元数据
├── data/ ← the actual deliverable ├── data/ ← 真正的交付物
└── scripts/ ← only what's needed to use the package └── scripts/ ← 用这个包必须的脚本
``` ```
`manifest.json` minimum fields: `manifest.json` 至少要有:
```json ```json
{ {
@@ -49,73 +45,59 @@ When we ship a task package (e.g. `praxis-sample-5.zip`,
} }
``` ```
If you can't fill a field, leave it as `null` and explain in the README. 填不出的字段写 `null`,在 README 里解释。**永远不要瞎编**。
Never make one up.
## Internal handoff (branch / PR) ## 内部 handoff(分支 / PR)
Before handing off: 交出去之前:
- PR description is current. The summary describes what shipped, not - PR description 是最新的。Summary 写实际交付了什么,不是尝试过什么。
what was attempted. - PR template 里的 "test plan" 老老实实填。没测就说没测——别埋。
- The "test plan" section in the PR template is filled in honestly. If - AI 协作中让你意外的决策放进 `## Notes for reviewer`。"AI 先试了 X
you didn't test something, say so — don't bury it. 不行因为 Y,最后用了 Z"——省 reviewer 重推一遍。
- Any AI-assisted decisions that surprised you go in a `## Notes for - 本地状态(env var、临时数据)要文档化或脚本化。"在我机器上能跑"
reviewer` section. "Claude tried X first, that didn't work because Y, 不算交接。
here's the working approach" saves the reviewer a re-derivation.
- Local-only state (env vars, scratch data) is documented or scripted.
"Works on my machine" is not a handoff.
The recipient should be able to: 接收方应该能:
1. `git checkout` the branch 1. `git checkout` 这个分支
2. Read the PR description 2. 读 PR description
3. Run the test plan 3. 跑 test plan
4. Form an opinion 4. 形成自己的判断
— without messaging you. If they have to message you, the handoff is —— **不用问你**。如果接收方还要私聊你,handoff 就是不完整的。
incomplete.
## External handoff (versioned artifact) ## 外部 handoff(版本化产物)
Higher bar. In addition to the task package contents above: 标准更高。除上面任务包内容外:
- **Reproducibility.** Someone with access to the source repo can - **可重现。** 有源码访问的人能从 `manifest.json` 里的 commit hash
rebuild the artifact from the commit hash in `manifest.json`. Test 重建产物。第一次发布前测一遍。
this at least once before the first release. - **验证报告。** 一份机器可读(JSON 之类)的报告,记录预发检查的
- **Verification report.** A machine-checkable report (JSON or 通过情况。写清楚检查了什么、结果是什么。
similar) showing the artifact passed our pre-ship checks. Include - **来源(provenance)。** AI 协助生成的,写明用的哪个模型、人工
what was checked and the result. 审核步骤是什么。不是为了仪式感——是为了半年后产物有问题时好查。
- **Provenance.** If the artifact was generated using AI assistance, - **License 与署名。** 内部伙伴也要写。明确他们能用、不能用。
note the model and any human-in-the-loop steps. Not for ceremony —
for debugging when something looks wrong six months from now.
- **License & attribution.** Even for internal partners. Be explicit
about what they can and can't do with the data.
## What NOT to ship ## 不要发的东西
- Files larger than ~500 MB without a conversation about delivery - 没聊过传输渠道的 ~500 MB 以上文件。
channel. - 含真实 PII 的内容——除非交付协议里就明确包含。
- Anything containing real PII unless that was explicitly the deal. - `.env`、密钥、API key、内部主机名。
- `.env`, secrets, API keys, internal hostnames. - "final final v3" 命名。用 version 字段。要是 final,那就是 `v1.0`。
- "Final final v3" filenames. Use the version field. If it's `final`, - 没有 README 的包。一行 README 也比没有强。
it's `v1.0`.
- A package without a README. Even a one-line README beats none.
## Receiving a handoff ## 收到 handoff 时
When you're on the receiving end: 你是接收方:
1. Read the README first, fully. Resist the urge to start running 1. 先**完整读** README。忍住直接跑脚本的冲动。
scripts. 2. 跑一遍验证报告。不通过——停下来联系发送方再做任何事。
2. Run the verification report. If it doesn't pass, stop and message 3. 任何意外(命名、缺文件、版本不对)一天内反馈给发送方。drift 不
the sender before doing anything else. 反馈只会越来越歪。
3. Note any surprise — naming, missing files, version mismatch — and
send it back to the sender within a day. Drift gets worse with
silence.
## Templates ## 模板
- `templates/HANDOFF_CHECKLIST.template.md` — fill out per handoff, - `templates/HANDOFF_CHECKLIST.template.md` —— 每次交接填一份,跟
ships in the package. 包一起发。
- `templates/PR_DESCRIPTION.template.md` — for internal handoff via PR. - `templates/PR_DESCRIPTION.template.md` —— 内部 handoff 走 PR 用。
+114
View File
@@ -0,0 +1,114 @@
# 07 — Codex
我们怎么在团队里用 Codex(CLI 与 IDE 集成),以及 `AGENTS.md` 怎么写。
## 为什么要规范
Codex 不读 `CLAUDE.md`。Claude Code 默认不读 `AGENTS.md`。两个工具在
同一个仓库里干活,看的是不同的"项目说明书"。如果只写一份,另一边就
是裸奔。
我们的做法:**两份都写,内容保持同步**。哪边的工具进来读哪边的文件。
## 文件分工
```
<repo>/
├── CLAUDE.md ← Claude Code 读的项目上下文
├── AGENTS.md ← Codex CLI / Codex IDE 读的项目上下文
└── docs/... ← 给人读的文档(中文)
```
两个文件**内容大体一致**:项目是什么、怎么跑、架构、本仓库特有的
约定、不要做什么。
它们的区别是:
- `CLAUDE.md` 偶尔会引用 Claude Code 特有的概念(skill、sub-agent、
permission mode、`.claude/settings.json`)。
- `AGENTS.md` 偶尔会引用 Codex 特有的概念(approval 模式、
`~/.codex/config.toml`、MCP server 配置)。
- 双方共有的部分(项目背景、命名约定、语言策略、commit 格式)必须
完全一致。
## 同步责任
谁改了 `CLAUDE.md`,谁顺手改 `AGENTS.md`(反之亦然)。在 PR 描述里
加一句"Synced AGENTS.md"或"Synced CLAUDE.md"——reviewer 一眼就能确认。
如果 PR 只改了一边,reviewer **block** 这个 PR,让作者补上。
要是哪天发现两边内容已经漂移得太远,开一个专门的 PR 重新对齐,
不要在功能 PR 里捎带修。
## Codex 使用约定
### 启动方式
- 终端:`codex`(不指定 prompt 进交互模式)或 `codex "<prompt>"`(一次性
任务)。在仓库根目录启动,让它能找到 `AGENTS.md`。
- IDE:用官方插件(VS Code / JetBrains)。仓库根目录的 `AGENTS.md`
自动加载。
### Approval 模式
默认用 `on-request`(命令前问一下)。机器是个人的、风险可控的环境
才用 `on-failure` 或 `never`。生产环境、共享机器、不熟悉的仓库——
保持 `on-request`。
调整方式见 Codex 文档;个人偏好放进 `~/.codex/config.toml`,**不要**
提交进仓库。
### 沙盒(sandbox)
- 写代码 + 跑测试:`workspace-write` + 网络 off。够用了。
- 需要联网装包 / fetch 资源:临时切 `workspace-write` + 网络 on,跑完
切回。
- `danger-full-access` 几乎不用。除非你知道自己在干嘛而且代价能承担。
### 不要让 Codex 干的事
跟 Claude Code 一样:
- 删数据、`git push --force`、改 auth、动密钥——**人决策**。
- 改 schema、加依赖、改 CI——**人审批**。
- 跨仓库的改动——**手动协调**,不要让 agent 一次推两个仓库。
## AGENTS.md 写法
每个项目的 `AGENTS.md` 按这个顺序写:
1. **项目** —— 一两句话定位。不要超过两句。
2. **怎么跑** —— Build / test / lint 命令,bash 块。
3. **架构** —— 一段话。入口、数据流、核心模块。能省字就省字。
4. **本仓库特有约定** —— 命名、目录、那些代码里看不出来的模式。
5. **语言策略** —— 哪些文件是中文(人看),哪些是英文(AI 看),
commit / PR / branch / tag 用什么语言。
6. **不要做的事** —— 翻过的车,每条一行。
100 行以内是目标,超出说明它在朝"通用文档"漂移,该拆。
模板见 `templates/AGENTS.md.template`。
## 工具选择建议
不是非此即彼,但有偏好:
- **写 docs / 写规范** —— Claude Code(这个仓库就是它写的)。
- **大段重构 / 跨多文件功能** —— Claude Code,因为有 plan mode 和
sub-agent。
- **窄范围编辑、跑个测试、改个配置** —— Codex CLI,启动快。
- **IDE 内 inline 改一段** —— Codex IDE 插件或 Cursor,看习惯。
两个工具混着用没问题,只要:
- 一个 session 一个工具(别又开 Claude Code 又开 Codex 改同一个文件,
互相覆盖很难追)。
- 两边产出的 commit 都按本仓库的 commit 格式([03-git-workflow.md](03-git-workflow.md))。
## 配置同步与个人覆盖
- 项目级:`AGENTS.md`、`CLAUDE.md`、`.claude/settings.json` 都进仓库。
- 个人级:`~/.codex/config.toml`、`~/.claude/settings.json`、
`.claude/settings.local.json`——**永远不进仓库**,gitignore 已经覆盖。
- 个人 token 永远不写进仓库里的任何文件,包括 `AGENTS.md`。
+69
View File
@@ -0,0 +1,69 @@
# AGENTS.md — <project name>
<!--
Template. Copy into a new repo and fill the bracketed sections.
Sister file: CLAUDE.md (Claude Code reads that one). Keep them in sync.
Delete sections that don't apply. Keep total length under ~100 lines.
-->
## Project
<One or two sentences. What does it do, who is it for.>
## Run it
```bash
# install
<command>
# run
<command>
# test
<command>
# lint / typecheck
<command>
```
## Architecture
<One paragraph. Where are the entry points, how does data flow, what
are the major modules. Skip diagrams unless they save words.>
Key files:
- `<path>` — <one-line role>
- `<path>` — <one-line role>
## Conventions specific to this repo
<Anything that's not obvious from reading the code. Naming patterns,
where to add new features, what's auto-generated, etc.>
## Language policy
<If this project follows the team's bilingual policy, copy this:>
- Human-facing docs (README, `docs/*.md`, human-fillable templates) are
in Chinese.
- AI-facing files (`CLAUDE.md`, `AGENTS.md`, AI-only templates) are in
English.
- Commit messages, PR titles, branch names, tag annotations: English.
## Don'ts
<Things Codex / Claude / a new contributor has gotten wrong before.
One line each. Add to this list as you discover them.>
- Don't <…>
- Don't <…>
## External resources
<Links to dashboards, related repos, docs, ticket trackers.>
## Sync
When you edit this file, also update `CLAUDE.md` (and vice versa). The
two files describe the same project to different tools.
+18 -2
View File
@@ -2,10 +2,11 @@
<!-- <!--
Template. Copy into a new repo and fill the bracketed sections. Template. Copy into a new repo and fill the bracketed sections.
Sister file: AGENTS.md (Codex reads that one). Keep them in sync.
Delete sections that don't apply. Keep total length under ~100 lines. Delete sections that don't apply. Keep total length under ~100 lines.
--> -->
## What this project is ## Project
<One or two sentences. What does it do, who is it for.> <One or two sentences. What does it do, who is it for.>
@@ -40,9 +41,19 @@ Key files:
<Anything that's not obvious from reading the code. Naming patterns, <Anything that's not obvious from reading the code. Naming patterns,
where to add new features, what's auto-generated, etc.> where to add new features, what's auto-generated, etc.>
## Language policy
<If this project follows the team's bilingual policy, copy this:>
- Human-facing docs (README, `docs/*.md`, human-fillable templates) are
in Chinese.
- AI-facing files (`CLAUDE.md`, `AGENTS.md`, AI-only templates) are in
English.
- Commit messages, PR titles, branch names, tag annotations: English.
## Don'ts ## Don'ts
<Things Claude or a new contributor has gotten wrong before. <Things Claude / Codex / a new contributor has gotten wrong before.
One line each. Add to this list as you discover them.> One line each. Add to this list as you discover them.>
- Don't <…> - Don't <…>
@@ -51,3 +62,8 @@ One line each. Add to this list as you discover them.>
## External resources ## External resources
<Links to dashboards, related repos, docs, ticket trackers.> <Links to dashboards, related repos, docs, ticket trackers.>
## Sync
When you edit this file, also update `AGENTS.md` (and vice versa). The
two files describe the same project to different tools.
+44 -50
View File
@@ -1,71 +1,65 @@
# Handoff checklist — <package or branch name> # Handoff 清单 — <包名或分支名>
<!-- <!--
Fill this out before declaring the handoff complete. 交付前填完整。外部 handoff 一起放进包里;内部 handoff 放进 PR
Ships inside the package for external handoffs. description。正文中文,技术字段(commit hash、ISO 时间戳等)保留
Lives in the PR description for internal handoffs. 英文格式。
--> -->
## Identity ## 身份信息
- **Name**: <package or branch name> - **名称**:<包名或分支名>
- **Version**: <e.g. v0.5.0 or commit sha> - **版本**:<比如 v0.5.0 或 commit sha 或 tag 比如 20260520>
- **Generated at**: <ISO timestamp> - **生成时间**:<ISO 时间戳>
- **Source repo**: <url> - **源仓库**:<url>
- **Source commit**: <full sha> - **源 commit**:<full sha>
- **Author / handoff owner**: <name> - **作者 / handoff owner**:<name>
- **Recipient**: <name or team> - **接收方**:<name 或团队>
## Contents ## 内容物
- [ ] `README.md` — describes what this is, how to use it - [ ] `README.md` —— 这是什么、怎么用
- [ ] `CHANGELOG.md` — what's different from the previous version (or - [ ] `CHANGELOG.md` —— 跟上一版的差异(首发就写"first release")
"first release") - [ ] `manifest.json` —— 机器可读元数据,所有字段都填了或显式 null
- [ ] `manifest.json` — machine-readable metadata, all fields filled or - [ ] `VERIFICATION.md` —— 检查了什么、结果如何
explicitly null - [ ] 数据 / 产物 —— 真正的交付物
- [ ] `VERIFICATION.md` — what we checked, what passed - [ ] 脚本 —— 仅限于使用本包必须的脚本
- [ ] Data / artifacts — the actual deliverable
- [ ] Scripts — only what's needed to use the package
## Verification ## 验证
- [ ] Record / file counts match expected - [ ] 记录数 / 文件数与预期一致
- [ ] Checksums computed and recorded - [ ] Checksum 已计算并记录
- [ ] Sanity checks pass (list them) - [ ] 合理性检查通过(列出来)
- [ ] No secrets, `.env`, or credentials included - [ ] 不含密钥、`.env`、credential
- [ ] No PII unless explicitly part of the deliverable - [ ] 不含 PII(除非交付协议里就明确包含)
- [ ] Total size reasonable for delivery channel - [ ] 总大小在传输渠道可接受范围
Verification report path: `<path>` 验证报告路径:`<path>`
## Reproducibility ## 可重现性
- [ ] Confirmed someone with repo access can rebuild from - [ ] 已确认有源仓库访问的人能从 `source_commit` 重建产物(写明
`source_commit` (note who tested this and when) 谁测的、什么时候测的)
- [ ] Build / generation command documented in `README.md` - [ ] 构建 / 生成命令写在 `README.md` 里
- [ ] External dependencies pinned to versions - [ ] 外部依赖锁版本
## Provenance (if AI-assisted) ## 来源(AI 协助生成时填)
- Model used: <e.g. claude-opus-4-7> - 使用的模型:<比如 claude-opus-4-7、gpt-5-codex>
- Human-in-the-loop steps: <which parts a human reviewed / approved> - 人工审核步骤:<人审 / 批准了哪些部分>
- Notable AI-assisted decisions: <anything that would matter if the - 值得标注的 AI 决策:<半年后产物有问题时会想知道的事>
output looks wrong six months from now>
## Known limitations ## 已知限制
<Things that don't work, edge cases that aren't covered, follow-ups <不能用的场景、未覆盖的边界、本版没赶上的后续。具体写。"在我机器
that didn't make this version. Be specific. "Works on my machine" is 上能跑"不是限制——是发布前要修的问题。>
not a limitation, it's a problem to fix before shipping.>
- <…> - <…>
- <…> - <…>
## Recipient instructions ## 给接收方的说明
- [ ] Read `README.md` first - [ ] 先读 `README.md`
- [ ] Run the verification report — if it fails, stop and contact the - [ ] 跑验证报告 —— 不通过就停下来联系发送方
sender - [ ] <X 天>内确认收到
- [ ] Confirm receipt within <X days> - [ ] 任何意外(缺文件、版本不对、命名异常)<X 天>内反馈给发送方
- [ ] Report any surprises (missing files, version mismatch, naming)
back to the sender within <X days>
+27 -30
View File
@@ -1,52 +1,49 @@
<!-- <!--
PR description template. Title goes in the PR title field, not here. PR description 模板。标题写在 PR 标题栏,不在这里。
Title format: <area>: <imperative summary under 70 chars> 标题格式:<area>: <祈使句小结,70 字符以内>。英文。
正文中文。
--> -->
## Summary ## Summary(小结)
<One sentence describing what this PR does. Then 1–3 bullets if needed.> <一句话说清这个 PR 干了什么。需要的话再加 1–3 条 bullet。>
- <bullet> - <bullet>
- <bullet> - <bullet>
## Why ## Why(为什么)
<The motivation. What problem does this solve, what decision does it <动机。解决什么问题、落实什么决策、修哪个 bug。如果挂着 issue
implement, what bug does it fix. If this links to an issue or earlier 或者之前的讨论,链上来。>
discussion, link it here.>
## What changed ## What changed(改了什么)
<Bulleted list of the actual changes, grouped by area if it spans <列出实际改动,跨多个区域时按区域分组。写事实就行——diff 是真相
multiple. Keep it factual — the diff is the source of truth, this is 来源,这只是地图。>
just a map.>
- `<file or area>` — <change> - `<文件或区域>` — <改动>
- `<file or area>` — <change> - `<文件或区域>` — <改动>
## Test plan ## Test plan(测试方案)
<Bulleted checklist. Mark `[x]` for done, `[ ]` for didn't do (and <勾选式 checklist。做了的勾 `[x]`,没做的留 `[ ]` 并在下面解释为什么。
explain why below). Be honest — "didn't test" is acceptable, "claimed 诚实——"没测"可以接受,"声称测了但没测"不行。>
tested but didn't" is not.>
- [ ] Unit tests pass locally (`<command>`) - [ ] 单元测试本地通过(`<command>`)
- [ ] Lint / typecheck pass (`<command>`) - [ ] Lint / typecheck 通过(`<command>`)
- [ ] <feature-specific check> - [ ] <功能特定的检查>
- [ ] <feature-specific check> - [ ] <功能特定的检查>
## Out of scope ## Out of scope(范围外)
<Things you noticed but explicitly chose not to fix in this PR. Helps <你注意到但**显式选择不在这个 PR 修**的东西。帮 reviewer 不要在这些
reviewers not bring them up.> 点上提出来。>
## Notes for reviewer ## Notes for reviewer(给 reviewer 的提示)
<Anything that surprised you, AI-assisted decisions worth flagging, <让你意外的地方、值得标注的 AI 协作决策、走过的捷径,或者"我考虑
shortcuts taken, or "I considered X but went with Y because Z". Skip 过 X 但选了 Y 因为 Z"。没什么可写就删掉这一节。>
this section if there's nothing notable.>
--- ---
🤖 AI-assisted with Claude Code. 🤖 AI 协助完成(Claude Code / Codex)。
+24 -24
View File
@@ -1,62 +1,62 @@
# <project name> # <项目名>
<One sentence. What this is, in plain language.> <一句话。这是什么,用大白话写。>
## What it does ## 这玩意儿干啥的
<One paragraph. Slightly more detail than the tagline. Who would use <一段话。比 tagline 多点细节。谁会用、解决什么问题、明确**不**做
it, what problem it solves, what it explicitly does not do.> 什么。>
## Quick start ## 快速上手
```bash ```bash
# clone # clone
git clone <url> git clone <url>
cd <repo> cd <repo>
# install # 安装
<command> <command>
# run # 跑起来
<command> <command>
``` ```
Expected output: 预期输出:
``` ```
<a few lines of what the user should see> <几行用户应该看到的内容>
``` ```
## Development ## 开发
```bash ```bash
# tests # 测试
<command> <command>
# lint / typecheck # lint / typecheck
<command> <command>
# format # 格式化
<command> <command>
``` ```
Code lives in `<dir>`. Tests live in `<dir>`. See [docs/](docs/) for 代码在 `<dir>`。测试在 `<dir>`。架构细节看 [docs/](docs/)(没有就
deeper architecture notes (or delete this line if there are none). 删掉这行)。
## Configuration ## 配置
<Env vars, config files, secrets. Point to a `.env.example` if there is <env var、配置文件、密钥。指向 `.env.example` 如果有的话。不写真实
one. Don't list real values.> 值。>
## Data sources / outputs ## 数据来源 / 流向
<Only if non-obvious. Where does input come from, where do outputs go.> <仅当不显然时写。输入从哪来,输出到哪去。>
## Related ## 相关链接
- <link> - <链接>
- <link> - <链接>
## License ## License
<Internal / MIT / etc.> <Internal / MIT / 等等。>