[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77MNC3WNTE9G21PY3GXZTP3":3,"skill-same:01M77MNC3WNTE9G21PY3GXZTP3":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77MNC3WNTE9G21PY3GXZTP3","graphify",null,"How to build, query, and inspect the project knowledge graph stored under knowledge\u002Fgraph\u002Fgraph.json using src\u002Fknowledge-graph.js. Load this skill when the user or orchestrator wants to add nodes or edges to the graph, query neighbors or type-filtered nodes, inspect the current graph state, or open the \u002Fgraph visualization in the board. Triggers on knowledge\u002Fgraph\u002F, addNode, addEdge, neighbors, nodesByType, loadGraph, or \u002Fhivemind:graph.","HexingBot\u002Fhivemind","HexingBot","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F296674764?v=4","01M77MMXMW5SWSXKHB0VA4N1FF","01M77MMXNV3PZA3795D6PYX5C9",1,"MIT","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgraphify\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: graphify\ndescription: How to build, query, and inspect the project knowledge graph stored under knowledge\u002Fgraph\u002Fgraph.json using src\u002Fknowledge-graph.js. Load this skill when the user or orchestrator wants to add nodes or edges to the graph, query neighbors or type-filtered nodes, inspect the current graph state, or open the \u002Fgraph visualization in the board. Triggers on knowledge\u002Fgraph\u002F, addNode, addEdge, neighbors, nodesByType, loadGraph, or \u002Fhivemind:graph.\nsource_tier: T2\n---\n\n# Graphify — Project Knowledge Graph Skill\n\nIncrementally build and query the project's typed knowledge graph via the\n`src\u002Fknowledge-graph.js` public API, then visualize it at the board's `\u002Fgraph`\nview. The graph is stored at `knowledge\u002Fgraph\u002Fgraph.json` in the project root.\n\n## CRITICAL Design Boundary\n\nThe graph is an **INCREMENTAL INDEX** over existing artifacts — not a bulk\nre-scanner and not a second copy of state. This honors the 2026-06-11 design\ndecision recorded in the project.\n\n- **Do** add nodes\u002Fedges for artifacts as they are created or referenced.\n- **Do** query the graph to find relationships between tasks, decisions, skills,\n  and knowledge entries.\n- **Do NOT** bulk-rescan all artifacts to rebuild the graph from scratch.\n- **Do NOT** duplicate artifact content into graph nodes — use `ref` to point at\n  the artifact; `label` is a short human-readable name only.\n\n## Graph Storage\n\n- **File:** `\u003CrepoRoot>\u002Fknowledge\u002Fgraph\u002Fgraph.json`\n- **Schema version:** `1`\n- **Format:** `{ schema_version: 1, nodes: [...], edges: [...] }` — deterministically\n  serialized (nodes sorted by `id`, edges sorted by `(from, to, relation)`).\n- The directory `knowledge\u002Fgraph\u002F` is created automatically on first write\n  (self-bootstrap); you do not need to `mkdir` it manually.\n\n## Node Types\n\nEach node has four required fields: `id`, `type`, `ref`, `label`.\n\n| `type`            | Intended artifact                        | Example `ref`                          |\n|-------------------|------------------------------------------|----------------------------------------|\n| `knowledge_entry` | A file under `knowledge\u002F`               | `knowledge\u002Fdecisions\u002F2026-06-11.md`    |\n| `task`            | A task JSON file                        | `tasks\u002FTASK-035.json`                  |\n| `decision`        | A recorded design decision              | `knowledge\u002Fdecisions\u002Fgraph-design.md`  |\n| `skill`           | A skill directory                       | `skills\u002Fgraphify\u002FSKILL.md`             |\n\n### Canonical id shapes (TASK-104 — the canonical reference, identical to the orchestrator-routing skill's close-protocol section; the two sites must never contradict)\n\n`id` must be unique across all nodes and match its type's canonical shape:\n\n| node type          | id shape                     | example                                          |\n|--------------------|-------------------------------|---------------------------------------------------|\n| `task`             | `task-\u003Cdigits>`               | `task-104`                                         |\n| `decision`         | `decision-\u003CYYYYMMDD>-\u003Cslug>`  | `decision-20260704-release-v0-10-0-minor-bump`     |\n| `skill`            | `skill-\u003Cslug>`                | `skill-graphify`                                   |\n| `knowledge_entry`  | `ke-\u003Cslug>`                   | `ke-windows-atomic-rename`                         |\n\n`\u003Cslug>` is lowercase, hyphen-separated, `[a-z0-9-]+` only — never a raw ISO\ntimestamp and never an uppercase task key (e.g. `TASK-104`). Derive\u002Fvalidate\nmechanically via `canonicalIdPattern`\u002F`isCanonicalId`\u002F`deriveCanonicalId` in\n`src\u002Fgraph-id-migration.js` rather than hand-rolling the convention. On an\n`addNode` slug-collision rejection (the id is already in use), add a\ndistinguishing word to the `\u003Cslug>` rather than reusing or overloading the\nexisting id.\n\n## Edge Relations (typed)\n\nEach edge has three required fields: `from`, `to`, `relation`.\n\n| `relation`    | Meaning                                              |\n|---------------|------------------------------------------------------|\n| `learned-in`  | A knowledge entry was learned while working on X     |\n| `blocks`      | Task\u002Fdecision X blocks task Y                        |\n| `supersedes`  | Decision X supersedes decision Y                     |\n| `uses`        | X uses\u002Fdepends on skill or knowledge entry Y         |\n| `produced-by` | Knowledge entry X was produced by task Y             |\n| `relates-to`  | Generic bidirectional association                    |\n\n## Canonical graph (the brain) — this local graph is a PROJECTION\n\n`knowledge\u002Fgraph\u002Fgraph.json` is a read-through **projection\u002Fcache**. The source of truth is the\nwisearcher **brain** graph (Neo4j+Qdrant), written over MCP. Keep them in sync by doing node\nwrites through `src\u002Fgraph-sync.js` rather than calling `addNode` directly:\n\n- **`recordNode({ brain, repoRoot, node, topic })`** — writes the local projection AND mirrors the\n  node to the canonical graph via `kb_assert` (best-effort; queued when the brain is offline, never\n  lost). `task`\u002F`decision`\u002F`skill` map to `[EXPLICIT]`\u002FT2 canonical entities, `knowledge_entry` to\n  `[INFERRED:strong]`; `node.ref` becomes the claim's provenance.\n- **`neighborsCanonicalFirst({ brain, repoRoot, id, canonicalId })`** — reads the canonical graph\n  when the brain is up, else falls back to this local projection.\n\nWhen no brain is wired (the graceful-fallback case) `recordNode` still writes the local graph, so\nthe API below remains the offline source of truth. Bring the brain up with `\u002Fhivemind:brain`.\n\n## Public API — `src\u002Fknowledge-graph.js`\n\nAll functions accept a named-parameter object and return a `Promise`.\n`repoRoot` is always required and is the absolute path to the project root\n(use `process.env.CLAUDE_PROJECT_DIR ?? process.cwd()`).\n\n### `loadGraph({ repoRoot })`\n\nLoad the graph from disk. Returns `{ schema_version, nodes, edges }`. If\n`knowledge\u002Fgraph\u002Fgraph.json` does not exist, returns an empty graph\n`{ schema_version: 1, nodes: [], edges: [] }` without throwing. Throws on\ncorrupt JSON (loud by design).\n\n```js\nimport { loadGraph } from '.\u002Fsrc\u002Fknowledge-graph.js';\nconst graph = await loadGraph({ repoRoot });\n\u002F\u002F graph.nodes  → array of node objects\n\u002F\u002F graph.edges  → array of edge objects\n```\n\n### `addNode({ repoRoot, node })`\n\nAdd a node to the graph. Validates schema + rejects a duplicate `id`\n(case-insensitive — TASK-104) before any disk write. Creates `knowledge\u002Fgraph\u002F`\non first use. Throws on validation failure (zero disk mutation on error).\n\n```js\nimport { addNode } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait addNode({\n  repoRoot,\n  node: {\n    id: 'task-059',\n    type: 'task',\n    ref: 'tasks\u002FTASK-059.json',\n    label: 'graphify skill + \u002Fgraph command',\n  },\n});\n```\n\n### `addEdge({ repoRoot, edge })`\n\nAdd a typed edge. Validates referential integrity (both `from` and `to` must\nexist) and full schema before any write. Throws on failure.\n\n```js\nimport { addEdge } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait addEdge({\n  repoRoot,\n  edge: { from: 'task-059', to: 'skill-graphify', relation: 'produced-by' },\n});\n```\n\n### `removeNode({ repoRoot, id })`\n\nRemove a node by `id`. Cascades all edges referencing that `id` (as `from` or\n`to`). Silently succeeds if `id` is not found.\n\n```js\nimport { removeNode } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait removeNode({ repoRoot, id: 'task-059' });\n```\n\n### `removeEdge({ repoRoot, edge })`\n\nRemove a specific edge identified by `(from, to, relation)`. Silently\nsucceeds if the edge is not found.\n\n```js\nimport { removeEdge } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait removeEdge({\n  repoRoot,\n  edge: { from: 'task-059', to: 'skill-graphify', relation: 'produced-by' },\n});\n```\n\n### `neighbors({ repoRoot, id, relation?, direction? })`\n\nReturn connected node objects for a given `id`. Deduplicated.\n\n- `relation` (optional string): filter to edges with this relation value.\n- `direction` (optional `'out'` | `'in'`): filter by edge direction.\n  - omitted (default): bidirectional — all nodes sharing any edge with `id`.\n  - `'out'`: nodes reachable by outgoing edges from `id` (`id` is `from`).\n  - `'in'`: nodes that have an edge pointing into `id` (`id` is `to`).\n\nThrows `UnknownNodeIdError` (`err.code === 'E_GRAPH_UNKNOWN_ID'`) when `id`\ndoes not exist in the graph (TASK-104) — no more silent `[]` for a typo'd or\nstale id. Callers that treat a missing id as an expected degradation (e.g.\n`graph-sync.js`'s canonical-first fallback) must catch this explicitly.\n\n```js\nimport { neighbors } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\n\u002F\u002F All neighbors of 'task-059' (any direction, any relation):\nconst all = await neighbors({ repoRoot, id: 'task-059' });\n\n\u002F\u002F Only nodes task-059 USES (outgoing 'uses' edges):\nconst used = await neighbors({ repoRoot, id: 'task-059', relation: 'uses', direction: 'out' });\n\n\u002F\u002F All tasks that block task-059 (incoming 'blocks' edges):\nconst blockers = await neighbors({ repoRoot, id: 'task-059', relation: 'blocks', direction: 'in' });\n```\n\n### `nodesByType({ repoRoot, type })`\n\nReturn all nodes with the given `type` value.\n\n```js\nimport { nodesByType } from '.\u002Fsrc\u002Fknowledge-graph.js';\nconst allTasks = await nodesByType({ repoRoot, type: 'task' });\nconst allDecisions = await nodesByType({ repoRoot, type: 'decision' });\n```\n\n## How-To Recipes\n\n### BUILD — Add a node and connect it\n\n```js\nimport { addNode, addEdge } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\nconst repoRoot = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();\n\n\u002F\u002F 1. Add the artifact node.\nawait addNode({\n  repoRoot,\n  node: {\n    id: 'skill-graphify',\n    type: 'skill',\n    ref: 'skills\u002Fgraphify\u002FSKILL.md',\n    label: 'graphify',\n  },\n});\n\n\u002F\u002F 2. Connect it to the task that produced it.\nawait addEdge({\n  repoRoot,\n  edge: { from: 'skill-graphify', to: 'task-059', relation: 'produced-by' },\n});\n```\n\n### QUERY — Find neighbors and filter by type\n\n```js\nimport { neighbors, nodesByType } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\nconst repoRoot = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();\n\n\u002F\u002F What does skill-graphify depend on?\nconst deps = await neighbors({ repoRoot, id: 'skill-graphify', relation: 'uses', direction: 'out' });\n\n\u002F\u002F List every decision in the graph:\nconst decisions = await nodesByType({ repoRoot, type: 'decision' });\n```\n\n### INSPECT — Load and pretty-print the full graph\n\n```js\nimport { loadGraph } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\nconst repoRoot = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();\nconst graph = await loadGraph({ repoRoot });\n\nconsole.log(`Nodes: ${graph.nodes.length}`);\nconsole.log(`Edges: ${graph.edges.length}`);\nconsole.log(JSON.stringify(graph, null, 2));\n```\n\n## Visualization\n\nRun the `\u002Fhivemind:graph` slash command to launch the board server and\nopen the graph view at `http:\u002F\u002F127.0.0.1:4517\u002Fgraph`. The page renders all nodes\nand edges as an interactive force-directed diagram. The same data is available\nas JSON at `http:\u002F\u002F127.0.0.1:4517\u002Fapi\u002Fgraph`.\n\n## Validation\n\nAll write operations (`addNode`, `addEdge`, `removeNode`, `removeEdge`) run\nfull AJV draft-2020-12 validation on the resulting document **before** any disk\nmutation. An invalid write throws; the on-disk file is never touched on a\nvalidation failure.\n\n## Provenance\n\n- **Authored by:** Developer subagent on behalf of ticket `TASK-059`.\n- **API source:** `src\u002Fknowledge-graph.js` (TASK-035).\n- **Design boundary:** 2026-06-11 decision — incremental index, not bulk re-scanner.\n","# Graphify — Project Knowledge Graph Skill\n\nIncrementally build and query the project's typed knowledge graph via the\n`src\u002Fknowledge-graph.js` public API, then visualize it at the board's `\u002Fgraph`\nview. The graph is stored at `knowledge\u002Fgraph\u002Fgraph.json` in the project root.\n\n## CRITICAL Design Boundary\n\nThe graph is an **INCREMENTAL INDEX** over existing artifacts — not a bulk\nre-scanner and not a second copy of state. This honors the 2026-06-11 design\ndecision recorded in the project.\n\n- **Do** add nodes\u002Fedges for artifacts as they are created or referenced.\n- **Do** query the graph to find relationships between tasks, decisions, skills,\n  and knowledge entries.\n- **Do NOT** bulk-rescan all artifacts to rebuild the graph from scratch.\n- **Do NOT** duplicate artifact content into graph nodes — use `ref` to point at\n  the artifact; `label` is a short human-readable name only.\n\n## Graph Storage\n\n- **File:** `\u003CrepoRoot>\u002Fknowledge\u002Fgraph\u002Fgraph.json`\n- **Schema version:** `1`\n- **Format:** `{ schema_version: 1, nodes: [...], edges: [...] }` — deterministically\n  serialized (nodes sorted by `id`, edges sorted by `(from, to, relation)`).\n- The directory `knowledge\u002Fgraph\u002F` is created automatically on first write\n  (self-bootstrap); you do not need to `mkdir` it manually.\n\n## Node Types\n\nEach node has four required fields: `id`, `type`, `ref`, `label`.\n\n| `type`            | Intended artifact                        | Example `ref`                          |\n|-------------------|------------------------------------------|----------------------------------------|\n| `knowledge_entry` | A file under `knowledge\u002F`               | `knowledge\u002Fdecisions\u002F2026-06-11.md`    |\n| `task`            | A task JSON file                        | `tasks\u002FTASK-035.json`                  |\n| `decision`        | A recorded design decision              | `knowledge\u002Fdecisions\u002Fgraph-design.md`  |\n| `skill`           | A skill directory                       | `skills\u002Fgraphify\u002FSKILL.md`             |\n\n### Canonical id shapes (TASK-104 — the canonical reference, identical to the orchestrator-routing skill's close-protocol section; the two sites must never contradict)\n\n`id` must be unique across all nodes and match its type's canonical shape:\n\n| node type          | id shape                     | example                                          |\n|--------------------|-------------------------------|---------------------------------------------------|\n| `task`             | `task-\u003Cdigits>`               | `task-104`                                         |\n| `decision`         | `decision-\u003CYYYYMMDD>-\u003Cslug>`  | `decision-20260704-release-v0-10-0-minor-bump`     |\n| `skill`            | `skill-\u003Cslug>`                | `skill-graphify`                                   |\n| `knowledge_entry`  | `ke-\u003Cslug>`                   | `ke-windows-atomic-rename`                         |\n\n`\u003Cslug>` is lowercase, hyphen-separated, `[a-z0-9-]+` only — never a raw ISO\ntimestamp and never an uppercase task key (e.g. `TASK-104`). Derive\u002Fvalidate\nmechanically via `canonicalIdPattern`\u002F`isCanonicalId`\u002F`deriveCanonicalId` in\n`src\u002Fgraph-id-migration.js` rather than hand-rolling the convention. On an\n`addNode` slug-collision rejection (the id is already in use), add a\ndistinguishing word to the `\u003Cslug>` rather than reusing or overloading the\nexisting id.\n\n## Edge Relations (typed)\n\nEach edge has three required fields: `from`, `to`, `relation`.\n\n| `relation`    | Meaning                                              |\n|---------------|------------------------------------------------------|\n| `learned-in`  | A knowledge entry was learned while working on X     |\n| `blocks`      | Task\u002Fdecision X blocks task Y                        |\n| `supersedes`  | Decision X supersedes decision Y                     |\n| `uses`        | X uses\u002Fdepends on skill or knowledge entry Y         |\n| `produced-by` | Knowledge entry X was produced by task Y             |\n| `relates-to`  | Generic bidirectional association                    |\n\n## Canonical graph (the brain) — this local graph is a PROJECTION\n\n`knowledge\u002Fgraph\u002Fgraph.json` is a read-through **projection\u002Fcache**. The source of truth is the\nwisearcher **brain** graph (Neo4j+Qdrant), written over MCP. Keep them in sync by doing node\nwrites through `src\u002Fgraph-sync.js` rather than calling `addNode` directly:\n\n- **`recordNode({ brain, repoRoot, node, topic })`** — writes the local projection AND mirrors the\n  node to the canonical graph via `kb_assert` (best-effort; queued when the brain is offline, never\n  lost). `task`\u002F`decision`\u002F`skill` map to `[EXPLICIT]`\u002FT2 canonical entities, `knowledge_entry` to\n  `[INFERRED:strong]`; `node.ref` becomes the claim's provenance.\n- **`neighborsCanonicalFirst({ brain, repoRoot, id, canonicalId })`** — reads the canonical graph\n  when the brain is up, else falls back to this local projection.\n\nWhen no brain is wired (the graceful-fallback case) `recordNode` still writes the local graph, so\nthe API below remains the offline source of truth. Bring the brain up with `\u002Fhivemind:brain`.\n\n## Public API — `src\u002Fknowledge-graph.js`\n\nAll functions accept a named-parameter object and return a `Promise`.\n`repoRoot` is always required and is the absolute path to the project root\n(use `process.env.CLAUDE_PROJECT_DIR ?? process.cwd()`).\n\n### `loadGraph({ repoRoot })`\n\nLoad the graph from disk. Returns `{ schema_version, nodes, edges }`. If\n`knowledge\u002Fgraph\u002Fgraph.json` does not exist, returns an empty graph\n`{ schema_version: 1, nodes: [], edges: [] }` without throwing. Throws on\ncorrupt JSON (loud by design).\n\n```js\nimport { loadGraph } from '.\u002Fsrc\u002Fknowledge-graph.js';\nconst graph = await loadGraph({ repoRoot });\n\u002F\u002F graph.nodes  → array of node objects\n\u002F\u002F graph.edges  → array of edge objects\n```\n\n### `addNode({ repoRoot, node })`\n\nAdd a node to the graph. Validates schema + rejects a duplicate `id`\n(case-insensitive — TASK-104) before any disk write. Creates `knowledge\u002Fgraph\u002F`\non first use. Throws on validation failure (zero disk mutation on error).\n\n```js\nimport { addNode } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait addNode({\n  repoRoot,\n  node: {\n    id: 'task-059',\n    type: 'task',\n    ref: 'tasks\u002FTASK-059.json',\n    label: 'graphify skill + \u002Fgraph command',\n  },\n});\n```\n\n### `addEdge({ repoRoot, edge })`\n\nAdd a typed edge. Validates referential integrity (both `from` and `to` must\nexist) and full schema before any write. Throws on failure.\n\n```js\nimport { addEdge } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait addEdge({\n  repoRoot,\n  edge: { from: 'task-059', to: 'skill-graphify', relation: 'produced-by' },\n});\n```\n\n### `removeNode({ repoRoot, id })`\n\nRemove a node by `id`. Cascades all edges referencing that `id` (as `from` or\n`to`). Silently succeeds if `id` is not found.\n\n```js\nimport { removeNode } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait removeNode({ repoRoot, id: 'task-059' });\n```\n\n### `removeEdge({ repoRoot, edge })`\n\nRemove a specific edge identified by `(from, to, relation)`. Silently\nsucceeds if the edge is not found.\n\n```js\nimport { removeEdge } from '.\u002Fsrc\u002Fknowledge-graph.js';\nawait removeEdge({\n  repoRoot,\n  edge: { from: 'task-059', to: 'skill-graphify', relation: 'produced-by' },\n});\n```\n\n### `neighbors({ repoRoot, id, relation?, direction? })`\n\nReturn connected node objects for a given `id`. Deduplicated.\n\n- `relation` (optional string): filter to edges with this relation value.\n- `direction` (optional `'out'` | `'in'`): filter by edge direction.\n  - omitted (default): bidirectional — all nodes sharing any edge with `id`.\n  - `'out'`: nodes reachable by outgoing edges from `id` (`id` is `from`).\n  - `'in'`: nodes that have an edge pointing into `id` (`id` is `to`).\n\nThrows `UnknownNodeIdError` (`err.code === 'E_GRAPH_UNKNOWN_ID'`) when `id`\ndoes not exist in the graph (TASK-104) — no more silent `[]` for a typo'd or\nstale id. Callers that treat a missing id as an expected degradation (e.g.\n`graph-sync.js`'s canonical-first fallback) must catch this explicitly.\n\n```js\nimport { neighbors } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\n\u002F\u002F All neighbors of 'task-059' (any direction, any relation):\nconst all = await neighbors({ repoRoot, id: 'task-059' });\n\n\u002F\u002F Only nodes task-059 USES (outgoing 'uses' edges):\nconst used = await neighbors({ repoRoot, id: 'task-059', relation: 'uses', direction: 'out' });\n\n\u002F\u002F All tasks that block task-059 (incoming 'blocks' edges):\nconst blockers = await neighbors({ repoRoot, id: 'task-059', relation: 'blocks', direction: 'in' });\n```\n\n### `nodesByType({ repoRoot, type })`\n\nReturn all nodes with the given `type` value.\n\n```js\nimport { nodesByType } from '.\u002Fsrc\u002Fknowledge-graph.js';\nconst allTasks = await nodesByType({ repoRoot, type: 'task' });\nconst allDecisions = await nodesByType({ repoRoot, type: 'decision' });\n```\n\n## How-To Recipes\n\n### BUILD — Add a node and connect it\n\n```js\nimport { addNode, addEdge } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\nconst repoRoot = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();\n\n\u002F\u002F 1. Add the artifact node.\nawait addNode({\n  repoRoot,\n  node: {\n    id: 'skill-graphify',\n    type: 'skill',\n    ref: 'skills\u002Fgraphify\u002FSKILL.md',\n    label: 'graphify',\n  },\n});\n\n\u002F\u002F 2. Connect it to the task that produced it.\nawait addEdge({\n  repoRoot,\n  edge: { from: 'skill-graphify', to: 'task-059', relation: 'produced-by' },\n});\n```\n\n### QUERY — Find neighbors and filter by type\n\n```js\nimport { neighbors, nodesByType } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\nconst repoRoot = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();\n\n\u002F\u002F What does skill-graphify depend on?\nconst deps = await neighbors({ repoRoot, id: 'skill-graphify', relation: 'uses', direction: 'out' });\n\n\u002F\u002F List every decision in the graph:\nconst decisions = await nodesByType({ repoRoot, type: 'decision' });\n```\n\n### INSPECT — Load and pretty-print the full graph\n\n```js\nimport { loadGraph } from '.\u002Fsrc\u002Fknowledge-graph.js';\n\nconst repoRoot = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();\nconst graph = await loadGraph({ repoRoot });\n\nconsole.log(`Nodes: ${graph.nodes.length}`);\nconsole.log(`Edges: ${graph.edges.length}`);\nconsole.log(JSON.stringify(graph, null, 2));\n```\n\n## Visualization\n\nRun the `\u002Fhivemind:graph` slash command to launch the board server and\nopen the graph view at `http:\u002F\u002F127.0.0.1:4517\u002Fgraph`. The page renders all nodes\nand edges as an interactive force-directed diagram. The same data is available\nas JSON at `http:\u002F\u002F127.0.0.1:4517\u002Fapi\u002Fgraph`.\n\n## Validation\n\nAll write operations (`addNode`, `addEdge`, `removeNode`, `removeEdge`) run\nfull AJV draft-2020-12 validation on the resulting document **before** any disk\nmutation. An invalid write throws; the on-disk file is never touched on a\nvalidation failure.\n\n## Provenance\n\n- **Authored by:** Developer subagent on behalf of ticket `TASK-059`.\n- **API source:** `src\u002Fknowledge-graph.js` (TASK-035).\n- **Design boundary:** 2026-06-11 decision — incremental index, not bulk re-scanner.\n",{"name":5,"description":7,"source_tier":23},"T2","main","c8856147b7a3246a1e54b66126d093183805d1f3",".claude\u002Fskills\u002Fgraphify",0,"https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind","https:\u002F\u002Fhivemind-ef84a.web.app","https:\u002F\u002Fgithub.com\u002FHexingBot","2026-10-10 00:50:01",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add HexingBot\u002Fhivemind --skill graphify",{"tool":38,"command":39},"bunx","bunx skills add HexingBot\u002Fhivemind --skill graphify",{"tool":41,"command":42},"pnpm","pnpm dlx skills add HexingBot\u002Fhivemind --skill graphify","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgraphify\u002FSKILL.md",true,[],[47,54,63,71,78,86],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M77MWBWY2AK0GJ91MMKAPZ0M","unknown-skill","A demo skill with no license signal at all, used to exercise the \"unknown\" classification branch of the human license gate (TASK-135).","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Funknown-skill\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":58,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":18},"01M77MW9H43Z0ATZ15421K8J7D","spoofed-license-skill","A demo skill used to test TASK-150's SPDX-header-vs-LICENSE-file conflict surfacing.","GPL-3.0","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fspoofed-license-skill\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fspoofed-license-skill\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":67,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M77MW7715ENRZN6F01FDM81J","permissive-skill","A demo skill used to test assimilation of a permissively-licensed third party skill.","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fpermissive-skill\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fpermissive-skill\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M77MW3CRAPWETDAZT7E08BVS","malicious-skill","A fixture skill deliberately carrying risky content patterns, used only to exercise src\u002Fskill-scan.js (TASK-122). Never assimilated for real.","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fmalicious-skill\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":58,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M77MW1RSWW1MTQGM9TY3X37G","copyleft-skill","A demo skill used to test the human license gate for a copyleft third party skill.","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fcopyleft-skill\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fcopyleft-skill\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M77MVWT1EVEJ8ZYZTCG4CENE","watch","Watch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video. (assimilated for Hivemind)","https:\u002F\u002Fgithub.com\u002FHexingBot\u002Fhivemind\u002Fblob\u002Fmain\u002Fskills\u002Fwatch\u002FSKILL.md",[],[]]