SVG Architecture Diagram

v1.2.0

Create professional, publication-quality technical architecture diagrams using pure SVG in HTML, then screenshot via Playwright. Produces crisp, pixel-perfec...

0· 76·0 current·0 all-time
byGarming@wujiaming88

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wujiaming88/svg-architecture-diagram.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "SVG Architecture Diagram" (wujiaming88/svg-architecture-diagram) from ClawHub.
Skill page: https://clawhub.ai/wujiaming88/svg-architecture-diagram
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install svg-architecture-diagram

ClawHub CLI

Package manager switcher

npx clawhub@latest install svg-architecture-diagram
Security Scan
Capability signals
Crypto
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match delivered artifacts: SVG patterns, example HTMLs, design-system reference and a screenshot helper script. All requested capabilities (rendering SVG and taking high-res screenshots) are justified by the skill's purpose.
Instruction Scope
SKILL.md stays on-topic: it instructs authors to produce an HTML file with inline SVG and to render it locally via Playwright or the bundled script. It does not instruct reading credentials, system-wide config, or exfiltrating data. The only external resource referenced is Google Fonts in the example HTML.
Install Mechanism
There is no install spec (instruction-only + small script). The included Python script uses Playwright and optionally Pillow; the script's ImportError message instructs the user to install them. Playwright will download browser binaries when the user runs 'playwright install chromium' — this is expected and not from an unknown host. No downloads from personal servers or URL-shorteners are present.
Credentials
The skill requests no environment variables or credentials. The script works with local file:// paths and writes a local PNG — this is proportionate to its stated function.
Persistence & Privilege
Skill does not request always:true; it is user-invocable and does not modify other skills or global agent config. It only operates on local files and produces local output.
Assessment
This skill appears coherent and focused on producing SVG diagrams and screenshots. Before running: (1) inspect any HTML you render for external URLs (examples import Google Fonts via https://fonts.googleapis.com), (2) install Playwright and run 'playwright install chromium' — note that installs browser binaries from upstream, and (3) run the included script on local files in a safe directory (it loads file:// paths and writes PNGs locally). If you're running the agent autonomously, be aware Playwright will fetch remote resources referenced by the HTML; otherwise there are no hidden endpoints or credential requests.

Like a lobster shell, security has layers — review code before you run it.

latestvk977ffat0tphkc7hhs38qspaqd85gndj
76downloads
0stars
3versions
Updated 3d ago
v1.2.0
MIT-0

SVG Architecture Diagram

Create professional technical architecture diagrams using pure SVG, rendered to high-res PNG via Playwright.

Why SVG (not CSS positioning or AI image generation)

ApproachLines/ArrowsText QualityPrecision
SVG (this skill)✅ Perfect: <line>, <path>, <marker>✅ Crisp at any size✅ Pixel-perfect
CSS absolute positioning❌ Hacky: borders, pseudo-elements✅ OK❌ Hard to align
AI image generation❌ No control❌ Garbled text❌ No precision

Quick Start

Step 1: Plan the diagram

Identify:

  • Modules — group related components (color-coded)
  • Hierarchy — top-to-bottom flow (user → core → subsystems → output)
  • Connections — data flow (solid lines), feedback (dashed lines)

Step 2: Create the HTML file

Write a single HTML file with an inline SVG. Standard canvas: 1600×1000px.

<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
body { width: 1600px; height: 1000px; background: #fafafa; overflow: hidden; }
</style>
</head><body>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 1000" width="1600" height="1000">
  <defs>
    <!-- Arrow markers — one per color -->
    <marker id="arr-indigo" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
      <path d="M0,0 L8,3 L0,6 Z" fill="#6366f1"/>
    </marker>
    <!-- Shadow filter -->
    <filter id="shadow" x="-4%" y="-4%" width="108%" height="108%">
      <feDropShadow dx="0" dy="2" stdDeviation="4" flood-color="#000" flood-opacity="0.08"/>
    </filter>
  </defs>

  <!-- Diagram content here -->

</svg>
</body></html>

Step 3: Build the diagram using these SVG patterns

Filled header card (module title):

<rect x="X" y="Y" width="W" height="40" rx="10" fill="#6366f1" filter="url(#shadow)"/>
<text x="CENTER" y="Y+25" text-anchor="middle" font-size="13" font-weight="700" fill="#fff">🔄 Module Name</text>

Outlined detail card (sub-component):

<rect x="X" y="Y" width="W" height="65" rx="10" fill="#fff" stroke="#6366f1" stroke-width="2" filter="url(#shadow)"/>
<text x="X+20" y="Y+22" font-size="12" font-weight="700" fill="#6366f1">Component Title</text>
<text x="X+20" y="Y+40" font-size="11" fill="#6b7280">Description line 1</text>
<text x="X+20" y="Y+55" font-size="10" fill="#9ca3af">Metadata / specs</text>

Connection line (with arrow):

<line x1="FROM_X" y1="FROM_Y" x2="TO_X" y2="TO_Y" stroke="#6366f1" stroke-width="2" marker-end="url(#arr-indigo)"/>

Curved connection (L-shape or bend):

<path d="M startX,startY L midX,midY L endX,endY" stroke="#6366f1" stroke-width="2" fill="none" marker-end="url(#arr-indigo)"/>

Dashed feedback line:

<path d="M x1,y1 L x2,y2" stroke="#8b5cf6" stroke-width="2" fill="none" stroke-dasharray="6,4" marker-end="url(#arr-purple)"/>

Connection label:

<text x="MID_X" y="MID_Y-5" font-size="10" fill="#6366f1" font-weight="500">label text</text>

Step 4: Screenshot with Playwright

from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page(
        viewport={"width": 1600, "height": 1000},
        device_scale_factor=4,  # 4x ultra-high res (default)
    )
    page.goto("file:///path/to/diagram.html", wait_until="networkidle")
    page.wait_for_timeout(1500)
    page.screenshot(path="diagram.png", full_page=True)
    browser.close()

Or use the bundled script: scripts/screenshot.py <input.html> [output.png]

Design System

See references/design-system.md for the complete color palette, card styles, arrow markers, and text sizing rules.

Critical Rules (prevent common issues)

Text Overflow Prevention

  1. Max characters per line at font-size 11px ≈ 7px/char:
    • 300px container → max 37 chars
    • 340px container → max 43 chars
    • 440px container → max 57 chars
  2. Long text → split into multiple <text> elements with Y offset +15px each
  3. Always leave 20px padding on each side of text inside cards
  4. Test at 1x scale before generating final 4x screenshot

Connection Line Rules

  1. Never use CSS for connections — always SVG <line> or <path>
  2. One <marker> per color — define in <defs>, reference with marker-end
  3. Straight lines when possible; use <path> L-segments for bends
  4. Avoid crossing lines — rearrange layout if lines would cross
  5. Label every connection — brief verb/noun near the midpoint
  6. ⚠️ Minimum 20px gap between vertically stacked cards — Arrow markers are 8px long. If the gap between cards is less than 20px, the arrow will completely cover the line, making it look like "arrow only, no line". Use card height 34px + gap 22px = 56px per step.
  7. Connection line length must be at least 17px — This ensures 9px visible line + 8px arrow marker. Example: card bottom at y=324, next card top at y=346, line from y1=324 to y2=343 (19px).
  8. Never make line length < marker size (8px) — The line will be invisible.

Layout Rules

  1. Top-to-bottom primary flow (input at top, output at bottom/right)
  2. Left-right symmetry when possible
  3. Group related modules vertically (e.g., memory layers stacked)
  4. Minimum 20px gap between vertically stacked cards (see Connection Line Rules)
  5. Color-code by function — see design system for standard palette
  6. Include a legend (bottom-right corner) explaining colors and line types
  7. Include a title (top center) and source attribution (bottom center)

Font Rules

  1. Font family: font-family="Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif" — set on root <svg> or first <text>
  2. Load Inter via Google Fonts in <style> block
  3. Chinese text: use PingFang SC / Microsoft YaHei fallback
  4. Font sizes: titles 13-14px, descriptions 10-11px, metadata 9-10px

Examples

Two complete working examples are included:

  • references/example-hermes.html — Hermes Agent architecture (6 modules, medium complexity)
  • references/example-openclaw.html — OpenClaw platform architecture (12 modules, high complexity, demonstrates proper vertical card spacing for Agent Loop steps)

Delivery

Output MEDIA:<path> for inline delivery, or openclaw message send --channel telegram --target <id> --media <path> --force-document for Telegram.

If PNG exceeds ~1MB for Telegram delivery, convert to JPEG (quality=95):

from PIL import Image
img = Image.open("diagram.png")
img.save("diagram.jpg", "JPEG", quality=95, optimize=True)

Default is 4x (6400×4000px for 1600×1000 canvas). Always use maximum resolution.

Comments

Loading comments...