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.
Python agent-skillsarchitecturearchitecture-diagramasyncapibpmnc4-modelclaude-codediagramdiagrams-as-codedrawioflowchartgithub-actionsgraphqlimage-to-diagramkubernetesmcp-serverprotobufsysmlterraformuml
feat(shapes): rank title-exact matches above tag-only neighbors (v1.11.1) (#22)
Agents365.aid1eaede574e2
diff --git a/skills/drawio-skill/SKILL.md b/skills/drawio-skill/SKILL.mdindex ba1bd8e..1f11f36 100644--- a/skills/drawio-skill/SKILL.md+++ b/skills/drawio-skill/SKILL.md@@ -1,12 +1,12 @@---name: drawio-skill-version: 1.11.0+version: 1.11.1description: Use when the user requests diagrams, flowcharts, architecture diagrams, ER diagrams, UML / sequence / class diagrams, network topology, ML/DL model figures (Transformer/CNN/LSTM), mind maps, or any visualization. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Best suited when the diagram needs custom styling, rich shape vocabulary, swimlanes, or exportable images (PNG/SVG/PDF/JPG). Generates .drawio XML and exports locally via the native draw.io desktop CLI.license: MIThomepage: https://github.com/Agents365-ai/drawio-skillcompatibility: Requires draw.io desktop app CLI on PATH (macOS/Linux/Windows). Self-check step requires a vision-enabled model (e.g., Claude Sonnet/Opus); gracefully skipped if unavailable. Optional auto-layout (scripts/autolayout.py) needs Graphviz (dot).platforms: [macos, linux, windows]-metadata: {"openclaw":{"requires":{"anyBins":["draw.io","drawio"]},"emoji":"📐","os":["darwin","linux","win32"],"install":[{"id":"brew-drawio","kind":"brew","formula":"drawio","bins":["drawio"],"label":"Install draw.io via Homebrew","os":["darwin"]},{"id":"brew-graphviz","kind":"brew","formula":"graphviz","bins":["dot"],"label":"Install Graphviz for optional autolayout.py","os":["darwin"],"optional":true}]},"hermes":{"tags":["drawio","diagram","flowchart","architecture","visualization","uml"],"category":"design","requires_tools":["drawio","draw.io"],"related_skills":["mermaid","excalidraw","plantuml"]},"author":"Agents365-ai","version":"1.11.0"}+metadata: {"openclaw":{"requires":{"anyBins":["draw.io","drawio"]},"emoji":"📐","os":["darwin","linux","win32"],"install":[{"id":"brew-drawio","kind":"brew","formula":"drawio","bins":["drawio"],"label":"Install draw.io via Homebrew","os":["darwin"]},{"id":"brew-graphviz","kind":"brew","formula":"graphviz","bins":["dot"],"label":"Install Graphviz for optional autolayout.py","os":["darwin"],"optional":true}]},"hermes":{"tags":["drawio","diagram","flowchart","architecture","visualization","uml"],"category":"design","requires_tools":["drawio","draw.io"],"related_skills":["mermaid","excalidraw","plantuml"]},"author":"Agents365-ai","version":"1.11.1"}---# Draw.io Diagramsdiff --git a/skills/drawio-skill/references/shapes.md b/skills/drawio-skill/references/shapes.mdindex da67b56..d943ec3 100644--- a/skills/drawio-skill/references/shapes.md+++ b/skills/drawio-skill/references/shapes.md@@ -28,6 +28,11 @@ python3 <this-skill-dir>/scripts/shapesearch.py "uml actor" --json`--json`, emits `[{style,w,h,title}]` for programmatic use.- Copy the `style` verbatim into an `mxCell`, and use the reported `w`/`h` as the`mxGeometry` width/height (vendor icons are drawn at a fixed aspect ratio).+- Results are ranked by tag relevance, with shapes whose **title** contains the+ query terms bubbled to the top of each score tier. Ranking is still a+ heuristic, though, and many shapes share a title (three `Lambda` variants:+ `aws3`/`aws4`/`aws3d`) — so run with `--limit 5` and pick the row whose title+ and size match what you actually want rather than blindly taking #1.```xml<mxCell id="2" value="Lambda" style="<paste the searched style here>" vertex="1" parent="1">diff --git a/skills/drawio-skill/scripts/shapesearch.py b/skills/drawio-skill/scripts/shapesearch.pyindex 95ecfb3..f296565 100644--- a/skills/drawio-skill/scripts/shapesearch.py+++ b/skills/drawio-skill/scripts/shapesearch.py@@ -6,10 +6,13 @@ matching palette shapes so a diagram can use the real draw.io `style=` stringinstead of a hand-guessed one. Covers AWS / Azure / GCP / Cisco / Kubernetes /UML / BPMN / P&ID / electrical / flowchart / network / general shape sets.-Port of the search in jgraph/drawio-mcp (Apache-2.0): tag map with exact +-Soundex matching, strict AND first, scored OR fallback. The bundled index-(data/shape-index.json.gz) is the upstream draw.io shape data — see-data/SHAPE-INDEX-NOTICE.md.+Based on the search in jgraph/drawio-mcp (Apache-2.0): tag map with exact ++Soundex matching, strict AND first, scored OR fallback. The matched set is+identical to upstream; the one addition is a tiebreaker that, among shapes with+the same tag score, prefers ones whose title contains the query terms verbatim+(so "dynamodb" returns the shape titled "DynamoDB", not a neighbor merely tagged+with it). The bundled index (data/shape-index.json.gz) is the upstream draw.io+shape data — see data/SHAPE-INDEX-NOTICE.md.Usage:python3 shapesearch.py "aws lambda" [--limit N] [--json]@@ -115,9 +118,20 @@ def search(shapes, tag_map, query, limit):if (pool is None or idx in pool) and idx not in exact:scores[idx] = scores.get(idx, 0) + 0.5- # Rank by score desc, then title (casefold ~ JS localeCompare), then index —- # the trailing index makes ties deterministic and matches upstream ordering.- ranked = sorted(scores, key=lambda i: (-scores[i], shapes[i].get("title", "").casefold(), i))+ # Rank by tag score desc, then by how many query terms appear verbatim in the+ # title, then casefolded title, then index. The title-hit tiebreak (our one+ # addition over upstream) only reorders *within* an equal tag-score group, so+ # e.g. the shape literally titled "DynamoDB" ranks above a neighbor that is+ # merely tagged `dynamodb` (like "Attribute"). The trailing index keeps ties+ # deterministic.+ term_set = set(terms)++ def title_hits(idx):+ toks = set(re.split(r"[^a-z0-9]+", shapes[idx].get("title", "").casefold()))+ return len(term_set & toks)++ ranked = sorted(scores, key=lambda i: (-scores[i], -title_hits(i),+ shapes[i].get("title", "").casefold(), i))return [{"style": shapes[i]["style"], "w": shapes[i]["w"],"h": shapes[i]["h"], "title": shapes[i]["title"]} for i in ranked[:limit]]