agentspec: Command for Claude Code

.claude/commands/visual-explainer/generate-web-diagram.md

generate-web-diagram is a command for Claude Code from luanmorenommaciel/agentspec. It costs 12 tokens per session (185 once invoked), scanned A, a copy of generate-web-diagram, MIT.

A command that creates a standalone HTML diagram and opens it in a web browser, following a visual-explainer design workflow.

In plain words
What is it for?
Use it to create diagrams for processes, systems, relationships, or other concepts. It can include Mermaid diagrams and, when appropriate, a generated illustration embedded in the HTML.
Why use it?
It turns a request for a visual explanation into a browser-viewable page and provides guidance for choosing layouts, styles, and optional illustrations. It is useful when prose or a simple code snippet would not explain the structure clearly.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is luanmorenommaciel/agentspec's own configuration. It tells Claude Code how to work on agentspec itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agentspec configures →

Reuse

Borrowing it

Nothing to install: this file belongs to luanmorenommaciel/agentspec. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/luanmorenommaciel/agentspec/main/.claude/commands/visual-explainer/generate-web-diagram.md
Clone the repo
git clone --depth 1 https://github.com/luanmorenommaciel/agentspec

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/luanmorenommaciel/agentspec/generate-web-diagram/github.svg)](https://agentmods.dev/commands/luanmorenommaciel/agentspec/generate-web-diagram)
Your own site
<a href="https://agentmods.dev/commands/luanmorenommaciel/agentspec/generate-web-diagram"><img src="https://agentmods.dev/badge/commands/luanmorenommaciel/agentspec/generate-web-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 generate-web-diagram

Your own site · 80×15
<a href="https://agentmods.dev/commands/luanmorenommaciel/agentspec/generate-web-diagram"><img src="https://agentmods.dev/badge/commands/luanmorenommaciel/agentspec/generate-web-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 185 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 100% copy Near-identical to another mod 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.00012 $0.00185
Opus 5 $0.00006 $0.00093
Sonnet 5 $0.00002 $0.00037
Haiku 4.5 $0.00001 $0.00018

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

Security

Grade A, and why

generate-web-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 7d 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.

Origin

This is a copy

100% identical to generate-web-diagram — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/visual-explainer/generate-web-diagram.md · 11 lines

What it actually says

Load the visual-explainer skill, then generate an HTML diagram for: $@

Follow the visual-explainer skill workflow. Read the reference template and CSS patterns before generating. Pick a distinctive aesthetic that fits the content — vary fonts, palette, and layout style from previous diagrams.

If surf CLI is available (which surf), consider generating an AI illustration via surf gemini --generate-image when an image would genuinely enhance the page — a hero banner, conceptual illustration, or educational diagram that Mermaid can't express. Match the image style to the page's palette. Embed as base64 data URI. See css-patterns.md "Generated Images" for container styles. Skip images when the topic is purely structural or data-driven.

Write to ~/.agent/diagrams/ and open the result in the browser.

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. 7d ago First seen · 11 lines · 12 tokens per session scan A b23769667b46

Subscribe to this mod's changes

generate-web-diagram is a command published in the GitHub repository luanmorenommaciel/agentspec (246 stars, last pushed today), licensed MIT. It adds 12 tokens to every session and 185 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to generate-web-diagram, differing in 4 lines, and is treated as a copy.