skills/rspack-tracing/SKILL.md
Comprehensive guide and toolkit for diagnosing Rspack build issues. Quickly identify where crashes/errors occur, or perform detailed performance profiling to resolve bottlenecks. Use when the user encounters build failures, slow builds, or wants to optimize Rspack performance.
npx skillsauth add rstackjs/agent-skills rspack-tracingInstall 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.
Use this skill when you need to:
First, ask the user to run their build with tracing enabled.
# Set environment variables for logging to a file
RSPACK_PROFILE=TRACE RSPACK_TRACE_LAYER=logger RSPACK_TRACE_OUTPUT=./trace.json pnpm build
This will generate a trace file in a timestamped directory like .rspack-profile-{timestamp}-{pid}/trace.json.
See references/tracing-guide.md for more details on configuration.
If the user wants to identify which stage a crash or error occurred in, use tail to quickly view the last events without running the full analysis:
# Navigate to the generated profile directory
cd .rspack-profile-*/
# View the last 20 events to see where the build failed
tail -n 20 trace.json
The last events will show the span names and targets where the build stopped, helping to quickly pinpoint the problematic stage, plugin, or loader.
For detailed performance profiling (not just crash diagnosis), ask the user to run the bundled analysis script on the generated trace file.
# Navigate to the generated profile directory
cd .rspack-profile-*/
# Run the analysis script
node ${CLAUDE_PLUGIN_ROOT}/skills/tracing/scripts/analyze_trace.js trace.json
Use the output from the script to identify bottlenecks. Consult references/bottlenecks.md to map span names to actionable fixes.
Based on the "Top Slowest Hooks" from the analysis script:
hook:CompilationOptimizeChunks).rspack.config.js or rsbuild.config.ts.RSPACK_PROFILE.development
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.