Draw.io Architecture Studio
Produce editable .drawio artifacts, not flattened pictures. The preferred
entrypoint is scripts/diagramctl.py, which unifies generation, incremental
sync, multi-view projection, semantic queries/tests/reviews, failure analysis,
and accessible publishing over a shared Diagram IR.
Choose the workflow
| Request | Route |
|---|---|
| Natural-language diagram with precise styling | Read references/diagram-types.md, then references/xml-authoring.md and author XML |
| Standard flowchart/mindmap/gantt/timeline/etc. with no special styling | If draw.io >=30, read references/mermaid-authoring.md and convert Mermaid to native .drawio |
| Large graph (~15+ nodes) that needs automatic layout | Use autolayout.py; read references/autolayout.md before passing any --layout value |
| Code, Terraform, K8s, compose, SQL, OpenAPI, AsyncAPI, or CI source | Use diagramctl.py build; read references/diagram-ir.md |
| Protocol Buffers schema (.proto) | Use protoimports.py or diagramctl.py build; read references/toolbox.md |
| GraphQL SDL schema (.graphql/.gql) or introspection JSON | Use graphqlerd.py or diagramctl.py build; read references/toolbox.md |
| Running cluster/stack/cloud (actual state, not declared config) | Read references/live-infra.md, then use tfstate.py, dockerimports.py, or k8simports.py - |
| Update a generated diagram without losing manual layout | Use diagramctl.py sync; read references/diagram-ir.md |
| Executive/system/deployment/data-flow/security views | Use diagramctl.py views; read references/diagram-ir.md |
| Query, architecture policy, review, what-if, or guided walkthrough | Read references/semantic-workflows.md |
| MCP host (Claude Desktop, Cursor, VS Code, Codex) should call these workflows | Register scripts/diagramctl_mcp.py; read |