PluginBench
Skill
Review
Audit score 70

argent-metro-debugger

software-mansion/argent

How to install argent-metro-debugger

npx skills add https://github.com/software-mansion/argent --skill argent-metro-debugger
Claude Code
Cursor
Windsurf
Cline
Full instructions (SKILL.md)

Source of truth, from software-mansion/argent.


name: argent-metro-debugger description: Debug a JS runtime via CDP using argent debugger tools. Primary path is React Native via Metro (iOS / Android); a subset of the tools (debugger-connect, debugger-status, debugger-evaluate, debugger-log-registry) also drive a Chromium (CDP) app's renderer (an Electron app, or any Chromium browser exposing CDP) through the same surface. Use when connecting to the runtime, inspecting React components, reading console logs, or evaluating JavaScript.

1. Prerequisites

For React Native (iOS / Android): requires Metro dev server running (default localhost:8081) and a React Native app connected to Metro (at least one CDP target). Verify via debugger-status.

For Chromium (CDP): requires a Chromium/CDP app already available — an Electron app booted via boot-device with electronAppPath, or any Chromium browser exposing a CDP port (auto-discovered by list-devices on 9222 / ARGENT_CHROMIUM_PORTS). The debugger re-uses the page CDP session — port is ignored, device_id is the chromium-cdp-<port> value from list-devices / boot-device. Only debugger-connect, debugger-status, debugger-evaluate, debugger-log-registry, view-network-logs, and view-network-request-details work on Chromium (the latter two read the browser's native CDP Network recording for the active tab instead of the Metro-injected fetch interceptor); debugger-component-tree, debugger-reload-metro, debugger-inspect-element, and the react-profiler-* / profiler-* tools are RN-only and reject Chromium at the capability gate with Tool 'X' is not supported on chromium app.

Android: reverse port for Metro

Android emulators and physical devices do not resolve the host's localhost by default. Before the RN app can reach Metro, forward port 8081 (or whichever port Metro is on) from the device back to the host:

adb -s <serial> reverse tcp:8081 tcp:8081

<serial> is the Android serial from list-devices. Once reversed, the app on the device connects to Metro just like an iOS simulator does, and all debugger-* / network-* / react-profiler-* tools work unchanged. If the device restarts or adb drops, re-run the command. A failing Metro connection on Android almost always means adb reverse has not been done or has been lost.

2. Tool Overview

All tools accept port (default 8081) AND device_id (the iOS Simulator UDID or Android serial, a.k.a. logicalDeviceId — the CDP-reported id that matches the device). Always make sure you target the correct app on the correct device.

One Metro port can serve multiple connected devices (e.g. two simulators on localhost:8081, or an iOS simulator alongside an Android emulator with adb reverse set up). device_id pins every debugger/network/profiler call to a specific device so sessions do not collide.

Connect & diagnostics

ToolPurpose
debugger-connectConnect to the JS runtime's CDP (Metro on iOS / Android; the page CDP session on Chromium). Returns port, projectRoot (empty on Chromium), deviceName, appName, logicalDeviceId, isNewDebugger, connected. The returned logicalDeviceId is the device_id for every subsequent debugger call.
debugger-statusLike connect + loadedScripts, enabledDomains, sourceMapReady (no-op on Chromium). Use to diagnose.

Reload & recovery

ToolPurpose
debugger-reload-metroReload all connected apps (like pressing "r" in Metro terminal). Needs a CDP target.
restart-appTerminate and relaunch the app by device id and bundleId. Use when app lost Metro connection.

Inspection & console

ToolPurpose
debugger-component-treeFull React fiber tree (names, depth, bounding rects, tap coordinates).
debugger-inspect-elementInspect at (x, y) using logical pixel coordinates (not normalized 0-1): component hierarchy with source file:line and code fragment. See references/source-maps.md.
debugger-log-registryGet log summary (counts, clusters, file path). Then use Grep/Read on the flat log file for details.
debugger-evaluateRun a JS expression in the app runtime.

3. Component Inspection

debugger-component-tree vs debugger-inspect-element

debugger-component-treedebugger-inspect-element
Best forLayout overview; finding tap targets; user-defined component hierarchyIdentifying a visible element and tracing it to its source file
Use when"What's on screen and where?""What component is this and where is it defined?"

Both can point to source files, but inspect-element is purpose-built for source tracing. component-tree is for orientation and tap-target discovery.

includeSkipped guidance

Applies to both debugger-component-tree and debugger-inspect-element. Set to true only when debugging filter behavior — e.g., an expected component is missing from output, or you need to inspect a very specific branch of the tree (not just an overview).

Warning: Output can be very large. Always combine with maxNodes (component-tree) or maxItems (inspect-element) and increase it incrementally (e.g., start at 50, then grow). Do not use includeSkipped without a limit on large apps.


4. Golden Rules

  1. debugger-status first when something fails — it runs discovery, connection, and returns diagnostics.
  2. "No CDP targets" → get the app to connect to Metro — use restart-app on the device, then retry debugger-status.
  3. Never assume one failure is permanent — follow recovery steps before asking the user. For starting Metro and full failure recovery, see argent-react-native-app-workflow and references/failure-scenarios.md.

5. Reading Console Logs (Log Registry)

Logs are written to a flat log file on disk. Use the log-registry → grep pattern instead of reading logs inline.

Workflow

  1. Call debugger-log-registry — returns: file (log path), totalEntries, byLevel, clusters (top message groups with counts and source file info)
  2. Search the file using Grep or Read with patterns from the response.

Large log files: If totalEntries exceeds 10 000, delegate the grep exploration to an Explore subagent — pass it the file path, the entry format, and the patterns you need.

Flat log format

One entry per line — fields (whitespace-separated, | delimiter before message)

FieldExampleNotes
[L:<id>][L:42]Unique grep anchor
<timestamp>2026-03-17T14:30:00.000ZISO 8601
<LEVEL>ERROR, WARN , LOG Uppercase, padded to 5 chars
<source>src/api/user.ts:42 or -Relative path from source map; - if unavailable
<message>Failed login attemptFull message; embedded newlines replaced with space

Source attribution (file + line) is also available in clusters returned by debugger-log-registry.

Log files and messages can be large - Always scope your search, treat the file like a database, not a document.

When reading from the log file:

  • Never Read the log file directly. Use grep or shell commands with limits using the above file format tips.
  • Default to -m 50 unless you need more.
  • Use tail -N recent entries.
  • clusters[].message gives you the exact text which you may look for

If the file is too large Delegate to an Explore subagent with the file path, the format spec above, and the specific patterns you need.


Quick Reference

ActionTool
Diagnose / check connectiondebugger-status
Connect to CDP (Metro / Chromium)debugger-connect
Reload JS (already connected)debugger-reload-metro
Relaunch app on devicerestart-app
Inspect component at pointdebugger-inspect-element
Full component treedebugger-component-tree
Console log overviewdebugger-log-registry (summary + log file path for Grep/Read)
Evaluate JSdebugger-evaluate

Related skills

More from software-mansion/argent and the wider catalog.

AR

argent-android-emulator-setup

software-mansion/argent

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.

4.4k installsAudited
AR

argent-device-interact

software-mansion/argent

Interact with an iOS simulator, Android emulator, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking visible app state after interactions.

4.4k installsAudited
AR

argent-react-native-app-workflow

software-mansion/argent

Step-by-step workflows for developing or debugging React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing builds, diagnosing runtime errors, or running tests.

4.4k installsAudited
AR

argent-ios-simulator-setup

software-mansion/argent

Set up and connect to an iOS simulator using argent MCP tools. Use when starting a new session, booting an iOS simulator, getting an iOS UDID, or before any iOS simulator interaction task.

4.4k installsAudited
AR

argent-test-ui-flow

software-mansion/argent

Autonomously test an app UI (iOS or Android) by running interact-screenshot-verify loops using argent MCP tools. Use when testing UI flows, verifying login works, testing navigation, running end-to-end UI test scenarios, manual QA steps, visible UI changes, or visual behavior.

4.4k installs
AR

argent-react-native-profiler

software-mansion/argent

Profile a React Native Hermes app to measure re-render and CPU performance using argent profiler tools. Use when optimizing for performance, measuring before/after a fix, spotting slow components, diagnosing re-renders, checking CPU hotspots, or producing a ranked issue report.

4.4k installsAudited