跳到正文
Skillpedia
技术文档41k · #7001

diagram

它能做什么

这项技能告诉智能体,何时用图表或简单的视觉效果解释技术概念会比文字更好。适合需要理解代码如何流动或各部分如何组合的人。

适用场景

  • ✓当代码流程或结构的文字说明难以理解的时候。
  • ✓当你想看看系统的各部分如何调用或依赖彼此的时候。
  • ✓当你希望在文档或聊天回复中放一张简单的更改示意图的时候。

技能链接

https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/diagram/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/diagram/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“能否用最简单、又能讲清楚的图,展示登录流程在我们代码中是如何流转的?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会选择一种最适合问题的视图,例如伪代码、调用树、文件树或 Mermaid 图。如果纯文字已经能回答问题,它就会略过图表。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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:

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:

acquireStateFileLockSync()
  resolveLockPath()
  openExclusive()
  writePid()

Component tree — UI or module structure, with the boundaries that matter annotated inline:

<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:

src/
├── hooks/        # hook registry + types
├── tools/        # MCP tool handlers
└── workflow/     # registry + projections

Mermaid — interaction between parties, dataflow, or state transitions:

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:

 <SettingsPage>
   <SessionList />
   <DangerZone>
+    <ConfirmButton />
   </DangerZone>

a file-layout change:

 src/tools/
-└── state-tools.ts
+└── state-tools/
+   ├── handlers.ts
+   └── schema.ts

a control-flow change:

 commit()
   stage()
     hashBlobs()
+  writeObject()
   updateRef()
+    acquireStateFileLock()

a state-machine change:

 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:

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.
常见问题

它总是会添加图表吗?

不会。只有当文字会迫使你在脑中记住整体结构时,它才会添加图表。

它使用哪些类型的图?

伪代码、调用树、组件树、文件树、Mermaid 图和差异对比。

它会创建图片文件吗?

最多只会写入一个产出文件,大多数视觉内容会以文本块的形式显示在聊天中。

详情

作者的原始描述

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.

repo: Yeachan-Heo/oh-my-claudecode

热度

GitHub 星标
41k
排名
#7001
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能