agentleFS
NateBJones-ProjectsNateBJones-Projects/unlock-ai-workbench/.agents/skills/test-t3-mobile/SKILL.md

test-t3-mobile

Skill4 starsChanged 4 months agoMITView on GitHub

Launch and test T3 Code Mobile on an iOS Simulator or Android Emulator against disposable local T3 environments, including Metro and dev-client reuse, native rebuild decisions, per-client pairing, seeded projects, semantic UI control, screenshots, and iOS serve-sim streaming. Use after mobile UI or native changes, when reproducing phone or tablet behavior, pairing an emulator to isolated state, or verifying mobile behavior on macOS, Linux, or Windows.

6 other projects use a version of this, 3 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

27 rules. 0 are common, 15 are distinctive, and 12 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 12

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run one focused, end-to-end mobile verification pass against disposable T3 state.

    line 8
  2. Distinctive:

    When the change is platform-specific, test that platform.

    line 18
  3. Distinctive:

    Do not treat unavailable iOS tooling as a blocker when Android is a valid representative target.

    line 20
  4. Very specific:

    Use vp run ios:dev or vp run android:dev only when an Expo clean prebuild is actually required.

    line 26
  5. Very specific:

    If the user requested no native rebuild and no compatible app is installed, reuse an existing compatible .app or .apk artifact when …

    line 27
  6. Very specific:

    Run backend commands from the repository root.

    line 39
  7. Very specific:

    Use direct SQLite mutation only for disposable projection fixtures.

    line 51
  8. Distinctive:

    Start a headless backend after seeding:

    line 53
  9. Distinctive:

    Use these client origins:

    line 63
  10. Very specific:

    Run Metro from apps/mobile.

    line 73
  11. Distinctive:

    Never kill another worktree's Metro.

    line 76
  12. Very specific:

    Run vp run dev:client on the standard port.

    line 77
  13. Very specific:

    Use ios-debugger-agent to select one UDID and set these XcodeBuildMCP session defaults:

    line 94
  14. Distinctive:

    Check the installed client with:

    line 102
  15. Distinctive:

    Do not start, stop, erase, or reconfigure an emulator owned by another task.

    line 124
  16. Distinctive:

    If the visible Add Environment action is not exposed as a semantic target, open the app's registered route instead of guessing coordinates:

    line 140
  17. Distinctive:

    Run only the command for the selected platform.

    line 150
  18. Very specific:

    Prefer semantic Android automation exposed by the current agent host.

    line 164
  19. Distinctive:

    Remove the disposable environment from T3 Code Dev.

    line 174
  20. Very specific:

    Remove any adb reverse rule created for this test with adb -s <emulator-serial> reverse --remove tcp:<metro-port>.

    line 175
  21. Distinctive:

    Stop only the serve-sim, Metro, backend, emulator, and log processes started by this test.

    line 176
  22. Distinctive:

    Remove only base directories and temporary Git repositories deliberately created for this test.

    line 177
  23. Distinctive:

    Keep local verification focused.

    line 179
  24. Distinctive:

    Old UI or an old error appears: verify Metro's worktree, variant, URL, and port before diagnosing the app.

    line 183
  25. Distinctive:

    The environment remains empty: verify the platform-specific HTTP origin, use a fresh token, and confirm project seeding used the identical …

    line 184
  26. Very specific:

    Android cannot reach Metro: verify adb reverse for the exact Metro port and relaunch the development-client URL.

    line 187
  27. Very specific:

    Android cannot reach the backend: use 10.0.2.2, not 127.0.0.1, for the Android Emulator.

    line 188

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “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

Test T3 Mobile

Run one focused, end-to-end mobile verification pass against disposable T3 state. Use the sibling test-t3-app skill as the detailed reference for pairing-token semantics and SQLite fixtures.

Command examples use POSIX shell syntax. On Windows, use PowerShell equivalents: set variables with $env:NAME = "value", use an explicit temporary directory from [System.IO.Path]::GetTempPath(), and run multiline examples on one line or with PowerShell backticks. Use $env:ANDROID_HOME\platform-tools\adb.exe when adb is not already on PATH.

Select a viable platform

Inspect the host and the affected code before launching processes:

  • On macOS with Xcode, prefer one representative iOS Simulator when the change is cross-platform so the user can watch through serve-sim. Load and follow ios-debugger-agent, and load ios-simulator-browser when live streaming is available.
  • On macOS, Linux, or Windows with the Android SDK, use one Android Emulator when Android is the affected surface or iOS tooling is unavailable.
  • When the change is platform-specific, test that platform. When neither platform is viable, report the missing SDK, emulator, or dev-client prerequisite rather than claiming verification.

Do not treat unavailable iOS tooling as a blocker when Android is a valid representative target.

Choose the lightest valid launch path

  • For JavaScript, TypeScript, or asset-only changes, reuse a compatible installed development client and start Metro. Do not rebuild native code merely to load a new bundle.
  • For native source, native dependencies, entitlements, config plugins, or generated project changes, rebuild the affected platform.
  • Use vp run ios:dev or vp run android:dev only when an Expo clean prebuild is actually required; both commands regenerate the native project.
  • If the user requested no native rebuild and no compatible app is installed, reuse an existing compatible .app or .apk artifact when available. Otherwise report the missing dev client instead of silently rebuilding.

The development identity on both platforms is:

  • App: T3 Code Dev
  • Bundle/package identifier: com.t3tools.t3code.dev
  • URL scheme: t3code-dev

Bundle or package presence proves the correct variant, not native compatibility. Reuse it only when the current changes did not alter its Expo SDK, native dependencies, config plugins, entitlements, generated project, or native source.

Start one disposable T3 environment

Run backend commands from the repository root. Use the ignored, worktree-local .t3 directory or create a fresh directory with the host OS's temporary-directory mechanism. An explicit base directory stores state in <base-dir>/userdata; never point testing at shared ~/.t3 state.

Seed a small number of meaningful Git projects before starting the backend:

node apps/server/src/bin.ts project add <git-workspace> \
  --base-dir <base-dir> \
  --title <project-title>

Running project add before the backend starts gives it exclusive offline database access. If a backend is already running, wait until it is ready so the CLI dispatches through the live server; never run offline mutations concurrently with the server.

Use direct SQLite mutation only for disposable projection fixtures. Follow test-t3-app and stop the backend before writing.

Start a headless backend after seeding:

node apps/server/src/bin.ts serve \
  --host 127.0.0.1 \
  --port <server-port> \
  --base-dir <base-dir> \
  --no-browser

Use these client origins:

  • iOS Simulator: http://127.0.0.1:<server-port>
  • Android Emulator: http://10.0.2.2:<server-port>
  • Physical device: bind the backend to 0.0.0.0 and use the host's reachable LAN origin

Enter the complete http:// origin to make the test transport explicit. Bare IP addresses default to HTTP, while bare hostnames default to HTTPS. When testing web and mobile together, run vp run dev --home-dir <base-dir> --host 127.0.0.1 instead and do not launch a second backend over the same base directory.

Start or reuse Metro safely

Run Metro from apps/mobile.

  1. Inspect any process on the intended Metro port and its /status response. Reuse it only when it is healthy, belongs to this worktree, and matches APP_VARIANT=development, --dev-client, and scheme t3code-dev.
  2. Never kill another worktree's Metro. Use a free explicit port when necessary.
  3. Run vp run dev:client on the standard port. For another port, retain the complete development identity:

    APP_VARIANT=development vp exec expo start \
      --dev-client \
      --scheme t3code-dev \
      --clear \
      --lan \
      --port <metro-port>

    In PowerShell, set $env:APP_VARIANT = "development" first and then run the vp exec expo start ... command without the leading assignment.

  4. Open the exact development-client URL for the selected device and confirm the loaded bundle belongs to this worktree and Metro port.

iOS launch

Use ios-debugger-agent to select one UDID and set these XcodeBuildMCP session defaults:

  • Workspace: <repo>/apps/mobile/ios/T3CodeDev.xcworkspace
  • Scheme: T3CodeDev
  • Configuration: Debug
  • Simulator ID: the selected UDID
  • Bundle ID: com.t3tools.t3code.dev

Check the installed client with:

xcrun simctl get_app_container <simulator-udid> com.t3tools.t3code.dev app
xcrun simctl openurl <simulator-udid> <printed-dev-client-url>

Accept the iOS confirmation prompt and dismiss the developer menu when it obscures the app.

Android launch

Select one running emulator serial from adb devices and check the installed client:

adb -s <emulator-serial> shell pm path com.t3tools.t3code.dev
adb -s <emulator-serial> reverse tcp:<metro-port> tcp:<metro-port>
adb -s <emulator-serial> shell am start -W \
  -a android.intent.action.VIEW \
  -d '<printed-dev-client-url>' \
  com.t3tools.t3code.dev

Do not start, stop, erase, or reconfigure an emulator owned by another task. Track and later stop only processes owned by this test.

Pair each client once

Issue a fresh credential against the running backend's exact base directory:

T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
  --base-dir <base-dir> \
  --base-url <mobile-origin> \
  --ttl 15m \
  --label agent-mobile-<short-device-id>

In PowerShell, set $env:T3CODE_PORT = "<server-port>" first and run the node ... auth pairing create command without the leading assignment.

If the visible Add Environment action is not exposed as a semantic target, open the app's registered route instead of guessing coordinates:

xcrun simctl openurl <simulator-udid> 't3code-dev://connections/new'
adb -s <emulator-serial> shell am start -W \
  -a android.intent.action.VIEW \
  -d 't3code-dev://connections/new' \
  com.t3tools.t3code.dev

Run only the command for the selected platform.

In T3 Code Dev, open Add Environment and enter the complete <mobile-origin> and newly printed Token. Verify the expected seeded projects appear before exercising the affected flow.

Pairing credentials are secret, short-lived, and single-use. Create a different credential for every simulator, emulator, physical device, or browser. If an attempt fails, issue a new credential rather than retrying the old one. Do not expose tokens in screenshots, commits, or final responses.

Drive and observe the affected flow

iOS

Use snapshot_ui and current element references from XcodeBuildMCP for taps and typing. Stream the same UDID through ios-simulator-browser so the user can watch in T3 Code when the host supports it. Use the stream as a visual feed rather than a reason to switch to fragile browser coordinates.

Android

Prefer semantic Android automation exposed by the current agent host. Otherwise inspect the current hierarchy with adb shell uiautomator dump, target stable resource IDs, content descriptions, text, or bounds, and use scoped adb shell input actions. Refresh the hierarchy after navigation. Capture the final state with adb exec-out screencap -p.

Android does not use serve-sim. Use a browser-compatible Android mirror when the host already provides one; otherwise return focused emulator screenshots as evidence rather than installing unrelated streaming infrastructure during verification.

Verify and clean up

Exercise only the affected flow on one representative device unless the change specifically concerns platform, OS version, or screen size. Before finishing:

  1. Confirm the app connected to the intended disposable environment instead of merely rendering an empty disconnected state.
  2. Capture the relevant final state.
  3. Remove the disposable environment from T3 Code Dev.
  4. Remove any adb reverse rule created for this test with adb -s <emulator-serial> reverse --remove tcp:<metro-port>.
  5. Stop only the serve-sim, Metro, backend, emulator, and log processes started by this test.
  6. Remove only base directories and temporary Git repositories deliberately created for this test. Preserve them when they contain useful reproduction evidence.

Keep local verification focused. Do not turn this workflow into a full repository test run.

Troubleshoot predictable failures

  • Old UI or an old error appears: verify Metro's worktree, variant, URL, and port before diagnosing the app.
  • The environment remains empty: verify the platform-specific HTTP origin, use a fresh token, and confirm project seeding used the identical base directory.
  • A second client cannot pair: pairing tokens are single-use; issue another token.
  • iOS semantic actions fail: set explicit XcodeBuildMCP defaults and refresh with snapshot_ui.
  • Android cannot reach Metro: verify adb reverse for the exact Metro port and relaunch the development-client URL.
  • Android cannot reach the backend: use 10.0.2.2, not 127.0.0.1, for the Android Emulator.

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.