code-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Review

代码审查

Guide proper code review practices emphasizing technical rigor, evidence-based claims, and verification over performative responses.
本指南介绍恰当的代码审查实践,强调技术严谨性、基于证据的主张与验证,而非流于形式的回应。

Overview

概述

Code review requires three distinct practices:
  1. Receiving feedback - Technical evaluation over performative agreement
  2. Requesting reviews - Systematic review processes
  3. Verification gates - Evidence before any completion claims
代码审查需要遵循三项明确的实践:
  1. 接收反馈 - 以技术评估替代流于形式的认同
  2. 请求审查 - 系统化的审查流程
  3. 验证关卡 - 做出任何完成声明前需提供证据

Core Principle

核心原则

Technical correctness over social comfort. Verify before implementing. Ask before assuming. Evidence before claims.
技术正确性优先于社交舒适度。先验证再实施。先询问再假设。先有证据再做主张。

When to Use

适用场景

Receiving Feedback

接收反馈

  • Receiving code review comments from any source
  • Feedback seems unclear or technically questionable
  • Multiple review items need prioritization
  • External reviewer lacks full context
  • Suggestion conflicts with existing decisions
  • 收到来自任何渠道的代码审查评论
  • 反馈内容模糊或存在技术疑问
  • 多个审查项需要排序优先级
  • 外部审查者缺乏完整上下文
  • 建议与现有决策存在冲突

Requesting Review

请求审查

  • Completing tasks in subagent-driven development (after EACH task)
  • Finishing major features or refactors
  • Before merging to main branch
  • Stuck and need fresh perspective
  • After fixing complex bugs
  • 在子Agent驱动的开发中完成任务后(每完成一个任务后
  • 完成主要功能或重构工作后
  • 合并到主分支之前
  • 遇到瓶颈需要新的思路时
  • 修复复杂漏洞之后

Verification Gates

验证关卡

  • About to claim tests pass, build succeeds, or work is complete
  • Before committing, pushing, or creating PRs
  • Moving to next task
  • Any statement suggesting success/completion
  • 即将宣称测试通过、构建成功或工作完成时
  • 提交、推送代码或创建PR之前
  • 进入下一个任务之前
  • 任何表明成功/完成的表述之前

Quick Decision Tree

快速决策树

SITUATION?
├─ Received feedback
│  ├─ Unclear items? → STOP, ask for clarification first
│  ├─ From human partner? → Understand, then implement
│  └─ From external reviewer? → Verify technically before implementing
├─ Completed work
│  ├─ Major feature/task? → Request systematic review
│  └─ Before merge? → Request systematic review
└─ About to claim status
   ├─ Have fresh verification? → State claim WITH evidence
   └─ No fresh verification? → RUN verification command first
SITUATION?
├─ Received feedback
│  ├─ Unclear items? → STOP, ask for clarification first
│  ├─ From human partner? → Understand, then implement
│  └─ From external reviewer? → Verify technically before implementing
├─ Completed work
│  ├─ Major feature/task? → Request systematic review
│  └─ Before merge? → Request systematic review
└─ About to claim status
   ├─ Have fresh verification? → State claim WITH evidence
   └─ No fresh verification? → RUN verification command first

CI Verification

CI验证

Before any completion claim or commit:
  • Run CI checks (types, tests, lint)
  • Prefer single CI command if available
  • Verify all checks pass
  • Do not proceed if checks fail
在做出任何完成声明或提交代码之前:
  • 运行CI检查(类型检查、测试、代码规范检查)
  • 如果有可用的单一CI命令,优先使用
  • 确认所有检查均通过
  • 若检查失败,请勿继续

References

参考资料

For detailed protocols, see:
  • references/receiving-feedback.md
    - How to handle code review feedback
  • references/requesting-review.md
    - Systematic review processes
  • references/verification-gates.md
    - Evidence before claims protocol
如需详细协议,请参阅:
  • references/receiving-feedback.md
    - 如何处理代码审查反馈
  • references/requesting-review.md
    - 系统化审查流程
  • references/verification-gates.md
    - 主张前的证据验证协议