**WORKFLOW SKILL** — Generate Azure architecture diagrams in .drawio via simonkurtz-MSFT MCP server (full Azure icon set, batch creation, transactional mode). Covers architecture, dependency, runtime-flow, and as-built diagrams. WHEN: 'draw.io diagram', 'Azure architecture diagram', 'as-built diagram', 'runtime flow diagram', 'dependency diagram'. DO NOT USE FOR: WAF/cost charts (python-diagrams), inline Mermaid (mermaid).
75
92%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Generate Azure architecture diagrams in .drawio format using the
simonkurtz-MSFT Draw.io MCP server. The server ships the full Azure icon set
(see assets/azure-public-service-icons/),
fuzzy shape search, batch operations, group/layer/page management, and
transactional mode for efficient multi-step workflows.
The MCP server's own src/instructions.md is the authoritative tool reference;
it is auto-sent to the client at startup. This skill captures project-specific
conventions that complement (not duplicate) it.
Naming note: "drawio" can refer to (a) this skill, (b) the MCP server slug
simonkurtz-MSFT/drawio-mcp-server, or (c) themcp_drawio_*tool family. In agent-facing references, disambiguate explicitly — say "thedrawioskill" or "the drawio MCP server", not baredrawio.
simonkurtz-MSFT/drawio-mcp-server (Deno, stdio) configured in .vscode/mcp.jsonhediet.vscode-drawio for in-editor previewThe MCP server's startup src/instructions.md is the authoritative tool reference. The
table below lists the most-used tools and the repo-specific batch sequence. Reusable call
patterns: references/azure-patterns.md.
| Tool | Purpose |
|---|---|
search-shapes | Fuzzy-search the Azure icon library; resolves names to shapes |
create-groups | Create container cells (VNets, subnets, resource groups, envs) |
add-cells | Add vertices + edges in a single batch (use shape_name, temp_id) |
add-cells-to-group | Assign children to group containers |
edit-cells / edit-edges | Update cell or edge properties post-creation |
validate-group-containment | Detect children that exceed group bounds |
finish-diagram | Resolve transactional placeholders + emit final compressed XML |
export-diagram | Non-transactional export with compress: true |
Standard sequence: search-shapes → create-groups → add-cells → add-cells-to-group
→ (optional edit-*) → validate-group-containment → finish-diagram /
export-diagram (compress: true).
import-diagraminput contract (CRITICAL — Phase D3 of nordic-foods lessons plan): when callingimport-diagram(or any tool whose schema declares anxmlparameter), the field MUST be XML content as a string — never a file path. Passing a barepath/to/file.drawiostring producesINVALID_XMLfrom the server and burns an MCP round trip. If you have a path on disk:WRONG: import-diagram(xml="agent-output/foo/03-des-diagram.drawio") RIGHT: read_file("agent-output/foo/03-des-diagram.drawio") → import-diagram(xml=<content>)Mirror this warning in
04-design.agent.mdnext to everyimport-diagramreference. The two locations must stay in sync.
There is no programmatic CLI fallback for diagram authoring. The Draw.io desktop app
is the only manual alternative; if the MCP server is unavailable, stop and surface the
failure rather than hand-rolling XML. The tools/scripts/save-drawio.py and
cleanup-drawio.py helpers are post-processing utilities for MCP output, not authoring
fallbacks.
Icons are resolved automatically by the MCP server from its built-in library (the full Azure icon set bundled with the server).
shape_name in add-cells specifies an Azure icon (e.g., "Front Doors").
Do NOT pass width, height, or style alongside it — the server applies them.search-shapes with a queries array finds icon names by fuzzy match."Key Vaults", "Container Apps").text label or omit text entirely — never pass "".Two modes — non-transactional (small diagrams, full XML each call) and
transactional (recommended for multi-step; lightweight placeholders during
the loop, real SVGs resolved by finish-diagram at the end). Full call chains,
the save-drawio.py save procedure, and the post-save cleanup script live in
references/creation-workflows.md.
Critical: transactional mode MUST end with
finish-diagram(compress: true)or the saved diagram keeps placeholder cells instead of real Azure icons.
shape_name for Azure icons — do NOT pass width, height, or style alongside it; the server applies themtext label or omit text entirely — never pass ""add-cells — edges must be ordered after the vertices they referencefinish-diagram at the end (~2KB intermediate vs ~200KB)compress: true on export-diagram / finish-diagram to keep .drawio files smallpython3 tools/scripts/save-drawio.py to extract via terminalpython-diagrams), inline Mermaid (use mermaid)Every tool that accepts an array MUST be called exactly ONCE with all items. Never call a tool repeatedly for individual items.
search-shapes — ONE call with all queries (main flow + cross-cutting)create-groups — ONE call with all groups. Set text: "" and create a separate text vertex above each groupadd-cells — ONE call with all vertices AND edges, vertices first. Use temp_id for cross-refs, shape_name for iconsadd-cells-to-group — ONE call with all assignmentsedit-cells / edit-edges — ONE call if adjustments are neededfinish-diagram (transactional) or export-diagram (default) — with compress: trueAfter group assignments, call validate-group-containment to detect children that exceed group bounds.
diagram_xml from the previous call on every subsequent call. Save XML to a temp file between steps; read only the IDs you need rather than the whole JSON.Concise summary; load references/style-reference.md → "Layout Conventions (extended)" for full detail (numbered callouts, fan-out staggering, legend HTML, group sizing, non-Azure component styling).
edgeStyle=orthogonalEdgeStyle); never set entryX/Y / exitX/Y and never add <Array as="points"> waypoints. Target specific icons inside groups, not the group celltext: "" on shape samplesEdge post-processing (CRITICAL): After
finish-diagram, runtools/scripts/save-drawio.pyto strip auto-router anchors and waypoints so Draw.io can recalculate clean orthogonal paths. The post-save cleanup script (cleanup-drawio.py) is documented inreferences/creation-workflows.md.
text: "" breaks shapes — every shaped vertex MUST have a text label
or omit text entirely; never pass "".shape_name — never pass width, height, or style
when using shape_name; the MCP server auto-applies correct values.finish-diagram — otherwise the diagram
keeps ~2KB placeholders instead of real SVG icons.shape=image + image=data:image/svg+xml;base64,… is the RESOLVED form —
do NOT confuse it with placeholder=1. After finish-diagram(compress: true),
every Azure icon appears as shape=image;…;image=data:image/svg+xml;base64,<svg>
with a multi-path Azure-brand SVG inside. The validator counts these as
totalImages (real icons). The placeholder=1 style attribute is the ONLY
marker of an unresolved transactional cell — count it with
grep -c 'placeholder=1' file.drawio before declaring a diagram broken.entryX/Y, exitX/Y, or add
<Array as="points"> to edges.| File | Purpose |
|---|---|
references/style-reference.md | Draw.io style properties for AI-generated files |
references/azure-patterns.md | Reusable MCP tool call patterns for Azure architectures |
references/validation-checklist.md | Validation rules for AI-generated .drawio files |
references/abstraction-rules.md | Diagram abstraction and data-flow clarity rules |
references/iac-to-diagram.md | Generate diagrams from Bicep/Terraform/ARM templates |
references/quality-rubric.md | Canonical 0–4 quality rubric (7 dimensions, thresholds) |
references/semantic-zones.md | Subscription / region / trust-boundary / external zone templates |
references/diagram-types.md | Logical / network / sequence / deployment selection + signatures |
references/legend-template.md | Copy-pasteable legend block (inline + two-column variants) |
references/icon-variants.md | Service tier / SKU disambiguation + single-batch contract |
references/large-architecture-decomposition.md | Tier S/M/L/XL breakpoints, decomposition, density target |
| File | Pattern |
|---|---|
examples/azure-vm-baseline-architecture.drawio | VM baseline — VNet + 6 subnets, vertical flow, legend |
examples/azure-aks-microservices.drawio | AKS microservices — horizontal flow, namespaces, CI/CD |
examples/azure-dns-private-resolver.drawio | DNS Private Resolver — hub-spoke, numbered callouts |
examples/azure-foundry-landing-zone.drawio | Foundry Chat — landing zone, multi-subscription |
examples/azure-vm-baseline-architecture.svg | Source SVG from Microsoft Learn (reference comparison) |
a0098f9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.