Intelligent code review skill, helping review code quality, discover potential problems, and provide improvement suggestions.
Smart code review skill that helps review code quality, identify potential issues, and provide improvement suggestions.
When to Use
Use this skill when the user requests the following operations:
- Review code / Review code
- Check code quality / Check code quality
- Find issues in code / Find issues in code
- Request improvement suggestions / Request improvement suggestions
Instructions
Review Steps / Review Steps
- Read the code - Carefully read the provided code
- Check for issues:
- Syntax errors / Syntax errors
- Logic issues / Logic issues
- Security vulnerabilities / Security vulnerabilities
- Performance issues / Performance issues
- Code style / Code style
- Provide suggestions - Give specific improvement suggestions
- Output report - Generate a review report using the standard format
Output Format / Output Format
## 代码审查报告 / Code Review Report
### 概述 / Summary
[简要总结 / Brief summary]
### 发现的问题 / Issues Found
- [ ] 问题 1 / Issue 1
- [ ] 问题 2 / Issue 2
### 改进建议 / Suggestions
1. 建议 1 / Suggestion 1
2. 建议 2 / Suggestion 2
### 评分 / Score
- 代码质量 / Code Quality: X/10
- 可读性 / Readability: X/10
- 可维护性 / Maintainability: X/10
Examples
Input / Input
def calc(x,y):
return x+y
Output / Output
Code review report
Overview
A simple addition function with naming and formatting issues.
Issues found
- Function name
calcis not descriptive - Missing type hints
- Missing docstring
- Missing spaces around operators
Improvement suggestions
- Rename the function to
add_numbers - Add type hints:
def add_numbers(x: int, y: int) -> int: - Add a docstring to explain the function's purpose
- Follow the PEP 8 formatting conventions
Score
- Code quality: 6/10
- Readability: 7/10
- Maintainability: 5/10