Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/diagram/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/diagram/

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.

diagram garrytan diagram is a Claude Code skill that turns an English description or Mermaid source into diagram files. It runs on requests to make, draw, or visualize a diagram. CX Codex +1 266installs excalidraw-diagram-generator official github excalidraw-diagram-generator is a GitHub Copilot skill that turns plain-language descriptions into Excalidraw diagrams of processes, system structure, and relationships. CX Codex +1 31,639installs diagram-design cathrynlavery diagram-design is a Claude Code skill that builds editorial diagrams as standalone HTML files with inline SVG. It covers 51 visual types under a project-specific style guide. CX Codex +1 30,900installs baoyu-diagram JimLiu baoyu-diagram builds system and workflow diagrams as self-contained SVGs with dark and light themes, exporting both versions to @2x PNGs. CX Codex +1 16,200installs excalidraw-diagram coleam00 excalidraw-diagram generates .excalidraw JSON diagram files for technical architectures and workflows. Helps turn system specs or logic into diagrams with real data examples. CX Codex +1 8,900installs external-diagram-mermaid-generate forcedotcom external-diagram-mermaid-generate turns Salesforce architecture into Mermaid diagrams: OAuth flows, ERDs, integration sequences, Agentforce structure. Ships an ASCII fallback for plain-text use. CX Codex +1 5,600installs diagram-creator claude-office-skills diagram-creator generates system diagrams and flowcharts using Mermaid, PlantUML, and D2 syntax. It helps document APIs, database relations, and service architecture. CX Codex +1 5,200installs

From the same set48

The whole set →
harbor harbor triages incoming issues and pull requests, verifies each claim, and hands the maintainer only the decisions that genuinely need a signature. CX Codex +1 241installs minimal-prose-discipline The minimal-prose-discipline skill keeps agent replies lean while preserving commands, errors, paths, and numbers. Use it when work updates need to stay clear and actionable. CX Codex +1 204installs architecture-survey architecture-survey inspects your module graph to spot shallow boundaries, false seams, and misplaced logic. Useful when changes start rippling across too many files at once. CX Codex +1 201installs agent-doc-discipline agent-doc-discipline sets writing rules for agent-facing specs, skills, and CLAUDE.md files. It ensures a fresh agent session acts correctly on instructions alone without needing prior chat context. CX Codex +1 196installs ask-navigator ask-navigator — a skill that turns an unclear effort into a map of decision tickets on the repo's issue tracker. It works the frontier one ticket per session until the route clears, then hands decisions over without building anything. CX Codex +1 191installs loft loft resolves deadlocked design and logic questions by building disposable runnable prototypes that never merge into main. CX Codex +1 189installs intent Turns a pasted chat or problem report into a reviewed intent.md. It gives /launch a decision brief instead of code. CX Codex +1 187installs pr pr — a Claude Code skill that drafts pull request descriptions from the session paper trail. It compiles verified test evidence, visual summaries, and rollback risks into a markdown body. CX Codex +1 161installs

Project sponsors

Companies that keep this analytics open