| name | drawio-diagram-forge |
| description | Generate editable draw.io diagrams (.drawio, .drawio.svg, .drawio.png) from text, images, Excel, or Markdown. Use for architecture diagrams, flowcharts, sequence diagrams, swimlanes, and Azure/AWS cloud diagrams. |
Draw.io Diagram Forge
Generate editable draw.io diagrams as XML/mxGraphModel. Prefer .drawio for stability; use .drawio.svg for embedding in Markdown or web pages.
Workflow
- Classify the request: architecture, flowchart, sequence, swimlane, image recreation, or cloud diagram.
- Extract entities, relationships, groups, labels, and layout direction from the input.
- Build a concise diagram plan before generating XML.
- Generate valid mxGraph XML with root cells, vertex cells, edge cells, geometry, labels, and styles.
- Validate with
scripts/validate_drawio.py when available.
- Save outputs under
outputs/.
For complex diagrams, use the orchestrated flow: input analysis, manifest/review, XML generation, validation, and targeted repair.
Output Formats
*.drawio: native draw.io, recommended.
*.drawio.svg: SVG with draw.io metadata, useful for Markdown/Web.
*.drawio.png: PNG with draw.io metadata.
Quality Gate
90-100: deliver.
85-89: deliver and note minor issues.
70-84: repair and retry.
50-69: simplify.
30-49: deliver partial result.
0-29: ask for clarification.
Iteration limits: manifest revisions 2, XML/SVG revisions 2, total revisions 4, total timeout 45 minutes.
Cloud Icons
Detect provider from input terms:
- Azure:
Azure, Microsoft Cloud, App Service, Azure AD, VNET, AKS, Key Vault.
- AWS:
AWS, Amazon, EC2, Lambda, S3, RDS, VPC, EKS, DynamoDB.
- GCP:
GCP, Google Cloud, Cloud Run, BigQuery, GKE, Cloud Functions.
- Alibaba:
Alibaba Cloud, 阿里云, ECS, OSS, MaxCompute.
- IBM:
IBM Cloud, IBM Watson, IBM OpenShift.
- Cisco:
Cisco, Meraki, ACI, Nexus, ISE.
Provider style formats:
- Azure:
image=img/lib/azure2/{category}/{Icon}.svg
- AWS:
shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.{icon}
- GCP:
shape=mxgraph.gcp2.{icon}
- Alibaba:
shape=mxgraph.alibabacloud.{icon}
- IBM:
image=img/lib/ibm/{category}/{icon}.svg
- Cisco:
shape=mxgraph.cisco19.{icon}
For unknown services, use a generic labeled shape.
Azure requirement: do not use shape=mxgraph.azure.*; use image=img/lib/azure2/.../*.svg so VS Code and draw.io render correctly.
To view cloud icons in draw.io, enable Azure/AWS shapes via + More Shapes.
Integrity Rules
- Include
mxCell id="0" root and mxCell id="1" default parent.
- Use one vertex
mxCell per node and one edge mxCell per relationship.
- Minimum cell count is
2 + nodes + edges.
- Validate IDs, edge source/target references, geometry, and content attributes.
References
Load only as needed:
references/mxcell-structure.md: mxCell XML structure.
references/cloud-icons.md: Azure/AWS icon paths and examples.
references/style-guide.md: node colors and edge styles.
scripts/validate_drawio.py: mxCell validation.