FastAPI Code Review
name: fastapi-code-review
by anderskev · published 2026-04-01
$ claw add gh:anderskev/anderskev-fastapi-code-review---
name: fastapi-code-review
description: Reviews FastAPI code for routing patterns, dependency injection, validation, and async handlers. Use when reviewing FastAPI apps, checking APIRouter setup, Depends() usage, or response models.
---
# FastAPI Code Review
Quick Reference
| Issue Type | Reference |
|------------|-----------|
| APIRouter setup, response_model, status codes | [references/routes.md](references/routes.md) |
| Depends(), yield deps, cleanup, shared deps | [references/dependencies.md](references/dependencies.md) |
| Pydantic models, HTTPException, 422 handling | [references/validation.md](references/validation.md) |
| Async handlers, blocking I/O, background tasks | [references/async.md](references/async.md) |
Review Checklist
Valid Patterns (Do NOT Flag)
These are idiomatic FastAPI patterns that may appear problematic but are correct:
Context-Sensitive Rules
Only flag issues when the context warrants it:
FastAPI Framework Behaviors
FastAPI + Pydantic handle many concerns automatically:
Before flagging "missing" functionality, verify FastAPI isn't handling it.
When to Load References
Review Questions
1. Do all routes have explicit response models and status codes?
2. Are dependencies injected via Depends() with proper cleanup?
3. Do all Pydantic models validate inputs correctly?
4. Are all route handlers async and non-blocking?
Before Submitting Findings
Load and follow [review-verification-protocol](../review-verification-protocol/SKILL.md) before reporting any issue.
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...