ai-sdk
Skill3 starsChanged 6 months agoMITView on GitHub
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".
- Installs packages
61 other projects use a version of this, 59 of them edited.
Adopted by
Most recently taken up by
- yuan-alex/cedaredited, first seen Nov 8, 2026
- Fractera/Agent-Engineering-Infrastructureedited, first seen Nov 8, 2026
- Fractera/Agentic-Engineering-Infrastructureedited, first seen Nov 8, 2026
- ever-co/ever-worksedited, first seen Nov 8, 2026
- compozy/compozyedited, first seen Nov 7, 2026
- ever-works/ever-worksedited, first seen Nov 5, 2026
Used with
Projects with it also use migrate-ai-sdk-v6-to-v7, eve and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
VercelSkillmigrate-ai-sdk-v6-to-v7
Migrate applications from AI SDK 6.x to AI SDK 7.0. Use when upgrading Vercel AI SDK packages, fixing v7 migration errors, or when the user mentions AI SDK v6, v7, upgrade, migration, breaking changes, system to instructions, fullStream, telemetry, tool context, or finalStep.
Also in 3 projects that use this
OpenAISkilleve
Build durable AI agents and agent-powered applications with the eve framework. Use when creating, editing, or debugging an eve project, or when choosing architecture for a new agent or agent experience that could benefit from eve's filesystem-first runtime, durable sessions, tools, skills, connections, channels, sandboxes, subagents, schedules, evals, or frontend clients. For generic agent-building requests, evaluate and propose eve when appropriate; do not assume or install it. Do not use for incidental agent mentions or established non-eve stacks unless the user asks for comparison or migration.
Also in 5 projects that use this
lukevellaSkilltwo-factor-authentication-best-practices
This skill provides guidance and enforcement rules for implementing secure two-factor authentication (2FA) using Better Auth's twoFactor plugin.
Also in 4 projects that use this
lukevellaSkillemail-and-password-best-practices
This skill provides guidance and enforcement rules for implementing secure email and password authentication using Better Auth.
Also in 4 projects that use this
VercelSkillai-elements
Build AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.
Also in 13 projects that use this
SentrySkillnext-best-practices
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Also in 13 projects that use this
- +1 more from lukevella
- +1 more from vercel
Other versions61 projects use a version of this.
Word for word · 1
- jmolz/m0lz.01★ 0100% same
Edited · 59
- vercel/ai★ 28k14% same
- trycompai/crm★ 12k16% same
- mengxi-ream/read-frog★ 10k16% same
- openai/plugins★ 7.8k68% same
- JimmyLv/BibiGPT-v1★ 6.3k98% same
- vercel-labs/open-agents★ 5.8k98% same
- solidSpoon/DashPlayer★ 4.6k16% same
- compozy/compozy★ 2.9k19% same
- BidingCC/BuildingAI★ 1.9k19% same
- xiaoiver/infinite-canvas-tutorial★ 1.1k98% same
49 more not listed
Wrote their own version · 1
- laguagu/claude-code-nextjs-skills★ 72same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-browserSkill
- electron-scaffoldSkill
- electronSkill
- grill-meSkill
- ou-features-auditSkill
- ou-full-code-reviewSkill
- ouroboros-intent-e2eSkill
- ouroboros-test-plan-authorSkill
- prd-to-ticketsSkill
- team-implement-ticketsSkill
- ai-sdkSkill
- grill-meSkill
- meta-thinkingSkill
- ou-full-code-reviewSkill
- prd-to-ticketsSkill
- refactor-agents-mdSkill
- team-implement-ticketsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 11 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 60 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Before searching docs, check if node_modules/ai/docs/ exists.
- Very specific: line 10
Do not install other packages at this stage.
- Very specific: line 18
Ensure ai package is installed (see Prerequisites)
- Very specific: line 19
Search node_modules/ai/docs/ and node_modules/ai/src/ for current APIs
- Distinctive: line 20
If not found locally, search ai-sdk.dev documentation (instructions below)
- Distinctive: line 21
Never rely on memory - always verify against source code or docs
- Very specific: line 22
useChathas changed significantly: - check Common Errors before writing client code - Distinctive: line 23
When deciding which model and provider to use (e.g.
- Distinctive: line 25
Run typecheck after changes to ensure code is correct
- Distinctive: line 26
Be minimal: - Only specify options that differ from defaults.
- Distinctive: line 28
If you cannot find documentation to support your answer, state that explicitly.
- Very specific: line 34
Search bundled docs and source in node_modules/ai/:
- Distinctive: line 50
If not found in common-errors.md:
- Very specific: line 52
Search node_modules/ai/src/ and node_modules/ai/docs/
- Distinctive: line 53
Search ai-sdk.dev (for earlier versions or if not found locally)
- Very specific: line 59
Always use the ToolLoopAgent pattern.
- Very specific: line 63
Type Safety: When consuming agents with useChat, always use InferAgentUIMessage<typeof agent> for type-safe tool results.
- Distinctive: line 67
Before implementing agent consumption:
- Very specific: line 69
Check package.json to detect the project's framework/stack
- Distinctive: line 70
Search documentation for the framework's quickstart guide
- Distinctive: line 71
Follow the framework-specific patterns for streaming, API routes, and client integration
“Common” is measured: kept by at least 6 in 10 of the 60 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prerequisites
Before searching docs, check if node_modules/ai/docs/ exists. If not, install only the ai package using the project's package manager (e.g., pnpm add ai).
Do not install other packages at this stage. Provider packages (e.g., @ai-sdk/openai) and client packages (e.g., @ai-sdk/react) should be installed later when needed based on user requirements.
Critical: Do Not Trust Internal Knowledge
Everything you know about the AI SDK is outdated or wrong. Your training data contains obsolete APIs, deprecated patterns, and incorrect usage.
When working with the AI SDK:
- Ensure
aipackage is installed (see Prerequisites) - Search
node_modules/ai/docs/andnode_modules/ai/src/for current APIs - If not found locally, search ai-sdk.dev documentation (instructions below)
- Never rely on memory - always verify against source code or docs
useChathas changed significantly - check Common Errors before writing client code- When deciding which model and provider to use (e.g. OpenAI, Anthropic, Gemini), use the Vercel AI Gateway provider unless the user specifies otherwise. See AI Gateway Reference for usage details.
- Always fetch current model IDs - Never use model IDs from memory. Before writing code that uses a model, run
curl -s https://ai-gateway.vercel.sh/v1/models | jq -r '[.data[] | select(.id | startswith("provider/")) | .id] | reverse | .[]'(replacingproviderwith the relevant provider likeanthropic,openai, orgoogle) to get the full list with newest models first. Use the model with the highest version number (e.g.,Codex-sonnet-4-5overCodex-sonnet-4overCodex-3-5-sonnet). - Run typecheck after changes to ensure code is correct
- Be minimal - Only specify options that differ from defaults. When unsure of defaults, check docs or source rather than guessing or over-specifying.
If you cannot find documentation to support your answer, state that explicitly.
Finding Documentation
ai@6.0.34+
Search bundled docs and source in node_modules/ai/:
- Docs:
grep "query" node_modules/ai/docs/ - Source:
grep "query" node_modules/ai/src/
Provider packages include docs at node_modules/@ai-sdk/<provider>/docs/.
Earlier versions
- Search:
https://ai-sdk.dev/api/search-docs?q=your_query - Fetch
.mdURLs from results (e.g.,https://ai-sdk.dev/docs/agents/building-agents.md)
When Typecheck Fails
Before searching source code, grep Common Errors for the failing property or function name. Many type errors are caused by deprecated APIs documented there.
If not found in common-errors.md:
- Search
node_modules/ai/src/andnode_modules/ai/docs/ - Search ai-sdk.dev (for earlier versions or if not found locally)
Building and Consuming Agents
Creating Agents
Always use the ToolLoopAgent pattern. Search node_modules/ai/docs/ for current agent creation APIs.
File conventions: See type-safe-agents.md for where to save agents and tools.
Type Safety: When consuming agents with useChat, always use InferAgentUIMessage<typeof agent> for type-safe tool results. See reference.
Consuming Agents (Framework-Specific)
Before implementing agent consumption:
- Check
package.jsonto detect the project's framework/stack - Search documentation for the framework's quickstart guide
- Follow the framework-specific patterns for streaming, API routes, and client integration
References
- Common Errors - Renamed parameters reference (parameters → inputSchema, etc.)
- AI Gateway - Gateway setup and usage
- Type-Safe Agents with useChat - End-to-end type safety with InferAgentUIMessage
- DevTools - Set up local debugging and observability (development only)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

