d2-diagrams

仓库创建 2026年7月3日最近提交 20 天前SkillHot 收录 20 天前
▸ 精选理由

把视觉迭代纳入工作流,适合架构与文档制作作者。

▸ 风险提示

可能需安装 d2 或调用外部渲染引擎/服务。

这个 Skill 做什么

用 D2 语言生成并渲染专业架构/流程/序列图,输出 SVG。

把图当代码写:用 D2 语言生成架构图、流程图、时序图或 ERD,然后渲染成 SVG 并反复看图修版直到好看可用。适合要把系统、流程或网络拓扑可视化时使用,支持 TALA 与 ELK 布局引擎。特点是自动渲染加人工检视循环,修正布局缺陷再交付,不负责数据类图表(如折线/柱状图)。

▸ 展开 SKILL.md 英文原文

Creates professional diagrams as code with D2 (d2lang.com) and renders them to SVG — architecture and system diagrams, flowcharts, sequence diagrams, database schemas/ERDs, network and cloud topologies, C4, state machines. Renders with the best available layout engine (TALA when licensed, ELK otherwise), then views its own rendered output and fixes layout defects in a loop before delivering. Use whenever the user wants a diagram or asks to visualise, map, or sketch a system, workflow, architecture, pipeline, schema, or process — even if they don't say "diagram" — and whenever they mention D2, d2lang, TALA, or diagram-as-code. Does NOT cover data charts or graphs (bar/line/scatter — use a plotting library) or hand-drawn Excalidraw JSON files.

内容创作D2 图表SVG 渲染架构图通用
0
Stars
0
Forks
1
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/khollingworth/d2-diagram-skill/main/skills/d2-diagrams/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/khollingworth/d2-diagram-skill/main/skills/d2-diagrams/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# D2 Diagrams

Write D2 source, render it to SVG, then **look at the render and fix what you
see** — in a loop, until the diagram is worth shipping. A diagram you haven't
seen is a diagram you haven't finished.

## Reference files — load on demand

| File | Read it when |
|---|---|
| `references/d2-language.md` | Writing any non-trivial D2 — syntax, shapes, containers, classes, vars, and the silent pitfalls that compile fine but render wrong |
| `references/layout-engines.md` | Choosing or debugging layout: TALA vs ELK vs dagre, licensing, seeds, per-engine behaviour differences |
| `references/diagram-patterns.md` | Picking a diagram type and structure — architecture, sequence, ERD, grid, C
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有