Use diagram-design to let AI draw charts: turn one sentence into a visualized HTML chart file

Author’s note: This article is about installing a community-built skill into a coding assistant so that the model writes a self-contained HTML diagram file directly, instead of opening some online diagramming site.

diagram-design-ai-diagram-54-types-html-en-image-0

You’ve just finished writing up a proposal in Claude Code, Cursor, or Codex and want an architecture diagram to go with it. The assistant hands you back a chunk of Mermaid, and it renders as the same old boxes-and-arrows look. The problem isn’t that the model can’t draw — it’s that it has no set of design rules to follow. diagram-design fills exactly that gap: the author took their own typographic taste, wrote it up as a skill, and installed it into a coding assistant, so the model follows those rules and writes out a self-contained HTML file with the diagram sitting inside as inline SVG.

This isn’t a diagramming website, and it isn’t a replacement for Figma or any online editor. There’s no canvas, no layers panel, no dragging nodes around. What you get is an HTML file you can open in a browser, paste into a document, and keep rewriting.

Why it’s worth your time: by the end of this article you’ll have an install command, a plain-English sentence that actually gets a diagram out of it, the exact origin of the number 54, what you need to install on top to export a PNG, and which bill the drawing work ultimately lands on.


What is diagram-design: a skill you install into your assistant, not a drawing website

diagram-design is an open-source repository by cathrynlavery, hosted at github.com/cathrynlavery/diagram-design. The repo description puts it plainly: editorial-grade diagram design for Claude Code, Codex, GitHub Copilot, Cursor, Factory Droid, Qoder, and Pi — 54 diagram types, self-contained HTML + SVG, no shadows, and no cookie-cutter Mermaid flowchart look.

That paragraph is worth reading sentence by sentence. “Editorial diagram design” — editorial here means magazine-style typography and color palettes. “No shadows” is a hard constraint. And “No Mermaid slop” is the author’s explicit pushback against default flowchart aesthetics. These aren’t marketing lines; they’re rules the skill actually uses to constrain model output, which is why the results look noticeably cleaner than a flowchart rendered on a whim.

Item Value Notes
Repository cathrynlavery/diagram-design Community open-source project, not an official product
Stars 77927 GitHub API data, as of 2026-12-03
Forks 5427 Same as above
License MIT Commercial use allowed, just keep the copyright notice
Primary language HTML The output itself is an HTML file
Created 2026-04-16 Repository first created
Last push 2026-12-01 Still actively maintained
Open issues 33 The place to check problems you run into

Where the number 54 comes from

The 54 comes solely from the phrase “54 diagram types” in the repository description. The project’s website, diagramdesign.dev, once listed 52 types — that’s site copy, and it doesn’t match the repo description. You can’t average the two numbers into 53; this article uses the repo description’s 54 throughout.

Some earlier articles mentioned numbers like 44 or 45. Those were descriptions of older versions and shouldn’t be treated as today’s capability range. The reason for hammering on the source is that the type count changes as the repo is updated, and the smallest unit you can actually verify is always the repo description itself.


Why diagram-design outputs HTML instead of an image

The default artifact is a single HTML file with the SVG inlined right in the document. There’s no separate build step, and no bundling command to run. That means when you send the file to a colleague, they just double-click it — no network dependency, no font server dependency, and the styling travels with the file.

Inline SVG has another advantage that’s easy to overlook: the diagram is text. It can go into Git and be diffed, it can be grepped, and you can tweak a single color value without redrawing anything. For people writing documentation, that’s far less hassle than exporting a PNG and then redoing the whole thing by hand.

The design rules are the author’s taste, baked into the skill — not conclusions we re-measured: the accent color appears in only one or two places, there are no shadows anywhere in the diagram, and the hierarchy of font sizes and whitespace is clearly layered. This set of constraints is especially handy when you have brand color requirements, because the model won’t smear six different colors onto a single diagram.

diagram-design-ai-diagram-54-types-html-en-image-1

As you can see from the pipeline diagram, there’s no server-side rendering step in the middle — everything happens between you and your coding assistant. Routing and diagram generation both happen locally; only model inference happens remotely, which is also why we’ll get into token cost later.


Which coding assistants does diagram-design support?

It follows the general Agent Skills convention, so any assistant that can read this kind of skill can install it: Cursor, Claude Code, Codex, GitHub Copilot, Gemini CLI, Cline, Windsurf, Amp, plus Factory Droid, Qoder, and Pi, which the repo description calls out by name. Installation is pretty much the same across the board, though Claude Code also has a plugin marketplace route.

Assistant How to install Notes
Claude Code npx skills add cathrynlavery/diagram-design Standard install
Claude Code (plugin) First /plugin marketplace add cathrynlavery/diagram-design, then /plugin install diagram-design@diagram-design Goes through the plugin marketplace, which makes centralized management easier
Cursor npx skills add cathrynlavery/diagram-design Once installed, just describe what you need in the chat
Codex Same as above Explicitly supported per the repo description
GitHub Copilot Same as above Same as above
Gemini CLI, Cline, Windsurf, Amp Same as above Works as long as it can read Agent Skills
Factory Droid, Qoder, Pi Same as above The three hosts named in the repo description

Once it’s installed, there’s no extra service to start and no ports to configure. A skill is a rule set that lives as files—the assistant reads it on its own when it needs to draw a diagram. You just have to state your requirements clearly.

🚀 Quick start: If your assistant needs a stable model endpoint to run this kind of long-text generation task, you can apply for a key and a free trial quota through APIYI apiyi.com. Just set base_url to https://api.apiyi.com/v1—the API is OpenAI-compatible, so switching models only means changing one field.

diagram-design Quick Start: One Command, One Plain-Language Prompt

Installation is just one command, shown inline—copy it straight into your terminal: npx skills add cathrynlavery/diagram-design. Updating is just as easy: npx skills update diagram-design. The repo’s most recent push was 2026-12-01, so it’s maintained fairly actively; it’s worth running an update every once in a while.

The real barrier isn’t installation—it’s how you phrase your request. The three examples below are typical requests from the repo’s guidance; talking at this level of detail is enough:

  • Draw an architecture diagram with a frontend, backend, database, and cache.
  • Draw a four-quadrant chart sorted by impact and effort.
  • Draw a call sequence with a 401 refresh.

Notice that none of these three specify a diagram type—the skill will decide for itself whether to use an architecture diagram, a four-quadrant chart, or a sequence diagram. All you need to do is make clear what relationship you want to convey and hand off the type selection; the diagram actually comes out more reliably.

There are only three acceptance criteria: you end up with an HTML file you can double-click to open; when opened, the diagram is complete, with no external resources and no missing characters or misalignment; and you don’t need to run any build commands during the process. If all three are met, the diagram output counts as a success and can go straight into a document or proposal.

If the first output isn’t to your taste, don’t go hunting for a canvas. Just tell the assistant something like “change the accent color to blue and make the nodes two columns,” and it’ll rewrite the HTML. That’s the only way this skill handles rework—once you’re used to it, it’s actually faster than dragging things around.


How diagram-design’s 54 types map to specific needs

You don’t need to memorize the type names, but knowing the rough mapping will make your requests more precise. The table below maps common intent to the diagram type it will most likely land on. For the exact list, refer to the repository; this is only a directional reference.

What you’re trying to explain Likely diagram type Where it fits
Which parts are in the system and how they connect Architecture diagram Technical proposals, README
What happens first, what happens next, and how failures are retried Sequence diagram API documentation, incident retrospectives
Trade-offs across two or three dimensions Four-quadrant diagram Decision records, weekly reports
Phase progression and state transitions State machine diagram Product flows, order models
Where data comes from and where it goes Data flow diagram Data pipeline documentation
Organizational and responsibility boundaries Layered structure diagram Team introductions, planning

If you want to specify a type, you can just say “draw it as a four-quadrant diagram” and the skill will do that. If you don’t say, it will choose for itself, which usually fits the content better than a hard-coded choice. This trade-off makes little difference on small diagrams, but on architecture diagrams with more than a dozen nodes it clearly affects readability.

The 52 types on the official website page are site copy; if they disagree with the repository description, the repository’s 54 take precedence. This detail itself is a reminder: for skill-based projects, accurate information lives in the repository, not on the marketing page.

diagram-design-ai-diagram-54-types-html-en-image-2

Those three rules in the diagram—use the accent color only in one or two places, no shadows, and layered typography—are the author’s taste written into the skill, not metrics we measured again. Treating them as style conventions is more accurate than treating them as performance parameters.


What Do You Need to Install to Export PNGs from diagram-design?

PNG isn’t a default output. If you’re only viewing the HTML, you don’t need to install anything—your browser’s built-in rendering is enough. To export images, your machine needs Playwright and Chromium. Run pip install playwright, then playwright install chromium; both commands can be run on the command line.

These two steps install the browser engine, which is fairly large, so only install it when you actually need PNGs. Most writing scenarios don’t need it: pasting the HTML directly into your documentation system, or using a screenshot tool to capture a section, is enough.

💡 Recommendation: If your diagrams will ultimately go into a PPT or poster, take the PNG route; if they’re only going into docs, a repo, or an internal knowledge base, HTML itself is the best delivery format. Either way, the model invocation step for generating the diagram can be accessed through APIYI (apiyi.com), making it easy to compare results across several models side by side.


diagram-design: Token costs for drawing a diagram, using models available on the platform

Let’s get one thing straight: this skill isn’t tied to any single model. It’s a set of rules and a workflow. The quality of the output depends on which model your coding assistant is using at the time, and the tokens are spent on that model—because the diagram is essentially “written” by the model as an HTML document with inline SVG, not generated by calling some drawing API.

Once you understand that, the cost model is straightforward: the more nodes, the longer the spec, and the more revision rounds, the more output tokens. The three models below are chosen by task type, and all can be invoked pay-as-you-go on APIYI apiyi.com. They aren’t names recommended in the skill docs; refer to the platform’s master table for the authoritative list.

Task type Model Input (per 1M) Output (per 1M) Cache read (per 1M)
General architecture diagrams, flowcharts gpt-6.2-sol $2 $10 $0.10
Long specs + strict brand colors gpt-6.2-astra $8 $40 $0.40
Outlines to simple diagrams, high volume gpt-6-luna $0.10 $0.50 $0.01

Both gpt-6.2-sol and gpt-6.2-astra have an input premium tier: when input exceeds 272K, input pricing is calculated at $4 and $16 respectively. In other words, stuffing the entire brand manual into the context versus only the color palette and typography sections makes a very noticeable difference on the bill.

The cache-read column deserves a separate note. When revising a diagram, you’re repeatedly submitting the same spec; only the last revision instruction changes. The portion that hits cache is billed at the cache-read unit price: $0.10 for gpt-6.2-sol and $0.01 for gpt-6-luna. gpt-6.2-luna is good for batch-converting existing outlines into simple diagrams—low unit price, and each diagram carries less information. If you need a formal architecture diagram that can go into a proposal, gpt-6.2-sol is the safer bet; only bring in gpt-6.2-astra when the spec is especially long and the color requirements are especially rigid.

There’s nothing special about integration: point base_url to https://api.apiyi.com/v1, prefer the Responses API, and fill in the model ID from the table above. APIYI apiyi.com is an aggregation platform; one key lets you switch between OpenAI, Claude, Gemini and other mainstream models. For drawing, if you want to compare models, you only change one field.

diagram-design-ai-diagram-54-types-html-en-image-3

How much a single diagram actually costs depends on how many nodes it has and how many rounds you revise it. I won’t give you a made-up concrete number here. A practical approach: first run two versions with gpt-6.2-luna to check whether the structure is right, then switch to gpt-6.2-sol and regenerate once after finalizing—save the expensive run for the final version.


What diagram-design can and can’t do

Most of the confusion in the community around this kind of skill comes from treating it like an editor. The comparison table below will save you a lot of trial and error.

Can do Can’t do
Produce a clearly structured diagram from a single plain-language sentence No canvas, no dragging nodes around to edit them
Output self-contained HTML you can open with a double-click Doesn’t export PNG by default — that needs Playwright installed separately
Inline SVG, so it can live in Git, be grepped, and be diffed Doesn’t generate editable project files like .fig or .drawio
Constrain colors and layout according to design rules Doesn’t guarantee it’s right on the first try; to change something, you just tell the assistant again
Automatically pick one of 54 diagram types Not an official product — it’s a community skill, with no endorsement behind it
No external dependencies; viewable offline Doesn’t take over your document layout — anything beyond the diagram is out of its scope

The editing point deserves repeating: this skill has no interactive canvas, so every adjustment happens by “saying one more sentence to the assistant.” That sounds primitive, but for people writing docs it’s actually smoother, because you’re already working inside a conversation and don’t have to switch windows.

One more thing to be upfront about: this is a community open-source project under the MIT license, maintained by an individual author — not an official capability from any model vendor. Before using it, I’d suggest skimming the repo’s issues and recent commits and judging for yourself whether it meets your compliance requirements.


Frequently Asked Questions

Q1: What exactly is diagram-design?

It’s a skill you install into a coding assistant that gets the model to write self-contained HTML diagram files according to a set of design rules, with the diagram rendered as inline SVG. It’s not a website, and it’s not an editor.

Q2: How is it different from Mermaid?

With Mermaid, you write a bit of syntax in a document and a renderer draws it; with diagram-design, the model directly writes out a complete HTML file. The former is constrained by the renderer’s default styling, while in the latter even color schemes and whitespace are decided by the model according to the rules — that’s exactly the difference the repo description is getting at with its line “No Mermaid slop.”

Q3: What are the 54 diagram types specifically?

The 54 comes from the “54 diagram types” line in the repo description. This article doesn’t list them one by one, because the list changes as the repo updates — for the accurate version, refer to the repo’s current description and skill files. The official site page once said 52, which is site copy; when it conflicts with the repo, the repo wins.

Q4: Where do I install it, how do I install it, and how do I update it?

The universal install is `npx skills add cathrynlavery/diagram-design`; with Claude Code you can also run `/plugin marketplace add cathrynlavery/diagram-design` first, then `/plugin install diagram-design@diagram-design`. To update later, run `npx skills update diagram-design`.

Q5: How do I hook diagram generation up to APIYI models?

Sign up at APIYI apiyi.com and get a Key, then point the coding assistant’s base_url at `https://api.apiyi.com/v1`. Pick the model by task: gpt-6.2-sol for ordinary diagrams, gpt-6.2-astra for long specs, and gpt-6-luna for high-volume simple diagrams. The skill itself doesn’t specify a model, so switching models doesn’t affect installation.

Q6: Do I absolutely need Playwright?

Not necessarily. If you only want to view the HTML, you don’t need to install anything; you only need Playwright and Chromium to export PNGs — first `pip install playwright`, then `playwright install chromium`.

Q7: What if the diagram doesn’t turn out well? Do I have to redraw it after changing colors?

No redrawing, and no hunting for a canvas. Just tell the assistant “switch the accent color to blue and split the nodes into two columns,” and it will rewrite that HTML. If you go through many revision rounds, keep an eye on how cache reads are billed — when you resubmit the same spec repeatedly, that part of the cost is very low.


diagram-design Core Takeaways

  • It’s a skill at heart: a ruleset you install into a coding assistant — not a drawing site and not an online editor.
  • The output is HTML: self-contained, inline SVG, opens with a double-click, no build step, no external assets.
  • Where the 54 comes from: it appears only in the repo description; the official site says 52, which is just site copy. When the two disagree, trust the repo.
  • Get started with one command: npx skills add cathrynlavery/diagram-design, plus a plain-language sentence describing the relationship you want to show.
  • The design rules come from the author’s taste: one or two accent colors only, no shadows, layered typography — these are aesthetic choices, not performance metrics.
  • PNG needs extra setup: Playwright plus Chromium, two steps. If you only care about HTML, skip it.
  • Your money goes to the model: the model writes the diagram. For everyday diagrams go with gpt-6.2-sol, long specs with gpt-6.2-astra, high volume with gpt-6-luna. For the endpoint, see APIYI apiyi.com.

Summary

The value of diagram-design isn’t that it gives you another way to draw diagrams — it’s that it hands the judgment of “what this diagram should look like” to a model armed with rules, instead of leaving you to nudge boxes around by hand. Its boundaries are just as clear: no canvas, edits happen by talking to it, PNG requires extra environment setup, and it’s a community project with no backing guarantee.

The path to actually using it is short: install the skill, say one plain sentence, and review an HTML file you can open by double-clicking. When you want to compare results across models, point base_url at https://api.apiyi.com/v1 and pick between gpt-6.2-sol, gpt-6.2-astra, and gpt-6-luna based on the task. APIYI apiyi.com offers a unified OpenAI-compatible interface with free trial credits, saving you the hassle of opening an account on each platform separately.


References

  1. GitHub – diagram-design: the skill repository and the original source for the 54 types and design rules

    • Link: github.com/cathrynlavery/diagram-design
    • Notes: The installation command, the list of supported hosts, and the artifact format all follow what’s here
  2. Official project site: the diagram-design project website

    • Link: diagramdesign.dev
    • Notes: The type count shown on the page is site copy; if it conflicts with the repository description, the repository wins
  3. APIYI models and pricing master table: available models and billing basis

    • Link: apiyi.com
    • Notes: The input, output, and cache-read unit prices for the three models in this article all follow this table; if specs change, the latest master table update takes precedence

Author: APIYI Technical Team
Technical contact: Feel free to reach us via the APIYI apiyi.com homepage; integration docs are available at the docs.apiyi.com documentation center

Leave a Comment