cloudflare-workers
Installation
SKILL.md
Cloudflare Workers
Overview
Cloudflare Workers enables building and deploying applications at the edge with sub-millisecond cold starts. The platform leverages the Workers runtime alongside storage services like KV, D1, R2, Durable Objects, and Queues to build globally distributed, low-latency applications.
Instructions
- When asked to create a Worker, scaffold with
wrangler initusing ES Module syntax (export default { fetch }) and setcompatibility_dateinwrangler.toml. - When configuring storage, recommend KV for read-heavy key-value caching, D1 for relational data with SQL, R2 for S3-compatible object storage with zero egress fees, and Durable Objects for strongly consistent state coordination.
- When setting up local development, use
wrangler devwith hot reload and local KV/D1/R2 simulation. - When deploying, use
wrangler deployand configure routes, bindings, and build settings inwrangler.toml. - When managing secrets, use
wrangler secret put KEY_NAMEand type bindings with anEnvinterface. - When optimizing performance, leverage the Cache API (
caches.default), Smart Placement, streaming responses withTransformStream, and HTMLRewriter for HTML transformation. - When handling background work, use
ctx.waitUntil()for fire-and-forget async tasks like analytics or logging. - When building AI features, use Workers AI for edge inference, AI Gateway for multi-provider management, and Vectorize for RAG pipelines.
Examples
Related skills