π‘ Summary
Generates high-quality draw.io diagrams with features like font management and Japanese text support.
π― Target Audience
π€ AI Roast: βThe project may expose risks through external dependencies and shell execution for PNG generation. Ensure to validate and sanitize inputs to mitigate potential command injection vuβ
The project may expose risks through external dependencies and shell execution for PNG generation. Ensure to validate and sanitize inputs to mitigate potential command injection vulnerabilities.
Claude Skill: draw.io Diagram Generator
A Claude Code skill for generating high-quality draw.io diagrams with proper font settings, arrow placement, and Japanese text support.
Features
- Font Management: Ensures
fontFamilyis set on all text elements - Arrow Layering: Correct Z-order placement (arrows behind boxes)
- Japanese Text Support: Proper width allocation for CJK characters
- PNG Validation: Pre-commit hooks for automatic PNG generation
- Best Practices: Comprehensive checklist and examples
Installation
Plugin Installation (Recommended)
# Via Claude Code marketplace /plugin marketplace add ekusiadadus/draw-mcp # Or install directly /plugin add https://github.com/ekusiadadus/draw-mcp
Manual Installation
Clone to your Claude Code skills directory:
# Global (personal use) git clone https://github.com/ekusiadadus/draw-mcp ~/.claude/skills/draw-io # Project-specific git clone https://github.com/ekusiadadus/draw-mcp .claude/skills/draw-io
Usage
Once installed, Claude Code will automatically use this skill when you ask to create draw.io diagrams.
Example Prompts
Create a simple flowchart showing: Start -> Process -> End
Draw an architecture diagram with Web Server, API, and Database
Create a sequence diagram for user login flow
Manual Trigger
If needed, you can explicitly request the skill:
Using the draw-io skill, create a flowchart for the authentication process
Requirements
draw.io CLI (for PNG export)
macOS:
brew install --cask drawio
Linux: Download from draw.io Desktop Releases
Python (for tests and validation)
pip install pytest
Project Structure
draw-mcp/
βββ .claude-plugin/
β βββ plugin.json # Plugin manifest
β βββ marketplace.json # Marketplace configuration
βββ skills/
β βββ draw-io/
β βββ SKILL.md # Main skill definition
β βββ reference.md # XML structure reference
β βββ examples.md # Production-ready examples
β βββ checklist.md # Validation checklist
βββ scripts/
β βββ convert-drawio-to-png.sh
βββ tests/
β βββ test_drawio_skill.py
βββ docs/
β βββ RULE.md
βββ .pre-commit-config.yaml
βββ .gitignore
βββ LICENSE
βββ README.md
Key Rules
1. Font Settings
<!-- In mxGraphModel --> <mxGraphModel defaultFontFamily="Noto Sans JP" ...> <!-- In EVERY text element --> <mxCell style="...fontFamily=Noto Sans JP;fontSize=18;..." />
2. Arrow Placement
Arrows must be declared FIRST in XML to render behind other elements:
<root> <!-- Arrows first (background) --> <mxCell id="arrow1" edge="1" ... /> <!-- Boxes after (foreground) --> <mxCell id="box1" vertex="1" ... /> </root>
3. Japanese Text Width
Allocate 30-40px per Japanese character:
<!-- 6 characters Γ 35px = 210px --> <mxGeometry width="220" ... />
4. PNG Verification
Always export to PNG and verify visually:
drawio -x -f png -s 2 -t -o diagram.png diagram.drawio
Pre-commit Hooks
This project includes pre-commit hooks for:
- XML Validation: Check font settings and structure
- PNG Conversion: Auto-generate PNG on commit
- Python Tests: Run skill validation tests
Setup:
pip install pre-commit pre-commit install
Running Tests
# Run all tests pytest tests/ -v # Run specific test file pytest tests/test_drawio_skill.py -v
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
pytest tests/ -v - Submit a pull request
License
MIT License - see LICENSE
Related Resources
Changelog
v1.0.0 (2025-12-16)
- Initial release
- Core skill with font, arrow, and text handling
- Pre-commit hooks for validation
- Comprehensive documentation and examples
Pros
- Supports Japanese text and proper font settings
- Automates PNG generation with pre-commit hooks
- Comprehensive documentation and examples
Cons
- Requires external draw.io CLI for PNG export
- Installation may be complex for beginners
- Limited to draw.io format
Related Skills
pytorch
SβIt's the Swiss Army knife of deep learning, but good luck figuring out which of the 47 installation methods is the one that won't break your system.β
agno
SβIt promises to be the Kubernetes for agents, but let's see if developers have the patience to learn yet another orchestration layer.β
nuxt-skills
SβIt's essentially a well-organized cheat sheet that turns your AI assistant into a Nuxt framework parrot.β
Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.
Copyright belongs to the original author ekusiadadus.
