database-design
Build well-structured database schemas from requirements through deployment. This skill guides you through normalization, relationship design, index optimization, and reversible migrations—covering relational databases like PostgreSQL and MySQL, document stores like MongoDB, and ORMs including Prisma, Drizzle, and TypeORM.
Database Design helps you create normalized schemas with safe migrations and optimized queries across relational and document databases.
AI-generated summary based on this skill's SKILL.md
Install
srstomp/pokayokay/database-design · repository language: Shell
git clone https://github.com/srstomp/pokayokay
cp -r pokayokay/plugins/pokayokay/skills/database-design ~/.claude/skills/database-designnpx skillfed install srstomp/pokayokay/database-designFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I design a database schema that follows best practices?
database-design guides you through schema creation by starting with normalization principles to eliminate redundancy, then defining clear relationships (one-to-many, many-to-many) with proper foreign keys and constraints. The skill covers entity-relationship modeling, choosing appropriate data types, and planning for indexing needs upfront. You'll learn to review your design against integrity requirements before implementation, whether you're building for PostgreSQL, MySQL, MongoDB, or another store.
What's the safest approach to database migrations in production?
database-design teaches reversible migration strategies that minimize downtime and risk. Key practices include writing migrations that can be rolled back, deploying schema changes separately from application code, and using zero-downtime techniques like adding columns as nullable before backfilling. The skill covers migration tooling within ORMs like Prisma, Drizzle, and TypeORM, plus standalone migration runners, so you can execute changes safely across environments.
How can I optimize slow database queries through indexing?
database-design covers query optimization by teaching you to analyze execution plans, identify missing or inefficient indexes, and understand index trade-offs (speed vs. write cost). You'll learn when to index on single columns versus composite indexes, how to avoid common pitfalls like the N+1 query problem, and techniques for denormalization when normalization hurts performance. The skill applies to both SQL and document stores.
Should I use Prisma, TypeORM, or Drizzle for my project?
database-design helps you evaluate ORMs by comparing their schema design approaches, migration capabilities, query APIs, and type safety. Prisma excels at developer experience and type generation; TypeORM offers decorator-based patterns; Drizzle provides lightweight SQL-like syntax. The skill guides you through trade-offs in learning curve, performance, and flexibility so you can choose the right fit for your application's needs and team expertise.
What does database normalization mean and when should I break it?
database-design explains normalization as the process of organizing data to reduce redundancy through normal forms (1NF through 3NF). This prevents anomalies and keeps updates efficient. However, the skill also covers denormalization—intentionally breaking normalization rules by duplicating or combining data—when read performance is critical and update frequency is low. You'll learn to measure trade-offs and apply denormalization strategically, not by default.
How do I audit an existing database design for problems?
database-design provides a review framework covering relationship integrity, missing or redundant indexes, normalization violations, and constraint gaps. You'll learn to spot anti-patterns like missing foreign keys, implicit many-to-many relationships, and columns that should be separate tables. The skill helps you prioritize fixes by impact, plan safe refactoring, and document design decisions so future changes stay aligned with your data model.
SKILL.md
rendered from the published skill — quoted content, verbatim
Database Design
Design efficient, maintainable database schemas with safe migration strategies.
Key Principles
- Start from requirements: identify entities, attributes, and relationships first
- Normalize for data integrity, denormalize selectively for read performance
- Design indexes based on actual query patterns, not guesses
- Migrations must be reversible and safe for zero-downtime deployments
- Choose the right ORM — Prisma for type safety, Drizzle for SQL-close, TypeORM for enterprise
Quick Start Checklist
- Identify entities and relationships from requirements
- Design normalized schema (3NF minimum)
- Add indexes for known query patterns
- Plan migration strategy (up + down)
- Choose ORM/query builder based on project needs
- Set up seed data for development
References
| Reference | Description |
|---|---|
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 9 files
plugins/pokayokay/skills/database-design/SKILL.md
plugins/pokayokay/skills/database-design/references/index-design.md
plugins/pokayokay/skills/database-design/references/migration-strategies.md
plugins/pokayokay/skills/database-design/references/postgresql.md
plugins/pokayokay/skills/database-design/references/prisma-patterns.md
plugins/pokayokay/skills/database-design/references/query-optimization.md
plugins/pokayokay/skills/database-design/references/review-checklist.md
plugins/pokayokay/skills/database-design/references/schema-patterns.md
plugins/pokayokay/skills/database-design/references/tdd-patterns.md