Skip to main content
skill CX Codex

rspress-docs-generator — Claude Code skill: overview & setup

Builds a new Rspress v2 docs site or updates existing documentation pages according to changes in source code and tests.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a claude-code
Open on GitHub

What rspress-docs-generator does

The skill inspects the repository before drafting content. The agent examines source files, examples, tests, and configuration files such as rspress.config.ts. Package managers are detected directly from lockfiles like pnpm-lock.yaml or yarn.lock to run commands in the existing environment.

When no documentation exists, the agent scaffolds a fresh Rspress v2 site. For pull requests, it modifies targeted .mdx files and updates navigation records inside _meta.json or _nav.json. If legacy Rspress v1 dependencies are found, the skill pauses documentation updates and routes the project to rspress-v2-upgrade.

A passing build serves as the strict completion gate. The agent executes the documentation build script and resolves broken links or frontmatter errors before finishing.

What it helps with

  • scaffold a new Rspress v2 documentation site for an undocumented project
  • keep .mdx pages and _meta.json navigation in sync with source code PRs
  • catch Rspress v1 dependencies early and hand off to migration tooling
  • validate docs integrity through a mandatory build check

Example prompts for the agent

  • Create a new Rspress v2 documentation site for this workspace
  • Update the API docs to match recent changes in src/formatBytes.ts
  • Run the docs build and fix any broken links or frontmatter errors

How to install rspress-docs-generator

1Skills CLI (Vercel)

npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a claude-code

2Manually: put the files in place

~/.claude/skills/rspress-docs-generator/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/rspress-docs-generator/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about rspress-docs-generator

How do I install rspress-docs-generator in Claude Code?

Run npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a claude-code. The skill writes its instructions into ~/.claude/skills/rspress-docs-generator/SKILL.md.

What does rspress-docs-generator do?

It automates the generation and maintenance of Rspress v2 documentation sites. It extracts details directly from code, package manifests, and tests to prevent generic wording.

What happens if the project uses Rspress v1?

The skill checks package dependencies and config files for legacy v1 markers. It halts doc editing and instructs you to run rspress-v2-upgrade first.

Source text

SKILL.md · MIT
---
name: rspress-docs-generator
description: Create a Rspress v2 docs site or maintain existing Rspress v2 documentation for project changes.
---

# 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**
   - If no Rspress docs site exists, follow [Create New Docs](references/create-new-docs.md).
   - If a Rspress docs site exists but appears to be v1, follow [Rspress Version Guard](references/rspress-version-guard.md) before editing docs.
   - If a Rspress v2 docs site exists, follow [Maintain Docs For PRs](references/maintain-docs-for-prs.md).

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:

```bash
# 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:

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

## Reference

- [Documentation structure conventions](references/doc-structure-conventions.md) — how `_nav.json` and `_meta.json` work, with concrete examples for Guide/API sites, grouped sections, and i18n layouts.
- [Create New Docs](references/create-new-docs.md) — scaffold a Rspress v2 docs site from an undocumented project.
- [Maintain Docs For PRs](references/maintain-docs-for-prs.md) — update an existing Rspress v2 docs site for feature work.
- [Rspress Version Guard](references/rspress-version-guard.md) — detect v1 sites, avoid stale v1 scaffolds, and hand full migration to `rspress-v2-upgrade`.

© rstackjs · MIT · rstackjs/agent-skills

Similar skills

All skills for Writing and docs →

From the same set13

rspress-best-practices A skill that gives the agent rules for Rspress v2 sites: config, navigation, MDX, assets, search and deployment. Useful once the docs exist and the agent edits them. CX Codex +1 538installs rspack-v2-upgrade Walks a Rspack 1.x project through the v2 upgrade: dependencies, config, build checks. Useful when a major bump is too fiddly to do by hand. CX Codex +1 515installs rspress-description-generator A skill that fills in the description frontmatter field on Rspress pages that lack one. Useful when the docs site has grown and meta descriptions are missing in places. CX Codex +1 498installs rsbuild-v2-upgrade Walks a Rsbuild 1.x project through the v2 migration: dependencies, config, breaking options. Useful when a major bump would otherwise eat an evening. CX Codex +1 476installs rsdoctor-analysis Evaluates Rspack and Webpack bundles from a local rsdoctor-data.json report. It ranks package duplicates, heavy modules, and tree-shaking leaks. CX Codex +1 450installs migrate-to-rstest Migrates Jest, Vitest, or Playwright Test suites to Rstest while keeping test discovery, assertions, mocks, snapshots, and coverage intact. For moving a runner without rewriting scenarios. CX Codex +1 420installs rspress-custom-theme A skill that walks your agent through Rspress v2 theme changes, from CSS variables up to replacing built-in components. CX Codex +1 408installs migrate-to-rsbuild A skill that migrates webpack, Vite, Create React App, and Vue CLI projects to Rsbuild. It rewrites build configs and validates dev servers before cleaning up old packages. CX Codex +1 326installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor