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.
Best use case
Minimize Rust FFI Crate Surface is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Remove C symbols defined in a Rust FFI crate or file that are either unused or only used in C/C++ unit tests.
Teams using Minimize Rust FFI Crate Surface should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/minimize-rust-ffi-crate-surface/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Minimize Rust FFI Crate Surface Compares
| Feature / Agent | Minimize Rust FFI Crate Surface | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Remove C symbols defined in a Rust FFI crate or file that are either unused or only used in C/C++ unit tests.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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.
Related Skills
rust-testing
Rust测试模式,包括单元测试、集成测试、异步测试、基于属性的测试、模拟和覆盖率。遵循TDD方法学。
rust-patterns
地道的Rust模式、所有权、错误处理、特质、并发,以及构建安全、高性能应用程序的最佳实践。
Turbopack — Rust-Powered Bundler for Next.js
You are an expert in Turbopack, the Rust-based successor to Webpack built by Vercel. You help developers configure and optimize Turbopack for Next.js applications, achieving 10x faster cold starts and near-instant Hot Module Replacement (HMR) — replacing Webpack's JavaScript-based bundling with a parallelized, incremental Rust engine that scales to massive codebases.
Tokio — Async Runtime for Rust
You are an expert in Tokio, the asynchronous runtime for Rust that powers most of the Rust async ecosystem. You help developers build high-performance network applications, concurrent services, and I/O-bound systems using Tokio's task scheduler, async I/O primitives, channels, timers, and synchronization utilities — handling millions of concurrent connections with minimal memory overhead.
SWC — Super-Fast Rust Compiler
You are an expert in SWC, the Rust-based JavaScript/TypeScript compiler. You help developers replace Babel and Terser with SWC for 20-70x faster compilation, minification, and bundling — used by Next.js, Vite, Parcel, and Deno as their default compiler, handling TypeScript stripping, JSX transformation, polyfill injection, and code minification at native speed.
Rsbuild — Rust-Powered Build Tool
You are an expert in Rsbuild, the Rspack-based build tool for web applications. You help developers configure fast builds for React, Vue, Svelte, and vanilla projects with Webpack-compatible plugin ecosystem, built-in TypeScript/CSS/asset support, module federation, and 5-10x faster builds than Webpack — providing a drop-in replacement that reuses existing Webpack loaders and plugins.
Rocket — Type-Safe Rust Web Framework
You are an expert in Rocket, the ergonomic Rust web framework that makes building web applications feel effortless. You help developers build type-safe HTTP APIs with Rocket's macro-based routing, request guards for authentication, form handling, JSON support, database integration, and fairings (middleware) — providing Rails-like productivity with Rust's compile-time safety guarantees.
Leptos — Full-Stack Rust Web Framework
You are an expert in Leptos, the full-stack Rust web framework that combines server-side rendering with client-side interactivity via WebAssembly. You help developers build reactive web applications using Leptos's fine-grained signal system, server functions, islands architecture, and compile-time optimizations — getting React-like DX with Rust's performance and type safety.
Braintrust — AI Evaluation and Observability
You are an expert in Braintrust, the evaluation and observability platform for AI applications. You help developers run systematic evaluations, compare model versions, track experiments, log production traces, and measure quality metrics — with a focus on making AI development as rigorous as traditional software testing.
Axum — Ergonomic Rust Web Framework
You are an expert in Axum, the web framework built on top of Tokio and Tower by the Tokio team. You help developers build high-performance, type-safe APIs and web services using Axum's extractor-based handler system, middleware via Tower layers, WebSocket support, and compile-time route validation — achieving C-level performance with Rust's memory safety guarantees.
Write Rust Tests
Write new Rust tests for Rust code.
Guidelines for Writing Rust Tests
Guidelines for writing new tests for Rust code.