Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ace Computer Use?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/arpan404-ace-computer-use)
---
name: ace-computer-use
description: Drive a native app, iOS simulator or Android emulator the person names. Use before screen_*, sim_*.
---
# Native apps and simulators in ace
ace works in Mac apps in the background through the accessibility API: apps open without coming forward, and your clicks and keys go to the app, not to the person's cursor or keyboard. They can keep working while you do. On Linux the same tools read apps through AT-SPI accessibility; see "On Linux" below. The person turns the `screen` (desktop apps) and `devices` (simulators) groups on in ace's Settings; `context` says which are on. If `screen_disabled` comes back, tell the person.
Websites belong in ace's browser (`browser_open`, guide ace-browser). Files and data belong to your shell. Never drive app UI with `osascript` or AppleScript.
If the person explicitly asks for a native screenshot of an already-open browser window, such as Brave, use `screen_state {app, screenshot: true, outline: false}` when Computer Use is authorized. The direct browser connection is optional for this request. Use `screen_apps` to check that the app is running if needed, and pass `window` when the person names a window. If the window is closed or native capture is blocked, report what stopped you. Leave closed apps and windows closed.
## A desktop app (screen_*)
1. `screen_state {app}` opens the app if needed and returns its window as an outline. `app` is a name or bundle id; `screen_apps {query}` finds the exact one.
2. `screen_act {app, actions}` runs up to 20 steps in order, then returns what changed. Batch steps that need no look in between.
3. Read the result, then act again. Call `screen_state` only when you need a fresh look without acting.
The outline has one line per element, indented by nesting:
```
4 standard window Untitled
12 text area (focused), Value: Dear Ada,
15 pop up button (collapsed) Format, Value: Plain text
16 button Save
```
Ids stay the same between looks, so later results are a diff: `+` lines are new, `~` lines changed, unmarked lines are context, `Removed: 3-5` lists ids that are gone. "No change since your last look." means the action had no visible effect. Pass `full: true` to get the whole outline again. A `Windows` line lists the app's windows; pass `window` (its number, or part of its title) to look at another.
### Choosing an action
- **Click by id**: `{"type":"click","id":15}`. It presses the element directly, even when the window is covered or on another Space. `count: 2` double-clicks; `button: "right"` opens the context menu, `"middle"` middle-clicks; `modifiers: ["cmd"]` ⌘-clicks (also `shift`, `alt`, `ctrl`, `fn`); `hold_ms` long-presses.
- **Click by x,y** only for things missing from the outline (canvases, images). The coordinates are pixels of the latest screenshot of that window, nothing else; take a new one after the window changes.
- **Hover**: `{"type":"move","id":15}` posts a move to that window. Effects that depend on the real pointer, such as some tooltips, may not appear.
- **Fields**: `set_value` replaces a field's whole value in one step and is the most reliable. `type` types at the caret, like a keyboard, for apps that react to keystrokes (search-as-you-type, chat boxes); give it an `id` to focus that field first. `select_text` selects a passage (`prefix` or `suffix` tell repeats apart), or with `cursor` places the caret before or after it, so the next `type` edits in place.
- **Long or formatted text**: `{"type":"paste","text":"…","format":"markdown"}` keeps headings, lists, bold and links (`html` works too). The person's clipboard is put back afterwards. In a background app rich paste may land as plain text; the result says so.
- **Keys**: `{"type":"key","key":"cmd+s"}`, `"Return"`, `"Escape"`, `"Down"` with `repeat`, `hold_ms` to hold, `id` to focus first. In a background app, ⌘ shortcuts run their menu item, and ⌘A/⌘C/⌘X/⌘V edit the focused text directly. After you copy, the result quotes what was copied.
- **Menus**: `{"type":"menu","path":["File","Export…"]}` runs a menu command without opening the menu. Prefer it to shortcuts when you know the path; the `Menu bar:` line of a full outline names the top-level menus.
- **Windows**: `{"type":"window","op":"resize","width":900,"height":600}`; also `close`, `minimize`, `restore`, `zoom`, `fullscreen`, `raise` and `move` (`x`, `y` in screen points). It acts on the window you looked at.
- **Other**: `scroll` (an id or a point, `direction`, and `pages` or `pixels`), `scroll_to {id}` to bring an element into view, `action` for an element's listed `Actions`, `focus`, `drag` (`from` and `to` as `[x, y]` or `{"id": n}`, with `modifiers`), `wait`.
### Fewer round trips
Batch consecutive actions into one `screen_act`, up to 20 steps. Read once after the batch, rather than after every click or field. Use `wait_for` at a dependency such as navigation or a dialog, and `if` for an optional branch:
- `{"type":"wait_for","text":"Saved"}` waits until that text appears (`gone: true`: until it goes, `id` for an element), up to `timeout_ms` (default 5000), instead of looking again.
- An `if` step runs the next steps only if the element is there now, so one batch can handle a dialog that may or may not show: `{"type":"if","text":"Replace"},{"type":"click","id":31}`. `steps: 2` guards two steps; `gone: true` inverts it. Skipped steps are listed as skipped, not failed.
- `observe: false` on `screen_act` skips the look afterwards when your next call looks anyway. `screen_state {app, outline: false, screenshot: true}` is the fastest look when only the picture matters.
Add `screenshot: true` to `screen_state` or `screen_act` when the outline does not show what you need: layout, images, colours, or a canvas you must click into. The image is the window alone, with each clickable element tagged by its outline id, so you can click by id what you found by sight. In a large window, `screen_state {app, find: "Invoice"}` lists only matching elements with their parents. "<App> is not responding" means the app is busy: the outline may be partial, so wait or look again.
### The whole screen
`screen_display` returns a picture of every display, with each display's name and size; `display: 2` pictures one. Use it when the person wants to see their screen, not an app: the shell's `screencapture` fails, because macOS gives Screen Recording to ace's helper, not to your shell. Apps computer use refuses are left out of the pictures, and the result names them. The pictures are view only: to act, look at the app with `screen_state`. macOS only.
If your call is stopped, the batch stops at its next step; work already done stays done, so look before you retry.
The person can watch: on a visible window a small marker shows where you act, and pressing Esc while you act stops you. `stopped_by_person` means stop and ask how to continue; `person_active` means the current control conflicts with their input. Prefer another element or window; brief conflicts are waited out inside the batch. Work in a different field using its element id to preserve their caret.
### When background input does not work
Use `set_value`, `paste`, element actions and menu paths when a posted key or click has no effect. Observe again before retrying; Electron's accessibility tree can take a moment to load. Windows on other Spaces receive events addressed to that window, without switching Spaces. Minimized windows need `window {op: restore}` for pointer input.
In a shared window or tab, target fields by id with `set_value`, `type` or `paste`. The helper preserves the person's caret and refuses commands that would use their first responder. Another tab's hidden page content may not be accessible until that tab is selected; changing the selected tab also changes what the person sees.
Keep the person's focus where it is. `activate` brings the app forward and interrupts their work; use it only when the person explicitly wants foreground control. If background alternatives fail, report the unsupported action.
While the Mac is locked, only controls still exposed through accessibility can work. If `screen_locked` reports missing controls, stop retrying those ids and use browser or non-GUI tools where available. Do not open replacement windows. Screenshots, posted input and `activate` are unavailable. If the person has turned on locked computer use and the component is installed and verified, an approved turn's `screen_state` and `screen_act` may briefly run on a locked Mac behind opaque covers; the person's input ends that at once and the Mac locks again afterwards. Otherwise locked use stays refused with `screen_locked` or `session_unavailable`, and a failed unlock leaves the Mac locked with an error: do not retry it in a loop. After unlock, observe again before acting. `session_unavailable` means the GUI session cannot be used; wait for it to return and observe again.
### On Linux
- `app` is the desktop-file id (`org.gnome.TextEditor`, a Flatpak app id) or the app's name; `screen_apps` shows both.
- Everything goes through accessibility with the window in the background: clicks by id or at screenshot x,y (the element there), `set_value`, `type` into a field, `select_text`, `action`, menus, scrolling, shortcuts the app's menus list (`ctrl+s` presses File › Save), copy/cut/paste in text and Tab between controls.
- Hover and drags can't be sent (Wayland lets no program send pointer input to another app).
- Chrome, VS Code, Slack and other Chromium or Electron apps take no typing in the background, and some keys have no accessible equivalent. When the person wants that done, put `activate` first in the same batch: the app comes forward and the text and keys go through the keyboard, in front, taking the person's focus (GNOME and KDE; Hyprland has no way to do it). The first time, the person allows the keyboard in a dialog (`keyboard_not_allowed` says so; try again once they have). Typing stops with `focus_changed` if another window gets the focus, and waits with `person_active` while the person is typing. Prefer background steps; for web pages use ace's browser.
- Shortcuts use `ctrl` (`ctrl+s`), not `cmd`.
- While you act, a notification tells the person "ace is using <app>" that they can click (or press its Stop) to stop you. `stopped_by_person` means they did: stop and ask how to continue. `person_active` means they are using that control right now: pick another element or wait.
- `app_inaccessible`, or a note that an app shows only its window, means it was started before accessibility was on (Firefox) or without it (Chrome, VS Code and other Chromium apps): ask the person to quit it; `screen_state` then reopens it so you can see it.
- "No graphical session" means nobody is logged in to a desktop ace can reach: ask the person to log in. An X11 session is refused: ask them to log in to a Wayland session.
### Limits
- Password managers, system authentication prompts (polkit, pinentry), terminals, Script Editor, Automator, Shortcuts, ace itself and any app the person has listed are refused. Ask the person to do those steps, use your shell for commands, and never look for another way into a refused app.
- Ask the person before anything irreversible they did not ask for in so many words: sending a message or email, posting, buying, deleting, changing system settings. Read back what you will send.
- When this machine has no screen helper for the background tools, ace offers the older session tools instead: `screen_open_app {bundleId}` returns a `sessionId` (omit it later while you control one app) and the app's windows (`screen_windows` lists them; pass `windowId` to switch). Read with `screen_ui_tree`, act with `screen_ui_act` on a ref or a `menu` path, and fall back to `screen_input` (points are screenshot pixels divided by the screenshot's scale). `mode: "foreground"` takes the real cursor and keyboard: use it only when the app ignores background input; without `mode` a session keeps its current one. `screen_measure` reports latency, settle time, FPS and hitch time per second, at most 10 s per run.
### On Windows
- Clicks by id, `set_value`, `select_text`, typing into fields, menus, menu shortcuts and `window` steps work with the window in the background.
- Other shortcuts, x,y clicks on things missing from the outline, hover and drags need the window in front: start the batch with `activate`, which interrupts the person.
- Shortcuts use `ctrl` (`ctrl+s`); `cmd` means `ctrl`.
## Simulators and emulators (sim_*)
sim_* drives the iOS simulators and Android emulators on this machine. Paired machines are different: reach them with `machines` and `delegate`.
1. `sim_list` shows simIds and status.
2. `sim_start` takes one for this thread, boots it if needed and starts capture. It is refused while a person or another agent holds it.
3. Read with `sim_ui` (pass `role`, `name` or `text` to find). Actionable elements carry refs like `@e3`. Act on a ref: `sim_act` with `action: "tap"` and `ref`, `"type"` with `ref` and `text`, or `"ui"` with a `uiAction`. Points (`x`, `y`, in screen points: screenshot pixels divided by its scale), `swipe` and `key` are the fallbacks; `type` without a ref types into the focused field. `open_app` (a bundle id or Android package), `open_url`, `install` (a Simulator-built `.app` or an `.apk`) and `record_start` / `record_stop` (a recording attached to the thread) cover apps and recordings; `clipboard_get` / `clipboard_set` read and set the clipboard without pasting.
- Keys: `recents` is Android's app overview; `action` is the iPhone Action button (iPhone 15 Pro and later); `side` is Apple Watch's side button and `home` presses its Digital Crown; `keyboard` brings back the on-screen keyboard (iOS toggles it; Android shows Gboard).
- `posture` folds a foldable simulator or emulator (iPhone Duo, Pixel Fold): `closed` (cover screen), `partiallyOpen` (half open, like a book) or `open` (flat, inner screen). `sim_start` reports the current posture.
4. `sim_screenshot` for a visual check, with or without the live view; `sim_logs` for a log tail.
5. `sim_stop` when you finish, so the person and other threads can use it.
`stale_ref` means the element has gone: read again; `lease_required` means call `sim_start` again, or wait while the person holds it. From a shell, `ace sim …` runs the same tools with the same refs and knows your thread from `ACE_THREAD_ID` (pass `--thread` where it isn't set). It prints short text; add `--json` to parse it. Exit 2 means a person holds the device (`ace sim --help`, `ace help sim act`).