Skip to content
Skills Library
Programming · Building & coding

schema-design

/schema-design

Design database schemas that stay correct under growth and change. Use when creating tables, modeling relationships, or planning schema migrations.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Design database schemas that stay correct under growth and change. Use when creating tables, modeling relationships, or planning schema migrations.

Original author description

Design database schemas that stay correct under growth and change. Use when creating tables, modeling relationships, or planning schema migrations.

How it works

  1. Method
  2. Litmus tests
Original SKILL.md headings · 48 lines, 373 words
SKILL.md preview
---
name: schema-design
description: Design database schemas that stay correct under growth and change. Use when creating tables, modeling relationships, or planning schema migrations.
---

# Schema design

The schema outlives every application that reads it. Model the domain's
truths, enforce them in the database, and leave a migration path, because
requirements will change and the data must survive the change.

## Method

1. **Model nouns and their real relationships first,** on paper: what
   things exist, what identifies them, how they relate (one-to-many,
   many-to-many), and which facts must always hold ("an order always has a
   customer", "an email is unique per workspace"). The invariants list is
   the schema's spec.
2. **Enforce invariants in the database, not in hope:** primary keys,
   foreign keys with deliberate on-delete behavior (cascade only where the
   child is meaningless without the parent), NOT NULL by default with null
   as a considered exception, unique constraints for real-world
   uniqueness, checks for closed sets and ranges. Application-level
   enforcement alone lasts until the second writer shows up.
3. **Choose keys and types for the long run:** synthetic ids for
   stability (natural keys drift), the precise type over the permissive
   one (timestamps with timezone, decimal for money, never float),
   text with constraints over enum columns that need migrations to extend,
   normalized by default with duplication only as a measured performance
   decision that names its sync strategy.
4. **Design the access paths with the schema:** the queries the product
   will actually run decide the indexes (foreign keys, filter columns,
   sort columns). Every index taxes writes; every missing one taxes reads.
   Write the top five queries down before finalizing.
5. **Migrate in expand-and-contract:** add the new column or table, write
   both, backfill in batches, switch reads, then drop the old in a later
   release. A destructive step (drop, rename, type change) ships only when
   nothing running still touches the old shape, and never inside the same
   deploy that introduces the new one.
6. **Plan the deletes on day one.** Soft delete or hard, retention rules,
   cascade blast radius: deciding at delete time means deciding during an
   incident.

## Litmus tests

- Can bad data exist? For each invariant, could a raw INSERT violate it?
  If yes, the database is not enforcing it.
- Could you run yesterday's application against today's schema during a
  rolling deploy?
- Does every relationship have a defined answer to "what happens when the
  parent goes away?"

Versions

RepositoryScoreLicence
This page · Amey-Thakur/AI-SKILLS90MIT
tonone-ai/tonone100MIT
butterbase-ai/butterbase-skills95MIT
nahid-sparktales/agent-dispatcher90MIT

Database snapshot: 13.11.2026 · package version 7a7268901e8c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100designing-database-schemas
    Process use when you need to work with database schema design. This skill provides schema design and migrations with comprehensive guidance and automation. Trigger with phrases like "design schema", "create migration", or "model database".
  • 100designing-database-schemas
    Process use when you need to work with database schema design. This skill provides schema design and migrations with comprehensive guidance and automation. Trigger with phrases like "design schema", "create migration", or "model database".
  • 100database-schema-designer
    Use when the user asks to create ERD diagrams, normalize database schemas, design table relationships, or plan schema migrations.
  • 100database-schema-design
    Design normalized database schemas with tables, relationships, indexes, and constraints for any application domain. Use when the user requests database schema design or provides relevant inputs for this workflow.
  • 100database-schema-design
    Designs relational and document database schemas, covering entities, keys, constraints, data types, multi-tenancy, soft deletes, audit columns and access-pattern modeling for NoSQL. Use when doing schema design or data modeling, creating new tables or collections, designing the…
  • 100database-schema-design
    Designs normalized database schemas with migration scripts, indexing strategies, and relationship handling. Supports SQL, Flyway, Liquibase, and Prisma. Triggers on: "design database", "create schema", "database migration", "design tables".

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.