Frontend Data Fetching

Use when the user asks how to cache server data on the client with TanStack Query, SWR or RTK Query, query keys, staleTime/gcTime, cache invalidation, optimistic updates, pagination or infinite scroll. Produces a typed data-fetching layer with caching and mutation patterns. Not for backend API design (use backend-api-design).

45 stars 6 forksFrontend & Design

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill frontend-data-fetching
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/frontend/universal/data-fetching ~/.claude/skills/frontend-data-fetching

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Frontend Data Fetching

## Purpose
Manage server state efficiently on the client — eliminating boilerplate, providing caching, deduplication, background refetching, and optimistic mutations while keeping server state out of global client stores.

## Agent Protocol

### Trigger
User request includes any of: "data fetching", "TanStack Query", "SWR", "React Query", "server state", "API client", "data fetching pattern", "cache invalidation", "optimistic update", "pagination data", "infinite scroll", "stale-while-revalidate".

### Input Context
- Framework (React, Vue, Solid, Svelte)
- Existing state management library
- API patterns (REST, GraphQL, tRPC)
- Auth / token handling approach

### Output Artifact
Data fetching architecture with query/mutation patterns and caching strategy.

### Response Format
```
## Strategy
<library, cache-key-design, staleTime>

## Query Layer
<query-hooks, pagination, revalidation>

## Mutation Layer
<optimistic-updates, invalidation, error-handling>

## Cache Config
<staleTime, gcTime, persistence>

—
Compression footer: frontend-data-fetching/v1 | 4 sections | lib: <selected> | cache: <persisted|memory>
```

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

### Completion Criteria
- All server data queries cached with appropriate staleTime
- Mutations invalidate related queries or apply optimistic updates
- Pagination / infinite scroll working with loading states
Read the full skill on GitHub

Details

Skill name
frontend-data-fetching
Path
skills/frontend/universal/data-fetching/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Frontend Data Fetching skill do?

Use when the user asks how to cache server data on the client with TanStack Query, SWR or RTK Query, query keys, staleTime/gcTime, cache invalidation, optimistic updates, pagination or infinite scroll. Produces a typed data-fetching layer with caching and mutation patterns. Not for backend API design (use backend-api-design).

How do I install the Frontend Data Fetching skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill frontend-data-fetching. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Frontend Data Fetching popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Frontend Design System

45

j4flmao/agent-skills

Use when the user asks to build a component library, define primitive, semantic and component design tokens as CSS variables, design component APIs with CVA variants, or wire dark mode through semantic tokens. Produces coded token layers and component library structure. Not for Figma variables and token pipeline governance (use design-systems).

Frontend & Design

Frontend CSS Strategy

45

j4flmao/agent-skills

Use when the user asks which styling approach to use: CSS Modules vs CSS-in-JS vs Tailwind, styled-components, Emotion, vanilla-extract, BEM, Sass, PostCSS, cascade layers or CSS architecture. Produces a styling decision with folder and naming conventions. Not for Tailwind configuration (use frontend-tailwind-css) or dark mode (use frontend-theming).

Frontend & Design

Frontend Error Handling

45

j4flmao/agent-skills

Use when the user asks about React error boundaries, Vue errorHandler, Angular ErrorHandler, svelte:boundary, fallback UI, retry and recovery, unhandled promise rejections or reporting frontend errors to Sentry. Produces layered error boundaries and user-facing recovery. Not for form validation messages (use frontend-form-handling).

Frontend & Design

Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.