vercel-ai-sdk
Guide for Vercel AI SDK v5 implementation patterns including generateText, streamText, useChat hook, tool calling, embeddings, and MCP integration. Use when…

Установить vercel-ai-sdk в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Vercel AI SDK v5 Implementation Guide
When to Use This Skill
Use this skill when:
- Implementing AI chat interfaces with
useChathook - Creating API routes that generate or stream AI responses
- Adding tool calling / function calling capabilities
- Generating text embeddings for semantic search or RAG
- Migrating from AI SDK v4 to v5
- Integrating Model Context Protocol (MCP) servers
- Working with streaming responses or message persistence
Structured Implementation Workflow
Understand the task requirements - Identify what AI functionality is needed (chat, generation, tools, embeddings) - Determine if client-side (useChat) or server-side (API route) implementation - Check if streaming or non-streaming response is required - Verify model provider (OpenAI, Anthropic, etc.) Verify current API patterns if uncertain - Use WebFetch to check https://ai-sdk.dev/docs/ if API patterns are unclear - Confirm model specification format for the provider - Verify function signatures for complex features Implement using correct v5 patterns - Use string-based model specification ('provider/model-id') - For chat: use sendMessage (not append), parts-based messages - For tools: MUST import and use tool() helper from 'ai', MUST use inputSchema (NOT parameters), MUST use zod - For streaming: use toUIMessageStreamResponse() or toTextStreamResponse() - For embeddings: use provider.textEmbeddingModel() Ensure TypeScript types are correct - Check for proper imports from 'ai' package - Verify message types (UIMessage for useChat) - Ensure tool parameter types are inferred correctly - Add explicit types for async functions Install any missing dependencies with the CORRECT package manager - **CRITICAL: Detect which package manager the project uses FIRST** * Check for lockfiles: pnpm-lock.yaml → use pnpm, package-lock.json → use npm, yarn.lock → use yarn, bun.lockb → use bun * If pnpm-lock.yaml exists, you MUST use pnpm (NOT npm!) - Check if all imported packages are installed - If build fails with "Module not found", identify the package name from the error - Add the package to package.json dependencies - Install using the CORRECT package manager: * If pnpm-lock.yaml exists: `pnpm install [package]` or `pnpm add [package]` * If package-lock.json exists: `npm install [package]` * If yarn.lock exists: `yarn add [package]` * If bun.lockb exists: `bun install [package]` or `bun add [package]` - Re-run build to verify installation succeeded **NEVER use the wrong package manager!** - Using npm when the project uses pnpm creates package-lock.json alongside pnpm-lock.yaml - This causes dependency version mismatches and breaks the build - ALWAYS check for existing lockfiles and use the matching package manager NEVER accept "Module not found" errors as environment issues
YOU must install the required packages with the CORRECT package manager
Common packages needed:
- ai (core AI SDK)
- @ai-sdk/openai (OpenAI provider)
- @ai-sdk/anthropic (Anthropic provider)
- @modelcontextprotocol/sdk (MCP integration)
- zod (for tool schemas)
</critical>
Run build and fix ALL errors until it passes
- Run: npm run build (or bun run build)
- If build fails, read the FULL error message carefully
- Common fixes:
* "Module not found" → Install the package (go back to step 5)
* Type errors → Fix TypeScript types
* Config errors → Check next.config.js/ts
* Framework errors → Research the error, try different approaches
- Apply fix and re-run build
- REPEAT until build passes
NEVER stop at "build fails but code is correct"
NEVER blame "environment" or "framework bugs" without debugging
KEEP ITERATING until the build PASSES
If you encounter a framework error, research it, try workarounds, debug it
DO NOT give up until you have a passing build
Run tests and debug ALL failures until they pass
- Run: npm run test (or bun runРазрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Read - 02
Write - 03
Edit - 04
Glob - 05
Grep - 06
Bash - 07
WebFetch
FAQ
Что делает скилл vercel-ai-sdk?
Guide for Vercel AI SDK v5 implementation patterns including generateText, streamText, useChat hook, tool calling, embeddings, and MCP integration. Use when implementing AI chat interfaces, streaming responses, tool/function calling, text embeddings, or working with convertToModelMessages and toUIMessageStreamResponse. Activates for AI SDK integration, useChat hook usage, message streaming, or tool calling tasks.
Как установить скилл vercel-ai-sdk?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vercel-ai-sdk запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
