Scan the Obsidian wiki and automatically discover missing cross-references between pages. Use this skill when the user says "link my pages", "find missing links", "cross-reference", "connect my wiki", "add wikilinks", "what pages should be linked", or after any large ingestion to ensure new pages are woven into the existing knowledge graph. Also trigger when the user mentions "orphan pages" in the context of wanting to connect them, or says things like "my wiki feels disconnected" or "pages aren't linked well". This is a write-heavy skill — it actually modifies pages to add links, unlike wiki-lint which just reports issues.
You are weaving the wiki's knowledge graph tighter by finding and inserting missing [[wikilinks]] between pages that should reference each other but currently don't.
Follow the Retrieval Primitives table in llm-wiki/SKILL.md. Build the registry in Step 1 by grepping frontmatter only (not full pages). Reserve full Read for the unlinked-mention detection pass, and even there, only read pages whose summaries/titles make them plausible link targets. Blind full-vault reads are what this framework exists to avoid.
.env to get OBSIDIAN_VAULT_PATHindex.md to get the full inventory of pages and their one-line descriptionslog.md to see what was recently ingested (focus linking effort on new pages)Glob all .md files in the vault (excluding _archives/, .obsidian/). For each page, extract:
.md) — this is the wikilink targettitle fieldBuild a lookup table:
page_name → { path, title, aliases, tags, summary }
This is your "vocabulary" — every entry in this table is a valid wikilink target.
For each page in the vault:
Read the full content
Extract existing wikilinks — find all [[...]] references already present
Search for unlinked mentions — check if the page's text contains any of these, without being wrapped in [[...]]:
[[projects/my-project/my-project]] is missing)Check for semantic connections — pages that share multiple tags or are in the same project directory but don't link to each other
MyProject)[[entities/müller]] and vice versa.[[page-name]] not [[full/path/to/page-name]] when the name is unique across the vault[[foo]] already appears on the page, don't add anotherNot every possible link is worth adding. Score each candidate using a composite signal, then tag it with a confidence label.
| Signal | Points | Example |
|---|---|---|
| Exact name match in text | +4 | "MyProject" appears in body text → link to my-project.md |
| Shared tags (2+) | +2 | Both tagged #ai #agent but no link between them |
| Same project, no link | +2 | Both under projects/my-project/ but don't reference each other |
| Mentioned entity/concept | +2 | Page mentions "knowledge graphs" → link to [[concepts/knowledge-graphs]] |
| Cross-category connection | +2 | Source is in concepts/, target is in entities/ (or skills/ ↔ synthesis/) — different knowledge layers make this link more architecturally valuable |
| Peripheral→hub reach | +2 | Source page has ≤ 2 total links (peripheral) but target has ≥ 8 (hub) — connecting a loose page to a load-bearing concept |
| Partial name match | +1 | "graph" appears but page is knowledge-graphs — plausible but ambiguous |
Tag each candidate with a confidence label based on its score:
| Score | Label | Action |
|---|---|---|
| ≥ 6 | EXTRACTED | Link is effectively certain — exact mention or very strong match. Apply inline. |
| 3–5 | INFERRED | Link is a reasonable inference — shared context, cross-category, peripheral→hub. Apply inline or as Related section. |
| 1–2 | AMBIGUOUS | Weak or partial match. Skip unless user specifically asks to connect loose pages. |
Only act on EXTRACTED and INFERRED candidates. Include the confidence label in the Cross-Link Report so the user can review INFERRED links before trusting them.
For each page with missing links:
Find the first natural mention of the term in the body text and wrap it in wikilinks:
Before:
This project uses knowledge graphs to connect entities.
After:
This project uses [[concepts/knowledge-graphs|knowledge graphs]] to connect entities.
Use the [[path|display text]] format when the wikilink path differs from the display text.
If the term isn't mentioned naturally in the body but the pages are semantically related (shared tags, same project), add a ## Related section at the bottom of the page:
## Related
- [[projects/my-project/my-project]] — Also uses AI agents for research automation
- [[concepts/knowledge-graphs]] — Core technique used in this project
If a ## Related section already exists, append to it. Don't duplicate existing entries.
Present a summary:
## Cross-Link Report
### Links Added: 23 across 12 pages
| Page | Links Added | Confidence | Type |
|---|---|---|---|
| `projects/my-project/my-project.md` | 3 | EXTRACTED | 2 inline, 1 related |
| `entities/jane-doe.md` | 5 | INFERRED | 3 inline, 2 related |
| ... | | | |
### Orphan Pages Remaining: 2
- `references/foo.md` — no incoming or outgoing links found
- `concepts/bar.md` — could not find related pages
### Pages Skipped: 3
- `index.md`, `log.md` — special files
- `_archives/*` — archived content
Append to log.md:
- [TIMESTAMP] CROSS_LINK pages_scanned=N links_added=M pages_modified=P orphans_remaining=Q
_archives/. Those are frozen snapshots.## Key Concepts section, add to that section rather than creating a separate ## Related.jane-doe should be linked from almost every project page. Prioritize these.