cloudflare-bindings

cloudflare-bindings is a skill for Claude Code, Codex from smicolon/ai-kit. It costs 47 tokens per session (2,223 once invoked), scanned A, original, MIT.

A guide to connecting Cloudflare Workers to services such as D1 databases, KV caches, R2 file storage, Durable Objects, and environment variables.

In plain words
What is it for?
Use it when defining bindings and writing Workers code that reads from databases, caches data, stores files, manages shared state, or loads configuration.
Why use it?
It gives the application a consistent way to access data, files, shared state, and secrets without repeating setup decisions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/smicolon/ai-kit/cloudflare-bindings
Any agent
npx skills add smicolon/ai-kit --skill cloudflare-bindings
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cloudflare-bindings

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/cloudflare-bindings.svg)](https://agentmods.dev/skills/smicolon/ai-kit/cloudflare-bindings)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/cloudflare-bindings"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/cloudflare-bindings.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,223 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.02223
Opus 5 $0.00023 $0.01111
Sonnet 5 $0.00009 $0.00445
Haiku 4.5 $0.00005 $0.00222

Measured yesterday against content hash 17b8ff0feee4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cloudflare-bindings scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packs/hono/skills/cloudflare-bindings/SKILL.md · 409 lines

How it starts

The opening of the file, as written. The whole thing — 409 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cloudflare Bindings

Patterns for Cloudflare Workers bindings in Hono.

Type Definitions

Define all bindings in a central type:

// types/bindings.ts
export type Env = {
  Bindings: {
    // D1 Database
    DB: D1Database

    // KV Namespace
    KV: KVNamespace

    // R2 Bucket
    BUCKET: R2Bucket

    // Durable Object
    COUNTER: DurableObjectNamespace

    // Environment Variables
    ENVIRONMENT: 'development' | 'staging' | 'production'
    API_KEY: string
    JWT_SECRET: string
  }
  Variables: {
    user: User
    requestId: string
  }
}

D1 Database

Basic Queries

app.get('/users', async (c) => {
  const db = c.env.DB

  // Select all
  const { results } = await db
    .prepare('SELECT * FROM users WHERE deleted_at IS NULL')
    .all()

  return c.json({ data: results })
})

app.get('/users/:id', async (c) => {
  const db = c.env.DB
  const id = c.req.param('id')

  // Select one
  const user = await db
    .prepare('SELECT * FROM users WHERE id = ?')
    .bind(id)
    .first()

  if (!user) {
    return c.json({ error: 'User not found' }, 404)
  }

  return c.json({ data: user })
})

Insert and Update

app.post('/users', async (c) => {
  const db = c.env.DB
  const { email, name } = c.req.valid('json')
  const id = crypto.randomUUID()

  const result = await db
    .prepare('INSERT INTO users (id, email, name) VALUES (?, ?, ?)')
    .bind(id, email, name)
    .run()

  return c.json({ data: { id, email, name } }, 201)
})

app.put('/users/:id', async (c) => {
  const db = c.env.DB
  const id = c.req.param('id')
  const { name } = c.req.valid('json')

  await db
    .prepare('UPDATE users SET name = ?, updated_at = datetime("now") WHERE id = ?')
    .bind(name, id)
    .run()

  return c.json({ data: { id, name } })
})

Transactions (Batch)

app.post('/transfer', async (c) => {
  const db = c.env.DB
  const { fromId, toId, amount } = c.req.valid('json')

  // D1 batch for transaction-like behavior
  const results = await db.batch([
    db.prepare('UPDATE accounts SET balance = balance - ? WHERE id = ?')
      .bind(amount, fromId),
    db.prepare('UPDATE accounts SET balance = balance + ? WHERE id = ?')
      .bind(amount, toId),
    db.prepare('INSERT INTO transfers (from_id, to_id, amount) VALUES (?, ?, ?)')
      .bind(fromId, toId, amount)
  ])

  return c.json({ success: true })
})

Read the full file on GitHub · 409 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 409 lines · 47 tokens per session scan A 17b8ff0feee4

Subscribe to this mod's changes

cloudflare-bindings is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 2,223 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

designing-architectures

Architecture knowledge reference covering API design, security architecture, cloud-native patterns, caching strategies, message queues, and data security. Use when designing system architecture, APIs, or cloud-native infrastructure.

telagod/code-abyss · 43 tokens

remote-compute-ssh

Submit recoverable SSH-direct research Runs with live progress cards and model-free monitoring.

xuzhougeng/wisp-science · 22 tokens

probe-compute-environment

Inspect a registered execution server before compute planning and interpret its persisted capability profile. Use when a server is added, when the user clicks Probe, before enabling an unfamiliar SSH/WSL resource, or when deciding whether GPU, sudo/root, a scheduler, Python, R, conda, mamba, or environment modules are…

xuzhougeng/wisp-science · 72 tokens

new-server-bootstrap

Bootstraps a brand-new Minecraft server from scratch (Paper, optionally with a Velocity proxy). Use whenever the user says "set up a new server", "start a Minecraft server from scratch", "how do I make a server", "fresh install", "download Paper", "what Java do I need", "first time server setup", "create a network"…

Teddy563/mcwrench · 170 tokens

senior-devops

Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or…

ahtavarasmus/lightfriend · 65 tokens

sandbox-manager

Create and manage isolated application sandboxes (Next.js, Python, PHP, etc.) with public URLs via Cloudflare.

essamamdani/openclaw-coolify · 27 tokens