본문으로 건너뛰기
cccskills
무료GitHub에 공개

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구PostgreSQLMySQL
설치 방법 보기

포함된 파일(7)

  • SKILL.md6.6 KB
  • references/best-practices-and-troubleshooting.md4.3 KB
  • references/indexes-and-migrations.md3.7 KB
  • references/schema-design-and-security.md7.6 KB
  • scripts/erd_generator.py11.9 KB
  • scripts/migration_diffr.py17.4 KB
  • scripts/schema_validator.py13.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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.

Keywords

database schema, schema design, normalization, migration, ERD, row-level security, indexing, multi-tenancy, soft deletes, audit trail, Drizzle, Prisma, PostgreSQL

Core Capabilities

  • Schema design from requirements — extract entities/relationships from natural language, apply 1NF–3NF normalization, add timestamps/soft-delete/audit/versioning, generate complete DDL.
  • Migration planning — forward and rollback migrations, zero-downtime patterns for large tables, column additions/type changes/backfills across Drizzle, Prisma, TypeORM, Alembic, and raw SQL.
  • Index strategy — composite, partial, covering, and GIN/GiST indexes mapped to query patterns; bloat detection and maintenance.
  • Type generation — TypeScript interfaces + Zod schemas and Python dataclasses + Pydantic models from the DB schema (enums as string unions).
  • Security — Row-Level Security for multi-tenant isolation, column-level PII encryption, audit logging with before/after JSON snapshots.

When to Use

  • Designing tables for a new feature
  • Reviewing an existing schema for normalization or performance issues
  • Adding multi-tenancy to a single-tenant schema
  • Planning a breaking schema migration
  • Generating ERD documentation for a service

Clarify First

Before designing the schema, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • Requirements or existing DDL — the entities/relationships in natural language, or the schema to review (the source the design is derived from)
  • Engine & ORM — PostgreSQL/MySQL/SQLite and Drizzle/Prisma/TypeORM/Alembic (sets the migration and type-generation output format)
  • Cross-cutting needs — multi-tenancy/RLS, soft deletes, audit trails, or temporal data (determines which patterns and policies are generated)

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.

Tools

ToolPurposeCommand
erd_generator.pyParse SQL DDL and generate a Mermaid ER diagrampython scripts/erd_generator.py schema.sql -o erd.mmd
migration_diffr.pyDiff two SQL schemas into migration ALTER statements (with rollback)python scripts/migration_diffr.py old.sql new.sql
schema_validator.pyValidate DDL for normalization violations, missing indexes, namingpython scripts/schema_validator.py schema.sql --strict

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

  • references/schema-design-and-security.md — the 4-step requirements-to-schema process, the full Drizzle ORM schema example, cross-cutting concerns, and PostgreSQL Row-Level Security policies. Read when designing a new schema or adding multi-tenancy.
  • references/indexes-and-migrations.md — the index-type decision framework, index anti-patterns, zero-downtime migration patterns (add NOT NULL column, rename column), and Mermaid ERD generation. Read when choosing indexes or planning a safe migration.
  • references/best-practices-and-troubleshooting.md — common pitfalls, best practices, the troubleshooting table, and the success-criteria bar. Read before shipping a schema or when diagnosing a problem.

Scope & Limitations

This skill covers:

  • Relational schema design for PostgreSQL, MySQL, and SQLite including normalization through 3NF
  • Migration generation and zero-downtime migration planning for Drizzle, Prisma, TypeORM, and Alembic
  • Row-Level Security policies, index strategy, and type generation (TypeScript and Python)
  • Cross-cutting patterns: multi-tenancy, soft deletes, audit trails, optimistic locking, and temporal data

This skill does NOT cover:

  • NoSQL or document database design (MongoDB, DynamoDB, Cassandra) — see senior-data-engineer for broader data store guidance
  • Query optimization and execution plan analysis beyond index recommendations — see performance-profiler for runtime profiling
  • Database infrastructure provisioning, replication, or failover configuration — see senior-cloud-architect for cloud database setup
  • Application-layer ORM patterns, connection pooling, or caching strategies — see senior-backend for backend architecture decisions

Integration Points

SkillIntegrationData Flow
migration-architectHands off generated DDL and migration files for sequencing across servicesSchema Designer produces migrations, Migration Architect orchestrates cross-service rollout order
api-design-reviewerSchema entities map directly to API resource models and endpoint structureSchema entities and relationships feed into REST/GraphQL resource definitions and validation rules
senior-backendGenerated types and ORM schemas plug into repository and service layersTypeScript interfaces and Pydantic models from schema become the backend's data access contracts
performance-profilerIndex strategy recommendations are validated against real query execution plansSchema Designer proposes indexes, Performance Profiler confirms effectiveness with EXPLAIN ANALYZE data
senior-secopsRLS policies and column encryption align with security compliance requirementsSecurity requirements flow in, RLS policies and encryption specifications flow out for audit verification
observability-designerAudit log schema provides the foundation for operational dashboards and alertingAudit log table structure feeds into observability pipelines for change tracking and anomaly detection

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

This skill should be used when the user asks to "check accessibility", "audit WCAG compliance", "scan HTML for a11y issues", "check color contrast", or "find accessibility violations in web pages".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borghei/Claude-Skills9482026년 10월 7일 업데이트

Design and analyze A/B tests: sample size, test duration, and statistical significance for conversion experiments. Use when setting up an A/B test, calculating sample size, designing an experiment, or analyzing results.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borghei/Claude-Skills9482026년 10월 7일 업데이트

Design and run statistically rigorous A/B tests and experiments. Use when planning experiments, calculating sample sizes, designing test variants, selecting metrics, analyzing results, or when someone says "let's test that."

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borghei/Claude-Skills9482026년 10월 7일 업데이트

Sales execution across pipeline, discovery, demos, negotiation, and closing. Use when qualifying opportunities, running MEDDIC discovery, building account plans, handling objections, structuring proposals, or forecasting pipeline.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borghei/Claude-Skills9482026년 10월 7일 업데이트

Design ad creative across Google, Meta, LinkedIn, Twitter/X, and TikTok with platform format specs, headline formulas, and A/B testing. Use when writing ad copy, generating headline variations, creating ad sets, or validating creative.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borghei/Claude-Skills9482026년 10월 7일 업데이트

aeo

무료

Answer Engine Optimization (AEO): optimize content to be cited by LLMs (ChatGPT, Claude, Perplexity, Gemini) in their answers. Use when designing content for LLM citation, auditing citability, or structuring Q&A schema.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

borghei/Claude-Skills9482026년 10월 7일 업데이트

borghei의 스킬 모두 보기

이 스킬의 문제 신고