Review unsafe Rust code and FFI boundaries for soundness, SAFETY documentation, and safer alternatives.

skills.sh installs
3.6K
GitHub stars
1.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers when unsafe is justified: FFI calls, low-level abstractions, and measured performance bottlenecks
  • Includes a quick reference of safety requirements for *ptr deref, transmute, extern "C", static mut, and impl Send/Sync
  • Enforces // SAFETY: comments on unsafe blocks and /// # Safety sections on unsafe functions
  • Maps deprecated patterns to replacements such as MaybeUninit<T>, NonNull<T>, and bindgen or cbindgen for FFI bindings

Install

$ npx -y skills add actionbook/rust-skills --skill unsafe-checker -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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 CaseExample
FFICalling C functions
Low-level abstractionsImplementing Vec, Arc
PerformanceMeasured 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

OperationSafety Requirements
*ptr derefValid, aligned, initialized
&*ptr+ No aliasing violations
transmuteSame size, valid bit pattern
extern "C"Correct signature, ABI
static mutSynchronization guaranteed
impl Send/SyncActually thread-safe

Common Errors

Details

Repository
github.com/actionbook/rust-skills
Categories
Rust, Security
First seen
May 16, 2026

More from actionbook/rust-skills

All 38

Similar to Unsafe Checker

More Rust