U

unsafe-checker

by @zhanghandongv
4.2(21)

CRITICAL: unsafe RustコードレビューおよびFFIに使用します。トリガーは、unsafe、raw pointer、FFI、extern、transmute、*mut、*const、union、#[repr(C)]、libc、std::ffi、MaybeUninit、NonNull、SAFETY comment、soundness、undefined behavior、UB、safe wrapper、memory layout、bindgen、cbindgen、CString、CStr、安全な抽象化。

ruststatic-analysiscode-qualitymemory-safetycompiler-warningsGitHub
インストール方法
npx skills add zhanghandong/rust-skills --skill unsafe-checker
compare_arrows

Before / After 効果比較

1
使用前

RustプロジェクトでunsafeコードブロックやFFIを扱う際、メモリ安全性の脆弱性を導入しやすいです。手動でのレビューは時間がかかり、重要な問題を見落としやすく、潜在的なリスクが存在します。

使用後

Rustのunsafeコードを自動的に検出しレビューし、潜在的なメモリ安全性の問題とFFIのリスクを特定します。コードの安全性を大幅に向上させ、システムの安定性と信頼性を確保し、重大な脆弱性を回避します。

SKILL.md

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

ErrorFix
Null pointer derefCheck for null before deref
Use after freeEnsure lifetime validity
Data raceAdd proper synchronization
Alignment violationUse #[repr(C)], check alignment
Invalid bit patternUse MaybeUninit
Missing SAFETY commentAdd // SAFETY:

Deprecated → Better

DeprecatedUse Instead
mem::uninitialized()MaybeUninit<T>
mem::zeroed() for refsMaybeUninit<T>
Raw pointer arithmeticNonNull<T>, ptr::add
CString::new().unwrap().as_ptr()Store CString first
static mutAtomicT or Mutex
Manual externbindgen

FFI Crates

DirectionCrate
C → Rustbindgen
Rust → Ccbindgen
PythonPyO3
Node.jsnapi-rs

Claude knows unsafe Rust. Focus on SAFETY comments and soundness.

ユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数650
評価4.2 / 5.0
バージョン
更新日2026年5月23日
比較事例1 件

ユーザー評価

4.2(21)
5
14%
4
48%
3
33%
2
5%
1
0%

この Skill を評価

0.0

対応プラットフォーム

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

タイムライン

作成2026年3月16日
最終更新2026年5月23日