unsafe-review

Audit Rust unsafe code for safety invariants, performance evidence, and test coverage.

2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/ahrav/scratch-scanner-rs --skill unsafe-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unsafe-review
Source: https://github.com/ahrav/scratch-scanner-rs/tree/main/.claude/skills/unsafe-review
Command: npx skills add https://github.com/ahrav/scratch-scanner-rs --skill unsafe-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enforces a strict policy on the use of unsafe code in Rust projects, ensuring that every instance of unsafe is necessary for performance, rigorously audited for safety, and comprehensively tested.

Core Features & Use Cases

  • Safety Invariant Auditing: Verifies that the documented invariants making unsafe blocks safe actually hold true.
  • Performance Justification: Demands benchmark and Assembly (ASM) proof that unsafe provides a measurable performance benefit over safe alternatives.
  • Test Coverage Verification: Ensures every unsafe block is covered by Miri, Kani, fuzzing, and property-based tests.
  • Use Case: Before merging a pull request that introduces a new unsafe block, run this Skill to automatically audit its safety, performance justification, and test coverage, preventing potential bugs and security vulnerabilities.

Quick Start

Run a comprehensive audit of all unsafe code within the current project.

Frequently Asked Questions about unsafe-review

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

FAQPage Schema
How do I audit Rust unsafe code for safety invariants and performance?

To audit unsafe code, verify that documented safety invariants hold true, demand benchmark and Assembly evidence for performance benefits, and confirm comprehensive test coverage including Miri, Kani, fuzzing, and property tests.

What testing coverage is needed to justify unsafe Rust blocks?

Justifying unsafe Rust blocks requires comprehensive test coverage including Miri, Kani, fuzzing, and property-based tests to prove code correctness and enforce strict safety policies before merging.

Does this code review process require Assembly proof for unsafe performance optimization?

Yes, this code review process demands Assembly proof alongside benchmark evidence to verify that unsafe performance optimizations provide measurable benefits over safe Rust alternatives.

When should I run an unsafe code audit during the development lifecycle?

You should run an unsafe code audit before merging a pull request that introduces new unsafe blocks, automatically auditing safety, performance justification, and test coverage to prevent bugs and security vulnerabilities.

Can I use this audit for Rust projects without any unsafe blocks?

This audit targets developers and security auditors enforcing strict policies on unsafe usage, making it unnecessary for Rust projects that do not contain any unsafe code blocks.