fangdididi

Panic Map — Development skill for Claude Code

Development community

Agent skill: find every place your Rust code can panic, judge which ones untrusted input can reach, fix them with typed errors, prove it with hostile-input tests, and block new panic sites in CI.

How to install Panic Map

This entry records only its repository, not the path inside it, so there is no exact command to give. Open fangdididi/panic-map and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Panic Map does

Agent skill: find every place your Rust code can panic, judge which ones untrusted input can reach, fix them with typed errors, prove it with hostile-input tests, and block new panic sites in CI. EN + 中文

Alternatives in Development

  • Battle — Head-to-head graded battle card between two sites — eight dimensions, bar-by-bar, verdict line 3.6k ★
  • Check A11y — Report WCAG contrast for the theme and the minimal fix to reach AA 452 ★
  • Claude Elementor Kit — Build WordPress sites with Claude Code via the Elementor MCP — a kit with skill, setup wizard, and cross-platf 84 ★

README

panic-map

[English](README.md) | [简体中文](README.zh-CN.md)

**An agent skill that finds every place your Rust code can crash, decides which ones outside input can actually reach, fixes those, and stops new ones from sneaking back in.**

Rust is memory safe, but it is not crash safe. `.unwrap()`, `.expect()`, `v[i]`, `&s[a..b]`, `x / n`, `RefCell::borrow_mut()` and `mutex.lock().unwrap()` all panic when their assumption is wrong. AI agents write a lot of these, and "just remove the unwraps" usually swaps a loud crash for a quiet wrong answer. panic-map gives your agent (Claude Code, Codex, Cursor and others) a disciplined way to do it properly:

  1. Map every panic site with a bundled scanner that ignores comments, strings and test code.
  2. Judge each one: REACHABLE from untrusted input, a stated INVARIANT, STARTUP-only, ACCEPTED, or UNKNOWN until probed.
  3. Fix the reachable ones with typed errors and total operations (get, split_once, checked_*, NonZero*, let else).
  4. Prove it with hostile-input tables, property tests or fuzzing whose only assertion is "never panics".
  5. Hold the line with a CI baseline that rejects new unexplained panic sites and a three-stage clippy lint ratchet.

Features

  • Nine site kinds: UNWRAP, EXPECT, MACRO (panic!/todo!/unimplemented!/unreachable!), ASSERT (release-time asserts), INDEX, SLICE (including UTF-8 char boundaries), DIV, BORROW (RefCell), LOCK (poisoned mutexes).
  • Honest scanner: a Rust-aware lexer that blanks comments (including nested /* */), strings, raw strings and char literals, keeps line numbers, skips #[cfg(test)] / #[test] items and target/, tests/, benches/. It also says plainly what it cannot see, with a manual checklist for those cases.
  • Reach-first judging: every row needs a one-line path from an input, and a weak reason ("should never happen") counts as UNKNOWN.
  • In-code markers: // panic-map: invariant|startup|accepted puts the