Guide for writing MoonBit bindings to C libraries using native FFI. Use when adding extern "c" declarations, writing C stubs with moonbit.h, configuring native-stub and link.native in moon.pkg, choosing #borrow/#owned ownership annotations, designing callback trampolines, wrapping C pointers with external objects and finalizers, converting strings across FFI, or validating bindings with AddressSanitizer.
$npx -y skills add moonbitlang/moonbit-agent-guide --skill moonbit-c-bindingInstalls into the current project.
Run `npx skills use "https://github.com/moonbitlang/moonbit-agent-guide" --skill "moonbitlang/moonbit-agent-guide/moonbit-c-binding"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/moonbitlang/moonbit-agent-guide" that are relevant to the current task. Run `npx skills add "https://github.com/moonbitlang/moonbit-agent-guide"` and select the relevant skills, then follow their instructions.