Migrate applications from AI SDK 6.x to AI SDK 7.0. Use when upgrading Vercel AI SDK packages, fixing v7 migration errors, or when the user mentions AI SDK v6, v7, upgrade, migration, breaking changes, system to instructions, fullStream, telemetry, tool context, or finalStep.
Detected risks:
The ai-sdk skill answers questions about the AI SDK and helps build AI-powered features, covering functions such as generateText, streamText, ToolLoopAgent, embed, and tools. It is intended for developers building AI agents, chatbots, RAG systems, or text generation features, asking about providers like OpenAI, Anthropic, and Google, working with streaming, tool calling, structured output, or embeddings, or using React hooks like useChat and useCompletion. The information targets AI SDK 7, and the skill compares this against the version in node_modules/ai/package.json, warning the user if they do not match.
A central rule is to not trust internal knowledge, because training data may contain obsolete APIs and deprecated patterns. Instead the skill verifies against the installed package: it ensures the ai package is installed, searches node_modules/ai/docs/ and node_modules/ai/src/ for current APIs, and falls back to ai-sdk.dev documentation when needed, fetching .md URLs from the search endpoint for earlier versions. It calls out that useChat has changed significantly and that a common-errors reference should be checked before writing client code. Model IDs are always fetched fresh from the AI Gateway models endpoint rather than recalled from memory, preferring the highest version number, and the AI Gateway provider is used by default unless the user specifies otherwise.
For agents, the skill always uses the ToolLoopAgent pattern and consults the bundled docs for current creation APIs, with type safety provided by InferAgentUIMessage when consuming agents through useChat. Consuming agents is framework-specific: it detects the project's stack from package.json and follows that framework's quickstart for streaming, API routes, and client integration. Guidance emphasizes installing only the ai package initially and adding provider and client packages later as needed, being minimal by specifying only non-default options, and running a typecheck after changes. When a typecheck fails, it greps the common-errors reference for the failing property before searching source. Reference files cover common errors, AI Gateway setup, type-safe agents, and development-only DevTools.
It targets AI SDK 7 and compares that against the version in node_modules/ai/package.json, warning you if the versions do not match. Bundled docs and source are searched for versions [email protected] and newer.
Because training data may contain obsolete APIs, deprecated patterns, and incorrect usage, the skill verifies everything against node_modules/ai/docs/ and node_modules/ai/src/ or the ai-sdk.dev documentation rather than relying on memory, and states explicitly when it cannot find supporting documentation.
Model IDs are always fetched fresh from the AI Gateway models endpoint rather than used from memory, and the skill picks the model with the highest version number. By default it uses the Vercel AI Gateway provider unless you specify otherwise.
It installs only the ai package initially, checking whether node_modules/ai/docs/ exists first. Provider packages such as @ai-sdk/openai and client packages such as @ai-sdk/react are installed later, only when needed based on your requirements.
It always uses the ToolLoopAgent pattern and searches the bundled docs for current agent creation APIs. When consuming agents with useChat it uses InferAgentUIMessage<typeof agent> for type-safe tool results.
Quick Setup:
.claude/skills/Repository
vercel-labs/ai