Cloudflare Worker

Develop and deploy Cloudflare Workers with Hono routing and R2/D1 bindings.

232|4|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ThePrimeagen/skills --skill cloudflare-worker-theprimeagen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Cloudflare Worker
Source: https://github.com/ThePrimeagen/skills/tree/main/skills/cloudflare
Command: npx skills add https://github.com/ThePrimeagen/skills --skill cloudflare-worker-theprimeagen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a standardized approach and best practices for developing and deploying Cloudflare Workers, particularly those leveraging Hono for routing and interacting with Cloudflare bindings like R2 and D1.

Core Features & Use Cases

  • Hono Integration: Encourages the use of Hono for efficient routing and middleware.
  • Cloudflare Bindings: Demonstrates correct usage of R2, D1, and KV bindings within the Env object.
  • Static Asset Serving: Outlines how to serve static assets from a dist directory.
  • Use Case: Quickly scaffold a new Cloudflare Worker that serves static assets from a dist folder and handles API requests using Hono, with proper integration for R2 storage.

Quick Start

Create a new Cloudflare Worker using Hono and configure it to serve static assets from the 'dist' directory.

Frequently Asked Questions about Cloudflare Worker

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

FAQPage Schema
How do I build a Cloudflare Worker using Hono and serve static assets?

To build a Cloudflare Worker with Hono, define routing and configure the application to serve static assets from a 'dist' directory. This approach standardizes API request handling alongside static file delivery.

How do I configure R2 and D1 bindings in a Hono Cloudflare Worker?

Configuring R2 and D1 bindings in a Cloudflare Worker requires defining them within the Env object. This ensures proper TypeScript type generation and secure access to storage and database resources.

What is the best way to manage environment variables in Cloudflare Workers?

The best way to manage environment variables in Cloudflare Workers is by enforcing strict type definitions within an Env object. This practice guarantees type safety when accessing bindings like R2, D1, or KV.

Do I need wrangler to deploy a Cloudflare Worker and generate types?

Yes, you need wrangler to deploy a Cloudflare Worker and generate types. Wrangler handles the deployment process and automatically generates the necessary TypeScript definitions for your environment bindings.

Can I use Hono for API routing while serving static files from a dist folder?

Yes, you can use Hono for API routing while serving static files from a dist folder. This Skill scaffolds Workers that efficiently handle API requests via Hono middleware and serve static assets concurrently.