drawio-core-xml-format

Validate and generate uncompressed Draw.io mxGraph XML with correct structure.

4|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Draw.io-Claude-Skill-Package --skill drawio-core-xml-format
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drawio-core-xml-format
Source: https://github.com/OpenAEC-Foundation/Draw.io-Claude-Skill-Package/tree/main/skills/source/drawio-core/drawio-core-xml-format
Command: npx skills add https://github.com/OpenAEC-Foundation/Draw.io-Claude-Skill-Package --skill drawio-core-xml-format

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill teaches the complete mxGraph XML format used by Draw.io (.drawio) files. It enables correct programmatic generation, reading, and modification of diagrams.

Core Features & Use Cases

  • Uncompressed XML generation: ALWAYS generate uncompressed XML to ensure AI readability and renderer compatibility.
  • Correct hierarchical structure: mxfile/diagram/mxGraphModel/root with mandatory root cells id="0" and id="1".
  • Vertex/Edge correctness and geometry: proper mxCell attributes, vertex/edge flags, and as="geometry".
  • Validation and examples: provides references to anti-patterns and working examples.

Quick Start

Start by composing an uncompressed mxGraph XML page using the mxfile>diagram>mxGraphModel>root structure and valid mxCell elements as shown in the examples.

Frequently Asked Questions about drawio-core-xml-format

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

FAQPage Schema
How do I generate valid Draw.io XML programmatically?

Valid Draw.io XML requires an uncompressed mxfile>diagram>mxGraphModel>root structure with mandatory root cells id="0" and id="1". You must include correct mxCell attributes, vertex/edge flags, and as="geometry" declarations for proper rendering.

What is the correct mxGraph XML structure for a multi-page diagram?

A multi-page mxGraph XML diagram uses a single mxfile containing multiple diagram elements. Each diagram page must contain its own mxGraphModel and root with the mandatory id="0" and id="1" cells, ensuring unique IDs across the entire structure.

Why does my Draw.io mxcell vertex show up without a size or position?

Draw.io mxCell elements require proper as="geometry" declarations with height and width attributes. Without correct geometry declarations and vertex flags, the renderer cannot position or size the elements correctly.

Does Draw.io XML validation require uncompressed mxfile format?

Draw.io XML validation targets uncompressed mxfile format to ensure AI readability and renderer compatibility. Compressed diagrams prevent proper programmatic reading, structural validation, and modification of mxGraphModel elements.

What are common anti-patterns when creating mxGraphModel XML?

Common mxGraphModel XML anti-patterns include duplicate cell IDs, missing root cells id="0" and id="1", incorrect parent-child relationships, absent vertex/edge flags, and malformed style conventions that break diagram rendering.