This drops into your Rust workflow whenever you touch unsafe blocks, raw pointers, or FFI boundaries. It surfaces a quick reference for common soundness issues like null pointer derefs, use after free, and alignment violations, plus reminds you about required SAFETY comments and proper patterns like MaybeUninit over the deprecated mem::uninitialized. The tables are genuinely useful if you're maintaining bindings or implementing low-level abstractions and need to quickly verify you're meeting the safety contract. Works best when you already understand why you need unsafe but want a second pair of eyes on whether your invariants actually hold. Won't replace Miri or careful review, but catches the documentation and obvious footguns.

skills.sh installs
726
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill unsafe-checker --agent claude-code

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/zhanghandong/rust-skills
Category
Rust

More from zhanghandong/rust-skills

All 34

Recommended

More Rust
1trailofbits avatarcargo-fuzztrailofbits/skillscargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo. Use for fuzzing Rust code with libFuzzer backend.5.7Kskills.sh installs
2trailofbits avatarrust-reviewtrailofbits/skillsPerforms comprehensive Rust security review for safe/unsafe boundary issues, memory safety in unsafe blocks, concurrency hazards, panic-induced DoS, FFI safety,2.4Kskills.sh installs
3mohitmishra786 avatarrust-ffimohitmishra786/low-level-dev-skillsRust FFI skill for C interoperability. Use when calling C libraries from Rust, generating Rust bindings with bindgen, exporting Rust functions to C with cbindge613skills.sh installs
4mohitmishra786 avatarcargo-workflowsmohitmishra786/low-level-dev-skillsCargo workflow skill for Rust projects. Use when managing workspaces, feature flags, build scripts, cargo cache, incremental builds, dependency auditing, or CI 608skills.sh installs
5personamanagmentlayer avatarrust-expertpersonamanagmentlayer/pclExpert-level Rust development with ownership, lifetimes, async, error handling, and production-grade patterns177skills.sh installs
6apollographql avatarrust-best-practicesapollographql/skillsGuide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) review22.7Kskills.sh installs