跳到主要内容
知仓学习社ZHICANG

sequence-diagram

Diagram an interaction as a sequence of messages between participants over time. Use when asked to show an API flow, request/response, auth handshak…

不碰外部(只输出文字)无严重或高危命中mohitagw15856/pm-claude-skills

它会碰到什么

扫了多少1 个文本文件,3 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Sequence Diagram Skill

When the question is "in what order do these things talk to each other?", a sequence diagram is the

clearest answer. This skill turns a described interaction — an API call chain, an auth handshake, a webhook

flow — into a correct Mermaid sequence diagram with participants, ordered messages, return values, and

the important error/timeout paths.

Required Inputs

Ask for these only if they aren't already provided:

  • The participants — the actors/services/systems involved (client, API, DB, third party…).
  • The messages — what each one sends to the next, in order; what comes back.
  • Sync vs async — which calls block on a response vs fire-and-forget.
  • Edge cases — the failure, timeout, or alternative path worth showing.

Output Format

[Interaction name] — sequence

One line on what flow this traces.

sequenceDiagram
    actor U as User
    participant W as Web app
    participant A as API
    participant D as Database
    U->>W: Click "Sign in"
    W->>A: POST /login
    A->>D: Lookup user
    D-->>A: User record
    A-->>W: 200 + token
    W-->>U: Logged in
    Note over A,D: On miss, return 401

Notes — failure/timeout handling, retries, idempotency, anything async (-) ).

Mermaid Rules (so it renders)

  • Start with sequenceDiagram. Declare participant X as Label (or actor) up front.
  • Solid arrow ->> = call/request; dashed -->> = response/return; -) = async message.
  • Use Note over A,B: ... for context and alt/else/end for alternative paths if needed.
  • Keep message text short; no colons that aren't the message separator.

Quality Checks

  • [ ] Participants are declared and ordered to match the real call flow
  • [ ] Requests and responses are distinguished (solid vs dashed arrows)
  • [ ] At least one failure/edge path is shown or noted (not just the happy path)
  • [ ] Sync vs async messages are visually distinct
  • [ ] The Mermaid block renders without edits

Anti-Patterns

  • [ ] Do not show only the happy path when a failure path matters — note the 401/timeout/retry
  • [ ] Do not blur requests and returns — use ->> vs -->>
  • [ ] Do not reorder messages for neatness — sequence order is the whole point
  • [ ] Do not put colons inside message text — it breaks parsing
  • [ ] Do not invent participants — model only the systems actually involved

Based On

UML sequence diagramming (lifelines, sync/async messages, alt fragments), expressed as renderable Mermaid.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

同名技能的其他版本

有 3 个不同仓库或目录里都有叫 sequence-diagram 的技能。它们内容并不相同,别混用: