debug-rust-panic

A checklist for finding the cause of Rust panics and failed Cargo tests. Cargo is Rust's build and test tool, while a panic is an unexpected runtime failure.

In plain words
What is it for?
Use it to reproduce one failing test, inspect its output, classify the panic, and check Rust, virtual file-system, or Android integration code.
Why use it?
It turns a broad test failure into a narrow investigation, including poisoned locks, blocked file-system permissions, and failures that occur only through Android's Java-to-Rust connection.

Skill for Claude CodeCodexCursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mannansaood/termi/debug-rust-panic
Any agent
npx skills add MannanSaood/termi --skill debug-rust-panic
Clone the repo
git clone --depth 1 https://github.com/MannanSaood/termi

Made for: Claude Code, Codex, Cursor.

Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00051 $0.00831
Opus 5 $0.00026 $0.00415
Sonnet 5 $0.00010 $0.00166
Haiku 4.5 $0.00005 $0.00083

Measured 2d ago against content hash 7d539c8b8678, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-rust-panic scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/debug-rust-panic/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Use this checklist whenever a cargo test run fails, a panic message shows up in logs, or behavior doesn't match what a test expects.

1. Reproduce narrowly

cd rust
cargo test <failing_test_name> -- --nocapture

--nocapture shows println!/log output even for passing tests, which often reveals the actual sequence of events leading to a failure that the assertion message alone doesn't show.

2. Classify the failure

  • Panic with a .unwrap()/.expect() in the message: this should have been caught by clippy::unwrap_used before it ever ran. Two possibilities:
    • It's in a #[cfg(test)] mod tests block — expected, not a bug, unless the test itself is wrong.
    • It's in production code — this is a regression in lint coverage. Check whether the file has #![warn(clippy::unwrap_used)] inherited from lib.rs (it should, crate-wide) and whether clippy was actually run before this code was merged (cargo clippy --all-targets -- -D warnings -D clippy::unwrap_used -D clippy::expect_used).
  • Poisoned mutex panic (PoisonError or "lock" in the message): check whether the code uses .lock().unwrap() instead of utils::sync_ext::LockExt::lock_safe(). If it's a data buffer (not a mutex protecting a real invariant), switch to lock_safe() — see that module's doc comment for when this is/isn't appropriate.
  • VFS operation failed unexpectedly: check whether the code called a FsProvider method directly instead of going through VfsService. If it went through VfsService, check whether the VfsOutcome was Blocked (capability check failed — expected for chmod/symlink on SAF) vs. an actual bug. Read vfs/capabilities.rs's capability matrix for the relevant FsType before assuming it's a bug.
  • JNI-related failure: this can only be meaningfully debugged on-device or with device logs (adb logcat). Don't try to reproduce JNI crashes with cargo test — the android feature only type-checks on host, it doesn't give you a JVM to actually exercise those code paths.

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 51 tokens per session scan A 7d539c8b8678

Subscribe to this mod's changes

debug-rust-panic is a skill published in the GitHub repository MannanSaood/termi (8 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 831 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

sceneview-web

Build 3D and WebXR (AR/VR) experiences in the browser with SceneView for Web — Filament.js (WebGL2/WASM) wrapped in a Kotlin/JS DSL and a plain-JavaScript API on window.sceneview. Use whenever the user asks for "3D in the browser", "a web model viewer", "WebXR AR/VR", or any browser 3D/AR app where the dependency is…

sceneview/sceneview · 147 tokens

sceneview

Build 3D and AR apps with the SceneView SDK in Jetpack Compose, SwiftUI (iOS/macOS/visionOS via SceneViewSwift), Web (Filament.js), Flutter and React Native. Use whenever the user asks for "3D in Compose", "AR with ARCore in Compose", a model viewer, or any cross-platform 3D/AR app where the dependency is…

sceneview/sceneview · 156 tokens

sceneview-ios

Build 3D and AR apps on Apple platforms (iOS, macOS, visionOS) with SceneViewSwift — the SwiftUI wrapper around RealityKit. Use whenever the user asks for "3D in SwiftUI", "AR with ARKit in SwiftUI", a model viewer for iOS, or any Apple-platform 3D/AR app where the dependency is the SceneViewSwift Swift Package from…

sceneview/sceneview · 148 tokens

to-plan

Use when one ready GitHub issue or an in-chat task needs a repository-aware implementation plan for a later implementation workflow.

chrisbanes/skills · 27 tokens

compose-ui-testing-patterns

Use when writing or reviewing Jetpack Compose UI tests, screenshot tests, previews, semantics assertions, fake image loading, keyboard input, focus assertions, interaction state (hover/pressed/focused), or tests for plain state-driven UI composables.

chrisbanes/skills · 54 tokens

gradle-run

Use when planning to execute Gradle through gradle, ./gradlew, or a custom gradlew wrapper script, or diagnosing a Gradle build, compact workflow ledger, repeated failure fingerprint, check, test, lint, warning, or failure even when no new Gradle run is appropriate.

chrisbanes/skills · 67 tokens