agentsclimarketplace

Mobile rn performance

Skill kensaurus/cursor-kenji/skills/mobile-rn-performance

🦖Curated Cursor AI agent skills, slash commands, MCP configs, subagents & rules for full-stack dev — React 19, Next.js 15, Supabase, Tailwind v4, TypeScript

Install
npx -y skills add kensaurus/cursor-kenji --skill mobile-rn-performance

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Fix React Native / Expo performance, build, and upgrade issues. Use for jank, frame drops, slow startup, large bundles, memory leaks, Hermes, FlashList, Reanimated, Turbo Modules, Android 16KB alignment, or RN/Expo version upgrades.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.6 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

React Native Performance & Build

The performance, bundling, and upgrade layer for React Native / Expo. mobile-rn-screen handles screen layout and native feel; this skill handles speed, size, and version moves.

Distilled from Callstack's React Native best-practices skill (MIT) and the Ultimate Guide to RN Optimization.

Diagnose first, then fix

Never optimize blind. Identify the symptom, then apply the matching category. Measure before/after.

SymptomCategoryImpact
Janky scroll/animation, dropped framesFPS & re-rendersCRITICAL
Large download / install sizeBundle sizeCRITICAL
Slow cold start (high TTI)TTI / startupHIGH
Slow native operationsNative performanceHIGH
Memory grows over time / crashesMemory managementMED-HIGH
Choppy gestures/transitionsAnimationsMEDIUM

1. FPS & re-renders (CRITICAL)

  • Profile with React DevTools + the RN perf monitor before changing code. Find the component re-rendering, don't guess.
  • Memoize hot paths: React.memo, useMemo, useCallback — but only where a profile shows wasted renders (over-memoization adds its own cost).
  • Stable references: don't create new objects/arrays/functions inline in props of list rows or memoized children.
  • Lists: use FlashList (Shopify) over FlatList for long/heterogeneous lists. Provide stable keyExtractor, avoid anonymous renderItem closures, and give size hints. A FlatList re-render storm is the #1 RN list perf bug.
  • Move continuous values (scroll, gesture, animation) off React state — see Animations.

2. Bundle & app size (CRITICAL)

  • Enable Hermes (default on modern RN) — smaller, faster startup.
  • Audit the bundle: tree-shake, avoid pulling whole libraries for one function, lazy-load heavy screens.
  • Ship per-architecture / split APKs; drop unused locales and assets.
  • Android 16KB page-size alignment — required for Google Play; verify all third-party native libs are aligned or builds get rejected.

3. TTI / startup (HIGH)

  • Defer non-critical work past first paint (analytics, feature flags, heavy init).
  • Lazy-init native modules; don't block the JS thread on startup.
  • Measure TTI on a real low-end device, not a flagship or simulator.

4. Native performance (HIGH)

  • Prefer native (Turbo Modules / JSI) over JS polyfills for hot, frequent operations.
  • Minimize bridge traffic: batch calls, avoid chatty per-frame round-trips.
  • Profile with Xcode Instruments / Android Studio profiler for native hotspots.

5. Memory (MED-HIGH)

  • Clean up listeners, timers, and subscriptions in effect cleanup. Leaked listeners are the common JS leak.
  • Watch image caches and large in-memory data; page or virtualize.
  • Profile native leaks with platform tools when JS looks clean.

6. Animations (MEDIUM)

  • Use react-native-reanimated on the UI thread (useSharedValue / useAnimatedStyle / worklets). Never drive continuous animation through setState — it re-renders the tree every frame and collapses FPS.
  • Use the native driver for Animated when staying on the core API.

React Native / Expo upgrades

  • Use the official RN Upgrade Helper diff for the exact version jump; apply native-side changes (android/, ios/, Podfile, Gradle) deliberately — these are where upgrades break.
  • Bump Expo SDK via expo install --fix; align all expo-* and third-party native deps to the SDK's supported ranges.
  • After upgrade: clean caches (watchman watch-del, Metro cache, Pods, Gradle), rebuild, and smoke-test on both platforms via mobile-emulator-test.
  • For Linux/Windows devs: iOS-affecting upgrade changes verify on macOS CI, not locally.

Definition of done (RN perf)

  • Measured before/after on a real device (numbers, not vibes).
  • The fix targets the profiled hotspot, not a guess.
  • No new re-render storms introduced (re-profile the changed screen).
  • Android 16KB alignment holds if native libs changed.
  • Both platforms still build and run.

Composes with

  • mobile-rn-screen — layout, safe-area, touch-target, native feel.
  • mobile-emulator-start / mobile-emulator-test — boot + on-device verification.
  • workflow-spec-tdd — spec + test the perf fix so it doesn't regress.
  • enhance-capacitor-ui — if the app is hybrid rather than bare RN, the axis architecture differs.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 327,167. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.