Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Deploy to edge runtimes (Cloudflare Workers, Vercel Edge, Deno Deploy) for globally distributed, low-latency applications. Master edge middleware, streaming, and runtime constraints for 2025+ edge computing.
.claude/skills/aiskillstore-edge-computing-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 253% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 89% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 66% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 58% | 0% |
Edge computing runs code closer to users worldwide, reducing latency from seconds to milliseconds. This skill covers Cloudflare Workers, Vercel Edge Functions, and Deno Deploy patterns for building globally distributed applications.
When to use this skill:
| Feature | Cloudflare Workers | Vercel Edge | Deno Deploy | |---------|-------------------|-------------|-------------| | Cold Start | <1ms | <10ms | <10ms | | Locations | 300+ | 100+ | 35+ | | Runtime | V8 Isolates | V8 Isolates | Deno | | Max Duration | 30s (paid: unlimited) | 25s | 50ms-5min | | Free Tier | 100k req/day | 100k req/month | 100k req/month |
typescript// worker.ts export default { async fetch(request: Request, env: Env): Promise<Response> { const url = new URL(request.url) // Geo-routing const country = request.cf?.country || 'US' if (url.pathname === '/api/hello') { return new Response(JSON.stringify({ message: `Hello from ${country}!` }), { headers: { 'Content-Type': 'application/json' } }) } // Cache API const cache = caches.default let response = await cache.match(request) if (!response) { response = await fetch(request) // Cache for 1 hour response = new Response(response.body, response) response.headers.set('Cache-Control', 'max-age=3600') await cache.put(request, response.clone()) } return response } } // Durable Objects for stateful edge export class Counter { private state: DurableObjectState private count = 0 constructor(state: DurableObjectState) { this.state = state } async fetch(request: Request) { const url = new URL(request.url) if (url.pathname === '/increment') { this.count++ await this.state.storage.put('count', this.count) } return new Response(JSON.stringify({ count: this.count })) } }
typescript// middleware.ts (Edge Middleware) import { NextResponse } from 'next/server' import type { NextRequest } from 'next/server' export function middleware(request: NextRequest) { // A/B testing const bucket = Math.random() < 0.5 ? 'a' : 'b' const url = request.nextUrl.clone() url.searchParams.set('bucket', bucket) // Geo-location const country = request.geo?.country || 'US' const response = NextResponse.rewrite(url) response.cookies.set('bucket', bucket) response.headers.set('X-Country', country) return response } export const config = { matcher: '/experiment/:path*' } // Edge API Route export const runtime = 'edge' export async function GET(request: Request) { return new Response(JSON.stringify({ timestamp: Date.now(), region: process.env.VERCEL_REGION })) }
✅ Available:
fetch, Request, Response, HeadersURL, URLSearchParamsTextEncoder, TextDecoderReadableStream, WritableStreamcrypto, SubtleCrypto❌ Not Available:
fs, path, child_process)typescriptimport { verify } from '@tsndr/cloudflare-worker-jwt' export default { async fetch(request: Request, env: Env) { const token = request.headers.get('Authorization')?.replace('Bearer ', '') if (!token) { return new Response('Unauthorized', { status: 401 }) } const isValid = await verify(token, env.JWT_SECRET) if (!isValid) { return new Response('Invalid token', { status: 403 }) } // Proceed with authenticated request return fetch(request) } }
typescriptexport default { async fetch(request: Request, env: Env) { const ip = request.headers.get('CF-Connecting-IP') const key = `ratelimit:${ip}` // Use KV for rate limiting const count = await env.KV.get(key) const currentCount = count ? parseInt(count) : 0 if (currentCount >= 100) { return new Response('Rate limit exceeded', { status: 429 }) } await env.KV.put(key, (currentCount + 1).toString(), { expirationTtl: 60 // 1 minute }) return fetch(request) } }
typescriptasync function handleRequest(request: Request) { const cache = caches.default const cacheKey = new Request(request.url, request) // Try cache first let response = await cache.match(cacheKey) if (!response) { // Fetch from origin response = await fetch(request) // Cache successful responses if (response.status === 200) { response = new Response(response.body, response) response.headers.set('Cache-Control', 'max-age=3600') await cache.put(cacheKey, response.clone()) } } return response }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 8,739 | 12,839 | +47% | 1 | 1 | 0% | 1,606 | 3,038 | +89% | 0 | 0 | — |
case-02 | pass→pass | 20,175 | 20,296 | +1% | 1 | 1 | 0% | 2,746 | 4,555 | +66% | 0 | 0 | — |
case-03 | pass→pass | 17,863 | 9,736 | -45% | 1 | 1 | 0% | 2,109 | 3,332 | +58% | 0 | 0 | — |
case-04 | pass→pass | 9,893 | 9,906 | +0% | 1 | 1 | 0% | 973 | 2,481 | +155% | 0 | 0 | — |
case-05 | pass→pass | 10,878 | 9,346 | -14% | 1 | 1 | 0% | 1,084 | 2,469 | +128% | 0 | 0 | — |
case-06 | pass→pass | 2,624 | 3,770 | +44% | 1 | 1 | 0% | 436 | 2,161 | +396% | 0 | 0 | — |
case-07 | pass→pass | 14,616 | 15,955 | +9% | 1 | 1 | 0% | 2,360 | 3,558 | +51% | 0 | 0 | — |
case-08 | pass→pass | 11,255 | 11,983 | +6% | 1 | 1 | 0% | 1,195 | 2,954 | +147% | 0 | 0 | — |
case-09 | pass→pass | 11,526 | 10,096 | -12% | 1 | 1 | 0% | 2,140 | 2,565 | +20% | 0 | 0 | — |
case-10 | pass→pass | 8,694 | 9,383 | +8% | 1 | 1 | 0% | 1,454 | 2,441 | +68% | 0 | 0 | — |
case-11 | pass→pass | 9,293 | 3,459 | -63% | 1 | 1 | 0% | 689 | 2,202 | +220% | 0 | 0 | — |
case-12 | pass→pass | 6,134 | 3,945 | -36% | 1 | 1 | 0% | 1,133 | 2,305 | +103% | 0 | 0 | — |
case-13 | pass→pass | 15,989 | 13,050 | -18% | 1 | 1 | 0% | 2,611 | 2,888 | +11% | 0 | 0 | — |
case-14 | fail→pass | 19,433 | 14,703 | -24% | 1 | 1 | 0% | 2,913 | 4,026 | +38% | 0 | 0 | — |
case-15 | pass→pass | 4,223 | 7,081 | +68% | 1 | 1 | 0% | 645 | 1,908 | +196% | 0 | 0 | — |
case-16 | fail→pass | 3,345 | 1,465 | -56% | 1 | 1 | 0% | 527 | 1,861 | +253% | 0 | 0 | — |
case-17 | pass→pass | 6,454 | 6,601 | +2% | 1 | 1 | 0% | 1,083 | 2,873 | +165% | 0 | 0 | — |
case-18 | pass→pass | 13,208 | 10,604 | -20% | 1 | 1 | 0% | 1,343 | 2,589 | +93% | 0 | 0 | — |
case-19 | pass→pass | 7,795 | 10,607 | +36% | 1 | 1 | 0% | 1,289 | 2,516 | +95% | 0 | 0 | — |
case-20 | pass→pass | 11,056 | 6,562 | -41% | 1 | 1 | 0% | 896 | 1,844 | +106% | 0 | 0 | — |
case-21 | pass→pass | 8,048 | 7,927 | -2% | 1 | 1 | 0% | 1,272 | 2,064 | +62% | 0 | 0 | — |
case-22 | pass→pass | 10,127 | 14,194 | +40% | 1 | 1 | 0% | 1,845 | 3,290 | +78% | 0 | 0 | — |
case-23 | pass→pass | 13,623 | 17,744 | +30% | 1 | 1 | 0% | 2,603 | 4,088 | +57% | 0 | 0 | — |
case-24 | pass→pass | 10,723 | 10,253 | -4% | 1 | 1 | 0% | 2,069 | 3,741 | +81% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +8 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.