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.
npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a claude-codeWhat 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
.mdxpages and_meta.jsonnavigation 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-code2Manually: put the files in place
~/.claude/skills/rspress-docs-generator/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/rspress-docs-generator/
1Skills CLI (Vercel)
npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a codex2Manually: put the files in place
.agents/skills/rspress-docs-generator/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a cursor2Manually: put the files in place
.cursor/skills/rspress-docs-generator/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install rstackjs/agent-skills rspress-docs-generator2Manually: put the files in place
.github/skills/rspress-docs-generator/SKILL.md1Skills CLI (Vercel)
npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a gemini-cli2Platform CLI
gemini skills install https://github.com/rstackjs/agent-skills --path skills/rspress-docs-generatorManually: put the files in place
.devin/skills/rspress-docs-generator/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add rstackjs/agent-skills --skill rspress-docs-generator -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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