mcpField
R
rspress-docs-generator

rspress-docs-generator

github.com/rstackjsDevelopment97312 installsUpdated 6d ago
Repository

About rspress-docs-generator

rspress-docs-generator is a skill for creating and maintaining Rspress v2 documentation alongside project work. It guides source-backed writing, detects existing site versions and structure, and uses a successful docs build as the main validation criterion.

Key features

  1. 01Inspect source, tests, examples, and metadata
  2. 02Create new Rspress v2 documentation sites
  3. 03Update docs for features, APIs, and CLI changes
  4. 04Detect v1 sites and route migration work
  5. 05Preserve package manager and workspace setup
  6. 06Validate with a documentation build

Use cases

  1. 01Documenting a project without an existing docs site
  2. 02Updating docs alongside a feature or API change
  3. 03Checking Rspress version before editing
  4. 04Adding docs to an Rslib package or workspace

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/rstackjs/agent-skills --skill rspress-docs-generator

After installing, type/rspress-docs-generatorin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
create-new-docs.md
doc-structure-conventions.md
maintain-docs-for-prs.md
rspress-version-guard.md

Details

From the project README

Rspress docs generator

Create and maintain Rspress documentation as part of normal project work. Prefer source-backed docs over generic prose: read the code, tests, examples, package metadata, and existing README before writing.

Use cases

  • Create a new Rspress v2 documentation site for a project that has no docs site yet.
  • Update an existing Rspress v2 docs site for a user-facing feature, API change, CLI change, or PR.
  • Detect Rspress v1 version markers before documentation work and hand migration to the dedicated rspress-v2-upgrade skill.
  • Integrate Rspress documentation into an Rslib package or workspace while preserving the repository's package manager and scripts.

Workflow

  1. Inspect the project

    • Locate package files, source entry points, examples, tests, changelogs, and README files.
    • Search for Rspress config files: rspress.config.ts, .js, .mjs, or .cjs.
    • Inspect dependencies for Rspress version markers: @rspress/core version, legacy rspress package or rspress/* imports, and @rspress/plugin-*.
    • Detect the package manager and workspace setup from lock files (pnpm-lock.yaml, yarn.lock, package-lock.json, bun.lock, bun.lockb) and pnpm-workspace.yaml.
    • If a config exists, resolve the docs root from its root option. When root is absent, inspect package scripts, CI commands, and documented commands for Rspress CLI positional roots such as rspress dev site, rspress build site, or rspress preview site; use that argument before falling back to Rspress's default docs/ directory relative to the config file's project cwd. If no config exists, check common roots such as docs/, doc/, website/, and site/.
  2. Choose the correct path

  3. Validate before finishing

    • Run the docs build from the Rspress project directory or through the repo's root script.
    • The build must pass as the primary success criterion.
    • Fix broken links, missing navigation entries, invalid frontmatter, and failed MDX imports before reporting completion.

Code examples

Use the repository's package manager when creating or validating docs:

# Create a new Rspress docs site with the detected package manager.
# Replace pnpm with npm, yarn, or bun when that is the repo package manager.
pnpm create rspress@latest

# Validate from the docs project after replacing starter content.
pnpm run build

When maintaining docs for a PR, inspect the changed source first, then update the matching docs page and navigation:

src/formatBytes.ts -> website/docs/api/formatBytes.mdx -> website/docs/api/_meta.json

Reference

Comments

Markdown supported