python-review
Skill3 starsChanged 4 months agoMITView on GitHub
Comprehensive Python code review for PEP 8 compliance, type hints, security, and Pythonic idioms
8 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- BaratovSokhibjon/skillstheir own version, first seen Oct 25, 2026
- ArangoGutierrez/claude-toolkittheir own version, first seen Oct 15, 2026
- tslateman/skillstheir own version, first seen Oct 11, 2026
- apinto25/claude-code-agents-skillstheir own version, first seen Oct 11, 2026
- jscott3201/yet-more-skillstheir own version, first seen Sep 7, 2026
- weiweimhy/agent-skillstheir own version, first seen Jul 1, 2026
Used with
Projects with it also use go-review, typescript-review and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TheKREATORSSkillgo-review
Comprehensive Go code review for idiomatic patterns, concurrency safety, error handling, and security. Invokes the go-reviewer agent.
Also in 5 projects that use this
weiweimhySkilltypescript-review
TypeScript code review guidance for type safety, generics, narrowing, public API types, runtime validation alignment, async flow, TSX, and strict tsconfig. Use when reviewing .ts or .tsx files, Node/React/Vue TypeScript, or complex types.
Also in 4 projects that use this
CloudflareSkillrust-review
Rust code review for workerd. Covers CXX FFI safety, unsafe code patterns, JSG resource conventions, error handling, and a review checklist adapted from the C++ review skills. Load this skill when reviewing Rust code in src/rust/.
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- TheKREATORS/my-claude-skills★ 197% same
Wrote their own version · 7
- kingsidharth/skills★ 17same name
- ArangoGutierrez/claude-toolkit★ 4same name
- jscott3201/yet-more-skills★ 4same name
- apinto25/claude-code-agents-skills★ 2same name
- BaratovSokhibjon/skills★ 1same name
- tslateman/skills★ 1same name
- weiweimhy/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository67 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- optimize-contextSkill
- a11y-checkSkill
- api-contractSkill
- backend-patternsSkill
- build-fixSkill
- checkpointSkill
- clickhouse-ioSkill
- code-review-eccSkill
- code-reviewSkill
- coding-standardsSkill
- config-auditSkill
- continuous-learning-v2Skill
- create-prdSkill
- deps-auditSkill
- e2eSkill
- eval-harnessSkill
- evalSkill
- evolveSkill
- executeSkill
- execution-reportSkill
- extract-sharedSkill
- firecrawlSkill
- frontend-designSkill
- frontend-patternsSkill
- golang-patternsSkill
- golang-testingSkill
- implement-fixSkill
- init-projectSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- iterative-retrievalSkill
- lazySkill
- learnSkill
- orchestrateSkill
- perf-profileSkill
- plan-eccSkill
- plan-featureSkill
- postgres-patternsSkill
- primeSkill
- project-guidelines-exampleSkill
- projectSkill
- prompt-auditSkill
- python-patternsSkill
- python-testingSkill
- rcaSkill
- refactor-cleanSkill
- releaseSkill
- security-reviewSkill
- seo-kitSkill
- set-working-dirSkill
- skill-createSkill
- strategic-compactSkill
- supadataSkill
- system-reviewSkill
- tddSkill
- tdd-workflowSkill
- test-coverageSkill
- testSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Security Scan: Check for SQL injection, command injection, unsafe deserialization
- Distinctive: line 16
Pythonic Code Check: Verify code follows PEP 8 and Python best practices
- Distinctive: line 22
After writing or modifying Python code
- Distinctive: line 23
Before committing Python changes
- Distinctive: line 42
Not using context managers for resources
- Distinctive: line 53
Not using f-strings for formatting
- Very specific: line 175
Use /python-test first to ensure tests pass
- Very specific: line 176
Use /code-review for non-Python specific concerns
- Very specific: line 177
Use /python-review before committing
- Very specific: line 178
Use /build-fix if static analysis tools fail
- Very specific: line 298
Ensure your project's pyproject.toml or setup.py specifies the correct minimum Python version.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Python Code Review
This command invokes the python-reviewer agent for comprehensive Python-specific code review.
What This Command Does
- Identify Python Changes: Find modified
.pyfiles viagit diff - Run Static Analysis: Execute
ruff,mypy,pylint,black --check - Security Scan: Check for SQL injection, command injection, unsafe deserialization
- Type Safety Review: Analyze type hints and mypy errors
- Pythonic Code Check: Verify code follows PEP 8 and Python best practices
- Generate Report: Categorize issues by severity
When to Use
Use /python-review when:
- After writing or modifying Python code
- Before committing Python changes
- Reviewing pull requests with Python code
- Onboarding to a new Python codebase
- Learning Pythonic patterns and idioms
Review Categories
CRITICAL (Must Fix)
- SQL/Command injection vulnerabilities
- Unsafe eval/exec usage
- Pickle unsafe deserialization
- Hardcoded credentials
- YAML unsafe load
- Bare except clauses hiding errors
HIGH (Should Fix)
- Missing type hints on public functions
- Mutable default arguments
- Swallowing exceptions silently
- Not using context managers for resources
- C-style looping instead of comprehensions
- Using type() instead of isinstance()
- Race conditions without locks
MEDIUM (Consider)
- PEP 8 formatting violations
- Missing docstrings on public functions
- Print statements instead of logging
- Inefficient string operations
- Magic numbers without named constants
- Not using f-strings for formatting
- Unnecessary list creation
Automated Checks Run
# Type checking
mypy .
# Linting and formatting
ruff check .
black --check .
isort --check-only .
# Security scanning
bandit -r .
# Dependency audit
pip-audit
safety check
# Testing
pytest --cov=app --cov-report=term-missingExample Usage
User: /python-review
Agent:
# Python Code Review Report
## Files Reviewed
- app/routes/user.py (modified)
- app/services/auth.py (modified)
## Static Analysis Results
- ruff: No issues
- mypy: No errors
- black: 2 files need reformatting
- bandit: No security issues
## Issues Found
[CRITICAL] SQL Injection vulnerability
File: app/routes/user.py:42
Issue: User input directly interpolated into SQL query
```python
query = f"SELECT * FROM users WHERE id = {user_id}" # BadFix: Use parameterized query
query = "SELECT * FROM users WHERE id = %s" # Good
cursor.execute(query, (user_id,))[HIGH] Mutable default argument File: app/services/auth.py:18 Issue: Mutable default argument causes shared state
def process_items(items=[]): # Bad
items.append("new")
return itemsFix: Use None as default
def process_items(items=None): # Good
if items is None:
items = []
items.append("new")
return items[MEDIUM] Missing type hints File: app/services/auth.py:25 Issue: Public function without type annotations
def get_user(user_id): # Bad
return db.find(user_id)Fix: Add type hints
def get_user(user_id: str) -> Optional[User]: # Good
return db.find(user_id)[MEDIUM] Not using context manager File: app/routes/user.py:55 Issue: File not closed on exception
f = open("config.json") # Bad
data = f.read()
f.close()Fix: Use context manager
with open("config.json") as f: # Good
data = f.read()Summary
- CRITICAL: 1
- HIGH: 1
- MEDIUM: 2
Recommendation: Block merge until CRITICAL issue is fixed
Formatting Required
Run: black app/routes/user.py app/services/auth.py
## Approval Criteria
| Status | Condition |
|--------|-----------|
| Approve | No CRITICAL or HIGH issues |
| Warning | Only MEDIUM issues (merge with caution) |
| Block | CRITICAL or HIGH issues found |
## Integration with Other Commands
- Use `/python-test` first to ensure tests pass
- Use `/code-review` for non-Python specific concerns
- Use `/python-review` before committing
- Use `/build-fix` if static analysis tools fail
## Framework-Specific Reviews
### Django Projects
The reviewer checks for:
- N+1 query issues (use `select_related` and `prefetch_related`)
- Missing migrations for model changes
- Raw SQL usage when ORM could work
- Missing `transaction.atomic()` for multi-step operations
### FastAPI Projects
The reviewer checks for:
- CORS misconfiguration
- Pydantic models for request validation
- Response models correctness
- Proper async/await usage
- Dependency injection patterns
### Flask Projects
The reviewer checks for:
- Context management (app context, request context)
- Proper error handling
- Blueprint organization
- Configuration management
## Related
- Agent: `agents/python-reviewer.md`
- Skills: `skills/python-patterns/`, `skills/python-testing/`
## Common Fixes
### Add Type Hints
```python
# Before
def calculate(x, y):
return x + y
# After
from typing import Union
def calculate(x: Union[int, float], y: Union[int, float]) -> Union[int, float]:
return x + yUse Context Managers
# Before
f = open("file.txt")
data = f.read()
f.close()
# After
with open("file.txt") as f:
data = f.read()Use List Comprehensions
# Before
result = []
for item in items:
if item.active:
result.append(item.name)
# After
result = [item.name for item in items if item.active]Fix Mutable Defaults
# Before
def append(value, items=[]):
items.append(value)
return items
# After
def append(value, items=None):
if items is None:
items = []
items.append(value)
return itemsUse f-strings (Python 3.6+)
# Before
name = "Alice"
greeting = "Hello, " + name + "!"
greeting2 = "Hello, {}".format(name)
# After
greeting = f"Hello, {name}!"Fix String Concatenation in Loops
# Before
result = ""
for item in items:
result += str(item)
# After
result = "".join(str(item) for item in items)Python Version Compatibility
The reviewer notes when code uses features from newer Python versions:
| Feature | Minimum Python | |
| Type hints | 3.5+ | |
| f-strings | 3.6+ | |
Walrus operator (:=) | 3.8+ | |
| Position-only parameters | 3.8+ | |
| Match statements | 3.10+ | |
| Type unions (`x | None`) | 3.10+ |
Ensure your project's pyproject.toml or setup.py specifies the correct minimum Python version.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

