|
1 | 1 | --- |
2 | 2 | name: agent-device |
3 | | -description: Automates interactions for Apple-platform apps (iOS, tvOS, macOS) and Android devices. Use when navigating apps, taking snapshots/screenshots, tapping, typing, scrolling, extracting UI info, or collecting logs, network inspection, and perf snapshots across mobile, TV, and desktop targets. |
| 3 | +description: Automates Apple-platform apps (iOS, tvOS, macOS) and Android devices. Use when navigating apps, taking snapshots/screenshots, tapping, typing, scrolling, extracting UI info, collecting logs/network/perf evidence, or planning agent-device CLI commands. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # agent-device |
7 | 7 |
|
8 | | -Use this skill as a router with mandatory defaults. Read this file first. For normal device tasks, always load `references/bootstrap-install.md` and `references/exploration.md` before acting. Use bootstrap to confirm or establish deterministic setup. Use exploration for UI inspection, interaction, and verification once the app session is open. |
| 8 | +Router only. Private setup before using this skill: |
9 | 9 |
|
10 | | -## Default operating rules |
| 10 | +```bash |
| 11 | +agent-device --version |
| 12 | +``` |
11 | 13 |
|
12 | | -- Start conservative. Prefer read-only inspection before mutating the UI. |
13 | | -- Start deterministic. If the app name, package, device, or session is uncertain, load bootstrap and discover them before interacting. |
14 | | -- Use plain `snapshot` when the task is to verify what text or structure is currently visible on screen. |
15 | | -- Use `snapshot -i` only when you need interactive refs such as `@e3` for a requested action or targeted query. On iOS and Android, default snapshot output uses the same visible-first model: off-screen interactive content is exposed as discovery hints, not tappable refs. |
16 | | -- Prefer `diff snapshot` after a nearby mutation when you only need to know what changed. |
17 | | -- Avoid speculative mutations. You may take the smallest reversible UI action needed to unblock inspection or complete the requested task, such as dismissing a popup, closing an alert, or clearing an unintended surface. |
18 | | -- In React Native dev or debug builds, check early for visible warning or error overlays, tooltips, and toasts that can steal focus or intercept taps. If they are not part of the requested behavior, dismiss them and continue. If you saw them, report them in the final summary. |
19 | | -- In Metro-backed React Native dev loops, use `agent-device metro reload` for a JS app reload before falling back to `open <app> --relaunch`. It mirrors pressing `r` in the Metro terminal and preserves the native app process. |
20 | | -- Do not browse the web or use external sources unless the user explicitly asks. |
21 | | -- Re-snapshot after meaningful UI changes instead of reusing stale refs. |
22 | | -- Treat refs in default snapshot output as actionable-now, not durable identities. If a target appears only in an off-screen summary, use `scroll <direction>` and re-snapshot until the target is visible. |
23 | | -- Prefer `@ref` or selector targeting over raw coordinates. |
24 | | -- Ensure the correct target is pinned and an app session is open before interacting. |
25 | | -- Keep the loop short: `open` -> inspect/act -> verify if needed -> `close`. |
| 14 | +Require `agent-device >= 0.13.4`; older CLIs lack these help topics. If older, run `npm install -g agent-device@latest`, recheck, then continue. If you cannot upgrade, stop and tell the user. Do not include version/upgrade commands in final plans. |
26 | 15 |
|
27 | | -## Default flow |
| 16 | +Before your first agent-device command or plan, read the version-matched CLI guide: |
28 | 17 |
|
29 | | -1. Load [references/bootstrap-install.md](references/bootstrap-install.md) and [references/exploration.md](references/exploration.md) before acting on a normal device task. |
30 | | -2. Use bootstrap first to confirm or establish the correct target, app install, and open app session. |
31 | | -3. Once the app session is open and stable, use exploration for inspection, interaction, and verification. |
32 | | -4. Start with plain `snapshot` if the goal is to read or verify what is visible. |
33 | | -5. Escalate to `snapshot -i` only if you need refs for interactive exploration or a requested action. |
34 | | -6. Use `get`, `is`, or `find` before mutating the UI when a read-only command can answer the question. |
35 | | -7. End by capturing proof if needed, then `close`. |
| 18 | +```bash |
| 19 | +agent-device help workflow |
| 20 | +``` |
36 | 21 |
|
37 | | -## QA modes |
| 22 | +Escalate only when relevant: |
38 | 23 |
|
39 | | -- Open-ended bug hunt with reporting: use [../dogfood/SKILL.md](../dogfood/SKILL.md). |
40 | | -- Pass/fail QA from acceptance criteria: stay in this skill, start with [references/bootstrap-install.md](references/bootstrap-install.md), then use the QA loop in [references/exploration.md](references/exploration.md). |
| 24 | +```bash |
| 25 | +agent-device help debugging |
| 26 | +agent-device help react-devtools |
| 27 | +agent-device help remote |
| 28 | +agent-device help macos |
| 29 | +agent-device help dogfood |
| 30 | +``` |
41 | 31 |
|
42 | | -## Required references |
| 32 | +Default loop: `open -> snapshot/-i -> get/is/find or press/fill/scroll/wait -> verify -> close`. |
43 | 33 |
|
44 | | -- For every normal device task, after reading this file, load [references/bootstrap-install.md](references/bootstrap-install.md) first, then [references/exploration.md](references/exploration.md), before acting. |
45 | | -- Use bootstrap to confirm or establish deterministic setup, especially in sandbox or cloud environments. |
46 | | -- Use exploration once the app session is open and stable. |
47 | | -- Load additional references only when their scope is needed. |
48 | | - |
49 | | -## Decision rules |
50 | | - |
51 | | -- Use plain `snapshot` when you need to verify whether text is visible. |
52 | | -- Use `snapshot -i` mainly for interactive exploration and choosing refs. |
53 | | -- Use `diff snapshot` for compact post-action verification; use `snapshot --diff` when that alias is easier to discover from snapshot help. |
54 | | -- Use `get`, `is`, or `find` when they can answer the question without changing UI state. |
55 | | -- Use `fill` to replace text. |
56 | | -- Use `type` to append text. |
57 | | -- Do not write `type @eN "text"`. Use `fill @eN "text"` to target a field directly, or `press @eN` then `type "text"` when the field already has focus and you want append semantics. |
58 | | -- If the on-screen keyboard blocks the next step, prefer `keyboard dismiss` over navigation. On iOS, keep an app session open first; `keyboard status|get` remains Android-only. |
59 | | -- When a task asks to "go back", use plain `back` for predictable app-owned navigation and reserve `back --system` for platform back gestures or button semantics. |
60 | | -- Use `type --delay-ms` or `fill --delay-ms` for debounced search fields that drop characters when typed too quickly. |
61 | | -- If there is no simulator, no app install, or no open app session yet, switch to `bootstrap-install.md` instead of improvising setup steps. |
62 | | -- Use the smallest unblock action first when transient UI blocks inspection, but do not navigate, search, or enter new text just to make the UI reveal data unless the user asked for that interaction. |
63 | | -- In React Native dev or debug apps, treat visible warning or error overlays as transient blockers unless the user is explicitly asking you to diagnose them. Dismiss them when safe, then continue the requested flow. |
64 | | -- For React Native code changes where the app is already connected to Metro, prefer `agent-device metro reload`, then wait and re-snapshot. Use `open <app> --relaunch` only when Metro reload does not reconnect or native startup state must reset. |
65 | | -- Do not use external lookups to compensate for missing on-screen data unless the user asked for them. |
66 | | -- If the needed information is not exposed on screen, say that plainly instead of compensating with extra navigation, text entry, or web search. |
67 | | -- Prefer `@ref` or selector targeting over raw coordinates. |
68 | | - |
69 | | -## Additional references |
70 | | - |
71 | | -- Need logs, network, alerts, permissions, or failure triage: [references/debugging.md](references/debugging.md) |
72 | | -- Need screenshots, diff, recording, replay maintenance, or perf data: [references/verification.md](references/verification.md) |
73 | | -- Need desktop surfaces, menu bar behavior, or macOS-specific interaction rules: [references/macos-desktop.md](references/macos-desktop.md) |
74 | | -- Need remote HTTP transport, `connect --remote-config`, or tenant leases on a remote macOS host: [references/remote-tenancy.md](references/remote-tenancy.md) |
75 | | - This includes remote React Native runs where `agent-device` now prepares Metro locally and manages the local Metro companion tunnel automatically. |
76 | | -- Need the React Native component tree, props, state, hooks, or render profiling: use `agent-device react-devtools ...` and the [react-devtools skill](../react-devtools/SKILL.md). |
| 34 | +Keep refs current, prefer selectors/refs over coordinates, use `fill` to replace text, and use `back` for app-owned navigation. Let `help workflow` provide the exact command shapes. |
0 commit comments