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 feature-area docs.
Step 1: Discover Documentation Files
Build a complete inventory of documentation files on disk.
- Use
Glob to find all files matching docs/*.md (feature-area docs).
- Use
Glob to find all files matching docs/upgrade-notes/*.md.
- Exclude
docs/planning/ from the doc inventory — those are meta/planning files,
not feature-area documentation.
- 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 Feature Documentation section (the tables under
"Core Framework", "Core Features", "Infrastructure & Operations", "Grails Platform",
"Development & Builds") and the Quick Reference by Task table.
- Parse each table row to extract the linked filename and description.
Read docs/planning/docs-roadmap.md — parse all priority tables and the Grails Platform
table.
- Extract each document name, description, and status value.
- Note which entries are
Planned, Draft, or Done.
Step 3: Reconcile Indexes
Compare documentation on disk against both index files.
docs/README.md Reconciliation
For each feature-area doc on disk:
docs-roadmap.md Reconciliation
For each feature-area doc on disk:
- Check if it has an entry in
docs/planning/docs-roadmap.md with the correct status.
- Status updates: Change
Planned → Draft if the file exists and contains a DRAFT
banner. Change Draft → Done if the file exists and the DRAFT banner has been removed.
- 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 (docs/*.md and docs/upgrade-notes/*.md) 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 docs for sections that discuss the same topic
as a new doc. Where an existing doc has a brief treatment of a topic that now has
dedicated documentation, add a contextual "See filename.md for details" link.
Client Integration sections: Check if a new or updated doc references hoist-react
features that have corresponding client-side documentation. Add cross-links to the
## Client Integration section using the format:
- [hoist-react doc name](https://github.com/xh/hoist-react/tree/develop/docs/doc-name.md)
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.
docs/authentication.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. docs/authentication.md,
docs/upgrade-notes/v36-upgrade-notes.md). This doubles as the unique identifier.
title: derived from the doc's top-level # heading.
mcpCategory: MCP category — one of package, devops, or index.
viewerCategory: toolbox viewer category — one of overview, core-framework,
core-features, infrastructure, grails-platform, 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 viewerCategory).
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-23description: Pre-commit documentation consistency check. Ensures docs/README.md index, docs/planning/docs-roadmap.md, and the MCP server's document registry (docs/doc-registry.json) stay in sync with documentation files on disk. Validates inter-doc links and enhances cross-references when new docs are added. Invoke after editing feature-area 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 feature-area docs.1011## Step 1: Discover Documentation Files1213Build a complete inventory of documentation files on disk.14151. Use `Glob` to find all files matching `docs/*.md` (feature-area docs).162. Use `Glob` to find all files matching `docs/upgrade-notes/*.md`.173. **Exclude** `docs/planning/` from the doc inventory — those are meta/planning files,18 not feature-area documentation.194. Run `git diff --name-only` and `git status --porcelain` to identify which docs were20 recently changed or added.215. Build a master list of all documentation files, noting which are new or recently modified.2223## Step 2: Read Index Files2425Read the two index files and parse their current entries.26271. Read `docs/README.md` — focus on the **Feature Documentation** section (the tables under28 "Core Framework", "Core Features", "Infrastructure & Operations", "Grails Platform",29 "Development & Builds") and the **Quick Reference by Task** table.30 - Parse each table row to extract the linked filename and description.31322. Read `docs/planning/docs-roadmap.md` — parse all priority tables and the Grails Platform33 table.34 - Extract each document name, description, and status value.35 - Note which entries are `Planned`, `Draft`, or `Done`.3637## Step 3: Reconcile Indexes3839Compare documentation on disk against both index files.4041### docs/README.md Reconciliation4243For each feature-area doc on disk:44- Check if it has an entry in the appropriate `docs/README.md` table (Core Framework, Core45 Features, Infrastructure & Operations, Grails Platform, or Development & Builds).46- **Missing entries:** Add a new table row in the correct section using this format:47 ```markdown48 | [`filename.md`](./filename.md) | One-sentence description | Key, Topics, Here |49 ```50- **Stale entries:** If an entry links to a doc that no longer exists, remove it.51- **Quick Reference:** Check if a new doc should have a "If you need to..." entry in the52 Quick Reference by Task table. Add one if the doc covers a common task.53- **AGENTS.md directive:** Verify that `AGENTS.md` still contains the directive pointing54 to `docs/README.md` (the "Documentation" section). Do not re-add documentation tables55 to AGENTS.md.5657### docs-roadmap.md Reconciliation5859For each feature-area doc on disk:60- Check if it has an entry in `docs/planning/docs-roadmap.md` with the correct status.61- **Status updates:** Change `Planned` → `Draft` if the file exists and contains a DRAFT62 banner. Change `Draft` → `Done` if the file exists and the DRAFT banner has been removed.63- **Missing entries:** Add entries for docs not yet on the roadmap.64- **Progress notes:** Append a progress note entry for the current date to65 `docs/planning/docs-roadmap-log.md`. Follow the existing chronological format.6667## Step 4: Validate Inter-Doc Links6869Scan every documentation file (`docs/*.md` and `docs/upgrade-notes/*.md`) for relative70markdown links.71721. For each file, extract all markdown links matching `[text](path)` where `path` is a73 relative path (not a URL).742. Resolve each relative path from the source file's directory.753. Verify the target exists on disk.764. **Broken links:** Report and fix. Common fixes include:77 - Correcting `../` depth for moved files78 - Updating paths for renamed files79 - Removing links to deleted files8081## Step 5: Enhance Cross-Links8283When new or recently changed docs are detected, look for cross-linking opportunities.84851. **Topic-based linking:** Scan existing docs for sections that discuss the same topic86 as a new doc. Where an existing doc has a brief treatment of a topic that now has87 dedicated documentation, add a contextual "See [`filename.md`](path) for details" link.88892. **Client Integration sections:** Check if a new or updated doc references hoist-react90 features that have corresponding client-side documentation. Add cross-links to the91 `## Client Integration` section using the format:92 ```markdown93 - [hoist-react doc name](https://github.com/xh/hoist-react/tree/develop/docs/doc-name.md)94 ```95963. **Be conservative:** Only add links where the existing text already discusses the topic.97 Do not restructure existing content or add new sections just to create links.9899## Step 6: Reconcile Document Registry JSON100101Ensure `docs/doc-registry.json` reflects the current documentation on disk. This JSON file is102the single source of truth for both the MCP server and the toolbox documentation viewer.1031041. **Read and parse** `docs/doc-registry.json`. Each entry in the `entries` array is a JSON105 object. The entry's `id` field is also the file path relative to the repo root (e.g.106 `docs/authentication.md`).1071082. **Detect missing entries** — compare the Step 1 documentation inventory against registry109 entry `id` fields. For each unregistered doc, add a new entry with these fields:110 - `id`: file path relative to repo root (e.g. `docs/authentication.md`,111 `docs/upgrade-notes/v36-upgrade-notes.md`). This doubles as the unique identifier.112 - `title`: derived from the doc's top-level `# heading`.113 - `mcpCategory`: MCP category — one of `package`, `devops`, or `index`.114 - `viewerCategory`: toolbox viewer category — one of `overview`, `core-framework`,115 `core-features`, `infrastructure`, `grails-platform`, `devops`, or `upgrade`.116 - `description`: concise one-sentence summary matching existing entry style.117 - `keywords`: 5–12 key terms as a JSON array of strings — include API names, class names,118 and topic terms.1191203. **Place entries** in logical order within the `entries` array (grouped by `viewerCategory`).1211224. **Remove stale entries** whose `id` (file path) no longer exists on disk.1231245. **Update moved/renamed docs** — fix `id` values (and `title` if the change is structural).1251266. **Verify existing entries** — spot-check that metadata (title, description, keywords) is still127 accurate for recently changed docs. Only fix entries that are clearly stale or incorrect; do not128 rewrite working entries for style.129130## Step 7: Report131132Output a summary organized into these sections:1331341. **Index Updates** — `docs/README.md` entries added, updated, or removed.1352. **Roadmap Updates** — Status changes and new entries in `docs-roadmap.md`, progress notes136 appended to `docs-roadmap-log.md`.1373. **Broken Links Fixed** — Source file, broken target, and fix applied.1384. **New Cross-Links Added** — Source file, target doc, and surrounding context.1395. **Registry Updates** — Entries added, removed, or updated in `docs/doc-registry.json`, with140 `id` for each change.1416. **Items Needing Review** — Ambiguities or items requiring human judgment.142143If no changes were needed in a category, note "None" for that section.144145---146> Converted and distributed by [TomeVault](https://tomevault.io/claim/xh) — claim your Tome and manage your conversions.147<!-- tomevault:4.0:skill_md:2026-04-11 -->