Command Palette

Search for a command to run...

Sumi diagrams: Mermaid an agent writes and a script checks

18 Oct 2026 · 3 min read

Sumi (墨) is the ink of East Asian brush painting: a picture in grey ink, and one vermilion seal. I wanted the diagrams in my READMEs and notes to look like that, quiet enough to read and with one mark that says where to look, so the skill took the name.

Most diagrams a coding agent writes are Mermaid text: it lives in the repo, reads in a diff, and the agent can edit it next week. But Mermaid lets mistakes through without an error, and nobody looks at the picture it draws. sumi-diagrams writes the text, renders it, and looks.

A browser signs in through the backend and the identity provider with the authorization code flow and PKCE; the backend keeps the verifier, the client secret and the tokens.

The authorization code flow with PKCE, written by an agent into an Obsidian note.

How it works

Mermaid, drawn by Pele. Pele is the Mermaid renderer Obsidian built for its next version: its own layout, no dependencies, a few milliseconds per diagram. It reads Mermaid 12.1 and draws every type Mermaid has, the new ones included: swimlane, agentflow, tree view, wardley, venn, ishikawa.

Grey ink, one seal. Boxes, lines and words are grey. One orange accent marks the arrowheads, so the eye follows the flow, and outlines the one node a diagram is about. A dashed outline marks what is outside the system. A chart with one series wears the same orange; with several, the series take the Okabe-Ito colours, ordered so neighbours stay apart for colour-blind readers.

The question picks the type. Who does what is a swimlane, who calls whom is a sequence, what a thing can become is a state machine, what the database holds is an ER diagram, when is a gantt. Each of the 32 types has a verified example and a note on what Pele rejects or quietly misreads.

One SVG for both themes. The colours are CSS variables, and the dark ones take over when the reader's system is dark. A README gets a light and a dark file instead, because GitHub picks the image by the theme chosen on GitHub. An Obsidian note gets the Mermaid block itself, checked at note and phone width.

A script looks at the picture. render.mjs renders the source with Pele and fails on what Mermaid lets through: a style on a node that doesn't exist, a Gantt date that misses its format, a label that won't wrap. It also fails on edges through nodes, labels on top of each other, and a picture so wide its text would shrink below 11 px. It lists every parse error at once, each with its fix, and exits with 1 until it prints check: clean.

Mermaid only tells the agent whether the text parses. The script tells it whether the picture reads.

Try it

Any agent, with Node.js:

npx skills add exdsgift/shuji-skills --skill sumi-diagrams

In Claude Code, the shuji plugin brings every shuji skill at once and runs this one as /shuji:sumi-diagrams:

claude plugin install shuji --marketplace exdsgift/shuji-skills

Then ask for a diagram or a chart in plain words. The check needs Node 20 and installs Pele from npm on its first run; it uses Chrome, Edge or Chromium for the font check when it finds one.

References