@swmansion/argent 0.6.1 → 0.7.0

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.
@@ -26,10 +26,10 @@ This skill is complementary to `argent-react-native-optimization`, not a replace
26
26
  | `profiler-cpu-query` | Targeted CPU investigation: top functions, time-windowed CPU, call trees, per-component CPU. |
27
27
  | `profiler-commit-query` | Targeted commit investigation: by component, time range, commit index, or cascade tree. |
28
28
  | `profiler-stack-query` | iOS Instruments drill-down: hang stacks, function callers, thread breakdown, leak details. |
29
- | `profiler-combined-report` | Cross-correlated report when both React Profiler and iOS Instruments ran in parallel. |
29
+ | `profiler-combined-report` | Cross-correlated report when both React Profiler and native profiler ran in parallel. |
30
30
  | `profiler-load` | List and reload previous profiling sessions from disk for re-investigation with query tools. |
31
31
 
32
- For native iOS profiling (CPU hotspots, UI hangs, memory leaks), see the `argent-ios-profiler` skill.
32
+ For native profiling (CPU hotspots, UI hangs, memory leaks), see the `argent-native-profiler` skill.
33
33
 
34
34
  ---
35
35
 
@@ -37,8 +37,8 @@ For native iOS profiling (CPU hotspots, UI hangs, memory leaks), see the `argent
37
37
 
38
38
  Follow these rules throughout the profiling workflow:
39
39
 
40
- - Start `react-profiler-start` and `ios-profiler-start` in parallel (two tool calls in one message). Both need `device_id`; use the same UDID for both so their data can be correlated later. This gives best coverage.
41
- - If the user only wants iOS-only, use the `argent-ios-profiler` skill workflow. Only skip `ios-profiler-start` if the user has **already explicitly said** they don't want native profiling in this session
40
+ - Start `react-profiler-start` and `native-profiler-start` in parallel (two tool calls in one message). Both need `device_id`; use the same UDID for both so their data can be correlated later. This gives best coverage.
41
+ - If the user only wants native profiling, use the `argent-native-profiler` skill workflow. Only skip `native-profiler-start` if the user has **already explicitly said** they don't want native profiling in this session
42
42
 
43
43
  ### After analysis: ask about next steps
44
44
 
@@ -56,7 +56,7 @@ When drilling down, chain query tool calls based on what you find:
56
56
 
57
57
  - A hot commit -> `profiler-commit-query` mode=`by_index` to see all components -> `profiler-cpu-query` mode=`component_cpu` for the slowest one -> `profiler-cpu-query` mode=`call_tree` for the hot function -> read the source file -> propose a fix.
58
58
  - A memory leak -> `profiler-stack-query` mode=`leak_stacks` to identify the responsible module -> read the native source if actionable.
59
- - An iOS hang -> `profiler-stack-query` mode=`hang_stacks` to get the native call chain -> correlate with React commit timing.
59
+ - A native hang -> `profiler-stack-query` mode=`hang_stacks` to get the native call chain -> correlate with React commit timing.
60
60
 
61
61
  ### After fixes: always re-profile
62
62
 
@@ -80,7 +80,7 @@ When profiling requires a specific interaction sequence (scroll a list, navigate
80
80
 
81
81
  Mind the react-native and ios-native profiler selection mentioned above when starting the session and start the tools. **Save `startedAtEpochMs` from the response** — you will need it for annotation offsets. Every subsequent profiler/query call in this session must use the same `device_id`. Before beginning, define lightweight success criteria with the user: which metric matters most (e.g., `totalRenderMs`, specific commit duration, render count for a component) and what threshold would be meaningful. This anchors later evaluation. On success:
82
82
 
83
- - if user asked you to perform the profiling, determine how to profile yourself using tools described in `argent-simulator-interact` skill.
83
+ - if user asked you to perform the profiling, determine how to profile yourself using tools described in `argent-device-interact` skill.
84
84
  - if the user stated they wish to perform the interaction themselves — suggest what interaction to perform (e.g. "scroll the list", "switch tabs") and wait for their reply.
85
85
  If you received information about **existing profiling session** being owned by another agent:
86
86
  - if session is marked as "stale", you may overtake it without prompting the user for allowance
@@ -92,7 +92,7 @@ After each `gesture-tap` or `gesture-swipe` call, record an annotation using the
92
92
 
93
93
  ### Step 2: Stop and collect
94
94
 
95
- Call `react-profiler-stop` **and** `ios-profiler-stop` in parallel. Only skip `ios-profiler-stop` if you did not start it in Step 1. Note `duration_ms` and `fiber_renders_captured`.
95
+ Call `react-profiler-stop` **and** `native-profiler-stop` in parallel. Only skip `native-profiler-stop` if you did not start it in Step 1. Note `duration_ms` and `fiber_renders_captured`.
96
96
  If `fiber_renders_captured: 0`, warn the user — React commit data may be missing.
97
97
 
98
98
  ### Step 3: Analyze
@@ -101,7 +101,7 @@ Call `react-profiler-analyze` with `port`, `device_id`, `project_root`, `platfor
101
101
 
102
102
  If you performed interactions using `gesture-tap`/`gesture-swipe`, pass `annotations` to mark when each action occurred. Each annotation's `offsetMs` must be computed as `tapTimestampMs - startedAtEpochMs`, where `tapTimestampMs` is the `timestampMs` returned by the gesture-tap/gesture-swipe tool and `startedAtEpochMs` was returned by `react-profiler-start`. Do **not** use `Date.now()` for this calculation — only server-side timestamps from the tool return values.
103
103
 
104
- If dual profiling, also call `ios-profiler-analyze`, then **you must** call `profiler-combined-report` for the cross-correlated view — do not skip this step when both profilers ran; the combined report surfaces correlations that individual reports miss.
104
+ If dual profiling, also call `native-profiler-analyze`, then **you must** call `profiler-combined-report` for the cross-correlated view — do not skip this step when both profilers ran; the combined report surfaces correlations that individual reports miss.
105
105
 
106
106
  The analyze report includes **CPU hotspots per commit** — showing exactly which JS functions ran during each slow React commit. Raw data is saved to disk automatically for later reload.
107
107
 
@@ -132,7 +132,7 @@ If you profiled multiple scenarios and need to revisit earlier data:
132
132
 
133
133
  1. Call `profiler-load` mode=`list` to see all saved sessions with timestamps (the list now also shows Runtime / Device / Metro bundle columns to help identify the right session).
134
134
  2. Call `profiler-load` mode=`load_react` session_id=`<timestamp>` device_id=`<UDID>` to reload React data. `device_id` scopes the reload into the `port:device_id` cache slot.
135
- 3. Call `profiler-load` mode=`load_instruments` session_id=`<timestamp>` device_id=`<UDID>` to reload iOS data.
135
+ 3. Call `profiler-load` mode=`load_native` session_id=`<timestamp>` device_id=`<UDID>` to reload native profiler data.
136
136
  4. Query tools now operate on the reloaded session data — **pass the same `device_id` you loaded with**, otherwise they will miss the cache.
137
137
 
138
138
  This is useful for before/after comparisons: profile, fix, re-profile, then reload the original session to compare metrics side by side.
@@ -32,7 +32,7 @@ Call `debugger-log-registry`. Returns a summary with entry counts by level, mess
32
32
 
33
33
  These require a completed profiling session (`react-profiler-stop` + `react-profiler-analyze`).
34
34
 
35
- ## CPU query (replaces react-profiler-cpu-summary)
35
+ ## CPU query
36
36
 
37
37
  ```json
38
38
  { "port": 8081, "device_id": "<UDID>", "mode": "top_functions", "top_n": 15 }
@@ -64,7 +64,7 @@ Call `profiler-commit-query`. Modes:
64
64
  { "device_id": "<UDID>", "mode": "hang_stacks", "hang_index": 0 }
65
65
  ```
66
66
 
67
- Call `profiler-stack-query` after `ios-profiler-analyze`. Modes:
67
+ Call `profiler-stack-query` after `native-profiler-analyze`. Modes:
68
68
 
69
69
  - `hang_stacks` — full CPU context during a specific hang.
70
70
  - `function_callers` — who calls a specific native `function_name`.
@@ -89,6 +89,6 @@ Call `profiler-load`. Modes:
89
89
 
90
90
  - `list` — show all saved profiling sessions (React + iOS) in `/tmp/argent-profiler-cwd/`.
91
91
  - `load_react` — reload a React profiler session by `session_id` + `device_id`. Populates the `port:device_id`-keyed in-memory cache for `profiler-cpu-query` and `profiler-commit-query` (which must be called with the same `device_id` afterward).
92
- - `load_instruments` — re-parse iOS Instruments XML by `session_id` and `device_id`. Populates session for `profiler-stack-query`.
92
+ - `load_native` — re-parse native profiler XML by `session_id` and `device_id`. Populates session for `profiler-stack-query`.
93
93
 
94
94
  Use this to revisit an earlier profiling session without re-profiling. Each `react-profiler-analyze` run saves raw data with a unique timestamp.
@@ -1,19 +1,30 @@
1
1
  ---
2
2
  name: argent-test-ui-flow
3
- description: Autonomously test an iOS app UI by running interact-screenshot-verify loops using argent simulator tools. Use when testing a UI flow, verifying login works, testing navigation, or running an end-to-end UI test scenario.
3
+ description: Autonomously test an app UI (iOS or Android) by running interact-screenshot-verify loops using argent MCP tools. Use when testing a UI flow, verifying login works, testing navigation, or running an end-to-end UI test scenario.
4
4
  ---
5
5
 
6
+ ## Platform-agnostic
7
+
8
+ The interaction tool names are identical on iOS and Android — `gesture-tap`, `gesture-swipe`, `describe`, `screenshot`, `launch-app`, etc. — and the tool-server auto-dispatches based on the `udid` you pass (UUID-shape → iOS, adb serial → Android).
9
+
10
+ Get a `udid` via:
11
+
12
+ | Platform | Setup skill | Find devices with |
13
+ | -------- | ------------------------------- | ----------------------------------------------------------- |
14
+ | iOS | `argent-ios-simulator-setup` | `list-devices` → `boot-device` with `udid` if none booted |
15
+ | Android | `argent-android-emulator-setup` | `list-devices` → `boot-device` with `avdName` if none ready |
16
+
6
17
  ## 1. Workflow
7
18
 
8
- All interactions go through argent MCP tools. Ensure the simulator is booted before starting.
19
+ All interactions go through argent MCP tools. Ensure the simulator/emulator is ready before starting.
9
20
 
10
21
  1. **Baseline screenshot**: Call `screenshot` to see the current UI state.
11
22
  2. **Find target**: Before tapping, use a discovery tool to get element coordinates:
12
- - **React Native apps**: use `debugger-component-tree` — it returns component names with (tap: x,y) coordinates. This is the preferred tool for RN apps. To use it, resolve the `argent-react-native-app-workflow` skill for setup.
13
- - **Standard iOS app screens and in-app modals**: use `describe` it returns the accessibility element tree with normalized frame coordinates.
14
- - **Permission prompts / system modal overlays**: still try `describe` first. Fall back to `screenshot` only if the overlay is not exposed reliably.
23
+ - **React Native apps**: use `debugger-component-tree` — it returns component names with (tap: x,y) coordinates. This is the preferred tool for RN apps on either platform. To use it, resolve the `argent-react-native-app-workflow` skill for setup; on Android you must also run `adb -s <serial> reverse tcp:8081 tcp:8081` so Metro is reachable from the device.
24
+ - **Standard app screens and in-app modals**: use `describe`. On iOS this returns the AX tree (falls back to native-devtools when AX is empty); on Android it returns the uiautomator tree in the same DescribeNode shape.
25
+ - **Permission prompts / system modal overlays**: try `describe` first. Fall back to `screenshot` only if the overlay is not exposed reliably.
15
26
  - **Fallback**: use `screenshot` to estimate where the desired component is, then verify immediately after the action.
16
- 3. **Interact**: Perform the action (`gesture-tap`, `gesture-swipe`, `paste`, etc.) — you receive a screenshot automatically.
27
+ 3. **Interact**: Perform the action (`gesture-tap`, `gesture-swipe`, `keyboard`, `button`, ...) — you receive a screenshot automatically.
17
28
  4. **Verify**: Check the returned screenshot for expected results. If it shows a loading/transitional state, retake with `screenshot`.
18
29
  5. **Repeat** for each step in the flow.
19
30
 
@@ -66,7 +77,7 @@ Steps:
66
77
 
67
78
  ## Tips
68
79
 
69
- - **Use `paste` for text entry** — faster and more reliable than key-by-key `keyboard`.
80
+ - **Use `paste` for text entry on iOS** — faster and more reliable than key-by-key `keyboard`. `paste` is iOS-only; on Android use `keyboard` instead.
70
81
  - **Use `gesture-custom` for long-press** context menus (800ms hold).
71
82
  - **Report clearly**: state what you expected, what you saw, and the verdict.
72
83
  - **Coordinate estimation**: center = 0.5, 0.5; top-third ~ 0.2; bottom-third ~ 0.8.
@@ -75,10 +86,11 @@ Steps:
75
86
 
76
87
  ## Related Skills
77
88
 
78
- | Skill | When to use |
79
- | ---------------------------------- | ------------------------------------------------ |
80
- | `argent-simulator-interact` | Detailed tool usage for tapping, swiping, typing |
81
- | `argent-simulator-setup` | Booting and connecting a simulator |
82
- | `argent-react-native-app-workflow` | Starting the app, Metro, build issues |
83
- | `argent-metro-debugger` | Breakpoints, console logs, JS evaluation |
84
- | `argent-create-flow` | Record a test sequence as a replayable flow |
89
+ | Skill | When to use |
90
+ | ---------------------------------- | ------------------------------------------------------- |
91
+ | `argent-device-interact` | Tool usage for tapping, swiping, typing (iOS + Android) |
92
+ | `argent-ios-simulator-setup` | Booting and connecting an iOS simulator |
93
+ | `argent-android-emulator-setup` | Booting and connecting an Android emulator |
94
+ | `argent-react-native-app-workflow` | Starting the app, Metro, build issues |
95
+ | `argent-metro-debugger` | Breakpoints, console logs, JS evaluation |
96
+ | `argent-create-flow` | Record a test sequence as a replayable flow |