diagram
Skill0 starsChanged 2 months agoMITView on GitHub
Generate accurate Mermaid diagrams from codebase analysis. Use when explicitly asked to visualize architecture, types, Git history, sequences, or state; return GitHub-native Mermaid or optionally render SVG/PNG with mmdc.
51 other projects use a version of this.
Adopted by
Most recently taken up by
- jame-hv/brse-toolkittheir own version, first seen Nov 8, 2026
- clearsmog/claude-skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- ActuallyNodejam/openpaperworktheir own version, first seen Nov 8, 2026
- seayniclabs/homelab-infra-mcptheir own version, first seen Nov 8, 2026
Used with
Projects with it also use ios-sync, benchmark-models and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Saqlain-811Skillios-sync
Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)
Also in 4 projects that use this
ShreyRaviSkillbenchmark-models
Cross-model benchmark for gstack skills. Runs the same prompt through Claude, GPT (via Codex CLI), and Gemini side-by-side — compares latency, tokens, cost, and optionally quality via LLM judge. Answers "which model is actually best for this skill?" with data instead of vibes. Separate from /benchmark, which measures web page performance. Use when: "benchmark models", "compare models", "which model is best for X", "cross-model comparison", "model shootout". (gstack) Voice triggers (speech-to-text aliases): "compare models", "model shootout", "which model is best".
Also in 5 projects that use this
ShreyRaviSkilllanding-report
Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)
Also in 5 projects that use this
timurgaleevSkilldocument-generate
Generate missing docs for a feature, module or project as tutorials, how-tos, reference and explanation.
Also in 4 projects that use this
Saqlain-811Skillios-clean
Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)
Also in 3 projects that use this
seek888Skillopen-gstack-browser
Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".
Also in 4 projects that use this
- +2 more from ShreyRavi
- +1 more from Saqlain-811
Other versions51 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 51
- garrytan/gstack★ 141ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- HybridAIOne/hybridclaw★ 159same name
- Kastalien-Research/thoughtbox★ 64same name
- jantichy/claude★ 45same name
- domengabrovsek/agent-config★ 22same name
- domengabrovsek/claude★ 22same name
- heathdutton/claude-d2-diagrams★ 16same name
- johnlindquist/claude-workshop-skills★ 16same name
41 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 7 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 43 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
No arguments: /diagram — detect scope from context.
- Very specific: line 38
Default: flowchart TD if no type is specified (covers most PR-architecture visuals).
- Very specific: line 52
Labels: always use "quoted labels" around text with special characters, spaces, or punctuation.
- Very specific: line 55
Default orientation TD (top-down).
- Distinctive: line 66
Use for PR context: show the branch relationship, not every commit.
- Distinctive: line 69
Consider whether a gitGraph truly clarifies — for a single-branch PR with 5 linear commits, text suffices.
- Distinctive: line 87
If the subject exceeds these limits, split into multiple diagrams — one per subsystem, layer, or concern.
- Very specific: line 94
Every diagram MUST include accessibility metadata as the first lines inside the `mermaid block:
- Very specific: line 113
Place these inside the Mermaid frontmatter block (the --- delimited section at the top) so Mermaid renders them as SVG <title> and <desc> …
- Very specific: line 149
If mmdc is not installed (command -v mmdc fails) and --render local was requested, fall back to inline mode and report: "Local rendering …
- Very specific: line 153
When /diagram is called from /pr, the scope is the PR's diff range.
- Distinctive: line 176
No tool attribution: Never add "Generated by AI" or credits anywhere near a diagram.
- Very specific: line 177
Labels use project language: Use terms from Context/Glossary.md if it exists.
- Very specific: line 178
Diagrams for Grove: When activated by the consolidate skill, follow that skill's bundled protocol: diagrams are first-class knowledge …
- Distinctive: line 182
Auto-generating a diagram for every PR: Not every change needs a visual.
- Very specific: line 186
Unvalidated Mermaid syntax: If uncertainty exists about whether a syntax form renders on GitHub (bleeding-edge feature, recently changed …
- Very specific: line 194
If the diagram was for a PR → the agent embeds the `mermaid block in the PR description, and /pr continues with the rest of the summary.
- Distinctive: line 195
If the diagram was standalone → the agent presents the block and waits for further direction.
- Distinctive: line 196
If the diagram uncovered a code structure issue or suggestion → the agent flags it before continuing.
“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Produce Mermaid.js diagrams that make codebase structure, architecture changes, and system interactions visible at a glance. A diagram earns its place when a reviewer parses a picture faster than prose — no decoration, no surplus.
The diagram definition is Mermaid syntax inside a ```mermaid fenced code block. GitHub renders these natively in PR descriptions, issues, READMEs, and any markdown file. No CLI tool needed for inline rendering.
1. Scope
Determine what to visualize from the request supplied with this skill invocation. If no scope was supplied and the skill was activated by pr, derive the scope from the diff range in §7. Otherwise ask: "What would you like me to diagram?"
The invocation request may identify:
- A path — file, directory, or module to analyze
- A git range —
HEAD~5..HEAD,main..feature - A diagram type —
flowchart,classDiagram,gitGraph,sequenceDiagram,stateDiagram-v2, orauto - A description — "the auth middleware chain", "how the payment pipeline works"
Combine them: /diagram flowchart src/routes/ — "flowchart of the route dependency graph."
No arguments: /diagram — detect scope from context. If none exists (not in a PR, no obvious target), ask.
2. Diagram types and when to use them
| Type | Use Case | Example | |
flowchart TD/LR | Architecture overviews, data flow, module dependencies, CI/CD pipelines | A[Client] --> B[Router] --> C[Handler] | |
classDiagram | Type/interface hierarchies, inheritance, composition | `Vehicle < | -- Car, Store *-- Product` |
gitGraph | PR branch/commit strategy, release histories | commit id:"abc123", branch feature-x, checkout feature-x | |
sequenceDiagram | API request flows, middleware chains, async message passing | Client->>+Server: GET /api/orders | |
stateDiagram-v2 | State machines, workflow states, reducer transitions | pending --> approved: authorize | |
block-beta | Codebase layout, directory structure, container diagrams | block "src" → sub-blocks |
Default: flowchart TD if no type is specified (covers most PR-architecture visuals). Use auto when the agent should pick the best type for the target.
3. Conventions
General
- Node IDs: short, uppercase identifiers. Labels in brackets.
- Rectangle:
A[Client App] - Rounded:
A(Process Request) - Circle:
A((Auth)) - Diamond:
A{Valid?} - Database:
A[(PostgreSQL)]
- Rectangle:
- Edges:
A --> Bfor directed flow.A --- Bfor undirected.A -.-> Bfor async/optional.A == Bfor thick/emphasis. - Subgraphs: group related nodes. Give them a label:
subgraph Auth[Auth Layer]. - Comments:
%% comment text— use to annotate sections the reader should note but the viewer doesn't render. - Labels: always use
"quoted labels"around text with special characters, spaces, or punctuation. Avoid unquoted single-word labels unless truly single and ASCII-safe.
flowchart
- Default orientation
TD(top-down). UseLRonly when TD would be unreasonably tall (>30 nodes vertical). - Group by subsystem or layer using
subgraph. - Style key nodes:
style A fill:#bbf,stroke:#66ffor emphasis. Use sparingly — one or two nodes per diagram.
classDiagram
<<Interface>>for interfaces,<<Abstract>>for abstract classes.<|--for inheritance,*--for composition,o--for aggregation.- Show only key properties and methods — not every getter/setter.
- Limit to ~15 classes per diagram. If more exist, show the core set and add
%% 20+ classes omitted for readability.
gitGraph
- Use for PR context: show the branch relationship, not every commit.
commit id:"abc1234"with abbreviated SHAs.- Maximum 2-3 branches per diagram. For complex histories, reference the full
git loginstead. - Consider whether a gitGraph truly clarifies — for a single-branch PR with 5 linear commits, text suffices.
sequenceDiagram
->>for synchronous call,-->>for async/return.+/-for activate/deactivate on same line:A->>+B: call()/B-->>-A: return.Note over A,B: explanationfor cross-participant notes.- Limit to ~8 participants per diagram.
stateDiagram-v2
[*]for initial/final states.State1 --> State2: triggerfor transitions.- Group states with
state "Label" as Aliasfor complex labels.
4. Size and readability rules
- Maximum 30 nodes per diagram (GitHub rendering degrades beyond this; also a comprehension ceiling for reviewers).
- Maximum 50 edges per diagram.
- Maximum 8 participants (sequenceDiagram) / 8 subgraphs (flowchart).
- If the subject exceeds these limits, split into multiple diagrams — one per subsystem, layer, or concern.
- Start simple, then layer. The first diagram in a PR shows the broad architecture; subsequent diagrams zoom into changed subsystems.
Size enforcement is critical — GitHub silently shows raw code for diagrams exceeding internal limits (~50KB definition text, ~500 edges). The agent MUST count nodes and edges and refuse to generate a diagram that exceeds these limits, splitting it instead.
5. Accessibility
Every diagram MUST include accessibility metadata as the first lines inside the ```mermaid block:
---
title: "Architecture overview"
---
flowchart TDOr inline (alternative syntax for diagram types that support it):
%%{init: {'flowchart': {'htmlLabels': true}} }%%Specifically:
accTitle: "descriptive title"— short, describes what the diagram shows.accDescr: "one or two sentence description"— what the diagram conveys, for screen readers and mobile viewers who can't see the rendered SVG.
Place these inside the Mermaid frontmatter block (the --- delimited section at the top) so Mermaid renders them as SVG <title> and <desc> elements with ARIA attributes. GitHub preserves these.
6. Output
Inline mode (default)
Generate a ```mermaid fenced code block with the diagram definition. Precede it with a plain-text description (1-2 sentences) that explains what the diagram shows. This is the format for PR descriptions and markdown docs — GitHub renders the block natively.
The request flows through three layers before reaching storage:
```mermaid
---
title: "Request architecture"
accTitle: "Request architecture"
accDescr: "Client request flows through Router, Handler, then Store"
---
flowchart TD
A[Client] --> B[Router]
B --> C[Handler]
C --> D[(Store)]
```File mode (--render local)
The agent:
- Writes the Mermaid definition to a
.mmdfile in a temp location. - Runs
mmdcto render SVG/PNG:mmdc -i diagram.mmd -o diagram.svg [-t dark] [-b transparent] - Reports the output path and describes the diagram contents.
- Cleans up the
.mmdtemp file unless--keepis specified.
File mode is for local preview, CI artifacts, or non-GitHub platforms. Most of the time, inline mode suffices — GitHub renders the ```mermaid block natively.
File mode fallback
If mmdc is not installed (command -v mmdc fails) and --render local was requested, fall back to inline mode and report: "Local rendering requested but mmdc not found. Generating inline Mermaid block instead — rendered by GitHub on push."
7. Integration with /pr
When /diagram is called from /pr, the scope is the PR's diff range. The agent:
- Reads the full diff (
git diff <base>..HEAD) to understand what changed. - Determines which diagram type(s) best communicate the change's shape:
- Architecture/structural changes (files moved, modules extracted, new subsystem) →
flowchart - Type/interface changes →
classDiagram - History/branching →
gitGraph - Data flow changes →
flowchartorsequenceDiagram
- Architecture/structural changes (files moved, modules extracted, new subsystem) →
- Generates the diagram(s). Each diagram must:
- Be preceded by a plain-text description.
- Have
accTitleandaccDescrfor accessibility. - Focus on the changed parts, not the entire system.
- The
prskill embeds these inline in the PR description.
What pr, visuals, and assess do with diagrams
The installed visuals skill orchestrates what to show in pull requests and reviews—the Story, Delta, and review Focus—while this skill defines how to draw it: types, syntax, size caps, and accessibility. The pr skill uses it in authoring mode and assess uses it in review mode. All three keep diagrams focused on the change, capped, and preceded by plain-text descriptions.
8. Rules
- Diagrams must be accurate. A misleading diagram is worse than none. If the codebase structure is too complex to represent faithfully within Mermaid's limits, say so and generate text instead.
- No decorative diagrams. A visual for a single-file tweak, a format-only change, or a rename is noise. Apply the same bar as
/pr: a diagram earns its place when a reviewer parses it faster than prose. - Size limits are hard. The agent counts nodes, edges, and nested subgraphs. If the limit would be exceeded, split into multiple diagrams or summarize in text. A diagram that silently fails to render on GitHub is worse than no diagram at all.
- No tool attribution. Never add "Generated by AI" or credits anywhere near a diagram. The agent is the author.
- Labels use project language. Use terms from
Context/Glossary.mdif it exists. Respect settled vocabulary. - Diagrams for Grove. When activated by the
consolidateskill, follow that skill's bundled protocol: diagrams are first-class knowledge leaves and should be saved as.mmdfiles in the selected tree'sKnowledge/directory.
9. Anti-patterns
- Auto-generating a diagram for every PR. Not every change needs a visual. Apply the viewer bar: "Would a reviewer who hasn't seen this branch parse the change faster from a diagram than from text?" If no, skip the diagram.
- Showcasing the whole system. The diagram must focus on what changed. A full-architecture diagram with one highlighted path is noise — the reviewer needs to see the delta, not the static.
- More than 3 diagrams per PR. Beyond three, the reviewer stops reading them. Pick the most important 1-3 views.
- Skipping alt-text. accTitle/accDescr are mandatory. A diagram with no accessibility metadata is incomplete — the agent must include it.
- Unvalidated Mermaid syntax. If uncertainty exists about whether a syntax form renders on GitHub (bleeding-edge feature, recently changed behavior), prefer a simpler, well-known form. When in doubt,
flowchartis the safest type. - Using
infoorganttdiagrams. These add no value for codebase visualization. Stick to the types in §2.
10. Workflow
Before this command: the agent has context on what to visualize — a codebase to map, a PR diff to illustrate, or a discussion to make concrete.
After this command:
- If the diagram was for a PR → the agent embeds the
```mermaidblock in the PR description, and/prcontinues with the rest of the summary. - If the diagram was standalone → the agent presents the block and waits for further direction.
- If the diagram uncovered a code structure issue or suggestion → the agent flags it before continuing.
- To preserve the session with diagram context →
/handoffto checkpoint.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

