Business Architecture Diagram Skill V3
This skill generates high-quality, layered system architecture diagrams in multiple export formats (PNG, SVG, HTML, PPTX) using Python Pillow, with enhanced Chinese font support and clear visual hierarchy.
Key Features
- Multi-format Export: PNG (raster), SVG (vector), HTML (interactive), PPTX (editable slides)
- Enhanced Chinese Support: Auto-detects system fonts (Microsoft YaHei, PingFang SC, WenQuanYi, etc.)
- Clear Visual Hierarchy: Layer badges (L1-L5), icons, flow labels, legends
- Interactive HTML: Hover tooltips, clickable modules, responsive layout
- Editable PPTX: Native PowerPoint output via PptxGenJS
Visual Style Specification
Color Scheme
- Background:
#F0F7FF (Light blue, professional and clean)
- Card Background:
#FFFFFF (Pure white, content highlight)
- Header Bar:
#4A90D9 (Business blue, for module titles)
- Accent:
#2E5C8A (Deep blue, for important modules or sidebars)
- Border:
#D0D8E0 (Light gray-blue, thin outline)
- Arrows/Lines:
#5B9BD5 (Medium blue, directional indicators)
- Text:
#333333 (Primary), #666666 (Secondary)
- Group Box: Dashed border
#A0B4C8, light blue fill #E8F1FA
- Layer Badge:
#4A90D9 with gradient per layer (L1-L5)
- Sidebar:
#2E5C8A dark blue background, #1E3A5F header
Graphic Elements
- Cards: Rounded rectangles, 8px radius, 1px border, subtle shadow (2px offset)
- Header Bar: Top color block of card, ~30px height, white text + icon
- Group Box: Dashed rounded rectangle wrapping each layer, with layer badge and name
- Layer Badge: "L1"-"L5" numbered badge at top-left of each layer group
- Icons: Business-style glyph icons in card headers
- Flow Labels: Small rounded labels on connection lines describing data flow
Connection Lines
- Solid Arrows: Main flow/data direction, 2px width, 8px arrowhead, with flow label
- Dashed Arrows: Auxiliary connections/monitoring flow, dash pattern (6, 3), 1px width
- Color:
#5B9BD5 solid, #A0B4C8 dashed
- Labels: White background pill with blue text on midpoint of connection
Layout Principles
小葱技能7w4.net有完整的技能分类。
- Compact: Minimize whitespace, module spacing 16-20px
- Hierarchical: Top-to-bottom layer arrangement with numbered badges (L1, L2, L3...)
- Aligned: Grid alignment, auto-calculated card widths based on module count
- Grouped: Each layer wrapped in dashed group box with layer number badge and name
- Sidebar: Optional right sidebar for cross-cutting concerns (security, monitoring, etc.)
- Legend: Bottom-left corner with visual explanations of line types and symbols
Fonts
- Chinese: Microsoft YaHei (
msyh.ttc) or SimHei (simhei.ttf)
- English/Numbers: Arial or Segoe UI
- Title: 22px bold, dark text with underline accent
- Subtitle: 13px, gray-blue
- Card Header: 13px bold, white on color block
- Body Items: 11px, regular, dark text with bullet points
- Layer Name: 12px bold, accent color
- Flow Labels: 10px, blue text
Available Icon Types
| Icon Type |
Use Case |
user |
User-facing modules (student, teacher, admin portals) |
monitor |
Dashboard, management console, display endpoints |
server |
Infrastructure components (databases, cache, storage) |
brain |
AI/ML modules (NLP, analysis, intelligence) |
database |
Data stores, data platforms, repositories |
shield |
Security, compliance, protection modules |
gear |
Engine, processing, configuration modules |
cloud |
Cloud services, external APIs |
chart |
Reporting, analytics, visualization |
link |
Integration, connection, communication modules |
mobile |
Mobile app, mobile-specific modules |
api |
API gateway, API management |
lock |
Authentication, authorization, access control |
mail |
Notification, messaging, email services |
Export Formats
PNG (Raster Image)
- Best for: Embedding in documents, presentations, websites
- Resolution: 150 DPI, configurable canvas size
- Features: Full visual effects (shadows, gradients, anti-aliasing)
SVG (Vector Graphics)
- Best for: Scalable output, print, further editing in Illustrator/Figma
- Features: Clean vector paths, editable in design tools
- Limitations: Simplified effects compared to PNG
HTML (Interactive)
- Best for: Web display, interactive exploration, sharing via browser
- Features:
- Hover tooltips showing module names
- Clickable module cards
- Responsive container layout
- CSS animations on hover
- Output: Single self-contained HTML file
PPTX (PowerPoint)
- Best for: Business presentations, editable slides
- Requirements: Node.js + PptxGenJS (
npm install pptxgenjs)
- Features: Native PowerPoint shapes, editable text, theme colors
- Fallback: If Node.js unavailable, generates JS template for manual execution
JSON Config Format
{
"title": "System Architecture Title",
"subtitle": "English Subtitle",
"width": 1800,
"height": 1300,
"layers": [
{
"name": "Layer Name",
"modules": [
{
"name": "Module Name",
"icon": "brain",
"items": ["Feature 1", "Feature 2", "Feature 3"]
}
]
}
],
"connections": [
{
"from": "Module A",
"to": "Module B",
"style": "solid",
"label": "Data Flow Description"
}
],
"sidebar": {
"title": "Sidebar Title",
"icon": "shield",
"items": [
{
"name": "Category Name",
"items": ["Sub-item 1", "Sub-item 2"]
}
]
},
"legend": [
{"type": "solid", "label": "Data Flow", "color": "#5B9BD5"},
{"type": "dashed", "label": "Auxiliary Connection", "color": "#A0B4C8"},
{"type": "badge", "label": "Layer Number", "color": "#4A90D9"},
{"type": "rect", "label": "Module", "color": "#E8F1FA"}
]
}
Usage
Python API
from generate_arch_v3 import generate_all, generate_png, generate_svg, generate_html, generate_pptx
# Generate all formats at once
results = generate_all(config, "output_path", formats=['png', 'svg', 'html', 'pptx'])
# Or generate individual formats
generate_png(config, "output.png")
generate_svg(config, "output.svg")
generate_html(config, "output.html")
generate_pptx(config, "output.pptx") # Requires Node.js + PptxGenJS
As Skill Invocation
When user requests an architecture diagram, follow these steps:
- Understand Requirements: Clarify the system/business process to display
- Design Structure: Plan layers (typically 4-6), modules per layer, sidebar, and connections
- Choose Icons: Select appropriate icon types for each module
- Define Connections: Map data flow between layers with descriptive labels
- Add Legend: Include visual legend for line types and symbols
- Generate Image: Use Python script following the visual specification
- Deliver Result: Return generated file paths for all requested formats
Key Design Rules
- Layer count: 4-6 layers is optimal; each layer should have 3-6 modules
- Module items: 2-5 items per module; keep descriptions concise (2-6 Chinese characters)
- Connections: Connect modules across adjacent layers; add descriptive flow labels
- Sidebar: Use for cross-cutting concerns (security, monitoring, DevOps)
- Canvas size: 1600x1200 for simple diagrams; 1800x1300 for complex ones
- Always include: Title, subtitle, layer badges, flow labels, and legend
Chinese Font Support
The script auto-detects available Chinese fonts in this priority order:
Windows: Microsoft YaHei > SimHei > SimSun > KaiTi > FangSong
macOS: PingFang SC > STHeiti > Hiragino Sans GB > Arial Unicode
Linux: WenQuanYi Micro Hei > Droid Sans Fallback > Noto Sans CJK > DejaVu Sans
If no Chinese font is found, falls back to system default. To verify font detection:
from generate_arch_v3 import get_font_info
print(get_font_info()) # Shows detected font family and path
Dependencies
- Python: Pillow (
pip install Pillow)
- PPTX export: Node.js + PptxGenJS (
npm install pptxgenjs)
- Fonts: System Chinese fonts (auto-detected)
Example Scenarios
- E-commerce system architecture
- Microservices architecture
- Data platform architecture
- AI platform architecture
- Business process flowchart
- Network topology diagram
- Cloud-native architecture
- Education technology system
- Healthcare information system
- Financial technology platform
Notes
- Ensure Pillow is installed:
pip install Pillow
- Chinese text requires system font support (auto-detected)
- Increase canvas size when there are many modules
- Keep hierarchy clear, avoid too many crossing lines
- Compact layout but not crowded, ensure readability
- For PPTX export, install Node.js and run
npm install pptxgenjs first
- HTML output is self-contained and can be opened directly in browser
- SVG output can be imported into Figma, Illustrator, or other design tools