/tanstack-ai:tanstack-ai-migrationfrom tanstack-ai
Migrates apps to TanStack AI from Vercel AI SDK or raw provider SDKs, or upgrades from TanStack AI 0.x to 1.0. Handles API mapping, adapter changes, and breaking changes.
Ships in tanstack-ai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Two different jobs. Pick the one that matches the code in front of you.
The name-by-name mapping lives in the docs, and it is longer than any summary that fits here:
https://tanstack.com/ai/latest/docs/migration/migration-from-vercel-ai
The shape of the change:
streamText and generateText become one chat() call with a streaming
option.createOpenAI(...) becomes a tree-shakeable adapter, such as openaiText()
from @tanstack/ai-openai.onFinish and friends become middleware hooks.generateObject becomes structured outputs on chat().Read the guide, then load the target API's own skill with
npx @tanstack/intent@latest load @tanstack/ai#ai-core. Do not port from memory: a half-remembered mapping produces
code that type-checks in neither SDK.
To port one side at a time, @tanstack/ai-vercel-compat connects the two
SDKs over the AI SDK UI message stream. It is a stop gap while porting, not a
place to stay: finish the port of the other side, then remove it.
useChat and serve it from chat() with
chat({ adapter, ...(await chatParamsFromAISDKRequest(request)) }) and
toUIMessageStreamResponse.
https://tanstack.com/ai/latest/docs/migration/ai-sdk-client-tanstack-serverchat() with
toServerSentEventsResponse and pass
toChatTransport(fetchServerSentEvents('/api/chat')) as the AI SDK
useChat transport. The conversion runs in the browser.streamText route and pass
fromChatTransport(new DefaultChatTransport({ api }))
as the connection of TanStack useChat. On the route,
clientToolsFromAISDKBody(body, serverTools) reads the client's tools, so
they need no copy there.
https://tanstack.com/ai/latest/docs/migration/tanstack-client-ai-sdk-serverTool approvals, client tools, activity and stream resume cross the bridge. Subagents and shared state go from a TanStack server to an AI SDK client only.
Start with the version the app has, and the current release:
node -p "require('@tanstack/ai/package.json').version"
npm view @tanstack/ai version
Then read the guides for what changed:
1.0 removes every API that 0.x marked as deprecated. Each one has a
replacement that already shipped in 0.x, so you can move to the replacements
on 0.x first, then bump every @tanstack/ai* package to 1.0 together.
Some renames have a jscodeshift transform. Run it straight from the repo, and
preview first with --dry --print:
npx jscodeshift \
-t https://raw.githubusercontent.com/TanStack/ai/main/codemods/ag-ui-compliance/transform.ts \
--dry --print src/
Each guide names the codemod that covers it, and what the codemod cannot reach. Server-side rewrites are usually manual.
Run the project's type checker. Most errors after a migration come from an API
that was remembered rather than read, so check the failing name against
node_modules/@tanstack/ai/src/ before changing it again.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tanstack-ai, ai-sdk-migration, vercel-ai-sdk, upgrade, codemod
npx claudepluginhub tanstack/ai --plugin tanstack-ai2 skills in this plugin
Other plugins' skills for the same job