Skip to content
Back to skills

Diagrams

ASecurity

Draw Mermaid diagrams in Markdown to show architecture, request flows, data models and state changes. Use when a structure or flow is easier to show than to describe, when writing a CONTEXT.md or plan, or when asked for a diagram.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
ai-agentsgosqlnodefastapigitapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add Zejnilovic/agd --skill diagrams --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Diagrams?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Diagrams
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zejnilovic-diagrams/badge)](https://www.skillsdirectory.com/skills/zejnilovic-diagrams)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: diagrams
description: Draw Mermaid diagrams in Markdown to show architecture, request flows, data models and state changes. Use when a structure or flow is easier to show than to describe, when writing a CONTEXT.md or plan, or when asked for a diagram.
---

<!-- From agentic-defaults. Kit updates replace this file except a "## This project" section at the end, which belongs to the project. Edit nothing else. Rules for all work go in AGENTS.md "This project". -->

# Diagrams with Mermaid

Draw a diagram when it replaces several paragraphs: how components connect, how a request moves through the system, what the data model looks like, how something changes state. Don't draw what one sentence can say.

Write diagrams as `mermaid` code blocks inside the Markdown they explain: a `CONTEXT.md`, a plan or a pull request description. GitHub and GitLab render them, they diff like text, and people and agents can edit them. VS Code needs a Mermaid extension to preview them.

## Pick the type

| To show | Use |
|---|---|
| Components and how they connect, module dependencies, process steps | `flowchart` |
| Messages between parts over time, such as a request through services | `sequenceDiagram` |
| Data model and relationships | `erDiagram` |
| Lifecycle of one thing, such as an order going from placed to paid to shipped | `stateDiagram-v2` |
| Classes and interfaces, only when the design is strongly object-oriented | `classDiagram` |

## Rules

- **One idea per diagram, at most about 12 nodes.** Split bigger pictures: an overview in the root `CONTEXT.md`, and details next to the code they describe.
- **Use the real names from the code**, so readers can search for them.
- **Label the arrows** with what moves or happens: `HTTP`, `publishes OrderPaid`, `reads`.
- **Show external systems** (databases, queues, third-party APIs) as distinct nodes, for example inside a subgraph named `External`.
- **No colors or styling.** They break in dark mode and add nothing.
- **Keep diagrams current.** A diagram is part of the doc it sits in, so update it in the same change that makes it wrong.

## Syntax that breaks rendering

- Quote labels that contain punctuation: `A["Parse (v2)"]`, not `A[Parse (v2)]`.
- Don't use `end` as a node id in a flowchart; use `done` or `finish`.
- Keep node ids to letters, digits and underscores, and put the display text in the label: `order_svc["Order service"]`.
- Write subgraphs as `subgraph ext [External]` … `end`.
- Break lines inside a label with `<br/>`.

## Check it

If the Mermaid CLI is installed (`mmdc`), render to a temporary folder to catch syntax errors: `mkdir -p /tmp/mermaid-check && mmdc -i doc.md -o /tmp/mermaid-check/doc.md`. Otherwise stick to the syntax shown here.

## Examples

```mermaid
flowchart LR
  user[Browser] -->|HTTPS| api["API (FastAPI)"]
  api -->|SQL| db[(PostgreSQL)]
  api -->|publishes OrderPaid| queue[[RabbitMQ]]
  queue --> worker[Email worker]
```

```mermaid
sequenceDiagram
  participant C as Client
  participant A as API
  participant P as Payment provider
  C->>A: POST /orders
  A->>P: create charge
  P-->>A: charge id
  A-->>C: 201 Created
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.