agentleFS
trac3r00trac3r00/agent-skills/skills/iphone-mirroring/SKILL.md

iphone-mirroring

Skill0 starsChanged 9 days agoMITView on GitHub

Read and navigate iPhone Mirroring: state, screenshots, View menu; input goes via OpenCUA. Use for the iPhone from the Mac. Not for calls (phone-facetime).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the script for reading and View-menu navigation (Accessibility only, no synthetic input):

    line 23
  2. Distinctive:

    Do one action (menu navigation here, input via OpenCUA), then screenshot again to confirm.

    line 51
  3. Distinctive:

    Stop when the screenshot shows the requested end state, or after one failed retry.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

iPhone Mirroring

iPhone Mirroring (macOS 15+) shows the phone in a Mac window but ships no AppleScript dictionary. This skill reads its window through the Accessibility API, presses its own View menu for navigation, and posts CoreGraphics mouse/keyboard events for taps, swipes and keys (stdlib ctypes, no pyobjc). The mirrored screen is only pixels, so look before you tap: take a screenshot, read it, then act.

Commands

Use the script for reading and View-menu navigation (Accessibility only, no synthetic input):

python3 scripts/iphone_mirroring.py --json status        # state, device, on-screen message, window frame
python3 scripts/iphone_mirroring.py open [--wait 20]     # bring forward, wait for a settled state
python3 scripts/iphone_mirroring.py retry [--wait 20]    # press "Try Again" / "Connect" / "Resume" after not_found, timed_out or paused
python3 scripts/iphone_mirroring.py screenshot --out "$SCRATCH/iphone.png"
python3 scripts/iphone_mirroring.py home                 # View > Home Screen
python3 scripts/iphone_mirroring.py app-switcher         # View > App Switcher
python3 scripts/iphone_mirroring.py spotlight            # View > Spotlight

Taps, scrolling, typing, keys and app launches go through the opencua skill (OpenCUA, formerly apple-cua; CLI opencua ios, "Control an iPhone through iPhone Mirroring"). The user forbids ad-hoc input scripts and OmO's native computer-use, so don't use this script's tap, scroll, type, key or launch; they post raw CoreGraphics events. Read opencua ios --help for its subcommands before the first input; this skill doesn't restate them.

Working loop

  1. status: act only when state is connected. Other states are connecting, not_found, timed_out, paused, in_use (unlocked and in use; mirroring needs it locked), needs_unlock, needs_auth, disconnected, error, no_window and unknown; message carries the app's text. For not_found, timed_out or paused, run retry once, then report.
  2. screenshot --out and read the image. On Retina the PNG is 2x the window's point size (window.width x window.height from status).
  3. Do one action (menu navigation here, input via OpenCUA), then screenshot again to confirm.
  4. Stop when the screenshot shows the requested end state, or after one failed retry.

Boundaries

  • Everything except status and screenshot acts on the real phone. Stay inside what the user asked for; confirm before anything that sends, purchases, deletes, or changes settings, and never enter passcodes.
  • Navigation commands exit 1 with the current status when the phone is not mirrored.
  • The Mac user must be the one paired with the iPhone. The phone must be nearby, locked, and not in use; the Mac may ask for Touch ID or its password on connect, and only a person can approve that.

Setup and exit codes

  • macOS 15+ with iPhone Mirroring set up once by hand. The process running the script needs Accessibility (reading the window and menu presses) and Screen Recording (screenshot) under System Settings > Privacy & Security.
  • 0 success, 1 app-level failure (not connected, menu item disabled, capture failed), 2 usage, permission, or non-macOS.

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.