macOS Native App Control & Evidence / Agent Skill

Huashu Mac Use:
Read silently in the background, write without stealing focus, prove every step.

A macOS computer-use Agent Skill with a compiled Swift core, CDP bridge, and agent-desktop collaboration. Probes each app’s real architecture first, keeps reads completely in the background, guards physical input behind four safety gates, and captures verifiable window evidence.

Author: · MIT License · Verified against repository on

What Huashu Mac Use helps you ship.

Step-0 App Probing & 4-Layer Channel Selection

Run probe.sh to inspect bundle architecture, CLI/AppleScript/URL schemes, embedded Chromium CDP ports, and AX trees—always picking the highest-reliability channel first.

Headless Control via agent-desktop & Cross-Space CDP

Delegate same-space UI control to Vercel Labs’ agent-desktop (~0.1s per headless ref click) while handling cross-space Chromium apps via cdp.js and background window capture via mac shot.

Four Focus-Safety Gates & Invisible HUD

Guard physical writes with foreground, occlusion, presence (waits if you moved keyboard/mouse within 2s), and lock gates—flashing a capture-invisible corner HUD and returning focus in ~0.5s.

Effect Verification & Continuous App Profiles

Never trust 'clicked' alone: verify state via readback, UI indicators, and side effects, then feed verified lessons back into code or per-app profiles.

Quick Start

Compile the Swift core and probe one native Mac app.

npx skills add alchaincyf/huashu-mac-use

macOS only. Requires Xcode Command Line Tools (to compile scripts/mac.swift in ~20s), Screen Recording & Accessibility permissions granted to your terminal app, Node.js for CDP, and recommended npm install -g agent-desktop.

  1. 1. Install, compile, and grant terminal permissions

    Install the skill, run scripts/build.sh once, install agent-desktop globally (recommended), and grant Screen Recording plus Accessibility permissions to your active terminal app.

  2. 2. Run probe.sh before touching any UI

    Run bash scripts/probe.sh <AppName> to see whether the app exposes CLI/AppleScript, embedded Chromium CDP, or Accessibility controls.

  3. 3. Execute reads silently and writes behind safety gates

    Capture background window screenshots with mac shot, use agent-desktop or cdp.js for zero-focus interaction, and respect built-in hard stops for irreversible actions.

Copy-and-paste first prompt

Use huashu-mac-use to probe [insert macOS app name, e.g. System Settings or Blender] via scripts/probe.sh. Tell me its architecture, whether it is on the current Space, whether agent-desktop or CDP can read it headlessly, and take one background window screenshot without stealing my focus.

Real references and examples from the repo.

Frequently asked questions.

Should I use huashu-mac-use or huashu-chrome for web browsers?

Always use huashu-chrome for browsers. huashu-mac-use’s stop line explicitly hands all browser tabs to huashu-chrome and focuses on native macOS apps and embedded desktop clients.

Is installing agent-desktop mandatory?

Recommended, not mandatory. With npm install -g agent-desktop, same-space UI control is much faster and richer; without it, huashu-mac-use falls back to its own Swift AX and coordinate kernel.

Why does cross-Space coordinate clicking return exit code 2?

macOS Accessibility does not expose windows on other Spaces, so synthetic clicks would hit the wrong desktop. The kernel refuses cross-Space coordinate writes (exit code 2, never treated as success) and routes through CDP or asks you to move the window.

Will it steal my cursor while I am typing?

No. Reads stay completely in the background, and focus-borrowing writes check user idle time first—waiting up to 15 seconds if you used the keyboard or mouse within 2 seconds, then refusing instead of interrupting.

What actions are strictly off-limits?

Publishing, payments, destructive deletes, overwrite saves, hitting Enter in terminals/IDEs, system file dialogs, TCC/Keychain/Touch ID prompts, and banking/medical/government apps are always handed back to the user.

Primary sources

Verified on . Capabilities and install commands follow the public repository; check GitHub for the latest changes.