What problem does it solve?
Database code often ships with unversioned schema changes, missing transactions, N+1 queries, and weak constraints that cause data corruption and slow queries in production. This Skill gives the AI a strict checklist of database engineering rules so migrations, transactions, indexes, and integrity constraints are handled correctly before delivery.
Core Features & Use Cases
- Migration Discipline: Requires all schema changes to go through timestamped, reversible migration files (up + down) validated in staging before production.
- Transaction & Index Rules: Enforces transactions for multi-table writes, minimal transaction scope, fixed lock ordering to prevent deadlocks, and leftmost-prefix composite indexing.
- Data Integrity Checks: Mandates foreign keys, NOT NULL with defaults, unique constraints, and a consistent soft-delete vs hard-delete policy.
- Use Case: When adding a new orders feature with Prisma or TypeORM, the AI will first design the data model and rollback plan, write a reversible migration, wrap multi-table writes in a transaction, and add indexes on query filter columns.
Quick Start
Ask the AI to design the schema and write a reversible migration with proper indexes and transactions for a new orders table using your ORM.