migrate-ai-sdk-v6-to-v7

Migrates applications from Vercel AI SDK 6.x to AI SDK 7.0 using a structured checklist.

Updated Dec 17, 2022
One-click install
npx skills add https://github.com/Foodshareclub/foodshare-web --skill migrate-ai-sdk-v6-to-v7-foodshareclub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-ai-sdk-v6-to-v7
Source: https://github.com/Foodshareclub/foodshare-web/tree/main/.agents/skills/migrate-ai-sdk-v6-to-v7
Command: npx skills add https://github.com/Foodshareclub/foodshare-web --skill migrate-ai-sdk-v6-to-v7-foodshareclub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Upgrading from Vercel AI SDK 6.x to 7.0 involves dozens of breaking changes across APIs, streaming, telemetry, and tool execution, and missing any one of them causes type errors or silent behavior changes. This Skill provides a systematic migration workflow so nothing is overlooked. ## Core Features & Use Cases - Comprehensive Rename Mapping: Covers all renamed APIs such as system to instructions, fullStream to stream, onFinish to onEnd, and stepCountIs to isStepCount. - Behavioral Change Guidance: Explains semantic shifts like all-steps result shapes, prepareStep carry-forward, and telemetry moving to @ai-sdk/otel, so you can choose between new and legacy behavior. - Package-Specific Checks: Handles MCP redirect defaults, Vue Chat deprecation, Anthropic cache token changes, and Google provider renames. - Use Case: Your Next.js app uses streamText with tools and OpenTelemetry. Run this Skill to update every call site, migrate telemetry registration, fix streaming helpers, and validate with typecheck and tests. ## Quick Start Migrate my project from AI SDK v6 to v7 and fix all breaking changes in my chat and streaming code.

Frequently Asked Questions about migrate-ai-sdk-v6-to-v7

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from AI SDK v6 to v7?

Upgrade all ai and @ai-sdk packages, then apply the breaking changes: rename system to instructions, fullStream to stream, onFinish to onEnd, and move telemetry to @ai-sdk/otel. Finish by running typecheck and targeted tests on streaming, tools, and multi-step flows.

What breaking changes are in Vercel AI SDK 7.0?

Key changes include system renamed to instructions, result helpers replaced by stateless functions like toUIMessageStream, top-level result fields now aggregating all steps, and OpenTelemetry moved into the separate @ai-sdk/otel package. Node.js 22 and ESM-only modules are also required.

Does AI SDK v7 require Node.js 22?

Yes, AI SDK 7.0 requires Node.js version 22 or higher. The packages are also ESM-only, so CommonJS require() calls must be replaced with ESM imports or the project must set type to module.

Why is my telemetry not working after upgrading to AI SDK v7?

OpenTelemetry support moved out of the core ai package in v7. Install @ai-sdk/otel and call registerTelemetry with an OpenTelemetry instance at app startup, moving any tracer configuration into the OpenTelemetry constructor.

How do I replace streamText result helper methods in v7?

Result methods like toUIMessageStreamResponse are deprecated in favor of top-level stateless helpers. Call toUIMessageStream with the result stream, then pass it to createUIMessageStreamResponse or pipeUIMessageStreamToResponse.