drizzle-postgres
Skill23 starsChanged 7 days agoMITView on GitHub
Change, generate, push, and verify PostgreSQL schemas managed with Drizzle ORM, including PostGIS exclusions and schema verification. Use when adding or altering tables, columns, enums, indexes, or foreign keys, or debugging drizzle-kit push or migration CI failures.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- anis-dr/skillstheir own version, first seen Oct 15, 2026
- FelipeAngeli/skillstheir own version, first seen Apr 10, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- anis-dr/skills★ 4same name
- FelipeAngeli/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-autonomous-loopsSkill
- agents-correctSkill
- agents-create-verification-skillSkill
- agents-reflectSkill
- agents-swarmSkill
- alchemy-infraSkill
- cloudflare-edge-hardeningSkill
- cloudflare-gradual-releaseSkill
- comms-howSkill
- comms-impactSkill
- comms-interrogateSkill
- comms-promo-videoSkill
- comms-slidesSkill
- comms-technical-writingSkill
- comms-unslopSkill
- comms-whySkill
- effect-boundary-validationSkill
- effect-seam-migrationSkill
- effectSkill
- eng-agent-dx-cli-scaleSkill
- eng-ai-featuresSkill
- eng-benchmark-checklistSkill
- eng-blast-radiusSkill
- eng-change-checklistSkill
- eng-cutover-verificationSkill
- eng-data-backward-compatSkill
- eng-migrationSkill
- eng-monorepoSkill
- eng-qa-cujsSkill
- eng-state-machineSkill
- eng-tddSkill
- eng-testingSkill
- gh-ci-triageSkill
- gh-issue-burndownSkill
- gh-pr-commit-reviewSkill
- gh-pr-feedback-loopSkill
- nix-darwinSkill
- reg-suitSkill
- sentry-bugfixSkill
- sentry-perfSkill
- seo-coachSkill
- svelte-shadcnSkill
- svelte-ui-deliverySkill
- ui-audit-loopSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Treat the schema package as the single source of truth for tables, enums, constraints, and relations.
- Very specific: line 18
When a transition cannot be expressed by drizzle-kit push (such as a column rename or adopting an existing constraint), add an idempotent …
- Very specific: line 24
When PostGIS is installed, keep PostGIS system tables excluded via tablesFilter in drizzle.config.
- Distinctive: line 25
Never renumber, edit, or delete an applied migration file, even when existing migration numbering has gaps or duplicates.
- Very specific: line 26
Keep one scoped connection pool in the database service.
- Distinctive: line 33
Check CI migration step summaries first when a remote migration fails.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database schema with Drizzle and PostgreSQL
Treat the schema package as the single source of truth for tables, enums, constraints, and relations.
Repo facts (from AGENTS.md): schema package path and entrypoints, build, generate, push, and migrate commands, post-push schema verification script, pre-push script path, secret-injection wrapper and env vars, PostGIS usage, and CI migration job.
Change the schema
- Edit or add the domain table file, re-export it from the package's schema entrypoint, and update relations when needed.
- Scope every tenant-owned table by its owning tenant identifier and index the columns queries filter on.
- Build the schema package first when
drizzle.configreads compiled output (dist/), then generate the SQL migration file. Generation does not require a live database. - Apply the change to a local database you own. Require explicit authorization before running migrations against shared or production databases.
- When a transition cannot be expressed by
drizzle-kit push(such as a column rename or adopting an existing constraint), add an idempotent step to the repo's pre-push script with aTODOnaming its removal condition.
Hazards
drizzle-kit pushcan exit 0 after SQL errors. Read its output, and run a post-push schema verification check against the live catalog so any missing table, column, key, constraint, or index fails the migration. Extend that verification through the schema, never by hand-editing expectations.- A composite foreign key must reference a
unique()constraint rather than auniqueIndex().drizzle-kit pushcreates indexes after foreign keys, so referencing a unique index fails on fresh databases. - When PostGIS is installed, keep PostGIS system tables excluded via
tablesFilterindrizzle.config. Generated columns and PostGIS column types can re-diff on every push, so a type diff alone does not prove a failure. - Never renumber, edit, or delete an applied migration file, even when existing migration numbering has gaps or duplicates.
- Keep one scoped connection pool in the database service. Keep
DATABASE_URLin the secret store, never print or commit it, and redact connection URLs in logs.
Verify
- Type check the schema package and every app that imports it.
- Push to a fresh local database and confirm schema verification passes with no missing objects.
- Inspect the generated SQL migration so it matches the schema change and nothing else.
- Check CI migration step summaries first when a remote migration fails; verification errors name the exact missing objects.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

