Communityコーディング&開発github.com

react-native-brownfield-migration

既存のネイティブiOS/AndroidアプリにReact NativeまたはExpoを段階的に導入するためのブラウンフィールド移行を実装します。@callstack/react-native-brownfieldを使用し、セットアップ、XCFramework/AARアーティファクトのパッケージ化、ネイティブホストへのReact Nativeサーフェス追加を支援します。

react-native-brownfield-migration とは?

このスキルは、既存のネイティブiOS/AndroidアプリケーションにReact NativeまたはExpoを段階的に統合するためのブラウンフィールド移行(brownfield migration)を実装するためのものです。`@callstack/react-native-brownfield`パッケージを中心に、初期セットアップからホストアプリへの段階的なReact Nativeサーフェス統合までを網羅した指示ワークフローを提供します。ExpoとBare React Nativeの2つのトラックをサポートしており、ユーザーはプロジェクトの状態に応じてどちらかを選択します。主なステップは、プロジェクトのアセスメントとパス選択、初期セットアップ、XCFramework(iOS)またはAAR(Android)アーティファクトのパッケージ化、ホストアプリへの統合と起動/ランタイム検証、そしてフィーチャー/画面ごとの段階的なロールアウトです。本スキルはClaude CodeやCursor、CodexなどのAIエージェント上で動作し、公式ドキュメントを参照しながらコマンド生成や設定ファイルの編集を支援します。また、グローバルガードレールとして、プレースホルダーの解決、コマンドの事前検証、設定ファイルへの安定した設定の書き込み、公式ドキュメントの優先、facadeパターンによるホストアプリのReact Native API直接依存の回避、そしてエージェントデバイスを用いた起動/ランタイム検証が規定されています。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/callstackincubator/agent-skills/tree/main/skills/react-native-brownfield-migration

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

React Native への移行について

このスキルは、ブラウンフィールド移行を採用する決定が行われた後にのみ使用してください。ユーザーがまだブラウンフィールド、グリーンフィールド、チェックポイントベースのパス、延期、または移行なしのいずれかを選択している段階では、最初に assess-react-native-migration を使用してください。

概要

@callstack/react-native-brownfield を使用して、既存のネイティブアプリにReact Nativeを段階的に導入するための指示ワークフローです。初期セットアップから段階的なホスト統合までをカバーします。

  • Expoトラック
  • Bare React Nativeトラック

タスクごとに1つのトラックを使用します。ユーザーが明示的に移行や比較を要求した場合を除きます。

移行戦略

ブラウンフィールド移行の計画と実行には、以下の戦略を使用します:

  1. アプリの状態を評価し、ExpoまたはBareのパスを選択します。
  2. @callstack/react-native-brownfield を使用して初期セットアップを実行します。
  3. RNソースアプリからRNアーティファクト(XCFramework/AAR)をパッケージ化します。
  4. 1つのRNサーフェスをホストアプリに統合し、起動/ランタイムを検証します。
  5. 機能/画面ごとに統合を繰り返し、段階的なロールアウトを行います。

エージェントガードレール(グローバル)

すべての参照ファイルにわたって、以下のルールを適用します:

  1. まず1つのパス(ExpoまたはBare)を選択し、ステップを混在させないでください。
  2. ドキュメントのプレースホルダー(<framework_target_name>、<android_module_name>、<registered_module_name>)を使用し、プロジェクトファイルから解決します。
  3. ホスト統合に進む前に、各パッケージ化コマンドを検証します。
  4. これらの参照のフラグテーブルに依存する前に npx brownfield <command> --help を実行します。Help出力が優先されます。
  5. フラグを繰り返す代わりに、安定したプロジェクト設定を一度 brownfield.config.* に書き込みます。詳細は cli-and-config.md を参照してください。
  6. 長いプラットフォームスニペットやCLIオプションの詳細については、公式ドキュメントを優先します。
  7. 可能な限り、ホストアプリを直接のReact Native APIから隔離します(facadeアプローチ)。
  8. 起動/ランタイム検証には、agent-device を使用してホストアプリを開き、RNサーフェスに移動し、スナップショット/スクリーンショットをキャプチャし、デバイスエビデンスを収集します。これが不足しており検証に必要な場合は、環境の承認済み/信頼済みパスを通じてインストールするか、ユーザーにインストールまたは有効化を依頼します。

正規ドキュメント

パス選択ゲート(必ず最初に実行)

参照ファイルを選択する前に、プロジェクトを分類します:

  1. React Nativeアプリがまだ存在しない場合は、Expo作成パスを使用します:
  2. React Nativeアプリが存在する場合は、package.json と app.json を検査します:
    • expo が存在する場合、またはExpoプラグインワークフローが要求されている場合はExpo。
    • Expoパスの要件がなく、ネイティブフォルダと直接RN CLIワークフローが使用されている場合はBare RN。
  3. まだ不明な場合は、1つの識別質問をします。
  4. 正確に1つのパスで続行します。

適用タイミング

以下の場合にこのパッケージを参照します:

  • 承認された段階的なネイティブアプリからReact NativeまたはExpoへの移行を実装する場合
  • ExpoまたはBare React Nativeプロジェクトのブラウンフィールド統合フローを作成する場合
  • @callstack/react-native-brownfield を使用して初期セットアップを実行する場合
  • React NativeアプリからiOS XCFrameworkアーティファクトを生成する場合
  • React NativeアプリからAndroid AARアーティファクトを生成して公開する場合
  • 生成されたアーティファクトをホストのiOS/Androidアプリに統合する場合

クイックリファレンス

ファイル説明
quick-start.md共有の事前チェックと必須のパス選択ゲート
cli-and-config.mdCLIコマンド、全フラグセット、設定ファイル、アーティファクトレイアウト、コード生成の副作用
runtime-api.mdホスト <-> RN APIサーフェス(JS、Swift、Kotlin)と参照アプリ
expo-create-app.mdExpoブラウンフィールドセットアップの前に新しいExpoアプリをスキャフォールド
expo-quick-start.mdExpoプラグインのセットアップとパッケージ化の準備
expo-ios-integration.mdExpo iOSのパッケージ化とホスト起動統合
expo-android-integration.mdExpo Androidのパッケージ化、公開、ホスト統合
bare-quick-start.mdBare React Nativeのベースラインセットアップ
bare-ios-xcframework-generation.mdBare iOS XCFramework生成
bare-android-aar-generation.mdBare Android AAR生成と公開
bare-ios-native-integration.mdBare iOSホスト統合
bare-android-native-integration.mdBare Androidホスト統合

問題 -> スキルマッピング

問題開始場所
最初に移行パス決定が必要assess-react-native-migration
ExpoとBareのパス決定が必要quick-start.md
CLIフラグ、設定ファイルの形状、アーティファクトパスが必要cli-and-config.md
ホスト <-> RN API名、シグネチャ、または動作するサンプルアプリが必要runtime-api.md
ホストとRN間の共有状態、または型付けされたRN -> ネイティブナビゲーションが必要brownie / brownfield-navigation スキル
ブラウンフィールド用の新しいExpoアプリを作成する必要があるexpo-create-app.md
Expoブラウンフィールドセットアップとプラグイン配線が必要expo-quick-start.md
Expo iOSブラウンフィールド統合が必要expo-ios-integration.md
Expo Androidブラウンフィールド統合が必要expo-android-integration.md
Bare RNベースラインセットアップが必要bare-quick-start.md
Bare RN iOS XCFramework生成が必要bare-ios-xcframework-generation.md
Bare RN Android AAR生成/公開が必要bare-android-aar-generation.md
Bare RN iOSホスト統合が必要bare-ios-native-integration.md
Bare RN Androidホスト統合が必要bare-android-native-integration.md

関連スキル

  • 移行パスを選択する前に、Assess React Native migration を評価します。
  • brownie(共有ホスト <-> RN状態)と brownfield-navigation(型付けされたRN -> ネイティブナビゲーション)は別のリポジトリから提供されます。名前で呼び出し、インストールされていない場合は正規ドキュメントにフォールバックします。

Individual skills in this repo

This repo contains 15 individual skills — each has its own dedicated page.

agent-device

Automates interactions for Apple-platform apps (iOS, tvOS, macOS) and Android devices. Use when navigating apps, taking snapshots/screenshots, tapping, typing, scrolling, or extracting UI info across mobile, TV, and desktop targets.

assess-react-native-migration

Assesses whether and how an existing mobile product should migrate to React Native. Use when auditing one or more product repositories for migration readiness, including products whose iOS, Android, and other clients live in separate directories or repositories; choosing brownfield, greenfield, or a checkpoint-based path; defining a representative trial; or preparing a baseline and ROI decision before implementation. When product scope or material evidence is unavailable, grills the stakeholder with exactly one question per turn instead of sending a questionnaire.

callstackincubator/github

GitHub patterns using gh CLI for pull requests, stacked PRs, code review, branching strategies, and repository automation. Use when working with GitHub PRs, merging strategies, or repository management tasks.

callstackincubator/validate-skills

Validates skills in this repo against agentskills.io spec and Claude Code best practices. Use via /validate-skills command.

create-react-native-library

Scaffolds React Native libraries with create-react-native-library for standalone libraries or local native modules and views. Use when creating or working on React Native libraries or adding native functionality in an existing app.

dogfood

Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", or "test this app" on mobile. Produces a structured report with reproducible evidence: screenshots, optional repro videos, and detailed steps for every issue.

github-actions

GitHub Actions workflow patterns for React Native iOS simulator and Android emulator cloud builds with downloadable artifacts. Use when setting up CI build pipelines or downloading GitHub Actions artifacts via gh CLI and GitHub API.

react-native-best-practices

Provides React Native performance optimization guidelines for FPS, TTI, bundle size, memory leaks, re-renders, and animations. Applies to tasks involving Hermes optimization, JS thread blocking, bridge overhead, FlashList, native modules, or debugging jank and frame drops.

react-native-testing

Write tests using React Native Testing Library (RNTL) v13 and v14 (`@testing-library/react-native`). Use when writing, reviewing, or fixing React Native component tests. Covers: render, screen, queries (getBy/getAllBy/queryBy/findBy), Jest matchers, userEvent, fireEvent, waitFor, and async patterns. Supports v13 (React 18, sync render) and v14 (React 19+, async render). Triggers on: test files for React Native components, RNTL imports, mentions of "testing library", "write tests", "component tests", or "RNTL".

react-native-tv-best-practices

Reviews React Native TV apps for focus/D-pad navigation, 10-foot UI layout, TV playback/DRM integration, low-memory TV performance, and TV accessibility. Use when building, debugging, or reviewing react-native-tvos, Expo TV, Amazon Vega/Kepler, or React Native web TV targets where the issue depends on remote input, TV focus, TV packaging, TV hardware, or TV playback constraints.

react-navigation

Provides React Navigation UI patterns for stacks, tabs, drawers etc. Use when building navigation UIs with React Navigation, configuring headers, bottom sheets or handling safe areas and insets.

upgrading-react-native

Upgrades React Native apps to newer versions by applying rn-diff-purge template diffs, updating package.json dependencies, migrating native iOS and Android configuration, resolving CocoaPods and Gradle changes, and handling breaking API updates. Use when upgrading React Native, bumping RN version, updating from RN 0.x to 0.y, or migrating Expo SDK alongside a React Native upgrade.

validate-skills

Validates skills in this repo against agentskills.io spec and Claude Code best practices. Use via /validate-skills command.

vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

writing-user-docs

House style for user-facing documentation — voice, scope, structure, and what to leave out. Use this skill whenever writing, editing, or reviewing anything a user reads to learn how to use a tool — help center articles, getting-started guides, tutorials, feature docs, README usage sections, in-app help, release notes, or FAQ entries. Trigger it even when the request is phrased plainly — "document this feature", "write docs for X", "explain this to users", "write a README for this library", "turn these notes into a guide" — and even when no style guidelines are mentioned. Also use it to review existing docs for tone, bloat, or leaked implementation detail. Do not use it for internal engineering docs, architecture write-ups, RFCs, or code comments.

関連スキル