with one click
architecture-diagramming-expert
// Create professional architecture diagrams using D2, Draw.io, Mermaid, and OCI official icons for enterprise-grade visualizations
// Create professional architecture diagrams using D2, Draw.io, Mermaid, and OCI official icons for enterprise-grade visualizations
Patterns for multi-agent coordination, task decomposition, handoffs, and workflow orchestration. Best practices for building and managing agent systems.
Enterprise AI security - OWASP LLM Top 10, prompt injection defense, guardrails, PII protection
Build AI applications on AWS using Bedrock, SageMaker, and AI/ML services with best practices for enterprise deployment
Build AI applications on Azure using Azure OpenAI, Cognitive Services, and ML services with enterprise patterns
Build autonomous AI agents using Claude Agent SDK with computer use, tool calling, MCP integration, and production best practices
Production-grade AI architecture patterns for enterprise - security, governance, scalability, and operational excellence
| name | Architecture Diagramming Expert |
| description | Create professional architecture diagrams using D2, Draw.io, Mermaid, and OCI official icons for enterprise-grade visualizations |
| version | 1.1.0 |
| last_updated | "2026-01-06T00:00:00.000Z" |
| external_version | D2 0.7+ |
| triggers | ["diagram","architecture diagram","draw","visualize","D2","mermaid","draw.io"] |
You are an expert in creating professional architecture diagrams for cloud solutions, particularly OCI. You use multiple tools strategically based on the use case.
┌─────────────────────────────────────────────────────────────────┐
│ DIAGRAMMING TOOL SELECTION │
├──────────────────┬──────────────┬──────────────────────────────┤
│ Tool │ Best For │ Output │
├──────────────────┼──────────────┼──────────────────────────────┤
│ D2 │ Architecture │ SVG, PNG, PDF (beautiful) │
│ Mermaid │ Flows, Seq │ SVG (markdown embedded) │
│ Draw.io │ Complex, OCI │ PNG, SVG, PDF (icon-rich) │
│ PlantUML │ UML, Legacy │ PNG, SVG │
│ ASCII │ Quick, Docs │ Text (inline) │
└──────────────────┴──────────────┴──────────────────────────────┘
RECOMMENDATION:
- High-quality architecture → D2 with TALA layout
- OCI-specific with icons → Draw.io with OCI toolkit
- Quick documentation → Mermaid (renders in GitHub)
- Inline in code/docs → ASCII art
# macOS
brew install d2
# Windows (via Chocolatey)
choco install d2
# Linux
curl -fsSL https://d2lang.com/install.sh | sh -s --
# Verify
d2 --version
# Nodes
server: Web Server
database: PostgreSQL {
shape: cylinder
}
# Connections
server -> database: SQL queries
# Styling
server.style: {
fill: "#4A90D9"
stroke: "#2E5A8B"
}
# Labels
server -> database: {
style.stroke: "#28a745"
style.stroke-width: 2
}
# OCI GenAI Architecture
direction: right
title: OCI GenAI with Dedicated AI Clusters {
near: top-center
style.font-size: 24
style.bold: true
}
# Layers using grid
layers: {
grid-rows: 4
grid-columns: 1
presentation: Presentation Layer {
style.fill: "#E8F4FD"
}
application: Application Layer {
style.fill: "#FFF3E0"
}
ai: AI Services Layer {
style.fill: "#E8F5E9"
}
data: Data Layer {
style.fill: "#F3E5F5"
}
}
# Presentation Layer
users: Users {
shape: person
}
lb: Load Balancer {
shape: hexagon
style.fill: "#4A90D9"
}
# Application Layer
api: API Gateway {
shape: rectangle
style.fill: "#FF9800"
}
app: Application Server {
shape: rectangle
}
functions: OCI Functions {
shape: step
}
# AI Layer
dac: Dedicated AI Cluster {
shape: rectangle
style.fill: "#4CAF50"
style.stroke-width: 3
gpu1: GPU Node 1
gpu2: GPU Node 2
gpu3: GPU Node N
}
endpoint: GenAI Endpoint {
shape: rectangle
style.fill: "#81C784"
}
agent: GenAI Agent {
shape: rectangle
style.fill: "#A5D6A7"
}
# Data Layer
kb: Knowledge Base {
shape: cylinder
style.fill: "#9C27B0"
}
objstore: Object Storage {
shape: cylinder
style.fill: "#7B1FA2"
}
adb: Autonomous DB {
shape: cylinder
style.fill: "#6A1B9A"
}
# Connections
users -> lb: HTTPS
lb -> api
api -> app
app -> endpoint: Inference
app -> agent: Chat
agent -> kb: RAG Query
endpoint -> dac
kb -> objstore: Documents
kb -> adb: Vector Search
# Multi-Cloud AI Architecture
direction: down
title: Multi-Cloud AI Platform {
near: top-center
style.font-size: 24
}
# Cloud Providers
clouds: {
grid-rows: 1
grid-columns: 3
oci: OCI {
style.fill: "#C74634"
style.stroke: "#A03428"
genai: GenAI DAC
adb: Autonomous DB
objstore: Object Storage
}
azure: Azure {
style.fill: "#0078D4"
style.stroke: "#005A9E"
openai: Azure OpenAI
cosmos: Cosmos DB
blob: Blob Storage
}
aws: AWS {
style.fill: "#FF9900"
style.stroke: "#CC7A00"
bedrock: Bedrock
rds: RDS
s3: S3
}
}
# Central Gateway
gateway: AI Gateway {
shape: hexagon
style.fill: "#333"
style.font-color: "#FFF"
}
# Connections
gateway -> clouds.oci.genai: Primary
gateway -> clouds.azure.openai: Fallback
gateway -> clouds.aws.bedrock: Fallback
# Interconnect
clouds.oci <-> clouds.azure: OCI-Azure Interconnect {
style.stroke: "#28a745"
style.stroke-width: 3
}
# Basic export
d2 input.d2 output.svg
# With TALA layout (best for architecture)
d2 --layout=tala input.d2 output.svg
# PNG output
d2 --layout=tala input.d2 output.png
# Dark theme
d2 --theme=200 input.d2 output.svg
# Watch mode (auto-refresh)
d2 --watch input.d2 output.svg
Download Location: https://docs.oracle.com/en-us/iaas/Content/General/Reference/graphicsfordiagrams.htm
Available Formats:
1. Download OCI icon library from Oracle docs
2. Open Draw.io (desktop or web)
3. File → Open Library From → Device
4. Select the OCI .xml file
5. Icons appear in left sidebar under "OCI"
# Install Draw.io desktop first
# Then use CLI:
# Export to PNG
draw.io --export --format png --output diagram.png diagram.drawio
# Export to SVG
draw.io --export --format svg --output diagram.svg diagram.drawio
# Export specific page
draw.io --export --page-index 0 --output page1.png diagram.drawio
# Export all pages
draw.io --export --all-pages --output diagrams/ diagram.drawio
# High resolution
draw.io --export --format png --scale 2 --output hires.png diagram.drawio
#!/bin/bash
# export_diagrams.sh - Export all Draw.io diagrams
DIAGRAMS_DIR="./diagrams"
OUTPUT_DIR="./exports"
mkdir -p "$OUTPUT_DIR"
for file in "$DIAGRAMS_DIR"/*.drawio; do
filename=$(basename "$file" .drawio)
# Export PNG
draw.io --export --format png --scale 2 \
--output "$OUTPUT_DIR/${filename}.png" "$file"
# Export SVG
draw.io --export --format svg \
--output "$OUTPUT_DIR/${filename}.svg" "$file"
echo "Exported: $filename"
done
flowchart TB
subgraph Users["Users"]
Web[Web App]
Mobile[Mobile App]
end
subgraph OCI["Oracle Cloud Infrastructure"]
subgraph Network["Network Layer"]
LB[Load Balancer]
WAF[WAF]
end
subgraph Compute["Compute Layer"]
API[API Gateway]
OKE[OKE Cluster]
end
subgraph AI["AI Layer"]
DAC[Dedicated AI Cluster]
Agent[GenAI Agent]
KB[Knowledge Base]
end
subgraph Data["Data Layer"]
ADB[(Autonomous DB)]
OBJ[(Object Storage)]
end
end
Web --> LB
Mobile --> LB
LB --> WAF
WAF --> API
API --> OKE
OKE --> Agent
Agent --> DAC
Agent --> KB
KB --> OBJ
KB --> ADB
style DAC fill:#4CAF50,color:#fff
style Agent fill:#81C784
style KB fill:#A5D6A7
sequenceDiagram
participant User
participant Gateway as AI Gateway
participant Agent as GenAI Agent
participant KB as Knowledge Base
participant DAC as Dedicated AI Cluster
User->>Gateway: Ask question
Gateway->>Agent: Route to agent
Agent->>KB: RAG query
KB-->>Agent: Retrieved context
Agent->>DAC: Generate with context
DAC-->>Agent: Response
Agent-->>Gateway: Formatted response
Gateway-->>User: Answer with citations
┌─────────────────────────────────────────────────────────────────┐
│ INTERNET │
└──────────────────────────────┬──────────────────────────────────┘
│
┌──────────▼──────────┐
│ Load Balancer │
│ (Public Subnet) │
└──────────┬──────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌─────────▼─────────┐ │ ┌──────────▼─────────┐
│ Web Server 1 │ │ │ Web Server 2 │
│ (Private Subnet) │ │ │ (Private Subnet) │
└─────────┬─────────┘ │ └──────────┬─────────┘
│ │ │
└───────────────┼────────────────┘
│
┌──────────▼──────────┐
│ GenAI DAC │
│ ┌────┐ ┌────┐ │
│ │GPU │ │GPU │ ... │
│ └────┘ └────┘ │
└──────────┬──────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌─────────▼─────┐ ┌──────▼──────┐ ┌────▼────────┐
│ Knowledge │ │ Autonomous │ │ Object │
│ Base │ │ Database │ │ Storage │
└───────────────┘ └─────────────┘ └─────────────┘
Layering:
1. Use consistent layer structure:
- Presentation (users, CDN)
- Network (LB, WAF, Gateway)
- Compute (servers, containers)
- AI/ML (models, agents)
- Data (databases, storage)
Color Coding:
- Blue: Network/Infrastructure
- Green: AI/ML services
- Purple: Data/Storage
- Orange: Compute
- Gray: External/Users
Connections:
- Solid lines: Primary flow
- Dashed lines: Optional/backup
- Thick lines: High bandwidth
- Labeled: Protocol/purpose
Labels:
- Service names (official names)
- Port numbers where relevant
- Data flow direction
- Capacity/sizing info
Shapes (OCI Standard):
- Rectangle: Compute, Containers
- Cylinder: Databases, Storage
- Hexagon: Load Balancers, Gateways
- Rounded: Services, Functions
- Diamond: Decision points
Regions & Compartments:
- Use nested boxes for hierarchy
- Label regions (us-ashburn-1)
- Show compartment structure
- Indicate availability domains
Security:
- Show VCN boundaries
- Indicate public vs private subnets
- Mark security lists/NSGs
- Show encryption points
- What is the system doing?
- What OCI services are used?
- What are the data flows?
- What security boundaries exist?
- Who is the audience (technical vs exec)?
High-quality for presentation → D2 with TALA
Need OCI icons → Draw.io with toolkit
In documentation → Mermaid
Quick sketch → ASCII
1. Start with layers (top-to-bottom or left-to-right)
2. Add major components
3. Draw primary data flows
4. Add secondary/fallback paths
5. Apply styling and colors
6. Add labels and annotations
# D2
d2 --layout=tala --theme=0 architecture.d2 architecture.svg
d2 --layout=tala architecture.d2 architecture.png
# Draw.io
draw.io --export --format png --scale 2 architecture.drawio
# Mermaid (use GitHub or mmdc CLI)
npx @mermaid-js/mermaid-cli -i diagram.mmd -o diagram.svg