All skills
simota avatar

/hearth

@16a3f28
by shingo imotasimota/agent-skills85 stars
15

Generating and auditing personal dev environment configs (zsh/tmux/neovim/ghostty) and automating the macOS desktop via AppleScript/JXA (Finder, Mail, Safari). Use for dotfiles or Apple Events.

Use this Skill: https://skilld.dev/gh/simota/agent-skills/hearth

This session only. Nothing lands on disk.

referenceui-scripting.md

≈676 tokens on demand. Your agent reads this file only when SKILL.md points to it.

UI (GUI) Scripting

Last resort for apps with no/partial AppleScript dictionary. Simulates clicks and keystrokes via the System Events Processes Suite over the macOS Accessibility framework.

When (and when not) to use

  • ✅ App exposes no scriptable term for the action you need.
  • ✅ A one-off menu/button action that has no dictionary equivalent.
  • ❌ A dictionary term exists — always prefer it (UI scripting breaks on layout/locale changes, window state, and OS updates).

Prerequisite: Accessibility permission

UI scripting is disabled by default. The controlling process (e.g., Terminal, Script Editor, or the app running osascript) must be added to System Settings → Privacy & Security → Accessibility (admin auth required). Without it, calls fail.

-- Guarded check before UI scripting
tell application "System Events"
    if not (UI elements enabled) then
        return "Enable Accessibility for this app in System Settings > Privacy & Security > Accessibility."
    end if
end tell

⚠️ On Ventura and later, UI elements enabled reflects the legacy global switch; per-bundle Accessibility grants may still block UI scripting even when it returns true. Treat it as a hint, not a guarantee — wrap actual UI calls in try … on error and surface the error code as the authoritative diagnostic.

Core patterns

tell application "TextEdit" to activate
tell application "System Events"
    tell process "TextEdit"
        -- Click a menu item by path
        click menu item "New" of menu "File" of menu bar 1
        -- Keystroke + modifiers
        keystroke "s" using {command down}
        -- Target a button in the frontmost window
        click button "Save" of sheet 1 of window 1
        -- Read UI to assert state before acting
        set winTitle to title of window 1
    end tell
end tell

Reliability rules

  1. Activate first. UI scripting acts on the frontmost app — activate the target, and add a short settle delay only if needed (delay 0.2), not blind long sleeps.
  2. Query before you click. Read exists, title, or value to confirm the element is present rather than clicking by blind coordinates.
  3. Avoid hardcoded coordinates. Reference elements by role/name/index, never screen pixels.
  4. Localize-aware. Menu/button names differ by system language — parameterize or detect them.
  5. Inspect the hierarchy. Use Accessibility Inspector (Xcode) or entire contents of window 1 to discover element paths.
-- Discover element structure
tell application "System Events" to tell process "Safari"
    entire contents of window 1
end tell

Source: SKILL.md on GitHub

2 warnings5mo5 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    Hearth is a personal environment management skill designed to configure and optimize developer dotfiles for shells, terminals, and editors. It emphasizes security best practices, including secret detection with Gitleaks and adherence to XDG Base Directory standards. The skill utilizes industry-standard tools and fetches dependencies from trusted or well-known open-source repositories.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: MEDIUM · 2 issues

  • Runlayer6mo

    4/10 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 16a3f28. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last month

README badge

README badge for simota/agent-skills/hearth