upgrade-agent-native
它能做什么
这项技能说明如何使用受支持的升级命令,将较旧的 Agent-Native 应用或工作区升级到当前的软件包。适合应用在更新后出现故障的开发者。
适用场景
- ✓当较旧的 Agent-Native 应用需要在当前的核心软件包上运行的时候。
- ✓当升级核心软件包导致应用出现故障的时候。
- ✓当你想修补框架软件包,使旧分支能够运行,却又觉得这样做很诱人的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/upgrade-agent-native/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的旧 Agent-Native 应用在更新核心软件包之后无法启动。请帮我用正确的方式升级它。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体先预览迁移变更,然后应用经过审阅的升级,刷新脚手架技能,并且只修复应用自身的代码,绝不修改框架软件包。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Upgrade Agent-Native
Rule
When an older Agent-Native app/branch needs to run on current packages, use
agent-native upgrade. Never "fix" upgrade breakage with
pnpm patch, pnpm patch-commit, pnpm.patchedDependencies,
pnpm.overrides, patchedDependencies, resolutions, local patch artifacts,
or edits under node_modules/@agent-native/* — especially not against
@agent-native/core or @agent-native/dispatch.
Why
Agents often respond to a failed core bump by inventing framework patches and dispatch behavior overrides. That hides the real app-level break, drifts from upstream, and makes the next upgrade worse. The supported path is bump → install → refresh scaffold skills → verify, then fix app code only.
How
For the Core 0.198.0 package and import migration, follow the Core 0.198.0 upgrade runbook. It covers the preview and apply commands, Toolkit and optional peer packages, codemod limits, and a symbol-level path map.
Preview migration codemods first
npx @agent-native/core@0.198.0 upgrade --codemods --dry-run--dry-runpreviews the diff without writing. Do not manually edit imports before applying the codemod; the migration manifest is the source of truth for renamed specifiers and symbols.Apply the reviewed upgrade and codemods
npx @agent-native/core@0.198.0 upgrade --codemodsUse the versioned CLI while the app still has Core 0.196 or another older Core version: its local CLI carries an older migration manifest. After Core 0.198.0 is installed,
npx agent-native upgrade --codemods(orpnpm exec agent-native upgrade --codemodsfrom an already-installed CLI) uses the matching manifest. Either invocation applies supported codemods and runs the upgrade, including dependency installation, scaffold skill refresh, and typecheck when available. Do not run a second upgrade command just to apply the codemods.Afterward, run
npx agent-native doctorfrom the app root. Its defaultmigration-manifestandfeature-dependencieschecks report stale imports and missing optional peers detected from local settings. Confirm remote deployment settings separately because Doctor cannot inspect them.What it does:
- Blocks (unless
--force) when@agent-native/*overrides/patches exist - Rewrites non-local
@agent-native/*dependency pins tolatest - Runs the package manager install
- Rewrites those pins to the exact versions the install resolved, so the committed manifest names one release instead of re-resolving next install
- Runs
skills update scaffold --project - Runs
typecheckwhen the project has that script
- Blocks (unless
Pull upstream template changes (optional, separate from the bump)
agent-native upgrademoves package versions. It never touches files that were copied out of a template at scaffold time, so template fixes and improvements do not arrive with a bump.agent-native template status # recorded ref vs latest, drift counts agent-native template diff # what upstream changed, read-only agent-native template sync # 3-way merge it into the appsyncdefaults to the ref matching the installed@agent-native/core, so run it afterupgrade. It merges per file against a pristine baseline stored inrefs/agent-native/template-baseline/<app-path>; files upstream did not touch are left alone, and real collisions get conflict markers. After resolving markers, runagent-native template accept— the baseline deliberately does not advance past an unresolved merge.Apps scaffolded before provenance existed have no baseline. Create one with
agent-native template baselinebefore the first sync.If upgrade or typecheck fails
- Read the concrete error
- Fix app source, actions, config, or env — not framework packages
- Re-run
agent-native upgradeorpnpm typecheck - Stop and ask the user if you cannot fix the app-level error
Intentional app-level UI customization is a separate workflow. Read
customizing-agent-nativewhen the product needs to own a selectively copied component; do not use that path to reproduce framework runtime behavior or hide version skew.Dry-run / partial runs
agent-native upgrade --dry-run agent-native upgrade --skip
常见问题
我应该修补框架软件包吗?
不应该。技能说明不要使用补丁、覆盖,也不要编辑 node_modules 中的内容。
第一步是什么?
在应用代码修改之前,先用试运行预览 codemod。
哪份指南涵盖 Core 0.198.0 迁移?
技能指向 Core 0.198.0 的升级运行手册。
详情
作者的原始描述
Bring an older Agent-Native app or workspace current. Use when updating @agent-native/core, fixing a broken upgrade, or when tempted to patch or override core/dispatch packages to make an old branch run.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13188
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …