hivemind-graph · activeloopai — скилл для Claude Code: что делает и как установить
Ищет связи в кодовой базе по локальному AST-графу: вызовы функций, импорты и наследование. Пригодится при оценке последствий рефакторинга.
npx skills add activeloopai/hivemind --skill hivemind-graph -a claude-codeЧто делает hivemind-graph
Скилл строит AST-граф репозитория и находит связи между классами, методами, функциями, типами и модулями. Доступны рёбра calls, imports, extends, implements и method_of. Граф обновляется сам после каждого хода агента через git diff и лимиты частоты, запускать сборку вручную не требуется.
Внутри работают два инструмента: hivemind_graph_search ищет по подстрокам или комбинации слов через + с соседями первого порядка, а hivemind_graph_neighborhood собирает связи для конкретного файла. Граф служит быстрым индексом, после которого агент переходит к чтению реальных файлов по найденным путям и номерам строк.
За пределами TypeScript, JavaScript и Python парсер не работает — для остальных языков придётся использовать обычный поиск по тексту. Граф может отставать от несохранённых правок в сессии, а нулевое число входящих вызовов не гарантирует мёртвый код из-за динамических вызовов.
Какие задачи решает
- найти все места вызова функции или метода
- оценить зону влияния изменений перед сменой сигнатуры
- посмотреть межфайловые зависимости и список импортов модуля
- определить архитектурные связи между подсистемами проекта
Примеры запросов агенту
- Кто вызывает функцию
pushSnapshotв проекте? - Что импортирует модуль
deeplake-pull.tsи от чего он зависит? - Покажи структуру символов и их соседей для файла
src/hooks/capture.ts
Как установить hivemind-graph
1Через Skills CLI (Vercel)
npx skills add activeloopai/hivemind --skill hivemind-graph -a claude-code2Вручную: положить файлы
~/.claude/skills/hivemind-graph/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/hivemind-graph/
1Через Skills CLI (Vercel)
npx skills add activeloopai/hivemind --skill hivemind-graph -a codex2Вручную: положить файлы
.agents/skills/hivemind-graph/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add activeloopai/hivemind --skill hivemind-graph -a cursor2Вручную: положить файлы
.cursor/skills/hivemind-graph/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install activeloopai/hivemind hivemind-graph2Вручную: положить файлы
.github/skills/hivemind-graph/SKILL.md1Через Skills CLI (Vercel)
npx skills add activeloopai/hivemind --skill hivemind-graph -a gemini-cli2Командой платформы
gemini skills install https://github.com/activeloopai/hivemind --path harnesses/openclaw/skills/hivemind-graphВручную: положить файлы
.devin/skills/hivemind-graph/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add activeloopai/hivemind --skill hivemind-graph -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о hivemind-graph
Как установить hivemind-graph в Claude Code?
Выполните команду npx skills add activeloopai/hivemind --skill hivemind-graph -a claude-code. Файл навыка сохранится по пути ~/.claude/skills/hivemind-graph/SKILL.md.
Что делает скилл hivemind-graph?
Он строит граф зависимостей и вызовов на основе AST для поиска функций, классов и связей между файлами. Инструмент помогает агенту быстро определять последствия правок без ручного просмотра всего репозитория.
Можно ли искать мёртвый код через этот скилл?
Нет, отсутствие входящих связей в графе не означает неиспользуемый код. Динамические вызовы и диспетчеризация методов экземпляров разрешаются не полностью, поэтому удалять функции только на основе графа нельзя.
Исходный текст
SKILL.md · Apache-2.0
---
name: hivemind-graph
description: Query the local AST-derived code graph (functions, classes, calls, imports) for structural codebase questions — what calls X, what does Y import, where is Z defined, blast radius of a change. The graph rebuilds automatically after each agent turn; use hivemind_graph_search and hivemind_graph_neighborhood tools (no manual build step).
allowed-tools: hivemind_graph_search, hivemind_graph_neighborhood
---
# Hivemind Code Graph (OpenClaw)
A deterministic, AST-derived map of the current repository — every function,
class, method, interface, type, enum, const, and module, plus the edges between
them (`calls`, `imports`, `extends`, `implements`, `method_of`).
The graph **builds and refreshes automatically** after each turn (gated by rate
limit + git diff). You never run a build command — just call the graph tools.
Set `plugins.entries.hivemind.config.tuning.HIVEMIND_GRAPH_CWD` in
`~/.openclaw/openclaw.json` to the git root of the project you want indexed
when the gateway's working directory is not the repo (then restart the gateway).
Use the graph as a fast **INDEX** to locate the few files/symbols that matter,
then use the host's read/exec tools on the real source. It is not a substitute
for reading source files.
## When to use this skill
Activate when the user asks a *structural / relational* question about the code:
- "What calls `pushSnapshot`?" / "Who uses this function?"
- "What does `deeplake-pull.ts` import?" / "What depends on X?"
- "Where is `GraphSnapshot` defined?" / "Find the function that handles Y."
- "What are the main subsystems / the architecture here?"
- "If I change this signature, what's affected?"
## Tools
- `hivemind_graph_search({ pattern })` — search symbols by substring (or
multi-token AND with `+`, e.g. `auth+handler`). Returns matches with 1-hop
neighbors (callers, callees, imports). **Start here.**
- `hivemind_graph_neighborhood({ file })` — every symbol in a repo-relative
file path plus its cross-file neighbors.
## Workflow
1. Broad structural question? `hivemind_graph_search({ pattern: "<symbol>" })`.
2. Know the file? `hivemind_graph_neighborhood({ file: "src/hooks/capture.ts" })`.
3. Need the actual code? Open the `source_file:line` from the tool output with
the host read tool — don't answer from the graph alone.
## When NOT to use this skill
- Reading the **body** of a symbol you already located → use the host read tool.
- Code that isn't **committed/built** yet — the graph can lag uncommitted edits.
- Languages outside **TypeScript, JavaScript, and Python** — fall back to grep.
## Anti-patterns
- **Zero incoming callers does NOT mean dead code.** Instance-method dispatch and
dynamic calls are not fully resolved.
- **The graph can be stale.** Prefer live source for files edited in this session.
- **`pattern` is lexical, not semantic** — try multiple keywords if the first misses.
© activeloopai · Apache-2.0 · activeloopai/hivemind
Похожие скиллы
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Сначала — hivemind-graph от других авторов.