agentleFS
tboome33tboome33/obsidian-mcp-router/skills/wiki-graph/SKILL.md

wiki-graph

Skill1 starsChanged 7 months agoApache-2.0View on GitHub

Build a typed knowledge graph (Understand-Anything-compatible JSON) from a vault's wiki — articles, entities, claims, sources, topics, and their relationships — so it can be visualised in an interactive graph dashboard. Use when the user says "build the knowledge graph", "graph my vault", "make a knowledge-graph.json", "visualise my wiki as a graph", "/wiki-graph", "construis le graphe de connaissance", "graphe du vault", or wants to explore their wiki's structure visually / feed it to Understand-Anything's dashboard.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 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.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Run /understand-dashboard <vault-path> — it reads our JSON directly (no need to run /understand-knowledge.

    line 88
  2. Distinctive:

    Don't hand-edit the generated JSON — it's derived.

    line 100
  3. Very specific:

    Don't add wiki-meta/graph/ or .understand-anything/ as *content* sources — they're derived artifacts, excluded by the default .wikiignore.

    line 101
  4. Very specific:

    Don't expect builds_on/contradicts edges yet — those need the LLM enrich pass (roadmap #1 step 3), not in this deterministic version.

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

wiki-graph

Assemble a typed knowledge graph from a vault's wiki and write it as JSON. The graph uses the Understand-Anything schema verbatim (Lum1104/Understand-Anything) so it can be visualised directly in that plugin's dashboard — see "Viewing it" below. Reference: [[understand-anything-roadmap]] item #1.

This skill is the deterministic core (--deterministic-only semantics): it maps existing vault data into a graph with no LLM calls. The LLM enrichment layers (auto-generating missing digests, discovering builds_on/contradicts edges) and Louvain community detection are roadmap follow-ons, not in this version.

What it produces

A knowledge-graph.json written to two locations:

PathRole
wiki-meta/graph/knowledge-graph.jsonCanonical source of truth — read by the future native viewer, agents, get_wiki_context_pack.
.understand-anything/knowledge-graph.jsonDerived copy — read directly by Understand-Anything's /understand-dashboard (zero extra step).

Both files are byte-identical. The derived copy is regenerated each run.

How the graph is built (deterministic)

Vault data→ Graph
each wiki/ pagearticle node (with knowledgeMeta: wikilinks, frontmatter)
digest concepts (wiki-meta/digests/)entity nodes (deduped globally) + related edges
digest claimsclaim nodes (page-namespaced) + related edges
[[wikilinks]] between pagesrelated edges
referenced sources — frontmatter sources:, ^[file:42-58] citations, ![[x.pdf]] embedssource nodes (lightweight, unparsed) + cites edges
wiki-meta/catalog.md sectionstopic nodes + categorized_under edges + layers[]

Key invariant (the binaries rule): a file a page references becomes a source node even if it matches .wikiignore. .wikiignore excludes files from becoming content (article nodes / lint / export), NOT from being referenceable as sources. So you can always trace a page back to its PDF/image and click through to it.

Pre-conditions

  1. Vault is online (list_vaults).
  2. Vault has a wiki/ directory with content pages. Richer graphs come from richer digests — if few pages have digests under wiki-meta/digests/, suggest running /wiki-refresh-digests first for fuller entity/claim extraction.

Steps

1. Resolve vault + options

  • vault — target vault (default vault if omitted).
  • --dry-run → pass dryRun: true to preview counts WITHOUT writing.
  • --no-ua-copy → pass writeUnderstandAnythingCopy: false to skip the .understand-anything/ copy.

2. (Optional) dry-run preview

For a first build or a big vault, preview first:

mcp__obsidian-router__build_wiki_graph({ vault, dryRun: true })

Report the counts (nodes/edges by type) so the user can sanity-check before writing.

3. Build + write

mcp__obsidian-router__build_wiki_graph({ vault })

The tool enumerates wiki/** + wiki-meta/digests/**, reads .wikiignore + wiki-meta/catalog.md, builds the graph, validates it against the schema (refuses to write an invalid graph), and writes the two files.

4. Report

Surface the returned summary:

  • counts — pages, digests, nodes, edges, layers + per-type breakdown
  • written — the two paths
  • warnings — e.g. index-not-found, no-content-pages-found, page-enumeration-truncated, understand-anything-copy-failed

5. Log

Append to wiki-meta/journal.md:

- YYYY-MM-DD HH:MM — wiki-graph — <vault> · <nodes> nodes / <edges> edges / <layers> layers

Viewing it (the interop — roadmap #2a)

The derived .understand-anything/knowledge-graph.json is written where Understand-Anything's dashboard expects it. To explore the graph interactively:

  1. Install the Understand-Anything plugin (/plugin marketplace add Lum1104/Understand-Anything → /plugin install understand-anything).
  2. Run /understand-dashboard <vault-path> — it reads our JSON directly (no need to run /understand-knowledge; we already produced the graph).

A native in-Obsidian viewer (obsidian-mcp-router-graph) is the roadmap #2b deliverable — until it ships, the UA dashboard is the visualisation path.

When NOT to use

  • A single page's links → use get_wiki_context_pack (it returns graphNeighbors for a query) instead of building the whole graph.
  • A portable text dump for an external LLM → use wiki-export (llms.txt).
  • Code-repo analysis → out of scope (that's Understand-Anything's /understand on the code side).

Anti-patterns

  • Don't hand-edit the generated JSON — it's derived; re-run the skill instead.
  • Don't add wiki-meta/graph/ or .understand-anything/ as content sources — they're derived artifacts, excluded by the default .wikiignore.
  • Don't expect builds_on/contradicts edges yet — those need the LLM enrich pass (roadmap #1 step 3), not in this deterministic version.

Quirks

  • Deterministic given fixed input: same vault state ⇒ same graph (only project.analyzedAt varies by run).
  • Enumeration is bounded (5000 files / depth 12); a *-enumeration-truncated warning means the vault exceeded a bound.
  • layers[] currently come from catalog.md sections. Louvain community detection (roadmap #4, folded into #1) will enrich them later.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.