Db Commands
Explore 3 curated db commands for building with AI coding agents — what each one does, when to use it, and how to add it to your workflow.
Three slash commands for database work that is easy to get wrong. /db-migrate generates and applies a migration with your project's own migration tool, using expand-contract steps for breaking changes, lock-free DDL and a reversible up and down. /scaffold-pgvector-schema sets up a pgvector table and HNSW index for an embedding corpus, matched to your migration tooling, distance metric and embedding dimensions. /seed-data reads your actual schema and writes realistic, referentially consistent seed data plus a re-runnable script that inserts in foreign-key order.
/db-migrate and /scaffold-pgvector-schema edit files and can run commands, so review each migration before it reaches a shared database. /seed-data is for development and test databases only and is never aimed at production. Use /db-migrate for changes to existing tables, and /scaffold-pgvector-schema when you are adding vector search to Postgres.
3 commands
DB Migrate
Generate and apply a database migration the safe way — using the project's migration tool, with expand-contract discipline for breaking changes, lock-free DDL, and a reversible up/down.
Scaffold a pgvector Schema & HNSW Index
Scaffold a production-ready pgvector schema and HNSW index for a corpus — matching the project's migration tooling, distance metric, and embedding dimensions.
Seed Data
Generate realistic, referentially-consistent seed data and a re-runnable seed script from your actual schema — types and constraints respected, plausible values, FK-dependency insert order, idempotent, never aimed at production.