What problem does it solve? FastAPI codebases accumulate subtle defects that pass review and fail in production: blocking calls inside async handlers that stall every request, response models that silently drop subclass fields or leak secrets, tests that patch dependencies without effect, and lifespan state that never initializes under a bare TestClient. This Skill encodes the verified rules, workflows, and edge cases for building and reviewing FastAPI services correctly against FastAPI 0.141, Pydantic 2.13, and Starlette 1.6. ## Core Features & Use Cases - 25 core rules with enforcement gates: Annotated dependency declarations, async def versus def selection, the 40-slot threadpool limit, structural secret filtering, Starlette-level exception handlers, and the FAST ruff lint group. - Four guided workflows: add-or-change-an-endpoint, fix-a-slow-or-stalling-endpoint, write-or-fix-tests, and migrate-legacy-fastapi-code, each ending in a verifiable gate. - Seven in-depth references: dependency injection, Pydantic models at the HTTP boundary, responses and error contracts, async and lifecycle, streaming and SSE, testing with dependency_overrides and ASGITransport, and project tooling. - Use Case: A reports API degrades from 40ms to 9 seconds under load and loses background jobs on redeploy. The Skill identifies blocking calls inside async handlers, moves multi-minute work from BackgroundTasks to a queue with a 202 job id, and replaces deprecated on_event hooks with a lifespan context manager. ## Quick Start Ask the agent to review your FastAPI router or endpoint file for correctness, performance, and testing issues using the fastapi skill.