Agent skill · software engineering · lobehub
drizzle
Use for Drizzle schemas and queries: tables, indexes, relations, joins and inferred types. Rollout belongs to db-migrations.
Why this skill is useful
Provides specific naming conventions and schema patterns for Drizzle ORM that the AI wouldn't reliably generate on its own.
What it needs
About 8k tokens when loaded. Last updated 2026-08-07. 81,352 stars on the source repository.
What this skill does
Drizzle ORM Schema Style Guide Adding a Model or Repository? Ship a sibling test in the same PR — every new file under packages/database/src/models/ or src/repositories/ needs a matching tests/<name>.test.ts. See the testing skill (.agents/skills/testing/references/db-model-test.md) for the getTestDB() integration pattern, user-isolation tests, the BM25 describe.skipIf(!isServerDB) guard, and schema gotchas. CI's coverage patch gate won't reliably catch a brand-new untested file, so this is on you. Configuration Config: drizzle.config.ts Schemas: packages/database/src/schemas/ Migrations: packages/database/migrations/ Dialect: postgresql with strict: true Helper Functions Location: packages/database/src/schemas/helpers.ts timestamptz(name): Timestamp with timezone createdAt(), updatedAt(), accessedAt(): Standard timestamp columns timestamps: Object with all three for easy spread Naming Conventions Tables: Plural snake\case (users, sessiongroups) Columns: snake\case (userid, createdat) New tables: Check nearby existing tables before naming a new one. Preserve the established noun family and suffix. For example, if the user-scoped table is userxxxlogs, the workspace-scoped counterpart should be workspacexxxlogs, not workspacexxxrecords or another new synonym. Column Definitions Primary Keys Do not use auto-incrementing primary keys (serial, bigserial, generated identity columns). They create sequence-state problems during cross-database migrations, restores, and data copy jobs. Prefer text IDs from application generators (idGenerator, createNanoId) or uuid for internal tables. Keep $defaultFn(...) when a table normally owns ID generation. Callers can still pass an explicit id; the default only runs when the insert omits it. Do not remove the default just because one flow needs to supply a request-scoped ID. ID prefixes make entity types distinguishable. For internal tables, use uuid. Do not use composite primary keys on new tables. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills lobehub/drizzle--e0aa60