Back to skills
SKILL.md
Diagram
ASecurityCreate and validate Mermaid diagrams. Use when creating, editing, or reviewing Mermaid diagrams in markdown files.
- 17 stars
- 0 votes
- 0 copies
- 4 views
- Added February 7, 2026
Works with
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add bendrucker/claude --skill diagram --agent claude-codeAre you the author of Diagram?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bendrucker-diagram)---
name: diagram
description: Create and validate Mermaid diagrams. Use when creating, editing, or reviewing Mermaid diagrams in markdown files.
user-invocable: true
---
# Mermaid Diagrams
Create and validate Mermaid diagrams with syntax checking.
## Diagram Types
| Type | Directive | Use For |
|------|-----------|---------|
| Flowchart | `flowchart TB` | Process flows, decision trees, system architecture |
| Sequence | `sequenceDiagram` | API interactions, message passing, protocols |
| State | `stateDiagram-v2` | State machines, lifecycles, status transitions |
| ER | `erDiagram` | Database schemas, entity relationships |
## Validation
Validate mermaid syntax in markdown files:
```bash
bun ${CLAUDE_SKILL_ROOT}/scripts/validate.ts <file.md>
```
## References
- [Flowchart](./references/flowchart.md) — Nodes, edges, subgraphs, layout direction
- [Sequence](./references/sequence.md) — Participants, messages, activations, loops
- [State](./references/state.md) — States, transitions, composite states
- [ER](./references/er.md) — Entities, relationships, cardinality
## Best Practices
- Keep labels concise—use full descriptions in surrounding prose
- Use subgraphs to group related nodes visually
- Order participants/nodes to minimize edge crossings
- Prefer left-to-right (`LR`) for timelines, top-to-bottom (`TB`) for hierarchies
Files in this skill
- SKILL.md
- package.json
- references/er.md
- references/flowchart.md
- references/sequence.md
- references/state.md
- scripts/fixtures/invalid.md
- scripts/fixtures/no-mermaid.md
- scripts/fixtures/valid.md
- scripts/validate.test.ts
- scripts/validate.ts
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.