Skip to content
Skill

To dbml

Turns ORM models, SQL, a live database or an idea into a validated DBML schema

To dbml is an open-source agent skill for databases. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
JavaScript
Platforms
Claude Code, Codex, Cursor
GitHub stars
10
Last commit
License
MIT
Listing updated

Similar skills

About To dbml

This skill keeps a DBML entity model of a system as a regenerated snapshot rather than a hand-maintained file. It reads from the first available source in a set order: a live database, SQL DDL or migrations, then ORM model code. For an early-stage idea, it runs a short interview to settle entities, keys, and relationships before drafting.

Each run passes the draft through a gate script that runs the official DBML parser and a set of project conventions, then writes the file. Previous versions are archived with timestamps so changes can be compared over time. A logical variant drops audit and tenancy columns and collapses pure join tables, and a migration mode can describe a change between two schema states.

The skill expects Node.js 18 or newer, and it installs @dbml/core into a cache folder on first run. A read-only dbdiagram.io link can be generated for the output, and the skill can push the diagram to a dbdiagram account when asked.

When your agent uses it

Turn ORM models, SQL, a live database, or an idea into a validated, versioned DBML entity model that opens on dbdiagram.io in one click.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 6 files (32 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/to-dbml to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/to-dbml &&
cp -R "$tmp/to-dbml" ~/.claude/skills/to-dbml &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/to-dbml inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/to-dbml to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/to-dbml &&
cp -R "$tmp/to-dbml" ~/.agents/skills/to-dbml &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/to-dbml inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/to-dbml to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/to-dbml &&
cp -R "$tmp/to-dbml" ~/.cursor/skills/to-dbml &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/to-dbml inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/ccomkhj/skills.git --path to-dbml

Or copy the folder to ~/.gemini/skills/to-dbml yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/to-dbml:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/to-dbml &&
cp -R "$tmp/to-dbml" ~/.copilot/skills/to-dbml &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/to-dbml inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/ccomkhj/skills.git

Then copy skills/to-dbml into your agent's skills folder as to-dbml. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Parser-validated output
Each draft is checked by the official DBML parser and project conventions before it is saved.
Versioned snapshots
The previous file is archived with a timestamp whenever the schema changes.
Multiple source readers
Models can be built from a live database, SQL DDL, migrations, or ORM model code.
Logical view
An optional mode strips audit columns and indexes and collapses join tables for a simpler diagram.
Migration diff mode
Describes the change between two schema states and flags breaking removals.
Shareable diagram link
Generates a read-only dbdiagram.io link and copies the DBML for pasting.

Good for

  • Generate a DBML diagram of my PostgreSQL database
  • Convert my ORM models into a DBML schema file
  • Show what changes between my branch's schema and main
  • Design an entity model for a marketplace idea before coding
  • Produce a simplified logical schema diagram without audit columns

To dbml FAQ

What does the skill need to run?

It needs Node.js 18 or newer, and Node 22.14 or newer enables the dbdiagram render check. The first gate run installs @dbml/core into a cache folder.

Where is the generated file saved?

By default it writes docs/db/schema.dbml, or the existing DBML file's location if the repo already has one. Earlier versions are moved into a versions folder beside it.

Will my database credentials end up in the file?

No. Hosts, DSNs, users, and passwords are kept out of every file, and row values are not written into the output.

Is the shared diagram link private?

The link is read-only and needs no account, but the DBML travels inside the link, so anyone holding it can read the schema. Free-plan pushes to dbdiagram are public.

How do I install To dbml in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/to-dbml to use it in all your projects, or to .claude/skills/to-dbml in one project.

Does To dbml run scripts?

Yes. It runs JavaScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use To dbml?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to To dbml?

The closest alternatives to To dbml are Data archaeology, Db change management, Db migration agent, Miro code explain on board and Database migrations.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from ccomkhj/skills

  1. Audits AGENTS.md project memory files and proposes targeted, approved updates

    • Open source
    • 10 GitHub stars
    • Developer tools
  2. Builds interactive HTML lessons that teach AI, ML or science concepts through worked cases

    • Open source
    • 10 GitHub stars
    • Education and exam prep
  3. Runs a project and builds an interactive walkthrough from what actually executed

    • Open source
    • 10 GitHub stars
    • Developer tools
  4. Turns a clear improvement target into a measurable Claude Code /goal condition

    • Open source
    • 10 GitHub stars
    • Developer tools
  5. Races Claude against Codex in separate git worktrees until a measurable goal is met

    • Open source
    • 10 GitHub stars
    • Developer tools
  6. Runs a per-turn race between two coding agents and keeps the better diff

    • Open source
    • 10 GitHub stars
    • Developer tools