Diagrams Generator 标志

Diagrams Generator

社区
darker2016
diagrams-generator

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.

概览

发布者darker2016
代码仓库workbuddy-skill-groups
技能名称diagrams-generator
星标数
35
复刻数
5
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 darker2016 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Diagrams Generator AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/darker2016/workbuddy-skill-groups/tree/main/aicoding-architecture-expert-skills/skills/diagrams-generator
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/darker2016/workbuddy-skill-groups.git /tmp/workbuddy-skill-groups
mkdir -p .claude/skills
cp -r /tmp/workbuddy-skill-groups/aicoding-architecture-expert-skills/skills/diagrams-generator .claude/skills/diagrams-generator
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Diagrams Generator,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Diagrams Generator。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Diagrams Generator 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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 (按需安装)

基础工具 (大多数场景)

bash
# Graphviz (diagrams 依赖)
brew install graphviz  # macOS
apt-get install graphviz  # Linux

# Python 库
pip install diagrams matplotlib seaborn plotly networkx

TikZ/LaTeX (学术论文级图表 - 可选)

bash
# 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.

  1. Receive input: User provides text description and/or reference image

  2. Identify Scenario: 根据用户描述中的关键词,识别场景类型:

    检测关键词场景判断
    架构/系统/微服务/AWS/GCP/K8s→ 云架构图
    数据/趋势/统计/柱状/折线/饼图→ 数据图表
    交互/动态/Web/仪表板→ 交互图表
    热力图/分布/相关性→ 统计图表
    流程/状态机/决策树→ 流程图
    网络/拓扑/节点/关系→ 关系图
    论文/学术/神经网络/模型架构→ 学术图
  3. Analyze and extract:

    • Components (services, databases, users, layers, etc.)
    • Groupings/Clusters (VPC, regions, logical groups, network layers)
    • Connections and data flows
    • Labels and annotations
  4. ⚠️ 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)

    方案工具速度质量输出格式说明
    Adiagrams⚡ 快★★★★PNG/SVG云图标丰富,专业
    Bgraphviz⚡ 快★★★PNG/SVG/PDF通用流程图风格
    CPlantUML⚡ 快★★★PNG/SVG需 Java 环境

    💡 推荐: 方案 A (diagrams) - 专为云架构设计


    场景: 数据图表 (折线/柱状/饼图/散点)

    方案工具速度质量输出格式说明
    Amatplotlib⚡ 快★★★PNG/SVG/PDF即开即用,最通用
    Bplotly⚡ 快★★★★HTML/PNG交互式,可缩放
    Cpyecharts⚡ 快★★★★HTML中文友好,样式丰富

    💡 推荐: 静态图选 A,交互式选 B


    场景: 学术论文图 (神经网络/模型架构/算法流程)

    方案工具速度质量输出格式说明
    Amatplotlib⚡ 快★★★PNG/SVG/PDF即开即用,适合初稿
    BTikZ/LaTeX🐢 慢★★★★★PDF/PNG首次需下载 500MB-4GB

    💡 推荐: 赶时间选 A,正式发表选 B


    场景: 流程图/状态机/决策树

    方案工具速度质量输出格式说明
    Agraphviz⚡ 快★★★PNG/SVG/PDF专业流程图
    Bmermaid-cli⚡ 快★★★PNG/SVG需 Node.js 环境
    CPlantUML⚡ 快★★★PNG/SVG需 Java 环境

    💡 推荐: 方案 A (graphviz) - 无额外依赖


    场景: 网络拓扑/关系图/知识图谱

    方案工具速度质量输出格式说明
    Anetworkx + matplotlib⚡ 快★★★PNG/SVG静态图,轻量
    Bpyvis⚡ 快★★★★HTML交互式,可拖拽
    Cgraphviz⚡ 快★★★PNG/SVG/PDF层次布局清晰

    💡 推荐: 静态选 A,交互式选 B


    场景: 统计图表 (热力图/分布图/相关性矩阵)

    方案工具速度质量输出格式说明
    Aseaborn⚡ 快★★★★PNG/SVG/PDF统计图专用
    Bmatplotlib⚡ 快★★★PNG/SVG/PDF更灵活,需手动配置
    Cplotly⚡ 快★★★★HTML/PNG交互式热力图

    💡 推荐: 方案 A (seaborn) - 统计可视化首选


  5. 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):

markdown
## 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. ⚠️ 工具选项表

检测到场景: 云架构图

方案工具速度质量输出格式说明
Adiagrams⚡ 快★★★★PNG/SVG云图标丰富,专业
Bgraphviz⚡ 快★★★PNG/SVG/PDF通用流程图风格
CPlantUML⚡ 快★★★PNG/SVG需 Java 环境

💡 推荐: 方案 A (diagrams) - 专为云架构设计,图标更专业


请确认

  1. 架构理解是否正确?组件是否需要增减?
  2. 连接关系是否准确?
  3. 布局方向偏好(左右 LR / 上下 TB)?
  4. 请选择工具方案: [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:

python
import os
os.makedirs("./pic/{subfolder}", exist_ok=True)
Code Structure Template
python
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:

  1. Save the Python source code to ./pic/{name}/{name}.py (same folder as generated images)
  2. Report generated file paths:
    • ./pic/{name}/{name}.py (source code)
    • ./pic/{name}/{name}.png
    • ./pic/{name}/{name}.svg
  3. If errors occur, analyze and fix automatically

Node Import Reference

See references/diagrams-api.md for complete node import paths.

Quick Reference - Common Providers

ProviderImport PatternExample
GCPdiagrams.gcp.{category}from diagrams.gcp.compute import Run
AWSdiagrams.aws.{category}from diagrams.aws.compute import EC2
Azurediagrams.azure.{category}from diagrams.azure.compute import VM
K8sdiagrams.k8s.{category}from diagrams.k8s.compute import Pod
Genericdiagrams.generic.{category}from diagrams.generic.compute import Rack
On-Premisediagrams.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 绘图库:

场景推荐库安装命令适用场景
云架构图diagramspip install diagramsAWS/GCP/Azure/K8s 架构可视化
数据可视化matplotlibpip install matplotlib折线图、柱状图、散点图、饼图等
统计图表seabornpip install seaborn高级统计图、热力图、分布图
交互式图表plotlypip install plotly可交互的 Web 图表、3D 图
流程图/思维导图graphvizpip install graphviz流程图、状态机、决策树
网络拓扑图networkx + matplotlibpip install networkx网络关系图、图论可视化
甘特图/时序图plotly / matplotlib-项目管理、时间线

Design Best Practices

  1. Use Clusters for logical grouping (VPC, Region, Service Group)
  2. Direction: Use LR (left-right) for wide diagrams, TB (top-bottom) for tall ones
  3. Edge labels: Add Edge(label="HTTP") for connection descriptions
  4. Consistent naming: Use clear, descriptive labels
  5. Color coding: Leverage built-in provider colors for visual distinction

输出格式指南

格式适用场景工具支持
PNG通用展示、PPT、网页所有工具
SVG网页嵌入、可缩放matplotlib, diagrams, plotly
PDF论文插图、打印TikZ (原生), matplotlib
HTML交互式展示plotly

常见问题

Diagrams Generator AI 技能有什么作用?

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.

为什么在 TypingMind 中使用 Diagrams Generator?

因为您只需安装一次,就能搭配任何模型使用。Diagrams Generator 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Diagrams Generator?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/darker2016/workbuddy-skill-groups/tree/main/aicoding-architecture-expert-skills/skills/diagrams-generator。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Diagrams Generator?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Diagrams Generator 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Diagrams Generator 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Diagrams Generator AI 技能免费吗?

darker2016 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇