/mermaid-terminal:mermaidfrom mermaid-terminal
Render a Mermaid diagram as Unicode box-drawing art directly in the Claude Code terminal. Use whenever the user asks to show, render, draw, preview or visualize a Mermaid diagram, or shares Mermaid source and wants to see it rendered in the chat.
Ships in mermaid-terminal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Render the diagram named by $ARGUMENTS and paste the result back to the user.
Decide the input:
$ARGUMENTS names a file (a .mmd, .mermaid or .md path) → pass that path as the
command's argument, in double quotes.$ARGUMENTS is inline Mermaid source, or no argument was given and the user's message
contains the source → pipe it to the command over stdin with a heredoc, do not pass a path.When you write or edit Mermaid source yourself, put spaces around every arrow: A --> B,
A -.-> B, never A-->B. The renderer draws an unspaced arrow as a single node and still
exits 0.
Run the renderer:
node "${CLAUDE_PLUGIN_ROOT}/dist/render.mjs" "<path>"
or, for inline source:
node "${CLAUDE_PLUGIN_ROOT}/dist/render.mjs" <<'MERMAID'
flowchart TD
A --> B
MERMAID
If the diagram contains a line that is exactly MERMAID, pick another heredoc terminator
that does not appear as a line in the source.
On success (exit 0): paste the command's stdout verbatim into your reply inside a fenced
code block with no language tag (a plain triple-backtick fence). If stdout itself
contains ```, use a four-backtick fence instead so the output stays inside it.
Do not summarize, re-indent or re-wrap it — the Claude Code terminal box-drawing only lines
up when the text is pasted exactly as printed. Do not run the diagram through any other
tool first.
On failure (non-zero exit): show the stderr lines the command printed, then show the
Mermaid source that was rendered, so the user can see both the cause and the input. A .md
file can print some diagrams and also fail on others: paste the diagrams, then the errors.
Pass these through when the user asks for them, right after render.mjs and before the path:
--ascii — ASCII glyphs for the frame and the diagram, for terminals that cannot render
Unicode box-drawing. Label text is kept as written.--spacious — more generous spacing than the default compact layout.--no-frame — the tidied diagram without a border. On a .md file, a <type> #<index>
header line precedes each block.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub ejklock/claude-mermaid-terminal --plugin mermaid-terminal