cloudflare-worker-builder

Scaffold a Cloudflare Worker project with Hono routing and Static Assets.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/moughamir/justwaitit-review --skill cloudflare-worker-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-worker-builder
Source: https://github.com/moughamir/justwaitit-review/tree/main/.agents/skills/cloudflare-worker-builder
Command: npx skills add https://github.com/moughamir/justwaitit-review --skill cloudflare-worker-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Setting up a correct, deployable Cloudflare Worker project with Hono, Vite, and Static Assets is easy to get wrong—especially around export formats, SPA fallbacks intercepting API routes, and deployment/bundling quirks.

Core Features & Use Cases

  • Scaffold a working Worker: Generates a complete project layout with Hono routing, Vite-based dev workflow, and Static Assets integration suitable for SPA + API setups.
  • Configure Cloudflare bindings: Helps you structure wrangler.jsonc for D1, R2, KV, and environment variables so your Worker can persist data and serve assets reliably.
  • Deploy with guardrails: Provides the correct deploy/dev commands and highlights common failure modes like export syntax errors, static assets routing conflicts, and HMR race conditions.
  • Troubleshoot deterministically: Guides fixes for issues such as “Cannot read properties of undefined”, API routes returning HTML, scheduled handler export problems, and unstable CI asset uploads.

Quick Start

Request: "Scaffold a TypeScript Cloudflare Worker using Hono with an API under /api/*, serve a SPA from static assets, and include a D1 database binding named DB for production deployment."

Frequently Asked Questions about cloudflare-worker-builder

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

FAQPage Schema
How do I scaffold a Cloudflare Worker with Hono and Vite for a SPA and API setup?

Setting up a Cloudflare Worker project with Hono, Vite, and Static Assets requires correct ES module export patterns and routing configurations. Scaffolding generates a complete project layout suitable for SPA and API setups with local and production workflows.

Why do my Cloudflare Worker API routes return HTML instead of JSON when using static assets?

API routes returning HTML in a Cloudflare Worker usually means the SPA fallback is intercepting /api/* paths. You must explicitly configure `run_worker_first` for /api/* to prevent static asset fallback conflicts and ensure correct routing.

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

You configure D1, R2, and KV bindings by structuring your `wrangler.jsonc` file appropriately so the Hono Worker can persist data and serve assets reliably during production deployment.

Can I use Vite HMR with Cloudflare Workers and Hono without race conditions?

Yes, Vite HMR works with Cloudflare Workers and Hono, but you need to follow specific deployment guardrails to avoid HMR race conditions and unstable CI asset uploads during development workflows.

What is the correct export format for a scheduled handler in a Cloudflare Worker ES module?

The correct export format for a scheduled handler in a Cloudflare Worker ES module requires specific syntax to avoid export syntax errors. Using the proper ES module pattern ensures the scheduled handler deploys without failures.