skills/rspress-best-practices/SKILL.md
Rspress best practices for config, CLI workflow, content organization, frontmatter, MDX, themes, i18n, search, static assets, deployment, and debugging. Use when writing, reviewing, or troubleshooting Rspress documentation sites.
npx skillsauth add rstackjs/agent-skills rspress-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Apply these rules when writing or reviewing Rspress (v2) sites.
rspress.config.ts and defineConfig from @rspress/coreroot explicitly when docs are not under the default docs/ directorytitle, description, icon, logo, base, and lang in config instead of repeating them in page filestheme/ directory and import original theme pieces from @rspress/core/theme-originalrspress dev for local developmentrspress build for production outputrspress preview only for local preview of the built siterspress eject only when CSS variables, class overrides, or layout wrapping cannot solve the customization_meta.json or _nav.json to control sidebar and navigation labels/order instead of encoding order in filenamestitle and description frontmatter, and set sidebar, outline, navbar, or footer only when page defaults are not enoughpageType: home, doc, doc-wide, custom, or blank intentionally based on layout needsglobalUIComponents or theme overrides instead of repeating imports in each pageLayout slots before ejecting built-in componentstheme/ files, keep export * from '@rspress/core/theme-original' unless intentionally replacing a named exportllms or ssgMd only when the site benefits from machine-readable outputs, and keep descriptions accurate because those outputs surface page summariespublic/ only for assets that must keep stable URL paths, such as favicons, social images, or download filesbase is set@rspress/plugin-preview and @rspress/plugin-api-docgen when interactive demos or API tables are neededrspress dev and rspress build; a page that works in dev can still fail during static generationbase handling before deploymentdevelopment
Debug Rstest issues systematically, including performance regressions. First determine whether the slowdown is in build startup or test execution, then run controlled config or code experiments and compare before/after timings.
development
Opinionated Rslib recommendations for modern JS/TS npm package design covering pure ESM, strict TypeScript, explicit exports, small stable APIs, pragmatic dependencies, accurate sideEffects, correct declarations, package validation, provenance, README.md, and AGENTS.md. Use when the user wants to make a JS/TS package more modern, check whether the current package setup is healthy, review package.json/exports/types/dependencies/docs/release readiness, or apply a modern library baseline.
development
Create or update draft GitHub releases for the current project's main GitHub repository, then organize GitHub-generated release notes into user-friendly sections without rewriting release note items. Use for preparing, formatting, categorizing, creating, or updating GitHub release notes or draft releases, including optional highlights when the user asks for them.
tools
Migrate ESLint or other linters to Rslint. Use when asked to replace ESLint flat config, lint scripts, VS Code ESLint settings, inline directives, rules, presets, plugins, or lint dependencies with Rslint equivalents.