From diagram
Generate an interactive SVG diagram (architecture, sequence, flowchart, ER) from a description
How this skill is triggered — by the user, by Claude, or both
Slash command
/diagram:diagram [description of what to diagram][description of what to diagram]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a single self-contained HTML file with an interactive (pan, zoom, hover-tooltip) SVG diagram. Supported types: architecture, sequence, flowchart, entity-relationship.
Generate a single self-contained HTML file with an interactive (pan, zoom, hover-tooltip) SVG diagram. Supported types: architecture, sequence, flowchart, entity-relationship.
Get the description. If $ARGUMENTS is non-empty, use it. Otherwise ask the user what to diagram.
Detect the type from keywords in the description. If multiple match, take the first row in this table; if none match, default to architecture.
| Type | Keywords |
|---|---|
| Architecture | architecture, system, service, microservice, component |
| Sequence | sequence, flow of, interaction, request, call |
| Flowchart | flowchart, pipeline, process, workflow, steps |
| ER | ER, entity, relationship, schema, table, database model |
Plan 5–25 nodes. For each node, decide on a 1–4 word label, a one-sentence tooltip, and its connections (with optional 1–3 word edge labels). If the description implies more than 25 nodes, group related items and tell the user what you grouped — past 25 the diagram stops being readable. If the description is too vague to plan meaningfully, ask for more detail rather than inventing nodes.
Lay out the nodes. See references/layouts.md for the spacing, shape, and colour conventions per diagram type. Read only the section for the type you detected.
Compute the viewBox. Take the bounding box of all nodes plus 60px padding on every side. Default size is 0 0 1200 800; widen it (e.g. 0 0 1600 1000) for diagrams that need more room. Update both the <svg viewBox="..."> attribute and the vb / INIT constants in the script so pan/zoom reset correctly.
Build the HTML by copying references/template.html verbatim, then filling in the title, subtitle (TYPE · N nodes), viewBox, and the <!-- DIAGRAM CONTENT --> block with your .node and .edge elements. The template already contains the arrowhead <marker id="arrow">, the colour palette, the pan/zoom/tooltip script, and the dark theme — do not duplicate or rewrite those.
Write and open the file. Save as <topic-slug>-diagram.html (lowercase, hyphens) in the current working directory. Then open <file> on macOS, xdg-open <file> on Linux. If the open command fails, print the absolute path so the user can open it manually.
Report the file path, diagram type, and node count.
Every node is a <g class="node node-<colour>"> with data-label (display name) and data-tooltip (one-sentence description) attributes. The script reads those attributes to render the tooltip — without them the node still draws but loses its hover behaviour.
<g class="node node-violet" data-label="Auth Service" data-tooltip="Issues and validates JWT tokens.">
<rect x="200" y="100" width="140" height="50" rx="8"/>
<text x="270" y="125">Auth Service</text>
</g>
<g class="edge">
<line x1="270" y1="150" x2="270" y2="220" marker-end="url(#arrow)"/>
<text class="edge-label" x="285" y="190">JWT</text>
</g>
Available palette classes: node-blue, node-indigo, node-violet, node-teal, node-green, node-cyan, node-slate, node-orange, node-amber, node-rose. The CSS in the template styles rect, circle, and polygon children of each — pick the shape that matches the diagram type (rect for most things, polygon for decision diamonds, etc.).
These keep the output readable; ignore them only when the description forces a trade-off, and tell the user what you compromised.
.html file. No external CSS, JS, fonts, or CDN links — the file should work fully offline. The template is built around this, so just don't add <link> or <script src=...> tags.references/template.html — the full HTML template to copy. Read once per invocation.references/layouts.md — per-type layout conventions. Read only the relevant section.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mikersays/mikersays-plugins --plugin diagram