Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

react-fetch-cache-patterns

FreeRuns bundled scriptsNot checked

React data-fetching patterns at scale — recommender carousels, infinite feeds, pages with many parallel fetches, dashboards. Covers request orchestration…

pproencaby pproenca★ 231 GitHub stars

About this skill

Experimental React Data Fetching & Caching Best Practices

Implementation patterns for React applications that fetch and cache many API requests without overwhelming the backend. 48 rules across 8 categories, ordered by execution lifecycle impact — earlier categories cascade through everything downstream. Templates show both library-based (TanStack Query, SWR) and library-free (pure React + AbortController) implementations so the patterns are usable regardless of stack constraints.

When to Apply

  • Writing or reviewing a React component that calls fetch, useQuery, useSWR, or any data-fetching hook
  • Designing a list, feed, or carousel that displays many items each requiring data
  • Investigating "the backend is getting hammered" or "the page loads slowly" symptoms
  • Choosing between client-side fetching, route loaders, server components, or SSR
  • Implementing prefetch, retry, optimistic updates, or any failure-handling logic
  • Refactoring code that already does data fetching but with waterfalls, no cache strategy, or no concurrency limits

Rule Categories by Priority

# Category Impact Prefix Rules
1 Request Orchestration CRITICAL orch- 7
2 Cache Strategy CRITICAL cache- 7
3 Backend Protection CRITICAL protect- 7
4 Prefetch & Hydration HIGH prefetch- 6
5 Failure Resilience HIGH resilience- 6
6 Feed & Carousel Patterns MEDIUM-HIGH feed- 7
7 Mutation & Invalidation MEDIUM mutate- 4
8 Component Patterns MEDIUM render- 4

Quick Reference

1. Request Orchestration (CRITICAL)

2. Cache Strategy (CRITICAL)

3. Backend Protection (CRITICAL)

4. Prefetch & Hydration (HIGH)

Full SKILL.md on GitHub

Install react-fetch-cache-patterns in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

AGENTS.mdassets/templates/_template.mdassets/templates/carousel-data-loader.template.tsxassets/templates/infinite-feed.template.tsxassets/templates/prefetch-link.template.tsxassets/templates/request-collapser.template.tsassets/templates/use-resource-query-no-deps.template.tsxassets/templates/use-resource-query.template.tsxmetadata.jsonreferences/_sections.mdreferences/cache-deterministic-keys.mdreferences/cache-normalize-shared-entities.mdreferences/cache-select-subscribed-fields.mdreferences/cache-set-stale-time.mdreferences/cache-shared-key-factory.mdreferences/cache-stale-while-revalidate.mdreferences/cache-tiered-stale-fresh.mdreferences/feed-bounded-working-set.mdreferences/feed-cursor-pagination.mdreferences/feed-image-lazy-and-sized.mdreferences/feed-multi-carousel-isolation.mdreferences/feed-split-summary-from-detail.mdreferences/feed-stable-keys-across-pages.mdreferences/feed-virtualize-long-lists.mdreferences/mutate-cancel-queries-on-mutate.mdreferences/mutate-optimistic-updates-with-rollback.mdreferences/mutate-set-data-over-invalidate.mdreferences/mutate-surgical-invalidation.mdreferences/orch-avoid-effect-chains.mdreferences/orch-batch-n-plus-one-fanout.mdreferences/orch-dedupe-in-flight-requests.mdreferences/orch-lift-fetch-to-route-loader.mdreferences/orch-parallelize-independent-fetches.mdreferences/orch-prefer-bulk-endpoint-for-fanout.mdreferences/orch-server-fetch-when-possible.mdreferences/prefetch-budget-and-priority.mdreferences/prefetch-hover-intent-links.mdreferences/prefetch-hydrate-server-cache.mdreferences/prefetch-idle-likely-next.mdreferences/prefetch-parallel-loader-queries.md

FAQ

What does the react-fetch-cache-patterns skill do?

React data-fetching patterns at scale — recommender carousels, infinite feeds, pages with many parallel fetches, dashboards. Covers request orchestration (parallelism, batching, deduplication), cache strategy (keys, normalization, staleTime, SWR), backend protection (concurrency caps, debounce/throttle, jittered retries, circuit breakers), prefetching (route loaders, hover/intent, idle, server hydration), failure resilience (AbortController, timeouts, error boundaries, stale fallback, idempotent mutations), and feed/carousel patterns (virtualization, cursor pagination, summary/detail split). Includes 5 ready-to-use scaffolding templates (resource query hook, carousel data loader, infinite feed, hover-prefetch link, request collapser). Trigger when building, reviewing, or refactoring React components that fetch data — even if the user doesn't explicitly mention "performance" or "scale".

How do I install the react-fetch-cache-patterns skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the react-fetch-cache-patterns skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare react-fetch-cache-patterns with