跳到主要内容
知仓学习社ZHICANG

hivemind-graph

Query the local code graph (functions, classes, calls, imports) through the Deeplake mount at memory/graph/. Use when the user asks structural quest…

不碰外部(只输出文字)无严重或高危命中activeloopai/hivemind

它会碰到什么

扫了多少1 个文本文件,5 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

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.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 1,616
本站分层T1
该仓技能数11
原文件路径harnesses/codex/skills/hivemind-graph/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 11 个技能

同名技能的其他版本

有 4 个不同仓库或目录里都有叫 hivemind-graph 的技能。它们内容并不相同,别混用:

  • activeloopai/hivemind — Query the local code graph (functions, classes, calls, imports) through the Deeplake mount
  • activeloopai/hivemind — Query the local code graph (functions, classes, calls, imports) through the Deeplake mount
  • activeloopai/hivemind — Query the local AST-derived code graph (functions, classes, calls, imports) for structural