Better Drizzle
almeidazs/better-drizzle
Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…
Drizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns.
$ npx skills add bretzel-app/crumbs --skill drizzle-migrations -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install bretzel-app/crumbs drizzle-migrations --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/bretzel-app/crumbs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/drizzle-migrations .claude/skills/drizzle-migrations && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "drizzle-migrations" agent skill from https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrations into .claude/skills/drizzle-migrations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-migrations", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrationsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add bretzel-app/crumbs --skill drizzle-migrations -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install bretzel-app/crumbs drizzle-migrations --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bretzel-app/crumbs.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/drizzle-migrations .agents/skills/drizzle-migrations && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "drizzle-migrations" agent skill from https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrations into .agents/skills/drizzle-migrations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-migrations", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bretzel-app/crumbs --skill drizzle-migrations -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install bretzel-app/crumbs drizzle-migrations --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bretzel-app/crumbs.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/drizzle-migrations .cursor/skills/drizzle-migrations && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "drizzle-migrations" agent skill from https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrations into .cursor/skills/drizzle-migrations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-migrations", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/bretzel-app/crumbs.git --path .agents/skills/drizzle-migrations--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add bretzel-app/crumbs --skill drizzle-migrations -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install bretzel-app/crumbs drizzle-migrations --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bretzel-app/crumbs.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/drizzle-migrations .gemini/skills/drizzle-migrations && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "drizzle-migrations" agent skill from https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrations into .gemini/skills/drizzle-migrations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-migrations", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install bretzel-app/crumbs drizzle-migrationsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add bretzel-app/crumbs --skill drizzle-migrations -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/bretzel-app/crumbs.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/drizzle-migrations .github/skills/drizzle-migrations && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "drizzle-migrations" agent skill from https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrations into .github/skills/drizzle-migrations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-migrations", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bretzel-app/crumbs --skill drizzle-migrations -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install bretzel-app/crumbs drizzle-migrations --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bretzel-app/crumbs.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/drizzle-migrations .opencode/skills/drizzle-migrations && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "drizzle-migrations" agent skill from https://github.com/bretzel-app/crumbs/tree/main/.agents/skills/drizzle-migrations into .opencode/skills/drizzle-migrations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-migrations", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
drizzle-migrationsDrizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns.
Drizzle Migrations is an agent skill from bretzel-app/crumbs. Drizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns. NOT for Prisma, TypeORM, Sequelize, or raw SQL migration tools.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering ORMs and data access. It works with SQLite, SQL, Drizzle ORM and Prisma. The repository describes itself as: Crumbs by Bretzel - a self-hosted, privacy-first Google Keep alternative. Capture your thoughts, ideas and notes. Built with SvelteKit. The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 31732e8. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditBash(npm:*npx:*)From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npmFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
orm.drizzle.teamFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Drizzle Migrations loads about 2.6k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 215 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from bretzel-app/crumbs at commit 31732e8, republished under its MIT licence (© bretzel-app). 215 words, ~2,553 tokens.
.claude/skills/drizzle-migrations/SKILL.md (or your agent's skills folder).This skill helps you manage database schema changes using Drizzle ORM with SQLite.
✅ USE this skill for:
❌ DO NOT use for:
supabase-admin skillConfiguration: drizzle.config.ts
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
schema: './src/db/schema.ts',
out: './drizzle',
dialect: 'sqlite',
dbCredentials: {
url: './data/app.db',
},
});Commands:
npm run db:generate # Generate migration files
npm run db:push # Push schema directly (dev only)
npm run db:studio # Open Drizzle Studio GUILocation: src/db/schema.ts
import { sqliteTable, text, integer, real, blob } from 'drizzle-orm/sqlite-core';
import { relations } from 'drizzle-orm';
// Basic table
export const users = sqliteTable('users', {
id: text('id').primaryKey(),
email: text('email').notNull().unique(),
username: text('username').notNull(),
passwordHash: text('password_hash'),
createdAt: text('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
updatedAt: text('updated_at'),
});
// Table with foreign key
export const checkIns = sqliteTable('check_ins', {
id: text('id').primaryKey(),
userId: text('user_id').notNull().references(() => users.id, {
onDelete: 'cascade',
}),
mood: integer('mood').notNull(),
cravingLevel: integer('craving_level').notNull(),
sleepHours: real('sleep_hours'),
notes: text('notes'),
createdAt: text('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
});
// Table with composite index
export const auditLog = sqliteTable('audit_log', {
id: text('id').primaryKey(),
userId: text('user_id').notNull(),
action: text('action').notNull(),
targetType: text('target_type'),
targetId: text('target_id'),
details: text('details'), // JSON string
createdAt: text('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
}, (table) => ({
userActionIdx: index('idx_audit_user_action').on(table.userId, table.action),
createdAtIdx: index('idx_audit_created').on(table.createdAt),
}));export const usersRelations = relations(users, ({ many }) => ({
checkIns: many(checkIns),
sessions: many(sessions),
journalEntries: many(journalEntries),
}));
export const checkInsRelations = relations(checkIns, ({ one }) => ({
user: one(users, {
fields: [checkIns.userId],
references: [users.id],
}),
}));import {
sqliteTable,
text, // TEXT - strings, JSON, dates
integer, // INTEGER - numbers, booleans (0/1)
real, // REAL - floating point
blob, // BLOB - binary data
} from 'drizzle-orm/sqlite-core';
const examples = sqliteTable('examples', {
// Strings
name: text('name').notNull(),
description: text('description'),
// Numbers
count: integer('count').notNull().default(0),
rating: real('rating'),
// Booleans (stored as 0/1)
isActive: integer('is_active', { mode: 'boolean' }).default(true),
// Dates (stored as ISO strings)
createdAt: text('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
expiresAt: text('expires_at'),
// JSON (stored as TEXT)
metadata: text('metadata', { mode: 'json' }),
// Enums (stored as TEXT)
status: text('status', { enum: ['pending', 'active', 'archived'] }),
});npm run db:push# 1. Generate migration file
npm run db:generate
# 2. Review generated SQL in /drizzle folder
# 3. Apply migration (in code or manually)import { drizzle } from 'drizzle-orm/better-sqlite3';
import { migrate } from 'drizzle-orm/better-sqlite3/migrator';
import Database from 'better-sqlite3';
const sqlite = new Database('./data/app.db');
const db = drizzle(sqlite);
// Run migrations
migrate(db, { migrationsFolder: './drizzle' });// 1. Add to schema.ts
export const newFeature = sqliteTable('new_feature', {
id: text('id').primaryKey(),
userId: text('user_id').notNull().references(() => users.id),
name: text('name').notNull(),
createdAt: text('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
});
// 2. Add relations
export const newFeatureRelations = relations(newFeature, ({ one }) => ({
user: one(users, {
fields: [newFeature.userId],
references: [users.id],
}),
}));
// 3. Generate migration
// npm run db:generate// In schema.ts, add the new column
export const users = sqliteTable('users', {
// existing columns...
newColumn: text('new_column'), // Add this
});
// Generate migration
// npm run db:generateexport const messages = sqliteTable('messages', {
id: text('id').primaryKey(),
conversationId: text('conversation_id').notNull(),
createdAt: text('created_at').notNull(),
}, (table) => ({
// Add index
convCreatedIdx: index('idx_messages_conv_created')
.on(table.conversationId, table.createdAt),
}));SQLite doesn't support direct column renames in older versions. For complex changes:
-- drizzle/XXXX_rename_column.sql
-- Manual migration for column rename
-- 1. Create new table with desired schema
CREATE TABLE users_new (
id TEXT PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
display_name TEXT NOT NULL, -- renamed from username
created_at TEXT NOT NULL
);
-- 2. Copy data
INSERT INTO users_new SELECT id, email, username, created_at FROM users;
-- 3. Drop old table
DROP TABLE users;
-- 4. Rename new table
ALTER TABLE users_new RENAME TO users;import { db } from '@/db';
import { eq, and, or, desc, asc, like, gte, lte } from 'drizzle-orm';
import { users, checkIns } from '@/db/schema';
// Select all
const allUsers = await db.select().from(users);
// Select with conditions
const activeUsers = await db
.select()
.from(users)
.where(eq(users.isActive, true));
// Select specific columns
const userEmails = await db
.select({ id: users.id, email: users.email })
.from(users);
// Complex where clause
const results = await db
.select()
.from(checkIns)
.where(
and(
eq(checkIns.userId, userId),
gte(checkIns.createdAt, startDate),
lte(checkIns.createdAt, endDate)
)
)
.orderBy(desc(checkIns.createdAt))
.limit(30);// Single insert
const [newUser] = await db
.insert(users)
.values({
id: generateId(),
email: 'user@example.com',
username: 'newuser',
})
.returning();
// Bulk insert
await db.insert(checkIns).values([
{ id: '1', userId, mood: 7, cravingLevel: 2 },
{ id: '2', userId, mood: 8, cravingLevel: 1 },
]);
// Upsert (insert or update)
await db
.insert(users)
.values({ id: 'user-1', email: 'new@example.com' })
.onConflictDoUpdate({
target: users.id,
set: { email: 'new@example.com' },
});await db
.update(users)
.set({ username: 'newname', updatedAt: new Date().toISOString() })
.where(eq(users.id, userId));// Always use WHERE clause!
await db
.delete(checkIns)
.where(eq(checkIns.id, checkInId));
// Delete with multiple conditions
await db
.delete(sessions)
.where(
and(
eq(sessions.userId, userId),
lte(sessions.expiresAt, new Date().toISOString())
)
);const userWithCheckIns = await db
.select({
user: users,
checkIn: checkIns,
})
.from(users)
.leftJoin(checkIns, eq(users.id, checkIns.userId))
.where(eq(users.id, userId));import { count, avg, sum, max, min } from 'drizzle-orm';
const stats = await db
.select({
totalCheckIns: count(),
avgMood: avg(checkIns.mood),
maxStreak: max(checkIns.streak),
})
.from(checkIns)
.where(eq(checkIns.userId, userId));await db.transaction(async (tx) => {
await tx.insert(users).values(userData);
await tx.insert(profiles).values(profileData);
});returning() to get inserted/updated rows© bretzel-app, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/drizzle-migrations of bretzel-app/crumbs.
Open the folder on GitHubat commit 31732e8
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in bretzel-app/crumbs, which our catalogue first saw on October 7, 2026.
Drizzle Migrations next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Drizzle Migrations this skillbretzel-app/crumbs | 127 | 1 repos | ~2.6k | Automated safety check: Pass | MIT | |
| Better Drizzlealmeidazs/better-drizzle | 349 | — | ~1.7k | Automated safety check: Pass | Apache-2.0 | |
| Database Expertcin12211/orca-q | 224 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Drizzle Orm Expertdavila7/claude-code-templates | 33k | 3 repos | ~2.6k | Automated safety check: Pass | MIT | |
| DB Review312362115/claude | 107 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Drizzle OrmEpicenterHQ/epicenter | 4.8k | — | ~1.3k | Automated safety check: Pass | Custom licence |
almeidazs/better-drizzle
Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…
cin12211/orca-q
Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.
davila7/claude-code-templates
Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, and serverless database integration.
312362115/claude
数据库代码审查 + Migration 安全检查. An agent skill from 312362115/claude.
EpicenterHQ/epicenter
Apply Drizzle ORM patterns for schemas, migrations, queries, branded types, and Postgres or D1 boundaries.
alirezarezvani/claude-skills
A skill your agent uses when the user asks to write SQL queries, optimize database performance, generate migrations, explore database schemas, or work with ORMs like Prisma, Drizzle, TypeORM, or…
bretzel-app/crumbs
Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation.
Categories
Drizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns. Drizzle Migrations is an agent skill from bretzel-app/crumbs. Drizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns.
Drizzle Migrations fits situations like: tasks that involve ORMs and data access.
Run `npx skills add bretzel-app/crumbs --skill drizzle-migrations -a claude-code`. Or copy the skill folder (.agents/skills/drizzle-migrations in bretzel-app/crumbs) into .claude/skills/drizzle-migrations in your project. Claude Code loads it when a task matches its description.
Run `npx skills add bretzel-app/crumbs --skill drizzle-migrations -a codex`. Or copy the skill folder (.agents/skills/drizzle-migrations in bretzel-app/crumbs) into .agents/skills/drizzle-migrations in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bretzel-app/crumbs --skill drizzle-migrations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/drizzle-migrations, .gemini/skills/drizzle-migrations, .github/skills/drizzle-migrations and .opencode/skills/drizzle-migrations in your project.
Going by SKILL.md and its folder, Drizzle Migrations needs the command-line tools its instructions call (npm). Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*,npx:*).
SKILL.md names 1 domain. As links in the text: orm.drizzle.team. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Drizzle Migrations is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Drizzle Migrations: Better Drizzle (almeidazs/better-drizzle, 349 stars), Database Expert (cin12211/orca-q, 224 stars), Drizzle Orm Expert (davila7/claude-code-templates, 33k stars) and DB Review (312362115/claude, 107 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
bretzel-app (a GitHub organization) maintains it in bretzel-app/crumbs, which has 127 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 6, 2026.
Source: bretzel-app/crumbs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.