creating-diagrams
Creates legible diagrams from D2 source (flows, architectures, sequences, decision paths) and checks they stay readable at their final size.
Skill by ken-guru
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ken-guru-creating-diagrams
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/creating-diagrams
What's inside
- Skill name
creating-diagrams- Description
- Creates legible diagrams from D2 source (flows, architectures, sequences, decision paths) and checks they stay readable at their final size. Use when a request needs a diagram, flowchart, architecture, sequence, or process picture, or mentions D2.
- License
- MIT
- Metadata
- version: 1.0.0 · changelog: https://github.com/ken-guru/skills/blob/main/skills/creating-diagrams/CHANGELOG.md
- Instructions
- 67 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (13)
- CHANGELOG.md
- SKILL.md
- login-sequence.d2 · examples/
- request-path.d2 · examples/
- retry-decision.d2 · examples/
- trust-boundary.d2 · examples/
- d2-essentials.md · references/
- design.md · references/
- layouts.md · references/
- text-alternatives.md · references/
- creating-diagrams.mjs · scripts/
- tools.mjs · scripts/
- creating-diagrams.test.mjs · tests/
SKILL.md (first lines)
# Creating diagrams Turn a description of what a diagram must show into D2 source, a rendered SVG, and alt text, then prove it is readable where it will be shown. Script paths below are relative to this skill's folder. Run each as one command with the folder's absolute path in front, never chained with `&&`, `$(…)`, or heredocs. ## Inputs - **What it must show**: the message, the subjects, and the relationships. In a slide deck this is the slide's Visual Intent. - **Output path** for the `.svg`. The PNG and ASCII previews are written beside it. - **Theme values** (optional): a JSON file of CSS custom properties (`--color-bg`, `--color-text`, `--color-surface`, `--color-muted`, `--color-accent`, `--color-on-accent`). Without one, a neutral palette is used. - **Slot size** (optional): the space the diagram will fill, in px on a 1280×720 reference, as `WIDTHxHEIGHT`. The default is a 16:9 slide's content area, `1164x616`. ## Workflow Copy this checklist and tick it off: ``` - [ ] 1. D2 is installed - [ ] 2. One message stated - [ ] 3. D2 written with Diagram Roles - [ ] 4. check passes - [ ] 5. render written and the PNG looked at - [ ] 6. Alt text written ``` 1. Run `node scripts/creating-diagrams.mjs setup --status`. If D2 is missing, ask the person to run `node scripts/creating-diagrams.mjs setup` once, outside the sandbox. It downloads the pinned D2 with a verified checksum into a shared cache. 2. Write the diagram's one message as a comment on the first line, for example `# One message: only the API crosses the network boundary.` Split anything that needs two messages into two diagrams. 3. Write D2 that styles every shape and connection with a **Diagram Role** (`class: <role>`) only, never colours or font sizes: | Role | Use for | |---|---| | `base` | ordinary shapes | | `emphasis` | the one or two shapes the message is about | | `muted` | context that matters less | | `risk` | failure, danger, or cost | | `boundary` | containers such as networks or teams (dashed) | | `flow` | ordinary connections | | `optional-flow` | conditional or fallback paths (dashed) | | `risk-flow` | failure paths | 4. Run `node scripts/creating-diagrams.mjs check <file.d2> [--theme <values.json>] [--slot WxH]`. Fix every reported problem and run it again until it passes. A legibility failure names the fix: change direction, shorten or wrap labels, or split the diagram. 5. Run `node scripts/creating-diagrams.mjs render <file.d2> --out <file.svg> [--theme <values.json>] [--slot WxH]`. Look at the `.png` preview, and check that every label in the reported **Labels** list belongs to the diagram. A green check is not proof: rendered layouts can still mislead. 6. Write the alt text, and a long description when the diagram carries more than one sentence of information. See [references/text-alternatives.md](references/text-alternatives.md). ## Rules agents most often miss These compile without any error yet produce the wrong diagram: - Quote any label containing `#` (it starts a comment) or `;` (it splits the shape in two). The `check` command catches these. - Connect **keys**, not labels: `api -> db`, not `API service -> Postgres`, which creates new shapes. - Inside containers, connect by full path (`public.user -> private.api`). A short name outside its container creates a new top-level shape. - In a sequence diagram, declare every actor before any group. An actor first seen inside a group turns the group into an actor. - Keep about four shapes per row. Legibility comes from layout, not font size. - Never add a legend. Put meaning in labels and role styles. ## References - **D2 syntax and silent pitfalls**: [references/d2-essentials.md](references/d2-essentials.md) - **Choosing direction, layout engine, and when to split**: [references/layouts.md](references/layouts.md) - **Diagram design (one message, labels, colour by role)**: [references/design.md](references/design.md) - **Alt text and long descriptions**: [references/text-alternatives.md](references/text-alternatives.md) - **Verified examples** (each passes `check`): [examples/](examples/) For icons, imports, layers, animation, SQL tables, UML classes, and LaTeX, query the installed D2 (`d2 --help`, `d2 layout`) or read [d2lang.com](https://d2lang.com) rather than guessing syntax.
From ken-guru/skills, MIT.
More from ken-guru/skills
- 0.592score
drafting-slides
ken-guru
Drafts a slide deck as one editable Marp Markdown file, with a heading and speaker notes on every slide, citations for every factual claim, and a plan for…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
creating-charts
ken-guru
Creates static, accessible data charts (bar, line, scatter, area, and more) from a data file with Vega-Lite, checks their text is readable at final size, and…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
generating-images
ken-guru
Generates illustrations and photos with an AI image provider (Gemini or OpenAI) after the person approves the cost, and marks every result as AI-generated.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
planning-presentation
ken-guru
Plans a presentation with the person: interviews them until the audience, goal, and premises are clear, records the Brief, and builds an approved storyline…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
rendering-slides
ken-guru
Renders a Marp slide deck to HTML, a tagged PDF, and a speaker-notes script with a polished theme, installing the pinned tools it needs and checking the result.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
reviewing-presentation
ken-guru
Reviews a slide deck for factual accuracy and sourcing, language, legibility, accessibility, timing, and how the rendered slides look, and reports what to fix…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
researching-sources
ken-guru
Finds, vets, and organises credible sources for a question into a Source Set, judging each source's credibility and turning conflicting claims into explicit…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
setup-devcontainer
ken-guru
Generate a shared devcontainer (Ubuntu base image, Node, GitHub CLI, one persistent config volume) in the current repo — one container every AI CLI installs…
SkillAFreshness: A★ 1Claude Code +9 - 0.583score
setup-copilot-devcontainer
ken-guru
Install GitHub Copilot CLI into an existing shared devcontainer generated by the setup-devcontainer skill — its own install step, optional YOLO guidance, and…
SkillAFreshness: A★ 1Claude Code +9 - 0.583score
setup-codex-devcontainer
ken-guru
Install Codex into an existing shared devcontainer generated by the setup-devcontainer skill — its own install step, sandbox capability grant, optional YOLO…
SkillAFreshness: A★ 1Claude Code +9 - 0.547score
unslop
ken-guru
Load when the user asks to edit prose for a more natural voice while preserving meaning, tone, technical precision, and structured output.
SkillBFreshness: B★ 1Claude Code +9 - 0.543score
setup-antigravity-devcontainer
ken-guru
Install Antigravity into an existing shared devcontainer generated by the setup-devcontainer skill — its own install step, optional YOLO alias, optional link…
SkillBFreshness: B★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 1
- Open issues
- 6
- Last commit (this folder)
- Oct 9, 2026 (19 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- Repository
- github.com/ken-guru/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ken-guru
- 0.592score
creating-charts
ken-guru
Creates static, accessible data charts (bar, line, scatter, area, and more) from a data file with Vega-Lite, checks their text is readable at final size, and…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
generating-images
ken-guru
Generates illustrations and photos with an AI image provider (Gemini or OpenAI) after the person approves the cost, and marks every result as AI-generated.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
planning-presentation
ken-guru
Plans a presentation with the person: interviews them until the audience, goal, and premises are clear, records the Brief, and builds an approved storyline…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
rendering-slides
ken-guru
Renders a Marp slide deck to HTML, a tagged PDF, and a speaker-notes script with a polished theme, installing the pinned tools it needs and checking the result.
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
reviewing-presentation
ken-guru
Reviews a slide deck for factual accuracy and sourcing, language, legibility, accessibility, timing, and how the rendered slides look, and reports what to fix…
SkillAFreshness: A★ 1Claude Code +9 - 0.592score
drafting-slides
ken-guru
Drafts a slide deck as one editable Marp Markdown file, with a heading and speaker notes on every slide, citations for every factual claim, and a plan for…
SkillAFreshness: A★ 1Claude Code +9
Cite this page
creating-diagrams skill. Agent Mart. https://agentmart.dev/skills/ken-guru-creating-diagrams (last updated 2026-10-24)