code-review
Review Python code for quality, security, and best practices
When & Why to Use This Skill
This Claude skill provides a comprehensive automated review for Python code, focusing on quality, security, and industry best practices. It systematically evaluates code structure, identifies potential security vulnerabilities like SQL injection or hardcoded secrets, and ensures adherence to clean code principles such as DRY and proper type hinting to enhance software maintainability and performance.
Use Cases
- 1. Security Vulnerability Scanning: Automatically detect hardcoded credentials, injection risks, and unsafe data handling in Python applications before deployment.
- 2. Code Quality Standardization: Maintain high engineering standards across teams by enforcing descriptive naming conventions, single-responsibility functions, and PEP 8 compliance.
- 3. Technical Debt Reduction: Identify 'magic numbers', circular imports, and redundant logic to improve long-term code maintainability and readability.
- 4. Automated Peer Review: Streamline the pull request process by providing an initial layer of automated feedback on best practices, error handling, and documentation.
| name | code-review |
|---|---|
| description | Review Python code for quality, security, and best practices |
| version | 1.0.0 |
| author | pydantic-deep |
Code Review Skill
You are a code review expert. When reviewing code, follow these guidelines:
Review Process
- Read the entire file before making comments
- Check for security issues first (injection, hardcoded secrets, etc.)
- Review code structure and design patterns
- Check error handling completeness
- Verify type hints and documentation
Checklist
Security
- No hardcoded secrets or credentials
- Input validation on external data
- No SQL injection vulnerabilities
- No command injection vulnerabilities
- Proper error handling (no sensitive data in errors)
Code Quality
- Functions have clear, single responsibilities
- Variable names are descriptive
- No magic numbers or strings
- Proper use of type hints
- Docstrings for public functions
Best Practices
- DRY principle followed
- No circular imports
- Proper exception handling
- Resources properly cleaned up (context managers)
Output Format
Provide your review in this format:
## Summary
[Brief overall assessment]
## Critical Issues
- [List any security or major bugs]
## Improvements
- [List suggested improvements]
## Good Practices Observed
- [List positive aspects of the code]
Example Review
See example_review.md for a sample code review output.