Agent skill

Sql2er

by ystemsrx in ystemsrx/sql_to_ER

A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

AGPL-3.0Auto-check passedDatabases

Install Sql2er

skills CLI
$ npx skills add ystemsrx/sql_to_ER --skill sql2er -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ystemsrx/sql_to_ER sql2er --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ystemsrx/sql_to_ER.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/sql2er .claude/skills/sql2er && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sql2er
GitHub stars
188
Token cost
~1.1k tokens
SKILL.md length
478 words
Files
16 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
AGPL-3.0

At a glance

A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

  • The user wants a Chen-model ER diagram from SQL CREATE TABLE statements
  • SKILL.md covers Core workflow, Cleanup rules and References
  • Runs TypeScript and JavaScript scripts from its folder; calls node
  • Wants to rearrange

What it does

Sql2er is an agent skill from ystemsrx/sql_to_ER. Use when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview with attributes hidden at generate time, or needs drawio/svg/png/json/html exports with final visual review.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 19 other files, including scripts and reference files (for example `agents/openai.yaml`, `references/commands.md` and `references/data-model.md`).

It sits in Databases, covering Diagrams and SQL. It works with SQL, draw.io, MySQL and MongoDB. The repository describes itself as: 【在线免费使用】 简单快速将SQL或DBML转换为美观的ER图(支持 Agent Skill)/ The best SQL to ER Diagram converter (Support Agent Skill). The licence is AGPL-3.0.

When your agent uses it

  • The user wants a Chen-model ER diagram from SQL CREATE TABLE statements
  • Wants to rearrange
  • Clean up an existing sql2er state
  • Wants a skeleton-only overview with attributes hidden at generate time

Example prompts

  • “/sql2er”

Requirements

  • Node.js

What it can do on your machine

Read from SKILL.md and the folder at commit 0ced3ee. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 12 files in scripts/ (TypeScript and JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sql2er loads about 1.1k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 478 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ystemsrx/sql_to_ER at commit 0ced3ee, republished under its AGPL-3.0 licence (© ystemsrx). 478 words, ~1,137 tokens.

Download SKILL.mdSave it as .claude/skills/sql2er/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.
name
sql2er
description
Use when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview with attributes hidden at generate time, or needs drawio/svg/png/json/html exports with final visual review.

sql2er

Use the bundled CLI from the repo root:

bash
AGENT=skills/sql2er/scripts/sql2er-agent.mjs

State lives in one JSON file passed with --state <path>; reuse the same state path for every command in a diagram session.

Core workflow

  1. Generate the diagram:
bash
node $AGENT generate --input schema.sql --state er.json

Use --hide-attrs only when the user wants an overview/skeleton, the schema is dense, or attributes are not important. Attribute visibility is fixed at generate; export never adds or removes attributes. If fields, PKs, or column-level semantics matter, generate with attributes.

Use --comment when table/column/ref comments carry readable business labels. Set labels before tuning layout because regenerating resets positions.

If generated names are not semantic enough, relabel nodes before layout tuning:

bash
node $AGENT labels mode comment --state er.json
node $AGENT labels set rel-orders-users-user_id-7 "placed by" --state er.json
node $AGENT labels batch --file labels.json --state er.json
  1. Inspect diagnostics:
bash
node $AGENT describe --state er.json

Use DIAGNOSTICS for structural decisions: crossings, overlaps, disconnected components, attribute overlaps, and attribute-line crossings. Use the ASCII map only as a rough orientation aid. If PARSER WARNINGS is present, fix every reported issue. If an issue cannot be fixed, report it to the user. Copy exact entity ids from the ENTITIES block for manual position edits.

  1. Improve layout as needed:
bash
node $AGENT layout optimal --state er.json
node $AGENT attrs compact --state er.json
node $AGENT swap entity-users-0 entity-orders-1 --state er.json
node $AGENT move entity-users-0 600 400 --state er.json
node $AGENT nudge entity-users-0 20 -10 --state er.json

Automatic overlap avoidance is on by default and moves attributes first, then relationship diamonds, never entity rectangles. Use avoid off only when the user explicitly wants to preserve exact positions.

Prefer layout optimal after major edits. Use attrs compact for the smallest attribute footprint and attrs moderate for a more even ring. Use swap, move, and nudge only when diagnostics or visual review show a local issue.

  1. Export and review:
bash
node $AGENT export svg --out er.svg --state er.json
node $AGENT export png --out er.png --state er.json
node $AGENT export drawio --out er.drawio --state er.json
node $AGENT export html --out er.html --state er.json --lang zh

Export HTML only when the user wants a portable manual fine-tuning editor; choose --lang zh|en for the page language. Always export SVG or PNG and inspect the image before finishing. Ensure labels are legible, the layout is balanced, and nodes/attribute ellipses do not overlap or sit on top of lines. If overlap or crossings are provably unavoidable, minimize them and make each remaining crossing/overlap clear.

When HTML is exported, tell the user the best manual fine-tuning path: open the HTML, enable continuous force layout briefly, turn it off, enable automatic avoidance once, turn it off, double-click nodes to edit the label text inside them, then hand-tune the remaining local details.

Show full SKILL.md (126 more words)Show less

Cleanup rules

  • crossings / overlaps: run layout optimal; for a small local crossing, try swap.
  • attrOverlaps / attrCrossings: compare attrs compact and attrs moderate, then keep the clearer result.
  • Persistent attribute issues: run describe --details to identify the exact attribute/node/line pairs before local edits.
  • Unwanted automatic movement: run avoid off; turn it back on with avoid on before final review when possible.
  • COMPONENTS > 1: keep related clusters in one diagram, or use export <fmt> --split for separate files.
  • Awkward aspect ratio: try rotate 90.
  • Busy attribute-heavy diagram: regenerate with --hide-attrs only if a skeleton-only answer satisfies the user.

References

  • Read references/commands.md for full command syntax, flags, describe output schema, export behavior, and recipes.
  • Read references/data-model.md when node ids, edge types, cardinality, placeholder entities, self-references, or semantic labels matter.

© ystemsrx, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 15 other files (scripts, references) in skills/sql2er of ystemsrx/sql_to_ER.

  • SKILL.md
  • agents/openai.yaml
  • references/commands.md
  • references/data-model.md
  • scripts/build.mjs
  • scripts/engine/adapter.ts
  • scripts/engine/cli.ts
  • scripts/engine/describe.ts
  • scripts/engine/embedded-assets.generated.d.ts
  • scripts/engine/exporters.ts
  • scripts/engine/ops.ts
  • scripts/engine/shims.ts
  • scripts/engine/skeleton.ts
  • scripts/engine/tsconfig.json
  • scripts/engine/validateState.ts
  • scripts/sql2er-agent.mjs

Open the folder on GitHubat commit 0ced3ee

Compare with similar skills

Sql2er next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sql2er compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sql2er this skillystemsrx/sql_to_ER188—~1.1kAutomated safety check: PassAGPL-3.0
Query Expertjamesrochabrun/skills215—~4.3kAutomated safety check: PassMIT
Mindsdb MCP SkillLeoYeAI/openclaw-master-skills2.2k—~2.5kAutomated safety check: PassMIT
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Squixeduardofuncao/squix273—~784Automated safety check: PassMIT

Similar skills

  • Query Expert

    jamesrochabrun/skills

    Master SQL and database queries across multiple systems. An agent skill from jamesrochabrun/skills.

    215 GitHub stars~4.3k tokensUpdated 8 mo ago
    DatabasesAuto-check passed
  • Mindsdb MCP Skill

    LeoYeAI/openclaw-master-skills

    MindsDB MCP服务器交互技能,用于通过自然语言查询和操作200+企业级数据源。当用户需要查询数据库、分析数据、创建AI模型、连接数据源(MySQL、PostgreSQL、MongoDB、Excel、CSV、Gmail、Slack等)、执行SQL查询、进行数据预测、构建知识库(RAG)、智能问答、文档检索或任何与数据库交互的任务时使用此技能。即使没有明确提到MindsDB,只要涉及数据库操…

    2.2k GitHub stars~2.5k tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Squix

    eduardofuncao/squix

    Run SQL queries across databases (Postgres, MySQL, SQLite, etc.) via the squix CLI.

    273 GitHub stars~784 tokensUpdated 15 days ago
    DatabasesAuto-check passed
  • Rhctl

    saidake/rhctl

    Run and author rhctl CLI workflows and remote environment scripts under scripts/ (PostgreSQL, JetStream, Docker, Redis, MongoDB, AWS LocalStack, execute/upload/patch).

    106 GitHub stars~4k tokensUpdated yesterday
    DatabasesAuto-check: notes

Categories

Questions about Sql2er

What does Sql2er do?

A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…. Sql2er is an agent skill from ystemsrx/sql_to_ER. Use when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview with attributes hidden at generate time, or needs drawio/svg/png/json/html exports with final visual review.

When should I use Sql2er?

Sql2er fits situations like: the user wants a Chen-model ER diagram from SQL CREATE TABLE statements; wants to rearrange; clean up an existing sql2er state; wants a skeleton-only overview with attributes hidden at generate time.

How do I install Sql2er in Claude Code?

Run `npx skills add ystemsrx/sql_to_ER --skill sql2er -a claude-code`. Or copy the skill folder (skills/sql2er in ystemsrx/sql_to_ER) into .claude/skills/sql2er in your project. Claude Code loads it when a task matches its description.

How do I install Sql2er in Codex?

Run `npx skills add ystemsrx/sql_to_ER --skill sql2er -a codex`. Or copy the skill folder (skills/sql2er in ystemsrx/sql_to_ER) into .agents/skills/sql2er in your project. Codex loads it when a task matches its description.

Can I use Sql2er in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ystemsrx/sql_to_ER --skill sql2er -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sql2er, .gemini/skills/sql2er, .github/skills/sql2er and .opencode/skills/sql2er in your project.

What does Sql2er need to run?

Going by SKILL.md and its folder, Sql2er needs TypeScript and JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node.js.

Does Sql2er access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sql2er safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Sql2er use?

Sql2er is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sql2er use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Sql2er?

Skills that share tags, products or a category with Sql2er: Query Expert (jamesrochabrun/skills, 215 stars), Mindsdb MCP Skill (LeoYeAI/openclaw-master-skills, 2.2k stars), SQL Database Support for pREST (prest/prest, 4.6k stars) and Chdb SQL (vemetric/vemetric, 394 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sql2er?

ystemsrx (a GitHub user) maintains it in ystemsrx/sql_to_ER, which has 188 GitHub stars. The repository was last updated on September 30, 2026.

Source: ystemsrx/sql_to_ER on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.