review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePerform 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:范围确定
- Determine scope based on $ARGUMENTS
- If reviewing a PR, fetch PR details and linked issue with and
gh pr viewgh issue view
- 根据$ARGUMENTS确定评审范围
- 若评审PR,使用和
gh pr view获取PR详情及关联的议题gh issue view
Phase 2: Review
阶段2:评审执行
- Run available linting tools for detected languages
- Check against project standards from CLAUDE.md (80 char limit, whitespace, naming)
- Review for: correctness, performance, security, maintainability, test coverage
- If PR: check alignment with target issue requirements and CI/CD status with
gh pr checks
- 针对检测到的语言运行可用的Linting工具
- 对照CLAUDE.md中的项目规范进行检查(80字符限制、空白符、命名规则)
- 评审维度:正确性、性能、安全性、可维护性、测试覆盖率
- 若为PR:检查是否符合目标议题要求,并通过查看CI/CD状态
gh pr checks
Phase 3: Synthesis
阶段3:结果汇总
- 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.
- 按优先级整理评审结果:
- 严重问题(必须修复)
- 重要改进(应该修复)
- 建议项(考虑修复)
- 正面评价
针对每个问题,提供位置、描述、建议修复方案及理由。