code-review-pro
3
总安装量
2
周安装量
#60897
全站排名
安装命令
npx skills add https://github.com/gked2121/claude-skills --skill code-review-pro
Agent 安装分布
mcpjam
2
claude-code
2
replit
2
junie
2
windsurf
2
zencoder
2
Skill 文档
Code Review Pro
Deep code analysis covering security, performance, maintainability, and best practices.
When to Use This Skill
Activate when the user:
- Asks for a code review
- Wants security vulnerability scanning
- Needs performance analysis
- Asks to “review this code” or “audit this code”
- Mentions finding bugs or improvements
- Wants refactoring suggestions
- Requests best practice validation
Instructions
-
Security Analysis (Critical Priority)
- SQL injection vulnerabilities
- XSS (cross-site scripting) risks
- Authentication/authorization issues
- Secrets or credentials in code
- Unsafe deserialization
- Path traversal vulnerabilities
- CSRF protection
- Input validation gaps
- Insecure cryptography
- Dependency vulnerabilities
-
Performance Analysis
- N+1 query problems
- Inefficient algorithms (check Big O complexity)
- Memory leaks
- Unnecessary re-renders (React/Vue)
- Missing indexes (database queries)
- Blocking operations
- Resource cleanup (file handles, connections)
- Caching opportunities
- Excessive network calls
- Large bundle sizes
-
Code Quality & Maintainability
- Code duplication (DRY violations)
- Function/method length (should be <50 lines)
- Cyclomatic complexity
- Unclear naming
- Missing error handling
- Inconsistent style
- Missing documentation
- Hard-coded values that should be constants
- God classes/functions
- Tight coupling
-
Best Practices
- Language-specific idioms
- Framework conventions
- SOLID principles
- Design patterns usage
- Testing approach
- Logging and monitoring
- Accessibility (for UI code)
- Type safety
- Null/undefined handling
-
Bugs and Edge Cases
- Logic errors
- Off-by-one errors
- Race conditions
- Null pointer exceptions
- Unhandled edge cases
- Timezone issues
- Encoding problems
- Floating point precision
-
Provide Actionable Fixes
- Show specific code changes
- Explain why change is needed
- Include before/after examples
- Prioritize by severity
Output Format
# Code Review Report
## ð¨ Critical Issues (Fix Immediately)
### 1. SQL Injection Vulnerability (line X)
**Severity**: Critical
**Issue**: User input directly concatenated into SQL query
**Impact**: Database compromise, data theft
**Current Code:**
```javascript
const query = `SELECT * FROM users WHERE email = '${userEmail}'`;
Fixed Code:
const query = 'SELECT * FROM users WHERE email = ?';
db.query(query, [userEmail]);
Explanation: Always use parameterized queries to prevent SQL injection.
â ï¸ High Priority Issues
2. Performance: N+1 Query Problem (line Y)
[Details…]
ð¡ Medium Priority Issues
3. Code Quality: Function Too Long (line Z)
[Details…]
â Low Priority / Nice to Have
4. Consider Using Const Instead of Let
[Details…]
ð Summary
- Total Issues: 12
- Critical: 2
- High: 4
- Medium: 4
- Low: 2
ð¯ Quick Wins
Changes with high impact and low effort:
- [Fix 1]
- [Fix 2]
ð Strengths
- Good error handling in X
- Clear naming conventions
- Well-structured modules
ð Refactoring Opportunities
- Extract Method: Lines X-Y could be extracted into
calculateDiscount() - Remove Duplication: [specific code blocks]
ð Resources
## Examples
**User**: "Review this authentication code"
**Response**: Analyze auth logic â Identify security issues (weak password hashing, no rate limiting) â Check token handling â Note missing CSRF protection â Provide specific fixes with code examples â Prioritize by severity
**User**: "Can you find performance issues in this React component?"
**Response**: Analyze component â Identify unnecessary re-renders â Find missing useMemo/useCallback â Note large state objects â Check for expensive operations in render â Provide optimized version with explanations
**User**: "Review this API endpoint"
**Response**: Check input validation â Analyze error handling â Test for SQL injection â Review authentication â Check rate limiting â Examine response structure â Suggest improvements with code samples
## Best Practices
- Always prioritize security issues first
- Provide specific line numbers for issues
- Include before/after code examples
- Explain *why* something is a problem
- Consider the language/framework context
- Don't just criticizeâacknowledge good code too
- Suggest gradual improvements for large refactors
- Link to documentation for recommendations
- Consider project constraints (legacy code, deadlines)
- Balance perfectionism with pragmatism
- Focus on impactful changes
- Group similar issues together
- Make recommendations actionable