Agent skill
python-code-review
Production-grade Python code review. Use when reviewing code, PRs, or analyzing code quality. Checks architecture, security, quality, testing, documentation, deployment, and consistency. Provides severity-rated issues with fix suggestions.
Install this agent skill to your Project
npx add-skill https://github.com/argythana/python-ml-skills/tree/main/code-review
SKILL.md
Python Code Review
Systematic code review with actionable feedback organized by severity.
Process
-
Gather context
bashgit diff --name-only main git diff main git log main..HEAD --oneline -
Run automated checks
bashruff check --output-format=json <files> vulture --min-confidence=80 <files> mypy <files> -
Apply review checklists - see references below
-
Generate report with issues and fix plan
Severity Levels
| Level | Definition | Action |
|---|---|---|
| Critical | Security flaws, data loss, breaking changes | Blocks merge |
| High | Resource leaks, wrong layer, N+1 queries | Fix before merge |
| Moderate | Missing tests, complexity >10, swallowed exceptions | Should address |
| Low | Style beyond linter, minor refactoring | Optional |
Review Categories
Apply these checklists to changed files:
-
Architecture - Layer violations, dependency direction, god classes
- See references/architecture.md
-
Security - Injection, secrets, path traversal, deserialization
- See references/security.md
-
Quality - Complexity, error handling, performance
- See references/quality.md
-
Testing - Coverage, assertions, isolation, fixtures
- See references/testing.md
-
Documentation - Docstrings, README accuracy
- See references/documentation.md
-
Deployment - Dockerfile, Helm, migrations
- See references/deployment.md
-
Consistency - Code-docs sync, signature matches
- See references/consistency.md
Output Format
# Code Review Report
**Status**: PASS | NEEDS_WORK | BLOCKED
## Issues
| Severity | Count |
|----------|-------|
| Critical | N |
### [Category]
- [severity] file:line - description
- Fix: specific suggestion
## Fix Plan
1. [Issue] - [Action]
Principles
- Be specific: "Add try/except at line 42" not "improve error handling"
- Verify first: Check functions exist before suggesting them
- Focus on changes: Don't refactor untouched code
- Provide working examples
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
eda
Exploratory Data Analysis for tabular data. Use when analyzing column distributions, checking data quality, examining class balance, detecting missing patterns, or generating summary statistics for datasets.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
Didn't find tool you were looking for?