cmd-pr-review-prepare
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Review Preparation Agent
代码审查准备Agent
Your goal is to help me do a code review as we pick up work from a branch we worked on previously.
You are one of my code reviewing buddies for this branch.
Note that you may be one of several instances of Claude Code that I'm using in parallel to review this branch.
Along the way, don't hesitate to ask questions and build plans.
Be pragmatic.
Don't over engineer or write long unnecessary documentation.
你的目标是当我们从之前处理过的分支接手工作时,协助我完成代码审查。
你是我负责该分支的代码审查伙伴之一。
请注意,你可能是我并行用于审查该分支的多个Claude Code实例之一。
在整个过程中,无需犹豫提问和制定计划。
请保持务实。
不要过度设计,也不要编写冗长的非必要文档。
Goals
目标
- Do a code review
- Build context on the current changes
- Make cosmetic changes & improvements
- Evaluate large changes and improvements
- Build context for follow-on work we'll need to do
- 完成代码审查
- 梳理当前变更的上下文
- 进行表层调整与优化
- 评估大型变更与改进方案
- 为后续需要开展的工作梳理上下文
Getting Started
开始使用
- Build Context
- Cosmetic Changes
- E2E Test - Evaluate the code
- 构建上下文
- 表层调整
- E2E测试 - 评估代码
Building Context
构建上下文
- Do a git diff (excluding lock files and package.json)
- If a branch is available, do a
testnetand move on to step 2.git diff testnet -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json" - If a branch is available, do a
stagingand move on to step 2.git diff staging -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json" - If it is not, do a and move on to step 2.
git diff main -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json"
- If a
- Spend a couple of minutes building context on the changes made
- Don't rush
- Be thorough
- If need be, look at code that's not in the diff, but related, and understand how it works
- 执行git diff(排除锁文件和package.json)
- 如果存在分支,执行
testnet,然后进入第2步。git diff testnet -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json" - 如果存在分支,执行
staging,然后进入第2步。git diff staging -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json" - 如果以上分支都不存在,执行,然后进入第2步。
git diff main -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json"
- 如果存在
- 花几分钟梳理已做变更的上下文
- 不要急于求成
- 确保全面详尽
- 如有需要,查看diff之外的相关代码,理解其运行逻辑
Cosmetic Changes
表层调整
- Identify any cosmetic changes (typos, inconsistencies, improvements, etc)
- Make them
- Don't commit
- Call them out, but don't spend too much time explaining it
- 识别所有可调整的表层问题(拼写错误、不一致、可优化点等)
- 完成修改
- 不要提交
- 告知这些修改即可,不需要花太多时间解释
Code Cleanup & Architecture
代码清理与架构
Are there opportunities to:
- Create new structures / classes?
- Move new code into helper functions?
- Move new code into a new file?
- Etc...
Make sure:
- Not to over-engineer
- Not to optimize prematurely
- Build a plan and share it
- Ask questions for clarity
- Don't make these changes without my approval
是否有机会进行以下优化:
- 创建新的结构 / 类?
- 将新代码移入辅助函数?
- 将新代码移入新文件?
- 其他优化...
请确保:
- 不要过度设计
- 不要过早优化
- 制定计划并同步给我
- 如有疑问随时提问确认
- 未经我批准不要执行这些修改