setup
/rn-dev-agent:setupWhat it does
Section titled “What it does”/setup does two things in sequence: diagnoses your environment, then proposes the project-side wiring the plugin needs. Each proposed change is shown as a diff and asks for confirmation before writing.
| Phase | Step | Action |
|---|---|---|
| 1. Diagnose | A | Run /doctor — check Node, CDP bridge, agent-device, maestro-runner, simulators, Metro, ffmpeg |
| 2. Inject | B | Append the plugin’s tool-routing rules to your project CLAUDE.md (or create one) |
| 2. Inject | C | Add a small dev-only bridge call to your app entry — exposes the navigation ref + Zustand stores in __DEV__ only |
| 2. Inject | D | Scaffold .rn-agent/ — the plugin’s home in your project (README, .gitignore, dev-bridge.ts, globals.d.ts, starter folders) |
| 2. Verify | E | Run cdp_status to confirm the bridge is reachable |
Re-running /setup is idempotent. Already-applied blocks are detected and skipped — safe to run any time you want to confirm everything is wired.
When to run
Section titled “When to run”- First time using the plugin in a project
- After SessionStart shows WARNING messages
- When
cdp_statusfails to connect - When
device_*tools fail - After cloning a project that already had
/setuprun by someone else (will detect existing wiring and skip)
Example output
Section titled “Example output”| Check | Status | Action Needed ||-----------------|-----------------------|-----------------------------------------|| Node.js | OK (v22.15.0) | — || CDP bridge | OK | — || agent-device | MISSING | Run: npm install -g agent-device || maestro-runner | OK (v1.0.9) | — || iOS Simulator | BOOTED (iPhone 16) | — || Android | NOT RUNNING | Boot an emulator || Metro | RUNNING (port 8081) | — || CDP connection | CONNECTED | — || ffmpeg | OK (v7.1) | — |
CLAUDE.md — append plugin tool-routing rules? [diff shown] (y/n)App entry — add getBridge()?.registerNavRef(...)? [diff shown] (y/n)App entry — add getBridge()?.registerStores(...)? [diff shown] (y/n).rn-agent/ — scaffold (8 files)? [list shown] (y/n)See also
Section titled “See also”/doctor— read-only diagnostic sibling./doctorreports;/setupfixes and instruments.- Getting Started — installation and first run
- Actions — what
.rn-agent/is for after/setupscaffolds it