Skip to content
Back to skills

New Hook

ASecurity

Scaffolds a new custom React hook with a Vitest browser-mode 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.

  • 27 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added October 26, 2026
ai-agentsreact

Works with

  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned October 26, 2026

npx -y skills add gaia-harness/gaia --skill new-hook --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of New Hook?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for New Hook
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gaia-harness-new-hook/badge)](https://www.skillsdirectory.com/skills/gaia-harness-new-hook)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: new-hook
description: Scaffolds a new custom React hook with a Vitest browser-mode 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.
model: haiku
---

# new-hook

## Workflow

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

The scaffold writes `app/hooks/use-<kebab>.ts` (named export `useCamel`) and `app/hooks/tests/use-<kebab>.test.ts`, which renders the hook with async `renderHook` from `vitest-browser-react` and runs in the `browser` Vitest project (real Chromium; run `pnpm install:browsers` once). A bare stub declares a `void` return.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.