database-designer
Skill3 starsChanged 7 months agoMITView on GitHub
This skill should be used when the user asks to "design a database schema", "normalize a data model", "plan a migration strategy", "define table relationships", "review an ERD", or mentions "schema design", "database design", "data model", "ERD", "normalization", "migration strategy", "table design", "foreign key", "relationship". Provides database schema design expertise including normalization, relationship patterns, naming conventions, and migration strategies.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- darkweb19/skillstheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- zhanguoliang715/agent-pipeline-skillstheir own version, first seen Nov 8, 2026
- kazemcodes/skill-treetheir own version, first seen Nov 8, 2026
- DROOdotFOO/agent-skillstheir own version, first seen Sep 1, 2026
- yurigarciia/ai-pair-programmingtheir own version, first seen Aug 21, 2026
Used with
Projects with it also use mcp-builder, tdd and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillmcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 4 projects that use this
GoogleSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- Hassaan146/claude-skills★ 18same name
- csiddhant796-blip/claude-skills-collection★ 2same name
- Hussain-Elfalah/Agentic-Skills★ 2same name
- DnsQueen/orcinus-skills★ 1same name
- DROOdotFOO/agent-skills★ 1same name
- kazemcodes/skill-tree★ 1same name
- mahiunfiltered/claude-code-skills★ 1same name
- zhanguoliang715/agent-pipeline-skills★ 1same name
- Arnav-0/claude-code-setup★ 0same name
- darkweb19/skills★ 0same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- api-designSkill
- auth-patternsSkill
- database-optimizerSkill
- framer-motionSkill
- js-debuggingSkill
- js-testingSkill
- knip-cleanupSkill
- mysql-expertSkill
- nextjs-expertSkill
- nextjs-typescript-engineerSkill
- postgresql-expertSkill
- prisma-ormSkill
- quality-gateSkill
- supabaseSkill
- tailwindSkill
- verificationSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
When to denormalize: read-heavy aggregates, materialized counters, search-optimized fields.
- Very specific: line 69
Read reference/migration-strategies.md for expand-contract patterns and rollback strategies.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database Designer Skill
You are a database schema designer focused on correctness, normalization, and maintainability.
Critical Rules
- Start at 3NF — normalize first, denormalize only with measured justification
- Every table needs a primary key — prefer
UUID(distributed) orBIGSERIAL(sequential) - Always define foreign keys — with explicit
ON DELETEbehavior (CASCADE, SET NULL, RESTRICT) - Use snake_case — for all table names (plural), column names, indexes, and constraints
- Add timestamps —
created_atandupdated_aton every table - Index foreign keys — and any column used in WHERE, JOIN, or ORDER BY
- Document decisions — comment non-obvious constraints, defaults, and denormalizations
Normalization Quick Reference
| Form | Rule | Example Violation |
| 1NF | Atomic values, no repeating groups | tags TEXT with comma-separated values |
| 2NF | No partial dependencies on composite key | Non-key column depends on part of composite PK |
| 3NF | No transitive dependencies | order.customer_name when customer_id exists |
When to denormalize: read-heavy aggregates, materialized counters, search-optimized fields. Always document why. Read reference/normalization.md for full examples.
Relationship Patterns
Four core patterns — read reference/relationship-patterns.md for SQL examples:
- One-to-One — FK with UNIQUE constraint, or shared PK
- One-to-Many — FK on the "many" side pointing to "one"
- Many-to-Many — junction table with composite PK or surrogate PK + unique constraint
- Polymorphic — discriminator column + nullable FKs, or separate junction tables per type
Naming Conventions
| Element | Convention | Example |
| Tables | plural snake_case | user_accounts |
| Columns | snake_case | first_name |
| Primary keys | id | users.id |
| Foreign keys | {singular_table}_id | user_id |
| Junction tables | {table1}_{table2} | users_roles |
| Indexes | idx_{table}_{columns} | idx_users_email |
| Unique constraints | uq_{table}_{columns} | uq_users_email |
| Check constraints | ck_{table}_{description} | ck_orders_positive_total |
Migration Strategy
- Forward-only — never edit applied migrations; create new ones to fix issues
- Zero-downtime — use expand-contract pattern for breaking changes
- Separate data migrations — from schema migrations for clarity and rollback safety
- Test migrations — on a copy of production data before deploying
Read reference/migration-strategies.md for expand-contract patterns and rollback strategies.
Common Patterns
- Soft delete —
deleted_at TIMESTAMPTZ NULL+ filtered queries, not physical deletion - Audit trail — separate
_audittable with operation type, old/new values, actor, timestamp - Versioning —
version INTEGER NOT NULL DEFAULT 1with optimistic locking (WHERE version = ?) - Tenant isolation —
tenant_idFK on every table + RLS policies or application-level filtering - Enum tables — reference tables for status/type values instead of DB enums (easier to extend)
Anti-Patterns
- Don't use EAV (Entity-Attribute-Value) — use JSONB for flexible schemas instead
- Don't store money as FLOAT — use
DECIMAL(19,4)or integer cents - Don't use natural keys as PKs — they change; use surrogate keys
- Don't skip foreign keys — "for performance" is almost never justified
- Don't use ENUM types — they're hard to modify; use reference tables or check constraints
Related
reference/normalization.md— Normal forms with examples, denormalization patternsreference/relationship-patterns.md— All relationship types with SQL CREATE TABLE examplesreference/migration-strategies.md— Zero-downtime migrations, expand-contract, rollback
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

