Get expert help using the Vercel AI SDK to build chatbots, AI agents, and RAG systems.

Install

mkdir -p .claude/skills/ai-sdk && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/533" && unzip -o skill.zip -d .claude/skills/ai-sdk && rm skill.zip

Installs to .claude/skills/ai-sdk

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
604 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Implement generateText and streamText flows
  • Configure AI SDK tool calling
  • Setup RAG system retrieval components
  • Integrate React hooks (useChat)

How it works

Searches internal documentation and verified SDK patterns to construct API-compliant code implementations.

Inputs & outputs

You give it
Natural language requirement or code snippet
You get back
AI SDK implementation code and configuration

When to use ai-sdk

  • Building AI-powered chatbots
  • Implementing RAG systems
  • Using generateText and streamText

About this skill

What the AI SDK Is

The AI SDK by Vercel (the ai package on npm) is a TypeScript toolkit for building AI applications. It provides a unified API across model providers for text generation, structured output, tool calling, agents, embeddings, and framework UI integrations.

Critical: Do Not Trust Your Own Memory

Whatever you remember about the AI SDK is likely outdated. The SDK changes frequently across versions - APIs are renamed, removed, and added. Your training data almost certainly contains obsolete APIs, deprecated patterns, and model IDs that no longer exist. UI hooks like useChat are among the most frequently changed APIs, so be especially careful with client code.

Never write AI SDK code from memory. Always verify every API, option, and pattern against the documentation and source code for the version that is actually installed in the project.

Use the Bundled, Version-Matched Docs

The ai package ships its full documentation and source code inside node_modules. These always match the installed version, so trust them over anything you remember.

  1. Ensure ai is installed. If node_modules/ai/ does not exist, install only the ai package using the project's package manager (e.g. pnpm add ai). Install provider packages (e.g. @ai-sdk/openai) and framework packages (e.g. @ai-sdk/react) later, when the task requires them.
  2. Read and grep the bundled docs at node_modules/ai/docs/ and the source at node_modules/ai/src/.
  3. Provider and framework packages bundle their own docs at node_modules/@ai-sdk/<name>/docs/.
  4. If something isn't in the bundled docs, search https://ai-sdk.dev/docs. You can append .md to any docs page URL to get its markdown, and search via https://ai-sdk.dev/api/search-docs?q=your_query.
  5. If you cannot find support for an answer in the docs or source, say so explicitly — do not guess.

AI Gateway: The Fastest Way to Start

The Vercel AI Gateway is the fastest way to get started with the AI SDK. It provides access to models from OpenAI, Anthropic, Google, and other providers through a single API, without installing provider packages or managing multiple API keys.

To set it up:

  1. Authenticate with OIDC (for Vercel deployments) or get an AI Gateway API key.
  2. Provide it to your app via the AI_GATEWAY_API_KEY environment variable.
  3. Reference models with provider/model strings.

For exact setup, authentication, and usage, read the bundled guide and the AI Gateway docs.

Choosing a Model

Never use model IDs from memory — models are released and retired frequently. Fetch the current list before writing code that references a model. Do not truncate the list (e.g. with head) so you can find the newest models:

# All available models
curl -s https://ai-gateway.vercel.sh/v1/models | jq -r '.data[].id'

# Filter by provider (e.g. anthropic, openai, google)
curl -s https://ai-gateway.vercel.sh/v1/models | jq -r '[.data[] | select(.id | startswith("anthropic/")) | .id] | reverse | .[]'

When multiple versions of a model exist, prefer the one with the highest version number.

Building and Consuming Agents

Use the SDK's built-in agent abstraction (such as ToolLoopAgent) rather than hand-rolling tool-calling loops. For end-to-end type safety, infer the UI message type from your agent definition when consuming it on the client (e.g. with useChat). Consuming an agent is framework-specific: check package.json to detect the stack, then follow the matching quickstart.

Look up the current agent, tool, and type-safety APIs in the bundled docs (node_modules/ai/docs/, especially the agents section) or at https://ai-sdk.dev/docs.

DevTools

AI SDK DevTools captures your AI SDK calls - requests, responses, tool calls, token usage, and multi-step runs - so you can inspect exactly what your agents do. Use it while developing to debug generations. It is a separate package and is intended for local development only.

For setup instructions, read the bundled DevTools documentation.

Keep the SDK Current

Outdated installs are the most common source of errors. Compare the installed version against the latest:

  • Installed: the version field in node_modules/ai/package.json.
  • Latest: run npm view ai version.

If the installed version is a major version (or more) behind the latest, tell the user they are on an old release, and recommend upgrading before continuing. Migration guides are at https://ai-sdk.dev/docs/migration-guides.

After Making Changes

Run the project's type checker. Be minimal — only set options that differ from the defaults, checking docs or source for the defaults rather than over-specifying. Most type errors come from remembered, now-changed APIs; re-check the current docs and source when they occur.

When not to use it

  • Projects not using the official Vercel AI SDK
  • Non-AI application development

Prerequisites

AI package installedPackage manager (pnpm/npm/yarn)

Limitations

  • Requires local documentation files for reliability
  • Does not support non-Vercel SDK patterns
  • Hooks API evolves rapidly

How it compares

It enforces strict source-of-truth usage by ignoring outdated internal training data and referencing current project docs.

Compared to similar skills

ai-sdk side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ai-sdk (this skill)112moReviewAdvanced
hr-portal-skill01moNo flagsBeginner
nextjs-developer3282moNo flagsAdvanced
landing-page-guide-v2488moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

turborepo

vercel

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

61191

web-design-guidelines

vercel

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

3290

update-docs

vercel

This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with code", "scaffold docs for this feature", "document this feature", "review docs completeness", "add docs for this change", "what documentation is affected", "docs impact", or mentions "docs/", "docs/01-app", "docs/02-pages", "MDX", "documentation update", "API reference", ".mdx files". Provides guided workflow for updating Next.js documentation based on code changes.

2543

streamdown

vercel

Implement, configure, and customize Streamdown — a streaming-optimized React Markdown renderer with syntax highlighting, Mermaid diagrams, math rendering, and CJK support. Use when working with Streamdown setup, configuration, plugins, styling, security, or integration with AI streaming (e.g., Vercel AI SDK). Triggers on: (1) Installing or setting up Streamdown, (2) Configuring plugins (code, mermaid, math, cjk), (3) Styling or theming Streamdown output, (4) Integrating with AI chat/streaming, (5) Configuring security, link safety, or custom HTML tags, (6) Using carets, static mode, or custom components, (7) Troubleshooting Tailwind, Shiki, or Vite issues.

1236

list-npm-package-content

vercel

List the contents of an npm package tarball before publishing. Use when the user wants to see what files are included in an npm bundle, verify package contents, or debug npm publish issues.

632

develop-ai-functions-example

vercel

Develop examples for AI SDK functions. Use when creating, running, or modifying examples under examples/ai-functions/src to validate provider support, demonstrate features, or create test fixtures.

536

You might also like

hr-portal-skill

hariventures2000-ship-it

Use this skill when developing, testing, debugging, or modifying code inside the HR Portal frontend (apps/hr-portal). It applies to handling HR administration tasks such as employee roster management, contract seeding, leave request approvals, attendance monitoring, payroll calculation, and recruitm

00

nextjs-developer

zenobi-us

Expert Next.js developer mastering Next.js 14+ with App Router and full-stack features. Specializes in server components, server actions, performance optimization, and production deployment with focus on building fast, SEO-friendly applications.

328531

landing-page-guide-v2

bear2u

Create distinctive, high-converting landing pages that combine proven conversion elements with exceptional design quality. Build beautiful, memorable landing pages using Next.js 14+ and ShadCN UI that avoid generic AI aesthetics while following the 11 essential elements framework.

48105

frontend-developer

sickn33

Build React components, implement responsive layouts, and handle client-side state management. Masters React 19, Next.js 15, and modern frontend architecture. Optimizes performance and ensures accessibility. Use PROACTIVELY when creating UI components or fixing frontend issues.

2782

nextjs-best-practices

davila7

Next.js App Router principles. Server Components, data fetching, routing patterns.

3164

frontend-code-review

langgenius

Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules.

1174

Search skills

Search the agent skills registry