[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EE02CWTN1FZ0VC0SKC0Q5F":3,"skill-same:01M6EE02CWTN1FZ0VC0SKC0Q5F":54},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6EE02CWTN1FZ0VC0SKC0Q5F","port-c-module",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FRediSearch\u002FRediSearch\u002Fport-c-module\u002FSKILL.md",[],[18,19,20],"module","port","port c module","2026-11-10 10:12:30",false,"# Port Module Skill\n\nGuide for porting a C module to Rust.\n\n## Arguments\nThe module name to port should be provided as an argument (e.g., `\u002Fport-module triemap`).\n\nModule to port: `$ARGUMENTS`\n\n## Usage\nUse this skill when starting to port a C module to Rust.\n\n## Instructions\n\n### 1. Analyze the C Code\nFirst, understand the C module you're porting (look for `$ARGUMENTS.c` and `$ARGUMENTS.h` in `src\u002F`):\n- Read the `.c` and `.h` files in `src\u002F`\n- Identify what is exposed by the header file:\n  - Does the rest of the codebase have access to the inner fields of the data structures defined in this module?\n  - Are types always passed by value or by reference? A mix?\n  - Can the corresponding Rust types be passed over the FFI boundary?\n- Understand data structures and their lifetimes\n- Identify which types and functions this module imports from other modules:\n  - Determine if those types are implemented in Rust or C\n  - If those types are implemented in Rust, identify the relevant Rust crate\n  - If those types are implemented in C, understand if it makes sense to port them first to Rust\n    or if it's preferable to invoke the C implementation from Rust via FFI\n- Note any global state or Redis module interactions\n- Identify which tests under `tests\u002F` are relevant to this module\n\n### 2. Define A Porting Plan\n\nCreate a `$ARGUMENTS_plan.md` file to outline the steps and decisions for porting the module.\nDetermine if the C code should be modified, at this stage, to ease the porting process.\nFor example:\n- Introduce getters and setters to avoid exposing inner fields of data structures defined in this module.\n- Split the module into smaller, more manageable parts.\n\n### 3. Create the Rust Crate\n```bash\ncd src\u002Fredisearch_rs\ncargo new $ARGUMENTS --lib\n```\n\n### 4. Implement Pure Rust Logic\n- Create idiomatic Rust code\n- Add comprehensive tests\n  - Ensure that all C\u002FC++ tests have equivalent Rust tests\n- Document public APIs with doc comments\n- For performance sensitive code, create microbenchmarks using `criterion`\n- Use `proptest` for property-based testing where appropriate\n- Testing code should be written with the same care reserved to production code\n\n### 5. Compare Rust API with C API\n- Review the public API of the new Rust module against the C API in the header file\n- Ensure that differences can be bridged by adding appropriate wrappers or adapters\n- Go back to step 1 if discovered differences cannot be bridged without a re-design\n\n### 6. Create FFI Wrapper\nCreate an FFI crate to expose the new Rust module to the C codebase:\n```bash\ncd src\u002Fredisearch_rs\u002Fc_entrypoint\ncargo new ${ARGUMENTS}_ffi --lib\n```\n\nFFI crate should:\n- Expose `#[unsafe(no_mangle)] pub extern \"C\" fn` functions\n- Handle null pointers and error cases\n- Convert between C and Rust types safely\n- Document all unsafe blocks with `\u002F\u002F SAFETY:` comments\n\n### 7. Wire Up C Code\n- Delete the C header file and its implementation\n- Update the rest of the C codebase to import the new Rust header wherever the old C header was used\n\nC header files for Rust FFI crates are auto-generated. No need to use their full path in imports,\nuse just their name (e.g. `#include $ARGUMENTS.h;` for `${ARGUMENTS}_ffi`)\n\n### 8. Test The Integration\n```bash\n.\u002Fbuild.sh RUN_UNIT_TESTS               # C\u002FC++ unit tests\n.\u002Fbuild.sh RUN_PYTEST                   # Integration tests\n```\n\n## Example: Well-Ported Module\nSee `src\u002Fredisearch_rs\u002Ftrie_rs\u002F` for a high-quality example:\n- Pure Rust implementation with comprehensive docs\n- Extensive test coverage\n- Clean FFI boundary in `c_entrypoint\u002Ftrie_ffi\u002F`\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FRediSearch\u002FRediSearch\u002Fport-c-module",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill port-c-module",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill port-c-module",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill port-c-module","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FRediSearch\u002FRediSearch\u002Fport-c-module\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"agents\u002Fopenai.yaml","REFERENCE","参考文档",106,"https:\u002F\u002Fgithub.com\u002FThamielis\u002F.agents\u002Fblob\u002Fmain\u002Fplugins\u002Fvercel\u002Fskills\u002Finvestigation-mode\u002Fagents\u002Fopenai.yaml",[55,64,73,82,88,94],{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[61,62,63],"model","model hierarchy","model hierarchy skill",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[70,71,72],"MCP","zoom","zoom mcp",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[79,80,81,71],"sdk","zoom apps sdk","apps",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[90],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[96]]