react-fetch-cache-patterns
БесплатноЗапускает вложенные скриптыНе проверенReact data-fetching patterns at scale — recommender carousels, infinite feeds, pages with many parallel fetches, dashboards. Covers request orchestration…
от pproenca★ 231 звезда на GitHubОб этом скилле
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)
orch-parallelize-independent-fetches— UsePromise.allfor independent requests; never serialawaitorch-batch-n-plus-one-fanout— Collapse per-row fetches via DataLoader-style batchingorch-dedupe-in-flight-requests— One in-flight request per key, shared across subscribersorch-lift-fetch-to-route-loader— Fetch in parallel with route chunk downloadorch-avoid-effect-chains— Flatten the dependency graph; only true dependencies waitorch-server-fetch-when-possible— Move fetches to RSC/server when they don't depend on client stateorch-prefer-bulk-endpoint-for-fanout— One bulk request beats N parallel requests
2. Cache Strategy (CRITICAL)
cache-deterministic-keys— Canonicalize cache keys; strip undefined, sort arrayscache-normalize-shared-entities— Store each entity once; views hold referencescache-set-stale-time— TunestaleTimeto data volatility, not refresh frequencycache-stale-while-revalidate— Render stale instantly; revalidate in backgroundcache-select-subscribed-fields— Subscribe to slices, not whole objectscache-shared-key-factory— One typed source of truth for keys; prevents read/write driftcache-tiered-stale-fresh— DifferentstaleTimeper data class (realtime, fresh, warm, cold, static)
3. Backend Protection (CRITICAL)
protect-concurrency-limit-fanout— Cap simultaneous requests withp-limit/semaphoreprotect-collapse-identical-requests— In-flight dedup at the fetch layerprotect-debounce-user-driven-fetches— Wait for user pause before firing search/filter requestsprotect-throttle-scroll-triggered— Use IntersectionObserver for viewport-triggered fetchesprotect-jittered-retry-backoff— Add random jitter to prevent thundering-herd retriesprotect-circuit-breaker— Stop calling persistently failing endpoints for a cooldown windowprotect-rate-limit-aware-client— HonorRetry-AfterandX-RateLimit-*headers
4. Prefetch & Hydration (HIGH)
prefetch-hover-intent-links— Prefetch on hover/pointerdown for instant navigationprefetch-parallel-loader-queries— Parallelize independent queries inside loaders- [`prefetch-hydrate-server-cach
Установить react-fetch-cache-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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".
Как установить скилл react-fetch-cache-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл react-fetch-cache-patterns запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic