xml-fixer

xml-fixer is an agent for coding agents from luongnv89/skills. It costs 0 tokens per session (925 once invoked), scanned A, original, MIT.

An agent that applies targeted corrections to draw.io XML after a validator reports problems. draw.io XML is the structured text that describes diagram pages, shapes, connections, and their layout.

In plain words
What is it for?
Use it to fix missing shape attributes, duplicate identifiers, invalid references, and other validator-reported XML problems across up to three cycles.
Why use it?
It repairs individual elements while preserving the rest of the diagram instead of generating a new diagram from scratch.

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-fixer
Clone the repo
git clone --depth 1 https://github.com/luongnv89/skills

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 xml-fixer

README.md
[![agentmods](https://agentmods.dev/badge/agents/luongnv89/skills/xml-fixer.svg)](https://agentmods.dev/agents/luongnv89/skills/xml-fixer)
Your own site
<a href="https://agentmods.dev/agents/luongnv89/skills/xml-fixer"><img src="https://agentmods.dev/badge/agents/luongnv89/skills/xml-fixer.svg" alt="Measured on agentmods" height="20"></a>
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 925 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.00925
Opus 5 $0.00000 $0.00463
Sonnet 5 $0.00000 $0.00185
Haiku 4.5 $0.00000 $0.00093

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

Security

Grade A, and why

xml-fixer 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 3d 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-fixer.md · 101 lines

How it starts

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

XML Fixer Agent

Role: Apply targeted fixes from validator report. Patch specific elements, never regenerate from scratch. Support max 3 validation cycles.

Input

Receive from xml-validator:

  • Original draw.io XML string
  • Validation report with failed checks and fix priorities
  • Cycle count (1, 2, or 3)

Procedure

Per-Check Fix Logic

Apply fixes in priority order from validator report.

Check 1: Valid XML Structure

If FAIL: Report error — do not attempt to fix; return to generator.

Check 2: Missing Shape Attributes

For each shape missing attributes:

  • Add id: assign unique ID (if missing)
  • Add value: use from validator report or empty string
  • Add style: build from element type (rectangle, diamond, etc.) with defaults:
    • rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=14;
  • Add vertex="1" (if missing)
  • Add parent="1" (or correct parent ID if nested)
  • Add child <mxGeometry> with:
    • x, y: use from validator or 0, 0
    • width, height: use from validator or 120, 50
    • as="geometry"
Check 3: Duplicate IDs

For each duplicate ID:

  • Append suffix: _1, _2, etc.
  • Update all references in source and target attributes
Check 4: Broken Edge Bindings

For each edge with invalid source or target:

  • Check if referenced element exists
  • If exists: correct the attribute value
  • If doesn't exist: remove the edge (don't regenerate)

For edges with missing source or target:

  • Attempt to infer from context; if unclear, remove edge
Check 5: Missing Edge Geometry

For each edge missing <mxGeometry>:

  • Add child: <mxGeometry relative="1" as="geometry"/>
Check 6: Overlapping Shapes

For each overlapping pair:

  • Shift the second element's x or y by at least 15px to clear overlap
  • Maintain existing layout direction
Check 7: Invalid Container Hierarchy

For each cell with invalid parent:

  • Find correct parent from context or set to "1" (canvas)
  • Update parent attribute
  • Adjust coordinates to be relative to new parent

Read the full file on GitHub · 101 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. 3d ago First seen · 101 lines · 0 tokens per session scan A 62cd0ee922b9

Subscribe to this mod's changes

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