cloudflare-workers-author

Develops Cloudflare Workers in TypeScript with bindings, routing, VitestPool testing, and gradual wrangler deployments.

15|2|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/d-padmanabhan/agent-engineering-handbook --skill cloudflare-workers-author
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-workers-author
Source: https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/cloudflare-workers-author
Command: npx skills add https://github.com/d-padmanabhan/agent-engineering-handbook --skill cloudflare-workers-author

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents Cloudflare Workers teams from shipping brittle, runtime-breaking code by guiding end-to-end Worker authoring with correct bindings, routing, testing, and gradual production rollouts.

Core Features & Use Cases

  • Production-grade Worker workflow: covers adding new Workers and extending existing ones with a consistent, incident-resistant process.
  • Bindings and storage decision matrix: helps you choose between KV, R2, D1, Durable Objects, Hyperdrive, Queues, Workers AI, and Vectorize based on consistency, data shape, and workload needs.
  • Correct edge runtime patterns: enforces Module Workers syntax, safe request routing (native URL/switch vs Hono), and Worker-specific pitfalls like secret leakage and canceled fire-and-forget promises.
  • Testing and deployment guardrails: standardizes testing with @cloudflare/vitest-pool-workers and rollout strategy using wrangler versions for gradual traffic splits and smoke tests.

Quick Start

Ask the AI to help you build a new production-grade Cloudflare Worker in TypeScript by selecting the right storage binding, scaffolding the project, adding Hono or native routing, wiring tests with @cloudflare/vitest-pool-workers, and deploying with wrangler versions gradual rollout.

Frequently Asked Questions about cloudflare-workers-author

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between KV, R2, D1, and Durable Objects for my Cloudflare Worker?

Testing Cloudflare Workers uses the @cloudflare/vitest-pool-workers package to run tests within the actual Workers runtime environment. This provides accurate binding behavior and execution context without mocking global APIs.

How do I safely deploy a Cloudflare Worker to production?

Safely deploying a Cloudflare Worker to production involves using wrangler versions upload and deploy for gradual traffic splits. This controlled rollout strategy allows you to route a percentage of traffic to new versions and run smoke tests before full deployment.

What is the correct way to handle asynchronous background tasks in a Cloudflare Worker?

Handling asynchronous background tasks in a Cloudflare Worker correctly requires using ctx.waitUntil. This prevents the runtime from canceling fire-and-forget promises prematurely, ensuring your asynchronous work completes safely without leaking operations.

Can I use Hono for routing in a production-grade Cloudflare Worker?

You can use Hono for routing in a production-grade Cloudflare Worker, or alternatively implement native URL parsing and switch statements. Both approaches are supported, with Hono offering structured middleware and native routing minimizing dependencies.

Do I need to use module workers syntax for new Cloudflare Workers in TypeScript?

You need to use module workers syntax for new Cloudflare Workers in TypeScript to ensure proper structure and secure operational practices. This format enables typed environments via generated worker-configuration.d.ts and supports WorkerEntrypoint RPC patterns.