rab-rn-debug

A debugging guide for checking and controlling React Native apps on real phones or simulators through a local service. React Native is a way to build mobile apps with JavaScript and React.

In plain words
What is it for?
Use it to send structured commands to a mobile app, find and call its Service functions, check results with assertions, inspect Service state, and collect device logs.
Why use it?
It removes the need to inspect the app manually when checking its Service logic or state. It also helps identify connected devices and retrieve their console logs.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ximing/rab/rab-rn-debug
Any agent
npx skills add ximing/rab --skill rab-rn-debug
Clone the repo
git clone --depth 1 https://github.com/ximing/rab

Made for: Claude Code, Codex.

Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,197 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00120 $0.02197
Opus 5 $0.00060 $0.01099
Sonnet 5 $0.00024 $0.00439
Haiku 4.5 $0.00012 $0.00220

Measured yesterday against content hash 604b61e66907, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rab-rn-debug scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:9229/api/devices
skills/rab-rn-debug/SKILL.md · 204 lines

How it starts

The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.

rab-rn-debug 调试指南(React Native)

本 skill 告知 Agent 如何通过 rab-rn-debug 本地服务(默认 localhost:9229)向集成 @rabjs/rn-debug 的 React Native 应用发送 HTTP 指令,对 Service 层进行功能验证与状态检查。请求会同步挂起直到设备执行完毕返回结果。


前置条件

  1. 电脑上启动调试服务(bin 名 rab-rn-debug,来自 @rabjs/rn-debug-server):
npx rab-rn-debug            # 默认端口 9229,启动时会打印局域网 IP(setupRNDebug 的 host)
  1. RN 应用已集成 SDK(App 入口,仅 __DEV__ 生效):
import { setupRNDebug } from '@rabjs/rn-debug';

setupRNDebug({ host: '<电脑局域网IP>', port: 9229, appName: 'MyApp' });
  1. 确认设备在线:
curl -s http://localhost:9229/api/devices
# 期望: [{"deviceId":"rn-ios-xxxx","appName":"MyApp","platform":"ios","osVersion":"18.0","sdkVersion":"0.1.0","connectedAt":...,"lastSeen":...}]

如果目标 App 尚未接入,先引导用户完成上述步骤再调试。多设备在线时,请求需带 deviceId(见下)。


指令调用方式

curl -X POST http://localhost:9229/api/commands \
  -H 'Content-Type: application/json' \
  -d '{"type":"<指令type>","payload":{...},"timeout":30000}'
  • 唯一设备在线时自动路由;多设备返回 409(body 为 {"error":"multiple devices, specify deviceId","devices":["rn-ios-xxx","rn-android-yyy"]}),改用 POST /api/devices/<deviceId>/commands;无设备返回 404;指定的 deviceId 不存在同样返回 404。
  • 响应:{"id","status":"ok"|"error"|"timeout","result","durationMs"};失败时另有 error:{"message","stack?"}
  • 事后可用 GET /api/commands/<id> 查询单条指令记录(含 status:"pending" 的进行中状态)。
  • 同一设备指令严格串行;默认超时 30s(上限 120s,超出按 120s 计),异步方法耗时长时可加大 timeout

常用调试操作

1. 连通性检查

curl -X POST localhost:9229/api/commands -H 'Content-Type: application/json' \
  -d '{"type":"ping"}'
# 期望 status ok, result: { "pong": true, "time": 1723766400000 }

2. 枚举所有已实例化的 Service

curl -X POST localhost:9229/api/commands -H 'Content-Type: application/json' \
  -d '{"type":"rab.listServices"}'

返回示例:

{
  "status": "ok",
  "result": [
    {
      "instanceId": "CartService#1",
      "containerName": "ProductPage_2",
      "identifierLabel": "CartService"
    }
  ]
}
  • instanceId 格式为 类名#序号(如 CartService#1),identifierLabel 为 Service 类名。
  • 仅枚举 Singleton 作用域且已实例化的 Service(Transient 不缓存实例,不会出现在列表中)。

Read the full file on GitHub · 204 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 204 lines · 120 tokens per session scan A 604b61e66907

Subscribe to this mod's changes

rab-rn-debug is a skill published in the GitHub repository ximing/rab (12 stars, last pushed yesterday), licensed MIT. It adds 120 tokens to every session and 2,197 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

flow

Use when you need to run Flow type checking, or when seeing Flow type errors in React code.

react/react · 22 tokens

tamagui

Universal React UI framework for web and native. Use when building cross-platform apps with Tamagui, creating styled components with styled(), configuring design tokens/themes, using Tamagui UI components, or working with animations. Triggers: "tamagui", "styled()", "$token", "XStack/YStack", "useTheme", "@tamagui/"…

tamagui/tamagui · 90 tokens

git-safety

Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git, push force, reset hard. NEVER force push or do destructive git operations.

tamagui/tamagui · 42 tokens

taro-ui-guide

Guides installation, Taro config, styling, and usage of taro-ui (At components) for WeChat/Alipay/H5/RN. Use when building Taro apps with taro-ui, picking components, theming, i18n, or modifying packages/taro-ui source.

jd-opensource/taro-ui · 66 tokens

menu-interactions

Wire mouse, wheel and touch input for react-horizontal-scrolling-menu: onWheel/onScroll are plain (api, event) => void callbacks, while ALL mouse/touch props (onMouseDown, onMouseUp, onMouseMove, onMouseLeave, onTouchStart, onTouchMove, onTouchEnd) are handler factories (api) => (event) => void. Covers mouse…

asmyshlyaev177/react-horizontal-scrolling-menu · 147 tokens

menu-migration

Detect and upgrade pre-v8 react-horizontal-scrolling-menu patterns that agents trained on older data still generate: destructured visibleElements/isFirstItemVisible/isLastItemVisible/initComplete (removed v6), Separator items, separatorClassName and getPrevItem/getNextItem (removed v7), the Arrows prop (removed v3)…

asmyshlyaev177/react-horizontal-scrolling-menu · 160 tokens