/python:fastapifrom python
Use when testing, adding or changing anything in a FastAPI app: TestClient tests, an endpoint or router, request validation, a Pydantic schema, settings from the environment, an auth or API-key dependency, middleware. House rules for FastAPI.
Ships in python. 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.
Read when SKILL.md points to them.
Lean on automatic validation, serialization and OpenAPI rather than fighting them. When rules conflict, prefer in this order: app factory with lifespan; thin routes; Pydantic-typed inputs/outputs; Annotated dependencies; async def only for non-blocking I/O.
create_app()) with lifespan for engines, HTTP clients and pools, yielding a typed state; on_startup/on_shutdown are deprecated.BaseSettings class, never raw os.environ; cache the provider with @lru_cache.lifespan.Annotated[Type, Depends(...)] (aliases like SessionDep, UnitOfWorkDep), not = Depends(...) defaults, so signatures stay reusable and type-checkable.dependencies/), which is the composition root.Depends(scope="function") cleans up before the response is sent; the default scope="request" cleans up after. Pick function when the resource (e.g. a session) must be released before streaming/slow responses.app.dependency_overrides[...] and clear it afterwards.Blocking I/O inside async def starves every concurrent request and is the most common FastAPI performance bug. Use async def for async I/O; use plain def (FastAPI runs it in a threadpool) or asyncio.to_thread() for blocking or CPU-bound work.
APIRouters by feature. Annotate every parameter.response_model when the return type differs or to filter fields for security.{Action}{Entity}Request, {Entity}Response, {Entity}ListResponse, {Entity}QueryParams.ConfigDict(extra="forbid") on requests to reject unknown fields; from_attributes=True on responses built from ORM objects. Share fields via a base schema, and keep API schemas separate from domain models.Map domain/application exceptions to HTTP with exception handlers, using one format: RFC 9457 application/problem+json as the api-design skill defines it (override the default RequestValidationError handler too, since FastAPI's 422 body is not problem+json). Never expose tracebacks in production.
ORJSONResponse as default_response_class; uvloop + httptools for throughput.BaseHTTPMiddleware on hot paths (it is markedly slower).StreamingResponse for large payloads.--workers or Gunicorn with UvicornWorker), never a single one.Simple CRUD: modules by feature, as the python-development skill lays out: orders.py or orders/ holding that feature's routes.py, schemas.py and logic, plus main.py (the app factory), config.py and dependencies.py. Never routes/, services/, models/ or schemas/ folders that collect code by kind. With DDD/hexagonal (the domain-driven-design skill), FastAPI is the driving adapter only: each context's api/ holds its routes, schemas and dependencies.py, while domain/ and application/ never import FastAPI; the tree is in python-development's references/HEXAGONAL.md.
Test through httpx.AsyncClient(transport=ASGITransport(app=app)) and override dependencies with fakes to keep tests fast and isolated.
EventSourceResponse.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub giocaizzi/harness --plugin pythonOther plugins' skills for the same job
4 skills in this plugin
/python-developmentUse when you write or change Python (.py), pyproject.toml or a ruff config: a feature, fix, refactor or review, even a one-line bug fix, and even when conventions are not mentioned. House rules: typing, errors, uv, ruff, mypy --strict./python-testingUse when you write, fix, review or debug Python tests (test_*.py, conftest.py, pytest config), including flaky, slow or hanging tests, tests that sleep, mock, patch, hit the network or share fixtures. pytest, fakes, hypothesis./sqlalchemyUse when defining SQLAlchemy models, writing queries, managing sessions and transactions, loading relationships, adding a migration, or tuning performance, sync or async. SQLAlchemy 2.x ORM and Core.