Draw UML class diagrams and UML sequence diagrams in correct, exam-level UML 2.5.1 notation as self-contained HTML/SVG (PNG/SVG export on request). Use for class/structure diagrams (classes, interfaces, abstract classes, attributes, operations, static members, generalization, realization, association with roles/multiplicity/navigability, aggregation, composition, enumerations, dependencies, notes), sequence/interaction diagrams (sd frame, lifelines, actors, activations, sync/async/reply/create/found/delete messages, self-calls, alt/opt/loop/par/break fragments), and design-pattern diagrams such as GoF structure and collaboration.
Ships in create-uml-seq-diagram. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Goal: diagrams a strict examiner gives full marks: every symbol standard, nothing optional added. A Python library (scripts/umlsvg.py) draws the notation in a fixed look (diagram-design's palette and Geist type); you only model and place boxes.
-attr: Type, +op(p: Type): Type, then relationships with kind, role, multiplicity, navigability. Sequence diagram: lifelines name : Type, then messages in time order with their kind. Every message must name an operation of the receiver's class.assets/template.py, replace <skill-dir> with this directory's absolute path, fill in the model, run python3 build.py out.html. For GoF patterns start from assets/examples/gof_patterns.py.python3 <skill-dir>/scripts/check_uml.py --render --shot shots out.html
It must print OK. Then Read shots/out.png and fix anything crowded, overlapping or touching (move boxes, add space, use label_x), and rerun.python3 <skill-dir>/scripts/export.py out.html [--format svg|png].Coordinates are px. A box returns attach points n(x), s(x), w_(y), e(y) on its edges (absolute coordinates; omit for the centre). Connectors are lists of points with horizontal/vertical segments only.
| Need | Call |
|---|---|
| Class diagram | cd = ClassDiagram(slug, title, desc, width, height) |
| Class | cd.klass(x, y, "Name", attrs=[...], ops=[...], w=None); attrs=None, ops=None gives a name-only box |
| Interface / abstract / enum | keywords=("interface",) / abstract=True (italic name) / keywords=("enumeration",), literals=["RED", "GREEN"] |
| Static / abstract member | Attr("-x: T", static=True), Op("+m(): T", static=True), Op("+m(): T", abstract=True) |
| Inheritance | cd.generalization([child.n(), parent.s()]); several children: cd.generalization_tree([c1.n(), c2.n()], parent.s(), bus_y) |
| Interface realization | same calls with realization=True |
| Association | cd.association(pts, End(...), End(...)); End(role="-items", mult="*", navigable=True); optional name="owns", name_at=(x, y) |
| Aggregation / composition | End(aggregation="shared") / End(aggregation="composite", mult="1") on the whole's end |
| Dependency | cd.dependency(pts, "use"); creation: "Instantiate" |
| Note | cd.note(x, y, ["line", ...], links=[pts]); a note about one operation (its body, pseudocode) ends on that operation's row: box.e_row("Notify") / box.w_row("Notify"), reached by a horizontal last segment; box.n()/box.s() mean a note about the whole class |
| Sequence diagram | sd = SequenceDiagram(slug, title, desc, width, height, name="operationName") |
| Lifeline | sd.lifeline(key, x, "name : Type"); created later: created_at=y; actor: actor=True; static calls: sd.lifeline(key, x, "Cls", keyword="Metaclass") |
| Activation | sd.execution(key, y1, y2, level=0) (level 1 for a self-call) |
| Message | sd.message(kind, src, dst, y, "op()"); kind sync, async, reply, create, delete (X ends the target); found with src = an x coordinate; reply label optional; label_x= moves a label off other lifelines |
| Self call | sd.self_message(key, y, "op()") |
| Fragment | sd.fragment("opt", x1, x2, y1, y2, [{"top": y1, "guard": "[cond]", "on": key}]); alt: add {"top": y_div, "guard": "[else]", "on": key}; also loop, loop(1,3), par, break; the frame must span every lifeline its messages touch |
| Page | write_page("out.html", "Title", [Figure(cd, "caption"), Figure(sd, "caption")]) |
Nothing beyond this table is supported on purpose: it is what an exam asks for.
Class diagram
«interface» above it; abstract class name in italics; abstract operations in italics.-name: Type, +op(p: Type): Type; no : void (omit the return type); UML types Integer, Boolean, String, Real; static members underlined.«use», «Instantiate»).Sequence diagram
sd name frame; heads read name : Type (not underlined).opt/alt/loop in a corner tab, guards [cond], alt operands separated by a dashed line.op(args); replies op(): value or no label; no message numbers.Never add: your own colours (the library applies one fixed palette), legends, rounded boxes, ALL-CAPS labels, << >> instead of « », «abstract», multiplicities you cannot justify from the model, a frame around class diagrams, members the question does not need.
| File | Read when |
|---|---|
assets/template.py | always: the starting point |
assets/examples/gof_patterns.py | drawing a GoF pattern |
references/notation.md | unsure whether a notation is standard; clause numbers for a justification |
references/rationale.md | asked why this skill differs from diagram-design or from a tool's output |
assets/examples/notation_reference.py | you want to see every primitive drawn |
The library and the checker refuse non-standard input (diagonal lines, «abstract», guards without brackets, request labels without (), << >>, numbered messages, symbols outside the frame); read the error, fix the input.
LICENSE (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)assets/examples/decorator.html (opens in a new tab)assets/examples/factory-method.html (opens in a new tab)assets/examples/gof_patterns.py (opens in a new tab)assets/examples/notation-reference.html (opens in a new tab)assets/examples/notation_reference.py (opens in a new tab)assets/examples/proxy.html (opens in a new tab)assets/examples/singleton.html (opens in a new tab)assets/template.py (opens in a new tab)docs/images/decorator-class.png (opens in a new tab)docs/images/factory-method-class.png (opens in a new tab)docs/images/proxy-seq.png (opens in a new tab)docs/images/singleton-seq.png (opens in a new tab)references/notation.md (opens in a new tab)references/rationale.md (opens in a new tab)scripts/check_uml.py (opens in a new tab)scripts/export.py (opens in a new tab)scripts/umlsvg.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/create-uml-seq-diagram:create-uml-seq-diagramfrom create-uml-seq-diagram
npx claudepluginhub arda-tuz/public-skills --plugin create-uml-seq-diagram