agentleFS
wendewende/macbeth/skills/Safari/SKILL.md

safari

Skill4 starsChanged 4 months agoMITView on GitHub

Navigate, search, click links, read content, and manage tabs in Safari

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Panchangam18/background-computer-use★ 4same name
    2. jootsing-research/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository13 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always connect with: connect_app({ name: "Safari" })

    line 10
  2. Very specific:

    Use index to disambiguate when multiple elements match:

    line 75
  3. Very specific:

    Use select_menu_item instead of press_key — it doesn't steal focus.

    line 90
  4. Very specific:

    Use get_element to read specific text values

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Safari Automation

Connect

Always connect with: connect_app({ name: "Safari" })

Key Concepts

Safari's AX tree has two main areas:

  1. Chrome (toolbar, tabs, menus) — native macOS UI elements
  2. Web content — a web_area element containing the page's DOM-like accessibility tree (headings, links, groups, text, lists, tables, etc.)

Navigation

Navigate to a URL — fill on the address bar sets the AX value but does NOT trigger navigation. Use open via shell instead:

open -a Safari "https://example.com"

Or with the macbeth SDK:

import { execSync } from "node:child_process";
execSync('open -a Safari "https://example.com"');

Read current URL:

{ "query": [
    { "role": "window" },
    { "role": "toolbar" },
    { "role": "text_field", "identifier": "WEB_BROWSER_ADDRESS_AND_SEARCH_FIELD" }
]}

The value field contains the current URL.

Back / Forward: Click the toolbar buttons:

{ "query": [{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "BackButton" }] }
{ "query": [{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "ForwardButton" }] }

Reload: select_menu_item({ app: "Safari", menuPath: ["View", "Reload Page"] }) or click ReloadButton

Common Queries

Toolbar Buttons

ElementQuery
Address bar[{ "role": "window" }, { "role": "toolbar" }, { "role": "text_field", "identifier": "WEB_BROWSER_ADDRESS_AND_SEARCH_FIELD" }]
Back[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "BackButton" }]
Forward[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "ForwardButton" }]
Reload[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "ReloadButton" }]
New Tab[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "NewTabButton" }]
Share[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "ShareButton" }]
Sidebar[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "SidebarButton" }]
Tab Overview[{ "role": "window" }, { "role": "toolbar" }, { "role": "button", "identifier": "TabOverviewButton" }]

Web Content

Queries use recursive descent — you don't need to specify every intermediate container. Just scope to web_area and target the element directly:

  • Click a link: [{ "role": "window" }, { "role": "web_area" }, { "role": "link", "title": "Sign in" }]
  • Click a link by pattern: [{ "role": "window" }, { "role": "web_area" }, { "role": "link", "titlePattern": "Learn.*more" }]
  • Read a heading: [{ "role": "window" }, { "role": "web_area" }, { "role": "heading", "title": "Example Domain" }]
  • Find a text field: [{ "role": "window" }, { "role": "web_area" }, { "role": "text_field" }]
  • Find a button: [{ "role": "window" }, { "role": "web_area" }, { "role": "button", "title": "Submit" }]

Use index to disambiguate when multiple elements match:

[{ "role": "window" }, { "role": "web_area" }, { "role": "link", "titlePattern": "comments", "index": 2 }]

Tabs

Tabs are radio elements inside an opaqueprovidergroup (TabBar):

[{ "role": "window" }, { "role": "opaqueprovidergroup" }, { "role": "radio", "title": "Example Domain" }]
  • Active tab has value: "1", inactive tabs have value: "0"
  • Each tab has a close button child

Menu Actions

Use select_menu_item instead of press_key — it doesn't steal focus.

ActionMenu path
New tab["File", "New Tab"]
Close tab["File", "Close Tab"]
New window["File", "New Window"]
New private window["File", "New Private Window"]
Find on page["Edit", "Find", "Find…"]
Back["History", "Back"]
Forward["History", "Forward"]
Reopen closed tab["History", "Reopen Last Closed Tab"]
Show all history["History", "Show All History"]
Reload["View", "Reload Page"]
Zoom in["View", "Zoom In"]
Zoom out["View", "Zoom Out"]
Actual size["View", "Actual Size"]
Next tab["Window", "Show Next Tab"]
Previous tab["Window", "Show Previous Tab"]

Gotchas

  1. Address bar click fails — Safari's address bar does not support AXPress. Use fill to set its value, or open -a Safari <url> to navigate.
  2. fill on address bar doesn't navigate — It sets the AX value but Safari ignores it for navigation. Use open -a Safari <url> instead.
  3. query_tree on web pages can be huge — Use maxDepth: 4-5 to keep output manageable. For the web content area specifically, the DOM adds several levels of nesting.
  4. Page load timing — After navigation, use wait_for on a known page element to confirm the page has loaded before interacting.

Workflows

Navigate and Read Page Content

  1. open -a Safari "https://example.com" (shell)
  2. wait_for a known element on the target page
  3. query_tree with maxDepth: 6-8 to see the page structure
  4. Use get_element to read specific text values

Fill and Submit a Form

  1. Navigate to the page
  2. query_tree to find form fields
  3. fill each text field (web form fields DO support fill, unlike the address bar)
  4. click the submit button

Switch Tabs

  1. Click a tab by title: [{ "role": "window" }, { "role": "opaqueprovidergroup" }, { "role": "radio", "title": "Tab Title" }]
  2. Or via menu: select_menu_item({ app: "Safari", menuPath: ["Window", "Show Next Tab"] })

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.