review-agents-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
The meta-principle: a context file earns its tokens. Every line must tell the agent something it can't infer from the code, the formatter, or the linter. If a line could be deleted without the agent getting worse, delete it.
核心原则:上下文文件要物有所值。每一行都必须为Agent提供无法从代码、格式化工具或代码检查工具中推断出的信息。如果删除某一行不会影响Agent的表现,那就删掉它。

Workflow

工作流程

  1. Read the target file (default:
    AGENTS.md
    , then
    CLAUDE.md
    at repo root). If both exist, review both.
  2. Evaluate against each rubric below. For every issue, quote the offending lines and propose a concrete rewrite — not just a critique.
  3. Report findings grouped by severity: Cut (delete), Rewrite (fix in place), Add (missing required content).
  4. End with a one-line verdict: total lines now vs. proposed, and whether the tech stack is mentioned.
Do not auto-edit the file unless the user asks. Surface the diff first.
  1. 读取目标文件(默认:仓库根目录下的
    AGENTS.md
    ,其次是
    CLAUDE.md
    )。如果两个文件都存在,则同时审查两者。
  2. 根据以下每项评估标准进行检查。对于每个问题,引用有问题的行并提出具体的重写方案——而不仅仅是批评。
  3. 按严重程度分组报告发现的问题:删除(移除内容)、重写(原地修复)、补充(添加缺失的必要内容)。
  4. 最后用一句话给出结论:当前总行数与修改后的预估行数对比,以及技术栈是否已被提及。
除非用户要求,否则不要自动编辑文件。先展示差异内容。

Rubric

评估标准

Length & signal density

长度与信号密度

Good: Short and load-bearing. Every line is non-obvious and would change agent behavior if removed. Bad: Long preambles, restated obvious facts ("we use TypeScript"), or generic engineering advice. Flag any file over ~200 lines as suspect and identify the lowest-signal sections to cut.
良好:简洁且有实际作用。每一行内容都非显而易见,且删除后会影响Agent的行为。 不良:冗长的开场白、重复显而易见的事实(如“我们使用TypeScript”),或通用的工程建议。将任何超过约200行的文件标记为可疑,并找出信号密度最低的部分进行删除。

Non-obvious content only

仅保留非显而易见的内容

Good: Conventions, architecture choices, tooling quirks ("we use bun, not node"; "migrations run via
make db-migrate
, not the ORM CLI"). Bad: Anything derivable from
package.json
,
Cargo.toml
, file extensions, or a five-second skim of the repo. Cut it.
良好:约定规则、架构选择、工具特性(如“我们使用bun,而非node”;“迁移通过
make db-migrate
执行,而非ORM命令行工具”)。 不良:任何可从
package.json
Cargo.toml
、文件扩展名或对仓库的5秒快速浏览中推导出来的内容。删除此类内容。

Tech stack is mentioned

提及技术栈

Good: The language/runtime/framework choices the agent would otherwise guess wrong are mentioned somewhere in the file (e.g., "Bun 1.x runtime, not Node"; "Postgres 16 + Drizzle, not Prisma"). A dedicated
## Tech Stack
section is fine but not required — a one-liner near the top works too. Bad: No mention at all of the non-obvious stack choices, so the agent has to infer them from manifests. If missing, propose a short addition drafted from the repo's manifests.
良好:文件中提及了Agent可能会猜错的语言/运行时/框架选择(例如:“使用Bun 1.x运行时,而非Node”;“使用Postgres 16 + Drizzle,而非Prisma”)。专门设置
## Tech Stack
章节是可行的,但并非必需——在文件顶部用一句话说明也可以。 不良:完全未提及非显而易见的技术栈选择,导致Agent必须从清单文件中推断。如果缺失,建议根据仓库的清单文件添加一段简短内容。

Auto-generated content

自动生成的内容

Good: Hand-written, curated. Bad: Looks
/init
-generated — boilerplate headings, file-tree dumps, restatement of
package.json
scripts. Auto-generated context files measurably reduce success rates. Recommend deletion and replacement with a hand-written file.
良好:手写且经过精心筛选。 不良:看起来像是通过
/init
生成的——包含模板化标题、文件树输出、重复
package.json
中的脚本内容。自动生成的上下文文件会显著降低成功率。建议删除并替换为手写文件。

Outdated docs

过时文档

Good: Current. References match the code. Bad: Mentions removed files, renamed commands, deprecated workflows. The agent reads these anyway and gets misled. Flag specific stale references and recommend deletion from the repo, not just from the context file.
良好:内容最新。引用内容与代码一致。 不良:提及已删除的文件、重命名的命令、已弃用的工作流。Agent仍会读取这些内容并被误导。标记具体的过时引用,并建议从仓库中删除,而不仅仅是从上下文文件中移除。

Don't redocument the formatter / linter

不要重复记录格式化/代码检查工具的规则

Good: Silent on style —
prettier
,
eslint
,
rustfmt
,
ruff
enforce it. Bad: "Use 2-space indent", "prefer single quotes", "no unused imports". Cut. If a rule isn't enforced by tooling, recommend adding the rule to the tooling instead of to the context file.
良好:对代码风格保持沉默——由
prettier
eslint
rustfmt
ruff
等工具强制执行。 不良:出现“使用2空格缩进”、“优先使用单引号”、“禁止未使用的导入”等内容。删除此类内容。如果某条规则未被工具强制执行,建议将该规则添加到工具配置中,而非写入上下文文件。

Procedural workflows live elsewhere

流程化工作流存放在其他位置

Good: Recurring multi-step tasks (release, migration, deploy) live in slash commands or skills.
AGENTS.md
points to them by name. Bad: Numbered step-by-step procedures embedded in
AGENTS.md
itself. Recommend extracting each procedure into
.claude/commands/<name>.md
or a skill, and replacing the section with a one-line pointer.
良好:重复性的多步骤任务(发布、迁移、部署)存放在斜杠命令或Skill中。
AGENTS.md
通过名称指向这些任务。 不良:将编号的分步流程直接嵌入
AGENTS.md
中。建议将每个流程提取到
.claude/commands/<name>.md
或Skill中,并将原章节替换为一行指向内容。

Decision tables for genuine choices

针对真实选择使用决策表

Good: When 2–3 valid approaches exist, a small table with columns like Situation / Use / Why. Bad: Prose that lists options without telling the agent which to pick when. Convert to a table.
良好:当存在2-3种有效方案时,使用包含场景 / 使用方案 / 原因等列的小型表格。 不良:仅列出选项但未说明Agent在何种情况下应选择哪个选项的散文式内容。将其转换为表格。

Pair every "don't" with a "do"

每个“不要”都对应“应该”

Good: "Don't add new endpoints to
legacy/api.ts
— add them to
routes/v2/
and register in
routes/index.ts
." Bad: "Don't touch the legacy module." A bare prohibition makes the agent over-explore looking for the allowed path. Flag every unpaired "don't" / "never" / "avoid" and propose the missing "do".
良好:“不要在
legacy/api.ts
中添加新的端点——应添加到
routes/v2/
并在
routes/index.ts
中注册。” 不良:仅出现“不要修改遗留模块”这类内容。单纯的禁止会导致Agent过度探索以寻找允许的操作路径。标记所有未配对的“不要”/“绝不”/“避免”语句,并补充对应的“应该”操作建议。

Progressive disclosure

渐进式披露

Good: The always-loaded root file is small. Path- or task-specific guidance lives in nested
AGENTS.md
files (e.g.,
services/billing/AGENTS.md
), slash commands, or skills, surfaced only when relevant. Bad: One mega-file with sections that only apply to one subdirectory or one rare task. Identify those sections and recommend moving them to a nested file or a skill.
良好:始终加载的根文件体积较小。特定路径或任务的指导内容存放在嵌套的
AGENTS.md
文件中(例如
services/billing/AGENTS.md
)、斜杠命令或Skill中,仅在相关时才展示。 不良:单个超大文件中包含仅适用于某个子目录或某项罕见任务的章节。找出这些章节并建议将其移至嵌套文件或Skill中。

Output format

输出格式

Structure the review as:
undefined
审查结果按以下结构呈现:
undefined

Cut (N lines)

删除(共N行)

  • L12–18: <quote>. Reason: <which rubric>. Replacement: <none / shorter line>.
  • 第12–18行:<引用内容>。原因:<对应评估标准>。替代方案:<无/更简短的内容>。

Rewrite

重写

  • L34: <quote>. Issue: bare "don't". Proposed: <do-form>.
  • 第34行:<引用内容>。问题:仅包含“不要”的禁止语句。建议修改为:<包含“应该”的表述>。

Add

补充

  • Tech stack not mentioned. Proposed addition (one-liner or section): <draft>
  • 未提及技术栈。建议添加内容(一句话或章节): <草稿内容>

Verdict

结论

Before: 187 lines. After proposed edits: ~60 lines. Tech stack mentioned: no → added.

Be specific. Quote line numbers. Propose replacement text, not just labels.
修改前:187行。修改后预估:约60行。技术栈提及情况:未提及 → 已添加。

内容要具体。引用行号。提出具体的替代文本,而非仅标注问题类型。