|
| 1 | +--- |
| 2 | +name: rocketsim |
| 3 | +description: "Use RocketSim to inspect and interact with iOS Simulator apps. Detects the installed RocketSim version, loads the matching RocketSim CLI guidance, and enables agents to list visible accessibility elements, navigate screens, tap, long-press, swipe, type text, press simulator hardware buttons, and automate simulator flows reliably. Use when: (1) the user mentions RocketSim, the rocketsim command, or RocketSim CLI, (2) interacting with an app in the iOS Simulator, (3) navigating or testing a simulator app with AI, (4) reading screen elements, accessibility elements, or visible UI state, (5) tapping, long-pressing, swiping, typing, or pressing simulator buttons, (6) using RocketSim instead of ad-hoc simulator automation." |
| 4 | +--- |
| 5 | + |
| 6 | +# RocketSim Agent Skill |
| 7 | + |
| 8 | +This skill lets agents use RocketSim as a reliable Simulator interaction layer. It finds a valid RocketSim app bundle, loads the matching bundled CLI reference, and hands off to the installed RocketSim version so simulator automation stays version-aware and in sync with the app on disk. |
| 9 | + |
| 10 | +## Step 1: Locate and validate RocketSim.app |
| 11 | + |
| 12 | +Developer machines can have multiple RocketSim installs side-by-side, such as an App Store build plus a locally built or renamed copy. Do not assume `/Applications/RocketSim.app` is the right app, and do not continue unless you validate the bundled skill and CLI paths first. |
| 13 | + |
| 14 | +### Prefer the running RocketSim app |
| 15 | + |
| 16 | +If RocketSim is already running, prefer that app bundle first: |
| 17 | + |
| 18 | +```bash |
| 19 | +ROCKETSIM_PID="$(pgrep -x RocketSim | head -1)" |
| 20 | +APP_PATH="" |
| 21 | +if [ -n "$ROCKETSIM_PID" ]; then |
| 22 | + APP_PATH="$(ps -o command= -p "$ROCKETSIM_PID" | sed 's#/Contents/MacOS/RocketSim$##')" |
| 23 | +fi |
| 24 | +printf '%s\n' "$APP_PATH" |
| 25 | +``` |
| 26 | + |
| 27 | +If that prints a path, validate it before continuing. |
| 28 | + |
| 29 | +### Otherwise, enumerate candidate installs |
| 30 | + |
| 31 | +If RocketSim is not running, gather candidate app bundles instead of taking the first match: |
| 32 | + |
| 33 | +```bash |
| 34 | +mdfind "kMDItemCFBundleIdentifier == 'com.swiftLee.RocketSim'" |
| 35 | +``` |
| 36 | + |
| 37 | +Then also check common fallback paths, including renamed installs: |
| 38 | + |
| 39 | +1. `/Applications/RocketSim.app` |
| 40 | +2. `/Applications/RocketSim 2.app` |
| 41 | +3. `~/Applications/RocketSim.app` |
| 42 | +4. `~/Applications/RocketSim 2.app` |
| 43 | + |
| 44 | +### Validate every candidate before continuing |
| 45 | + |
| 46 | +Given a candidate app path (`APP_PATH`), the following two files must exist: |
| 47 | + |
| 48 | +- `APP_PATH/Contents/Resources/Agent-Skill/SKILL.md` |
| 49 | +- `APP_PATH/Contents/Helpers/rocketsim` |
| 50 | + |
| 51 | +Use this validation: |
| 52 | + |
| 53 | +```bash |
| 54 | +test -f "$APP_PATH/Contents/Resources/Agent-Skill/SKILL.md" && test -x "$APP_PATH/Contents/Helpers/rocketsim" |
| 55 | +``` |
| 56 | + |
| 57 | +Pick the first candidate that passes validation. If RocketSim is already running, only continue with the running app if it passes validation. |
| 58 | + |
| 59 | +If no candidate passes validation, stop immediately and tell the user: |
| 60 | +> I found RocketSim installs, but none of them expose the bundled Agent Skill and CLI that this workflow requires. Please launch or install a current RocketSim build from the Mac App Store: https://apps.apple.com/us/app/rocketsim-for-xcode-simulator/id1504940162 |
| 61 | +
|
| 62 | +## Step 2: Resolve Paths |
| 63 | + |
| 64 | +Given the app path (`APP_PATH`), derive: |
| 65 | +- **Bundled skill:** `APP_PATH/Contents/Resources/Agent-Skill/SKILL.md` |
| 66 | +- **CLI binary:** `APP_PATH/Contents/Helpers/rocketsim` |
| 67 | + |
| 68 | +## Discovery contract |
| 69 | + |
| 70 | +Before moving on to Step 3, all of the following must be true: |
| 71 | + |
| 72 | +- `APP_PATH` points to the RocketSim bundle you intend to use. |
| 73 | +- `APP_PATH/Contents/Resources/Agent-Skill/SKILL.md` exists. |
| 74 | +- `APP_PATH/Contents/Helpers/rocketsim` exists and is executable. |
| 75 | +- If RocketSim is already running, the chosen `APP_PATH` should be the running app bundle. |
| 76 | + |
| 77 | +If any of these checks fail, stop and resolve discovery first. Do not attempt simulator interaction without a validated CLI path. |
| 78 | + |
| 79 | +## Step 3: Read the Bundled Skill |
| 80 | + |
| 81 | +Read the file at `APP_PATH/Contents/Resources/Agent-Skill/SKILL.md` and follow its instructions. Wherever the bundled skill references the CLI binary, use the resolved absolute path from Step 2. |
| 82 | + |
| 83 | +## Step 4: Verify RocketSim is Running |
| 84 | + |
| 85 | +Before executing any CLI command, verify the app is running: |
| 86 | + |
| 87 | +```bash |
| 88 | +pgrep -x RocketSim >/dev/null && echo "Running" || echo "Not running" |
| 89 | +``` |
| 90 | + |
| 91 | +If not running, ask the user to launch RocketSim before proceeding. |
| 92 | + |
| 93 | +If RocketSim is running from a different app bundle than the `APP_PATH` you resolved, restart discovery and prefer the running app bundle. |
0 commit comments