cloudflare-workers-dev-experience
Get your Cloudflare Workers project running locally with Wrangler and Miniflare. This skill covers project initialization, wrangler.jsonc configuration for KV, D1, and R2 bindings, TypeScript setup, and common development errors. Use it to troubleshoot binding issues, HMR problems, and deployment mismatches.
Cloudflare Workers Dev Experience sets up local development with Wrangler, Miniflare, and hot reload for testing Workers code.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-25
Cloudflare Workers Dev Experience sets up local development with Wrangler, Miniflare, and hot reload for testing Workers code. Get your Cloudflare Workers project running locally with Wrangler and Miniflare. This skill covers project initialization, wrangler.jsonc configuration for KV, D1, and R2 bindings, TypeScript setup, and common development errors. Use it to troubleshoot binding issues, HMR problems, and deployment mismatches.
Use it when
- Cloudflare Workers' hot reload (HMR) requires proper wrangler.jsonc setup.
- Cloudflare Workers bindings go in wrangler.jsonc under [[env.production.kv_namespaces]], [[d1_databases]], or [[r2_buckets]].
Verify before relying
Read SKILL.md below before installing (7 files). Open directory: indexed for reading, not audited.
Install
secondsky/claude-skills/cloudflare-workers-dev-experience · repository language: TypeScript
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I set up Cloudflare Workers local development?
Cloudflare Workers dev experience starts with installing Wrangler (npm install -g wrangler) and running wrangler init to scaffold your project. This creates wrangler.jsonc with your worker configuration. Use wrangler dev to start the local server on port 8787, which runs your worker through Miniflare for local testing before deployment.
Why is wrangler dev not working with hot reload?
Cloudflare Workers' hot reload (HMR) requires proper wrangler.jsonc setup. Ensure your file changes are in the src/ directory and wrangler dev is running. If changes aren't reflecting, check that your wrangler version is current (wrangler update) and that no build errors are blocking recompilation. Restart wrangler dev if needed.
How do I configure wrangler.jsonc with bindings and environment variables?
Cloudflare Workers bindings go in wrangler.jsonc under [[env.production.kv_namespaces]], [[d1_databases]], or [[r2_buckets]]. Define environment variables in [env.production.vars]. For local development, Miniflare reads these automatically. Use wrangler dev --remote to test against live bindings, or --local for Miniflare simulation.
What does 'binding undefined env.KV error' mean in Cloudflare Workers?
Cloudflare Workers throws this error when wrangler.jsonc doesn't declare the binding or the binding name in your code doesn't match the config. Verify [[kv_namespaces]] has the correct binding name and namespace_id. For local dev, ensure Miniflare is running (wrangler dev without --remote). Check your worker accesses env.KV_NAMESPACE, not a different name.
How do I debug Cloudflare Workers locally with TypeScript?
Cloudflare Workers TypeScript debugging uses wrangler types to generate type definitions (wrangler types). Add "types": "@cloudflare/workers-types" to tsconfig.json. Use wrangler dev to run locally, then inspect logs with wrangler tail. For VSCode debugging, attach to the Node process or use console.log in your worker code to see output in the terminal.
How do I set up Cloudflare KV locally with Wrangler?
Cloudflare Workers KV local setup requires declaring [[kv_namespaces]] in wrangler.jsonc with binding and id. Run wrangler dev to start Miniflare, which simulates KV locally. Use env.KV_BINDING.get/put/delete in your worker code. For testing against live KV, use wrangler dev --remote instead of local mode.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Cloudflare Workers Developer Experience
Local development setup with Wrangler, Miniflare, and modern tooling.
Quick Start
# Create new project
bunx create-cloudflare@latest my-worker
# Or from scratch
mkdir my-worker && cd my-worker
bun init -y
bun add -d wrangler @cloudflare/workers-types
# Start local development
bunx wrangler dev
Secure Installation
Scaffolding tools like bunx create-cloudflare download and execute remote code. Before running, follow supply chain security best practices:
- Block post-install scripts —
npm config set ignore-scripts true(or Bun: disabled by default) - Cooldown period — Wait 7 days for new package versions to be vetted by the community
- Audit before installing — Run
socket package score npm <pkg>or usesocket npm install <pkg>to check packages
Load the dependency-upgrade skill for full security configuration including Socket
(truncated - see the full file via the links below)
File tree — 7 files
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/SKILL.md
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/references/debugging-tools.md
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/references/local-development.md
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/references/wrangler-config.md
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/scripts/dev-setup.sh
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/templates/dev-script.ts
plugins/cloudflare-workers/skills/cloudflare-workers-dev-experience/templates/wrangler-config.jsonc
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Set up local development environment for Cloudflare Workers”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
This skill enables developers to deploy and execute Bun applications directly on Cloudflare Workers, combining the speed of Bun's runtime with Cloudflare's global edge network. It provides production-grade tooling for serverless workloads, including support for modern frameworks and AI service integrations. Ideal for teams building high-performance, distributed applications that need minimal latency and automatic scaling.
Wrangler Coder helps you develop and deploy Cloudflare Workers and Pages projects through the official Wrangler command-line tool. It covers project setup, configuration management across multiple environments, secrets handling, and deployment workflows. The skill also guides integration with Cloudflare's backend services including D1 databases, R2 storage, KV namespaces, and Queues.
Configure production-ready deployment pipelines for Cloudflare Workers using GitHub Actions or GitLab CI. This skill covers automated testing on every commit, multi-environment deployments, preview URLs per pull request, secrets management, and deployment verification to prevent failures and enforce safe release practices.
Wrangler is a tool designed to help you manage and work with web development tasks more effectively. This skill introduces you to Wrangler's fundamental features and explains how it fits into modern development workflows. Gain clarity on what makes Wrangler useful and when to apply it in your projects.
Wrangler is Cloudflare's command-line tool for building and deploying Workers across the edge platform. It handles local development, deployment, and management of Workers alongside bindings for KV storage, R2 buckets, D1 databases, Vectorize indexes, and Workers AI. The skill prioritizes current documentation over cached knowledge to ensure commands and config syntax stay accurate.
Navigate Cloudflare's full platform—from serverless compute and data storage to AI inference and edge security. This skill maps your use case to the right product via decision trees, then points you to authoritative references for APIs, limits, and configuration. Always retrieves current docs over cached knowledge.
More skills cloudflare (Apache-2.0) · cloudflare-deploy (Apache-2.0) · cloudflare-kv (MIT) · cloudflare-workers (MIT) · cloudflare-email-service (Apache-2.0) · nuxt-production (MIT)