mcpbeat Sign in

Sql2er Agent Skill

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.

701k tokens
context cost
the whole folder, loaded on every use
14
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
181
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/ystemsrx/sql_to_ER --skill sql2er

The instruction itself

4 sections, as written by the author

sql2er

Use the bundled CLI from the repo root:

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

  • Generate the diagram:
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:

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
  • Inspect diagnostics:
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.

Copy exact entity ids from the ENTITIES block for manual position edits.

  • Improve layout as needed:
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.

  • Export and review:
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.

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.

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take ystemsrx/sql2er from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.