React Native Best Practices Skill
Production patterns for React Native apps on the New Architecture, by Software Mansion.
Add this skill to give your AI coding agent accurate, current guidance for Software Mansion's React Native libraries: Reanimated, Gesture Handler, React Native SVG, ExecuTorch, Audio API, and more.
Sub-skills
| Sub-skill | Covers | Status |
|---|---|---|
| Animations | Reanimated 4, CSS transitions, CSS animations, CSS pseudo-selectors and callbacks, shared values, canvas animations (Skia), GPU shader animations (WebGPU, TypeGPU), layout animations, scroll-driven animations, SVG animations, 120fps, performance flags | Complete |
| Gestures | Gesture Handler: tap, pan, pinch, rotation, fling, hover, long press, Pressable, RectButton, Swipeable, Touchable, DrawerLayout, gesture composition, testing | Complete |
| SVG | React Native SVG: when to use vs expo-image/Skia/Lottie/Rive/fonts/WebView, installation, loading (URI/XML/file), touch events, filters, FilterImage, performance pitfalls, iOS memory leaks | Complete |
| On-device AI | Routes to the standalone react-native-executorch skill for setup, ready-made models and hooks, custom models and pipelines, and troubleshooting |
Complete |
| Rich Text | Rich text editing with react-native-enriched, Markdown rendering with react-native-enriched-markdown | Complete |
| Multithreading | react-native-worklets: Worker Runtimes, scheduling APIs, shared memory, Serializable, Synchronizable | Complete |
| Enable Worklets Bundle Mode | Step-by-step Bundle Mode enablement for react-native-worklets (Expo, RN CLI, brownfield): babel plugin options, metro config helpers, mandatory metro + metro-runtime patches for every package manager (Yarn berry, npm/Yarn classic, bun, pnpm), verification, uniwind/NativeWind resolver workaround | Complete |
| Audio | React Native Audio API: playback (buffer sources, oscillators, streaming, queued playback), recording (file, data callback, graph processing), effects (gain, filters, delay, convolver, panner, waveshaper), analysis and visualization, worklets (custom processing, synthesis, UIRuntime/AudioRuntime), system integration (sessions, interruptions, notifications, permissions), testing | Complete |
| JSI | React Native JSI (JavaScript Interface): C++ API for interacting with the JS runtime — jsi::Value, HostObject, HostFunction, NativeState, ArrayBuffer, type casting, threading safety, calling JS from C++, CallInvoker/invokeAsync, performance (zero-copy, PropNameID caching, Scope), setup on Android/iOS, TurboModules vs Nitro Modules vs pure JSI, C++ memory patterns, crash debugging |
Complete |
| Complete = full reference documentation with code examples. |
Structure
react-native-best-practices/
├── SKILL.md # Entry point: routing table for sub-skills
└── references/
├── animations/
│ ├── SKILL.md # When to use, what references to read
│ ├── animations.md # Decision tree, CSS transitions/animations, shared values
│ ├── css-pseudo-selectors.md # :hover/:active/:focus without React state
│ ├── animation-functions.md # Core hooks, withSpring, withTiming, withDecay, composition
│ ├── layout-animations.md # Entering/exiting, transitions, keyframes
│ ├── scroll-and-events.md # Scroll-driven animations, useAnimatedReaction, useFrameCallback
│ ├── canvas-animations.md # Skia canvas animations, path morphing, SKSL shaders, gesture integration
│ ├── canvas-atlas.md # Atlas batched sprite/tile animation, useTexture, useRSXformBuffer, RSXform
│ ├── gpu-animations.md # Shader animations, react-native-wgpu, TypeGPU, particles
│ ├── svg-animations.md # Animating SVG elements and paths with Reanimated
│ └── animations-performance.md # 120fps, feature flags, simultaneous animation limits
├── gestures/
│ ├── SKILL.md # Version decision tree (v2 Builder vs v3 Hook API)
│ ├── gestures.md # Decision tree, lifecycle, threading, SharedValue config
│ ├── tap-handling.md # RectButton, Pressable, tap, double-tap, hit slop
│ ├── continuous-gestures.md # Pan, Pinch, Rotation, LongPress, Fling, Hover
│ ├── gesture-composition.md # Simultaneous, Race, Exclusive, VirtualGestureDetector
│ ├── swipeable-and-drawer.md # ReanimatedSwipeable, ReanimatedDrawerLayout
│ └── testing.md # Jest setup, fireGestureHandler, troubleshooting
├── svg/
│ ├── SKILL.md # When to use react-native-svg vs alternatives
│ ├── when-to-use.md # Choosing between svg, expo-image, icons, Skia, Lottie
│ └── svg.md # Installation, loading (URI/XML/file), touch events, filters, FilterImage, performance
├── on-device-ai/
│ └── SKILL.md # Routes to the standalone react-native-executorch skill
├── rich-text/
│ └── SKILL.md # Editor and renderer patterns, style customization
├── multithreading/
│ ├── SKILL.md # Runtime model, API decision tree, critical rules
│ ├── threading-api.md # Scheduling APIs, Worker Runtimes, sync/async
│ ├── shared-memory.md # Closures, Serializable, Synchronizable
│ └── setup-and-advanced.md # Installation, Babel config, Bundle Mode, Jest
├── enable-worklets-bundle-mode/
│ ├── SKILL.md # State detection, babel plugin, metro config, patches, verification
│ └── references/
│ ├── patching-yarn-berry.md # Metro patches via Yarn 2+ builtin patch: protocol
│ ├── patching-patch-package.md # Metro patches via patch-package (npm / Yarn 1 classic)
│ ├── patching-bun.md # Metro patches via bun's native patching
│ ├── patching-pnpm.md # Metro patches via pnpm patch
│ └── uniwind-remap-workaround.md # Guarded metro config when a library remaps react-native
├── audio/
│ ├── SKILL.md # When to use, what references to read
│ ├── audio.md # Decision tree, AudioContext lifecycle, singleton, audio graph, decoding
│ ├── playback.md # AudioBufferSourceNode, OscillatorNode, StreamerNode, queued playback, AudioParam, noise
│ ├── recording.md # AudioRecorder modes (file, callback, graph), permissions, file formats
│ ├── effects-and-analysis.md # GainNode (ADSR), filters, delay, convolver, panner, AnalyserNode, visualization
│ ├── worklets.md # WorkletNode, WorkletSourceNode, WorkletProcessingNode, runtimes, performance
│ └── system-and-notifications.md # AudioManager, sessions, interruptions, notifications, permissions, testing
└── jsi/
├── SKILL.md # Decision tree, references routing
├── overview.md # JSI architecture, sync model, runtime data, prototype manipulation
├── core-types.md # Value, PropNameID, HostFunction, HostObject, NativeState, WeakObject, Scope
├── casting-and-serialization.md # get/as convention, string encoding, C++↔JS mapping, folly::dynamic, ISerialization
├── threading-safety.md # Single-thread rule, destruction order, hot reload pitfalls, WithRuntimeDecorator
├── calling-js-and-async.md # HostFunction install, calling JS from C++, CallInvoker, Promise patterns
├── performance.md # Batching, PropNameID cache, zero-copy ArrayBuffer, Scope in loops
├── setup-and-templates.md # Android (FBJNI), iOS (ObjC++), library scaffolding templates
├── module-approaches.md # Pure JSI vs TurboModules vs Nitro Modules decision tree
├── cpp-memory-patterns.md # unique_ptr, shared_ptr, move, RAII, circular ownership, GC boundary
└── debugging-and-pitfalls.md # Crash traces, symbolication, ASan, common JSI crash patternsAdding a Sub-skill
- Create the directory:
references/<your-topic>/ - Write
SKILL.mdwith frontmatter:--- name: your-topic description: "What it covers and when to trigger. Include specific keywords users might type." --- - Add reference files for detailed patterns and code examples
- Register it in the parent
SKILL.mdsub-skills table - Keep SKILL.md under 500 lines. Move detailed content to reference files and link to them with a "when to read" table.