unsafe-checker

Identify unsafe Rust code patterns and enforce safety invariants.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mberetvas/dbt-migrator --skill unsafe-checker-mberetvas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unsafe-checker
Source: https://github.com/mberetvas/dbt-migrator/tree/main/.github/skills/unsafe-checker
Command: npx skills add https://github.com/mberetvas/dbt-migrator --skill unsafe-checker-mberetvas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Unsafe Rust Checker enforces safety discipline around unsafe code blocks, ensuring reviewers and authors document SAFETY invariants, verify FFI boundaries, and avoid common pitfalls.

Core Features & Use Cases

  • SAFETY comment enforcement: requires explicit SAFETY: notes for every unsafe block.
  • Invariant verification: checks documented invariants and safety contracts across unsafe APIs.
  • FFI and memory-safety guidance: analyzes raw pointers, unions, and memory layout concerns for safe interop.
  • Reviewer guidance: provides actionable feedback and recommended fixes during code reviews.

Quick Start

Run a safety review pass on a Rust project to ensure every unsafe block has a SAFETY comment and documented invariants.

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 blocks during code review?

To enforce SAFETY comments for unsafe Rust blocks during code review, the checker identifies every unsafe block and verifies that explicit SAFETY: notes documenting invariants are present, flagging violations and suggesting fixes.

What is the best way to verify invariants across unsafe Rust APIs and FFI boundaries?

The best way to verify invariants across unsafe Rust APIs and FFI boundaries is to analyze raw pointers, unions, and memory layout concerns, ensuring documented safety contracts are validated and safe interop is maintained.

Can I use static analysis to check memory safety in Rust codebases at scale?

Yes, you can use static analysis to check memory safety in Rust codebases at scale by running safety review passes that verify data-flow validations and safety invariants across teams during audits and inline checks.

Does the review process provide actionable fixes for FFI and memory-safety violations?

Yes, the review process provides actionable fixes for FFI and memory-safety violations by analyzing raw pointers and unions, offering reviewer guidance and recommended fixes to correct documented invariant discrepancies.

When do I need to document safety contracts for unions and raw pointers in Rust?

You need to document safety contracts for unions and raw pointers in Rust whenever unsafe blocks or FFI boundaries are present, ensuring memory layout concerns and safety invariants are explicitly verified to avoid common pitfalls.