Skip to content
Back to skills

Minimize Rust Ffi Crate Surface

ASecurity

Remove Rust-defined C symbols that are either unused or only used in C/C++ unit tests.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 29, 2026
testingrustc++documentation

Security analysis

A100/100

Scanned May 29, 2026

npx -y skills add zjunlp/Skills --skill minimize-rust-ffi-crate-surface --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Minimize Rust Ffi Crate Surface?

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

Security grade badge for Minimize Rust Ffi Crate Surface
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zjunlp-minimize-rust-ffi-crate-surface/badge)](https://www.skillsdirectory.com/skills/zjunlp-minimize-rust-ffi-crate-surface)

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: minimize-rust-ffi-crate-surface
description: Remove Rust-defined C symbols that are either unused or only used in C/C++ unit tests.
---

# Minimize Rust FFI Crate Surface

Remove C symbols defined in a Rust FFI crate or file that are either unused or only used in C/C++ unit tests.

## Arguments
- `<path>`: Path to the Rust crate or file.
- `<path 1> <path 2>`: Multiple Rust crates/files.

If the path doesn't start with `src/`, assume it to be in the `src/redisearch_rs/c_entrypoint` directory. E.g. `numeric_range_tree_ffi` becomes `src/redisearch_rs/numeric_range_tree_ffi`.
If the path points to a directory, review the documentation of all Rust files in that directory.

## Instructions

- Use [analyze-rust-ffi-crate-surface](../analyze-rust-ffi-crate-surface/SKILL.md) to enumerate and analyze the usage of all the FFI symbols exposed by the Rust crate or file (e.g. `extern "C" fn` annotated with `#[unsafe(no_mangle)]` or type definitions).
- For each unused symbol:
  - Delete its Rust definition.
  - Run C/C++ unit tests to ensure the symbol was indeed unused (via `./build.sh RUN_UNIT_TESTS`)
- For each symbol that is only used in C/C++ unit tests, elaborate a plan to either:
  - Refactor the C/C++ unit tests not to use it.
  - Remove the C/C++ unit tests (or assertions) that rely on it, since they are prying into the implementation details of the Rust crate.
  - Keep the symbol, but mark it as "test only" in the Rust documentation.

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.