# /lint

Health-check the wiki.

Reports on:

* **Orphan pages** — wiki pages with no inbound `[[links]]`.
* **Unresolved contradictions** — pages with `[!WARNING] Contradiction` callouts that haven't been resolved.
* **Stale claims** — claims superseded by newer sources.
* **Missing pages** — concepts/entities referenced by `[[links]]` that lack their own page.
* **Broken links** — wikilinks pointing to files that don't exist.
* **Data gaps** — important topics that lack source coverage; suggests specific sources to investigate.

## The lint script

The mechanical checks run as a plain Node script with no dependencies, so the agent doesn't have to read every page to find broken links or orphans. `/lint` runs it first and works from its JSON output. You can run it yourself from the vault root:

```bash
csb lint                                  # from anywhere; pick brains or pass --path
pnpm lint:wiki                            # readable report, inside the vault
node scripts/lint/wiki-lint.js --json     # JSON, what /lint reads
```

| Check | Severity | What it finds |
|-------|----------|---------------|
| `broken-link` | error | A `[[wikilink]]` that points to no file in the vault. Links inside code are ignored. |
| `frontmatter` | error | A page with no frontmatter, or a missing or invalid `type` or `updated` date. |
| `orphan` | warning | A page no other wiki page links to. `index.md`, `log.md` and `overview.md` are exempt, and links from `log.md` don't count. |
| `short-link` | warning | A link that only resolves by bare file name, not the full `[[wiki/...]]` path the schema asks for. |
| `contradiction` | info | A `[!WARNING] Contradiction` callout still on a page. |

The JSON also groups broken link targets into `missingPages`, most-linked first. The script exits 1 when it finds errors and 0 otherwise. Stale claims and data gaps need judgment, so the agent still does those by reading pages.

Applies fixes where safe and flags everything else for your review. Appends a summary to `wiki/log.md`.

Scope: vault-local, installed at `.claude/skills/lint/SKILL.md` and copied into each other selected agent's project skills dir (e.g. `.agents/skills/lint`). Source: [template/.claude/skills/lint/SKILL.md](https://github.com/jessepinkman9900/claude-second-brain/blob/main/template/.claude/skills/lint/SKILL.md).
