Draw a flowchart with AI and D2
Describe a process and get a text-based diagram you can edit, plus a rendered file for readers. Change a label or route without rebuilding the drawing by hand.
To draw a flowchart with AI and D2, give the agent the decisions as well as the happy path. A returned parcel can go back on the shelf, wait for inspection or be written off. A label on each branch tells the reader why it went that way.
The d2-diagrams skill writes the editable diagram in a small text file and renders a separate image. The same source can sit beside a procedure in the team repository and change when the procedure changes.
What it does
- Draw the branches of a returns process with a reason on each arrow.
- Group the team’s work into intake, inspection and dispatch sections.
- Show a software service, its data store and the direction of the requests between them.
- Try another layout when the longest labels force two routes too close together.
- Keep an SVG for a website and a PDF for a printed procedure from the same source.
Install and use
- Install the skill and the official D2 command-line tool. The agent needs permission to write files and run the renderer. No account is required for local output.
- Ask, “Show how an order moves from inspection back into stock, including the route for a damaged item.”
- Follow one parcel through the rendered diagram. Correct any ambiguous arrow in the source, then regenerate the format you want to share.
FAQ
Source
Made by Mike Williams. Original skill: d2-diagrams, published on GitHub under the MIT licence.
View on GitHub