review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Perform a code review.
Arguments: $ARGUMENTS (optional scope)
  • commit: Review only staged files for commit
  • pr [number]: Review all files changed in the current PR (or specific PR number)
  • all: Review the entire codebase
  • If no argument provided:
    • If in a PR branch: defaults to 'pr'
    • Otherwise: defaults to 'commit'
执行代码评审。
参数:$ARGUMENTS(可选范围)
  • commit: 仅评审提交的暂存文件
  • pr [number]: 评审当前PR(或指定PR编号)中所有变更的文件
  • all: 评审整个代码库
  • 若未提供参数:
    • 若处于PR分支:默认使用'pr'模式
    • 否则:默认使用'commit'模式

Phase 1: Scope Determination

阶段1:范围确定

  1. Determine scope based on $ARGUMENTS
  2. If reviewing a PR, fetch PR details and linked issue with
    gh pr view
    and
    gh issue view
  1. 根据$ARGUMENTS确定评审范围
  2. 若评审PR,使用
    gh pr view
    gh issue view
    获取PR详情及关联的议题

Phase 2: Review

阶段2:评审执行

  1. Run available linting tools for detected languages
  2. Check against project standards from CLAUDE.md (80 char limit, whitespace, naming)
  3. Review for: correctness, performance, security, maintainability, test coverage
  4. If PR: check alignment with target issue requirements and CI/CD status with
    gh pr checks
  1. 针对检测到的语言运行可用的Linting工具
  2. 对照CLAUDE.md中的项目规范进行检查(80字符限制、空白符、命名规则)
  3. 评审维度:正确性、性能、安全性、可维护性、测试覆盖率
  4. 若为PR:检查是否符合目标议题要求,并通过
    gh pr checks
    查看CI/CD状态

Phase 3: Synthesis

阶段3:结果汇总

  1. Organise findings by priority:
    • Critical issues (must fix)
    • Important improvements (should fix)
    • Suggestions (consider fixing)
    • Positive observations
For each issue, provide location, description, suggested fix, and rationale.
  1. 按优先级整理评审结果:
    • 严重问题(必须修复)
    • 重要改进(应该修复)
    • 建议项(考虑修复)
    • 正面评价
针对每个问题,提供位置、描述、建议修复方案及理由。