database-schema-designer
Skill36 starsChanged 6 months agoMITView on GitHub
This skill should be used when designing database schemas for SQL or NoSQL databases. It provides normalization guidelines, indexing strategies, migration patterns, and performance optimization.
- Deletes or force-pushes
17 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- JPeetz/agent-skillstheir own version, first seen Sep 29, 2026
- OneWave-AI/claude-skillstheir own version, first seen Sep 21, 2026
- SkotAlexsander/skillstheir own version, first seen Sep 16, 2026
- MortuisVMain/ai-agent-superpowersedited, first seen Sep 15, 2026
- th-efool/SKILLStheir own version, first seen Aug 8, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
Used with
Projects with it also use skill-judge, agent-md-refactor and 4 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.
bamechoSkillskill-judge
Evaluate Agent Skill design quality against official specifications and best practices. Use when reviewing, auditing, or improving SKILL.md files and skill packages. Provides multi-dimensional scoring and actionable improvement suggestions.
Also in 3 projects that use this
softaworksSkillagent-md-refactor
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.
Also in 3 projects that use this
alirezarezvaniSkilldependency-auditor
Check dependencies for known vulnerabilities using npm audit, pip-audit, etc. Use when package.json or requirements.txt changes, or before deployments. Alerts on vulnerable dependencies. Triggers on dependency file changes, deployment prep, security mentions.
Also in 3 projects that use this
rogue-dev-studioSkillbrowser-automation
Canonical browser automation and web UI verification: Playwright, agent browser CLIs, and CDP-based tooling in one playbook.
Also in 3 projects that use this
lookfreeSkillexcalidraw
Generate architecture diagrams as .excalidraw files from codebase analysis. Use when the user asks to create architecture diagrams, system diagrams, visualize codebase structure, or generate excalidraw files.
Also in 3 projects that use this
AnthropicSkillpdf
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- softaworks/agent-toolkit★ 2.5k11% same
- digitalspeed/claude-code-skillset★ 111% same
- Typeless-Git/skills★ 111% same
- MortuisVMain/ai-agent-superpowers★ 011% same
- nbirkner/digital-brain★ 011% same
Wrote their own version · 12
- OneWave-AI/claude-skills★ 321same name
- nahisaho/MUSUBI★ 77same name
- Hassaan146/claude-skills★ 18same name
- JPeetz/agent-skills★ 10same name
- csiddhant796-blip/claude-skills-collection★ 2same name
- Hussain-Elfalah/Agentic-Skills★ 2same name
- Nikoxkx/Agent-Skills★ 2same name
- mahiunfiltered/claude-code-skills★ 1same name
- OpenBun/Skills★ 1same name
- SkotAlexsander/skills★ 1same 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 repository157 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a2ui-angularSkill
- accessibility-auditSkill
- adk-deploy-guideSkill
- adk-dev-guideSkill
- adk-eval-guideSkill
- adk-observability-guideSkill
- agentic-ai-coding-standardSkill
- agentic-ai-devSkill
- ai-auditSkill
- ai-chatSkill
- ai-decision-recordSkill
- ai-incident-responseSkill
- ai-launch-checkSkill
- ai-playbookSkill
- angular-best-practicesSkill
- angularSkill
- angular-spaSkill
- angular-ui-patternsSkill
- api-design-principlesSkill
- app-store-optimizationSkill
- architect-reviewSkill
- architecture-decision-recordsSkill
- architecture-designSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-release-flowSkill
- asc-signing-setupSkill
- asc-submission-healthSkill
- asc-testflight-orchestrationSkill
- browser-testingSkill
- changelog-generatorSkill
- claude-actions-auditorSkill
- clean-codeSkill
- codebase-onboardingSkill
- code-explainerSkill
- code-reviewerSkill
- code-simplifierSkill
- comment-analyzerSkill
- ddd-architectSkill
- decision-frameworksSkill
- dedup-code-agentSkill
- deployment-ci-cdSkill
- design-systemSkill
- dockerSkill
- documentation-generationSkill
- domain-finderSkill
- error-detectiveSkill
- eval-guideSkill
- feature-forgeSkill
- firebase-basicsSkill
- firebase-hosting-basicsSkill
- fixing-accessibilitySkill
- fixing-motion-performanceSkill
- flutter-animationsSkill
- flutter-genuiSkill
- flutter-mobileSkill
- flutter-security-expertSkill
- frontend-designSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 6 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 62
Add constraints -- read reference/constraints-and-relationships.md for patterns
- Very specific: line 64
Read reference/normalization-guide.md for 1NF/2NF/3NF rules and examples.
- Distinctive: line 69
Consider denormalization for read-heavy queries
- Distinctive: line 70
Add timestamps (created_at, updated_at)
- Very specific: line 78
Read reference/migration-patterns.md for zero-downtime patterns and rollback strategies.
- Very specific: line 80
Read reference/expand-contract-migrations.md for zero-downtime Expand-Contract strategy, CONCURRENTLY index operations, and batched SKIP …
- Distinctive: line 100
NEVER use these types — they have silent, hard-to-debug failure modes:
- Very specific: line 123
After designing a schema, run through reference/schema-design-checklist.md to verify completeness.
- Distinctive: line 127
Before generating schemas or queries, consult these sources:
- Distinctive: line 151
Migration conflicts: When migrations fail, check for column type mismatches or missing dependent migrations.
- Very specific: line 153
Index creation failures: Verify the column exists and data types support the index type.
- Very specific: line 158
Use plural table names (users, orders, payments)
- Distinctive: line 163
After writing SQL/migration code, dispatch this reviewer agent:
“Common” is measured: kept by at least 6 in 10 of the 11 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
Iron Law
NO SCHEMA MIGRATION WITHOUT A DOWN (ROLLBACK) SCRIPT AND AN INDEX ON EVERY FOREIGN KEY — unindexed FKs cause full table scans; irreversible migrations cause production incidents
Database Schema Designer
Design production-ready database schemas with best practices built-in.
Triggers
| Trigger | Example |
design schema | "design a schema for user authentication" |
database design | "database design for multi-tenant SaaS" |
create tables | "create tables for a blog system" |
schema for | "schema for inventory management" |
model data | "model data for real-time analytics" |
I need a database | "I need a database for tracking orders" |
design NoSQL | "design NoSQL schema for product catalog" |
Quick Reference
| Task | Approach | Key Consideration |
| New schema | Normalize to 3NF first | Domain modeling over UI |
| SQL vs NoSQL | Access patterns decide | Read/write ratio matters |
| Primary keys | INT or UUID | UUID for distributed systems |
| Foreign keys | Always constrain | ON DELETE strategy critical |
| Indexes | FKs + WHERE columns | Column order matters |
| Migrations | Always reversible | Backward compatible first |
Process
Phase 1: Analyze
- Identify entities and relationships
- Determine access patterns (read-heavy vs write-heavy)
- Choose SQL or NoSQL based on requirements
Phase 2: Design
- Normalize to 3NF (SQL) or determine embed/reference strategy (NoSQL)
- Define primary keys and foreign keys
- Choose appropriate data types -- read
reference/data-types-reference.mdfor type guides - Add constraints -- read
reference/constraints-and-relationships.mdfor patterns
Read reference/normalization-guide.md for 1NF/2NF/3NF rules and examples.
Phase 3: Optimize
- Plan indexing strategy -- read
reference/indexing-strategy.mdfor when to index and composite index rules - Consider denormalization for read-heavy queries
- Add timestamps (created_at, updated_at)
Phase 4: Migrate
- Generate migration scripts (up + down)
- Ensure backward compatibility
- Plan zero-downtime deployment
Read reference/migration-patterns.md for zero-downtime patterns and rollback strategies.
Read reference/expand-contract-migrations.md for zero-downtime Expand-Contract strategy, CONCURRENTLY index operations, and batched SKIP LOCKED backfills.
NoSQL Design
For MongoDB, Firestore, and other document databases, read reference/nosql-design-patterns.md for embedding vs referencing patterns and Firestore-specific design rules.
Commands
| Command | When to Use |
design schema for {domain} | Start fresh -- full schema generation |
normalize {table} | Fix existing table -- apply normalization rules |
add indexes for {table} | Performance issues -- generate index strategy |
migration for {change} | Schema evolution -- create reversible migration |
review schema | Code review -- audit existing schema |
Anti-Patterns
PostgreSQL Type Forbidden List
NEVER use these types — they have silent, hard-to-debug failure modes:
| Forbidden type | Problem | Use instead |
timestamp (no tz) | Stores local time, breaks across timezones | timestamptz |
timetz | Doesn't handle DST — reports wrong time after clock changes | timestamptz |
char(n) / varchar(n) | char pads with spaces, silently breaks equality checks | text |
money | Locale-dependent formatting, rounding errors across servers | numeric |
serial | Sequence ownership breaks on pg_dump/restore | generated always as identity |
float for money | Binary floating-point rounding errors | numeric(10,2) |
Schema Anti-Patterns
| Avoid | Why | Instead |
| VARCHAR(255) everywhere | Wastes storage, hides intent | Size appropriately per field |
| Missing FK constraints | Orphaned data | Always define foreign keys |
| No indexes on FKs | Slow JOINs | Index every foreign key |
| Storing dates as strings | Cannot compare/sort | DATE, TIMESTAMPTZ types |
| Non-reversible migrations | Cannot rollback | Always write DOWN migration |
Verification
After designing a schema, run through reference/schema-design-checklist.md to verify completeness.
Documentation Sources
Before generating schemas or queries, consult these sources:
| Source | URL / Tool | Purpose |
| PostgreSQL | PostgreSQL MCP server | Schema-aware SQL, introspection, admin-safe workflows |
| Firebase Firestore | Firebase MCP server | Document design, rules, indexes for NoSQL schemas |
Reference Files
| File | Contents |
reference/schema-design-checklist.md | Pre-design, table design, and deployment checklist |
reference/normalization-guide.md | 1NF/2NF/3NF explanations, examples, denormalization guide |
reference/data-types-reference.md | String, numeric, date/time, JSON type guides |
reference/indexing-strategy.md | When to index, composite indexes, B-tree vs hash, EXPLAIN |
reference/constraints-and-relationships.md | PKs, FKs, CHECK, UNIQUE, relationship patterns |
reference/nosql-design-patterns.md | MongoDB/Firestore embedding vs referencing |
reference/migration-patterns.md | Zero-downtime migrations, rollback strategies |
reference/expand-contract-migrations.md | Expand-Contract pattern, CONCURRENTLY index ops, SKIP LOCKED backfills |
assets/templates/migration-template.sql | SQL migration file template |
reference/postgresql-review-checklist.md | PostgreSQL review checklist (used by postgresql-database-reviewer agent) |
Error Handling
Migration conflicts: When migrations fail, check for column type mismatches or missing dependent migrations. Never modify an applied migration — create a new corrective one.
Index creation failures: Verify the column exists and data types support the index type. For large tables, use CREATE INDEX CONCURRENTLY.
Hard Prohibitions
- No
DROP TABLEorDROP COLUMNwithout explicit human approval - Use plural table names (
users,orders,payments) - Database credentials rotated every 90 days (see
security-review-checklist.md§8)
Post-Code Review
After writing SQL/migration code, dispatch this reviewer agent:
postgresql-database-reviewer— query optimization, schema correctness, index coverage, security
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.

