Enforces RAII patterns for Windows resource management using the Windows Implementation Library.

Install

mkdir -p .claude/skills/wil-raii && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15871" && unzip -o skill.zip -d .claude/skills/wil-raii && rm skill.zip

Installs to .claude/skills/wil-raii

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Windows Implementation Library (WIL) RAII patterns for managing Windows resources. Use when creating, managing, or cleaning up Windows handles like HICON, HWND, HBITMAP, HDC, COM objects, or any GDI resources.
209 chars✓ has a “when” trigger
Advanced

Key capabilities

  • →Manage HICON resources with `wil::unique_hicon`
  • →Manage HWND resources with `wil::unique_hwnd`
  • →Manage COM objects with `wil::com_ptr<T>`
  • →Handle GDI selections with `wil::SelectObject`
  • →Ensure cleanup with `wil::scope_exit`

How it works

The skill provides WIL RAII wrappers and patterns to automatically manage and clean up Windows resources like handles and COM objects.

Inputs & outputs

You give it
Windows handle or resource
You get back
RAII-managed Windows resource

When to use wil-raii

  • →Manage HICON or HWND
  • →Clean up COM objects
  • →Implement safe GDI resource management
  • →Ensure auto-cleanup on exit

About wil-raii

Provides standard patterns and wrappers for cleaning up Windows handles and GDI resources. It prohibits manual cleanup, requiring the use of specific wrappers.

Windows Implementation Library (WIL) RAII patterns for managing Windows resources. Use when creating, managing, or cleaning up Windows handles like HICON, HWND, HBITMAP, HDC, COM objects, or any GDI resources.

When not to use it

  • →When performing manual resource cleanup
  • →When using `goto` for cleanup patterns
  • →When destroying an owned HWND via `.get()`

Limitations

  • →Manual resource cleanup is prohibited
  • →`goto` cleanup patterns are forbidden
  • →Destroying an owned HWND via `.get()` is prohibited

How it compares

This skill enforces RAII wrappers for all Windows resources, eliminating manual cleanup and `goto` patterns common in traditional Win32 programming.

Compared to similar skills

wil-raii side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
wil-raii (this skill)06moNo flagsAdvanced
static-analysis59moNo flagsAdvanced
memory-safety-patterns47moNo flagsAdvanced
gdb-cli07moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry