wiki-neighbors
Skill1 starsChanged 7 months agoApache-2.0View on GitHub
Show the neighbours of ONE wiki page from the knowledge graph — the pages it links to, the pages that link to it (backlinks), or both, at a configurable hop depth. Use when the user says "what links to X", "who links to X", "show me the backlinks of X", "what does X link to", "neighbours of X", "what's connected to X", "/wiki-neighbors", "quelles pages sont liées à X", "qui pointe vers X", "voisins de X", "qu'est-ce que X cite", or wants to explore one page's immediate connections. Do NOT use for the path between TWO specific pages — that's `wiki-path`; do NOT use for a full synthesized answer to a question — that's `wiki-query`.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- auto-modeSkill
- autoresearchSkill
- bind-workspaceSkill
- build-search-indexSkill
- canvasSkill
- conventionsSkill
- decision-consolidateSkill
- defuddleSkill
- discover-list-filesSkill
- discover-list-vaultsSkill
- force-new-port-startSkill
- hot-compactSkill
- lockSkill
- manage-deleteSkill
- manage-moveSkill
- meta-attach-vaultSkill
- meta-audit-bridge-readinessSkill
- meta-setupSkill
- meta-statusSkill
- meta-sync-templateSkill
- obsidian-basesSkill
- obsidian-markdownSkill
- read-frontmatterSkill
- read-getSkill
- read-searchSkill
- read-search-smartSkill
- saveSkill
- sync-from-githubSkill
- template-executeSkill
- unlockSkill
- who-is-speakingSkill
- wiki-boundarySkill
- wiki-exportSkill
- wiki-foldSkill
- wiki-graphSkill
- wiki-ingestSkill
- wiki-lintSkill
- wiki-pathSkill
- wiki-querySkill
- wiki-refresh-digestsSkill
- wikiSkill
- wiki-tourSkill
- write-appendSkill
- write-bundleSkill
- write-create-or-replaceSkill
- write-frontmatter-mergeSkill
- write-frontmatter-setSkill
- write-patchSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
If truncated: true, say so explicitly ("showing the closest 50 of 214 neighbours — narrow with direction or ask for a specific nodeTypes") …
- Very specific: line 57
Don't silently widen nodeTypes beyond ["article"] without telling the user — they asked about pages.
- Very specific: line 58
Don't re-fetch each neighbour's full page body just to answer this — the graph lookup already has name/path/type.
- Very specific: line 59
Don't present a truncated list as exhaustive.
- Distinctive: line 60
Don't pick a candidate for the user on an ambiguous name — surface the list and let them choose (the tool deliberately refuses to guess).
- Very specific: line 65
Default nodeTypes: ["article"] — the graph's related edges also connect a page to concepts/claims it mentions.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
wiki-neighbors
Look up the neighbourhood of one page directly from the persisted knowledge graph — no page-body scraping, no LLM synthesis. This is a deterministic graph lookup: give a page, get back the pages it cites (forward), the pages that cite it (backward, i.e. backlinks), or both. Reference: [[page-neighbors-roadmap]] item W-A.
Pre-condition
The knowledge graph must exist: wiki-meta/graph/knowledge-graph.json. If the tool call fails with "No knowledge graph at ...", tell the user and offer to run /wiki-graph first (or run it yourself if they confirm), then retry.
Steps
1. Parse the request
page(required) — a page name, a unique path suffix, or the exact vault-relative path. If the user only names a topic loosely ("what links to the OAuth page"), use their best guess aspage; the tool's own resolver will refuse with candidates if it's ambiguous (see step 3).direction(optional, defaultboth) — infer from phrasing: "what links TO X" / "backlinks of X" →backward; "what does X link to" / "what X cites" →forward; "neighbours of X" / "what's connected to X" →both.depth(optional, default 1) — "direct neighbours" → 1; "neighbours of neighbours" / "2 hops" → 2. Cap at 4 — if the user asks for more, tell them 4 is the ceiling and explain why (graph fan-out grows fast).nodeTypes(optional, default["article"]) — pages only by default. If the user asks "what concepts does X mention" or "what does X cite as a source", passnodeTypes: ["entity"]or["source"]instead/in addition.
2. Call the tool
mcp__obsidian-router__get_page_neighbors({ vault, page, direction, depth, nodeTypes?, edgeTypes?, maxNeighbors? })3. Handle the three special cases
- Graph missing (error mentions
build_wiki_graph) → offer to run/wiki-graph, then retry the lookup. - Ambiguous page (error says "is ambiguous" + lists candidate paths) → show the candidates to the user and ask them to pick one (or re-run with the exact path).
- Page not found → say so plainly; suggest checking
wiki-meta/catalog.mdfor the right name, or offer asearch/search_smartto locate it.
4. Present the result
Group by direction if both was used (the response doesn't separate them — you compute that from viaEdgeType/whichever hop set you asked for, or just present the flat list if direction was already narrowed). Use [[wikilinks]] (by page name) so the user can click through in Obsidian. For each neighbour, the hop distance and node type are useful context — surface them when depth > 1 or when nodeTypes was widened.
If truncated: true, say so explicitly ("showing the closest 50 of 214 neighbours — narrow with direction or ask for a specific nodeTypes") — never present a truncated list as if it were complete.
Example shape (adapt to what's actually returned — don't invent neighbours):
[[Crawl4AI]] — 2 pages link to it (backlinks):
- [[Crawl4AI-roadmap]]
- [[roadmap-emprunts]]
When NOT to use
- The relationship between two named pages ("how are A and B connected") →
/wiki-path. - A synthesized, cited answer to a broader question →
/wiki-query. - Exploring a whole vault/section as a reading path →
/wiki-tour. - The graph doesn't exist yet → run
/wiki-graphfirst.
Anti-patterns
- Don't silently widen
nodeTypesbeyond["article"]without telling the user — they asked about pages; concepts/sources showing up unannounced is confusing. - Don't re-fetch each neighbour's full page body just to answer this — the graph lookup already has name/path/type; only fetch a page if the user asks to read it.
- Don't present a
truncatedlist as exhaustive. - Don't pick a candidate for the user on an ambiguous name — surface the list and let them choose (the tool deliberately refuses to guess).
Quirks
directionmatters here (unlikewiki-path, which is undirected) —forwardandbackwardcan return different sets.- Default
nodeTypes: ["article"]— the graph'srelatededges also connect a page to concepts/claims it mentions; widennodeTypeson purpose to see those. depthcapped at 4,maxNeighborscapped at 200 (default 50, flagged viatruncated).graphAnalyzedAtin the response tells you how stale the graph might be — if it looks old and the vault has since changed a lot, suggest re-running/wiki-graph.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

