Install this skill: copy and save to ~/.claude/skills/schema-designer/SKILL.md

Schema Designer

Designs database schemas from feature descriptions with proper relations, indexes, and constraints. Outputs Prisma, Drizzle, or raw SQL.

5 min|Intermediate
BuildDeep WorkDeveloper
SKILL.md~/.claude/skills/schema-designer/
---
name: schema-designer
description: |
  Designs database schemas with relations, indexes, and constraints.
  IMPORTANT: Activate this skill whenever the user asks to "design a schema",
  "create database tables", "model the data", or "database design".
  This skill MUST be used for all schema design requests.
---

# Schema Designer

Designs database schemas from feature descriptions. Produces tables with proper relations, indexes, constraints, and sensible defaults. Outputs in your project's ORM format (Prisma, Drizzle, TypeORM) or raw SQL.

**Trigger:**

Say any of these to activate this skill:
- "design a schema for [feature]"
- "create database tables"
- "model the data for [feature]"
- "Use skill: schema designer"

**How It Works:**

1. Analyze the feature description to identify entities, relationships, and attributes
2. Check the existing schema to avoid duplicating tables or breaking conventions
3. Detect the ORM (Prisma, Drizzle, TypeORM, Knex) or if the project uses raw SQL
4. Design tables with: proper primary keys, foreign keys, indexes, constraints, timestamps
5. Add indexes for columns used in WHERE clauses and JOINs
6. Include created_at and updated_at timestamps on all tables
7. Output the schema in the project's ORM format
8. Generate the migration file if the project uses migrations

**Guidelines:**

- Use UUIDs for primary keys unless the project uses auto-increment integers
- Always add indexes on foreign key columns
- Include NOT NULL constraints on required fields
- Use enums or check constraints for fields with a fixed set of values
- Consider soft deletes (deleted_at) for user-facing data

**Works With:**

- Best with: Claude Code CLI (can read existing schema and generate compatible code)
- Also works: Cursor, Windsurf
- Expects: A project with an existing database setup

**Output Format:**

- Schema definition in the project's ORM format
- Migration file if applicable
- Entity relationship summary (which tables reference which)

Designs database schemas from feature descriptions. Produces tables with proper relations, indexes, constraints, and sensible defaults. Outputs in your project's ORM format (Prisma, Drizzle, TypeORM) or raw SQL.

Say any of these to activate this skill: - "design a schema for [feature]" - "create database tables" - "model the data for [feature]" - "Use skill: schema designer"

1. Analyze the feature description to identify entities, relationships, and attributes 2. Check the existing schema to avoid duplicating tables or breaking conventions 3. Detect the ORM (Prisma, Drizzle, TypeORM, Knex) or if the project uses raw SQL 4. Design tables with: proper primary keys, foreign keys, indexes, constraints, timestamps 5. Add indexes for columns used in WHERE clauses and JOINs 6. Include created_at and updated_at timestamps on all tables 7. Output the schema in the project's ORM format 8. Generate the migration file if the project uses migrations

  • Use UUIDs for primary keys unless the project uses auto-increment integers
  • Always add indexes on foreign key columns
  • Include NOT NULL constraints on required fields
  • Use enums or check constraints for fields with a fixed set of values
  • Consider soft deletes (deleted_at) for user-facing data
  • Best with: Claude Code CLI (can read existing schema and generate compatible code)
  • Also works: Cursor, Windsurf
  • Expects: A project with an existing database setup
  • Schema definition in the project's ORM format
  • Migration file if applicable
  • Entity relationship summary (which tables reference which)