---
name: vault-integrity
description: Structural / graph / convention health check for the vault — broken wikilinks (split into fixable link-errors where a note exists under a variant name vs. allowed not-yet-created gaps), frontmatter holes (missing/unterminated, no `author`/`type`), missing folder notes, area-TODO coverage, TODO `added`-stamp slips, checkboxes on People notes (a PEAK violation), duplicate basenames, and orphans. Wraps the engine's `vault_integrity` module (installed `alexandria-vault` package). Use when the owner says "check vault integrity", "vault health", "check the brain", "any broken links", "audit the vault", or wants a structural/graph audit. Read-only. NOT the growth metrics (that's vault-stats), and NOT the sweep's weekly hygiene email.
served: false
---

# Vault integrity

A thin trigger over a **read-only** structural checker — the on-demand, deeper companion to the sweep's weekly hygiene pass. It never writes to the vault.

When this skill fires:

1. **Run the tool** — from anywhere in the vault:
   ```sh
   "${ALEXANDRIA_PYTHON:-python3}" -m alexandria_vault.engine.vault_integrity --vault .           # human report
   "${ALEXANDRIA_PYTHON:-python3}" -m alexandria_vault.engine.vault_integrity --vault . --json    # machine-readable summary
   "${ALEXANDRIA_PYTHON:-python3}" -m alexandria_vault.engine.vault_integrity --vault . --top 40  # rows per section

   (The engine lives in the installed `alexandria-vault` package, not in the vault.
   `ALEXANDRIA_PYTHON` — the app venv's python — is the interpreter that has it; plain
   `python3` works wherever the package is pip-installed.)
   ```
2. **Verify before reporting.** The checker is deliberately conservative, but treat its output as leads, not verdicts: spot-check a few of the flagged items (open the file, confirm the link is really broken vs. a doc example) before presenting counts — a report full of false positives is worse than none.
3. **Split the graph findings.** Broken links come in two kinds: **link errors** (the target exists under a variant name — fixable now, usually by adding the variant as an `alias:` on the target note) and **not-yet-created** gaps (allowed by convention — but a target referenced many times has earned at least a stub). Lead with the fixable errors.
4. **Report + offer.** Summarize by severity; offer to fix the clear-cut items (alias the variant names, add missing frontmatter, convert People-note checkboxes to plain bullets) via the normal manifest → approve → one-commit loop. Don't mass-edit without approval.

What it checks: broken wikilinks (link-errors vs. gaps), frontmatter, folder notes, area-TODO coverage, TODO `added` stamps, People-note checkboxes (People notes are relationship records — tasks belong in an area TODO), duplicate basenames, and orphans. Wikilink parsing handles display aliases, heading links, table-escaped pipes, and attachments, and skips fenced/inline code so documentation examples aren't counted as real links.
