---
name: database-design
description: ALWAYS use this when the hard part is schemas, relationships, constraints, indexes, data integrity, query shape, or migration-safe data modeling.
Database Design
Selective Reading Rule
Start with:
references/usage-routing.md
references/quality-checklist.md
Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.
Learn to THINK, not copy SQL patterns.
Supplementary References
Start with:
references/senior-master-standard.md
references/schema-routing.md
references/migration-safety.md
Then load only the root markdown files that match the actual database question.
đŸ¯ Selective Reading Rule
Read ONLY files relevant to the request! Check the content map, find what you need.
File
Description
When to Read
database-selection.md
PostgreSQL vs Neon vs Turso vs SQLite
Choosing database
orm-selection.md
Drizzle vs Prisma vs Kysely
Choosing ORM
schema-design.md
Normalization, PKs, relationships
Designing schema
indexing.md
Index types, composite indexes
Performance tuning
optimization.md
N+1, EXPLAIN ANALYZE
Query optimization
migrations.md
Safe migrations, serverless DBs
Schema changes
â ï¸ Core Principle
ASK user for database preferences when unclear
Choose database/ORM based on CONTEXT
Don't default to PostgreSQL for everything
Decision Checklist
Before designing schema:
Asked user about database preference?
Chosen database for THIS context?
Considered deployment environment?
Planned index strategy?
Defined relationship types?
Anti-Patterns
⌠Default to PostgreSQL for simple apps (SQLite may suffice)
⌠Skip indexing
⌠Use SELECT * in production
⌠Store JSON when structured data is better
⌠Ignore N+1 queries
1---2name: database-design3description: ---4---5---6name: database-design7description: ALWAYS use this when the hard part is schemas, relationships, constraints, indexes, data integrity, query shape, or migration-safe data modeling.8---910# Database Design1112## Selective Reading Rule1314Start with:1516- `references/usage-routing.md`17- `references/quality-checklist.md`1819Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.2021> **Learn to THINK, not copy SQL patterns.**2223## Supplementary References2425Start with:2627- `references/senior-master-standard.md`28- `references/schema-routing.md`29- `references/migration-safety.md`3031Then load only the root markdown files that match the actual database question.3233## đŸ¯ Selective Reading Rule3435**Read ONLY files relevant to the request!** Check the content map, find what you need.3637| File | Description | When to Read |38|------|-------------|--------------|39| `database-selection.md` | PostgreSQL vs Neon vs Turso vs SQLite | Choosing database |40| `orm-selection.md` | Drizzle vs Prisma vs Kysely | Choosing ORM |41| `schema-design.md` | Normalization, PKs, relationships | Designing schema |42| `indexing.md` | Index types, composite indexes | Performance tuning |43| `optimization.md` | N+1, EXPLAIN ANALYZE | Query optimization |44| `migrations.md` | Safe migrations, serverless DBs | Schema changes |4546---4748## â ï¸ Core Principle4950- ASK user for database preferences when unclear51- Choose database/ORM based on CONTEXT52- Don't default to PostgreSQL for everything5354---5556## Decision Checklist5758Before designing schema:5960- [ ] Asked user about database preference?61- [ ] Chosen database for THIS context?62- [ ] Considered deployment environment?63- [ ] Planned index strategy?64- [ ] Defined relationship types?6566---6768## Anti-Patterns6970⌠Default to PostgreSQL for simple apps (SQLite may suffice)71⌠Skip indexing72⌠Use SELECT * in production73⌠Store JSON when structured data is better74⌠Ignore N+1 queries
Run npx skillmds@latest add anhvu1107/database-design in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
--- It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
anhvu1107 (@anhvu1107) published this skill. Their other Agent Skills are listed on their SkillMD profile.