xh-update-doc-links — Documentation Consistency Check
Pre-commit skill to ensure documentation index files, the MCP document registry, inter-doc links,
and cross-references stay consistent after editing READMEs or concept docs.
Step 1: Discover Documentation Files
Build a complete inventory of documentation files on disk.
- Use
Glob to find all **/README.md files, excluding node_modules/, public/, and
static/ directories.
- Use
Glob to find all files under docs/.
- Run
git diff --name-only and git status --porcelain to identify which docs were
recently changed or added.
- Build a master list of all documentation files, noting which are new or recently modified.
Step 2: Read Index Files
Read the two index files and parse their current entries.
Read docs/README.md — focus on the Package Documentation section (the tables under
"Core Framework", "Components", "Utilities", "Concepts", and "Other Packages").
- Parse each table row to extract the package path and linked README path.
- Parse the "Other Packages" paragraph to extract unlisted package names.
Read docs/planning/docs-roadmap.md — parse all priority tables and the Concepts table.
- Extract each package path, description, and status value.
- Note which entries are
Planned, Drafted, or [Done](link).
Step 3: Reconcile Indexes
Compare documentation on disk against both index files.
docs/README.md Reconciliation
For each README on disk:
docs-roadmap.md Reconciliation
For each README on disk:
- Check if it has an entry in
docs/planning/docs-roadmap.md with the correct status.
- Status updates: Change
Planned → [Done](../../path/README.md) for newly completed docs.
Change Drafted → [Done](../../path/README.md) if appropriate.
- Missing entries: Add entries for docs not yet on the roadmap.
- Progress notes: Append a progress note entry for the current date to
docs/planning/docs-roadmap-log.md. Follow the existing chronological format.
Step 4: Validate Inter-Doc Links
Scan every documentation file (READMEs + concept docs) for relative markdown links.
- For each file, extract all markdown links matching
[text](path) where path is a
relative path (not a URL).
- Resolve each relative path from the source file's directory.
- Verify the target exists on disk.
- Broken links: Report and fix. Common fixes include:
- Correcting
../ depth for moved files
- Updating paths for renamed files
- Removing links to deleted files
Step 5: Enhance Cross-Links
When new or recently changed docs are detected, look for cross-linking opportunities.
Topic-based linking: Scan existing READMEs for sections that discuss the same topic
as a new doc. Where an existing README has a brief treatment of a topic that now has
dedicated documentation, add a contextual "See /package/ for details" link.
Related Packages sections: Check if a new README was created for a package that is
referenced without a link in another doc's "Related Packages" section. Add the link using
the format:
- [`/package/`](path) - Brief description
Be conservative: Only add links where the existing text already discusses the topic.
Do not restructure existing content or add new sections just to create links.
Step 6: Reconcile Document Registry JSON
Ensure docs/doc-registry.json reflects the current documentation on disk. This JSON file is
the single source of truth for both the MCP server and the toolbox documentation viewer.
Read and parse docs/doc-registry.json. Each entry in the entries array is a JSON
object. The entry's id field is also the file path relative to the repo root (e.g.
cmp/grid/README.md, docs/lifecycle-app.md).
Detect missing entries — compare the Step 1 documentation inventory against registry
entry id fields. For each unregistered doc, add a new entry with these fields:
id: file path relative to repo root (e.g. cmp/grid/README.md,
docs/upgrade-notes/v82-upgrade-notes.md). This doubles as the unique identifier.
title: derived from the doc's top-level # heading.
mcpCategory: MCP category — one of package, concept, devops, conventions, or index.
viewerCategory: toolbox viewer category — one of overview, concepts, core,
components, desktop, mobile, utilities, supporting, devops, or upgrade.
description: concise one-sentence summary matching existing entry style.
keywords: 5–12 key terms as a JSON array of strings — include API names, class names,
and topic terms.
Place entries in logical order within the entries array (grouped by category).
Remove stale entries whose id (file path) no longer exists on disk.
Update moved/renamed docs — fix id values (and title if the change is structural).
Verify existing entries — spot-check that metadata (title, description, keywords) is still
accurate for recently changed docs. Only fix entries that are clearly stale or incorrect; do not
rewrite working entries for style.
Step 7: Report
Output a summary organized into these sections:
- Index Updates —
docs/README.md entries added, updated, or removed.
- Roadmap Updates — Status changes and new entries in
docs-roadmap.md, progress notes appended to docs-roadmap-log.md.
- Broken Links Fixed — Source file, broken target, and fix applied.
- New Cross-Links Added — Source file, target doc, and surrounding context.
- Registry Updates — Entries added, removed, or updated in
docs/doc-registry.json, with id for each change.
- Items Needing Review — Ambiguities or items requiring human judgment.
If no changes were needed in a category, note "None" for that section.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: xh-update-doc-links-33description: Pre-commit documentation consistency check. Ensures docs/README.md index, docs/planning/docs-roadmap.md, and the MCP server's hardcoded document registry stay in sync with documentation files on disk. Validates inter-doc links and enhances cross-references when new docs are added. Invoke after editing READMEs or concept docs, before committing. Use when this capability is needed.4---56# xh-update-doc-links — Documentation Consistency Check78Pre-commit skill to ensure documentation index files, the MCP document registry, inter-doc links,9and cross-references stay consistent after editing READMEs or concept docs.1011## Step 1: Discover Documentation Files1213Build a complete inventory of documentation files on disk.14151. Use `Glob` to find all `**/README.md` files, excluding `node_modules/`, `public/`, and16 `static/` directories.172. Use `Glob` to find all files under `docs/`.183. Run `git diff --name-only` and `git status --porcelain` to identify which docs were19 recently changed or added.204. Build a master list of all documentation files, noting which are new or recently modified.2122## Step 2: Read Index Files2324Read the two index files and parse their current entries.25261. Read `docs/README.md` — focus on the **Package Documentation** section (the tables under27 "Core Framework", "Components", "Utilities", "Concepts", and "Other Packages").28 - Parse each table row to extract the package path and linked README path.29 - Parse the "Other Packages" paragraph to extract unlisted package names.30312. Read `docs/planning/docs-roadmap.md` — parse all priority tables and the Concepts table.32 - Extract each package path, description, and status value.33 - Note which entries are `Planned`, `Drafted`, or `[Done](link)`.3435## Step 3: Reconcile Indexes3637Compare documentation on disk against both index files.3839### docs/README.md Reconciliation4041For each README on disk:42- Check if it has an entry in the appropriate `docs/README.md` table (Core Framework, Components,43 Utilities, Concepts, or Other Packages).44- **Missing entries:** Add a new table row in the correct section using this format:45 ```markdown46 | [`/package/`](../package/README.md) | One-sentence description | Key, Topics, Here |47 ```48 (Note: paths are relative from `docs/`, so package READMEs use `../` prefix.)49- **Stale entries:** If an entry links to a README that no longer exists, remove it.50- **Promotion:** If a package is listed in the "Other Packages" paragraph and now has a51 README, move it to the appropriate table and remove it from the paragraph.52- **AGENTS.md directive:** Verify that `AGENTS.md` still contains the directive pointing53 to `docs/README.md` (the "Hoist Documentation" section). Do not re-add package tables54 to AGENTS.md.5556### docs-roadmap.md Reconciliation5758For each README on disk:59- Check if it has an entry in `docs/planning/docs-roadmap.md` with the correct status.60- **Status updates:** Change `Planned` → `[Done](../../path/README.md)` for newly completed docs.61 Change `Drafted` → `[Done](../../path/README.md)` if appropriate.62- **Missing entries:** Add entries for docs not yet on the roadmap.63- **Progress notes:** Append a progress note entry for the current date to64 `docs/planning/docs-roadmap-log.md`. Follow the existing chronological format.6566## Step 4: Validate Inter-Doc Links6768Scan every documentation file (READMEs + concept docs) for relative markdown links.69701. For each file, extract all markdown links matching `[text](path)` where `path` is a71 relative path (not a URL).722. Resolve each relative path from the source file's directory.733. Verify the target exists on disk.744. **Broken links:** Report and fix. Common fixes include:75 - Correcting `../` depth for moved files76 - Updating paths for renamed files77 - Removing links to deleted files7879## Step 5: Enhance Cross-Links8081When new or recently changed docs are detected, look for cross-linking opportunities.82831. **Topic-based linking:** Scan existing READMEs for sections that discuss the same topic84 as a new doc. Where an existing README has a brief treatment of a topic that now has85 dedicated documentation, add a contextual "See [`/package/`](path) for details" link.86872. **Related Packages sections:** Check if a new README was created for a package that is88 referenced without a link in another doc's "Related Packages" section. Add the link using89 the format:90 ```markdown91 - [`/package/`](path) - Brief description92 ```93943. **Be conservative:** Only add links where the existing text already discusses the topic.95 Do not restructure existing content or add new sections just to create links.9697## Step 6: Reconcile Document Registry JSON9899Ensure `docs/doc-registry.json` reflects the current documentation on disk. This JSON file is100the single source of truth for both the MCP server and the toolbox documentation viewer.1011021. **Read and parse** `docs/doc-registry.json`. Each entry in the `entries` array is a JSON103 object. The entry's `id` field is also the file path relative to the repo root (e.g.104 `cmp/grid/README.md`, `docs/lifecycle-app.md`).1051062. **Detect missing entries** — compare the Step 1 documentation inventory against registry107 entry `id` fields. For each unregistered doc, add a new entry with these fields:108 - `id`: file path relative to repo root (e.g. `cmp/grid/README.md`,109 `docs/upgrade-notes/v82-upgrade-notes.md`). This doubles as the unique identifier.110 - `title`: derived from the doc's top-level `# heading`.111 - `mcpCategory`: MCP category — one of `package`, `concept`, `devops`, `conventions`, or `index`.112 - `viewerCategory`: toolbox viewer category — one of `overview`, `concepts`, `core`,113 `components`, `desktop`, `mobile`, `utilities`, `supporting`, `devops`, or `upgrade`.114 - `description`: concise one-sentence summary matching existing entry style.115 - `keywords`: 5–12 key terms as a JSON array of strings — include API names, class names,116 and topic terms.1171183. **Place entries** in logical order within the `entries` array (grouped by category).1191204. **Remove stale entries** whose `id` (file path) no longer exists on disk.1211225. **Update moved/renamed docs** — fix `id` values (and `title` if the change is structural).1231246. **Verify existing entries** — spot-check that metadata (title, description, keywords) is still125 accurate for recently changed docs. Only fix entries that are clearly stale or incorrect; do not126 rewrite working entries for style.127128## Step 7: Report129130Output a summary organized into these sections:1311321. **Index Updates** — `docs/README.md` entries added, updated, or removed.1332. **Roadmap Updates** — Status changes and new entries in `docs-roadmap.md`, progress notes appended to `docs-roadmap-log.md`.1343. **Broken Links Fixed** — Source file, broken target, and fix applied.1354. **New Cross-Links Added** — Source file, target doc, and surrounding context.1365. **Registry Updates** — Entries added, removed, or updated in `docs/doc-registry.json`, with `id` for each change.1376. **Items Needing Review** — Ambiguities or items requiring human judgment.138139If no changes were needed in a category, note "None" for that section.140141---142> Converted and distributed by [TomeVault](https://tomevault.io/claim/xh) — claim your Tome and manage your conversions.143<!-- tomevault:4.0:skill_md:2026-04-11 -->