add-binding

Configures Cloudflare bindings in wrangler.jsonc for TanStack Start Workers projects.

1|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/fayazara/bangalore.fyi --skill add-binding-fayazara
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-binding
Source: https://github.com/fayazara/bangalore.fyi/tree/main/.agents/skills/add-binding
Command: npx skills add https://github.com/fayazara/bangalore.fyi --skill add-binding-fayazara

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding Cloudflare bindings (KV, R2, D1, Queues, secrets, environment variables) to a TanStack Start + Workers project requires exact wrangler.jsonc syntax, type regeneration, and correct server-side access patterns that are easy to get wrong. ## Core Features & Use Cases - Binding Configuration: Provides exact wrangler.jsonc snippets for KV namespaces, R2 buckets, D1 databases, Queue producers, and plain vars. - Type Generation: Runs cf-typegen after config edits so TypeScript knows about new bindings via worker-configuration.d.ts. - Usage Patterns: Shows how to access bindings through import { env } from "cloudflare:workers" with read/write examples per binding type. - Use Case: When you need caching, ask to add a KV namespace and get the wrangler config, the namespace creation command, regenerated types, and working put/get/delete code. ## Quick Start Ask the agent to add an R2 bucket binding named STORAGE to this project and show how to upload a file with it.

Frequently Asked Questions about add-binding

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

FAQPage Schema
How do I add a KV namespace to a Cloudflare Worker?

Add a kv_namespaces entry in wrangler.jsonc with a binding name and namespace ID, then run npx wrangler kv namespace create to provision it. Run npm run cf-typegen afterward so TypeScript recognizes the new binding.

How do I access Cloudflare bindings in TanStack Start server code?

Import env from cloudflare:workers in server-side code and access bindings directly, such as env.CACHE or env.STORAGE. Never pass env as a function argument or import it in client components, since it is server-only.

Where do I put secrets in a Cloudflare Workers project?

Secrets are not declared in wrangler.jsonc. Use npx wrangler secret put MY_SECRET for production and add the value to a .dev.vars file for local development.

Why is my new binding not recognized by TypeScript?

TypeScript does not know about bindings until you regenerate types. Run npm run cf-typegen after editing wrangler.jsonc to update worker-configuration.d.ts with the new binding types.

Can I use process.env for Cloudflare bindings?

No, process.env is a Node.js pattern and does not work for Workers bindings. Use import { env } from "cloudflare:workers" instead, which provides typed access to KV, R2, D1, Queues, and vars.