xml-validator

An agent that checks draw.io XML against nine independent rules and returns a structured pass-or-fail report. draw.io is a diagramming app, and XML is the text format used to describe its diagrams.

In plain words
What is it for?
Use it to validate draw.io diagrams produced as XML and provide precise problems for another agent to correct.
Why use it?
It finds malformed structure, missing shape details, duplicate identifiers, and other issues before the diagram is used or passed to a fixer.

Agent

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.

agentmods
npx agentmods add agents/luongnv89/skills/xml-validator
Clone the repo
git clone --depth 1 https://github.com/luongnv89/skills
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,010 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01010
Opus 5 $0.00000 $0.00505
Sonnet 5 $0.00000 $0.00202
Haiku 4.5 $0.00000 $0.00101

Measured 2d ago against content hash 6a908b99f217, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

xml-validator 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 2d ago.

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.

skills/diagram-generator/drawio-generator/agents/xml-validator.md · 140 lines

How it starts

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

XML Validator Agent

Role: Run all 9 validation checks independently on draw.io XML, return structured pass/fail report for fixes.

Input

Receive from xml-generator:

  • Complete draw.io XML string
  • Metadata: page count, element count, edge count, original plan

Procedure

Run each check independently. Record result as PASS or FAIL with remediation details.

Check 1: Valid XML Structure

  • XML parses without error
  • Has <mxfile><diagram><mxGraphModel><root> hierarchy
  • Each page has system cells: id="0" and id="1" parent="0"

Fail remediation: Describe XML syntax error or missing elements


Check 2: All Shapes Have Required Attributes

Every vertex cell (vertex="1") must have:

  • id: unique within page
  • value: label text
  • style: string including html=1;whiteSpace=wrap;
  • vertex="1"
  • parent: valid ID (usually "1")
  • Child <mxGeometry> with: x, y, width, height, as="geometry"

Every style string must include html=1;whiteSpace=wrap;.

Fail remediation: List shapes missing attributes or geometry


Check 3: Unique IDs

All id values must be unique within each page. No duplicates allowed within the same diagram.

Fail remediation: List duplicate IDs and suggested unique suffixes


Check 4: Edge Bindings Valid

Every edge (edge="1") with source or target must reference an existing vertex ID in the same page.

Fail remediation: List edges with broken source/target references


Check 5: Edge Geometry

Every edge must have child <mxGeometry relative="1" as="geometry"/>.

Fail remediation: List edges missing geometry element


Check 6: No Overlapping Shapes

Vertex bounding boxes (x, y, x+width, y+height) must not overlap by more than 10px (unless one is a container parent of the other).

Fail remediation: List overlapping element pairs and suggest shifts


Check 7: Container Hierarchy Valid

Every cell with parent="X" (where X is not "0" or "1") must reference an existing container cell. Children coordinates must be relative to the container.

Read the full file on GitHub · 140 lines

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. 2d ago First seen · 140 lines · 0 tokens per session scan A 6a908b99f217

Subscribe to this mod's changes

xml-validator is an agent published in the GitHub repository luongnv89/skills (121 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,010 tokens. 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-08-30.