Files
secondsky 292c93845e feat(humanize-writing): add skill plugin, lockstep 3.9.0
- Rewrites AI-sounding text to read human; 8 editing passes + review-only mode
- Adapted from jpeggdev/humanize-writing (MIT); npm installer scaffolding dropped
- Frontmatter condensed to 238 chars (sync enforces 250 max for single-skill plugins)
- Lockstep bump 3.8.0 -> 3.9.0: all 145 plugins, both marketplaces, package.json
- CHANGELOG entry for 3.9.0
2026-09-09 17:02:38 +02:00
..

TanStack Query (React Query) v5

Status: ✅ Production Ready Last Updated: 2025-12-09 Production Tested: Patterns verified with TypeScript strict mode


Auto-Trigger Keywords

Claude Code automatically discovers this skill when you mention:

Primary Keywords

  • TanStack Query
  • React Query
  • useQuery
  • useMutation
  • useInfiniteQuery
  • useSuspenseQuery
  • QueryClient
  • QueryClientProvider

Secondary Keywords

  • data fetching
  • server state
  • caching
  • staleTime
  • gcTime
  • query invalidation
  • prefetching
  • optimistic updates
  • mutations
  • query keys
  • query functions
  • error boundaries
  • suspense queries
  • React Query DevTools
  • v5 migration
  • v4 to v5

Error-Based Keywords

  • "query callbacks removed"
  • "cacheTime not found"
  • "loading status"
  • "initialPageParam required"
  • "useQuery is not a function"
  • "keepPreviousData removed"
  • "onSuccess removed"
  • "onError removed"
  • "object syntax required"
  • "enabled not available with suspense"
  • "placeholderData"
  • "isPending vs isLoading"

What This Skill Does

Provides comprehensive knowledge for TanStack Query v5 (React Query) server state management in React applications, including setup, queries, mutations, caching strategies, v4→v5 migration, optimistic updates, infinite queries, and error handling.

Core Capabilities

✅ QueryClient configuration and setup ✅ useQuery, useMutation, useInfiniteQuery patterns ✅ Optimistic updates and cache management ✅ v4 to v5 migration (all breaking changes) ✅ TypeScript patterns and type safety ✅ Error handling strategies ✅ Caching and refetching strategies ✅ DevTools setup and debugging ✅ Testing patterns with MSW


Known Issues This Skill Prevents

Issue Why It Happens Source How Skill Fixes It
#1: Object Syntax Required v5 removed function overloads Migration Guide Always use useQuery({ queryKey, queryFn })
#2: Query Callbacks Removed onSuccess/onError removed from queries v5 Breaking Changes Use useEffect or move to mutations
#3: Status Renamed loading → pending v5 Migration Use isPending for initial load
#4: cacheTime → gcTime Renamed for clarity v5 Migration Use gcTime instead
#5: useSuspenseQuery + enabled enabled option not available GitHub #6206 Use conditional rendering
#6: initialPageParam Required v5 requires explicit value v5 Migration Always provide initialPageParam
#7: keepPreviousData Removed Replaced with placeholderData v5 Migration Use placeholderData: keepPreviousData
#8: Error Type Default Changed from unknown to Error v5 Migration Specify error type if non-Error

When to Use This Skill

✅ Use When:

  • Setting up TanStack Query in React app
  • Implementing data fetching with useQuery
  • Creating mutations with useMutation
  • Configuring QueryClient settings
  • Migrating from React Query v4 to v5
  • Implementing optimistic updates
  • Setting up infinite scroll with useInfiniteQuery
  • Debugging caching or refetching issues
  • Resolving v5 breaking changes
  • Implementing suspense queries
  • Setting up React Query DevTools
  • Writing tests for components using TanStack Query

❌ Don't Use When:

  • Managing local UI state (use useState)
  • Global client state like theme (use Context/Zustand)
  • Simple static data (no need for query library)
  • Server-side data fetching (Next.js App Router, Remix)

Quick Usage Example

# Install dependencies (choose one)
pnpm add @tanstack/react-query@latest @tanstack/react-query-devtools@latest
# or
npm install @tanstack/react-query@latest @tanstack/react-query-devtools@latest
# or
bun add @tanstack/react-query@latest @tanstack/react-query-devtools@latest

# Set up QueryClient Provider (see SKILL.md for complete setup)

Result: Full TanStack Query v5 setup with best practices

Full instructions: See SKILL.md


Package Versions (Verified 2026-08-03)

Package Version Status
@tanstack/react-query 5.101.4 ✅ Latest stable
@tanstack/react-query-devtools 5.101.4 ✅ Latest stable
@tanstack/eslint-plugin-query 5.101.4 ✅ Latest stable
react 18.0.0+ ✅ Required
typescript 5.2.0+ ✅ Recommended

Dependencies

Prerequisites: None (standalone skill)

Integrates With:

  • react-hook-form (optional) - Forms integration
  • zod (optional) - Runtime validation
  • axios (optional) - HTTP client alternative

File Structure

tanstack-query/
├── SKILL.md                          # Complete documentation
├── README.md                         # This file
├── scripts/
│   └── example-script.sh             # Bootstrap: installs deps + copies templates
├── examples/                         # Focused, ready-to-copy snippets (top 10)
│   └── README.md                     # Index of scenarios + official links
├── templates/                        # Copy-ready code
│   ├── package.json                  # Dependencies
│   ├── query-client-config.ts        # QueryClient setup
│   ├── provider-setup.tsx            # App wrapper
│   ├── use-query-basic.tsx           # Basic query hook
│   ├── use-mutation-basic.tsx        # Basic mutation
│   ├── use-mutation-optimistic.tsx   # Optimistic updates
│   ├── use-infinite-query.tsx        # Infinite scroll
│   ├── custom-hooks-pattern.tsx      # Reusable hooks
│   ├── error-boundary.tsx            # Error handling
│   └── devtools-setup.tsx            # DevTools config
└── references/                       # Deep-dive docs
    ├── v4-to-v5-migration.md         # Complete migration guide
    ├── best-practices.md             # Performance & caching
    ├── common-patterns.md            # Reusable patterns
    ├── official-guides-map.md        # When to load each official doc
    ├── typescript-patterns.md        # Type safety
    ├── testing.md                    # Testing with MSW
    └── top-errors.md                 # All errors + solutions

Official Documentation


  • react-hook-form-zod - Forms with validation
  • tailwind-v4-shadcn - UI components and styling
  • cloudflare-worker-base - Backend API for queries

Contributing

Found an issue or have a suggestion?


License

MIT License - See main repo LICENSE file


Production Tested: ✅ Patterns verified with TypeScript strict mode Token Savings: ~65% Error Prevention: 100% (all 8 documented issues) Ready to use! See SKILL.md for complete setup.