Guide for porting a C module to Rust. Use this when starting to port a C module to Rust.
Guide for porting a C module to Rust.
The module name to port should be provided as an argument (e.g., /port-module triemap).
Module to port: $ARGUMENTS
Use this skill when starting to port a C module to Rust.
First, understand the C module you're porting (look for $ARGUMENTS.c and $ARGUMENTS.h in src/):
.c and .h files in src/tests/ are relevant to this moduleCreate a $ARGUMENTS_plan.md file to outline the steps and decisions for porting the module.
Determine if the C code should be modified, at this stage, to ease the porting process.
For example:
cargo new src/redisearch_rs/$ARGUMENTS --lib
criterionproptest for property-based testing where appropriateCreate an FFI crate to expose the new Rust module to the C codebase:
cargo new src/redisearch_rs/c_entrypoint/${ARGUMENTS}_ffi --lib
FFI crate should:
#[unsafe(no_mangle)] pub extern "C" fn functions// SAFETY: commentsC header files for Rust FFI crates are auto-generated. No need to use their full path in imports,
use just their name (e.g. #include $ARGUMENTS.h; for ${ARGUMENTS}_ffi)
./build.sh RUN_UNIT_TESTS # C/C++ unit tests
./build.sh RUN_PYTEST # Integration tests
See src/redisearch_rs/trie_rs/ for a high-quality example:
c_entrypoint/trie_ffi/npx skills add RediSearch/port-c-module下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer