‹ 首页

hivemind-graph

@activeloopai · 收录于 1 周前 · 上游提交 2 天前

Query the local code graph (functions, classes, calls, imports) through the Deeplake mount at memory/graph/. Use when the user asks structural questions about the codebase — "what calls X?", "what does Y import?", "where is Z defined?", "what's the architecture / which subsystems exist?", "what's the impact of changing this?". The graph is an AST-derived map of the repo, queried as files (no build needed — it rebuilds automatically).

适合你,如果需要快速理解代码库结构和调用关系

/ 下载安装
hivemind-graph.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add activeloopai/hivemind/hivemind-graph
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- activeloopai/hivemind/hivemind-graph
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify activeloopai/hivemind/hivemind-graph
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
1477GitHub stars
~1.1K上下文体积 · 单文件
镜像托管

怎么用

商店整理自技能原文 · 版本 9e3221c · 表述以原文为准
它做什么

装上后,Claude 能查询代码库的结构信息,比如函数、类、调用关系和导入依赖。它会读取自动生成的代码图谱文件,告诉你某个函数被谁调用、在哪里定义、修改影响范围等。

什么时候触发

当你问代码结构相关的问题时触发,例如“谁调用了 X?”、“Y 导入了什么?”、“Z 在哪里定义?”、“架构是怎样的?”或“修改这个会影响什么?”。

装好后可以这样说
Claude 会查询图谱并列出调用者。
Claude 会显示该文件的导入依赖。
Claude 会分析传递影响范围。
技能原文 SKILL.md作者撰写 · Apache-2.0 · 9e3221c

Hivemind Code Graph

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). It is queried as synthesized files under the Deeplake mount; there are no real files on disk and no network call in the read path.

The graph builds and refreshes automatically (on Stop / SessionEnd, gated by a rate limit + git diff). You never run a build command — just read it.

Use it as a fast INDEX to locate the few files/symbols that matter, then open them with Read to answer. It is not a substitute for the source.

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?" → use impact/<symbol> (transitive blast radius)
When NOT to use this skill
  • Reading the body of a symbol you already located → use Read on the real source file. The graph gives location + relationships, not full source.
  • Code that isn't committed/built yet — the graph can lag uncommitted edits. If a file's mtime is newer than the build timestamp, read the live source.
  • Languages outside TypeScript, JavaScript, and Python (Go, Rust, …) — the extractor covers those three, with cross-file calls/imports resolved for named imports. For anything else, fall back to grep/read.
Path cheat sheet
cat ~/.deeplake/memory/graph/index.md
#   Overview: node/edge counts, kind breakdown, top files by node count.

cat ~/.deeplake/memory/graph/query/<pattern>   # START HERE (the 2-in-1)
#   Search + expand the top matches with their 1-hop neighbors (callers,
#   callees, imports, heritage). Multi-token AND: query/<a>+<b>.

cat ~/.deeplake/memory/graph/find/<pattern>
#   Case-insensitive substring search on node id + label (max 50 hits).
#   Prints numbered handles [1] [2] ... saved for this worktree.

cat ~/.deeplake/memory/graph/show/<handle-or-pattern>
#   <handle>: a digit from a prior find/ (e.g. 3).
#   <pattern>: a substring → unique node detail, or a candidate list.
#   Output: the node + its 1-hop neighbors grouped by edge relation.

cat ~/.deeplake/memory/graph/neighborhood/<file>
#   Every symbol in a file + its cross-file neighbors (callers/callees/imports).

cat ~/.deeplake/memory/graph/impact/<pattern>
#   Transitive dependents — the blast radius of changing a symbol.

cat ~/.deeplake/memory/graph/path/<from>/<to>
#   Shortest dependency path between two symbol patterns (trace a flow across files).

cat ~/.deeplake/memory/graph/layers      # architectural layers / subsystems
cat ~/.deeplake/memory/graph/tour        # deterministic guided walkthrough
Workflow
  1. Broad? Start at index.md to see subsystems and the biggest files.
  2. Looking for a symbol? find/<name> (or query/<name>) → pick the handle.
  3. Want relationships? show/<handle> / neighborhood/<file> → callers/callees, imports.
  4. Tracing a flow? path/<from>/<to>. Change impact? impact/<symbol>.
  5. Need the actual code? Take the source_file:line and Read it — don't answer from the graph alone.
Anti-patterns (read these)
  • "Incoming (0)" does NOT mean dead code. Cross-file calls are resolved for named imports (TS/JS/Python), but instance-method dispatch (obj.method()), dynamic calls, and nested/inner functions are NOT — a zero-incoming symbol may still be reached via one of those. Confirm in the source before calling it unused.
  • The graph can be stale. It rebuilds at most once per rate-limit window. The SessionStart inject prints the build age; if it's old or you've just edited a file, prefer the live source for that file.
  • Don't try to build it. There is no user-facing build step in normal use; the hooks handle it. Just read the mount.
  • find/ is lexical, not semantic. It matches substrings, not meaning — find/auth won't surface login/credentials unless those strings appear in the id/label. Try multiple keywords if the first misses.
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。