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.
npx agentmods add skills/ximing/rab/rab-reactnpx skills add ximing/rab --skill rab-reactgit clone --depth 1 https://github.com/ximing/rabWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00149 | $0.05114 |
| Opus 5 | $0.00075 | $0.02557 |
| Sonnet 5 | $0.00030 | $0.01023 |
| Haiku 4.5 | $0.00015 | $0.00511 |
Grade A, and why
rab-react 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.
How it starts
The opening of the file, as written. The whole thing — 681 lines — stays where its author put it; the contents beside it link to each section on GitHub.
@rabjs/react 快速参考
这是为大模型优化的 @rabjs/react (RSJS) 快速参考指南,聚焦最核心的使用模式。
🎯 五大核心概念
1. 响应式组件:observer 和 view
基本规则:组件必须使用 observer 或 view 包裹才能自动响应状态变化。
import { observer, view } from "@rabjs/react";
// ✅ 方式 1:observer(推荐用于函数组件)
const Counter = observer(() => {
const service = useService(CounterService);
return <div>{service.count}</div>; // 自动追踪 count 变化
});
// ✅ 方式 2:view(支持类组件和函数组件)
class Counter extends React.Component {
render() {
const { store } = this.props;
return <div>{store.count}</div>;
}
}
export default view(Counter);
// ❌ 错误:忘记使用 observer
const Counter = () => {
const service = useService(CounterService);
return <div>{service.count}</div>; // 不会自动更新!
};
关键点:
- 必须在
observer内部访问 observable 属性 - 不要解构 observable 对象(会破坏响应性)
view和observer功能相同,view额外支持类组件
2. Service:业务逻辑容器
基本规则:所有业务逻辑都应该封装在 Service 类中,包括组件内的操作方法。
import { Service } from "@rabjs/react";
export class CounterService extends Service {
// 属性自动是 observable
count = 0;
// 方法自动是 action(批量更新)
increment() {
this.count++;
}
decrement() {
this.count--;
}
// 计算属性(getter)
get doubleCount() {
return this.count * 2;
}
// 异步方法自动追踪 loading 和 error
async fetchData() {
const response = await fetch("/api/data");
this.count = await response.json();
}
}
// 在组件中访问异步状态
const Component = observer(() => {
const service = useService(CounterService);
// 自动生成的状态
if (service.$model.fetchData.loading) return <div>加载中...</div>;
if (service.$model.fetchData.error) return <div>错误</div>;
// 可以直接使用,框架会处理好 this指向问题
return <div onClick={service.fetchData}>{service.count}</div>;
});
关键点:
- Service 类继承自
Service基类 - 所有属性自动是响应式的(observable)
- 所有方法默认就是 action(批量更新),不需要也不应该再写
@Action装饰器 - 只有需要关闭批量更新时才用
@SyncAction标记方法 - 异步方法自动追踪
loading和error状态(通过$model.methodName)
3. useService + bindServices:连接组件和 Service
基本规则:使用 bindServices 注册 Service,使用 useService 获取 Service 实例。
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- evals/evals.json 9.6 KB
- evals/README.md 4.6 KB
- references/async-operations.md 3.4 KB
- references/best-practices.md 5.6 KB
- references/computed-properties.md 2.5 KB
- references/debugging.md 5.5 KB
- references/decorators.md 6.8 KB
- references/domain-architecture.md 4.7 KB
- references/event-system.md 5.3 KB
- references/hooks-api.md 3.7 KB
- references/observable-api.md 1.7 KB
- references/ssr.md 2.3 KB
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.
- yesterday First seen · 681 lines · 149 tokens per session scan A 101ebfcf026b
rab-react is a skill published in the GitHub repository ximing/rab (12 stars, last pushed yesterday), licensed MIT. It adds 149 tokens to every session and 5,114 once invoked, about $0.0007 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.
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…
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)…
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)…
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…
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))…
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…