Upgrade agent native

From BuilderIO/agent-native · View interactive version

Upgrade agent native is an AI agent skill from the GitHub repository BuilderIO/agent-native. 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.

How to use this skill

Skill file

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.

  1. Preview migration codemods first

```bash

npx @agent-native/core@0.198.0 upgrade --codemods --dry-run

```

--dry-run previews 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.

  1. Apply the reviewed upgrade and codemods

```bash

npx @agent-native/core@0.198.0 upgrade --codemods

```

Use 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 (or

pnpm exec agent-native upgrade --codemods from 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 doctor from the app root. Its default

migration-manifest and feature-dependencies checks report stale imports

and missing optional peers detected from local settings. Confirm remote

deployment settings separately because Doctor cannot inspect them.

What it does:

committed manifest names one release instead of re-resolving next install

  1. Pull upstream template changes (optional, separate from the bump)

agent-native upgrade moves 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.

```bash

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 app

```

sync defaults to the ref matching the installed @agent-native/core, so

run it after upgrade. It merges per file against a pristine baseline

stored in refs/agent-native/template-baseline/<app-path>; files upstream

did not touch are left alone, and real collisions get conflict markers.

After resolving markers, run agent-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 baseline before the first sync.

  1. If upgrade or typecheck fails

Intentional app-level UI customization is a separate workflow. Read

customizing-agent-native when the product needs to own a selectively

copied component; do not use that path to reproduce framework runtime

behavior or hide version skew.

  1. Dry-run / partial runs

```bash

agent-native upgrade --dry-run

agent-native upgrade --skip-verify

agent-native upgrade --skip-install # package.json bumps only

agent-native doctor --only migration-manifest

```

migration-manifest has no opt-out. Run it in CI before upgrading to find

imports that will break, then use npx @agent-native/core@latest upgrade --codemods

to preview the supported rewrite.

Don't

patchedDependencies for any @agent-native/* package

patches/, for any dependency

node_modules/@agent-native/dispatch

upgrade command does this for you)

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.