Architecture Diagram Skill
Generate professional, dark-themed technical architecture diagrams as standalone HTML files with inline SVG graphics. No external tools, no API keys, no rendering libraries — just write the HTML file and open it in a browser.
Scope
Best suited for:
- Software system architecture (frontend / backend / database layers)
- Cloud infrastructure (VPC, regions, subnets, managed services)
- Microservice / service-mesh topology
- Database + API map, deployment diagrams
- Anything with a tech-infra subject that fits a dark, grid-backed aesthetic
Look elsewhere first for:
- Physics, chemistry, math, biology, or other scientific subjects
- Physical objects (vehicles, hardware, anatomy, cross-sections)
- Floor plans, narrative journeys, educational / textbook-style visuals
- Hand-drawn whiteboard sketches (consider
excalidraw)
- Animated explainers (consider an animation skill)
If a more specialized skill is available for the subject, prefer that. If none fits, this skill can also serve as a general SVG diagram fallback — the output will just carry the dark tech aesthetic described below.
Based on Cocoon AI's architecture-diagram-generator (MIT).
Workflow
- User describes their system architecture (components, connections, technologies)
- Generate the HTML file following the design system below
- Save with
write_file to a .html file (e.g. ~/architecture-diagram.html)
- If the user wants to view/share the diagram in chat (web console, WeCom / 企业微信, DingTalk, Feishu, Telegram, ...): call
render_html_image(filePath="<the .html path>", filename="<name>") and return the markdown link it produces. IM channels can only deliver rasterised images natively, so a PNG is required for the diagram to appear inline rather than as a dead link or a file attachment.
- Otherwise, the user opens the
.html directly in a browser — works offline, no dependencies.
Output Location
Save diagrams to a user-specified path, or default to the current working directory:
./[project-name]-architecture.html
Delivering through chat / IM channels
When the current channel is anything other than a local browser session, follow up write_file with:
render_html_image(filePath="./architecture-diagram.html", filename="architecture")
This returns a /api/v1/files/generated/<id> URL with image/png MIME. The channel layer detects the image MIME and uploads the PNG as a native image message (so it renders inline in WeCom / DingTalk / Feishu / Telegram / Web). Without this step, an .html artifact reaches IM channels as either a dead markdown link or, at best, a non-previewable file attachment.
Local preview
After saving, the user can open the .html directly:
# macOS
open ./my-architecture.html
# Linux
xdg-open ./my-architecture.html
Design System & Visual Language
Color Palette (Semantic Mapping)
Use specific rgba fills and hex strokes to categorize components:
| Component Type |
Fill (rgba) |
Stroke (Hex) |
| 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 |
rgba(30, 41, 59, 0.5) |
#94a3b8 (slate-400) |
Typography & Background
- Font: JetBrains Mono (Monospace), loaded from Google Fonts
- Sizes: 12px (Names), 9px (Sublabels), 8px (Annotations), 7px (Tiny labels)
- Background: Slate-950 (
#020617) with a subtle 40px grid pattern
<!-- Background 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>
Technical Implementation Details
Component Rendering
Components are rounded rectangles (rx="6") with 1.5px strokes. To prevent arrows from showing through semi-transparent fills, use a double-rect masking technique:
- Draw an opaque background rect (
#0f172a)
- Draw the semi-transparent styled rect on top
Connection Rules
- Z-Order: Draw arrows early in the SVG (after the grid) so they render behind component boxes
- Arrowheads: Defined via SVG markers
- Security Flows: Use dashed lines in rose color (
#fb7185)
- Boundaries:
- Security Groups: Dashed (
4,4), rose color
- Regions: Large dashed (
8,4), amber color, rx="12"
Spacing & Layout Logic
- Standard Height: 60px (Services); 80-120px (Large components)
- Vertical Gap: Minimum 40px between components
- Message Buses: Must be placed in the gap between services, not overlapping them
- Legend Placement: CRITICAL. Must be placed outside all boundary boxes. Calculate the lowest Y-coordinate of all boundaries and place the legend at least 20px below it.
Document Structure
The generated HTML file follows a four-part layout:
- Header: Title with a pulsing dot indicator and subtitle
- Main SVG: The diagram contained within a rounded border card
- Summary Cards: A grid of three cards below the diagram for high-level details
- Footer: Minimal metadata
Info Card Pattern
<div class="card">
<div class="card-header">
<div class="card-dot cyan"></div>
<h3>Title</h3>
</div>
<ul>
<li>• Item one</li>
<li>• Item two</li>
</ul>
</div>
Output Requirements
- Single File: One self-contained
.html file
- No External Dependencies: All CSS and SVG must be inline (except Google Fonts)
- No JavaScript: Use pure CSS for any animations (like pulsing dots)
- Compatibility: Must render correctly in any modern web browser
Template Reference
Load the full HTML template for the exact structure, CSS, and SVG component examples:
skill_view(name="architecture-diagram", file_path="templates/template.html")
The template contains working examples of every component type (frontend, backend, database, cloud, security), arrow styles (standard, dashed, curved), security groups, region boundaries, and the legend — use it as your structural reference when generating diagrams.
1---2name: architecture-diagram3description: Dark-themed SVG architecture/cloud/infra diagrams as HTML.4---5# Architecture Diagram Skill67Generate professional, dark-themed technical architecture diagrams as standalone HTML files with inline SVG graphics. No external tools, no API keys, no rendering libraries — just write the HTML file and open it in a browser.89## Scope1011**Best suited for:**12- Software system architecture (frontend / backend / database layers)13- Cloud infrastructure (VPC, regions, subnets, managed services)14- Microservice / service-mesh topology15- Database + API map, deployment diagrams16- Anything with a tech-infra subject that fits a dark, grid-backed aesthetic1718**Look elsewhere first for:**19- Physics, chemistry, math, biology, or other scientific subjects20- Physical objects (vehicles, hardware, anatomy, cross-sections)21- Floor plans, narrative journeys, educational / textbook-style visuals22- Hand-drawn whiteboard sketches (consider `excalidraw`)23- Animated explainers (consider an animation skill)2425If a more specialized skill is available for the subject, prefer that. If none fits, this skill can also serve as a general SVG diagram fallback — the output will just carry the dark tech aesthetic described below.2627Based on [Cocoon AI's architecture-diagram-generator](https://github.com/Cocoon-AI/architecture-diagram-generator) (MIT).2829## Workflow30311. User describes their system architecture (components, connections, technologies)322. Generate the HTML file following the design system below333. Save with `write_file` to a `.html` file (e.g. `~/architecture-diagram.html`)344. **If the user wants to view/share the diagram in chat (web console, WeCom / 企业微信, DingTalk, Feishu, Telegram, ...): call `render_html_image(filePath="<the .html path>", filename="<name>")`** and return the markdown link it produces. IM channels can only deliver rasterised images natively, so a PNG is required for the diagram to appear inline rather than as a dead link or a file attachment.355. Otherwise, the user opens the `.html` directly in a browser — works offline, no dependencies.3637### Output Location3839Save diagrams to a user-specified path, or default to the current working directory:40```41./[project-name]-architecture.html42```4344### Delivering through chat / IM channels4546When the current channel is anything other than a local browser session, follow up `write_file` with:4748```49render_html_image(filePath="./architecture-diagram.html", filename="architecture")50```5152This returns a `/api/v1/files/generated/<id>` URL with `image/png` MIME. The channel layer detects the image MIME and uploads the PNG as a native image message (so it renders inline in WeCom / DingTalk / Feishu / Telegram / Web). Without this step, an `.html` artifact reaches IM channels as either a dead markdown link or, at best, a non-previewable file attachment.5354### Local preview5556After saving, the user can open the `.html` directly:57```bash58# macOS59open ./my-architecture.html60# Linux61xdg-open ./my-architecture.html62```6364## Design System & Visual Language6566### Color Palette (Semantic Mapping)6768Use specific `rgba` fills and hex strokes to categorize components:6970| Component Type | Fill (rgba) | Stroke (Hex) |71| :--- | :--- | :--- |72| **Frontend** | `rgba(8, 51, 68, 0.4)` | `#22d3ee` (cyan-400) |73| **Backend** | `rgba(6, 78, 59, 0.4)` | `#34d399` (emerald-400) |74| **Database** | `rgba(76, 29, 149, 0.4)` | `#a78bfa` (violet-400) |75| **AWS/Cloud** | `rgba(120, 53, 15, 0.3)` | `#fbbf24` (amber-400) |76| **Security** | `rgba(136, 19, 55, 0.4)` | `#fb7185` (rose-400) |77| **Message Bus** | `rgba(251, 146, 60, 0.3)` | `#fb923c` (orange-400) |78| **External** | `rgba(30, 41, 59, 0.5)` | `#94a3b8` (slate-400) |7980### Typography & Background81- **Font:** JetBrains Mono (Monospace), loaded from Google Fonts82- **Sizes:** 12px (Names), 9px (Sublabels), 8px (Annotations), 7px (Tiny labels)83- **Background:** Slate-950 (`#020617`) with a subtle 40px grid pattern8485```svg86<!-- Background Grid Pattern -->87<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">88 <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>89</pattern>90```9192## Technical Implementation Details9394### Component Rendering95Components are rounded rectangles (`rx="6"`) with 1.5px strokes. To prevent arrows from showing through semi-transparent fills, use a **double-rect masking technique**:961. Draw an opaque background rect (`#0f172a`)972. Draw the semi-transparent styled rect on top9899### Connection Rules100- **Z-Order:** Draw arrows *early* in the SVG (after the grid) so they render behind component boxes101- **Arrowheads:** Defined via SVG markers102- **Security Flows:** Use dashed lines in rose color (`#fb7185`)103- **Boundaries:**104 - *Security Groups:* Dashed (`4,4`), rose color105 - *Regions:* Large dashed (`8,4`), amber color, `rx="12"`106107### Spacing & Layout Logic108- **Standard Height:** 60px (Services); 80-120px (Large components)109- **Vertical Gap:** Minimum 40px between components110- **Message Buses:** Must be placed *in the gap* between services, not overlapping them111- **Legend Placement:** **CRITICAL.** Must be placed outside all boundary boxes. Calculate the lowest Y-coordinate of all boundaries and place the legend at least 20px below it.112113## Document Structure114115The generated HTML file follows a four-part layout:1161. **Header:** Title with a pulsing dot indicator and subtitle1172. **Main SVG:** The diagram contained within a rounded border card1183. **Summary Cards:** A grid of three cards below the diagram for high-level details1194. **Footer:** Minimal metadata120121### Info Card Pattern122```html123<div class="card">124 <div class="card-header">125 <div class="card-dot cyan"></div>126 <h3>Title</h3>127 </div>128 <ul>129 <li>• Item one</li>130 <li>• Item two</li>131 </ul>132</div>133```134135## Output Requirements136- **Single File:** One self-contained `.html` file137- **No External Dependencies:** All CSS and SVG must be inline (except Google Fonts)138- **No JavaScript:** Use pure CSS for any animations (like pulsing dots)139- **Compatibility:** Must render correctly in any modern web browser140141## Template Reference142143Load the full HTML template for the exact structure, CSS, and SVG component examples:144145```146skill_view(name="architecture-diagram", file_path="templates/template.html")147```148149The template contains working examples of every component type (frontend, backend, database, cloud, security), arrow styles (standard, dashed, curved), security groups, region boundaries, and the legend — use it as your structural reference when generating diagrams.