FastAPI App Architecture Review
When To Use
- The main decision is about FastAPI project structure, route organization, dependency injection, or async I/O boundaries.
- Reviewing Pydantic schema design, background task management, or startup/shutdown lifecycle.
Workflow
- Identify route organization — are routers grouped by domain or by CRUD?
- Review dependency injection usage — are dependencies scoped correctly (request, session, global)?
- Check Pydantic schema boundaries — are schemas used as API contracts or leaking into domain layers?
- Review async boundaries — are blocking I/O calls wrapped in proper thread pools?
- Check startup/shutdown lifecycle for clients, connection pools, and background tasks.
- Review error handling and validation at API boundaries.
- Recommend the smallest change that improves separation of concerns.
Output Format
FastAPI architecture review:
- Route organization:
- Dependency injection:
- Pydantic schema boundaries:
- Async I/O boundaries:
- Lifecycle management:
- Error handling:
- Recommended change:
- Verification:
Source: WangYao-GoGoGo/architecture-agent-skills — distributed by TomeVault.