Database Schema Designer

Designs relational database schemas from requirements and generates migrations, TypeScript/Python types, seed data, RLS policies, and indexes. Handles multi-tenancy, soft deletes, audit trails, versioning, and polymorphic associations.

✨ What it does

  • Schema design from requirements into tables, relationships, constraints
  • Migration generation for Drizzle, Prisma, TypeORM, Alembic
  • Type generation for TypeScript and Python
  • Row-Level Security (RLS) policy generation for multi-tenant apps
  • Index strategy recommendations (composite, partial, covering)
  • Seed data generation with realistic test data

🎯 When to use it

  • Designing a new feature that needs database tables
  • Reviewing a schema for performance or normalization issues
  • Adding multi-tenancy to an existing schema
  • Generating TypeScript types from a Prisma schema
  • Planning a schema migration for a breaking change

🚀 How to use

Trigger by asking to design a database schema, generate ERD diagrams, normalize schemas, or plan migrations. Provide requirements or an existing schema. Example prompts:

Design a schema for a task management app with users, projects, tasks, labels, and audit trail.
Generate TypeScript types from my Prisma schema.

📄 Output: Produces a complete schema design with SQL DDL, migration files, type definitions, RLS policies, seed scripts, and Mermaid ERD diagrams.

📦 Add this skill to Claude Code

# 1. Get the skills repo
git clone --depth 1 https://github.com/alirezarezvani/claude-skills /tmp/claude-skills

# 2. Copy this skill into your project (or ~/.claude/skills for all projects)
mkdir -p .claude/skills
cp -r /tmp/claude-skills/engineering/skills/database-schema-designer .claude/skills/database-schema-designer

Skill source: engineering/skills/database-schema-designer/SKILL.md

⚠️ Good to know

Requires clear requirements or an existing schema to work from; does not execute migrations or deploy code.

❓ FAQ

What ORMs are supported for migration generation?

The skill supports Drizzle, Prisma, TypeORM, and Alembic.

How does the skill handle multi-tenancy?

It adds an organization_id to tenant-scoped tables and generates RLS policies to enforce data isolation at the database level.

What are common pitfalls it warns about?

It warns against soft delete without indexes, missing composite indexes, mutable surrogate keys, non-nullable columns without defaults, lack of optimistic locking, and untested RLS.

🤖 Overview, features, install steps and FAQ were generated from the project's SKILL.md on Sep 4, 2026. Always check the original source before running commands.