@swmansion/argent 0.5.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.
- package/LICENSE +195 -0
- package/README.md +103 -0
- package/agents/argent-environment-inspector.md +106 -0
- package/agents/references/quality-control-checklist.md +45 -0
- package/bin/ax-service +0 -0
- package/bin/simulator-server +0 -0
- package/dist/Argent.tracetemplate +0 -0
- package/dist/auto-screenshot.d.ts +22 -0
- package/dist/auto-screenshot.js +79 -0
- package/dist/auto-screenshot.js.map +1 -0
- package/dist/cli/constants.d.ts +6 -0
- package/dist/cli/constants.js +12 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.js +466 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mcp-configs.d.ts +38 -0
- package/dist/cli/mcp-configs.js +724 -0
- package/dist/cli/mcp-configs.js.map +1 -0
- package/dist/cli/uninstall.d.ts +13 -0
- package/dist/cli/uninstall.js +389 -0
- package/dist/cli/uninstall.js.map +1 -0
- package/dist/cli/update.d.ts +1 -0
- package/dist/cli/update.js +126 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/utils.d.ts +27 -0
- package/dist/cli/utils.js +158 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +80 -0
- package/dist/cli.js.map +1 -0
- package/dist/content.d.ts +31 -0
- package/dist/content.js +59 -0
- package/dist/content.js.map +1 -0
- package/dist/launcher.d.ts +8 -0
- package/dist/launcher.js +183 -0
- package/dist/launcher.js.map +1 -0
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +228 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/tool-server.cjs +51288 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +53 -0
- package/rules/argent.md +121 -0
- package/scripts/postinstall.cjs +34 -0
- package/skills/argent-create-flow/SKILL.md +213 -0
- package/skills/argent-ios-profiler/SKILL.md +103 -0
- package/skills/argent-metro-debugger/SKILL.md +117 -0
- package/skills/argent-metro-debugger/references/failure-scenarios.md +10 -0
- package/skills/argent-metro-debugger/references/source-maps.md +27 -0
- package/skills/argent-react-native-app-workflow/SKILL.md +237 -0
- package/skills/argent-react-native-optimization/SKILL.md +64 -0
- package/skills/argent-react-native-optimization/references/fix-reference.md +14 -0
- package/skills/argent-react-native-optimization/references/lint-rules.md +55 -0
- package/skills/argent-react-native-optimization/references/semantic-checklist.md +34 -0
- package/skills/argent-react-native-profiler/SKILL.md +160 -0
- package/skills/argent-react-native-profiler/references/diagnostic-tools.md +94 -0
- package/skills/argent-simulator-interact/SKILL.md +272 -0
- package/skills/argent-simulator-interact/references/gesture-examples.md +114 -0
- package/skills/argent-simulator-setup/SKILL.md +19 -0
- package/skills/argent-test-ui-flow/SKILL.md +84 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Diagnostic Tools
|
|
2
|
+
|
|
3
|
+
These tools can be called independently without starting a profiling session.
|
|
4
|
+
|
|
5
|
+
## Live render stats
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{ "port": 8081, "device_id": "<UDID>", "top_n": 20 }
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Call `react-profiler-renders`. Returns render counts and durations per component — useful for spotting hot components before a full profile.
|
|
12
|
+
|
|
13
|
+
## Component hierarchy
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{ "port": 8081, "device_id": "<UDID>", "max_depth": 10, "filter": "MyComponent" }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Call `react-profiler-fiber-tree`. Inspect `useMemoCache` presence to confirm React Compiler is active for a given component. If `useMemoCache` is absent, the compiler bailed out for that component — memoization hints are safe to propose.
|
|
20
|
+
|
|
21
|
+
## Console logs
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{ "port": 8081, "device_id": "<UDID>" }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Call `debugger-log-registry`. Returns a summary with entry counts by level, message clusters, and the log file path. Use `Grep`/`Read` on the log file to filter by level or search for specific messages.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Post-Analysis Query Tools
|
|
32
|
+
|
|
33
|
+
These require a completed profiling session (`react-profiler-stop` + `react-profiler-analyze`).
|
|
34
|
+
|
|
35
|
+
## CPU query (replaces react-profiler-cpu-summary)
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{ "port": 8081, "device_id": "<UDID>", "mode": "top_functions", "top_n": 15 }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Call `profiler-cpu-query`. Modes:
|
|
42
|
+
|
|
43
|
+
- `top_functions` — global CPU hotspots. Add `time_window_ms: { start, end }` to filter.
|
|
44
|
+
- `time_window` — CPU breakdown for a specific time range (e.g. during a slow commit).
|
|
45
|
+
- `call_tree` — callers and callees of a specific `function_name`.
|
|
46
|
+
- `component_cpu` — aggregate CPU during all commits of a `component_name`.
|
|
47
|
+
|
|
48
|
+
## Commit query
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{ "port": 8081, "device_id": "<UDID>", "mode": "by_component", "component_name": "AppNavigator" }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Call `profiler-commit-query`. Modes:
|
|
55
|
+
|
|
56
|
+
- `by_component` — all commits where a component rendered.
|
|
57
|
+
- `by_time_range` — commits in a `time_range_ms` window.
|
|
58
|
+
- `by_index` — full detail of a single `commit_index`.
|
|
59
|
+
- `cascade_tree` — parent-child re-render cascade for a commit.
|
|
60
|
+
|
|
61
|
+
## iOS Instruments query
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{ "device_id": "<UDID>", "mode": "hang_stacks", "hang_index": 0 }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Call `profiler-stack-query` after `ios-profiler-analyze`. Modes:
|
|
68
|
+
|
|
69
|
+
- `hang_stacks` — full CPU context during a specific hang.
|
|
70
|
+
- `function_callers` — who calls a specific native `function_name`.
|
|
71
|
+
- `thread_breakdown` — CPU time split by thread, optionally filtered.
|
|
72
|
+
- `leak_stacks` — memory leak details, optionally filtered by `object_type`.
|
|
73
|
+
|
|
74
|
+
## Combined report
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{ "port": 8081, "device_id": "<UDID>" }
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Call `profiler-combined-report` when both React Profiler and iOS Instruments ran in parallel. Automatically correlates iOS hangs with React commits using wall-clock time alignment.
|
|
81
|
+
|
|
82
|
+
## Session reload
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{ "mode": "list" }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Call `profiler-load`. Modes:
|
|
89
|
+
|
|
90
|
+
- `list` — show all saved profiling sessions (React + iOS) in `/tmp/argent-profiler-cwd/`.
|
|
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`.
|
|
93
|
+
|
|
94
|
+
Use this to revisit an earlier profiling session without re-profiling. Each `react-profiler-analyze` run saves raw data with a unique timestamp.
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: argent-simulator-interact
|
|
3
|
+
description: Interact with an iOS simulator using argent MCP tools. Use when tapping UI elements, perfroming gestures, scrolling, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 1. Before You Start
|
|
7
|
+
|
|
8
|
+
If you delegate simulator tasks to sub-agents, make sure they have MCP permissions.
|
|
9
|
+
|
|
10
|
+
Use `list-simulators` to find available simulators. **Pick the first result** if specific not specified by user — booted iPhones are listed first. If none are booted, use `boot-simulator` first.
|
|
11
|
+
|
|
12
|
+
**Load tool schemas before first use.** Gesture tools (`gesture-tap`, `gesture-swipe`, `gesture-pinch`, `gesture-rotate`, `gesture-custom`) may be deferred — their parameter schemas are not loaded until fetched. Always use ToolSearch to load the schemas of all gesture tools you plan to use **before** calling any of them. If you skip this step, parameters may be coerced to strings instead of numbers, causing validation errors.
|
|
13
|
+
|
|
14
|
+
## 2. Best Practices
|
|
15
|
+
|
|
16
|
+
1. **Always refer to tapping_rule** from your argent.md rule before tapping.
|
|
17
|
+
2. Before performing interactions, consider whether they can be **dispatched sequentially** - more on that in `run-sequence`.
|
|
18
|
+
3. **Use `gesture-swipe` for lists/scrolling**, not `gesture-custom`, unless you need non-linear movement. Consider whether you need multiple swipes, if yes - use `run-sequence`.
|
|
19
|
+
4. **Tap a text field before typing** — try `paste` first, fall back to `keyboard`.
|
|
20
|
+
5. **Coordinates are normalized** — always 0.0–1.0, not pixels.
|
|
21
|
+
6. **For native iOS app navigation, prefer `describe` first.** It works on any screen without app restart. Do not navigate from screenshots on regular in-app screens unless `describe` failed to expose a reliable target. Use `native-describe-screen` only when you need app-scoped UIKit properties.
|
|
22
|
+
|
|
23
|
+
## 3. Opening Apps
|
|
24
|
+
|
|
25
|
+
**Never navigate to an app by tapping home-screen icons.** Use `launch-app` or `open-url` — they are instant and reliable.
|
|
26
|
+
|
|
27
|
+
### launch-app — by bundle ID
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{ "udid": "<UDID>", "bundleId": "com.apple.MobileSMS" }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Common IDs: `com.apple.MobileSMS` (Messages), `com.apple.mobilesafari` (Safari), `com.apple.Preferences` (Settings), `com.apple.Maps`, `com.apple.Photos`, `com.apple.mobilemail`, `com.apple.mobilenotes`, `com.apple.MobileAddressBook` (Contacts)
|
|
34
|
+
|
|
35
|
+
### open-url — by URL scheme
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{ "udid": "<UDID>", "url": "messages://" }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Common schemes: `messages://`, `settings://`, `maps://?q=<query>`, `tel://<number>`, `mailto:<address>`, `https://...` (Safari)
|
|
42
|
+
|
|
43
|
+
## 4. Choosing the Right Tool
|
|
44
|
+
|
|
45
|
+
| Action | Tool | Notes |
|
|
46
|
+
| ---------------- | ---------------- | --------------------------------------------------------- |
|
|
47
|
+
| Multiple actions | `run-sequence` | Batch steps in one call (no intermediate screenshots) |
|
|
48
|
+
| Open an app | `launch-app` | **Always — never tap home-screen icons** |
|
|
49
|
+
| Restart an app | `restart-app` | Terminate and relaunch by bundle ID |
|
|
50
|
+
| Open URL/scheme | `open-url` | Web pages, deep links, URL schemes |
|
|
51
|
+
| Single tap | `gesture-tap` | Buttons, links, checkboxes |
|
|
52
|
+
| Scroll/swipe | `gesture-swipe` | Straight-line scroll or swipe |
|
|
53
|
+
| Long press | `gesture-custom` | Context menus, drag start |
|
|
54
|
+
| Drag & drop | `gesture-custom` | Complex drag interactions |
|
|
55
|
+
| Pinch/zoom | `gesture-pinch` | Two-finger pinch with auto-interpolation |
|
|
56
|
+
| Rotation | `gesture-rotate` | Two-finger rotation with auto-interpolation |
|
|
57
|
+
| Custom gesture | `gesture-custom` | Arbitrary touch sequences, optional interpolation |
|
|
58
|
+
| Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
|
|
59
|
+
| Type text (fast) | `paste` | Form fields — uses clipboard |
|
|
60
|
+
| Type text | `keyboard` | Fallback when paste fails; supports Enter, Escape, arrows |
|
|
61
|
+
| Rotate device | `rotate` | Orientation changes |
|
|
62
|
+
|
|
63
|
+
## 5. Finding Tap Targets
|
|
64
|
+
|
|
65
|
+
IMPORTANT. When moved to a different screen after an action or do not know the coordinates of component, **always** perform proper discovery first.
|
|
66
|
+
|
|
67
|
+
| App type | Discovery tool | What it returns |
|
|
68
|
+
| --------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| Target app discovery | `describe` | Accessibility element tree for the current simulator screen with normalized frame coordinates. Works on any app, system dialogs, and Home screen — no app restart or `bundleId` required |
|
|
70
|
+
| React Native | `debugger-component-tree` | React component tree with names, text, testID, and (tap: x,y) |
|
|
71
|
+
| App-scoped native | `native-describe-screen` | Low-level app-scoped accessibility elements with normalized and raw coordinates; requires `bundleId` |
|
|
72
|
+
| Permission / system modal overlay | `describe` | `describe` detects system dialogs automatically and returns dialog buttons with tap coordinates. Fall back to `screenshot` only if `describe` does not expose the controls |
|
|
73
|
+
| Final visual fallback | `screenshot` | Use only when discovery tools cannot inspect the current UI reliably. Do not derive routine in-app navigation targets from screenshots |
|
|
74
|
+
|
|
75
|
+
Point follow-up native diagnostics after you already have a candidate point:
|
|
76
|
+
|
|
77
|
+
- `native-user-interactable-view-at-point`: deepest native view that would receive touch at a known raw iOS point; requires `bundleId`
|
|
78
|
+
- `native-view-at-point`: deepest visible native view at a known raw iOS point; requires `bundleId`
|
|
79
|
+
|
|
80
|
+
### If `describe` Fails
|
|
81
|
+
|
|
82
|
+
Read the exact error and choose the action that matches it:
|
|
83
|
+
|
|
84
|
+
- Error mentions `ax-service` not available or daemon startup failure:
|
|
85
|
+
the ax-service daemon could not start. Check that the simulator is booted. Use `screenshot` as a temporary fallback, or use `native-describe-screen` with an explicit `bundleId` if the app has native devtools injected.
|
|
86
|
+
- `describe` returns an empty element list:
|
|
87
|
+
the screen may be blank, loading, or showing content without accessibility labels. Use `screenshot` to see what is visible, then retry after the content has loaded.
|
|
88
|
+
- `describe` succeeds but is not detailed enough for a React Native app:
|
|
89
|
+
use `debugger-component-tree` next.
|
|
90
|
+
- You need app-scoped inspection with full UIKit properties (`accessibilityIdentifier`, `viewClassName`):
|
|
91
|
+
use `native-describe-screen` with an explicit `bundleId`. This requires native devtools (dylib) injection — call `restart-app` first if needed.
|
|
92
|
+
- You already have a candidate point and want to confirm what would actually receive touch:
|
|
93
|
+
use `native-user-interactable-view-at-point`. Use `native-view-at-point` when you want the visually deepest view instead of the hit-test target.
|
|
94
|
+
|
|
95
|
+
## 6. Tool Usage
|
|
96
|
+
|
|
97
|
+
### gesture-tap — Single tap at a point
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{ "udid": "<UDID>", "x": 0.5, "y": 0.5 }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Coordinates: `0.0` = left/top, `1.0` = right/bottom.
|
|
104
|
+
|
|
105
|
+
Before tapping near the bottom of the screen in React Native apps, check that "Open Debugger to View Warnings" banners are not visible — tapping them breaks the debugger connection. Close them with the X icon if present.
|
|
106
|
+
|
|
107
|
+
### gesture-swipe — Straight-line gesture
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{ "udid": "<UDID>", "fromX": 0.5, "fromY": 0.7, "toX": 0.5, "toY": 0.3 }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Swipe **up** (`fromY > toY`) = scroll content **down**. Default duration: 300ms. Optional: `"durationMs": 500` for slower swipe.
|
|
114
|
+
|
|
115
|
+
### gesture-pinch — Two-finger pinch
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{ "udid": "<UDID>", "centerX": 0.5, "centerY": 0.5, "startDistance": 0.2, "endDistance": 0.6 }
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
All values are normalized 0.0–1.0 (fractions of screen, not pixels) — same as all other gesture tools. `startDistance: 0.2` means fingers start 20% of the screen apart; `endDistance: 0.6` means they end 60% apart. `startDistance < endDistance` = pinch out (zoom in). `startDistance > endDistance` = pinch in (zoom out). Defaults: `angle: 0` (horizontal), `durationMs: 300`. Optional: `"angle": 90` for vertical axis, `"durationMs": 500` for slower pinch.
|
|
122
|
+
|
|
123
|
+
### gesture-rotate — Two-finger rotation
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"udid": "<UDID>",
|
|
128
|
+
"centerX": 0.5,
|
|
129
|
+
"centerY": 0.5,
|
|
130
|
+
"radius": 0.15,
|
|
131
|
+
"startAngle": 0,
|
|
132
|
+
"endAngle": 90
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
All positions and radius are normalized 0.0–1.0 (fractions of screen, not pixels). `radius: 0.15` means each finger is 15% of the screen away from center. `endAngle > startAngle` = clockwise. Default duration: 300ms. Optional: `"durationMs": 500` for slower rotation.
|
|
137
|
+
|
|
138
|
+
### gesture-custom — Custom touch sequence
|
|
139
|
+
|
|
140
|
+
For long-press, drag-and-drop, and other complex sequences, see `references/gesture-examples.md`. Set `"interpolate": 10` to auto-generate smooth intermediate Move events between keyframes.
|
|
141
|
+
|
|
142
|
+
### button — Hardware button press
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{ "udid": "<UDID>", "button": "home" }
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Values: `home`, `back`, `power`, `volumeUp`, `volumeDown`, `appSwitch`, `actionButton`
|
|
149
|
+
|
|
150
|
+
### paste — Type text into focused field
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
{ "udid": "<UDID>", "text": "Hello, world!" }
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Tap the field first, then paste. Fall back to `keyboard` if it doesn't work.
|
|
157
|
+
|
|
158
|
+
### keyboard — Type text or press special keys
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{ "udid": "<UDID>", "text": "search query", "key": "enter" }
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Special keys: `enter`, `escape`, `backspace`, `tab`, `space`, `arrow-up`, `arrow-down`, `arrow-left`, `arrow-right`, `f1`–`f12`. Optional: `"delayMs": 100` between keystrokes (default 50ms).
|
|
165
|
+
|
|
166
|
+
### rotate — Change orientation
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{ "udid": "<UDID>", "orientation": "LandscapeLeft" }
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Values: `Portrait`, `LandscapeLeft`, `LandscapeRight`, `PortraitUpsideDown`
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 7. Screenshots
|
|
177
|
+
|
|
178
|
+
Use the explicit `screenshot` tool only when:
|
|
179
|
+
|
|
180
|
+
- You need the initial screen state before any action.
|
|
181
|
+
- The auto-attached screenshot shows a transitional or loading frame.
|
|
182
|
+
- You require extra context.
|
|
183
|
+
- You want to check state after a delay (e.g. waiting for a network response).
|
|
184
|
+
- A permission dialog, system alert, or native modal overlay is visible and `describe` did not expose reliable targets.
|
|
185
|
+
|
|
186
|
+
When using `screenshot` for permission or native modal navigation:
|
|
187
|
+
|
|
188
|
+
- Do not switch to screenshot-driven navigation just because a modal is visible. On regular app screens and in-app modals, keep using `describe`.
|
|
189
|
+
- Prefer obvious, centered alert buttons such as `Allow`, `OK`, `Don't Allow`, `Not Now`, or `Continue`.
|
|
190
|
+
- Tap one control at a time and inspect the returned auto-screenshot before doing anything else.
|
|
191
|
+
- After the modal is dismissed, return to normal discovery with `describe`, `native-describe-screen`, or `debugger-component-tree`.
|
|
192
|
+
|
|
193
|
+
Optional rotation parameter: `{ "udid": "<UDID>", "rotation": "LandscapeLeft" }` — rotates the capture without changing simulator orientation.
|
|
194
|
+
|
|
195
|
+
Screenshots are downscaled by default (30% of original resolution) to reduce context size. `scale` accepts values from 0.01 to 1.0. If UI elements are hard to read or you need to inspect fine detail, pass `scale: 1.0` to get full resolution: `{ "udid": "<UDID>", "scale": 1.0 }`.
|
|
196
|
+
|
|
197
|
+
### Troubleshooting
|
|
198
|
+
|
|
199
|
+
| Problem | Solution |
|
|
200
|
+
| -------------------- | ------------------------------------------------------------- |
|
|
201
|
+
| Screenshot times out | Restart the simulator-server via `stop-simulator-server` tool |
|
|
202
|
+
| No booted simulator | Run `boot-simulator` first. |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 8. Action Sequencing with `run-sequence`
|
|
207
|
+
|
|
208
|
+
Use `run-sequence` to batch multiple interaction steps into **a single tool call**. Only one screenshot is returned — after all steps complete. Use cases:
|
|
209
|
+
scrolling multiple times, typing and submitting automatically, known sequence of multiple taps, rotating device back and forth.
|
|
210
|
+
|
|
211
|
+
Do **not** use `run-sequence` when any step depends on observing the result of a previous step
|
|
212
|
+
|
|
213
|
+
### Use cases
|
|
214
|
+
|
|
215
|
+
Use the sequencing when:
|
|
216
|
+
|
|
217
|
+
- Knowing that some action needs multiple steps without necessarily immediate insight of screenshot
|
|
218
|
+
- "scroll to bottom", "scroll to top", "scroll to do X" -> sequence scroll 3-5 times
|
|
219
|
+
- form interactions, "clear and retype field" -> you may use triple-tap to select all, type new value
|
|
220
|
+
- "submit form" → fill all fields in sequence, tap submit
|
|
221
|
+
- "go back to X" → defined tap sequence for the navigation
|
|
222
|
+
|
|
223
|
+
### Allowed tools inside `run-sequence`
|
|
224
|
+
|
|
225
|
+
`gesture-tap`, `gesture-swipe`, `gesture-custom`, `gesture-pinch`, `gesture-rotate`, `button`, `keyboard`, `rotate`
|
|
226
|
+
|
|
227
|
+
The `udid` is shared — do **not** include it in each step's `args`. Optional `delayMs` per step (default 100ms).
|
|
228
|
+
|
|
229
|
+
### Examples
|
|
230
|
+
|
|
231
|
+
Scroll down three times:
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"udid": "<UDID>",
|
|
236
|
+
"steps": [
|
|
237
|
+
{ "tool": "gesture-swipe", "args": { "fromX": 0.5, "fromY": 0.7, "toX": 0.5, "toY": 0.3 } },
|
|
238
|
+
{ "tool": "gesture-swipe", "args": { "fromX": 0.5, "fromY": 0.7, "toX": 0.5, "toY": 0.3 } },
|
|
239
|
+
{ "tool": "gesture-swipe", "args": { "fromX": 0.5, "fromY": 0.7, "toX": 0.5, "toY": 0.3 } }
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Type into a focused field and submit:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"udid": "<UDID>",
|
|
249
|
+
"steps": [
|
|
250
|
+
{ "tool": "keyboard", "args": { "text": "hello world" } },
|
|
251
|
+
{ "tool": "keyboard", "args": { "key": "enter" } }
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Tap a known button, then scroll down:
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"udid": "<UDID>",
|
|
261
|
+
"steps": [
|
|
262
|
+
{ "tool": "gesture-tap", "args": { "x": 0.5, "y": 0.15 } },
|
|
263
|
+
{
|
|
264
|
+
"tool": "gesture-swipe",
|
|
265
|
+
"args": { "fromX": 0.5, "fromY": 0.7, "toX": 0.5, "toY": 0.3 },
|
|
266
|
+
"delayMs": 300
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Stops on the first error and returns partial results.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Gesture Examples
|
|
2
|
+
|
|
3
|
+
Detailed sequences and parameters for the gesture tool family. All coordinates, distances, and radii are **normalized 0.0–1.0** (fractions of screen width/height, not pixels) — same coordinate space across all gesture tools.
|
|
4
|
+
|
|
5
|
+
## gesture-pinch — Two-finger pinch
|
|
6
|
+
|
|
7
|
+
Pinch out (zoom in):
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{ "udid": "<UDID>", "centerX": 0.5, "centerY": 0.5, "startDistance": 0.2, "endDistance": 0.6 }
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Pinch in (zoom out):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{ "udid": "<UDID>", "centerX": 0.5, "centerY": 0.5, "startDistance": 0.6, "endDistance": 0.2 }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Vertical pinch (angle = 90):
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"udid": "<UDID>",
|
|
24
|
+
"centerX": 0.5,
|
|
25
|
+
"centerY": 0.5,
|
|
26
|
+
"startDistance": 0.2,
|
|
27
|
+
"endDistance": 0.6,
|
|
28
|
+
"angle": 90
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## gesture-rotate — Two-finger rotation
|
|
33
|
+
|
|
34
|
+
Clockwise 90 degrees:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"udid": "<UDID>",
|
|
39
|
+
"centerX": 0.5,
|
|
40
|
+
"centerY": 0.5,
|
|
41
|
+
"radius": 0.15,
|
|
42
|
+
"startAngle": 0,
|
|
43
|
+
"endAngle": 90
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Counter-clockwise 45 degrees:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"udid": "<UDID>",
|
|
52
|
+
"centerX": 0.5,
|
|
53
|
+
"centerY": 0.5,
|
|
54
|
+
"radius": 0.15,
|
|
55
|
+
"startAngle": 0,
|
|
56
|
+
"endAngle": -45
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## gesture-custom — Custom touch sequences
|
|
61
|
+
|
|
62
|
+
### Long Press (800ms hold)
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"udid": "<UDID>",
|
|
67
|
+
"events": [
|
|
68
|
+
{ "type": "Down", "x": 0.5, "y": 0.5 },
|
|
69
|
+
{ "type": "Up", "x": 0.5, "y": 0.5, "delayMs": 800 }
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Pinch Out (zoom in) — manual events
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"udid": "<UDID>",
|
|
79
|
+
"events": [
|
|
80
|
+
{ "type": "Down", "x": 0.4, "y": 0.5, "x2": 0.6, "y2": 0.5 },
|
|
81
|
+
{ "type": "Move", "x": 0.2, "y": 0.5, "x2": 0.8, "y2": 0.5 },
|
|
82
|
+
{ "type": "Up", "x": 0.2, "y": 0.5, "x2": 0.8, "y2": 0.5 }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Pinch Out with interpolation — smooth version
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"udid": "<UDID>",
|
|
92
|
+
"events": [
|
|
93
|
+
{ "type": "Down", "x": 0.4, "y": 0.5, "x2": 0.6, "y2": 0.5 },
|
|
94
|
+
{ "type": "Up", "x": 0.2, "y": 0.5, "x2": 0.8, "y2": 0.5 }
|
|
95
|
+
],
|
|
96
|
+
"interpolate": 15
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Drag and Drop
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"udid": "<UDID>",
|
|
105
|
+
"events": [
|
|
106
|
+
{ "type": "Down", "x": 0.3, "y": 0.4 },
|
|
107
|
+
{ "type": "Move", "x": 0.3, "y": 0.4, "delayMs": 500 },
|
|
108
|
+
{ "type": "Move", "x": 0.7, "y": 0.6 },
|
|
109
|
+
{ "type": "Up", "x": 0.7, "y": 0.6 }
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Add a `delayMs` on the first `Move` to simulate a hold before dragging — this is required for some drag-and-drop implementations that only activate after a sustained press.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: argent-simulator-setup
|
|
3
|
+
description: Set up and connect to an iOS simulator using argent MCP tools. Use when starting a new session, booting a simulator, getting a simulator UDID, or before any simulator interaction task.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 1. Setup Steps
|
|
7
|
+
|
|
8
|
+
If you delegate simulator tasks to sub-agents, make sure they have MCP permissions.
|
|
9
|
+
|
|
10
|
+
1. **Find a booted simulator**
|
|
11
|
+
Use `list-simulators`. Pick the first result — booted iPhones are listed first.
|
|
12
|
+
If none are booted, use `boot-simulator` with the desired UDID.
|
|
13
|
+
|
|
14
|
+
2. **Verify connection**
|
|
15
|
+
All interaction tools (`gesture-tap`, `gesture-swipe`, `gesture-custom`, etc.) auto-start the server if not already running.
|
|
16
|
+
|
|
17
|
+
## 2. Notes
|
|
18
|
+
|
|
19
|
+
- UDIDs look like: `A1B2C3D4-E5F6-7890-ABCD-EF1234567890`
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 1. Workflow
|
|
7
|
+
|
|
8
|
+
All interactions go through argent MCP tools. Ensure the simulator is booted before starting.
|
|
9
|
+
|
|
10
|
+
1. **Baseline screenshot**: Call `screenshot` to see the current UI state.
|
|
11
|
+
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.
|
|
15
|
+
- **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.
|
|
17
|
+
4. **Verify**: Check the returned screenshot for expected results. If it shows a loading/transitional state, retake with `screenshot`.
|
|
18
|
+
5. **Repeat** for each step in the flow.
|
|
19
|
+
|
|
20
|
+
## 2. Template
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Goal: Test [feature name]
|
|
24
|
+
|
|
25
|
+
Steps:
|
|
26
|
+
1. screenshot → see current state (baseline)
|
|
27
|
+
2. [Navigate / tap / type to reach starting point] → verify auto-screenshot
|
|
28
|
+
3. [Perform the action to test] → verify auto-screenshot
|
|
29
|
+
4. Report: pass / fail with details
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 3. Examples
|
|
33
|
+
|
|
34
|
+
### Login flow
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
1. screenshot → see login screen
|
|
38
|
+
2. gesture-tap { x: 0.5, y: 0.4 } → tap email field
|
|
39
|
+
3. paste { text: "user@example.com" }
|
|
40
|
+
4. gesture-tap { x: 0.5, y: 0.55 } → tap password field
|
|
41
|
+
5. paste { text: "password123" }
|
|
42
|
+
6. gesture-tap { x: 0.5, y: 0.7 } → tap Login button
|
|
43
|
+
7. screenshot → verify home screen appeared
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Scroll and navigation
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
1. screenshot → see list at top
|
|
50
|
+
2. gesture-swipe { fromY: 0.7, toY: 0.3 } → scroll down
|
|
51
|
+
3. gesture-tap item at visible position → verify auto-screenshot
|
|
52
|
+
4. screenshot → verify detail view opened
|
|
53
|
+
5. button { button: "back" }
|
|
54
|
+
6. screenshot → verify returned to list
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 4. Recovery Pattern
|
|
60
|
+
|
|
61
|
+
- If screenshot shows loading/transition: wait 500ms, retake with `screenshot`.
|
|
62
|
+
- If tap misses target: re-run discovery tool (`describe` / `debugger-component-tree`), retry once with new coordinates.
|
|
63
|
+
- If a permission dialog or modal is visible: re-run `describe` first. Stay in screenshot-driven navigation only when the overlay is not exposed reliably, then switch back to `describe` / `debugger-component-tree` as soon as it is dismissed.
|
|
64
|
+
- If tap fails twice at same coordinates: stop, re-discover, report if element not found.
|
|
65
|
+
- If a **saved flow** fails during `flow-execute` replay (as opposed to live test steps above): follow `argent-create-flow` skill §10 for structured diagnosis and correction.
|
|
66
|
+
|
|
67
|
+
## Tips
|
|
68
|
+
|
|
69
|
+
- **Use `paste` for text entry** — faster and more reliable than key-by-key `keyboard`.
|
|
70
|
+
- **Use `gesture-custom` for long-press** context menus (800ms hold).
|
|
71
|
+
- **Report clearly**: state what you expected, what you saw, and the verdict.
|
|
72
|
+
- **Coordinate estimation**: center = 0.5, 0.5; top-third ~ 0.2; bottom-third ~ 0.8.
|
|
73
|
+
- **Permission modals**: try `describe` first. Use `screenshot` only as fallback, tap one visible button at a time, and verify with the returned screenshot before continuing.
|
|
74
|
+
- **Record for replay**: If a tested flow is likely to be repeated, use the `argent-create-flow` skill to record it as a `.yaml` script. This lets you replay the entire sequence later with a single `flow-execute` call instead of re-running each step manually.
|
|
75
|
+
|
|
76
|
+
## Related Skills
|
|
77
|
+
|
|
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 |
|