Agent skill

Rust Ffi Safe Wrappers

by hashgraph-online in hashgraph-online/awesome-codex-plugins

Design and review Rust FFI boundaries that keep raw declarations isolated behind safe ownership, lifetime, error, and cleanup wrappers.

MITAuto-check passedDevelopment

Install Rust Ffi Safe Wrappers

skills CLI
$ npx skills add hashgraph-online/awesome-codex-plugins --skill rust-ffi-safe-wrappers -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashgraph-online/awesome-codex-plugins rust-ffi-safe-wrappers --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashgraph-online/awesome-codex-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/LVTD-LLC/skills/skills/rust-ffi-safe-wrappers .claude/skills/rust-ffi-safe-wrappers && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rust-ffi-safe-wrappers
GitHub stars
1.3k
Token cost
~945 tokens
SKILL.md length
390 words
Files
3 (incl. references)
Skills in repo
714
Repo updated
First seen
Licence
MIT

At a glance

Design and review Rust FFI boundaries that keep raw declarations isolated behind safe ownership, lifetime, error, and cleanup wrappers.

  • Works in 7 steps: Separate raw declarations from safe… → Verify ABI, type layout, calling… → Use unsafe extern "C" blocks for modern… → …
  • Reviewing unsafe extern blocks
  • SKILL.md covers Core Workflow, Wrapper Rules, Rust 2024 Syntax Checks and Review Checklist
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Rust Ffi Safe Wrappers is an agent skill from hashgraph-online/awesome-codex-plugins. Design and review Rust FFI boundaries that keep raw declarations isolated behind safe ownership, lifetime, error, and cleanup wrappers. Use when writing, refactoring, or reviewing unsafe extern blocks, C ABI wrappers, repr(C) types, CString, CStr, raw handles, Drop cleanup, bindgen, cbindgen, or panic-safe foreign boundaries.

Its SKILL.md is about 950 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/ffi-boundary-patterns.md`). Compatibility notes: Codex, Claude Code, and other Agent Skills-compatible clients.

It sits in Development, covering Refactoring. It works with Rust. The repository describes itself as: A curated list of awesome OpenAI Codex / ChatGPT plugins, skills, and resources. The 1 Codex Marketplace. See live plugins at: https://hol.org/plugins/best-codex-plugins. The licence is MIT.

When your agent uses it

  • Reviewing unsafe extern blocks
  • Panic-safe foreign boundaries

Example prompts

  • “/rust-ffi-safe-wrappers”

Requirements

  • Compatibility (from SKILL.md): Codex, Claude Code, and other Agent Skills-compatible clients.

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Separate raw declarations from safe wrappers. Put raw unsafe extern
  2. Verify ABI, type layout, calling convention, ownership, nullability,
  3. Use unsafe extern "C" blocks for modern Rust, especially Rust 2024 edition
  4. Use #[repr(C)] for structs and enums that cross the ABI boundary. Do not
  5. Use CString for owned nul-terminated strings sent to C and CStr for
  6. Wrap raw handles in Rust types with private fields and Drop cleanup using
  7. Prevent Rust panics from crossing extern "C" boundaries. Catch panics or

What it can do on your machine

Read from SKILL.md and the folder at commit 9e7b281. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Codex, Claude Code, and other Agent Skills-compatible clients.

    From compatibility in the SKILL.md frontmatter.

Context cost

Rust Ffi Safe Wrappers loads about 945 tokens when it runs, and up to ~1.5k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 390 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~945
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashgraph-online/awesome-codex-plugins at commit 9e7b281, republished under its MIT licence (© hashgraph-online). 390 words, ~945 tokens.

Download SKILL.mdSave it as .claude/skills/rust-ffi-safe-wrappers/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
rust-ffi-safe-wrappers
description
Design and review Rust FFI boundaries that keep raw declarations isolated behind safe ownership, lifetime, error, and cleanup wrappers. Use when writing, refactoring, or reviewing unsafe extern blocks, C ABI wrappers, repr(C) types, CString, CStr, raw handles, Drop cleanup, bindgen, cbindgen, or panic-safe foreign boundaries.
compatibility
Codex, Claude Code, and other Agent Skills-compatible clients.
license
MIT
metadata.version
0.1.0
metadata.displayName
Rust FFI Safe Wrappers
metadata.category
Rust
metadata.tags
rust,ffi,c-abi,unsafe,bindings

Rust FFI Safe Wrappers

Use this skill to wrap foreign interfaces in Rust APIs that make ownership, lifetimes, errors, and cleanup explicit. FFI code should be unsafe at the raw boundary and safe for normal Rust callers.

Core Workflow

  1. Separate raw declarations from safe wrappers. Put raw unsafe extern bindings in a small private module.
  2. Verify ABI, type layout, calling convention, ownership, nullability, threading, and error conventions against the foreign header or docs.
  3. Use unsafe extern "C" blocks for modern Rust, especially Rust 2024 edition code. Leave safety-conditional items unqualified or explicitly unsafe, and mark individual extern items safe only when calling them is safe for all Rust inputs.
  4. Use #[repr(C)] for structs and enums that cross the ABI boundary. Do not expose Rust-only layout types across C.
  5. Use CString for owned nul-terminated strings sent to C and CStr for borrowed C strings. Never treat arbitrary C memory as Rust-owned.
  6. Wrap raw handles in Rust types with private fields and Drop cleanup using the matching foreign deallocator.
  7. Prevent Rust panics from crossing extern "C" boundaries. Catch panics or expose an ABI that permits unwinding only when deliberately using "C-unwind".
Show full SKILL.md (194 more words)Show less

Wrapper Rules

Read references/ffi-boundary-patterns.md before adding or reviewing FFI bindings.

  • Prefer core::ffi or std::ffi C types over guessing integer sizes.
  • Convert foreign error codes into Rust Result at the wrapper boundary.
  • Represent nullable handles as Option<NonNull<T>> internally when useful, but expose safe Rust types to callers.
  • Tie borrowed values to owner lifetimes with normal references or PhantomData when the compiler cannot see the relationship.
  • Make initialization and shutdown idempotent with OnceLock, LazyLock, or Once when the foreign library requires process-wide setup.
  • Use bindgen for large or changing C headers and cbindgen when exporting a Rust API to C, but still review generated unsafe signatures.

Rust 2024 Syntax Checks

rust
unsafe extern "C" {
    pub fn library_open(path: *const core::ffi::c_char) -> *mut RawHandle;
    pub fn library_close(handle: *mut RawHandle);
    // Mark an item `safe` only when calling it is valid for all Rust inputs:
    // pub safe fn library_version() -> core::ffi::c_int;
}

// SAFETY: This exported symbol name is unique for this library.
#[unsafe(no_mangle)]
pub extern "C" fn plugin_version() -> core::ffi::c_int {
    1
}

Unsafe attributes such as no_mangle, export_name, and link_section need the unsafe(...) form in Rust 2024 edition code. Include a SAFETY comment where symbol uniqueness or linker behavior is part of the contract.

Review Checklist

  • Raw bindings are private or clearly separated from safe wrappers.
  • Every pointer parameter has a documented nullability and ownership rule.
  • Every allocation is freed by the same side or an explicitly matching deallocator.
  • Strings and buffers preserve length, encoding, and nul-byte requirements.
  • Panics, callbacks, and threads crossing the boundary have explicit behavior.

© hashgraph-online, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/LVTD-LLC/skills/skills/rust-ffi-safe-wrappers of hashgraph-online/awesome-codex-plugins.

  • SKILL.md
  • agents/openai.yaml
  • references/ffi-boundary-patterns.md

Open the folder on GitHubat commit 9e7b281

Compare with similar skills

Rust Ffi Safe Wrappers next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rust Ffi Safe Wrappers compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Ffi Safe Wrappers this skillhashgraph-online/awesome-codex-plugins1.3k—~945Automated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0
RTK Rust Code Simplifierrtk-ai/rtk83k—~1.1kAutomated safety check: PassApache-2.0
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.

    83k GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed

More from hashgraph-online/awesome-codex-plugins

All 714 skills in this repo
  • Anime Reaction Gif

    hashgraph-online/awesome-codex-plugins

    Create original anime-style reaction stickers as looping GIFs and MP4 previews, using generated character pose sheets and timed key poses.

    1.3k GitHub stars~922 tokensUpdated today
    Auto-check passed
  • Calibredb

    hashgraph-online/awesome-codex-plugins

    Manage and query Calibre libraries with the calibredb CLI (local paths or Calibre Content server URLs).

    1.3k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Rust API Test Harness

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or debugging Rust HTTP APIs and services, especially when Codex needs black-box integration tests, random-port app startup, real database test…

    1.3k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Art

    hashgraph-online/awesome-codex-plugins

    Make a studio's game look like something at build time — a cover from a real frame of the game (free), painted covers, backdrops, textures and character plates from image models through the…

    1.3k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Calle

    hashgraph-online/awesome-codex-plugins

    Use CALL-E from Codex through the calle CLI. An agent skill from hashgraph-online/awesome-codex-plugins.

    1.3k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Game Balance Economy

    hashgraph-online/awesome-codex-plugins

    Balance game difficulty, resources, rewards, probability, progression, economies, and dominant strategies.

    1.3k GitHub stars~618 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Rust Ffi Safe Wrappers

What does Rust Ffi Safe Wrappers do?

Design and review Rust FFI boundaries that keep raw declarations isolated behind safe ownership, lifetime, error, and cleanup wrappers. Rust Ffi Safe Wrappers is an agent skill from hashgraph-online/awesome-codex-plugins. Design and review Rust FFI boundaries that keep raw declarations isolated behind safe ownership, lifetime, error, and cleanup wrappers.

When should I use Rust Ffi Safe Wrappers?

Rust Ffi Safe Wrappers fits situations like: reviewing unsafe extern blocks; panic-safe foreign boundaries.

How do I install Rust Ffi Safe Wrappers in Claude Code?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill rust-ffi-safe-wrappers -a claude-code`. Or copy the skill folder (plugins/LVTD-LLC/skills/skills/rust-ffi-safe-wrappers in hashgraph-online/awesome-codex-plugins) into .claude/skills/rust-ffi-safe-wrappers in your project. Claude Code loads it when a task matches its description.

How do I install Rust Ffi Safe Wrappers in Codex?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill rust-ffi-safe-wrappers -a codex`. Or copy the skill folder (plugins/LVTD-LLC/skills/skills/rust-ffi-safe-wrappers in hashgraph-online/awesome-codex-plugins) into .agents/skills/rust-ffi-safe-wrappers in your project. Codex loads it when a task matches its description.

Can I use Rust Ffi Safe Wrappers in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashgraph-online/awesome-codex-plugins --skill rust-ffi-safe-wrappers -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-ffi-safe-wrappers, .gemini/skills/rust-ffi-safe-wrappers, .github/skills/rust-ffi-safe-wrappers and .opencode/skills/rust-ffi-safe-wrappers in your project.

What does Rust Ffi Safe Wrappers need to run?

SKILL.md names no scripts, command-line tools or credentials: Rust Ffi Safe Wrappers is instructions for the agent only. Compatibility (from SKILL.md): Codex, Claude Code, and other Agent Skills-compatible clients..

Does Rust Ffi Safe Wrappers access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rust Ffi Safe Wrappers safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Rust Ffi Safe Wrappers use?

Rust Ffi Safe Wrappers is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Ffi Safe Wrappers use?

About 945 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 520 tokens, read only when the agent opens those files.

What are the alternatives to Rust Ffi Safe Wrappers?

Skills that share tags, products or a category with Rust Ffi Safe Wrappers: Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars), Rust Best Practices (farm-fe/farm, 5.6k stars), RTK Rust Design Patterns (rtk-ai/rtk, 83k stars) and RTK Rust Code Simplifier (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Ffi Safe Wrappers?

hashgraph-online (a GitHub organization) maintains it in hashgraph-online/awesome-codex-plugins, which has 1,255 GitHub stars. The repository holds 714 skills in this directory. The repository was last updated on October 9, 2026.

Source: hashgraph-online/awesome-codex-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.