skills/plantuml-diagrams/SKILL.md
Create and render PlantUML diagrams with correct syntax and the plantuml CLI. Use when the user asks to "create a puml diagram", "draw a plantuml diagram", "generate puml", "visualize with plantuml", mentions "puml" or "plantuml", or asks for PlantUML-specific diagrams (sequence, class, component, deployment, activity, ER, state, mindmap, gantt, C4, AWS architecture, K8s, use case, timing, nwdiag, network diagram, wireframe, salt mockup, archimate, EBNF grammar, regex diagram, ditaa). Do NOT trigger on generic "diagram" or "mermaid" requests — those use the mermaid-diagrams skill.
npx skillsauth add mgajewskik/opencode-config plantuml-diagramsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
.puml file in project directoryplantuml only when diagram is completexdg-open (background process)# Render PNG and open preview
plantuml -tpng diagram.puml && xdg-open diagram.png &
# Other formats
plantuml -tsvg diagram.puml # SVG (scalable)
plantuml -tpdf diagram.puml # PDF
plantuml -tutxt -pipe < diagram.puml # Terminal preview (no file)
# Syntax check only (no render)
plantuml -checkonly diagram.puml
# Custom output directory
plantuml -o output_dir diagram.puml
What are you visualizing?
│
├─ Interactions/flow between actors?
│ ├─ Time-ordered messages → Sequence
│ ├─ User goals/scenarios → Use Case
│ └─ Precise timing constraints → Timing
│
├─ System structure?
│ ├─ Code/domain model → Class
│ ├─ Object instances → Object
│ ├─ Database schema → IE/ER (crow's foot) or Chen ER
│ ├─ System components → Component
│ └─ Infrastructure/nodes → Deployment
│
├─ Behavior/process?
│ ├─ Flowchart/decisions → Activity
│ └─ State transitions → State
│
├─ Cloud/infrastructure?
│ ├─ AWS/Azure/GCP → Component + stdlib (read references/cloud-architecture.md)
│ ├─ Kubernetes → Component + K8s stdlib
│ └─ C4 model → C4 stdlib
│
├─ Planning/organization?
│ ├─ Project timeline → Gantt
│ ├─ Topic hierarchy → Mind Map
│ └─ Work breakdown → WBS
│
├─ Data visualization?
│ ├─ Network topology → nwdiag
│ └─ Config/data → JSON/YAML
│
├─ Documentation/specs?
│ ├─ UI mockup → Salt (@startsalt)
│ ├─ Grammar/syntax → EBNF (@startebnf)
│ ├─ Regex pattern → Regex (@startregex)
│ └─ ASCII art → Ditaa (@startditaa)
│
└─ Enterprise architecture?
└─ ArchiMate model → Archimate
| Need | Type | Start Tag |
|------|------|-----------|
| API calls, service interactions | Sequence | @startuml |
| User goals, scenarios | Use Case | @startuml |
| OOP design, domain models | Class | @startuml |
| Database schema (crow's foot) | IE/ER | @startuml |
| Database schema (Chen notation) | ER | @startchen |
| Process flow, decisions | Activity | @startuml |
| System architecture | Component | @startuml |
| Infrastructure, nodes | Deployment | @startuml |
| State machines | State | @startuml |
| Precise timing | Timing | @startuml |
| AWS/Azure/GCP | Component + stdlib | @startuml |
| K8s cluster | Component + stdlib | @startuml |
| C4 model | C4 stdlib | @startuml |
| Topic hierarchy | Mind Map | @startmindmap |
| Work breakdown | WBS | @startwbs |
| Project timeline | Gantt | @startgantt |
| Network topology | nwdiag | @startuml |
| JSON/YAML data | JSON/YAML | @startjson / @startyaml |
| UI mockup/wireframe | Salt | @startsalt |
| Grammar/syntax | EBNF | @startebnf |
| Regex visualization | Regex | @startregex |
| ASCII art conversion | Ditaa | @startditaa |
| Enterprise architecture | Archimate | @startuml + include |
For cloud/K8s/C4: Read references/cloud-architecture.md For extra types: Read references/extra-diagrams.md
| Flag | Description |
|------|-------------|
| -tpng | PNG output (default) |
| -tsvg | SVG output |
| -tpdf | PDF output (requires Apache Batik) |
| -ttxt | ASCII art (outputs .atxt) |
| -tutxt | Unicode ASCII (outputs .utxt) |
| -pipe | Read stdin, write stdout |
| -o <dir> | Output directory |
| -theme <name> | Apply theme |
| --dark-mode | Dark mode rendering |
| -checkonly | Syntax check only |
| --check-graphviz | Check Graphviz installation |
| --disable-metadata | Don't embed source in PNG |
| -Playout=smetana | Use Smetana layout engine |
| -Playout=elk | Use ELK layout engine |
| -Pteoz=true | Use Teoz engine for sequence diagrams |
| Engine | Use Case | Pragma |
|--------|----------|--------|
| Graphviz | Default, best for most diagrams | (default) |
| Smetana | Java port, no Graphviz needed | !pragma layout smetana |
| ELK | Orthogonal layout only | !pragma layout elk |
| Teoz | Sequence diagrams with anchors/duration | !pragma teoz true |
@startuml
actor User
participant API
database DB
User -> API ++: POST /login
API -> DB: Query user
DB --> API: User record
alt Valid credentials
API --> User --: 200 JWT token
else Invalid
API --> User: 401 Unauthorized
end
note right of API: Auth service
== Later ==
User -> API: GET /data
@enduml
Participants: participant, actor, boundary, control, entity, database, collections, queue
Arrows: -> solid, --> dotted, ->x lost, <-> bidirectional, -[#red]-> colored
Activation: -> Target ++: activate, --> Source --: deactivate
Grouping: alt/else, opt, loop, par/else, break, critical, group — close with end
Notes: note left of A:, note right of A:, note over A,B:
Line breaks in notes:
note right of A: line 1\nline 2) supports \n\n' Inline note: \n works
note right of API: line 1\nline 2
' Block note: use real newlines
note right of API
line 1
line 2
end note
Other: autonumber, == Divider ==, ...delay..., ||| space, box "Group" ... end box
@startuml
class User {
-id: int
-name: String
+getName(): String
+setName(name: String): void
}
class Order {
-orderId: int
-total: Decimal
+calculate(): Decimal
}
User "1" --> "*" Order : places
interface Payable <<Interface>> {
+pay(): void
}
Order ..|> Payable
@enduml
Visibility: + public, - private, # protected, ~ package
Modifiers: {static}, {abstract}
Relationships: <|-- inheritance, <|.. realization, *-- composition, o-- aggregation, --> association, ..> dependency
Cardinality: "1" --> "*", "0..1", "1..*"
@startuml
skinparam linetype ortho
entity Customer {
* customer_id : int <<PK>>
--
* name : varchar
email : varchar
}
entity Order {
* order_id : int <<PK>>
--
* customer_id : int <<FK>>
* created_at : timestamp
total : decimal
}
Customer ||--o{ Order : places
@enduml
Cardinality: || exactly one, o| zero or one, }| one or more, o{ zero or more
Line: -- solid (identifying), .. dashed (non-identifying)
Attributes: * mandatory, <<PK>>, <<FK>>
@startuml
start
:Read input;
if (Valid?) then (yes)
:Process data;
fork
:Save to DB;
fork again
:Send notification;
end fork
else (no)
:Show error;
stop
endif
:Return result;
stop
@enduml
Actions: :text; — MUST end with ;
Conditionals: if (cond?) then (yes) ... else (no) ... endif
Switch: switch (test?) case (A) ... case (B) ... endswitch
Loops: while (cond?) ... endwhile, repeat ... repeat while (cond?)
Parallel: fork ... fork again ... end fork
Swimlanes: |Lane Name| before actions
Kill/Detach: kill (X end), detach (arrow end)
@startuml
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
}
Customer --> UC1
Customer --> UC2
Admin --> UC3
UC2 ..> UC1 : <<include>>
@enduml
Actors: actor Name, :Name: (stick figure)
Use cases: usecase "Name", (Name)
Relationships: --> association, ..> include/extend, --|> generalization
Stereotypes: <<include>>, <<extend>>
@startuml
package "Frontend" {
[Web App]
[Mobile App]
}
cloud "Cloud" {
node "API Server" {
[REST API]
[Auth Service]
}
database "PostgreSQL" {
[Users DB]
}
}
[Web App] --> [REST API] : HTTPS
[REST API] --> [Auth Service]
[REST API] --> [Users DB]
@enduml
Components: [Name], component "Name" as alias
Interfaces: () "Name", interface Name
Grouping: package, node, folder, frame, cloud, database, rectangle, storage, queue
@startuml
robust "Web Browser" as WB
concise "Web User" as WU
@0
WU is Idle
WB is Idle
@100
WU is Waiting
WB is Processing
@300
WB is Waiting
@enduml
Participants: robust (multiple states), concise (simple states), clock
States: @<time> then <participant> is <state>
Constraints: @<time> <-> @<time> : label
@startuml
!theme spacelab
' Available: cerulean, vibrant, materia, bluegray, amiga, hacker
CLI: plantuml -theme spacelab diagram.puml
Key skinparams:
skinparam backgroundColor white ' themes may set transparent - override explicitly
skinparam monochrome true
skinparam shadowing false
skinparam defaultFontName "Helvetica"
skinparam linetype ortho
List themes: plantuml -help shows available themes, or check https://the-lum.github.io/puml-themes-gallery/
| Scenario | Detection | Fallback |
|----------|-----------|----------|
| Graphviz not installed | plantuml --check-graphviz fails | Add !pragma layout smetana at top |
| Syntax error | plantuml -checkonly returns error | Check NEVER list, fix syntax |
| Crow's feet render poorly | Angled lines look wrong | Add skinparam linetype ortho |
| Diagram too large | Output truncated or slow | Split into multiple diagrams, use packages |
| AWS icons not found | Include path error | Use awslib14 not awslib, check category names |
| Mind map renders as class | Wrong diagram type | Use @startmindmap not @startuml |
| Gantt dates wrong | Tasks overlap incorrectly | Check Project starts date, verify closed days |
| C4 macros not found | Include error | Verify !include <C4/C4_Container> path |
| K8s sprites missing | Sprite not rendered | Check !include <kubernetes/k8s-sprites-unlabeled-25pct> |
| Salt wireframe broken | Elements misaligned | Check brace matching, column separators | |
| \n shows literally inside a note | Used block note syntax | Replace \n with real line breaks inside note ... end note |
When in doubt:
plantuml -checkonly before renderingskinparam linetype ortho for ER diagramsSyntax errors:
; at end of activity diagram actions — :text; not :text@startuml for mindmap/WBS/gantt — use @startmindmap, @startwbs, @startganttend as a node/state name — reserved keyword, use End or Finishthen keyword in activity if statementsend to close grouping blocks (alt, loop, opt, par, etc.)"Long Name" as aliasgraph keyword — PlantUML uses @startuml not graphAWS/Cloud errors:
<awslib/NetworkingAndContentDelivery/...> — correct is NetworkingContentDelivery (no "And")<awslib/...> without !include <awslib/AWSCommon> first!define — use !$var = valueRendering errors:
skinparam linetype ortho.puml file first — always write file, then renderSequence diagram errors:
par/and syntax — use par/else for parallel threadsactivate/deactivate without matching pairsbox ... end box groups\n to render as a newline inside note ... end note blocks — use literal line breaks thereClass diagram errors:
extends with interface — use implements or <|..-- and - inconsistently for relationship lengthActivity diagram errors:
if without endiffork without end forkif (condition?) then (yes)Mind Map/WBS errors:
@startuml for mindmap — use @startmindmap@startuml for WBS — use @startwbs+ and - depth markers inconsistently in same branchGantt errors:
Project starts YYYY-MM-DD — required for date-based tasks[Task] starts [Other]'s end — correct is starts at [Other]'s endSalt/Wireframe errors:
@startuml for wireframes — use @startsalt} for salt containersChen ER errors:
@startuml for Chen notation — use @startchenEBNF/Regex errors:
@startuml for EBNF — use @startebnf@startuml for regex — use @startregex.puml file before renderingskinparam linetype ortho for ER/IE diagramsAWSCommon before other AWS includes"My Service" as svc:action;alt/else/end, if/endif, fork/end forknote ... end note); reserve \n for inline note ... : ... syntaxdocumentation
Create senior-level deep research dossiers and roadmap companions. Use when the user asks for a dossier, senior research, deep research, in-depth research, mental models for a topic, senior perspective on a topic, how something actually works, ramp up on a topic, architectural deep dive, tradeoffs, failure modes, or what a senior would notice. Produces current-directory research-* and roadmap-* markdown artifacts, not a tutorial or short summary.
development
Senior-level Knative and OpenShift Serverless guidance for Serving, Eventing, Functions, autoscaling, scale-to-zero, CloudEvents, RabbitMQ/Kafka sources, Lambda migration, Harbor/OCI images, debugging, operations, and production rollout. Use when working with Knative Service, Revision, Route, KPA, activator, queue-proxy, Broker, Trigger, Source, Sink, kn func, OpenShift Serverless, Kourier, eventing-rabbitmq, Knative Kafka, or serverless workloads on Kubernetes/OpenShift.
development
Senior-level RHEL-family Linux operations. Use when running, debugging, hardening, patching, installing, upgrading, or operating Red Hat Enterprise Linux, Rocky Linux, AlmaLinux, CentOS Stream, Fedora-as-upstream, or related enterprise Linux hosts: systemd, RPM/DNF, SELinux, NetworkManager, firewalld, storage, kernel/kdump, FIPS/STIG, Satellite, IdM, Podman, bootc, air-gapped fleets.
development
Senior-level Proxmox VE guidance for VM creation, templates, storage, ZFS, Ceph, networking, clusters, HA, PBS backups, debugging, upgrades, security, and production/homelab operations. Use when working with Proxmox, PVE, Proxmox VE, qm, pct, pvesm, pvecm, pmxcfs, HA manager, Proxmox Backup Server, VM migration, Proxmox incidents, or Ceph/ZFS/Corosync/VLAN bridges in a Proxmox VE context.