create-react-query-hook

Generate React Query hooks for queries and mutations in Next.js TypeScript projects.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/keidsondesigner/nextjs-bewear-ecommerce --skill create-react-query-hook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-react-query-hook
Source: https://github.com/keidsondesigner/nextjs-bewear-ecommerce/tree/main/.claude/skills/create-react-query-hook
Command: npx skills add https://github.com/keidsondesigner/nextjs-bewear-ecommerce --skill create-react-query-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the creation of reusable React Query hooks to manage server state, ensuring consistent data fetching, caching, and invalidation patterns across a codebase.

Core Features & Use Cases

  • Query hooks: Generate use-<resource> hooks for fetching data with standardized query keys.
  • Mutation hooks: Create use-<resource>Mutation hooks for mutations with reliable cache invalidation.
  • Server Actions integration: Aligns with Next.js Server Actions to trigger client-side data refresh automatically.
  • Code organization: Enforces a consistent file structure under src/hooks/queries and src/hooks/mutations.

Quick Start

Create a new React Query hook by following the scaffold guidelines in your Next.js project, then import and use the generated hook in your components.

Frequently Asked Questions about create-react-query-hook

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

FAQPage Schema
How do I generate React Query hooks for Next.js Server Actions with TypeScript?

Generate React Query hooks for Next.js Server Actions by creating standardized query and mutation hooks under src/hooks/queries and src/hooks/mutations. This enforces proper key patterns and integrates cache invalidation to trigger client-side data refresh automatically.

What's the best way to structure React Query mutation hooks and cache invalidation?

Structure React Query mutation hooks and cache invalidation by placing them in src/hooks/mutations with standardized mutation keys. This ensures reliable cache invalidation across your codebase and aligns mutations with Next.js Server Actions for automatic data refresh.

Do I need a specific project setup to automate React Query hook creation?

You need a standard Next.js project with TypeScript and React Query installed to automate hook creation. The scaffolding assumes this environment to output consistent use-<resource> and use-<resource>Mutation hooks for managing server state.

How does React Query integrate with Next.js Server Actions for data fetching?

React Query integrates with Next.js Server Actions by aligning generated mutation hooks to trigger client-side data refresh automatically. This ensures that server state remains consistent through enforced cache invalidation patterns after mutations execute.

Why are consistent query keys important for managing server state in React Query?

Consistent query keys are important for managing server state because they enable reliable cache invalidation and prevent stale data. Standardizing these keys across query and mutation hooks ensures predictable data fetching and refresh behavior.