Agent skill
drizzle
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.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/drizzle
SKILL.md
Drizzle
Add a drizzle.config.empty.ts file
drizzle.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
Quick Start
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 usingdrizzle.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"
}
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?