cloudflare-worker-builder

Scaffold and deploy Cloudflare Workers with Hono routing, Vite, and Static Assets.

1|Updated Aug 18, 2026
One-click install
npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill cloudflare-worker-builder-scsm-unrestrict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-worker-builder
Source: https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent/tree/main/frontend-engineer/skills/cloudflare-worker-builder
Command: npx skills add https://github.com/scsm-unrestrict/dsh-frontend-engineer-agent --skill cloudflare-worker-builder-scsm-unrestrict

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires hono, @cloudflare/vite-plugin, wrangler, vite, typescript, vitest, @cloudflare/vitest-pool-workers, and includes references (resource) and assets (resource) components.

What problem does it solve? Setting up a Cloudflare Worker project involves tricky configuration details—incorrect export syntax, SPA fallback intercepting API routes, HMR crashes, and flaky CI deployments—that cause cryptic errors and wasted debugging time. ## Core Features & Use Cases - Project Scaffolding: Generates a deployable Worker project with Hono routing, the official Vite plugin, and Static Assets from a brief description. - Bindings Configuration: Configures D1 databases, R2 buckets, KV namespaces, and environment-specific settings in wrangler.jsonc with auto-provisioning support. - Documented Troubleshooting: Ships reference guides covering 6+ sourced issues (export syntax errors, API route conflicts, cron handler exports, HMR race conditions, asset upload races) with verified fixes. - Use Case: Describe "a todo app with a D1 database and API routes" and receive a working project with correct run_worker_first configuration, typed bindings, and deployment commands ready to run. ## Quick Start Ask the agent to scaffold a Cloudflare Worker project with Hono and a D1 database for your app idea, then run npm run dev to test it locally.

Frequently Asked Questions about cloudflare-worker-builder

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

FAQPage Schema
How do I create a Cloudflare Worker with Hono?

Run npm create cloudflare@latest with the hello-world template, then install hono and @cloudflare/vite-plugin. Define routes on a Hono app and use export default app as the entry point, which is the correct ES Module pattern for Workers.

Why do my Cloudflare Worker API routes return HTML instead of JSON?

The SPA fallback in Static Assets intercepts requests when run_worker_first is missing. Add "run_worker_first": ["/api/*"] to the assets section of wrangler.jsonc so Worker routes execute before the index.html fallback.

Why does my Hono Worker fail with 'Cannot read properties of undefined'?

This error comes from using export default { fetch: app.fetch }, which loses the this context during Vite bundling. Use export default app directly, or the Module Worker format only when you also need scheduled or tail handlers.

How do I add cron triggers to a Hono Cloudflare Worker?

Switch to the Module Worker export format with both fetch and scheduled handlers, then define crons under triggers in wrangler.jsonc. The @hono/vite-build plugin only supports fetch, so use @cloudflare/vite-plugin instead.

Can Cloudflare Workers use D1, R2, and KV bindings together?

Yes, declare d1_databases, r2_buckets, and kv_namespaces arrays in wrangler.jsonc with explicit binding names. Wrangler 4.45+ auto-provisions resources on first deploy, and wrangler types generates TypeScript definitions for type-safe access.

Why does Worker deployment fail randomly in CI/CD pipelines?

A race condition in parallel static asset uploads causes non-deterministic failures, documented in workers-sdk issue 7555. Upgrade to Wrangler 4.x for improved upload logic, or add retry loops around the deploy command in your pipeline.