agentleFS
ryusuke-airyusuke-ai/argus/.claude/skills/mermaid-to-webp/SKILL.md

mermaid-to-webp

Skill1 starsChanged 9 months agoMITView on GitHub

Mermaid記法のテキストをWebP画像に変換するスキル。Mermaid図の共有を求められた場合も、図を画像化して渡すのが適切なことが多いため、このスキルを呼び出す。

The file

Files
SKILL.md

Mermaid to WebP Converter Skill

Overview

Mermaid記法で書かれたダイアグラムをWebP画像に変換するスキルです。フローチャート、シーケンス図、ER図など、Mermaidがサポートする全ての図形式に対応しています。

変換フロー:

[Mermaid Text] → [mermaid-cli] → [SVG] → [sharp] → [WebP]

使用タイミング

  • 「Mermaidで図を作ってWebP画像にして」と依頼されたとき
  • 「このフローチャートを画像にしたい」と言われたとき
  • ドキュメント用のダイアグラム画像が必要なとき
  • 「mermaid」「ダイアグラム」「フローチャート」「シーケンス図」などのキーワードがある場合

対応ダイアグラムタイプ

  • フローチャート (flowchart/graph)
  • シーケンス図 (sequenceDiagram)
  • クラス図 (classDiagram)
  • 状態図 (stateDiagram)
  • ER図 (erDiagram)
  • ガントチャート (gantt)
  • パイチャート (pie)
  • マインドマップ (mindmap)
  • その他Mermaid対応の全図形式

使用方法

基本的な使い方(ファイルから変換)

node .claude/skills/mermaid-to-webp/scripts/convert.js \
  --input path/to/diagram.mmd \
  --output path/to/output.webp

標準入力から変換

echo "graph TD; A-->B;" | node .claude/skills/mermaid-to-webp/scripts/convert.js \
  --stdin \
  --output path/to/output.webp

オプション付き変換

node .claude/skills/mermaid-to-webp/scripts/convert.js \
  --input path/to/diagram.mmd \
  --output path/to/output.webp \
  --width 1920 \
  --height 1080 \
  --quality 85 \
  --theme default \
  --background white

オプション一覧

オプション短縮説明デフォルト
--input-i入力Mermaidファイルパス (.mmd)-
--output-o出力WebPファイルパス-
--stdin-標準入力からMermaidテキストを読み込むfalse
--width-w出力幅(ピクセル)1920
--height-h出力高さ(ピクセル)1080
--quality-qWebP品質(1-100)85
--background-b背景色(transparent, white, #RRGGBBなど)white
--theme-tMermaidテーマ(default, dark, forest, neutral)default
--help-ヘルプを表示-

依存関係

以下のパッケージが必要です:

{
  "dependencies": {
    "@mermaid-js/mermaid-cli": "^11.0.0",
    "sharp": "^0.33.0"
  }
}

実行例

ユーザー: 「このフローチャートをWebP画像にして」
graph TD
    A[開始] --> B{条件分岐}
    B -->|Yes| C[処理A]
    B -->|No| D[処理B]
    C --> E[終了]
    D --> E

手順:
1. Mermaidテキストを一時ファイルに保存
   echo "graph TD..." > agent-workspace/temp.mmd

2. スクリプト実行
   node .claude/skills/mermaid-to-webp/scripts/convert.js \
     --input agent-workspace/temp.mmd \
     --output agent-output/flowchart.webp \
     --theme default \
     --background white

3. 結果報告
   agent-output/flowchart.webp が生成されました

注意事項

  • mermaid-cliはPuppeteerを使用するため、初回実行時にChromiumのダウンロードが発生する可能性がある
  • 大きな図の場合、変換に時間がかかる場合がある
  • 一時ファイルは処理完了後に自動的にクリーンアップされる

スクリプト

スクリプト用途
scripts/convert.jsMermaid → WebP変換メインスクリプト

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.