graphify
Knowledge graph tool: '/graphify <path>' builds a graph, '/graphify query' searches existing graph, '/graphify path/explain' traces or explains nodes. Check the subcommand FIRST before responding.
kyopark2014 · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add kyopark2014/agent-wiki --skill graphify技能说明
name: graphify description: "Knowledge graph tool: '/graphify ' builds a graph, '/graphify query' searches existing graph, '/graphify path/explain' traces or explains nodes. Check the subcommand FIRST before responding." trigger: /graphify
/graphify
Turn any folder of files into a navigable knowledge graph with community detection, an honest audit trail, and three outputs: interactive HTML, GraphRAG-ready JSON, and a plain-language GRAPH_REPORT.md.
Usage
/graphify # full pipeline on current directory → Obsidian vault
/graphify <path> # full pipeline on specific path
/graphify <path> --mode deep # thorough extraction, richer INFERRED edges
/graphify <path> --update # incremental - re-extract only new/changed files
/graphify <path> --directed # build directed graph (preserves edge direction: source→target)
/graphify <path> --whisper-model medium # use a larger Whisper model for better transcription accuracy
/graphify <path> --cluster-only # rerun clustering on existing graph
/graphify <path> --no-viz # skip visualization, just report + JSON
/graphify <path> --html # (HTML is generated by default - this flag is a no-op)
/graphify <path> --svg # also export graph.svg (embeds in Notion, GitHub)
/graphify <path> --graphml # export graph.graphml (Gephi, yEd)
/graphify <path> --neo4j # generate graphify-out/cypher.txt for Neo4j
/graphify <path> --neo4j-push bolt://localhost:7687 # push directly to Neo4j
/graphify <path> --mcp # start MCP stdio server for agent access
/graphify <path> --watch # watch folder, auto-rebuild on code changes (no LLM needed)
/graphify <path> --wiki # build agent-crawlable wiki (index.md + one article per community)
/graphify <path> --obsidian --obsidian-dir ~/vaults/my-project # write vault to custom path (e.g. existing vault)
/graphify add <url> # fetch URL, save to ./raw, update graph
/graphify add <url> --author "Name" # tag who wrote it
/graphify add <url> --contributor "Name" # tag who added it to the corpus
/graphify query "<question>" # BFS traversal - broad context
/graphify query "<question>" --dfs # DFS - trace a specific path
/graphify query "<question>" --budget 1500 # cap answer at N tokens
/graphify path "AuthModule" "Database" # shortest path between two concepts
/graphify explain "SwinTransformer" # plain-language explanation of a node
What graphify is for
graphify is built around Andrej Karpathy's /raw folder workflow: drop anything into a folder - papers, tweets, screenshots, code, notes - and get a structured knowledge graph that shows you what you didn't know was connected.
Three things it does that Claude alone cannot:
- Persistent graph - relationships are stored in
graphify-out/graph.jsonand survive across sessions. Ask questions weeks later without re-reading everything. - Honest audit trail - every edge is tagged EXTRACTED, INFERRED, or AMBIGUOUS. You know what was found vs invented.
- Cross-document surprise - community detection finds connections between concepts in different files that you would never think to ask about directly.
Use it for:
- A codebase you're new to (understand architecture before touching anything)
- A reading list (papers + tweets + notes → one navigable graph)
- A research corpus (citation graph + concept graph in one)
- Your personal /raw folder (drop everything in, let it grow, query it)
What You Must Do When Invoked
CRITICAL - SUBCOMMAND DISPATCH: Before doing anything else, parse the user's command to identify the subcommand. Follow this table:
| User's command | Action |
|---|---|
/graphify query "..." | Jump to "For /graphify query" section below. Do NOT run the full pipeline. |
/graphify path "A" "B" | Jump to "For /graphify path" section below. Do NOT run the full pipeline. |
/graphify explain "..." | Jump to "For /graphify explain" section below. Do NOT run the full pipeline. |
/graphify add <url> | Jump to "For /graphify add" section below. Do NOT run the full pipeline. |
/graphify <path> --update | Jump to "For --update" section below. |
/graphify <path> --cluster-only | Jump to "For --cluster-only" section below. |
/graphify <path> --watch | Jump to "For --watch" section below. |
/graphify or /graphify <path> (with optional flags) | Run the full pipeline (Steps 0–9) below. |
If the subcommand is query, path, explain, or add, you MUST skip the full pipeline entirely and go directly to the corresponding section. These subcommands operate on an EXISTING graph — they do NOT build a new one.
If no path was given, use . (current directory). Do not ask the user for a path.
IMPORTANT: Always start by setting the working directory to ~/Documents/wiki to ensure graphify-out is created in the correct location.
Follow these steps in order. Do not skip steps.
Step 0 - Set Working Directory
cd ~/Documents/wiki || { echo "Error: ~/Documents/wiki directory not found. Creating it..."; mkdir -p ~/Documents/wiki; cd ~/Documents/wiki; }
Step 1 - Ensure graphify is installed
cd ~/Documents/wiki
# Detect the correct Python interpreter (handles pipx, venv, system installs)
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
if [ -n "$GRAPHIFY_BIN" ]; then
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
case "$PYTHON" in
*[!a-zA-Z0-9/_.-]*) PYTHON="python3" ;;
e
阅读完整来源 ↗