database-design

Installation
SKILL.md

Database Design — Schema & Architecture Mastery


Mandatory Pre-Flight Context Inspection

Before designing schemas or writing SQL migrations, you MUST inspect:

  1. Timezone Timestamp Standard → Always use TIMESTAMPTZ; ban bare TIMESTAMP
  2. Primary Key B-Tree Locality → Use BIGINT GENERATED ALWAYS AS IDENTITY or UUID v7 (RFC 9562); ban random UUID v4 as primary keys on high-insert tables
  3. Foreign Key Indexing → Explicitly create indexes on all foreign key columns (CREATE INDEX idx_... ON table(fk_id)) to prevent full table locks during cascading operations
  4. Zero-Downtime Migration Pattern → Use the expand-contract pattern; never rename columns or drop columns in a single deploy step

Activation Boundaries

  • Activate when: Designing database relational schemas, writing database migrations, indexing query paths, tuning connection pooling, and architecting persistence layers.
  • DO NOT activate when: Writing frontend UI components, styling layouts, or handling client-side state.

2026 Database Performance & Schema Invariants

Installs
3
GitHub Stars
7
First Seen
Apr 26, 2026