跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 upgrade-react-native

Upgrade React Native

更新新版本时使用 。 处理版本起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起 用 “/ 升级- 反应- 本地化< version> 输入.

1200 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

更新新版本时使用 。 处理版本起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起 用 “/ 升级- 反应- 本地化< version> 输入.

何时用

升级后的反应-内在对更新的版本。 处理版本起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起起 使用“/升级-反应-本地化 < version > 启动

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Upgrade React Native、Invocation、Step-by-step procedure、1. Detect the current React Native version、2. Validate the target version、3. Fetch the upgrade diff。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/upgrade-helper-api.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Use when upgrading react-native to a newer version. Handles version bumps, native project changes (Android/iOS), dependency updates, and breaking change migration. Invoke with `/upgrade-react-native <version>`.

Upgrade React NativeInvocationStep-by-step procedure1. Detect the current React Native version2. Validate the target version3. Fetch the upgrade diff4. Parse the diff and map file paths5. Review the diff and plan changes6. Apply changes7. Update third-party native dependencies8. Migrate to the Strict TypeScript API (target >= 0.87)9. Post-upgrade checklist

· 许可:MIT

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
upgrade-react-native
description
Use when upgrading react-native to a newer version. Handles version bumps, native project changes (Android/iOS), dependency updates, and breaking change migration. Invoke with `/upgrade-react-native <version>`.
许可
MIT
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • references/upgrade-helper-api.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「upgrade-react-native」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-9d00c9cfec7c5a11-%E5%8D%87%E7%BA%A7%E6%9C%AC%E5%9C%B0%E5%8F%8D%E5%BA%94.html
请存为 .cursor/skills/upgrade-react-native/SKILL.md 或 .claude/skills/upgrade-react-native/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/react-native-community/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/react-native-community/skills' --list

npx skills add 'https://github.com/react-native-community/skills' --skill 'upgrade-react-native'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: upgrade-react-native description: > Use when upgrading react-native to a newer version. Handles version bumps, native project changes (Android/iOS), dependency updates, and breaking change migration. Invoke with `/upgrade-react-native `. version: 0.1.0 license: MIT --- # Upgrade React Native Upgrade a React Native Community CLI project to a target version by fetching and applying the diff from the [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/). > [!Note] > **Expo users:** For Expo projects or more complex upgrade scenarios, try: > - [expo/skills/upgrading-expo](https://skills.sh/expo/skills/upgrading-expo) > - [callstackincubator/agent-skills/upgrading-react-native](https://skills.sh/callstackincubator/agent-skills/upgrading-react-native) ## Invocation ``` /upgrade-react-native ``` - `` — the React Native version to upgrade to (e.g. `0.79.0`). ## Step-by-step procedure Follow every step below **in order**. Do not skip steps. ### 1. Detect the current React Native version Read the project's root `package.json` and extract the `react-native` version from `dependencies` (or `devDependencies`). Strip any semver range prefix (`^`, `~`, `>=`, etc.) to get the exact current version string. If the current version cannot be determined, stop and ask the user. ### 2. Validate the target version - The target version must be a valid semver string (e.g. `0.79.0`). - It must be **greater than** the current version. - Verify the target version exists by checking: ``` https://raw.githubusercontent.com/react-native-community/rn-diff-purge/master/RELEASES ``` Fetch this file and confirm the target version is listed. If not, report the closest available versions and ask the user to choose. ### 3. Fetch the upgrade diff Fetch the unified diff between the two versions: ``` https://raw.githubusercontent.com/react-native-community/rn-diff-purge/diffs/diffs/...diff ``` For example, to upgrade from `0.73.0` to `0.74.0`: ``` https://raw.githubusercontent.com/react-native-community/rn-diff-purge/diffs/diffs/0.73.0..0.74.0.diff ``` If the diff cannot be fetched (404), it may be because exact patch versions are not available. Try the nearest minor versions (e.g. `0.73.0` instead of `0.73.2`). Report what you tried and ask the user if needed. ### 4. Parse the diff and map file paths The diff uses the template project name `RnDiffApp`. Map every path in the diff to the actual project: | Diff path prefix | Actual project path | |------------------|---------------------| | `RnDiffApp/` | Project root (`./`) | Additionally, replace occurrences of the template identifiers with the project's actual names: | Template value | Replace with | |----------------|--------------| | `RnDiffApp` | The project's app name (from `app.json` → `name`, or the `name` field in `package.json`) | | `rndiffapp` | Lowercase version of the project's app name | | `com.rndiffapp` | The project's Android package name (from `android/app/build.gradle` or `android/app/src/main/AndroidManifest.xml`) | ### 5. Review the diff and plan changes Before making any edits, review the entire diff and categorize changes: 1. **Direct applies** — files that exist in the project and whose original content matches the diff's `-` lines. These can be applied as-is. 2. **Conflicts** — files where the project's content has diverged from the template (custom modifications). These need manual merging. 3. **New files** — files in the diff that don't exist in the project yet. Create them. 4. **Deleted files** — files the diff removes. Delete them only if the project hasn't added custom content to them. Present this plan to the user before proceeding. Group changes by area: - **Root config files** (`package.json`, `metro.config.js`, `.eslintrc.js`, etc.) - **iOS native files** (`ios/` directory) - **Android native files** (`android/` directory) - **JavaScript/TypeScript source** (if any template source files changed) - **Third-party native dependencies** (from step 7 — include any version bumps identified there) ### 6. Apply changes Apply the changes following the plan from step 5: - For **direct applies**: edit the file to match the diff's `+` lines. - For **conflicts**: apply the upgrade changes while preserving the project's customizations. Use your judgement to merge. If uncertain, show both versions and ask the user. - For **new files**: create them at the mapped path. - For **deleted files**: remove them. **Important considerations:** - When updating `package.json`, update the `react-native` version and any related dependencies mentioned in the diff (e.g. `react`, `@react-native/*` packages, Gradle versions, CocoaPods versions). - Do NOT run `npm install` / `yarn install` / `pod install` automatically. Inform the user these steps are needed after the upgrade. - Refer to the [references](#references) section for version-specific guidance on breaking changes and migration notes. ### 7. Update third-party native dependencies Scan the project's `dependencies` and `devDependencies` in `package.json` for third-party React Native libraries that contain **native code** (i.e. they have an `ios/` or `android/` directory, or are known native modules). Common examples include `react-native-screens`, `react-native-reanimated`, `react-native-gesture-handler`, `@react-native-async-storage/async-storage`, `react-native-svg`, `react-native-safe-area-context`, etc. For each candidate dependency: 1. **Fetch the library's README** from its GitHub repository or npm page. 2. **Look for a React Native version compatibility table or section** — many native libraries document which versions of their package support which React Native versions (e.g. a "Compatibility" or "Version Support" table). 3. **If the README contains a compatibility table** that maps the target React Native version to a specific library version, include that library version bump in the upgrade plan. 4. **If the README does not mention version compatibility with React Native versions**, skip the library — do not guess or assume an upgrade is needed. Present all proposed dependency bumps alongside the diff-based changes in step 5 (grouped under a **Third-party native dependencies** section). For each: - State the current version, the proposed version, and link to the compatibility info you found. - If multiple major versions are compatible, prefer the latest stable version that supports the target React Native version. Apply these version bumps to `package.json` as part of step 6. ### 8. Migrate to the Strict TypeScript API (target >= 0.87) React Native 0.87 makes the [Strict TypeScript API](https://reactnative.dev/docs/strict-typescript-api) the default. When the upgrade crosses this boundary (current version < 0.87, target >= 0.87) and the project uses TypeScript (a `tsconfig.json` exists), type-checking of the project is affected and this step is **required** — do not silently skip it. Ask the user which they prefer: 1. **Migrate now (recommended)** — run the [`migrate-to-strict-api`](https://skills.sh/react-native-community/skills/migrate-to-strict-api) skill (`/migrate-to-strict-api`), which handles dependency compatibility, deep import rewriting, and known breaking type changes. 2. **Defer with the temporary opt-out** — add `"customConditions": ["react-native", "react-native-legacy-deep-imports"]` to `compilerOptions` in `tsconfig.json`, keeping both entries. Tell the user this opt-out is temporary and due for removal in a future release. For target versions below 0.87, or projects without TypeScript, skip this step and do not suggest the migration unprompted. ### 9. Post-upgrade checklist After applying all changes, present the user with a checklist: - [ ] Run `npm install` or `yarn install` to update JS dependencies - [ ] Run `cd ios && bundle exec pod install` (or `npx pod-install`) to update native iOS dependencies - [ ] Run a clean build for Android: `cd android && ./gradlew clean` - [ ] Run a clean build for iOS: `cd ios && xcodebuild clean` - [ ] Run the app on both platforms to verify it launches - [ ] Run the project's test suite - [ ] (TypeScript, target >= 0.87) Run `npx tsc --noEmit` to confirm the Strict TypeScript API migration or opt-out from step 8 - [ ] Review any conflict resolutions for correctness - [ ] Check the [React Native changelog](https://github.com/facebook/react-native/blob/main/CHANGELOG.md) for additional breaking changes - [ ] Check the [Upgrade Helper web UI](https://react-native-community.github.io/upgrade-helper/?from=&to=) for any supplementary notes ## References Consult these for version-specific migration guidance: - [references/upgrade-helper-api.md](./references/upgrade-helper-api.md) — How to fetch diffs and version lists programmatically - [migrate-to-strict-api](https://skills.sh/react-native-community/skills/migrate-to-strict-api) — Companion skill for the Strict TypeScript API migration (default from 0.87)

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…