rspack-debugging
Skill95 starsChanged 4 months agoMITView on GitHub
Debug native Rspack crashes, segmentation faults, deadlocks, or stuck builds with LLDB and matching debug symbols.
- Installs packages
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- create-draft-release-notesSkill
- mdx-to-markdownSkill
- pr-creatorSkill
- release-blog-writerSkill
- rstack-docs-writerSkill
- rstack-eco-ci-debugSkill
- rstack-repo-maintainSkill
- rstack-skill-evaluatorSkill
- migrate-to-rsbuildSkill
- migrate-to-rslibSkill
- migrate-to-rslintSkill
- migrate-to-rstestSkill
- rsbuild-best-practicesSkill
- rsbuild-v2-upgradeSkill
- rsdoctor-analysisSkill
- rslib-best-practicesSkill
- rslib-modern-packageSkill
- rspack-best-practicesSkill
- rspack-split-chunksSkill
- rspack-tracingSkill
- rspack-v2-upgradeSkill
- rspress-best-practicesSkill
- rspress-custom-themeSkill
- rspress-description-generatorSkill
- rspress-docs-generatorSkill
- rspress-v2-upgradeSkill
- rstest-best-practicesSkill
- rstest-debuggingSkill
- storybook-rsbuildSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before starting, please ensure your environment meets the requirements.
- Distinctive: line 77
When you successfully obtain a backtrace or a tracing log, you MUST save it to a local file in the user's project directory so it is …
- Very specific: line 79
Create Directory: Ensure a directory named debug_artifacts exists in the project root.
- Very specific: line 80
Save Backtraces: Write the full output of thread backtrace all to debug_artifacts/backtrace_<timestamp>.txt.
- Very specific: line 85
After debugging is complete, restore your package.json to use production packages:
- Very specific: line 92
Use the same resolved <skill-root> as in Preparation.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rspack debugging
Overview
This Skill guides you on how to capture the underlying crash state of Rspack (which is based on Rust). By using the LLDB debugger and Rspack packages with debug symbols, we can obtain detailed stack backtraces, which are crucial for pinpointing issues. The guides focus on non-interactive, automated debugging to easily capture backtraces.
Preparation
Before starting, please ensure your environment meets the requirements.
- Install LLDB: You must install the LLDB debugger.
- macOS: Run
xcode-select --install - Linux: Install the
lldbpackage (e.g.,apt-get install lldb) - Detailed guide: references/lldb.md
- macOS: Run
Replace Debug Packages: Production packages like
@rspack/corehave debug symbols stripped. They must be replaced with the@rspack-debug/*series packages to see useful stack information.Automatic Replacement Script:
Resolve the bundled
scripts/setup_debug_deps.cjsrelative to the Skill root while keeping the working directory in the user's project, then run:node "<skill-root>/scripts/setup_debug_deps.cjs"Running the above script will automatically add
pnpm.overridesconfiguration topackage.json, pointing Rspack packages to their corresponding Debug versions. Afterwards, please be sure to runpnpm installto update dependencies.
Debugging workflows
Identify your specific scenario and follow the corresponding linked guide.
Detailed guides
Detailed guides
Guide A: crash during HMR
Scenario: Stable Crash/Deadlock during DevServer HMR. Read Guide: references/guide_a_hmr_crash.md
Guide B: crash during build
Scenario: Stable Crash/Deadlock during Build (or Unstable Build Crash that is frequent enough). Read Guide: references/guide_b_build_crash.md
Guide C: attach to stuck process
Scenario: Unstable Deadlock during Build (happens randomly). Read Guide: references/guide_c_attach_to_stuck_process.md
Guide D: coredump analysis (Dev)
Scenario: Unstable Crash during DevServer HMR (hard to catch interactively). Read Guide: references/guide_d_coredump_analysis_dev.md
Guide E: coredump analysis (Build)
Scenario: Unstable Crash during Build. Read Guide: references/guide_e_coredump_analysis_build.md
Guide F: async deadlock identification
Scenario: Unstable Async Deadlock. Main thread stuck in uv_run.
Read Guide: references/guide_f_async_deadlock.md
Saving debug artifacts
Critical Instruction for Agents: When you successfully obtain a backtrace or a tracing log, you MUST save it to a local file in the user's project directory so it is preserved after the session.
- Create Directory: Ensure a directory named
debug_artifactsexists in the project root. - Save Backtraces: Write the full output of
thread backtrace alltodebug_artifacts/backtrace_<timestamp>.txt. - Save Tracing Logs: (Only if using Tracing Skill)
Environment restoration
After debugging is complete, restore your package.json to use production packages:
node "<skill-root>/scripts/setup_debug_deps.cjs" --restore
pnpm installUse the same resolved <skill-root> as in Preparation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

