vercel avatar

Migrate Ai Sdk V6 To V7

vercel/aiOfficial

This walks you through the full AI SDK v6 to v7 upgrade, handling all the breaking changes in one pass. It renames experimental APIs to stable (generateImage, streamText patterns), migrates the system/instructions terminology shift, fixes the new multi-step result shape where usage and content now include all steps instead of just the final one, and updates streaming helpers that moved from result methods to standalone functions. It also covers the OpenTelemetry extraction into a separate package, tool context refactoring, and ESM-only module requirements. The checklist is methodical but dense, so expect to lean on the official migration guide for edge cases. Most useful when you're staring at a wall of type errors after bumping versions.

skills.sh installs
5.8K
GitHub stars
27.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add vercel/ai --skill migrate-ai-sdk-v6-to-v7 --agent claude-code

Installs into .claude/skills of the current project.

Files

AI SDK 6 to 7 Migration

Use content/docs/08-migration-guides/23-migration-guide-7-0.mdx from the AI SDK repo as the source of truth. This skill is the working checklist; read the guide for exact examples or when behavior is unclear.

Migration Workflow

  1. Ensure the user has a clean backup or committed baseline before editing.
  2. Inspect package.json and lockfiles to identify installed ai, @ai-sdk/*, provider, UI, MCP, and telemetry packages.
  3. Upgrade AI SDK packages to latest versions, and add @ai-sdk/otel only if the project uses OpenTelemetry spans.
  4. Update runtime and module assumptions: Node.js must be >=22, and AI SDK packages are ESM-only. Replace require() imports with ESM imports and add "type": "module" or use .mjs where needed.
  5. Search for the v6 patterns below, migrate only the code that exists, then run typecheck and targeted tests.

Prefer behavior-preserving changes. When v7 changes semantics, decide whether the app wants the new all-steps behavior or the previous final-step-only behavior.

Core API Changes

Sponsors

Details

Repository
github.com/vercel/ai
Categories
AI & Agent Building, Cloud & Infrastructure
First seen
Jul 14, 2026

More from vercel/ai

All 8
1affaan-m avataragent-introspection-debuggingaffaan-m/eccStructured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.5.7Kskills.sh installs
2affaan-m avatarai-regression-testingaffaan-m/eccRegression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns t5.7Kskills.sh installs
3affaan-m avatarmcp-server-patternsaffaan-m/eccBuild MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest A5.6Kskills.sh installs
4affaan-m avatarai-first-engineeringaffaan-m/eccEngineering operating model for teams where AI agents generate a large share of implementation output.5.5Kskills.sh installs
5affaan-m avatarcontinuous-agent-loopaffaan-m/eccPatterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.5.5Kskills.sh installs
6affaan-m avataragent-sortaffaan-m/eccBuild an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel5.5Kskills.sh installs