diagram
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.
What this skill does
# 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](https://kroki.io) 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](https://docs.astral.sh/uv/)). 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.
| Flag | Description |
| -------------------- | ---------------------------------------------------------------------------------------------------------- |
| `--input <path>` | Read diagram source from a file. Extension drives type auto-detect (see table below). |
| `--source "<text>"` | Inline diagram source (alternative to `--input`). |
| stdin | Used 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:
```bash
# 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:
```json
{"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`.
```bash
./diagram-cli/diagram types # all types
./diagram-cli/diagram types mermaid # one type
```
## Supported diagram types (summary)
| Type | File extensions | Output formats |
| ------------- | ------------------------------ | --------------------------- |
| `plantuml` | `.puml`, `.plantuml`, `.iuml` | svg, png, pdf, txt, base64 |
| `mermaid` | `.mmd`, `.mermaid` | svg, png |
| `graphviz` | `.dot`, `.gv` | svg, png, jpeg, pdf |
| `d2` | `.d2` | svg |
| `dbml` | `.dbml` | svg |
| `bpmn` | `.bpmn` | svg |
| `c4plantuml` | `.c4`, `.c4puml` | svg, png, pdf, txt, base64 |
| `erd` | `.erd` | svg, png, jpeg, pdf |
| `ditaa` | `.ditaa` | svg, png |
| `excalidraw` | `.excalidraw` | svg |
| `nomnoml` | `.nomnoml` | svg |
| `pikchr` | `.pikchr` | svg |
| `structurizr` | `.structurizr`, `.dsl` | svg, png, pdf, txt, base64 |
| `svgbob` | `.svgbob` | svg |
| `tikz` | `.tikz` | svg, png, jpeg, pdf |
| `vega` | `.vega` | svg, png, pdf |
| `vegalite` | `.vl`, `.vegalite` | svg, png, pdf |
| `wavedrom` | `.wavedrom` | svg |
| `wireviz` | `.wireviz` | svg, png |
| `bytefield` | `.bytefield` | svg |
| `symbolator` | — | svg |
| `umlet` | — | svg, png, jpeg |
| `blockdiag` family (`blockdiag`, `seqdiag`, `actdiag`, `nwdiag`, `packetdiag`, `rackdiag`) | matching `.*diag` extension | svg, 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
| Code | Meaning |
| -------------------- | -------------------------------------------------------------------------------- |
| `PREREQ_MISSING` | `uv` is not installed. |
| `INPUT_CONFLICT` | More than one of `--input` / `--source` / stdin was provided. |
| `INPUT_MISSING` | No 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_MISSING` | Type was not given and could not be inferred from the input file extension. |
| `TYPE_UNKNOWN` | Type name is not in the supported list — run `diagram types`. |
| `FORMAT_UNSUPPORelated in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.