mcpField
R
relational-database-design

relational-database-design

github.com/pproencaData & databases21875 installsUpdated 11w ago
Repository

About relational-database-design

A skill for designing and reviewing relational schemas at the logical level, independent of any RDBMS. Its rules cover tables, fields, keys, relationships, and integrity while leaving physical implementation concerns out of scope.

Key features

  1. 01RDBMS-agnostic logical design
  2. 02Guidance for tables and fields
  3. 03Candidate, primary, and foreign key rules
  4. 04Relationship and deletion-rule modeling
  5. 05Integrity constraints, validation tables, and views
  6. 06Antipattern and terminology references

Use cases

  1. 01Design a schema from requirements
  2. 02Review or refactor an existing schema
  3. 03Resolve repeating groups and redundant data
  4. 04Diagnose schema-related data loss or corruption

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill relational-database-design

After installing, type/relational-database-designin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
gotchas.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
anti-bend-rules-only-deliberately.md
anti-flat-file-design.md
anti-rdbms-driven-design.md
anti-spreadsheet-as-database.md
fld-clear-singular-field-names.md
fld-derive-dont-store-calculated-values.md
fld-ideal-field-checklist.md
fld-keep-fields-atomic.md
fld-store-single-values-not-lists.md
intg-database-vs-application-rules.md
intg-field-specifications.md
intg-four-levels-of-data-integrity.md
intg-validation-tables-for-allowed-values.md
intg-views-for-derived-and-restricted-data.md
key-candidate-key-elements.md
key-foreign-key-mirrors-its-primary-key.md
key-one-primary-key-per-table.md
key-prefer-stable-non-sensitive-keys.md
proc-analyze-and-interview-before-designing.md
proc-design-logically-before-choosing-rdbms.md
proc-follow-the-design-sequence.md
proc-normalization-is-built-in.md
proc-start-from-mission-and-objectives.md
rel-deletion-rule-guards-orphans.md
rel-foreign-key-on-the-many-side.md

Details

From the project README

Relational Database Design

A logical, RDBMS-agnostic method for designing sound relational databases — the decisions a schema forces and how a disciplined logical-design methodology settles them, written so an agent applies them while designing or reviewing a schema. Each rule names a specific wrong default it corrects; there is no rule for things the model already gets right.

The whole method produces the logical structure first — the tables, fields, keys, relationships, and integrity rules an organization's information requires — deliberately independent of any particular RDBMS product or physical/performance concern. Followed faithfully, it yields fully normalized tables without treating normalization as a separate back-end phase.

When to Apply

  • Designing a new relational schema from requirements
  • Reviewing or refactoring an existing schema for structural soundness
  • Resolving repeating groups, multivalued/multipart fields, or redundant data
  • Choosing candidate, primary, and foreign keys for a table
  • Modeling one-to-one, one-to-many, many-to-many, or self-referencing relationships
  • Deciding deletion rules (restrict, cascade, nullify, deny, set default) and participation constraints
  • Deciding where a constraint belongs — field spec, relationship, validation table, or application
  • Diagnosing a schema that duplicates, loses, or corrupts data

This skill covers logical design. It does not cover SQL dialects, indexing, partitioning, query tuning, or analytical/dimensional (star-schema) modeling — those are physical/implementation concerns handled after the logical design is sound.

Rule Categories

#CategoryPrefixCovers
1Design Process & Requirementsproc-Design logically before choosing an RDBMS, follow the sequence, drive from mission + analysis, normalization is built in
2Table Structuretbl-One subject per table, the ideal table, no reference fields, minimal redundancy
3Field Designfld-The ideal field, single values, atomic fields, no stored calculations, clear names
4Keyskey-Candidate key elements, one primary key per table, foreign keys mirror primary keys, stable non-sensitive keys
5Relationshipsrel-Junction tables for many-to-many, foreign-key placement, deletion rules, participation, self-referencing
6Data Integrity, Rules & Viewsintg-The four integrity levels, field specifications, database-vs-application rules, validation tables, views
7Antipatternsanti-Flat-file, spreadsheet-as-database, RDBMS-driven design, when bending the rules is defensible
8Terminologyterm-Data vs information, nulls, core relational vocabulary

Quick Reference

1. Design Process & Requirements
2. Table Structure
3. Field Design
4. Keys
5. Relationships
6. Data Integrity, Rules & Views
7. Antipatterns
8. Terminology

How to Use

Read a reference file when its decision comes up. Each rule names the wrong default it corrects, then shows the canonical way (with an incorrect/correct contrast only where the wrong way is a real trap).

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and source references

Comments

Markdown supported