drawio-skill

Generates draw.io XML diagrams from natural language and exports them to PNG, SVG, PDF, or JPG.

11|2|Updated May 17, 2026
One-click install
npx skills add https://github.com/haozhang04/homework_skill --skill drawio-skill-haozhang04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drawio-skill
Source: https://github.com/haozhang04/homework_skill/tree/main/skill/drawio-skill
Command: npx skills add https://github.com/haozhang04/homework_skill --skill drawio-skill-haozhang04

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and assets (resource) components.

What problem does it solve? Creating professional diagrams by hand in draw.io is slow, and asking an LLM directly produces inconsistent layouts with overlapping shapes and crossing edges. This Skill turns natural language descriptions into well-structured .drawio files with preset styles, grid-aligned layouts, and a self-check loop that catches visual issues before you see them. ## Core Features & Use Cases - 6 Diagram Type Presets: ERD, UML Class, Sequence, Architecture, ML/Deep Learning, and Flowchart presets with predefined shapes, colors, and layout conventions. - Self-Check and Iterative Refinement: Reads the exported PNG with vision, auto-fixes up to 6 issue types (overlaps, clipped labels, stacked edges), then supports a 5-round targeted-edit review loop. - Local Export with Fallbacks: Exports via the draw.io desktop CLI to PNG/SVG/PDF/JPG, with a diagrams.net browser URL fallback when the CLI is unavailable. - Use Case: Describe a microservices e-commerce architecture with API Gateway, Kafka, and per-service databases, and receive a clean, grid-aligned architecture diagram exported as PNG, ready to embed in documentation or a paper. ## Quick Start Ask the agent to create a diagram, for example: draw a microservices architecture diagram with an API Gateway, auth and order services, Kafka, and separate databases, then export it as a PNG.

Frequently Asked Questions about drawio-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a draw.io diagram from a text description?

Describe the diagram in natural language, including the components and their relationships. The skill writes a .drawio XML file, exports a PNG preview via the draw.io desktop CLI, self-checks the image for layout issues, and iterates on your feedback until approved.

What diagram types can this draw.io skill create?

It supports six presets: ERD, UML class diagrams, sequence diagrams, architecture diagrams, ML/deep learning model diagrams, and flowcharts. Each preset includes predefined shapes, color coding, and layout conventions such as tensor shape annotations for neural networks.

Does this skill work without the draw.io desktop app installed?

Partially. Without the desktop CLI, it generates a diagrams.net URL by compressing and base64-encoding the XML with python3, so you can view and edit in a browser. If Python is also unavailable, it delivers only the .drawio XML file for manual opening.

Why does draw.io export fail on a Linux server?

CLI export fails on headless Linux servers because draw.io needs a display. Install xvfb and prefix commands with xvfb-run -a, for example: xvfb-run -a draw.io -x -f png -o out.png input.drawio.

Can I refine a generated diagram without starting over?

Yes. The review loop applies targeted XML edits for single-element changes like recoloring, moving, or renaming nodes, preserving prior layout tuning. Only layout-wide changes such as switching orientation trigger full regeneration, with a 5-round safety limit.