Rust Safety Rules

    1

    Enforce memory safety, FFI soundness, and panic-free library patterns in Rust codebases.

    $6.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Rust Safety Rules

    Example session with this skill installed

    Review this FFI wrapper. I added an unsafe Send impl to move the raw pointer between threads and a bytes method to get a slice. It occasionally crashes.

    • Read your context and instructions
    • Compiled the rust safety rules

    Safety scope

    FFI wrapper for raw pointers.

    Findings

    1. sensor.rs — Unsafe rule 1. Missing SAFETY comment.
    2. sensor.rs — Send rule 2. Unsafe impl Send has no written proof.

    Patch

    // [Patched code with NonNull and SAFETY comments]

    Audit notes

    • Run cargo +nightly miri test.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    The Rust compiler handles most safety checks, but it cannot verify the invariants inside unsafe blocks, the soundness of FFI wrappers, or hand-written Send and Sync implementations. These blind spots often lead to rare, hard-to-debug segfaults and undefined behavior in production.

    What it does

    • Enforces mandatory SAFETY comments for every unsafe block that explain the invariant being relied upon.
    • Audits ownership patterns to identify when borrow checker struggles indicate a design flaw rather than a syntax error.
    • Flags prohibited panics, unwraps, and expects in library code to prevent process crashes for callers.
    • Verifies that unsafe functions include proper safety sections in doc comments for downstream callers.
    • Reviews hand-written thread-safety claims (Send/Sync) and demands written proof of synchronization.

    Frameworks & tools

    Rust (2021 and 2024 editions), Cargo, thiserror, anyhow, and cargo-deny.

    Why this beats prompting it yourself

    Generic LLMs often suggest fixes that simply silence the compiler without addressing underlying soundness issues. This skill follows a strict "Trigger Matrix" to catch subtle signals like mutex guards crossing await points or missing raw pointer invariants that standard prompting misses.

    Use cases

    • Reviewing FFI wrappers to ensure C pointers are handled safely before dereferencing.
    • Refactoring library code to replace panics with robust error handling using thiserror.
    • Auditing thread-safety implementations in systems-level concurrency primitives.
    • Cleaning up "reflexive cloning" and improper interior mutability patterns.

    Known limitations

    It cannot run cargo commands, Miri, or tests. It only reviews and edits code within the editor based on static analysis of the provided text.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Cannot run cargo build, test, Miri, or cargo deny. Does not check live vulnerability databases or perform actual supply chain auditing. Restricted to editor-based code review and patching.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 3 months ago

    Permissions

    Network Access
    Listed3 months ago

    What's inside

    Frequently Asked Questions

    This skill acts as an expert-level auditor for 'unsafe' blocks, FFI boundaries, and thread-safety implementations where the standard Rust compiler cannot reach. It focuses on eliminating undefined behavior and preventing library panics that lead to production crashes.

    The skill is compatible with any AI agent that supports file editing and code review. It is optimized for Rust 2021 and 2024 editions and works alongside standard tools like Cargo and Clippy.

    While the skill provides deep static analysis and identifies architectural flaws, it does not execute code or run external tools like Miri or Cargo Test. It is designed to be used during the authoring and review phases within your code editor.

    The skill enforces a strict 'no-panic' policy for library code, identifying hidden 'unwraps' and 'expects' and suggesting robust, Result-based error handling patterns using thiserror or anyhow.

    You receive the complete AI skill set including the logic for safety comment enforcement, FFI auditing, and thread-safety verification. Buyers also receive free updates to ensure compatibility with future Rust editions and evolving memory safety best practices.

    It requires zero external configuration; simply provide the skill to your AI agent, and it will begin auditing your Rust source files based on its internal trigger matrix for memory safety.

    New in Agents & Orchestration