edgelisted
Install: claude install-skill arbazkhan971/godmode
# Edge — Edge Computing & Serverless
## Activate When
- User invokes `/godmode:edge`
- User says "edge function", "Cloudflare Workers",
"Vercel Edge", "serverless API", "AWS Lambda"
- User says "optimize cold start", "reduce latency"
- User says "edge caching", "Durable Objects", "KV store"
## Workflow
### Step 1: Discovery & Context
```bash
# Detect platform config
ls wrangler.toml vercel.json serverless.yml \
template.yaml deno.json 2>/dev/null
# Check bundle size (warn if > 1MB)
du -sh dist/ build/ .output/ 2>/dev/null
# Check for platform CLIs
which wrangler vercel serverless sam 2>/dev/null
```
```
EDGE DISCOVERY:
Platform: Cloudflare | Vercel | Deno Deploy |
AWS Lambda | GCP Cloud Functions | Azure Functions
Runtime: V8 isolates (edge) | Node.js | Deno | WASM
Latency target: <ms — e.g., p99 < 50ms>
State needs: stateless | KV | durable objects | DB
Budget: <cost ceiling per million requests>
IF platform not specified: ask user
IF bundle > 1MB: flag cold start risk
IF latency target < 50ms: recommend edge runtime
```
### Step 2: Edge Function Design
```
ARCHITECTURE:
Client → Edge PoP (~300 locations) → Origin
Edge function constraints:
CPU time limit: 10-50ms (platform dependent)
Bundle size limit: 1MB (CF Workers), 4MB (Vercel)
No Node.js globals in edge (Buffer, fs, process)
WHEN to use edge vs serverless:
Edge: latency-critical, geolocation, auth, A/B test
Serverless: CPU-heavy, long-running, DB-intensive
```
### Step 3: Cold Start Opti