Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

CodeGraph

БесплатноЗапускает вложенные скриптыНе проверен

Generate source-linked Mermaid diagrams and long-form CodeWalkthrough explainer pages from a codebase, with diff-aware review mode.

longbowzzот 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 for validate.mjs and build-html.mjs (ESM + node: prefix imports).
  • A supported editor for click-to-jump (VS Code / Cursor / JetBrains family), or the web editor which opens source in an in-page code panel (no external editor needed). See §2 Step 1 and §6 for the full list. Non-web editors 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):

  1. Project-local (Claude): <repo>/.claude/skills/codegraph/
  2. User-global (Claude): ~/.claude/skills/codegraph/
  3. Project-local (DSH): <repo>/.dsh/skills/codegraph/
  4. User-global (DSH): ~/.dsh/skills/codegraph/ or ~/.agents/skills/codegraph/
  5. 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

  1. Read <repo>/.codegraph/config.json if it exists.
  2. If it does not exist, or editor.id is 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 web editor: no install verification is needed. It opens source in an in-page code panel inside the same browser tab
Полный SKILL.md на ClawHub

Установить 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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить CodeGraph с