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.
/plugin marketplace add sgaunet/claude-plugins/plugin install software-engineeringWrote 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.
[](https://agentmods.dev/commands/sgaunet/claude-plugins/gen-diagram)<a href="https://agentmods.dev/commands/sgaunet/claude-plugins/gen-diagram"><img src="https://agentmods.dev/badge/commands/sgaunet/claude-plugins/gen-diagram.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00039 | $0.04910 |
| Opus 5 | $0.00019 | $0.02455 |
| Sonnet 5 | $0.00008 | $0.00982 |
| Haiku 4.5 | $0.00004 | $0.00491 |
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 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.
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 -- How it starts
The opening of the file, as written. The whole thing — 440 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate d2 Diagram Command
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 Command 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 command that:
- Synthesizes a
.d2source file from a free-text description or repo analysis - Embeds vendor icons from
icons.terrastruct.comonly when the URL is known to resolve - Renders to SVG automatically if
d2is 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
-
Validate Git repository:
git rev-parse --git-dir- If fails: Exit with error "Not a git repository. Run 'git init' first."
-
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.tomld2on PATH: stored2Installed = true. Capture version:d2 --version.d2absent: stored2Installed = false(will warn later, but proceed — the.d2source is produced either way).miseon PATH: storemiseAvailable = true.mise.tomlalready pins d2: stored2Pinned = true.
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.
- 6d ago First seen · 440 lines · 39 tokens per session scan C 039dc5aaa978
gen-diagram is a command published in the GitHub repository sgaunet/claude-plugins (16 stars, last pushed 4d ago), licensed MIT. It adds 39 tokens to every session and 4,910 once invoked, about $0.0002 per session on Opus 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-08-30.
Other commands, from other repositories
security-audit-static
Static security audit of AI-built code — map trust boundaries, cross-reference documented intent, self-refute every finding, and report only evidence-backed risks.
performance-audit-static
Static performance audit of AI-built code — find N+1 queries and request waterfalls, over-fetching, missing indexes, and caching opportunities, ranked by effort and impact.
write-stories
Break a feature into backlog items — user stories, job stories, or WWA format with acceptance criteria.
battlecard
Create a sales-ready competitive battlecard — positioning, feature comparison, objection handling, and win strategies.
document-app
Reverse-engineer an AI-built codebase into the system documents reviewers and auditors need — a core set (architecture, flows, permissions, variables) plus conditional docs (emails, cron, SEO, automation) when they apply.
plan-okrs
Brainstorm team-level OKRs aligned with company objectives — qualitative objectives with measurable key results.