- Home
- Skills
- Agents & Orchestration
- Rust Safety Rules
Rust Safety Rules
Enforce memory safety, FFI soundness, and panic-free library patterns in Rust codebases.
$6.99
Works with the AI Agents you already use
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
- sensor.rs — Unsafe rule 1. Missing SAFETY comment.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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