agent-device 0.13.3 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +68 -63
  2. package/android-snapshot-helper/README.md +75 -0
  3. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.14.1.apk +0 -0
  4. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.14.1.apk.sha256 +1 -0
  5. package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.14.1.manifest.json +17 -0
  6. package/dist/src/221.js +4 -0
  7. package/dist/src/3918.js +29 -29
  8. package/dist/src/8161.js +3 -3
  9. package/dist/src/8656.js +1 -1
  10. package/dist/src/9152.js +1 -1
  11. package/dist/src/9542.js +2 -2
  12. package/dist/src/9818.js +1 -1
  13. package/dist/src/989.js +1 -1
  14. package/dist/src/android-snapshot-helper.d.ts +182 -0
  15. package/dist/src/android-snapshot-helper.js +1 -0
  16. package/dist/src/index.d.ts +19 -0
  17. package/dist/src/internal/bin.js +413 -69
  18. package/dist/src/internal/daemon.js +22 -20
  19. package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +26 -2
  20. package/package.json +29 -9
  21. package/skills/agent-device/SKILL.md +20 -62
  22. package/skills/dogfood/SKILL.md +9 -168
  23. package/skills/react-devtools/SKILL.md +15 -31
  24. package/skills/agent-device/references/bootstrap-install.md +0 -244
  25. package/skills/agent-device/references/coordinate-system.md +0 -28
  26. package/skills/agent-device/references/debugging.md +0 -138
  27. package/skills/agent-device/references/exploration.md +0 -362
  28. package/skills/agent-device/references/macos-desktop.md +0 -88
  29. package/skills/agent-device/references/remote-tenancy.md +0 -188
  30. package/skills/agent-device/references/verification.md +0 -134
  31. package/skills/dogfood/references/issue-taxonomy.md +0 -83
  32. package/skills/dogfood/templates/dogfood-report-template.md +0 -52
  33. package/skills/react-devtools/references/commands.md +0 -91
  34. package/skills/react-devtools/references/profiling.md +0 -74
@@ -285,20 +285,44 @@ extension RunnerTests {
285
285
  }
286
286
 
287
287
  private func tapKeyboardDismissControl(app: XCUIApplication) -> Bool {
288
- for label in ["Hide keyboard", "Dismiss keyboard"] {
288
+ let keyboardFrame = app.keyboards.firstMatch.frame
289
+ for label in ["Hide keyboard", "Dismiss keyboard", "Done"] {
289
290
  let candidates = [
290
291
  app.keyboards.buttons[label],
291
292
  app.keyboards.keys[label],
292
- app.toolbars.buttons[label],
293
+ app.keyboards.toolbars.buttons[label],
293
294
  ]
294
295
  if let hittable = candidates.first(where: { $0.exists && $0.isHittable }) {
295
296
  hittable.tap()
296
297
  return true
297
298
  }
299
+
300
+ let toolbarButtonPredicate = NSPredicate(
301
+ format: "label == %@ OR identifier == %@",
302
+ label,
303
+ label
304
+ )
305
+ let toolbarButtons = app.toolbars.buttons
306
+ .matching(toolbarButtonPredicate)
307
+ .allElementsBoundByIndex
308
+ if let hittable = toolbarButtons.first(where: {
309
+ $0.exists && $0.isHittable && isKeyboardAccessoryControl($0, keyboardFrame: keyboardFrame)
310
+ }) {
311
+ hittable.tap()
312
+ return true
313
+ }
298
314
  }
299
315
  return false
300
316
  }
301
317
 
318
+ private func isKeyboardAccessoryControl(_ element: XCUIElement, keyboardFrame: CGRect) -> Bool {
319
+ let frame = element.frame
320
+ guard !frame.isEmpty && !keyboardFrame.isEmpty else {
321
+ return false
322
+ }
323
+ return frame.intersects(keyboardFrame) || abs(frame.maxY - keyboardFrame.minY) <= 80
324
+ }
325
+
302
326
  private func moveCaretToEnd(element: XCUIElement) {
303
327
  let frame = element.frame
304
328
  guard !frame.isEmpty else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-device",
3
- "version": "0.13.3",
3
+ "version": "0.14.1",
4
4
  "description": "Agent-driven CLI for mobile UI automation, network inspection, and performance diagnostics across iOS, Android, tvOS, and macOS.",
5
5
  "license": "MIT",
6
6
  "author": "Callstack",
@@ -13,6 +13,7 @@
13
13
  "url": "https://github.com/callstackincubator/agent-device/issues"
14
14
  },
15
15
  "type": "module",
16
+ "packageManager": "pnpm@10.33.2",
16
17
  "main": "dist/src/index.js",
17
18
  "types": "dist/src/index.d.ts",
18
19
  "exports": {
@@ -44,6 +45,10 @@
44
45
  "import": "./dist/src/android-apps.js",
45
46
  "types": "./dist/src/android-apps.d.ts"
46
47
  },
48
+ "./android-snapshot-helper": {
49
+ "import": "./dist/src/android-snapshot-helper.js",
50
+ "types": "./dist/src/android-snapshot-helper.d.ts"
51
+ },
47
52
  "./contracts": {
48
53
  "import": "./dist/src/contracts.js",
49
54
  "types": "./dist/src/contracts.d.ts"
@@ -58,7 +63,7 @@
58
63
  }
59
64
  },
60
65
  "engines": {
61
- "node": ">=22"
66
+ "node": ">=22.19"
62
67
  },
63
68
  "bin": {
64
69
  "agent-device": "bin/agent-device.mjs"
@@ -71,19 +76,31 @@
71
76
  "build:xcuitest:ios": "AGENT_DEVICE_XCUITEST_PLATFORM=ios AGENT_DEVICE_IOS_CLEAN_DERIVED=1 sh ./scripts/build-xcuitest-apple.sh",
72
77
  "build:xcuitest:macos": "AGENT_DEVICE_XCUITEST_PLATFORM=macos sh ./scripts/build-xcuitest-apple.sh",
73
78
  "build:xcuitest:tvos": "AGENT_DEVICE_XCUITEST_PLATFORM=tvos AGENT_DEVICE_IOS_CLEAN_DERIVED=1 sh ./scripts/build-xcuitest-apple.sh",
79
+ "build:android-snapshot-helper": "sh ./scripts/build-android-snapshot-helper.sh $(node -p \"require('./package.json').version\") .tmp/android-snapshot-helper",
80
+ "package:android-snapshot-helper": "sh ./scripts/package-android-snapshot-helper.sh $(node -p \"require('./package.json').version\") v$(node -p \"require('./package.json').version\") .tmp/android-snapshot-helper",
81
+ "package:android-snapshot-helper:npm": "rm -rf android-snapshot-helper/dist && sh ./scripts/package-android-snapshot-helper.sh $(node -p \"require('./package.json').version\") v$(node -p \"require('./package.json').version\") android-snapshot-helper/dist",
74
82
  "build:macos-helper": "swift build -c release --package-path macos-helper",
75
83
  "build:all": "pnpm build:node && pnpm build:xcuitest",
76
84
  "ad": "node bin/agent-device.mjs",
77
85
  "lint": "oxlint . --deny-warnings",
78
- "format": "oxfmt --write src test skills package.json tsconfig.json .oxlintrc.json .oxfmtrc.json",
86
+ "format": "oxfmt --write src test skills package.json tsconfig.json tsconfig.lib.json rslib.config.ts vitest.config.ts .github/actions/setup-node-pnpm/action.yml .oxlintrc.json .oxfmtrc.json '!test/skillgym/.skillgym-results/**'",
87
+ "fallow": "fallow --summary",
88
+ "fallow:baseline": "(fallow dead-code --save-baseline fallow-baselines/dead-code.json --summary || true) && (fallow dupes --save-baseline fallow-baselines/dupes.json --summary || true) && (fallow health --save-baseline fallow-baselines/health.json --summary || true)",
89
+ "check:fallow": "fallow audit",
79
90
  "check:quick": "pnpm lint && pnpm typecheck",
80
91
  "check:tooling": "pnpm lint && pnpm typecheck && pnpm build",
81
92
  "check:unit": "pnpm test:unit && pnpm test:smoke",
82
- "check": "pnpm check:tooling && pnpm check:unit",
83
- "prepack": "pnpm build:all",
93
+ "check": "pnpm check:tooling && pnpm check:fallow && pnpm check:unit",
94
+ "prepack": "pnpm build:all && pnpm package:android-snapshot-helper:npm",
84
95
  "typecheck": "tsc -p tsconfig.json",
96
+ "test-app:install": "pnpm install --dir examples/test-app --ignore-workspace",
97
+ "test-app:start": "pnpm --dir examples/test-app start",
98
+ "test-app:ios": "pnpm --dir examples/test-app ios",
99
+ "test-app:android": "pnpm --dir examples/test-app android",
100
+ "test-app:typecheck": "pnpm --dir examples/test-app typecheck",
85
101
  "test": "vitest run",
86
102
  "test:unit": "vitest run",
103
+ "test:skillgym": "pnpm build && skillgym run ./test/skillgym/suites/agent-device-smoke-suite.ts --config ./test/skillgym/skillgym.config.ts",
87
104
  "test:smoke": "node --test test/integration/smoke-*.test.ts",
88
105
  "test:integration": "node --test test/integration/*.test.ts",
89
106
  "test:replay:ios": "node --experimental-strip-types src/bin.ts test test/integration/replays/ios/simulator",
@@ -102,6 +119,8 @@
102
119
  "!ios-runner/**/*.xcuserstate",
103
120
  "macos-helper",
104
121
  "!macos-helper/**/.build",
122
+ "android-snapshot-helper/dist",
123
+ "!android-snapshot-helper/dist/*.idsig",
105
124
  "src/platforms/linux/atspi-dump.py",
106
125
  "skills",
107
126
  "README.md",
@@ -132,18 +151,19 @@
132
151
  "performance"
133
152
  ],
134
153
  "dependencies": {
135
- "fast-xml-parser": "^5.5.10",
154
+ "fast-xml-parser": "^5.7.2",
136
155
  "pngjs": "^7.0.0"
137
156
  },
138
157
  "devDependencies": {
139
- "@microsoft/api-extractor": "^7.58.1",
158
+ "vitest": "^4.1.2",
140
159
  "@rslib/core": "0.20.1",
141
160
  "@types/node": "^22.0.0",
142
161
  "@types/pngjs": "^6.0.5",
162
+ "fallow": "^2.52.0",
143
163
  "oxfmt": "^0.42.0",
144
164
  "oxlint": "^1.57.0",
165
+ "skillgym": "^0.5.0",
145
166
  "typescript": "^6.0.2",
146
- "vite": "^8.0.7",
147
- "vitest": "^4.1.2"
167
+ "vite": "^8.0.10"
148
168
  }
149
169
  }
@@ -1,76 +1,34 @@
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.14.0`; 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
+ Use this skill only to route into version-matched CLI help. Let `help workflow` provide exact command shapes, platform limits, and current workflow guidance.
@@ -1,184 +1,25 @@
1
1
  ---
2
2
  name: dogfood
3
- description: 'Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", or "test this app" on mobile. Produces a structured report with reproducible evidence: screenshots, optional repro videos, and detailed steps for every issue.'
3
+ description: Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to dogfood, QA, exploratory test, find issues, bug hunt, or test this app on mobile.
4
4
  allowed-tools: Bash(agent-device:*), Bash(npx agent-device:*)
5
5
  ---
6
6
 
7
- # Dogfood (agent-device)
7
+ # Dogfood
8
8
 
9
- Systematically explore a mobile app, find issues, and produce a report with full reproduction evidence for every finding.
10
-
11
- ## Setup
12
-
13
- Only the **Target app** is required. Everything else has sensible defaults.
14
-
15
- | Parameter | Default | Example override |
16
- | -------------------- | ----------------------------------------------------------- | -------------------------------------------- |
17
- | **Target app** | _(required)_ | `Settings`, `com.example.app`, deep link URL |
18
- | **Platform** | Infer from user context; otherwise ask (`ios` or `android`) | `--platform ios` |
19
- | **Session name** | Slugified app/platform (for example `settings-ios`) | `--session my-session` |
20
- | **Output directory** | `./dogfood-output/` | `Output directory: /tmp/mobile-qa` |
21
- | **Scope** | Full app | `Focus on onboarding and profile` |
22
- | **Authentication** | None | `Sign in to user@example.com` |
23
-
24
- If the user gives enough context to start, begin immediately with defaults. Ask follow-up only when a required detail is missing (for example platform or credentials).
25
-
26
- Prefer direct `agent-device` binary when available.
27
-
28
- ## Workflow
29
-
30
- ```
31
- 1. Initialize Set up session, output dirs, report file
32
- 2. Launch/Auth Open app and sign in if needed
33
- 3. Orient Capture initial snapshot and map navigation
34
- 4. Explore Systematically test flows and states
35
- 5. Document Record reproducible evidence per issue
36
- 6. Wrap up Reconcile summary, close session
37
- ```
38
-
39
- ### 1. Initialize
40
-
41
- ```bash
42
- mkdir -p {OUTPUT_DIR}/screenshots {OUTPUT_DIR}/videos
43
- cp {SKILL_DIR}/templates/dogfood-report-template.md {OUTPUT_DIR}/report.md
44
- ```
45
-
46
- ### 2. Launch/Auth
47
-
48
- Start a named session and launch target app:
49
-
50
- ```bash
51
- agent-device --session {SESSION} open {TARGET_APP} --platform {PLATFORM}
52
- agent-device --session {SESSION} snapshot -i
53
- ```
54
-
55
- If login is required:
9
+ Router for exploratory QA. Private setup before using this skill:
56
10
 
57
11
  ```bash
58
- agent-device --session {SESSION} snapshot -i
59
- agent-device --session {SESSION} fill @e1 "{EMAIL}"
60
- agent-device --session {SESSION} fill @e2 "{PASSWORD}"
61
- agent-device --session {SESSION} press @e3
62
- agent-device --session {SESSION} wait 1000
63
- agent-device --session {SESSION} snapshot -i
12
+ agent-device --version
64
13
  ```
65
14
 
66
- For OTP/email codes: ask the user, wait for input, then continue.
67
-
68
- ### 3. Orient
15
+ Require `agent-device >= 0.14.0`; 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.
69
16
 
70
- Capture initial evidence and navigation anchors:
17
+ Read current CLI guidance:
71
18
 
72
19
  ```bash
73
- agent-device --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/initial.png
74
- agent-device --session {SESSION} snapshot -i
20
+ agent-device help dogfood
75
21
  ```
76
22
 
77
- Map top-level navigation, tabs, and key workflows before deep testing.
78
-
79
- ### 4. Explore
80
-
81
- Read [references/issue-taxonomy.md](references/issue-taxonomy.md) for severity/category calibration.
82
-
83
- Strategy:
84
-
85
- - Move through each major app area (tabs, drawers, settings pages).
86
- - Test core journeys end-to-end (create, edit, delete, submit, recover).
87
- - Validate edge states (empty/error/loading/offline/permissions denied).
88
- - Use `diff snapshot -i` after UI transitions to avoid stale refs.
89
- - Periodically capture `logs path` and inspect the app log when behavior looks suspicious.
90
-
91
- Useful commands per screen:
92
-
93
- ```bash
94
- agent-device --session {SESSION} snapshot -i
95
- agent-device --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/{screen-name}.png
96
- agent-device --session {SESSION} appstate
97
- agent-device --session {SESSION} logs path
98
- ```
99
-
100
- ### 5. Document Issues (Repro-First)
101
-
102
- Explore and document in one pass. When you find an issue, stop and fully capture evidence before continuing.
103
-
104
- #### Interactive/behavioral issues
105
-
106
- Use video + step screenshots:
107
-
108
- 1. Start recording:
109
-
110
- ```bash
111
- agent-device --session {SESSION} record start {OUTPUT_DIR}/videos/issue-{NNN}-repro.mp4
112
- ```
113
-
114
- 2. Reproduce with visible pacing. Capture each step:
115
-
116
- ```bash
117
- agent-device --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-step-1.png
118
- sleep 1
119
- # perform action
120
- sleep 1
121
- agent-device --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-step-2.png
122
- ```
123
-
124
- 3. Capture final broken state:
125
-
126
- ```bash
127
- sleep 2
128
- agent-device --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}-result.png
129
- ```
130
-
131
- 4. Stop recording:
132
-
133
- ```bash
134
- agent-device --session {SESSION} record stop
135
- ```
136
-
137
- 5. Append issue immediately to report with numbered steps and screenshot references.
138
-
139
- #### Static/on-load issues
140
-
141
- Single screenshot is sufficient; no video required:
142
-
143
- ```bash
144
- agent-device --session {SESSION} screenshot {OUTPUT_DIR}/screenshots/issue-{NNN}.png
145
- ```
146
-
147
- Set **Repro Video** to `N/A` in the report.
148
-
149
- ### 6. Wrap Up
150
-
151
- Target 5-10 well-evidenced issues, then finish:
152
-
153
- 1. Reconcile summary severity counts in `report.md`.
154
- 2. Close session:
155
-
156
- ```bash
157
- agent-device --session {SESSION} close
158
- ```
159
-
160
- 3. Report total issues, severity breakdown, and highest-risk findings.
161
-
162
- ## Guidance
163
-
164
- - Repro quality matters more than issue count.
165
- - Use refs (`@eN`) for fast exploration, selectors for deterministic replay assertions when needed.
166
- - Re-snapshot after any mutation (navigation, modal, list update, form submit).
167
- - Use `fill` for clear-then-type semantics; use `type` for incremental typing behavior checks.
168
- - Keep logs optional and targeted: enable/read app logs only when useful for diagnosis.
169
- - If the issue appears rooted in React Native internals rather than device/app runtime behavior, use `agent-device react-devtools ...` and the `skills/react-devtools` workflow for component-tree or render-profiling inspection.
170
- - Never read source code of the app under test; findings must come from observed runtime behavior.
171
- - Write each issue immediately to avoid losing evidence.
172
- - Never delete screenshots/videos/report artifacts during a session.
173
-
174
- ## References
175
-
176
- | Reference | When to Read |
177
- | ------------------------------------------------------------ | ----------------------------------------------- |
178
- | [references/issue-taxonomy.md](references/issue-taxonomy.md) | Start of session; severity/categories/checklist |
179
-
180
- ## Templates
23
+ Loop: open named session -> snapshot -i + screenshot -> explore flows -> capture evidence per issue -> close.
181
24
 
182
- | Template | Purpose |
183
- | ---------------------------------------------------------------------------- | --------------------------------------------- |
184
- | [templates/dogfood-report-template.md](templates/dogfood-report-template.md) | Copy into output directory as the report file |
25
+ Target app is required; infer platform or ask. Findings must come from runtime behavior, not source reads. Let `help dogfood` provide exact report shape, evidence commands, and current workflow guidance.
@@ -1,55 +1,39 @@
1
1
  ---
2
2
  name: react-devtools
3
- description: Inspect and profile React Native component trees from agent-device. Use when debugging React Native props, state, hooks, render causes, slow components, excessive re-renders, or questions like why a component re-rendered.
3
+ description: Inspect and profile React Native component trees from agent-device. Use for React Native performance, profiling, props, state, hooks, render causes, slow components, excessive rerenders, or questions like why a component rerendered.
4
4
  ---
5
5
 
6
6
  # react-devtools
7
7
 
8
- Use this skill when the task needs React Native internals that are not visible in the accessibility tree: component hierarchy, props, state, hooks, render causes, or profiling data.
8
+ Router for React Native internals. Private setup before using this skill:
9
9
 
10
- Run commands through `agent-device react-devtools`. The command dynamically runs pinned `agent-react-devtools@0.4.0` and passes arguments through 1:1.
10
+ ```bash
11
+ agent-device --version
12
+ ```
11
13
 
12
- The first run may download the pinned package from npm. `agent-device` global flags work before or after `react-devtools`; use `--` before downstream flags only when they intentionally share an `agent-device` global flag name.
14
+ Require `agent-device >= 0.14.0`; 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.
13
15
 
14
- ## Default flow
16
+ Read current CLI guidance:
15
17
 
16
- 1. Use `agent-device` to open the React Native app and verify the visible state when needed.
17
- 2. Check `agent-device react-devtools status`.
18
- 3. If no app is connected, start or wait for the devtools daemon, then reload or relaunch the app.
19
- 4. Inspect with `get tree`, `find`, and `get component`.
20
- 5. Profile only around the interaction being investigated.
21
- 6. Verify the fix with the same command sequence and interaction.
18
+ ```bash
19
+ agent-device help react-devtools
20
+ ```
22
21
 
23
- For cross-platform validation with explicit `--device`, `--udid`, or `--serial` selectors, prefer an isolated `--state-dir` over separate named sessions. Named sessions enable bound-session locks during setup. Restart `agent-device react-devtools` between iOS and Android runs so `status`, `get tree`, and profiling clearly refer to the currently launched app.
22
+ Use `agent-device react-devtools ...` for component tree, props, state, hooks, render ownership, performance profiling, slow components, or rerenders. It dynamically runs pinned `agent-react-devtools@0.4.0`. Use normal `agent-device` commands for visible UI, refs, screenshots, logs, network, or device-level perf.
24
23
 
25
- ## Main commands
24
+ Core loop:
26
25
 
27
26
  ```bash
28
27
  agent-device react-devtools status
29
28
  agent-device react-devtools wait --connected
30
29
  agent-device react-devtools get tree --depth 3
31
- agent-device react-devtools find <ComponentName>
32
- agent-device react-devtools get component @c5
33
30
  agent-device react-devtools profile start
31
+ # perform the interaction with normal agent-device commands
34
32
  agent-device react-devtools profile stop
35
33
  agent-device react-devtools profile slow --limit 5
36
34
  agent-device react-devtools profile rerenders --limit 5
37
35
  ```
38
36
 
39
- ## Decision rules
40
-
41
- - Need current UI text, refs, screenshots, logs, network, or device metrics: use the `agent-device` skill.
42
- - Need props, state, hooks, component ownership, render causes, or React profiler data: use this skill.
43
- - Start component-tree reads with `get tree --depth 3` or `find <name>` to keep output bounded.
44
- - Labels like `@c5` reset when the app reloads or components remount. After reload, run `wait --connected` and inspect again.
45
- - Profiling only captures renders between `profile start` and `profile stop`.
46
- - On Android, set `adb reverse tcp:8097 tcp:8097` for React DevTools. If Metro is local, also set `adb reverse tcp:8081 tcp:8081`.
47
- - For Android sessions connected through `agent-device connect --remote-config`, run `agent-device react-devtools ...` normally. The CLI registers a bridge companion tunnel to the local DevTools daemon on `127.0.0.1:8097` and unregisters it when the command exits.
48
- - Remote Android React DevTools assumes the React Native-bundled DevTools behavior in React Native 0.83+. Do not assume older browser/Chromium DevTools workflows exist in remote sandboxes. For Expo apps, verify the SDK's bundled React Native version and runtime behavior first; no Expo SDK version is separately verified by this skill.
49
-
50
- ## References
37
+ Rules:
51
38
 
52
- | File | When to read |
53
- | --------------------------------------- | --------------------------------------------- |
54
- | [commands.md](references/commands.md) | Command reference and common inspection flows |
55
- | [profiling.md](references/profiling.md) | Render profiling workflow and interpretation |
39
+ Keep reads bounded with `--depth`/`find`, treat `@c` refs as reload-local, profile only the investigated interaction, and run the same command in remote Android sessions; the CLI manages the needed local service tunnel.