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/childrentime/reactuse/hook-testnpx skills add childrentime/reactuse --skill hook-testgit clone --depth 1 https://github.com/childrentime/reactuseWhat 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.00077 | $0.01022 |
| Opus 5 | $0.00039 | $0.00511 |
| Sonnet 5 | $0.00015 | $0.00204 |
| Haiku 4.5 | $0.00008 | $0.00102 |
Grade A, and why
hook-test 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 — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.
hook-test — test a hook the ReactUse way
The core package uses jest (not vitest), testEnvironment: 'jsdom'. Tests run via
babel-jest against src/ directly — no build step needed.
Where tests live
Co-located with the hook: packages/core/src/useX/index.spec.ts (a couple use .test.ts,
but prefer index.spec.ts). There is no central __tests__ directory.
Basic pattern
import { act, renderHook } from '@testing-library/react'
import { useX } from '.'
describe('useX', () => {
function setUp(initial?: number) {
return renderHook(() => useX(initial))
}
it('inits with the given value', () => {
const { result } = setUp(5)
expect(result.current[0]).toBe(5)
})
it('updates on set', () => {
const { result } = setUp(0)
act(() => {
result.current[1](10) // wrap every state mutation in act()
})
expect(result.current[0]).toBe(10)
})
})
Key rules:
- Wrap a
renderHookcall in a smallsetUp()helper. - Every state mutation goes inside
act(() => { … }). - Read current values via
result.current; usererender()/unmount()from therenderHookreturn for prop changes and cleanup assertions.
Timer hooks
describe('useInterval', () => {
jest.useFakeTimers()
jest.spyOn(global, 'clearInterval')
it('fires on the interval', () => {
const cb = jest.fn()
renderHook(() => useInterval(cb, 20))
expect(cb).not.toBeCalled()
jest.advanceTimersByTime(70)
expect(cb).toHaveBeenCalledTimes(3)
})
it('clears on unmount', () => {
const { unmount } = renderHook(() => useInterval(jest.fn(), 200))
unmount()
expect(clearInterval).toHaveBeenCalledTimes(1)
})
})
SSR / hydration tests
For hooks that must not break SSR or cause hydration mismatch, use the custom environment and render on the server, then hydrate:
/**
* @jest-environment ./.test/ssr-environment
*/
import { act } from '@testing-library/react'
import ReactDOMServer from 'react-dom/server'
import ReactDOMClient from 'react-dom/client'
import { createMockMediaMatcher } from '../../.test'
import { createTestComponent } from '../../.test/testingHelpers'
describe('useX SSR', () => {
beforeEach(() => {
jest.resetModules()
window.matchMedia = createMockMediaMatcher({ '(prefers-color-scheme: dark)': true }) as any
})
it('does not mismatch during hydration', async () => {
const TestComponent = createTestComponent(() => useX())
const el = document.createElement('div')
const markup = ReactDOMServer.renderToString(<TestComponent />)
el.innerHTML = markup
const root = await act(() => ReactDOMClient.hydrateRoot(el, <TestComponent />))
expect(el.innerHTML).toBe(markup)
await act(() => root.unmount())
})
})
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 · 123 lines · 77 tokens per session scan A 72db6b81b996
hook-test is a skill published in the GitHub repository childrentime/reactuse (1,047 stars, last pushed 11d ago), licensed Unlicense. It adds 77 tokens to every session and 1,022 once invoked, about $0.0004 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
react-hooks-composition
Advanced React hooks composition patterns - SWR integration, debounced search, memoized contexts, state machines, and performance optimization.
juniors-best-practice
Juniors-focused React and TypeScript best practices. Use this skill when writing or reviewing code to enforce clear, consistent, and maintainable patterns across common scopes like React, TypeScript, styling, devtools, assets, and Git.
react-hooks-best-practices
React hooks best practices for React application code and custom hook design across DX, optimization, and logic. Use when writing components with hooks, creating or refactoring custom hooks, reviewing hook usage/APIs/internals, checking effects/dependencies/state/refs/callbacks, or improving hook correctness…
reactuse
Practical playbook for React teams to choose and apply reactuse hooks across state, async flows, browser APIs, and UI interactions. Use it when replacing custom hook logic with production-ready patterns that stay compatible with SSR and Next.js.
react-ink
Use this skill when building terminal user interfaces with React Ink - interactive CLI apps, terminal dashboards, progress displays, or keyboard-driven TUI components. Triggers on React Ink, Ink components, terminal UI with React, useInput, useFocus, Box/Text layout, create-ink-app, and any task requiring rich…
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance…