Agent skill · software engineering · wsimmonds

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.

Why this skill is useful

Provides specific implementation patterns and critical integration steps for Vercel AI SDK v5 that the AI wouldn't reliably generate on its own.

What it needs

Requires bun, npm, pnpm, yarn installed locally. About 11k tokens when loaded. Last updated 2025-10-24. 109 stars on the source repository.

What this skill does

Vercel AI SDK v5 Implementation Guide When to Use This Skill Use this skill when: Implementing AI chat interfaces with useChat hook 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 <workflow> <step id="1" name="verify-requirements"> <description>Understand the task requirements</description> <actions> 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.) </actions> </step> <step id="2" name="check-documentation"> <description>Verify current API patterns if uncertain</description> <actions> 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 </actions> </step> <step id="3" name="implement"> <description>Implement using correct v5 patterns</description> <actions> 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() </actions> </step> <step id="4" name="verify-types"> <description>Ensure TypeScript types are correct</description> <actions> 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 </actions> </step> <step id="5" name="install-dependencies"> …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills wsimmonds/vercel-ai-sdk

View the source on GitHub

Browse the @skills marketplace