plantuml

Generate UML diagrams (use case, class, sequence, activity, state, component, deployment, object, timing, and more) using PlantUML. Use when the user asks to draw, create, or generate any UML diagram, or mentions PlantUML, UML, use case diagram, class diagram, sequence diagram, activity diagram, state diagram, or any structural/behavioral diagram.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "plantuml" with this command: npx skills add guoxh/plantuml

PlantUML Diagram Generation

One-Liner

java -jar ~/tools/plantuml.jar -tpng -charset UTF-8 file.puml

Prerequisites

  • PlantUML jar: ~/tools/plantuml.jar
  • Graphviz: Required for most diagram types. Verify with dot -V.
  • Java: Required runtime. Verify with java -version.

If Graphviz is missing, sequence diagrams still render (they use the built-in lambda renderer), but other diagram types will fail.

Quick Start

  1. Write .puml source file
  2. Generate image: java -jar ~/tools/plantuml.jar -tpng -charset UTF-8 <file>.puml
  3. PlantUML uses the word after @startuml as the output filename (e.g., @startuml MyDiagramMyDiagram.png)
  4. Copy to outbound media dir and send via message tool — OpenClaw will handle path resolution automatically

Diagram Types & Syntax

See references/syntax-guide.md for detailed syntax per diagram type.

Use Case Diagram

@startuml DiagramName
left to right direction
skinparam packageStyle rectangle
skinparam actorStyle awesome

actor User
actor Admin

rectangle "System Name" {
  usecase "Login" as UC1
  usecase "Do Something" as UC2
}

User --> UC1
User --> UC2
UC2 .> UC1 : <<include>>
@enduml

Class Diagram

@startuml DiagramName
skinparam classAttributeIconSize 0

abstract class Shape {
  + draw(): void
}
class Circle {
  - radius: double
}
Shape <|-- Circle

Circle "1" --> "0..*" Point : contains >
@enduml

Sequence Diagram

@startuml DiagramName
actor User
participant ":System" as SYS

User -> SYS : request()
activate SYS
SYS --> User : response()
deactivate SYS

alt success
  SYS --> User : ok
else failure
  SYS --> User : error
end
@enduml

Activity Diagram

@startuml DiagramName
start
:Step 1;
if (Condition?) then (yes)
  :Step 2a;
else (no)
  :Step 2b;
endif
stop
@enduml

State Diagram

@startuml DiagramName
[*] --> Idle
Idle --> Processing : start
Processing --> Done : complete
Processing --> Error : fail
Done --> [*]
Error --> [*]
@enduml

Component Diagram

@startuml DiagramName
component [Web App] as WA
component [API Server] as API
interface "REST API" as REST

WA -right- REST
REST -right- API
@enduml

Deployment Diagram

@startuml DiagramName
node "Web Server" as WS {
  component [Web App] as WA
}
node "DB Server" as DB {
  database [Database] as D
}
WA ..> D : JDBC
@enduml

Key Conventions

  • File naming: Use kebab-case for .puml filenames (e.g., order-system-class.puml).
  • Diagram label: Always name @startuml <PascalCaseName> — this becomes the output filename.
  • Charset: Always pass -charset UTF-8 for CJK content.
  • Format: Default to -tpng. Use -tsvg for vector output when needed.
  • Batch: Pass multiple .puml files in one command for efficiency.
  • Output directory: Default is same directory as source. Use -o <dir> to specify a different output directory.

Rendering & Delivery Workflow

  1. Write .puml to workspace
  2. Run: java -jar ~/tools/plantuml.jar -tpng -charset UTF-8 <file>.puml
  3. Verify output exists and has nonzero size
  4. Copy PNG to ~/.openclaw/media/outbound/ (create if needed)
  5. Send via message tool with media parameter — OpenClaw handles path resolution automatically

Troubleshooting

ProblemSolution
Cannot run program "dot"Graphviz not installed. Sequence diagrams still work; others need apt install graphviz.
Empty output file (0 bytes)Likely a syntax error. Run with -v flag to see detailed error output.
Smetana UnsupportedOperationExceptionAvoid -Playout=smetana; use Graphviz instead.
CJK garbled textEnsure -charset UTF-8 flag is set and source file is UTF-8.
Image too large/smallAdd -DPLANTUML_LIMIT_SIZE=16384 before the jar, or resize in the puml with skinparam dpi.

Advanced: Output Size Control

# Increase max image size (default 4096)
java -DPLANTUML_LIMIT_SIZE=16384 -jar ~/tools/plantuml.jar -tpng -charset UTF-8 file.puml

Within the diagram:

skinparam dpi 150

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

仲氏纯碱馍馍店

仲氏纯碱馍馍店信息查询。获取店名、简介、营业时间、地址、预订方式、Wi-Fi、招牌产品。用户询问"仲氏馍馍在哪"、"营业时间"、"有什么馒头"时使用。

Registry SourceRecently Updated
General

Clawhub Skill

Play the daily up or dn chart-prediction game and report results

Registry SourceRecently Updated
General

中文内容精修助手

中文内容精修助手 — 专为中文 AI 生成内容设计。一键去除 AI 味儿、格式化排版、适配不同平台(小红书/公众号/知乎/朋友圈)。 支持:去AI味润色、平台专属排版、标题优化、emoji智能添加、段落节奏调整。

Registry SourceRecently Updated
General

AI Product Launch — GTM Strategy & Product Hunt #1 Playbook

Take your AI product from zero buzz to Product Hunt #1 and 1,000+ day-one sign-ups. A 6-week GTM framework with hour-by-hour launch day tactics, KOL outreach...

Registry SourceRecently Updated