migrate-ai-sdk-v6-to-v7

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

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/MohamadJoumaa/Direct --skill migrate-ai-sdk-v6-to-v7-mohamadjoumaa
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/MohamadJoumaa/Direct/tree/main/.cursor/skills/migrate-ai-sdk-v6-to-v7
Command: npx skills add https://github.com/MohamadJoumaa/Direct --skill migrate-ai-sdk-v6-to-v7-mohamadjoumaa

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 checklist so every renamed symbol and semantic change is found and fixed. ## Core Features & Use Cases - Comprehensive rename mapping: Covers experimental API promotions (e.g. experimental_generateImage to generateImage), callback renames (onFinish to onEnd), and the system to instructions prompt migration. - Semantic change guidance: Explains behavior shifts such as all-steps result shapes, fullStream to stream, telemetry moving to @ai-sdk/otel, and tool context splitting into runtimeContext and toolsContext. - Package-specific checks: Handles MCP redirect defaults, Vue Chat deprecation, Anthropic cache token fields, and Google createGoogleGenerativeAI to createGoogle renames. - Use Case: A team upgrading a Next.js chat app to AI SDK 7.0 uses this Skill to find every v6 pattern in their codebase, apply the correct replacements, and validate with typecheck and streaming smoke tests. ## Quick Start Migrate my project from AI SDK v6 to v7 by scanning package.json and source files for v6 patterns and applying the required renames and behavior updates.

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, ensure Node.js 22 or later with ESM imports, then apply the breaking changes: rename system to instructions, fullStream to stream, and experimental callbacks to their stable names. Finish by running typecheck and targeted tests.

What replaced the system prompt parameter in AI SDK 7?

The top-level system parameter is renamed to instructions in generateText, streamText, generateObject, streamObject, and streamUI. System role messages inside prompt or messages arrays should move into instructions unless allowSystemInMessages is enabled for trusted persisted messages.

Does AI SDK 7 still support OpenTelemetry telemetry?

Yes, but OpenTelemetry moved out of the core ai package into @ai-sdk/otel. Install it and call registerTelemetry with an OpenTelemetry instance at startup; telemetry is enabled by default once registered, and experimental_telemetry becomes telemetry.

Why did result.totalUsage stop working after upgrading to AI SDK 7?

In v7, result.usage now aggregates all steps and totalUsage is deprecated. Use result.finalStep.usage for final-step-only token counts, and apply the same finalStep pattern for reasoning, request, response, and providerMetadata.

What are the limitations of an automated AI SDK v6 to v7 migration?

Renames are mechanical, but semantic changes need judgment: multi-step results now aggregate all steps, prepareStep instructions carry forward, and onChunk receives all stream part types. You must decide whether to keep final-step-only behavior via finalStep or adopt the new all-steps semantics.