skills/zereight/skill/zereight-react-native-optimizer

zereight-react-native-optimizer

SKILL.md

zereight-react-native-optimizer

Focused on performance correctness during code review. The goal is not to teach optimization โ€” it is to catch regressions before they ship.

When to use

Use alongside zereight-review when:

  • Reviewing React Native or Expo PRs
  • Auditing list, animation, or native module changes
  • Checking screen transitions or gesture interactions

Not a replacement for react-native-best-practices or vercel-react-native-skills โ€” those explain how to optimize. This skill detects what went wrong in a diff.

Prerequisites

The following skills provide the full optimization context this skill references:

  • react-native-best-practices (callstackincubator)
  • vercel-react-native-skills (vercel-labs)
  • react-native-animations (pluginagentmarketplace)
  • react-native-best-practices (callstackincubator)
  • agent-device (callstackincubator)

Priority order

  1. Animation on JS thread (causes visible jank โ€” always ๐ŸŸ  Major or higher)
  2. List rendering with FlatList instead of FlashList for large datasets
  3. Unnecessary re-renders in hot paths (list items, animated components)
  4. Memory leaks (listeners, subscriptions not cleaned up)
  5. Bridge overuse (synchronous calls, large payloads)
  6. Bundle size regressions
  7. Image loading / caching issues

Rendering checks

Run on every component change. See references/rendering.md for detail.

Pattern Severity
FlatList used for list with 50+ items ๐Ÿ› ๏ธ ๐ŸŸ  Major
keyExtractor returns index โš ๏ธ ๐ŸŸก Minor
Inline function/object passed as prop to memoized child ๐Ÿ› ๏ธ ๐ŸŸก Minor
React.memo wrapping component that receives new object ref each render โš ๏ธ ๐ŸŸก Minor
Context provider too high โ€” causes full subtree re-render โš ๏ธ ๐ŸŸ  Major
useSelector selecting large slice of store ๐Ÿ› ๏ธ ๐Ÿ”ต Trivial
Missing useCallback on event handler passed to child ๐Ÿ› ๏ธ ๐Ÿ”ต Trivial
StyleSheet defined inside component body ๐Ÿ› ๏ธ ๐ŸŸก Minor

Animation checks

Run when animation, gesture, or transition code is changed. See references/animation.md for detail.

Pattern Severity
Animated.Value (legacy API) used instead of Reanimated shared value ๐Ÿ› ๏ธ ๐ŸŸ  Major
Animation drives style via setState (runs on JS thread) โš ๏ธ ๐ŸŸ  Major
Worklet function accesses JS-side state directly (no runOnJS) โš ๏ธ ๐ŸŸ  Major
useAnimatedStyle depends on non-shared-value reactive data โš ๏ธ ๐ŸŸก Minor
Touch handled with TouchableOpacity instead of GestureDetector in animated context ๐Ÿ› ๏ธ ๐ŸŸก Minor
LayoutAnimation used instead of Reanimated layout animations ๐Ÿ› ๏ธ ๐Ÿ”ต Trivial
Animation not cancelled on unmount โš ๏ธ ๐ŸŸก Minor

Native / bridge checks

Run when native modules, images, or bundle changes are involved. See references/native.md for detail.

Pattern Severity
Event listener / subscription not removed in cleanup โš ๏ธ ๐ŸŸ  Major
NativeModules called synchronously in render path โš ๏ธ ๐ŸŸ  Major
Large object passed over bridge (>10KB) โš ๏ธ ๐ŸŸก Minor
Image loaded without resizeMode or explicit width/height ๐Ÿ› ๏ธ ๐ŸŸก Minor
Image source is remote URL without caching strategy ๐Ÿ› ๏ธ ๐ŸŸก Minor
New dependency added without checking bundle size impact โšช Info
console.log left in production code path ๐Ÿงน ๐Ÿ”ต Trivial

Findings format

Use the same format as zereight-review:

### [type] [severity] Title

**Condition:** <what triggers this>
**Impact:** <FPS drop / memory leak / jank / crash>
**Evidence:** `file:line` โ€” short snippet
**Minimal fix:** <smallest safe change>

Output template

When running as standalone review:

  1. Performance Summary (2-3 lines: what changed, overall signal)
  2. โš ๏ธ Performance Findings (ordered ๐ŸŸ โ†’๐ŸŸกโ†’๐Ÿ”ต)
  3. ๐ŸŽฏ Verdict (No regressions | Minor regressions | Block โ€” performance regression)

When integrated with zereight-review, append findings to the existing โš ๏ธ Findings section under a --- Performance --- subheader.

Quick heuristics

  • If it touches a list โ†’ check FlashList, keyExtractor, and item memoization
  • If it touches animation โ†’ verify UI thread execution (Reanimated, not setState)
  • If it mounts/unmounts โ†’ verify all listeners/subscriptions have cleanup
  • If it adds a native module call โ†’ verify async, not in render, not in hot loop
  • If it adds a new package โ†’ note bundle size concern as โšช Info
Weekly Installs
7
Repository
zereight/skill
First Seen
Mar 1, 2026
Installed on
mcpjam7
gemini-cli7
claude-code7
junie7
windsurf7
zencoder7