Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Read from this skill's files on GitHub on 2026-11-09. These are facts about the files, not a review of how well the skill works.
Files
2 files, 0 scripts, SKILL.md is 446 words
Needs on your machine
Python
Web addresses in its scripts
No URLs in its scripts
Worth a look before running
No sudo, rm -rf, curl | sh or shell=True in its scripts
Agent Skills spec
name and description present, name matches the folder
Last upstream change
2026-10-15
We ran this skill ourselves. Here is what went in and what came out.
Field noteRan on 2026-11-22
Claude Code 2.1.329, claude-opus-5-5, headless, 118s. Claude picked the skill on its own from a plain prompt. How we test skills
Terminal log of the run, rendered from Claude Code's stream-json output. Long steps are trimmed.
Input
Empty folder. Prompt: a FastAPI notes service (create, list, get by id) with async SQLite, dependency injection and error handling, using uv, with pytest tests that run.
Output
src/notes_service with config, database, models, schemas, repository, service and api layers, a 404 handler and a generic 500, /health. 12 tests. uv run pytest: 12 passed (re-checked).
What happened
It started the real server too and found that SQLite dropped the timezone on created_at, then added a UTC column type and a test for it. No migrations; it said to add Alembic before real data.
Use it when
A new small FastAPI service where you want the layered structure from the start.
Skip it when
A one-file prototype. The layers are more structure than a toy needs.
If you are starting a Python API. It scaffolds a project. Do not point it at an existing Django app.
FastAPI Project Templates
Production-ready FastAPI project structures with async patterns, dependency injection, middleware, and best practices for building high-performance APIs.
When to Use This Skill
Starting new FastAPI projects from scratch
Implementing async REST APIs with Python
Building high-performance web services and microservices
Creating async applications with PostgreSQL, MongoDB
Setting up API projects with proper structure and testing
# requirements.txtfastapiuvicorn[standard]pydantic-settingssqlalchemy[asyncio]>=2.0 # DeclarativeBase; [asyncio] installs greenlet for the async engineasyncpg # PostgreSQL driver: postgresql+asyncpg://...PyJWTpwdlib[argon2]python-multipart # only for a login route that uses OAuth2PasswordRequestForm# requirements-dev.txtpytestpytest-asynciohttpxaiosqlite # test database: sqlite+aiosqlite:///:memory:
Detailed worked examples and patterns
Detailed sections (starting with ## Implementation Patterns) live in references/details.md. Read that file when the navigation summary above is insufficient.