| type | skill |
| lifecycle | stable |
| inheritance | inheritable |
| name | nav-inject |
| description | Inject cross-document navigation tables into multi-file Markdown documentation suites |
| tier | extended |
| applyTo | **/*nav*,**/*navigation*,**/nav.json |
| muscle | .github/muscles/nav-inject.cjs |
| currency | 2026-04-22T00:00:00.000Z |
Navigation Injector
One config, every file navigable -- keep multi-doc suites connected
Reads a nav.json config and stamps a navigation table into every .md file in a documentation suite. Eliminates manual navigation maintenance across multi-file document sets.
When to Use
- Maintaining a multi-file documentation suite (governance, specs, guides)
- Need consistent cross-document navigation across all Markdown files
- Want to update navigation in one place and propagate everywhere
- Preparing document suites for Word/PDF conversion with navigation links
How It Works
- Define a
nav.json with the list of documents, labels, and icons
- Run
nav-inject.cjs -- it finds <!-- nav:start --> / <!-- nav:end --> sentinels in each file
- The navigation table is generated and injected between sentinels
- Run again after adding/removing files -- only sentinel content is replaced
Usage
node .github/muscles/nav-inject.cjs --init
node .github/muscles/nav-inject.cjs nav.json
node .github/muscles/nav-inject.cjs nav.json --dry-run
nav.json Format
{
"title": "Project Documentation",
"style": "table",
"position": "top",
"files": [
{ "path": "README.md", "label":