# FFI Design Skill

Expert skill for designing and implementing foreign function interfaces to native code.

## Quick Reference

- **Category**: Interoperability
- **ID**: SK-016

## Key Capabilities

- FFI declaration syntax design
- Type marshaling between languages
- C calling convention handling (cdecl, stdcall, fastcall)
- Callback support (native calling managed)
- String encoding conversions
- Struct layout matching (padding, alignment)
- Memory ownership transfer rules
- Dynamic library loading

## When to Use

Use this skill when implementing:
- Native code interop for managed languages
- C library bindings
- Cross-language callback mechanisms
- Platform API access

## Shared Candidate

This skill is a candidate for extraction to a shared library as it applies to:
- Embedded Systems
- Systems Programming

## Related Skills

- memory-allocator (SK-009)
- bytecode-vm (SK-010)
- llvm-backend (SK-005)
