unsafe-checker

Detect unsafe Rust blocks and FFI misuse in .rs files.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/jmduea/emotiv-cortex-rs --skill unsafe-checker-jmduea
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unsafe-checker
Source: https://github.com/jmduea/emotiv-cortex-rs/tree/main/.github/skills/unsafe-checker
Command: npx skills add https://github.com/jmduea/emotiv-cortex-rs --skill unsafe-checker-jmduea

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often struggle to ensure that unsafe Rust blocks, raw pointers, and foreign function interfaces are used correctly, leading to potential memory safety bugs and undefined behavior.

Core Features & Use Cases

  • Safety Checklist: Verifies that every unsafe block includes a clear SAFETY comment and proper documentation.
  • FFI Validation: Checks for correct usage of C-compatible types, CString/CStr handling, and portable type aliases.
  • Pointer Safety: Detects misaligned casts, raw pointer misuse, and lifetime violations across threads.

Quick Start

Run the unsafe-checker on your Rust project to flag unsafe issues.

Frequently Asked Questions about unsafe-checker

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

FAQPage Schema
How do I audit unsafe Rust code in my repository?

To audit unsafe Rust code, you can scan all .rs files in your project to flag unsafe blocks, raw pointers, and external function interfaces for potential memory safety bugs and undefined behavior.

How does FFI validation work for C-compatible types in Rust?

FFI validation checks for correct usage of C-compatible types, CString and CStr handling, and portable type aliases to ensure your foreign function interfaces execute safely and correctly.

Can I automatically detect misaligned casts and raw pointer misuse in Rust?

Yes, you can detect misaligned casts, raw pointer misuse, and lifetime violations across threads by scanning your Rust repository for unsafe blocks and pointer safety issues.

Do I need SAFETY comments for every unsafe block in Rust?

Yes, proper auditing verifies that every unsafe block includes a clear SAFETY comment and proper documentation to prevent memory safety bugs and undefined behavior.

What's the best way to ensure correct pointer alignment in unsafe Rust?

The best way to ensure correct pointer alignment is to scan your codebase for misaligned casts and raw pointer misuse, validating that all unsafe blocks adhere to strict safety checklists.

Why does my Rust FFI code cause undefined behavior?

Rust FFI code causes undefined behavior when C-compatible types are misused, pointer alignment is incorrect, or unsafe blocks lack proper validation and SAFETY comments.