MCPInstall

plantuml-skill

Use when user requests diagrams, flowcharts, sequence diagrams, class diagrams, component diagrams, ER diagrams, architecture charts, or visualizations — including generating a diagram from existing source code, or rendering/extracting PlantUML embedded in a Markdown file to images (e.g. preparing docs for Confluence/Notion). Also use proactively when explaining systems with 3+ components, APIs, data flows, or class hierarchies. Generates .puml files and exports to PNG/SVG via Kroki API (no local install required).

Installs
4.1K
Last 24h
—
Trending rank
—
Security
Warn

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/agents365-ai/365-skills --skill plantuml-skill
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads plantuml-skill automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

Security audits

Independent scans of the skill's instructions and bundled files.

Gen Agent Trust Hub PassSAFE ·The skill is safe for general use. It facilitates diagram generation by sending PlantUML source text to the public Kroki API for rendering. Users should be aware that diagram content is transmitted externally to kroki.io, although the documentation provides options for local rendering of sensitive data. There is a minor risk of indirect prompt injection when the skill processes external source code or markdown files to extract diagrams.
Socket PassNo alerts
Snyk WarnMEDIUM ·Risk: MEDIUM · 1 issue

SKILL.md

The instructions your agent reads when the skill is triggered.

PlantUML Diagram Skill

Overview

Generate .puml PlantUML diagram files and export to PNG/SVG using Kroki — a cloud rendering API that requires no local installation beyond curl.

Format: .puml (PlantUML text) Renderer: Kroki API (https://kroki.io) — just curl, no Java needed Output: PNG, SVG Diagram types: sequence, component, class, ER, activity, use case, state, C4, and more

When to Use

Explicit triggers:

  • "plantuml diagram", "sequence diagram", "class diagram", "component diagram"
  • "UML", "activity diagram", "use case diagram", "state machine"
  • "visualize", "draw", "diagram", "flowchart", "architecture chart"

Proactive triggers:

  • Explaining a system with 3+ interacting components
  • Describing API flows, authentication sequences, message passing
  • Showing class hierarchies, database schemas, or ER models
  • Illustrating state machines or lifecycle flows

When NOT to use it — route elsewhere:

  • General, non-UML quick diagrams embedded in Markdown → mermaid.
  • Freeform, heavily-styled, or branded diagrams needing pixel control → drawio.
  • A hand-drawn / sketchy look → excalidraw or tldraw.

Modes

Once triggered, route by what the user actually wants — then run the shared render loop (Steps 4–8):

ModeThe user wants…Entry point
Generate (default)a diagram from a text descriptionSteps 1–8 below
From codea diagram of existing source codereferences/from-source-code.md → Steps 4–8
Embedthe PlantUML inside a Markdown doc rendered to imagesreferences/markdown-embed.md
Refineto change an existing diagramload its .puml, apply the minimal edit (Step 7), re-render (Steps 4–6)
Reviewto know whether an existing diagram is readable / correctrun the Step 6 vision self-check on the image

Prerequisites

Option A: Kroki API (recommended — no install)

# Just needs curl (pre-installed on macOS/Linux/Windows Git Bash)
curl --version

Option B: Local Kroki via Docker (for offline use)

docker run -d -p 8000:8000 yuzutech/kroki
# Then replace https://kroki.io with http://localhost:8000 in commands

Option C: Local PlantUML jar (traditional)

# Requires Java + Graphviz
brew install graphviz   # macOS
sudo apt install graphviz  # Ubuntu
# Download plantuml.jar from https://plantuml.com/download
java -jar plantuml.jar diagram.puml

Workflow

Step 1: Check Dependencies

curl --version

curl is available on all modern systems. If missing, install via package manager.

Step 2: Pick Diagram Type

Choose the most appropriate PlantUML diagram type (see reference below).

Step 3: Generate .puml File

Write the PlantUML source file with @startuml / @enduml markers.

Step 4: Export via Kroki (capture the HTTP status)

Pick the backend first. The default below (public Kroki) uploads the .puml source to kroki.io — for sensitive diagrams use a local backend instead, and never silently fall back. See references/rendering-backends.md. For local Kroki, swap https://kroki.io → http://localhost:8000.

# PNG (recommended) — keep the status code so Step 5 can verify it
http=$(curl -s -w "%{http_code}" -o diagram.png \
  -X POST https://kroki.io/plantuml/png \
  -H "Content-Type: text/plain" \
  --data-binary "@diagram.puml")
echo "HTTP $http"

# SVG
http=$(curl -s -w "%{http_code}" -o diagram.svg \
  -X POST https://kroki.io/plantuml/svg \
  -H "Content-Type: text/plain" \
  --data-binary "@diagram.puml")
echo "HTTP $http"

Step 5: Validate & self-correct (loop — do NOT skip)

Never report success on a blind curl. Verify the output first; treat the export as failed if any of these hold:

  • $http is not 200. Kroki returns 400 on a syntax error and writes the error text into the output file, so a .png can exist yet be broken.
  • The file is empty: [ -s diagram.png ] fails.
  • The bytes aren't a real image: file diagram.png should report PNG image data; for SVG the file should start with <svg or <?xml.
if [ "$http" != "200" ] || [ ! -s diagram.png ]; then
  echo "Render failed — Kroki said:"
  cat diagram.png    # the 400 body holds the offending line + reason
fi

On failure: cat the output file to read Kroki's error, fix the flagged .puml line (see Common Mistakes), then re-run Step 4. Repeat up to 3 times. If a targeted line fix doesn't clear it, degrade in this order, re-rendering after each step — stop as soon as it renders:

  1. remove exotic shapes → plain rectangle/component/node
  2. strip skinparam / !theme (render plain first)
  3. remove note lines
  4. simplify labels, wrap in "…"
  5. reduce edges
  6. switch to a simpler diagram type rather than forcing the current one

For a per-diagram-type error catalog and the Kroki safe subset, read references/kroki-troubleshooting.md. If it still fails after 3 tries, stop and show the user the raw Kroki error — do not claim the diagram was produced.

Step 6: Self-check (vision)

The Step 5 loop only proves Kroki returned a valid image — not that the diagram is readable. After it renders, use the agent's vision capability to read the PNG and catch what auto-layout (Graphviz) can't prevent. PlantUML positions everything itself, so the failures here are about readability, not your coordinates:

CheckWhat to look forFix
Label truncation / overrunText clipped or spilling past a boxShorten the label, wrap in "…", or break with \n
Component overlap / crampedBoxes touching or crowded; unreadableAdd together { }, layout hints, or split the diagram
Wrong orientation / aspectDiagram far too wide or too tall to readSwitch left to right direction ↔ top to bottom direction
Edge spaghettiMany relations crossing, hard to followReorder declarations, group with package/together, or add hidden edges for layout
Wrong diagram typeType doesn't suit the contentSwitch type (sequence, state, C4, …)
Low contrastText blends into the fill / themeAdjust skinparam / !theme so text contrasts the fill
  • Max 2 self-check rounds — if issues remain after 2 fixes, show the user anyway.
  • Re-render (Step 4) and re-validate (Step 5) after every fix.
  • If vision is unavailable, skip self-check and show the PNG directly.

Step 7: Review loop

After self-check, show the exported image and collect feedback. Apply the minimal .puml edit for each request, then re-render and re-validate:

User requestEdit action
Change a labelEdit the element / message text in the .puml
Add / remove an element or relationAdd or delete the matching line
Change a colorskinparam, !theme, or an inline #color on the element
Change layout directionSwap left to right direction ↔ top to bottom direction
Restructure / groupWrap related elements in a package / together { }, or regenerate
  • Overwrite the same diagram.puml / output file each round — don't create v1, v2, …
  • Safety valve: after 5 rounds, suggest the user fine-tune the .puml directly or at plantuml.com.

Step 8: Report to User

Only after Steps 5–7 pass. Tell the user:

  • Path to the .puml source file
  • Path to the exported PNG/SVG
  • Brief description of what was generated
  • Which backend rendered it, and whether the source left the machine — e.g. "via public Kroki (uploaded to kroki.io)" vs "via local Kroki (stayed local)"

Import Workflows

Two non-default modes — load the linked playbook when triggered, then run the same Step 4–8 loop:

  • Generate a diagram from existing source code — class diagram of a module, sequence from a request handler, component map of a repo, ER from ORM models. Read the code, extract the real entities/relationships, draw only what's there. → references/from-source-code.md
  • Render PlantUML embedded in Markdown — extract ```plantuml / ```puml blocks (and linked .puml), render each to an image, and rewrite the Markdown with image links (e.g. to publish to Confluence / Notion, which don't render fenced PlantUML). → references/markdown-embed.md

Diagram Types

TypeKeywordUse for
Sequence@startuml + sequence syntaxAPI calls, protocol flows, message passing
Component@startuml + componentsservice architecture, module dependencies
Class@startuml + class syntaxOOP models, data structures
ER / Entity@startuml + entity syntaxdatabase schemas
Activity@startuml + activity syntaxworkflows, business processes
Use Case@startuml + actor/usecasesystem requirements, user stories
State@startuml + state syntaxstate machines, lifecycle
C4 Context@startuml + C4 includeshigh-level system context maps
Mind Map@startmindmaptopic breakdowns, concept maps
Gantt@startganttproject timelines, schedules

Syntax Reference

Component / Architecture Diagram

@startuml
!theme plain

title Microservices Architecture

actor "Client" as client
rectangle "API Gateway" as gateway #LightBlue

rectangle "Services" {
  component "User Service" as user
  component "Order Service" as order
}

database "User DB" as userdb
database "Order DB" as orderdb
queue "Kafka" as kafka

client --> gateway
gateway --> user
gateway --> order
user --> userdb
order --> orderdb
order --> kafka : events

@enduml

Shape types:

  • actor "Name" as id — stick figure (user, external actor)
  • component "Name" as id — component box with [brackets]
  • rectangle "Name" as id — plain rectangle (for groups/layers)
  • database "Name" as id — cylinder (database)
  • queue "Name" as id — queue symbol
  • cloud "Name" as id — cloud shape (external services)
  • node "Name" as id — server/node box
  • frame "Name" as id — frame grouping
  • package "Name" { } — package grouping

Arrows:

  • A --> B — solid arrow
  • A -> B — thin arrow
  • A ..> B — dashed arrow
  • A --> B : label — labeled arrow
  • A <--> B — bidirectional

Colors:

  • #LightBlue, #LightGreen, #LightYellow, #Pink, #Violet
  • #AED6F1 (blue), #A9DFBF (green), #FAD7A0 (orange), #F1948A (red)
  • #D7BDE2 (purple), #F9E79F (yellow), #D3D3D3 (grey)

Sequence Diagram

@startuml
!theme plain
title Login Flow

participant "Client" as C
participant "API Gateway" as G
participant "Auth Service" as A
database "User DB" as D

C -> G : POST /login
G -> A : validateCredentials(user, pass)
A -> D : SELECT * FROM users WHERE email = ?
D --> A : user record
A --> G : 200 OK + JWT token
G --> C : { token: "..." }

@enduml

Arrow types:

  • A -> B — synchronous call
  • A --> B — return / dashed
  • A ->> B — async message
  • A -[#red]-> B — colored arrow
  • activate A / deactivate A — show activation box

Class Diagram

@startuml
!theme plain

class User {
  +int id
  +String name
  +String email
  +login() : bool
  +logout()
}

class Order {
  +int id
  +Date createdAt
  +float total
  +place()
  +cancel()
}

class Product {
  +int id
  +String name
  +float price
}

User "1" --> "*" Order : places
Order "*" --> "*" Product : contains

@enduml

Relationships:

  • A --> B — association
  • A --|> B — inheritance
  • A ..|> B — implements interface
  • A *-- B — composition
  • A o-- B — aggregation
  • A "1" --> "*" B : label — with multiplicities

ER Diagram

@startuml
!theme plain

entity "USER" as user {
  * id : int <<PK>>
  --
  name : varchar
  email : varchar
  created_at : datetime
}

entity "ORDER" as ord {
  * id : int <<PK>>
  --
  * user_id : int <<FK>>
  total : decimal
  status : varchar
}

entity "PRODUCT" as prod {
  * id : int <<PK>>
  --
  name : varchar
  price : decimal
}

user ||--o{ ord : places
ord }o--|{ prod : contains

@enduml

Activity / Flowchart

@startuml
!theme plain

start

:Receive Order;

if (Payment valid?) then (yes)
  :Process Payment;
  :Send Confirmation Email;
  :Update Inventory;
  :Ship Order;
  :Mark as Delivered;
else (no)
  :Send Payment Failed Email;
  :Cancel Order;
endif

stop

@enduml

State Diagram

@startuml
!theme plain

[*] --> Pending

Pending --> Processing : payment_received
Processing --> Shipped : packed
Shipped --> Delivered : confirmed
Processing --> Cancelled : cancel
Pending --> Cancelled : cancel

Delivered --> [*]
Cancelled --> [*]

@enduml

C4 Context Diagram

C4 uses the bundled C4-PlantUML standard library via !include <C4/...>, which Kroki and recent local jars resolve with no network fetch. Export with the standard plantuml endpoint (the c4plantuml Kroki type also works).

@startuml
!include <C4/C4_Context>

title System Context — Internet Banking

Person(customer, "Banking Customer", "A customer of the bank")
System(banking, "Internet Banking System", "Lets customers view their accounts")
System_Ext(mail, "E-mail System", "The internal Microsoft Exchange system")

Rel(customer, banking, "Uses", "HTTPS")
Rel(banking, mail, "Sends e-mail via", "SMTP")
@enduml

Other levels: <C4/C4_Container> (Container, ContainerDb), <C4/C4_Component> (Component). Common macros: Person, System, System_Ext, Container, Rel, Boundary. Do not use a remote !includeurl https://… — Kroki cannot fetch external URLs; always use the bundled <C4/…> form.


Export Commands

Quick reference for the renderer variants. The Kroki ones drop the status capture for brevity — when actually exporting, use the Step 4 form and run the Step 5 validation loop.

# PNG via Kroki API (recommended)
curl -s -X POST https://kroki.io/plantuml/png \
  -H "Content-Type: text/plain" \
  --data-binary "@diagram.puml" \
  -o diagram.png

# SVG via Kroki API
curl -s -X POST https://kroki.io/plantuml/svg \
  -H "Content-Type: text/plain" \
  --data-binary "@diagram.puml" \
  -o diagram.svg

# Via local Kroki Docker (offline)
curl -s -X POST http://localhost:8000/plantuml/png \
  -H "Content-Type: text/plain" \
  --data-binary "@diagram.puml" \
  -o diagram.png

# Via local PlantUML jar (if installed)
java -jar plantuml.jar diagram.puml
# Output: diagram.png in same directory

Themes

!theme plain       ← clean, minimal (recommended)
!theme cerulean    ← blue-tinted
!theme blueprint   ← dark blue background
!theme aws-orange  ← AWS style
!theme vibrant     ← vivid colors

Or use skinparam for custom styling:

skinparam backgroundColor #FAFAFA
skinparam componentBorderColor #555555
skinparam ArrowColor #333333
skinparam FontName Arial

Common Mistakes

Quick table below; for a per-diagram-type error catalog, the Kroki safe subset, and the failure-degradation ladder, see references/kroki-troubleshooting.md.

MistakeFix
curl POST returns HTML error pageCheck network; try curl -v to see error details
Kroki returns 400 Bad Requestcat the output file — Kroki wrote the offending line + reason there; fix it and re-render via the Step 5 loop. Validate syntax at https://www.plantuml.com/plantuml/uml/
Arrow direction unexpectedUse --> for downward/right; explicitly use -up->, -down->, -left->, -right->
Diagram too large/crowdedSplit into multiple diagrams or use package/rectangle grouping
Missing @startuml / @endumlAlways wrap diagram in these markers
Special chars in labelsWrap in quotes: "Label: value"
C4 includes not foundUse the bundled !include <C4/C4_Context> (resolved on the standard plantuml endpoint and c4plantuml); never a remote !includeurl https://… — Kroki cannot fetch external URLs
Component overlapUse together { } or explicit layout hints (top to bottom direction)
Sequence participants out of orderDeclare participant explicitly at top in desired left-to-right order

FAQ

What does the plantuml-skill skill do?

Use when user requests diagrams, flowcharts, sequence diagrams, class diagrams, component diagrams, ER diagrams, architecture charts, or visualizations — including generating a diagram from existing source code, or rendering/extracting PlantUML embedded in a Markdown file to images (e.g. preparing docs for Confluence/Notion). Also use proactively when explaining systems with 3+ components, APIs, data flows, or class hierarchies. Generates .puml files and exports to PNG/SVG via Kroki API (no local install required).

How do I install plantuml-skill?

Run npx skills add https://github.com/agents365-ai/365-skills --skill plantuml-skill in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/plantuml-skill/ (personal) or .claude/skills/plantuml-skill/ (project).

Which AI agents can use plantuml-skill?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is plantuml-skill safe to install?

Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk flagged items to review. As with any skill, read the SKILL.md and bundled scripts before installing.

Who maintains plantuml-skill?

It is published by agents365-ai in agents365-ai/365-skills. It has 4,057 recorded installs.

More from agents365-ai/365-skills

View all →

drawio-skill

agents365-ai/365-skills

Create, edit, synchronize, inspect, test, and publish editable draw.io diagrams. Use when the user explicitly requests draw.io/diagrams.net, needs a polished architecture, ERD, UML, sequence, C4, SysML, BPMN, network, swimlane, ML, or infrastructure diagram, wants code/IaC/SQL/OpenAPI/AsyncAPI/Protobuf converted into a diagram, or wants an existing diagram queried, reviewed, diffed, restyled, kept in sync, or made interactive. Prefer Mermaid/PlantUML elsewhere when the requested artifact is diagrams-as-code rather than an editable draw.io file.

Docs & Writing9K installs

excalidraw

agents365-ai/365-skills

Use when user requests diagrams, flowcharts, architecture charts, or visualizations. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Generates .excalidraw files and exports to PNG/SVG via Kroki API or locally using excalidraw-brute-export-cli.

Backend & APIs4.6K installs

creating-mermaid-diagrams

agents365-ai/365-skills

Generate Mermaid diagrams (.mmd) and export to PNG/SVG/PDF using mmdc CLI or Kroki API. USE THIS SKILL when user mentions diagram, flowchart, sequence diagram, class diagram, ER diagram, state machine, architecture, visualize, git graph, 画图, 架构图, 流程图, 时序图. PROACTIVELY USE when explaining ANY system with 3+ components, API flows, authentication sequences, class hierarchies, database schemas, or state machines. Supports 11+ diagram types with fully automatic layout.

Docs & Writing4.2K installs

tldraw-skill

agents365-ai/365-skills

Use when user requests diagrams, flowcharts, architecture charts, or visualizations. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Generates .tldr JSON files and exports to PNG/SVG locally using @kitschpatrol/tldraw-cli.

paper-fetch

agents365-ai/365-skills

Use whenever the user wants to obtain, download, or fetch a paper's PDF — given a DOI, an arXiv id, a paper title, a citation, or a list of DOIs. Trigger on phrases like "download this paper", "find the PDF for [DOI]", "grab me the [Nature/bioRxiv/arXiv] paper on X", "get the open-access version", "I need this article", or any bulk/batch paper download request, even when the user doesn't explicitly say "PDF" or "DOI". Resolves via Unpaywall → Semantic Scholar → arXiv → PubMed Central → bioRxiv/medRxiv → publisher direct (institutional opt-in) → Sci-Hub mirrors as last-resort fallback.

Education & Science3.4K installs

semanticscholar-skill

agents365-ai/365-skills

Use when searching academic papers, looking up citations, finding authors, or getting paper recommendations using the Semantic Scholar API. Triggers on queries about research papers, academic search, citation analysis, or literature discovery.

Education & Science3.4K installs

Popular docs & writing skills

View category →

grill-with-docs

mattpocock/skills

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

Docs & Writing1.2M installs

lark-markdown

open.feishu.cn

飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。

Docs & Writing778.7K installs

writing-beats

mattpocock/skills

Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.

Docs & Writing490.7K installs

writing-shape

mattpocock/skills

Writing, exploit: shape raw material into an article, paragraph by paragraph.

Docs & Writing490.2K installs

writing-fragments

mattpocock/skills

Writing, explore: mine raw fragments, no structure yet.

Docs & Writing489.6K installs

writing-for-agents

mattpocock/skills

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

Docs & Writing479.3K installs