What problem does it solve?
This Skill helps you avoid common pitfalls and build reliable, secure, production-grade async REST APIs with FastAPI by enforcing modern FastAPI, Pydantic v2, and SQLAlchemy async best practices.
Core Features & Use Cases
- Production-grade FastAPI architecture: Enforces an async-first design using lifespan instead of deprecated startup hooks.
- Correct Pydantic v2 schema patterns: Uses ConfigDict, field/model validators, and model_dump/model_dump_json idioms to keep schemas consistent.
- Async SQLAlchemy 2.0 patterns: Provides guidance for async engine/session lifecycle, mapped_column/relationships, and safe CRUD handling without lazy-loading surprises.
- API reliability & interoperability: Standardizes RFC 9457 Problem Details error responses, cursor pagination, and URI versioning from day one.
- Security-ready authentication: Recommends PyJWT (not python-jose), OAuth2 patterns, secure cookie refresh strategies, and role-based access control.
Quick Start
Use the fastapi-expert Skill when designing a new versioned FastAPI API and ask it to produce the router, schemas, auth dependency patterns, and RFC 9457 error handling skeleton.