CodeGraph
БесплатноЗапускает вложенные скриптыНе проверенGenerate source-linked Mermaid diagrams and long-form CodeWalkthrough explainer pages from a codebase, with diff-aware review mode.
от longbowzz66 установок в других каталогахОб этом скилле
CodeGraph Skill
Generate an interactive, single-page HTML visualization of a specific code flow (control flow and/or call sequence) from the user's repository, with clickable jump-to-source behavior in their preferred editor.
This document is the operational contract for the agent. Follow it precisely. All directives in this file are English; the data you produce (node labels, messages, notes, topic slug) MUST be in the user's preferred language, which you confirm during the alignment step.
0. Runtime Requirements & Skill Location
0.1 Runtime requirements
Graph generation and viewing require no runtime npm install. The scripts use Node.js standard-library modules and the vendored Mermaid engine. Development dependencies used to rebuild vendored assets are separate.
Required on the host machine:
- Node.js 18 or newer. Verify with
node --version. Required forvalidate.mjsandbuild-html.mjs(ESM +node:prefix imports). - A supported editor for click-to-jump (VS Code / Cursor / JetBrains family),
or the
webeditor which opens source in an in-page code panel (no external editor needed). See §2 Step 1 and §6 for the full list. Non-webeditors must be installed and reachable via their OS URL scheme. - An internet connection is NOT required after the skill is installed.
The Mermaid engine and supporting assets are vendored under
vendor/. External images and icons are outside the offline guarantee.
0.2 Skill directory resolution
The agent MUST resolve the skill's own directory before invoking scripts. The skill can be installed in one of these locations (check in order):
- Project-local (Claude):
<repo>/.claude/skills/codegraph/ - User-global (Claude):
~/.claude/skills/codegraph/ - Project-local (DSH):
<repo>/.dsh/skills/codegraph/ - User-global (DSH):
~/.dsh/skills/codegraph/or~/.agents/skills/codegraph/ - Cloned repo or bundle:
skills/codegraph/in the CodeGraph checkout.
In all cases, the scripts are at <skill-dir>/scripts/, templates at
<skill-dir>/template/, and the vendored Mermaid engine and browser assets at <skill-dir>/vendor/.
To find the skill dir from a shell:
find . ~/.claude/skills ~/.dsh/skills ~/.agents/skills -type f -name SKILL.md \
\( -path '*codegraph*' -o -path '*CodeGraph*' \) 2>/dev/null | head -1 | xargs dirname
In examples below, <SKILL_DIR> refers to this resolved directory.
0.3 Target repository
The user's target repo (the code being analyzed) is referred to as <repo>.
All paths in graph.locs.json are relative to <repo>. The agent MUST obtain
<repo> (typically the current working directory) and pass it to scripts via
--repo <abs-path>.
The output directory <repo>/.codegraph/output/ is created on demand.
1. Choose the workflow
This skill has two workflows. Pick one before doing anything else.
1.1 Graph workflow
Trigger it when the user's message:
- Contains the literal token "CodeGraph" (any case) AND one of:
- "流程图" / "flowchart"
- "时序图" / "sequence diagram"
- "调用流程" / "call flow"
- "流程" / "flow"
- "PR" / "commit" / "diff" / "review" / "改动" / "变更" / "评审"
- OR explicitly says "use CodeGraph" / "用 CodeGraph 技能" together with a request to draw, visualize, map, or review.
If the request is primarily "介绍 / 讲解 / 科普 / 写网页 / 教程 / 原理", use the CodeWalkthrough workflow below instead, even if it also contains the word "流程".
The rest of this file is the graph contract. Follow it exactly for this workflow.
1.2 CodeWalkthrough workflow
Trigger it when the user asks CodeGraph to explain, introduce, teach, or build a long-form interactive explainer about a module or flow, including:
- "介绍 / 讲解 / 科普 / 说明 / 教程 / 原理 / 深入理解"
- "写一个网页介绍 / 做一个讲解页面 / 生成一个学习页面"
- "用 CodeGraph 为我介绍 XX 流程"
- "用 CodeGraph 写一个网页介绍 XXX 模块"
Read references/walkthrough.md before gathering evidence or writing the
page. That file defines the intake questions, the evidence table, the page
structure, the content/source-link format, the build command, and the self-check
protocol. Do not use the graph contract for this workflow.
If the user's intent is ambiguous (for example just "用 CodeGraph 看一下这个模块"), ask exactly one question:
你是想要一张流程图,还是一篇可以交互阅读的讲解网页?
Do not trigger either workflow on generic "explain the code" or "draw me a diagram" requests that do not mention CodeGraph.
2. Interaction Flow
Execute these steps in order.
Step 1 — Editor configuration
- Read
<repo>/.codegraph/config.jsonif it exists. - If it does not exist, or
editor.idis missing:- Ask the user to choose one editor from the supported list:
vscode,vscode-insiders,cursor,idea,pycharm,webstorm,goland,phpstorm,rider,clion,rubymine,web. - For the
webeditor: no install verification is needed. It opens source in an in-page code panel inside the same browser tab
- Ask the user to choose one editor from the supported list:
Установить CodeGraph в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл CodeGraph?
Generate source-linked Mermaid diagrams and long-form CodeWalkthrough explainer pages from a codebase, with diff-aware review mode.
Как установить скилл CodeGraph?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл CodeGraph запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic