Performs structured code reviews on Python and FastAPI codebases covering correctness, async safety, security, Pydantic v2 patterns, testing, and style.
62
72%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./skills/code-review-python/SKILL.mdWhen asked to review code — a file, a function, a PR diff, or a module — follow this checklist systematically. Always provide specific, actionable feedback with line references and concrete improvement suggestions. Never give vague praise or criticism.
Before writing any comment:
Check for bugs, edge-cases, and incorrect assumptions.
except: or except Exception: clauses swallowing errors silently?await calls present where required? Is there any blocking I/O (e.g., time.sleep, synchronous DB calls) in an async context?Example annotation style:
# ❌ Bug: This will silently ignore ALL exceptions, masking real failures.
try:
result = await some_call()
except Exception:
pass
# ✅ Fix: Log and re-raise, or handle specifically.
try:
result = await some_call()
except SpecificError as e:
logger.error("Failed during some_call: %s", e)
raiseallow_origins=["*"] is only used in local/dev environments; flag it with a # FIXME if it is not environment-gated.Depends(get_current_user)).model_config = ConfigDict(...) not class Config.@field_validator / @model_validator, not @validator / @root_validator.model_dump() / model_dump_json(), not .dict() / .json().BaseSettings from pydantic_settings (separate package) for env config.api/routers/), with a single responsibility (one logical domain per router).Depends() for shared logic (auth, DB sessions, config). Avoid instantiating dependencies inside route functions.response_model= on route decorators so the API contract is explicit and documented.status_code= (e.g., status_code=201 for creation, status_code=204 for deletion).HTTPException with appropriate status codes. Never return 500 for client errors.@app.on_event (deprecated in FastAPI 0.93+).httpx, DB, MCP clients). Integration tests may use real services.test_<what>_<condition>_<expected_outcome> convention.def my_func(x: int) -> str:
"""One-line summary.
Args:
x: Description of x.
Returns:
Description of the return value.
Raises:
ValueError: If x is negative.
"""i) and cryptic abbreviations should be flagged.from foo import *).ruff, black). Flag obvious style deviations (long lines >120 chars, inconsistent quoting, etc.).logger.error("msg: %s", var) (lazy %-formatting), never f-strings in log calls (performance anti-pattern).# TODO and # FIXME comments must include context. Flag any that are vague or very old.When delivering a code review, structure your response as follows:
A 2–4 sentence overview: what does the code do, is it generally well-written, what is the most important concern?
Issues that must be fixed before merging: security vulnerabilities, data loss risks, correctness bugs, broken contracts. Number each item.
Things that are not blocking but meaningfully improve quality: design issues, missing tests, performance problems, unclear naming. Number each item.
Style, convention, and cleanup items that improve consistency but have minimal functional impact. Can be bulleted for brevity.
Call out what is done well. This is not optional — good feedback is balanced.
Use this as a mental checklist before finalizing any review:
c0b2e4b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.