---
title: "mermaid"
url: "https://claudemods.dev/ja/builds/mermaid-5a425a"
source: "https://github.com/WhiteKr/claude-plugin-mermaid"
source_type: "github"
repo: "https://github.com/WhiteKr/claude-plugin-mermaid"
author: "WhiteKr"
author_handle: "WhiteKr"
stars: 0
category: "テーマ・外観"
categories: ["themes"]
tags: ["diagrams", "hooks", "mermaid", "plugin", "terminal-rendering", "ui-render"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add WhiteKr/claude-plugin-mermaid\nclaude plugin install mermaid@whitekr-claude-plugins"
added: "2026-10-13T00:40:35.164Z"
updated: "2026-10-13T00:40:35.164Z"
locale: "ja"
content_locale: "ja"
---

# mermaid

Claude の応答にある ```` ```mermaid ```` コードブロックを、ターミナル transcript 内で Unicode ボックス図として描画する function-hook プラグイン。`/show-me` などのスキルが出力する mermaid コードが対象。

## Description

# mermaid

Claude の応答にある ```` ```mermaid ```` コードブロックを、ターミナル transcript 内で Unicode ボックス図として描画する function-hook プラグイン。`/show-me` などのスキルが出力する mermaid コードが対象。

## インストール

```
/plugin marketplace add WhiteKr/whitekr-claude-plugins
/plugin install mermaid@whitekr-claude-plugins
```

開発中は `claude --plugin-dir <このフォルダ>` でロードする。

## 動作

- `ui.render` の `AssistantMessage` をフックし、閉じた ```` ```mermaid ```` フェンスを [beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid) ASCII レンダラーの描画結果に置き換える。保存されたメッセージ (ctrl+o) は変わらず、画面のみが変わる。
- 原文を保持する場合: パース失敗、ダイアグラム幅がターミナル幅を超える、フェンスがまだ閉じていない (ストリーミング中)。
- ラベル内のリテラル `\n` はスペースに置き換える (レンダラーが改行として描画するとボックスが崩れる)。
- 対応ダイアグラムは beautiful-mermaid ASCII レンダラーが対応する範囲 (flowchart、sequence、class、ER、state など) に従う。

## オプション

`/config` の plugin 項目、または settings の `pluginConfigs.mermaid.options`:

- `useAscii` (boolean、デフォルト false): ボックス文字の代わりに純粋な ASCII (`+-|>`) で描画する。ターミナルやフォントが `─│▶` のような ambiguous-width 文字を 2 セルで描画し行がずれるときにオンにする。

## 開発

`hooks/hooks.js` は `src/hooks.js` + beautiful-mermaid ASCII パスを esbuild でバンドルした成果物であり、コミット対象 (marketplace インストールはビルドなしでそのまま使う)。

```
npm i
npm test   # build + test/hooks.test.mjs
```

## Install

```
claude plugin marketplace add WhiteKr/claude-plugin-mermaid
claude plugin install mermaid@whitekr-claude-plugins
```

## Original README

# mermaid

Claude 응답의 ```` ```mermaid ```` 코드 블록을 터미널 transcript에서 유니코드 박스 다이어그램으로 바꿔 그리는 function-hook 플러그인. `/show-me` 같은 스킬이 내는 mermaid 코드가 대상이다.

## 설치

```
/plugin marketplace add WhiteKr/whitekr-claude-plugins
/plugin install mermaid@whitekr-claude-plugins
```

개발 중에는 `claude --plugin-dir <이 폴더>` 로 로드한다.

## 동작

- `ui.render` 의 `AssistantMessage` 를 훅해 닫힌 ```` ```mermaid ```` 펜스를 [beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid) ASCII 렌더러로 그린 결과로 치환한다. 저장된 메시지(ctrl+o)는 바뀌지 않고 화면만 바뀐다.
- 원문을 유지하는 경우: 파싱 실패, 다이어그램 폭이 터미널 폭을 넘김, 펜스가 아직 안 닫힘(스트리밍 중).
- 라벨 안의 리터럴 `\n` 은 공백으로 바꾼다(렌더러가 줄바꿈으로 그리면 박스가 깨짐).
- 지원 다이어그램은 beautiful-mermaid ASCII 렌더러가 지원하는 범위(flowchart, sequence, class, ER, state 등)를 따른다.

## 옵션

`/config` 의 plugin 항목 또는 settings `pluginConfigs.mermaid.options`:

- `useAscii` (boolean, 기본 false): 박스 문자 대신 순수 ASCII(`+-|>`)로 그린다. 터미널·폰트가 `─│▶` 같은 ambiguous-width 글자를 2칸으로 그려 줄이 어긋날 때 켠다.

## 개발

`hooks/hooks.js` 는 `src/hooks.js` + beautiful-mermaid ASCII 경로를 esbuild 로 묶은 산출물이며 커밋 대상이다(마켓플레이스 설치는 빌드 없이 그대로 쓴다).

```
npm i
npm test   # build + test/hooks.test.mjs
```
