Agent skill

diagram-render

Render PlantUML (@startuml…@enduml) and Mermaid fenced blocks to a self-contained HTML preview; if rendering fails, the error text must be embedded in the output image. Use when the user asks to render, preview, or export diagrams.

Stars 1
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/geggo98/dotfiles/tree/main/modules/ai/_files/skills/diagrams

SKILL.md

Diagram renderer (PlantUML + Mermaid)

This skill renders embedded PlantUML and Mermaid snippets to images and produces a self-contained HTML preview. It is safe-by-default: it does not write image files unless the user explicitly requests an output directory.

What counts as a “diagram block”

Extract diagrams from the provided inputs:

  • PlantUML blocks: @startuml ... @enduml
  • Markdown fenced blocks:
    • ```plantuml / ```puml / ```uml
    • ```mermaid

How to run (always use the helper script)

The helper script lives at scripts/render_diagram.sh.

Important: Run the script directly (./scripts/render_diagram.sh). Do not prefix with bash — the script requires zsh and will fail under bash.

If the user passes file/dir paths

Run:

  • scripts/render_diagram.sh $ARGUMENTS

If the user pasted diagram text instead of giving a path

Pipe the text to stdin and add --stdin (do not create a persistent file unless the user asks):

  • cat <<'EOF' | scripts/render_diagram.sh --stdin <other flags>
  • (paste the user’s text, containing @startuml..@enduml and/or fenced blocks)
  • EOF

Timeout

The wrapper script enforces a global timeout via gtimeout. Pass --timeout DURATION to override it (default: 5m). The duration format follows GNU coreutils (e.g. 30s, 5m, 1h).

bash
scripts/render_diagram.sh docs/architecture.md --timeout 10m

Output rules

  1. Default: Produce an HTML preview with embedded images (no image files on disk).
  2. If the user wants images written, require an explicit --out-dir <dir> and write there.
  3. Always report the generated HTML path to the user (the script prints it to stdout).
  4. If any diagram fails, the preview must still include an image for it where the error text is rendered into the image.
  5. You can get structured JSON output with --json (default: minimal, omitting source/bytes). Use --detail full for full output.

Selecting which diagrams to render

  • To list extracted blocks and their IDs:
    • scripts/render_diagram.sh <paths...> --list
  • To render a subset by ID:
    • scripts/render_diagram.sh <paths...> --only 2,5-7

Examples

  • Render everything found in a Markdown doc:
    • scripts/render_diagram.sh docs/architecture.md
  • Only Mermaid blocks from multiple files:
    • scripts/render_diagram.sh docs/*.md --select mermaid
  • Only PlantUML @startuml ... @enduml blocks:
    • scripts/render_diagram.sh src/diagrams --blocks startuml
  • Persist images for CI artifacts:
    • scripts/render_diagram.sh docs/architecture.md --out-dir out/diagrams

Tooling expectations

The helper script will try, in order:

  • PlantUML: plantuml executable; otherwise java -jar <plantuml.jar> if available (via PLANTUML_JAR).
  • Mermaid: mmdc; otherwise npx -y @mermaid-js/mermaid-cli if npx exists.

If a tool is missing, still generate an error image explaining what is missing and how to fix it.

Expand your agent's capabilities with these related and highly-rated skills.

geggo98/dotfiles

eval-notebook

Execute .ipynb notebooks (Python, Kotlin, or any Jupyter kernel) without overwriting; return LLM-friendly JSON with outputs and errors. Use when you need to run or validate a Jupyter notebook.

1 0
Explore
geggo98/dotfiles

nix-shell

Search Nix packages and run commands with packages from nixpkgs that are not installed locally. Use when you need a package not available locally or want to search nixpkgs.

1 0
Explore
geggo98/dotfiles

tmux

Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.

1 0
Explore
geggo98/dotfiles

slidev

Create and present web-based slidedecks for developers using Slidev with Markdown, Vue components, code highlighting, animations, and interactive features. Use when building technical presentations, conference talks, code walkthroughs, teaching materials, or developer decks. Also trigger when the user mentions Slidev, sli.dev, slide decks with code, or wants to create developer-facing presentations.

1 0
Explore
geggo98/dotfiles

adr-writing

Use when documenting significant architectural decisions. Creates focused ADRs explaining context, decision, and alternatives. Prevents vague documentation and implementation detail bloat. Triggers: 'create ADR', 'document decision', making technology/framework/persistence/auth choices, cross-cutting concerns.

1 0
Explore
geggo98/dotfiles

writing-clearly-and-concisely

Use when writing documentation, commit messages, error text, explanations, reports, or summaries. Applies Strunk's principles for clear, vigorous prose. Triggers: writing human-readable content, verbose text, unclear explanations.

1 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results