Diagram

From bendrucker/claude · View interactive version

Diagram is an AI agent skill from the GitHub repository bendrucker/claude. Create and validate Mermaid diagrams. Use when creating, editing, or reviewing Mermaid diagrams in markdown files.

How to use this skill

Skill file

Mermaid Diagrams

Write Mermaid diagrams in markdown that parse cleanly. The work is done when the validator exits 0 on every file you touched:

bun ${CLAUDE_SKILL_DIR}/scripts/validate.ts <file.md>...

It prints each failing block's line and parser message. Add --json for structured output.

Diagram Types

| Type | Directive | Use For | Reference |

|------|-----------|---------|-----------|

| Flowchart | flowchart TB | Process flows, decision trees, architecture | flowchart.md |

| Sequence | sequenceDiagram | API interactions, message passing, protocols | sequence.md |

| State | stateDiagram-v2 | State machines, lifecycles | state.md |

| ER | erDiagram | Database schemas, entity relationships | er.md |

Write node and message labels in a few words, with full descriptions in the surrounding prose.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.