api-ai-vercel-ai-sdk
Vercel AI SDK patterns - providers, text generation, streaming, structured output, tool calling, chat UI hooks, embeddings, and RAG
npx skills add majiayu000/claude-skill-registry --skill api-ai-vercel-ai-sdk --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 Patterns > **Quick Guide:** Use Vercel AI SDK (v6) to build AI-powered applications with a unified provider API. Use `generateText`/`streamText` for text generation and streaming, `Output.object()`/`Output.array()` for structured data with Zod, `tool()` for function calling, and `useChat`/`useCompletion` hooks for React chat UIs. Supports OpenAI, Anthropic, Google, and 20+ providers through a single API. --- <critical_requirements> ## CRITICAL: Before Using This Skill > **All code must follow project conventions in CLAUDE.md** (kebab-case, named exports, import ordering, `import type`, named constants) **(You MUST use the `ai` package (v6) with `Output.object()` / `Output.array()` for structured output -- NOT the deprecated `generateObject` / `streamObject` functions)** **(You MUST define tool input schemas with `z.object()` and use `.describe()` on each property to help the model understand expected inputs)** **(You MUST use `streamText` for user-facing responses to enable progressive rendering -- use `generateText` only for background/non-interactive tasks)** **(You MUST handle streaming errors via `onError` callback -- streamText errors become part of the stream
- CRITICAL: Before Using This Skill
- Philosophy
- Core Patterns
- Pattern 1: Provider Setup
- Pattern 2: Text Generation with generateText
- Pattern 3: Streaming with streamText
- Pattern 4: Structured Output with Zod
- Pattern 5: Tool Calling
- Pattern 6: useChat Hook (React)
- Pattern 7: useCompletion Hook (React)
- Decision Framework
- Which Function to Use
- Which Provider to Choose
- Integration Guide
What does the api-ai-vercel-ai-sdk skill do?
Vercel AI SDK patterns - providers, text generation, streaming, structured output, tool calling, chat UI hooks, embeddings, and RAG
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-ai-vercel-ai-sdk --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.
