Audit the wiki for structural and quality problems. Run this explicitly when the user says "lint the wiki", "check wiki health", "find broken links", "find orphan pages", "what needs fixing", or "/wiki-lint". Never runs automatically. Produces a lint report and files it to wiki/lint-report.md.
The wiki accumulates over time. Without periodic audits, it develops orphan pages, stale content, broken links, and silent contradictions. Lint is the maintenance operation that keeps the wiki trustworthy as it scales.
Run explicitly. Never auto-triggered.
Find wiki pages with no inbound [[wikilinks]] from other pages.
# Terminal command to find all wikilinks in use:
grep -rh "\[\[" wiki/ --include="*.md" | grep -oP '\[\[\K[^\]]+' | sort | uniq > /tmp/linked-pages.txt
# Then list all wiki page names and diff against linked-pages.txt
For each orphan: suggest which pages should link to it.
Find [[PageName]] references that point to pages that don't exist.
grep -rn "\[\[" wiki/ --include="*.md"
Cross-reference against actual file names in wiki/ subdirectories. List every broken link with the file it appears in and line number.
Search for pages with existing ⚠️ contradiction flags:
grep -rn "⚠️" wiki/ --include="*.md"
Summarise all open contradictions. Flag any that were marked more than 30 days ago and still unresolved as stale contradictions needing resolution.
Find entity names mentioned in 3+ wiki pages that lack their own page in
wiki/entities/. Use codebase search for proper nouns appearing repeatedly.
List each missing entity with the pages that mention it.
Find concept names mentioned in 3+ wiki pages that lack their own page in
wiki/concepts/. Same approach as L4.
List each with suggested page content outline.
Find pages whose last_updated frontmatter date is older than 60 days AND
where newer sources in the wiki likely contain relevant updates.
Identify these by cross-referencing log.md timestamps against page dates.
Scan all wiki pages for:
confidence: speculative that have been in drafts/ for 14+ dayssources: [] field (untrackable claims)After running all checks, compile a lint report in this format:
# Wiki Lint Report
Date: YYYY-MM-DD
Wiki size: N pages | N sources | N entities | N concepts | N syntheses
## Summary
| Category | Issues Found |
|----------|-------------|
| L1 Orphans | N |
| L2 Broken Links | N |
| L3 Contradictions | N open |
| L4 Missing Entities | N |
| L5 Missing Concepts | N |
| L6 Stale Pages | N |
| L7 Index Integrity | N mismatches |
| L8 Frontmatter | N incomplete |
## L1 — Orphan Pages
[list each orphan with suggested fix]
## L2 — Broken Wikilinks
[list each with file:line and what the correct page name should be]
## L3 — Open Contradictions
[list each ⚠️ flag with its age and suggested resolution]
## L4 — Missing Entity Pages (suggested)
[list each entity with pages that mention it]
## L5 — Missing Concept Pages (suggested)
[list each concept with pages that mention it]
## L6 — Stale Pages
[list pages needing refresh with reason]
## L7 — Index Integrity Issues
[list mismatches]
## L8 — Frontmatter Issues
[list pages with problems]
## Recommended Actions (prioritised)
1. [highest impact fix first]
2. ...
Ask the user:
wiki/lint-report.md?"Append to wiki/log.md regardless of whether fixes were applied:
## [YYYY-MM-DD HH:MM] lint | Full audit
- Issues found: [N total across all categories]
- Auto-fixed: [list or none]
- Report saved: [yes/no]