К основному содержанию
скилл CX Codex

update · assistant-ui — скилл для Claude Code: миграция assistant-ui и AI SDK

Обновляет существующее приложение на assistant-ui до актуальных версий AI SDK v7 и assistant-ui 0.15.x, применяя нужные миграции. Пригодится, когда после апдейта посыпались ошибки типов или пропали хуки.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add assistant-ui/skills --skill update -a claude-code
Открыть на GitHub

Что делает update

Скилл ведёт обновление в два прохода: сначала приводит AI SDK и его адаптер assistant-ui к совместимым версиям, потом обновляет сам assistant-ui и применяет миграции его API. Порядок важен, потому что прямой прыжок через несколько версий пересекает несколько окон депрекаций.

Внутри три справочника: миграция AI SDK с v4/v5 на v6 и v6 на v7, изменения assistant-ui от 0.8 до 0.15, и таблица быстрого поиска по версиям и симптомам. Для определения установленных версий скилл запускает npm ls и npm view, затем сравнивает версию @assistant-ui/react с порогами и выбирает нужный набор миграций.

CLI-команда npx assistant-ui@latest upgrade запускает шесть кодмодов в строго заданном порядке: edge-package-split, content-part-to-message-part, assistant-api-to-aui, event-names-to-camelcase, primitive-if-to-aui-if, aui-accessor-calls-to-properties. Сначала советуют прогнать с флагами -d -p, чтобы посмотреть дифф и список изменённых файлов.

Исторический кодмод v0-8/ui-package-split в текущий апгрейд добавлять нельзя: его целевая структура несовместима с нынешними рантаймами. Для нового проекта скилл отсылает к setup, а не к update.

Какие задачи решает

  • поднять проект с assistant-ui 0.8–0.14 на 0.15.x без ручного разбора депрекаций
  • мигрировать AI SDK v4/v5/v6 на ai@^7 и @ai-sdk/react@^4
  • починить ошибки типов после обновления пакетов
  • найти, какой кодмод запускать для конкретной версии
  • перенести импорты с @assistant-ui/react-ai-sdk на @assistant-ui/ai-sdk

Примеры запросов агенту

  • обнови assistant-ui в этом проекте до 0.15.x
  • после апдейта сломались хуки — разберись, какие миграции нужны
  • покажи, что изменит upgrade перед запуском

Как установить update

1Через Skills CLI (Vercel)

npx skills add assistant-ui/skills --skill update -a claude-code

2Вручную: положить файлы

~/.claude/skills/update/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/update/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора13

streaming Скилл по проводным протоколам и бэкенд-хелперам assistant-ui: помогает собрать свой стриминговый эндпоинт и разобрать формат чанков. CX Codex +1 6 400установок primitives Скилл помогает собирать кастомные интерфейсы чата на базе нестилизованных компонентов @assistant-ui/react. Пригодится при вёрстке тредов, композеров и списков сообщений. CX Codex +1 6 300установок tools Скилл про то, как объявлять инструменты, которые вызывает модель, и рисовать их вызовы в assistant-ui. Пригодится, когда инструмент не вызывается или его UI не отрисовывается. CX Codex +1 6 300установок thread-list Скилл для assistant-ui: добавляет боковую панель с несколькими диалогами, переключением, переименованием, архивацией и удалением. CX Codex +1 6 200установок cloud Подключает AssistantCloud к приложению на assistant-ui: история тредов между сессиями, обратная связь по сообщениям и загрузка файлов. CX Codex +1 5 000установок react-mcp Скилл для работы с @assistant-ui/react-mcp: подключает MCP-серверы, выбранные пользователем, прямо в браузере и регистрирует их инструменты в чате. CX Codex +1 4 000установок observability Подключает Langfuse, LangSmith или Helicone к бэкенд-роутам assistant-ui на AI SDK и рисует собранные спаны через экспериментальный @assistant-ui/react-o11y. CX Codex +1 4 000установок copilots Скилл для assistant-ui: учит агента читать состояние страницы, кликать по компонентам и менять их состояние через хуки React. CX Codex +1 3 900установок

Другие версии update

Похожие

chakra-ui-migrate chakra-ui Скилл ведёт миграцию проекта с Chakra UI v2 на v3 по шагам. Он помогает удалить старые пакеты, запустить официальный кодемод, обновить провайдер и переписать устаревшие пропсы. CX Codex +1 1 800установок ai-sdk vercel Скилл помогает писать код на базе Vercel AI SDK и не допускать устаревших API. Он проверяет локальную документацию пакета перед генерацией. CX Codex +1 66 100установок vercel-development Mindrally Набор правил для ИИ-агента: как писать код под Next.js App Router, React Server Components и Vercel AI SDK. Пригодится, когда агент лепит клиентские компоненты там, где хватило бы серверных. CX Codex +1 712установок json-render официальный Vercel Labs Помогает отображать части UIMessage, результаты вызова инструментов и статус стриминга в React-интерфейсах на AI SDK v6. CX Codex GP ChatGPT 4установок jscodeshift pproenca Набор правил для написания и отладки кодмодов на jscodeshift: разбор AST, миграции кода, авторефакторинг. CX Codex +1 410установок nextjs-migration-helper davila7 Слэш-команда для Claude, которая помогает переносить проект Next.js с Pages Router на App Router, с JavaScript на TypeScript и с классовых компонентов на хуки. 237установок

Рядом в теме «Настройка агента: память, контекст, субагенты»

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Вопросы о update

Как установить update в Claude Code?

Выполни npx skills add assistant-ui/skills --skill update -a claude-code. Скилл появится в ~/.claude/skills/update/SKILL.md.

Что делает скилл update?

Обновляет assistant-ui и AI SDK до актуальных линий (0.15.x и v7), подбирает миграции по установленной версии и запускает CLI-кодмоды в правильном порядке.

Чем update отличается от setup?

update рассчитан на существующий проект с уже установленным assistant-ui. Для первого запуска или нового проекта нужен скилл setup, а для написания рантайма без апгрейда — runtime.

Исходный текст

SKILL.md · MIT
---
name: update
description: "Upgrades an existing assistant-ui application and applies the migrations needed to reach the current AI SDK v7 and assistant-ui 0.15.x lines. Use when updating, bumping, or migrating @assistant-ui/react, @assistant-ui/ai-sdk, the older @assistant-ui/react-ai-sdk alias, ai, or @ai-sdk/react, or when an upgrade exposes removed hooks, scope accessor calls, provider configuration, registry paths, event names, legacy interactables, or tool registrations. Start here for an existing project, post-update type failures, package compatibility, CLI codemods, and version-specific migration order. For a first install or a new project use setup; for authoring a runtime without an upgrade use runtime."
license: MIT
---

# assistant-ui Update

**Always consult [assistant-ui.com/llms.txt](https://www.assistant-ui.com/llms.txt) for the latest API.**

Upgrade in two passes. First make the AI SDK and its assistant-ui adapter compatible, then update assistant-ui and apply its API migration. Read the relevant references before editing because a direct jump can cross several deprecation windows.

## References

- [./references/ai-sdk.md](./references/ai-sdk.md) -- AI SDK v4 and v5 to v6 migration, v6 to v7 changes, and adapter pins
- [./references/assistant-ui.md](./references/assistant-ui.md) -- assistant-ui 0.8 through 0.15, toolkits, LangGraph, and deprecation policy
- [./references/breaking-changes.md](./references/breaking-changes.md) -- quick version and symptom lookup

## Detect the installed lines

Run these commands from the application root. npm ls reports the installed dependency graph and npm view reports the published latest version.

```bash
npm ls @assistant-ui/react @assistant-ui/ai-sdk @assistant-ui/react-ai-sdk @assistant-ui/core @assistant-ui/store assistant-stream ai @ai-sdk/react

npm view @assistant-ui/react version
npm view @assistant-ui/ai-sdk version
npm view @assistant-ui/react-ai-sdk version
npm view @assistant-ui/core version
npm view @assistant-ui/store version
npm view assistant-stream version
npm view ai version
npm view @ai-sdk/react version
```

Current published lines as of September 2026:

| Package | Current line |
| --- | --- |
| assistant-ui | 0.0.x |
| @assistant-ui/react | 0.15.x |
| @assistant-ui/ai-sdk | 0.0.x |
| @assistant-ui/react-ai-sdk | 1.4.x |
| @assistant-ui/core | 0.3.x |
| @assistant-ui/store | 0.3.x |
| assistant-stream | 0.3.x |
| assistant-cloud | 0.1.x |
| ai | 7.x |

@assistant-ui/react-ai-sdk re-exports the same API for older installs. New code imports from @assistant-ui/ai-sdk.

## Choose the migration set

Compare the installed @assistant-ui/react version against every threshold below. Apply every applicable guide in ascending version order.

| Installed before | Check for |
| --- | --- |
| 0.8.x | The historical UI package split. The current upgrade bundle intentionally excludes v0-8/ui-package-split because its destination is incompatible with current runtimes. Move to the Elements registry manually. |
| 0.9.x | The v0-9/edge-package-split codemod. |
| 0.10.x | The bundled migration has no dedicated 0.10 codemod. Run the later codemods and resolve remaining package or build errors from the project’s current toolchain. |
| 0.11.x | ContentPart names and MessagePrimitive.Content become MessagePart and MessagePrimitive.Parts. |
| 0.12.x | Unified state API, hook aliases, and camelCase event names. |
| 0.13.x | Review the 0.14 guide before proceeding because it removes the v0.11 and v0.12 deprecations. |
| 0.14.x | Removed aliases and runtime APIs, plus primitive children render functions. |
| 0.15.x | Scope properties, removed legacy hooks, toolUIs, standalone-tool-call, AuiConfig, and threads.selectionChanged. |

## Migration order

1. Migrate the AI SDK first. Read [ai-sdk.md](./references/ai-sdk.md) when the project is on v4, v5, or v6. Target ai@^7 and @ai-sdk/react@^4 with @assistant-ui/ai-sdk.
2. Update assistant-ui next. Use the threshold table and [assistant-ui.md](./references/assistant-ui.md), starting with the oldest applicable version.
3. Verify only after the package and source migrations are both complete. Typecheck, build, and exercise chat, tool, approval, and thread-selection paths that the application uses.

## Run the CLI

```bash
# Update every installed @assistant-ui/* package.
npx assistant-ui@latest update

# Preview package changes without installing them.
npx assistant-ui@latest update --dry

# Preview the complete bundled migration and print each transformed file.
npx assistant-ui@latest upgrade -d -p

# Apply one codemod to a source directory.
npx assistant-ui@latest codemod v0-11/content-part-to-message-part ./src

# Report environment and dependency details.
npx assistant-ui@latest doctor
npx assistant-ui@latest info
```

The bundled upgrade command runs these codemods in this exact order:

1. v0-9/edge-package-split
2. v0-11/content-part-to-message-part
3. v0-12/assistant-api-to-aui
4. v0-12/event-names-to-camelcase
5. v0-12/primitive-if-to-aui-if
6. v0-15/aui-accessor-calls-to-properties

Use the dry and print form first. After reviewing the diff, run upgrade without -d and -p. Do not add the historical v0-8/ui-package-split codemod to a current upgrade.

## 0.15.x follow-ups

These changes shipped after 0.15.0 without another major. Sweep for them even if the project already declares 0.15.x.

### Move the AI SDK import

```tsx
// Before
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
```

```tsx
// After
import { useChatRuntime } from "@assistant-ui/ai-sdk";
```

### Replace client construction with configuration

useAui takes no configuration. Build a configuration with AuiConfig and give it to the provider. A nested AuiProvider must declare whether it extends the parent client or is isolated.

```tsx
// Before
const aui = useAui({ tools: Tools({ toolkit }) });
return <AuiProvider value={aui}>{children}</AuiProvider>;
```

```tsx
// After
const aui = useAui();
const config = AuiConfig({ tools: Tools({ toolkit }) });
return <AuiProvider extends={aui} config={config}>{children}</AuiProvider>;
```

At a runtime boundary, replace AssistantRuntimeProvider aui with config. For an isolated root, use AuiProvider extends={null} config={config}.

```tsx
// Before
return <AssistantRuntimeProvider runtime={runtime} aui={aui}>{children}</AssistantRuntimeProvider>;
```

```tsx
// After
const config = AuiConfig({ tools: Tools({ toolkit }) });
return <AssistantRuntimeProvider runtime={runtime} config={config}>{children}</AssistantRuntimeProvider>;
```

### Move copied registry components

Runtime-connected registry components live at components/assistant-ui/elements/<name>.aui.tsx and import as @/components/assistant-ui/elements/<name>.aui. Renderers and standalone Elements use components/assistant-ui/elements/<name>.tsx and omit .aui from their import. Replace retired @/components/assistant-ui/<name> imports during the same sweep.

### Consolidate thread selection events

```tsx
// Before
useAuiEvent("threadListItem.switchedTo", ({ threadId }) => select(threadId));
useAuiEvent("threadListItem.switchedAway", ({ threadId }) => clear(threadId));
```

```tsx
// After
useAuiEvent("threads.selectionChanged", ({ threadId, previousThreadId }) => {
  select(threadId);
  if (previousThreadId) clear(previousThreadId);
});
```

The new event is shared by the threads scope. A listener that previously lived inside a thread-list item can filter by its item id.

### Replace legacy interactables and tool registrations

useAssistantInteractable, Interactables(), and useInteractableState are deprecated since 2026-06-14 and scheduled for removal on or after 2026-09-14. Migrate to unstable_useInteractable, unstable_Interactables(), and unstable_interactableTool.

makeAssistantTool, useAssistantTool, makeAssistantToolUI, and useAssistantToolUI are deprecated. Put the model contract, executor, and renderer in a defineToolkit entry and register it with AuiConfig({ tools: Tools({ toolkit }) }). Read the toolkits section in [assistant-ui.md](./references/assistant-ui.md) before converting stateful or UI-only tools.

## Verify

```bash
npx tsc --noEmit
npm run build
npm test
```

Also open a real chat route and verify an ordinary message, a tool call, an approval gate if present, a thread switch, and the project’s persisted-history path. Run npx assistant-ui@latest doctor and npx assistant-ui@latest info when a dependency or environment mismatch remains.

## Common Gotchas

**The upgrade command changed imports but the app still uses the old adapter**

- The package update only covers @assistant-ui packages. Update ai and @ai-sdk/react separately, then follow the AI SDK reference.
- @assistant-ui/react-ai-sdk is an alias for older installs. Current source imports from @assistant-ui/ai-sdk.

**AuiProvider or AssistantRuntimeProvider no longer accepts the old props**

- useAui() is context access only. Build AuiConfig({...}) and pass it as config.
- A nested AuiProvider needs extends={aui}; an isolated one needs extends={null}.

**A scope lookup no longer behaves like a null check**

- aui.thread is always truthy. Check aui.thread.source != null before accessing an optional scope.
- Scope accessors are properties. Call scope methods, not the scope itself.

**The typecheck still finds removed hooks or tool maps**

- Apply the full removed-hook mapping in [assistant-ui.md](./references/assistant-ui.md).
- Replace s.tools.tools with s.tools.toolUIs and the mcp-app group key with standalone-tool-call.

## Related Skills

- [setup](../setup/SKILL.md) -- install assistant-ui into a project that has not used it before
- [runtime](../runtime/SKILL.md) -- build or customize an active runtime after the migration
- [tools](../tools/SKILL.md) -- author toolkits, frontend tools, approvals, and tool UI
- [elements](../elements/SKILL.md) -- install and customize the copied Elements registry components

© assistant-ui · MIT · assistant-ui/skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой