{"id":"hivemind-graph","name":"hivemind-graph","summary":"Deeplakeマウントのmemory/graph/でローカルコードグラフ(関数、クラス、呼び出し、インポート)をクエリします。","body":"# Hivemind Code Graph\n\nA deterministic, AST-derived map of the current repository — every function,\nclass, method, interface, type, enum, const, and module, plus the edges between\nthem (`calls`, `imports`, `extends`, `implements`, `method_of`). It is queried as\nsynthesized files under the Deeplake mount; there are no real files on disk and\nno network call in the read path.\n\nThe graph **builds and refreshes automatically** (on Stop / SessionEnd, gated by\na rate limit + git diff). You never run a build command — just read it.\n\nUse it as a fast **INDEX** to locate the few files/symbols that matter, then open\nthem with `Read` to answer. It is not a substitute for the source.\n\n## When to use this skill\n\nActivate when the user asks a *structural / relational* question about the code:\n\n- \"What calls `pushSnapshot`?\" / \"Who uses this function?\"\n- \"What does `deeplake-pull.ts` import?\" / \"What depends on X?\"\n- \"Where is `GraphSnapshot` defined?\" / \"Find the function that handles Y.\"\n- \"What are the main subsystems / the architecture here?\"\n- \"If I change this signature, what's affected?\" → use `impact/<symbol>` (transitive blast radius)\n\n## When NOT to use this skill\n\n- Reading the **body** of a symbol you already located → use `Read` on the real\n  source file. The graph gives location + relationships, not full source.\n- Code that isn't **committed/built** yet — the graph can lag uncommitted edits.\n  If a file's mtime is newer than the build timestamp, read the live source.\n- Languages outside **TypeScript, JavaScript, and Python** (Go, Rust, …) — the\n  extractor covers those three, with cross-file `calls`/`imports` resolved for\n  named imports. For anything else, fall back to grep/read.\n\n## Path cheat sheet\n\n```bash\ncat ~/.deeplake/memory/graph/index.md\n#   Overview: node/edge counts, kind breakdown, top files by node count.\n\ncat ~/.deeplake/memory/graph/query/<pattern>   # START HERE (the 2-in-1)\n#   Search + expand the top matches with their 1-hop neighbors (callers,\n#   callees, imports, heritage). Multi-token AND: query/<a>+<b>.\n\ncat ~/.deeplake/memory/graph/find/<pattern>\n#   Case-insensitive substring search on node id + label (max 50 hits).\n#   Prints numbered handles [1] [2] ... saved for this worktree.\n\ncat ~/.deeplake/memory/graph/show/<handle-or-pattern>\n#   <handle>: a digit from a prior find/ (e.g. 3).\n#   <pattern>: a substring → unique node detail, or a candidate list.\n#   Output: the node + its 1-hop neighbors grouped by edge relation.\n\ncat ~/.deeplake/memory/graph/neighborhood/<file>\n#   Every symbol in a file + its cross-file neighbors (callers/callees/imports).\n\ncat ~/.deeplake/memory/graph/impact/<pattern>\n#   Transitive dependents — the blast radius of changing a symbol.\n\ncat ~/.deeplake/memory/graph/path/<from>/<to>\n#   Shortest dependency path between two symbol patterns (trace a flow across files).\n\ncat ~/.deeplake/memory/graph/layers      # architectural layers / subsystems\ncat ~/.deeplake/memory/graph/tour        # deterministic guided walkthrough\n```\n\n## Workflow\n\n1. Broad? Start at `index.md` to see subsystems and the biggest files.\n2. Looking for a symbol? `find/<name>` (or `query/<name>`) → pick the handle.\n3. Want relationships? `show/<handle>` / `neighborhood/<file>` → callers/callees, imports.\n4. Tracing a flow? `path/<from>/<to>`. Change impact? `impact/<symbol>`.\n5. Need the actual code? Take the `source_file:line` and `Read` it — don't answer from the graph alone.\n\n## Anti-patterns (read these)\n\n- **\"Incoming (0)\" does NOT mean dead code.** Cross-file `calls` are resolved for\n  *named imports* (TS/JS/Python), but **instance-method dispatch** (`obj.method()`),\n  dynamic calls, and nested/inner functions are NOT — a zero-incoming symbol may\n  still be reached via one of those. Confirm in the source before calling it unused.\n- **The graph can be stale.** It rebuilds at most once per rate-limit window. The\n  SessionStart inject prints the build age; if it's old or you've just edited a\n  file, prefer the live source for that file.\n- **Don't try to build it.** There is no user-facing build step in normal use;\n  the hooks handle it. Just read the mount.\n- **`find/` is lexical, not semantic.** It matches substrings, not meaning —\n  `find/auth` won't surface `login`/`credentials` unless those strings appear in\n  the id/label. Try multiple keywords if the first misses.","author":"@activeloopai","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/activeloopai/hivemind/tree/main/harnesses/claude-code/skills/hivemind-graph","license":"Apache-2.0","category":"coding","lang":"en","tokens":1139,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":["Read Bash"]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}