Agent Skills › TanStack/ai › tanstack-ai-migration

tanstack-ai-migration

GitHub

指导将应用从 Vercel AI SDK 迁移至 TanStack AI,或从 0.x 版本升级至 1.0。提供 API 映射、Codemod 使用及版本检查指南,解决重构与兼容性问题。

skills/tanstack-ai-migration/SKILL.md TanStack/ai

Trigger Scenarios

migrate switch from Vercel AI SDK ai-sdk streamText upgrade TanStack AI deprecated breaking change codemod

Install

npx skills add TanStack/ai --skill tanstack-ai-migration -g -y
More Options

Use without installing

npx skills use TanStack/ai@tanstack-ai-migration

指定 Agent (Claude Code)

npx skills add TanStack/ai --skill tanstack-ai-migration -a claude-code -g -y

安装 repo 全部 skill

npx skills add TanStack/ai --all -g -y

预览 repo 内 skill

npx skills add TanStack/ai --list

SKILL.md

Frontmatter
{
    "name": "tanstack-ai-migration",
    "description": "Move an app to TanStack AI from the Vercel AI SDK or raw provider SDKs, or upgrade it from TanStack AI 0.x to 1.0. Use when someone asks whether to switch AI libraries, when code mixes streamText, generateText, generateObject, createOpenAI, or @ai-sdk\/* with TanStack AI, when an upgrade breaks, or when someone hits a renamed option, a deprecated -ui package, or an old adapter shape. Triggers on \"migrate\", \"switch from Vercel AI SDK\", \"ai-sdk\", \"streamText\", \"upgrade TanStack AI\", \"deprecated\", \"breaking change\", \"codemod\"."
}

Migrating to TanStack AI

Two different jobs. Pick the one that matches the code in front of you.

Coming from another SDK

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.
  • Manual SSE wiring becomes the built-in response helpers.
  • 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.

Upgrading TanStack AI itself

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.

Codemods

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.

After the port

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.

Version History

  • 3ce3085 Current 2026-11-02 13:14

    发布 1.0.0 版本,移除所有已弃用的 API 和 UI 包;修复 1.0 客户端 forwardedProps 读取逻辑及工具输出 Schema 匹配问题。

  • 645757a 2026-09-22 03:44

Same Skill Collection

.agents/skills/add-example-tutorial/SKILL.md
.agents/skills/docs/SKILL.md
.agents/skills/gap-analysis/SKILL.md
.agents/skills/i-have-adhd/SKILL.md
.agents/skills/pr-description/SKILL.md
.claude/skills/add-example-tutorial/SKILL.md
.claude/skills/docs/SKILL.md
.claude/skills/gap-analysis/SKILL.md
.claude/skills/i-have-adhd/SKILL.md
.claude/skills/pr-description/SKILL.md
.grok/skills/add-example-tutorial/SKILL.md
.grok/skills/docs/SKILL.md
.grok/skills/gap-analysis/SKILL.md
.grok/skills/i-have-adhd/SKILL.md
.grok/skills/pr-description/SKILL.md
examples/ts-remix-chat/.agents/skills/remix/SKILL.md
packages/ai-code-mode/skills/ai-code-mode/SKILL.md
packages/ai-mcp/skills/ai-mcp/SKILL.md
packages/ai-memory/skills/tanstack-ai-memory-hindsight/SKILL.md
packages/ai-memory/skills/tanstack-ai-memory-honcho/SKILL.md
packages/ai-memory/skills/tanstack-ai-memory-in-memory/SKILL.md
packages/ai-memory/skills/tanstack-ai-memory-mem0/SKILL.md
packages/ai-memory/skills/tanstack-ai-memory-redis/SKILL.md
packages/ai-memory/skills/tanstack-ai-memory/SKILL.md
packages/ai-persistence/skills/ai-persistence/build-cloudflare-adapter/SKILL.md
packages/ai-persistence/skills/ai-persistence/build-cloudflare-artifact-store/SKILL.md
packages/ai-persistence/skills/ai-persistence/build-custom-adapter/SKILL.md
packages/ai-persistence/skills/ai-persistence/build-drizzle-adapter/SKILL.md
packages/ai-persistence/skills/ai-persistence/build-prisma-adapter/SKILL.md
packages/ai-persistence/skills/ai-persistence/server/SKILL.md
packages/ai-persistence/skills/ai-persistence/SKILL.md
packages/ai-persistence/skills/ai-persistence/stores/SKILL.md
packages/ai/skills/ai-core/ag-ui-protocol/SKILL.md
packages/ai/skills/ai-core/chat-experience/SKILL.md
packages/ai/skills/ai-core/custom-backend-integration/SKILL.md
packages/ai/skills/ai-core/debug-logging/SKILL.md
packages/ai/skills/ai-core/locks/SKILL.md
packages/ai/skills/ai-core/middleware/SKILL.md
packages/ai/skills/ai-core/tool-calling/SKILL.md
testing/panel/skills/emoji-storyteller/SKILL.md
testing/panel/skills/haiku/SKILL.md
testing/panel/skills/pirate-speak/SKILL.md
.agents/skills/bugfix-pr/SKILL.md
.agents/skills/ponytail/SKILL.md
.agents/skills/pr-sweep/SKILL.md
.agents/skills/simple-english/SKILL.md
.agents/skills/triage-github/SKILL.md
.claude/skills/bugfix-pr/SKILL.md
.claude/skills/ponytail/SKILL.md
.claude/skills/pr-sweep/SKILL.md

Metadata

Files
0
Version
3ce3085
Hash
5676bc80
Indexed
2026-09-22 03:44

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-02 17:39
浙ICP备14020137号-1