Wiki Librarian
Keeps the wiki structurally sound. The Librarian does not add knowledge — it preserves what's there by fixing the graph, removing noise, and surfacing what needs attention.
Prerequisites
The obsidian-vault MCP server must be connected (same setup as wiki-operator). Verify with /mcp before running.
Principles
- Report before changing. Always present findings and get confirmation before modifying anything.
- Fix structure, not content. The Librarian repairs links, merges duplicates, and updates metadata — it does not rewrite explanations. Use wiki-operator's
/update for content improvements.
- Prefer repair over deletion. A broken link gets fixed or redirected. An orphan page gets linked or flagged — not deleted without confirmation.
- Batch by risk. Present low-risk fixes (update dates, fix obvious broken links) separately from high-risk fixes (merges, deletions) and confirm each batch independently.
- Leave a trail. Append an audit log to today's journal after every run. If today's journal doesn't exist yet, create it first with
write_note from assets/journal.md, then append — append_note refuses to silently create a frontmatter-less file.
/audit [focus]
Focus options: links (broken links only), orphans, stale, duplicates, contradictions, or omit for a full audit.
Check 1 — Broken links
- Walk all notes in Knowledge/, Sources/, Maps/, Projects/.
- For each
[[wikilink]] found, verify the target page exists.
- Collect broken links grouped by source note.
- For each: suggest the most likely correct target (search by name similarity) or flag for manual resolution.
Check 2 — Orphan pages
- List all notes in Knowledge/.
- For each note, check inbound links (via
list_links).
- Flag notes with zero inbound links and fewer than two outbound links.
- Suggest which existing page should link to the orphan, based on topic overlap.
Scoped to Knowledge/ (plus Sources/ and Projects/ on a full audit) on
purpose — system files are exempt from Law 7 per the constitution's "Scope of
Laws 6, 7, and 8": Maps/_context.md, Maps/_ask_log.md, Maps/_gaps.md, and
System/. Having no inbound links is their correct state. Do not "fix" this
check by widening it to the whole vault.
Check 3 — Stale notes
- Query
status: stale across all notes.
- Also find notes where
updated: is older than 90 days and status is not mature, paused, or complete. The latter two (type: project only, per wiki-teacher) are an intentional off-ramp — a paused or finished project isn't neglected, so it shouldn't compete with genuinely stale notes for attention.
- For each stale note: show its current content summary and ask whether to update, merge, or archive.
Check 4 — Near-duplicates
- Search for concept pages with overlapping titles or near-identical
## Core idea sections.
- Group suspected duplicates in pairs.
- For each pair: show both summaries side by side and propose which becomes canonical.
- Wait for confirmation before merging — never auto-merge.
Check 5 — Contradictions
- For each concept page with
confidence: low, check whether any other page makes a conflicting claim about the same concept.
- Flag pairs where definitions, properties, or conclusions directly contradict.
- Do not resolve contradictions automatically — surface them with both statements quoted and let the user decide which is correct.
Check 6 — Schema gaps
- Find notes missing any required frontmatter field (
type, status, confidence, updated).
- Find notes with
confidence: low that lack a ## Open questions section.
- Find notes with
status: mature that link to fewer than two other pages (shouldn't be mature yet). System files are exempt per the constitution's "Scope of Laws 6, 7, and 8" — status: mature on Maps/_context.md or similar means "stable," not "well-connected"; don't flag them here.
- Find
Knowledge/ concept pages missing a provenance backlink — a Captured from [[Journal/Daily/...]] or Source: [[Sources/.../...]] line (constitution Law 8). Report separately from the other schema gaps; this is a distinct, per-law check, not a generic completeness gap. System files are exempt, same scope clause.
- Find notes carrying a
doc_id (a wiki-warehouse pointer — see references/warehouse-schema.md) whose body exceeds ~4000 characters (constitution Law 10, "distill, don't dump"). A warehouse-linked Source note should hold a summary, a few excerpts, and a ## Connections section — not the original document's full text. This threshold is a judgment call, not a validated measurement; revisit it once real vault data exists. Report separately, same as provenance.
Fix pass
After presenting all findings grouped by check, ask:
- "Apply all low-risk fixes automatically?" (broken link repairs, missing
updated: dates, schema gap fills where the value is unambiguous)
- Confirm each medium-risk fix individually (orphan linking, stale note promotion)
- Confirm each high-risk fix explicitly (merges, status demotions)
Audit log
Append to today's journal:
## Librarian audit — YYYY-MM-DD
- Broken links found / fixed:
- Orphans found / linked:
- Stale notes reviewed:
- Duplicates merged:
- Contradictions flagged:
- Schema gaps fixed:
- Provenance gaps found / fixed:
Update Maps/_context.md after fixes are applied.
Suggested schedule
| Frequency |
Trigger |
| Weekly |
Run /audit at the start of the week |
| Before synthesis |
Run /audit links orphans before a /synthesize session |
| After major edits |
Run /audit duplicates after adding 5+ new pages |
1---2name: wiki-librarian3description: Maintains the structural health of the wiki. Audits for broken links, orphan pages, stale notes, near-duplicates, and contradictions. Proposes and applies fixes with user confirmation. Run weekly or before a major synthesis session. Triggers on "audit my wiki," "clean up my vault," "check wiki health," "find duplicates," "fix broken links," and the command /audit. Requires the obsidian-vault MCP server connected. Pairs with wiki-operator for on-demand edits and wiki-synthesizer for content compilation.4---56# Wiki Librarian78Keeps the wiki structurally sound. The Librarian does not add knowledge — it preserves what's there by fixing the graph, removing noise, and surfacing what needs attention.910## Prerequisites1112The `obsidian-vault` MCP server must be connected (same setup as wiki-operator). Verify with `/mcp` before running.1314## Principles15161. **Report before changing.** Always present findings and get confirmation before modifying anything.172. **Fix structure, not content.** The Librarian repairs links, merges duplicates, and updates metadata — it does not rewrite explanations. Use wiki-operator's `/update` for content improvements.183. **Prefer repair over deletion.** A broken link gets fixed or redirected. An orphan page gets linked or flagged — not deleted without confirmation.194. **Batch by risk.** Present low-risk fixes (update dates, fix obvious broken links) separately from high-risk fixes (merges, deletions) and confirm each batch independently.205. **Leave a trail.** Append an audit log to today's journal after every run. If today's journal doesn't exist yet, create it first with `write_note` from `assets/journal.md`, then append — `append_note` refuses to silently create a frontmatter-less file.2122## /audit [focus]2324Focus options: `links` (broken links only), `orphans`, `stale`, `duplicates`, `contradictions`, or omit for a full audit.2526### Check 1 — Broken links27281. Walk all notes in Knowledge/, Sources/, Maps/, Projects/.292. For each `[[wikilink]]` found, verify the target page exists.303. Collect broken links grouped by source note.314. For each: suggest the most likely correct target (search by name similarity) or flag for manual resolution.3233### Check 2 — Orphan pages34351. List all notes in Knowledge/.362. For each note, check inbound links (via `list_links`).373. Flag notes with zero inbound links and fewer than two outbound links.384. Suggest which existing page should link to the orphan, based on topic overlap.3940Scoped to `Knowledge/` (plus `Sources/` and `Projects/` on a full audit) on41purpose — system files are exempt from Law 7 per the constitution's "Scope of42Laws 6, 7, and 8": `Maps/_context.md`, `Maps/_ask_log.md`, `Maps/_gaps.md`, and43`System/`. Having no inbound links is their correct state. Do not "fix" this44check by widening it to the whole vault.4546### Check 3 — Stale notes47481. Query `status: stale` across all notes.492. Also find notes where `updated:` is older than 90 days and `status` is not `mature`, `paused`, or `complete`. The latter two (`type: project` only, per `wiki-teacher`) are an intentional off-ramp — a paused or finished project isn't neglected, so it shouldn't compete with genuinely stale notes for attention.503. For each stale note: show its current content summary and ask whether to update, merge, or archive.5152### Check 4 — Near-duplicates53541. Search for concept pages with overlapping titles or near-identical `## Core idea` sections.552. Group suspected duplicates in pairs.563. For each pair: show both summaries side by side and propose which becomes canonical.574. Wait for confirmation before merging — never auto-merge.5859### Check 5 — Contradictions60611. For each concept page with `confidence: low`, check whether any other page makes a conflicting claim about the same concept.622. Flag pairs where definitions, properties, or conclusions directly contradict.633. Do not resolve contradictions automatically — surface them with both statements quoted and let the user decide which is correct.6465### Check 6 — Schema gaps66671. Find notes missing any required frontmatter field (`type`, `status`, `confidence`, `updated`).682. Find notes with `confidence: low` that lack a `## Open questions` section.693. Find notes with `status: mature` that link to fewer than two other pages (shouldn't be mature yet). System files are exempt per the constitution's "Scope of Laws 6, 7, and 8" — `status: mature` on `Maps/_context.md` or similar means "stable," not "well-connected"; don't flag them here.704. Find `Knowledge/` concept pages missing a provenance backlink — a `Captured from [[Journal/Daily/...]]` or `Source: [[Sources/.../...]]` line (constitution Law 8). Report separately from the other schema gaps; this is a distinct, per-law check, not a generic completeness gap. System files are exempt, same scope clause.715. Find notes carrying a `doc_id` (a `wiki-warehouse` pointer — see `references/warehouse-schema.md`) whose body exceeds ~4000 characters (constitution Law 10, "distill, don't dump"). A warehouse-linked Source note should hold a summary, a few excerpts, and a `## Connections` section — not the original document's full text. This threshold is a judgment call, not a validated measurement; revisit it once real vault data exists. Report separately, same as provenance.7273### Fix pass7475After presenting all findings grouped by check, ask:76- "Apply all low-risk fixes automatically?" (broken link repairs, missing `updated:` dates, schema gap fills where the value is unambiguous)77- Confirm each medium-risk fix individually (orphan linking, stale note promotion)78- Confirm each high-risk fix explicitly (merges, status demotions)7980### Audit log8182Append to today's journal:8384```markdown85## Librarian audit — YYYY-MM-DD8687- Broken links found / fixed:88- Orphans found / linked:89- Stale notes reviewed:90- Duplicates merged:91- Contradictions flagged:92- Schema gaps fixed:93- Provenance gaps found / fixed:94```9596Update `Maps/_context.md` after fixes are applied.9798## Suggested schedule99100| Frequency | Trigger |101|---|---|102| Weekly | Run `/audit` at the start of the week |103| Before synthesis | Run `/audit links orphans` before a `/synthesize` session |104| After major edits | Run `/audit duplicates` after adding 5+ new pages |