svg-diagram

svg-diagram is a skill for Claude Code from DuanZGit/D-Hub. It costs 73 tokens per session (7,583 once invoked), scanned A, original, MIT.

Guidance for creating technical diagrams as SVG files, a scalable image format, with rules for layout, text, lines, file placement, and Markdown links.

In plain words
What is it for?
Use it to create or update flowcharts, architecture diagrams, and similar figures alongside documentation.
Why use it?
It helps prevent diagrams from being clipped, overlapping, or disagreeing with the document they illustrate.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions subagents.

Good fit Use it to create or update flowcharts, architecture diagrams, and similar figures alongside documentation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/duanzgit/d-hub/svg-diagram
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 DuanZGit/D-Hub --skill svg-diagram
Clone the repo
git clone --depth 1 https://github.com/DuanZGit/D-Hub

Made for: Claude Code.

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-diagram

README.md
[![agentmods](https://agentmods.dev/badge/skills/duanzgit/d-hub/svg-diagram/github.svg)](https://agentmods.dev/skills/duanzgit/d-hub/svg-diagram)
Your own site
<a href="https://agentmods.dev/skills/duanzgit/d-hub/svg-diagram"><img src="https://agentmods.dev/badge/skills/duanzgit/d-hub/svg-diagram/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 svg-diagram

Your own site · 80×15
<a href="https://agentmods.dev/skills/duanzgit/d-hub/svg-diagram"><img src="https://agentmods.dev/badge/skills/duanzgit/d-hub/svg-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,583 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.00073 $0.07583
Opus 5.5 $0.00029 $0.03033
Sonnet 5.5 $0.00015 $0.01517
Haiku 4.5 $0.00007 $0.00758

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

Security

Grade A, and why

svg-diagram 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 40 executable files (tools/svg-lint/bin/svg-lint.mjs, tools/svg-lint/lib/checks/arrow-marker.mjs, tools/svg-lint/lib/checks/baseline-offset.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.

skills/svg-diagram/SKILL.md · 592 lines

How it starts

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

SVG Diagramming Conventions

Output location and referencing

Diagrams go in SVG, never ASCII art. That rule decides whether to draw; this skill covers how, starting with where the file lands.

  • Put the file in an assets/ directory next to the document (e.g. docs/foo.md → docs/assets/foo-arch.svg)
  • Reference it from markdown with a relative path, ![title](assets/xxx.svg). Do not inline SVG XML.
  • When data in the document changes, the corresponding SVG must be updated too. A figure that contradicts the prose beside it is worse than no figure

Core principles

Get it right on the first pass

The first SVG you generate must already satisfy every item in the verification checklist at the end of this document. Do not rely on user feedback to fix basic layout problems (spacing, padding, alignment, viewBox clipping). After generating, walk the checklist yourself and fix anything you find before showing the result.

No overlapping elements

  • Text must not sit on top of boxes or lines
  • Lines must not cut through boxes (unless the line is an arrow terminating at that box)
  • Keep 10–20px between text and lines
  • For spacing between sibling/adjacent boxes see the "Block spacing" section below (single standard: ≥25px, 25–30px recommended)
  • Put color-key legends outside the diagram body (bottom or side), never overlapping the content area
<!-- ✅ Correct: label sits beside the line -->
<path d="M35,200 C 35,120 ..." .../>
<text x="55" y="200">Label text</text>  <!-- 20px clearance -->

<!-- ❌ Wrong: label sits on the line -->
<text x="35" y="200">Label text</text>

Visual balance

The left and right halves should carry similar visual weight; add or remove annotation boxes to even them out.

Layout rules

Centering

content width = right edge of rightmost element - left edge of leftmost element
left margin   = (viewBox width - content width) / 2

Center the title on the content center, not the viewBox center (they differ whenever the content is asymmetric):

Read the full file on GitHub · 592 lines

Files

What ships with it

60 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 First seen · 592 lines · 73 tokens per session scan A 0119ef779a41

Subscribe to this mod's changes

svg-diagram is a skill published in the GitHub repository DuanZGit/D-Hub (0 stars, last pushed 2d ago), licensed MIT. It adds 73 tokens to every session and 7,583 once invoked, about $0.0003 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-11-06.

Related

svg-diagram compared with skills from other repositories

svg-diagram next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
svg-diagramDuanZGit/D-HubSkill02d agoMITA73Claude Code
diagram-workflowrcarmo/piclaw-addonsSkill232d agoMITA20Claude Code, Codex
diagram-colour-pickerrcarmo/piclaw-addonsSkill232d agoMITA21Claude Code, Codex
piznlgis/opengis-skillsSkill7812d agoMITB103Claude Code, Codex
spec-imagerenky1025/agent-skillsSkill1129d agoMITA286Claude Code
image-designrenky1025/agent-skillsSkill1129d agoMITA203Claude Code, Codex
design-md-extractorrenky1025/agent-skillsSkill1129d agoMITA193Claude Code, Codex