What problem does it solve?
This Skill helps you implement SWR data fetching correctly in React and Next.js so cached data, revalidation, and mutations behave predictably instead of causing stale UI, duplicate requests, or cache mismatches.
Core Features & Use Cases
- Cache Identity and Key Design: Define stable keys that include every input affecting the response, such as filters, auth scope, locale, or tenant.
- Fetching and Revalidation: Set up
useSWR, shared fetchers, loading states, error handling, retry behavior, and global SWRConfig defaults.
- Mutations and Optimistic UI: Update or invalidate cache entries safely after writes, including rollback behavior and cross-component refresh.
- Pagination, Subscriptions, and Next.js: Handle infinite lists, realtime subscriptions, and App Router client/server hydration boundaries.
- Use Case: A dashboard with user-specific lists, live updates, and paginated search results can keep data fresh without breaking cache consistency.
Quick Start
Ask for help implementing or reviewing your SWR hooks, cache keys, mutations, and Next.js hydration boundaries in the current codebase.