sequence-diagram
БесплатноБез исполняемых скриптовНе проверенUse when the user asks for a sequence diagram, ladder diagram, message-exchange diagram, or any temporal flow showing who talks to whom in order ("draw the…
от sergio-bershadsky★ 15 звёзд на GitHubОб этом скилле
Sequence Diagram 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.
What triggers this skill
- "Draw a sequence diagram of X"
- "Show the [OAuth | login | checkout | webhook] flow over time"
- "Ladder diagram for protocol Y"
- "Show the message exchange between A and B"
- "Activity diagram of [request]" — users frequently conflate these; default to sequence when there's a clear temporal order of messages between named actors
- Any request whose answer is "X happens, then Y, then Z" with named actors
When to use this skill vs siblings
| 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.
Output contract
Same as the rest of the plugin:
- Self-contained
.svgfile (or.htmlif delivering to a user with the export toolbar — copy from../architecture-diagram/resources/template.htmland swap the SVG body). - Dark
#020617background, JetBrains Mono via the inline<style>block, halo text viapaint-order: stroke fill. - Geometry-audit (
../architecture-diagram/resources/geometry-audit.py) must exit 0 before the diagram is done.
Visual conventions (UML 2.x, blueprint-adapted)
| 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 |
Semantic colors per actor type (reuse from architecture-diagram)
| 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 |
Workflow
- Extract actors from the brief. Read the user's prose; identify the distinct named participants (USER, SPA, AUTH SERVER, DB, API, …). Typical count: 3–6. Cap at 7 — beyond that, split the diagram.
- Extract messages in order. Each message = (src actor, tgt actor, label, kind ∈ {sync, async, return, self}). Keep labels short — verbs preferred ("request token", "fetch user").
- Compute layout (algorithm below).
- Emit SVG. Actor row first, then lifelines, then messages top-to-bottom.
- Run geometry-audit. Must be clean. Lifelines are now exempt from edge-edge crossings (see Audit notes below).
Layout algorithm
The diagram is two zones: an actor row at the top, then a message ladder below.
Step 1 — column widths and positions
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
Step 2 — actor row
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.
Step 3 — lifeline geometry
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
Установить sequence-diagram в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sequence-diagram?
Use when the user asks for a sequence diagram, ladder diagram, message-exchange diagram, or any temporal flow showing who talks to whom in order ("draw the OAuth flow", "show the request lifecycle", "diagram the protocol over time", "sequence diagram for X"). Produces dark-themed self-contained SVG with actor lifelines, sync/async/return messages, self-loops, halo text, and a geometry-audit gate that knows about lifelines.
Как установить скилл sequence-diagram?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sequence-diagram запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic