db-design
FreeNo executable scriptsNot checkedDeep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and…
by jiaxiaojunQAQ★ 35 GitHub starsAbout this skill
DB Design
Good OLTP design balances integrity, write paths, query patterns, and evolution—not “third normal form everywhere.”
When to Offer This Workflow
Trigger conditions:
- Greenfield service schema or major new domain
- Performance or integrity issues from ad-hoc tables
- Multi-tenant isolation questions
Initial offer:
Use six stages: (1) domain & access patterns, (2) entities & relationships, (3) keys & constraints, (4) normalization trade-offs, (5) indexing & performance, (6) operations & evolution). Confirm RDBMS and scale expectations.
Stage 1: Domain & Access Patterns
Goal: List critical queries and writes: QPS, joins, filters, hot rows.
Exit condition: Top access paths ranked by business importance.
Stage 2: Entities & Relationships
Goal: ER model; cardinality; optional vs required relationships.
Practices
- Clear table names; avoid opaque “data” blobs unless documented
Stage 3: Keys & Constraints
Goal: Primary keys (surrogate vs natural); foreign keys with explicit ON DELETE policy; unique constraints for business rules.
Multi-tenant
tenant_idon rows that need isolation; composite keys or indexes as appropriate
Stage 4: Normalization Trade-offs
Goal: Normalize to reduce update anomalies; denormalize read hotspots with documented trade-offs.
Stage 5: Indexing & Performance
Goal: Indexes serve real queries; watch write amplification and index bloat.
Stage 6: Operations & Evolution
Goal: Migration strategy (expand/contract); backup/restore; PII columns flagged.
Final Review Checklist
- Access patterns drive schema
- Keys, FKs, and constraints explicit
- Multi-tenant isolation if applicable
- Normalization decisions justified
- Index plan aligned with queries
- Migration and ops considerations noted
Tips for Effective Guidance
- NULL semantics and defaults matter for bugs and migrations.
- Pair with db-migrate for online schema changes.
Handling Deviations
- Document stores: embed vs reference with consistency story.
Install db-design in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the db-design skill do?
Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.
How do I install the db-design skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the db-design skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic