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.
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.
Build a complete inventory of documentation files on disk.
Glob to find all files matching docs/*.md (feature-area docs).Glob to find all files matching docs/upgrade-notes/*.md.docs/planning/ from the doc inventory — those are meta/planning files,
not feature-area documentation.git diff --name-only and git status --porcelain to identify which docs were
recently changed or added.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.
Read docs/planning/docs-roadmap.md — parse all priority tables and the Grails Platform
table.
Planned, Draft, or Done.Compare documentation on disk against both index files.
For each feature-area doc on disk:
docs/README.md table (Core Framework, Core
Features, Infrastructure & Operations, Grails Platform, or Development & Builds).| [`filename.md`](./filename.md) | One-sentence description | Key, Topics, Here |
AGENTS.md still contains the directive pointing
to docs/README.md (the "Documentation" section). Do not re-add documentation tables
to AGENTS.md.For each feature-area doc on disk:
docs/planning/docs-roadmap.md with the correct status.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.docs/planning/docs-roadmap-log.md. Follow the existing chronological format.Scan every documentation file (docs/*.md and docs/upgrade-notes/*.md) for relative
markdown links.
[text](path) where path is a
relative path (not a URL).../ depth for moved filesWhen 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.
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.
Output a summary organized into these sections:
docs/README.md entries added, updated, or removed.docs-roadmap.md, progress notes
appended to docs-roadmap-log.md.docs/doc-registry.json, with
id for each change.If no changes were needed in a category, note "None" for that section.