Wiki Doctor
Unified health check for Kevin's agent system. Validates five layers:
wiki structure, skills, rules, automations, and config sync.
When to use
- After large wiki edits or ingests
- When something seems broken (rendering, missing skills, stale data)
- When Kevin says "doctor", "audit", "health check", "validate"
- Before committing wiki changes (quality gate)
- On a schedule (daily via Cursor automation)
Commands
From the wiki repo root (~/Documents/GitHub/kevin-wiki):
# Run all doctors
npx tsx scripts/doctor.ts
# Run a specific doctor
npx tsx scripts/doctor.ts --only wiki # frontmatter, wikilinks, index
npx tsx scripts/doctor.ts --only skills # SKILL.md validity, symlinks
npx tsx scripts/doctor.ts --only rules # .mdc integrity, hub refs
npx tsx scripts/doctor.ts --only automations # staleness, missing refs
npx tsx scripts/doctor.ts --only config-sync # symlink health
# JSON output (for programmatic use)
npx tsx scripts/doctor.ts --json
What each doctor checks
wiki-structure
- Every page has valid frontmatter (title required, type + created recommended)
- No broken
[[wikilinks]]
_index.md page count matches actual files
log.md has valid YAML frontmatter
skills
- Every
SKILL.md under skills/personal/, skills/claude/, skills/dedalus/ has frontmatter with name and description
- Symlinks from wiki repo to
~/.cursor/skills/ and ~/.claude/skills/ are intact
- No duplicate slugs across namespaces
rules
- Every
.mdc in config/cursor/rules/ is non-empty
- Rules referenced in
agent-operations-hub.md exist on disk
- Dedalus cursor rules are valid
automations
- Every automation in
state.json has run within 14 days
- Never-run automations are flagged
config-sync
- All expected symlinks (
~/.cursor/rules, ~/.cursor/skills, ~/.claude/skills, hooks.json, mcp.json) point to correct targets
Interpreting results
| Severity |
Meaning |
| pass |
Check passed |
| warn |
Non-critical issue, should be fixed when convenient |
| fail |
Critical issue, fix before committing |
After running
Results are written to wiki/meta/doctor-results.json and state.json is updated. If there are fails, fix them before committing. If there are warns, batch-fix during maintenance.
Related
scripts/lint.ts — older wiki-only lint (subset of wiki-structure doctor)
scripts/build-discovery.ts — generates wiki/meta/discovery-index.json and wiki/llms.txt
scripts/check-freshness.ts — sync + automation staleness checks
1---2name: wiki-doctor3description: Run the wiki system doctor to validate wiki structure, skills, rules, automations, and config sync. Use when the user says "doctor", "audit", "health check", "validate wiki", "check my system", "run doctor", or when you suspect something is misconfigured after a large edit session.4---56# Wiki Doctor78Unified health check for Kevin's agent system. Validates five layers:9wiki structure, skills, rules, automations, and config sync.1011## When to use1213- After large wiki edits or ingests14- When something seems broken (rendering, missing skills, stale data)15- When Kevin says "doctor", "audit", "health check", "validate"16- Before committing wiki changes (quality gate)17- On a schedule (daily via Cursor automation)1819## Commands2021From the wiki repo root (`~/Documents/GitHub/kevin-wiki`):2223```bash24# Run all doctors25npx tsx scripts/doctor.ts2627# Run a specific doctor28npx tsx scripts/doctor.ts --only wiki # frontmatter, wikilinks, index29npx tsx scripts/doctor.ts --only skills # SKILL.md validity, symlinks30npx tsx scripts/doctor.ts --only rules # .mdc integrity, hub refs31npx tsx scripts/doctor.ts --only automations # staleness, missing refs32npx tsx scripts/doctor.ts --only config-sync # symlink health3334# JSON output (for programmatic use)35npx tsx scripts/doctor.ts --json36```3738## What each doctor checks3940### wiki-structure41- Every page has valid frontmatter (title required, type + created recommended)42- No broken `[[wikilinks]]`43- `_index.md` page count matches actual files44- `log.md` has valid YAML frontmatter4546### skills47- Every `SKILL.md` under `skills/personal/`, `skills/claude/`, `skills/dedalus/` has frontmatter with `name` and `description`48- Symlinks from wiki repo to `~/.cursor/skills/` and `~/.claude/skills/` are intact49- No duplicate slugs across namespaces5051### rules52- Every `.mdc` in `config/cursor/rules/` is non-empty53- Rules referenced in `agent-operations-hub.md` exist on disk54- Dedalus cursor rules are valid5556### automations57- Every automation in `state.json` has run within 14 days58- Never-run automations are flagged5960### config-sync61- All expected symlinks (`~/.cursor/rules`, `~/.cursor/skills`, `~/.claude/skills`, `hooks.json`, `mcp.json`) point to correct targets6263## Interpreting results6465| Severity | Meaning |66|----------|---------|67| pass | Check passed |68| warn | Non-critical issue, should be fixed when convenient |69| fail | Critical issue, fix before committing |7071## After running7273Results are written to `wiki/meta/doctor-results.json` and `state.json` is updated. If there are fails, fix them before committing. If there are warns, batch-fix during maintenance.7475## Related7677- `scripts/lint.ts` — older wiki-only lint (subset of wiki-structure doctor)78- `scripts/build-discovery.ts` — generates `wiki/meta/discovery-index.json` and `wiki/llms.txt`79- `scripts/check-freshness.ts` — sync + automation staleness checks