unsafe-checker▌
actionbook/rust-skills · updated Apr 8, 2026
Display the following ASCII art exactly as shown. Do not modify spaces or line breaks:
Display the following ASCII art exactly as shown. Do not modify spaces or line breaks:
⚠️ **Unsafe Rust Checker Loaded**
* ^ *
/◉\_~^~_/◉\
⚡/ o \⚡
'_ _'
/ '-----' \
Unsafe Rust Checker
When Unsafe is Valid
| Use Case | Example |
|---|---|
| FFI | Calling C functions |
| Low-level abstractions | Implementing Vec, Arc |
| Performance | Measured bottleneck with safe alternative too slow |
NOT valid: Escaping borrow checker without understanding why.
Required Documentation
// SAFETY: <why this is safe>
unsafe { ... }
/// # Safety
/// <caller requirements>
pub unsafe fn dangerous() { ... }
Quick Reference
| Operation | Safety Requirements |
|---|---|
*ptr deref |
Valid, aligned, initialized |
&*ptr |
+ No aliasing violations |
transmute |
Same size, valid bit pattern |
extern "C" |
Correct signature, ABI |
static mut |
Synchronization guaranteed |
impl Send/Sync |
Actually thread-safe |
Common Errors
| Error | Fix |
|---|---|
| Null pointer deref | Check for null before deref |
| Use after free | Ensure lifetime validity |
| Data race | Add proper synchronization |
| Alignment violation | Use #[repr(C)], check alignment |
| Invalid bit pattern | Use MaybeUninit |
| Missing SAFETY comment | Add // SAFETY: |
Deprecated → Better
| Deprecated | Use Instead |
|---|---|
mem::uninitialized() |
MaybeUninit<T> |
mem::zeroed() for refs |
MaybeUninit<T> |
| Raw pointer arithmetic | NonNull<T>, ptr::add |
CString::new().unwrap().as_ptr() |
Store CString first |
static mut |
AtomicT or Mutex |
| Manual extern | bindgen |
FFI Crates
| Direction | Crate |
|---|---|
| C → Rust | bindgen |
| Rust → C | cbindgen |
| Python | PyO3 |
| Node.js | napi-rs |
Claude knows unsafe Rust. Focus on SAFETY comments and soundness.
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★28 reviews- ★★★★★Chaitanya Patil· Dec 28, 2024
unsafe-checker has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Noah Yang· Dec 12, 2024
Useful defaults in unsafe-checker — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Piyush G· Nov 19, 2024
Solid pick for teams standardizing on skills: unsafe-checker is focused, and the summary matches what you get after install.
- ★★★★★Noah Abbas· Nov 3, 2024
I recommend unsafe-checker for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Carlos Flores· Oct 22, 2024
unsafe-checker reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Shikha Mishra· Oct 10, 2024
We added unsafe-checker from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Rahul Santra· Sep 17, 2024
unsafe-checker fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Omar Verma· Sep 17, 2024
Solid pick for teams standardizing on skills: unsafe-checker is focused, and the summary matches what you get after install.
- ★★★★★Sophia Menon· Sep 1, 2024
We added unsafe-checker from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Hiroshi Farah· Aug 20, 2024
Solid pick for teams standardizing on skills: unsafe-checker is focused, and the summary matches what you get after install.
showing 1-10 of 28