Token导航 LogoToken导航TokenDH.com
开发执行命令github未标认证来源可访问许可证需确认审计提醒

tanstack-query-experttanstack 查询专家

Agent Skill

tanstack-query-expert 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

392

周安装

16

GitHub Stars

9

下载量

127
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tanstack-query-expert(tanstack 查询专家)
来源仓库:https://github.com/yuniorglez/gemini-elite-core
仓库路径:skills/tanstack-query-expert
安装命令:
npx skills add https://github.com/yuniorglez/gemini-elite-core --skill tanstack-query-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yuniorglez/gemini-elite-core --skill tanstack-query-expert

简介

tanstack-query-expert 专注于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要整理仓库状态、代码变更或协作事项的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 使用前请确认权限范围、维护状态,避免触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

📡 Skill: tanstack-query-expert (v1.0.0)

Executive Summary

Senior Server State Architect for TanStack Query v5 (2026). Specialized in reactive data fetching, advanced caching, and high-performance integration with React 19 and Next.js 16. Expert in eliminating waterfalls, managing complex mutation states, and leveraging platform-level caching via Next.js "use cache" and Partial Prerendering (PPR).


📋 The Conductor's Protocol

  1. Architecture Choice: Determine if data fetching should happen in RSC (via React 19 use hook + "use cache") or on the client (via TanStack Query).
  2. Hydration Strategy: For SSR/PPR, always prefetch on the server and use HydrationBoundary to ensure instant client-side data availability.
  3. Mutation Tracking: Use useMutationState to handle global loading/pending states without prop drilling.
  4. Verification: Use TanStack Query Devtools v5 to audit query states, stale times, and cache invalidation.

🛠️ Mandatory Protocols (2026 Standards)

1. The "Object Syntax" Rule

TanStack Query v5 ONLY supports the object-based syntax for all hooks.

  • Rule: Never use the deprecated positional argument syntax (e.g., useQuery(key, fn)).
  • Correct: useQuery({queryKey: [...], queryFn:...}).

2. React 19 & Next.js 16 Integration

  • PPR First: Wrap client components using TanStack Query in <Suspense> to allow Next.js 16 to stream content while serving the static shell.
  • "use cache" Directive: For server-side prefetching, utilize Next.js 16's "use cache" to cache the prefetch results at the platform level.
  • Action Mutations: Prefer React 19 Actions for simple form mutations; use TanStack Query mutations for complex state, optimistic updates, and background refetching.

3. Cache & Performance Hardening

  • Stale Time: Default to at least 5000 (5s) to prevent excessive refetching.
  • GC Time: Use gcTime (renamed from cacheTime in v5) to manage memory cleanup.
  • Query Keys: Always use stable, array-based query keys. Treat keys as unique identifiers for your data.

🚀 Show, Don't Just Tell (Implementation Patterns)

Quick Start: Modern Query with Suspense (React 19)

"use client";

import { useSuspenseQuery } from "@tanstack/react-query";
import { queryOptions } from "@tanstack/react-query";

// Pattern: Reusable Query Options
export const userOptions = (id: string) => queryOptions({
  queryKey: ["users", id],
  queryFn: async () => {
    const res = await fetch(`/api/users/${id}`);
    if (!res.ok) throw new Error("Failed to fetch");
    return res.json();
  },
  staleTime: 1000 * 60 * 5, // 5 min
});

export function UserProfile({ id }: { id: string }) {
  // Guaranteed data availability via Suspense
  const { data: user } = useSuspenseQuery(userOptions(id));

  return <div>Welcome, {user.name}</div>;
}

Advanced Pattern: Global Mutation Tracking

import { useMutationState } from "@tanstack/react-query";

function PendingUploads() {
  const pendingVariables = useMutationState({
    filters: { status: "pending", mutationKey: ["upload"] },
    select: (mutation) => mutation.state.variables as { fileName: string },
  });

  return (
    <ul>
      {pendingVariables.map((vars, i) => (
        <li key={i} className="opacity-50 italic text-blue-400">
          Uploading {vars.fileName}...
        </li>
      ))}
    </ul>
  );
}

🛡️ The Do Not List (Anti-Patterns)

  1. DO NOT use onSuccess, onError, or onSettled in useQuery. They are removed in v5. Use useEffect or move logic to queryFn.
  2. DO NOT ignore isPending. It replaced isLoading in v5 for "no data yet" states.
  3. DO NOT use useQuery without a queryKey. It's the only way to manage the cache effectively.
  4. DO NOT forget to await prefetchQuery on the server. Non-awaited prefetches lead to hydration mismatches.
  5. DO NOT use enabled with useSuspenseQuery. It's incompatible with the guarantee of data presence.

📂 Progressive Disclosure (Deep Dives)


🛠️ Specialized Tools & Scripts

  • scripts/audit-query-keys.ts: Checks for non-array query keys or unstable key generation.
  • scripts/generate-query-hook.py: Boilerplate generator for v5 query/mutation pairs.

🎓 Learning Resources


*Updated: January 23, 2026 - 16:45*

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.98%
按下载量换算42

Claude

28.05%
按下载量换算36

Cursor

20.34%
按下载量换算26

Gemini CLI

9.41%
按下载量换算12

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/yuniorglez/gemini-elite-core --skill tanstack-query-expert 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills