agentleFS
rstackjsrstackjs/agent-skills/skills/rspack-debugging/SKILL.md

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

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
  1. Distinctive:

    Before starting, please ensure your environment meets the requirements.

    line 14
  2. Distinctive:

    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 …

    line 77
  3. Very specific:

    Create Directory: Ensure a directory named debug_artifacts exists in the project root.

    line 79
  4. Very specific:

    Save Backtraces: Write the full output of thread backtrace all to debug_artifacts/backtrace_<timestamp>.txt.

    line 80
  5. Very specific:

    After debugging is complete, restore your package.json to use production packages:

    line 85
  6. Very specific:

    Use the same resolved <skill-root> as in Preparation.

    line 92

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

  1. Install LLDB: You must install the LLDB debugger.
    • macOS: Run xcode-select --install
    • Linux: Install the lldb package (e.g., apt-get install lldb)
    • Detailed guide: references/lldb.md
  2. Replace Debug Packages: Production packages like @rspack/core have 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.cjs relative 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.overrides configuration to package.json, pointing Rspack packages to their corresponding Debug versions. Afterwards, please be sure to run pnpm install to 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.

  1. Create Directory: Ensure a directory named debug_artifacts exists in the project root.
  2. Save Backtraces: Write the full output of thread backtrace all to debug_artifacts/backtrace_<timestamp>.txt.
  3. 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 install

Use the same resolved <skill-root> as in Preparation.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.