cloudflare-d1:setup

cloudflare-d1:setup is a command for coding agents from secondsky/claude-skills. It costs 50 tokens per session (2,827 once invoked), scanned A, original, MIT.

Interactive wizard to set up Cloudflare D1 database with database creation, Worker binding configuration, schema generation, and first migration. Use when user wants to create first D1 database or add D1 to existing Worker.

Command

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 commands/secondsky/claude-skills/d1-setup
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

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-d1:setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/secondsky/claude-skills/d1-setup.svg)](https://agentmods.dev/commands/secondsky/claude-skills/d1-setup)
Your own site
<a href="https://agentmods.dev/commands/secondsky/claude-skills/d1-setup"><img src="https://agentmods.dev/badge/commands/secondsky/claude-skills/d1-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,827 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.00050 $0.02827
Opus 5 $0.00025 $0.01413
Sonnet 5 $0.00010 $0.00565
Haiku 4.5 $0.00005 $0.00283

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

Security

Grade A, and why

cloudflare-d1:setup 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 today.

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.

plugins/cloudflare-d1/commands/d1-setup.md · 467 lines

How it starts

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

D1 Setup Wizard

Overview

Interactive wizard for complete D1 setup: create database, configure bindings, generate schema, and run first migration.

Prerequisites

Check before starting:

  • Cloudflare account with wrangler authenticated (wrangler whoami)
  • Existing Worker project or willingness to create one
  • Write access to wrangler.jsonc/wrangler.toml

Steps

Step 1: Gather Requirements

Use AskUserQuestion to collect setup preferences.

Question 1: Database Name

  • Prompt: "What should your database be named?"
  • Examples: "my-app-db", "production-db", "users-db"
  • Validation: Alphanumeric + hyphens only (validate before proceeding)
  • Store as: databaseName

Question 2: Binding Name

  • Prompt: "What binding name should be used in your Worker code?"
  • Default: "DB"
  • Examples: "DB", "DATABASE", "USERS_DB"
  • Validation: Valid JavaScript identifier
  • Store as: bindingName

Question 3: Schema Source

  • Prompt: "Do you have an existing schema.sql file?"
  • Options:
    • "Yes - I have schema.sql" → Ask for path
    • "No - Generate basic schema" → Ask for table names
  • Store as: hasSchema, schemaPath or tableNames

Question 4: Read Replication

  • Prompt: "Enable read replication? (Recommended for read-heavy apps, requires paid plan)"
  • Options:
    • "Yes - Enable read replication"
    • "No - Single region only"
  • Store as: enableReplication

Question 5: Data Jurisdiction (if user is on paid plan)

  • Prompt: "Specify data jurisdiction for compliance? (Optional, paid plan only)"
  • Options:
    • "GLOBAL - Best performance (default)"
    • "EU - European Union (GDPR compliance)"
    • "US - United States"
  • Store as: jurisdiction

Step 2: Create Database

Build and execute wrangler command based on user inputs:

# Base command
wrangler d1 create <databaseName>

# Add jurisdiction if specified and not GLOBAL
if [jurisdiction != "GLOBAL"]:
  wrangler d1 create <databaseName> --jurisdiction <jurisdiction>

Read the full file on GitHub · 467 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. today First seen · 467 lines · 50 tokens per session scan A 60999ad1b07a

Subscribe to this mod's changes

cloudflare-d1:setup is a command published in the GitHub repository secondsky/claude-skills (214 stars, last pushed today), licensed MIT. It adds 50 tokens to every session and 2,827 once invoked, about $0.0003 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.