vercel-ai-sdk-v5
Expert-level Vercel AI SDK v5 patterns for production chatbots. Use for: (1) Chat persistence with Drizzle/PostgreSQL, (2) Generative UI with typed tool parts, (3) Human-in-the-loop tool confirmations, (4) Custom data streaming with reconciliation, (5) Anthropic provider with extended thinking/reasoning, (6) Type-safe message metadata with token tracking. Covers advanced patterns only - assumes basic AI SDK knowledge. NOT for AI SDK v6.
npx skills add majiayu000/claude-skill-registry --skill vercel-ai-sdk-v5-horuz-ai-claude-plugins-3 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Vercel AI SDK v5 Production patterns for AI chatbots with persistence, generative UI, and streaming. ## Quick Reference | Need | Reference | |------|-----------| | Database schema & persistence | `references/persistence.md` | | Tools & generative UI | `references/tools-and-generative-ui.md` | | Custom data streaming | `references/streaming.md` | | Type definitions | `references/types.md` | | Anthropic + reasoning | `references/anthropic-config.md` | | Working examples | `cookbook/` directory | ## Core Architecture ### Message Flow ``` Client (useChat) → API Route (streamText) → DB (Drizzle) ↑ ↓ └── UIMessageStream ←┘ ``` ### Key Imports ```typescript // Core import { streamText, convertToModelMessages, UIMessage } from 'ai' import { createUIMessageStream, createUIMessageStreamResponse } from 'ai' // Client import { useChat } from '@ai-sdk/react' import { DefaultChatTransport } from 'ai' // Provider import { anthropic } from '@ai-sdk/anthropic' ``` ## Decision Tree ### Streaming Response Type - Simple text streaming → `streamText().toUIMessageStreamResponse()` - Need custom data parts → `createUIMessageStream()` + `writer.write()` - Need both → `createUIMessageStream()` + `writer.
- Quick Reference
- Core Architecture
- Message Flow
- Key Imports
- Decision Tree
- Streaming Response Type
- Tool Execution Location
- Data Attachment
- Naming Convention
- File Organization
- Essential Patterns
- 1. Send Only Last Message
- 2. Persist on Finish
- 3. Handle Disconnects
What does the vercel-ai-sdk-v5 skill do?
Expert-level Vercel AI SDK v5 patterns for production chatbots. Use for: (1) Chat persistence with Drizzle/PostgreSQL, (2) Generative UI with typed tool parts, (3) Human-in-the-loop tool confirmations, (4) Custom data streaming with reconciliation, (5) Anthropic provider with extended thinking/reasoning, (6) Type-safe message metadata with token tracking. Covers advanced patterns only - assumes basic AI SDK knowledge. NOT for AI SDK v6.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill vercel-ai-sdk-v5-horuz-ai-claude-plugins-3 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
