React Native Skills
Comprehensive best practices for React Native and Expo applications. Contains rules across multiple categories covering performance, animations, UI patterns, and platform-specific optimizations.
Portability note: This skill reads sibling files (
rules/*.mdand the compiledAGENTS.md) relative to this SKILL.md. If those files are not shipped alongside it, apply the inline Quick Reference rules directly — the rule names below are self-describing and need no VPS-specific path.
Single-voice craft (do NOT parallelize)
This is one coherent engineering-guidance voice, not a multi-angle audit. Do not fan out into parallel sub-agents or split categories across workers — RN guidance must stay internally consistent (one navigation stack choice, one styling system, one list strategy) or it contradicts itself. Read the relevant rule file(s), apply, move on.
Craft upgrades when applying these rules:
- Cite the rule name in every change. When you apply guidance, name it
(e.g. "
list-performance-virtualize→ swapped FlatList for FlashList") so the reviewer can trace each edit to a rule. No silent restyling of adjacent code (R-KARPATHY: surgical changes). - Resolve conflicts toward the higher-priority category. Priorities are ordered 1 (List Performance, CRITICAL) → 8 (Config, LOW). If two rules pull different directions, the lower-numbered category wins; state the tradeoff.
- Match the existing project, don't impose. Detect the app's current stack (NativeWind vs StyleSheet, expo-image vs Image, native vs JS nav) before recommending — apply the rule in the project's idiom rather than rewriting its conventions.
Output contract
- Produces: RN/Expo code changes (or a review) where each change maps to a
named rule above, plus a short list of
rule-name → what changed. - Verify: the app/component still type-checks and renders
(
tsc --noEmitor the project's lint/build); animations run on the UI thread (transform/opacity only); lists use FlashList with stable keys. A change that doesn't build is not done (L0). - Evidence / no hallucination: only apply rules listed here or in
rules/. Do not invent RN APIs — if a rule file is absent, fall back to the documented Quick Reference name and verify the API against current Expo/RN docs before using it. No regressions: never remove working behavior to satisfy a rule.
When to Apply
Reference these guidelines when:
- Building React Native or Expo apps
- Optimizing list and scroll performance
- Implementing animations with Reanimated
- Working with images and media
- Configuring native modules or fonts
- Structuring monorepo projects with native dependencies
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | List Performance | CRITICAL | list-performance- |
| 2 | Animation | HIGH | animation- |
| 3 | Navigation | HIGH | navigation- |
| 4 | UI Patterns | HIGH | ui- |
| 5 | State Management | MEDIUM | react-state- |
| 6 | Rendering | MEDIUM | rendering- |
| 7 | Monorepo | MEDIUM | monorepo- |
| 8 | Configuration | LOW | fonts-, imports- |
Quick Reference
1. List Performance (CRITICAL)
list-performance-virtualize- Use FlashList for large listslist-performance-item-memo- Memoize list item componentslist-performance-callbacks- Stabilize callback referenceslist-performance-inline-objects- Avoid inline style objectslist-performance-function-references- Extract functions outside renderlist-performance-images- Optimize images in listslist-performance-item-expensive- Move expensive work outside itemslist-performance-item-types- Use item types for heterogeneous lists
2. Animation (HIGH)
animation-gpu-properties- Animate only transform and opacityanimation-derived-value- Use useDerivedValue for computed animationsanimation-gesture-detector-press- Use Gesture.Tap instead of Pressable
3. Navigation (HIGH)
navigation-native-navigators- Use native stack and native tabs over JS navigators
4. UI Patterns (HIGH)
ui-expo-image- Use expo-image for all imagesui-image-gallery- Use Galeria for image lightboxesui-pressable- Use Pressable over TouchableOpacityui-safe-area-scroll- Handle safe areas in ScrollViewsui-scrollview-content-inset- Use contentInset for headersui-menus- Use native context menusui-native-modals- Use native modals when possibleui-measure-views- Use onLayout, not measure()ui-styling- Use StyleSheet.create or Nativewind
5. State Management (MEDIUM)
react-state-minimize- Minimize state subscriptionsreact-state-dispatcher- Use dispatcher pattern for callbacksreact-state-fallback- Show fallback on first renderreact-compiler-destructure-functions- Destructure for React Compilerreact-compiler-reanimated-shared-values- Handle shared values with compiler
6. Rendering (MEDIUM)
rendering-text-in-text-component- Wrap text in Text componentsrendering-no-falsy-and- Avoid falsy && for conditional rendering
7. Monorepo (MEDIUM)
monorepo-native-deps-in-app- Keep native dependencies in app packagemonorepo-single-dependency-versions- Use single versions across packages
8. Configuration (LOW)
fonts-config-plugin- Use config plugins for custom fontsimports-design-system-folder- Organize design system importsjs-hoist-intl- Hoist Intl object creation
How to Use
Read individual rule files for detailed explanations and code examples:
rules/list-performance-virtualize.md
rules/animation-gpu-properties.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and references
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md