borghei/database-schema-designer
> Design relational schemas from requirements with normalization, migrations, ERDs, RLS policies, and indexes for PostgreSQL, MySQL, and SQLite. Use when designing new features, reviewing schemas, or adding multi-tenancy.
npx skills add https://github.com/borghei/Claude-Skills --skill database-schema-designer
Design normalized relational database schemas from requirements and generate migrations, TypeScript/Python types, seed data, Row-Level Security policies, index strategies, and ERD diagrams. Handles multi-tenancy, soft deletes, audit trails, optimistic locking, polymorphic associations, and temporal data patterns. Supports PostgreSQL, MySQL, and SQLite with Drizzle, Prisma, TypeORM, and Alembic.
database schema, schema design, normalization, migration, ERD, row-level security, indexing, multi-tenancy, soft deletes, audit trail, Drizzle, Prisma, PostgreSQL
Before designing the schema, confirm these inputs. If any is unknown or vague, ASK — do not assume:
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
| Tool | Purpose | Command |
|------|---------|---------|
| erd_generator.py | Parse SQL DDL and generate a Mermaid ER diagram | python scripts/erd_generator.py schema.sql -o erd.mmd |
| migration_diffr.py | Diff two SQL schemas into migration ALTER statements (with rollback) | python scripts/migration_diffr.py old.sql new.sql |
| schema_validator.py | Validate DDL for normalization violations, missing indexes, naming | python scripts/schema_validator.py schema.sql --strict |
Load the reference that matches the task — keep this file lean and pull detail on demand:
This skill covers:
This skill does NOT cover:
senior-data-engineer for broader data store guidanceperformance-profiler for runtime profilingsenior-cloud-architect for cloud database setupsenior-backend for backend architecture decisions| Skill | Integration | Data Flow |
|-------|-------------|-----------|
| migration-architect | Hands off generated DDL and migration files for sequencing across services | Schema Designer produces migrations, Migration Architect orchestrates cross-service rollout order |
| api-design-reviewer | Schema entities map directly to API resource models and endpoint structure | Schema entities and relationships feed into REST/GraphQL resource definitions and validation rules |
| senior-backend | Generated types and ORM schemas plug into repository and service layers | TypeScript interfaces and Pydantic models from schema become the backend's data access contracts |
| performance-profiler | Index strategy recommendations are validated against real query execution plans | Schema Designer proposes indexes, Performance Profiler confirms effectiveness with EXPLAIN ANALYZE data |
| senior-secops | RLS policies and column encryption align with security compliance requirements | Security requirements flow in, RLS policies and encryption specifications flow out for audit verification |
| observability-designer | Audit log schema provides the foundation for operational dashboards and alerting | Audit log table structure feeds into observability pipelines for change tracking and anomaly detection |
Take borghei/database-schema-designer from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.