# Build AI SDK Features with Current Docs

AI SDK APIs change quickly, which can make generated code outdated. This skill guides Claude, Codex, and Claude Code to current docs and migration patterns.

## Install

```bash
npx skillstore add vercel/ai-sdk
```

## Metadata

- Status: approved
- Slug: vercel-ai-sdk
- Skillstore revision: r1
- Version status: missing
- Tree hash: a36ea96ac327807a2f565f28ded9bf70674fa1a2804cebfcb64937b71bbf66c9
- Author: vercel
- GitHub username: vercel
- License: MIT
- Repository: https://github.com/vercel/ai/tree/main/skills/use-ai-sdk/
- Ref: 0519034dad657fb1f7706e0550e962beeda73fdf
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: network, env\_access, external\_commands, filesystem
- Quality score: 76
- Public page: https://skillstore.pages.dev/skills/vercel-ai-sdk
- Manifest: https://skillstore.pages.dev/api/skills/vercel-ai-sdk/manifest

## Capabilities

- Directs agents to verify AI SDK APIs in local docs and source files.
- Guides work with generateText, streamText, useChat, tools, embeddings, and structured output.
- Documents common AI SDK migration errors and current replacement APIs.
- Explains Vercel AI Gateway authentication, model selection, and provider usage.
- Shows type-safe ToolLoopAgent and useChat patterns with inferred UI message types.

## Use Cases

- Build a Streaming Chat: Create a chat experience that uses current useChat and streaming response patterns.
- Standardize AI Gateway Usage: Choose current provider model IDs and configure AI Gateway patterns across a project.
- Migrate Older AI SDK Code: Update deprecated options, message formats, and tool part handling to current APIs.

## Prompt Templates

### Check an AI SDK API

```
Verify the current AI SDK API for my task before making changes. Use local docs first, then ai-sdk.dev if needed.
```

### Build Streaming Chat

```
Build a streaming chat feature with the current AI SDK patterns. Check common useChat errors before writing client code.
```

### Migrate Deprecated Usage

```
Review this AI SDK code for deprecated APIs and update it to the current patterns. Explain each migration decision briefly.
```

### Design a Type-Safe Agent

```
Design a ToolLoopAgent with type-safe useChat rendering. Include where agent files, tool files, and UI message types should live.
```

## Limitations

- It does not provide provider credentials or create Vercel accounts.
- It depends on local AI SDK docs or public ai-sdk.dev documentation being available.
- It may require user approval before package installation or external documentation lookups.
- It focuses on TypeScript AI SDK usage, not general machine learning model design.

## Best Practices

- Verify current APIs in local docs or ai-sdk.dev before changing code.
- Check current AI Gateway model IDs before choosing provider models.
- Run type checks after implementing AI SDK changes.

## Anti Patterns

- Relying on remembered AI SDK API names without checking documentation.
- Using deprecated useChat input handlers or generic tool-invocation parts.
- Adding provider packages before the project actually needs them.

## Security Audit

- Audited at: 2026-07-09T12:12:04.791\+00:00
- Summary: Static analysis flagged hardcoded documentation URLs, placeholder environment-file examples, TypeScript relative imports, and Markdown backtick text. Review found no prompt injection, secret exfiltration, user-controlled command execution, or malicious intent in the scanned files.

## Stats

- Views: 202
- Downloads: 13
- Favorites: 0
- Popularity score: 0
