db-schema-designer
Skill2 starsChanged 9 months agoMITView on GitHub
Designs database schemas from domain model descriptions. Generates ERD, migration scripts, and index strategies for PostgreSQL, MySQL, and MongoDB. Includes Prisma, Drizzle, SQLAlchemy, and raw SQL support.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- mike22890/opencode-skills-cntheir own version, first seen Sep 13, 2026
- inbharatai/claude-skillstheir own version, first seen Mar 14, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- inbharatai/claude-skills★ 37same name
- mike22890/opencode-skills-cn★ 1same name
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 repository28 other files it gives its agents.
- brand-voiceSkill
- community-builderSkill
- email-sequenceSkill
- growth-experimentSkill
- landing-page-genSkill
- pitch-deckSkill
- referral-programSkill
- budget-plannerSkill
- fundraising-prepSkill
- legal-checklistSkill
- meeting-notesSkill
- okr-builderSkill
- postmortem-writerSkill
- retrospective-guideSkill
- risk-registerSkill
- sop-writerSkill
- experiment-designerSkill
- metrics-trackerSkill
- prd-writerSkill
- scope-cutterSkill
- user-interview-guideSkill
- ai-integrationSkill
- api-first-designSkill
- deploy-pipelineSkill
- infra-as-codeSkill
- monitoring-setupSkill
- mvp-scaffoldSkill
- test-generatorSkill
The file
Files
DB Schema Designer - Database Schema Design
Overview
Transforms domain descriptions into optimized database schemas with migrations, indexes, and relationship diagrams.
1. When to Apply
| Trigger | Behavior |
| New project data modeling | Full schema design workflow |
| "database schema", "ERD" | Interactive schema builder |
| Adding new entity/table | Incremental schema update |
2. Design Workflow
Step 1: Domain Analysis
From user description, extract:
- Entities: Nouns → tables/collections
- Relationships: Verbs → foreign keys/references
- Attributes: Properties → columns/fields
- Cardinality: one-to-one, one-to-many, many-to-many
Step 2: Schema Generation
Prisma Example:
model User {
id String @id @default(cuid())
email String @unique
name String?
role Role @default(USER)
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
}
model Post {
id String @id @default(cuid())
title String
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String
tags Tag[]
createdAt DateTime @default(now())
@@index([authorId])
@@index([published, createdAt])
}Step 3: Index Strategy
## Index Recommendations
| Table | Index | Type | Reason |
|-------|-------|------|--------|
| users | email | UNIQUE | Login lookup |
| posts | authorId | B-TREE | Filter by author |
| posts | (published, createdAt) | COMPOSITE | Published feed query |
| posts | title | GIN (trigram) | Full-text search |Step 4: Migration Script
Generate migration for chosen ORM/tool.
Step 5: ERD (Mermaid)
erDiagram
User ||--o{ Post : writes
Post }o--o{ Tag : has
User {
string id PK
string email UK
string name
enum role
}
Post {
string id PK
string title
string content
boolean published
string authorId FK
}3. Design Principles
- Start normalized, denormalize when needed — 3NF first, optimize later
- Always add timestamps — createdAt, updatedAt on every table
- Use UUIDs/CUIDs for IDs — avoids enumeration attacks
- Soft delete when data matters — deletedAt instead of DELETE
- Index foreign keys — always index FK columns
- Plan for multi-tenancy early — add tenantId if SaaS
4. Tool Coordination
| Tool | Purpose |
| Write | Generate schema files, migrations |
| Read | Analyze existing schema |
| Bash | Run migrations (npx prisma migrate, alembic upgrade) |
5. Boundaries
Will:
- Design schemas from domain descriptions
- Generate Prisma/Drizzle/SQLAlchemy models
- Create migration scripts
- Recommend index strategies
- Generate ERD diagrams (Mermaid)
Will Not:
- Set up database servers
- Perform data migration between databases
- Optimize queries (use performance-profiler)
- Design caching strategies
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.

