rab-cdp-debug

A browser debugging guide for inspecting Service objects in applications built with React and @rabjs/react. It uses Chrome DevTools, the browser’s built-in developer tools, to access the application’s Service container.

In plain words
What is it for?
Use it to find Service instances, inspect containers, check their state, and call Service methods while the app is running in a browser.
Why use it?
It provides a direct way to check live Service state and behavior in a browser instead of relying only on the visible page. The application must first expose its Service container to the browser.

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-cdp-debug
Any agent
npx skills add ximing/rab --skill rab-cdp-debug
Clone the repo
git clone --depth 1 https://github.com/ximing/rab

Made for: Claude Code, Codex.

Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00128 $0.05232
Opus 5 $0.00064 $0.02616
Sonnet 5 $0.00026 $0.01046
Haiku 4.5 $0.00013 $0.00523

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

Security

Grade A, and why

rab-cdp-debug scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rab-cdp-debug/SKILL.md · 653 lines

How it starts

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

window.RS_ROOT_CONTAINER 调试指南(Chrome DevTools MCP)

本 skill 告知 Agent 如何通过 Chrome DevTools MCPevaluate_script 工具,利用 @rabjs/devtools 挂载的 window.__RS_ROOT_CONTAINER__ 能力,对 Service 层进行功能验证与状态检查。


前置条件:初始化挂载

window.__RS_ROOT_CONTAINER__ 不会自动挂载,必须由应用入口显式初始化。

  1. 安装依赖:
pnpm add @rabjs/devtools
  1. 在应用入口(如 main.tsx)调用一次:
import { setupWindowRootContainer } from '@rabjs/devtools';

setupWindowRootContainer();

如果目标页面尚未接入,先引导用户完成上述初始化步骤,再进行后续调试。SSR 安全:非浏览器环境下调用会自动跳过。


能力概述

window.__RS_ROOT_CONTAINER__setupWindowRootContainer() 在浏览器环境下挂载的全局访问句柄,暴露整棵容器树的查询接口。

挂载时机:应用入口调用 setupWindowRootContainer() 时。

容器树结构

global (getGlobalContainer())           ← 真正的根,与 React 无关
  └─ RSRootInner_1                      ← RSRoot 的 bindServices 容器
       └─ ProductPage_2                 ← 页面级 bindServices 容器
            └─ CartDomain_3             ← Domain 级 bindServices 容器

RSRootContainerHandle 接口

interface RSRootContainerHandle {
  container: Container; // global 容器实例
  getService(instanceId: string): Service | undefined;
  getContainer(containerName: string): Container | undefined;
  listServices(): Array<{
    instanceId: string; // 格式: ClassName_nanoid
    containerName: string; // 来自 bindServices options.name 或自动生成
    identifierLabel: string; // Service 类名
    instance: Service; // 内存对象引用,可直接操控
  }>;
}

evaluate_script 工具使用说明

Chrome DevTools MCP 提供 evaluate_script 工具,可在当前选中页面内执行 JavaScript 函数,返回值必须是 JSON 可序列化的

function (string) (required): JavaScript 函数声明
  示例无参数: () => { return document.title }
  示例有参数: (el) => { return el.innerText; }
args (array) (optional): 传入函数的参数列表

关键约束:Service 实例本身不可序列化跨进程传递,必须在 evaluate_script 内部完成操作,只将基础类型(数字、字符串、布尔、普通对象)作为结果返回。


常用调试操作

1. 检查 handle 是否已挂载

() => {
  return typeof window.__RS_ROOT_CONTAINER__;
};
// 期望返回: "object"

2. 列出所有已实例化的 Service

() => {
  const handle = window.__RS_ROOT_CONTAINER__;
  if (!handle) return { error: '__RS_ROOT_CONTAINER__ 未挂载' };
  return handle.listServices().map(s => ({
    instanceId: s.instanceId,
    containerName: s.containerName,
    identifierLabel: s.identifierLabel,
  }));
};

Read the full file on GitHub · 653 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 · 653 lines · 128 tokens per session scan A a7e7a7292a79

Subscribe to this mod's changes

rab-cdp-debug is a skill published in the GitHub repository ximing/rab (12 stars, last pushed yesterday), licensed MIT. It adds 128 tokens to every session and 5,232 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. 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

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

menu-recipes

Recipes composed on the react-horizontal-scrolling-menu public API — NOT props: autoplay (setInterval + scrollNext gated on menuVisible), infinite loop/carousel (clone head/tail + scrollLeft teleport at seams), center on click (scrollToItem 'center'), save/restore scroll position (onUpdate, onInit, scrollContainer)…

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

menu-setup

Build a working react-horizontal-scrolling-menu: install, the mandatory 'react-horizontal-scrolling-menu/dist/styles.css' import, ScrollMenu with a unique itemId per child, arrow components via VisibilityContext with useLeftArrowVisible/useRightArrowVisible, Header/Footer slots, and CSS customization (fixed item…

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

menu-testing-ssr

Server rendering and testing for react-horizontal-scrolling-menu: the library is client-only ('use client' required in React Server Components, else "createContext is not a function"), SSR first paint is controlled by the useIsVisible defaultValue argument (canonical ('first', true) / ('last', false))…

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

menu-transitions-rtl

Animate react-horizontal-scrolling-menu scrolling and build right-to-left menus: noPolyfill defaults to true since v8, so transitionDuration (default 500), a custom-easing-function transitionBehavior, and per-call ScrollOptions { duration, boundary } on scrollToItem/scrollNext/scrollPrev are silently ignored unless…

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