Wiki Doctor Contract

npx tsx scripts/doctor.ts is the structural health gate for the wiki, skills, rules, automations, and config sync.

Run this after large wiki edits, before commit when touching skills/rules/automations, and whenever generated-surface closeout could hide a drift bug. Use --verbose for item detail; use --quiet for final pass/fail signal.

Subsystems Checked

Subsystem Examples
wiki-structure frontmatter, recognized type, date sanity, body and related: wikilinks, no manual Backlinks heading, required timelines, page-size sanity, stale _index.md, duplicate slugs, orphans.
skills SKILL.md frontmatter, generated Skill Registry coverage, family pages, retired root mirrors, slug/name consistency, runtime symlinks.
rules .mdc presence, descriptions, hub-referenced rules, Dedalus rule projections.
automations frontmatter, schema, stale runs, never-run-local info.
config-sync expected symlink targets and config projection integrity.

Modes: --only <doctor>, --verbose, --quiet, and --json. Exit 1 means a failing finding exists; exit 2 means usage error.

Doctor results write to wiki/meta/doctor-results.json. The doctor is a structural gate; Wiki Lint Workflow and npm run wiki-quality cover broader content quality and graph health.

Companion Checks

Change class Check
Routing or skill resolver changes npm run routing-doctor
Broad wiki quality pass npm run wiki-quality
Generated pack/capsule edits npm run agent-packs:check
Config sync edits npx tsx scripts/doctor.ts --only config-sync
Skill source edits npm run skills:check

Closeout

For a broad AGENT DOCS rewrite, run npm run agent-packs:refresh, npm run agent-packs:check, npm run routing-doctor, npm run wiki-quality, npx tsx scripts/doctor.ts --quiet, npm run build-index, and qmd update && qmd embed.


Timeline

  • 2026-07-01 | Updated the doctor contract with current subsystem boundaries, companion checks, generated-surface closeout, and wording that avoids false manual-backlink matches. Source: User request, 2026-07-01
  • 2026-06-27 | Doctor skills check now validates generated registry coverage and family pages instead of one wiki article per executable skill. Source: User request, 2026-06-27
  • 2026-06-24 | Upgraded orphan skill catalog pages from advisory noise to failing doctor findings. Source: User request, 2026-06-24
  • 2026-06-05 | Doctor made more thorough: related-link, date, Timeline, manual-backlink, page-size, dangling-index, and skill/wiki-page checks; info severity plus aggregation and --verbose/--quiet. Source: User, 2026-06-05
  • 2026-05-31 | Agent doc created from wiki-doctor skill contract. Source: wiki-doctor SKILL.md, 2026-05-31