code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese代码审查技能
Code Review Skill
本技能提供专业的代码审查能力,帮助发现潜在问题并提供改进建议。
This skill provides professional code review capabilities to help identify potential issues and provide improvement suggestions.
审查维度
Review Dimensions
1. 代码质量
1. Code Quality
- 可读性: 命名规范、注释完整性、代码结构
- 可维护性: 模块化程度、耦合度、复杂度
- 一致性: 代码风格、设计模式使用
- Readability: Naming conventions, comment completeness, code structure
- Maintainability: Modularity, coupling, complexity
- Consistency: Code style, design pattern usage
2. 潜在问题
2. Potential Issues
- Bug 风险: 空指针、边界条件、异常处理
- 安全漏洞: 注入攻击、敏感数据泄露、权限问题
- 性能问题: 算法复杂度、资源泄漏、并发问题
- Bug Risks: Null pointers, boundary conditions, exception handling
- Security Vulnerabilities: Injection attacks, sensitive data leakage, permission issues
- Performance Issues: Algorithm complexity, resource leaks, concurrency problems
3. 最佳实践
3. Best Practices
- 设计原则: SOLID、DRY、KISS
- 语言特性: 现代语法、标准库使用
- 测试覆盖: 单元测试、边界测试
- Design Principles: SOLID, DRY, KISS
- Language Features: Modern syntax, standard library usage
- Test Coverage: Unit testing, boundary testing
审查流程
Review Process
- 概览分析: 理解代码目的和结构
- 逐行审查: 检查每个函数和模块
- 问题分类: 按严重程度分为 Critical/Major/Minor
- 建议生成: 提供具体的改进方案
- Overview Analysis: Understand the purpose and structure of the code
- Line-by-Line Review: Inspect each function and module
- Issue Classification: Categorize by severity as Critical/Major/Minor
- Recommendation Generation: Provide specific improvement solutions
输出格式
Output Format
markdown
undefinedmarkdown
undefined代码审查报告
Code Review Report
概述
Overview
[代码的整体评价]
[Overall evaluation of the code]
发现的问题
Identified Issues
Critical(严重)
Critical
- 问题描述 (文件:行号)
- 原因分析
- 建议修复
- Issue description (File:Line number)
- Root cause analysis
- Suggested fix
Major(重要)
Major
- ...
- ...
Minor(次要)
Minor
- ...
- ...
改进建议
Improvement Suggestions
- 建议一
- 建议二
- Suggestion 1
- Suggestion 2
总体评分: X/10
Overall Score: X/10
undefinedundefined使用示例
Usage Example
用户: "帮我审查这段 Python 代码"
→ 加载此技能,按照上述流程进行代码审查
User: "Help me review this Python code"
→ Load this skill and perform code review following the above process