# New Hook

> Scaffold a new custom React hook with a Vitest test file. Use this skill whenever the user asks to "create a hook", "make a useFoo hook", "scaffold a custom React hook", "add a hook under app/hooks", or describes a piece of reusable React state/effect logic that warrants extraction into a named `use*` hook.

- Skill: `gaia-react/new-hook` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gaia-react/new-hook`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gaia-react/new-hook/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: gaia-react (https://skillmd.com/u/gaia-react)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/gaia-react/new-hook

---


# new-hook

Trigger: user asks to create a custom React hook.

## Workflow

1. Confirm: name (use\*), params, return type.
2. Run: `.gaia/cli/gaia scaffold hook <useFoo> [--params "a:string,b:number"] [--returns "ReturnType"]`.
3. Verify: `pnpm typecheck` clean. Open and sanity-check.

