/diagramming:sequence-diagramfrom diagramming
Generates dark-themed self-contained SVG sequence diagrams (UML 2.x-lite) with actor lifelines, sync/async/return messages, self-loops, and halo text. Triggered by requests for temporal flows like OAuth, request lifecycle, or protocol diagrams.
Ships in diagramming. 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.
None: SKILL.md is the whole skill.
Generate UML-2.x-lite sequence diagrams as self-contained SVG files, sharing the blueprint aesthetic of the sibling architecture-diagram and mindmap skills: dark #020617 background, JetBrains Mono, halo text, semantic palette, deterministic geometry-audit gate.
| You want… | Skill |
|---|---|
| Static topology — what calls what, where it lives, how it's deployed | architecture-diagram |
| Radial topic tree — one focal point, themes radiating out | mindmap |
| Temporal sequence — who talks to whom, in what order, over time | sequence-diagram (this one) |
Rule of thumb: if every arrow in your diagram needs a number to make sense, you want a sequence diagram.
Same as the rest of the plugin:
.svg file (or .html if delivering to a user with the export toolbar — copy from ../architecture-diagram/resources/template.html and swap the SVG body).#020617 background, JetBrains Mono via the inline <style> block, halo text via paint-order: stroke fill.../architecture-diagram/resources/geometry-audit.py) must exit 0 before the diagram is done.| Element | Notation | Implementation |
|---|---|---|
| Actor box | rounded rect, semantic color | <rect class="component <color>" rx="2"> with name + optional sub-label |
| Lifeline | dashed vertical line below actor | <line class="lifeline" stroke-dasharray="4,4"> — the lifeline class makes the audit skip it for edge-edge / edge-crosses-component checks |
| Synchronous call | solid arrow, filled V chevron | <path d="M src,y L tgt,y" marker-end="url(#ah-<color>)"> |
| Async call | dashed arrow, open V chevron | same path + stroke-dasharray="5,3" |
| Return | dashed line, open chevron, optional label | stroke-dasharray="4,3", lighter stroke |
| Self-loop | right-side bump arrow | <path d="M x,y q 32,0 32,16 T x,y+16"> with arrowhead at end |
| Activation bar (optional) | thin rect on lifeline | <rect width="8" fill="rgba(...)"> overlapping lifeline at activation span |
| Note | halo-only text in clear space | <text class="note"> — no chip rect |
| Numbering (optional) | small badge or prefix on label | label = "1. login" — simplest readable form |
| Actor type | kind | Stroke |
|---|---|---|
| Human user | slate | #94a3b8 |
| Frontend / SPA / mobile | cyan | #22d3ee |
| Backend service | emerald | #34d399 |
| Database / store | violet | #a78bfa |
| Auth / IDP / KMS | rose | #fb7185 |
| Cloud edge / LB / CDN | amber | #fbbf24 |
| External system | slate | #94a3b8 |
The diagram is two zones: an actor row at the top, then a message ladder below.
N = number of actors
LEFT = 60 # left margin
RIGHT = 60 # right margin
COL_W_i = max(180, label_w_i + 40) # per-actor; longest of name and sub-label drives width
x_i = LEFT + sum(COL_W_j for j < i) + COL_W_i / 2 # actor center
W = LEFT + sum(COL_W) + RIGHT
ACTOR_TOP = 80
ACTOR_H = 56
actor_box_i = rect(x = x_i - aw_i/2, y = ACTOR_TOP, w = aw_i, h = ACTOR_H, rx = 4)
where aw_i = max(140, label_w_i + 28)
Title and subtitle live above the actor row (y = 32 and y = 52), same as every other diagram in this plugin.
Each lifeline runs from the bottom of its actor box down to LIFELINE_BOTTOM:
LIFELINE_TOP = ACTOR_TOP + ACTOR_H + 8 # 8 px gap below actor
LIFELINE_BOTTOM = MSG_TOP + M * ROW_H + 16 # 16 px below last message
Emit each lifeline as:
<line class="lifeline" x1="x_i" y1="LIFELINE_TOP" x2="x_i" y2="LIFELINE_BOTTOM"
stroke="#475569" stroke-width="1" stroke-dasharray="4,4"/>
The class="lifeline" is required — the geometry-audit uses this class to skip lifelines in edge-edge and edge-crosses-component checks (otherwise every horizontal message would flag).
MSG_TOP = LIFELINE_TOP + 24 # first message y
ROW_H = 36 # vertical gap per message
y_k = MSG_TOP + k * ROW_H # k = 0..M-1
For each message at row k:
<path d="M src_x,y_k L tgt_x-sign(tgt-src)*8,y_k"
stroke="<color>" stroke-width="1.4" marker-end="url(#ah-<color>)"/>
<path d="M src_x,y_k h 32 v 16 h -32"
stroke="<color>" stroke-width="1.4" marker-end="url(#ah-<color>)"/>
Label sits to the right of the bump: <text x="src_x + 40" y="y_k + 4">label</text>.Centered above the arrow line, with halo:
label.x = (src_x + tgt_x) / 2
label.y = y_k - 6
If |src_x − tgt_x| < label_w + 16, widen the source/target columns so the label fits. Don't shrink the label — verbosity here costs nothing visually.
H = LIFELINE_BOTTOM + 40 # 40 px footer margin
viewBox = "0 0 W H"
The geometry-audit has been extended (in this repo) to recognize class="lifeline" on <line> and <path> elements. Lifelines are:
edge-crosses-edge (every message crosses every lifeline — by design)edge-crosses-component (lifelines shouldn't cross actor boxes anyway; if they do, the actor box layout itself is wrong)Other audit classes apply normally:
component-overlap — actor boxes must not overlaplabel-overlaps-component — message labels must not sit on an actor boxedge-crosses-label — different messages' labels must not collideIf you see edge-crosses-edge findings in a sequence diagram, those are between messages (not lifelines) — typically a sign that two messages share a y-coordinate by mistake, or that a self-loop bump overlaps the next row. Fix by spacing or by re-ordering.
"Show the OAuth 2.0 authorization code flow with PKCE: user clicks login on the SPA, SPA redirects to the IDP, IDP authenticates the user and stores a code in its DB, IDP redirects back with the code, SPA exchanges the code (with verifier) for a token at the IDP, IDP returns the token, SPA calls the API with the token, API verifies and returns the resource."
Extracted:
See ../../examples/14-sequence-oauth-code-flow.svg for the rendered output.
class="lifeline" — the audit will flag every message as crossing a lifeline.y. Spacing is what makes sequence diagrams readable.alt/loop/par fragments in v1. If the brief genuinely needs branching, draw two sequence diagrams (one per branch) and reference them in prose.6 actors → split into two diagrams (e.g., "auth phase" + "API phase").
14 messages → consider folding consecutive same-pair calls into one message with a list label.
par fragment territory) → sequence diagrams aren't the right tool; use an architecture diagram with annotated edges instead.Original work. Follows UML 2.x sequence-diagram semantics where applicable, blueprint-adapted to match the architecture-diagram and mindmap aesthetic in this plugin.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sergio-bershadsky/ai --plugin diagramming4 skills in this plugin
/architecture-diagramUse when the user asks for a system, infrastructure, cloud, security, network topology, or architecture diagram. Produces polished dark-themed self-contained HTML+SVG files with mathematically-correct label placement, clean-background priority, text halos, and leader lines./architecture-diagram-reactUse when the user wants to embed an architecture diagram directly inside a React/Vite site as inline SVG (no html2canvas, no external scripts, no separate HTML file). Produces an `arch-diagram` fenced markdown block that the site's React renderer expands — including `<lucide-icon>` placeholders for semantic icons. Companion to the `architecture-diagram` skill, which produces standalone HTML./mindmapUse when the user asks for a mindmap, mind-map, concept map, idea tree, brainstorm diagram, or any radial topic explosion ("draw a mindmap of X", "map out the themes around Y", "mindmap the differentiators of Z"). Produces dark-themed self-contained HTML+SVG with a central root, branches radiating in all directions, halo text, Q-curved Bezier connectors, and geometry-audit gating.Other plugins' skills for the same job