What problem does it solve? FastAPI applications become hard to maintain as they grow: route handlers accumulate business logic, database access, and validation in one place, making testing and refactoring risky. This Skill provides architecture guidance to keep handlers thin, boundaries explicit, and business logic testable. ## Core Features & Use Cases - Layered Boundaries: Defines clear responsibilities for main.py, APIRouter modules, Pydantic schemas, services, repositories, and dependency injection with Annotated types. - Refactor Guidance: Gives concrete rules for extracting services from fat handlers, centralizing settings with pydantic-settings, managing async database boundaries, and converting domain errors to HTTP responses at the API boundary. - Testing Patterns: Shows how to test services without HTTP and override dependencies in tests instead of monkeypatching globals. - Use Case: When a router module mixes several domains and handlers contain business rules, use this Skill to plan a refactor that extracts an InvoiceService while preserving paths, status codes, and response shapes. ## Quick Start Ask the agent to review and refactor a FastAPI router module so handlers stay thin and business logic moves into a testable service layer.