Diagrams Generator
Generate professional diagrams using the most suitable tool for each scenario.
工具选择矩阵
| 场景 |
推荐工具 |
速度 |
质量 |
安装成本 |
| 云架构图 (AWS/GCP/Azure/K8s) |
diagrams |
⚡ 快 |
★★★★ |
轻量 (~50MB) |
| 数据图表 (折线/柱状/饼图) |
matplotlib |
⚡ 快 |
★★★ |
轻量 |
| 统计图表 (热力图/分布图) |
seaborn |
⚡ 快 |
★★★★ |
轻量 |
| 交互式图表 (Web/3D) |
plotly |
⚡ 快 |
★★★★ |
轻量 |
| 流程图/状态机 |
graphviz |
⚡ 快 |
★★★ |
轻量 |
| 网络拓扑/关系图 |
networkx |
⚡ 快 |
★★★ |
轻量 |
| 学术论文图 (神经网络/模型架构) |
TikZ |
🐢 慢 |
★★★★★ |
重量 (~4GB) |
| 学术论文图 (快速替代) |
matplotlib |
⚡ 快 |
★★★ |
轻量 |
Prerequisites (按需安装)
基础工具 (大多数场景)
# Graphviz (diagrams 依赖)
brew install graphviz # macOS
apt-get install graphviz # Linux
# Python 库
pip install diagrams matplotlib seaborn plotly networkx
TikZ/LaTeX (学术论文级图表 - 可选)
# macOS - 完整安装 (~4GB, 10-15分钟)
brew install --cask mactex
# macOS - 轻量安装 (~500MB)
brew install --cask basictex
sudo tlmgr install tikz-cd pgfplots standalone
# Linux
apt-get install texlive-full # 完整版
# 或
apt-get install texlive-base texlive-pictures texlive-latex-extra # 轻量版
Workflow
Phase 1: Requirement Understanding & Tool Recommendation (MANDATORY)
⚠️ CRITICAL: You MUST complete ALL steps in Phase 1 and receive explicit user confirmation BEFORE proceeding to Phase 2. DO NOT skip this phase or generate code without confirmation.
Receive input: User provides text description and/or reference image
Identify Scenario: 根据用户描述中的关键词,识别场景类型:
| 检测关键词 |
场景判断 |
| 架构/系统/微服务/AWS/GCP/K8s |
→ 云架构图 |
| 数据/趋势/统计/柱状/折线/饼图 |
→ 数据图表 |
| 交互/动态/Web/仪表板 |
→ 交互图表 |
| 热力图/分布/相关性 |
→ 统计图表 |
| 流程/状态机/决策树 |
→ 流程图 |
| 网络/拓扑/节点/关系 |
→ 关系图 |
| 论文/学术/神经网络/模型架构 |
→ 学术图 |
Analyze and extract:
- Components (services, databases, users, layers, etc.)
- Groupings/Clusters (VPC, regions, logical groups, network layers)
- Connections and data flows
- Labels and annotations
⚠️ MANDATORY OUTPUT - 输出以下结构化内容:
你必须按照以下格式输出,缺一不可:
4.1 架构理解 - Natural language summary of the architecture
4.2 组件清单 - List all identified components by layer
4.3 连接关系 - Describe all connections and data flows
4.4 Mermaid 预览 - Provide Mermaid diagram code for quick visual preview
4.5 ⚠️ 工具选项表 (THIS IS REQUIRED - DO NOT SKIP)
根据识别的场景,你必须输出对应的完整工具选项表格:
场景: 云架构图 (AWS/GCP/Azure/K8s)
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
diagrams |
⚡ 快 |
★★★★ |
PNG/SVG |
云图标丰富,专业 |
| B |
graphviz |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
通用流程图风格 |
| C |
PlantUML |
⚡ 快 |
★★★ |
PNG/SVG |
需 Java 环境 |
💡 推荐: 方案 A (diagrams) - 专为云架构设计
场景: 数据图表 (折线/柱状/饼图/散点)
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
matplotlib |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
即开即用,最通用 |
| B |
plotly |
⚡ 快 |
★★★★ |
HTML/PNG |
交互式,可缩放 |
| C |
pyecharts |
⚡ 快 |
★★★★ |
HTML |
中文友好,样式丰富 |
💡 推荐: 静态图选 A,交互式选 B
场景: 学术论文图 (神经网络/模型架构/算法流程)
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
matplotlib |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
即开即用,适合初稿 |
| B |
TikZ/LaTeX |
🐢 慢 |
★★★★★ |
PDF/PNG |
首次需下载 500MB-4GB |
💡 推荐: 赶时间选 A,正式发表选 B
场景: 流程图/状态机/决策树
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
graphviz |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
专业流程图 |
| B |
mermaid-cli |
⚡ 快 |
★★★ |
PNG/SVG |
需 Node.js 环境 |
| C |
PlantUML |
⚡ 快 |
★★★ |
PNG/SVG |
需 Java 环境 |
💡 推荐: 方案 A (graphviz) - 无额外依赖
场景: 网络拓扑/关系图/知识图谱
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
networkx + matplotlib |
⚡ 快 |
★★★ |
PNG/SVG |
静态图,轻量 |
| B |
pyvis |
⚡ 快 |
★★★★ |
HTML |
交互式,可拖拽 |
| C |
graphviz |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
层次布局清晰 |
💡 推荐: 静态选 A,交互式选 B
场景: 统计图表 (热力图/分布图/相关性矩阵)
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
seaborn |
⚡ 快 |
★★★★ |
PNG/SVG/PDF |
统计图专用 |
| B |
matplotlib |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
更灵活,需手动配置 |
| C |
plotly |
⚡ 快 |
★★★★ |
HTML/PNG |
交互式热力图 |
💡 推荐: 方案 A (seaborn) - 统计可视化首选
MANDATORY CONFIRMATION - 你必须询问用户确认:
- 架构理解是否正确?
- 组件/连接是否需要增减?
- 请选择工具方案: [A] / [B] / [C]?(或使用推荐方案)
- ⚠️ DO NOT proceed to Phase 2 until user explicitly confirms AND chooses a tool
Required output format (MUST follow this structure):
## 1. 架构理解
我理解你需要的架构图包含以下内容:[简要描述]
## 2. 组件清单
- **用户层**: Business Analyst, Developer
- **应用层**: Cloud Run (wiki-interface, evaluator)
- **数据层**: Redis (Memorystore), Cloud SQL
## 3. 连接关系
- User → wiki-interface → evaluator
- evaluator → Redis (缓存)
## 4. Mermaid 预览
```mermaid
graph LR
User --> wiki[wiki-interface]
wiki --> eval[evaluator]
eval --> Redis
5. ⚠️ 工具选项表
检测到场景: 云架构图
| 方案 |
工具 |
速度 |
质量 |
输出格式 |
说明 |
| A |
diagrams |
⚡ 快 |
★★★★ |
PNG/SVG |
云图标丰富,专业 |
| B |
graphviz |
⚡ 快 |
★★★ |
PNG/SVG/PDF |
通用流程图风格 |
| C |
PlantUML |
⚡ 快 |
★★★ |
PNG/SVG |
需 Java 环境 |
💡 推荐: 方案 A (diagrams) - 专为云架构设计,图标更专业
请确认
- 架构理解是否正确?组件是否需要增减?
- 连接关系是否准确?
- 布局方向偏好(左右 LR / 上下 TB)?
- 请选择工具方案: [A] / [B] / [C]?(直接回复字母,或回复"用推荐")
确认后我将生成专业的架构图。
### Phase 2: Code Generation & Execution
After user confirms, generate Python code following these rules:
#### Output Configuration
```python
with Diagram(
"Diagram Name",
filename="./pic/{subfolder}/{name}", # Output to pic subdirectory
outformat=["png", "svg"], # Both formats
show=False, # Don't auto-open
direction="LR" # Left-to-right by default
):
Directory Setup
Before execution, ensure output directory exists:
import os
os.makedirs("./pic/{subfolder}", exist_ok=True)
Code Structure Template
from diagrams import Diagram, Cluster, Edge
# Import nodes based on cloud provider
# from diagrams.gcp.compute import Run, ComputeEngine
# from diagrams.aws.compute import EC2, Lambda
# from diagrams.k8s.compute import Pod, Deployment
import os
output_dir = "./pic/{diagram_name}"
os.makedirs(output_dir, exist_ok=True)
with Diagram(
"{Diagram Title}",
filename=f"{output_dir}/{diagram_name}",
outformat=["png", "svg"],
show=False,
direction="LR"
):
# Define clusters and nodes
with Cluster("Cluster Name"):
node1 = ServiceType("Label")
# Define connections
node1 >> Edge(label="description") >> node2
Phase 3: Save Code & Result Feedback
After execution:
- Save the Python source code to
./pic/{name}/{name}.py (same folder as generated images)
- Report generated file paths:
./pic/{name}/{name}.py (source code)
./pic/{name}/{name}.png
./pic/{name}/{name}.svg
- If errors occur, analyze and fix automatically
Node Import Reference
See references/diagrams-api.md for complete node import paths.
Quick Reference - Common Providers
| Provider |
Import Pattern |
Example |
| GCP |
diagrams.gcp.{category} |
from diagrams.gcp.compute import Run |
| AWS |
diagrams.aws.{category} |
from diagrams.aws.compute import EC2 |
| Azure |
diagrams.azure.{category} |
from diagrams.azure.compute import VM |
| K8s |
diagrams.k8s.{category} |
from diagrams.k8s.compute import Pod |
| Generic |
diagrams.generic.{category} |
from diagrams.generic.compute import Rack |
| On-Premise |
diagrams.onprem.{category} |
from diagrams.onprem.database import PostgreSQL |
Common Categories
compute: EC2, Run, Pod, VM
database: RDS, SQL, PostgreSQL, Redis
network: ELB, VPC, DNS, CDN
storage: S3, GCS, PersistentDisk
analytics: BigQuery, Dataflow
ml: SageMaker, VertexAI
security: IAM, KMS, WAF
client: User, Users, Client
扩展能力:多种 Python 绑图库支持
除了 diagrams 库用于架构图,本 Skill 支持根据用户需求动态选择合适的 Python 绘图库:
| 场景 |
推荐库 |
安装命令 |
适用场景 |
| 云架构图 |
diagrams |
pip install diagrams |
AWS/GCP/Azure/K8s 架构可视化 |
| 数据可视化 |
matplotlib |
pip install matplotlib |
折线图、柱状图、散点图、饼图等 |
| 统计图表 |
seaborn |
pip install seaborn |
高级统计图、热力图、分布图 |
| 交互式图表 |
plotly |
pip install plotly |
可交互的 Web 图表、3D 图 |
| 流程图/思维导图 |
graphviz |
pip install graphviz |
流程图、状态机、决策树 |
| 网络拓扑图 |
networkx + matplotlib |
pip install networkx |
网络关系图、图论可视化 |
| 甘特图/时序图 |
plotly / matplotlib |
- |
项目管理、时间线 |
Design Best Practices
- Use Clusters for logical grouping (VPC, Region, Service Group)
- Direction: Use
LR (left-right) for wide diagrams, TB (top-bottom) for tall ones
- Edge labels: Add
Edge(label="HTTP") for connection descriptions
- Consistent naming: Use clear, descriptive labels
- Color coding: Leverage built-in provider colors for visual distinction
输出格式指南
| 格式 |
适用场景 |
工具支持 |
| PNG |
通用展示、PPT、网页 |
所有工具 |
| SVG |
网页嵌入、可缩放 |
matplotlib, diagrams, plotly |
| PDF |
论文插图、打印 |
TikZ (原生), matplotlib |
| HTML |
交互式展示 |
plotly |
1---2name: diagrams-generator3description: Generate professional diagrams including cloud architecture, data charts, academic figures, and more. Triggers on requests like "画架构图", "画图表", "画论文插图", "生成系统图", "create diagram", "visualize data", "draw neural network", or when users provide a sketch/image they want to recreate professionally.4---56# Diagrams Generator78Generate professional diagrams using the most suitable tool for each scenario.910## 工具选择矩阵1112| 场景 | 推荐工具 | 速度 | 质量 | 安装成本 |13|------|---------|------|------|----------|14| 云架构图 (AWS/GCP/Azure/K8s) | `diagrams` | ⚡ 快 | ★★★★ | 轻量 (~50MB) |15| 数据图表 (折线/柱状/饼图) | `matplotlib` | ⚡ 快 | ★★★ | 轻量 |16| 统计图表 (热力图/分布图) | `seaborn` | ⚡ 快 | ★★★★ | 轻量 |17| 交互式图表 (Web/3D) | `plotly` | ⚡ 快 | ★★★★ | 轻量 |18| 流程图/状态机 | `graphviz` | ⚡ 快 | ★★★ | 轻量 |19| 网络拓扑/关系图 | `networkx` | ⚡ 快 | ★★★ | 轻量 |20| **学术论文图** (神经网络/模型架构) | `TikZ` | 🐢 慢 | ★★★★★ | 重量 (~4GB) |21| **学术论文图** (快速替代) | `matplotlib` | ⚡ 快 | ★★★ | 轻量 |2223## Prerequisites (按需安装)2425### 基础工具 (大多数场景)26```bash27# Graphviz (diagrams 依赖)28brew install graphviz # macOS29apt-get install graphviz # Linux3031# Python 库32pip install diagrams matplotlib seaborn plotly networkx33```3435### TikZ/LaTeX (学术论文级图表 - 可选)36```bash37# macOS - 完整安装 (~4GB, 10-15分钟)38brew install --cask mactex3940# macOS - 轻量安装 (~500MB)41brew install --cask basictex42sudo tlmgr install tikz-cd pgfplots standalone4344# Linux45apt-get install texlive-full # 完整版46# 或47apt-get install texlive-base texlive-pictures texlive-latex-extra # 轻量版48```4950## Workflow5152### Phase 1: Requirement Understanding & Tool Recommendation (MANDATORY)5354**⚠️ CRITICAL: You MUST complete ALL steps in Phase 1 and receive explicit user confirmation BEFORE proceeding to Phase 2. DO NOT skip this phase or generate code without confirmation.**55561. **Receive input**: User provides text description and/or reference image57582. **Identify Scenario**: 根据用户描述中的关键词,识别场景类型:59 60 | 检测关键词 | 场景判断 |61 |-----------|---------|62 | 架构/系统/微服务/AWS/GCP/K8s | → 云架构图 |63 | 数据/趋势/统计/柱状/折线/饼图 | → 数据图表 |64 | 交互/动态/Web/仪表板 | → 交互图表 |65 | 热力图/分布/相关性 | → 统计图表 |66 | 流程/状态机/决策树 | → 流程图 |67 | 网络/拓扑/节点/关系 | → 关系图 |68 | 论文/学术/神经网络/模型架构 | → 学术图 |69703. **Analyze and extract**:71 - Components (services, databases, users, layers, etc.)72 - Groupings/Clusters (VPC, regions, logical groups, network layers)73 - Connections and data flows74 - Labels and annotations75764. **⚠️ MANDATORY OUTPUT - 输出以下结构化内容**:7778 **你必须按照以下格式输出,缺一不可:**79 80 ---81 82 **4.1 架构理解** - Natural language summary of the architecture83 84 **4.2 组件清单** - List all identified components by layer85 86 **4.3 连接关系** - Describe all connections and data flows87 88 **4.4 Mermaid 预览** - Provide Mermaid diagram code for quick visual preview89 90 **4.5 ⚠️ 工具选项表 (THIS IS REQUIRED - DO NOT SKIP)**91 92 **根据识别的场景,你必须输出对应的完整工具选项表格:**93 94 ---95 96 **场景: 云架构图 (AWS/GCP/Azure/K8s)**97 98 | 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |99 |------|------|------|------|----------|------|100 | **A** | `diagrams` | ⚡ 快 | ★★★★ | PNG/SVG | 云图标丰富,专业 |101 | **B** | `graphviz` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 通用流程图风格 |102 | **C** | `PlantUML` | ⚡ 快 | ★★★ | PNG/SVG | 需 Java 环境 |103 104 **💡 推荐**: 方案 A (`diagrams`) - 专为云架构设计105 106 ---107 108 **场景: 数据图表 (折线/柱状/饼图/散点)**109 110 | 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |111 |------|------|------|------|----------|------|112 | **A** | `matplotlib` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 即开即用,最通用 |113 | **B** | `plotly` | ⚡ 快 | ★★★★ | HTML/PNG | 交互式,可缩放 |114 | **C** | `pyecharts` | ⚡ 快 | ★★★★ | HTML | 中文友好,样式丰富 |115 116 **💡 推荐**: 静态图选 A,交互式选 B117 118 ---119 120 **场景: 学术论文图 (神经网络/模型架构/算法流程)**121 122 | 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |123 |------|------|------|------|----------|------|124 | **A** | `matplotlib` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 即开即用,适合初稿 |125 | **B** | `TikZ/LaTeX` | 🐢 慢 | ★★★★★ | PDF/PNG | 首次需下载 500MB-4GB |126 127 **💡 推荐**: 赶时间选 A,正式发表选 B128 129 ---130 131 **场景: 流程图/状态机/决策树**132 133 | 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |134 |------|------|------|------|----------|------|135 | **A** | `graphviz` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 专业流程图 |136 | **B** | `mermaid-cli` | ⚡ 快 | ★★★ | PNG/SVG | 需 Node.js 环境 |137 | **C** | `PlantUML` | ⚡ 快 | ★★★ | PNG/SVG | 需 Java 环境 |138 139 **💡 推荐**: 方案 A (`graphviz`) - 无额外依赖140 141 ---142 143 **场景: 网络拓扑/关系图/知识图谱**144 145 | 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |146 |------|------|------|------|----------|------|147 | **A** | `networkx` + `matplotlib` | ⚡ 快 | ★★★ | PNG/SVG | 静态图,轻量 |148 | **B** | `pyvis` | ⚡ 快 | ★★★★ | HTML | 交互式,可拖拽 |149 | **C** | `graphviz` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 层次布局清晰 |150 151 **💡 推荐**: 静态选 A,交互式选 B152 153 ---154 155 **场景: 统计图表 (热力图/分布图/相关性矩阵)**156 157 | 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |158 |------|------|------|------|----------|------|159 | **A** | `seaborn` | ⚡ 快 | ★★★★ | PNG/SVG/PDF | 统计图专用 |160 | **B** | `matplotlib` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 更灵活,需手动配置 |161 | **C** | `plotly` | ⚡ 快 | ★★★★ | HTML/PNG | 交互式热力图 |162 163 **💡 推荐**: 方案 A (`seaborn`) - 统计可视化首选164 165 ---1661675. **MANDATORY CONFIRMATION** - 你必须询问用户确认:168 - 架构理解是否正确?169 - 组件/连接是否需要增减?170 - **请选择工具方案: [A] / [B] / [C]?(或使用推荐方案)**171 - **⚠️ DO NOT proceed to Phase 2 until user explicitly confirms AND chooses a tool**172173**Required output format (MUST follow this structure):**174175```markdown176## 1. 架构理解177178我理解你需要的架构图包含以下内容:[简要描述]179180## 2. 组件清单181182- **用户层**: Business Analyst, Developer183- **应用层**: Cloud Run (wiki-interface, evaluator)184- **数据层**: Redis (Memorystore), Cloud SQL185186## 3. 连接关系187188- User → wiki-interface → evaluator189- evaluator → Redis (缓存)190191## 4. Mermaid 预览192193```mermaid194graph LR195 User --> wiki[wiki-interface]196 wiki --> eval[evaluator]197 eval --> Redis198```199200## 5. ⚠️ 工具选项表201202**检测到场景**: 云架构图203204| 方案 | 工具 | 速度 | 质量 | 输出格式 | 说明 |205|------|------|------|------|----------|------|206| **A** | `diagrams` | ⚡ 快 | ★★★★ | PNG/SVG | 云图标丰富,专业 |207| **B** | `graphviz` | ⚡ 快 | ★★★ | PNG/SVG/PDF | 通用流程图风格 |208| **C** | `PlantUML` | ⚡ 快 | ★★★ | PNG/SVG | 需 Java 环境 |209210**💡 推荐**: 方案 A (`diagrams`) - 专为云架构设计,图标更专业211212---213214## 请确认2152161. 架构理解是否正确?组件是否需要增减?2172. 连接关系是否准确?2183. 布局方向偏好(左右 LR / 上下 TB)?2194. **请选择工具方案: [A] / [B] / [C]?(直接回复字母,或回复"用推荐")**220221确认后我将生成专业的架构图。222```223224### Phase 2: Code Generation & Execution225226After user confirms, generate Python code following these rules:227228#### Output Configuration229```python230with Diagram(231 "Diagram Name",232 filename="./pic/{subfolder}/{name}", # Output to pic subdirectory233 outformat=["png", "svg"], # Both formats234 show=False, # Don't auto-open235 direction="LR" # Left-to-right by default236):237```238239#### Directory Setup240Before execution, ensure output directory exists:241```python242import os243os.makedirs("./pic/{subfolder}", exist_ok=True)244```245246#### Code Structure Template247```python248from diagrams import Diagram, Cluster, Edge249# Import nodes based on cloud provider250# from diagrams.gcp.compute import Run, ComputeEngine251# from diagrams.aws.compute import EC2, Lambda252# from diagrams.k8s.compute import Pod, Deployment253254import os255output_dir = "./pic/{diagram_name}"256os.makedirs(output_dir, exist_ok=True)257258with Diagram(259 "{Diagram Title}",260 filename=f"{output_dir}/{diagram_name}",261 outformat=["png", "svg"],262 show=False,263 direction="LR"264):265 # Define clusters and nodes266 with Cluster("Cluster Name"):267 node1 = ServiceType("Label")268 269 # Define connections270 node1 >> Edge(label="description") >> node2271```272273### Phase 3: Save Code & Result Feedback274275After execution:2761. **Save the Python source code** to `./pic/{name}/{name}.py` (same folder as generated images)2772. Report generated file paths:278 - `./pic/{name}/{name}.py` (source code)279 - `./pic/{name}/{name}.png`280 - `./pic/{name}/{name}.svg`2813. If errors occur, analyze and fix automatically282283## Node Import Reference284285See [references/diagrams-api.md](references/diagrams-api.md) for complete node import paths.286287### Quick Reference - Common Providers288289| Provider | Import Pattern | Example |290|----------|---------------|---------|291| GCP | `diagrams.gcp.{category}` | `from diagrams.gcp.compute import Run` |292| AWS | `diagrams.aws.{category}` | `from diagrams.aws.compute import EC2` |293| Azure | `diagrams.azure.{category}` | `from diagrams.azure.compute import VM` |294| K8s | `diagrams.k8s.{category}` | `from diagrams.k8s.compute import Pod` |295| Generic | `diagrams.generic.{category}` | `from diagrams.generic.compute import Rack` |296| On-Premise | `diagrams.onprem.{category}` | `from diagrams.onprem.database import PostgreSQL` |297298### Common Categories299- `compute`: EC2, Run, Pod, VM300- `database`: RDS, SQL, PostgreSQL, Redis301- `network`: ELB, VPC, DNS, CDN302- `storage`: S3, GCS, PersistentDisk303- `analytics`: BigQuery, Dataflow304- `ml`: SageMaker, VertexAI305- `security`: IAM, KMS, WAF306- `client`: User, Users, Client307308## 扩展能力:多种 Python 绑图库支持309310除了 `diagrams` 库用于架构图,本 Skill 支持根据用户需求动态选择合适的 Python 绘图库:311312| 场景 | 推荐库 | 安装命令 | 适用场景 |313|------|--------|----------|----------|314| 云架构图 | `diagrams` | `pip install diagrams` | AWS/GCP/Azure/K8s 架构可视化 |315| 数据可视化 | `matplotlib` | `pip install matplotlib` | 折线图、柱状图、散点图、饼图等 |316| 统计图表 | `seaborn` | `pip install seaborn` | 高级统计图、热力图、分布图 |317| 交互式图表 | `plotly` | `pip install plotly` | 可交互的 Web 图表、3D 图 |318| 流程图/思维导图 | `graphviz` | `pip install graphviz` | 流程图、状态机、决策树 |319| 网络拓扑图 | `networkx` + `matplotlib` | `pip install networkx` | 网络关系图、图论可视化 |320| 甘特图/时序图 | `plotly` / `matplotlib` | - | 项目管理、时间线 |321322## Design Best Practices3233241. **Use Clusters** for logical grouping (VPC, Region, Service Group)3252. **Direction**: Use `LR` (left-right) for wide diagrams, `TB` (top-bottom) for tall ones3263. **Edge labels**: Add `Edge(label="HTTP")` for connection descriptions3274. **Consistent naming**: Use clear, descriptive labels3285. **Color coding**: Leverage built-in provider colors for visual distinction329330## 输出格式指南331332| 格式 | 适用场景 | 工具支持 |333|------|---------|---------|334| **PNG** | 通用展示、PPT、网页 | 所有工具 |335| **SVG** | 网页嵌入、可缩放 | matplotlib, diagrams, plotly |336| **PDF** | 论文插图、打印 | TikZ (原生), matplotlib |337| **HTML** | 交互式展示 | plotly |