pr-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePR Review
PR审核
Systematic code review following team standards.
遵循团队标准的系统化代码审核。
Review Process
审核流程
1. Understand the Change
1. 理解变更内容
- Read PR description and linked issues
- Understand the intent and scope
- Check if the approach aligns with architecture
- 阅读PR描述和关联的问题
- 理解变更意图和范围
- 检查实现方案是否符合架构设计
2. Review Code Quality
2. 审核代码质量
Go through each checklist section below.
依次检查以下各清单部分。
3. Provide Feedback
3. 提供反馈
- Be specific and actionable
- Explain the "why" behind suggestions
- Distinguish blocking issues from suggestions
- Acknowledge good patterns
- 反馈要具体且可执行
- 解释建议背后的原因
- 区分阻塞性问题和优化建议
- 认可代码中的优秀模式
Review Checklist
审核清单
TypeScript
TypeScript
- No types used
any - No casts (type guards used instead)
as - Functions have explicit return types
- Proper error types defined
- No TypeScript errors (passes)
bun run build
- 不使用类型
any - 不使用类型转换(改用类型守卫)
as - 函数有明确的返回类型
- 定义了合适的错误类型
- TypeScript编译无错误(执行通过)
bun run build
React
React
- useEffect only for external synchronization
- API calls, WebSocket, browser APIs, timers
- No derived state in useEffect
- No props copied to state
- User actions handled in event handlers
- Effects have comments explaining external resource
- Proper cleanup in effects when needed
- useEffect仅用于外部同步
- API调用、WebSocket、浏览器API、定时器
- 不在useEffect中处理派生状态
- 不将props复制到state中
- 用户操作在事件处理器中处理
- effect有注释说明涉及的外部资源
- 必要时在effect中进行适当的清理
Code Quality
代码质量
- (or
bun run lint:fixif no fix script) passesbun run lint - No console.log in production code
- Follows existing patterns in codebase
- No dead code or commented-out code
- Meaningful variable and function names
- (如果没有修复脚本则用
bun run lint:fix)执行通过bun run lint - 生产代码中无console.log
- 遵循代码库中的现有模式
- 无死代码或注释掉的代码
- 变量和函数命名有意义
Security
安全
- Input validated at boundaries
- No hardcoded secrets or credentials
- Proper authentication/authorization checks
- No SQL injection vulnerabilities
- No XSS vulnerabilities
- 在边界处验证输入
- 无硬编码的密钥或凭证
- 有适当的认证/授权检查
- 无SQL注入漏洞
- 无XSS漏洞
Database (if applicable)
数据库(如适用)
- Existing migrations NOT edited
- Schema changes via
drizzle-kit generate - Appropriate indexes considered
- No N+1 query patterns
- 不修改已有的迁移文件
- 通过进行Schema变更
drizzle-kit generate - 考虑添加合适的索引
- 无N+1查询问题
Testing
测试
- Tests cover happy path
- Tests cover error cases
- Tests are meaningful (not just coverage)
- 测试覆盖正常流程
- 测试覆盖异常场景
- 测试有实际意义(不只是为了覆盖率)
Documentation
文档
- Comments and docs in English
- Complex logic explained
- API changes documented
- README updated if needed
- 注释和文档使用英文
- 复杂逻辑有说明
- API变更有文档记录
- 必要时更新README
Feedback Template
反馈模板
markdown
undefinedmarkdown
undefinedSummary
Summary
[Overall assessment: Approve / Request Changes / Comment]
[Overall assessment: Approve / Request Changes / Comment]
Blocking Issues
Blocking Issues
- [File:Line] Issue description
- Why it's a problem
- Suggested fix
- [File:Line] Issue description
- Why it's a problem
- Suggested fix
Suggestions
Suggestions
- [File:Line] Suggestion description
- Why this would be better
- [File:Line] Suggestion description
- Why this would be better
Questions
Questions
- [Question about design or implementation]
- [Question about design or implementation]
Praise
Praise
- [Acknowledge good patterns or improvements]
undefined- [Acknowledge good patterns or improvements]
undefinedSeverity Levels
严重程度等级
| Level | Meaning | Action |
|---|---|---|
| Blocking | Must fix before merge | Request changes |
| Suggestion | Would improve code | Comment |
| Nitpick | Minor style preference | Optional |
| Question | Need clarification | Comment |
| 等级 | 含义 | 处理方式 |
|---|---|---|
| Blocking | 合并前必须修复 | 要求变更 |
| Suggestion | 能提升代码质量 | 添加评论 |
| Nitpick | 次要的风格偏好 | 可选修复 |
| Question | 需要澄清 | 添加评论 |