cloudflare-d1
Cloudflare D1 SQLite database with Workers, Drizzle ORM, migrations
Skill by alinaqi
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/alinaqi-cloudflare-d1
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, cloud
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/cloudflare-d1
What's inside
- Skill name
cloudflare-d1- Description
- Cloudflare D1 SQLite database with Workers, Drizzle ORM, migrations
- License
- MIT
- Instructions
- 653 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Agent Skills spec issues
- body: 653 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# Cloudflare D1 Skill
Cloudflare D1 is a serverless SQLite database designed for Cloudflare Workers with global distribution and zero cold starts.
**Sources:** [D1 Docs](https://developers.cloudflare.com/d1/) | [Drizzle + D1](https://orm.drizzle.team/docs/connect-cloudflare-d1) | [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/)
---
## Core Principle
**SQLite at the edge, migrations in version control, Drizzle for type safety.**
D1 brings SQLite's simplicity to serverless. Design for horizontal scale (multiple small databases) rather than vertical (one large database). Use Drizzle ORM for type-safe queries and migrations.
---
## D1 Stack
| Component | Purpose |
|-----------|---------|
| **D1** | Serverless SQLite database |
| **Workers** | Edge runtime for your application |
| **Wrangler** | CLI for development and deployment |
| **Drizzle ORM** | Type-safe ORM with migrations |
| **Drizzle Kit** | Migration tooling |
| **Hono** | Lightweight web framework (optional) |
---
## Project Setup
### Create Worker Project
```bash
# Create new project
npm create cloudflare@latest my-app -- --template "worker-typescript"
cd my-app
# Install dependencies
npm install drizzle-orm
npm install -D drizzle-kit
```
### Create D1 Database
```bash
# Create database (creates both local and remote)
npx wrangler d1 create my-database
# Output:
# [[d1_databases]]
# binding = "DB"
# database_name = "my-database"
# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```
### Configure wrangler.toml
```toml
name = "my-app"
main = "src/index.ts"
compatibility_date = "2024-01-01"
[[d1_databases]]
binding = "DB"
database_name = "my-database"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
migrations_dir = "drizzle"
migrations_table = "drizzle_migrations"
```
### Generate TypeScript Types
```bash
# Generate env types from wrangler.toml
npx wrangler types
# Creates worker-configuration.d.ts:
# interface Env {
# DB: D1Database;
# }
```
---
## Drizzle ORM Setup
### Schema Definition
```typescript
// src/db/schema.ts
import { sqliteTable, text, integer, real, blob } from 'drizzle-orm/sqlite-core';
import { sql } from 'drizzle-orm';
export const users = sqliteTable('users', {
id: integer('id').primaryKey({ autoIncrement: true }),
email: text('email').notNull().unique(),
name: text('name').notNull(),
role: text('role', { enum: ['user', 'admin'] }).default('user'),
createdAt: text('created_at').default(sql`CURRENT_TIMESTAMP`),
updatedAt: text('updated_at').default(sql`CURRENT_TIMESTAMP`)
});
export const posts = sqliteTable('posts', {
id: integer('id').primaryKey({ autoIncrement: true }),
title: text('title').notNull(),
content: text('content'),
authorId: integer('author_id').references(() => users.id),
published: integer('published', { mode: 'boolean' }).default(false),
viewCount: integer('view_count').default(0),
createdAt: text('created_at').default(sql`CURRENT_TIMESTAMP`)
});
export const tags = sqliteTable('tags', {
id: integer('id').primaryKey({ autoIncrement: true }),
name: text('name').notNull().unique()
});
export const postTags = sqliteTable('post_tags', {
postId: integer('post_id').references(() => posts.id),
tagId: integer('tag_id').references(() => tags.id)
});From alinaqi/maggy, MIT.
More from alinaqi/maggy
- 0.761score
model-routing
alinaqi
9-tier model routing system with cascading classifier fallback and result auto-evaluation
SkillAFreshness: A★ 711Claude Code +9 - 0.721score
dataforseo
alinaqi
Keyword & SERP research via the DataForSEO API — search volume, competition, CPC, keyword ideas for naming/SEO decisions
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
visual-validation
alinaqi
Autonomous screenshot verification — captures, compares, and AI-evaluates UI changes for visual regressions
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
build-in-public
alinaqi
Best practices for sharing engineering work publicly — what to post, what to withhold, and channel-specific guidance
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
llm-patterns
alinaqi
AI-first application patterns, LLM testing, prompt management
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
external-model-delegation
alinaqi
UserPromptSubmit hook pattern that classifies prompts into six cost tiers and delegates to external model CLIs
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
autonomous-testing
alinaqi
AI-driven testing agent that auto-discovers, generates, executes, evaluates, and fixes tests for any project type
SkillBFreshness: B★ 711Claude Code +9 - 0.716score
security-audit
alinaqi
Structured, adversarial, multi-phase security audit of a codebase — recon → coverage-led hunting → finder≠validator validation → machine-readable findings →…
SkillBFreshness: B★ 711Claude Code +9 - 0.716score
verify-cascade
alinaqi
Verification-gated model escalation — run a cheap model, verify its output with decomposed per-field checks, and escalate to a strong model only when a flag…
SkillBFreshness: B★ 711Claude Code +9 - 0.713score
context-shunt
alinaqi
Offload large / multi-file reads to a cheap worker model so raw files never enter Claude's context (token savings)
SkillBFreshness: B★ 711Claude Code +9 - 0.708score
ms-teams-apps
alinaqi
Microsoft Teams bots and AI agents - Claude/OpenAI, Adaptive Cards, Graph API
SkillBFreshness: B★ 711Claude Code +9 - 0.708score
ai-models
alinaqi
Latest AI models reference - Claude, OpenAI, Gemini, Eleven Labs, Replicate
SkillBFreshness: B★ 711Claude Code +9
Signals
- Stars
- 711
- Forks
- 61
- Open issues
- 0
- Last commit (this folder)
- Apr 7, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/alinaqi/maggy
- Website
- www.srooter.ai/maggy
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from alinaqi
- 0.761score
model-routing
alinaqi
9-tier model routing system with cascading classifier fallback and result auto-evaluation
SkillAFreshness: A★ 711Claude Code +9 - 0.721score
dataforseo
alinaqi
Keyword & SERP research via the DataForSEO API — search volume, competition, CPC, keyword ideas for naming/SEO decisions
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
external-model-delegation
alinaqi
UserPromptSubmit hook pattern that classifies prompts into six cost tiers and delegates to external model CLIs
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
autonomous-testing
alinaqi
AI-driven testing agent that auto-discovers, generates, executes, evaluates, and fixes tests for any project type
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
build-in-public
alinaqi
Best practices for sharing engineering work publicly — what to post, what to withhold, and channel-specific guidance
SkillBFreshness: B★ 711Claude Code +9 - 0.717score
llm-patterns
alinaqi
AI-first application patterns, LLM testing, prompt management
SkillBFreshness: B★ 711Claude Code +9
Cite this page
cloudflare-d1 skill. Agent Mart. https://agentmart.dev/skills/alinaqi-cloudflare-d1 (last updated 2026-10-24)