gen-diagram

gen-diagram is a skill for Claude Code from sgaunet/claude-plugins. It costs 39 tokens per session (4,921 once invoked), scanned C, original, MIT.

A tool that creates editable D2 architecture diagrams from a project description or codebase. It saves the diagram source and can render an SVG image when D2 is installed.

In plain words
What is it for?
Use it to document software or infrastructure architecture in design documents and README files, including services, databases, queues, and external systems.
Why use it?
It avoids drawing architecture diagrams by hand or committing static images that become outdated. The source files can be reviewed and updated with the code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; names the AskUserQuestion tool; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the software-engineering plugin — 18 skills, 7 agents shipped together

Good fit Use it to document software or infrastructure architecture in design documents and README files, including services, databases, queues, and external systems.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add sgaunet/claude-plugins
Claude Code
/plugin install software-engineering

Made for: Claude Code.

Or install software-engineering, the plugin that ships this one along with the rest of its 18 skills, 7 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgaunet/claude-plugins/gen-diagram"><img src="https://agentmods.dev/badge/skills/sgaunet/claude-plugins/gen-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,921 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00039 $0.04921
Opus 5.5 $0.00016 $0.01968
Sonnet 5.5 $0.00008 $0.00984
Haiku 4.5 $0.00004 $0.00492

Measured 22d ago against content hash 3fa4a932d071, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

gen-diagram scanned grade C with 2 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 22d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

• Linux: curl -fsSL https://d2lang.com/install.sh | sh -s --

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

• Linux: curl -fsSL https://d2lang.com/install.sh | sh -s --
plugins/software-engineering/skills/gen-diagram/SKILL.md · 442 lines

How it starts

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

Generate d2 Diagram

Produce a .d2 source file (and a rendered .svg when the d2 binary is installed) that captures a software or infrastructure architecture. Default engine is d2 (https://d2lang.com/), default icons come from https://icons.terrastruct.com/.

Why This Skill Exists

Problem: Architecture diagrams in design docs and READMEs are usually either missing, drawn in a closed-source tool that no one can edit, or pasted as PNG screenshots that drift from reality. Running through d2 syntax and the icon catalog by hand takes 10-20 minutes per diagram.

Solution: One invocation that:

  • Synthesizes a .d2 source file from a free-text description or repo analysis
  • Embeds vendor icons from icons.terrastruct.com only when the URL is known to resolve
  • Renders to SVG automatically if d2 is installed
  • Stores both files in docs/diagrams/ for diff-able, PR-reviewable diagrams

Content Generation Rules

CRITICAL: When generating any content (.d2 source, file headers, descriptions, or any other output):

  • NEVER add Claude Code attribution or co-authorship
  • NEVER include phrases like "Generated by Claude", "Created with Claude Code", or similar
  • NEVER add "Co-Authored-By: Claude" in commit messages or documentation
  • All generated content should appear as if written by a human developer
  • Focus on technical accuracy and clear, readable d2 source

Process (6 Phases)

Phase 1: Prerequisites Validation

  1. Validate Git repository:

    git rev-parse --git-dir
    
    • If fails: Exit with error "Not a git repository. Run 'git init' first."
  2. Detect d2 and the mise toolchain (non-blocking, and no writes in this phase):

    command -v d2
    command -v mise
    test -f mise.toml && grep -qE '^[[:space:]]*"?d2"?[[:space:]]*=' mise.toml
    
    • d2 on PATH: store d2Installed = true. Capture version: d2 --version.
    • d2 absent: store d2Installed = false (will warn later, but proceed — the .d2 source is produced either way).
    • mise on PATH: store miseAvailable = true.
    • mise.toml already pins d2: store d2Pinned = true.

Read the full file on GitHub · 442 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. 22d ago First seen · 442 lines · 39 tokens per session scan C 3fa4a932d071

Subscribe to this mod's changes

gen-diagram is a skill published in the GitHub repository sgaunet/claude-plugins (16 stars, last pushed 8d ago), licensed MIT. It adds 39 tokens to every session and 4,921 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-25.

Related

Other skills, from other repositories

customer-journey-map

Create an end-to-end customer journey map with stages, touchpoints, emotions, pain points, and opportunities. Use when mapping the customer experience, identifying friction points, improving onboarding, or visualizing the user journey.

phuryn/pm-skills · 49 tokens

visual-explainer

Generate self-contained HTML pages that visually explain technical material — systems, code changes, plans, data. Use when the user asks for any diagram or visual explanation, when they want a slide deck or a longform document (user guide, how-to, reference page), when another skill needs one rendered, or proactively…

NikiforovAll/claude-code-rules · 84 tokens

brand

A project-specific visual identity for chat cards and saved reports, using the project's colors, logo, and fonts. It finds these details in the repository or asks the user for them, then stores the result in a committable `.readable/` folder.

smk-labs/claude-plugins · 64 tokens

verifying-design-canvas

Verify a live deployed app matches its Claude Design canvas (.dc.html): theme tokens, DOM/a11y structure, every interactive state — not just default view. Building instead of verifying? See artifact-design.

qte77/claude-code-plugins · 47 tokens

auditing-website-accessibility

Audits website accessibility for WCAG 2.2 AA compliance, generating findings and code fixes. Use when reviewing accessibility, keyboard navigation, screen reader compatibility, or inclusive design.

qte77/claude-code-plugins · 43 tokens

auditing-website-usability

Audits website usability for UX optimization, covering forms, navigation, validation, and microcopy. Use when reviewing user experience, task completion flows, or interface friction points.

qte77/claude-code-plugins · 41 tokens