This skill provides professional code review capabilities to help discover potential issues and provide improvement suggestions.
Review Dimensions
1. Code Quality
- Readability: Naming conventions, comment completeness, code structure
- Maintainability: Degree of modularization, coupling, complexity
- Consistency: Code style, use of design patterns
2. Potential Issues
- Bug Risk: Null pointers, boundary conditions, exception handling
- Security Vulnerabilities: Injection attacks, sensitive data leakage, permission issues
- Performance Issues: Algorithm complexity, resource leaks, concurrency issues
3. Best Practices
- Design Principles: SOLID、DRY、KISS
- Language Features: Modern syntax, standard library usage
- Test Coverage: Unit tests, boundary tests
Review Process
- Overview Analysis: Understand the purpose and structure of the code
- Line-by-Line Review: Check each function and module
- Issue Classification: Classify by severity as Critical/Major/Minor
- Suggestion Generation: Provide specific improvement plans
Output Format
## 代码审查报告
### 概述
[代码的整体评价]
### 发现的问题
#### Critical(严重)
- [ ] 问题描述 (文件:行号)
- 原因分析
- 建议修复
#### Major(重要)
- [ ] ...
#### Minor(次要)
- [ ] ...
### 改进建议
1. 建议一
2. 建议二
### 总体评分: X/10
Usage Example
User: "Help me review this Python code" → Load this skill and perform a code review according to the above process