Build High-Performance FastAPI APIs
A FastAPI expert skill for async-first, production-ready microservices covering data, auth, testing, and deployment.
Why it matters
Develop robust, scalable, and production-ready microservices using FastAPI. Leverage modern Python patterns for high-concurrency, async-first API development.
Outcomes
What it gets done
Implement async-first FastAPI endpoints with Pydantic V2 validation.
Integrate databases (SQLAlchemy, MongoDB) and caching (Redis).
Secure APIs with OAuth2, JWT, and RBAC.
Write comprehensive tests and optimize for performance.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-fastapi-pro | bash Overview
Fastapi Pro
A FastAPI expert skill for async-first, production-ready microservices covering data access, authentication, testing, performance, and deployment. Use it for FastAPI-specific microservice development, not for tasks unrelated to FastAPI or a different backend framework.
What it does
This is a FastAPI expert skill specializing in high-performance, async-first API development with modern Python patterns, focused on production-ready microservices and scalable architectures. Core coverage spans FastAPI 0.100+ features (Annotated types, modern dependency injection), Pydantic V2 validation and serialization, automatic OpenAPI/Swagger docs, WebSockets, background tasks, and streaming responses. Data management covers SQLAlchemy 2.0+ with async drivers (asyncpg, aiomysql), Alembic migrations, the repository/unit-of-work pattern, MongoDB via Motor/Beanie, and Redis for caching. API design covers RESTful principles, GraphQL integration via Strawberry or Graphene, microservices patterns, API versioning, rate limiting, circuit breakers, and CQRS/event sourcing.
When to use - and when NOT to
Use this skill when building FastAPI microservices, authentication systems, WebSocket real-time features, or performance-critical API endpoints. Authentication and security cover OAuth2 with JWT (python-jose, pyjwt), social auth, API keys, RBAC, and SQL-injection-safe input sanitization. Testing covers pytest/pytest-asyncio, TestClient integration tests, factory_boy/Faker for test data, and Locust for performance testing. Performance work covers connection pooling, Redis/Memcached response caching, cursor-based pagination, and response compression. It is not the right skill for tasks unrelated to FastAPI or a different backend framework entirely.
Inputs and outputs
Input is a FastAPI development task - a new microservice, an endpoint needing optimization, an auth flow, or a deployment target; output follows an eight-step response approach: analyze requirements for async opportunities, design API contracts with Pydantic models first, implement endpoints with proper error handling, add comprehensive Pydantic validation, write async tests covering edge cases, optimize with caching and pooling, document with OpenAPI annotations, and plan deployment and scaling. Deployment output covers Docker multi-stage builds, Kubernetes with Helm, GitHub Actions/GitLab CI pipelines, Pydantic Settings for environment config, and Uvicorn/Gunicorn or Hypercorn/Daphne ASGI server tuning. Observability output covers structured logging (loguru/structlog), OpenTelemetry tracing, Prometheus metrics, and APM integration (DataDog, New Relic, Sentry).
Who it's for
Python developers building high-performance, async-first FastAPI microservices who want production-ready patterns for data access, authentication, testing, performance, and deployment applied consistently rather than assembled ad hoc per project. Integration coverage rounds this out with message queues (RabbitMQ, Kafka, Redis Pub/Sub), Celery/Dramatiq task queues, gRPC service calls, httpx for external API integration, and webhook handling, alongside advanced features like lifespan events for startup/shutdown and custom exception handlers for consistent error responses. Its behavioral defaults: write async-first code by default, emphasize type safety with Pydantic and type hints throughout, implement dependency injection for clean architecture, and follow 12-factor app principles for configuration and deployment.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.