Skip to content

Agent skill that turns natural language, code, Terraform/K8s, SQL, OpenAPI, AsyncAPI, Protobuf and GraphQL sources into editable, tested draw.io architecture diagrams: incremental sync, multi-view projection, drift diff, CI architecture tests, whiteboard derasterize, interactive HTML/PPTX/Mermaid exports.

Merge pull request #128 from Chirudeva-Reddy/feat/protoimports

Agents365-aief2cf550096f
diff --cc CHANGELOG.md
index 77ccf00,b09a29a..5b0d9a3
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -9,9 -9,10 +9,13 @@@ semantic-ish versioning (the `metadata.
### Added
+- **AsyncAPI importer** (`asyncapiimports.py`): AsyncAPI 2 and 3 specs can now
+ produce channel, publish/subscribe operation, and payload-schema graphs with
+ source provenance, direction control, and optional grouping.
+ - **Protobuf importer** (`protoimports.py`): parse Protocol Buffers (`.proto`)
+ files into service (with RPC methods), message (with typed fields), and enum
+ nodes with source provenance, request/response and field-type edges, and
+ optional package grouping.
## [3.2.4] - 2026-09-11
diff --cc README.md
index a964779,4325596..268aa96
--- a/README.md
+++ b/README.md
@@@ -31,7 -31,7 +31,8 @@@ A skill that turns natural language an
- **Visualize a codebase** — import graphs for Python / JS-TS / Go / Rust and Python class hierarchies, with Graphviz placement, transitive reduction, and nested module containers
- **IaC and live infrastructure** — Terraform, Kubernetes, and docker-compose configs become diagrams with official AWS / Azure / GCP / K8s icons; snapshot what's *actually deployed* from `terraform show -json`, `docker inspect`, or `kubectl get -o json`
- - **Schemas and pipelines** — SQL DDL → ER diagram, OpenAPI/Swagger → API diagram coloured by HTTP method, AsyncAPI → event-driven architecture diagram, GitHub Actions / GitLab CI → pipeline DAG
-- **Schemas and pipelines** — SQL DDL → ER diagram, OpenAPI/Swagger → API diagram coloured by HTTP method, Protocol Buffers → message/service diagram, GitHub Actions / GitLab CI → pipeline DAG
++- **Schemas and pipelines** — SQL DDL → ER diagram, OpenAPI/Swagger → API diagram coloured by HTTP method, AsyncAPI → event-driven architecture diagram, Protocol Buffers → message/service diagram, GitHub Actions / GitLab CI → pipeline DAG
++
- **Deterministic engines** — sequence diagrams with computed lifelines and activation bars; multi-page C4 models with click-to-drill-down
**Keep it true over time**
@@@ -200,7 -200,7 +201,7 @@@ The full toolbox, grouped by stage
| Stage | Tools |
| --- | --- |
- | **Import** | 14 extractors: **Python · JS/TS · Go · Rust** import graphs, **Python class inheritance**, **Terraform / Kubernetes / docker-compose** with official cloud icons, **live** infra from `terraform show -json` / `docker inspect` / `kubectl get -o json`, **SQL DDL → ERD**, **OpenAPI → API diagram** (coloured by HTTP method), **AsyncAPI → event-driven architecture diagram**, **GitHub Actions + GitLab CI → DAG** |
-| **Import** | 14 extractors: **Python · JS/TS · Go · Rust** import graphs, **Python class inheritance**, **Terraform / Kubernetes / docker-compose** with official cloud icons, **live** infra from `terraform show -json` / `docker inspect` / `kubectl get -o json`, **SQL DDL → ERD**, **OpenAPI → API diagram** (coloured by HTTP method), **Protobuf → message/service diagram**, **GitHub Actions + GitLab CI → DAG** |
++| **Import** | 15 extractors: **Python · JS/TS · Go · Rust** import graphs, **Python class inheritance**, **Terraform / Kubernetes / docker-compose** with official cloud icons, **live** infra from `terraform show -json` / `docker inspect` / `kubectl get -o json`, **SQL DDL → ERD**, **OpenAPI → API diagram** (coloured by HTTP method), **AsyncAPI → event-driven architecture diagram**, **Protobuf → message/service diagram**, **GitHub Actions + GitLab CI → DAG** |
| **Compare & evolve** | `drawiodiff.py` colour-codes drift between two diagrams or two live snapshots (added=green, removed=red, changed=orange); `timelapse.py` replays git history as an HTML player; `prdiff.py` renders PR diffs in CI |
| **Repurpose** | `explain.py` → Markdown, `drawiohtml.py` → pan/zoom/search HTML viewer, `drawio2pptx.py` → deck, `svgflow.py` → animated SVG, `drawio2mermaid.py` → diagrams-as-code, `runbook.py` → clickable triage app, `compress.py` → exec summary with drill-down, `buildup.py` → self-drawing player, `tubemap.py` → metro map |
| **Restyle & enrich** | `restyle.py` applies presets by hue remap, `relabel.py` produces translated twins with layout untouched, `heatmap.py` shades nodes from a metrics CSV/JSON, `edgeports.py` un-stacks edges at shape boundaries |
@@@ -302,7 -302,7 +303,7 @@@ Behind the scenes: **check dependencie
| **Browser fallback** | ✅ diagrams.net URL (viewer + editable) | ✅ diagrams.net URL (plugin) + inline preview | ✅ via optional MCP | ✅ diagrams.net viewer (primary) |
| **Zero-config** | ✅ copy `skills/drawio-skill/` | ✅ | ✅ desktop-only mode | ❌ needs plugin install |
- > **Using the official jgraph plugin?** [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) now ships an official Claude Code plugin (`/plugin install drawio@drawio`) that also generates `.drawio` and exports via the desktop CLI. drawio-skill is complementary — reach for it when you want the code / IaC / SQL / OpenAPI / AsyncAPI importers, AI-brand logos, deterministic sequence & C4 generators, self-check + review loop, and the interactive HTML viewer, all from a single SKILL.md with no MCP server.
-> **Using the official jgraph plugin?** [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) now ships an official Claude Code plugin (`/plugin install drawio@drawio`) that also generates `.drawio` and exports via the desktop CLI. drawio-skill is complementary — reach for it when you want the code / IaC / SQL / OpenAPI / Protobuf importers, AI-brand logos, deterministic sequence & C4 generators, self-check + review loop, and the interactive HTML viewer, all from a single SKILL.md with no MCP server.
++> **Using the official jgraph plugin?** [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) now ships an official Claude Code plugin (`/plugin install drawio@drawio`) that also generates `.drawio` and exports via the desktop CLI. drawio-skill is complementary — reach for it when you want the code / IaC / SQL / OpenAPI / AsyncAPI / Protobuf importers, AI-brand logos, deterministic sequence & C4 generators, self-check + review loop, and the interactive HTML viewer, all from a single SKILL.md with no MCP server.
Full comparison + key-advantages summary in [docs/COMPARISON.md](docs/COMPARISON.md) (with audit timestamp).
diff --cc README_CN.md
index 2378ea3,d755617..30d72ab
--- a/README_CN.md
+++ b/README_CN.md
@@@ -31,7 -31,7 +31,8 @@@
- **可视化代码库** —— Python / JS-TS / Go / Rust 项目的导入关系图与 Python 类继承层级,Graphviz 布点、传递约简、按子包嵌套的容器
- **IaC 与实时基础设施** —— Terraform、Kubernetes、docker-compose 配置直接变成带**官方 AWS / Azure / GCP / K8s 图标**的架构图;也能从 `terraform show -json`、`docker inspect`、`kubectl get -o json` 画出**真正在运行**的东西
- - **Schema 与流水线** —— SQL DDL → ER 图,OpenAPI/Swagger → 按 HTTP 方法着色的 API 图,AsyncAPI → 事件驱动架构图,GitHub Actions / GitLab CI → 流水线 DAG
-- **Schema 与流水线** —— SQL DDL → ER 图,OpenAPI/Swagger → 按 HTTP 方法着色的 API 图,Protocol Buffers → 消息/服务图,GitHub Actions / GitLab CI → 流水线 DAG
++- **Schema 与流水线** —— SQL DDL → ER 图,OpenAPI/Swagger → 按 HTTP 方法着色的 API 图,AsyncAPI → 事件驱动架构图,Protocol Buffers → 消息/服务图,GitHub Actions / GitLab CI → 流水线 DAG
++
- **确定性引擎** —— 序列图自动计算 lifeline 与激活条;多页 C4 模型支持点击下钻
**让图长期保持真实**
@@@ -197,7 -197,7 +198,7 @@@ python3 scripts/drawiohtml.py architect
| 阶段 | 工具 |
| --- | --- |
- | **导入** | 14 个提取器:**Python · JS/TS · Go / Rust** 导入关系图、**Python 类继承**、**Terraform / Kubernetes / docker-compose**(官方云图标)、从 `terraform show -json` / `docker inspect` / `kubectl get -o json` 提取的**实时**基础设施、**SQL DDL → ER 图**、**OpenAPI → API 图**(按 HTTP 方法着色)、**AsyncAPI → 事件驱动架构图**、**GitHub Actions + GitLab CI → DAG** |
-| **导入** | 14 个提取器:**Python · JS/TS · Go / Rust** 导入关系图、**Python 类继承**、**Terraform / Kubernetes / docker-compose**(官方云图标)、从 `terraform show -json` / `docker inspect` / `kubectl get -o json` 提取的**实时**基础设施、**SQL DDL → ER 图**、**OpenAPI → API 图**(按 HTTP 方法着色)、**Protobuf → 消息/服务图**、**GitHub Actions + GitLab CI → DAG** |
++| **导入** | 15 个提取器:**Python · JS/TS · Go / Rust** 导入关系图、**Python 类继承**、**Terraform / Kubernetes / docker-compose**(官方云图标)、从 `terraform show -json` / `docker inspect` / `kubectl get -o json` 提取的**实时**基础设施、**SQL DDL → ER 图**、**OpenAPI → API 图**(按 HTTP 方法着色)、**AsyncAPI → 事件驱动架构图**、**Protobuf → 消息/服务图**、**GitHub Actions + GitLab CI → DAG** |
| **对比与演进** | `drawiodiff.py` 用颜色标出两张图或两个实时快照的漂移(新增=绿、删除=红、变更=橙);`timelapse.py` 把 git 历史重放成 HTML 播放器;`prdiff.py` 在 CI 里渲染 PR diff |
| **二次利用** | `explain.py` → Markdown,`drawiohtml.py` → 平移缩放搜索的 HTML 查看器,`drawio2pptx.py` → 演示稿,`svgflow.py` → 动画 SVG,`drawio2mermaid.py` → diagrams-as-code,`runbook.py` → 点击式排查应用,`compress.py` → 可下钻的高管摘要,`buildup.py` → 自动绘制播放器,`tubemap.py` → 地铁图 |
| **换肤与增强** | `restyle.py` 按色相重映射应用预设,`relabel.py` 布局不动地生成翻译变体,`heatmap.py` 按指标 CSV/JSON 给节点上色,`edgeports.py` 解开形状边界上堆叠的连线 |
@@@ -299,7 -299,7 +300,7 @@@ Skill 会提取配色、形状、字体
| **浏览器降级** | ✅ diagrams.net URL(查看 + 可编辑) | ✅ diagrams.net URL(插件)+ 内联预览 | ✅ 通过可选 MCP | ✅ diagrams.net viewer(主要) |
| **零配置** | ✅ 复制 `skills/drawio-skill/` | ✅ | ✅ 桌面版模式 | ❌ 需安装插件 |
- > **在用官方 jgraph 插件?** [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) 现已提供官方 Claude Code 插件(`/plugin install drawio@drawio`),同样生成 `.drawio` 并通过桌面版 CLI 导出。drawio-skill 与之互补 —— 当你需要代码 / IaC / SQL / OpenAPI / AsyncAPI 导入器、AI 品牌图标、确定性时序图与 C4 生成器、自检 + 审查循环以及交互式 HTML 查看器,且只想用单个 SKILL.md、无需 MCP 服务时,选它。
-> **在用官方 jgraph 插件?** [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) 现已提供官方 Claude Code 插件(`/plugin install drawio@drawio`),同样生成 `.drawio` 并通过桌面版 CLI 导出。drawio-skill 与之互补 —— 当你需要代码 / IaC / SQL / OpenAPI / Protobuf 导入器、AI 品牌图标、确定性时序图与 C4 生成器、自检 + 审查循环以及交互式 HTML 查看器,且只想用单个 SKILL.md、无需 MCP 服务时,选它。
++> **在用官方 jgraph 插件?** [jgraph/drawio-mcp](https://github.com/jgraph/drawio-mcp) 现已提供官方 Claude Code 插件(`/plugin install drawio@drawio`),同样生成 `.drawio` 并通过桌面版 CLI 导出。drawio-skill 与之互补 —— 当你需要代码 / IaC / SQL / OpenAPI / AsyncAPI / Protobuf 导入器、AI 品牌图标、确定性时序图与 C4 生成器、自检 + 审查循环以及交互式 HTML 查看器,且只想用单个 SKILL.md、无需 MCP 服务时,选它。
完整对比 + 核心优势总结见 [docs/COMPARISON_CN.md](docs/COMPARISON_CN.md)(含核查时间戳)。
diff --cc skills/drawio-skill/SKILL.md
index 74df6bc,2141061..f79a3df
--- a/skills/drawio-skill/SKILL.md
+++ b/skills/drawio-skill/SKILL.md
@@@ -1,6 -1,6 +1,6 @@@
---
name: drawio-skill
- description: Create, edit, synchronize, inspect, test, and publish editable draw.io diagrams. Use when the user explicitly requests draw.io/diagrams.net, needs a polished architecture, ERD, UML, sequence, C4, SysML, BPMN, network, swimlane, ML, or infrastructure diagram, wants code/IaC/SQL/OpenAPI/AsyncAPI converted into a diagram, or wants an existing diagram queried, reviewed, diffed, restyled, kept in sync, or made interactive. Prefer Mermaid/PlantUML elsewhere when the requested artifact is diagrams-as-code rather than an editable draw.io file.
-description: Create, edit, synchronize, inspect, test, and publish editable draw.io diagrams. Use when the user explicitly requests draw.io/diagrams.net, needs a polished architecture, ERD, UML, sequence, C4, SysML, BPMN, network, swimlane, ML, or infrastructure diagram, wants code/IaC/SQL/OpenAPI/Protobuf converted into a diagram, or wants an existing diagram queried, reviewed, diffed, restyled, kept in sync, or made interactive. Prefer Mermaid/PlantUML elsewhere when the requested artifact is diagrams-as-code rather than an editable draw.io file.
++description: Create, edit, synchronize, inspect, test, and publish editable draw.io diagrams. Use when the user explicitly requests draw.io/diagrams.net, needs a polished architecture, ERD, UML, sequence, C4, SysML, BPMN, network, swimlane, ML, or infrastructure diagram, wants code/IaC/SQL/OpenAPI/AsyncAPI/Protobuf converted into a diagram, or wants an existing diagram queried, reviewed, diffed, restyled, kept in sync, or made interactive. Prefer Mermaid/PlantUML elsewhere when the requested artifact is diagrams-as-code rather than an editable draw.io file.
license: MIT
allowed-tools: [Bash, Read, Write, WebFetch]
metadata: {"openclaw":{"requires":{"anyBins":["python3"]},"emoji":"📐","os":["darwin","linux","win32"],"install":[{"id":"brew-drawio","kind":"brew","formula":"drawio","bins":["drawio"],"label":"Install draw.io for native exports","os":["darwin"],"optional":true},{"id":"brew-graphviz","kind":"brew","formula":"graphviz","bins":["dot"],"label":"Install Graphviz for automatic layout","os":["darwin"],"optional":true}]},"hermes":{"tags":["drawio","diagram","architecture","visualization","uml"],"category":"design","requires_tools":["python3"],"related_skills":["mermaid","excalidraw","plantuml"]},"author":"Agents365-ai","version":"3.2.4","homepage":"https://github.com/Agents365-ai/drawio-skill","compatibility":"Core IR, XML, sync, query, test, review, and Story workflows need Python 3 only; native export needs draw.io; Graphviz is optional.","platforms":["macos","linux","windows"]}
@@@ -20,7 -20,8 +20,8 @@@ and accessible publishing over a share
| 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, or CI source | Use `diagramctl.py build`; read `references/diagram-ir.md` |
+| 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` |
| 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` |
diff --cc skills/drawio-skill/references/cookbook.md
index e82d0b6,f88f0d6..38c787d
--- a/skills/drawio-skill/references/cookbook.md
+++ b/skills/drawio-skill/references/cookbook.md
@@@ -128,14 -128,14 +128,22 @@@ Turn schema.sql into an ER diagram wit
notation; keep schema prefixes for the billing tables.
```
+## Event-driven architecture from AsyncAPI
+
+```text
+Turn asyncapi.yaml into an event-driven architecture diagram. Show channels,
+publish and subscribe operations, and referenced payload schemas; group related
+flows by tag and lay them out from left to right.
+```
+
+ ## Protobuf / gRPC architecture diagram
+
+ ```text
+ Turn our Protocol Buffers schemas under ./proto into a service and message diagram.
+ Show RPC methods on the service nodes, group by proto package, and link request/response
+ and referenced field types. Output PNG + editable .drawio.
+ ```
+
## ML / deep-learning model
```text
diff --cc skills/drawio-skill/references/diagram-ir.md
index 93a533b,50b1230..3d37e00
--- a/skills/drawio-skill/references/diagram-ir.md
+++ b/skills/drawio-skill/references/diagram-ir.md
@@@ -55,9 -55,9 +55,9 @@@ python3 scripts/diagramctl.py inspect a
python3 scripts/diagramctl.py query architecture.drawio --from internet --to orders-db
```
-`build --from auto` recognizes Diagram IR/graph JSON, SQL, OpenAPI, Protobuf,
-compose, Kubernetes YAML, and common repository markers. Use an explicit `--from`
-when the source is ambiguous.
+`build --from auto` recognizes Diagram IR/graph JSON, SQL, OpenAPI, AsyncAPI,
- compose, Kubernetes YAML, and common repository markers. Use an explicit `--from`
- when the source is ambiguous.
++Protobuf, compose, Kubernetes YAML, and common repository markers. Use an
++explicit `--from` when the source is ambiguous.
## Reconcile instead of regenerate
diff --cc skills/drawio-skill/references/mcp.md
index a4af526,1c3769a..744d462
--- a/skills/drawio-skill/references/mcp.md
+++ b/skills/drawio-skill/references/mcp.md
@@@ -30,7 -30,7 +30,7 @@@ call shells out to `scripts/diagramctl.
| Tool | Maps to | Purpose |
| --- | --- | --- |
| `doctor` | `diagramctl doctor` | Check python/draw.io/Graphviz availability without launching anything |
- | `build` | `build` | Code / IaC / SQL / OpenAPI / AsyncAPI / graph / IR → editable `.drawio` (+ optional IR) |
-| `build` | `build` | Code / IaC / SQL / OpenAPI / Protobuf / graph / IR → editable `.drawio` (+ optional IR) |
++| `build` | `build` | Code / IaC / SQL / OpenAPI / AsyncAPI / Protobuf / graph / IR → editable `.drawio` (+ optional IR) |
| `sync` | `sync` | Incremental re-sync of a diagram from its changed source, preserving manual layout |
| `views` | `views` | Project an IR file into linked executive/system/deployment/dataflow/security pages |
| `architecture_test` | `test` | Deterministic architecture contract rules (policy YAML/JSON); `isError` mirrors the CI exit code |
diff --cc skills/drawio-skill/references/toolbox.md
index cbcbe52,3ef7632..d1583c0
--- a/skills/drawio-skill/references/toolbox.md
+++ b/skills/drawio-skill/references/toolbox.md
@@@ -1,6 -1,6 +1,6 @@@
# Toolbox — every bundled script, by use-case
--A map of the 40 focused tools, the unified `diagramctl.py` orchestrator
++A map of the 41 focused tools, the unified `diagramctl.py` orchestrator
(and its MCP server wrapper), and its
internal `diagram_ir.py` model grouped by what you're trying to do. The
per-task routing table in `SKILL.md` says *when* to reach for each; this says
@@@ -43,7 -43,7 +43,8 @@@ Use focused scripts directly when you n
| a running cluster/stack/cloud | what's **actually deployed** | `tfstate` · `dockerimports` · `k8simports -` |
| a SQL schema | an ER diagram | `sqlerd` |
| an OpenAPI / Swagger spec | an API diagram (by method) | `openapiimports` |
+| an AsyncAPI 2 / 3 spec | an event-driven architecture diagram | `asyncapiimports` |
+ | a Protocol Buffers (.proto) schema | a message/service diagram | `protoimports` |
| CI workflows (GH Actions / GitLab) | the pipeline as a DAG | `ciimports` |
| a diagram + a metrics file | it coloured by the data | `heatmap` |
| a sequence of interactions | a UML sequence diagram | `seqlayout` |
@@@ -89,7 -89,7 +90,8 @@@ All emit graph JSON → `autolayout.py`
- **`sqlerd.py`** — SQL DDL (`CREATE TABLE`) → ERD with crow's-foot FK edges.
- **`ciimports.py`** — GitHub Actions (`.github/workflows/*.yml`) and/or `.gitlab-ci.yml` -> pipeline DAG: job nodes (runner, `matrix xN`, reusable-workflow calls in purple), `needs:` edges, an `on:` trigger node per workflow, jobs boxed per workflow / per GitLab stage.
- **`openapiimports.py`** — OpenAPI 3 / Swagger 2 spec → API diagram: one node per operation (coloured by HTTP method) + one per component schema, with edges to the schemas each operation uses and between nested schemas. `--group` by tag.
+- **`asyncapiimports.py`** — AsyncAPI 2 / 3 spec → event-driven architecture diagram: channel, publish/subscribe operation, and payload-schema nodes with provenance. `--group` by operation tag, channel tag, or channel prefix.
+ - **`protoimports.py`** — Protocol Buffers (`.proto`) → message/service diagram: one node per message, service (with RPC methods), or enum; edges for referenced message field types and service request/response types. `--group` by proto package.
## 4. Live infrastructure → diagram (actually running)
diff --cc skills/drawio-skill/scripts/diagramctl.py
index baacee8,a813c71..9398296
--- a/skills/drawio-skill/scripts/diagramctl.py
+++ b/skills/drawio-skill/scripts/diagramctl.py
@@@ -51,7 -51,7 +51,8 @@@ IMPORTERS =
"compose": "composeimports.py",
"sql": "sqlerd.py",
"openapi": "openapiimports.py",
+ "asyncapi": "asyncapiimports.py",
+ "proto": "protoimports.py",
"ci": "ciimports.py",
}
CODE_IMPORTERS = {"python", "javascript", "js", "go", "rust", "pyclasses"}
@@@ -166,7 -168,7 +173,8 @@@ def importer_ir(source, source_type, gr
"rust",
"pyclasses",
"openapi",
+ "asyncapi",
+ "proto",
}:
cmd.insert(-2, "--group")
proc = subprocess.run(cmd, text=True, capture_output=True)
@@@ -506,7 -508,8 +514,9 @@@ def parser()
p.set_defaults(func=cmd_doctor)
p = sub.add_parser(
- "build", help="build a draw.io from IR, graph JSON, code, IaC, SQL, OpenAPI or AsyncAPI"
+ "build",
- help="build a draw.io from IR, graph JSON, code, IaC, SQL, OpenAPI or Protobuf",
++ help="build a draw.io from IR, graph JSON, code, IaC, SQL, OpenAPI, "
++ "AsyncAPI or Protobuf",
)
p.add_argument("source")
p.add_argument("-o", "--output", required=True)
diff --cc skills/drawio-skill/scripts/diagramctl_mcp.py
index 0d44d2e,1bac5ec..93df2c2
--- a/skills/drawio-skill/scripts/diagramctl_mcp.py
+++ b/skills/drawio-skill/scripts/diagramctl_mcp.py
@@@ -54,7 -54,7 +54,7 @@@ TOOLS =
"name": "build",
"description": (
"Build an editable .drawio diagram from code, IaC, SQL, OpenAPI, "
- "AsyncAPI, compose, a graph JSON, or an existing IR file. "
- "Protobuf, compose, a graph JSON, or an existing IR file. "
++ "AsyncAPI, Protobuf, compose, a graph JSON, or an existing IR file. "
"Auto-detects the "
"source type. Returns a JSON report and writes the .drawio (and "
"optionally the IR JSON)."
@@@ -67,7 -67,7 +67,7 @@@
"type": "string",
"description": "Override auto-detection "
"(python|javascript|go|rust|pyclasses|terraform|kubernetes|"
- "compose|sql|openapi|asyncapi|ci|graph|ir|drawio)",
- "compose|sql|openapi|proto|ci|graph|ir|drawio)",
++ "compose|sql|openapi|asyncapi|proto|ci|graph|ir|drawio)",
},
"group": {
"type": "boolean",
diff --cc tests/test_diagramctl.py
index c4bb54f,b698368..01001ca
--- a/tests/test_diagramctl.py
+++ b/tests/test_diagramctl.py
@@@ -93,9 -91,9 +93,11 @@@ class TestDiagramIR(unittest.TestCase)
["internet", "api", "orders", "db"], d.shortest_path(ir, "internet", "db")
)
self.assertEqual(
++ # pi-lens-ignore: python-sql-injection
4, len(d.query(ir, source="internet", target="db")["nodes"])
)
self.assertEqual(
++ # pi-lens-ignore: python-sql-injection
["db"], [n["id"] for n in d.query(ir, kind="database")["nodes"]]
)
self.assertIn("api", d.articulation_points(ir))
diff --cc tests/test_scripts.py
index 331b44b,0a61ada..a49bf09
--- a/tests/test_scripts.py
+++ b/tests/test_scripts.py
@@@ -276,6 -276,60 +276,60 @@@ class TestAutolayoutColor(unittest.Test
self.assertIn(""", out)
+ class TestDiagramIr(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.d = load("diagram_ir")
+
+ def test_grid_fallback_keeps_drill_down_links(self):
+ """Without Graphviz, write_drawio lays out a grid; links must survive it."""
+ d = self.d
+ real = d._load_autolayout()
+ ir = d.normalize_ir(
+ {
+ "schema": d.SCHEMA,
+ "nodes": [
+ {"id": "api", "label": "API"},
+ {"id": "db", "label": "DB"},
+ ],
+ "edges": [{"source": "api", "target": "db"}],
+ }
+ )
+ ids = [n["id"] for n in ir["nodes"]]
+ views = [
+ {"name": "A", "id": "a", "nodes": ids},
+ {"name": "B", "id": "b", "nodes": ids},
+ ]
+
+ class NoGraphviz:
+ @staticmethod
+ def build_dot(graph):
+ return real.build_dot(graph)
+
+ @staticmethod
+ def wrap_page(cells, page_id=None, name=None):
+ return real.wrap_page(cells, page_id=page_id, name=name)
+
+ @staticmethod
+ def layout(_dot):
+ raise SystemExit("graphviz missing")
+
+ original = d._load_autolayout
- setattr(d, "_load_autolayout", lambda: NoGraphviz)
++ d._load_autolayout = lambda: NoGraphviz
+ try:
+ with tempfile.TemporaryDirectory() as td:
+ path = os.path.join(td, "fallback.drawio")
+ d.write_drawio(ir, path, views=views)
+ with open(path, encoding="utf-8") as fh:
+ xml = fh.read()
+ finally:
- setattr(d, "_load_autolayout", original)
++ d._load_autolayout = original
+
+ self.assertIn('<UserObject id="a--api" label="API"', xml)
+ self.assertIn('link="data:page/id,b"', xml)
+ self.assertIn('link="data:page/id,a"', xml)
+
+
class TestBuiltinPresets(unittest.TestCase):
STYLES = os.path.join(ROOT, "skills", "drawio-skill", "styles", "built-in")