diagrams-as-code

diagrams-as-code is a skill for Claude Code, Codex from fmind/dot. It costs 34 tokens per session (916 once invoked), scanned A, original, MIT.

A method for creating technical diagrams from text using Mermaid or D2. Mermaid is commonly used in Markdown and GitHub, while D2 is suited to standalone diagram layouts.

In plain words
What is it for?
Use it to create, validate, render, and export diagrams that explain software systems and their relationships.
Why use it?
It keeps diagrams reviewable as source code and helps choose the appropriate format. It also catches syntax problems before exporting an image.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create, validate, render, and export diagrams that explain software systems and their relationships.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fmind/dot/diagrams-as-code
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 fmind/dot --skill diagrams-as-code
Clone the repo
git clone --depth 1 https://github.com/fmind/dot

Made for: Claude Code, Codex.

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 diagrams-as-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmind/dot/diagrams-as-code/github.svg)](https://agentmods.dev/skills/fmind/dot/diagrams-as-code)
Your own site
<a href="https://agentmods.dev/skills/fmind/dot/diagrams-as-code"><img src="https://agentmods.dev/badge/skills/fmind/dot/diagrams-as-code/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 diagrams-as-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmind/dot/diagrams-as-code"><img src="https://agentmods.dev/badge/skills/fmind/dot/diagrams-as-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 916 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.00034 $0.00916
Opus 5.5 $0.00014 $0.00366
Sonnet 5.5 $0.00007 $0.00183
Haiku 4.5 $0.00003 $0.00092

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

Security

Grade A, and why

diagrams-as-code 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (references/svg/scripts/check_svg.py, references/variants/scripts/gallery.py), 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/diagrams-as-code/SKILL.md · 43 lines

How it starts

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

Diagrams as Code

Use diagrams for boundaries, flows, lifecycles, and comparisons (tables or lists when non-spatial). Simple and pleasant is default: show the plain mental model in 3 to 5 soft-colored boxes (~10 to 15 words total) for flows, or a dark-mode-safe framed mini C1/C2 card (1px #9AA0A6 rounded #FFFFFF card: inputs -> grouped core container with 3 crisp inner boxes -> outputs) for READMEs and architecture briefs, lifting raw flags or protocols into a bottom table.

Plot data charts only when a comparison or baseline adds real decision value; use large readable labels (15 to 18pt on full-width slides), stamp [DRAFT] on unverified draft charts, and default to an editorial bar or line chart with light scale, baseline line, winner highlight, and delta (reserve multi-container C4 graphs and dense diagnostics strictly for opt-in engineering docs). Apply client branding (ask if missing; never mix), keep existing identities, or use ~/.agents/DESIGN.md (fmind/theme) and ~/.agents/themes/ (edit upstream only). Cut chrome, gradients, and AI imagery.

Workflow

  1. Pick a guide below: typst (default calm soft-colored flows and composed cards), charts (Altair or Matplotlib editorial plots), mermaid (GitHub/PR/Zensical fenced blocks), d2 (opt-in routed architecture graphs and single-service C4 layers:), likec4 (opt-in multi-container C4 models), svg (logos and marks), recording (VHS demos), variants (open look or rejected draft).
  2. Render and inspect: keep editable sources and inspect PNG/SVG directly (open whitespace, >= 12px text, >= 8pt chart ticks, fonts, >= 4.5:1 contrast, light/dark legibility).

Task guides

  • charts: Plot quantitative data charts with Altair/vl-convert and Matplotlib: honest scales, CVD palettes, PNG/SVG.
  • d2: Author D2 diagram sources, standalone layouts, theming, and vector/raster exports.
  • likec4: Author opt-in LikeC4 C4 architecture models, validate in CI, and build interactive static explorers.
  • mermaid: Author portable Mermaid diagrams in Markdown and GitHub: frontmatter config, validation, and rendering.
  • recording: Record reproducible, isolated terminal demos with VHS, ttyd, and FFmpeg.
  • svg: Author self-contained SVG logos, geometric marks, and live-text visual checks.
  • typst: Compose branded illustrations, concept diagrams, and cards in Typst stdlib with 2x PNG/SVG exports.
  • variants: Generate numbered logo, cover, or illustration variants with light/dark contact sheets.

Read the full file on GitHub · 43 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. 2d ago Changed e7cd2d609c7c
  2. 4d ago Changed 8a5721fea9aa
  3. 5d ago Changed · +2 lines b779a2a1e0a4
  4. 7d ago Changed · +1 lines · +4 tokens per session 45a661d37d32
  5. 12d ago Changed · -1 tokens per session 52514701d86a
  6. 15d ago Changed · -2 lines de751a4d7469
  7. 16d ago Changed 2846685eaf9c
  8. 20d ago Changed · +2 lines · +3 tokens per session 42b6f53c6c0c
  9. 21d ago Changed · +4 lines · +9 tokens per session 5c575f155812
  10. 23d ago First seen · 36 lines · 19 tokens per session scan A 5e83150ece2e

Subscribe to this mod's changes

diagrams-as-code is a skill published in the GitHub repository fmind/dot (14 stars, last pushed yesterday), licensed MIT. It adds 34 tokens to every session and 916 once invoked, about $0.0001 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-09-17.

Related

diagrams-as-code compared with skills from other repositories

diagrams-as-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
diagrams-as-codefmind/dotSkill14yesterdayMITA34Claude Code, Codex
fmind-visualsfmind/dotfilesSkill43mo agoMITA53Claude Code, Codex
mermaidfmind/dotfilesSkill43mo agoMITA33Claude Code, Codex
d2fmind/dotfilesSkill43mo agoMITA35Claude Code, Codex
product-design-reviewfmind/dotfilesSkill43mo agoMITA47Claude Code, Codex
manage-themeurmzd/dotfilesSkill6todayApache-2.0A187Claude Code
python-stackfmind/dotfilesSkill43mo agoMITA41Claude Code, Codex