Rust Debug
Rule
Reproduce first, identify root cause, then make the smallest targeted fix. Prefer compiler
diagnostics, tests, backtraces, and tracing evidence over broad rewrites.
Hard Stops
Stop before:
- Touching live systems, real secrets, production data, or destructive operations.
- Adding
unsafe, changing public APIs, or weakening error contracts solely to silence an
error.
- Suppressing panics, Clippy findings, or test flakes without understanding root cause.
- Fixing async hangs with sleeps or unbounded timeouts.
Workflow
- Capture failing command, panic, compiler diagnostic, backtrace, log, race/deadlock symptom,
or hang.
- Reproduce with the narrowest
cargo test, cargo check, or executable command.
- Isolate root cause using
RUST_BACKTRACE=1, targeted tests, Clippy, dbg!/temporary
tracing, Miri for unsafe/suspicious UB, sanitizers when configured, or tokio-console for
async runtime issues.
- Add a regression test when practical.
- Apply a targeted fix and remove temporary diagnostics.
- Run the original failing command, targeted tests, full tests, Clippy, and
just check.
Completion
Report reproduction, root cause, fix, regression tests, commands, and remaining risks.
Source: nyquistwilder/personal-pi — distributed by TomeVault.
1---2name: rust-debug3description: Rust debugging workflow for reproducing failures, panics, compiler diagnostics, trait/borrow errors, flaky tests, async hangs, deadlocks, and targeted fixes with regression tests. Use when this capability is needed.4---56# Rust Debug78## Rule910Reproduce first, identify root cause, then make the smallest targeted fix. Prefer compiler11diagnostics, tests, backtraces, and tracing evidence over broad rewrites.1213## Hard Stops1415Stop before:1617- Touching live systems, real secrets, production data, or destructive operations.18- Adding `unsafe`, changing public APIs, or weakening error contracts solely to silence an19 error.20- Suppressing panics, Clippy findings, or test flakes without understanding root cause.21- Fixing async hangs with sleeps or unbounded timeouts.2223## Workflow24251. Capture failing command, panic, compiler diagnostic, backtrace, log, race/deadlock symptom,26 or hang.272. Reproduce with the narrowest `cargo test`, `cargo check`, or executable command.283. Isolate root cause using `RUST_BACKTRACE=1`, targeted tests, Clippy, `dbg!`/temporary29 tracing, Miri for unsafe/suspicious UB, sanitizers when configured, or `tokio-console` for30 async runtime issues.314. Add a regression test when practical.325. Apply a targeted fix and remove temporary diagnostics.336. Run the original failing command, targeted tests, full tests, Clippy, and `just check`.3435## Completion3637Report reproduction, root cause, fix, regression tests, commands, and remaining risks.3839---40> Source: [nyquistwilder/personal-pi](https://github.com/nyquistwilder/personal-pi) — distributed by [TomeVault](https://tomevault.io).41<!-- tomevault:4.0:skill_md:2026-06-16 -->