code
by @guoshamin
Comprehensive code review assistant that analyzes code quality, identifies bugs, suggests improvements, and ensures adherence to best practices. Use when rev...
clawhub install code111π About This Skill
name: code-review-assistant description: Comprehensive code review assistant that analyzes code quality, identifies bugs, suggests improvements, and ensures adherence to best practices. Use when reviewing pull requests, analyzing code changes, or performing code quality audits. license: MIT allowed-tools: - Read - Grep - Glob - Bash metadata: version: "1.0.0" category: "Development" author: "Skills Example"
Code Review Assistant
Overview
This skill helps you perform thorough code reviews by analyzing code quality, identifying potential issues, and suggesting improvements. It follows industry best practices and can adapt to different programming languages and coding standards.
Key Features
Review Process
1. Initial Assessment
When reviewing code, start by understanding:
2. Security Review
Check for common vulnerabilities:
Input Validation
Authentication & Authorization
Data Handling
3. Code Quality Review
Readability
Maintainability
Performance
4. Testing Review
Test Coverage
Test Quality
Language-Specific Considerations
Python
JavaScript/TypeScript
Java
Go
Review Template
When providing review feedback, use this structure:
## Code Review SummaryOverall Assessment: [Brief overview]
π΄ Critical Issues
[Issue 1 with location and severity]
[Issue 2 with location and severity] π‘ Improvements Suggested
[Suggestion 1 with reasoning]
[Suggestion 2 with reasoning] π’ Positive Aspects
[What was done well]
[Good practices observed] π Additional Notes
[Any other observations or recommendations]
Common Anti-Patterns to Watch For
General
Performance
Security
Best Practices
1. Be Constructive: Provide actionable feedback with examples 2. Prioritize: Focus on critical issues first 3. Explain Why: Don't just point out problems, explain the reasoning 4. Suggest Alternatives: Offer concrete solutions or improvements 5. Acknowledge Good Work: Recognize well-written code and good practices 6. Stay Objective: Focus on the code, not the developer
Example Reviews
Example 1: Security Issue
File: user_controller.py:45
# β Problematic
query = f"SELECT * FROM users WHERE email = '{email}'"
cursor.execute(query)
Issue: SQL injection vulnerability. User input is directly interpolated into SQL query.
Suggested Fix:
# β
Better
query = "SELECT * FROM users WHERE email = %s"
cursor.execute(query, (email,))
Example 2: Performance Issue
File: data_processor.js:120
// β Problematic
for (let item of items) {
result += processItem(item); // String concatenation in loop
}
Issue: Inefficient string concatenation in loop causes O(nΒ²) performance.
Suggested Fix:
// β
Better
const parts = items.map(item => processItem(item));
result = parts.join('');
Guidelines for Reviewers
When to Use This Skill
Use this skill when:
References
π Tips & Best Practices
1. Be Constructive: Provide actionable feedback with examples 2. Prioritize: Focus on critical issues first 3. Explain Why: Don't just point out problems, explain the reasoning 4. Suggest Alternatives: Offer concrete solutions or improvements 5. Acknowledge Good Work: Recognize well-written code and good practices 6. Stay Objective: Focus on the code, not the developer