svg-check

svg-check is a cursor rule for Cursor from sordi-ai/skill-everything. It costs 37 tokens per session (1,251 once invoked), scanned A, original, MIT.

A checking rule for SVG diagrams, which are drawings described in code. It measures rendered text and boxes to find text that spills out or overlaps unrelated shapes.

In plain words
What is it for?
Use it whenever you create, edit, review, or approve an SVG diagram. It focuses on text overflow and text touching unrelated rectangles.
Why use it?
Visual inspection can miss small spacing and overlap errors. The check provides a measurable pass/fail test before an SVG is committed.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Gemini CLI.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node skills/svg-check/overflow-check.js path/to/diagram.svg.

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/sordi-ai/skill-everything
agentmods
npx agentmods add rules/sordi-ai/skill-everything/svg-check

Made for: Cursor.

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 svg-check

README.md
[![agentmods](https://agentmods.dev/badge/rules/sordi-ai/skill-everything/svg-check.svg)](https://agentmods.dev/rules/sordi-ai/skill-everything/svg-check)
Your own site
<a href="https://agentmods.dev/rules/sordi-ai/skill-everything/svg-check"><img src="https://agentmods.dev/badge/rules/sordi-ai/skill-everything/svg-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 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,251 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.1 $0.00037 $0.01251
Opus 5 $0.00018 $0.00626
Sonnet 5 $0.00007 $0.00250
Haiku 4.5 $0.00004 $0.00125

Measured 6d ago against content hash d9479c03b6f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

svg-check 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 6d 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.

.cursor/rules/svg-check.mdc · 133 lines

How it starts

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

Sub-Skill: SVG Check

Purpose. Catch text-overflow and foreign-rect-intersection bugs in SVG diagrams before commit. LLM eyeball review at 4× zoom misses these bug classes consistently — measurement is the only reliable test.

The acceptance test is the script output. Not your visual judgment.


When to apply

Apply this skill whenever:

  • you are editing an existing SVG (*.svg in any docs/diagrams folder),
  • you are producing a new SVG from scratch,
  • a designer agent reports an SVG as "clean" — verify with the script,
  • you are reviewing a PR that touches *.svg.

The two bug classes the script catches

  1. OVERFLOW (own-container): a <text> whose rendered bbox extends past the bounds of its containing <rect> (in the same <g>). Caught by getBBox() measurement, tolerance 2 px.

  2. FOREIGN-RECT INTERSECT: a <text> whose viewport bbox intersects a <rect> that is not an ancestor of the text — i.e. a tagline ascender that touches a structural box above/below it. Caught by getBoundingClientRect() intersection, tolerance 2 px.

Both classes filter false-positives: rects smaller than 40 × 18 (legend swatches) are not treated as containers; texts that start more than 5 px outside a rect's horizontal range are not treated as contained.


How to run

The script lives next to this file: overflow-check.js. It needs Playwright installed once per machine.

One-time setup

# From the skill folder
cd skills/svg-check
bash setup.sh

Or manually:

npm install playwright
npx playwright install chromium --with-deps

Run on one SVG

node skills/svg-check/overflow-check.js path/to/diagram.svg

Run on all SVGs in a folder

for svg in path/to/*.svg; do
  out=$(node skills/svg-check/overflow-check.js "$svg" 2>&1)
  if echo "$out" | grep -q "FOUND"; then
    echo "FAIL: $svg"; echo "$out" | grep -E "FOUND|  \[|  \""
  fi
done

The script exits non-zero when issues are found — suitable for use as a pre-commit gate or CI step.

Read the full file on GitHub · 133 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. 6d ago First seen · 133 lines · 37 tokens per session scan A d9479c03b6f0

Subscribe to this mod's changes

svg-check is a cursor rule published in the GitHub repository sordi-ai/skill-everything (20 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 1,251 once invoked, about $0.0002 per session on Opus 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-08-30.