ms-win32

Installation
SKILL.md

Win32 Discipline

Invoke for ANY code touching Windows APIs: *W/*A functions from kernel32/user32/advapi32/ole32/shell32 and friends, COM interfaces, handles (HANDLE, HWND, HDC), registry, services, or shell — in any language, however trivial the snippet.

Non-negotiables

  1. Unicode W APIs only, never A. Text is UTF-16 or UTF-8 only; never CP_ACP or any ANSI/narrow encoding for durable or protocol text.
  2. Bytes are not UTF-16 code units. Honor exact length contracts and terminators; never assume null termination when a length is supplied.
  3. Check documented failure values. FAILED/SUCCEEDED for HRESULT; ERROR_SUCCESS for LSTATUS; capture GetLastError() only where documented — many calls invalidate it.
  4. RAII ownership with matching release for handles, buffers, and COM allocations; never release borrowed or pseudo-handles. Initialize structure size/version fields (cbSize etc.) as documented; use pointer-sized types (DWORD_PTR, INT_PTR) without truncation.

When a rule here conflicts with an API's documented contract, the documented contract wins — note the deviation.

Cross-language general (Rust FFI and friends)

These rules apply to ANY language calling Windows APIs; each language skill defers here instead of restating them.

Installs
7
First Seen
Aug 27, 2026