skills/react-native-instant/SKILL.md
Eliminate loading states in Postgres-backed React Native or Expo apps by combining React Query cache persistence with MMKV, targeted prefetching, and optimistic updates. Use when implementing or debugging instant app launch, instant screen navigation, instant saves, offline-friendly sync, React Query persistence, MMKV hydration, optimistic mutations, or local-first UX on top of a server-truth API.
npx skillsauth add cenjie/skills react-native-instantInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Apply this skill with one framing rule: native feel requires native UI and instant data. Prefer stale local data now over fresh remote data later.
Follow this sequence unless the user explicitly narrows scope:
State these UX constraints when relevant:
App launch or screen reopen
-> hydrate React Query cache from MMKV
-> render immediately from cache
-> refetch stale data in background
-> reconcile cache with server response
-> keep subsequent interactions instant
Target outcome: show meaningful content immediately after reopening the app.
Do this:
PersistQueryClientProvider with an MMKV-backed persister.staleTime in minutes, not seconds, for user-facing data that can tolerate brief staleness.gcTime long enough to survive normal reopen flows, typically around 24 hours.Enforce this:
key: app-cache-v{N}
During hydration:
Target outcome: the next screen reads warm cache instead of waiting on the network.
Use the lightest prefetch that fits the flow:
onPressIn for high-intent navigation.Constrain it:
['entity', id] and ['list', { filter }].Target outcome: the UI commits immediately and sync happens in the background.
Use this mutation pattern:
cancelQueries for affected keys.setQueryData for optimistic writes.invalidateQueries on settle to reconcile with server truth.If the mutation changes more than one cache surface, update and roll back all of them:
Target outcome: the app stays responsive without connectivity.
Do this:
networkMode: 'offlineFirst' for relevant queries and mutations.shouldDehydrateMutation: () => true.Rule: offline should defer synchronization, not block the interaction.
Check these before shipping:
development
Launch both thermo-nuclear review subagents in parallel, then synthesize their findings. Use for thermos, double thermo review, or combined bug/security and code-quality branch audits.
development
Comprehensive security and correctness audit of a branch's changes. Use for thermo nuclear, thermonuclear, or deep review requests, or branch/PR diff audits focused on bugs, breaking changes, security issues, devex regressions, and feature-gate leaks.
development
Run an extremely strict maintainability review for abstraction quality, giant files, and spaghetti-condition growth. Use for a thermo-nuclear code quality review, thermonuclear review, deep code quality audit, or especially harsh maintainability review.
development
Use for custom storefronts requiring direct GraphQL queries/mutations for data fetching and cart operations. Choose this when you need full control over data fetching and rendering your own UI. NOT for Web Components - if the prompt mentions HTML tags like <shopify-store>, <shopify-cart>, use storefront-web-components instead.