code-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Review Guidelines

代码审查指南

This is a strict guideline. Follow these rules exactly.
Multi-perspective code analysis strategy for comprehensive reviews.

这是一份严格的指南,请严格遵守以下规则。
用于开展全面审查的多视角代码分析策略。

Review Strategy

审查策略

Analyze code from four parallel perspectives:
  1. Architecture - Alignment with patterns and principles
  2. Security - Vulnerabilities and risks
  3. Performance - Optimization opportunities
  4. Quality - Maintainability and conventions

从四个并行维度分析代码:
  1. 架构 - 与模式和原则的对齐度
  2. 安全 - 漏洞与风险
  3. 性能 - 优化空间
  4. 质量 - 可维护性与规范符合度

Architecture Review

架构审查

Check for:
  • Alignment with CORE_PRINCIPLES
  • Consistency with established patterns (see INDEX.md)
  • Proper separation of concerns
  • Module boundaries and dependencies
  • File organization
Report:
  • Pattern violations with doc references
  • Architectural inconsistencies
  • Recommendations for better alignment

检查项:
  • 与CORE_PRINCIPLES的对齐度
  • 与已确立模式的一致性(参见INDEX.md)
  • 合理的关注点分离
  • 模块边界与依赖关系
  • 文件组织方式
输出报告:
  • 违反模式的情况及文档参考
  • 架构不一致问题
  • 提升对齐度的建议

Security Review

安全审查

Check for:
  • Environment variable handling
  • Authentication and authorization flows
  • API endpoint security
  • Input validation and sanitization
  • Token/credential storage
  • Sensitive data exposure
Report:
  • Security vulnerabilities (critical)
  • Potential risks (warnings)
  • Best practice recommendations

检查项:
  • 环境变量处理
  • 身份认证与授权流程
  • API端点安全
  • 输入验证与清理
  • 令牌/凭证存储
  • 敏感数据暴露
输出报告:
  • 安全漏洞(严重)
  • 潜在风险(警告)
  • 最佳实践建议

Performance Review

性能审查

Check for:
  • Inefficient algorithms or data structures
  • Unnecessary computations
  • Resource-intensive operations
  • Caching opportunities
  • Bundle size impact (frontend)
  • Database query optimization (backend)
Report:
  • Performance bottlenecks
  • Optimization opportunities
  • Trade-offs to consider

检查项:
  • 低效的算法或数据结构
  • 不必要的计算
  • 资源密集型操作
  • 可缓存场景
  • 包体积影响(前端)
  • 数据库查询优化(后端)
输出报告:
  • 性能瓶颈
  • 优化空间
  • 需要考量的权衡点

Quality Review

质量审查

Check for:
  • Code readability and clarity
  • Naming conventions
  • Error handling
  • Code duplication
  • Test coverage
  • Documentation completeness
Report:
  • Code quality issues
  • Maintainability concerns
  • Convention violations

检查项:
  • 代码可读性与清晰度
  • 命名规范
  • 错误处理
  • 代码重复
  • 测试覆盖率
  • 文档完整性
输出报告:
  • 代码质量问题
  • 可维护性隐患
  • 违反规范的情况

Output Format

输出格式

Structure findings as:
按以下结构整理发现的问题:

✅ Strengths

✅ 优势

Brief acknowledgment of what works well
简要确认代码中做得好的部分

🔴 Critical Issues

🔴 严重问题

Must be fixed (security, broken functionality, principle violations)
必须修复(安全问题、功能损坏、违反原则)

🟡 Improvements

🟡 待改进项

Important but not urgent (performance, maintainability)
重要但不紧急(性能、可维护性相关)

💡 Suggestions

💡 建议

Nice-to-have enhancements (style, minor optimizations)
锦上添花的优化(代码风格、小幅优化)

📋 Action Items

📋 行动项

Numbered list of specific changes with file references

带文件引用的具体变更编号列表

Review Process

审查流程

  1. Analyze in parallel - Run all four perspectives simultaneously
  2. Synthesize findings - Combine results, remove duplicates
  3. Prioritize - Critical → Improvements → Suggestions
  4. Be specific - Reference files, patterns, and principles
  5. Be constructive - Acknowledge good patterns, explain reasoning

  1. 并行分析 - 同时从四个维度开展审查
  2. 整合发现 - 合并结果,去除重复项
  3. 优先级排序 - 严重问题 → 待改进项 → 建议
  4. 表述具体 - 关联对应的文件、模式与原则
  5. 保持建设性 - 认可优秀的设计模式,解释判断理由

Progressive Improvement

持续改进

If the developer corrects a behavior that this skill should have prevented, suggest a specific amendment to this skill to prevent the same correction in the future.
如果开发人员修正了本指南本应提前规避的问题,请提出对本指南的具体修订建议,避免未来重复出现同类问题。