Files
skills/skills/using-wiki-graph/SKILL.md

4.3 KiB
Raw Blame History

name, version, description
name version description
using-wiki-graph 0.1.1 Use when a question is RELATIONAL about a wiki — «что связывает X и Y», «как связаны», «пу ть между X и Y», «what connects X and Y», «shortest path» — or about STRUCTURE/HEALTH — «ч то ссылается на X», «backlinks of X», «сироты», «битые ссылки», «orphan pages». Triggers ` wiki-graph` MCP (`mcp__wiki-graph__path|neighbors|backlinks|orphans|stats`) — deterministi c BFS over `wikilinks` server-side. Guarded failure-mode: on relational questions the agent reads one page and STOPS, never walking multi-hop chains. Precondition: DENSE corpor a only (e.g. modulair-wiki, 150 pages); skip sparse wikis (shared meta-wiki ≈ empty graph) . Each tool needs `corpus` = absolute path to `.wiki/`. Read-only, no grant. Skip for sing le-page content questions and wikis without `links`.

using-wiki-graph

Stop and call the graph. On a relational or structural wiki question, do not answer from reading one page — the links form a graph the LLM does not traverse reliably by reading. The wiki-graph MCP server walks [[wikilinks]] deterministically and returns the answer in a few lines; the corpus never enters context.

When to use

Trigger when the question is about connections between pages or wiki structure, not about the content of a single page:

  • relational — "what connects X and Y", "how are X and Y related", "path between X and Y", «что связывает», «как связаны», «путь между»;
  • neighbourhood — "neighbours of X", "what does X reach in 2 hops", «соседи X», «что рядом с X»;
  • incoming — "what links to X", "who references X", «кто ссылается на X», «backlinks»;
  • health — "orphan pages", "dangling/broken links", "how many components", «сироты», «битые ссылки», «здоровье вики».

Precondition — dense corpus only

The graph is useful only when the wiki is actually linked. modulair-wiki (~150 linked pages, ~715 edges) — yes. The shared meta-wiki (~/projects/.wiki/, ~1 link total) — no, the graph is empty; answer by reading instead. If unsure, run stats first: near-zero edges ⇒ fall back to reading.

Inputs

  • corpusabsolute path to the wiki's .wiki/ directory (e.g. C:/Users/vitya/projects/modulair-wiki/.wiki). Every tool requires it. Provenance dirs (raw/, sources/, assets/) are excluded automatically; the graph is the canonical concept/entity network.
  • page references are slugs (the .md basename, kebab-case), case-insensitive — e.g. euclidean-rhythms, not a title or path.

Steps

  1. Pick the tool from the question shape:
    • relational / "what connects" → mcp__wiki-graph__path (from, to) — shortest undirected chain.
    • neighbourhood → mcp__wiki-graph__neighbors (node, depth default 1) — outgoing within N hops.
    • "who links to" → mcp__wiki-graph__backlinks (node) — incoming references.
    • health → mcp__wiki-graph__orphans (unlinked pages + dangling targets) or mcp__wiki-graph__stats (counts).
  2. Pass corpus + the slugs. Report the returned chain/list directly; don't re-derive it by reading pages.
  3. Empty path result = genuinely no link chain — say so, don't invent one from prose proximity.

Failure modes

  • Slug typo / page not under a canonical dir → path returns empty or the node is unknown. Verify the slug is a real .md basename.
  • Sparse corpus → empty/near-empty graph. Don't force it; read instead (see Precondition).
  • wiki-graph server not registered → tools absent in session. Then read manually and note the server needs registering in ~/.claude.json.

Side effects

None. Read-only; parses files server-side. No writes, no grant, no network.

What NOT to do

  • Don't answer a relational question from a single-page read — that's the exact 0%-recall failure this skill exists to prevent.
  • Don't paste the whole wiki into context to "trace" links by hand — the server does it at zero token cost.
  • Don't invoke on dense-content questions ("what is euclidean-rhythms about") — that's a read, not a graph walk.
  • Don't pass titles or relative paths — only absolute corpus + basename slugs.