cua-driver
Drive a native macOS app via the cua-driver MCP server or CLI — snapshot its AX tree, click/type/scroll by element_index, verify via re-snapshot. Use when the user asks you to operate, drive, automate, or perform a GUI task in a real macOS application on the host (e.g. "open a file in TextEdit", "navigate to /Applications in Finder", "click the Save button in Numbers").
npx skills add ThinkInAIXYZ/deepchat --skill cua-driver --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Orchestrates macOS app automation via cua-driver. When a user requests GUI operations in a real macOS application, it adheres to a snapshot-before-action loop, capturing the AX tree, then clicking, typing, or scrolling by element_index, and verifying by re-snapshot. The skill is used to drive native macOS apps (e.g., TextEdit, Finder, Numbers) and can operate via MCP server or CLI. It emphasizes not changing the user’s frontmost app and uses an invariant where snapshots and visible targets guide actions.
How it works
- Uses cua-driver to perform actions (click, type_text, scroll, etc.) by translating each reference like
click({pid, window_id, x, y})into the corresponding cua-driver command. All mentions ofclick(...),get_window_state(...), etc. map tocua-driverinvocations. - Maintains a frontmost-app rule: do not foreground or activate apps unless explicitly allowed; before any shell command that could activate or bring forward an app, checks and follows the policy outlined in the no-foreground contract.
- Performs a diagnostic self-check before each Bash call touching a macOS app, ensuring the command won’t foreground the target, move the real cursor, or bypass cua-driver.
- Uses a workflow that emphasizes taking an initial AX-tree snapshot, performing a target action by element_index or pixel-based coordinates when necessary, and immediately re-snapshot to verify observable changes.
- Provides prerequisites for running cua-driver: ensuring it is on PATH, permissions granted, and the daemon started (via serve mode). It recommends start commands and status checks to maintain a persistent per-pid element cache for window interactions.
When to use it
Use when the user asks you to operate, drive, automate, or perform a GUI task in a real macOS application on the host (e.g., "open a file in TextEdit", "navigate to /Applications in Finder", "click the Save button in Numbers"). Employs the snapshot-before-action invariant and frontmost-app constraints unless the user explicitly requests foregrounding.
What it can touch
- Commands and tools:
cua-driverwith subcommands likeclick,get_window_state, and other referenced actions translated tocua-driver <tool-name> '<JSON-args>'. - It documents translating
click(...),get_window_state(...), etc. intocua-driverCLI calls and uses per-pid window IDs and element indices for interaction. - Prerequisites mention
cua-driverbeing on PATH and daemon management commands likeopen -n -g -a "DeepChat Computer Use" --args serve, along withcua-driver status.
Caveats
- Enforces the no-foreground contract: many commands that would foreground or activate apps are forbidden unless explicitly asked for by the user.
- Requires a persistent cua-driver daemon; without it, per-invocation caches die and element_index workflows may fail.
- The approach relies on accurate AX trees and visible targets; if snapshots are sparse or invalid, it recommends re-snapshot and fallback to in-window AX or pixel actions.
- Open/activate behaviors and keyboard shortcuts that focus apps are discouraged; only use
launch_appfor startup, notopenforms, and only use activation when the user explicitly requests frontmost state.
# cua-driver Orchestrates macOS app automation via `cua-driver`. Whenever a user asks to drive a native macOS app, follow the loop in this skill rather than calling tools ad-hoc — the snapshot-before-action invariant is not optional and silently breaks if you skip it. ## DeepChat MCP mode When DeepChat auto-pins this skill because the Computer Use MCP server is enabled, use the available Computer Use tools in the current tool list directly. Treat examples such as `click({...})` or `get_window_state({...})` as calls to the matching MCP tool with the same JSON payload. Shell CLI examples are diagnostic references for shell-based agents. App-name resolution belongs here. When matching a user request to an app, compare the request with each `list_apps` name and `bundle_id`. Consider the user's language, system language, English product names, English brand names, romanized or pinyin variants, and common abbreviations. Treat `bundle_id` as the strongest identity signal. When the requested app name is ambiguous, localized, translated, abbreviated, or written in another script, call `list_apps`, resolve the most credible bundle id, then call `launch_app` with that bundle id. ## Sparse vis
- DeepChat MCP mode
- Sparse visible UI fallback
- The no-foreground contract — read this first
- Defaults — always prefer cua-driver over shell shims
- The narrow carve-out
- Self-check pattern
- Prerequisites — check before starting
- Using cua-driver from the shell
- Agent cursor overlay
- The core invariant — snapshot before AND after every action
- Why window selection is the caller's job now
- Behavior matrix
- The canonical loop
- 1. Resolve target pid — always via launchapp
What does the cua-driver skill do?
Drive a native macOS app via the cua-driver MCP server or CLI — snapshot its AX tree, click/type/scroll by element_index, verify via re-snapshot. Use when the user asks you to operate, drive, automate, or perform a GUI task in a real macOS application on the host (e.g. "open a file in TextEdit", "navigate to /Applications in Finder", "click the Save button in Numbers").
How do I install it?
Run `npx skills add ThinkInAIXYZ/deepchat --skill cua-driver --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ThinkInAIXYZ/deepchat, a repository with 6,191 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
