diagram-skill

diagram-skill is a skill for Codex from CodingFeng101/CanvasAnvil. It costs 55 tokens per session (1,399 once invoked), scanned A, original, MIT.

A tool guide for creating, editing, and checking diagrams.net (draw.io) diagrams as XML, the text format used to store their shapes and connections. It can open the resulting diagram in the online editor for further editing.

In plain words
What is it for?
Use it for flowcharts, architecture diagrams, and other diagrams made in draw.io or diagrams.net.
Why use it?
It helps produce editable diagrams without manually manipulating the diagram file or dealing with incomplete XML by hand.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it for flowcharts, architecture diagrams, and other diagrams made in draw.io or diagrams.net.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/codingfeng101/canvasanvil/diagram-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add CodingFeng101/CanvasAnvil --skill diagram-skill
Clone the repo
git clone --depth 1 https://github.com/CodingFeng101/CanvasAnvil

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagram-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/codingfeng101/canvasanvil/diagram-skill/github.svg)](https://agentmods.dev/skills/codingfeng101/canvasanvil/diagram-skill)
Your own site
<a href="https://agentmods.dev/skills/codingfeng101/canvasanvil/diagram-skill"><img src="https://agentmods.dev/badge/skills/codingfeng101/canvasanvil/diagram-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagram-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/codingfeng101/canvasanvil/diagram-skill"><img src="https://agentmods.dev/badge/skills/codingfeng101/canvasanvil/diagram-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,399 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.01399
Opus 5.5 $0.00022 $0.00560
Sonnet 5.5 $0.00011 $0.00280
Haiku 4.5 $0.00006 $0.00140

Measured yesterday against content hash c1a5ba422e36, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diagram-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/build-drawio-url.mjs, scripts/check-layout.mjs, scripts/validate-drawio-xml.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/diagram-skill/SKILL.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Diagram Skill

Trigger

Use when the user asks for a diagram, flowchart, architecture diagram, network diagram, ER diagram, BPMN diagram, or a cloud/infrastructure diagram, or mentions draw.io, diagrams.net, drawio, or a .drawio file.

Order

  1. Classify the request.
  2. Read the required references.
  3. Plan: in 1–3 sentences, say what the diagram shows, its layout kind, its groups and its main flow (for an edit, what changes and why). Show the plan to the user.
  4. Produce or modify draw.io XML, laid out on a grid for that layout kind.
  5. Write the XML to a .drawio file (a scratch file if file writes are limited).
  6. Validate the structure with scripts/validate-drawio-xml.mjs.
  7. Check the layout with scripts/check-layout.mjs. Fix every error it reports and run it again, keeping the arrangement while fixing.
  8. Build an online editor URL and open it in the agent's built-in browser.
  9. Return the plan, the XML code, the .drawio path, the layout score and the online editor link.

Classification

  • prompts/display.md
    • new diagram
    • major rewrite
    • major relayout
    • any case where local editing is fragile
  • prompts/edit.md
    • current XML exists
    • change is small and precise
    • ids can remain stable
  • prompts/append.md
    • earlier XML output was truncated
  • prompts/router.md
    • routing decision needed before generation

Required References

  • references/xml-rules.md
  • references/layout-rules.md
  • references/edit-rules.md
  • references/shape-library-index.md
  • references/shape-libraries/<library>.md

Read the library file before generating any library-backed diagram.

Do not guess undocumented shape-library prefixes or shape names.

XML Contract

  • New diagrams should normally produce a full <mxGraphModel> with <root>.
  • Every mxCell is written flat inside <root>; nesting is expressed with parent.
  • Root cells must exist:
    • <mxCell id="0"/>
    • <mxCell id="1" parent="0"/>
  • Every id must be unique; 0 and 1 are reserved, never used for a shape or an edge.
  • Groups are real containers: container=1 (or swimlane), with members using parent="<group id>" and coordinates relative to the group.
  • Edges use parent="1", and their source and target must reference existing ids.
  • Preserve existing ids during local edits unless renaming is explicitly required.
  • Escape XML attribute values correctly.
  • Do not emit XML comments.

Read the full file on GitHub · 127 lines

Files

What ships with it

45 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +18 lines c1a5ba422e36
  2. 11d ago First seen · 109 lines · 55 tokens per session scan A 2e91f28d6ed6

Subscribe to this mod's changes

diagram-skill is a skill published in the GitHub repository CodingFeng101/CanvasAnvil (160 stars, last pushed yesterday), licensed MIT. It adds 55 tokens to every session and 1,399 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-27.

Related

diagram-skill compared with skills from other repositories

diagram-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
diagram-skillCodingFeng101/CanvasAnvilSkill160yesterdayMITA55Codex
drawio-skillAgents365-ai/drawio-skillSkill11k5d agoMITA107Claude Code, Codex
cocosketchSnowflake-Labs/cocoplusSkill7272d agoMITA20Claude Code
fin-arch-diagramcsmar432/finai-researchSkill1093d agoMITA72Cursor
bruce-drawiobruc3van/bruce-drawioSkill1142mo agoMITA129Claude Code, Codex
FlowForgewentong2022-arch/flowforge-skillSkill1394mo agoMITA153Claude Code
excalidrawAgents365-ai/365-skillsSkill1004d agononeA73Claude Code