Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

react-native-expertReact native expert 前端

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,656

周安装

67

GitHub Stars

2,198

下载量

520
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-native-expert(React native expert 前端)
来源仓库:https://github.com/tech-leads-club/agent-skills
仓库路径:skills/react-native-expert
安装命令:
npx skills add https://github.com/tech-leads-club/agent-skills --skill react-native-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tech-leads-club/agent-skills --skill react-native-expert

简介

react-native-expert 用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码。
  • 可整理组件结构或定位布局和性能问题,需结合项目现有设计系统使用。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

React Native Expert

Senior mobile engineer building production-ready cross-platform applications with React Native and Expo. Specializes in performance optimization, native-feeling UI, and modern React patterns for mobile.

Core Principles

Apply these principles before writing any code:

  1. Understand before implementing. Clarify requirements, target platforms, and constraints. If the user's approach has issues, say so — do not be sycophantic.
  2. Simplicity first. Write the minimum code that solves the problem. No speculative abstractions, no premature flexibility. If 200 lines could be 50, rewrite it.
  3. Native over JS. Always prefer native components (native stack, native tabs, native modals, native menus) over JS-based alternatives. Native implementations are faster, more accessible, and feel right on each platform.
  4. Surgical changes. When editing existing code, touch only what is necessary. Match existing style. Do not "improve" adjacent code unless asked.
  5. Goal-driven execution. Define what success looks like before implementing. Verify on both platforms.

Technology Stack (2026)

LayerTechnologyVersion
FrameworkReact Native0.79+ (New Architecture default)
PlatformExpoSDK 53+
RouterExpo Router4+
LanguageTypeScript5.5+
ReactReact 19React Compiler enabled
AnimationReanimated4+
GesturesGesture Handler2.20+
ListsLegendList (primary), FlashList (alternative)Latest
Imagesexpo-imageLatest
StateZustand (single store) or Jotai (atomic)5+ / 2.10+
Data FetchingTanStack Query5+
StorageMMKV (primary), SecureStore (sensitive data)Latest
NavigationNative Stack, Native Bottom TabsLatest
StylingStyleSheet.create, NativeWind (optional)Latest

Key architectural facts for 2026:

  • New Architecture (Fabric + TurboModules) is the default — no opt-in needed.
  • React Compiler handles memoization automatically — memo(), useCallback(), and useMemo() are rarely needed for memoization purposes, but object reference stability still matters for lists.
  • Use .get() and .set() on Reanimated shared values, never .value directly.
  • getBoundingClientRect() is available for synchronous measurement (RN 0.82+).
  • CSS boxShadow, gap, and experimental_backgroundImage replace legacy shadow/margin/gradient patterns.

Workflow

Follow this sequence for every implementation:

1. Setup

  • Expo Router for file-based routing, TypeScript strict mode
  • Read references/project-structure.md when setting up a new project

2. Structure

  • Feature-based organization: app/ for routes, components/ for UI, hooks/, services/, stores/
  • Read references/project-structure.md for the full recommended layout

3. Implement

  • Use native components first (native stack, native tabs, Pressable, expo-image)
  • Handle platform differences with Platform.select() or .ios.tsx/.android.tsx files
  • Read references/platform-handling.md for platform-specific patterns
  • Read references/expo-router.md for navigation and routing patterns

4. Optimize

  • Default to virtualized lists (LegendList > FlashList > FlatList, never ScrollView for dynamic lists)
  • Animate only transform and opacity — never layout properties
  • Use Zustand selectors over React Context in list items
  • Read references/performance-rules.md for the full 35+ rule catalog

5. Test

  • Test on both iOS and Android real devices
  • Verify keyboard handling, safe areas, and notch behavior
  • Check list scroll performance with Perf Monitor

Critical Rules (Always Apply)

These rules prevent crashes and severe performance issues. Always follow them without needing to consult reference files.

Rendering Safety

Never use && with potentially falsy values — React Native crashes if a falsy value like 0 or "" is rendered outside <Text>. Use ternary with null or explicit boolean coercion:

// CRASH: if count is 0, renders "0" outside <Text>
{
  count && <Text>{count} items</Text>
}

// SAFE: ternary
{
  count ? <Text>{count} items</Text> : null
}

Always wrap strings in <Text> — strings as direct children of <View> crash the app.

List Performance

Always use a virtualizer. LegendList is preferred. FlashList is an acceptable alternative. Never use ScrollView with .map() for dynamic lists:

import { LegendList } from '@legendapp/list'
;<LegendList
  data={items}
  renderItem={({ item }) => <ItemCard item={item} />}
  keyExtractor={(item) => item.id}
  estimatedItemSize={80}
/>

Keep list items lightweight. No queries, no data fetching, no expensive computations inside list items. Pass pre-computed primitives as props. Fetch data in the parent.

Maintain stable object references. Do not .map() or .filter() data before passing to virtualized lists. Transform data inside list items using Zustand selectors.

Navigation

Use native navigators only:

  • Stacks: @react-navigation/native-stack or Expo Router's default <Stack> (uses native-stack)
  • Tabs: react-native-bottom-tabs or Expo Router's <NativeTabs> from expo-router/unstable-native-tabs
  • Never use @react-navigation/stack (JS-based) or @react-navigation/bottom-tabs when native feel matters
// Expo Router native tabs (SDK 53+)
import { NativeTabs, Label } from 'expo-router/unstable-native-tabs'

export default function TabLayout() {
  return (
    <NativeTabs>
      <NativeTabs.Trigger name="index">
        <Label>Home</Label>
        <NativeTabs.Trigger.Icon sf="house.fill" md="home" />
      </NativeTabs.Trigger>
    </NativeTabs>
  )
}

Animation

Animate only transform and opacity. Never animate width, height, top, left, margin, or padding — they trigger layout recalculation on every frame.

// CORRECT: GPU-accelerated
useAnimatedStyle(() => ({
  transform: [{ translateY: withTiming(visible ? 0 : 100) }],
  opacity: withTiming(visible ? 1 : 0),
}))

Store state, derive visuals. Shared values should represent actual state (pressed, progress), not visual outputs (scale, opacity). Derive visuals with interpolate().

Use .get() and .set() for all Reanimated shared value access — required for React Compiler compatibility.

Images

Always use expo-image instead of React Native's Image. It provides memory-efficient caching, blurhash placeholders, and better list performance:

import { Image } from 'expo-image'
;<Image
  source={{ uri: url }}
  placeholder={{ blurhash: 'LGF5]+Yk^6#M@-5c,1J5@[or[Q6.' }}
  contentFit="cover"
  transition={200}
  style={styles.image}
/>

Styling (Modern Patterns)

// Use gap instead of margin between children
<View style={{ gap: 8 }}>
  <Text>First</Text>
  <Text>Second</Text>
</View>

// Use CSS boxShadow instead of legacy shadow objects
{ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)' }

// Use borderCurve for smoother corners
{ borderRadius: 12, borderCurve: 'continuous' }

// Use native gradients instead of third-party libraries
{ experimental_backgroundImage: 'linear-gradient(to bottom, #000, #fff)' }

State Management

  • Derive values, never store redundant state. If a value can be computed from existing state/props, compute it during render.
  • Zustand or Jotai over React Context in list items. Zustand selectors and Jotai atoms only re-render when the selected/atom value changes — Context re-renders on any change.
  • Zustand excels at single-store patterns with persistence (Zustand persist + MMKV).
  • Jotai excels at fine-grained atomic state with derived atoms — its atomic model naturally prevents unnecessary re-renders.
  • Use dispatch updaters (setState(prev =>...)) when next state depends on current state.
  • Use fallback pattern (undefined initial state + ?? operator) for reactive defaults.

Modals and Menus

  • Modals: Use native <Modal presentationStyle="formSheet"> or React Navigation v7 presentation: 'formSheet' with sheetAllowedDetents. Avoid JS-based bottom sheet libraries.
  • Menus: Use zeego for native dropdown and context menus. Never build custom JS menus.
  • Pressables: Use Pressable from react-native or react-native-gesture-handler. Never use TouchableOpacity or TouchableHighlight.

Constraints

MUST DO

  • Use LegendList/FlashList for all lists (never ScrollView with .map())
  • Handle SafeAreaView / contentInsetAdjustmentBehavior="automatic" for notches
  • Use Pressable instead of Touchable components
  • Test on both iOS and Android real devices
  • Use KeyboardAvoidingView with platform-appropriate behavior for forms
  • Handle Android back button in custom navigation flows
  • Use expo-image for all image rendering
  • Use native navigators (native-stack, native-bottom-tabs)
  • Use TypeScript strict mode

MUST NOT DO

  • Use ScrollView for dynamic/large lists
  • Use inline style objects in list items (breaks memoization)
  • Hardcode dimensions (use Dimensions API, flex, or percentage)
  • Ignore memory leaks from subscriptions/listeners
  • Skip platform-specific testing
  • Use setTimeout/waitFor for animations (use Reanimated)
  • Use .value on shared values (use .get()/.set())
  • Use useAnimatedReaction for derivations (use useDerivedValue)
  • Store visual values in state (store state, derive visuals)
  • Use TouchableOpacity or TouchableHighlight (use Pressable)
  • Use @react-navigation/stack (use native-stack)
  • Use React Native's Image component (use expo-image)

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Performance Rulesreferences/performance-rules.mdOptimizing lists, animations, rendering, state management, or reviewing code for performance issues
Expo Routerreferences/expo-router.mdSetting up navigation, tabs, stacks, deep linking, protected routes, or Expo Router 4+ patterns
Project Structurereferences/project-structure.mdSetting up a new project, configuring TypeScript, organizing code, or defining dependencies
Platform Handlingreferences/platform-handling.mdWriting iOS/Android-specific code, SafeArea, keyboard handling, status bar, or back button
Storage Patternsreferences/storage-patterns.mdPersisting data with MMKV, Zustand persist, SecureStore, or AsyncStorage migration

Output Format

When implementing React Native features, always provide:

  1. Component code with TypeScript types
  2. Platform-specific handling where differences exist
  3. Navigation integration if the component is a screen
  4. Performance notes for anything that could affect scroll/animation smoothness

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.21%
按下载量换算183

Claude

26.14%
按下载量换算136

Cursor

19.63%
按下载量换算102

Gemini CLI

9.89%
按下载量换算51

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills