schema
FreeNo executable scriptsNot checkedDatabase schema design, migration creation, and ER diagram design. Acts as a data modeling expert responsible for normalization, index design, and…
by onfire7777★ 17 GitHub starsAbout 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
erDiagramoutput 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
upanddown, 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 NULLto 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
3NFby 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 CONCURRENTLYon PostgreSQL for production index creation. - Treat
DROP COLUMNandDROP TABLEas backup-required. - Use expand-contract for risky rename/type-change flows, populated
NOT NULL, and phased deprecation. - Prefer DB-native data types over generic
VARCHARorTEXTfor 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 |
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
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
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
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic