From aj-geddes-useful-ai-prompts-4
Build high-performance FastAPI applications with async/await, Pydantic validation, dependency injection, JWT security, and OpenAPI docs. Use for modern Python REST APIs with automatic documentation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:fastapi-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
references/api-routes-with-async-endpoints.mdreferences/async-database-models-and-queries.mdreferences/fastapi-application-setup.mdreferences/pydantic-models-for-validation.mdreferences/security-and-jwt-authentication.mdreferences/service-layer-for-business-logic.mdscripts/validate-api.shtemplates/api-scaffold.yamlCreate fast, modern Python APIs using FastAPI with async/await support, automatic API documentation, type validation using Pydantic, dependency injection, JWT authentication, and SQLAlchemy ORM integration.
Minimal working example:
# main.py
from fastapi import FastAPI, HTTPException, status
from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager
import logging
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Create FastAPI instance
app = FastAPI(
title="API Service",
description="A modern FastAPI application",
version="1.0.0",
docs_url="/api/docs",
openapi_url="/api/openapi.json"
)
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:3000"],
allow_credentials=True,
allow_methods=["*"],
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| FastAPI Application Setup | FastAPI Application Setup |
| Pydantic Models for Validation | Pydantic Models for Validation |
| Async Database Models and Queries | Async Database Models and Queries |
| Security and JWT Authentication | Security and JWT Authentication |
| Service Layer for Business Logic | Service Layer for Business Logic |
| API Routes with Async Endpoints | API Routes with Async Endpoints |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Builds high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Covers microservices, WebSockets, authentication, testing, and async optimization patterns.
<!-- AUTO-GENERATED by export-plugins.py — DO NOT EDIT -->
Builds high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Covers microservices, WebSockets, and modern async patterns.