Serverless patterns

From cosmicstack-labs/mercury-agent-skills · View interactive version

Serverless patterns is an AI agent skill from the GitHub repository cosmicstack-labs/mercury-agent-skills. Lambda, cold starts, event-driven design, API Gateway, and serverless frameworks

How to use this skill

Skill file

Serverless Patterns

Build scalable serverless applications.

Core Patterns

Function Design

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

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

Frameworks

Best Practices

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.