$npx -y skills add tuan3w/obsidian-vault-agent --skill vault-graphUse when analyzing vault structure, finding orphan notes, discovering missing connections, identifying bridge concepts, or checking vault health from a graph perspective. Triggers on "vault graph", "map vault", "find orphans", "missing links", "vault structure", "knowledge graph"
| 1 | <Purpose> |
| 2 | Analyze the vault's wikilink structure as a directed graph. Computes PageRank |
| 3 | (most influential concepts), betweenness centrality (bridge nodes connecting |
| 4 | domains), orphan detection, cluster analysis, and missing-link discovery. |
| 5 | Combines deterministic graph computation (Python/NetworkX) with intelligent |
| 6 | interpretation (agent) to surface actionable insights. |
| 7 | </Purpose> |
| 8 | |
| 9 | <Use_When> |
| 10 | - User asks about vault structure, connections, or health |
| 11 | - User wants to find orphan notes (unlinked, isolated) |
| 12 | - User wants to discover missing connections between notes |
| 13 | - User wants to identify the most important concepts in the vault |
| 14 | - User asks "what should I link?" or "what's disconnected?" |
| 15 | - As part of /health workflow for structural metrics |
| 16 | - User says "map", "graph", "network", "connections", "orphans", "bridges" |
| 17 | </Use_When> |
| 18 | |
| 19 | <Do_Not_Use_When> |
| 20 | - User wants to search note CONTENT (use Grep/search_notes instead) |
| 21 | - User wants to process a single note (use /process) |
| 22 | - User wants tag analysis without graph structure (use /health) |
| 23 | </Do_Not_Use_When> |
| 24 | |
| 25 | <Execution_Policy> |
| 26 | - Run the Python script first — it handles all graph math deterministically |
| 27 | - Pipe script output to the graph-analyst agent for interpretation |
| 28 | - Report progress via TodoWrite |
| 29 | - If uv is not installed, provide install command and stop |
| 30 | - Script runs on the full vault — no sampling needed (handles 5000+ notes) |
| 31 | </Execution_Policy> |
| 32 | |
| 33 | <Steps> |
| 34 | |
| 35 | ## Stage 1: RUN GRAPH ANALYSIS |
| 36 | |
| 37 | Run the analysis script from the skill directory: |
| 38 | |
| 39 | ```bash |
| 40 | SKILL_DIR="${CLAUDE_SKILL_DIR}" |
| 41 | uv run "$SKILL_DIR/scripts/analyze_vault_graph.py" "." --top 20 |
| 42 | ``` |
| 43 | |
| 44 | The script outputs JSON to stdout with: |
| 45 | - `summary`: total notes, edges, orphans, density, clustering coefficient |
| 46 | - `top_pagerank`: most influential notes |
| 47 | - `top_betweenness`: bridge concepts connecting clusters |
| 48 | - `top_in_degree`: most referenced notes |
| 49 | - `top_out_degree`: most connecting notes |
| 50 | - `orphans`: notes with zero links in/out |
| 51 | - `dead_ends`: notes referenced but linking nowhere |
| 52 | - `clusters`: connected components with dominant types |
| 53 | - `missing_links`: wikilinks pointing to non-existent notes |
| 54 | - `type_distribution`: counts by note type |
| 55 | - `status_distribution`: counts by processing status |
| 56 | |
| 57 | Requires `uv` installed (`brew install uv` or `curl -LsSf https://astral.sh/uv/install.sh | sh`). Dependencies auto-install on first run. |
| 58 | |
| 59 | ## Stage 2: INTERPRET WITH AGENT |
| 60 | |
| 61 | Read the agent definition from `agents/graph-analyst.md` in the skill directory. |
| 62 | |
| 63 | Launch the analyst agent: |
| 64 | |
| 65 | ``` |
| 66 | Agent( |
| 67 | subagent_type="general-purpose", |
| 68 | model="sonnet", |
| 69 | run_in_background=false, |
| 70 | prompt="You are Graph Analyst. Follow these instructions exactly: |
| 71 | |
| 72 | [INSERT FULL CONTENT OF agents/graph-analyst.md HERE] |
| 73 | |
| 74 | VAULT CONTEXT: |
| 75 | - This is a Zettelkasten-style Obsidian vault |
| 76 | - Note types: term (atomic concepts), thought (original synthesis), |
| 77 | paper/post/book (sources), note (explanations), decision-log |
| 78 | - Tags are inline (#topic), not frontmatter |
| 79 | - Cross-domain connections are the vault's highest-value links |
| 80 | |
| 81 | GRAPH ANALYSIS RESULTS: |
| 82 | [INSERT JSON OUTPUT FROM STAGE 1 HERE] |
| 83 | |
| 84 | Produce your analysis following the Output Format specified above." |
| 85 | ) |
| 86 | ``` |
| 87 | |
| 88 | ## Stage 3: PRESENT RESULTS |
| 89 | |
| 90 | Present the agent's analysis to the user. Include: |
| 91 | 1. The health score and top findings |
| 92 | 2. Specific bridge concepts and orphans |
| 93 | 3. Missing notes worth creating |
| 94 | 4. Suggested new connections |
| 95 | |
| 96 | If the user wants to ACT on suggestions (create notes, add links), help them |
| 97 | do so using standard vault tools (Edit, write_note, etc.). |
| 98 | |
| 99 | </Steps> |
| 100 | |
| 101 | <Tool_Usage> |
| 102 | - **Bash**: Run analyze_vault_graph.py script |
| 103 | - **Read**: Read agent definition from agents/graph-analyst.md |
| 104 | - **Agent**: Delegate interpretation to graph-analyst (sonnet) |
| 105 | - **TodoWrite**: Report progress at each stage |
| 106 | - **Grep/Glob**: Follow-up searches if user wants to explore specific findings |
| 107 | </Tool_Usage> |
| 108 | |
| 109 | <Examples> |
| 110 | <Good> |
| 111 | User: "Show me my vault's knowledge graph health" |
| 112 | 1. Run script → JSON with 847 notes, 2341 edges, 43 orphans |
| 113 | 2. Agent interprets → "Your ML cluster is dense but isolated from psychology. |
| 114 | [[Reinforcement Learning]] and [[Operant Conditioning]] both describe |
| 115 | reward-based behavior but aren't linked." |
| 116 | 3. Present: 5 findings, 8 bridge suggestions, 12 orphans worth connecting |
| 117 | </Good> |
| 118 | |
| 119 | <Good> |
| 120 | User: "Find orphan notes" |
| 121 | 1. Run script → 43 orphans identified |
| 122 | 2. Agent filters → 15 are legitimately standalone (daily notes, clippings), |
| 123 | 28 should be connected |
| 124 | 3. Present prioritized list: "[[Loss Aversion]] is a term note with zero |
| 125 | links — should connect to [[Prospect Theory]] and [[Pricing Psychology]]" |
| 126 | </Good> |
| 127 | |
| 128 | <Bad> |
| 129 | User: "Map m |