diagram

GitHub

指导在复杂逻辑、结构或流程难以用文字清晰表达时,选择最简可视化的原则与规范。涵盖伪代码、调用树、组件/文件树、Mermaid图及Diff等格式,旨在降低认知负荷并提升沟通效率。

skills/diagram/SKILL.md Yeachan-Heo/oh-my-claudecode

触发场景

需要解释复杂的控制流或运行时逻辑 描述模块、组件或文件的层级结构 展示状态转换或交互时序 对比代码或结构的变更影响

安装

npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -g -y
更多选项

不安装直接使用

npx skills use Yeachan-Heo/oh-my-claudecode@diagram

指定 Agent (Claude Code)

npx skills add Yeachan-Heo/oh-my-claudecode --skill diagram -a claude-code -g -y

安装 repo 全部 skill

npx skills add Yeachan-Heo/oh-my-claudecode --all -g -y

预览 repo 内 skill

npx skills add Yeachan-Heo/oh-my-claudecode --list

SKILL.md

Frontmatter
{
    "name": "diagram",
    "level": 2,
    "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."
}

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.

版本历史

  • 9fd35ec 当前 2026-09-22 13:49

同 Skill 集合

skills/agent-doc-discipline/SKILL.md
skills/ai-slop-cleaner/SKILL.md
skills/architecture-survey/SKILL.md
skills/ask-navigator/SKILL.md
skills/ask/SKILL.md
skills/autopilot/SKILL.md
skills/autoresearch/SKILL.md
skills/cancel/SKILL.md
skills/ccg/SKILL.md
skills/configure-notifications/SKILL.md
skills/debug/SKILL.md
skills/deep-dive/SKILL.md
skills/deep-interview/SKILL.md
skills/deepinit/SKILL.md
skills/drydock/SKILL.md
skills/execute/SKILL.md
skills/external-context/SKILL.md
skills/graph/SKILL.md
skills/harbor/SKILL.md
skills/hud/SKILL.md
skills/intent/SKILL.md
skills/learner/SKILL.md
skills/local-build-reminder/SKILL.md
skills/loft/SKILL.md
skills/mcp-setup/SKILL.md
skills/merge-readiness/SKILL.md
skills/minimal-code-discipline/SKILL.md
skills/minimal-prose-discipline/SKILL.md
skills/omc-doctor/SKILL.md
skills/omc-reference/SKILL.md
skills/omc-setup/SKILL.md
skills/omc-teams/SKILL.md
skills/plan/SKILL.md
skills/project-session-manager/SKILL.md
skills/ralph/SKILL.md
skills/ralplan/SKILL.md
skills/release/SKILL.md
skills/remember/SKILL.md
skills/research/SKILL.md
skills/review/SKILL.md
skills/sciomc/SKILL.md
skills/self-improve/SKILL.md
skills/setup/SKILL.md
skills/skill/SKILL.md
skills/skillify/SKILL.md
skills/team/SKILL.md
skills/trace/SKILL.md
skills/ultragoal/SKILL.md
skills/ultraqa/SKILL.md

元信息

文件数
0
版本
9fd35ec
Hash
13e51a5c
收录时间
2026-09-22 13:49

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-22 15:06
浙ICP备14020137号-1