Skip to content
Back to skills

Diagram

ASecurity

Use to draw how a system fits together (architecture, workflow, sequence, data flow, state, ERD) as Mermaid plus an evidence table tying each box and arrow to a source line. Triggers - "diagram", "draw the architecture", "map how X calls Y", "show the data flow", "ERD of this schema". Not for decorative pictures or charts of numbers.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
developmentgobashnodegitapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add aldianriski/lean-flow --skill diagram --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Diagram?

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

Security grade badge for Diagram
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aldianriski-diagram/badge)](https://www.skillsdirectory.com/skills/aldianriski-diagram)

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: diagram
description: Use to draw how a system fits together (architecture, workflow, sequence, data flow, state, ERD) as Mermaid plus an evidence table tying each box and arrow to a source line. Triggers - "diagram", "draw the architecture", "map how X calls Y", "show the data flow", "ERD of this schema". Not for decorative pictures or charts of numbers.
argument-hint: "[what to draw - e.g. the request path, the loop, the schema]"
allowed-tools: Read, Glob, Grep, Write, Edit, Bash(git rev-parse *), Bash(git status *)
user-invocable: true
version: "0.1.0"
---

# diagram

Draw one relationship as Mermaid, and back every id on it with a source. A diagram written from
memory looks the same whether it is true or invented; the evidence table is what makes it checkable.
Bash is for read-only git only (`git rev-parse HEAD`, `git status --short`).

## Steps

1. **Frame it.** State the question, the audience, the scope, and whether the diagram shows the
   system as it is (**actual**) or as it should be (**proposed**). Ask only if that is genuinely unclear.
2. **Read the sources.** Entry points, config, call sites, persistence, deploy files. Runtime
   evidence is a call, a write or a read that you can point at, not a name or a description.
3. **Write the evidence table** before drawing - one row per component or edge id. Columns,
   statuses and examples: `references/evidence-record.md`. No source found means status `unknown`.
4. **Draw the Mermaid** from the table only. Status goes in the label text of every id, since style
   alone is lost in some viewers; dotted lines are a secondary cue.
   - Node: `N1["api - called"]`. Edge: `A -->|E1 called| B`; otherwise `A -.->|E2 configured| B`
     (also `proposed`, `unknown`).
   - Sequence: `A->>B: E1 called`. ER: status in the relationship label,
     e.g. `CUSTOMER ||--o{ ORDER : "E3 called"`.
5. **Place it** (map below) and report the unknowns last.

## Rules

- A configured adapter that nothing calls is `configured`, never `called`, and never joined by a solid `-->`.
- Never add a service, control, tenant or throughput figure you did not read. Missing means `unknown`.
- Draw the edge where the call actually happens: if a server owns the storage, the client gets no arrow to it.
- Uncommitted edits are `working-tree` facts, not facts about the last commit.
- Redact credentials, tokens and private addresses in labels, rows and quoted lines.
- Mermaid text only; no generated pictures.
- Pick the view by the question: runtime ownership - architecture; ordering and failure - workflow;
  calls over time - sequence; where data moves or rests - dataflow; allowed transitions - state;
  entities - ERD.
- Too dense for one canvas? Draw an overview plus targeted views; never drop an edge to make it fit.

## Update

`/diagram update <diagram file>` re-reads the sources behind an existing diagram and its table, and
changes only the ids whose source changed. Keep ids stable; a rerun with no source change writes
nothing. A vanished source turns its row `unknown` with the date, never deleted. Procedure:
`references/evidence-record.md` § Updating.

## Where the output goes

If the repo already has the standard doc slots, use them and keep each within its line cap, with
diagram and table together. Over the cap: one overview diagram, then one diagram per area.

| View | Path | Cap |
|---|---|---|
| workflow, sequence, state | `docs/flows/<slug>.md` | 100 |
| dataflow | `docs/architecture/data-flow.md` | 120 |
| cross-service calls | `docs/architecture/service-dependencies.md` | 120 |
| ERD | `docs/database/erd.md` | 120 |
| whole system | a section of `docs/architecture/overview.md` | 150 |

No such docs, or the user names a path: output inline or at that path. Create no folder layout.

## Degrades gracefully

- No git: revision is `working-tree`, or today's date.
- No docs, no sprint files, no lean-flow layout: the skill reads whatever source exists and needs nothing else.
- Source you cannot open (generated, remote, binary): the row is `unknown`, with the reason.

## Finish

Run the self-check in `references/evidence-record.md` (every id has exactly one row; every
`called` row has a cited call site; no solid edge touches a non-`called` id; no edge outranks either end), then show the diagram,
the table, and a one-line list of unknowns and what would resolve each.

Files in this skill

  • SKILL.md4.3 KB
  • references/evidence-record.md4.2 KB

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 development →

Comments

Loading comments…

Newsletter

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