d2-diagrams
把视觉迭代纳入工作流,适合架构与文档制作作者。
可能需安装 d2 或调用外部渲染引擎/服务。
用 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.
帮我安装这个 skill:https://raw.githubusercontent.com/khollingworth/d2-diagram-skill/main/skills/d2-diagrams/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/khollingworth/d2-diagram-skill/main/skills/d2-diagrams/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