npx skills add ...
npx skills add ar9av/obsidian-wiki --skill wiki-lint
npx skills add ar9av/obsidian-wiki --skill wiki-lint
Audit and maintain the health of the Obsidian wiki. Use this skill when the user wants to check their wiki for issues, find orphaned pages, detect contradictions, identify stale content, fix broken wikilinks, or perform general maintenance on their knowledge base. Also triggers on "clean up the wiki", "what needs fixing", "audit my notes", or "wiki health check". Add --consolidate to switch from report-only to act-and-report mode (the "dream cycle"): fixes broken links, adds missing cross-references for orphans, corrects lifecycle states, demotes stale peripheral pages, normalizes tag aliases, and adds contradiction callouts — all with a dry-run preview and explicit user confirmation before any writes.
You are performing a health check on an Obsidian wiki. Your goal is to find and fix structural issues that degrade the wiki's value over time.
Before scanning anything: follow the Retrieval Primitives table in llm-wiki/SKILL.md. Prefer frontmatter-scoped greps and section-anchored reads over full-page reads. On a large vault, blindly reading every page to lint it is exactly what this framework is built to avoid.
llm-wiki/SKILL.md (inline @name override → walk up CWD for .env → ~/.obsidian-wiki/config → prompt setup). This gives OBSIDIAN_VAULT_PATHindex.md for the full page inventorylog.md for recent activity contextRun these checks in order. Report findings as you go.
Scope: skip _archives/, _raw/, _readouts/, and .obsidian/ in every check. These hold frozen snapshots, unprocessed staging drafts, and derived readouts (saved by wiki-narrate) — they are not knowledge-graph pages, so orphan, frontmatter, and link checks don't apply to them.
Find pages with zero incoming wikilinks. These are knowledge islands that nothing connects to.
How to check:
.md files in the vault[[page-name]] referencesindex.md and log.md) are orphansHow to fix:
Find [[wikilinks]] that point to pages that don't exist.
How to check:
\[\[.*?\]\] across all pages.md file existsHow to fix:
Every page should have: title, category, tags, sources, created, updated.
How to check:
^--- at file heads) instead of reading every page in fullHow to fix:
Every page should have a summary: frontmatter field — 1–2 sentences, ≤200 chars. This is what cheap retrieval (e.g. wiki-query's index-only mode) reads to avoid opening page bodies.
How to check:
^summary: across the vaultHow to fix:
Pages whose updated timestamp is old relative to their sources.
How to check:
updated timestamps to source file modification timesClaims that conflict across pages.
How to check:
How to fix:
Verify index.md matches the actual page inventory.
How to check:
index.md to actual files on diskindex.md still match page contentCheck whether pages are being honest about how much of their content is inferred vs extracted. See the Provenance Markers section in llm-wiki for the convention.
How to check:
provenance: block or any ^[inferred]/^[ambiguous] markers, count sentences/bullets and how many end with each markerextracted, inferred, ambiguous)synthesis/sources: in frontmatter: flag as "unsourced synthesis" — the page is making connections but has nothing to citeprovenance: frontmatter block, flag it when any field is more than 0.20 off from the recomputed valueprovenance: frontmatter and no markers — treated as fully extracted by conventionHow to fix:
synthesis/ pagesources: to frontmatter or clearly label the page as synthesisprovenance: frontmatter to match the recomputed valuesChecks whether pages that share a tag are actually linked to each other. Tags imply a topic cluster; if those pages don't reference each other, the cluster is fragmented — knowledge islands that should be woven together.
How to check:
n = count of pages with this tagactual_links = count of wikilinks between any two pages in this tag group (check both directions)cohesion = actual_links / (n × (n−1) / 2)How to fix:
cross-linker skill targeted at the fragmented tag — it will surface and insert the missing linksChecks that visibility/ tags are applied correctly and aren't silently missing where they matter.
How to check:
password, api_key, secret, token, ssn, email:, phone: followed by an actual value (not a field description). If a page matches and lacks visibility/pii or visibility/internal, flag it as a likely mis-classification.visibility/pii without sources:: A page tagged visibility/pii should always have a sources: frontmatter field — if there's no provenance, there's no way to verify the classification. Flag any visibility/pii page missing sources:.visibility/ tags are system tags and must not appear in _meta/taxonomy.md. If found there, flag as misconfigured — they'd be counted toward the 5-tag limit on pages that include them.How to fix:
visibility/pii (or visibility/internal if it's team-context rather than personal data) to the page's frontmatter tagssources:: add provenance or escalate to the user — don't auto-fillvisibility/ entries from _meta/taxonomy.mdFind pages in misc/ that have accumulated enough project affinity to be promoted.
How to check:
$OBSIDIAN_VAULT_PATH/misc/*.mdaffinity frontmatter fieldHow to fix:
cross-linker skill first if affinity scores look stale (e.g., affinity: {} on a page with many wikilinks)projects/<project-name>/references/ (or another appropriate category), update its category frontmatter, remove promotion_status, and grep the vault for backlinks to update themEnforces the confidence + lifecycle frontmatter schema (see llm-wiki/SKILL.md, Confidence and Lifecycle section).
Two modes:
--check (default, read-only) — reports errors and warnings--consolidate — may apply separately approved structural maintenance, but never rewrites base_confidenceConfidence is a semantic judgment. A deterministic tool cannot infer independent evidence lineages or whole-page claim coverage from source strings alone. Confidence automation therefore validates an explicitly approved manual trust ledger; it never substitutes URL counting for review.
lifecycle enum validationHow to check: Grep frontmatter for ^lifecycle: across all pages. Flag any value not in {draft, reviewed, verified, disputed, archived}.
How to fix: n/a (only a human should set lifecycle state)
base_confidence rangeHow to check: Grep frontmatter for ^base_confidence: across all pages. Flag any value outside [0.0, 1.0] or any page missing the field entirely.
How to fix: n/a (wrong value means the skill computed it wrong — surface for manual correction)
Staleness is never stored — it is computed at read time: is_stale = (today − updated) > 90 days.
How to check: For each page, read updated: from frontmatter and compute is_stale. If stale, also check lifecycle:. Report:
lifecycle: verified with a louder annotation (these are the most dangerous — high-trust pages that may be wrong)How to fix: --fix does not rewrite lifecycle. Staleness clears automatically when a re-ingest bumps updated.
How to check: For each page with superseded_by: "[[target]]":
archived (no circular or chained supersession)lifecycle != archived while superseded_by is set (inconsistent state)How to fix: n/a — flag for human resolution
How to check: Run the deterministic ledger validator first:
Use --strict for CI and scheduled gates: stale, unreviewed, or missing-page
warnings then return nonzero. Without --strict, trust-check remains a
read-only reporting command and returns nonzero only for hard ledger errors or
score mismatches.
The approved ledger lives at _meta/trust-ledger.json. Each entry records the human-reviewed score plus a SHA-256 fingerprint of material page content and evidence metadata. The fingerprint excludes volatile bookkeeping (updated, base_confidence, and lifecycle transition fields), so timestamp-only edits do not reopen review.
Interpret results as follows:
reviewed — current material fingerprint and stored score both match the approved review; do not recompute from source strings.stale — body, summary, sources, provenance, tags, or relationships changed; perform a new manual lineage + claim-coverage review.unreviewed — page has no approved ledger entry; manual review is required.score_mismatches — material content still matches, but stored base_confidence differs from the approved value; fail the lint.errors — malformed/missing ledger data; fail the lint.For a separately approved full-vault review, record the accepted state explicitly:
After a separately approved review of only specific stale/unreviewed pages, update only those entries:
--approved means a human approved every score being recorded. It is a workflow
assertion, not a cryptographic signature: keep _meta/trust-ledger.json under
version control and require human diff review before merging ledger changes.
--all is valid only after a full-vault review; use repeatable --page for
partial reviews so unrelated stale pages remain open. Never run trust-record
merely to silence warnings.
Manual recomputation protocol for stale/unreviewed pages:
llm-wiki buckets.raise, keep, lower, or repair first; require approval before changing base_confidence or refreshing the ledger.How to fix: There is no automatic confidence fix. Apply only an explicitly approved exact patch, verify its scope, then refresh only the reviewed ledger state. --consolidate must never rewrite base_confidence.
Full enforcement is active. Every non-reserved content page must contain a
finite base_confidence in [0.0, 1.0] and a documented lifecycle value.
Missing or malformed trust fields, malformed ledger data, and a missing required
ledger are hard errors. New pages with valid trust fields but no approved ledger
entry are unreviewed; material changes to approved pages are stale.
Add to the Wiki Health Report:
Append to the LINT log entry:
Validate relationships: frontmatter blocks. Skip pages that have no relationships: block — the field is optional.
Allowed types: extends, implements, contradicts, derived_from, uses, replaces, related_to
How to check:
^relationships: across all vault pagesrelationships: block, read its frontmatter (not the full page body)type: value not in the allowed set above[[ and ]] from the target: string, normalize (lowercase, spaces→hyphens, strip .md), and check whether a .md file at that path exists in the vault. Flag unresolved targets.How to fix:
related_to when the type is ambiguousOutput additions:
Append to the LINT log entry:
Identify high-value synthesis opportunities the wiki is missing — concept pairs that co-occur across many pages but have no synthesis/ page connecting them.
How to check:
synthesis/ — collect the concept pairs each one already covers (from its [[wikilinks]] or title)concepts/ and entities/How to fix:
/wiki-synthesize to automatically discover and fill the top gapsReport findings as a structured list:
Append to log.md:
Offer to fix issues automatically or let the user decide which to address.
--consolidate)Triggered by wiki-lint --consolidate. Switches from report-only to act-and-report — the "dream cycle" that runs periodically so the wiki self-heals.
Always run in dry-run first. Before writing anything:
"Apply these N changes? [yes / no / select]".wiki-dedup for that. Only link, promote, demote, and flag.Pre-write snapshot — before the first file write, check whether the vault itself is the root of a Git repository. Merely being a subdirectory of a larger repository does not qualify: running git add -A there could capture unrelated files. If the vault is not a standalone Git repository, skip this step silently — no nagging, no suggesting git init.
The clean-repository branch deliberately avoids calling git commit, so "nothing to commit" is not treated as an error. If git add or git commit fails, stop before editing the vault; never continue without the promised snapshot.
If SNAPSHOT_SHA is non-empty and the skill writes files, include the SHA in the final report. To discard the entire run, after confirming there are no later changes worth keeping, the user can run:
For each broken [[Target]] found in Check 2:
Grep across index.md titles)[[Oringal]] → [[corrected-page]].~~[[Target]]~~ → Target) and add a comment <!-- broken link: no match found -->.For each orphan page found in Check 1 (zero incoming links):
[[wikilink]] replacing the plain-text mention.cross-linker which runs broadly).Apply these rules automatically (they don't require human judgment — they enforce the documented state machine):
draft → reviewed: pages where lifecycle: draft AND created > 30 days ago AND base_confidence > 0.7. Set lifecycle: reviewed, lifecycle_changed: <today>, lifecycle_reason: "auto-promoted by wiki-lint --consolidate: age>30d, confidence>0.7".verified → stale: NOT a state transition — stale is a computed overlay, not a lifecycle value. Instead: for verified pages where is_stale = (today − updated) > 180 days, add a callout at the top of the page body: > ⚠️ **Stale**: This page was last updated <date>. Verify before relying on it. Only add if the callout isn't already present.reviewed → verified or any other transition — those are human-only.For pages with tier: supporting (or unset) that have 0 incoming links AND haven't been updated in 90+ days:
tier: peripheral.tier: core pages automatically — those were manually set.Read _meta/taxonomy.md for the alias mapping (e.g., ml → machine-learning). For each page, replace known alias tags with their canonical form in the tags: frontmatter field. This is a subset of tag-taxonomy's work — only alias fixes, no full audit.
For each pair of pages marked as contradicting each other (via relationships: contradicts in frontmatter, or flagged in Check 5):
> ⚠️ Contradiction flagged with [[Other Page]] callout already exists near the relevant claim.After all actions, write a report to synthesis/consolidation-<YYYY-MM-DD>.md:
QMD is a search index, not the source of truth. If $QMD_WIKI_COLLECTION is empty or unset, skip this step. Run it only after this skill has written or rewritten vault markdown. If QMD refresh fails, do not roll back the vault changes; report the QMD status separately.
Use $QMD_CLI if set; otherwise use qmd.
If the output says vectors are needed or embeddings may be stale, run:
Verify the collection with either:
or, when a specific page path is known:
Record one of:
QMD refreshed: update + embed + verifiedQMD refreshed: update only + verifiedQMD skipped: QMD_WIKI_COLLECTION unsetQMD skipped: qmd CLI unavailableQMD failed: <short error summary>obsidian-wiki trust-record "$OBSIDIAN_VAULT_PATH" \
--page "concepts/example.md" --page "skills/example.md" \
--reviewed-at "<ISO-8601 timestamp>" --approved --json --pretty### Confidence/Lifecycle Issues (N found)
- `concepts/foo.md` — missing `lifecycle` field (warning: Phase 1)
- `entities/bar.md` — `lifecycle: stalestate` is not a valid enum value
- `concepts/scaling.md` — `base_confidence: 1.4` is out of range [0.0, 1.0]
- `synthesis/old-analysis.md` — STALE (last updated 2025-10-01, 182 days ago) lifecycle=verified ⚠️ HIGH PRIORITY
- `concepts/outdated.md` — STALE (last updated 2025-11-15, 137 days ago) lifecycle=draft
- `entities/tool-v1.md` — `superseded_by: [[entities/tool-v2]]` but lifecycle=draft (expected archived)
- `concepts/drift-example.md` — confidence review stale: material fingerprint changed; manual lineage + coverage review required
- `entities/mismatch.md` — confidence mismatch: stored=0.80, approved=0.59- [TIMESTAMP] LINT ... lifecycle_issues=N### Typed Relationship Issues (N found)
- `concepts/foo.md` — relationships[1]: type "contradication" is not an allowed type (did you mean "contradicts"?)
- `concepts/bar.md` — relationships[0]: target "[[skills/nonexistent-skill]]" resolves to no page in vault
- `entities/baz.md` — relationships[2]: self-reference (target resolves to this page's own id)... relationship_issues=N