Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
38c3917
Create static.yml
Dargon789 Jan 24, 2025
c7937cf
Create SECURITY.md
Dargon789 Feb 1, 2025
5e36ad3
Create jekyll-gh-pages.yml
Dargon789 Jan 24, 2025
9cafb49
Potential fix for code scanning alert no. 11: Incomplete string escap…
Dargon789 Feb 1, 2025
f7c261d
Potential fix for code scanning alert no. 10: Incomplete regular expr…
Dargon789 Feb 1, 2025
d591a8d
Merge pull request #9 from Dargon789/alert-autofix-10
Dargon789 Feb 2, 2025
6d175a4
Merge pull request #6 from Dargon789/Dargon789-patch-3
Dargon789 Feb 2, 2025
1a66a6f
Merge pull request #7 from Dargon789/alert-autofix-11
Dargon789 Feb 2, 2025
c3c6f03
Merge pull request #2 from Dargon789/Dargon789-patch-2
Dargon789 Feb 2, 2025
27b0c15
Merge pull request #1 from Dargon789/Dargon789-patch-1
Dargon789 Feb 2, 2025
aa2a0f2
Merge branch 'Uniswap:main' into main
Dargon789 Feb 8, 2025
ef8aa9f
Merge branch 'Uniswap:main' into main
Dargon789 Feb 22, 2025
09d7af5
fix: packages/wallet/package.json to reduce vulnerabilities
snyk-bot Feb 22, 2025
0acc3d6
fix: packages/utilities/package.json to reduce vulnerabilities
snyk-bot Feb 22, 2025
2c1f99b
fix: apps/mobile/package.json to reduce vulnerabilities
snyk-bot Feb 22, 2025
9427c3c
Merge pull request #18 from Dargon789/snyk-fix-9be0a1d2ae92acc7332505…
Dargon789 Feb 23, 2025
e9755d6
fix: apps/mobile/package.json to reduce vulnerabilities
snyk-bot Feb 23, 2025
0c58ce1
Merge pull request #21 from Dargon789/snyk-fix-d77ca07c87b0c5245594fd…
Dargon789 Feb 23, 2025
5705e0d
fix: apps/mobile/package.json to reduce vulnerabilities
snyk-bot Feb 23, 2025
0e3c1b4
Merge pull request #16 from Dargon789/snyk-fix-107e0e51af286852e0e565…
Dargon789 Feb 23, 2025
4122857
Merge pull request #15 from Dargon789/snyk-fix-ac8ffdf06593961b331fe5…
Dargon789 Feb 23, 2025
405e01c
Merge pull request #22 from Dargon789/snyk-fix-78de97ca8975f9e7e610e9…
Dargon789 Feb 23, 2025
2f09c4e
fix: packages/utilities/package.json to reduce vulnerabilities
snyk-bot Mar 1, 2025
7a36b08
fix: packages/uniswap/package.json to reduce vulnerabilities
snyk-bot Mar 2, 2025
4b672fe
Merge pull request #25 from Dargon789/snyk-fix-f5cd1d35c0e61779161c88…
Dargon789 Mar 2, 2025
bd5a963
Merge pull request #24 from Dargon789/snyk-fix-84e19216aa21cc924f206a…
Dargon789 Mar 2, 2025
1b8ac68
fix: packages/uniswap/package.json to reduce vulnerabilities
snyk-bot Mar 2, 2025
22836cc
Merge pull request #26 from Dargon789/snyk-fix-659a6c5a5d0bde282986ba…
Dargon789 Mar 3, 2025
c9d06b9
fix: packages/uniswap/package.json to reduce vulnerabilities
snyk-bot Mar 3, 2025
eacf92c
Merge pull request #27 from Dargon789/snyk-fix-150a7cc67904080ad02dff…
Dargon789 Mar 3, 2025
86f739d
fix: packages/uniswap/package.json to reduce vulnerabilities
snyk-bot Mar 3, 2025
bb0b1b1
Merge pull request #28 from Dargon789/snyk-fix-b3c586e1ca9668d98a90ca…
Dargon789 Mar 3, 2025
7991e0d
fix: apps/extension/package.json to reduce vulnerabilities
snyk-bot Mar 3, 2025
565b44b
Merge pull request #29 from Dargon789/snyk-fix-c02104d5702790c65d206c…
Dargon789 Mar 4, 2025
35bea4b
Potential fix for code scanning alert no. 9: Incomplete regular expre…
Dargon789 Mar 4, 2025
186408f
Potential fix for code scanning alert no. 2: Inefficient regular expr…
Dargon789 Mar 4, 2025
b81f3b9
fix: packages/uniswap/package.json to reduce vulnerabilities (#14)
Dargon789 Mar 4, 2025
049c9a4
fix: apps/extension/package.json to reduce vulnerabilities (#17)
Dargon789 Mar 4, 2025
1a07ec8
fix: apps/mobile/Gemfile & apps/mobile/Gemfile.lock to reduce vulnera…
Dargon789 Mar 4, 2025
62f5c53
fix: apps/mobile/package.json to reduce vulnerabilities (#23)
Dargon789 Mar 4, 2025
4abfd13
fix: apps/extension/package.json to reduce vulnerabilities (#30)
Dargon789 Mar 4, 2025
31a92d0
fix: apps/extension/package.json to reduce vulnerabilities (#31)
Dargon789 Mar 4, 2025
70d8acc
fix: apps/extension/package.json to reduce vulnerabilities (#32)
Dargon789 Mar 4, 2025
69612cb
Circleci project setup (#34)
Dargon789 Mar 5, 2025
cbfbdbf
fix: packages/wallet/package.json to reduce vulnerabilities (#33)
Dargon789 Mar 5, 2025
d3a93e8
fix: packages/wallet/package.json to reduce vulnerabilities (#35)
Dargon789 Mar 5, 2025
d62098f
fix: packages/wallet/package.json to reduce vulnerabilities (#36)
Dargon789 Mar 5, 2025
936eb1a
Circleci project setup (#37)
Dargon789 Mar 6, 2025
364eefa
Potential fix for code scanning alert no. 12: Inefficient regular exp…
Dargon789 Mar 6, 2025
7ceded6
Circleci project setup (#39)
Dargon789 Mar 6, 2025
7d01e37
feat: upgrade turbo from 1.13.4 to 2.4.2
snyk-bot Mar 6, 2025
b6ab792
Update tag_and_release.yml
Dargon789 Sep 30, 2025
5422b19
Update static.yml
Dargon789 Oct 9, 2025
fbe55b5
Update jekyll-gh-pages.yml
Dargon789 Oct 9, 2025
06175f4
Merge branch 'Uniswap:main' into Dargon789-patch-1
Dargon789 Oct 26, 2025
5db5983
Create ci-web3-gamefi.yml (#86)
Dargon789 Oct 26, 2025
73418e6
Create docker.yml (#88)
Dargon789 Oct 27, 2025
23a7ec1
ci(release): publish latest release
hello-happy-puppy Oct 28, 2025
60b7d92
ci(release): publish latest release
hello-happy-puppy Oct 30, 2025
269e0a8
ci(release): publish latest release
hello-happy-puppy Nov 5, 2025
6b6c50e
Merge branch 'Uniswap:main' into Dargon789-patch-1
Dargon789 Nov 6, 2025
deaefb5
ci(release): publish latest release
hello-happy-puppy Nov 13, 2025
0ef926c
ci(release): publish latest release
hello-happy-puppy Nov 13, 2025
173a940
ci(release): publish latest release
hello-happy-puppy Nov 15, 2025
f535511
ci(release): publish latest release
hello-happy-puppy Nov 17, 2025
9a70db0
ci(release): publish latest release
hello-happy-puppy Nov 19, 2025
0f117d8
ci(release): publish latest release
hello-happy-puppy Nov 20, 2025
b9b5ab9
ci(release): publish latest release
hello-happy-puppy Nov 21, 2025
0c31bed
ci(release): publish latest release
hello-happy-puppy Nov 21, 2025
58089c1
ci(release): publish latest release
hello-happy-puppy Nov 24, 2025
4125476
ci(release): publish latest release
hello-happy-puppy Nov 24, 2025
d359d65
ci(release): publish latest release
hello-happy-puppy Nov 24, 2025
9e2bcfb
ci(release): publish latest release
hello-happy-puppy Nov 26, 2025
9f6becd
ci(release): publish latest release
hello-happy-puppy Dec 1, 2025
bfb9c9a
ci(release): publish latest release
hello-happy-puppy Dec 2, 2025
52fff30
ci(release): publish latest release
hello-happy-puppy Dec 2, 2025
721ddf2
ci(release): publish latest release
hello-happy-puppy Dec 2, 2025
ee96537
ci(release): publish latest release
hello-happy-puppy Dec 2, 2025
2dd993d
ci(release): publish latest release
hello-happy-puppy Dec 2, 2025
39d285e
ci(release): publish latest release
hello-happy-puppy Dec 2, 2025
73d2409
ci(release): publish latest release
hello-happy-puppy Dec 3, 2025
7887825
ci(release): publish latest release
hello-happy-puppy Dec 3, 2025
4994670
ci(release): publish latest release
hello-happy-puppy Dec 4, 2025
25bd42d
ci(release): publish latest release
hello-happy-puppy Dec 5, 2025
340b8bf
ci(release): publish latest release
hello-happy-puppy Dec 5, 2025
67f9a00
ci(release): publish latest release
hello-happy-puppy Dec 10, 2025
9f1cb1b
ci(release): publish latest release
hello-happy-puppy Dec 11, 2025
27cf6fd
ci(release): publish latest release
hello-happy-puppy Dec 12, 2025
111b532
ci(release): publish latest release
hello-happy-puppy Dec 12, 2025
5bdad5b
ci(release): publish latest release
hello-happy-puppy Dec 18, 2025
55c403a
ci(release): publish latest release
hello-happy-puppy Dec 20, 2025
e399998
fix: apps/mobile/Gemfile & apps/mobile/Gemfile.lock to reduce vulnera…
snyk-io[bot] Dec 20, 2025
1609591
Potential fix for code scanning alert no. 21: Incomplete URL substrin…
Dargon789 Jan 19, 2026
f6b397f
Potential fix for code scanning alert no. 22: Incomplete URL substrin…
Dargon789 Jan 19, 2026
4e67b8c
ci(release): publish latest release
hello-happy-puppy Feb 25, 2026
16fe8a3
ci(release): publish latest release
hello-happy-puppy Feb 25, 2026
3b655d2
ci(release): publish latest release
hello-happy-puppy Mar 4, 2026
f167cfa
ci(release): publish latest release
hello-happy-puppy Mar 4, 2026
f20697b
Merge remote-tracking branch 'upstream/main'
googleworkspace-bot Mar 5, 2026
16d3a5e
ci(release): publish latest release
hello-happy-puppy Mar 6, 2026
6f3592a
ci(release): publish latest release
hello-happy-puppy Mar 6, 2026
afbd32f
ci(release): publish latest release
hello-happy-puppy Mar 11, 2026
ed4fa88
ci(release): publish latest release
hello-happy-puppy Mar 12, 2026
051e810
ci(release): publish latest release
hello-happy-puppy Mar 13, 2026
8c94d6f
ci(release): publish latest release
hello-happy-puppy Mar 19, 2026
eaf0377
ci(release): publish latest release
hello-happy-puppy Mar 19, 2026
18626ce
ci(release): publish latest release
hello-happy-puppy Mar 24, 2026
8d9ac54
ci(release): publish latest release
hello-happy-puppy Mar 25, 2026
ae3dd1a
ci(release): publish latest release
hello-happy-puppy Mar 30, 2026
8e7b1d2
ci(release): publish latest release
hello-happy-puppy Apr 1, 2026
4abdc2f
ci(release): publish latest release
hello-happy-puppy Apr 3, 2026
37afe8b
Merge remote-tracking branch 'upstream/main'
googleworkspace-bot Apr 6, 2026
8ac9c76
fix: apps/mobile/Gemfile & apps/mobile/Gemfile.lock to reduce vulnera…
Dargon789 Apr 7, 2026
5dc3260
ci(release): publish latest release
hello-happy-puppy Apr 8, 2026
81d92bd
ci(release): publish latest release
hello-happy-puppy Apr 9, 2026
5aeb7ce
Merge remote-tracking branch 'upstream/main'
googleworkspace-bot Apr 13, 2026
8f5ee2e
ci(release): publish latest release
hello-happy-puppy Apr 13, 2026
da7ea0c
ci(release): publish latest release
hello-happy-puppy Apr 13, 2026
370b3b8
ci(release): publish latest release
hello-happy-puppy Apr 13, 2026
cb2349c
ci(release): publish latest release
hello-happy-puppy Apr 13, 2026
32c9d73
ci(release): publish latest release
hello-happy-puppy Apr 13, 2026
9fc17fd
ci(release): publish latest release
hello-happy-puppy Apr 13, 2026
0c1bb25
build(deps): bump the npm_and_yarn group across 7 directories with 7 …
dependabot[bot] Apr 14, 2026
514fb12
ci(release): publish latest release
hello-happy-puppy Apr 15, 2026
330581f
ci(release): publish latest release
hello-happy-puppy Apr 15, 2026
2d2034e
ci(release): publish latest release
hello-happy-puppy Apr 15, 2026
23813b0
Merge remote-tracking branch 'upstream/main'
googleworkspace-bot Apr 17, 2026
07f1000
Merge remote-tracking branch 'upstream/main' into Dargon789-patch-1
googleworkspace-bot Apr 17, 2026
a2d840e
build(deps): bump the npm_and_yarn group across 2 directories with 3 …
dependabot[bot] Apr 17, 2026
65ed51f
Update packages/sessions/src/challenge-solvers/turnstileSolver.integr…
Dargon789 Apr 17, 2026
0a863e3
Update apps/web/src/state/migrations/16.ts
Dargon789 Apr 17, 2026
fadaa86
Update apps/web/src/pages/Landing/components/cards/ValuePropCard.tsx
Dargon789 Apr 17, 2026
c723e2f
Merge remote-tracking branch 'upstream/main' into uniswap/main-foundr…
googleworkspace-bot Apr 17, 2026
b356d0f
build(deps): bump hono (#129)
Dargon789 Apr 17, 2026
75228c8
Revert "build(deps): bump hono (#129)"
googleworkspace-bot Apr 17, 2026
503b305
Merge remote-tracking branch 'origin/snyk-fix-f20e47a9545da7bc229d8ee…
googleworkspace-bot Apr 17, 2026
5d84337
fix: apps/mobile/Gemfile & apps/mobile/Gemfile.lock to reduce vulnera…
snyk-bot Apr 17, 2026
78b6080
fix: apps/mobile/Gemfile & apps/mobile/Gemfile.lock to reduce vulnera…
snyk-bot Apr 17, 2026
0fb12cc
Merge branch 'Dargon789-hello-happy-puppy'
googleworkspace-bot Apr 17, 2026
fc626fe
Merge remote-tracking branch 'origin/snyk-fix-cd4063b4874a6b90338d01b…
googleworkspace-bot Apr 17, 2026
34dfea8
Potential fix for pull request finding 'CodeQL / Client-side cross-si…
Dargon789 Apr 17, 2026
8e1ddc6
Potential fix for pull request finding 'CodeQL / Incomplete string es…
Dargon789 Apr 17, 2026
9a983ba
Potential fix for pull request finding 'CodeQL / Incomplete URL subst…
Dargon789 Apr 17, 2026
5d32d97
Potential fix for pull request finding 'CodeQL / Information exposure…
Dargon789 Apr 17, 2026
e7e0546
Update packages/uniswap/src/features/transactions/hooks/usePollingInt…
Dargon789 Apr 17, 2026
8224067
Update packages/uniswap/src/features/transactions/hooks/usePollingInt…
Dargon789 Apr 17, 2026
4946dc2
Potential fix for code scanning alert no. 28: Incomplete URL substrin…
Dargon789 Apr 18, 2026
64ff3de
ci(release): publish latest release
hello-happy-puppy Apr 22, 2026
160805e
ci(release): publish latest release
hello-happy-puppy Apr 29, 2026
e011a5b
ci(release): publish latest release
hello-happy-puppy May 6, 2026
d761f7c
ci(release): publish latest release
hello-happy-puppy May 13, 2026
dedc752
ci(release): publish latest release
hello-happy-puppy May 14, 2026
a4a6127
ci(release): publish latest release
hello-happy-puppy May 20, 2026
b8dbf44
ci(release): publish latest release
hello-happy-puppy May 21, 2026
7c25a91
ci(release): publish latest release
hello-happy-puppy May 26, 2026
7ec9add
ci(release): publish latest release
hello-happy-puppy May 27, 2026
dac7b0b
Merge branch 'main' into uniswap/main-foundry-ux
Dargon789 May 28, 2026
1165526
Merge remote-tracking branch 'upstream/main'
googleworkspace-bot May 28, 2026
1efa6b5
Merge branch 'uniswap/main-foundry-ux'
googleworkspace-bot May 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
29 changes: 29 additions & 0 deletions .agents/skills/argent-android-emulator-setup/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: argent-android-emulator-setup
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.
---

## 1. Prerequisites

- **Android SDK Platform Tools** on PATH — provides `adb`.
- **Android Emulator** on PATH — needed to boot AVDs. If you will only use an already-running emulator or a physical device, adb alone is sufficient.
- An AVD created via Android Studio or `avdmanager create avd`.

Verify with `adb version` and `emulator -list-avds`.

## 2. Setup

1. **Find a ready device** — call `list-devices`. Filter for entries with `platform: "android"`. Ready devices (`state: "device"`) come first. Pick the first `serial` (e.g. `emulator-5554`) unless the user specified one.
2. **Boot if needed** — if nothing Android is ready, call `boot-device` with `avdName: <name>` from the same call's `avds` list. The tool transparently picks hot vs cold boot: it probes the AVD's `default_boot` snapshot, restores it under a tight deadline when usable, and falls back to a full cold boot otherwise. Hot path is typically ~30s; cold path takes 2–10 min. On any stage failure the tool kills the emulator process it started so your next call starts from a clean state.
3. **Metro (for React Native)** — once a device is up, run `adb -s <serial> reverse tcp:8081 tcp:8081` so the device can reach Metro on your host. Repeat if the device restarts. See the `argent-metro-debugger` skill.

## 3. Using the device

Pass the Android serial as `udid` to the unified interaction tools — `gesture-tap`, `gesture-swipe`, `describe`, `screenshot`, `launch-app`, `keyboard`, etc. Dispatch is automatic based on the id shape. See `argent-device-interact` for platform-neutral interaction tooling and the Android-specific gotchas section at the bottom of that skill.

## 4. Notes

- Serials are the adb device id. iOS UDIDs and Android serials are not interchangeable, but you do NOT need to tell the tools which platform — dispatch is automatic.
- `describe` on Android returns a shallower tree than iOS (no accessibility-service equivalent), but covers most tap-target discovery.
- `reinstall-app` on Android always installs with `-g` so first-launch runtime permissions are pre-granted.
- To kill the emulator when you're done, run `adb -s <serial> emu kill` from a shell.
213 changes: 213 additions & 0 deletions .agents/skills/argent-create-flow/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
---
name: argent-create-flow
description: Record a reusable flow (scripted sequence of MCP tool calls) that can be replayed later with a single command. Use when the user asks to create, record, or build a flow, or to script a sequence of simulator actions.
---

## 1. Overview

A flow is a recorded sequence of MCP tool calls saved to a `.yaml` file in the `.argent/flows/` directory. Each step is **executed live** as you add it, so you verify it works before it becomes part of the flow. Replay a finished flow with `flow-execute`.

## 2. Tools

| Tool | Purpose |
| ------------------------ | -------------------------------------------------------------------------- |
| `flow-start-recording` | Start recording — takes a name and executionPrerequisite, creates the file |
| `flow-add-step` | Execute a tool call live and record it if it succeeds |
| `flow-add-echo` | Add a label/comment that prints during replay |
| `flow-finish-recording` | Stop recording and get a summary |
| `flow-read-prerequisite` | Read a flow's execution prerequisite without running it |
| `flow-execute` | Replay a saved flow by name |

## 3. Workflow

### Recording

1. **Start**: Call `flow-start-recording` with a descriptive name, the absolute `project_root`, and an `executionPrerequisite` describing the required app state before running the flow (e.g. "App on home screen after a fresh reload"). `project_root` is stored for the session — you do **not** need to pass it again to subsequent tools.
2. **Build step-by-step**: For each action, call `flow-add-step` with the tool name and args. The tool runs immediately — check the result before moving on.
3. **Add labels**: Use `flow-add-echo` between steps to describe what each section does.
4. **Finish**: Call `flow-finish-recording` to stop recording. It returns the file path where the flow was saved and a summary of all steps. You can edit the `.yaml` file directly afterwards to remove, reorder, or tweak steps.

Every tool during recording returns the current flow file contents so you can track what has been recorded.

### Replaying

Call `flow-execute` with the flow name. If the flow has an execution prerequisite:

1. The tool returns a **notice** with the prerequisite text instead of running. It asks you to verify the prerequisite is met and call `flow-execute` again with `prerequisiteAcknowledged: true`.
2. You can also call `flow-read-prerequisite` beforehand to inspect the prerequisite without triggering a run.
3. Once you pass `prerequisiteAcknowledged: true`, the flow runs all steps in order and returns every tool call result (including screenshots) merged into a single response.

If the flow has no prerequisite, it runs immediately without needing acknowledgment.

## 4. flow-add-step Usage

The `command` parameter is the MCP tool name. The `args` parameter is a **JSON string** (not an object):

```
command: "launch-app"
args: "{\"udid\": \"<UDID>\", \"bundleId\": \"com.apple.Preferences\"}"
```

```
command: "gesture-tap"
args: "{\"udid\": \"<UDID>\", \"x\": 0.5, \"y\": 0.35}"
```

```
command: "screenshot"
args: "{\"udid\": \"<UDID>\"}"
```

For tools with no arguments, omit `args` entirely.

## 5. Important Rules

- **Every step runs live.** You will see the real tool result (including screenshots). Use this to verify the step worked before continuing.
- **Only successful steps are recorded.** If a tool call fails, nothing is written to the flow file — fix the issue and try again.
- **Pass `project_root` only to `flow-start-recording`.** It is stored for the session and automatically used by all subsequent flow tools. An error is returned if the path is not absolute.
- **You do NOT need to pass a flow name** to `flow-add-step`, `flow-add-echo`, or `flow-finish-recording`. The active flow is tracked automatically after `flow-start-recording`.
- **Start before adding.** Calling `flow-add-step`, `flow-add-echo`, or `flow-finish-recording` without an active recording returns an error: _"No active flow. Call flow-start-recording first."_
- **One flow at a time.** If you call `flow-start-recording` while already recording, the active flow switches to the new one. The response tells you which flow was abandoned and which is now active. The old flow's file remains on disk.
- **Mistakes can be edited out.** If a step was recorded by mistake, edit the `.yaml` file directly to remove or reorder entries.

## 6. Example Session

```
flow-start-recording { name: "open-settings", project_root: "/Users/dev/MyApp", executionPrerequisite: "Simulator booted with app installed" }
flow-add-echo { message: "Launch Settings app" }
flow-add-step { command: "launch-app", args: "{\"udid\": \"ABC\", \"bundleId\": \"com.apple.Preferences\"}" }
flow-add-echo { message: "Tap General" }
flow-add-step { command: "gesture-tap", args: "{\"udid\": \"ABC\", \"x\": 0.5, \"y\": 0.35}" }
flow-add-echo { message: "Tap About" }
flow-add-step { command: "gesture-tap", args: "{\"udid\": \"ABC\", \"x\": 0.5, \"y\": 0.17}" }
flow-finish-recording {}
```

## 7. Replay Example

```
flow-execute { name: "open-settings", project_root: "/Users/dev/MyApp" }
→ Returns: notice with executionPrerequisite: "Simulator booted with app installed"
"Verify the prerequisite is met and call flow-execute again with prerequisiteAcknowledged set to true."

flow-execute { name: "open-settings", project_root: "/Users/dev/MyApp", prerequisiteAcknowledged: true }
→ Runs all steps, returns merged results with status and output for every step
```

## 8. Flow File Format

Flow files use YAML. The top-level is an object with `executionPrerequisite` (describes required state) and `steps` (array of actions):

- `- echo: <message>` — a label
- `- tool: <name>` with optional `args:` — a tool call. Add `delayMs: <ms>` to sleep that long before the step runs (use sparingly — only when the app needs a fixed wait between actions).

Example `.yaml` file:

```yaml
executionPrerequisite: Simulator booted with app installed
steps:
- echo: Launch Settings app
- tool: launch-app
args:
udid: ABC
bundleId: com.apple.Preferences
- echo: Tap General
- tool: gesture-tap
args:
udid: ABC
x: 0.5
y: 0.35
- echo: Tap About
- tool: gesture-tap
args:
udid: ABC
x: 0.5
y: 0.17
```

## 9. When to Proactively Record a Flow

You do not need the user to ask for a flow. Record one proactively when you recognize any of these patterns:

- **About to re-profile**: You completed a profiling session and are about to apply a fix and re-profile. Record the interaction steps now so the re-profile replays them identically (see `argent-react-native-profiler` and `argent-native-profiler` skills).
- **Repeating steps**: You have already performed a multi-step interaction sequence once and the task requires doing it again (comparison, retry, re-test).
- **Complex path discovered**: You worked through a non-trivial sequence of taps/swipes/navigation to reach a desired app state. Capture it before it is lost.
- **User says "again" / "one more time"**: Any request to redo what you just did is a signal to record first, then replay.

## 10. Flow Self-Improvement

Flows break. UI layouts change, coordinates drift, screens get added or removed. When `flow-execute` returns a failure, follow this procedure to diagnose and fix the flow instead of silently re-recording or giving up.

### 10.1 Classify the Result

After every `flow-execute`, classify the outcome before proceeding:

| Outcome | Signal | Action |
| ---------------------- | --------------------------------------------------------------------- | ------------------ |
| **Success** | All steps completed, final screenshot shows expected state | Continue with task |
| **Hard error** | A step has `ERROR` in the result — engine stopped there | Enter §10.2 |
| **Silent misfire** | All steps completed but final screenshot shows wrong screen | Enter §10.2 |
| **Partial divergence** | Intermediate screenshot shows wrong state even though later steps ran | Enter §10.2 |

For silent misfires and partial divergence, echo annotations (§10.5) are your reference for what each screen _should_ look like.

### 10.2 Diagnose

1. Note the failure step index and error message (if hard error).
2. Call `screenshot` to see where the app actually is now.
3. Call `describe` or `debugger-component-tree` to get the current element tree.
4. Compare current state to what the failed step expected. Classify the root cause:

| Root cause | Symptoms |
| ---------------- | --------------------------------------------------------------- |
| Coordinate drift | Tap succeeded but hit wrong element; elements shifted positions |
| Missing element | Target element not present in element tree |
| Wrong screen | Screenshot shows entirely different page than expected |
| Timing | Element exists in tree but tap missed; loading spinner visible |
| State mismatch | First step fails — executionPrerequisite was not actually met |

5. State the diagnosis in one sentence before attempting any correction.

### 10.3 Correct

Choose the lightest strategy that fits:

**Strategy 1 — Edit the YAML** (coordinate drift, parameter changes).
Read `.argent/flows/<flow-name>.yaml`, update the broken step's `x`/`y`, `bundleId`, `text`, or other args. Re-run `flow-execute` to verify.

**Strategy 2 — Manual recovery + continue** (timing/transient issues, one-off replay).
Manually execute the failed step with corrected coordinates from §10.2 discovery, then manually execute remaining steps. Does not fix the YAML — use only when re-recording is not worth it.

**Strategy 3 — Re-record from failure point** (structural changes, new intermediate screens).
Navigate the app to the state just before the failure point. Call `flow-start-recording` with the same flow name (overwrites). Re-add the working prefix steps via `flow-add-step`, then continue recording new steps from the divergence point. Call `flow-finish-recording`.

**Strategy 4 — Full re-record** (major changes, unclear diagnosis, or 3+ broken steps).
Reset the app to prerequisite state (`restart-app` + `launch-app`). Record from scratch with the same flow name.

**Decision heuristic:**

- 1 step broken, parameter-only change → Strategy 1
- 1 step broken, transient issue, not worth persisting → Strategy 2
- 2–3 steps broken or flow structure partially changed → Strategy 3
- 3+ steps broken, or unclear root cause → Strategy 4
- Flow used for profiling comparison (must be identical) → Strategy 4

### 10.4 Verify and Bound Retries

After applying a correction, re-run `flow-execute` to verify.

- If it succeeds → done. Report what changed (e.g. "Fixed step 4: updated tap coordinates from 0.5,0.35 to 0.5,0.42").
- If it fails at a **different** step → return to §10.2 for a second attempt.
- If this is already the second correction attempt → **stop**. Report the diagnosis to the user and recommend a full re-record or manual investigation.

**Hard cap: 2 correction cycles.** Do not enter an unbounded fix loop.

### 10.5 Making Flows Resilient

Apply these when recording new flows to reduce future breakage:

- **Echo expected state, not just actions.** Write `"On Settings > General screen, about to tap About"` not `"Tap About"`. During diagnosis these tell you what the screen _should_ look like.
- **Add screenshot steps after critical navigation.** Insert `screenshot` steps after screen transitions. These produce images in the flow result you can inspect during diagnosis.
- **Write specific executionPrerequisites.** `"App on home tab, user logged in, simulator UDID is <X>"` — not `"App running"`. Verify with `screenshot` + `describe` before acknowledging.
- **Prefer launch-app / open-url over navigation chains.** Deep links are more resilient to layout changes than tap sequences.
- **Echo accessibility labels for coordinate taps.** When recording a tap, add an echo with the target's label or testID: `"Tapping 'Submit' button (testID: submit-btn) at 0.5, 0.82"`. During repair, use `describe` to find the element by label and update coordinates. Only use `screenshot` for permission or system overlays when `describe` cannot expose the target reliably.
Loading
Loading