@swmansion/argent 0.35.1-next.9 → 0.35.1-next.90

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 (59) hide show
  1. package/README.md +16 -15
  2. package/bin/argent-android-devtools-0.4.0.apk +0 -0
  3. package/bin/darwin/argent-macos-helper +0 -0
  4. package/bin/darwin/ax-service +0 -0
  5. package/bin/darwin/tvos-ax-service +0 -0
  6. package/bin/darwin/tvos-hid-daemon +0 -0
  7. package/bin/network-inspector/network-inspector.jar +0 -0
  8. package/bin/tcp/ax-service +0 -0
  9. package/dist/cli-cmds.mjs +3275 -2158
  10. package/dist/cli.js +22 -3
  11. package/dist/cli.js.map +1 -1
  12. package/dist/client.js +844 -457
  13. package/dist/fatal-handlers.d.ts +1 -0
  14. package/dist/fatal-handlers.js +8 -2
  15. package/dist/fatal-handlers.js.map +1 -1
  16. package/dist/installer-help.js +4 -2
  17. package/dist/installer-help.js.map +1 -1
  18. package/dist/installer.mjs +823 -726
  19. package/dist/mcp-server.mjs +2107 -1563
  20. package/dist/tool-args.generated.d.ts +413 -326
  21. package/dist/tool-server.cjs +14071 -8488
  22. package/dylibs/libArgentAudio.dylib +0 -0
  23. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  24. package/dylibs/libKeyboardPatch.dylib +0 -0
  25. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  26. package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
  27. package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
  28. package/dylibs/tcp/argent-audio-feeder +0 -0
  29. package/dylibs/tcp/libArgentAudio.dylib +0 -0
  30. package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
  31. package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
  32. package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
  33. package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
  34. package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
  35. package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
  36. package/package.json +2 -2
  37. package/skills/argent-android-emulator-setup/SKILL.md +2 -2
  38. package/skills/argent-create-e2e/SKILL.md +2 -1
  39. package/skills/argent-create-e2e/references/e2e-yaml.md +32 -5
  40. package/skills/argent-create-e2e/references/live-authoring.md +14 -4
  41. package/skills/argent-device-interact/SKILL.md +21 -94
  42. package/skills/argent-device-interact/references/advanced.md +64 -0
  43. package/skills/argent-ios-device-interact/SKILL.md +1 -1
  44. package/skills/argent-ios-device-setup/SKILL.md +1 -1
  45. package/skills/argent-ios-simulator-setup/SKILL.md +1 -1
  46. package/skills/argent-lens/SKILL.md +1 -1
  47. package/skills/argent-macos-app-interact/SKILL.md +3 -2
  48. package/skills/argent-macos-app-interact/references/e2e.md +1 -0
  49. package/skills/argent-metro-debugger/SKILL.md +4 -4
  50. package/skills/argent-native-profiler/SKILL.md +1 -1
  51. package/skills/argent-qa-e2e/SKILL.md +1 -1
  52. package/skills/argent-react-native-app-workflow/SKILL.md +1 -1
  53. package/skills/argent-react-native-optimization/SKILL.md +1 -1
  54. package/skills/argent-react-native-profiler/SKILL.md +1 -1
  55. package/skills/argent-screen-recording/SKILL.md +1 -1
  56. package/skills/argent-screenshot-diff/SKILL.md +1 -1
  57. package/skills/argent-settings-permissions/SKILL.md +1 -1
  58. package/skills/argent-test-ui-flow/SKILL.md +1 -1
  59. package/skills/argent-tv-interact/SKILL.md +1 -1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.35.1-next.9",
3
+ "version": "0.35.1-next.90",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",
@@ -98,5 +98,5 @@
98
98
  "vitest": "^5.0.5",
99
99
  "yaml": "^2.9.1"
100
100
  },
101
- "gitHead": "aa8a0c6bf0326f7fff85d0cab3a2ea0613e5d6e8"
101
+ "gitHead": "caa5e59eb10ccf32347bc4ffa209da8068bc9851"
102
102
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-android-emulator-setup
3
- description: Set up and connect to an Android emulator using argent MCP tools. Use when starting a new session on Android, booting an emulator, getting a device serial, or before any UI interaction task.
3
+ description: Boot an Android emulator and find its serial with Argent. Use when no Android emulator is running yet or you need to pick and boot one.
4
4
  ---
5
5
 
6
6
  ## 1. Prerequisites
@@ -14,7 +14,7 @@ The Android SDK (platform tools and emulator) and an AVD, created in Android Stu
14
14
 
15
15
  ## 3. Using the device
16
16
 
17
- Pass the Android serial as `udid` to the same interaction tools as on iOS. See `argent-device-interact` for interaction tooling and the Android notes at the bottom of that skill. If a React Native app can't reach Metro, see `argent-metro-debugger` §1.
17
+ Pass the Android serial as `udid` to the same interaction tools as on iOS. See `argent-device-interact` (and its `references/advanced.md` for Android notes). If a React Native app can't reach Metro, see `argent-metro-debugger` §1.
18
18
 
19
19
  ## 4. Notes
20
20
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-create-e2e
3
- description: Create, record, edit, replay, or repair reusable Argent e2e test YAML files. Use when the user asks to record, replay, or run an e2e test or a repeatable device path, set up profiling or an A/B comparison, or invoke the authoring engine behind argent-qa-e2e. Also use before repeating three or more interactions. For one-off UI checks, acceptance-driven regression tests, or screen video, use argent-test-ui-flow, argent-qa-e2e, or argent-screen-recording respectively.
3
+ description: Create, record, edit, replay, or repair reusable Argent e2e test YAML files. Use when the user asks to record, replay, or run an e2e test or repeatable path, set up profiling/A-B comparison, or before repeating 3+ interactions. For one-off UI checks, writing QA regression tests, or screen video, use argent-test-ui-flow, argent-qa-e2e, or argent-screen-recording.
4
4
  ---
5
5
 
6
6
  # Create an Argent e2e test
@@ -13,6 +13,7 @@ For a saved QA test case, ticket, or acceptance criterion, load `argent-qa-e2e`
13
13
 
14
14
  - Before creating or changing an e2e test, read [Live authoring](references/live-authoring.md) completely.
15
15
  - When polishing, composing, or manually reviewing YAML, read [E2E YAML](references/e2e-yaml.md). For Vega, read its platform limits before recording remote or keyboard tools.
16
+ - After you edit the YAML by hand, run `argent e2e check <file>`. It finds the problems that make `argent e2e run` refuse the test before the first step, without a device.
16
17
  - E2E tests run on physical iPhones (an iOS `list-devices` entry with kind `"device"`), but replay never auto-binds one, even when no simulator is booted: pass the phone's udid as `device` (CLI `--device`), and only a `connected` phone can run. `pinch`/`rotate` steps need the app drawn in portrait. On hardware the runner tree is the `describe` tree: same ids and roles, no UIView hierarchy. See `argent-ios-device-interact` for the hardware contract.
17
18
  - On capture warnings, raw coordinates, unavailable trees, mistimed transitions, overlays, or replay failures, read [Reliability and recovery](references/reliability-and-recovery.md).
18
19
 
@@ -233,6 +233,14 @@ Use `when:` only for optional setup or an interstitial that reconverges:
233
233
 
234
234
  Use a UI condition (`exists`, `visible`, `hidden`, or `text`), an [output check](#pass-values-between-steps), or a platform guard (`{ platform: ios|android|chromium|vega|macos }`). A run on a remote simulator matches `ios`. UI guards use the short assert grace and reject `timeout`. There is no `else` or per-step `optional`. Put separate behavioral paths in separate tests. Never place a required acceptance check inside `when:`.
235
235
 
236
+ ## Shutdown
237
+
238
+ Put cleanup in `shutdown:` so it runs after `steps` pass or fail. A cancellation skips any remaining cleanup. A run refused before its first step skips shutdown entirely. Independent shutdown entries continue after a failure. Group dependent steps in one `when:` block so the chain stops at its first failure.
239
+
240
+ If setup can stop before writing an output, guard the cleanup with `when: { output: user.id, exists: true }` or supply a fallback the cleanup handles. A `run:` fragment queues its shutdown for the end of the run, most recently loaded first. If the fragment runs more than once, collect IDs in an output list and use `pop()` in its shutdown script. A separate `tool: e2e-execute` run performs its own cleanup.
241
+
242
+ Inspect `shutdownFailed` and the steps marked `shutdown: true` before rerunning. See [Shutdown](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#shutdown).
243
+
236
244
  ## Composition and platform limits
237
245
 
238
246
  A `run:` target is a YAML path resolved against the directory of the test file containing the step, so `../shared/login.yaml` reaches a sibling directory rather than the project root. The `.yaml` suffix is optional: `run: login` and `run: login.yaml` both name `login.yaml` beside the test. A bare name that is missing beside a test in `.argent/e2e/` is also looked up in `.argent/flows/`, and the reverse. The recorder writes a nested test that is only in the other directory by its path, for example `run: ../flows/login.yaml`.
@@ -249,16 +257,16 @@ A `run:` target is a YAML path resolved against the directory of the test file c
249
257
  ```yaml
250
258
  - script: { path: ../../scripts/seed-order.mjs }
251
259
  - script: { path: ../../scripts/seed-order.mjs, timeout: 60000 }
252
- - script: { path: ../../scripts/seed-order.mjs, env: { API_TOKEN: "{{secret:API_TOKEN}}" } }
260
+ - script: { path: ../../scripts/seed-order.mjs, env: { API_TOKEN: "{{var:API_TOKEN}}" } }
253
261
  ```
254
262
 
255
263
  Use the map form shown above. A bare `script: scripts/seed.mjs` is invalid.
256
264
 
257
265
  `path` is relative to the test file that contains the step. Use an `.mjs` or `.js` file, or an `.mts` or `.ts` file for TypeScript, and match the file name's letter case. `timeout` is in milliseconds, as in `e2e-add-script`.
258
266
 
259
- Use top-level `env` for script defaults, step `env` for one script, and `--env NAME=value` or `e2e-execute.env` for run overrides. The last layer to set a name wins. A `run:` fragment fills missing defaults. Pass overrides explicitly to a separate `tool: e2e-execute` run.
267
+ Scripts get ordinary [vars](#vars) through `process.env`. Use step `env` to pass a secret var explicitly or override a value for one script. To let `--var` override an `env` entry, use `"{{var:NAME}}"` as its value.
260
268
 
261
- Quote non-string YAML scalars, such as `PORT: "8080"`. Use `{{secret:NAME}}` for credentials and keep credentials out of logs. If a secret is missing, check the secret sources for the run's project root. See [Environment values](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#environment-values) for the value rules and redaction limits.
269
+ Quote numbers and booleans in `env`, for example `PORT: "8080"`. If a secret is missing, check the sources listed in the error. For a local call, check where the `argent` command or the MCP server started. See [Secret lookup](https://docs.swmansion.com/argent/docs/reference/configuration#secrets) for setup and [Script environment](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#script-environment) for excluded host names and redaction limits.
262
270
 
263
271
  `.mjs` and `.mts` are always ES modules. `.js` and `.ts` take their module type from the project's `package.json` `type` field; with no `type`, Node reads a file with `import`, `export` or top-level `await` as an ES module, and each other file as CommonJS. So prefer `.mjs` or `.mts` for a new script and use `.js` or `.ts` for a script the project already has. `.cjs` and `.cts` are invalid: under `"type": "module"`, use `import` in the script, not `require`.
264
272
 
@@ -270,11 +278,30 @@ Node runs `.mts` and `.ts` by removing the types, and it does not read `tsconfig
270
278
 
271
279
  If the reason says that the Node.js of the tool-server cannot run TypeScript, use `.mjs` or `.js` files.
272
280
 
281
+ A script reads the run's device from three environment variables: `ARGENT_DEVICE_ID` (the `list-devices` id), `ARGENT_DEVICE_PLATFORM` (for example `ios`, `ios-remote`, `android`, `chromium`) and `ARGENT_DEVICE_KIND` (`simulator`, `emulator`, `device`, `vvd`, `app` or `catalyst`). A run without a device leaves all three unset. A name set in an `env` layer wins over the device value. An `ext:` id (device provider) or an `ios-remote` id is not one that `xcrun simctl` or `adb` accepts. A HarmonyOS id is `harmony-<connectKey>`; strip `harmony-` before `hdc -t`. A simulator from `ios.additionalDeviceSets` (for example Radon IDE) needs `xcrun simctl --set <dir>`. When the test runs on a device, pass that device's id as `udid` to `e2e-add-script`, so the recorded run gets the same values as a replay; omit it for a test of script steps alone. The id is not written to the test file.
282
+
273
283
  Over a link (`argent link` or `ARGENT_TOOLS_URL`, also to 127.0.0.1), `e2e-add-script` refuses the call, and a replay rejects a test with a `script:` step. Record and replay a test with a script without a link.
274
284
 
285
+ ### Vars
286
+
287
+ Define test inputs under `vars:`. Override defaults with `--var NAME=value` or `e2e-execute.vars`. Use `run:` to inherit the caller's vars. For a separate `tool: e2e-execute` run, pass any overrides explicitly.
288
+
289
+ ```yaml
290
+ vars:
291
+ USER_NAME: alice
292
+ PASSWORD: "{{secret:ALICE_PASSWORD}}"
293
+ steps:
294
+ - type: { into: { id: user }, text: "{{var:USER_NAME}}" }
295
+ - type: { into: { id: password }, text: "{{var:PASSWORD}}" }
296
+ ```
297
+
298
+ Use quoted var references in the same fields as output references. For an unset var, supply a value or add a fallback such as `"{{var:USER_NAME ?? guest}}"`.
299
+
300
+ Use secret placeholders for credentials, including values passed with `--var`. Pass secret vars in typed text, tool arguments, or explicit script `env` entries. Use ordinary vars in selectors and checks. See [Vars in the YAML reference](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#vars) for validation and precedence rules.
301
+
275
302
  ### Pass values between steps
276
303
 
277
- Save JSON data to the global `output`, for example `output.user = { id: "user-7" }`. Record scripts one at a time so each starts with the previous output. Inspect `e2e-add-script.outputJson` before writing a reference. A `run:` fragment shares output. For a separate `tool: e2e-execute` run, pass inputs through `env`.
304
+ Save JSON data to the global `output`, for example `output.user = { id: "user-7" }`. Record scripts one at a time so each starts with the previous output. Inspect `e2e-add-script.outputJson` before writing a reference. A `run:` fragment shares output. For a separate `tool: e2e-execute` run, pass inputs through `vars`.
278
305
 
279
306
  Quote references in YAML, such as `"{{output:user.id}}"`. Use dotted keys and indexes (`items.0.id`). If a script may be skipped, guard the use with an output check or provide a literal fallback, such as `"{{output:user.id ?? guest}}"`. For a required check, use `assert: { output: user.id, exists: true }`.
280
307
 
@@ -282,7 +309,7 @@ Use references in selectors, typed text, equality or contains checks, tool argum
282
309
 
283
310
  ## Snapshots and CLI runs
284
311
 
285
- `argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|macos|ios-remote] [--update-baselines] [--env NAME=value] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
312
+ `argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|macos|ios-remote] [--update-baselines] [--var NAME=value] [--secrets-file <path>] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
286
313
 
287
314
  A screenshot is human evidence. A `snapshot:` is executable visual verification. A missing baseline or excessive mismatch fails. A `cropOn` size change also fails. Use snapshots for color, layout, size, spacing, typography, clipping, overflow, images, icons, or stable component appearance. Use full screen for global changes and `cropOn` for one component.
288
315
 
@@ -30,12 +30,20 @@ Over a link, `e2e-add-step` refuses a call whose step a replay over the same lin
30
30
 
31
31
  Obey these lifecycle rules:
32
32
 
33
- 1. Choose a name unique to the task: another caller can take over the same `name` + `project_root` pair without an ownership check. The pair is keyed by the file the filesystem resolves to, not the spelling you passed, so a differently-cased name or a symlinked `.argent/e2e` collides too. That collision is reported: the second start says `restarted`, and the first recording's next call fails naming both spellings.
33
+ 1. Give each concurrent recording its own device and a name unique to the task. Steps run live, so two recordings on one device change each other's screens. Another caller can also take over the same `name` + `project_root` pair without an ownership check. The pair is keyed by the file the filesystem resolves to, not the spelling you passed, so a differently-cased name or a symlinked `.argent/e2e` collides too. That collision is reported: the second start says `restarted`, and the first recording's next call fails naming both spellings.
34
34
  2. Treat `e2e-start-recording` as destructive. It truncates the named YAML even when it holds a finished or committed test. `restarted` reports only a displaced live take.
35
35
  3. If a call says the recording is inactive, do not restart under that name. The completed take can still be on disk. Copy it aside or record under a fresh name.
36
36
  4. Read `recorded` after each call. The recorder does not always store the tool call you made, and that line is where a rewrite shows up. The recorder still appends `await-ui-element` and `await-network-request` steps that return `success: false`. Check the warning before continuing. To see the whole file mid-recording, read it at `savedTo`. A `null` `savedTo` means only the write on your side failed: the step is still in the recording, the next step rewrites the whole file, and `e2e-finish-recording` returns `e2eTestFile` regardless.
37
37
  5. Edit or reorder the YAML only after `e2e-finish-recording`.
38
- 6. Set script defaults with `e2e-start-recording.env` or call `e2e-set-env` directly before recording the script. Use `e2e-add-script.env` for values specific to one step. The tool runs the script immediately. If a secret is missing, check the project’s secret sources before retrying.
38
+ 6. Set vars with `e2e-start-recording.vars` or call `e2e-set-vars` directly before recording steps that use them. For a fragment that expects a caller's var, set a recording default or add a fallback. See [Vars](e2e-yaml.md#vars) before adding references to the YAML.
39
+
40
+ ## Record cleanup after the main steps
41
+
42
+ Pass `shutdown: true` to `e2e-add-step` or `e2e-add-script` for cleanup. Use the same flag on `e2e-add-echo` to label it. Actions and scripts run during the call. Check the `recorded` line for the `shutdown` prefix and read any wait warning before continuing.
43
+
44
+ A fragment recorded as `run:` in the main list usually defers cleanup until the first shutdown action or script, or until `e2e-finish-recording`. Read `fragmentShutdown` and the call message before assuming cleanup passed. If the call was cancelled, finish the recording or retry the shutdown call to run queued cleanup.
45
+
46
+ For an uploaded fragment or one that starts its own Chromium app, read the message for cleanup that ran immediately. If later steps need the state it removed, record the fragment's main steps individually and its cleanup with `shutdown: true`. Replace those steps after `e2e-finish-recording`. See [Shutdown](e2e-yaml.md#shutdown) for replay order.
39
47
 
40
48
  ## Start in the correct order
41
49
 
@@ -149,9 +157,11 @@ A warning does not reject the step. If `e2e-finish-recording` reports dropped wa
149
157
 
150
158
  On iOS simulators, Android, Mac apps, and Chromium, use `e2e-add-step` to record `network-capture-start`, the action, `await-network-request`, and `network-capture-stop` in that order. Put capture start after launch and the first-screen wait. A start before `launch:` makes the test a fragment. Use [Inspect network requests](../../argent-metro-debugger/SKILL.md#inspect-network-requests) for platform setup.
151
159
 
152
- - Keep the wait as a raw `tool:` step. A log listing can pass with an empty log. Match a part of the URL that contains no secret. On Android, capture can slow the app: start just before the action and stop right after the wait. When collecting several related requests, stop after the last check.
160
+ - Use `absent: true` for a check that should fail on a match. Keep start before the action to catch requests the action sends. For later traffic only, record the action first and allow any earlier native requests to reach capture before starting a new window.
161
+ - When recording a URL, body, or header comparison against a secret, use `{{secret:NAME}}` in the step.
162
+ - Keep the wait as a raw `tool:` step. A log listing can pass with an empty log. On Android, capture can slow the app: start just before the action and stop right after the wait. When collecting several related requests, stop after the last check.
153
163
  - If the recorder reports `NETWORK_CAPTURE_NOT_STARTED`, record the missing start, then repeat and record the action and the wait. Replay only uses recorded steps.
154
- - If the recorder saves a failed wait, inspect `toolResult.nearMisses` for an `unmet` wait. Restore capture and repeat the action for `unreadable`. Record a new wait if cancelled. Remove superseded steps after `e2e-finish-recording`.
164
+ - If a recorded wait reports `unmet`, inspect `toolResult.nearMisses` for a missing match or `toolResult.match` for a forbidden request. For `unreadable`, restore capture from the result's notes and record a new window with the action and wait. Record a new wait if cancelled. Remove superseded steps after `e2e-finish-recording`.
155
165
  - On replay, verify the relevant layer's `armed` and `reason` in the start and stop results. On Chromium, stop can report `armed: false` even when there was no window. If a failed step skips the stop, stop capture before replaying.
156
166
 
157
167
  On Vega, call `view-network-logs` before the action to start JavaScript capture. Read the log again after the action to inspect the requests. `await-network-request` is unavailable on Vega.
@@ -1,103 +1,30 @@
1
1
  ---
2
2
  name: argent-device-interact
3
- description: Interact with an iOS simulator or iPhone, Android emulator or phone, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking visible app state after interactions. Not for TV targets.
3
+ description: Drive iOS, Android, or Chromium apps with Argent MCP tools. Use when tapping, swiping, typing, launching apps, waiting for UI, or taking screenshots (not for TV targets).
4
4
  ---
5
5
 
6
- Each tool's own description carries its parameters, defaults, return shape and examples. This skill covers choosing between tools and the gotchas those descriptions don't state.
6
+ Each tool's description carries its parameters, defaults, and return shape. This skill covers routing and gotchas those descriptions don't state.
7
7
 
8
- ## 1. Before You Start
8
+ ## Target Routing
9
9
 
10
- - Get a target id from `list-devices`; if none is ready, `boot-device` one. Full setup flow: `argent-ios-simulator-setup` / `argent-ios-device-setup` / `argent-android-emulator-setup`. The same tool names drive iOS, Android and Chromium; each takes the `udid` from `list-devices`.
11
- - Physical iPhone (`kind: "device"`): read `argent-ios-device-interact` first. Only the tools it lists exist there, and `describe` sees only the app `launch-app` registered.
12
- - Mac app (`platform: "macos"`): read `argent-macos-app-interact` first.
13
- - Read the matching reference before driving these targets: `references/chromium.md` for a `chromium` target, `references/harmonyos.md` for a `harmony` target, `references/foldables.md` for a device `list-devices` marks `foldable: true` (or before calling `fold`).
14
- - Load a deferred tool's schema with ToolSearch before its first call (e.g. `gesture-pinch`, `gesture-rotate`, `gesture-custom`); without it, numbers go out as strings and fail validation.
15
- - If you delegate device tasks to sub-agents, make sure they have MCP permissions.
10
+ - Get a `udid` from `list-devices` (or `boot-device` if none is ready). Full setup: `argent-ios-simulator-setup` / `argent-ios-device-setup` / `argent-android-emulator-setup`.
11
+ - Before driving a specialized target, read the matching instructions below:
12
+ - Physical iPhone (`kind: "device"`): `argent-ios-device-setup` and `argent-ios-device-interact`
13
+ - Mac app (`platform: "macos"`): `argent-macos-app-interact`
14
+ - TV (`runtimeKind: "tv"` or `platform: "vega"`): `argent-tv-interact`
15
+ - Chromium / HarmonyOS / foldables (`foldable: true`): `references/chromium.md`, `references/harmonyos.md`, `references/foldables.md`
16
+ - Load any deferred tool's schema (e.g. `gesture-custom`, `gesture-pinch`, `gesture-rotate`) before its first call so numbers don't serialize as strings.
17
+ - If delegating device tasks to sub-agents, ensure they have MCP permissions.
16
18
 
17
- ## 2. Choosing the Right Tool
19
+ ## Core Rules
18
20
 
19
- | Action | Tool | Notes |
20
- | ------------------------------ | -------------------- | -------------------------------------------------------------- |
21
- | Several known steps | `run-sequence` | One call, one screenshot at the end (§5) |
22
- | Open an app | `launch-app` | **Never tap home-screen icons** |
23
- | Restart an app | `restart-app` | Clean in-memory state |
24
- | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
25
- | Tap | `gesture-tap` | Buttons, links, checkboxes |
26
- | Scroll / swipe | `gesture-swipe` | Touch targets; not Chromium |
27
- | Scroll (Chromium) | `gesture-scroll` | Mouse wheel |
28
- | Drag (Chromium) | `gesture-drag` | Sliders, drag-and-drop, text selection |
29
- | Long press, drag & drop | `gesture-custom` | Also any other non-linear touch sequence |
30
- | Pinch / zoom | `gesture-pinch` | |
31
- | Two-finger rotation | `gesture-rotate` | |
32
- | Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
33
- | Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) |
34
- | Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app |
35
- | Rotate device | `rotate` | Orientation changes |
36
- | Fold device | `fold` | Foldables only: `references/foldables.md` |
37
- | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
38
- | Slow or offline network | `network-conditions` | iOS simulator app, Android emulator, or Chromium tab |
39
- | Wait for UI | `await-ui-element` | Block until an element is visible/hidden/exists/contains text |
40
- | Wait for idle | `await-screen-idle` | Block until a non-empty tree holds for `minStableMs` (§4) |
21
+ - **Open apps directly:** use `launch-app` or `open-url`, never tap home-screen icons. Use `restart-app` for clean in-memory state.
22
+ - **Use the returned element tree:** interaction tools already attach a downscaled screenshot and `--- Elements after action (describe) ---` with normalized `[0,1]` tap frames. Tap at a line's `tap=(x,y)` when it has one, else at the frame center. Call `describe` only when no fresh tree covers the current screen. Never derive routine tap coordinates from pixels.
23
+ - **Tree & screenshot IDs:** full trees/screenshots carry a `Tree id` / `Screenshot id`. When unchanged or slightly changed, a later result references that id (unchanged note or `-`/`+` diff); call `describe` or `screenshot` if that earlier result isn't in context. An identical tree does not mean the action did nothing.
24
+ - **Batch known steps:** use `run-sequence` when multiple consecutive steps are known ahead of time (scroll sweeps, type + enter, form fill + submit).
25
+ - **Text entry:** tap the field first (`keyboard` with no focus is a silent no-op). `keyboard` takes either `text` or `key`, not both. Keep `keyboard` as default; reserve `paste` for real paste flows (OTP, long tokens). Use `{{secret:<NAME>}}` placeholders for credentials and navigate/submit before capturing non-secure fields.
26
+ - **Wait server-side:** never poll `screenshot` or `describe` in a loop. Use `await-ui-element`, or use `await-screen-idle` before tapping moving UI.
27
+ - **Dialogs:** `describe` exposes simulator/emulator system & permission dialogs; prefer answering the app's dialog over `settings-permissions`.
28
+ - **Screenshots:** keep the default downscaled capture for UI checks; do not pass `scale: 1.0` as a tapping/readability aid.
41
29
 
42
- After a network test, call `network-conditions` with the same target and omit the conditions to reset. On Android, this brings an offline emulator back online. If an Argent crash leaves an emulator's proxy active, reset before retrying.
43
-
44
- ## 3. Finding Tap Targets
45
-
46
- After an action moves you to a different screen, or whenever you don't know an element's coordinates, discover before tapping. Interaction results already carry the element tree (`--- Elements after action (describe) ---`): use it, and call a discovery tool only when no fresh tree covers the current screen. Each full tree has a `Tree id`, and each full screenshot has a `Screenshot id`. When the tree or screenshot matches an earlier one (or only a few tree lines changed), the result names that id in place of repeating it (an unchanged note, or `-` gone / `+` new lines against it): refer back to the named result, and call `describe` or `screenshot` if it is not in your context. An identical tree does not mean the action did nothing.
47
-
48
- | Need | Tool |
49
- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
50
- | Any screen: app, system dialog, Home screen | `describe` |
51
- | UIKit properties of a view (iOS simulator) | `native-find-views` (needs `bundleId` and a class, id, label, tag or `nativeID` to match) |
52
- | What sits at a known raw point (iOS simulator) | `native-view-at-point` (the visually deepest view; `hitTest: true` for the view that receives touch) |
53
- | Final visual fallback | `screenshot`, only when the tools above cannot expose the control. Do not derive routine in-app navigation targets from pixels |
54
-
55
- If `describe` returns an empty tree, follow its `hint`; with no hint, the screen is blank, loading or unlabeled: check the attached screenshot and retry once content has loaded.
56
-
57
- For a React Native testID or component name that `describe` does not show, use `debugger-component-tree`; take tap points from `describe`.
58
-
59
- **React Native:** LogBox toasts sit over the bottom of the screen and catch taps meant for what is under them. Argent hides them when a `debugger-*` tool connects and after `debugger-reload-metro`; after `restart-app`, call a `debugger-*` tool again. After any other reload they come back: close each by tapping the right end of its `describe` frame (the X), not its middle.
60
-
61
- **System and permission dialogs:** on a simulator or emulator, `describe` returns a visible dialog's buttons with tap coordinates; keep using it for in-app modals too. Fall back to `screenshot` only if it does not expose the controls: then tap one obvious button (`Allow`, `OK`, `Don't Allow`, `Not Now`, `Continue`) at a time, check the returned screenshot, and go back to `describe` once the dialog is gone.
62
-
63
- > **Prefer the dialog over the Settings tool.** When the app triggers its own permission prompt, answering it is the real user path. Use `settings-permissions` only when you can't make the change through the app: set a permission _before_ the app asks, re-enable one the user denied (iOS won't re-prompt), or reset it so the prompt reappears. See `argent-settings-permissions`.
64
-
65
- ## 4. Waiting: `await-ui-element` and `await-screen-idle`
66
-
67
- **Never poll `screenshot`/`describe` in a loop to wait for something.** `await-ui-element` blocks server-side on the same tree `describe` reads. It has no bare-timer mode; for a plain pause, use your own harness sleep. Its description covers conditions, selector matching and defaults. What it does not tell you:
68
-
69
- - A `hidden` check that succeeds **immediately** may be a false pass: its `note` then says the selector never matched anything. Treat that as a failed check and fix the selector; it does not mean "the element went away".
70
- - The synthetic `ROOT` container `describe` prints is never matched, so a `role` like `AXGroup`/`html` won't trivially "match the screen".
71
- - To disambiguate a loose selector, pin `role` to a text role like `StaticText`; that skips a same-named button.
72
-
73
- `await-screen-idle` is for live diagnosis after a launch or navigation, before a raw tap on an element that may still be moving. Continue only when `settled: true`, and pair it with an `await-ui-element` for the destination: stillness does not identify a screen, and the tool can return during a presentation-layer animation. Do not record it in an e2e test; tests use `await: { idle: true }`, which also compares pixels.
74
-
75
- ## 5. Action Sequencing with `run-sequence`
76
-
77
- Use `run-sequence` when every step is known in advance; if a step depends on what the previous one shows, use separate calls. Its description lists the allowed tools and their arguments. Typical batches:
78
-
79
- - "scroll to bottom", "scroll until X": 3-5 swipes
80
- - "clear and retype a field": triple-tap to select all, then type the new value
81
- - typing then submitting: a `keyboard` text step, then a `keyboard` `enter` step (one call cannot carry both)
82
- - "submit form": fill every field, then tap submit
83
- - "go back to X": a known tap path
84
-
85
- Use `await-ui-element` to gate a step on a screen transition. To gate on a request, start capture before the sequence and put `await-network-request` after the triggering action. A failed step, including a wait with `success: false`, stops the sequence and returns partial results.
86
-
87
- ## 6. Text Entry and Secrets
88
-
89
- - Tap the field first. Typing or pasting with no focused field is a silent no-op.
90
- - `paste` is **not** a faster `keyboard`. `keyboard` types the way a user types and stays the default for every text entry. Use `paste` only where a real user would paste: a 2FA / OTP code from another app, a long link or token, or testing how the app handles pasted input. That it can carry text `keyboard` can't type on a platform (multi-line text, non-ASCII on Android) is not a reason on its own.
91
- - **Credentials:** type them as a `{{secret:<NAME>}}` placeholder in `text` (`keyboard`, `paste`, `run-sequence` keyboard steps, e2e `type` steps), never as plaintext, and never ask the user for the value. Do **not** `describe` or `screenshot` a non-secure field you just filled with a secret: submit or navigate away first, then verify the resulting screen.
92
-
93
- ## 7. Screenshots
94
-
95
- Interaction tools already attach a screenshot. Call `screenshot` for the initial state, for a baseline before you change visible UI, to check state after a delay, or when the attached capture shows a transitional or loading frame.
96
-
97
- Keep the default downscaled capture for UI context and state checks; do not use `scale: 1.0` as a readability or tapping aid. Full resolution is only for saving baseline/current PNGs for comparison (`scale: 1.0` with `includeImageInContext: false`); for visual regression checks use the `argent-screenshot-diff` skill.
98
-
99
- If `screenshot` times out, restart the device transport with `stop-simulator-server`.
100
-
101
- ## 8. Android notes
102
-
103
- - **First-launch permission prompts**: `reinstall-app` on Android installs with `-g`, so runtime permissions are pre-granted on first launch.
30
+ Read `references/advanced.md` when you need: the full tool table, `network-conditions` reset, React Native LogBox dismissal, an empty `describe` tree or a `screenshot` timeout, `await-ui-element`/`await-screen-idle` edge cases, `run-sequence` gating, `paste`/secrets rules, or Android `reinstall-app` notes.
@@ -0,0 +1,64 @@
1
+ # Advanced Interaction Notes
2
+
3
+ ## Tool Reference
4
+
5
+ | Action | Tool | Notes |
6
+ | --------------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
7
+ | Several known steps | `run-sequence` | One call, one screenshot at the end |
8
+ | Open / restart app | `launch-app` / `restart-app` | Never tap home-screen icons; `restart-app` clears in-memory state |
9
+ | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
10
+ | Tap / swipe | `gesture-tap` / `gesture-swipe` | Touch targets; not Chromium for swipe |
11
+ | Scroll / drag (Chromium) | `gesture-scroll` / `gesture-drag` | Mouse wheel; sliders, drag-and-drop, text selection |
12
+ | Long press, drag & drop | `gesture-custom` | Also any non-linear touch sequence |
13
+ | Pinch / rotate gesture | `gesture-pinch` / `gesture-rotate` | Two-finger gestures |
14
+ | Hardware key / rotate | `button` / `rotate` | Home, back, power, volume, appSwitch, actionButton; orientation changes |
15
+ | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
16
+ | Fold device | `fold` | Foldables only (`references/foldables.md`) |
17
+ | Type text / press named key | `keyboard` | Every platform; text or one key per call |
18
+ | Paste text | `paste` | Only where a user would paste; sim/emu, Mac app |
19
+ | Slow or offline network | `network-conditions` | iOS sim app, Android emu, or Chromium tab |
20
+ | Wait for UI / idle | `await-ui-element` / `await-screen-idle` | Server-side waits |
21
+
22
+ ## Network Conditions Recovery
23
+
24
+ After a network test, call `network-conditions` with the same target and omit the conditions to reset. On Android, this brings an offline emulator back online. If an Argent crash leaves an emulator's proxy active, reset before retrying.
25
+
26
+ ## Discovery & React Native LogBox
27
+
28
+ - **UIKit view lookup (iOS simulator):** `native-find-views` (needs `bundleId` and a class, id, label, tag, or `nativeID`) and `native-view-at-point` (visually deepest view; `hitTest: true` for touch target).
29
+ - **React Native component names / testIDs:** `debugger-component-tree` when `describe` omits them; still take tap points from `describe`.
30
+ - **React Native LogBox toasts:** sit over the bottom of the screen and catch taps meant for what is under them. Argent hides them when a `debugger-*` tool connects and after `debugger-reload-metro`; after `restart-app`, call a `debugger-*` tool again. After any other reload they come back: close each by tapping the right end of its `describe` frame (the X), not its middle.
31
+ - **Empty `describe` tree:** follow its `hint` if present. If there's no hint, the screen is blank, loading, or unlabeled. Check the attached screenshot and retry once content loads.
32
+ - **System / permission dialogs:** on a simulator or emulator, `describe` returns visible dialog buttons with tap coordinates (and in-app modals too). Fall back to `screenshot` only if `describe` omits them. Tap one obvious button (`Allow`, `OK`, `Don't Allow`, `Not Now`, `Continue`) at a time, check the screenshot, and return to `describe` once dismissed. Prefer answering the app's own dialog over `settings-permissions`. Use `settings-permissions` only to pre-authorize, re-enable a denied permission (iOS won't re-prompt), or reset prompts. See `argent-settings-permissions`.
33
+
34
+ ## Waiting: `await-ui-element` and `await-screen-idle`
35
+
36
+ - `await-ui-element` blocks server-side on the same tree `describe` reads. It has no bare-timer mode; for a plain pause, use your own harness sleep.
37
+ - The synthetic `ROOT` container `describe` prints is never matched, so a `role` like `AXGroup`/`html` won't trivially match the screen.
38
+ - To disambiguate a loose selector, pin `role` to a text role like `StaticText` to skip a same-named button.
39
+ - `await-screen-idle` is for live diagnosis after a launch or navigation before a raw tap on a moving element. Continue only when `settled: true`, and pair it with `await-ui-element` for the destination: stillness does not identify a screen, and the tool can return during a presentation-layer animation. Do not record it in an e2e test; tests use `await: { idle: true }`, which also compares pixels.
40
+
41
+ ## Action Sequencing with `run-sequence`
42
+
43
+ Use `run-sequence` when every step is known in advance; if a step depends on what the previous one shows, use separate calls. Typical batches:
44
+
45
+ - Scroll to bottom / until X: 3–5 swipes
46
+ - Clear and retype a field: triple-tap to select all, then type
47
+ - Type then submit: a `keyboard` text step, then a `keyboard` `enter` step
48
+ - Submit form: fill every field, then tap submit
49
+ - Known tap path: e.g. navigating back through screens
50
+
51
+ Use `await-ui-element` to gate a step on a screen transition. To gate on an HTTP request, start capture before the sequence and put `await-network-request` after the triggering action. A failed step (including a wait with `success: false`) stops the sequence with partial results.
52
+
53
+ ## Text Entry, Paste & Secrets
54
+
55
+ - Tap the field first; typing or pasting with no focused field is a silent no-op.
56
+ - `paste` is **not** a faster `keyboard`. Keep `keyboard` as the default; use `paste` only where a real user would paste (OTP/2FA codes, long links/tokens, or testing paste handling). Platform text limitations alone are not a reason to switch to `paste`.
57
+ - **Credentials:** pass `{{secret:<NAME>}}` placeholders in `text` (`keyboard`, `paste`, `run-sequence` keyboard steps, e2e `type` steps), never plaintext, and never ask the user for the value. Do **not** `describe` or `screenshot` a non-secure field you just filled with a secret: submit or navigate away first, then verify the resulting screen.
58
+
59
+ ## Screenshots & Android Notes
60
+
61
+ - Call `screenshot` for initial state, baselines before visible UI changes, state after a delay, or when an attached capture shows a transitional/loading frame.
62
+ - Keep the default downscaled capture for routine checks; reserve `scale: 1.0` (with `includeImageInContext: false`) for saving baselines/currents for `argent-screenshot-diff`.
63
+ - If `screenshot` times out, restart the device transport with `stop-simulator-server`.
64
+ - **Android first-launch permissions:** `reinstall-app` on Android installs with `-g`, pre-granting runtime permissions on first launch.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-ios-device-interact
3
- description: Drive a physical iPhone through argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator. For connection, trust, or signing problems read argent-ios-device-setup.
3
+ description: Drive a physical iPhone with Argent. Use when targeting a physical iPhone (list-devices kind "device") and ONLY then, never a simulator. For setup/signing, use `argent-ios-device-setup`.
4
4
  ---
5
5
 
6
6
  # Physical iPhone interaction
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-ios-device-setup
3
- description: Set up a physical iPhone over USB or a connected CoreDevice tunnel for argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator.
3
+ description: Set up a physical iPhone over USB or CoreDevice tunnel for Argent. Use when a physical iPhone is involved (kind "device") and ONLY then; never for a simulator.
4
4
  ---
5
5
 
6
6
  # Physical iPhone setup
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-ios-simulator-setup
3
- description: Set up and connect to an iOS simulator using argent MCP tools. Use when starting a new session, booting an iOS simulator, getting an iOS UDID, or before any iOS simulator interaction task.
3
+ description: Boot an iOS simulator and find its UDID with Argent. Use when no simulator is booted yet or you need to pick and boot one.
4
4
  ---
5
5
 
6
6
  ## 1. Setup Steps
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-lens
3
- description: Propose multiple visual design variants for on-screen elements and let the human pick in the Argent Lens window. Use when the user asks for design alternatives / options / A-B choices for a screen or component, or any time you have produced more than one candidate look for an element and want a human decision before committing.
3
+ description: Propose visual design variants for on-screen elements so the user can pick in Argent Lens. Use when presenting UI design alternatives or A/B choices.
4
4
  ---
5
5
 
6
6
  > **Prerequisite: feature flag.** This workflow is gated behind the `argent-lens` flag (off by default). Run `argent enable argent-lens` once before using it. If `propose_variant` comes back not-found, the flag is off; enable it and retry.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-macos-app-interact
3
- description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos, Mac Catalyst) through argent. Use when a list-devices entry has platform "macos", or the user names a Mac app, a macOS app or a native desktop app. Never for an iOS simulator, an iPhone, or an Electron or Chromium app (platform "chromium").
3
+ description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos, Catalyst) with Argent. Use when targeting platform "macos" or a native macOS app, never iOS or Electron/Chromium.
4
4
  ---
5
5
 
6
6
  `argent-device-interact` still applies for everything not listed here (`run-sequence`, `await-ui-element`, secrets).
@@ -24,7 +24,8 @@ description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos, Mac Ca
24
24
  - Zoom or rotate: `gesture-pinch` and `gesture-rotate` fail; use the app's own controls or shortcuts.
25
25
  - After a right-click (`gesture-tap` with `button: "right"`), the returned tree lists the menu items; a plain `gesture-tap` on one chooses it (the menu can stay in the tree for a moment while it closes). `keyboard` `escape` closes the menu; `enter` chooses nothing after a right-click, so tap the item.
26
26
  - For a Command-click or Shift-click, pass `modifiers` in the `gesture-tap` call. Check the returned tree for the expected selection.
27
- - No hover: a tooltip is out of reach.
27
+ - Find the row or region that reveals a hover-only control in the latest element tree. Run `gesture-hover` there and check the returned tree or screenshot. Use `await-ui-element` for a delayed control. Use `gesture-tap` directly for visible controls.
28
+ - Verify hover effects before moving the pointer again. To clear a hover, call `gesture-hover {leave: true}`. If the tree reports that the user took back the pointer, wait until they finish, then hover again.
28
29
  - `open-url`: the URL goes to the running app. A custom scheme must be one the app declares; `http` and `https` go to the app, not the browser; a `file:` URL opens that document in the app.
29
30
  - A SwiftUI `DisclosureGroup` opens only at its chevron, near the left end of its frame: a tap at the centre passes and does nothing. Tap along the left end in steps of about 0.008 until its `value` changes.
30
31
  - `menu-bar` for any menu command. An item listed `[disabled]` cannot be chosen right now: an edit command (Copy, Select All) needs the text field clicked first; while an alert is open only its own commands work, so answer the alert first. When a menu of the app is open, `choose` fails: send `keyboard {key: "escape"}`, then choose again.
@@ -3,4 +3,5 @@
3
3
  - Record the launch as a `restart-app` step, then write it as `launch: { macos: <bundle id> }` (keep `{ app, args }` if the recorder wrote args) so the runner picks the Mac app and starts it. Otherwise run with `--platform macos` or the device id: without them the runner never picks a Mac app.
4
4
  - A `swipe` is a mouse drag, a `long-press` a press and hold. `pinch` and `rotate` fail.
5
5
  - A right-click is `tap: { on: <selector>, button: right }`. For a Command-click, write `tap: { on: <selector>, modifiers: [command] }`. The recorder preserves `modifiers` from `gesture-tap` so replay holds the same keys.
6
+ - Record hover through `e2e-add-step` with `command: "gesture-hover"`. Argent saves it as `tool: gesture-hover`. Record the hover check with `await-ui-element` before moving the pointer again.
6
7
  - A file panel is a `tool: file-panel` step, a menu command a `tool: menu-bar` step (`args: { action: choose, path: [Edit, Select All] }`). Gate a branch with `when: { platform: macos }`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-metro-debugger
3
- description: Debug JavaScript with Argent in React Native apps on iOS, Android, Vega, and macOS, or in Chromium and Electron over CDP. Use when connecting to a runtime, inspecting React components, reading console logs, evaluating JavaScript, or inspecting and checking an app's HTTP requests.
3
+ description: Debug JS with Argent in React Native (iOS, Android, Vega, macOS) or Chromium/Electron (CDP). Use when reading console logs, inspecting React trees, evaluating JS, or checking HTTP requests.
4
4
  ---
5
5
 
6
6
  ## 1. Prerequisites
@@ -43,9 +43,9 @@ If `debugger-reload-metro` fails to reload the Mac app, use `restart-app` for an
43
43
  ### Inspect network requests
44
44
 
45
45
  1. Choose the log. Use `view-network-logs` for JavaScript or the active Chromium tab and `native-network-logs` for OkHttp or URLSession. The two logs can show the same request.
46
- 2. Start before triggering the request. On iOS simulators, Android, and Mac apps, call `network-capture-start`. Select `layer: "js"` or `layer: "native"` when you only need one. Check that the layer you need is armed. On Vega, read the JS log to start. On Chromium, read the log to attach or call start if you need a window for a request check.
47
- 3. After the action, use `await-network-request` to check for a specific request or read the logs to explore traffic. On Vega, use the log. On Chromium, use a valid placeholder bundle ID such as `argent.capture` for start, stop, and wait. The log includes traffic outside the window. For redirects, Chromium waits match the final URL and method. Other layers match the URL the app requested.
48
- 4. For an `unmet` wait, check the action and matcher against the near misses. For `unreadable`, follow the layer notes before repeating the action. A wait can restore recording while a JS window is active, but may miss requests sent before it reconnects.
46
+ 2. Open the capture window with `network-capture-start`. Start before the action to include its requests, or after it to check only later traffic. Allow earlier native requests to reach capture first in that case. Select `layer: "js"` or `layer: "native"` if you need only one, and check that it armed. On Vega, read the JS log to start capture. On Chromium, use a placeholder bundle ID such as `argent.capture` for start, stop, and wait. Read the log directly to attach without a window.
47
+ 3. Use `await-network-request` to check for a match, or set `absent: true` to check that none appears. Add a body or request header check when the URL and status alone cannot identify the expected call. For Chromium redirects, match the final URL and method. On Vega or when exploring traffic, read the log. Chromium logs include traffic outside the window.
48
+ 4. For `unmet`, check `nearMisses` for a missing match or `match` for a forbidden request. For `unreadable`, use `note` to find what Argent could not verify. If capture had a gap, start a new window once capture is ready and repeat the check. A JavaScript reconnection can resume capture with a gap.
49
49
  5. Pass an ID from the log or wait to `view-network-request-details`. Read Android native bodies you need before stopping. Stop the capture you started with `network-capture-stop`. Check `armed` and `reason` to confirm what stopped. On Chromium, a stop closes the window and leaves tab logging active.
50
50
 
51
51
  Keep the original `udid` for start, wait, stop, and native reads. On iOS simulators and Android, if shared Metro requires a logical ID, use it as `logicalDeviceId` on start and stop and as `device_id` on JS reads. For Mac apps, keep `macos-app-<bundle id>` for capture and JS reads, even on shared Metro. Check the project's Metro start script if the port is unclear. Pass the same port throughout when it differs from the device default. The wait reuses the target from start.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-native-profiler
3
- description: Diagnose native CPU hotspots, UI hangs, memory issues, and iOS app launch time. Use Instruments (xctrace) on iOS simulators, iPhones (launch time only) and Mac apps, or Perfetto on Android. Use when diagnosing native-level performance issues.
3
+ description: Profile native CPU hotspots, UI hangs, memory, and iOS launch time via Instruments (iOS/Mac) or Perfetto (Android). Use when diagnosing native performance issues.
4
4
  ---
5
5
 
6
6
  ## 1. Tools and platforms
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-qa-e2e
3
- description: Write repeatable QA regression e2e tests from test cases, tickets, or acceptance criteria. Use when the user asks to write, automate, or generate an e2e test or preserve an automated regression scenario, with deterministic setup, stable targets, executable structural or visual evidence, and two consecutive full passes. For one-off UI checks or replayable paths without acceptance criteria, use argent-test-ui-flow or argent-create-e2e. Supports iOS, Android, Chromium, Mac apps, and Vega (Fire TV), where recorded tv-remote steps replace touch directives. Apple TV and Android TV are unsupported; use argent-tv-interact there and report the limitation.
3
+ description: Write repeatable QA regression e2e tests from test cases, tickets, or acceptance criteria (iOS, Android, Chromium, Mac apps, Vega; not Apple TV/Android TV). Use when the user asks to write, automate, or generate an e2e test or preserve a regression scenario. For one-off checks or replayable paths without criteria, use argent-test-ui-flow or argent-create-e2e.
4
4
  ---
5
5
 
6
6
  # Create a QA regression e2e test
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-react-native-app-workflow
3
- description: Step-by-step workflows for developing or debugging React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing builds, diagnosing runtime errors, or running tests.
3
+ description: Develop and debug React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing builds, diagnosing runtime errors, or running tests.
4
4
  ---
5
5
 
6
6
  Physical iPhone (`kind: "device"`): Metro debugging and profiling tools reject it. Use a simulator. Exception: measure and profile app launch on the iPhone with `native-profiler-launch-analysis` (`argent-native-profiler` §4).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-react-native-optimization
3
- description: Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup / TTI (including iOS launch time). Delegates to argent-react-native-profiler for measurement.
3
+ description: Entry-point for React Native performance optimization; profiles first via `argent-react-native-profiler`. Use when the app feels slow, fixing re-renders or jank, or improving startup/TTI.
4
4
  ---
5
5
 
6
6
  ## Rules
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-react-native-profiler
3
- description: Profile a React Native Hermes app to measure re-render and CPU performance using argent profiler tools. Use when optimizing for performance, measuring before/after a fix, spotting slow components, diagnosing re-renders, checking CPU hotspots, or producing a ranked issue report.
3
+ description: Profile a React Native Hermes app for JS re-renders and CPU hotspots via Argent profiler tools. Use when measuring before/after performance, diagnosing re-renders, or finding CPU hotspots.
4
4
  ---
5
5
 
6
6
  This skill is complementary to `argent-react-native-optimization`, not a replacement for it.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-screen-recording
3
- description: Record a screen video with Argent on an iOS simulator, cabled iPhone, Android emulator or device, or Mac app. Use when the user asks for a screen recording or a video of a flow, interaction, animation, or other app behavior.
3
+ description: Record a screen video with Argent on iOS, Android, or Mac apps. Use when asked to capture a video clip of a flow, interaction, or animation.
4
4
  ---
5
5
 
6
6
  `screen-recording-start` and `screen-recording-stop` carry the options (`timeLimitSeconds`, `trimStatic`, `showTouches`) and the result fields. One recording per device at a time; different devices can record concurrently.