Claude-skill-registry cloudflare-sveltekit-workers-d1
Expert guidance for deploying TypeScript SvelteKit apps to Cloudflare Workers (edge) with D1. Use when configuring @sveltejs/adapter-cloudflare, Wrangler config, Workers Assets, D1 bindings/migrations, or when writing precise step-by-step deployment instructions for SvelteKit on Cloudflare Workers/Pages with D1.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/cloudflare-sveltekit-workers-d1" ~/.claude/skills/majiayu000-claude-skill-registry-cloudflare-sveltekit-workers-d1 && rm -rf "$T"
manifest:
skills/data/cloudflare-sveltekit-workers-d1/SKILL.mdsource content
Cloudflare SvelteKit Workers D1
Overview
Provide a clear, current workflow to connect a SvelteKit TypeScript app to Cloudflare Workers and D1, including adapter setup, Wrangler configuration, D1 bindings/migrations, local testing, and deployment instructions.
Workflow Decision Tree
- Existing SvelteKit app -> Use the Manual Setup workflow in
.references/manual-workers-d1.md - Brand new project -> Use the Cloudflare framework CLI flow in
(C3 option).references/manual-workers-d1.md - User wants fastest/auto config -> Use
(experimental) and still verify the generated config.references/wrangler-autoconfig.md
Core Workflow (Manual Setup)
- Verify the latest Cloudflare + SvelteKit docs with
(adapter-cloudflare, Workers framework guide, D1 commands).web.run - Add the Cloudflare adapter and update
.svelte.config.js - Create or update
for Workers Assets and D1 bindings.wrangler.toml - Create the D1 database and copy its binding block into
.wrangler.toml - Add TypeScript platform typings and use
in server endpoints.platform.env.DB - Create/apply migrations locally and remotely.
- Build, test with Wrangler, then deploy.
Use the exact steps and snippets in
references/manual-workers-d1.md.
D1 Integration Checklist
- Ensure the binding name is a valid JS identifier and matches
in code.platform.env.<BINDING> - Ensure
includeswrangler.toml
with[[d1_databases]]
+database_name
.database_id - Create and apply migrations with both
and--local
as needed.--remote - Update TypeScript declarations in
.src/app.d.ts
Local Dev and Testing Guidance
- Prefer SvelteKit dev server for general UI work.
- For Cloudflare-specific behavior, build and run
.wrangler dev .svelte-kit/cloudflare - Use adapter
options if local bindings need tweaks.platformProxy
Writing Deployment Instructions
- Be explicit about files, commands, and where to paste blocks.
- Always include the
skeleton and D1 binding block.wrangler.toml - Include verification steps (local dev and a deploy check).
- If there is any uncertainty in versions or commands, re-check docs via
.web.run
Resources
- canonical manual setup workflow + snippetsreferences/manual-workers-d1.md
- experimental Wrangler auto-setup pathreferences/wrangler-autoconfig.md