React hook

From berkcangumusisik/claude-code-practices · View interactive version

React hook is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Creates a custom React hook with TypeScript types, tests, and usage example

How to use this skill

Skill file

Generate Custom React Hook

Hook name: use$1 (auto-prefix use if not present)

Description: $2

  1. Check existing hooks:
ls src/hooks/ 2>/dev/null | head -10

Read 1-2 existing hooks to match style.

  1. Generate the hook:
  1. Generate a test using @testing-library/react-hooks or renderHook.
  1. Add a usage example comment at the top:
/**
 * @example
 * const { data, isLoading } = useMyHook(id)
 */
  1. Place in src/hooks/use$1.ts (or match project convention).
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.