
Argent Metro Debugger
- 9.8k installs
- 1.9k repo stars
- Updated August 4, 2026
- software-mansion/argent
argent-metro-debugger is an agent skill for 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, debugg
About
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 --- 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. 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).
- **`debugger-status` first when something fails** - it runs discovery, connection, and returns diagnostics.
- **"No CDP targets" → get the app to connect to Metro** - use `restart-app` on the device, then retry `debugger-status`
- **Call `debugger-log-registry`** - returns: `file` (log path), `totalEntries`, `byLevel`, `clusters` (top message grou
- **Search the file** using `Grep` or `Read` with patterns from the response.
- Never `Read` the log file directly. Use `grep` or shell commands with limits using the above file format tips.
Argent Metro Debugger by the numbers
- 9,841 all-time installs (skills.sh)
- +1,085 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #56 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
argent-metro-debugger capabilities & compatibility
- Capabilities
- **`debugger status` first when something fails** · **"no cdp targets" → get the app to connect to m · **call `debugger log registry`** — returns: `fil · **search the file** using `grep` or `read` with · never `read` the log file directly. use `grep` o
- Use cases
- documentation
What argent-metro-debugger says it does
--- name: argent-metro-debugger description: Debug a JS runtime via CDP using argent debugger tools.
Use when connecting to the runtime, inspecting React components, reading console logs, or evaluating JavaScript.
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).
npx skills add https://github.com/software-mansion/argent --skill argent-metro-debuggerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 9.8k |
|---|---|
| repo stars | ★ 1.9k |
| Security audit | 2 / 3 scanners passed |
| Last updated | August 4, 2026 |
| Repository | software-mansion/argent ↗ |
When should developers use argent-metro-debugger and what problem does it solve?
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-lo
Who is it for?
Developers working with argent-metro-debugger patterns described in the skill documentation.
Skip if: Skip when cached docs are empty or the task is outside the skill's documented scope.
When should I use this skill?
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-lo
What you get
Grounded guidance and workflows from SKILL.md for argent-metro-debugger.
- component tree inspection
- console log output
- runtime JS evaluation results
By the numbers
- Default Metro dev server port localhost:8081
- Android debugging requires adb reverse of port 8081 to host
Files
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
| Tool | Purpose |
|---|---|
debugger-connect | Connect 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-status | Like connect + loadedScripts, enabledDomains, sourceMapReady (no-op on Chromium). Use to diagnose. |
Reload & recovery
| Tool | Purpose |
|---|---|
debugger-reload-metro | Reload all connected apps (like pressing "r" in Metro terminal). Needs a CDP target. |
restart-app | Terminate and relaunch the app by device id and bundleId. Use when app lost Metro connection. |
Inspection & console
| Tool | Purpose |
|---|---|
debugger-component-tree | Full React fiber tree (names, depth, bounding rects, tap coordinates). |
debugger-inspect-element | Inspect 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-registry | Get log summary (counts, clusters, file path). Then use Grep/Read on the flat log file for details. |
debugger-evaluate | Run a JS expression in the app runtime. |
---
3. Component Inspection
debugger-component-tree vs debugger-inspect-element
debugger-component-tree | debugger-inspect-element | |
|---|---|---|
| Best for | Layout overview; finding tap targets; user-defined component hierarchy | Identifying 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 withmaxNodes(component-tree) ormaxItems(inspect-element) and increase it incrementally (e.g., start at 50, then grow). Do not useincludeSkippedwithout 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: IftotalEntriesexceeds 10 000, delegate the grep exploration to anExploresubagent — 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)
| Field | Example | Notes |
|---|---|---|
[L:<id>] | [L:42] | Unique grep anchor |
<timestamp> | 2026-03-17T14:30:00.000Z | ISO 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 attempt | Full 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
Readthe log file directly. Usegrepor shell commands with limits using the above file format tips. - Default to
-m 50unless you need more. - Use
tail -Nrecent entries. clusters[].messagegives 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
| Action | Tool |
|---|---|
| Diagnose / check connection | debugger-status |
| Connect to CDP (Metro / Chromium) | debugger-connect |
| Reload JS (already connected) | debugger-reload-metro |
| Relaunch app on device | restart-app |
| Inspect component at point | debugger-inspect-element |
| Full component tree | debugger-component-tree |
| Console log overview | debugger-log-registry (summary + log file path for Grep/Read) |
| Evaluate JS | debugger-evaluate |
Failure Scenarios: Recovery Steps
When a debugger tool fails, use `debugger-status` first to diagnose. Then match the error or situation below and act as specified. Do not retry the same failing tool repeatedly without following the recovery steps.
| Scenario | Error or situation | What to do |
|---|---|---|
| Metro not running | Error contains: Metro at port 8081 is not running (got: ...) | Start Metro yourself unless the user asked you not to: scan the workspace configuration and run the appropriate command to start Metro in the background (by default npx react-native start or npx expo start). Wait for Metro to be ready, then retry debugger-connect or debugger-status. If you cannot determine the project root, ask the user. |
| Metro not standard | Error contains: Metro at port 8081 did not return X-React-Native-Project-Root header | Something on that port is not the standard React Native Metro server. Try starting Metro yourself from the app's project root using the command resolution above. If you cannot determine the correct root or the problem persists, inform the user what you found and what you tried. |
| App not connected | Error contains: Metro at port 8081 has no CDP targets — is a React Native app connected? | 1) Confirm the app is running on the device. 2) Use restart-app with the app's device id and bundleId to relaunch so it connects to Metro. 3) Wait a few seconds for the bundle to load. 4) Retry debugger-status. Do not use debugger-reload-metro to fix this — it also requires at least one target. |
| Was connected, then tool fails | Any debugger tool fails with a connection or disconnect error after it was working | The app may have crashed or been closed. Use restart-app to relaunch the app, then call debugger-connect again to pick up the fresh logicalDeviceId (may change for booted-fresh simulators), and use that new device_id on all subsequent calls. |
Source Resolution for inspect-element
debugger-inspect-element tries to resolve each component in the hierarchy to its source file and line. It uses a fallback chain:
1. `_debugStack` (React fiber property) — a stack trace string from the bundled code. When available, the tool symbolicates it via Metro's /symbolicate endpoint to resolve to the original source file, then reads a code fragment from disk. Set resolveSourceMaps: false to skip symbolication and return raw bundled locations instead. 2. `_debugSource` (React fiber property) — contains { fileName, lineNumber, columnNumber } pointing directly to the original source file. No symbolication needed. The tool reads the code fragment from disk automatically. 3. Neither available — the tool returns the component hierarchy with source: null and code: null for all items. The hierarchy (component names) is still useful.
When Source Info Is Missing
If debugger-inspect-element returns all items with source: null, the React Native project's Babel configuration does not inject source information into JSX elements. This is common with the automatic JSX transform (used by Expo SDK 50+ and React Native 0.73+).
To enable source resolution, inform the user that they can add @babel/plugin-transform-react-jsx-source to their project's Babel config. For example, in babel.config.js:
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"], // or 'module:@react-native/babel-preset'
plugins: [
"@babel/plugin-transform-react-jsx-source", // enables _debugSource on fibers
],
};
};After adding the plugin, restart Metro (npx react-native start --reset-cache or npx expo start --clear) and reload the app. The tool will then automatically pick up _debugSource and resolve components to their source files. No extra npm install needed — the plugin ships with babel-preset-expo and @babel/preset-env.
Related skills
FAQ
What does argent-metro-debugger do?
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 dri
When should I invoke argent-metro-debugger?
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 dri
Where is the source documentation?
Ground claims in SKILL.md excerpts and linked reference files from the cached docs.
Is Argent Metro Debugger safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.