What problem does it solve? Calling native C/C++ libraries from .NET is error-prone: incorrect signatures, wrong string encodings, and mismatched memory ownership cause crashes, silent data corruption, and memory leaks that surface far from the actual defect. This Skill provides a structured workflow for writing correct P/Invoke and LibraryImport declarations and diagnosing failures at the managed/native boundary. ## Core Features & Use Cases - Declaration authoring: Maps native C/C++ types to correct .NET types (CLong, nuint, SafeHandle) and generates DllImport or LibraryImport declarations based on the target framework. - Memory and string safety: Enforces explicit string encoding, correct allocator pairing, SafeHandle usage for native handles, and delegate rooting for callbacks. - Diagnostics and migration: Provides failure-mode tables for AccessViolationException and DllNotFoundException, plus a step-by-step DllImport-to-LibraryImport migration path for AOT/trimming compatibility. - Use Case: Given a C header for a compression library, generate a complete .NET wrapper with LibraryImport declarations, SafeHandle-based resource management, and UTF-8 string marshalling, then validate it with interop analyzers. ## Quick Start Ask the agent to write a LibraryImport wrapper for the functions declared in your native C header file, targeting .NET 8.