cloudflare-workers

Assists with building and deploying applications on Cloudflare Workers edge computing platform. Use when working with Workers runtime, Wrangler CLI, KV, D1, R2, Durable Objects, Queues, or Hyperdrive. Trigger words: cloudflare, workers, edge functions, wrangler, KV, D1, R2, durable objects, edge computing.

26 stars

Best use case

cloudflare-workers is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Assists with building and deploying applications on Cloudflare Workers edge computing platform. Use when working with Workers runtime, Wrangler CLI, KV, D1, R2, Durable Objects, Queues, or Hyperdrive. Trigger words: cloudflare, workers, edge functions, wrangler, KV, D1, R2, durable objects, edge computing.

Teams using cloudflare-workers should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/cloudflare-workers/SKILL.md --create-dirs "https://raw.githubusercontent.com/TerminalSkills/skills/main/skills/cloudflare-workers/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/cloudflare-workers/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How cloudflare-workers Compares

Feature / Agentcloudflare-workersStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Assists with building and deploying applications on Cloudflare Workers edge computing platform. Use when working with Workers runtime, Wrangler CLI, KV, D1, R2, Durable Objects, Queues, or Hyperdrive. Trigger words: cloudflare, workers, edge functions, wrangler, KV, D1, R2, durable objects, edge computing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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 init` using ES Module syntax (`export default { fetch }`) and set `compatibility_date` in `wrangler.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 dev` with hot reload and local KV/D1/R2 simulation.
- When deploying, use `wrangler deploy` and configure routes, bindings, and build settings in `wrangler.toml`.
- When managing secrets, use `wrangler secret put KEY_NAME` and type bindings with an `Env` interface.
- When optimizing performance, leverage the Cache API (`caches.default`), Smart Placement, streaming responses with `TransformStream`, 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

### Example 1: Create an edge API with KV caching

**User request:** "Set up a Cloudflare Worker that serves cached API responses from KV"

**Actions:**
1. Scaffold a new Worker project with `wrangler init`
2. Configure KV namespace binding in `wrangler.toml`
3. Implement fetch handler with KV read/write and cache-control headers
4. Test locally with `wrangler dev`

**Output:** A Worker that checks KV for cached data, falls back to origin, and stores results in KV with TTL.

### Example 2: Deploy a scheduled data sync Worker

**User request:** "Build a Worker that runs on a schedule to sync data from an external API into D1"

**Actions:**
1. Configure Cron Trigger in `wrangler.toml`
2. Create D1 database and migration with schema
3. Implement `scheduled()` handler that fetches external data and inserts into D1
4. Use `ctx.waitUntil()` for non-blocking cleanup tasks

**Output:** A Worker with cron-triggered data synchronization and D1 storage.

## Guidelines

- Always set `compatibility_date` in `wrangler.toml` to pin runtime behavior.
- Use ES Module syntax (`export default`) over Service Worker syntax.
- Type all environment bindings with an `Env` interface for type safety.
- Handle errors gracefully with proper HTTP status codes instead of unhandled exceptions.
- Use `ctx.waitUntil()` for fire-and-forget async work that should not block the response.
- Prefer D1 over KV for relational data; use KV for simple key-value caching.
- Set appropriate `Cache-Control` headers and leverage Cloudflare's edge cache.

Related Skills

cloudflare-vectorize

26
from TerminalSkills/skills

Serverless vector database at the edge with Cloudflare Vectorize. Use when: building semantic search on Cloudflare Workers, RAG pipelines at the edge, low-latency vector similarity search, or storing and querying embeddings without managing a separate vector database.

cloudflare-ai

26
from TerminalSkills/skills

You are an expert in Cloudflare Workers AI, the serverless AI inference platform running on Cloudflare's global network. You help developers run LLMs, embedding models, image generation, speech-to-text, and translation models at the edge with zero cold starts, pay-per-use pricing, and integration with Workers, Pages, and Vectorize — enabling AI features without managing GPU infrastructure.

zustand

26
from TerminalSkills/skills

You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.

zoho

26
from TerminalSkills/skills

Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.

zod

26
from TerminalSkills/skills

You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.

zipkin

26
from TerminalSkills/skills

Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.

zig

26
from TerminalSkills/skills

Expert guidance for Zig, the systems programming language focused on performance, safety, and readability. Helps developers write high-performance code with compile-time evaluation, seamless C interop, no hidden control flow, and no garbage collector. Zig is used for game engines, operating systems, networking, and as a C/C++ replacement.

zed

26
from TerminalSkills/skills

Expert guidance for Zed, the high-performance code editor built in Rust with native collaboration, AI integration, and GPU-accelerated rendering. Helps developers configure Zed, create custom extensions, set up collaborative editing sessions, and integrate AI assistants for productive coding.

zeabur

26
from TerminalSkills/skills

Expert guidance for Zeabur, the cloud deployment platform that auto-detects frameworks, builds and deploys applications with zero configuration, and provides managed services like databases and message queues. Helps developers deploy full-stack applications with automatic scaling and one-click marketplace services.

zapier

26
from TerminalSkills/skills

Automate workflows between apps with Zapier. Use when a user asks to connect apps without code, automate repetitive tasks, sync data between services, or build no-code integrations between SaaS tools.

zabbix

26
from TerminalSkills/skills

Configure Zabbix for enterprise infrastructure monitoring with templates, triggers, discovery rules, and dashboards. Use when a user needs to set up Zabbix server, configure host monitoring, create custom templates, define trigger expressions, or automate host discovery and registration.

yup

26
from TerminalSkills/skills

Validate data with Yup schemas. Use when adding form validation, defining API request schemas, validating configuration, or building type-safe validation pipelines in JavaScript/TypeScript.