diagram · yeachan-heo — Claude Code skill: code diagrams and setup
This skill picks a compact visual for code structure, from a call tree to a Mermaid diagram. Use it when prose makes relationships hard to follow.
MIT 194 installs ★ 40,997 updated 2026-10-24
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a claude-codeWhat diagram does
diagram matches the view to the question: pseudocode can show branches, a call tree can trace execution, and component or file trees can mark ownership. Mermaid fits interactions and state changes; a diff shows what changed. Keep the visual beside the sentences it explains, with only the relevant nodes.
When a single sentence is enough, the skill recommends leaving the diagram out. For a dense UI layout or a before-and-after comparison, it can create one focused HTML file and open it with the system’s platform command. The output is one artifact, not a collection of pages.
What it helps with
- show logic branches as pseudocode
- trace execution through a call tree
- map component or module boundaries
- compare code structure before and after a change
Example prompts for the agent
- Show this function’s execution path as a call tree.
- Compare the file layout before and after the change with a diff.
- Explain these state transitions with a Mermaid diagram.
How to install diagram
1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a claude-code2Manually: put the files in place
~/.claude/skills/diagram/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/diagram/
1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a codex2Manually: put the files in place
.agents/skills/diagram/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a cursor2Manually: put the files in place
.cursor/skills/diagram/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Yeachan-Heo/oh-my-claudecode skills/diagram2Manually: put the files in place
.github/skills/diagram/SKILL.md1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a gemini-cli2Platform CLI
gemini skills install https://github.com/Yeachan-Heo/oh-my-claudecode --path skills/diagramManually: put the files in place
.devin/skills/diagram/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about diagram
How do I install diagram in Claude Code?
Run npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a claude-code. The skill file is at ~/.claude/skills/diagram/SKILL.md.
What does diagram do?
It helps an agent choose a concise visual for logic, execution paths, module structure, interactions, or code changes. If one sentence answers the question, it recommends skipping the diagram.
When does diagram create an HTML file?
For a dense UI layout, a before-and-after view, or a concept that Mermaid cannot express clearly. The skill calls for one HTML file, opened with the platform’s system command.
Source text
SKILL.md · MIT
---
name: diagram
description: "Use the smallest visual when prose must carry structure—control flow, call depth, module ownership, or change shape: pseudocode, call tree, component/file tree, Mermaid diagram, or diff. Skip it when prose already answers the question."
level: 2
---
**Diagrams are load-bearing, not decoration.** Reach for one only when prose forces the reader to hold a whole shape in their head at once — then pick the smallest view that lets them see the shape instead of reconstructing it from sentences. Everything here renders in the conversation as text blocks or Mermaid; at most one artifact file is ever written.
## The vocabulary
Pick one view; two at most. More is noise.
**Pseudocode** — logic without language noise. Reduces a decision to its branching shape:
```text
on(request)
if state file locked by another writer
queue and return pending
acquire lock
write
release
```
**Call tree** — runtime control flow. Depth shows who owns the flow; annotate where the interesting edge is:
```text
acquireStateFileLockSync()
resolveLockPath()
openExclusive()
writePid()
```
**Component tree** — UI or module structure, with the boundaries that matter annotated inline:
```tsx
<SettingsPage> (src/routes/settings)
<SessionList> (owns its fetches)
<DangerZone>
<ConfirmButton> (disabled until typed confirmation)
```
**File tree** — where responsibility lives; keep it shallow, one annotation per directory:
```text
src/
├── hooks/ # hook registry + types
├── tools/ # MCP tool handlers
└── workflow/ # registry + projections
```
**Mermaid** — interaction between parties, dataflow, or state transitions:
```mermaid
sequenceDiagram
participant CLI
participant Hook
participant State
CLI->>Hook: PreToolUse
Hook->>State: read mode
Hook-->>CLI: allow / deny + facts
```
**Diff** — the shape of a change when the surrounding structure already exists. Match the diff to the topic:
a component change:
```diff
<SettingsPage>
<SessionList />
<DangerZone>
+ <ConfirmButton />
</DangerZone>
```
a file-layout change:
```diff
src/tools/
-└── state-tools.ts
+└── state-tools/
+ ├── handlers.ts
+ └── schema.ts
```
a control-flow change:
```diff
commit()
stage()
hashBlobs()
+ writeObject()
updateRef()
+ acquireStateFileLock()
```
a state-machine change:
```diff
on(request)
- write immediately
+ if locked
+ queue and return pending
+ acquire lock
+ write
+ release
```
**The whole block** — when elision would hide who owns what or the order things run in, show the complete unit once, copyable:
```ts
export function isRegistryEnabled(): boolean {
const flag = process.env.OMC_WORKFLOW_REGISTRY;
return flag !== '0' && flag !== 'false';
}
```
## When text runs out
A UI layout, a before/after comparison, or a concept too dense for Mermaid: write one focused HTML file — a diagram, an infographic, or a few slides — styled after the product's own colors, type, and components, filled with real labels and data, working on desktop and mobile. Open it with the platform opener (`start` on Windows, `open` on macOS, `xdg-open` on Linux) and stop there: one artifact, not a gallery.
## Discipline
- Place each visual directly beside the two or three sentences it supports.
- Carry only the calls, files, props, states, and boundaries that answer the current question — every extra node is a decoding tax on the reader.
- If the honest answer fits in one sentence, write the sentence.
© Yeachan-Heo · MIT · Yeachan-Heo/oh-my-claudecode
Similar skills
SKILL.md skills catalog →diagram by other authors comes first.