agentleFS
ThilinaTLMThilinaTLM/agent-skills/diagram/SKILL.md

diagram

Skill4 starsChanged 6 months agoMITView on GitHub

This skill should be used when the user asks to "render a diagram", "draw a diagram", "create a diagram from text", "convert PlantUML to SVG", "render Mermaid", "render PlantUML", "render GraphViz", "render D2", "render DBML", "render BPMN", "convert .puml to png", "convert .mmd to svg", "make a flowchart", "make a sequence diagram", "make an ERD", "draw a UML diagram", "diagram as code", "Kroki", "C4 diagram", or otherwise needs to convert textual diagram source (PlantUML, Mermaid, GraphViz/dot, D2, DBML, BPMN, Excalidraw, Erd, Ditaa, Nomnoml, Pikchr, Structurizr, SvgBob, TikZ, Vega/Vega-Lite, WaveDrom, WireViz, BlockDiag family) into SVG, PNG, PDF, or JPEG. Backed by the Kroki HTTP service — no local diagram toolchain required.

51 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ios-sync, benchmark-models and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Saqlain-811Skill

    ios-sync

    Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)

    Also in 4 projects that use this

  • ShreyRaviSkill

    benchmark-models

    Cross-model benchmark for gstack skills. Runs the same prompt through Claude, GPT (via Codex CLI), and Gemini side-by-side — compares latency, tokens, cost, and optionally quality via LLM judge. Answers "which model is actually best for this skill?" with data instead of vibes. Separate from /benchmark, which measures web page performance. Use when: "benchmark models", "compare models", "which model is best for X", "cross-model comparison", "model shootout". (gstack) Voice triggers (speech-to-text aliases): "compare models", "model shootout", "which model is best".

    Also in 5 projects that use this

  • ShreyRaviSkill

    landing-report

    Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

    Also in 5 projects that use this

  • timurgaleevSkill

    document-generate

    Generate missing docs for a feature, module or project as tutorials, how-tos, reference and explanation.

    Also in 4 projects that use this

  • Saqlain-811Skill

    ios-clean

    Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)

    Also in 3 projects that use this

  • seek888Skill

    open-gstack-browser

    Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".

    Also in 4 projects that use this

  • +2 more from ShreyRavi
  • +1 more from Saqlain-811

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 43 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run diagram render --help for current flags.

    line 15
  2. Very specific:

    Add .kroki-url to .gitignore if it points to an internal hostname.

    line 26
  3. Very specific:

    Run diagram types for the machine-readable, always-current list.

    line 111
  4. Distinctive:

    Default to SVG. It scales, embeds cleanly in HTML/Markdown, and every diagram type supports it.

    line 115
  5. Very specific:

    Prefer writing the diagram source to a file with an unambiguous extension (.puml, .mmd, .dot, etc.).

    line 116
  6. Very specific:

    When RENDER_FAILED comes back, the hint field contains Kroki's syntax-error message — surface it verbatim to the user and to your reasoning.

    line 117

“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

diagram

CLI for rendering text-based diagrams (PlantUML, Mermaid, GraphViz, D2, DBML, BPMN, C4, Erd, Ditaa, Nomnoml, Pikchr, Structurizr, SvgBob, TikZ, Vega, Vega-Lite, WaveDrom, WireViz, BlockDiag / SeqDiag / ActDiag / NwDiag / PacketDiag / RackDiag, Excalidraw, Bytefield, Symbolator, UMlet) to SVG / PNG / PDF / JPEG / TXT / Base64 via the Kroki HTTP API. JSON output.

CLI

  • Path: ./diagram-cli/diagram (relative to this SKILL.md). On Windows use diagram.cmd or diagram.ps1.
  • Requires uv (install). First call provisions the Python environment automatically.
  • Subcommands: render (primary), types (capability discovery).
  • Run diagram render --help for current flags.

Endpoint resolution

The CLI picks the Kroki endpoint in this order:

  1. --endpoint <url> flag
  2. KROKI_URL environment variable
  3. .kroki-url file (one URL, no quotes) walked up from the current working directory — useful for pinning a project to a self-hosted Kroki without touching shell config
  4. https://kroki.io (default, free public instance)

Add .kroki-url to .gitignore if it points to an internal hostname.

Subcommands

diagram render

Renders one diagram and writes the output to a file. Always pass --output <path> — the JSON envelope is the only thing on stdout; the rendered bytes go to the file. After a successful call, use the Read tool on the produced file path to confirm the output looks right.

FlagDescription
--input <path>Read diagram source from a file. Extension drives type auto-detect (see table below).
--source "<text>"Inline diagram source (alternative to --input).
stdinUsed when neither --input nor --source is given and stdin is piped.
--type <name>Diagram type (e.g. plantuml, mermaid, graphviz, d2). Required if not derivable from the extension.
--format <name>Output format. Default svg. Support varies by type — see diagram types.
--output <path>Required. Output file. Parent directories are created.
--endpoint <url>Override Kroki endpoint (also KROKI_URL, .kroki-url).
--timeout <secs>HTTP timeout. Default 30.

Examples:

# Auto-detect type from extension (.mmd → mermaid), default SVG
./diagram-cli/diagram render --input docs/flow.mmd --output docs/flow.svg

# PlantUML to PNG with explicit type/format
./diagram-cli/diagram render --input arch.puml --type plantuml --format png --output assets/arch.png

# Inline GraphViz
./diagram-cli/diagram render \
  --type graphviz \
  --source 'digraph G { Hello -> World }' \
  --output /tmp/hello.svg

# Stdin
cat diagram.d2 | ./diagram-cli/diagram render --type d2 --output diagram.svg

# Self-hosted Kroki
KROKI_URL=http://kroki.internal:8000 ./diagram-cli/diagram render \
  --input flow.puml --output flow.svg

Success output:

{"ok":true,"file":"/abs/path/flow.svg","type":"plantuml","format":"svg","bytes":12345,"endpoint":"https://kroki.io","sourceOrigin":"file"}

diagram types

Lists supported diagram types and their formats. No network call — the table is baked into the CLI. Use this to discover what --type / --format combinations are valid before calling render.

./diagram-cli/diagram types            # all types
./diagram-cli/diagram types mermaid    # one type

Supported diagram types (summary)

TypeFile extensionsOutput formats
plantuml.puml, .plantuml, .iumlsvg, png, pdf, txt, base64
mermaid.mmd, .mermaidsvg, png
graphviz.dot, .gvsvg, png, jpeg, pdf
d2.d2svg
dbml.dbmlsvg
bpmn.bpmnsvg
c4plantuml.c4, .c4pumlsvg, png, pdf, txt, base64
erd.erdsvg, png, jpeg, pdf
ditaa.ditaasvg, png
excalidraw.excalidrawsvg
nomnoml.nomnomlsvg
pikchr.pikchrsvg
structurizr.structurizr, .dslsvg, png, pdf, txt, base64
svgbob.svgbobsvg
tikz.tikzsvg, png, jpeg, pdf
vega.vegasvg, png, pdf
vegalite.vl, .vegalitesvg, png, pdf
wavedrom.wavedromsvg
wireviz.wirevizsvg, png
bytefield.bytefieldsvg
symbolator—svg
umlet—svg, png, jpeg
blockdiag family (blockdiag, seqdiag, actdiag, nwdiag, packetdiag, rackdiag)matching .*diag extensionsvg, png, pdf

Run diagram types for the machine-readable, always-current list.

Workflow guidance

  • Default to SVG. It scales, embeds cleanly in HTML/Markdown, and every diagram type supports it. Switch to PNG only when the consumer can't render SVG (image-only chat, certain markdown renderers).
  • Prefer writing the diagram source to a file with an unambiguous extension (.puml, .mmd, .dot, etc.). The CLI then auto-detects --type and you keep the source under version control alongside the rendered output.
  • When RENDER_FAILED comes back, the hint field contains Kroki's syntax-error message — surface it verbatim to the user and to your reasoning. Most of the time it includes a line number.
  • For very large diagrams, raise --timeout. The default 30 s is generous for Kroki's free instance but a self-hosted one rendering complex PlantUML or TikZ may need more.

Error codes

CodeMeaning
PREREQ_MISSINGuv is not installed.
INPUT_CONFLICTMore than one of --input / --source / stdin was provided.
INPUT_MISSINGNo diagram source was provided.
INPUT_NOT_FOUND--input path does not exist, is not a file, or could not be decoded as UTF-8.
OUTPUT_MISSING--output was not provided.
TYPE_MISSINGType was not given and could not be inferred from the input file extension.
TYPE_UNKNOWNType name is not in the supported list — run diagram types.
FORMAT_UNSUPPORTEDThe (type, format) combination is not supported by Kroki for that type.
RENDER_FAILEDKroki returned 4xx. Usually a syntax error in the source; details in hint.
KROKI_UNAVAILABLENetwork failure, timeout, or Kroki returned 5xx.
IO_ERRORCould not write the --output file.
INTERNAL_ERRORUnexpected CLI failure — file a bug if you see this.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.