skills/drizzle/SKILL.md
Manage Drizzle ORM and drizzle-kit workflows for this repo, including schema generation, pushing migrations, and reset flows. Use when working with Drizzle, drizzle-kit, database schema changes, or migration resets.
npx skillsauth add morgs32/skills drizzleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
drizzle.config.empty.ts filedrizzle.config.empty.ts is a minimal drizzle-kit config that loads DATABASE_URL (preferring .env.local for non-production) and defines the target schema as itself. This config is used as a safe "empty schema" so drizzle-kit push --force can reset the database to no tables.
import * as dotenv from "dotenv"
import { defineConfig } from "drizzle-kit";
dotenv.config()
if (process.env.NODE_ENV !== "production") {
dotenv.config({ path: ".env.local" })
}
if (!process.env.DATABASE_URL) {
throw new Error("DATABASE_URL is not set")
}
export default defineConfig({
dbCredentials: {
url: process.env.DATABASE_URL,
},
dialect: "postgresql",
schema: './drizzle.config.empty.ts',
});
Here's the script to reset the db then:
npx drizzle-kit push --force --config ./drizzle.config.empty.ts
Use these scripts from package.json:
pnpm generate: generate SQL migrations from the Drizzle schemapnpm push: push the current schema to the databasepnpm reset: force-reset the database using drizzle.config.empty.tspnpm studio: open Drizzle Studio{
"scripts": {
"generate": "drizzle-kit generate",
"push": "drizzle-kit push",
"reset": "npx drizzle-kit push --force --config ./drizzle.config.empty.ts",
"studio": "drizzle-kit studio"
}
}
development
Create and map ZerospinError instances for Effect-based code in zerospin. Use when defining error codes/messages, wrapping causes, mapping/catching errors in Effects, or returning structured errors from Effect.gen/Effect.fn or promise boundaries.
data-ai
Update agent skills in this repo or another.
development
TypeScript type-safety rules and guidance.
devops
Fix and update Turborepo (Turbo) configuration and task setup. Use for turbo.json errors, schema updates (pipeline -> tasks), and package-level config issues like missing extends.