rn-upgrade

📁 nielsmadan/agentic-coding 📅 1 day ago
4
总安装量
4
周安装量
#51812
全站排名
安装命令
npx skills add https://github.com/nielsmadan/agentic-coding --skill rn-upgrade

Agent 安装分布

opencode 4
kilo 4
antigravity 4
claude-code 4
github-copilot 4
codex 4

Skill 文档

React Native Upgrade Command

You are tasked with upgrading a React Native application to the version specified in $ARGUMENTS (or the latest version if not specified).

Usage

/rn-upgrade 0.76
/rn-upgrade 0.75.4
/rn-upgrade          # upgrades to latest stable

Instructions

  1. Determine versions:

  2. Research and validate:

  3. Fetch the upgrade diff:

  4. Check dependency compatibility:

  5. Plan the upgrade:

    • Create a task list with TaskCreate, broken into phases:
      • Phase 1: Dependency updates (package.json)
      • Phase 2: Android native changes (MainApplication, Gradle, gradle.properties)
      • Phase 3: iOS native changes (AppDelegate, Podfile, Info.plist, .pbxproj)
      • Phase 4: Library-specific migrations
      • Phase 5: Install dependencies and pods
    • Use EnterPlanMode to present the plan to the user for approval before making changes
  6. Execute the upgrade:

    • Update package.json with new React Native and React versions
    • Update all @react-native/* packages to match the target version
    • Apply native code changes from the diff, preserving:
      • Custom package names/bundle identifiers
      • Third-party SDK integrations (e.g., Firebase, analytics, crash reporting)
      • Custom build configurations
      • Existing native modules
    • Update Gradle wrapper if required by the diff
    • Enable/configure New Architecture if required
    • Install dependencies: yarn install (or npm install)
    • Install iOS pods: cd ios && pod install
  7. Important considerations:

    • ALWAYS preserve custom native code integrations
    • Replace template package names (e.g., com.helloworld) with the project’s actual package names
    • Check for react-native-fast-image compatibility (may need @d11/react-native-fast-image fork)
    • Update related dependencies if needed (e.g., react-native-bootsplash, react-native-safe-area-context)
    • Never skip steps without user confirmation
  8. Post-upgrade checklist:

    • Provide a testing checklist including:
      • Clean builds for both platforms (cd android && ./gradlew clean, Xcode clean build folder)
      • New Architecture verification (if enabled)
      • Third-party integrations testing
      • Navigation and animations
      • Device-specific features (camera, location, notifications, etc.)
  9. Documentation:

    • Summarize all changes made
    • List any manual follow-up actions required
    • Note any dependencies that still need updates
    • Provide links to relevant release notes

Examples

Single version upgrade:

/rn-upgrade 0.76

Upgrades from current version (e.g., 0.75.3) to 0.76. Fetches the diff from rn-diff-purge, checks dependency compatibility, plans changes, and executes after approval.

Multi-version jump:

/rn-upgrade 0.76

When current version is 0.73 or older, the skill upgrades incrementally: 0.73 -> 0.74 -> 0.75 -> 0.76, one major version at a time, validating builds between each jump.

Troubleshooting

Problem Solution
pod install fails with version conflicts Run cd ios && pod repo update && pod install. If still failing, delete Podfile.lock and Pods/ then retry.
Gradle build fails after upgrade Clear caches: cd android && ./gradlew clean. Check that gradle-wrapper.properties matches the version from the diff.
Metro bundler can’t resolve modules Clear Metro cache: npx react-native start --reset-cache. Also delete node_modules and reinstall.
Xcode build fails with “framework not found” Run cd ios && pod deintegrate && pod install. If using use_frameworks!, check compatibility with native modules.
New Architecture bridge errors Verify all native modules support the New Architecture. Check newArchEnabled in gradle.properties (Android) and Podfile flags (iOS).
Diff URL returns 404 The exact patch version may not exist in rn-diff-purge. Use the nearest available version or the Upgrade Helper UI.

Guidelines

  • Use the manual upgrade approach with diff analysis (not react-native upgrade CLI)
  • Upgrade incrementally (one major version at a time) when jumping multiple versions
  • Enable New Architecture in current version before upgrading if it’s required in target
  • Clear all caches after upgrade (Metro, Gradle, Pods, Derived Data)
  • Test thoroughly on both iOS and Android before considering upgrade complete

Resources


Start by determining the current and target versions, then proceed with research and planning before making any changes.