Agent skill

macOS Desktop Control

by OpenLoaf in OpenLoaf/OpenLoaf

Guides an agent to operate native macOS apps by surveying an app first, acting through intents, menus or keystrokes, and verifying each step, in OpenLoaf Desktop only.

AGPL-3.0Auto-check passedProductivity & Automation

Install macOS Desktop Control

skills CLI
$ npx skills add OpenLoaf/OpenLoaf --skill macos-control-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OpenLoaf/OpenLoaf macos-control-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OpenLoaf/OpenLoaf.git skills-src && mkdir -p .claude/skills && cp -r skills-src/apps/server/src/ai/builtin-skills/macos-control/en .claude/skills/macos-control-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
macos-control-skill
GitHub stars
108
Token cost
~2.4k tokens
SKILL.md length
868 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Guides an agent to operate native macOS apps by surveying an app first, acting through intents, menus or keystrokes, and verifying each step, in OpenLoaf Desktop only.

  • Works in 4 steps: Look at Survey's Menu bar section —… → If a menu item has (⌘⇧X), MacosAct… → Last resort: observe the screenshot,… → …
  • Opening a native Mac app and clicking through its interface
  • SKILL.md covers Core mindset: understand…, Tool inventory, Execution priority (Survey… and What a Survey response looks…, plus 7 more sections
  • Reaches github.com

What it does

The core rule is to understand an app before acting on it. The agent calls MacosSurvey for each new app to get a model of its known intents, accessibility tree richness, menu bar and windows, picks a path from the recommended order, then acts with MacosAct and confirms the result with MacosObserve. Skipping the survey is named as the most common failure, especially for self-drawn apps such as WeChat, QQ, Feishu, DingTalk and Teams, where a guessed click can land on the close button.

MacosListWindows and MacosCaptureWindow handle lighter window listing and per-window screenshots, and MacosAct supports intents, launching apps, menu clicks, AppleScript, keys, clicks, typing, scrolling, dragging, waiting and accessibility actions. Recommended paths run from known intents to menu navigation and keyboard shortcuts. The tools exist only in OpenLoaf Desktop on macOS; elsewhere the skill says to fall back to BrowserAct or hand the task back.

When your agent uses it

  • Opening a native Mac app and clicking through its interface
  • Reading what is currently on the screen
  • Filling in a form inside a native window
  • Automating a repeatable local GUI flow

Example prompts

  • “In Finder, open my Downloads folder and tell me what is in it.”
  • “Click Export in the Keynote window and tell me what the dialog shows.”
  • “What's on my screen right now?”

Requirements

  • OpenLoaf Desktop running on macOS

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Look at Survey's Menu bar section — almost every app's menu bar is menu_click-able
  2. If a menu item has (⌘⇧X), MacosAct type="key" is more reliable than click
  3. Last resort: observe the screenshot, then coord click
  4. If none of these work, stop and tell the user "I don't have a safe path for this". Don't guess.

What it can do on your machine

Read from SKILL.md and the folder at commit f7eccf6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

macOS Desktop Control loads about 2.4k tokens when it runs. Until then it costs about 144 tokens; SKILL.md has 868 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~144
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OpenLoaf/OpenLoaf at commit f7eccf6, republished under its AGPL-3.0 licence (© OpenLoaf). 868 words, ~2,430 tokens.

Download SKILL.mdSave it as .claude/skills/macos-control-skill/SKILL.md (or your agent's skills folder).
name
macos-control-skill
description
Triggered when the user asks the AI to directly operate their macOS desktop: open an app, click a button, fill a form inside a native window, read what's currently on screen, automate a local GUI flow. Typical phrasing: "in Finder, please…", "click X in the Y app", "what's on my screen right now". **Available only in OpenLoaf Desktop (macOS)**; other platforms return a desktop-only error — fall back to `BrowserAct` or hand the task back to the user. **Not for**: in-page web interaction (→ `browser-ops-skill`), local file I/O (→ `Read`/`Edit`/`Write`).
tools
MacosSurvey, MacosObserve, MacosAct, MacosListWindows, MacosCaptureWindow

macOS Desktop Control Guide

Core mindset: understand first, then act

Do not see an app and immediately click. When a human opens an unfamiliar app they look around first — they notice which region is business UI, where the close button is, what entry points exist. You have to do the same.

Three-phase framework:

1. Survey    → MacosSurvey(app)  — get a mental model of the app
2. Plan      → pick a path from the "Recommended path order" the survey gives you
3. Act+Verify → MacosAct executes; MacosObserve confirms the result

Skipping Survey and going straight to Act is the single most common failure mode. WeChat / QQ / Feishu / DingTalk / Teams are self-drawn — their AX tree exposes only 3 window chrome buttons (close / min / zoom). A model that guesses path=["0","0"] lands on the red close button and kills the window. Survey will tell you in advance when you're in that trap.

Tool inventory

ToolWhen
MacosSurvey(app)First call for every new app in a session. Returns the mental model: known intents, AX richness, menu bar map, window list, recommended path order. Cached per session × app for 5 minutes.
MacosObserve(appFilter?)Look at the current UI state — screenshot + AX tree + window list. Use after Survey and after every MacosAct to verify the result.
MacosActExecute an action. Supports intent / launch_app / menu_click / applescript / key / click / type / scroll / drag / wait / ax_action.
MacosListWindows(appFilter?)Lighter than Observe — just enumerate windows. Useful when you need a specific window in a multi-window app.
MacosCaptureWindow(windowID)Screenshot a specific window by id; covered / off-screen / minimized windows still capture (Window Server keeps the composition buffer).

All tools are desktop-only. They aren't registered off-macOS; don't try to call them.

Execution priority (Survey tells you this)

MacosSurvey's response contains a Recommended path order section, highest confidence first:

1. Known intents       MacosAct type="intent"         100% confidence
2. Menu navigation     MacosAct type="menu_click"     works on self-drawn apps too
3. Keyboard shortcut   MacosAct type="key"            read the shortcut from the menu tree
4. AX path click       MacosAct type="click" ref=...  only when Survey verdict is ax-rich
5. Coord click         MacosAct type="click" point=... last resort, read pixels off a screenshot

Go down the list in order. Never skip ahead. On apps classified self-drawn, step 4 is off-limits — AX path clicks on window chrome buttons are refused (you'll get WINDOW_CHROME_BLOCKED).

What a Survey response looks like

App: 微信 (WeChat.app) (com.tencent.xinWeChat, pid=86795)

AX profile: self-drawn — AXWindow children are only chrome buttons
  richness: 0.995 (203 nodes)
  windowChildRoles: [AXCloseButton, AXFullScreenButton, AXMinimizeButton]

Known intents (from registry):
  - id: open_moments    — Open Moments feed
  - id: open_chats      — Switch to chats tab
  - id: open_discover   — Open Discover tab
  ...

Menu bar (34 entries with shortcuts, sample):
  - File > Lock WeChat  (⌘L)
  - View > Chats  (⌘1)
  - View > Moments  (⌘⇧4)
  ...

Windows (2):
  - windowID=227474 visible 1060×859 "Weixin"  (main)
  - windowID=260481 hidden 710×831

Recommended path order:
  1. Known intents (highest confidence): MacosAct type="intent" — 5 registered
  2. Menu navigation: MacosAct type="menu_click" — 34 reachable entries
  3. Keyboard shortcut: MacosAct type="key"
  4. AX path click: **DO NOT USE** on this app.
  5. Coordinate click: last resort.

"Known intents" are paths that have been vetted for you. Use them first.

Typical flows

A. Open WeChat Moments
1. MacosAct { type: "launch_app", app: "WeChat" }
2. MacosSurvey { app: "WeChat" }
   → sees Known intents contains open_moments
3. MacosAct { type: "intent", app: "WeChat", intent: "open_moments" }
4. MacosObserve { appFilter: "WeChat" } — verify Moments is showing

Do NOT observe + click AX tree right after launch_app. That's the old path, and it lands on the close button.

B. Open github.com in Safari
1. MacosSurvey { app: "Safari" }
   → Known intents has open_url (requires url arg)
2. MacosAct { type: "intent", app: "Safari", intent: "open_url", args: { url: "https://github.com" } }
3. MacosObserve { appFilter: "Safari" } — verify the page loads
C. Read the screen

User asks "what's on my screen / what's in this app": one MacosObserve call — use the screenshot + AX tree to answer. No Survey, no Act needed.

D. Unregistered intent on an ax-rich app

Survey returns ax-rich but no matching intent. Prefer menu_click or key, then AX path click:

1. MacosSurvey { app: "Finder" } → ax-rich; recommends menu_click / AX path click
2. Want a new Finder window → menu bar shows "File > New Finder Window (⌘N)"
3. MacosAct { type: "key", keys: ["cmd", "n"] } — shortcut beats click
4. MacosObserve to verify
E. Multi-window (WeChat main + image preview)
1. MacosSurvey { app: "WeChat" } → Windows: 2 entries, windowIDs 227474/260481
2. MacosCaptureWindow { windowID: 227474 } — capture the main window directly (even if preview covers it)
3. Subsequent MacosAct click coords are now based on that window's image
F. Native form (AppKit app, ax-rich)
1. MacosObserve { appFilter: "..." } to get the text field ref
2. MacosAct { type: "click", ref: { app, path: [...] } } to focus
3. MacosAct { type: "type", text: "..." }
4. MacosAct { type: "ax_action", ref: { app, path: [submit button] }, action: "AXPress" }
5. MacosObserve to verify

When Survey doesn't have the intent you want

  1. Look at Survey's Menu bar section — almost every app's menu bar is menu_click-able
  2. If a menu item has (⌘⇧X), MacosAct type="key" is more reliable than click
  3. Last resort: observe the screenshot, then coord click
  4. If none of these work, stop and tell the user "I don't have a safe path for this". Don't guess.
Show full SKILL.md (405 more words)Show less

Rules

  1. First contact with an app: Survey first. Skipping Survey is the #1 failure, especially on self-drawn UIs.
  2. Prefer Survey's first-row recommendation (Known intents). Going off-script usually crashes.
  3. Observe after every MacosAct. UI has state; you can't predict the outcome. Exception: after a successful intent / menu_click, if no further action is needed you can skip the verify.
  4. AX path click only on ax-rich apps. mixed = cautious; self-drawn = forbidden — chrome buttons are hard-blocked (WINDOW_CHROME_BLOCKED).
  5. Coord click is last resort. Must follow a recent observe. After two coord clicks with no visible change, stop and say you failed to locate.
  6. Sensitive apps in foreground (password manager / bank / Keychain): stop immediately. Let the user drive.
  7. When permissions are missing: the settings pane was auto-opened. Tell the user (in prose) to enable OpenLoaf there, wait for confirmation. Do not retry.
  8. Non-macOS desktop: return the desktop-only error, switch to BrowserAct or hand back.

Permissions

First call prompts for missing permissions; the server auto-opens the matching System Settings pane. Required:

  • screen — Screen Recording (Survey / Observe / CaptureWindow all need it)
  • accessibility — Accessibility (AX tree + synthetic input)

Some system-level apps need an OpenLoaf Desktop restart after granting.

Coordinate space (when falling back to point)

point.{x,y} refers to pixels on the most recent MacosObserve or MacosCaptureWindow screenshot — read them straight off the image. The tool converts to screen coords automatically; you don't handle retina scale, window offset, or multi-display yourself.

  • The Screenshot: window 2120×1718 px line in observe/capture_window output is the coordinate range
  • You must call observe / capture_window at least once before coord actions; otherwise the tool refuses

Safety & privacy

  • Do not Survey / Observe / Act on password / bank / Keychain apps in the foreground. Hand it back to the user.
  • Screenshots live in the session asset dir and are cleaned with the session. Not uploaded, not trained on.
  • When uncertain about current screen state, observe first. Don't guess.

Error diagnosis

  • permissionsMissing → settings pane already opened, prompt user, wait
  • desktop-only → not running under OpenLoaf Desktop; switch platforms
  • WINDOW_CHROME_BLOCKED → you clicked a chrome button. Pick one of the 4 suggested fallbacks (menu_click / key / coord / URL). Do NOT add confirm_window_chrome:true unless you really do mean to close the window.
  • "intent not found" → call MacosSurvey to list available intents; otherwise degrade to menu_click.
  • Click has no effect → re-observe; check whether the target is really actionable or was covered.
  • Foreground switched mid-flow → observe's app no longer matches act's; key cmd+tab back first.

© OpenLoaf, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in apps/server/src/ai/builtin-skills/macos-control/en of OpenLoaf/OpenLoaf.

Open the folder on GitHubat commit f7eccf6

Compare with similar skills

macOS Desktop Control next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

macOS Desktop Control compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
macOS Desktop Control this skillOpenLoaf/OpenLoaf108—~2.4kAutomated safety check: PassAGPL-3.0
Mac Computer UseTo3akaRin/mac-computer-use1.1k1 repos~495Automated safety check: PassMIT
TreeSheets Agent Socketaardappel/treesheets3.2k—~5.7kAutomated safety check: NotesZlib
Open Computer UseiFurySt/open-codex-computer-use2.4k—~1.5kAutomated safety check: PassMIT
Interceptor BrowserHacker-Valley-Media/Interceptor5171 repos~4.8kAutomated safety check: PassCustom licence
TuriX macOS Desktop AgentTurixAI/TuriX-CUA3.2k—~3.2kAutomated safety check: WarnMIT

Similar skills

  • Mac Computer Use

    To3akaRin/mac-computer-use

    操作 macOS 桌面应用,探测窗口和自动化接口、截图、读取或修改辅助功能元素、执行鼠标键盘动作,以及通过 CDP 操作内嵌 Chromium 页面。适用于桌面应用自动化与界面验收;普通网页任务优先使用已有浏览器工具。

    1.1k GitHub starsUsed in 1 repo~495 tokens
    Productivity & AutomationAuto-check passed
  • TreeSheets Agent Socket

    aardappel/treesheets

    Runs Lobster scripts against the document open in a running TreeSheets instance through its local agent socket, and returns the results or errors.

    3.2k GitHub stars~5.7k tokensUpdated yesterday
    Productivity & AutomationAuto-check: notes
  • Open Computer Use

    iFurySt/open-codex-computer-use

    Platform-neutral guidance for using Open Computer Use, the open-source Computer Use MCP server and CLI for macOS, Linux, and Windows.

    2.4k GitHub stars~1.5k tokensUpdated yesterday
    Productivity & AutomationAuto-check passed
  • Interceptor Browser

    Hacker-Valley-Media/Interceptor

    Drive a signed-in Chrome / Brave / Safari session via the interceptor CLI: open/read pages, click, type, inspect DOM/text/network, automate rich browser editors and scene graphs, capture…

    517 GitHub starsUsed in 1 repo~4.8k tokens
    Productivity & AutomationAuto-check passed
  • TuriX macOS Desktop Agent

    TurixAI/TuriX-CUA

    Controls the macOS desktop visually through the TuriX computer-use agent, for opening apps, clicking buttons and navigating interfaces that have no CLI or API.

    3.2k GitHub stars~3.2k tokensUpdated 24 days ago
    Productivity & AutomationAuto-check: warnings
  • Shortcuts Generator

    drewocarr/generate-shortcuts-skill

    Generate macOS/iOS Shortcuts by creating plist files. An agent skill from drewocarr/generate-shortcuts-skill.

    217 GitHub starsUsed in 1 repo~2k tokens
    Productivity & AutomationAuto-check: notes

More from OpenLoaf/OpenLoaf

All 33 skills in this repo
  • Agent Orchestration Skill

    OpenLoaf/OpenLoaf

    Triggers when the master Agent faces a multi-step complex task and is deciding whether / how to outsource sub-tasks to built-in subagents (browser / doc-editor / data-analyst / extractor /…

    108 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Browser Ops Skill

    OpenLoaf/OpenLoaf

    Triggered when the user asks for page-level interaction with a specific webpage: login, form filling, button clicks, pagination scraping, screenshots, downloading page images, handling CAPTCHAs or…

    108 GitHub stars~1.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Canvas Ops Skill

    OpenLoaf/OpenLoaf

    Triggered when the user wants lifecycle management of OpenLoaf canvases / whiteboards: create, open, filter, duplicate, delete, rename, or change ownership.

    108 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Reads, edits, converts and reviews Word documents through three dedicated tools, covering tracked changes, comments, tables, images and format conversion.

    108 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Email Operations

    OpenLoaf/OpenLoaf

    Handles a real email account through query and mutate tools: check the inbox, read, search, reply, forward, compose and organize, with sending always confirmed first.

    108 GitHub stars~1.8k tokensUpdated 4 mo ago
    Auto-check passed
  • PDF Skill

    OpenLoaf/OpenLoaf

    All-in-one PDF read / write / convert / OCR. An agent skill from OpenLoaf/OpenLoaf.

    108 GitHub stars~2k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Questions about macOS Desktop Control

What does macOS Desktop Control do?

Guides an agent to operate native macOS apps by surveying an app first, acting through intents, menus or keystrokes, and verifying each step, in OpenLoaf Desktop only. The core rule is to understand an app before acting on it. The agent calls MacosSurvey for each new app to get a model of its known intents, accessibility tree richness, menu bar and windows, picks a path from the recommended order, then acts with MacosAct and confirms the result with MacosObserve.

When should I use macOS Desktop Control?

macOS Desktop Control fits situations like: opening a native Mac app and clicking through its interface; reading what is currently on the screen; filling in a form inside a native window; automating a repeatable local GUI flow.

How do I install macOS Desktop Control in Claude Code?

Run `npx skills add OpenLoaf/OpenLoaf --skill macos-control-skill -a claude-code`. Or copy the skill folder (apps/server/src/ai/builtin-skills/macos-control/en in OpenLoaf/OpenLoaf) into .claude/skills/macos-control-skill in your project. Claude Code loads it when a task matches its description.

How do I install macOS Desktop Control in Codex?

Run `npx skills add OpenLoaf/OpenLoaf --skill macos-control-skill -a codex`. Or copy the skill folder (apps/server/src/ai/builtin-skills/macos-control/en in OpenLoaf/OpenLoaf) into .agents/skills/macos-control-skill in your project. Codex loads it when a task matches its description.

Can I use macOS Desktop Control in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OpenLoaf/OpenLoaf --skill macos-control-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/macos-control-skill, .gemini/skills/macos-control-skill, .github/skills/macos-control-skill and .opencode/skills/macos-control-skill in your project.

What does macOS Desktop Control need to run?

SKILL.md names no scripts, command-line tools or credentials: macOS Desktop Control is instructions for the agent only. Our summary lists: OpenLoaf Desktop running on macOS.

Does macOS Desktop Control access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is macOS Desktop Control safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does macOS Desktop Control use?

macOS Desktop Control is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does macOS Desktop Control use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to macOS Desktop Control?

Skills that share tags, products or a category with macOS Desktop Control: Mac Computer Use (To3akaRin/mac-computer-use, 1.1k stars), TreeSheets Agent Socket (aardappel/treesheets, 3.2k stars), Open Computer Use (iFurySt/open-codex-computer-use, 2.4k stars) and Interceptor Browser (Hacker-Valley-Media/Interceptor, 517 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains macOS Desktop Control?

OpenLoaf (a GitHub organization) maintains it in OpenLoaf/OpenLoaf, which has 108 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on May 14, 2026.

Source: OpenLoaf/OpenLoaf on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.