new-hook

Scaffold React hook files with TypeScript types and JSDoc under src/hooks.

3|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/gwpjp/Web3-Claude --skill new-hook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-hook
Source: https://github.com/gwpjp/Web3-Claude/tree/main/.claude/skills/new-hook
Command: npx skills add https://github.com/gwpjp/Web3-Claude --skill new-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating consistent, well-documented React hooks is tedious and error-prone; this skill scaffolds new hooks following project conventions, generating TS types, JSDoc, and robust error handling.

Core Features & Use Cases

  • Type-safe scaffolding: Generates TypeScript types for hook params and return values.
  • Documentation & patterns: Adds JSDoc comments and aligns with layer-appropriate templates from hook-patterns.md.
  • Seamless placement: Creates the hook under src/hooks/, respecting optional subfolders for organization.

Quick Start

Use the new-hook skill to create a hook named useExample in the appropriate subfolder, and let it generate the hook file with type definitions and docs.

Frequently Asked Questions about new-hook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a React hook with TypeScript types and JSDoc documentation?

You can scaffold a React hook with TypeScript types and JSDoc by providing a hook name to automatically generate a file with type definitions, documentation comments, and robust error handling under src/hooks.

What's the best way to create consistent React hooks following project conventions?

Creating consistent React hooks is best handled by using layer-appropriate templates that automatically apply project rules, ensuring transform, read, and write hooks follow uniform patterns without manual boilerplate.

Can I generate React hooks into specific subfolders within src/hooks?

Yes, you can generate React hooks into specific subfolders by providing an optional subfolder argument; the scaffolding process will respect your directory structure and place the file accordingly under src/hooks.

Do I need to manually add TypeScript types when creating a new React hook?

No, you do not need to manually add TypeScript types; the scaffolding process automatically generates type definitions for hook parameters and return values while updating existing types as needed.

Does React hook scaffolding support different patterns for data reading and writing?

Yes, React hook scaffolding supports different patterns by using layer-appropriate templates that distinguish between transform, read, and write hooks to ensure appropriate logic structure and error handling.

Why does my React hook scaffolding fail to follow project conventions?

React hook scaffolding might miss project conventions if the hook-patterns templates are not referenced; the process relies on these templates to align JSDoc and error handling with established rules.