Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

draw-beautiful-mermaid

verified

Generates beautiful, themeable Mermaid diagrams (SVG/ASCII) using the beautiful-mermaid library. Handles installation and rendering.

View on GitHub

Marketplace

beautiful-mermaid-marketplace

jyoung105/beautiful-mermaid-plugin

Plugin

beautiful-mermaid-plugin

development

Repository

jyoung105/beautiful-mermaid-plugin

skills/draw-beautiful-mermaid/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/jyoung105/beautiful-mermaid-plugin/blob/main/skills/draw-beautiful-mermaid/SKILL.md -a claude-code --skill draw-beautiful-mermaid

Installation paths:

Claude
.claude/skills/draw-beautiful-mermaid/
Powered by add-skill CLI

Instructions

# Draw Beautiful Mermaid

This skill allows you to render Mermaid diagrams as high-quality SVGs or ASCII art using the `beautiful-mermaid` library. It is designed to replace default, plain Mermaid rendering with visually superior, themed output.

## Installation Check

Before rendering, always check if `beautiful-mermaid` is installed in the user's project.

1.  Check `package.json` for `beautiful-mermaid`.
2.  If missing, ask the user or install it:
    ```bash
    npm install beautiful-mermaid
    # or
    bun add beautiful-mermaid
    # or
    pnpm add beautiful-mermaid
    ```

## Usage

### 1. Using the Helper Script

This skill provides a helper script `scripts/render.ts` to quickly render diagrams.

**Syntax:**
```bash
npx tsx .claude/skills/draw-beautiful-mermaid/scripts/render.ts --input $'graph TD\n  A --> B' --output diagram.svg --theme tokyo-night
```

**Important:** The `beautiful-mermaid` parser requires newlines between lines (not semicolons) and spaces around arrows (`A --> B`, not `A-->B`). Use `$'...\n...'` in bash to embed newlines, or pass a `.mmd` file path instead.

**Options:**
- `--input, -i`: Mermaid diagram code (string) or path to a `.mmd` file.
- `--output, -o`: Output file path (default: `output.svg`). Extensions `.svg` or `.txt` determine format.
- `--theme, -t`: Theme name (see `references/THEMES.md`). Default: `zinc-light` (light) or `zinc-dark` (dark).
- `--ascii, -a`: Force ASCII output (for terminal display).

### 2. Programmatic Usage (in User Code)

If you are writing a script for the user:

**SVG Output:**
```typescript
import { renderMermaid, THEMES } from 'beautiful-mermaid';

const svg = await renderMermaid(`
  graph TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Action]
`, THEMES['tokyo-night']);
// Save 'svg' string to file
```

**ASCII Output:**
```typescript
import { renderMermaidAscii } from 'beautiful-mermaid';

const ascii = renderMermaidAscii(`graph LR\n  A --> B`);
console.log(ascii);
```

## Examples

### Beautifu

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2620 chars