database-schema-designer

Designs relational database schemas and generates migrations, types, RLS policies, and ERD diagrams.

2|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/BryanPinheiro77/FinanceBot-BackEnd --skill database-schema-designer-bryanpinheiro77
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-schema-designer
Source: https://github.com/BryanPinheiro77/FinanceBot-BackEnd/tree/main/.agents/skills/database-schema-designer
Command: npx skills add https://github.com/BryanPinheiro77/FinanceBot-BackEnd --skill database-schema-designer-bryanpinheiro77

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Translating product requirements into a well-normalized, production-ready relational database schema is error-prone: developers often forget indexes, audit columns, soft deletes, or multi-tenant isolation. This Skill turns plain-language requirements into complete schemas with migrations, types, seed data, and security policies. ## Core Features & Use Cases - Schema Design & Normalization: Extract entities and relationships from requirements, then apply cross-cutting concerns like multi-tenancy, soft deletes, audit trails, and optimistic locking. - Migration & Type Generation: Produce Prisma, Drizzle, TypeORM, or Alembic migrations plus TypeScript interfaces and Python dataclasses/Pydantic models. - Security & Performance: Generate PostgreSQL Row-Level Security policies for tenant isolation and plan composite, partial, and covering indexes. - ERD Diagrams: Output Mermaid erDiagram visualizations directly from the schema. - Use Case: Given "users create projects with tasks, labels, and assignments, and we need a full audit trail," the Skill produces the full table set, RLS policies, seed script, and Mermaid ERD. ## Quick Start Ask the assistant to design a database schema for your feature, for example: design a multi-tenant task management schema with soft deletes, audit logging, and RLS policies in PostgreSQL.

Frequently Asked Questions about database-schema-designer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a multi-tenant database schema in PostgreSQL?▼

Add an organization_id column to every tenant-scoped table and enforce isolation with Row-Level Security policies that filter rows by the current user's organization membership. Combine this with composite indexes on organization_id plus status for query performance.

How to generate TypeScript types from a database schema?▼

With Drizzle, use $inferSelect and $inferInsert on table definitions to derive TypeScript types automatically. With Prisma, the generated client provides model types, and this Skill produces equivalent interfaces or Pydantic models for Python.

Prisma vs Drizzle vs Alembic for schema migrations?▼

Prisma offers declarative schemas with a generated client, Drizzle provides SQL-like TypeScript schema definitions with lightweight migrations, and Alembic handles Python/SQLAlchemy migrations with explicit upgrade and downgrade functions. The Skill generates examples for all three.

Does Row-Level Security replace application-level authorization?▼

RLS enforces tenant isolation at the database layer, so even buggy application queries cannot leak rows across organizations. It complements rather than fully replaces application authorization, and policies must be tested with a non-superuser role.

Why is my soft delete query slow on large tables?▼

Queries filtering WHERE deleted_at IS NULL perform full scans without a supporting index. Create a partial index on the filtered columns with the condition deleted_at IS NULL so active-row lookups stay fast.

When should I use soft deletes instead of hard deletes?▼

Use soft deletes with a deleted_at timestamp for auditable or recoverable data such as tasks, projects, and user records. Hard deletes suit ephemeral or compliance-purged data where retention is prohibited.