Overview
Serverless architecture patterns using AWS Lambda, Cloudflare Workers, and Vercel Edge Functions. Event-driven design with cold start optimization.
Capabilities
- Lambda function deployment
- Cloudflare Workers with Wrangler
- Vercel Edge Functions
- API Gateway integration
- Step Functions orchestration
- Cold start optimization
- Event-driven patterns
When to Use
Trigger phrases:
"serverless"
"Serverless architecture — AWS Lambda, Cloudflare Workers, Vercel Edge"
API backends without servers
Event-driven processing
Scheduled tasks (cron)
Microservices at low cost
When NOT to Use
- Task is outside your authorization scope
- You need to implement controls (use implementing-* skills)
- Task is about analysis, not action (use analyzing-* skills)
- You don't have access to target systems
- Task requires compliance expertise (consult professionals)
- Task is about defense, not offense (use defensive skills)
Pseudo Code
The serverless workflow follows a standard pipeline pattern.
Core flow:
# serverless primary flow
input = prepare(raw_data)
result = process(input, config={architecture, cloudflare, cold, design, driven})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Lambda Function
def handler(event, context):
return {"statusCode": 200, "body": json.dumps({"message": "Hello!"})}
Cloudflare Worker
export default {
async fetch(request) {
return new Response("Hello from the edge!");
},
};
Common Patterns
- Keep functions small and focused
- Use provisioned concurrency for latency
- Connection pooling for DB access
- Idempotent handlers for retries
How to Use
- Define infrastructure as code (Terraform, CloudFormation, Pulumi)
- Review changes through PR process before applying
- Configure monitoring and alerting for critical paths
- Set up secrets management (Vault, AWS Secrets Manager, etc.)
- Document runbooks for deployment, rollback, and incident response
- Test disaster recovery procedures regularly
Red Flags
- Infrastructure changes without review: Unreviewed changes cause outages — use PRs for infra code
- No rollback strategy: Every deployment needs a tested rollback plan before it runs
- Secrets in configuration files: Secrets in YAML/JSON get committed to version control
- Missing monitoring and alerting: Without monitoring, outages go undetected until users report them
- No documentation for runbooks: Without runbooks, on-call engineers waste time re-discovering procedures
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "Manual deployments are fine" |
Manual deployments are error-prone and不可 repeatable. Automate. |
| "We do not need monitoring" |
Without monitoring, you are flying blind. Add observability from day one. |
| "Infrastructure as code is overkill" |
IaC enables reproducibility, version control, and disaster recovery. |
1---2name: serverless3description: Use when serverless architecture — AWS Lambda, Cloudflare Workers, Vercel4 Edge. Event-driven design, cold start optimization. Use when working with serverless.5domain: devops6author: oyi777license: Apache-2.08subdomain: devops9tags:10- aws11- ci-cd12- devops13- infrastructure14- serverless15version: 1.0.016category: devops17metadata:18 source: https://skillmd.com/skills/oyi77/serverless19---20212223## Overview2425Serverless architecture patterns using AWS Lambda, Cloudflare Workers, and Vercel Edge Functions. Event-driven design with cold start optimization.2627## Capabilities2829- Lambda function deployment30- Cloudflare Workers with Wrangler31- Vercel Edge Functions32- API Gateway integration33- Step Functions orchestration34- Cold start optimization35- Event-driven patterns3637## When to Use38**Trigger phrases:**39- "serverless"40- "Serverless architecture — AWS Lambda, Cloudflare Workers, Vercel Edge"414243- API backends without servers44- Event-driven processing45- Scheduled tasks (cron)46- Microservices at low cost4748## When NOT to Use4950- Task is outside your authorization scope51- You need to implement controls (use implementing-* skills)52- Task is about analysis, not action (use analyzing-* skills)53- You don't have access to target systems54- Task requires compliance expertise (consult professionals)55- Task is about defense, not offense (use defensive skills)565758## Pseudo Code5960The serverless workflow follows a standard pipeline pattern.6162Core flow:63```64# serverless primary flow65input = prepare(raw_data)66result = process(input, config={architecture, cloudflare, cold, design, driven})67validate(result)68deliver(result)69```7071Error handling:72```73on error:74 log(error_details)75 retry_with_backoff(max=3)76 if still_failing: alert_and_escalate()77```787980### Lambda Function81```python82def handler(event, context):83 return {"statusCode": 200, "body": json.dumps({"message": "Hello!"})}84```8586### Cloudflare Worker87```javascript88export default {89 async fetch(request) {90 return new Response("Hello from the edge!");91 },92};93```9495## Common Patterns9697- Keep functions small and focused98- Use provisioned concurrency for latency99- Connection pooling for DB access100- Idempotent handlers for retries101102## How to Use1031041. Define infrastructure as code (Terraform, CloudFormation, Pulumi)1052. Review changes through PR process before applying1063. Configure monitoring and alerting for critical paths1074. Set up secrets management (Vault, AWS Secrets Manager, etc.)1085. Document runbooks for deployment, rollback, and incident response1096. Test disaster recovery procedures regularly110111## Red Flags112113- **Infrastructure changes without review**: Unreviewed changes cause outages — use PRs for infra code114- **No rollback strategy**: Every deployment needs a tested rollback plan before it runs115- **Secrets in configuration files**: Secrets in YAML/JSON get committed to version control116- **Missing monitoring and alerting**: Without monitoring, outages go undetected until users report them117- **No documentation for runbooks**: Without runbooks, on-call engineers waste time re-discovering procedures118119## Verification120121- [ ] Skill output matches expected behavior122123## Process1241251. Analyze the task requirements1262. Apply domain expertise1273. Verify output quality128129## Anti-Rationalization Table130131| Rationalization | Reality |132|---|---|133| "Manual deployments are fine" | Manual deployments are error-prone and不可 repeatable. Automate. |134| "We do not need monitoring" | Without monitoring, you are flying blind. Add observability from day one. |135| "Infrastructure as code is overkill" | IaC enables reproducibility, version control, and disaster recovery. |