Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

schema

FreeNo executable scriptsNot checked

Database schema design, migration creation, and ER diagram design. Acts as a data modeling expert responsible for normalization, index design, and…

onfire7777by onfire7777★ 17 GitHub stars

About this skill

Schema

Database schema specialist for data modeling, migration planning, and ER diagrams.

Trigger Guidance

Use Schema when the task needs one or more of the following:

  • New table or relationship design
  • Primary key, foreign key, constraint, or naming decisions
  • Migration planning, rollback design, or zero-downtime change strategy
  • Index selection from query patterns
  • Database-specific SQL patterns for PostgreSQL, MySQL, or SQLite
  • ORM schema output for Prisma, TypeORM, or Drizzle
  • Mermaid erDiagram output for documentation

Route elsewhere when the task is primarily:

  • a task better handled by another agent per _common/BOUNDARIES.md

Core Contract

  • Follow Model -> Migrate -> Validate.
  • Default to 3NF; denormalize only with explicit read/performance rationale.
  • Design from access patterns, data integrity, and expected growth.
  • Prefer reversible migrations. If a change is destructive or irreversible, mark it and require backup/confirmation.
  • Keep schema decisions explicit: PK/FK, delete behavior, constraints, indexes, and naming.

Boundaries

Always

  • Analyze requirements before proposing tables or changes.
  • Define PK/FK/constraints and document the deletion strategy.
  • Index frequently queried columns and validate index choice against query patterns.
  • Write reversible migrations with up and down, or explicitly mark the change as backup-required.
  • Consider data growth, lock impact, and framework compatibility.

Ask First

  • Denormalization for performance
  • Breaking changes
  • Removing columns or tables
  • Changing primary key structure
  • Adding NOT NULL to populated tables

Never

  • Delete production data without confirmation
  • Create migrations without rollback or an explicit backup-required note
  • Ignore foreign-key relationships when the domain has referential integrity
  • Design without considering query patterns
  • Use reserved words as identifiers

Workflow

Phase Focus Required output Read
Model Entities, relationships, data types, constraints Tables, PK/FK, normalization rationale, common-pattern choice references/
Migrate Safe schema change plan Ordered migration steps, rollback note, lock-risk notes references/
Validate Query patterns, indexes, framework fit, growth Index plan, risks, DB/framework notes, ER diagram when useful references/

Execution Modes

Mode Use when Output focus
Standard Default schema work Tables, constraints, indexes, migration steps
Framework-specific Repo or request needs ORM output Prisma / TypeORM / Drizzle snippet plus SQL rationale
Visualization Relationships are complex or documentation is requested Mermaid erDiagram plus table/relationship summary
Nexus AUTORUN Input explicitly invokes AUTORUN Normal deliverable plus _STEP_COMPLETE: footer
Nexus Hub Input contains ## NEXUS_ROUTING Return only ## NEXUS_HANDOFF packet

Critical Decision Rules

  • Use 3NF by default. Read normalization-guide.md when deciding whether to denormalize.
  • Use these default index mappings:
Query pattern Default index
Exact match / range B-tree
JSON / array membership GIN
Full-text GIN or engine-native full-text
Geospatial GiST / engine-native spatial index
  • Use CREATE INDEX CONCURRENTLY on PostgreSQL for production index creation.
  • Treat DROP COLUMN and DROP TABLE as backup-required.
  • Use expand-contract for risky rename/type-change flows, populated NOT NULL, and phased deprecation.
  • Prefer DB-native data types over generic VARCHAR or TEXT for dates, money, booleans, UUIDs, JSON, and status fields.
  • Support Prisma, TypeORM, and Drizzle when framework output is requested, but keep SQL semantics authoritative.

Routing And Handoffs

Situation Route What to send
API payload or resource lifecycle drives the model Gateway Entitie
Full SKILL.md on GitHub

Install schema 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
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

references/data-modeling-anti-patterns.mdreferences/index-performance-anti-patterns.mdreferences/index-strategies.mdreferences/migration-deployment-anti-patterns.mdreferences/migration-patterns.mdreferences/normalization-guide.mdreferences/schema-design-anti-patterns.mdreferences/schema-examples.md

FAQ

What does the schema skill do?

Database schema design, migration creation, and ER diagram design. Acts as a data modeling expert responsible for normalization, index design, and relationship definitions. Used when database schema design is required.

How do I install the schema 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 schema skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare schema with