Agent skill · software engineering · erichowens
database-design-patterns
Schema design, normalization decisions, indexing strategies, and migration safety for relational databases. Use when designing tables, choosing between normalize vs denormalize, selecting index
Why this skill is useful
Provides specific normalization strategies and indexing patterns that the AI wouldn't reliably generate on its own.
What it needs
About 7k tokens when loaded. Last updated 2026-07-14. 180 stars on the source repository.
What this skill does
Database Design Patterns Relational database schema design expert. Covers normalization decisions, index selection, migration safety, and connection pooling — the structural foundations that determine whether a database performs well at scale or becomes a maintenance burden. When to Use Use for: Designing new schemas or refactoring existing ones Deciding whether to normalize or denormalize for a specific query pattern Choosing index types (B-tree, GIN, GiST, hash, partial, covering) Planning migrations that must not break running production systems Implementing soft deletes, polymorphic associations, or composite keys Configuring PgBouncer or Prisma connection pools NOT for: Running EXPLAIN ANALYZE or reading query plans → use postgresql-optimization Document model design (MongoDB, DynamoDB) → use a NoSQL skill Database provisioning, replicas, or infrastructure → use a cloud/infra skill ORM-specific code generation → use the relevant ORM skill --- Normalize vs. Denormalize Decision Tree The rule: Start at 3NF. Denormalize only after measuring, and only the specific join that is provably too slow. Never denormalize speculatively. --- Index Selection Decision Tree Always index: Every foreign key column (prevents full table scans on joins) Columns that appear in WHERE, ORDER BY, or JOIN ON clauses in frequent queries Composite indexes: put the most selective column first Consult references/indexing-strategies.md when choosing between partial vs. covering indexes or tuning multi-column index column order. --- Migration Safety Decision Tree Consult references/migration-patterns.md for expand-contract templates, lock timeout settings, and rollback strategies. --- Normalization Reference 1NF — No Repeating Groups Each column holds one value. No comma-separated lists in a column. 2NF — No Partial Dependencies (composite PKs only) Every non-key column depends on the whole primary key, not just part of it. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills erichowens/database-design-patterns