← Back to Skills Marketplace
romanmeclazcke

Draw.io Professional Diagrams

by Roman Meclazcke · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
1523
Downloads
4
Stars
13
Active Installs
1
Versions
Install in OpenClaw
/install drawio
Description
Generate professional draw.io diagrams (ERD/database tables, class diagrams, sequence diagrams, flowcharts, architecture diagrams) and export them as PNG. Us...
README (SKILL.md)

Draw.io Diagram Generation Skill

When to use this skill

  • User requests a database diagram, ERD, or entity-relationship diagram
  • User requests a class diagram or UML class structure
  • User requests a sequence diagram or interaction diagram
  • User requests a flowchart or process flow
  • User requests an architecture diagram or system overview
  • User mentions "draw.io", "diagram", "table", "entity", "class", "sequence", "flow"

⚠️ MANDATORY RULES — READ BEFORE GENERATING ANYTHING

  1. ALWAYS detect the diagram type first before writing any XML
  2. NEVER mix styles between diagram types — each type has its own strict XML structure
  3. ALWAYS assign unique sequential IDs to every mxCell starting from 0
  4. NEVER use \ inside a value attribute — use separate rows/cells instead
  5. ALWAYS calculate table/class heights correctly using the formulas provided
  6. ALWAYS validate the XML structure before saving
  7. ALWAYS export to PNG and include the PNG in the response before asking about other formats — this step is non-negotiable
  8. NEVER use generic rounded rectangles for database tables or class entities
  9. ALWAYS apply consistent spacing between diagram elements
    • Horizontal spacing between elements: minimum 120px
    • Vertical spacing between rows or steps: minimum 100px
    • Tables/classes must not overlap
    • Relationship lines must not cross through table headers

STEP 0 — Diagram Type Detection

Before generating any XML, identify the diagram type from the user's request:

User says... Diagram type
"database", "ERD", "tables", "entities", "foreign key" TYPE 1: ERD
"class", "UML", "inheritance", "attributes", "methods" TYPE 2: Class Diagram
"sequence", "interaction", "lifeline", "actor calls" TYPE 3: Sequence Diagram
"flowchart", "flow", "process", "decision", "steps" TYPE 4: Flowchart
"architecture", "system", "services", "components" TYPE 5: Architecture

Diagram Type References

Use the detailed rules/templates in these files based on the detected type.

  • ERD / Database: ERD.md
  • UML Class: CLASS.md
  • Sequence: SEQUENCE.md
  • Flowchart: FLOWCHART.md
  • Architecture: LAYOUT.md

Generation Workflow — ALWAYS follow this exact order

Step 1 — Identify diagram type

Determine TYPE 1–5 from the user's message before writing any XML.

Step 2 — Plan all elements

List every entity/class/participant and all relationships before coding.

Step 3 — Create output folder

mkdir -p ./diagrams

Step 4 — Write and save the XML

Save to ./diagrams/\x3Cdiagram-name>.drawio

Mandatory pre-save checklist:

  • All mxCell elements have unique sequential numeric IDs
  • ERD tables use shape=table with shape=tableRow rows (never generic shapes)
  • Class diagrams use swimlane with attribute block, divider line, and method block
  • Sequence diagrams have lifelines, activation boxes, and correct arrow styles
  • ERD relationship arrows connect to row cell IDs, not table container IDs
  • Heights calculated correctly: 30 + (columns x 30) for ERD tables
  • No literal \ in value attributes (use 
 for multiline text cells only)
  • XML is well-formed and all tags are closed

Step 5 — Export to PNG

# macOS
/Applications/draw.io.app/Contents/MacOS/draw.io -x -f png --scale 2 -o ./diagrams/\x3Cname>.png ./diagrams/\x3Cname>.drawio

# Linux / headless
xvfb-run -a drawio -x -f png --scale 2 -o ./diagrams/\x3Cname>.png ./diagrams/\x3Cname>.drawio

Step 6 — Verify output

ls -lh ./diagrams/\x3Cname>.png

Step 7 — Show PNG first (MANDATORY)

Always respond with the PNG image first (embed/attach it in the response).

Step 8 — Ask the user for delivery format (MANDATORY)

After showing the PNG, ALWAYS ask the user which additional format they want:


The diagram is ready! Which format would you like?

1 - PNG image (ready to view) 2 - .drawio file (editable in draw.io) 3 - SVG (scalable vector) 4 - PDF 5 - All of the above

Reply with the number(s) of your choice.

Then based on the response:

  • 1 → send the PNG file
  • 2 → send the .drawio file
  • 3 → export SVG and send it
  • 4 → export PDF and send it
  • 5 → send all formats
  • Multiple numbers (e.g. "1 2") → send all requested formats

Other export formats

# SVG (scalable vector)
/Applications/draw.io.app/Contents/MacOS/draw.io -x -f svg -o ./diagrams/\x3Cname>.svg ./diagrams/\x3Cname>.drawio

# PDF
/Applications/draw.io.app/Contents/MacOS/draw.io -x -f pdf -o ./diagrams/\x3Cname>.pdf ./diagrams/\x3Cname>.drawio

# High-res PNG (scale 3)
/Applications/draw.io.app/Contents/MacOS/draw.io -x -f png --scale 3 -o ./diagrams/\x3Cname>_hd.png ./diagrams/\x3Cname>.drawio

# Transparent background
/Applications/draw.io.app/Contents/MacOS/draw.io -x -f png -t --scale 2 -o ./diagrams/\x3Cname>_transparent.png ./diagrams/\x3Cname>.drawio
Usage Guidance
This skill is internally consistent and appears to do only diagram generation using the local draw.io CLI. Before installing/use: 1) Ensure you have the official draw.io/drawio-desktop binary installed and up-to-date (the skill will run that binary). 2) Be aware the skill writes files to ./diagrams and executes the drawio binary (including xvfb-run on headless Linux) — only use in environments where executing local binaries is safe. 3) Inspect generated .drawio/.png files before sharing if diagrams may contain sensitive data (credentials, PII). 4) If you do not have drawio on the host, the skill will fail rather than requesting extra permissions or secrets. If you want the agent to run in a restricted environment, ensure it cannot execute untrusted binaries or write to sensitive directories.
Capability Analysis
Type: OpenClaw Skill Name: drawio Version: 1.0.0 The skill bundle provides comprehensive instructions and templates for generating various types of diagrams (ERD, UML, Flowcharts, etc.) using the draw.io CLI. It uses standard shell commands (mkdir, drawio, xvfb-run) to manage files and export diagrams to PNG/SVG/PDF formats, all of which are directly aligned with its stated purpose. No evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
Purpose & Capability
Name/description (draw.io diagrams → export PNG/.drawio/etc.) match the declared requirement of a drawio binary and the SKILL.md. Nothing in the manifest asks for unrelated cloud credentials, network endpoints, or extra binaries.
Instruction Scope
Runtime instructions are narrowly focused: detect diagram type, produce well-formed draw.io XML, save to ./diagrams, and run the drawio CLI (or macOS app binary) to export PNG/SVG/PDF. They do not instruct reading arbitrary host files, environment variables, or sending data to external endpoints. The mandatory steps (unique IDs, layout formulas, export) are strict but consistent with diagram-generation purpose.
Install Mechanism
No install spec is included (instruction-only), so nothing is downloaded or written by the skill itself. The only runtime dependency is an existing drawio binary/app — this is proportionate to the described capability.
Credentials
The skill requires no environment variables, secrets, or config paths. It only expects a local drawio executable. There are no requests for unrelated credentials.
Persistence & Privilege
The skill is not always-enabled and does not request persistent system privileges or modifications to other skills. It writes files to a local ./diagrams folder during normal operation, which is expected for this functionality.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install drawio
  3. After installation, invoke the skill by name or use /drawio
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the drawio skill for generating professional diagrams. - Supports automatic detection and creation of ERD, class, sequence, flowchart, and architecture diagrams. - Strict output and formatting rules ensure diagram quality and consistency. - Always exports and displays PNG images first before offering other formats. - Users can request additional formats: .drawio (editable), SVG, PDF, or all of the above.
Metadata
Slug drawio
Version 1.0.0
License
All-time Installs 13
Active Installs 13
Total Versions 1
Frequently Asked Questions

What is Draw.io Professional Diagrams?

Generate professional draw.io diagrams (ERD/database tables, class diagrams, sequence diagrams, flowcharts, architecture diagrams) and export them as PNG. Us... It is an AI Agent Skill for Claude Code / OpenClaw, with 1523 downloads so far.

How do I install Draw.io Professional Diagrams?

Run "/install drawio" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Draw.io Professional Diagrams free?

Yes, Draw.io Professional Diagrams is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Draw.io Professional Diagrams support?

Draw.io Professional Diagrams is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Draw.io Professional Diagrams?

It is built and maintained by Roman Meclazcke (@romanmeclazcke); the current version is v1.0.0.

💬 Comments