fastapi
SolidUse when building APIs with FastAPI. Covers dependency injection, Pydantic v2 validation, async database access, authentication, background tasks, and testing.
API & Backend 26 stars
3 forks Updated 3 weeks ago MIT
Install
Quality Score: 83/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# FastAPI
## Purpose
Build FastAPI services that use the framework's strengths — declarative validation and dependency injection — without falling into its two standard traps: blocking calls inside `async def`, and business logic in the route handler.
## When to Use
- Building or reviewing a FastAPI application.
- Structuring dependencies, authentication, and database sessions.
- Diagnosing latency that appears only under concurrency.
- Writing tests for FastAPI endpoints.
## Capabilities
- Route and router organization.
- Pydantic v2 models for request, response, and settings.
- Dependency injection with scoped lifecycles.
- Async SQLAlchemy sessions, correctly scoped per request.
- Authentication and authorization dependencies.
- Testing with `httpx.AsyncClient` and dependency overrides.
## Inputs
- The API contract and the data layer.
- Whether the workload is I/O-bound (nearly always) or CPU-bound.
## Outputs
- Thin route handlers delegating to service functions.
- Response models that control exactly what is serialized.
- A test suite that overrides dependencies rather than mocking internals.
## Workflow
1. **Define the schemas** — Separate request, response, and internal models. Never return an ORM object directly; a `response_model` is your defense against leaking a password hash.
2. **Build the dependencies** — Database session, current user, feature flags. These are the injection points that make the app testable.
3. **Keep handlers thin** — Parse, author...
Details
- Author
- nimadorostkar
- Repository
- nimadorostkar/Claude-Skills-collection
- Created
- 1 months ago
- Last Updated
- 3 weeks ago
- Language
- Python
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
API & Backend Listed
fastapi-patterns
FastAPI patterns for async APIs, dependency injection, Pydantic request and response models, OpenAPI docs, tests, security, and production readiness.
0 Updated yesterday
TeiNam Code & Development Listed
fastapi
FastAPI mastery skill. Covers Pydantic models, DI, async DB access, background tasks, WebSocket, testing. Triggers on: /godmode:fastapi, "fastapi", "pydantic", "async api", "python api".
26 Updated 1 weeks ago
arbazkhan971 AI & Automation Listed
fastapi-patterns
FastAPI application patterns — routing, Pydantic v2, dependency injection, error handling, async DB sessions, middleware.
1 Updated yesterday
jjackkun