macwright: Skill for Claude Code

.claude/macwright-skills/skills/macwright-patterns/SKILL.md

macwright-patterns is a skill for Claude Code from ruchit-p/macwright. It costs 93 tokens per session (2,879 once invoked), scanned A, original, MIT.

A set of patterns for using MacWright, an automation tool for controlling macOS applications and Safari. It explains which action to choose and how to confirm that it worked.

In plain words
What is it for?
Use it to plan automation, choose tools for browser actions, fill forms, inspect the screen, chain actions with waits and screenshots, and debug interactions.
Why use it?
It reduces failed clicks, unreliable scrolling, and unnecessary steps when automating a Mac workflow.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is ruchit-p/macwright's own configuration. It tells Claude Code how to work on macwright itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything macwright configures →

Part of the macwright-skills plugin — 3 skills shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to ruchit-p/macwright. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ruchit-p/macwright/master/.claude/macwright-skills/skills/macwright-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ruchit-p/macwright

Made for: Claude Code.

Or install macwright-skills, the plugin that ships this one along with the rest of its 3 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for macwright-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ruchit-p/macwright/macwright-patterns/github.svg)](https://agentmods.dev/skills/ruchit-p/macwright/macwright-patterns)
Your own site
<a href="https://agentmods.dev/skills/ruchit-p/macwright/macwright-patterns"><img src="https://agentmods.dev/badge/skills/ruchit-p/macwright/macwright-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for macwright-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/ruchit-p/macwright/macwright-patterns"><img src="https://agentmods.dev/badge/skills/ruchit-p/macwright/macwright-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,879 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00093 $0.02879
Opus 5.5 $0.00037 $0.01152
Sonnet 5.5 $0.00019 $0.00576
Haiku 4.5 $0.00009 $0.00288

Measured 1mo ago against content hash 63ecd91b7c17, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

macwright-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/macwright-skills/skills/macwright-patterns/SKILL.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MacWright Automation Patterns

Patterns and pitfalls discovered from iterative testing of all 24 macwright tools.

Wait+Screenshot Chaining

Most action tools accept optional wait (ms) and screenshot (bool) params:

click(x: 500, y: 300, wait: 500, screenshot: true)
→ clicks, waits 500ms, returns screenshot

This collapses 3 tool calls into 1. Use it to verify actions immediately.

Tool Selection Guide

Task Best Tool Notes
Navigate Safari safari_url Never click address bar
Manage Safari tabs safari_tabs list/new/close/select actions
Fill web form fill_form Multi-field, dispatches input/change events, supports textarea
Click web element click_element CSS selector → scrolls into view → click in one step
Click by visible text click_text("Submit") No CSS selector — finds by text, picks most specific match
Hover over element hover_element CSS selector → moves mouse over it (triggers :hover, dropdowns)
Get web element coords find_element When you need coords without clicking
Find all matching elements find_element(all: true) Returns array of coords + text
Screenshot a DOM element screenshot_element Scrolls into view, captures region
Wait for DOM element wait_for_element After navigation/AJAX
Scroll web page (relative) scroll_page(y: 500) Focus-free, returns position
Scroll web page (absolute) scroll_page(y: 0, absolute: true) Jump to exact position (e.g. top)
Scroll overflow div element scroll_element(selector, y: 200) Scroll a specific DOM container
Scroll native app scroll + focus_window first App must be frontmost
Type ASCII type_text Direct AppleScript
Type emoji/Unicode type_text Auto-detects, uses clipboard
Type with autocomplete type_text(slowly: true) 50ms delay per char, triggers keystroke handlers
Run shell command run_shell Returns stdout/stderr; exit code in text, only timeout = isError
Process data with jq run_shell(command: "jq ...") jq available at /usr/bin/jq
Process data with python run_shell(command: "python3 -c ...") [email protected] available
Reload Safari page safari_reload Faster than Cmd+R
Check what's visible screenshot(x,y,width,height) Region param for focused view
Find app state get_frontmost_app Returns bounds too
List all windows list_windows JSON array of apps+bounds
Dismiss menus press_key(key: "esc") Works for context menus too
Window positioning resize_window Set exact x,y,width,height
Current page info get_page_info() URL, title, readyState in one call
Discover form fields get_form_fields() All inputs/selects/buttons with types/names
Extract all links get_links(filter: '/blog') Links with text+href, filterable by URL
Scroll to element scroll_to_element(selector) scrollIntoView with alignment
Focus element focus_element(selector) Trigger focus event (no click)
Navigate forward safari_navigate_forward History.forward()
Wait for condition wait_for_function(expr) Most flexible wait — any JS expression
Wait for text wait_for_text("Success") Page body textContent check
Wait for URL wait_for_url("/dashboard") URL contains pattern

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 236 lines · 93 tokens per session scan A 63ecd91b7c17

Subscribe to this mod's changes

macwright-patterns is a skill published in the GitHub repository ruchit-p/macwright (0 stars, last pushed 2mo ago), licensed MIT. It adds 93 tokens to every session and 2,879 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

macos-harness

Read and operate the apps on this Mac from the shell. Use it when a task needs an app's UI and no API, CLI or purpose-built tool can do it.

browser-use/macos-harness · 40 tokens

computer-use

A set of rules for controlling Windows desktop applications through screen observation and simulated mouse and keyboard actions. It also describes how to find and launch installed applications and verify the results.

Plocr/Reasonix-computer-use · 23 tokens

web-navigator

A browser-automation routing guide for web tasks. It directs navigation, page inspection, and actions such as clicking or filling forms to the appropriate browser tool.

Plocr/Reasonix-computer-use · 30 tokens

cua-sandboxes

Create, use and clean up cua sandboxes (disposable Linux or macOS computers) locally or in the Cua cloud with the cua CLI or the cua SDK, and browse the web inside one. Use when a task needs an isolated machine to run code, test an app, drive a desktop GUI, browse or test a website, fill a web form, take a web page…

trycua/cua · 98 tokens

cua-driver

Drive a native GUI app (macOS, Windows, Linux) via the cua-driver CLI (default) or MCP server; snapshot its accessibility tree, act through snapshot-bound element tokens, native menu paths, exact window geometry, or pixel coordinates, and verify from fresh state. Use when the user asks you to operate, drive, automate…

trycua/cua · 98 tokens

peekaboo

Use Peekaboo for macOS screenshots, Accessibility inspection, and background app/window/UI automation, including fallback computer use when the primary tool cannot handle an authorized task.

openclaw/Peekaboo · 37 tokens