skills/rsbuild-best-practices/SKILL.md
Rsbuild best practices for config, CLI workflow, type checking, bundle optimization, assets, and debugging. Use when writing, reviewing, or troubleshooting Rsbuild projects.
npx skillsauth add rstackjs/agent-skills rsbuild-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 Rsbuild projects.
rsbuild.config.ts and defineConfigtools.rspack or tools.bundlerChain only when no first-class Rsbuild option existssource.entry values for multi-page applicationstsconfig.json path aliases firstrsbuild for local developmentrsbuild build for production buildrsbuild preview only for local production previewrsbuild inspect to inspect final Rsbuild/Rspack configs@rsbuild/plugin-type-check for integrated dev/build type checkstsc --noEmit/vue-tsc --noEmit as an explicit script stepimport() for non-critical code pathspublicpublic files by absolute URL path.map files to public servers/CDNs when production source maps are enabledDEBUG=rsbuild when diagnosing config resolution or plugin behaviordist/.rsbuild to confirm final config, not assumed config--cpu-prof) when JavaScript-side overhead is suspectedRSPACK_PROFILE=OVERVIEW and analyze trace output for compiler-phase bottlenecksdevelopment
Customize Rspress themes using CSS variables, Layout slots, component wrapping, or component ejection. Use when a user wants to change the look and feel of an Rspress site, override theme components, add custom navigation/sidebar/footer content, inject global providers, or modify the default Rspress theme in any way. Also use when a user mentions theme/index.tsx, Layout slots, BEM class overrides, or rspress eject.
development
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.