What problem does it solve?
This Skill helps developers write clean, efficient, and up-to-date FastAPI code by enforcing best practices and leveraging the latest features.
Core Features & Use Cases
- Best Practices Enforcement: Guides users on modern FastAPI patterns like
Annotated for parameters and dependencies.
- CLI Usage: Demonstrates how to use the
fastapi CLI for development and production.
- Response Modeling: Emphasizes the importance of return types and
response_model for documentation, validation, and performance.
- Router Conventions: Recommends best practices for including routers and applying shared dependencies.
- Async/Sync Operations: Provides guidance on correctly using
async and def for path operations and dependencies.
- Streaming: Covers patterns for streaming JSON Lines, Server-Sent Events, and bytes.
- Tooling Integration: Mentions helpful tools like
uv, Ruff, and ty.
- Library Recommendations: Suggests
Asyncer, SQLModel, and HTTPX for enhanced development.
Quick Start
Use the fastapi skill to refactor the provided Python code to use Annotated for path parameters and dependencies.