cloudflare-d1-development

Inspects Cloudflare D1 bindings, migrations, and access patterns to produce a development plan.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Cloudflare Workers projects that depend on D1 often suffer from misconfigured bindings, unclear local-vs-remote database behavior, and implicit migration or seed workflows. This Skill inventories the D1 surface of a project and turns scattered configuration into a concrete development plan before deeper implementation work begins. ## Core Features & Use Cases - D1 Surface Inventory: Runs a helper script to locate Wrangler config files, d1_databases declarations, preview_database_id usage, migration and seed files, and D1-related code usage. - Binding and Workflow Validation: Verifies binding names, Wrangler scopes, local versus remote development mode, and migration/seed discipline, flagging drift between code, docs, and config. - Development Plan Output: Produces a structured Markdown plan covering the binding model, local and preview behavior, migration status, and recommended next steps. - Use Case: Before adding a new D1-backed feature to a Workers app, run the inspection to confirm the binding is declared correctly, migrations are reproducible locally, and preview database expectations are documented. ## Quick Start Ask the AI to inspect the D1 development setup in your Cloudflare Workers project and produce a development plan covering bindings, migrations, and local versus remote behavior.

Frequently Asked Questions about cloudflare-d1-development

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

FAQPage Schema
How do I check my Cloudflare D1 binding configuration?▼

Run the inspect-d1-development.sh helper against your project repo to locate wrangler.jsonc or wrangler.toml and extract d1_databases declarations and preview_database_id usage. Then verify the binding name matches what your app code actually references.

How to set up D1 migrations and seeding for local development?▼

Keep SQL migration files in a tracked migrations directory and provide explicit seed commands or seed files so local databases can be recreated consistently. Avoid relying on one-off manual dashboard changes, since implicit workflows are a real risk.

Should local D1 development use local state or remote mode?▼

Local development should default to local D1 state unless remote mode is explicitly required and documented. Using remote D1 by default during local development without saying so is a common mistake that this Skill flags.

Why does my Workers app fail to access D1 even though it compiles?▼

Compilation does not prove the binding is correct. The code may reference a D1 binding that Wrangler does not declare, or treat D1 as a generic env var instead of a runtime binding, both of which cause runtime failures.

What are the limitations of D1 development inspection?▼

The inspection inventories configuration and code patterns but does not replace broader binding review or generic SQL design work. It complements skills like cloudflare-workers-bindings-local-dev rather than substituting for them.