wiki-lint
Health-check the wiki synthesis layer for stale pages, broken refs, and gaps
Wiki Lint
Validate the health of the wiki synthesis layer by checking for stale pages, broken references, orphan pages, and coverage gaps.
Primary Path: Lint Script
If the file scripts/lint-synthesis.js exists, run it and present the output:
node scripts/lint-synthesis.js
Parse the script's output and present findings using the report format described below.
Fallback Path: Manual Checks
If scripts/lint-synthesis.js does not exist or fails to run, perform the equivalent checks manually by following each step below.
Check 1: Staleness
For each Markdown file in docs/synthesis/:
- Parse the YAML frontmatter and extract
last_synthesizedandsources. - For each asset ID in
sources, look it up inmetadata.jsonand read itslast_revieweddate. - If any source asset's
last_reviewedis newer than the page'slast_synthesized, compute the gap in days. - If the gap exceeds the page's
staleness_threshold_daysfrontmatter value (default: 90), the page is stale. Record the page path, the stale source asset ID, and the number of days behind.
Check 2: Broken References
For each Markdown file in docs/synthesis/:
- Parse the
sourcesarray from YAML frontmatter. - For each source ID, verify it exists as an entry in
metadata.json. - If a source ID is not found in
metadata.json, record it as a broken reference with the synthesis page path and the missing ID.
Check 3: Orphan Pages
Build an adjacency map of synthesis pages:
- For each synthesis page, parse its
related_pagesfrontmatter field (a list of other synthesis page filenames). - A page is an orphan if no other synthesis page references it in its own
related_pageslist. Pages with IDgap-analysis-coverageorreadmeare excluded from orphan detection. - Record orphan page paths.
Check 4: Coverage Gaps
Identify domains that should have synthesis pages but do not:
- Read
metadata.jsonand group all assets by domain (derived from all tags in the asset'stagsarray; assets with multiple tags appear in multiple domains). - For each domain with 3 or more assets, check whether a corresponding entity page exists in
docs/synthesis/. - A domain without a matching entity page is a coverage gap. Record the domain name and asset count.
Report Format
Present findings in a structured report with these sections:
Stale Pages
| Page | Stale Source | Days Behind |
|---|---|---|
docs/synthesis/{page}.md | {asset-id} | N |
If no stale pages found, display: "No stale pages detected."
Broken References
| Page | Missing Source ID |
|---|---|
docs/synthesis/{page}.md | {missing-id} |
If no broken references found, display: "No broken references detected."
Orphan Pages
docs/synthesis/{page}.md
If no orphans found, display: "No orphan pages detected."
Coverage Gaps
| Domain | Asset Count | Suggested Page |
|---|---|---|
{domain} | N | docs/synthesis/entity-{domain}.md |
If no coverage gaps found, display: "Full coverage across all domains."
Summary
Provide a one-line pass/fail status:
- PASS: No stale pages and no broken references (orphans and coverage gaps are advisory warnings, not failures).
- WARN: Advisory issues only (orphans or coverage gaps, but no stale pages or broken refs).
- FAIL: Stale pages or broken references detected.
Include counts: {N} stale, {N} broken refs, {N} orphans, {N} coverage gaps.

