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: Deploy and manage serverless functions on AWS Lambda, Cloudflare Workers, and Vercel Edge, with event-driven design and cold start optimization.4license: Apache-2.05---6789## Overview1011Serverless architecture patterns using AWS Lambda, Cloudflare Workers, and Vercel Edge Functions. Event-driven design with cold start optimization.1213## Capabilities1415- Lambda function deployment16- Cloudflare Workers with Wrangler17- Vercel Edge Functions18- API Gateway integration19- Step Functions orchestration20- Cold start optimization21- Event-driven patterns2223## When to Use24**Trigger phrases:**25- "serverless"26- "Serverless architecture — AWS Lambda, Cloudflare Workers, Vercel Edge"272829- API backends without servers30- Event-driven processing31- Scheduled tasks (cron)32- Microservices at low cost3334## When NOT to Use3536- Task is outside your authorization scope37- You need to implement controls (use implementing-* skills)38- Task is about analysis, not action (use analyzing-* skills)39- You don't have access to target systems40- Task requires compliance expertise (consult professionals)41- Task is about defense, not offense (use defensive skills)424344## Pseudo Code4546The serverless workflow follows a standard pipeline pattern.4748Core flow:49```50# serverless primary flow51input = prepare(raw_data)52result = process(input, config={architecture, cloudflare, cold, design, driven})53validate(result)54deliver(result)55```5657Error handling:58```59on error:60 log(error_details)61 retry_with_backoff(max=3)62 if still_failing: alert_and_escalate()63```646566### Lambda Function67```python68def handler(event, context):69 return {"statusCode": 200, "body": json.dumps({"message": "Hello!"})}70```7172### Cloudflare Worker73```javascript74export default {75 async fetch(request) {76 return new Response("Hello from the edge!");77 },78};79```8081## Common Patterns8283- Keep functions small and focused84- Use provisioned concurrency for latency85- Connection pooling for DB access86- Idempotent handlers for retries8788## How to Use89901. Define infrastructure as code (Terraform, CloudFormation, Pulumi)912. Review changes through PR process before applying923. Configure monitoring and alerting for critical paths934. Set up secrets management (Vault, AWS Secrets Manager, etc.)945. Document runbooks for deployment, rollback, and incident response956. Test disaster recovery procedures regularly9697## Red Flags9899- **Infrastructure changes without review**: Unreviewed changes cause outages — use PRs for infra code100- **No rollback strategy**: Every deployment needs a tested rollback plan before it runs101- **Secrets in configuration files**: Secrets in YAML/JSON get committed to version control102- **Missing monitoring and alerting**: Without monitoring, outages go undetected until users report them103- **No documentation for runbooks**: Without runbooks, on-call engineers waste time re-discovering procedures104105## Verification106107- [ ] Skill output matches expected behavior108109## Process1101111. Analyze the task requirements1122. Apply domain expertise1133. Verify output quality114115## Anti-Rationalization Table116117| Rationalization | Reality |118|---|---|119| "Manual deployments are fine" | Manual deployments are error-prone and不可 repeatable. Automate. |120| "We do not need monitoring" | Without monitoring, you are flying blind. Add observability from day one. |121| "Infrastructure as code is overkill" | IaC enables reproducibility, version control, and disaster recovery. |