Skip to content
Back to skills

Ffi And Language Interop

ASecurity

FFI and native interop rules: single documented pointer ownership, opaque handles, null-pointer checks, allocate/free pairs, unsafe-block invariants, generated C headers, stable C ABI, frozen struct layouts, and error/context conversion. Load when writing or reviewing FFI boundaries between native and host languages.

  • 146 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 5, 2026
ai-agentsrustc++

Security analysis

A100/100

Scanned October 5, 2026

npx -y skills add Goldziher/ai-rulez --skill ffi-and-language-interop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ffi And Language Interop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ffi And Language Interop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/goldziher-ffi-and-language-interop/badge)](https://www.skillsdirectory.com/skills/goldziher-ffi-and-language-interop)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ffi-and-language-interop
description: "FFI and native interop rules: single documented pointer ownership, opaque handles, null-pointer checks, allocate/free pairs, unsafe-block invariants, generated C headers, stable C ABI, frozen struct layouts, and error/context conversion. Load when writing or reviewing FFI boundaries between native and host languages."
---

- Every pointer has one owner, documented with `SAFETY` comments or host-language ownership docs.
- Use opaque handles across native boundaries. Do not expose Rust, C++, or host-runtime internals directly.
- Check all nullable pointers before use and return explicit errors for invalid handles or null inputs.
- Provide allocate/free pairs for every caller-owned allocation and document which side frees each value.
- Every unsafe block must state the invariant, why it holds, and what would make it invalid.
- Generate C headers or native declarations from source when possible, and make CI verify generated files are current.
- Treat the C ABI or equivalent native ABI as the stable contract for downstream bindings.
- Freeze native struct layouts across compatible releases, and version breaking ABI changes deliberately.
- Convert native errors to host exceptions, result objects, or idiomatic error values at every boundary.
- Preserve diagnostic context across boundaries: message, numeric code when available, source operation, and cause chain.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.