tanstack-ai-migration

tanstack-ai-migration is a skill for Claude Code from TanStack/ai. It costs 140 tokens per session (683 once invoked), scanned A, original, MIT.

A migration guide for moving an application between TanStack AI and the Vercel AI SDK or provider-specific AI libraries. It also covers upgrades from deprecated TanStack AI APIs.

In plain words
What is it for?
Use it to replace calls such as streamText or generateText, update provider adapters, move manual server-sent-event handling, or upgrade TanStack AI code.
Why use it?
It maps old calls and streaming code to the newer API instead of relying on incomplete memory of differences between libraries.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the tanstack-ai plugin — 47 skills shipped together

Good fit Use it to replace calls such as streamText or generateText, update provider adapters, move manual server-sent-event handling, or upgrade TanStack AI code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tanstack/ai/tanstack-ai-migration
About the project

TanStack AI is a TypeScript SDK for building applications that stream AI responses, call tools, run agents, produce structured output, and handle multimodal or realtime interactions. Developers use it across frameworks and AI providers through shared typed interfaces and provider adapters. The catalogue entries are add-ons for working with this SDK.

TanStack/ai · 3,210 stars · on GitHub · tanstack.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add TanStack/ai --skill tanstack-ai-migration
Clone the repo
git clone --depth 1 https://github.com/TanStack/ai

Made for: Claude Code.

Or install tanstack-ai, the plugin that ships this one along with the rest of its 47 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tanstack-ai-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/tanstack/ai/tanstack-ai-migration/github.svg)](https://agentmods.dev/skills/tanstack/ai/tanstack-ai-migration)
Your own site
<a href="https://agentmods.dev/skills/tanstack/ai/tanstack-ai-migration"><img src="https://agentmods.dev/badge/skills/tanstack/ai/tanstack-ai-migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tanstack-ai-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/tanstack/ai/tanstack-ai-migration"><img src="https://agentmods.dev/badge/skills/tanstack/ai/tanstack-ai-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 683 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00140 $0.00683
Opus 5.5 $0.00056 $0.00273
Sonnet 5.5 $0.00028 $0.00137
Haiku 4.5 $0.00014 $0.00068

Measured 1mo ago against content hash b73a1931b222, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tanstack-ai-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/tanstack-ai-migration/SKILL.md · 77 lines

How it starts

The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

Deprecated APIs keep working, so upgrade in steps rather than rewriting everything at once.

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.

Read the full file on GitHub · 77 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 77 lines · 140 tokens per session scan A b73a1931b222

Subscribe to this mod's changes

tanstack-ai-migration is a skill published in the GitHub repository TanStack/ai (3,210 stars, last pushed today), licensed MIT. It adds 140 tokens to every session and 683 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-09.