/fastapi:fastapifrom fastapi
Bounded changes to existing FastAPI apps covering lifespan, Depends providers, Pydantic request and response models, async handler boundaries, auth dependencies, service transactions, and TestClient or dependency_overrides tests. Use when a task touches `from fastapi import` code, routers, dependencies, or FastAPI tests.
Ships in fastapi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Preserve the application factory, router registration, dependency graph, and wire contract unless the request changes them. Don't add a package, compatibility layer, global service registry, or background task just to make a change look complete.
Related skills, each used if installed:
python for typing, resource lifetimes, and asyncio mechanics.app-auth for auth policy: token formats, permission models, cookies/CSRF, and cryptography.api-rest-design for resource and status-code design.db-schema-design and postgres for ORM choice, schemas, and constraints.app instance, affected routers and routes, the Depends providers and their consumers, the Pydantic models, the service layer, and the nearest tests.uv pip show fastapi pydantic or the lockfile). Pydantic v1 and v2 APIs differ. Look up version-sensitive APIs with Context7 (resolve-library-id for "fastapi" or "pydantic", then query-docs).lifespan context manager. Acquire before yield, release after.Base.metadata.create_all) in lifespan or at import time. Startup DDL races concurrent deploys and bypasses migrations, so schema changes go through the repo's migration tool. Don't add network calls or unrelated work there either without an existing requirement.Depends. Don't construct them ad hoc in handlers.app.dependency_overrides is keyed by the original callable. Reuse the canonical provider function so overrides work, and don't wrap it in a lambda or new function at the use site.Annotated alias, such as DbDep = Annotated[AsyncSession, Depends(get_db)] or CurrentUserDep. It is plain type-alias syntax, keeps editor and type-checker support, and still wraps the canonical provider, so dependency_overrides keeps working. Follow the repo's existing alias names.yield dependency owns cleanup around its yield. Keep its commit, rollback, and close behavior there, not duplicated in handlers.response_model.model_dump(exclude_unset=True); v1 uses .dict(exclude_unset=True).ORDER BY with a unique tiebreaker (for example created_at, id). Without one the database may return rows in a different order per page, so pages skip or repeat rows (PostgreSQL documents this for LIMIT).async def only when the handler awaits async collaborators. A sync def handler runs in a threadpool, so blocking I/O there is safe. Blocking I/O inside async def stalls the whole event loop.BackgroundTasks runs after the response with no error channel back to the client, so use it only when that is acceptable.WWW-Authenticate headers consistent with existing policy.sub claim is a string (RFC 7519). Convert it to the key type at the dependency and treat a failed conversion like any other invalid token (401). FastAPI's current JWT tutorial uses PyJWT, with pwdlib (Argon2) for password hashing. Keep the repo's library unless app-auth, if installed, says to change it.app.dependency_overrides[provider] = fake, and clear it in fixture teardown so no test leaks it.with TestClient(app) as client: runs lifespan. A bare TestClient(app) does not.httpx.AsyncClient(transport=ASGITransport(app=app)) does not run lifespan. Test a seam that doesn't need it, or use the repo's existing lifespan arrangement. Don't add a package just for this.unit-testing, if installed, to pick the smallest meaningful set of cases (success, validation, 401/403, conflict, cleanup).app.openapi() or /openapi.json for the affected path.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin fastapi