/sitegraph:rebuild-navfrom sitegraph
This skill should be used when the user asks to "rebuild the nav", "regenerate the sitemap", "fix the nav rail", "update the breadcrumbs", "check whether the nav is stale", "verify nothing has drifted before handoff", or "start a new sitegraph site", or after HTML pages are added, moved, renamed, or deleted under a sitegraph site root. Rebuilds the nav rail, breadcrumbs, prev/next pager, and sitemap.html from the folder structure; also covers drift detection with --check and bootstrapping sitegraph.config.json for a new site.
Ships in sitegraph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
sitegraph treats the filesystem itself as the navigation graph: every directory is a
section, every *.html file is a page. This skill runs the one script that keeps the
generated parts of every page in sync with that structure. There is no other build
step.
Use this skill when:
--check mode)Run the script against the site root:
bun run "${CLAUDE_PLUGIN_ROOT}/skills/rebuild-nav/scripts/build-nav.ts" <site-root>
<site-root> defaults to . if omitted. This requires bun — it is a zero-dependency
script using only Bun/Node built-ins, no npm packages and no network access.
Read the summary line it prints, e.g. sitegraph: 12 page(s) discovered, 3 updated, 9 unchanged. Files are only rewritten when their generated content
actually changed, so diffs stay minimal across reruns.
Surface warnings (printed as sitegraph warning: ...) to the user instead of
silently ignoring them. The most common cause is a page missing a <head> or
<body> tag — the script skips just that block and keeps going rather than
failing the whole run. See references/authoring.md for
the minimal page skeleton that avoids this.
Never hand-edit the content between <!-- sitegraph:head:start -->,
<!-- sitegraph:nav:start -->, or <!-- sitegraph:footer:start --> markers (and
their matching :end markers), or sitemap.html itself — all of it is
regenerated and overwritten on every run. Everything else in a page is left
completely untouched.
Use --check for drift detection instead of a real rebuild when the user just
wants to know if anything is out of date (e.g. before a release): it writes
nothing and exits non-zero if a rebuild would change any file.
bun run "${CLAUDE_PLUGIN_ROOT}/skills/rebuild-nav/scripts/build-nav.ts" <site-root> --check
There is no separate "init" skill — running rebuild-nav against a new or empty directory does the bootstrapping:
sitegraph.config.json if one doesn't exist yetsitemap.html at the site rootAfter that, scaffold a minimal index.html for the user using the skeleton in
references/authoring.md, then rerun the script so the new
page gets its nav rail and CSS link injected.
*.html/*.htm files are pages. Nothing else
needs to be declared anywhere.index.html, if present, becomes that section's hub — its title
labels the section in the rail/breadcrumb, and clicking the section links straight
to it. Without an index.html, the section is still shown (expandable) but its
label isn't a link.sitemap.html is generated output, not an input page — it is never discovered,
never appears in the rail, and is excluded from the page count.sitegraph.config.json's ignore
array are skipped entirely.Titles, sort order, and naming conventions are derived from the filenames
themselves; the exact rules are tabulated in
references/authoring.md, along with the config file
schema and the CSS helper classes (badge, callout, metric, …) available to
hand-authored content. Read it before writing new pages, choosing directory names,
or troubleshooting a warning.
references/authoring.md: page skeleton, marker-comment contract, config schema,
CSS kernel helper classes, and troubleshooting (loaded on demand)scripts/build-nav.ts: the rebuild script itselfWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub meaganewaller/marketplace --plugin sitegraph