microsoft/winappcli/winapp-ui-automation
Claude Code and agent skill by microsoft/winappcli
- vendor
Checking that the SKILL.md file is still in the repository.
Inspect, drive, and verify a running Windows app UI via winapp ui (UI Automation): find elements, click, type, read text/values, wait for state, take screenshots in WinUI, WPF, WinForms, Win32, or Electron apps. Use to check, test, or act on a live app; for WinUI XAML internals, use winui-devtools.
Install
npx vskill@latest install microsoft/winappcli/winapp-ui-automationSKILL.md
The same SKILL.md was published earlier as microsoft/winappcli/winapp-ui-automation.
If you can't run `winapp` yourself (no shell, or the command is denied), give the user the exact winapp command(s) for their project instead of only describing the steps.
When to use
- Inspecting a running Windows app's UI from the command line
- AI agents interacting with Windows applications (clicking buttons, reading text, taking screenshots)
- Verifying UI state during development or testing
- Automating UI workflows without Playwright or Selenium
- Debugging WinUI 3, WPF, WinForms, Win32, or Electron app UIs by what the user sees and can operate
- Not for a WinUI 3 app's XAML internals (why a value or binding resolved the way it did, which XAML line made an element, live property edits, UI review comments): use
winui-devtools
Prerequisites
For WinUI 3 XAML source/tree, bindings or dependency-property diagnosis and edits, use the winui-devtools skill and winapp devtools. It requires an attached target or explicit authorization to inject with --attach; a PID alone is not consent. An AutomationId works as a selector in both tools; generated slugs do not transfer to DevTools. Continue using winapp ui for cross-framework actions, screenshots, waits and accessibility.
To measure WinUI work while driving a scenario, use the winapp-performance skill to bracket UI actions with capture markers.
- For UIA mode (any app): No setup needed — works with any running Windows app
- For input-injecting verbs (
click,hover,drag,touch,pen,scroll --wheel/--wheel-horizontal,send-keys --via send-input): an unlocked, interactive desktop with the target window foregroundable. On a locked/secure desktop they fail fast withno_interactive_desktop. The UIA-pattern verbs (inspect,search,get-*,wait-for,set-value,invoke,scroll --direction/--to) are headless/locked-session friendly — prefer them in CI. screenshotis not in that group: it always takes an exclusive turn, so it queues behind other UI workflows, and capture can need a usable interactive desktop — the engine restores the target if it is minimized, and falls back to foregrounding it when frame capture is unavailable or--capture-screenis used.--capture-screenneeds exactly one window.-w <hwnd>gives it one: that window's screen region, including anything visibly on top of it. If-amatches several top-level or owned windows the command fails withinvalid_argumentsbefore capturing; runwinapp ui list-windows -a <app>and retry with-w <hwnd>.- If other UI workflows may run at the same time, set one workflow id per logical workflow (see below). Nothing breaks without it, but your commands will not be recognized as belonging together.
Coordinating with other UI workflows
Windows has one foreground window, one keyboard focus, one cursor, and one input stream. winapp ui therefore makes desktop-driving commands take cooperative turns so concurrent workflows cannot steal each other's focus or dismiss each other's menus. That is always on. Read-only commands never wait.
Keeping the desktop across commands is opt-in — without an id, each command is a one-shot that releases the desktop the moment it finishes:
Rules that matter when driving this from an agent:
- Each tool call usually gets a fresh shell, and there is no process-ancestry fallback, so
commands are grouped ONLY by the id you inject. Without it every call is its own workflow.
- A workflow with an id keeps its turn for four seconds after its last command. That covers
back-to-back commands in one script; it deliberately expires while you are reasoning. Treat it as a fallback for when you cannot say you are done — not as the way to finish.
- Run `winapp ui yield` when you finish a known sequence. It hands the desktop over immediately
instead of making a waiting workflow sit out a four-second grace nobody needs. Yielding twice, or after the grace lapsed, is a harmless success.
- After a reasoning gap, replay your setup. Another workflow may have used the desktop, so
reopen the menu / re-navigate, re-resolve the element, then act. Do not assume transient UI survived.
- Prefer one tight script over many round trips for a known sequence: `winapp ui invoke View -w
$hwnd; winapp ui search "Status bar" -w $hwnd; winapp ui click "Status bar" -w $hwnd; winapp ui yield`.
- `record` shares the turn with its own workflow, so same-workflow clicks and typing are captured
while it runs — but only if both commands carry the same id. A record with no id blocks everyone else for its whole duration.
- Ordering is owner affinity, then FIFO. An active workflow may keep issuing commands ahead of
others already waiting; once it yields or its grace expires, waiters are served in arrival order.
- Waiting is indefinite and cancellable. After one second a notice on stderr says what holds the
desktop and for how long (silent under --json and --quiet); Ctrl+C exits 130 with error code cancelled and the command never ran.
- There is no hard cap — a long script, unbounded recording, or failure loop can block other
mutating workflows until it finishes or is stopped.
Commands that never wait: status, list-windows, inspect, search, get-*, wait-for. Commands that wait for the turn but never take the desktop (headless/locked-session friendly): set-value, scroll-into-view, scroll --direction/--to, record. They mutate the app, so they queue behind another workflow. Inside your own workflow they overlap with other shared work — that is how record captures the set-value calls it is recording — but they still wait behind an earlier DesktopExclusive command of your own workflow, so a click followed by a set-value runs in the order you wrote it. Commands that take the desktop exclusively: invoke, click, drag, hover, scroll --wheel/--wheel-horizontal, touch, pen, focus, send-keys, screenshot.
Common patterns
Read within a specific container
Use --root, --type, and --class-name together or separately on search, get-property, get-value, wait-for, and the commands that act on one selected element (invoke, set-value, click, focus, and so on; not send-keys --target). --type and --class-name work without a selector; commands other than search then need exactly one match, and an ambiguous match lists the first five with their slugs. --root alone is not a query. For set-value, pass "" as the selector. For click, hover, touch, and pen, filters can't be combined with --at or --path. The root must be unique; only its descendants match. wait-for re-resolves it every poll, including when it is initially absent. Type names and literal whole ClassName values ignore case. The only type aliases are TextBox → Edit and TextBlock → Text. See Scoped and typed queries for the full type vocabulary, boundaries, and error behavior.
Discover and interact
Find visible text and click it
Navigate multi-page apps
Choose an exact action in tests
Use --action to avoid automatic pattern and ancestor fallback. Omit it for the existing automatic behavior. With --root, --type, or --class-name, the filters follow the same matching rules as read queries: exactly one element must match inside the selected app/window, or the command fails without acting, and the ancestor fallback is skipped. See the action reference for supported actions, scope, idempotent toggles, and failure recovery, and the JSON envelope for action results.
Disambiguate duplicate elements
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 24 Nov 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/winapp/skills/winapp-ui-automation/SKILL.md
Popularity
- Repository stars
- 1,290
- Repository forks
- 84
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/winappcli/winapp-ui-automation)