Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Diagrams As Code?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/fmind-diagrams-as-code)
---
name: diagrams-as-code
description: "Create Typst, D2, LikeC4, Mermaid, SVG diagrams, Altair/Matplotlib charts, VHS demos, visual variants."
license: MIT
metadata:
kind: collection
author: Médéric HURIER (Fmind)
source: github.com/fmind/dot/tree/main/skills/diagrams-as-code
created: "2026-09-16"
updated: "2026-12-01"
---
# 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](https://github.com/fmind/theme/blob/main/DESIGN.md)) 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).
1. **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
<!-- guides:start -->
- [charts](references/charts.md): Plot quantitative data charts with Altair/vl-convert and Matplotlib: honest scales, CVD palettes, PNG/SVG.
- [d2](references/d2.md): Author D2 diagram sources, standalone layouts, theming, and vector/raster exports.
- [likec4](references/likec4.md): Author opt-in LikeC4 C4 architecture models, validate in CI, and build interactive static explorers.
- [mermaid](references/mermaid.md): Author portable Mermaid diagrams in Markdown and GitHub: frontmatter config, validation, and rendering.
- [recording](references/recording/GUIDE.md): Record reproducible, isolated terminal demos with VHS, ttyd, and FFmpeg.
- [svg](references/svg/GUIDE.md): Author self-contained SVG logos, geometric marks, and live-text visual checks.
- [typst](references/typst.md): Compose branded illustrations, concept diagrams, and cards in Typst stdlib with 2x PNG/SVG exports.
- [variants](references/variants/GUIDE.md): Generate numbered logo, cover, or illustration variants with light/dark contact sheets.
<!-- guides:end -->
## Documentation
- [fmind/theme](https://github.com/fmind/theme) (each guide links its upstream tool docs and releases).
- Companions: [write/typst-deck](../write/references/typst-deck/GUIDE.md), [write/doc](../write/references/doc/GUIDE.md), [docs/site](../docs/references/site/GUIDE.md), [docs/repository](../docs/references/repository/GUIDE.md), [web-frontend](../web-frontend/SKILL.md).