Token导航 LogoToken导航

Agent Skill · 研究检索

react-native-patterns(React native 模式)

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

react-native-patterns 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 44,750。

总安装 894周安装 38GitHub Stars 74下载 313核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill react-native-patterns

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

提供 React Native 组件开发的可维护模式参考,涵盖触摸交互、列表渲染和导航等核心场景。适用于移动端界面构建,支持 Pressable、FlashList 和模态框等原生组件的最佳实践。通过 SafeAreaView、触觉反馈和平台适配建议,帮助生成符合 RN 规范的交互逻辑。

安装需指定 GitHub 仓库路径,使用时需结合项目路由与样式系统避免片段化代码。react-native-patterns 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/react-native-patterns

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

react-native-patterns 怎么安装?

在终端执行 npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill react-nati…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

react-native-patterns 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

react-native-patterns 需要什么权限?

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

react-native-patterns 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

react-native-patterns 用的人多吗?

公开数据是累计安装 894 次,近一周安装 38 次,下载 313 次,GitHub 74 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

react-native-patterns 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
react-native-patterns

React native 模式 · 本页

89474需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

React Native Patterns

Overview

Patterns for building maintainable React Native components. Covers touch interactions (Pressable), list rendering (FlashList), modal patterns (bottom sheets), accessibility, navigation, and RN-specific requirements that differ from web React.

For React web patterns (hooks, context, composition), see the react-patterns skill.

Workflows

Building an interactive screen:

  1. Set up SafeAreaView or apply safe area insets
  2. Use Pressable for all interactive elements (44pt minimum)
  3. Add haptic feedback on primary actions
  4. Use FlashList for lists, ScrollView for fixed content
  5. Implement bottom sheet for detail/modal views
  6. Add accessibility labels to all interactive elements
  7. Test on device for touch targets and scroll performance

Guidance

Pressable (not TouchableOpacity)

Pressable is the standard touch component. TouchableOpacity is deprecated.

Key principles:

  • 44pt minimum touch target on all interactive elements
  • Use hitSlop to expand touch area beyond visual bounds: hitSlop={{top: 8, bottom: 8, left: 8, right: 8}}
  • Style feedback via style function: style={({pressed}) => [pressed && {opacity: 0.7}]}
  • Or use NativeWind: className="active:opacity-70"
  • Add haptics on press for primary actions: onPress={() => {Haptics.impactAsync(); doAction();}}

Text-Only Strings Rule

React Native requires all visible text to be wrapped in <Text>:

✅ <View><Text>Hello</Text></View>
❌ <View>Hello</View>  // Crashes at runtime

This applies to conditional renders, string interpolation, and JSX expressions. Always wrap strings in Text.

ScrollView Patterns

Two className targets:

  • className — outer container (flex, background)
  • contentContainerClassName — inner content (padding, gap, alignment)

Use ScrollView for screens with fixed, non-dynamic content. Use FlashList for dynamic lists.

showsVerticalScrollIndicator={false} for cleaner visual when custom scroll indicators are used.

FlashList Patterns

High-performance list rendering:

  • estimatedItemSize is required — estimate average item height in points
  • renderItem receives {item, index} — keep render function pure
  • keyExtractor — use unique string ID from data
  • contentContainerClassName — NativeWind styling for inner content
  • ItemSeparatorComponent — consistent spacing between items
  • ListEmptyComponent — graceful empty state

Bottom Sheet as Modal

@gorhom/bottom-sheet replaces web modal dialogs:

  • Define snapPoints array: ['25%', '50%', '90%']
  • Use BottomSheetModal with BottomSheetModalProvider for imperative control
  • BottomSheetScrollView for scrollable sheet content
  • BottomSheetBackdrop for press-to-dismiss overlay
  • Present: bottomSheetRef.current?.present()
  • Dismiss: bottomSheetRef.current?.dismiss()

expo-image Patterns

Use for all image display:

  • Remote images: source={{uri: 'https://...'}}
  • Local images: source={require('../assets/image.png')}
  • Blurhash placeholder: placeholder="LKO2?U%2Tw=w]~RBVZRi}" for loading state
  • contentFit="cover" for card thumbnails, "contain" for full images
  • transition={300} for smooth fade-in on load

Accessibility

Required accessibility props for interactive elements:

PropPurposeExample
accessibilityRoleSemantic role"button", "link", "image"
accessibilityLabelScreen reader text"Open settings"
accessibilityHintAction description"Opens the settings screen"
accessibilityStateDynamic state{selected: true, disabled: false}
accessibleMarks as accessibleDefault true for Pressable

Guidelines:

  • All Pressable elements need accessibilityLabel
  • Images need accessibilityLabel describing content
  • Use accessibilityRole="header" for screen titles
  • Toggle/checkbox: set accessibilityState={{checked: isChecked}}
  • Disabled elements: accessibilityState={{disabled: true}}

Chat-Forward Component Patterns

Demos use a chat-forward interface where the conversation thread is the primary UI.

Chat Screen Layout

Three zones:

  • Header: Minimal — title, back nav, optional status. Uses safe area top inset.
  • Message stream: FlashList or inverted ScrollView for the conversation. Agent and user messages alternate. Rich content is embedded within agent message components.
  • Input bar: Text input pinned to bottom. Uses KeyboardAvoidingView (iOS) or android:windowSoftInputMode="adjustResize". Safe area bottom inset for home indicator. Optional quick-action chips above the text field.
Message Bubble

Agent and user bubbles have distinct styling (alignment, color, shape):

  • Agent bubble: Left-aligned, neutral background, can contain child components (cards, summaries, action buttons)
  • User bubble: Right-aligned, accent background, text only
  • Bubbles animate in with FadeInDown.duration(300) on append
Inline Rich Card

Compact data card rendered as a child of an agent message bubble:

  • Photo thumbnail (expo-image) + title + key metric + status badge
  • Tappable — opens bottom sheet with full detail
  • For card sets: horizontal ScrollView within the message, or vertical stack
  • Stagger animation: FadeInDown.delay(index * 50).duration(300)
Summary Card

Running totals/status that updates as the conversation progresses:

  • Shows aggregated state: Keep ($X), Sell ($Y), Donate ($Z), Progress (N%)
  • Can be rendered as a sticky element above the input bar for persistent visibility
  • Content crossfades on update (150ms timing)
Prompt Card

Agent suggestion with embedded action buttons:

  • Text prompt + 1-3 action buttons inline
  • Buttons are Pressable with 44pt targets, haptic on press
  • After tap, the prompt card updates to show the confirmed action
  • E.g., *"Want me to find pickup options?"* → [Yes] [Not now]
Comparison View

Before/after or side-by-side content within a message:

  • Two expo-image instances with labels (Before / After)
  • Optional delta annotation (e.g., "New scratch detected")
Timeline View

Chronological event list rendered inline within an agent message:

  • Compact: date + title + icon per event
  • Expandable: tap to show detail (inline expand or bottom sheet)
  • Vertical line connector between events
Notification Message

Proactive agent alert that appears as a new message in the thread:

  • Distinctive styling (icon + emphasis color) to differentiate from regular agent messages
  • Can contain inline action buttons
  • E.g., *"Storm season starts in 6 weeks. Your basement still shows moisture risk."*

Navigation from Components

Use Expo Router's useRouter() hook:

  • router.push('/path') — navigate forward (adds to stack)
  • router.replace('/path') — replace current screen
  • router.back() — go back
  • router.canGoBack() — check if back navigation possible
  • Pass params: router.push({pathname: '/detail/[id]', params: {id: '123'}})

Best Practices

  • Always use Pressable over TouchableOpacity or TouchableHighlight
  • Enforce 44pt minimum touch targets — use hitSlop when visual is smaller
  • Wrap every visible string in <Text> — no bare strings in JSX
  • Use expo-image for all images (never RN Image)
  • Add accessibilityLabel to every interactive element
  • Use FlashList with estimatedItemSize for any list with >10 items
  • Use contentContainerClassName for ScrollView/FlashList inner styling
  • Add haptic feedback sparingly — primary actions only
  • Test touch targets on real device (simulator touch is imprecise)

Anti-Patterns

  • Using TouchableOpacity (deprecated — use Pressable)
  • Touch targets smaller than 44pt without hitSlop compensation
  • Bare strings without <Text> wrapper (runtime crash)
  • Using RN Image instead of expo-image (no caching, no blurhash)
  • Forgetting estimatedItemSize on FlashList
  • Using FlatList for large datasets (FlashList is faster)
  • Missing accessibilityLabel on interactive elements
  • Using Alert.alert() for complex choices (use bottom sheet instead)
  • Padding on className of ScrollView (use contentContainerClassName)
  • Inline anonymous functions in FlashList renderItem (causes re-renders — extract component)

平台分布

Codex

34.88%
按下载量换算109

Claude

32.1%
按下载量换算100

Cursor

18.1%
按下载量换算57

Gemini CLI

8.61%
按下载量换算27

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills