serverless — Claude Code skill: microservices and FastAPI rules
A skill that gives the agent rules for FastAPI services in serverless and microservice setups: AWS Lambda, Azure Functions, API gateways.
npx skills add Mindrally/skills --skill serverless -a claude-codeWhat serverless does
The skill tells the agent how to shape services: keep them stateless, push state into external storage and caches such as Redis, put gateways and reverse proxies in front of them, add circuit breakers and retries for service-to-service calls. Background work goes to Celery or RQ.
Security and observability get their own sections: middleware for logging and tracing, OpenTelemetry, OAuth2, rate limiting, CORS and CSP headers, secrets through AWS Secrets Manager or Azure Key Vault. On performance it advises FastAPI's async path, connection pooling, a caching layer, and smaller function packages so cold starts stay short. Testing is split by level: unit, integration, contract, plus local runs with SAM Local or LocalStack.
The skill runs nothing on its own. It is a set of instructions the agent reads while working on code. Without Python and FastAPI in the project there is little to apply, because the examples and advice are tied to that stack.
What it helps with
- split a monolith into services with clear API boundaries
- move state out of functions so they survive a restart
- set up a gateway with rate limiting and request filtering
- shrink function package size to cut cold start time
- add distributed tracing and structured logging
Example prompts for the agent
- Design a FastAPI service for AWS Lambda and keep state in Redis
- Add a circuit breaker and retries for calls between services
- Set up middleware for OpenTelemetry tracing and CORS headers
How to install serverless
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a claude-code2Manually: put the files in place
~/.claude/skills/serverless/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/serverless/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a codex2Manually: put the files in place
.agents/skills/serverless/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a cursor2Manually: put the files in place
.cursor/skills/serverless/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills serverless2Manually: put the files in place
.github/skills/serverless/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path serverlessManually: put the files in place
.devin/skills/serverless/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about serverless
How do I install the serverless skill in Claude?
Run npx skills add Mindrally/skills --skill serverless -a claude-code. The skill file lands at ~/.claude/skills/serverless/SKILL.md.
What does the serverless skill do?
It gives the agent guidelines for microservices and serverless apps: FastAPI, API gateways, async workers, caching, tracing and testing.
Which platforms can use this skill?
Install steps are given for Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. The content itself covers Python, FastAPI, AWS Lambda and Azure Functions.
Source text
SKILL.md · Apache-2.0
--- name: serverless description: Serverless and microservices development guidelines covering FastAPI, cloud-native patterns, API gateways, and best practices for scalable serverless architectures. metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Serverless and Microservices Development You are an expert in Python, FastAPI, microservices architecture, and serverless environments including AWS Lambda, Azure Functions, and cloud-native patterns. ## Core Principles - Design services to be stateless; leverage external storage and caches (e.g., Redis) for maintaining state - Implement API gateways and reverse proxies like NGINX or Traefik for traffic management - Apply circuit breakers and retries for dependable service-to-service communication - Favor serverless deployment for reduced infrastructure overhead in scalable environments - Use asynchronous workers such as Celery or RQ for background tasks ## Microservices and API Integration - Integrate FastAPI with Kong or AWS API Gateway - Leverage gateways for rate limiting, request transformation, and security filtering - Maintain clear API separation aligned with microservices design - Employ message brokers like RabbitMQ or Kafka for event-driven systems - Design APIs with clear boundaries and contracts ## Serverless and Cloud-Native Patterns - Optimize FastAPI for AWS Lambda and Azure Functions by minimizing cold starts - Package applications as lightweight containers or standalone binaries - Use managed databases (DynamoDB, Cosmos DB, Aurora Serverless) - Implement automatic scaling for variable workloads - Design for idempotency to handle retries safely ## Security and Middleware - Create custom middleware for logging, tracing, and request monitoring - Integrate OpenTelemetry for distributed tracing - Apply OAuth2 for authentication - Implement rate limiting and DDoS protection measures - Enforce security headers (CORS, CSP) and content validation - Use secrets management (AWS Secrets Manager, Azure Key Vault) ## Performance Optimization - Leverage FastAPI's async capabilities for concurrent connections - Optimize for high throughput using read-optimized databases - Deploy caching layers (Redis, Memcached, CDN for static content) - Use load balancing and service mesh technologies like Istio - Minimize function package size for faster cold starts - Implement connection pooling for database connections ## Monitoring and Observability - Monitor with Prometheus and Grafana - Implement structured logging practices - Integrate centralized logging systems (ELK Stack, CloudWatch, Azure Monitor) - Set up alerting for critical metrics - Implement distributed tracing across services ## Architecture Best Practices - Follow the single responsibility principle for functions/services - Use infrastructure as code (Terraform, CloudFormation, Pulumi) - Implement proper error handling and dead letter queues - Design for failure with graceful degradation - Use event sourcing and CQRS patterns where appropriate - Implement health checks and readiness probes ## Testing Strategies - Write unit tests for individual functions - Implement integration tests for service interactions - Use contract testing for API boundaries - Test locally with tools like SAM Local or LocalStack - Implement load testing for performance validation
© Mindrally · Apache-2.0 · Mindrally/skills