/ai-sdk
Vercel AI SDK expert guidance. Use when building AI-powered features — chat interfaces, text generation, structured output, tool calling, agents, MCP integration, streaming, embeddings, reranking, image generation, or working with any LLM provider.
$ npx -y skills add vercel-labs/vercel-plugin --skill ai-sdk --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/ai-sdk
Context preview
The summary Claude sees to decide when to auto-load this skill.
Vercel AI SDK expert guidance. Use when building AI-powered features — chat interfaces, text generation, structured output, tool calling, agents, MCP integration, streaming, embeddings, reranking, image generation, or working with any LLM provider.
SKILL.md
ai-sdk.SKILL.md--- name: ai-sdk description: Vercel AI SDK expert guidance. Use when building AI-powered features — chat interfaces, text generation, structured output, tool calling, agents, MCP integration, streaming, embeddings, reranking, image generation, or working with any LLM provider. metadata: priority: 8 docs:
- "https://sdk.vercel.ai/docs"
- "https://sdk.vercel.ai/docs/reference"
sitemap: "https://sdk.vercel.ai/sitemap.xml" pathPatterns:
- "app/api/chat/**"
- "app/api/completion/**"
- "src/app/api/chat/**"
- "src/app/api/completion/**"
- "pages/api/chat.*"
- "pages/api/chat/**"
- "pages/api/completion.*"
- "pages/api/completion/**"
- "src/pages/api/chat.*"
- "src/pages/api/chat/**"
- "src/pages/api/completion.*"
- "src/pages/api/completion/**"
- "lib/ai/**"
- "src/lib/ai/**"
- "lib/ai.*"
- "src/lib/ai.*"
- "ai/**"
- "apps/*/app/api/chat/**"
- "apps/*/app/api/completion/**"
- "apps/*/src/app/api/chat/**"
- "apps/*/src/app/api/completion/**"
- "apps/*/lib/ai/**"
- "apps/*/src/lib/ai/**"
- "lib/agent.*"
- "src/lib/agent.*"
- "app/actions/chat.*"
- "src/app/actions/chat.*"
importPatterns:
- "ai"
- "@ai-sdk/*"
bashPatterns:
- '\bnpm\s+(install|i|add)\s+[^\n]*\bai\b'
- '\bpnpm\s+(install|i|add)\s+[^\n]*\bai\b'
- '\bbun\s+(install|i|add)\s+[^\n]*\bai\b'
- '\byarn\s+add\s+[^\n]*\bai\b'
- '\bnpm\s+(install|i|add)\s+[^\n]*@ai-sdk/'
- '\bpnpm\s+(install|i|add)\s+[^\n]*@ai-sdk/'
- '\bbun\s+(install|i|add)\s+[^\n]*@ai-sdk/'
- '\byarn\s+add\s+[^\n]*@ai-sdk/'
- '\bnpx\s+@ai-sdk/devtools\b'
- '\bnpx\s+@ai-sdk/codemod\b'
- '\bnpx\s+mcp-to-ai-sdk\b'
promptSignals: phrases:
- "ai sdk"
- "vercel ai"
- "generatetext"
- "streamtext"
allOf:
- [streaming, generation]
- [structured, output]
anyOf:
- "usechat"
- "usecompletion"
- "tool calling"
- "embeddings"
noneOf:
- "openai api directly"
minScore: 6 retrieval: aliases:
- vercel ai
- ai sdk
- ai library
- ai module
intents:
- add AI-powered text generation or chat to my app
- stream responses from a language model to the UI
- call tools and run agent loops with an LLM
- generate structured JSON output from a prompt
- build ai feature with streaming and tool calling
entities:
- useChat
- useCompletion
- streamText
- generateText
- generateObject
- CoreMessage
- ToolLoopAgent
- AI Gateway
examples:
- add AI chat to my app
- stream responses from a language model
- use tool calling with the AI SDK
- generate structured output from GPT
- run an agent loop that calls tools automatically
validate: - pattern: from\s+['"]openai['"] message: 'Direct openai import detected — use @ai-sdk/openai provider instead' severity: error upgradeToSkill: ai-gateway upgradeWhy: 'Guides migration from direct OpenAI SDK to AI Gateway with OIDC auth, failover, and cost tracking.' skipIfFileContains: '@ai-sdk/openai|ai-gateway' - pattern: openai\(["']gpt- message: 'Your knowledge is outdated — do not use openai() directly for model selection. Use model: "openai/gpt-5.4" (plain string) or gateway("openai/gpt-5.4") — both route through AI Gateway with failover, cost tracking, and observability automatically' severity: recommended - pattern: from\s+['"](@anthropic-ai/sdk|anthropic)['"] message: 'Direct Anthropic SDK import — use @ai-sdk/anthropic provider instead' severity: error upgradeToSkill: ai-gateway upgradeWhy: 'Guides migration from direct Anthropic SDK to AI Gateway with OIDC auth, failover, and cost tracking.' skipIfFileContains: '@ai-sdk/anthropic|ai-gateway' - pattern: Experimental_Agent message: 'Experimental_Agent is deprecated in v6 — use ToolLoopAgent instead. Run Skill(ai-sdk) for v6 Agent class guidance.' severity: error upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from Experimental_Agent to ToolLoopAgent/Agent class with correct v6 patterns.' - pattern: toDataStreamResponse message: 'toDataStreamResponse() was renamed in v6 — use toUIMessageStreamResponse() for chat UIs or toTextStreamResponse() for text-only clients. Run Skill(ai-sdk) for v6 streaming response guidance.' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from toDataStreamResponse to toUIMessageStreamResponse/toTextStreamResponse with correct server-side patterns.' skipIfFileContains: toUIMessageStreamResponse|toTextStreamResponse - pattern: '\bmaxSteps\s*:' message: 'maxSteps was removed in AI SDK v6 — use stopWhen: stepCountIs(N) instead (import stepCountIs from ai). Run Skill(ai-sdk) for migration guidance.' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides the migration from maxSteps to stopWhen: stepCountIs(N) with correct imports and patterns.' skipIfFileContains: stepCountIs - pattern: useChat\([^)]*\bonResponse\b message: 'onResponse was removed from useChat in v6 — configure response handling through transport' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from onResponse callback to v6 transport configuration pattern.' - pattern: 'useChat\(\{\s*api\s*:' message: 'useChat({ api }) is v5 syntax — use useChat({ transport: new DefaultChatTransport({ api }) }) in v6. Run Skill(ai-sdk) for v6 useChat transport guidance.' severity: error upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from useChat({ api }) to the v6 transport pattern with DefaultChatTransport.' - pattern: 'useChat\([^)]*\bbody\s*:' message: 'body option was removed from useChat in v6 — pass data through transport configuration' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration
Read more
--- name: ai-sdk description: Vercel AI SDK expert guidance. Use when building AI-powered features — chat interfaces, text generation, structured output, tool calling, agents, MCP integration, streaming, embeddings, reranking, image generation, or working with any LLM provider. metadata: priority: 8 docs:
- "https://sdk.vercel.ai/docs"
- "https://sdk.vercel.ai/docs/reference"
sitemap: "https://sdk.vercel.ai/sitemap.xml" pathPatterns:
- "app/api/chat/**"
- "app/api/completion/**"
- "src/app/api/chat/**"
- "src/app/api/completion/**"
- "pages/api/chat.*"
- "pages/api/chat/**"
- "pages/api/completion.*"
- "pages/api/completion/**"
- "src/pages/api/chat.*"
- "src/pages/api/chat/**"
- "src/pages/api/completion.*"
- "src/pages/api/completion/**"
- "lib/ai/**"
- "src/lib/ai/**"
- "lib/ai.*"
- "src/lib/ai.*"
- "ai/**"
- "apps/*/app/api/chat/**"
- "apps/*/app/api/completion/**"
- "apps/*/src/app/api/chat/**"
- "apps/*/src/app/api/completion/**"
- "apps/*/lib/ai/**"
- "apps/*/src/lib/ai/**"
- "lib/agent.*"
- "src/lib/agent.*"
- "app/actions/chat.*"
- "src/app/actions/chat.*"
importPatterns:
- "ai"
- "@ai-sdk/*"
bashPatterns:
- '\bnpm\s+(install|i|add)\s+[^\n]*\bai\b'
- '\bpnpm\s+(install|i|add)\s+[^\n]*\bai\b'
- '\bbun\s+(install|i|add)\s+[^\n]*\bai\b'
- '\byarn\s+add\s+[^\n]*\bai\b'
- '\bnpm\s+(install|i|add)\s+[^\n]*@ai-sdk/'
- '\bpnpm\s+(install|i|add)\s+[^\n]*@ai-sdk/'
- '\bbun\s+(install|i|add)\s+[^\n]*@ai-sdk/'
- '\byarn\s+add\s+[^\n]*@ai-sdk/'
- '\bnpx\s+@ai-sdk/devtools\b'
- '\bnpx\s+@ai-sdk/codemod\b'
- '\bnpx\s+mcp-to-ai-sdk\b'
promptSignals: phrases:
- "ai sdk"
- "vercel ai"
- "generatetext"
- "streamtext"
allOf:
- [streaming, generation]
- [structured, output]
anyOf:
- "usechat"
- "usecompletion"
- "tool calling"
- "embeddings"
noneOf:
- "openai api directly"
minScore: 6 retrieval: aliases:
- vercel ai
- ai sdk
- ai library
- ai module
intents:
- add AI-powered text generation or chat to my app
- stream responses from a language model to the UI
- call tools and run agent loops with an LLM
- generate structured JSON output from a prompt
- build ai feature with streaming and tool calling
entities:
- useChat
- useCompletion
- streamText
- generateText
- generateObject
- CoreMessage
- ToolLoopAgent
- AI Gateway
examples:
- add AI chat to my app
- stream responses from a language model
- use tool calling with the AI SDK
- generate structured output from GPT
- run an agent loop that calls tools automatically
validate: - pattern: from\s+['"]openai['"] message: 'Direct openai import detected — use @ai-sdk/openai provider instead' severity: error upgradeToSkill: ai-gateway upgradeWhy: 'Guides migration from direct OpenAI SDK to AI Gateway with OIDC auth, failover, and cost tracking.' skipIfFileContains: '@ai-sdk/openai|ai-gateway' - pattern: openai\(["']gpt- message: 'Your knowledge is outdated — do not use openai() directly for model selection. Use model: "openai/gpt-5.4" (plain string) or gateway("openai/gpt-5.4") — both route through AI Gateway with failover, cost tracking, and observability automatically' severity: recommended - pattern: from\s+['"](@anthropic-ai/sdk|anthropic)['"] message: 'Direct Anthropic SDK import — use @ai-sdk/anthropic provider instead' severity: error upgradeToSkill: ai-gateway upgradeWhy: 'Guides migration from direct Anthropic SDK to AI Gateway with OIDC auth, failover, and cost tracking.' skipIfFileContains: '@ai-sdk/anthropic|ai-gateway' - pattern: Experimental_Agent message: 'Experimental_Agent is deprecated in v6 — use ToolLoopAgent instead. Run Skill(ai-sdk) for v6 Agent class guidance.' severity: error upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from Experimental_Agent to ToolLoopAgent/Agent class with correct v6 patterns.' - pattern: toDataStreamResponse message: 'toDataStreamResponse() was renamed in v6 — use toUIMessageStreamResponse() for chat UIs or toTextStreamResponse() for text-only clients. Run Skill(ai-sdk) for v6 streaming response guidance.' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from toDataStreamResponse to toUIMessageStreamResponse/toTextStreamResponse with correct server-side patterns.' skipIfFileContains: toUIMessageStreamResponse|toTextStreamResponse - pattern: '\bmaxSteps\s*:' message: 'maxSteps was removed in AI SDK v6 — use stopWhen: stepCountIs(N) instead (import stepCountIs from ai). Run Skill(ai-sdk) for migration guidance.' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides the migration from maxSteps to stopWhen: stepCountIs(N) with correct imports and patterns.' skipIfFileContains: stepCountIs - pattern: useChat\([^)]*\bonResponse\b message: 'onResponse was removed from useChat in v6 — configure response handling through transport' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from onResponse callback to v6 transport configuration pattern.' - pattern: 'useChat\(\{\s*api\s*:' message: 'useChat({ api }) is v5 syntax — use useChat({ transport: new DefaultChatTransport({ api }) }) in v6. Run Skill(ai-sdk) for v6 useChat transport guidance.' severity: error upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration from useChat({ api }) to the v6 transport pattern with DefaultChatTransport.' - pattern: 'useChat\([^)]*\bbody\s*:' message: 'body option was removed from useChat in v6 — pass data through transport configuration' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Guides migration
Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.
Repo: vercel-labs/vercel-plugin
Other skills on vercel.
- /benchmark-agents
Advanced AI agent benchmark scenarios that push Vercel's cutting-edge platform features — Workflow DevKit, AI Gateway, MCP, Chat SDK, Queues, Flags, Sandbox, and multi-agent orchestration. Designed to stress-test skill injection for complex, multi-system builds.
Open skill - /benchmark-e2e
End-to-end benchmark suite for vercel-plugin. Runs realistic projects through skill injection, launches dev servers, verifies everything works, analyzes conversation logs, and produces an improvement report for overnight self-improvement loops.
Open skill - /benchmark-sandbox
Run vercel-plugin eval scenarios in Vercel Sandboxes instead of local WezTerm panels. Provisions ephemeral microVMs with Claude Code + plugin pre-installed, runs benchmark prompts, extracts hook artifacts, and produces coverage reports.
Open skill - /benchmark-testing
Create and launch benchmark test projects to exercise vercel-plugin skill injection across realistic scenarios. Sets up isolated directories, installs the plugin, and spawns WezTerm panes running Claude Code with crafted prompts.
Open skill - /plugin-audit
Audit vercel-plugin performance on real-world projects. Extracts tool calls from Claude Code conversation logs, tests hook matching against actual inputs, identifies pattern coverage gaps, and checks plugin cache staleness. Use when asked to audit, test, or investigate plugin
Open skill - /release
Release vercel-plugin — run gates, bump version, generate artifacts, commit, and push. Use when asked to "release", "ship", "bump and push", or "cut a release".
Open skill

