Install
openclaw skills install @samonysh/plantuml-skillTurn natural language into uml-diagrams.org style PlantUML diagrams (sequence, class, activity, use case, component, state…) and render to SVG/PNG/PDF. Use when the user asks to draw a UML diagram.
openclaw skills install @samonysh/plantuml-skillGenerate professional PlantUML diagrams from natural language descriptions. This skill handles the full pipeline: requirement analysis → PlantUML code generation → image rendering.
Use this skill when the user asks to:
ALL diagrams generated by this skill MUST adhere to the uml-diagrams.org reference style — strict OMG UML 2.x rendered with Visio UML 2.x stencils (black-and-white, no decoration). This is the canonical style used throughout https://www.uml-diagrams.org and serves as the authoritative visual reference for every diagram this skill produces. No exceptions unless the user explicitly requests otherwise.
#000000) on a pure white background (#FFFFFF). No colors, no grayscale fills, no gradients, no themed accents.skinparam classAttributeIconSize 0. Use + - # ~ text markers only.skinparam style strictuml enforces text stereotypes («interface», «abstract», «enumeration»). Always declare interfaces/abstract classes via class <<interface>> or class <<abstract>> — never use the interface or abstract class keywords.<<abstract>> text stereotype with strictuml produces the correct italic rendering automatically.skinparam shadowing false).--cjk flag to switch to a CJK-compatible font (see CJK Font Support).--no-fix to disable this behavior (see Step 3).scale N directive and re-renders up to once. The default body font of 12 px (from the mandatory preamble) shrinks proportionally; if the estimated on-paper font drops below --min-font-pt (default 8 pt), the script prints a legibility warning — at that point no further down-scaling helps and the user must split the diagram or abbreviate labels. A4 fit is ON by default; disable with --no-a4-check (-NoA4Check on PowerShell).X at the bottom of the lifeline (PlantUML <participant> ! syntax).«include» / «extend» as dashed open arrows.Every .puml file MUST include the mandatory uml-diagrams.org-style preamble as its first lines after @startuml (see Style Configuration).
Extract from the user's description:
If the diagram type is not explicitly stated, infer it from the description:
| Description signals | Recommended diagram |
|---|---|
| "A sends X to B", "request/response", "handshake" | Sequence |
| "inherits from", "has many", "belongs to", entities & fields | Class |
| "if/then", "approve/reject", workflow, pipeline | Activity |
| "user can", "admin manages", roles & permissions | Use Case |
| "depends on", "connects to", services & interfaces | Component |
| "deployed on", "hosted on", nodes & servers | Deployment |
| "transitions from", "changes state", lifecycle | State |
| timeline, milestones, phases, schedule | Gantt |
| hierarchy, brainstorming, tree structure | Mind Map |
If ambiguous, ask the user to clarify the diagram type before proceeding.
Write the PlantUML source following these rules:
@startuml:
skinparam preamble — see OMG-UML / uml-diagrams.org Style Configuration.
Maximum backward compatibility, used by every example except #07.
(Example #07 is a legacy alias of #01_css — same OAuth2 sequence diagram, same CSS preamble.)<style> preamble — see Alternative — CSS-style Preamble.
Recommended on PlantUML ≥ 1.2019.9 where skinparam is being phased out.
Pick ONE per file — never mix both inside the same .puml.@startuml / @enduml delimiterstitleSave the PlantUML source to a .puml file in the working directory.
Use the bundled conversion script. Pick the variant that matches the current OS / shell:
Linux, macOS, or Windows with a POSIX shell (Git Bash, MSYS2, WSL, Cygwin):
bash skills/plantuml/scripts/generate-plantuml.sh <input.puml> <output_dir> --format <svg|png|pdf|txt>
Windows native PowerShell (no bash required):
powershell -ExecutionPolicy Bypass -File skills\plantuml\scripts\generate-plantuml.ps1 <input.puml> <output_dir> -Format <svg|png|pdf|txt>
Both scripts accept the same arguments and try three backends in strict priority order — local-first. Docker and the local JAR are tried first; the Kroki public server is OPT-IN ONLY because it uploads your diagram source to a third-party service (kroki.io by default):
plantuml/plantuml:latest) — preferred default, fully localplantuml.jar (requires Java) — offline fallback--use-public-server (Bash) or -UsePublicServer (PowerShell).
Override the host with PLANTUML_PUBLIC_SERVER=<url> (Bash) or
$env:PLANTUML_PUBLIC_SERVER='<url>' (PowerShell) to point at a
self-hosted Kroki instance.⚠ Privacy notice — passing
--use-public-server/-UsePublicServerPOSTs the entire.pumlsource tokroki.io(or your override host). Never enable this flag for diagrams containing confidential architecture, credentials, customer data, or proprietary business logic. When in doubt, stay with the default (Docker / local JAR). See the Privacy & Backend Selection section below for the full data-flow contract.
CJK font support: When the .puml contains Chinese, Japanese, or Korean characters, add the --cjk flag:
bash generate-plantuml.sh diagram.puml ./output --format svg --cjk
The --cjk flag:
Helvetica with WenQuanYi Micro Hei (a CJK-compatible font)/usr/share/fonts, /usr/local/share/fonts) into the container and refreshes the font cache before renderingsudo apt install fonts-wqy-zenheisudo dnf install wqy-zenhei-fontsAspect ratio validation: After rendering (SVG or PNG), the script measures width/height and checks whether it sits inside the configured band. The default band is 0.7–1.4 (width/height), i.e. diagrams should be neither extremely tall nor extremely wide. If the output falls outside the band, the script injects layout corrections and re-renders:
--min-aspect): applies left to right direction and adds spacing guards so labels do not crowd.--max-aspect): applies top to bottom direction and adds spacing guards.Spacing guards added during auto-fix include Padding, BoxPadding, ParticipantPadding, MinClassWidth, WrapWidth, NodeSep, and RankSep. These prevent text from becoming cramped when the layout is re-directed.
To disable automatic correction:
bash generate-plantuml.sh diagram.puml ./output --no-fix
To set a custom band:
bash generate-plantuml.sh diagram.puml ./output --min-aspect 0.6 --max-aspect 1.5
Dark mode (opt-in): The default output follows the strict uml-diagrams.org black-and-white style. When the user explicitly asks for a dark variant, add --dark-mode (Bash) or -DarkMode (PowerShell). This emits both the regular light output and a dark companion named <basename>.dark.<fmt>:
bash generate-plantuml.sh diagram.puml ./output --format svg --dark-mode
Behaviour:
@media (prefers-color-scheme: dark) block into the SVG, which automatically adapts to the user's system theme.convert is available. PDF/TXT dark companions are not generated because there is no reliable local post-processor.#1e1e2e canvas, #c9d1d9 text/strokes, #f0f6fc bold text, and #6e7681 lifelines.fill="none" and no stroke attribute. The script injects CSS rules to add strokes to these elements in both light (#000000) and dark (#c9d1d9) variants.skinparam style strictuml is essential for use case and component diagrams — it has no CSS equivalent. Removing it causes missing borders on ellipses, rects, and actor paths.A4 paper fit validation: After the aspect-ratio check passes, the render script validates the diagram's pixel dimensions against A4 paper. PlantUML writes SVG in CSS pixels at the 96 DPI standard, so A4 (210×297 mm = 8.27×11.69 in) maps to 794×1123 px portrait or 1123×794 px landscape. The check is ON by default and runs right after the aspect check.
Behaviour:
≤1.0 and a hard floor of 0.15, injects a scale N directive into a working copy of the .puml, then re-renders once.scale × 12 px × 0.75 ≈ pt (the 0.75 factor converts px to pt at 96 DPI). If this is below --min-font-pt it prints a legibility warning — at that point further down-scaling cannot help; the user must split the diagram, shorten labels, or switch to a smaller font.Flags:
| Flag (Bash) | Flag (PowerShell) | Purpose | Default |
|---|---|---|---|
--no-fix | -NoFix | Disable automatic aspect-ratio correction | off (correction ON) |
--min-aspect N | -MinAspect N | Lower bound of acceptable width/height band | 0.7 |
--max-aspect N | -MaxAspect N | Upper bound of acceptable width/height band | 1.4 |
--no-a4-check | -NoA4Check | Disable A4 fit validation entirely | off (check ON) |
--min-font-pt N | -MinFontPt N | Minimum legible on-paper font size in pt | 8.0 |
--dark-mode | -DarkMode | Also emit a dark companion (<basename>.dark.<fmt>) with CSS @media theme | off |
Examples:
# Disable A4 fit
bash generate-plantuml.sh diagram.puml ./output --no-a4-check
# Tighten legibility threshold (warn if effective font drops below 10 pt)
bash generate-plantuml.sh diagram.puml ./output --min-font-pt 10
# Allow narrower diagrams and also emit a dark SVG companion
bash generate-plantuml.sh diagram.puml ./output --format svg --min-aspect 0.5 --dark-mode
# PowerShell equivalents
powershell -ExecutionPolicy Bypass -File generate-plantuml.ps1 diagram.puml .\out -NoA4Check
powershell -ExecutionPolicy Bypass -File generate-plantuml.ps1 diagram.puml .\out -MinFontPt 10
powershell -ExecutionPolicy Bypass -File generate-plantuml.ps1 diagram.puml .\out -Format svg -MinAspect 0.5 -DarkMode
A4 fit is skipped automatically for txt and pdf output (TXT has no image dimensions; PDF is already a print-oriented format the PlantUML renderer pages itself). The check shares the same 3-attempt auto-fix budget as aspect-ratio correction — running both does not double the cap.
After rendering, show the user the output. If SVG is generated, read and display it inline. If PNG/PDF is generated, tell the user where the file is saved.
This skill is local-first. By default, all rendering happens on the user's own machine — diagram source code never leaves the host.
.puml ──► Docker (plantuml/plantuml) ──► output.svg [LOCAL, preferred]
└────► local plantuml.jar (Java) ──► output.svg [LOCAL, fallback]
No network calls are made; nothing is uploaded.
The Kroki public server (https://kroki.io) can render diagrams without any
local installation, but doing so POSTs the full .puml source to a third
party. To use it you must explicitly opt in:
# Bash — explicit opt-in required
bash generate-plantuml.sh diagram.puml ./output --use-public-server
# PowerShell — explicit opt-in required
powershell -ExecutionPolicy Bypass -File generate-plantuml.ps1 diagram.puml .\output -UsePublicServer
When opt-in is active, the script:
.puml contents to kroki.io (or your override host)Kroki is open source and self-hostable
(github.com/yuzutech/kroki). To route
opt-in traffic to your own instance instead of the public kroki.io, set the
PLANTUML_PUBLIC_SERVER env var to your base URL:
# Bash
PLANTUML_PUBLIC_SERVER=https://kroki.internal.example.com \
bash generate-plantuml.sh diagram.puml ./output --use-public-server
# PowerShell
$env:PLANTUML_PUBLIC_SERVER = 'https://kroki.internal.example.com'
powershell -ExecutionPolicy Bypass -File generate-plantuml.ps1 diagram.puml .\output -UsePublicServer
The runtime privacy warning surfaces the resolved host name so you can confirm
the traffic destination before any data leaves the machine. Custom hosts must
expose the standard Kroki endpoint shape <base>/plantuml/<format>.
Earlier versions of this script POSTed to
https://www.plantuml.com/plantuml/<format>. That endpoint now sits behind a
Cloudflare + Ezoic consent wall: a POST returns 302 redirecting to a
JavaScript-only HTML consent page, making non-browser automation impossible.
Kroki replaces it because:
--use-public-serverNever enable remote rendering for diagrams that contain any of the following:
If you are unsure whether the diagram is safe to upload, don't opt in —
install Docker (one command: docker pull plantuml/plantuml:latest) or
download plantuml.jar and render locally.
When --cjk / -Cjk is combined with the Docker backend, the script mounts
host font directories read-only into the container so PlantUML can
discover system-installed CJK fonts. The mounts are:
/usr/share/fonts, /usr/local/share/fonts, /System/Library/Fonts/c/Windows/Fonts or /mnt/c/Windows/Fonts%WINDIR%\FontsThese mounts are read-only (:ro), are scoped to font directories only, and
are used only inside the throwaway PlantUML container. No font data is
written back to the host. If you do not need CJK rendering, omit the flag
and no host directories are mounted.
If the user requests changes:
.puml fileNote: All examples below omit the mandatory monochrome preamble for brevity. In actual generated code, EVERY file MUST include the OMG-UML style preamble immediately after
@startuml. The class diagram example shows the full preamble inline as a reference.
@startuml
title Authentication Flow
actor User
participant "Web App" as App
participant "Auth Service" as Auth
database "User DB" as DB
User -> App: Login (email, password)
App -> Auth: POST /auth/login
Auth -> DB: SELECT user WHERE email
DB --> Auth: user record
Auth -> Auth: Verify password hash
alt Success
Auth --> App: JWT token
App --> User: Dashboard
else Failure
Auth --> App: 401 Unauthorized
App --> User: Error message
end
@enduml
Key syntax: -> sync message, --> async/return, ->> async, alt/else/end branching,
loop/end loops, opt/end optional, activate/deactivate lifeline, note left/right
@startuml
' OMG-UML Monochrome Style — CSS variant
<style>
root {
FontName Helvetica
FontSize 12
FontColor #000000
BackGroundColor #FFFFFF
LineColor #000000
LineThickness 0.75
RoundCorner 0
Shadowing 0
}
title {
FontSize 14
FontStyle bold
FontColor #000000
BackGroundColor transparent
LineColor transparent
LineThickness 0
}
note {
BackGroundColor #FFFFFF
LineColor #000000
FontColor #000000
}
classDiagram {
class { BackGroundColor #FFFFFF; LineColor #000000; FontColor #000000 }
arrow { LineColor #000000; LineThickness 0.75 }
}
</style>
skinparam style strictuml
skinparam classAttributeIconSize 0
title Payment System
class User {
+id: UUID
+email: String
+name: String
+register()
}
class Order {
+id: UUID
+total: Decimal
+status: OrderStatus
+calculateTotal()
}
class PaymentProcessor <<interface>> {
+processPayment(amount: Decimal): Boolean
+refund(transactionId: UUID): Boolean
}
class NotificationService <<abstract>> {
#enabled: Boolean
+{abstract} send(to: String, body: String)
}
enum OrderStatus {
PENDING
CONFIRMED
SHIPPED
DELIVERED
}
User "1" -- "*" Order : places
Order ..|> PaymentProcessor
NotificationService <|-- EmailNotifier
@enduml
Key syntax: + public, - private, # protected, {abstract} abstract method,
class Foo <<interface>> (interface via text stereotype — NOT interface Foo),
class Bar <<abstract>> (abstract class — NOT abstract class Bar),
enum, relationships: -- association, *-- composition, o-- aggregation,
<|-- inheritance, ..|> realization
@startuml
title Order Processing
start
:Receive Order;
if (Payment Valid?) then (yes)
:Reserve Inventory;
if (Inventory Available?) then (yes)
:Confirm Order;
:Ship Order;
stop
else (no)
:Notify Customer;
:Cancel Order;
stop
endif
else (no)
:Reject Order;
stop
endif
@enduml
Key syntax: start/stop/end, if/then/else/endif, repeat/repeat while,
fork/fork again/end fork (parallel), split/split again/end split,
partition "name" { ... } (swimlane), :Text; action
@startuml
title E-Commerce System
left to right direction
actor Customer
actor Admin
rectangle "E-Commerce" {
usecase "Browse Products" as UC1
usecase "Place Order" as UC2
usecase "Manage Inventory" as UC3
usecase "Process Returns" as UC4
}
Customer --> UC1
Customer --> UC2
Admin --> UC3
Admin --> UC4
UC2 ..> UC1 : <<include>>
@enduml
Key syntax: actor, usecase, rectangle/package for system boundary,
--> association, ..> dependency, <<include>> / <<extend>> stereotypes
@startuml
title Microservice Architecture
package "Frontend" {
[Web App]
[Mobile App]
}
package "API Gateway" {
[Gateway]
}
package "Services" {
[User Service]
[Order Service]
[Payment Service]
}
database "PostgreSQL" as DB
cloud "Message Queue" as MQ
[Web App] --> [Gateway]
[Mobile App] --> [Gateway]
[Gateway] --> [User Service]
[Gateway] --> [Order Service]
[Order Service] --> [Payment Service]
[User Service] --> DB
[Order Service] --> DB
[Order Service] --> MQ
@enduml
Key syntax: [Component], package "name" { }, database, cloud, node,
frame, interface, ()-- required interface, --() provided interface
@startuml
title Production Deployment
node "AWS us-east-1" {
node "VPC" {
node "Public Subnet" {
[Load Balancer]
[Bastion Host]
}
node "Private Subnet" {
node "App Server 1" {
[Application]
}
node "App Server 2" {
[Application]
}
database "RDS Primary"
}
}
cloud "CDN"
}
@enduml
Key syntax: node "name" { }, nested node, database, cloud, actor
@startuml
title Order Lifecycle
[*] --> Draft
Draft --> Submitted : submit()
Submitted --> Paid : processPayment()
Submitted --> Cancelled : cancel()
Paid --> Shipped : ship()
Shipped --> Delivered : confirmDelivery()
Delivered --> [*]
Cancelled --> [*]
state Paid {
[*] --> Authorizing
Authorizing --> Captured : success
Authorizing --> Failed : decline
Captured --> [*]
}
@enduml
Key syntax: [*] start/end, --> transition with optional : label,
state Name { } composite state, state "Name" as Alias
@startuml
title Project Roadmap
project starts 2025-01-06
[Design] lasts 10 days
[Development] lasts 20 days
[Development] starts at [Design]'s end
[Testing] lasts 10 days
[Testing] starts at [Development]'s end
[Deployment] lasts 3 days
[Deployment] starts at [Testing]'s end
[Frontend] lasts 12 days
[Frontend] starts at [Design]'s end
[Backend] lasts 15 days
[Backend] starts at [Design]'s end
@enduml
Key syntax: project starts YYYY-MM-DD, [Task] lasts N days,
[Task] starts at [Other]'s end, -- separator for dependency,
printscale weekly/monthly, @dailymail, @weeklymail
@startmindmap
title System Architecture
* Root Node
** Level 1 A
*** Level 2 A1
*** Level 2 A2
** Level 1 B
*** Level 2 B1
**** Level 3 B1a
**** Level 3 B1b
** Level 1 C
@endmindmap
Key syntax: * root, ** level 1, *** level 2, etc.
Use @startmindmap / @endmindmap (not @startuml).
Affix _ to markdown-style side notation, e.g., ***_ Right side node.
Colors: <style> * { BackgroundColor lightblue } </style>
Every generated .puml file MUST include this CSS-style preamble immediately after @startuml.
It locks PlantUML's rendering to the uml-diagrams.org reference style (strict OMG UML 2.x,
black-and-white Visio stencils).
Since PlantUML 1.2019.9 the project officially recommends the CSS-like <style> block
(plantuml.com/style-evolution) as the preferred
styling mechanism — "skinparam is being phased out … users should migrate to style".
Do NOT mix both inside the same .puml file. Pick one preamble per diagram.
<style> Preamble (recommended)@startuml
<style>
root {
FontName Helvetica
FontSize 12
FontColor #000000
BackGroundColor #FFFFFF
LineColor #000000
LineThickness 0.75
RoundCorner 0
Shadowing 0
}
title {
FontSize 14
FontStyle bold
FontColor #000000
BackGroundColor transparent
LineColor transparent
LineThickness 0
}
note {
BackGroundColor #FFFFFF
LineColor #000000
FontColor #000000
}
sequenceDiagram {
actor { BackGroundColor #FFFFFF; LineColor #000000; FontColor #000000 }
participant { BackGroundColor #FFFFFF; LineColor #000000; FontColor #000000 }
lifeLine { BackGroundColor #FFFFFF; LineColor #000000; LineStyle 5-5; LineThickness 0.75 }
reference { BackGroundColor #FFFFFF; LineColor #000000 }
group { BackGroundColor #FFFFFF; LineColor #000000 }
arrow { LineColor #000000; LineThickness 0.75; FontColor #000000 }
}
classDiagram {
class { BackGroundColor #FFFFFF; LineColor #000000; FontColor #000000 }
arrow { LineColor #000000; LineThickness 0.75 }
}
activityDiagram {
activity { BackGroundColor #FFFFFF; LineColor #000000; FontColor #000000; RoundCorner 10 }
arrow { LineColor #000000; LineThickness 0.75 }
diamond { BackGroundColor #FFFFFF; LineColor #000000 }
}
useCaseDiagram {
actor { BackGroundColor #FFFFFF; LineColor #000000 }
usecase { BackGroundColor #FFFFFF; LineColor #000000 }
rectangle { BackGroundColor #FFFFFF; LineColor #000000 }
}
componentDiagram {
component { BackGroundColor #FFFFFF; LineColor #000000 }
package { BackGroundColor #FFFFFF; LineColor #000000 }
}
stateDiagram {
state { BackGroundColor #FFFFFF; LineColor #000000; FontColor #000000 }
arrow { LineColor #000000 }
}
</style>
' Two settings still have NO CSS equivalent yet — keep them as skinparams:
skinparam style strictuml
skinparam classAttributeIconSize 0
What each CSS block does (mapped to uml-diagrams.org figures):
| CSS Block | Effect / uml-diagrams.org reference |
|---|---|
root | Global defaults: Helvetica 12px black-on-white, 0.75pt lines, no shadows, square corners. Matches Visio UML 2.x stencil look. |
root > Shadowing 0 | Disables drop shadows — uml-diagrams.org figures never have shadows. |
root > RoundCorner 0 | Square corners on rectangles (matches Visio stencils). activityDiagram.activity overrides to 10 for round-cornered actions. |
title | Bold 14px black text, transparent background/border. |
note | White fill, black border, black text — matches uml-diagrams.org note style. |
sequenceDiagram.lifeLine | Dashed black lines (LineStyle 5-5) — exactly the lifeline notation on uml-diagrams.org/sequence-diagrams.html. |
sequenceDiagram.arrow | Thin black arrows (0.75pt) — matches Visio stencil hair-line strokes. |
classDiagram.class | White fill, black border — no grey fills. |
activityDiagram.activity | White fill with round corners (RoundCorner 10) — matches uml-diagrams.org activity shape. |
activityDiagram.diamond | White fill, black border for decision/merge diamonds. |
useCaseDiagram | White actors, use cases, and rectangles — no colored fills. |
componentDiagram | White components and packages — no colored fills. |
stateDiagram.state | White fill, black border — no grey fills. |
Two skinparam settings have NO CSS equivalent yet (as of PlantUML 1.2026.x):
skinparam style strictuml — enforces text stereotypes («interface», «abstract», «enumeration») and removes circle adornmentsskinparam classAttributeIconSize 0 — removes coloured visibility dots (●/◐/○)These must remain as skinparam lines beside the <style> block. This is the only place
where the two systems must coexist.
skinparam Preamble (backward-compatible)Use this preamble only when you need maximum backward compatibility with PlantUML < 1.2019.9. Both preambles produce the same uml-diagrams.org reference look.
' uml-diagrams.org reference style — strict OMG UML 2.x, monochrome
skinparam monochrome true
skinparam backgroundColor #FFFFFF
skinparam defaultFontName Helvetica
skinparam defaultFontSize 12
skinparam shadowing false
skinparam style strictuml
skinparam classAttributeIconSize 0
skinparam sequenceMessageAlign center
skinparam roundCorner 0
' Force every fill to white so monochrome never falls back to grey
skinparam ActorBackgroundColor #FFFFFF
skinparam ParticipantBackgroundColor #FFFFFF
skinparam NoteBackgroundColor #FFFFFF
skinparam SequenceGroupBackgroundColor #FFFFFF
skinparam PackageBackgroundColor #FFFFFF
skinparam ClassBackgroundColor #FFFFFF
skinparam ObjectBackgroundColor #FFFFFF
skinparam StateBackgroundColor #FFFFFF
skinparam UsecaseBackgroundColor #FFFFFF
skinparam ComponentBackgroundColor #FFFFFF
skinparam ActivityBackgroundColor #FFFFFF
skinparam NodeBackgroundColor #FFFFFF
skinparam DatabaseBackgroundColor #FFFFFF
skinparam StereotypeCBackgroundColor #FFFFFF
skinparam StereotypeIBackgroundColor #FFFFFF
skinparam StereotypeABackgroundColor #FFFFFF
skinparam StereotypeEBackgroundColor #FFFFFF
' Sequence diagrams — match the lifeline / activation look on uml-diagrams.org:
' * lifeline = dashed black vertical line
' * activation bar = thin WHITE rectangle with black border (NOT yellow)
skinparam SequenceLifeLineBorderColor #000000
skinparam SequenceLifeLineBackgroundColor #FFFFFF
skinparam SequenceLifeLineBorderThickness 0.75
skinparam SequenceActivationBackgroundColor #FFFFFF
skinparam SequenceActivationBorderColor #000000
skinparam SequenceArrowColor #000000
skinparam SequenceArrowThickness 0.75
skinparam SequenceBoxBackgroundColor #FFFFFF
' Default arrow / border colour everywhere
skinparam ArrowColor #000000
skinparam ArrowThickness 0.75
skinparam DefaultTextColor #000000
NEVER apply colored themes (!theme blueprint, !theme cerulean, etc.), custom colors,
gradients, shadows, or decorative styling — doing so breaks compliance with the
uml-diagrams.org reference style. If a user explicitly and unambiguously requests colour,
add it on top of this preamble rather than removing the preamble.
When diagrams contain CJK characters, Helvetica cannot render them — characters will appear as empty boxes (□) or tofu (▯).
In .puml files: Replace FontName Helvetica in the CSS <style> block with a CJK-compatible font:
root {
FontName "WenQuanYi Micro Hei"
}
For the skinparam preamble (backward-compatible):
skinparam defaultFontName "WenQuanYi Micro Hei"
When rendering: Use the --cjk flag, which automatically applies the font substitution and configures Docker font mounting if needed:
bash generate-plantuml.sh diagram.puml ./output --cjk
Host prerequisites for CJK rendering:
/usr/share/fonts (or /usr/local/share/fonts, /System/Library/Fonts). The script mounts these into the container.Common CJK font packages:
| OS | Package |
|---|---|
| Debian/Ubuntu | fonts-wqy-zenhei |
| Fedora/RHEL | wqy-zenhei-fonts |
| Arch | wqy-zenhei |
| Alpine | font-wqy-zenhei |
| macOS | Built-in (PingFang SC / Hiragino Sans) |
If the PlantUML server returns an error:
.puml file@startuml / @enduml are properly paired@startmindmap for mind maps)docker pull plantuml/plantuml:latest && bash generate-plantuml.sh ...If CJK characters render as empty boxes (□):
--cjk flag was passed when renderingfc-list :lang=zh--cjk)If aspect ratio warnings appear:
.puml:
top to bottom direction and reduce skinparam BoxPaddingleft to right direction and reduce skinparam ParticipantPaddingscale 0.75 or scale 0.5 for extreme casesIf A4 fit warnings appear (the script prints 📄 A4 fit: ... exceeds A4 ...):
scale N directive computed from the smaller required factor. Check the loop output for "A4 fit ✓" on the second render — if present, the diagram now fits within A4.--min-font-pt threshold (default 8 pt), further down-scaling will not make the diagram readable on print. To fix manually:
client_id, redirect_uri with shortened param names.--no-a4-check (-NoA4Check) to keep the larger original.--min-font-pt 6 (or lower) and accept reduced legibility — the script will warn but still emit the smaller-than-A4 final image.After successful generation:
.puml and the rendered imagescale N factor and the post-fix dimensions), or skipped due to legibility threshold; if the legibility warning fired, surface it and propose splitting the diagram