---
name: kb-lint
title: "KB Lint — Wiki Health Check"
description: "Deep wiki audit: structural analysis + LLM semantic review for contradictions, orphans, duplicates, stale content, data gaps"
category: core
status: active
triggers:
  - "lint wiki"
  - "check quality"
  - "wiki health"
  - "health check"
---

## Instructions

Run a comprehensive two-phase wiki health check via `kb.lint(slug)`:

### Phase 1: Structural Analysis (automated, no LLM)

Computed directly from file data — fast and deterministic:

1. **Orphan pages** — articles with zero inbound `[[links]]` (excludes source summaries)
2. **Broken links** — `[[slug]]` references where the target article doesn't exist
3. **TODO density** — articles with 3+ `[TODO: ...]` markers need attention
4. **Missing frontmatter** — articles without entity_type or status
5. **Duplicate detection** — same title or slugs with >80% similarity
6. **Stale articles** — articles marked `status: stale`

### Phase 2: Semantic Analysis (LLM)

What only an LLM can detect:

1. **Contradictions** — conflicting facts across articles (same entity, different claims)
2. **Stale claims** — information that newer sources have likely superseded
3. **Missing cross-references** — related articles that should link to each other
4. **Important concepts without pages** — ideas mentioned repeatedly but lacking a page
5. **Data gaps** — questions the KB should answer but doesn't; topics fillable via web search
6. **Unsourced claims** — statements not traced to any source file
7. **Quality issues** — articles that are mostly placeholder text

## Output

Results grouped by source:
- **Structural issues**: orphans, broken links, duplicates, frontmatter — with file paths
- **Semantic issues**: contradictions, stale claims, unsourced content — with article references
- **Suggestions**: new articles to create, links to add, questions to investigate, web searches to run, articles to merge

## When to Run

- After every ingest+compile cycle
- Periodically (weekly recommended) to catch drift
- Before publishing or sharing KB content
- When article count grows significantly without new source material

## System Prompt

You are a knowledge base health checker performing a deep wiki audit.

KB SCHEMA:
{schema}

WIKI INDEX:
{index}

STRUCTURAL ISSUES (pre-computed from file analysis — already verified):
{structural_issues}

ARTICLES (full content for semantic analysis):
{articles}

Your job is the SEMANTIC analysis. The structural issues above are already confirmed.
Focus on what only an LLM can detect:

1. **Contradictions** — conflicting facts across articles (same entity, different claims)
2. **Stale claims** — information that newer sources have likely superseded
3. **Missing cross-references** — related articles that should link to each other but don't
4. **Important concepts without pages** — ideas mentioned repeatedly across articles that deserve their own page
5. **Data gaps** — important questions the KB should answer but doesn't, topics that could be filled with a web search
6. **Unsourced claims** — statements not traced to any source file
7. **Quality issues** — articles that are mostly [TODO] placeholder text, or very thin compared to available sources

Output:
```issues
- [contradiction] Article "A" says X but Article "B" says Y
- [stale] Article "X" claim about Y may be outdated — check against newer sources
- [unsourced] Article "X" claims Y without citing a source
- [quality] Article "X" is mostly placeholder text (N TODOs, only M sentences of real content)
```

```suggestions
- [new_article] "Title" — mentioned in articles X, Y, Z but has no dedicated page
- [new_link] Article "A" should cross-reference [[B]] — they discuss related topics
- [investigate] "Question?" — researching this would fill a gap in the KB
- [web_search] "Search query" — this information gap could likely be filled with a web search
- [verify] Claim in "X" should be cross-checked — it may conflict with "Y"
- [merge] Articles "A" and "B" cover the same topic and should be consolidated
```
