Skip to content
Back to skills

Spgr Generate Sequence Diagram

ASecurity

Produce a UML sequence diagram, committed Mermaid or PlantUML source plus a rendered SVG, showing how participants collaborate over time through ordered messages for one scenario. Use when the Architect, Backend Developer, or API Design Agent needs the time-ordered interaction between participants, not static structure or data model.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 11, 2026
ai-agentsgoexpressawstestingapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 18 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add z4gunn/springer --skill spgr-generate-sequence-diagram --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spgr Generate Sequence Diagram?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Spgr Generate Sequence Diagram
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/z4gunn-spgr-generate-sequence-diagram/badge)](https://www.skillsdirectory.com/skills/z4gunn-spgr-generate-sequence-diagram)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: spgr-generate-sequence-diagram
description: Produce a UML sequence diagram, committed Mermaid or PlantUML source plus a rendered SVG, showing how participants collaborate over time through ordered messages for one scenario. Use when the Architect, Backend Developer, or API Design Agent needs the time-ordered interaction between participants, not static structure or data model.
disable-model-invocation: true
---

# generate-sequence-diagram

## Purpose

Capture the message protocol for one scenario as diagram-as-code: who calls whom, in what order, synchronous versus asynchronous, request versus response, so contributors agree on the runtime contract before implementation. It answers one question for one scenario, how participants interact over time. Emit committed Mermaid or PlantUML source and a rendered SVG kept in version control next to the code the diagram depicts. This is not an envelope artifact. Do not call spgr-write-artifact and do not add a JSON schema. The source plus the rendered SVG are the deliverable.

## Inputs

| Field | Description |
|-------|-------------|
| `scenario` | One interaction scenario, API protocol, or user story for a single flow. One diagram covers one scenario for one audience. |
| `participants` | The actors, services, components, or objects involved, named with stable domain aliases. |
| `semantics` | Sync versus async per message, and the branch, optional, loop, and concurrency conditions for the scenario. |
| `view` | Optional. A communication view (linked participants, decimal-numbered messages) instead of the default time-axis layout. |

## Outputs

| Artifact | Description |
|----------|-------------|
| Sequence-diagram source | Mermaid `sequenceDiagram` by default, or PlantUML on an escalation trigger. Participants with lifelines, activation bars, synchronous (`->>`), asynchronous (`-)`), and return (`-->>`) messages, self-calls, object creation and destruction, and combined fragments (`alt`, `opt`, `loop`, `par`, and where needed `critical`, `break`, `ref`). Committed next to the code. |
| Rendered SVG | The compiled output from scripts/render-sequence.sh, committed alongside the source. |
| Communication view (on request) | The same interaction by link topology with decimal-numbered messages, via PlantUML or the Mermaid numbered-flowchart approximation, with the chosen tool and reason stated. |

## Procedure

1. Confirm the deliverable is interaction over time for one scenario. If it is process flow with responsibility lanes use spgr-generate-activity-diagram, a single entity lifecycle use spgr-generate-state-diagram, static structure use spgr-generate-uml-class-diagram, the data model use spgr-generate-erd, C4 structure use spgr-generate-system-diagram, and deployment topology use spgr-write-infrastructure-diagram. If the input names no concrete scenario, no participants, or contradicts itself on sync versus async, stop and raise spgr-escalate with the precise gap. Do not assume a protocol.

2. Select the notation. Default to Mermaid `sequenceDiagram`. Escalate to PlantUML only on a trigger in .claude/references/tool-selection.md: richer fragments, a true communication or object view, `autoactivate`, object creation, or finer styling Mermaid cannot express. State the notation and the trigger in the source as a comment when you escalate.

3. Author the source from the matching golden template so output stays consistent across runs. For Mermaid, copy from assets/mermaid/ (`sync-request-response.mmd`, `async-fire-and-forget.mmd`, `alt-opt-loop.mmd`). For PlantUML, copy from assets/plantuml/ with the same three names. For the message arrows, activation, and fragment rules, read references/mermaid-sequence.md or references/plantuml-sequence.md.

4. Declare participants up front with stable domain aliases. Show the messages that carry the scenario and no more. Reserve the async open arrow for genuinely non-blocking calls. Turn on `autonumber` when call ordering is part of the deliverable. Keep activation open and close in one style, either the `+`/`-` suffix or explicit `activate`/`deactivate`, never one of each for the same bar.

5. Split, do not deep-nest. When a scenario branches into a happy path and an error path, produce two diagrams rather than nesting combined fragments deeply, which is the top readability killer.

6. For a communication view, use PlantUML's communication form, or approximate it in Mermaid with a numbered flowchart, since Mermaid has no communication-diagram type. State the chosen tool and reason. See references/mermaid-sequence.md for the flowchart approximation.

7. Validation gate. Run scripts/render-sequence.sh on every source file. It runs scripts/lint-sequence.sh first to flag any `alt`, `opt`, `loop`, or `par` missing its `end` and any `activate` missing its `deactivate`, then compiles with mmdc or plantuml.jar and fails on a non-zero exit or an error annotation drawn into the SVG. A render that exits non-zero, draws an error into the image, or drops a declared participant is a validation failure. Fix the source and re-render. Do not deliver an uncompiled diagram.

8. Commit the source and the rendered SVG together, in the same commit as the code or spec change they depict. Regenerate from the source on every change. Never hand-edit the rendered SVG.

## Notes

- The output is committed diagram source plus a rendered SVG, verified by the render-and-validate script, not by an envelope schema. Do not call spgr-write-artifact for this skill.
- Cross-cutting diagram quality rules (one question per diagram, source of truth, render before delivery, cite the source) live in .claude/references/diagram-standards.md. The notation decision table and the Mermaid limitation list live in .claude/references/tool-selection.md. Do not restate them here.
- Keep use-case, interaction-overview, and timing diagrams out of scope. This skill owns interaction over time only.
- For presentation-grade output, hand the committed source to spgr-render-diagram-excalidraw rather than re-authoring by hand.
- scripts/render-sequence.sh is the validation gate. Run it before every delivery. scripts/lint-sequence.sh is the structural balance check it calls first, and can also run standalone on a draft. assets/mermaid/UNBALANCED-do-not-ship.mmd is a deliberately broken fixture for testing the lint, not a template.

Files in this skill

  • SKILL.md6.2 KB
  • assets/mermaid/UNBALANCED-do-not-ship.mmd353 B
  • assets/mermaid/alt-opt-loop.mmd864 B
  • assets/mermaid/alt-opt-loop.svg28.3 KB
  • assets/mermaid/async-fire-and-forget.mmd677 B
  • assets/mermaid/async-fire-and-forget.svg24.2 KB
  • assets/mermaid/sync-request-response.mmd652 B
  • assets/mermaid/sync-request-response.svg24.6 KB
  • assets/plantuml/alt-opt-loop.puml868 B
  • assets/plantuml/alt-opt-loop.svg11.8 KB
  • assets/plantuml/async-fire-and-forget.puml588 B
  • assets/plantuml/async-fire-and-forget.svg7.1 KB
  • assets/plantuml/sync-request-response.puml625 B
  • assets/plantuml/sync-request-response.svg7.6 KB
  • references/mermaid-sequence.md3.3 KB
  • references/plantuml-sequence.md3.2 KB
  • scripts/lint-sequence.sh2.7 KB
  • scripts/render-sequence.sh2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.