← 返回
未分类

plantuml-skill

Turn 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.
Turn 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.
yjkj999999
未分类 community v1.0.0 1 版本 96000 Key: 无需
★ 0
Stars
📥 24
下载
💾 0
安装
1
版本
#latest

概述

PlantUML Diagram Generator

Generate professional PlantUML diagrams from natural language descriptions. This skill handles

the full pipeline: requirement analysis → PlantUML code generation → image rendering.

Trigger Phrases

Use this skill when the user asks to:

  • "Generate/draw/create a PlantUML diagram for..."
  • "Create a sequence/class/activity/... diagram showing..."
  • "Visualize this flow/architecture/process as..."
  • "Turn this description into a UML diagram"
  • "Make a flowchart / ERD / Gantt chart from..."
  • Any request involving diagram generation from text descriptions

Mandatory Style Requirements

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.

  • Black and white only: Pure black lines (#000000) on a pure white background (#FFFFFF). No colors, no grayscale fills, no gradients, no themed accents.
  • Thin uniform line weight: All borders, arrows and connectors use the default hair-line stroke (≈0.75pt). Never thicken or stylize lines.
  • No circle visibility icons: Class attributes MUST NOT show colored circle icons (● public / ◐ protected / ○ private). Enforced via skinparam classAttributeIconSize 0. Use + - # ~ text markers only.
  • No circle stereotype icons: Class and interface headers MUST NOT show circle-with-letter icons (Ⓒ / Ⓘ / Ⓐ / Ⓔ). skinparam style strictuml enforces text stereotypes («interface», «abstract», «enumeration»). Always declare interfaces/abstract classes via class <> or class <> — never use the interface or abstract class keywords.
  • Abstract classifiers in italics: Per UML 2.5 §9 and uml-diagrams.org "Name of an abstract classifier is shown in italics" — using the <> text stereotype with strictuml produces the correct italic rendering automatically.
  • No 3D effects: Drop shadows MUST be disabled (skinparam shadowing false).
  • Clean typography: Sans-serif font (Helvetica, equivalent to the Arial used by Visio stencils on uml-diagrams.org), 12pt default. No colored or bold text except diagram titles.
  • Standard UML shapes:
  • Actors are stick figures (never Visio icons or images).
  • Classes / components / nodes are plain rectangles; activities are round-cornered rectangles with the activity name in the upper-left.
  • Dependencies and realizations use dashed lines; lifelines use dashed vertical lines (uml-diagrams.org explicitly: "a rectangle forming its head followed by a vertical line (which may be dashed) that represents the lifetime of the participant").
  • Notes are white folded-corner rectangles; no shading.
  • Sequence diagram specifics (matching uml-diagrams.org figures exactly):
  • Lifeline head is a white rectangle; the vertical lifeline is a dashed black line.
  • Execution specification / activation bar is a "thin grey or white rectangle on the lifeline" — this skill renders it as a thin white rectangle with a black border (no yellow PlantUML default).
  • Destruction occurrence is shown as an X at the bottom of the lifeline (PlantUML ! syntax).
  • Synchronous messages use a filled solid triangle arrowhead on a solid line.
  • Asynchronous messages use an open stick arrowhead on a solid line.
  • Reply / return messages use an open stick arrowhead on a dashed line.
  • Activity diagram specifics: round-cornered action rectangles, solid arrows with open arrowheads for control flow, diamond decisions/merges, thick horizontal/vertical bar for forks/joins, filled black dot for initial node, bull's-eye for activity final.
  • Use case diagram specifics: stick-figure actor on the left, ellipses for use cases inside a rectangle subject boundary, «include» / «extend» as dashed open arrows.
  • Class diagram specifics: associations are plain solid lines, aggregation = hollow diamond, composition = filled diamond, generalization = hollow triangle arrowhead on solid line, realization = hollow triangle arrowhead on dashed line, dependency = open arrow on dashed line.

Every .puml file MUST include the mandatory uml-diagrams.org-style preamble as its first lines after @startuml (see Style Configuration).


Workflow

Step 1: Parse and Confirm Requirements

Extract from the user's description:

  • Diagram type — which PlantUML diagram fits best
  • Actors/participants — who/what is involved
  • Relationships/flows — how they interact
  • Constraints/rules — conditions, ordering, cardinality
  • Output format — svg (default), png, pdf, or txt (ASCII art)

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.

Step 2: Generate PlantUML Code

Write the PlantUML source following these rules:

  1. Start EVERY file with one of the two mandatory uml-diagrams.org-style preambles

immediately after @startuml:

Maximum backward compatibility, used by every example except #07.

  • Backup option: the CSS-style


    OMG-UML / uml-diagrams.org Style Configuration (MANDATORY)

    Every generated .puml file MUST include this 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):

    ' 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
    

    What each directive does (mapped to uml-diagrams.org figures):

    | Directive | Effect / uml-diagrams.org reference |

    |---|---|

    | skinparam monochrome true | Strips all PlantUML colour themes. Matches the Visio UML 2.x stencil look used across uml-diagrams.org. |

    | skinparam backgroundColor #FFFFFF | Pure white canvas — same as every figure on uml-diagrams.org. |

    | skinparam *BackgroundColor #FFFFFF (all element kinds) | Forces every classifier / actor / note / package / lifeline / state / use case / component / activity / node / database fill to pure white. Eliminates the grey fills monochrome would otherwise leave. |

    | skinparam defaultFontName Helvetica + size 12 | Sans-serif typography equivalent to Arial used by Visio stencils on uml-diagrams.org. |

    | skinparam shadowing false | Disables drop shadows — uml-diagrams.org figures never have shadows. |

    | skinparam style strictuml | Critical. Enforces text stereotypes («interface», «abstract», «enumeration») and removes the Ⓒ/Ⓘ/Ⓐ/Ⓔ circle adornments. Abstract classifier names render in italics, matching uml-diagrams.org §"Classifier". |

    | skinparam classAttributeIconSize 0 | Removes the coloured visibility dots (●/◐/○). uml-diagrams.org uses +/-/#/~ text markers only. |

    | skinparam roundCorner 0 | Square corners on rectangles (matches Visio stencils). Activity diagrams override locally for round-cornered actions. |

    | skinparam SequenceLifeLineBorderStyle (implicit dashed via strictuml) + SequenceLifeLineBorderColor #000000 | Lifelines render as dashed black lines — exactly the lifeline notation shown on uml-diagrams.org/sequence-diagrams.html. |

    | skinparam SequenceActivationBackgroundColor #FFFFFF + SequenceActivationBorderColor #000000 | Activation bar (execution specification) is a thin white rectangle with black border, per the uml-diagrams.org definition: "Execution is represented as a thin grey or white rectangle on the lifeline". |

    | skinparam ArrowColor #000000 + ArrowThickness 0.75 | All arrows are thin black — matches Visio stencil hair-line strokes. |

    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.


    Alternative — CSS-style Preamble (modern, backup option)

    Since PlantUML 1.2019.9 the project officially recommends the CSS-like