Przejdź do treści
Biblioteka skilli
Dane i analityka · Planowanie

dbdesign

/dbdesign

Projektuje i recenzuje produkcyjne schematy baz, modele danych, diagramy ERD i plany migracji dla OLTP i OLAP w PostgreSQL, MySQL, SQLite, BigQuery i MongoDB, bez wykonywania DDL.

Repozytorium
skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
8
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Projektuje i recenzuje produkcyjne schematy baz, modele danych, diagramy ERD i plany migracji dla OLTP i OLAP w PostgreSQL, MySQL, SQLite, BigQuery i MongoDB, bez wykonywania DDL.

Oryginalny opis (EN)

Design and review production database schemas, data models, ERDs, migration plans, and storage patterns. Use for OLTP schema design, OLAP/star-schema modeling, fact/dimension tables, indexes, constraints, partitioning, multi-tenant data models, CSV/JSON-to-table design, schema review, migration risk review, and database design documents across PostgreSQL, MySQL, SQLite/D1, BigQuery, and MongoDB. Does not execute DDL by default.

Jak działa

  1. Reference Router
  2. Workflow
  3. Design Defaults
  4. Validate DBML with dbdocs
  5. Hard Rules
Sekcje z nagłówków SKILL.md, w oryginale · 65 linii, 617 słów
Podgląd SKILL.md
---
name: dbdesign
description: "Design and review production database schemas, data models, ERDs, migration plans, and storage patterns. Use for OLTP schema design, OLAP/star-schema modeling, fact/dimension tables, indexes, constraints, partitioning, multi-tenant data models, CSV/JSON-to-table design, schema review, migration risk review, and database design documents across PostgreSQL, MySQL, SQLite/D1, BigQuery, and MongoDB. Does not execute DDL by default."
license: MIT
metadata:
  author: vanducng
  version: "1.0.0"
---

# DB Design

Design database schemas from requirements, existing data, and query patterns. This skill covers modeling decisions and review quality; use `vd:miudb` or the `sqlit` CLI to inspect live databases, `vd:diagram` for ERDs, and `vd:cnpg` for CloudNativePG provisioning.

## Reference Router

Read only what the task needs:

- `references/workflow.md`: intake, schema inspection, output format, and approval gates.
- `references/transactional.md`: OLTP entities, relationships, constraints, indexes, soft delete, tenancy, and audit columns.
- `references/analytics.md`: OLAP/star schema, facts, dimensions, SCD, summaries, and incremental refresh design.
- `references/engine-notes.md`: PostgreSQL, MySQL/MariaDB, SQLite/D1, BigQuery, and MongoDB-specific design notes.
- `references/migration-review.md`: migration safety, rollout sequencing, backfills, rollback, partitioning, and risk checks.
- `references/design-doc.md`: compact database design document template.

## Workflow

1. Identify the database engine and context: new schema, extension of existing schema, analytics model, data import, migration review, or design doc.
2. Inspect existing schema before proposing changes when a database or repo is available. Use `vd:miudb`, the `sqlit` CLI, migrations, ORM models, dbt models, or schema files as source of truth.
3. Capture requirements before DDL:
   - entities and relationships
   - main reads/writes/reports
   - expected scale and growth
   - tenancy, permissions, privacy, retention, and audit needs
   - consistency requirements and transaction boundaries
4. Load the relevant references:
   - OLTP or CRUD app -> `transactional.md`
   - analytics/reporting -> `analytics.md`
   - engine-specific DDL -> `engine-notes.md`
   - migration/change review -> `migration-review.md`
   - design document -> `design-doc.md`
5. Propose the model first, then DDL. Do not execute DDL unless the user explicitly asks and the environment is safe.
6. Explain tradeoffs: normalization vs denormalization, surrogate vs natural keys, JSON vs columns, partitioning, index cost, retention, and operational risk.
7. Finish with a checklist and open questions. If assumptions remain, label them instead of pretending certainty.

## Design Defaults

- Model the business language first; table names should reflect domain concepts, not UI screens.
- Prefer boring relational constraints for integrity: primary keys, foreign keys, unique constraints, checks, and NOT NULL.
- Index from actual query patterns, not from every column.
- Add comments/descriptions for tables and important columns when the engine supports them.
- Use exact numeric types for money and measured quantities.
- Store timestamps consistently; prefer timezone-aware types when the engine supports them.
- Plan retention and deletion behavior up front, especially for PII and audit logs.
- Separate operational tables from analytics/reporting models when workloads diverge.
- Treat schema migrations as production changes: reversible when possible, staged when large, and tested with realistic data.

## Validate DBML with dbdocs

When the design uses DBML (you write or edit a `.dbml` file):

- **Gate:** after writing/editing the file, run `dbdocs validate <path/to/schema.dbml>`. A clean parse (`Parse succeeded without errors.`) is required before the design is done. `dbdocs` is the validator (e.g. `dbdocs/0.14.0`).
- **No apostrophes inside single-quoted notes.** `note: 'the row''s id'` is not valid DBML and fails with `Expect a comma ','` - reword to drop the apostrophe ("the id on this row"); triple-quoted `'''...'''` notes are fine.
- **Avoid reserved/ambiguous words as column names** (e.g. `index`, `now`) - they can break the parser; document the column in the table `Note` instead, or quote/rename it.

## Hard Rules

- Do not invent a schema when existing tables might already cover the domain. Inspect first or ask for the schema.
- Do not execute DDL by default. Present DDL and migration steps for approval.
- Do not generate irreversible destructive migrations without an explicit warning and safer alternatives.
- Do not design indexes without naming the query pattern each index serves.
- Do not put secrets, credentials, or real PII in design docs, examples, PR bodies, or committed files.
- Do not preserve old source skill names or Claude-specific paths in new work.
Pliki w paczce (8)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB
  • references/analytics.md 4 KB
  • references/design-doc.md 2 KB
  • references/engine-notes.md 4 KB
  • references/migration-review.md 3 KB
  • references/transactional.md 4 KB
  • references/workflow.md 3 KB

Wersje

W bazie nie ma innych skilli o nazwie dbdesign.

Migawka bazy z 13.11.2026 · wersja paczki 0cf24f0cc2a0 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 86db-schema-assistant
    Zamienia pomysły produktowe w relacyjne architektury baz danych: ERD, schematy 3NF, DDL dla PostgreSQL lub MySQL, migracje i plany wycofania.
  • 90data-migration-verify
    Sprawdza poprawność migracji baz PostgreSQL, MySQL i SQLite: porównuje schematy, struktury tabel i liczby wierszy.
  • 100sql-pro
    Pisze złożony SQL analityczny w PostgreSQL, BigQuery i Snowflake oraz projektuje schematy hurtowni danych.
  • 100database-schema-designer
    Projektuje schematy relacyjne z wymagań: normalizacja, migracje, ERD, polityki RLS i indeksy dla PostgreSQL, MySQL i SQLite, także przy wielodostępności.
  • 100database-schema-designer
    Projektuje schematy relacyjne i dokumentowe z wymagań lub istniejącej aplikacji: tabele, klucze, relacje, ograniczenia, indeksy, ERD i odwracalne migracje, domyślnie w PostgreSQL.
  • 90database-engineer
    Projektuje architekturę baz, optymalizuje schematy i zapytania oraz przygotowuje migracje w PostgreSQL, MySQL, MongoDB i Redis.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.