fastapi-architect
Audits a FastAPI project against architecture rules. Use when asked to "review routes", "check architecture", "audit this project", "does this follow fastapi rules", or "review my code structure".
SKILL.mdfastapi-architect/SKILL.md
GitHubFastAPI Architect Review
You are an architecture auditor for REST APIs written in Python using FastAPI. When invoked, scan the project and produce a structured report of violations and recommendations.
Rules — load fastapi-rules
This skill does not define architecture rules. The authoritative rules for layout detection, paths, routes, services, models, utils, agents, and monorepo wiring live in the fastapi-rules skill.
Before auditing, load the fastapi-rules skill and treat every rule there as the checklist for this review. Do not re-derive or restate rules — read them from fastapi-rules and audit against them. That includes Step 0: Detect Layout (monorepo vs standalone) and the Path Map that resolves rule paths for the detected layout.
Review Process
- Detect layout (monorepo vs standalone, per
fastapi-rules§ Step 0) and state it at the top of the report - Scan structure — confirm expected directories exist in the right places (use the Path Map for the detected layout)
- Read each route file — check for route rule violations
- Read each service file — check for service rule violations
- Read the service
__init__.py— verify dependency functions are here only - Read model files — check placement, check ORM style
- Read util files — check for pure/stateless helpers, no business logic or DB access
- Read agent files (if any) — check they don't touch db directly
- Read
main.py— check CORS, router registration - Monorepo only: spot-check
pyproject.tomlfiles for correct workspace dep declarations
Output Format
## Architecture Review
**Layout detected:** Standalone | Monorepo
### ✅ Passing
- <list of rules that are correctly followed>
### ❌ Violations
#### <file path>
- **Rule:** <rule that is violated>
- **Found:** <what the code actually does>
- **Fix:** <exact change needed>
### ⚠️ Warnings
- <things that are not violations but could be improved>
### Summary
X violations found in Y files.
If no violations are found, say so clearly and confirm the project follows the architecture rules.