diagrams
Installation
SKILL.md
Diagrams
Write D2 source and render it with the d2 CLI. If d2 is missing, ask the user to install it (sudo dnf install d2, brew install d2); don't fetch it any other way.
- Write
<name>.d2where the user asked, otherwise in the project'stmp/. - Render:
d2 --sketch <name>.d2 <name>.svg && rsvg-convert -z 2 <name>.svg -o <name>.png(hand-drawn look; drop--sketchif the user wants a clean one). Don't letd2write PNG directly: older versions download a headless browser for it. - Open the PNG and check it: overlaps, cut or unreadable labels, tangled arrows. Fix the source and re-render, up to 3 rounds;
--layout elkoften untangles dense graphs. - Keep the
.d2next to the image so it can be edited later, and report both paths.