reactuse: Skill for Claude Code

.claude/skills/new-hook/SKILL.md

new-hook is a skill for Claude Code from childrentime/reactuse. It costs 82 tokens per session (1,137 once invoked), scanned A, original, Unlicense.

A guide for creating a new React hook in the @reactuses/core package. A React hook is a reusable piece of code that adds behavior or state to a component.

In plain words
What is it for?
Use it when adding a hook, checking whether a similar hook already exists, and connecting the implementation, types, documentation, and tests.
Why use it?
It helps a new hook match the repository's file layout, browser and server behavior, documentation style, and public exports.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is childrentime/reactuse's own configuration. It tells Claude Code how to work on reactuse itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything reactuse configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { isDev, isFunction } from '../utils/is'.

About the project

ReactUse is a TypeScript library of reusable React Hooks for browser APIs, state, sensors, animations, and DOM interactions. React developers use it when building React applications that need these common behaviors. The catalogue skills and commands help coding agents discover or work with ReactUse hooks.

childrentime/reactuse · 1,068 stars · on GitHub · reactuse.com

Reuse

Borrowing it

Nothing to install: this file belongs to childrentime/reactuse. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/childrentime/reactuse/main/.claude/skills/new-hook/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/childrentime/reactuse

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-hook

README.md
[![agentmods](https://agentmods.dev/badge/skills/childrentime/reactuse/new-hook/github.svg)](https://agentmods.dev/skills/childrentime/reactuse/new-hook)
Your own site
<a href="https://agentmods.dev/skills/childrentime/reactuse/new-hook"><img src="https://agentmods.dev/badge/skills/childrentime/reactuse/new-hook/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for new-hook

Your own site · 80×15
<a href="https://agentmods.dev/skills/childrentime/reactuse/new-hook"><img src="https://agentmods.dev/badge/skills/childrentime/reactuse/new-hook.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,137 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00082 $0.01137
Opus 5.5 $0.00033 $0.00455
Sonnet 5.5 $0.00016 $0.00227
Haiku 4.5 $0.00008 $0.00114

Measured 2mo ago against content hash 35ddc8e59129, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

new-hook 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 2mo ago.

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.

.claude/skills/new-hook/SKILL.md · 110 lines

How it starts

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

new-hook — scaffold a hook the ReactUse way

Use this when adding a new hook to @reactuses/core. It encodes how hooks are actually built in this repo today. Pair it with hook-test and hook-docs afterward.

There is no scaffolding script — hooks are created by hand. Follow the steps below.

Step 0 — Understand before writing (don't skip)

  1. Confirm the hook doesn't already exist: ls packages/core/src/useX.
  2. Read 1-2 similar existing hooks end to end (not just their names) to match style — e.g. a state hook like useCounter, a browser hook like useClipboard, an element hook like useEventListener. Note their return shape and which utils they reuse.
  3. Check the knowledge base reuse cheat-sheet — much of what you need (useLatest, useUnmount, useEventListener, defaultWindow, isBrowser) is already written. Reuse before writing.

Step 1 — Create the hook folder

packages/core/src/useX/ with two (then three) files:

  • index.ts — the implementation, named export export const useX: UseX = ….
  • interface.ts — the public type UseX with multilingual JSDoc.
  • index.spec.ts — tests (hand off to the hook-test skill).

interface.ts template

Types live here (not inline), so the API-doc generator can read them. JSDoc is trilingual:

/**
 * @title useX
 * @returns_en What the hook returns, described for docs.
 * @returns 返回值说明(简体)。
 * @returns_zh-Hant 返回值說明(繁體)。
 */
export type UseX = (
  /**
   * @en The first argument, described.
   * @zh 第一个参数说明。
   * @zh-Hant 第一個參數說明。
   * @defaultValue 0
   */
  initial?: number,
) => readonly [number, (n: number) => void]

(See packages/core/src/useCounter/interface.ts for a full real example.)

index.ts template

import { useState, useCallback } from 'react'
import { isDev, isFunction } from '../utils/is'
import type { UseX } from './interface'

export const useX: UseX = (initial = 0) => {
  if (isDev && initial != null && !isFunction(initial) && typeof initial !== 'number') {
    console.error(`useX: \`initial\` expected number, got "${typeof initial}".`)
  }

  const [value, setValue] = useState(initial)
  const set = useCallback((n: number) => setValue(n), [])

  return [value, set] as const
}

Read the full file on GitHub · 110 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. 2mo ago First seen · 110 lines · 82 tokens per session scan A 35ddc8e59129

Subscribe to this mod's changes

new-hook is a skill published in the GitHub repository childrentime/reactuse (1,068 stars, last pushed 8d ago), licensed Unlicense. It adds 82 tokens to every session and 1,137 once invoked, about $0.0003 per session on Opus 5.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

new-hook compared with skills from other repositories

new-hook next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
new-hookchildrentime/reactuseSkill1.1k8d agoUnlicenseA82Claude Code
prism-componenttonone-ai/tononeSkill7723d agoMITA43Claude Code
juniors-best-practicesiberiacancode/agent-skillsSkill2327d agoMITA55Claude Code, Codex
react-hooks-best-practicessiberiacancode/agent-skillsSkill2327d agoMITA71Claude Code, Codex
reactusesiberiacancode/agent-skillsSkill2327d agoMITA50Claude Code, Codex
testing-best-practicessiberiacancode/agent-skillsSkill2327d agoMITA47Claude Code, Codex
fluencyloopbaokhang83/fluencyloopSkill472mo agoApache-2.0A98Claude Code