Skip to content
Agentmart
Submit a tool

cmd-mermaid-render

Render and display Mermaid diagrams inline in iTerm2 or Ghostty.

Skill by Olshansk

IndexedMIT★ 9
Write a review

Chalk Labs

Need help deploying cmd-mermaid-render?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/olshansk-cmd-mermaid-render

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Render and display Mermaid diagrams inline in iTerm2 or Ghostty. Use when creating, editing, or iterating on mermaid diagrams. Triggers on mermaid diagram work — flowcharts, sequence, state, class, ER, and XY charts.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Shell scripts

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cmd-mermaid-render

Tools it pre-approves 4

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read
  • Write
  • Edit
  • Bash

What's inside

Skill name
cmd-mermaid-render
Description
Render and display Mermaid diagrams inline in iTerm2 or Ghostty. Use when creating, editing, or iterating on mermaid diagrams. Triggers on mermaid diagram work — flowcharts, sequence, state, class, ER, and XY charts.
License
MIT
Allowed tools
Read, Write, Edit, Bash
Instructions
172 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Pre-approves any shell command

Files (2)

  • SKILL.md
  • render.sh · scripts/

SKILL.md (first lines)

# Mermaid Diagram Renderer <!-- omit in toc -->

Render mermaid diagrams to PNG and display them inline. Supports iTerm2 (imgcat) and Ghostty (kitten icat). Built for fast visual iteration.

<!-- TODO: Once Claude Code supports inline image passthrough, update the workflow
     to display directly instead of printing the view command.
     Tracking: https://github.com/anthropics/claude-code/issues/29254 -->

- [Workflow](#workflow)
- [Prerequisites](#prerequisites)
- [Rendering](#rendering)
- [Iteration Rules](#iteration-rules)
- [Mermaid Syntax Cheatsheet](#mermaid-syntax-cheatsheet)

## Workflow

Every time you generate or modify mermaid code, immediately render and display it. Never ask "want me to render?" — just do it.

**Write the mermaid code:**

```bash
cat > /tmp/mermaid-diagram.mmd << 'MERMAID'
graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action]
    B -->|No| D[End]
MERMAID
```

**Render:**

```bash
"${CLAUDE_SKILL_DIR}/scripts/render.sh" /tmp/mermaid-diagram.mmd
```

The script outputs `Rendered: <path>` and `View: <command>`. **Always print the `View:` command for the user** so they can copy-paste it to see the diagram inline. Claude Code's Bash tool captures stdout, so inline images won't display automatically.

If the user provides a specific file path, use that instead of `/tmp/mermaid-diagram.mmd`.

## Prerequisites

On first use, check that `mmdc` is available:

```bash
which mmdc || echo "MISSING: Run 'npm install -g @mermaid-js/mermaid-cli'"
```

The display command (`imgcat` or `kitten icat`) is detected automatically based on `$TERM_PROGRAM`. No manual setup needed — the script falls back to `open` if neither is available.

## Rendering

The `render.sh` script handles rendering with sensible defaults. It supports these flags:

- `--theme <name>` — mermaid theme: `default`, `dark`, `forest`, `neutral` (default: `default`)
- `--width <px>` — output width in pixels (default: `1200`)
- `--bg <color>` — background color (default: `transparent`)
- `--css <path>` — custom CSS file for styling
- `--output <path>` — custom output path (default: replaces `.mmd` with `.png`)

**Examples:**

```bash
"${CLAUDE_SKILL_DIR}/scripts/render.sh" /tmp/mermaid-diagram.mmd --theme dark
```

```bash
"${CLAUDE_SKILL_DIR}/scripts/render.sh" /tmp/mermaid-diagram.mmd --width 2400
```

```bash
"${CLAUDE_SKILL_DIR}/scripts/render.sh" /tmp/mermaid-diagram.mmd --output ~/Desktop/diagram.png
```

## Iteration Rules

- After each user edit request, update the `.mmd` file and re-render immediately
- Show the `View:` command after every change — the user should never have to ask
- Keep the `.mmd` file path consistent within a session so edits accumulate
- If `mmdc` reports a syntax error, show the error message and fix the mermaid code before retrying
- Use the cheatsheet below for syntax reference when iterating

## Mermaid Syntax Cheatsheet

### Graph Directions

`graph TD` (top-down), `graph LR` (left-right), `graph BT` (bottom-top), `graph RL` (right-left)

### Node Shapes

```text
A[Rectangle]    B(Rounded)    C{Diamond}
D((Circle))     E[[Subroutine]]   F[(Database)]
G>Asymmetric]   H{{Hexagon}}  I[/Parallelogram/]
```

### Link Styles

```text
A --> B           Solid arrow
A --- B           Solid line (no arrow)
A -.-> B          Dotted arrow
A ==> B           Thick arrow
A -->|label| B    Arrow with label
A -- text --> B   Arrow with text (alternate)
```

### Subgraphs

```text
subgraph Title
    A --> B
end
```

### Styling

```text
style A fill:#f9f,stroke:#333,stroke-width:2px
classDef highlight fill:#ff0,stroke:#333

From Olshansk/agent-skills, MIT.

More from Olshansk/agent-skills

Signals

Stars
9
Forks
0
Open issues
0
Last commit (this folder)
May 3, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Olshansk

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get cmd-mermaid-render running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying cmd-mermaid-render?

CallGet help
Cite this page

cmd-mermaid-render skill. Agent Mart. https://agentmart.dev/skills/olshansk-cmd-mermaid-render (last updated 2026-10-24)