agentsclimarketplace

Debugging

Skill gurinderu/craft/skills/debugging

Rust debugging toolbox — reproducing, localizing, and explaining a bug (minimal repro, git bisect / cargo bisect-rustc, dbg!/tracing/RUST_BACKTRACE, Miri/loom for heisenbugs, rust-gdb/rr). Use for any Rust bug, panic, test failure, crash, or flaky behavior. Triggers: bisect, cargo bisect-rustc, heisenbug, RUST_BACKTRACE, loom, rr, why is this failing.From its SKILL.md

Install
npx -y skills add gurinderu/craft --skill debugging

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.2 KB, as published. Nobody here has run it

Debugging (Rust)

The Rust-specific toolbox for reproducing, localizing, and explaining a Rust bug. Full detail in techniques.md.

Read the error first

The single highest-yield habit: read the whole error message and stack trace before doing anything. Rust's errors (and RUST_BACKTRACE=1 / =full) are unusually precise — they usually name the file, line, and often the cause. Don't pattern-match the first word and jump.

The 3-strike rule: stop fixing, question the design

If the same error survives three honest attempts, the bug is one level up from where you're patching. Count the strikes — it's what stops you thrashing at attempt seven.

StrikeWhat it suggestsMove
1maybe a slipapply the obvious local fix
2maybe the wrong methodtry a different approach, same layer
3the approach itself is wrongescalate — question the design, not the line

Escalating means handing the problem to the skill that owns that design decision:

  • E0382/E0597 still failing after clone/borrow churn → the ownership model is wrong → rust-ownership
  • a Result/unwrap you keep re-shaping → the error strategy is wrong → rust-errors
  • "cannot be sent between threads" you keep bound-chasing → the concurrency design → rust-concurrency
  • a panic that should have been unreachable → the type should forbid the state → rust-traits

Rust toolbox (→ techniques.md)

  • Shrink the repro — delta-debug the input; a failing proptest/quickcheck hands you a minimal counterexample (→ rust-testing).
  • Bisect — git bisect run <cmd> for the offending commit; cargo bisect-rustc for a toolchain regression.
  • Instrument — escalate dbg! → eprintln! → tracing::debug!(?x) → assert!; RUST_BACKTRACE=1 for the panic path. Remove dbg!/eprintln! before committing; keep tracing (→ rust-cloud-native).
  • Heisenbugs — non-determinism is shared state / ordering / timing: run under Miri (data races — the rust-miri agent) or loom; cargo nextest's process isolation surfaces test-order leaks; inject the clock with tokio::time::pause (→ rust-concurrency).
  • Heavy tools — rust-gdb/rust-lldb, and rr for deterministic record/replay of rare failures.

Boundaries

  • Full technique detail → techniques.md.
  • Confirming the fix — the Rust "what proves what" commands → rust-review.
  • A panic-where-a-Result-belonged / error-design issue → rust-errors.
  • Intermittent / ordering / data-race bugs → rust-concurrency (and Miri via the rust-miri agent).
  • "Slow", not "wrong" → rust-performance (profile, don't guess).
  • Symptom-patching (e.g. unwrap_or_default() to hide a None) is a finding in → rust-review.

Keep looking

Skills are one crate of 626,474. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.