Python Code Review
Testing & Qualitypython-code-reviewPython Code Review is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Reviews Python code for type safety, async patterns, error handling, and common mistakes. Use when reviewing .py files, checking type hints, async/await usage, or exception handling.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/development/python-code-review-existential-birds-beagle/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/python-code-review, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Python Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Missing/wrong type hints, Any usage | references/type-safety.md |
| Blocking calls in async, missing await | references/async-patterns.md |
| Bare except, missing context, logging | references/error-handling.md |
| Mutable defaults, print statements | references/common-mistakes.md |
Review Checklist
- Type hints on all function parameters and return types
- No
Anyunless necessary (with comment explaining why) - Proper
T | Nonesyntax (Python 3.10+) - No blocking calls (
time.sleep,requests) in async functions - Proper
awaiton all coroutines - No bare
except:clauses - Specific exception types with context
-
raise ... fromto preserve stack traces - No mutable default arguments
- Using
loggernotprint()for output - f-strings preferred over
.format()or%
When to Load References
- Reviewing function signatures → type-safety.md
- Reviewing
async deffunctions → async-patterns.md - Reviewing try/except blocks → error-handling.md
- General Python review → common-mistakes.md
Review Questions
- Are all function signatures fully typed?
- Are async functions truly non-blocking?
- Do exceptions include meaningful context?
- Are there any mutable default arguments?