/diagramming:architecture-diagramfrom diagramming
Generates professional architecture diagrams as self-contained HTML+SVG files with dark theme, export toolbar, and blueprint aesthetic. Activates on requests for system, infrastructure, cloud, security, or network topology 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.
Read when SKILL.md points to them.
Generate professional technical architecture diagrams as self-contained HTML files with inline SVG graphics, CSS styling, and a built-in export toolbar (PNG / PDF / Copy-to-clipboard).
Blueprint aesthetic: dashed cluster boundaries, halo text, semantic palette, Q-filleted orthogonal edges, and a deterministic geometry-audit linter that gates release.
Always produce a single self-contained .html file that:
#report-container div via getBoundingClientRect() + 32 px padding#020617 (slate-950) dark background even in PDFSee resources/template.html for the canonical starting point.
This skill is self-contained markdown. Every algorithm needed to produce a correct blueprint diagram lives in resources/design-system.md and the rule list below. When the user asks for a diagram, the model applies those algorithms inline in the conversation and emits HTML+SVG directly — there is no build step, no Python generator, no make target. The maintainer never writes per-diagram code.
The only Python in resources/ is genuinely-generic post-production tooling: geometry-audit.py deterministically detects intersections/overlaps/overflows (blocking — must pass before a diagram is done), audit-labels.py lints label placement vs arrow midpoints, coordinate-shifter.py bulk-shifts y-coordinates in any HTML+SVG file. None produce diagrams; all operate on already-rendered output.
Examples under examples/ are hand-committed SVG artifacts that demonstrate the rules in their current form. They are evidence, not infrastructure.
These rules describe the v2 (blueprint) aesthetic. They are inspired by ISO 128 (technical drawings — line grammar, weight series, terminator shape) and ISO/IEC 19505 (UML 2.x — relationship notation). Every rule below is an algorithm the model applies at generation time — no external tool needed.
resources/design-system.md § Workflow — layout first, content second.paint-order: stroke fill (4 px for body, 6 px for titles, 3 px for sublabels). This masks underlying lines cleanly through each glyph; the universal halo IS the background. Never wrap labels in rounded-corner rect "chips".text_x = (icon_right + 8 + box_right) / 2) or left-align at icon_right + 8. Required guard: icon_size + 16 px of horizontal clearance.(box, side). For N edges in a group, give each a distinct attach point at fraction (k+1)/(N+1) of the side length (k = 0..N-1, sorted by direction toward target). Single-arrow case lands at the midpoint — backward-compatible. See resources/design-system.md § Edge endpoint distribution.r = 12 rounded turns. Route horizontal legs in CLEAR corridors between rows of components — never through a row of components. For cross-band edges use a Z-shape via an intermediate y (V-H-V) or x (H-V-H). Diagonals are forbidden.{0.5, 1, 1.5, 2} only. Corner radii from {0, 2, 4} only. Same width / rx for the same role across the whole diagram.label_w = len * font_size * 0.6 and ensure the gap is ≥ label_w + 24 px. If not, widen the gap (default), shorten the label, or promote to a callout. Done in Phase 1 layout, not after.center = (box.x + 20, box.y), r = 12, fill = box stroke colour). The disc straddles the top border (half outside, half inside). Apply the icon-space rule to the box's label. See resources/design-system.md § Icon disc (corner-anchored, opt-in).resources/design-system.md for colors, fonts, spacing, component patterns.resources/label-placement.md for the math + clean-background principle.template.html — copy and customise. Always preserve the header, toolbar, capture script, halo CSS.resources/geometry-audit.py <file>.html must exit 0 before the diagram is considered done. It deterministically reports component-overlap, component-outside-cluster, edge-crosses-component, edge-crosses-edge, label-overlaps-component, and edge-crosses-label. Iterate fixes and re-run until clean. Only pass --ignore-edge-edge when the diagram is an intentional mesh.resources/audit-labels.py <file>.html reports any label > 50 px from its arrow's midpoint and lacking a leader line.<name>-architecture.html in the user's docs directory.resources/design-system.md for full)| Component Type | Fill | Stroke |
|---|---|---|
| Frontend | rgba(8, 51, 68, 0.4) | #22d3ee (cyan-400) |
| Backend / service | rgba(6, 78, 59, 0.4) | #34d399 (emerald-400) |
| Database / store | rgba(76, 29, 149, 0.4) | #a78bfa (violet-400) |
| Cloud edge / LB | rgba(120, 53, 15, 0.3) | #fbbf24 (amber-400) |
| Security / IDP / KMS | rgba(136, 19, 55, 0.4) | #fb7185 (rose-400) |
| External / generic | rgba(30, 41, 59, 0.5) | #94a3b8 (slate-400) |
| Message bus | rgba(251, 146, 60, 0.3) | #fb923c (orange-400) |
rx="6", 1.5 px stroke, semi-transparent fillstroke-dasharray="4,4", transparent fill, rose strokestroke-dasharray="8,4", rx="12", amber stroke| Style | Meaning |
|---|---|
| Solid | Data plane traffic (HTTPS, mTLS) |
| Dashed cyan/emerald | Control plane (xDS, gRPC) |
| Dashed rose | Auth / key / rotation flow |
| Dashed amber | Egress to upstream / external |
Dotted violet (1,3) | Audit log stream |
| Bold (no dash) | Key / secret flow |
See resources/label-placement.md for the formal version. Summary:
def place_label(arrow_path, label_text, occupied_regions):
# Compute Bezier midpoint as initial candidate
if arrow_path.type == 'quadratic':
# P = 0.25·P0 + 0.5·P1 + 0.25·P2
midpoint = bezier_midpoint(arrow_path)
elif arrow_path.type == 'line':
midpoint = ((p1.x + p2.x) / 2, (p1.y + p2.y) / 2)
# Compute label bounding box
label_width = len(label_text) * font_size * 0.6
label_height = font_size * 1.2
margin = font_size
# Search for clean space, starting at midpoint and spiraling outward
for candidate in spiral_search(midpoint, max_distance=300):
bbox = (candidate.x - label_width/2, candidate.y - label_height,
label_width + 2*margin, label_height + 2*margin)
if not overlaps_any(bbox, occupied_regions):
# Place label here
distance = euclidean(candidate, midpoint)
return {
'x': candidate.x,
'y': candidate.y,
'anchor': 'middle',
'needs_leader_line': distance > 30
}
# Fallback: place at midpoint, rely on halo
return {'x': midpoint.x, 'y': midpoint.y, 'anchor': 'middle', 'needs_leader_line': False}
The principle: fight for clean visual space. Geometric midpoint accuracy is the lowest-priority criterion.
Two audit scripts. Both must be run. The geometry audit is blocking — a diagram is not done until it exits 0.
python3 ${CLAUDE_PLUGIN_ROOT}/skills/architecture-diagram/resources/geometry-audit.py <file>.html
Deterministically reports six classes of collision, each with SVG line numbers:
| Kind | Meaning | Typical fix |
|---|---|---|
component-overlap | Two component rects overlap | Move one box; widen row spacing |
component-overflow-cluster | Component pokes outside its parent cluster | Resize cluster or move box inward |
edge-crosses-component | Path segment passes through a box that is not its endpoint | Re-route via clear corridor (V-H-V or H-V-H) |
edge-crosses-edge | Two paths cross outside their shared endpoints | Re-route the shorter/less-important one; or use --ignore-edge-edge for intentional meshes |
label-overlaps-component | Text bbox sits on a box it does not label | Shorten label, move it, or promote to a callout with a leader line |
edge-crosses-label | Path runs through a foreign label's bbox | Shift label off the corridor, or shift the corridor |
arrowhead-reversed | Path ends on a rect edge but the tangent at the endpoint points away from the rect interior, so orient="auto" rotates the arrowhead 180° | Make the path's last segment travel into the rect (e.g. for top-edge entry, end the path with a downward V or a Q whose endpoint is at the target y). Common bug: ending with Q X,via X,via+12 V target where target < via+12 — the final V draws upward. |
edge-on-cluster-border | A path's H/V segment runs within ~2 px of a cluster's dashed boundary for ≥8 px, so the two lines visually merge into one cluttered band | Move the path's via_y / via_x further inside the cluster (≥10 px from the border) |
Iterate: fix one class, re-run, repeat until "clean — no geometry issues".
python3 ${CLAUDE_PLUGIN_ROOT}/skills/architecture-diagram/resources/audit-labels.py <file>.html
Flags any arrow label > 50 px from its curve midpoint without a leader line. Each flag is either fixable (move label closer or add a leader line) or by design (endpoint annotation — add the leader line and move on).
When the diagram needs more breathing room between root-level blocks, use:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/architecture-diagram/resources/coordinate-shifter.py <file>.html
The script shifts y-coordinates in tiers by editing the SVG directly: top row stays, control plane shifts +N, region shifts +2N, etc. Handles y= attributes and d="..." path commands correctly.
"Create an architecture diagram for our payment processing pipeline: Stripe webhook → API gateway → queue → workers → Postgres."
→ Use semantic colors (Stripe is external/slate, API gateway is cloud-edge/amber, queue is message-bus/orange, workers are backend/emerald, Postgres is database/violet). Place in left-to-right horizontal flow. Add halos. Run audit.
"Diagram our auth flow: user → CloudFront → ALB → API → Cognito → Postgres."
→ Top-down flow. Cognito is security/rose. Annotate the JWT verification arrow with a dashed rose line. Run audit.
"Show me a diagram of our multi-region setup with global control plane and regional data planes."
→ This is the Socket0 Connect shape. Two-band layout: global CP cluster (sub-grouped: compute services, identity, storage, audit) at top; regional fan-out below. Generous spacing. Halos and leader lines as needed.
Original work.
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/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./sequence-diagramnpx claudepluginhub sergio-bershadsky/ai --plugin diagrammingOther plugins' skills for the same job