agentleFS
matheusmmatheusm/iphone-mirroring-skill/skills/iphone-mirroring/SKILL.md

iphone-mirroring

Skill0 starsChanged 21 days agoMITView on GitHub

Drive the macOS iPhone Mirroring app from a coding agent. Screenshot the phone, tap, scroll, swipe, open Home / App Switcher / Spotlight, and check every step against a fresh screenshot. Use when the user wants you to read or operate an iPhone app through iPhone Mirroring on a Mac, such as app-only stats (Instagram Reel insights, creator dashboards), settings, or a quick check of a mobile UI. Also use when they mention "iPhone Mirroring", "Espelhamento do iPhone", or controlling their phone from the Mac.

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. trac3r00/agent-skills★ 0same name
    2. trac3r00/core-skills★ 0same 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.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    All actions take --dry-run, which prints the target point and sends nothing.

    line 37
  2. Very specific:

    Run $IM doctor, then fix each [FAIL] by asking the user.

    line 42
  3. Very specific:

    Look at the new screenshot.

    line 58
  4. Distinctive:

    Read-only by default: Never tap anything that posts, likes, follows, comments, sends, shares, buys, subscribes, boosts/promotes, deletes, …

    line 65
  5. Very specific:

    Coordinates come from the latest shot: If you captured with --native on a Retina display, add --ref <that.png> to the action.

    line 72
  6. Distinctive:

    Keep screenshots in a temporary folder and delete them when done.

    line 74

≈ “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

You control the user's real iPhone through the iPhone Mirroring window on their Mac. You see the phone only through screenshots and act only through synthetic mouse events. Be slow, verify everything, and change nothing the user did not ask you to change.

The tool

scripts/iphone-mirror lives in this skill's folder. It is a wrapper that compiles scripts/iphone-mirror.swift with swiftc on first run (about 10 s) and caches the binary. Use its absolute path:

IM="<this skill's folder>/scripts/iphone-mirror"   # if the exec bit is lost: IM="bash <folder>/scripts/iphone-mirror"
$IM help
CommandUse
$IM doctorCheck permissions, host app, window and scale. Run first.
$IM shot <png>Screenshot of the phone. 1 px = 1 window point, so coordinates read off it go straight to tap.
$IM tap <x> <y> [--shot <png>]Tap. --shot takes a screenshot 1 s later.
$IM scroll -60 [--at x y] [--times 8]Negative = further down the page. Waits 2.5 s for momentum by default.
$IM menu home|app-switcher|spotlightiPhone Mirroring menu actions (localized names handled). menu --list shows all.
$IM wait-settleWait until the screen stops changing. Playing videos never settle: use --region.
$IM has-color <png> x1 y1 x2 y2 '#RRGGBB'Cheap check of which screen you are on (exit 0 = found).
$IM join <out> a.png b.png --trim-barsSeveral screenshots side by side, to read long pages with fewer tokens.

All actions take --dry-run, which prints the target point and sends nothing. Exit codes: 2 = app or window missing, 3 = permission or capture failure, 4 = timeout or not found.

Setup (once per machine)

  1. Run $IM doctor, then fix each [FAIL] by asking the user. You cannot grant permissions yourself.
    • The host app that doctor names (Terminal, iTerm, Warp, Ghostty, VS Code, Cursor...) needs Accessibility and Screen & System Audio Recording (System Settings > Privacy & Security).
    • Screen Recording only applies after the host app is fully quit (cmd+Q) and reopened, which ends this session. Tell the user to do that and resume afterwards.
    • $IM doctor --prompt asks macOS to show the permission dialogs.
  2. iPhone Mirroring must be open (open -b com.apple.ScreenContinuity), connected, and visible on a display. Other windows may cover it; every action raises it first.
  3. If taps do nothing at the start of a session, ask the user to click once inside the iPhone Mirroring window, then retry. Synthetic events can be ignored until the first physical click.

Core loop: one action, then verify

  1. $IM shot /tmp/im/00.png and look at the image (read it with your image or file tool).
  2. Pick one action and read its coordinates off that image.
  3. Act and capture in one step: $IM tap 177 391 --shot /tmp/im/01.png.
  4. Look at the new screenshot. Check that the screen is the one you expected (title, selected tab, a known button). If it is not, back out (top-left back chevron, or $IM menu home) and try again.
  5. Repeat. Never chain several blind actions, and never reuse coordinates from an older screenshot after anything moved.

Rules

  • Read-only by default. Never tap anything that posts, likes, follows, comments, sends, shares, buys, subscribes, boosts/promotes, deletes, or changes settings unless the user explicitly asked for that exact action. Do not double-tap on media: many apps treat a double tap as a like. If a dialog asks for a payment, a permission or a confirmation, stop and ask the user.
  • After scrolling, wait (built in: 2.5 s). A tap during scroll momentum only stops the scroll.
  • The same tap can open different screens (in Instagram, a grid item sometimes opens the Reels viewer and sometimes the Posts list). Verify, then retry or back out. In scripts, use has-color as the check.
  • Coordinates come from the latest shot. If you captured with --native on a Retina display, add --ref <that.png> to the action.
  • Keep screenshots in a temporary folder and delete them when done. They show private data.

Status

The tap and scroll event sequences were proven live with prototype scripts. In this CLI, live tests have covered doctor, info and window detection so far. Successful shot, tap, scroll and menu still need a live run on a machine with both permissions. swipe, long press, menu paste and keyboard typing are experimental: confirm each with a screenshot and fall back to taps.

References

  • references/pitfalls.md: every failure seen so far and its fix (permissions, taps that land in the wrong place, scroll, menus, coordinates, multiple displays). Read it when something does not behave.
  • references/scripting.md: turning a manual flow into a script that retries (verify-by-pixel loops, joining pages).
  • references/instagram-insights.md: worked recipe for reading Instagram Reel insights in the iOS app (data the web does not show).

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.