Skip to content

Refactor docs nav: one CLI page, no AI Resources, four tabs - #59

Merged
SPIKESPIGEL404 merged 1 commit into
mainfrom
claude/docs-refactor-59ae73
Aug 6, 2026
Merged

Refactor docs nav: one CLI page, no AI Resources, four tabs#59
SPIKESPIGEL404 merged 1 commit into
mainfrom
claude/docs-refactor-59ae73

Conversation

@SPIKESPIGEL404

Copy link
Copy Markdown
Contributor

What

Three structural changes to the docs site, plus a build fix they surfaced.

1. The CLI reference is one page

content/docs/(guide)/usage/cli/ — ten generated pages plus a hand-authored hub — collapses into a single usage/cli.mdx, shaped like opencode's CLI reference: intro, global flags, then one ## section per command group with commands nested beneath as ###/####/#####.

scripts/generate-cli.mjs now emits the whole page. Overlays keep the same role, with one addition:

File Supplies
cli-overlays/index.md (new) page frontmatter + the intro (moved verbatim from the old hub page)
cli-overlays/<group>.md title: → the ## section heading; prose → section intro; ## @<cmd> → per-command extras

The flag-hoisting is load-bearing, not just editorial. Flags every command accepts (-j/--json, --json, --human) now live in one ## Global flags table instead of repeating across 107 command tables. Without that, the page carries 733 table lines and OOMs the MDX compiler at a 12 GB heap — MDX compilation is superlinear in table rows, and a probe confirmed it's the rows specifically (3,205 lines of headings compile fine; 1,200 table rows do not). Hoisting drops it to 438 lines and the page builds.

2. AI Resources is dissolved

  • skills.mdxusage/skills.mdx, retitled Agent Skills
  • the docs MCP server merges into usage/mcp.mdx as ## The docs MCP server, next to the origin server, with the "not the MCP gateway" section extended to distinguish all three roles
  • the llms.txt page is retired

⚠️ Only the page is gone — /llms.txt and /api/docs/llms-full.txt still serve. Say the word if you want those retired too.

Usage now reads as the three ways to drive BitRouter: CLI, MCP Server, Agent Skills.

3. Integrations and Guides are top-level tabs

Both move out of the (guide) folder group to content/docs/, marked "root": true alongside Documentation and API Reference. URLs are unchanged(guide) was already stripped from them.

Two fumadocs gotchas hit along the way:

  • Integrations needed index in its pages list, or the tab resolved to /docs/integrations/models and /docs/integrations fell back to rendering under the Documentation tab.
  • Guides has no index.mdx, so it needs a pagesIndex.

Icon polish

  • usage/skills.mdx was the only page in the whole tree with a frontmatter icon: — a lone Box next to icon-less CLI and MCP Server siblings. Removed.
  • Documentation was the only tab of four without an icon. Added BookOpen.
  • integrations/index.mdx retitled Overview → Integrations, matching how reference/index.mdx is titled API Reference (it was the third "Overview" in that sidebar).

Redirects

Every retired URL has a 301 in next.config.ts. The ten CLI pages land on their section anchors:

From To
/docs/usage/cli/daemon /docs/usage/cli#daemon-lifecycle
/docs/usage/cli/misc /docs/usage/cli#key-workflow-state-and-update
/docs/ai-resources/skills /docs/usage/skills
/docs/ai-resources/mcp /docs/usage/mcp#the-docs-mcp-server
/docs/guides /docs/guides/cloud-api

(…and the rest — all twelve verified returning 308 to a live anchor.)

Section headings are now anchor targets that redirects depend on, so renaming one means updating next.config.ts. Noted in docs/CONTRIBUTING.md and AGENTS.md.

Verified

  • pnpm build — clean, 107 docs pages prerendered
  • pnpm test — 83 passing (footer-nav test updated for the new hrefs)
  • pnpm lint:docs — 47 docs across 6 sections; check-docs.mjs updated for the moved sections, now covering hand-authored usage/ pages while exempting generated cli.mdx
  • All four tabs render with their own sidebar; every redirect and anchor target checked in the browser

Not fixed here

A pre-existing React unique "key" prop warning in fumadocs' Sidebar — confirmed present on main before these changes.

🤖 Generated with Claude Code

Three structural changes to the docs site.

**One CLI page.** `content/docs/(guide)/usage/cli/` (ten generated pages plus a
hand-authored hub) collapses into a single `usage/cli.mdx`, in the shape of
opencode's CLI reference: intro, global flags, then one `##` section per command
group with commands nested beneath. `scripts/generate-cli.mjs` now emits the
whole page — `cli-overlays/index.md` supplies the frontmatter and intro (moved
from the old hub page), and each `cli-overlays/<group>.md` supplies a section.

Flags every command accepts (`-j/--json`, `--json`, `--human`) are hoisted into
one Global flags table instead of repeating across 107 command tables. That is
partly editorial and partly load-bearing: MDX compilation is superlinear in
table rows, and the un-hoisted page (733 table lines) OOM'd the compiler at a
12 GB heap. Hoisting drops it to 438 and the page builds.

**AI Resources dissolved.** Skills moves to `usage/skills.mdx` (retitled Agent
Skills), the docs MCP server merges into `usage/mcp.mdx` as its own section
alongside the origin server, and the llms.txt page is retired — the `/llms.txt`
and `/api/docs/llms-full.txt` endpoints still serve, they just no longer have a
docs page. Usage is now the three ways to drive BitRouter: CLI, MCP, Skills.

**Integrations and Guides are top-level tabs.** Both move out of the `(guide)`
folder group to `content/docs/`, marked `"root": true` alongside Documentation
and API Reference. URLs are unchanged — `(guide)` was already stripped from
them. Integrations lists `index` in its `pages` so the tab resolves to
`/docs/integrations` rather than its first child; Guides has no index page, so
it gets a `pagesIndex`.

Every retired URL has a 301 in `next.config.ts`, with the ten CLI pages landing
on their section anchors. Also drops the lone page-level icon in the Usage
sidebar and gives Documentation a tab icon so all four tabs match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SPIKESPIGEL404
SPIKESPIGEL404 merged commit e04f3a2 into main Aug 6, 2026
1 check passed
SPIKESPIGEL404 added a commit that referenced this pull request Aug 6, 2026
Main's #59 collapsed the ten generated `usage/cli/` pages into one
`usage/cli.mdx`, moved Integrations and Guides out of the `(guide)`
group into their own tabs, and dissolved AI Resources into `usage/`.
Three resolutions:

- `usage/meta.json`: main made Usage cli + mcp + skills. Insert `tui`
  after `cli` — those two are the binary's human-facing surfaces, and
  mcp/skills are how agents drive it.

- `scripts/check-docs.mjs`: main independently closed the same `usage/`
  lint gap this branch did, and did it better for the new layout —
  section paths are now `(guide)/`-prefixed since Integrations and
  Guides are top-level, and GENERATED is an exact-path Set because the
  CLI reference is one file rather than a subtree. Took main's version
  wholesale and re-applied only what it doesn't have: the alert rule and
  the frontmatter line-number offset.

- `usage/tui.mdx` See also: the CLI subpages it linked to no longer
  exist. Repointed at the single page's anchors. Main also folded the
  `tui` blurb into the Harnesses section intro and noted it has no
  generated subsection (it is absent from the alpha.26 snapshot's
  `--help`), so the section link now lands on real prose.

Also lists `tui.mdx` in CONTRIBUTING's `usage/` inventory.

Verified: lint 48 docs / 6 sections; the alert rule still fails a bare
alert at the right line and passes a fenced one; 83/83 tests;
`generate:cli` reproduces the committed page byte-for-byte; every
outbound link on the TUI page returns 200 and all three CLI anchors
resolve.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant