Use when designing, reviewing, or refactoring a CLI that must serve AI agents alongside humans, or when converting an API or SDK into an agent-usable CLI interface.
日本語の概要は準備中です。原文の説明を表示しています。
Generate Mermaid diagrams (.mmd) and export to PNG/SVG/PDF using mmdc CLI or Kroki API. USE THIS SKILL when user mentions diagram, flowchart, sequence diagram, class diagram, ER diagram, state machine, architecture, visualize, git graph, 画图, 架构图, 流程图, 时序图, 类图, ER图, 甘特图, 状态机. PROACTIVELY USE when explaining ANY system with 3+ components, API flows, authentication sequences, class hierarchies, database schemas, or state machines. Supports 17+ diagram types with fully automatic layout.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Generate .mmd text files and export to PNG/SVG/PDF using mmdc (local) or Kroki API (no install).
Key advantage: Text-based syntax with fully automatic layout — no x/y coordinates needed.
Use this skill for: diagrams-as-code with automatic layout (flowchart, sequence, class, state, ER, gantt, mindmap, architecture) — text source that lives in git and embeds in Markdown.
Do NOT use it — route elsewhere — for:
Option A: Local (mmdc) — also needs a headless Chrome (mmdc renders via Puppeteer)
npm install -g @mermaid-js/mermaid-cli
npx puppeteer browsers install chrome-headless-shell # required — mmdc has no bundled browser
mmdc --version
mmdc --versionsucceeds even with no Chrome installed, but every export then fails withCould not find Chrome. Install the browser above (or setPUPPETEER_EXECUTABLE_PATHto a system Chrome). If you can't, use Kroki (Option B) — it needs no browser.
CI / Docker: mmdc crashes with Running as root without --no-sandbox in containers. Pass the bundled puppeteer config (see scripts/puppeteer-config.json):
mmdc -p scripts/puppeteer-config.json -i diagram.mmd -o diagram.png
Option B: Kroki API (no install)
curl --version # Just need curl
curl); check mmdc --version and a headless Chrome only when local export (PNG quality / PDF) is wanted.mmd file to diskmmdc or Kroki API to produce PNG/SVG/PDF.mmd edit per request, re-export until approved (5-round safety valve). See Review Loop below.NEVER export a diagram without validating first.
Prefer Kroki for validation — it needs no browser and sidesteps the Could not find Chrome trap entirely. Use mmdc for validation only when offline.
# Validate with Kroki (preferred — no browser needed)
curl -s -X POST -H "Content-Type: text/plain" --data-binary @diagram.mmd https://kroki.io/mermaid/svg -o /tmp/test.svg && echo "Valid" || echo "Invalid"
# Validate with mmdc (offline fallback — requires headless Chrome)
mmdc -i diagram.mmd -o /tmp/test.svg 2>&1
# If error, fix the .mmd file and validate again
# Only proceed to export after validation passes
Common validation errors:
->> for sequence, --> for flowchart)A
Could not find Chrome(or puppeteer) error frommmdcis a setup problem, not a diagram error — the.mmdmay be perfectly valid. Validate via Kroki instead of "fixing" correct syntax.
Zero-cost pre-check: before spending a vision call, read the PNG dimensions (sips -g pixelWidth -g pixelHeight diagram.png on macOS, file diagram.png elsewhere). An extreme aspect ratio (longer side > 8x the shorter) is a "wrong orientation" defect — fix it without vision.
Validation (above) only proves the syntax is legal — it says nothing about whether the rendered diagram is readable. After exporting, use the agent's vision capability to read the PNG and catch what automatic layout can't prevent. Mermaid positions everything itself, so the failures here are about content and readability, not overlaps:
| Check | What to look for | Fix |
|---|---|---|
| Label truncation | Node / edge text clipped or cut off | Shorten the label, or wrap it with <br/> |
| Cramped, unreadable density | Too many nodes crammed together; tangled lines | Flip direction (TD↔LR), split into subgraphs, or reduce nodes |
| Wrong orientation / aspect | Diagram far too wide or too tall to read | Change flowchart TD↔LR (or set direction in class/state) |
| Edge spaghetti | Many edges crossing, hard to follow | Reorder node declarations so connected nodes sit adjacent; group with subgraph |
| Wrong diagram type | Type doesn't suit the content (e.g. flowchart for a timeline) | Switch type (gantt, sequenceDiagram, stateDiagram-v2, …) |
| Low contrast | Text blends into the node fill | Adjust classDef / theme so text contrasts the fill |
After self-check, show the exported image and collect feedback. Apply the minimal .mmd edit for each request, then re-validate and re-export:
| User request | Edit action |
|---|---|
| Change a label | Edit the node / edge text in the .mmd |
| Add / remove a node or edge | Add or delete the matching line |
| Change a color | Add / adjust a classDef and class <node> <className> |
| Change layout direction | Swap TD↔LR (flowchart) or set direction (class / state) |
| Restructure / group | Wrap related nodes in a subgraph, or regenerate |
diagram.mmd / diagram.png each round — don't create v1, v2, …When the review loop ends (approved or safety-valve), generate a one-click link that opens the current .mmd in the mermaid.live editor for interactive fine-tuning:
python3 scripts/mermaid_live_link.py diagram.mmd
# -> https://mermaid.live/edit#pako:...
Pure zlib + base64 (raw-deflate + URL-safe base64, same encoding mermaid.live uses), works offline. The script self-verifies with a round-trip decode before printing.
When the user asks to diagram a whole repo ("survey this codebase", "map the architecture"):
index.html (title + one section per diagram, no CDN), so the user opens one fileSame validation and self-check rules apply to every diagram in the batch.
| Type | Keyword | Use for |
|---|---|---|
| Flowchart | flowchart TD/LR | processes, pipelines, decisions |
| Sequence | sequenceDiagram | API calls, message passing |
| Class | classDiagram | OOP models, data structures |
| ER | erDiagram | database schemas |
| State | stateDiagram-v2 | state machines, lifecycle |
| Gantt | gantt | project timelines |
| Pie | pie | proportions |
| Git Graph | gitGraph | branch strategies |
| C4 Context | C4Context | high-level system context |
| Architecture | architecture-beta | cloud / CI/CD service layouts |
| Mind Map | mindmap | topic breakdowns |
| User Journey | journey | user-experience flows |
| Use Case | usecase-beta | actor–system interactions (UML) |
| Cynefin | cynefin-beta | sense-making / complexity domains |
| Event Modeling | eventmodeling | event-driven system timelines |
| Tree View | treeView-beta | file / directory hierarchies |
| Wardley Maps | wardley-beta | business strategy / value chains |
Flowchart: See reference/FLOWCHART.md Sequence: See reference/SEQUENCE.md Class & ER: See reference/CLASS-ER.md Architecture: See reference/ARCHITECTURE.md Use Case: See reference/USECASE.md Other types: See reference/OTHER-TYPES.md Themes & styling: See reference/THEMES.md
See reference/EXAMPLES.md for four worked examples (JWT auth sequence, microservices architecture, order state machine, cloud architecture) — each with the user prompt, the generated .mmd, and the output files.
Requires mmdc installed locally. Best for offline use.
# PNG (recommended: 2048px wide, white background)
mmdc -i diagram.mmd -o diagram.png -w 2048 --backgroundColor white
# PNG with theme — valid -t values: default | dark | neutral | forest
# (`base` is NOT a valid -t value; it only works inside a %%{init: {'theme':'base'}}%% directive)
mmdc -i diagram.mmd -o diagram.png -w 2048 --backgroundColor white --theme neutral
# SVG
mmdc -i diagram.mmd -o diagram.svg
# PDF
mmdc -i diagram.mmd -o diagram.pdf
Use Kroki when mmdc is not available. No local dependencies needed.
# SVG via Kroki
curl -X POST -H "Content-Type: text/plain" --data-binary @diagram.mmd https://kroki.io/mermaid/svg -o diagram.svg
# PNG via Kroki
curl -X POST -H "Content-Type: text/plain" --data-binary @diagram.mmd https://kroki.io/mermaid/png -o diagram.png
# PDF is NOT supported by Kroki for Mermaid — POSTing to /mermaid/pdf returns
# HTTP 400 ("Unsupported output format: pdf for mermaid. Must be one of png or svg").
# For PDF, use the local mmdc path instead: mmdc -i diagram.mmd -o diagram.pdf
Kroki advantages:
curlWhen to use Kroki:
mmdc installation fails| Mistake | Fix |
|---|---|
mmdc not found | npm install -g @mermaid-js/mermaid-cli |
mmdc error Could not find Chrome | Install the headless browser: npx puppeteer browsers install chrome-headless-shell (or use Kroki) |
| Kroki PDF fails with HTTP 400 | Kroki does PNG/SVG only for Mermaid; use local mmdc for PDF |
Valid diagram reported "invalid" by mmdc | The error is a Chrome/puppeteer setup failure, not a syntax error — don't rewrite correct .mmd; fix the browser or validate via Kroki |
| Wrong arrow in sequence | Use ->> for request, -->> for response |
| Special chars in label | Wrap in quotes: A["Label: value"] |
| Blank/small output | Add -w 2048 flag |
| Participant order wrong | Declare participant explicitly at top |
| Subgraph name with spaces | Wrap in quotes: subgraph "My Layer" |
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use when designing, reviewing, or refactoring a CLI that must serve AI agents alongside humans, or when converting an API or SDK into an agent-usable CLI interface.
日本語の概要は準備中です。原文の説明を表示しています。
Search free commercial-use creative assets across multiple online sources — photos, illustrations, icons, video footage, music, sound effects, and fonts. Use when the user needs to find assets for videos, PPTs, articles, or any content creation. Trigger on phrases like "find me a photo of", "search for icons", "I need background music", "find video footage", "search fonts", "找一张图片", "搜素材", "帮我找图标/视频/音乐/字体". Covers Pexels, Unsplash, Pixabay, Iconify, Freesound, Google Fonts and more — with API-backed search where available.
日本語の概要は準備中です。原文の説明を表示しています。
Query the Semantic Scholar academic corpus through AI2's Asta MCP server: keyword or title search with venue and date filters, who-cited-a-paper traversal, author profiles and publications, DOI/arXiv/PMID lookup, and ~500-word full-text snippets for evidence, with citation counts and h-index. Use when the user asks for papers on a topic, who cited a paper, an author's work, recent literature since a date, or a venue-scoped paper list. Requires the Asta MCP server.
日本語の概要は準備中です。原文の説明を表示しています。
Extract and organize frames from a Bilibili video (bangumi episode, UP upload, or a local file) into scenery shots and per-character image groups, using anime-specific person detection + CCIP character-identity embeddings. Two modes — cluster everyone, or pull out one (or several) named characters via reference folders. Use when the user wants to collect, extract, or organize anime frames/screenshots by character or by scenery from a Bilibili video. Read-only download for personal viewing/analysis; uploads nothing.
日本語の概要は準備中です。原文の説明を表示しています。
Fetch Bilibili (哔哩哔哩) video comments for UP主 self-analysis. Use when the user asks to collect, download, export, or analyze comments on a Bilibili video (BV号 / URL / UID). Produces JSONL + summary.json suitable for further Claude Code analysis (sentiment, keywords, audience trends). Read-only; does not post/edit/delete.
日本語の概要は準備中です。原文の説明を表示しています。
Use when user requests diagrams, flowcharts, architecture charts, or visualizations. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Generates .excalidraw files and exports to PNG/SVG via Kroki API or locally using excalidraw-brute-export-cli.
日本語の概要は準備中です。原文の説明を表示しています。