react-rx-hook-audit
Skill by sanity-io
Finds react-rx hook call sites in the Sanity repository that churn observable identity or re-render too often. It verifies the suspicion at runtime and refactors them to the useValuePreview pattern. Built for engineers reviewing or writing components that use these hooks.
Install react-rx-hook-audit
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sanity-io/sanity /tmp/sanity && mkdir -p ~/.claude/skills && cp -r /tmp/sanity/.agents/skills/react-rx-hook-audit ~/.claude/skills/react-rx-hook-auditRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sanity-io/sanity /tmp/sanity && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/sanity/.agents/skills/react-rx-hook-audit ~/.gemini/antigravity-cli/skills/react-rx-hook-auditAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install react-rx-hook-audit in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The react-rx hook audit skill looks for call sites of useObservable, useSyncObservable and useObservablePromise whose observable identity changes or that re-render more than needed. It gives search commands to list candidates and dependency arrays to check. It then describes how to confirm a suspicion with the React DevTools profiler and with temporary console logs counted in a headed Chrome session. It also guides a refactor toward the useValuePreview pattern.
The skill explains the difference between react-rx 6 and react-rx 7, where identity changes show up as loading flashes. It includes a reference hook implementation and three test cases for regressions. It is aimed at engineers reviewing or writing components and hooks that use these hooks, especially when a re-render, loading flash or resubscribe storm is suspected.
Written from the project's SKILL.md and checked against it.
What it can do
- Find candidate call sitesRuns ripgrep searches for react-rx hook calls and flags risky useMemo dependency arrays.
- Count renders at runtimeUses agent-react-devtools profile commands to count re-renders during an interaction.
- Count subscriptions at runtimeAdds temporary console logs and a Playwright script to count builds and subscriptions per host.
- Refactor to the useValuePreview patternLays out steps to split identity inputs from streamed inputs and hold them in a BehaviorSubject.
- Write regression testsDescribes a harness and three tests that assert on rendered frames and subscription counts.
- Compare against react-rx 6 warm-upExplains how to run the test file against the react-rx 6.0.1 dist to see masked issues.
What you need
- Node.js and pnpm
- A running Sanity test studio with the react-devtools skill set up
- Playwright and Google Chrome at /usr/local/bin/google-chrome
- A STUDIO_AUTH_TOKEN environment variable and an existing document in the /test workspace
Try asking
- Audit the react-rx hook call sites in this component for identity churn
- Count renders and subscriptions while I type in this studio field
- Refactor this useObservable hook to the useValuePreview pattern
Good to know
- The render profiler counts renders, not subscriptions, so some resubscribes are not visible.
- Hidden Activity trees show as repeated first-mount fibers, not as re-renders.
- Commands and file paths are specific to the Sanity repository and its test studio.
- Installed react-rx dist files are hard links, so they must be unlinked before editing.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/react-rx-hook-audit/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md11 KB
Alternatives to react-rx-hook-audit
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
react-rx-hook-audit: common questions
Does this skill work with react-rx 7?
The source says react-rx 7 has no warm-up, so each identity change renders initialValue once and resubscribes on commit. It also says useObservableSubject replaces useObservableEvent.
Can it count subscriptions as well as renders?
Yes. It describes temporary console logs and a Playwright run that counts build and subscribe lines. The render profiler alone does not count resubscribes that render the same value.
When should the refactor pattern not be applied?
The source says not to apply it when the observable has no value-shaped inputs, only ids, strings and stores. It also says not to use it when consumers need a synchronous update on every change.
How do I install react-rx-hook-audit?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is react-rx-hook-audit free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is react-rx-hook-audit safe to use?
It scores 82 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to react-rx-hook-audit?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
