serverless — скилл для Claude Code: правила для микросервисов
Скилл задаёт агенту правила разработки на FastAPI в микросервисах и serverless-среде: AWS Lambda, Azure Functions, API-шлюзы.
npx skills add Mindrally/skills --skill serverless -a claude-codeЧто делает serverless
Скилл описывает, как агенту проектировать сервисы: держать их без состояния, выносить состояние во внешнее хранилище и кеши вроде Redis, ставить перед сервисами шлюзы и обратные прокси, добавлять circuit breaker и повторные попытки для вызовов между сервисами. Фоновые задачи уходят в Celery или RQ.
Отдельные блоки — про безопасность и наблюдаемость: middleware для логирования и трассировки, OpenTelemetry, OAuth2, ограничение частоты запросов, заголовки CORS и CSP, секреты через AWS Secrets Manager или Azure Key Vault. Для производительности скилл советует асинхронные возможности FastAPI, пул соединений с базой, кеширующий слой и уменьшение размера пакета функции, чтобы холодный старт был короче. Тестирование расписано по уровням: модульные тесты, интеграционные, контрактные, локальный прогон через SAM Local или LocalStack.
Скилл ничего не запускает сам — это набор указаний, которые агент читает при работе с кодом. Если в проекте нет Python и FastAPI, применять его не к чему: примеры и рекомендации завязаны на этот стек.
Какие задачи решает
- разложить монолит на сервисы с чёткими границами API
- убрать состояние из функций, чтобы они переживали перезапуск
- настроить шлюз с ограничением частоты запросов и фильтрацией
- сократить холодный старт функции за счёт размера пакета
- добавить распределённую трассировку и структурные логи
Примеры запросов агенту
- Спроектируй сервис на FastAPI для AWS Lambda, состояние вынеси в Redis
- Добавь circuit breaker и повторные попытки для вызовов между сервисами
- Настрой middleware для трассировки через OpenTelemetry и заголовки CORS
Как установить serverless
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a claude-code2Вручную: положить файлы
~/.claude/skills/serverless/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/serverless/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a codex2Вручную: положить файлы
.agents/skills/serverless/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a cursor2Вручную: положить файлы
.cursor/skills/serverless/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills serverless2Вручную: положить файлы
.github/skills/serverless/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path serverlessВручную: положить файлы
.devin/skills/serverless/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill serverless -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о serverless
Как установить serverless в Claude?
Выполните npx skills add Mindrally/skills --skill serverless -a claude-code. Файл скилла окажется по пути ~/.claude/skills/serverless/SKILL.md.
Что делает скилл serverless?
Даёт агенту правила разработки микросервисов и serverless-приложений: FastAPI, API-шлюзы, асинхронные воркеры, кеширование, трассировка и тестирование.
Для каких платформ подходит скилл?
Установка описана для Claude, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Внутри речь идёт о Python, FastAPI, AWS Lambda и Azure Functions.
Исходный текст
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