architecture-diagram
cocoon-ai/architecture-diagram-generator
Create professional dark-themed architecture diagrams as self-contained HTML+SVG files.
What is architecture-diagram?
Generate polished system, infrastructure, cloud, and network topology diagrams with a consistent design system. Use this skill when users request visual architecture documentation with professional styling, semantic color coding, and built-in export capabilities.
- Renders architecture diagrams as self-contained HTML files with inline SVG and CSS
- Applies semantic color palette for component types (Frontend, Backend, Database, AWS/Cloud, Security, Message Bus)
- Includes built-in export toolbar for copying/downloading as PNG or PDF
- Provides design system with typography, spacing rules, and visual element patterns
- Supports region boundaries, security groups, message buses, and connection arrows
- Automatically masks arrows behind semi-transparent component fills for clean rendering
How to install architecture-diagram
npx skills add https://github.com/cocoon-ai/architecture-diagram-generator --skill architecture-diagram- Node.js environment to run the skill
- Access to the template.html resource file for customization
How to use architecture-diagram
- 1.Install the skill using the provided npx command
- 2.Open the template.html file from resources/
- 3.Update the SVG viewBox dimensions if needed for your diagram size
- 4.Add component boxes using the provided SVG pattern with appropriate semantic colors
- 5.Draw connection arrows between components, ensuring they render behind boxes
- 6.Add region boundaries or security groups using dashed strokes as needed
- 7.Update the three summary cards with key architecture details
- 8.Use the export toolbar (⋯ button) to copy as PNG, download PNG, or generate PDF
Use cases
- Document microservices architecture with service-to-service connections and message buses
- Visualize cloud infrastructure with AWS regions, security groups, and network topology
- Create system design diagrams for technical documentation and design reviews
- Generate security architecture diagrams showing authentication flows and data boundaries
- Illustrate multi-tier application layouts with frontend, backend, and database components
- Software architects designing system layouts
- Backend engineers documenting infrastructure
- DevOps engineers visualizing cloud deployments
- Technical writers creating architecture documentation
- Teams conducting design reviews and system planning
architecture-diagram FAQ
Draw an opaque background rect at the same position before the styled component rect. The opaque rect masks arrows behind it, while the semi-transparent styled rect renders on top.
Place legends outside all boundary boxes (regions, clusters, security groups), at least 20px below the lowest boundary. Extend the SVG viewBox height if needed to accommodate it.
Use a minimum 40px vertical gap between components. Place message buses in the middle of this gap (e.g., at y=140 for a gap from y=130 to y=170) to avoid overlaps.
Yes. The skill provides a semantic color table in the design system section. Update the fill and stroke colors in your SVG components to match your brand while maintaining the rgba transparency pattern.
The built-in toolbar supports three formats: PNG (copied to clipboard or downloaded at 2x scale), and PDF (PNG embedded in a one-page PDF via jsPDF).
Full instructions (SKILL.md)
Source of truth, from cocoon-ai/architecture-diagram-generator.
name: architecture-diagram description: Create polished dark-themed architecture diagrams as self-contained HTML+SVG files. Use when the user asks for system, infrastructure, cloud, security, or network topology diagrams.
Architecture Diagram Skill
Create professional technical architecture diagrams as self-contained HTML files with inline SVG graphics and CSS styling.
Version 1.1 · MIT License · Authored by Cocoon AI
Design System
Color Palette
Use these semantic colors for component types:
| Component Type | Fill (rgba) | Stroke |
|---|---|---|
| Frontend | rgba(8, 51, 68, 0.4) | #22d3ee (cyan-400) |
| Backend | rgba(6, 78, 59, 0.4) | #34d399 (emerald-400) |
| Database | rgba(76, 29, 149, 0.4) | #a78bfa (violet-400) |
| AWS/Cloud | rgba(120, 53, 15, 0.3) | #fbbf24 (amber-400) |
| Security | rgba(136, 19, 55, 0.4) | #fb7185 (rose-400) |
| Message Bus | rgba(251, 146, 60, 0.3) | #fb923c (orange-400) |
| External/Generic | rgba(30, 41, 59, 0.5) | #94a3b8 (slate-400) |
Typography
Use JetBrains Mono for all text (monospace, technical aesthetic):
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
Font sizes: 12px for component names, 9px for sublabels, 8px for annotations, 7px for tiny labels.
Visual Elements
Background: #020617 (slate-950) with subtle grid pattern:
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
<path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>
</pattern>
Component boxes: Rounded rectangles (rx="6") with 1.5px stroke, semi-transparent fills.
Security groups: Dashed stroke (stroke-dasharray="4,4"), transparent fill, rose color.
Region boundaries: Larger dashed stroke (stroke-dasharray="8,4"), amber color, rx="12".
Arrows: Use SVG marker for arrowheads:
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#64748b" />
</marker>
Arrow z-order: Draw connection arrows early in the SVG (after the background grid) so they render behind component boxes. SVG elements are painted in document order, so arrows drawn first will appear behind shapes drawn later.
Masking arrows behind transparent fills: Since component boxes use semi-transparent fills (rgba(..., 0.4)), arrows behind them will show through. To fully mask arrows, draw an opaque background rect (e.g., fill="#0f172a") at the same position before drawing the semi-transparent styled rect on top:
<!-- Opaque background to mask arrows -->
<rect x="X" y="Y" width="W" height="H" rx="6" fill="#0f172a"/>
<!-- Styled component on top -->
<rect x="X" y="Y" width="W" height="H" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>
Auth/security flows: Dashed lines in rose color (#fb7185).
Message buses / Event buses: Small connector elements between services. Use orange color (#fb923c stroke, rgba(251, 146, 60, 0.3) fill):
<rect x="X" y="Y" width="120" height="20" rx="4" fill="rgba(251, 146, 60, 0.3)" stroke="#fb923c" stroke-width="1"/>
<text x="CENTER_X" y="Y+14" fill="#fb923c" font-size="7" text-anchor="middle">Kafka / RabbitMQ</text>
Spacing Rules
CRITICAL: When stacking components vertically, ensure proper spacing to avoid overlaps:
- Standard component height: 60px for services, 80-120px for larger components
- Minimum vertical gap between components: 40px
- Inline connectors (message buses): Place IN the gap between components, not overlapping
Example vertical layout:
Component A: y=70, height=60 → ends at y=130
Gap: y=130 to y=170 → 40px gap, place bus at y=140 (20px tall)
Component B: y=170, height=60 → ends at y=230
Wrong: Placing a message bus at y=160 when Component B starts at y=170 (causes overlap) Right: Placing a message bus at y=140, centered in the 40px gap (y=130 to y=170)
Legend Placement
CRITICAL: Place legends OUTSIDE all boundary boxes (region boundaries, cluster boundaries, security groups).
- Calculate where all boundaries end (y position + height)
- Place legend at least 20px below the lowest boundary
- Expand SVG viewBox height if needed to accommodate
Example:
Kubernetes Cluster: y=30, height=460 → ends at y=490
Legend should start at: y=510 or below
SVG viewBox height: at least 560 to fit legend
Wrong: Legend at y=470 inside a cluster boundary that ends at y=490 Right: Legend at y=510, below the cluster boundary, with viewBox height extended
Layout Structure
- Header - Title with pulsing dot indicator, subtitle, and export toolbar
- Main SVG diagram - Contained in rounded border card
- Summary cards - Grid of 3 cards below diagram with key details
- Footer - Minimal metadata line
Export Toolbar (built-in)
Every diagram ships with a single unobtrusive ⋯ toggle in the header. Click it to reveal three buttons — 📋 Copy (high-DPI PNG to clipboard, scale: 2), 🖼️ PNG (high-DPI PNG download), 📄 PDF (PNG embedded in a one-page PDF via jsPDF). The toolbar collapses back to the icon by default so it doesn't clutter the diagram. All three formats use the same html2canvas capture (with the toolbar excluded and 32px padding around the content), so PDF preserves the dark theme without going through the browser's print dialog.
When generating a new diagram, keep these intact in the template:
- The two CDN scripts in
<head>(pinned versions, with Subresource Integrity hashes andcrossorigin="anonymous"):https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js—integrity="sha384-ZZ1pncU3bQe8y31yfZdMFdSpttDoPmOZg2wguVK9almUodir1PghgT0eY7Mrty8H"https://cdn.jsdelivr.net/npm/jspdf@2.5.2/dist/jspdf.umd.min.js—integrity="sha384-en/ztfPSRkGfME4KIm05joYXynqzUgbsG5nMrj/xEFAHXkeZfO3yMK8QQ+mP7p1/"- SRI ensures generated diagrams are tamper-resistant against CDN compromise. Do not modify the hashes; if the version is bumped, the new hash must be computed fresh.
id="report-container"on the outermost.containerdiv (this is what gets captured).toolbarmarkup with.toolbar-actions(collapsed by default) and.toolbar-toggle(the⋯button).toolbarCSS +@media print { .toolbar { display: none !important; } }copyAsImage(),downloadPNG(), anddownloadPDF()script before</body>, all usinggetBoundingClientRect()+html2canvas(document.body, { x, y, width, height, ignoreElements })to capture a precise rect with breathing room and no toolbar
Caveats: clipboard API needs a user gesture and a secure context (https/file/localhost). SVG <foreignObject> renders inconsistently in html2canvas — stick to plain <svg> shapes and <text>. Bump scale: 2 to 3 or 4 for higher-res output.
Component Box Pattern
<rect x="X" y="Y" width="W" height="H" rx="6" fill="FILL_COLOR" stroke="STROKE_COLOR" stroke-width="1.5"/>
<text x="CENTER_X" y="Y+20" fill="white" font-size="11" font-weight="600" text-anchor="middle">LABEL</text>
<text x="CENTER_X" y="Y+36" fill="#94a3b8" font-size="9" text-anchor="middle">sublabel</text>
Info Card Pattern
<div class="card">
<div class="card-header">
<div class="card-dot COLOR"></div>
<h3>Title</h3>
</div>
<ul>
<li>• Item one</li>
<li>• Item two</li>
</ul>
</div>
Template
Copy and customize the template at resources/template.html. Key customization points:
- Update the
<title>and header text - Modify SVG viewBox dimensions if needed (default:
1000 x 680) - Add/remove/reposition component boxes
- Draw connection arrows between components
- Update the three summary cards
- Update footer metadata
Output
Always produce a single self-contained .html file with:
- Embedded CSS (no external stylesheets except Google Fonts)
- Inline SVG (no external images)
- No JavaScript required (pure CSS animations)
The file should render correctly when opened directly in any modern browser. The export toolbar uses two CDN scripts (html2canvas and jsPDF) — no other JavaScript dependencies.
Related skills
More from cocoon-ai/architecture-diagram-generator and the wider catalog.

app-icon
Generate professional app icons for React Native Expo apps with iOS 26 Liquid Glass support.

github-issue-triage
Agent skill from code-yeongyu/oh-my-openagent.

github-triage
Read-only GitHub issue and PR analyzer that spawns background tasks for evidence-backed triage reports.

github-issue-triage
Triage GitHub issues with streaming analysis—one background task per issue for real-time results.
build-tam
Build a Total Addressable Market list by sourcing accounts and contacts from Crustdata, Dropleads, and PDL.
clay-to-deepline
Convert Clay table configurations into local Deepline scripts with extraction, documentation, and parity validation.