md2rich

docu.md Agent Skills 2026: Markdown Diagrams as Text

Every diagram in a document is usually a PNG. That is why every diagram in a document is also stale the moment the numbers change. A GitHub repository called markdown-viewer/skills takes the opposite bet: the figure is the text. It ships 242 verified examples across five rendering engines, and an AI agent can pick the right one by describing what the reader wants to know. Here is how the package is built, what it actually does, and where it fits in a Markdown publishing workflow.

The repository behind docu.md - a cross-platform Markdown viewer with rich diagram support, available as a Chrome, Edge, Firefox, Obsidian and VS Code extension - carries about 3,400 GitHub stars and 193 forks. Inside it sits a single directory, documd-visuals, packaged in the Agent Skills format. The README states the headline figure plainly: 242 verified examples, 183 scenarios, 31 goal domains, 5 engines. Every one of those numbers is generated from a source table and gated by a script that checks theme drift, contrast, block rendering and block coverage.

That last detail matters more than it sounds. A skills package is usually a pile of prose an agent reads and tries to follow. This one is a package whose content is machine-checked: the scripts fail the build if a rendered example drifts from its theme, if contrast regresses, or if a documented file becomes unreachable from the router. That is the difference between a prompt and a specification.

The core idea: figures are text, in place

The package's central claim is in its SKILL.md router, and it is short enough to quote: "Figures are text, in place." A fenced block written into the Markdown is the figure. The viewer draws it live, the block stays editable, and nothing is pre-rendered, built or exported first. There is no build step and no binary artifact to regenerate.

The contrast with the conventional workflow is worth spelling out, because it is the whole argument. Normally a chart in a Markdown document is an image you exported from a spreadsheet, committed to the repository, and now has to be regenerated by hand every time the underlying data moves. The prose and the picture drift apart. The picture is also a binary, so a diff shows nothing about what changed. And an AI agent cannot reason about it at all - it sees pixels.

Under this model the same agent that wrote the sentence describing a latency regression can also edit the block that draws it, because both are text in the same file. The example format makes that concrete - every scenario file follows the same shape, and it ends with a traceability line:

# Dumbbell - Latency Before and After a Fix (Vega-Lite)

**Best for**: two measurements per category, where the
*gap* between them is the argument
**Avoid when**: the two values are not comparable
**Answers**: how much each endpoint improved

```vega-lite
{
  "data": {
    "values": [
      {"endpoint": "Checkout", "before": 412, "after": 268},
      {"endpoint": "Cart",     "before": 366, "after": 210},
      {"endpoint": "Search",   "before": 298, "after": 224}
    ]
  },
  "mark": "point"
}
```

*Data Shape / Key Options / Pitfalls / Alternatives*

<!-- source: engines/vega.md -->

Notice the shape: a recommendation for when to use the figure, a warning about when not to, the question it answers, the block itself, and a pointer back to the engine documentation. An agent reading only the example can decide whether it fits the reader's question, and can trace any claim to the source that justifies it.

Routing by goal, not by engine

The package is organised by what the reader wants, not by what the renderer is. Requests route through 31 goal domains, grouped into four meta-clusters:

Each domain lists its scenarios with the example files that implement them, and each scenario names its engine. The path through the package is three hops: match the reader's intent to a goal domain, read that domain's guide, then open the engine reference for the limits and anti-patterns of the renderer you landed on. Engines are suggestions; the guide and the examples are authoritative.

The distribution of the 242 examples across the five engines is not arbitrary, and it hints at where the package thinks its real strength is:

Engine Fence Examples Used for
Infographic (AntV) infographic 92 Template-driven roadmaps, sequences, comparisons
Vega / Vega-Lite vega, vega-lite 46 Charts with data transforms, faceting, statistics
PlantUML (draw-uml) plantuml, puml 41 UML, ArchiMate, BPMN, cloud and network architecture
ECharts echarts 39 Report-grade charts, dashboards, gauges
Bare HTML no fence 24 System architecture layouts, cards, page skeletons

Infographic is the largest single group, which tells you what this package is actually for: business documents, status reports, roadmaps and comparison material - not scientific plotting. The heaviest domain is delivery-throughput with 19 examples; the lightest are enterprise-architecture, data-platform and catalogues-and-inventories with 3 each.

The five engines and their hard edges

The package is opinionated to a degree that is unusual for documentation. Seven iron rules govern it, and the second one is the striking one: "Nothing outside that list. A fence the list does not name is a bug, not a lesser option - there is no second-tier engine." The single place the excluded names appear is the SKILL.md description itself - mermaid, canvas, drawio, dot - so an agent recognises the request when a user makes it and can say no.

Other rules matter for anyone writing against it. HTML must be bare, never fenced: ```html turns the block into an image. One diagram per fence, and never nested fences. Chart engines must inline their own data - vega, vega-lite and echarts carry their own values and series, because external URLs are unreliable on the export path. And colours come from one of nine named themes - accessible, contrast, default, editorial, nord, pastel, print, slate, vivid - with a hand-picked hex treated as a bug.

The theme system is the part most likely to surprise you, because it is not decoration. Each theme is a block of values per engine, and the gates check for off-theme literals in strict mode. The instruction to pick a theme and take every value from it is what keeps 242 examples visually coherent - and it is why the repo tells contributors to edit scripts/themes.json rather than the generated theme files.

PlantUML support comes with a detail worth knowing about: the draw-uml path converts PlantUML text into DrawIO XML, and the bundle ships roughly 9,500 stencil icons for architecture diagrams. The companion packages are published separately - @markdown-viewer/draw-uml at version 1.5.2 and @markdown-viewer/drawio2svg at 1.5.5.

Installation, and the one trap that catches everyone

Installation is a single command, and it works across Claude Code, Codex, Cursor and anything else that understands the Agent Skills format:

npx skills add markdown-viewer/skills

For Claude Code the manual route is copying skills/documd-visuals into ~/.claude/skills/. For GitHub Copilot and VS Code, dropping the package into .github/skills/ is enough. For claude.ai, you can add the package as project knowledge or paste the SKILL.md contents into the conversation.

The trap is the npm scope, and the package warns about it twice. The bare name documd on npm belongs to an unrelated package called "markdown object notation". If you type npx documd, you fetch that one, and it fails in a way that looks like a bug in your document rather than a wrong package name. Always write the full scope:

npx @markdown-viewer/documd report.md report.docx
npx @markdown-viewer/documd notes.md book.epub
npx @markdown-viewer/documd architecture.puml architecture.svg

# install once if the command repeats:
npm install -g @markdown-viewer/documd

There is a second subtlety that trips people up. Installing the skill does not install the CLI, and no installer could make it. npx skills add copies or symlinks files into a skills directory; the Agent Skills format has no install-hook field, and the CLI runs no scripts of its own during add. The CLI is a separate tool the skill points at. The export path also needs Node 18 or newer plus a Chrome or Chromium install - it bundles playwright-core, and if Chrome is not on the default path you pass --chrome <path>.

The export half: from live figures to files

The CLI splits cleanly by input type. A Markdown document goes out to a finished file - html, epub, docx or pdf, with the format inferred from the output extension. A SUMMARY.md with the --book flag exports a whole book following the GitBook summary structure. A single diagram source - a .puml, .vl or .vega file - renders on its own to svg or png.

The --assets flag is the one to know about for publishing: it exports a document's figures and images into a directory instead of producing a document. That is the bridge from "live in the viewer" to "an image that a social platform will actually display".

The CLI is at version 6.0.0 on npm, published under a GPL-3.0-only license, last modified at the end of October 2026.

Two licenses, and why the split is deliberate

The repository is covered by CC-BY-4.0. That grant includes the whole repository - the skill package, the repo-only tooling in scripts/ and the engine dossiers in research/, none of which are shipped or discovered as skills. You may copy, adapt and redistribute it, including commercially, with attribution. Attribution is asked for only when you share the package, and then a credit line in your notices satisfies it. Writing documents with the skill, and documents that stay inside your organisation, require nothing at all.

The CLI and the rendering engines are a different work under GPL-3.0-only. Installing the skill does not license them. This split is the kind of detail that is easy to miss and awkward to discover later, so it is worth reading the licence section before you vendor any of it into a product.

One more piece of housekeeping: the repository used to ship 14 separate engine-named and domain-named skills. They were consolidated into the single documd-visuals package and rewritten rather than copied - there are no compatibility stubs, because the CLI discovers a skill by locating a SKILL.md and a stub directory would be ignored anyway. If you installed one of the old skills, reinstall to get the new package.

Where this fits in a publishing workflow

Here is the honest limitation, and it is worth being precise about it. LinkedIn, X Articles, Notion, Medium and Substack do not render a fenced plantuml or vega-lite block. Paste one into a rich-text editor and you get the literal characters - backticks, braces, the whole JSON payload - because a fenced block is only meaningful to something that knows the fence. The same is true of Mermaid, of course, but the point is more general: text figures need a renderer, and social platforms are not renderers.

So the workflow has an export step in the middle, and it looks like this:

  1. Draft in Markdown, with the figure as a fenced block inline where it belongs in the prose.
  2. Export with npx @markdown-viewer/documd - or --assets if you want the figures as separate image files.
  3. Convert to rich text with a client-side converter like md2rich, which turns the Markdown into clipboard-ready rich text entirely in your browser.
  4. Paste and publish. Bold, headings, lists and links arrive intact, and the exported images ride along.

Two examples of the Markdown before that conversion - this is the material most publishers get wrong, because pasting it raw shows the reader a wall of asterisks:

Example 1: a LinkedIn-ready summary of a latency fix. The bold lead-ins, the inline code and the numbered structure all become real formatting on paste, instead of literal ** characters.

## p95 latency, before and after the cache fix

1. **Checkout** moved from 412 ms to 268 ms.
2. **Cart** moved from 366 ms to 210 ms.
3. **Search** moved from 298 ms to 224 ms.

The chart above is a Vega-Lite dumbbell: the
*gap* is the argument, not the absolute values.

Figure source: `documd-visuals/examples/service-reliability/`

Example 2: an X Articles pull-quote with a reference link. The blockquote marker and the inline link are exactly the constructs that get lost when raw Markdown is pasted into a rich-text field.

> Figures are text, in place. The fenced block is
> the figure: the viewer draws it live, the block
> stays editable, and nothing is pre-rendered.

Read more: [the md2rich blog](/blog/)

The privacy angle is sharper for this particular workflow than for most, because the documents people put diagrams in are often the ones they least want on a third-party server - internal architecture, incident retros, roadmap reviews, unreleased pricing. A client-side converter keeps that whole pipeline on your device. No upload means no server to trust, which is the same property that makes the exported archive safe to open and the source tree git-friendly.

The verdict

docu.md's Agent Skills package is a genuinely different bet from the usual "here is a prompt you can paste into your agent". The figures are text, so they diff, so they stay editable, so an agent can author them. The 31 goal domains mean routing is by reader intent instead of by renderer, which is the part a human author gets wrong most often. And the gates - theme drift, contrast, block coverage, catalog consistency - mean the package holds its own quality bar rather than asking readers to trust it.

The limitation is real and it is not small: it targets a workflow where you control the renderer. For a document you publish to LinkedIn or X, the fenced block has to become an image before anyone else can see it, which means the export CLI is not optional in practice. But that is a solvable step, it is one command, and the alternative - a PNG that goes stale the next time a number changes - is the problem most Markdown documentation has been living with for a decade.

If you write in Markdown and publish anywhere in 2026, the stack writes itself: draft in Markdown, draw figures as text, export with documd, convert with md2rich, paste everywhere.

FAQ

What is docu.md's Agent Skills package?

It is a single skill package called documd-visuals, published in the markdown-viewer/skills repository on GitHub and installable with npx skills add markdown-viewer/skills. It teaches an AI coding agent how to create charts, diagrams, cards and page layouts directly inside Markdown, using fenced blocks that the docu.md viewer renders live. The repository has about 3,400 stars and the package contains 242 verified examples, 183 scenarios, 31 goal domains and 5 rendering engines.

Which rendering engines does the skill support?

Five. PlantUML (fenced as plantuml or puml) for UML, ArchiMate, BPMN and cloud architecture, with roughly 9,500 stencil icons. Vega and Vega-Lite for charts that need data transforms, faceting and statistics. ECharts for report-grade charts, dashboards and gauges. Infographic, from AntV, for template-driven roadmaps, sequences and comparisons. And bare HTML for system architecture diagrams, cards and page-level layouts. The skill treats any other engine as a bug rather than a second-tier option, and explicitly does not recommend Mermaid, canvas, drawio or dot.

Do I need to install anything to use the skill?

No, not for writing figures. The skill copies or symlinks files into your agent's skills directory, and the viewer renders the fenced blocks live, so nothing is pre-rendered or built. The optional export CLI is separate and must be installed on demand: npx @markdown-viewer/documd report.md report.docx. The CLI needs Node 18 or newer and a Chrome or Chromium install. Note the scope, because the bare name documd on npm is an unrelated package called markdown object notation.

Can I export a Markdown document with diagrams to PDF, DOCX or EPUB?

Yes. The documd CLI renders a whole Markdown document, figures included, to html, epub, docx or pdf, with the format inferred from the output extension. A document input of .md, .markdown, .mdown, .mkd or .txt produces those four formats. A SUMMARY.md file with the --book flag exports a whole book following the GitBook summary structure. A single diagram source such as a .puml, .vl or .vega file can be rendered on its own to svg or png.

How do I publish a Markdown document with diagrams to LinkedIn or X Articles?

Export the document to HTML first so the figures become images, then paste the result into a rich-text converter such as md2rich, which runs entirely in your browser and turns the Markdown into clipboard-ready rich text for LinkedIn, X Articles, Notion, Medium and Substack. Your draft and any internal content never leaves your device because the conversion happens client-side. Note that LinkedIn and X do not render fenced diagram blocks themselves, so the export step is what turns a text figure into a visible chart.

What license applies to the skill package and the CLI?

They are two separate works with two different licenses. The skill package, the documd-visuals directory, is CC-BY-4.0, which lets you copy, adapt and redistribute it including commercially, with attribution, and it covers the whole repository including the repo-only tooling. The CLI and the rendering engines, published as @markdown-viewer/documd, @markdown-viewer/draw-uml and @markdown-viewer/drawio2svg, are GPL-3.0-only and are not covered by that grant. Installing the skill does not license them.

Draw it in text. Publish it in rich text.

Try md2rich — the free, client-side Markdown-to-rich-text converter. Paste the Markdown from any exported docu.md document, get clipboard-ready rich text for LinkedIn, X Articles, Notion, Medium, and Substack. No upload. No account. No server.

Try md2rich →