macwright AGENTS.md

A set of project instructions for coding agents working on MacWright, a macOS desktop-control server. It covers the project structure, setup checks, building, tests, and required macOS privacy permissions.

In plain words
What is it for?
It is for installing and checking the project, building it, running its tests, opening macOS permission settings, and understanding where its code lives.
Why use it?
It gives an agent the project-specific steps and permission requirements needed to work on the code without guessing how to set it up or verify changes.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ruchit-p/macwright/agents-md
Clone the repo
git clone --depth 1 https://github.com/ruchit-p/macwright

Made for: Codex, OpenCode.

Per session 1,232 This file is loaded in full into every session.
When invoked 1,232 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01232 $0.01232
Opus 5 $0.00616 $0.00616
Sonnet 5 $0.00246 $0.00246
Haiku 4.5 $0.00123 $0.00123

Measured yesterday against content hash 948bfc3c6da9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

macwright AGENTS.md 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 yesterday.

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.

AGENTS.md · 121 lines

How it starts

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

MacWright Agent Guide

MacWright is an MCP server for native macOS desktop control. Use this file as the first-stop guide for any coding agent or LLM working in this repo.

Project Basics

  • Runtime: Node.js >= 18, TypeScript.
  • Server entry: src/index.ts.
  • Tool implementations: src/tools/**.
  • Shared helpers: src/utils/**.
  • Built server: dist/index.js.
  • Build: npm run build.
  • Portable schema test: npm test.
  • Native macOS smoke test: npm run test:macos-smoke.
  • Setup/doctor: ./setup.sh and ./setup.sh --doctor.

Setup and Permissions

Run the setup/doctor script instead of guessing what is broken:

./setup.sh                         # install deps, build, run checks
./setup.sh --doctor                # checks only; no install/build
./setup.sh --open-settings         # open relevant macOS Privacy panes
./setup.sh --install-omniparser    # also run omniparser/setup.sh
./setup.sh --start-omniparser      # start OmniParser after checks

macOS TCC permissions cannot be silently bypassed by normal scripts. The setup script can preflight, open the right panes, and verify readiness, but the user must manually approve permissions and then restart the controlling app.

Required/important permissions:

Permission Needed for
Accessibility mouse, keyboard, scroll, AX read/click, focus/resize window via System Events
Screen Recording screenshots, screen_parse, visual verification, wait_for_change
Input Monitoring / Automation prompts may be requested by macOS depending on controlling app, keyboard events, Apple Events, or target app
Safari JavaScript from Apple Events Safari JS tools; enable Safari Develop menu + “Allow JavaScript from Apple Events”

Native Control Strategy

Do not assume one API works for every app. Use a layered strategy:

  1. Accessibility API for semantic native UI control when the app exposes a useful AX tree.
  2. Screen-first visual fallback when AX is weak: screenshot or screen_parse -> click/type/shortcut -> visual verification.
  3. Raw mouse/keyboard/clipboard/hotkeys as the lowest-level universal layer.
  4. Always verify the result with verifyChange, screenshot, screenshotAfterClick, wait_for_change, read_ui, or another parse.

Read the full file on GitHub · 121 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. yesterday First seen · 121 lines · 1,232 tokens per session scan A 948bfc3c6da9

Subscribe to this mod's changes

macwright AGENTS.md is an instructions file published in the GitHub repository ruchit-p/macwright (0 stars, last pushed 20d ago), licensed MIT. It adds 1,232 tokens to every session, about $0.0062 per session on Opus 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.