skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
pproenca/dot-skills161 installs

react-fetch-cache-patterns

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 this agent skill?

npx skills add https://github.com/pproenca/dot-skills --skill react-fetch-cache-patterns
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides a set of React data-fetching and caching patterns. It is an educational resource containing idiomatic code examples and templates. No security risks or malicious behaviors were found.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

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

#CategoryImpactPrefixRules
1Request OrchestrationCRITICALorch-7
2Cache StrategyCRITICALcache-7
3Backend ProtectionCRITICALprotect-7
4Prefetch & HydrationHIGHprefetch-6
5Failure ResilienceHIGHresilience-6
6Feed & Carousel PatternsMEDIUM-HIGHfeed-7
7Mutation & InvalidationMEDIUMmutate-4
8Component PatternsMEDIUMrender-4

Quick Reference

1. Request Orchestration (CRITICAL)

2. Cache Strategy (CRITICAL)

3. Backend Protection (CRITICAL)

4. Prefetch & Hydration (HIGH)

5. Failure Resilience (HIGH)

6. Feed & Carousel Patterns (MEDIUM-HIGH)

7. Mutation & Invalidation (MEDIUM)

8. Component Patterns (MEDIUM)

How to Use

  1. Open references/_sections.md for category definitions and impact rationale
  2. Read individual rule files for incorrect-vs-correct code examples
  3. For ready-to-use scaffolds, see scaffolding templates
  4. The AGENTS.md navigation document (auto-generated) provides a TOC for browsing

Scaffolding Templates

Six ready-to-adapt code templates under assets/templates/:

TemplateLibrary depsPurpose
use-resource-query.template.tsxTanStack QueryStandard query hook with key factory, retry, abort, optional suspense
use-resource-query-no-deps.template.tsxNone (pure React + AbortController)Same patterns as above, library-free: hand-rolled cache, dedup, retry with jitter, staleTime/gcTime, concurrency limit
carousel-data-loader.template.tsxTanStack Query + react-error-boundarySingle carousel (summary + viewport-triggered detail) and multi-carousel feed with per-carousel failure isolation
infinite-feed.template.tsxTanStack Query + TanStack VirtualCursor-paginated infinite feed with virtualization and bounded working set
prefetch-link.template.tsxNoneHover/intent prefetch link wrapper
request-collapser.template.tsNoneIn-flight deduplication + concurrency limit utility

Library-free path: if you can't add TanStack Query / SWR / DataLoader to your bundle (size constraints, host-app conflicts, dependency bans), start with use-resource-query-no-deps.template.tsx — it implements the core cache/dedup/retry/abort patterns in ~250 lines using only React and the web platform. The other templates that depend on TanStack can be adapted on top of it; only the request-collapser and prefetch-link templates are zero-dep out of the box.

Reference Files

FileDescription
references/_sections.mdCategory definitions, ordering, impact rationale
assets/templates/_template.mdTemplate for authoring new rules
metadata.jsonVersion, references, abstract

Related Skills

  • react-optimise — General React render performance (this skill is data-fetching-specific)
  • nextjs-bundle-optimizer — Bundle/payload optimization for Next.js
  • inngest-nextjs-patterns — Server-side workflow patterns (complements server-fetch guidance)

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/pproenca/dot-skills/react-fetch-cache-patterns">View react-fetch-cache-patterns on skillZs</a>