unsafe-checker

Identify unsafe Rust patterns and enforce SAFETY comments during code reviews.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/gregoryraymond/claude-agents-and-skills --skill unsafe-checker-gregoryraymond
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unsafe-checker
Source: https://github.com/gregoryraymond/claude-agents-and-skills/tree/main/skills/unsafe-checker
Command: npx skills add https://github.com/gregoryraymond/claude-agents-and-skills --skill unsafe-checker-gregoryraymond

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Unsafe Rust Checker helps developers enforce safety discipline around unsafe Rust code by ensuring comprehensive SAFETY comments, small unsafe scopes, and strong review guidance for low-level constructs and FFI usage.

Core Features & Use Cases

  • SAFETY comments at every unsafe block to document invariants
  • Guidance on tiny unsafe scopes, correct Send/Sync impls, and FFI boundaries
  • Review patterns and checklists for transmute, static mut, and pointers

Quick Start

Run the Unsafe Rust Checker on a Rust project to identify unsafe patterns and generate concrete safety guidance.

Frequently Asked Questions about unsafe-checker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce SAFETY comments for unsafe Rust code during code reviews?

Unsafe Rust code reviews identify missing SAFETY comments by checking unsafe blocks for documented invariants like non-null pointers and proper memory ownership. The checker surfaces undocumented risks and provides concrete safety guidance for FFI boundaries.

What is the best way to review FFI boundaries and pointer dereferences in Rust?

Reviewing FFI boundaries and pointer dereferences in Rust requires validating memory ownership and non-null guarantees. A safety-analysis checker automates this by identifying risky low-level abstraction patterns and enforcing strict review checklists.

How do I validate Send and Sync implementations for unsafe Rust abstractions?

Validating Send and Sync implementations for unsafe Rust abstractions involves checking type invariants and memory safety guarantees. A safety-analysis checker reviews these implementations to ensure correct thread-safety properties are maintained across low-level constructs.

Can I check for risky transmute and static mut patterns in Rust projects?

Checking for risky transmute and static mut patterns in Rust projects is possible by applying a safety-analysis checker. It identifies these dangerous constructs during code reviews and enforces the addition of SAFETY comments documenting invariants.

Why should unsafe scopes be kept small in Rust, and how do I check them?

Unsafe scopes in Rust should be kept small to minimize the surface area for memory safety violations. A safety-analysis checker reviews code to ensure unsafe blocks are tightly scoped and properly documented with SAFETY comments explaining invariants.