Skip to content
Skills Library
Data & analytics · Building & coding

db_schema

/db_schema

Writes valid db_schema SQL DDL or JSON for uml-mcp (diagram_type=db_schema, bundled plugin schema). Use when the user asks for a database schema or ER diagram from SQL DDL or a list of tables; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).

Repository
uml-mcp ↗
Licence
MIT
Last repository change
13.11.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Writes valid db_schema SQL DDL or JSON for uml-mcp (diagram_type=db_schema, bundled plugin schema). Use when the user asks for a database schema or ER diagram from SQL DDL or a list of tables; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).

Original author description

Writes valid db_schema SQL DDL or JSON for uml-mcp (diagram_type=db_schema, bundled plugin schema). Use when the user asks for a database schema or ER diagram from SQL DDL or a list of tables; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).

How it works

  1. Example prompt
  2. Notation tips
  3. Styling
  4. Example source
Original SKILL.md headings · 96 lines, 492 words
SKILL.md preview
---
name: db_schema
description: >-
  Writes valid db_schema SQL DDL or JSON for uml-mcp (diagram_type=db_schema, bundled plugin schema). Use when the user asks for a database schema or ER diagram from SQL DDL or a list of tables; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).
---

# db_schema diagram (uml-mcp plugin `schema`)

**`diagram_type`:** `db_schema`  
**Backend:** `plugin:schema` (bundled with uml-mcp, on by default)  
**Output formats:** html, svg

Database schema (ER) from SQL DDL (CREATE TABLE; Postgres, MySQL, SQLite) or JSON tables: column cards with PK/FK/null/unique markers, crow's-foot relationships at the column rows, groups; html or svg

Load the workflow skill [uml-mcp-diagrams](../uml-mcp-diagrams/SKILL.md) and the focused guide `skill://uml-mcp-guides/db-schema/SKILL.md`. This file is notation only; it does not add an MCP tool.

## Example prompt

> Draw the schema of my shop database from this CREATE TABLE script.

## Notation tips

- Paste SQL DDL as is: `CREATE TABLE` with `PRIMARY KEY`, `REFERENCES`, `FOREIGN KEY`, `UNIQUE`, `NOT NULL`, `DEFAULT` (Postgres, MySQL, SQLite); other statements are skipped.
- Comment directives: `-- title: Shop`, `-- theme: dark`, `-- group: Billing` (tables below it go in a tinted container; `-- group:` ends it).
- Or JSON: `tables` (`name`, `group`, `note`, `columns`: `name`, `type`, `pk`, `fk` `{"table","column"}` or `"table.column"`, `nullable`, `unique`, `note`) and optional `relations` (`from`, `to`, `kind`: `one-to-one`, `one-to-many`, `many-to-many`, `label`).
- A unique or primary-key foreign key draws one-to-one; a table keyed by two foreign keys is marked as an M:N join table. `validate_uml` lists every bad reference with its line.

## Styling

Pass **`theme`** (`auto`, `dark` or `light`) to `generate_uml` / `generate_uml_image`, or set it in the source. `auto` follows the reader's system in the HTML page and is dark in static SVG and PNG.

## Example source

```sql
-- title: Shop database
-- group: Customers
CREATE TABLE customers (
  id          BIGSERIAL PRIMARY KEY,
  email       VARCHAR(255) NOT NULL UNIQUE,
  full_name   TEXT NOT NULL,
  referred_by BIGINT REFERENCES customers (id),
  created_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE TABLE addresses (
  id          BIGSERIAL PRIMARY KEY,
  customer_id BIGINT NOT NULL REFERENCES customers (id) ON DELETE CASCADE,
  line1       TEXT NOT NULL,
  city        TEXT NOT NULL,
  country     CHAR(2) NOT NULL
);

-- group: Catalog
CREATE TABLE products (
  id          BIGSERIAL PRIMARY KEY,
  sku         VARCHAR(32) NOT NULL UNIQUE,
  name        TEXT NOT NULL,
  price_cents INTEGER NOT NULL CHECK (price_cents >= 0)
);

CREATE TABLE categories (
  id   SERIAL PRIMARY KEY,
  name TEXT NOT NULL UNIQUE
);

CREATE TABLE product_categories (
  product_id  BIGINT NOT NULL REFERENCES products (id),
  category_id INTEGER NOT NULL REFERENCES categories (id),
  PRIMARY KEY (product_id, category_id)
);

-- group: Orders
CREATE TABLE orders (
  id          BIGSERIAL PRIMARY KEY,
  customer_id BIGINT NOT NULL,
  ship_to     BIGINT,
  status      VARCHAR(16) NOT NULL DEFAULT 'pending',
  placed_at   TIMESTAMPTZ NOT NULL DEFAULT now(),
  CONSTRAINT fk_orders_customer FOREIGN KEY (customer_id) REFERENCES customers (id),
  FOREIGN KEY (ship_to) REFERENCES addresses (id)
);

CREATE TABLE order_items (
  order_id    BIGINT NOT NULL REFERENCES orders (id) ON DELETE CASCADE,
  product_id  BIGINT NOT NULL REFERENCES products (id),
  quantity    INTEGER NOT NULL DEFAULT 1,
  price_cents INTEGER NOT NULL,
  PRIMARY KEY (order_id, product_id)
);

CREATE TABLE payments (
  id        BIGSERIAL PRIMARY KEY,
  order_id  BIGINT NOT NULL UNIQUE REFERENCES orders (id),
  provider  TEXT NOT NULL,
  paid_at   TIMESTAMPTZ
);

COMMENT ON TABLE orders IS 'One checkout; its lines are in order_items';
CREATE INDEX orders_customer_idx ON orders (customer_id);
```

Versions

The database has no other skills named db_schema.

Database snapshot: 13.11.2026 · package version cadf360d93bc (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95d3_architecture
    Writes valid d3_architecture JSON for uml-mcp (diagram_type=d3_architecture, bundled plugin d3). Use when the user asks for a cloud or system architecture with provider and brand logos; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format…
  • 90d3_topology
    Writes valid d3_topology JSON for uml-mcp (diagram_type=d3_topology, bundled plugin d3). Use when the user asks for a deployment or network topology flowing top to bottom; then call validate_uml, then generate_uml_image (chat PNG) or generate_uml with output_format html (interactive MCP App page).
  • 90erd-diagram
    Generate or update an interactive ERD (entity relationship diagram) as a single offline HTML file for a Postgres repository, built only from the repo's schema code (a Prisma schema, a SQL schema dump, or a folder of SQL migrations; other ORMs through a model the agent writes…
  • 100mssql-insights-ops
    Operate the MSSQL MCP server (`MssqlMcp.exe`) effectively: introspect schema, query data safely, and use the AI Insights layer (cached object summaries + DDL audit) to investigate a database with low-token, repeatable workflows. Use when the user asks to "investigate",…
  • 100database-designer
    Design a database schema: tables, relationships, indexes, normalization, SQL vs NoSQL, migration plans. Use whenever the user asks how to structure their data, which database to pick, or before writing DDL. Only invoke via the orcinus router.
  • 100dbt-migration-ms-sql-server
    Convert Microsoft SQL Server/Azure Synapse T-SQL DDL to dbt models compatible with Snowflake. This skill should be used when converting views, tables, or stored procedures from SQL Server to dbt code, generating schema.yml files with tests and documentation, or migrating T-SQL…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.