agentleFS
avas-appavas-app/agent-bridge/skills/agent-bridge/SKILL.md

agent-bridge

Skill3 starsChanged 53 days agoMITView on GitHub

Drive a running React Native or Expo dev build directly through @avasapp/agent-bridge: start from an app-defined scenario such as a locally signed-in user, see what's on screen, fill in forms, press buttons, seed query data, flip feature flags, set store state, navigate, mock the network, fake realtime messages and undo it all, in milliseconds per call instead of tapping through the app. Pairs with agent-device, which opens the app and covers native UI, real taps and screenshots. Use whenever you need the app in a particular state to test a change, or need to verify what a screen shows.

8 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions8 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 8

    1. kununu/agent-bridge★ 18same name
    2. xyva-yuangui/agent-bridge★ 15same name
    3. EthanSK/agent-bridge★ 11same name
    4. cocodrino/bridge-harness★ 4same name
    5. Latth/agent-bridge★ 2same name
    6. ilamanov/skills★ 1same name
    7. JaylanJerry/codex-agent-bridge★ 0same name
    8. Mihirokte/agent-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use both, each for what it's good at:

    line 14
  2. Distinctive:

    Don't tap through setup screens or edit backend data to reach a state that one bridge call can set.

    line 24
  3. Very specific:

    If Metro runs on another port, pass the same --metro (or set AGENT_BRIDGE_METRO) on every command that doesn't go through the session.

    line 43
  4. Very specific:

    If a call fails with app not connected.

    line 58
  5. Very specific:

    If tools fails with "agent-bridge isn't running", the hook isn't mounted in this build.

    line 64
  6. Very specific:

    If the app doesn't have the package or a bridge file yet, run npx @avasapp/agent-bridge init --json in the app (--dir apps/x from a …

    line 67
  7. Very specific:

    Add a mock for it (net.mock), don't turn strict mode off.

    line 93
  8. Distinctive:

    If the app has no scenario for the state you need, say so.

    line 95
  9. Very specific:

    Every reply carries errors the app logged or threw since the previous reply, printed as !

    line 115

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Driving an app with agent-bridge

The app mounts useAgentBridge({ tools }) in a dev build. You call those tools by name. Nothing is tapped, so there is no setup to click through.

Pair it with agent-device

agent-bridge works inside the app's JavaScript; agent-device works the device. Use both, each for what it's good at:

agent-bridgeagent-device
Put the app in a state: flags, query data, store values, network mocks, realtime messagesInstall and open the app, reload, relaunch
Navigate, fill forms, press buttons, check text on screenSystem alerts, permission prompts, native sheets, the keyboard
Undo it all with bridge.restoreScreenshots, recordings, one real tap to prove the UI responds

A typical run: agent-device open the app, set up and check the screen with agent-bridge, then finish with one real tap or a screenshot from agent-device. Don't tap through setup screens or edit backend data to reach a state that one bridge call can set.

Run the CLI directly

The examples say npx @avasapp/agent-bridge; never drop the scope, because agent-bridge on npm is an unrelated package. Prefer the installed bin, ./node_modules/.bin/agent-bridge (with bun too): npx loads npm's config on every call, so a project .npmrc with keys npm doesn't know prints npm warn Unknown project config into your output each time, and it adds roughly 200 ms more startup per call (machine-dependent).

Start a session

npx @avasapp/agent-bridge session start            # add --metro host:port if Metro isn't on localhost:8081
npx @avasapp/agent-bridge tools                    # what this app exposes

If Metro runs on another port, pass the same --metro (or set AGENT_BRIDGE_METRO) on every command that doesn't go through the session. A Nothing is listening on … error names the Metro it found instead and its apps; check it's yours before switching to it.

A session holds one connection for all your calls. It stops itself after 15 minutes without calls and runs bridge.restore when it does.

A JS reload (an error screen's Retry, or app.reload) throws away every pending restore. The session notices the app is a new runtime and reports app reloaded; N pending restores lost: store, query (the areas that had something to undo) as a warning on the next call (also on a failed one) and again in session stop. When you see it, redo your setup: nothing you changed before the reload will be undone.

If a call fails with app not connected; reconnecting or The app is gone, the session lost the app (Metro or the app is down, or mid-reload). It retries on its 5 s health check and on your next call: wait a few seconds and call again. session stop still works. A session never moves to another app: <app> is not connected; connected: … means its app is gone and something else is there.

If tools fails with "agent-bridge isn't running", the hook isn't mounted in this build. Say so; don't fall back to tapping silently.

If the app doesn't have the package or a bridge file yet, run npx @avasapp/agent-bridge init --json in the app (--dir apps/x from a monorepo root). It writes src/dev/agent-bridge.tsx but never edits the root layout: paste mount.snippet into mount.file as mount.note says. Ask the user about each entry in choices it reports as open (such as network tools), then rerun with the flag it names, or add its lines by hand when there's no flag. Then follow next, from runFrom.

Start from a scenario

Apps can define named setups, such as a locally signed-in user. Use one instead of signing in by hand or seeding auth state yourself:

npx @avasapp/agent-bridge scenarios                                        # what this app defines
npx @avasapp/agent-bridge call scenario.apply '["signedIn", {"user": {"name": "Ada"}}]'

scenarios shows each one's options as a JSON Schema. Bad options fail before anything changes, and the error lists every problem (options: unknown option "usr". Known: user): fix them and apply again. bridge.restore (and session stop) undoes it after everything else.

A local scenario usually turns on strict network mode: any request no mock answers fails with a 501, and the reply carries an error that names it (! error during …: agent-bridge strict network: no mock for GET https://…). Add a mock for it (net.mock), don't turn strict mode off.

If the app has no scenario for the state you need, say so. Don't sign in to a real account instead. If you're asked to add one, read references/writing-scenarios.md.

See and use the screen

npx @avasapp/agent-bridge call screen.snapshot                       # buttons, inputs, text on the focused screen
npx @avasapp/agent-bridge call screen.press '"add-plant"'            # by testID, label or text
npx @avasapp/agent-bridge call screen.fill '["plant-name", "Fern"]'  # runs the input's handlers
npx @avasapp/agent-bridge call screen.waitFor '"Name is required"'   # {"gone": true} waits for it to go
npx @avasapp/agent-bridge call router.navigate /inbox

press and fill return once the app has rendered the result, so the next check sees it. Arguments are a JSON array (or a single JSON value): the array is spread into the tool's arguments.

Watch for errors

Every reply carries errors the app logged or threw since the previous reply, printed as ! error during <tool> or ! error after <tool>. Treat them as failures of the step they name. npx @avasapp/agent-bridge call bridge.logs shows the last 200 errors and warnings.

Clean up

npx @avasapp/agent-bridge call bridge.pending      # what restore will put back, per area
npx @avasapp/agent-bridge session stop             # runs bridge.restore; --keep leaves the app as is

bridge.restore unpins queries, puts back store values, removes network mocks, unmutes realtime channels, then undoes active scenarios, so the next run starts from the real state.

Read more when you need it

When you need to…Read
Press icon-only buttons, scroll, pull to refresh, find text, take a screenshotreferences/screen.md
Drive or read a page inside a WebView (webview "…" in the snapshot)references/webview.md
Read or set query data, store values, routes, modals; get argument shapes rightreferences/state.md
Mock or inspect requests, or deal with strict network modereferences/network.md
See or fake realtime messages (realtime.* in tools)references/realtime.md
Handle a result over 32 KB or an argument over ~128 KBreferences/large-data.md
Run many calls at once, write a flow file, or measure timingreferences/flows.md
Understand what restore undoes, or fix a value restore got wrongreferences/restore.md
Add a scenario to the appreferences/writing-scenarios.md

The app may expose its own tools for hooks the bridge has no tool for (queue.flush, realtime.reconnect); tools lists them. There is no app.eval: if the app has no tool for it, say so.

Caveats

  • It can't see native UI (system alerts, permission prompts, native sheets) or overlap. Finish a flow with one real UI check or screenshot from agent-device.
  • fill skips the keyboard: autocorrect and native-only input behaviour need one real typing step from agent-device.
  • Swipe and drag gestures need agent-device, unless the control is screen-reader operable: press sends its activate accessibility action (see references/screen.md).
  • With several apps on one Metro, pass --device.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.