Serverless Patterns

Lambda, cold starts, event-driven design, API Gateway, and serverless frameworks

492 stars 68 forksDevOps & Cloud

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add cosmicstack-labs/mercury-agent-skills --skill serverless-patterns
Manual install
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/backend/serverless-patterns ~/.claude/skills/serverless-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Serverless Patterns

Build scalable serverless applications.

## Core Patterns

### Function Design
- Single responsibility per function
- Stateless (use external storage for state)
- Idempotent handlers (retry-safe)
- Receive event, process, return/forward

### Cold Start Mitigation
| Strategy | Effect | Tradeoff |
|----------|--------|----------|
| Provisioned Concurrency | Zero cold starts | Cost |
| Smaller runtime (Node/Python) | Faster start | Language choice |
| Keep-alive ping | Reduce frequency | Extra cost |
| Lambda SnapStart (Java) | Fast restore | State constraints |
| Lambda@Edge | Regional distribution | 1MB response limit |

## Event-Driven Design

### Event Types
```yaml
Events:
  - UserRegistered { userId, email, timestamp }
  - OrderPlaced { orderId, items, total }
  - PaymentProcessed { orderId, amount, status }
  - EmailSent { to, template, variables }
```

### SQS + Lambda Pattern
```
API Gateway → Lambda (producer) → SQS → Lambda (consumer) → DynamoDB
```
Benefits: decoupling, buffering, retry, dead-letter queue.

## API Gateway Patterns
- Request validation at gateway level
- Caching for GET endpoints (TTL per route)
- WAF for rate limiting and IP blocks
- Custom domain with ACM certificate
- Usage plans for API keys

## Frameworks
- **SAM** (AWS) — YAML/YML, local testing
- **Serverless Framework** — Multi-cloud, plugins
- **CDK** (AWS) — Full programming languages
- **Terraform** — If already using for other infra
Read the full skill on GitHub

Details

Skill name
serverless-patterns
Path
categories/backend/serverless-patterns/SKILL.md
License
MIT
Repo updated
25 August 2026

FAQ

What does the Serverless Patterns skill do?

Lambda, cold starts, event-driven design, API Gateway, and serverless frameworks

How do I install the Serverless Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill serverless-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Serverless Patterns popular?

It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.

Related skills

Browse the most popular Claude skills, all devops & cloud skills, or write your own with the skills generator.