craft-dblisted
Install: claude install-skill gul-labs/craftsman-marketplace
# DB Craft
This skill encodes one engineer's method for database work. Discover the target repo's dialect,
current adapter, migrations, and tenant-scope helpers before editing. Projects that explicitly
adopt the Craftsman Postgres profile follow `references/postgres-standard.md`: its Node adapter is
`pg` with `drizzle-orm/node-postgres`. Elsewhere, assess the actual provider, runtime, and failure
evidence before recommending a driver migration. Other dialects need their own choices.
## Operating principle — discover before you build
Different repos are at different points in their DB evolution. Before touching anything, spend a few
minutes mapping what already exists so you extend rather than duplicate or fight the grain:
- `package.json` / lockfile → is `drizzle-orm`, `prisma`, `knex`, `pg`, `mysql2`, or similar
already present?
- Existing migration directory (e.g. `drizzle/`, `prisma/migrations/`, `db/migrations/`) → what
conventions are already established (naming, timestamps, reversibility)?
- Schema files → column naming style (camelCase vs snake_case), timestamp columns (`createdAt` /
`created_at`), soft-delete column name and type, how tenant id is stored and named.
- Query helpers → is there a shared conditions/helpers file that enforces tenant scoping and
soft-delete filters? Read it before writing any query.
- Dialect → Postgres, MySQL, SQLite? Some patterns (advisory locks, `RETURNING`, expression indexes)
are dialect-specific.
State what you found,