Skip to main content
dotnet-pinvokeby .NETOfficialDevelopmentGitHub stars: 5.5k

.NET P/Invoke skill: what it does and how to install it

Creates and reviews .NET P/Invoke and LibraryImport declarations for native libraries, including types, strings, memory ownership and handles.

Summary generated from the skill's documentation.

Install

$ npx skills add dotnet/skills --skill dotnet-pinvoke

Run it in a terminal. If your agent is already running, start a new session so it picks the skill up.

About this skill

What it does. Maps C and C++ headers to DllImport or LibraryImport declarations, covering type sizes, string encoding, calling conventions, memory ownership, SafeHandle, callbacks and cross-platform library loading. It also provides migration guidance, interop analyser checks and runtime validation steps.

When to use it. For wrapping native libraries, reviewing interop signatures, migrating to source-generated imports, or diagnosing crashes, leaks and corruption at the managed/native boundary. It does not apply to COM interop, C++/CLI assemblies or purely managed code.

History

Repo stars

5.5kAbout +384 since 9 Jul 2026

Before 1 Oct 2026 the curve is estimated from public event data.

Stars are counted for the whole repository, which holds 18 skills.

Show as a table
Repo stars by day
DateRepo stars
1 Oct 20265,531
24 Sept 2026 (estimated)5,519
17 Sept 2026 (estimated)5,494
10 Sept 2026 (estimated)5,419
3 Sept 2026 (estimated)5,258
27 Aug 2026 (estimated)5,233
20 Aug 2026 (estimated)5,221
13 Aug 2026 (estimated)5,221
6 Aug 2026 (estimated)5,171
30 Jul 2026 (estimated)5,159
23 Jul 2026 (estimated)5,159
16 Jul 2026 (estimated)5,147
9 Jul 2026 (estimated)5,147

Installs

2.5k

Tracking since . A chart appears once there are 7 days of data.

Installs via skills.sh

Similar skills