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
Provides React Native performance optimization guidelines for FPS, TTI, bundle size, memory leaks, re-renders, and animations. Applies to tasks involving Hermes optimization, JS thread blocking, bridge overhead, FlashList, native modules, or debugging jank and frame drops.
development
Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, typography, micro-interactions, enter/exit animations, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, font smoothing, tabular numbers, image outlines, box shadows.
development
General-purpose Static Application Security Testing (SAST) skill for code vulnerability analysis. Trigger when the user asks to: "analyze code for vulnerabilities", "review code security", "find security bugs", "do a SAST scan", "check for [vulnerability type] in code", "audit source code", or requests a security code review of any language or framework. Covers 34 vulnerability classes across web, API, auth, mobile, and logic layers.
tools
Helps understand and write EAS workflow YAML files for Expo projects. Use this skill when the user asks about CI/CD or workflows in an Expo or EAS context, mentions .eas/workflows/, or wants help with EAS build pipelines or deployment automation.