json-validator

A checker for Excalidraw JSON, the data format used to store diagrams made in Excalidraw. It runs ten separate checks and returns a pass-or-fail report.

In plain words
What is it for?
Use it to verify generated or edited Excalidraw diagrams, check their elements and bindings, and prepare a structured list of corrections.
Why use it?
It finds invalid structure, missing fields, and other diagram-data problems before the JSON is used. Each failed check includes details for fixing it.

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/json-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,321 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.01321
Opus 5 $0.00000 $0.00660
Sonnet 5 $0.00000 $0.00264
Haiku 4.5 $0.00000 $0.00132

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

Security

Grade A, and why

json-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/excalidraw-generator/agents/json-validator.md · 157 lines

How it starts

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

JSON Validator Agent

Role: Run all 10 validation checks independently on Excalidraw JSON, return structured pass/fail report for fixes.

Input

Receive from json-generator:

  • Complete Excalidraw JSON object
  • Metadata: original plan, element count, arrow count

Procedure

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

Check 1: Valid JSON Structure

  • JSON parses without error
  • Top-level has: type: "excalidraw", version: 2, elements (array), appState (object), files (object)

Fail remediation: Describe syntax error or missing top-level key


Check 2: Required Fields on Every Element

All elements must have ALL these fields: id, type, x, y, width, height, angle, strokeColor, backgroundColor, fillStyle, strokeWidth, strokeStyle, roughness, opacity, groupIds, frameId, roundness, isDeleted, boundElements, updated, link, locked, seed

Additionally:

  • Text elements: must have text, fontSize, fontFamily, textAlign, verticalAlign, containerId, originalText, lineHeight, autoResize
  • Arrow/line elements: must have points, startBinding, endBinding, startArrowhead, endArrowhead

Fail remediation: List elements missing fields and their missing fields


Check 3: Unique IDs

Collect all id values. No duplicates allowed.

Fail remediation: List duplicate IDs and suggested unique suffixes


Check 4: Two-way Text Bindings

For every text element with containerId:

  • The referenced container's boundElements must include {"id": "<text-id>", "type": "text"}

For every shape with a boundElements entry of type: "text":

  • The referenced text element must have containerId pointing back

Fail remediation: List broken bindings (specify which direction is missing)


Check 5: Two-way Arrow Bindings

For every arrow with startBinding.elementId:

  • That element's boundElements must include {"id": "<arrow-id>", "type": "arrow"}

Read the full file on GitHub · 157 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 · 157 lines · 0 tokens per session scan A 5b2bfa382eda

Subscribe to this mod's changes

json-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,321 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.