/bawa:os-integrationsfrom bawa
Provides Windows API recipes for global hotkeys, keyboard/mouse hooks, tray icons, overlays, screen capture, clipboard, and other deep OS integrations. Use when an app must reach outside its own window or control other apps.
Ships in bawa. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A Windows app is a set of entry points around the system, not one window. This skill picks the API for each entry point and the limit it runs into. Code for every row marked "recipe" is in recipes.md. Rows marked with another file have their code there:
| Want | API | Permission or limit |
|---|---|---|
| Global shortcut (key combo) | RegisterHotKey on a hidden window (recipe) | None. Fails with error 1409 when another app owns the combo |
| Hold-to-show (hold Alt, press a key), key remapping, snippet expansion | SetWindowsHookEx(WH_KEYBOARD_LL) on its own thread (recipe) | None. Sees no keys typed into elevated windows |
| Watch keys without changing them (keystroke overlay) | The same WH_KEYBOARD_LL hook, returning false for every key (recipe). In a suite, the shared hook | None. Not Raw Input: it marks injected keys only by hDevice == 0, needs a window for WM_INPUT, and has no LLKHF_ALTDOWN |
| Watch the mouse (cursor highlight, click ripples, reset on a click) | SetWindowsHookEx(WH_MOUSE_LL) on a thread that also owns the overlay windows (overlays.md) | None |
| List other apps' windows (a switcher, a window picker) | EnumWindows plus a filter (system.md) | None |
| Tray icon (the menu bar extra) | Shell_NotifyIcon on a hidden window (recipe) | None. New icons start in the overflow |
| Live numbers in the tray (CPU, memory) | One icon per metric on the feature's own window, redrawn per sample (system.md) | None. Windows keeps a settings entry per icon for good |
| Live status in the taskbar (a timer, a sync) | Tray icon tooltip, or ITaskbarList3 progress on the taskbar button | None |
| Desktop widgets (Widgets board), share targets, Explorer context menus, startup tasks, Windows AI APIs | Need package identity | Add a sparse package to the unpackaged app (distribute skill, step 5), as PowerToys does for its context menus |
| Tray-only app, no taskbar button | Never Activate() the main window at launch; the tray icon shows it | None |
| Spotlight-style panel that keeps the other app in front | Topmost window with WS_EX_NOACTIVATE, or one that activates and hands focus back (recipe) | None |
| A window with no frame at all (a frozen screen, a full-display picker) | WinUI window plus a WM_NCCALCSIZE subclass and three DWM attributes (overlays.md) | None |
| Click-through overlay with per-pixel alpha (key caps, a halo) | Win32 layered popup drawn with UpdateLayeredWindow (overlays.md) | None. PrintWindow cannot capture it |
| Keep a window out of screenshots and recordings | SetWindowDisplayAffinity(WDA_EXCLUDEFROMCAPTURE) (overlays.md) | None. Also blanks PrintWindow |
| Move and resize other apps' windows | SetWindowPos, corrected by DWMWA_EXTENDED_FRAME_BOUNDS (recipe) | None. Elevated windows need an elevated app |
| Paste into the front app, type text | Clipboard, then SendInput with a marker in dwExtraInfo (recipe) | None. UIPI drops it silently for elevated windows |
| Screenshot of a display or an area | GDI BitBlt of the virtual screen, frozen before any picker shows (capture.md) | None. No border, no prompt |
| Screenshot of one window | GraphicsCaptureItem.TryCreateFromWindowId, cropped to the visible frame (recipe) | None. Yellow border unless the person allowed borderless capture |
| Window thumbnails | Live: DwmRegisterThumbnail (capture.md). Still: the window screenshot above | None |
| Screen recording to MP4 | Windows.Graphics.Capture into MediaStreamSource and MediaTranscoder (capture.md) | Yellow border as above. Microphone: Settings > Privacy & security > Microphone |
| Clipboard history | AddClipboardFormatListener, then Win32 reads (recipe) | None. Skip content marked by password managers and by other tools |
| Text in images | Windows.Media.Ocr.OcrEngine | None |
| Find files by name | The Windows Search index through OLE DB (system.md) | Only indexed folders. Nothing when the service is off |
| App and file icons | StorageFile.GetThumbnailAsync, then SHDefExtractIcon (system.md) | None |
| Ask another app's UI a question (is the focused field a password?) | UI Automation through raw COM (system.md) | None. The managed UIA library is WPF only |
| Launch at login | HKCU\...\CurrentVersion\Run value (recipe) | None. People can turn it off in Task Manager |
| One running copy, second launch hands over | AppInstance.FindOrRegisterForKey in a custom Main (recipe) | None |
| Links from scripts, Stream Deck, PowerToys Run | URL protocol under HKCU\Software\Classes (recipe) | None |
| Agent or script reads and changes data | A console CLI that talks to the running app over a named pipe (agent-cli skill) | None |
| A CLI that writes its own files tells the app to reload | A named EventWaitHandle (Local\<App>-changed) the app waits on | None |
| Keep the PC awake | SetThreadExecutionState (already in UI/Win32.cs), or a PowerCreateRequest handle with a reason (system.md) | None |
| Check that the PC is kept awake | CallNtPowerInformation(SystemExecutionState) (system.md) | None. powercfg /requests needs an admin terminal |
| System stats | GetSystemTimes, GlobalMemoryStatusEx, GetSystemPowerStatus, on a sampler thread with EcoQoS (performance skill) | None |
| Listening ports and process command lines | GetExtendedTcpTable, NtQueryInformationProcess (system.md) | None. Elevated processes return no command line |
| Audio devices | Windows.Media.Devices.MediaDevice, or the Core Audio IMMDeviceEnumerator | None |
| Notifications | AppNotificationManager from the Windows App SDK (recipe) | The user can turn them off. Not shown for elevated apps |
| Share with other apps | DataTransferManager through IDataTransferManagerInterop | None |
Prefer the row with no limit when two rows solve the same job.
BAMA's Mac apps ask for permissions. Windows asks for almost none, and has other walls instead:
| macOS | Windows |
|---|---|
| Accessibility (event taps, AX window control, posting keys) | No permission. UIPI blocks input, hooks, and window moves into elevated (administrator) apps. See "Elevation and UIPI" in recipes.md |
| Input Monitoring | No permission. A low-level hook sees every key except those typed into elevated windows |
| Screen Recording | No permission. GDI reads the screen with no sign. Windows.Graphics.Capture draws a yellow border around what it captures, until the person allows borderless capture |
| Menu bar extra | Tray icon. Windows hides new icons in the overflow until the user pins them |
| Login item approval | None. The Run key works at once; Task Manager can turn it off later |
| Notification permission prompt | None at first. People turn notifications off per app in Settings |
| Camera, microphone, location | Settings > Privacy & security, with a "Let desktop apps access" switch for each |
AppNotificationManager.Default.Setting),
the capture border (read with CheckAccess, which never prompts), and
the tray icon. Each gets a button that fixes it or opens the right
page: ms-settings:startupapps, ms-settings:notifications,
ms-settings:privacy-microphone, ms-settings:privacy-webcam.requireAdministrator.ITaskbarList3.SetOverlayIcon) only with a
count of unread items.The Run key, the URL protocol, the toast registration, and every tray icon store the exe's path. To keep them working across rebuilds:
build.ps1 installs to
%LOCALAPPDATA%\Programs\<App>\<App>.exe.APP_STORE set). That includes NIM_ADD: Windows 11 writes a
key per exe path and icon id under HKCU\Control Panel\NotifyIconSettings
and never removes it. One dev PC had dozens of entries for
old dev folders. A test run draws its icons but never adds them.HKCU\Software\Classes\<scheme> key, and
AppNotificationManager.Default.UnregisterAll().ship stage).If a hook works from the build folder but not after install, a registration still points at the old path. Remove it and register again from the installed exe.
In a PowerToys-shaped app (one tray app, many features), the host owns
every integration that Windows allows only once per process or per
person, and features subscribe. The new-windows-app skill's
suite.md has the whole shape.
For integrations:
| The host owns | Features get |
|---|---|
| The tray icon (uID 1) and its hidden top-level window | Menu rows and a flyout block. A feature with icons of its own (live stats) puts them on its own window with uIDs from 101 |
| Single instance | Nothing to do: a second launch hands over to the running copy (it opens Settings) |
The hotkey registry: one RegisterHotKey per action, keyed by action id | A default combo per action, and "used by another app" when it failed. No two actions share a default |
One WH_KEYBOARD_LL hook on its own thread | Subscribe(Func<KeyEvent, bool>), disposed in Stop. The hook starts with the first subscriber and stops with the last |
A foreground tracker (SetWinEventHook(EVENT_SYSTEM_FOREGROUND)) | "The window you were using", never the app's own panel or the taskbar |
The shared keyboard hook is the one that matters most. Windows removes a hook that takes over a second, and ten hooks in one process are ten chances. The shape:
public readonly record struct KeyEvent(int VirtualKey, int ScanCode, bool Down, bool Injected,
bool AltDown, uint Time, bool Extended, nuint ExtraInfo);
// In a feature's Start, and Dispose in Stop:
_subscription = Host.Input.Subscribe(e =>
{
if (e.Injected && e.ExtraInfo == MyMarker) return false; // our own SendInput
_queue.Enqueue(e); // copy, then return at once
Host.Dispatcher.TryEnqueue(Drain);
return false; // true only to swallow the key
});
Rules for the shared hook:
dwExtraInfo. Each feature filters for itself: the keystroke overlay
drops injected keys, a switcher may want them. A first version without
Extended and ExtraInfo pushed two features into workarounds.performance skill, "Timers, polling, and energy").Each feature gets: a command with a KeyboardAccelerator, a URL
(<app>://action/<name>), and an agent CLI command (agent-cli skill).
The same action enum backs all three, so a new action shows up everywhere
at once. Add a self-test check that every action has a command label, a
URL name, and a CLI command. The URL and the CLI also let
test-windows-app drive the feature from a script.
Self-tests of these integrations act only on the app's own test windows:
feed hook handlers synthetic events, read captures from a test window, and
check GetForegroundWindow before every SendInput. Each recipe ends
with how it was tested safely.
Done when every entry point in the brief's "System hooks" works from a clean install, Settings shows the state of every hook it needs, and no test run left a registration or a tray icon entry behind.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/agent-cliOptional command line and MCP server for a Windows app, so Claude Code, Codex, and scripts can drive it (list, add, change, search, act) through the running app. Use when the user wants agents to work with their app or its data, asks for a CLI, an MCP server, or automation for the app, or says "Claude should be able to use my app"./app-briefOne-page brief (docs/BRIEF.md) for a new Windows app, written before any code. Use when the user has an app idea, wants to replace an app they pay for, or the research and clone skills are done./app-iconWindows app icon drawn as an SVG (Icon/AppIcon.svg), rendered by tools/make-icon.ps1 into a multi-size AppIcon.ico and AppIcon.png, and reviewed on light and dark taskbar and Start backgrounds, with hand-tuned small sizes. Use when the user wants an app icon, a better icon, or a taskbar or Start icon./bawaBuild any Windows app. Start here to pick the next skill for a native Windows app./build-and-verifyBuild a WinUI 3 app from the command line, install it, and check light and dark window snapshots of every page before calling a change done. Use after any UI code change, when a build fails, or when the user asks to run, screenshot, or check the app./cloneWalk through any existing app (native Windows app with computer use, web app with a browser), screenshot every screen, menu, and dialog, write a screen index, and turn it into user stories. Use when the user wants to clone, rebuild, replace, or copy the design of an app, or says "screenshot every screen".npx claudepluginhub daveebbelaar/bawa --plugin bawaOther plugins' skills for the same job