plugins/knowledge-base/skills/kb-health/SKILL.md
Lint and health-check the knowledge base. Finds orphan pages, missing cross-references, stale claims, broken wiki-links, and regenerates the index.
npx skillsauth add jmagly/aiwg kb-healthInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit the knowledge base for structural and content issues. Reports problems and, with --fix, repairs what can be fixed automatically (broken links, missing index entries). Human review is required for content issues (stale claims, empty sections).
--index-only/kb-health → direct invocation--path <subtree> (optional)Scope the check to a subdirectory (e.g., --path .aiwg/kb/entities/). Defaults to full KB root.
--kb <path> (optional)Root of the knowledge base. Default: resolved by aiwg kb path (#965), which reads resolveStorage('kb') and honors any roots.kb override in .aiwg/storage.config. On the default fs backend this is .aiwg/kb/.
KB_ROOT=$(aiwg kb path)
aiwg kb list --prefix entities/
aiwg kb get entities/foo.md
--fix (optional)Automatically repair issues that are safe to fix without human judgment:
Does NOT auto-fix: empty required sections, stale claim dates, ambiguous duplicates.
--index-only (optional)Skip all checks; only regenerate index.md.
An orphan is a page with no incoming [[wiki-link]] references from any other KB page.
Procedure:
.md files under <kb>/.[[...]] references.Orphans in sources/ are less critical (sources are often terminal nodes). Report them separately.
For every [[link-target]] found in any KB page:
With --fix: remove confirmed-broken links from Sources tables. Flag broken links in prose sections for manual review (do not silently remove).
Templates define required sections (Overview, Definition, Key Takeaways, etc.).
Detect pages where a required section header exists but the body is a placeholder (_..._ or a single empty line).
Report as warnings, not errors. Do not auto-fix content.
A page is considered stale if:
_Last updated: date is more than 180 days ago, ANDReport stale pages as advisory — staleness is informational, not a structural error.
Detect files with the same normalized slug in different subdirectories (e.g., entities/python.md and concepts/python.md). These may be legitimate or accidental duplicates. Report all cases; do not auto-resolve.
Always regenerate <kb>/index.md at the end of a health check run (or when --index-only is used).
The index lists all KB pages grouped by directory with their first-line description (the > blockquote line from templates):
# Knowledge Base Index
_Generated: YYYY-MM-DD — N pages_
## Entities (N)
- [Entity Name](entities/entity-name.md) — type · domain
## Concepts (N)
- [Concept Name](concepts/concept-name.md) — category · domain
## Sources (N)
- [Source Title](sources/source-slug.md) — type · author · date
## Comparisons (N)
- [A vs B](comparisons/a-vs-b.md) — purpose
## Syntheses (N)
- [Synthesis Title](syntheses/synthesis-slug.md) — type · confidence
KB Health Report — YYYY-MM-DD
Root: .aiwg/kb/
Pages scanned: N
ERRORS (must fix)
Broken links: N
entities/foo.md:12 — [[missing-page]] not found
WARNINGS (review recommended)
Orphan pages: N
sources/old-article.md — no incoming links
Empty sections: N
concepts/bar.md — Definition section is placeholder
Stale pages: N
entities/baz.md — last updated 2024-01-01 (>180 days)
INFO
Duplicate slugs: N
entities/python.md and concepts/python.md share slug "python"
Index regenerated: .aiwg/kb/index.md (N entries)
--fix enables targeted writes; --index-only writes only index.md.--path to scope.data-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.