cloudflare-workers-bindings-local-dev

Inspects Wrangler binding configuration and produces a local development plan for Cloudflare Workers projects.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/gmackie/agent-skills --skill cloudflare-workers-bindings-local-dev-gmackie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cloudflare-workers-bindings-local-dev
Source: https://github.com/gmackie/agent-skills/tree/main/skills/cloudflare-workers-bindings-local-dev
Command: npx skills add https://github.com/gmackie/agent-skills --skill cloudflare-workers-bindings-local-dev-gmackie

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, jq, python3, and includes scripts (resource) and references (resource) components.

What problem does it solve? Cloudflare Workers projects that depend on bindings like D1, KV, R2, Queues, Durable Objects, or Workflows often break or drift during local development because binding declarations, environment-specific config, and local-versus-remote assumptions are unclear. This Skill inventories the binding surface and turns it into a concrete local-dev plan. ## Core Features & Use Cases - Binding Inventory: Runs a helper script to detect wrangler.jsonc or wrangler.toml, env.* sections, .dev.vars files, and declarations for D1, KV, R2, Queues, Durable Objects, Workflows, and service bindings. - Environment Drift Detection: Verifies which bindings are declared at the top level versus per Wrangler environment, and flags code that references undeclared bindings or mixes process.env with runtime env access. - Local State Strategy: Documents whether D1/KV/R2/Queues should be simulated locally, where local state persists, and when remote bindings are genuinely required. - Use Case: A team whose Worker works in production but fails under wrangler dev can run this Skill to get a dated plan at docs/cloudflare/YYYY-MM-DD-bindings-local-dev.md covering bindings, environment model, and next steps. ## Quick Start Use the cloudflare-workers-bindings-local-dev skill to audit my project's Wrangler bindings and write a local development plan.

Frequently Asked Questions about cloudflare-workers-bindings-local-dev

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

FAQPage Schema
How do I set up local development for Cloudflare Workers with D1 and KV bindings?▼

Start by inventorying your wrangler.jsonc or wrangler.toml to see which D1, KV, and other bindings are declared and in which environments. Then decide which bindings can be simulated locally under wrangler dev and document where local D1 state should persist.

Why do my Cloudflare Workers bindings work in production but fail locally?▼

Bindings do not automatically inherit across Wrangler environments, so bindings declared at the top level may be missing in your dev environment section. Redeclare required bindings per environment and check whether code references bindings that are not declared.

Can I use remote Cloudflare bindings during local development?▼

Yes, remote bindings can be enabled during local development, but they should only be used where actually needed, such as resources unsupported in local simulation. Document which resources use remote mode and why to avoid hidden dependencies.

What is the difference between .dev.vars and .env files in a Workers project?▼

.dev.vars files provide secrets and variables to wrangler dev for the Worker runtime, while .env files are typically used by build tooling. Mixing process.env assumptions with runtime env binding access is a common drift source that should be flagged.

How do I find bindings used in code but missing from Wrangler config?▼

Search the codebase for patterns like env.MY_BINDING, D1Database, KVNamespace, and getCloudflareContext, then compare the results against binding declarations in wrangler.jsonc or wrangler.toml. The included inspection script automates this comparison.