React-Query — React-Query install React-Query, hub-ln, community, React-Query install, ide skills, asynchronous data management, React-Query caching, React-Query CRUD operations, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Ideal for Frontend Agents requiring efficient asynchronous data management and caching using @tanstack/react-query v5. React-Query is a library for managing asynchronous data in React applications, providing features like automatic cache synchronization and feedback visualizations.

Features

Implement asynchronous data fetching using @tanstack/react-query v5
Manage loading and error states for a better user experience
Automatically synchronize cache after mutations
Perform CRUD operations with feedback visualizations
Invalidate queries after mutations for data consistency
Optimize data pagination and listing with React-Query

# Core Topics

endriwmsi endriwmsi
[0]
[0]
Updated: 3/2/2026

Agent Capability Analysis

The React-Query skill by endriwmsi is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for React-Query install, asynchronous data management, React-Query caching.

Ideal Agent Persona

Ideal for Frontend Agents requiring efficient asynchronous data management and caching using @tanstack/react-query v5.

Core Value

Empowers agents to simplify data fetching, caching, and synchronization with automatic cache invalidation after mutations, utilizing @tanstack/react-query v5 for seamless asynchronous data management, and managing loading and error states effectively.

Capabilities Granted for React-Query

Fetching paginated data from servers
Implementing CRUD operations with visual feedback
Synchronizing cache automatically after data mutations
Managing loading and error states for improved user experience

! Prerequisites & Limits

  • Requires @tanstack/react-query v5 library
  • Limited to React-based applications
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

React-Query

Install React-Query, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

React Query (TanStack Query)

Esta skill orienta a implementação de gerenciamento de dados assíncronos usando @tanstack/react-query v5, seguindo os padrões estabelecidos neste projeto.

Quando usar esta skill

  • Buscar dados do servidor - Listagens, detalhes, dados paginados
  • Criar, atualizar ou deletar recursos - Operações CRUD com feedback visual
  • Sincronizar cache automaticamente - Invalidar queries após mutations
  • Gerenciar loading/error states - Estados de carregamento e erro de forma declarativa

Como usar

1. Estrutura de Arquivos

Os hooks de React Query devem seguir a estrutura feature-based:

src/features/{feature-name}/
├── actions/         # Server actions (Next.js)
    ├──action.ts
├── schemas/         # Tipos e validações Zod
    ├──schema.ts
├── hooks/
    ├── use-{entities}.ts        # Query para listar (ex: use-services.ts)
    ├── use-create-{entity}.ts   # Mutation para criar
    ├── use-update-{entity}.ts   # Mutation para atualizar
    └── use-delete-{entity}.ts   # Mutation para deletar

2. Convenções de Nomenclatura

TipoPadrãoExemplo
Query (listar)use{Entities}useServices, useUsers
Query (detalhe)use{Entity}useService, useUser
Mutation (criar)useCreate{Entity}useCreateService
Mutation (atualizar)useUpdate{Entity}useUpdateService
Mutation (deletar)useDelete{Entity}useDeleteService

3. Query Keys

Use arrays estruturados para query keys:

typescript
1// ✅ Bom - permite invalidação granular 2queryKey: ["services"]; // Lista todos 3queryKey: ["services", { onlyActive: true }]; // Lista com filtro 4queryKey: ["services", id]; // Detalhe por ID 5 6// ❌ Evitar - dificulta invalidação 7queryKey: ["all-services"]; 8queryKey: [`service-${id}`];

4. Padrão de useQuery (Buscar Dados)

typescript
1"use client"; 2 3import { useQuery } from "@tanstack/react-query"; 4import { getEntities } from "../actions"; 5 6export function useEntities(filter?: boolean) { 7 return useQuery({ 8 queryKey: ["entities", { filter }], 9 queryFn: () => getEntities(filter), 10 }); 11}

5. Padrão de useMutation (Modificar Dados)

typescript
1"use client"; 2 3import { useMutation, useQueryClient } from "@tanstack/react-query"; 4import { toast } from "sonner"; 5import { createEntity } from "../actions"; 6import type { CreateEntityInput } from "../schemas"; 7 8export function useCreateEntity() { 9 const queryClient = useQueryClient(); 10 11 return useMutation({ 12 mutationFn: (data: CreateEntityInput) => createEntity(data), 13 onSuccess: (result) => { 14 if (result.success) { 15 toast.success("Criado com sucesso!"); 16 queryClient.invalidateQueries({ queryKey: ["entities"] }); 17 } else { 18 toast.error("Erro ao criar"); 19 } 20 }, 21 onError: () => { 22 toast.error("Erro ao criar"); 23 }, 24 }); 25}

6. Uso em Componentes

tsx
1"use client"; 2 3import { useEntities } from "../hooks/use-entities"; 4import { useCreateEntity } from "../hooks/use-create-entity"; 5 6export function EntitiesTable() { 7 const { data, isLoading, error } = useEntities(); 8 const createMutation = useCreateEntity(); 9 10 if (isLoading) return <Loading />; 11 if (error) return <Error message={error.message} />; 12 13 const handleCreate = (data: CreateEntityInput) => { 14 createMutation.mutate(data); 15 }; 16 17 return <Table data={data} />; 18}

Regras importantes

[!IMPORTANT] Todos os hooks de React Query devem incluir "use client" no topo do arquivo.

[!TIP] Sempre invalide queries relacionadas após uma mutation para manter o cache sincronizado.

[!WARNING] Não use queryClient.setQueryData para modificar o cache diretamente, prefira invalidateQueries para garantir dados frescos.

Referências

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is React-Query?

Ideal for Frontend Agents requiring efficient asynchronous data management and caching using @tanstack/react-query v5. React-Query is a library for managing asynchronous data in React applications, providing features like automatic cache synchronization and feedback visualizations.

How do I install React-Query?

Run the command: npx killer-skills add endriwmsi/hub-ln. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for React-Query?

Key use cases include: Fetching paginated data from servers, Implementing CRUD operations with visual feedback, Synchronizing cache automatically after data mutations, Managing loading and error states for improved user experience.

Which IDEs are compatible with React-Query?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for React-Query?

Requires @tanstack/react-query v5 library. Limited to React-based applications.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add endriwmsi/hub-ln. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use React-Query immediately in the current project.

Related Skills

Looking for an alternative to React-Query or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI