sc-mermaid
БесплатноБез исполняемых скриптовНе проверенChoose the right kind of diagram for what the user is describing, then write and validate it in mermaid. This skill SHOULD be used when the user asks to…
от kylesnowschwartz★ 116 звёзд на GitHubОб этом скилле
Mermaid diagrams
The table below covers twelve common kinds of mermaid diagram. The default pull is toward
flowchart for everything, and most requests that arrive as "diagram this" are better served by something
else. Pick the type first.
1. Pick the type
| What the user has | Draw |
|---|---|
| Services, components, and how they connect | flowchart |
| Who calls whom, in order, over time | sequenceDiagram |
| One thing moving between statuses | stateDiagram-v2 |
| Tables and their relationships | erDiagram |
| Types, fields, and inheritance | classDiagram |
| Steps a person goes through, with how each one feels | journey |
| Dated events, with no durations or dependencies | timeline |
| Options scored on two axes | quadrantChart |
| Branches and merges | gitGraph |
| Amounts splitting and flowing between stages | sankey-beta |
| Loose ideas hanging off one topic | mindmap |
| System context for a non-technical reader | C4Context |
Mermaid has more types than the table lists. Use gantt for a schedule with durations or
dependencies, and pie for shares of a whole. For anything else, check the type list in the
Mermaid documentation (https://mermaid.js.org/intro/) rather than forcing the request into a
table row.
State the type you chose and the reason, in one line, before drawing. When two types fit,
name both and say why you picked one. When the request is too vague to choose, ask rather
than defaulting to flowchart.
Signals worth acting on: the words "status", "state", or "lifecycle" point at
stateDiagram-v2 rather than a flowchart with status boxes. A schema question points at
erDiagram. "What happens when a user does X" points at sequenceDiagram. A comparison
of options points at quadrantChart.
2. Ground it in the code
Read the relevant files before drawing anything. A diagram that does not match the codebase is worse than no diagram, because it carries authority it has not earned.
- Scope the diagram: decide what the reader needs and leave the rest out.
- Read the files and follow the actual data and control flow.
- Check each node and each arrow against the code, and note which file confirms it.
Name things in domain terms. "Payment reconciliation worker" tells the reader more than "Service B". Label every arrow with what crosses it.
3. Validate and save
Write the diagram to {descriptive-name}.mmd in the current directory, or ask where it
should go, then validate it:
mmdc -i <file>.mmd -o <file>.svg -q
It prints nothing and exits 0 on success. On invalid syntax it exits 1 and prints a
Parse error with a line number, so check the exit code: a nonzero exit or a Parse error
on stderr means the diagram is invalid. Fix the error and re-run. Never hand over a diagram
that has not passed this check.
mmdc needs a real output path ending in .svg, .png, .pdf, or .md, so /dev/null
does not work. The .svg it writes is the preview; mention it, and delete it if the user
wanted only the source. To validate without leaving a preview, render to a temporary SVG
instead (-o "$(mktemp -d)/check.svg"); the exit code means the same thing.
If mmdc is missing, tell the user to run npm install -g @mermaid-js/mermaid-cli and
stop. Do not skip validation.
4. Report
Give the user four things:
- The diagram source.
- The path it was written to.
- A short explanation of what it shows, brief enough to put on a slide.
- The file that confirms each component, so anyone can check the diagram against the code.
Установить sc-mermaid в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sc-mermaid?
Choose the right kind of diagram for what the user is describing, then write and validate it in mermaid. This skill SHOULD be used when the user asks to "create a diagram", "draw an architecture diagram", "sequence diagram", "flowchart", "state diagram", "ER diagram", "visualise the system", "map the services", "diagram this", or "generate mermaid".
Как установить скилл sc-mermaid?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sc-mermaid запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic