Skip to main content

Diagram Style Guide — ByteByteGo-Inspired

Version: 1.0 Based on: ByteByteGo system design visual language + CLAUDE.md palette Applies to: All Cloud Aegis architecture diagrams (Figma + Mermaid SVG)


[+] Color Palette

Layer Semantics

LayerHexRGB (0-1)Use
Portal / Frontend#3b82f60.231, 0.510, 0.965User-facing UI layers
API Gateway#1e40af0.118, 0.251, 0.686Request routing, auth, rate limiting
Core Engines#7c3aed0.486, 0.227, 0.929Business logic, scoring, dispatch
Risk / Security#dc26260.863, 0.149, 0.149Threat intel, vulnerability, breach
Policy / Governance#f59e0b0.961, 0.620, 0.043OPA, guardrails, compliance
FinOps / Cost#22c55e0.133, 0.773, 0.369Cost aggregation, budgets, alerts
Infrastructure#64748b0.392, 0.455, 0.545Storage, compute, cloud APIs

Accent Colors

PurposeHexUse
Async / Queues#ec4899Dashed arrows, event-driven paths
DR / Failover#ef4444Failover paths, disaster recovery
Success / Pass#22c55eThreshold pass, healthy state
Warning#f59e0bThreshold warn, degraded state
Labels / Metadata#6b7280Subtitle text, secondary info
Background (dark)#0f172aMain frame background
Card fillrgba(255,255,255,0.08)Node card background

[+] Typography

ElementFontSizeWeightColor
Diagram titleSystem (Inter)28px700 (Bold)#ffffff
Layer titleSystem (Inter)16px700 (Bold)Layer color
Layer subtitleSystem (Inter)11px400 (Regular)#99a3b3
Node labelSystem (Inter)13px500 (Medium)#ffffff
Node metadataSystem (Inter)9px400 (Regular)#8c94a5

[+] Layout

Composition Patterns

PatternUseExample
Horizontal tiers (LR)System overview, data flowarchitecture.mmd
Vertical tiers (TD)Deep dives, sequence flowsfailover-sequence.mmd
Hub-spokeCentral engine with satellitesrisk-intelligence-pipeline.mmd

Spacing

ElementValue
Main frame padding40-140px
Layer frame width310px
Layer gap25px
Node card size260 x 50px
Node vertical spacing110-160px (varies by count)
Card internal padding15px left, 15px top
Metadata offsety+18px below label
Snap grid20px

Corner Radius

ElementRadius
Main frame16px
Layer subframe12px
Node card8px
Icon badge4px

[+] Icons

Sourcing Priority

  1. Official CSP icons (AWS/Azure/GCP) via icon-library MCP — 64px source, render at 32-36px
  2. Homelab icons (Terraform, Redis, Prometheus) — homelab-svg-assets/
  3. Figma primitives — diamond (queue), hexagon (cache), circle (endpoint)

Placement

PositionSizeUse
Layer header (top-right)36x36pxOne icon per layer representing its domain
Inside node card (left)24x24pxPer-component icon (ByteByteGo standard)
Standalone (diagram)48x48pxHero/focal point icons

Icon Mapping (Cloud Aegis)

ComponentIconProvider
API GatewayArch_Amazon-API-Gateway_64AWS
Auth / ShieldArch_AWS-Shield_64AWS
VulnerabilityArch_Amazon-Inspector_64AWS
Cost/FinOpsArch_AWS-Cost-Explorer_64AWS
Terraformterraform.svgHomelab
PostgreSQLAzure-Database-PostgreSQL-Server_64Azure
RedisCache-Redis_64Azure
WorkflowsArch_AWS-Express-Workflows_64AWS

[+] Connectors / Arrows

Line Styles

StyleStrokePatternUse
Sync API2px #94a3b8SolidREST calls, direct invocations
Async event2px #ec4899Dashed (5px/3px)Webhooks, queues, CDC
Optional path1.5px #6b7280Dotted (2px/4px)Fallback, optional enrichment
Failover2.5px #ef4444Dashed (8px/4px)DR paths, circuit breaker

Arrowheads

  • Standard: Filled triangle, 10px, same color as stroke
  • Bidirectional: Double arrowhead for two-way sync
  • No head: Plain line for association/grouping

Labels on Arrows

  • Font: 10px, centered above line, 6-8px offset
  • Color: #94a3b8 (same as line, or slightly lighter)
  • Content: Protocol or action (e.g., "REST", "gRPC", "webhook", "CDC")

[+] Node Card Anatomy

+------------------------------------------+
| [Icon 24x24] Service Name | <- 13px white, medium
| (implementation detail) | <- 9px #8c94a5, regular
+------------------------------------------+
8px corner radius
rgba(255,255,255,0.08) fill
260 x 50px

Two-Line Label Format

Primary Label           <- Title case, 13px
tech-stack, key-detail <- lowercase, 9px, gray

[+] Dark Theme vs Light Theme

PropertyDark (default)Light (BBG classic)
Background#0f172a#ffffff
Card fillrgba(255,255,255,0.08)#f5f5f5
Text primary#ffffff#1f2937
Text secondary#8c94a5#6b7280
Layer strokeLayer color @ 50% alphaLayer color @ 30% alpha
Arrow color#94a3b8#9ca3af

Default: Dark theme for portfolio, presentations, Figma. Use light theme for: README embeds, printed docs, high-contrast accessibility.


[+] Figma Workflow

Creating a New Diagram

  1. Create main frame — 2600x900 (LR) or 1200x1600 (TD), dark bg #0f172a, radius 16px
  2. Add title — 28px bold white, top-left with 40px margin
  3. Create layer subframes — 310px wide, layer color fill @ 15% alpha, stroke @ 50%, radius 12px
  4. Add layer titles — 16px bold in layer color, subtitle 11px gray
  5. Create node cards — 260x50, rgba(255,255,255,0.08), radius 8px
  6. Add labels — 13px white label + 9px gray metadata inside each card
  7. Place icons — Layer headers (36px) + node cards (24px) via icon-library MCP
  8. Draw arrows — SVG connectors between layers, varied styles per type
  9. Export — PNG @2x for Figma, SVG for README embedding

MCP Tool Sequence

icon-library:search_icons → icon-library:get_icon_svg → figma:create_from_svg
figma:create_frame (main) → create_frame (layers) → create_frame (cards)
figma:create_text (labels) → set_corner_radius → export_node_as_image

[+] Mermaid Alignment

When generating .mmd source files, use these theme variables to approximate the dark theme:

%%{init: {'theme': 'base', 'themeVariables': {
'fontFamily': 'Inter, system-ui, sans-serif',
'fontSize': '14px',
'primaryColor': '#3b82f6',
'primaryTextColor': '#fff',
'primaryBorderColor': '#1e3a8a',
'lineColor': '#64748b',
'secondaryColor': '#f59e0b',
'tertiaryColor': '#22c55e'
}}}%%

The Mermaid SVGs support CSS edge animation (stroke-dasharray + @keyframes dash) — these animate when viewed in browsers but not in GitHub <img> tags.


Document History

VersionDateChanges
1.02026-03-24Initial release — BBG style research + Cloud Aegis implementation