LaunchKit · 2026
Back to Skills

desktop-guardian

macOS GUI automation and desktop control for OpenClaw, powered by Hammerspoon.

0
377 downloads
by @s3rous

Setup & Installation

openclaw skills install @s3rous/desktop-guardian

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install desktop-guardian

What This Skill Does

Desktop Guardian gives OpenClaw agents full access to the macOS GUI via Hammerspoon. It can query windows, close tabs, click dialog buttons, and send keypresses to any app. An always-on monitor watches for system dialogs, permission prompts, and unauthorized apps, auto-dismissing safe ones and alerting when human input is needed.

Unlike AppleScript or headless shell automation, it monitors desktop state continuously and intercepts macOS permission prompts before they stall an agent mid-task, with configurable safety guardrails that prevent clicking destructive buttons.

When to use it

  • Auto-dismissing 'app downloaded from internet' popups during software installs
  • Closing excess Chrome tabs when a browser window limit is exceeded
  • Detecting and quitting apps not on the approved whitelist
  • Alerting when a security prompt requires manual approval
  • Clicking OK on system dialogs without switching focus from another task

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: Close all Chrome tabs not related to my current project and tell me what was closed

AGENT
  1. 1Connects to Chrome via Chrome DevTools Protocol on port 9222
  2. 2Retrieves all open tabs with their URLs and titles
  3. 3Compares each tab against allowed domains defined in policy.yaml
  4. 4Closes non-matching tabs using CDP commands
  5. 5Logs each closed tab to the audit trail and returns a summary
OUTPUT

Closed 4 tabs (reddit.com, youtube.com, twitter.com, news.ycombinator.com); audit log updated

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

macOS Accessibility permission granted to Hammerspoon in System Settings