← ClaudeAtlas

craft-dblisted

The Craftsman standard for database work — schema design, migrations, query writing, indexing, and multi-tenant data scoping. Use this WHENEVER the work touches the database in any form: designing or changing schema, writing migrations, modeling tables or relations, writing or optimizing queries, adding indexes, handling soft-deletes, scoping data to a tenant, or wiring up connection pooling. Trigger even when the user only says "add a column", "this query is slow", "design the data model", or "write a migration" without naming an ORM or dialect.
gul-labs/craftsman-marketplace · ★ 1 · AI & Automation · score 74
Install: claude install-skill gul-labs/craftsman-marketplace
# DB Craft This skill encodes one engineer's standard for database work, applied the same way across every repo. The **method and opinions** live here; the **specifics** (which ORM, which dialect, which migration tool, what the tenant-scope helper is called) live in the target repo — always discover them first, never assume or hardcode. ## 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, then propose the smallest set of changes that achieves the goal. ## The data layers (work in this order) 1. **Schema design** — model the domain co