ai-sdk-6
Skill72 starsChanged 18 days agoMITView on GitHub
Vercel AI SDK v6 development, for projects already on ai@6. Use when building or maintaining AI agents, chatbots, tool integrations, streaming apps, or structured output in a v6 codebase. New projects and ai@7 code use ai-sdk-7; an unknown version goes through ai-sdk. Covers ToolLoopAgent, useChat, generateText, streamText, tool approval, provider tools, MCP integration, and Output patterns.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mm-mazhar/agent-skills-configtheir own version, first seen Feb 10, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mm-mazhar/agent-skills-config★ 0same 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 repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/ai-sdk-6/references/agents.mdAGENTS.md
- skills/ai-sdk-7/references/agents.mdAGENTS.md
- skills/openai-agents-sdk/references/agents.mdAGENTS.md
- skills/react-best-practices/AGENTS.mdAGENTS.md
- skills/vercel-react-view-transitions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-harness-reviewSkill
- ai-appSkill
- ai-elementsSkill
- ai-sdk-7Skill
- ai-sdkSkill
- cache-componentsSkill
- chrome-devtoolsSkill
- frontend-designSkill
- goSkill
- handoffSkill
- hetzner-cloudSkill
- iconsSkill
- next-best-practicesSkill
- nextjs-chatbotSkill
- nextjs-seoSkill
- nextjs-shadcnSkill
- openai-agents-sdkSkill
- postgres-semantic-searchSkill
- react-best-practicesSkill
- shadcnSkill
- supabase-postgres-best-practicesSkill
- vercel-react-view-transitionsSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Read the resolved ai/docs/, provider docs and source/types for the exact minor release.
- Very specific: line 29
Use text functions with Output for new schema output.
- Very specific: line 39
Use a configured model verified for the actual provider.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI SDK 6 maintenance
Apply this skill only to ai@6 projects. Resolve compatible provider and UI
packages from the existing manifest/lockfile. Use ai-sdk when the major is
unknown and ai-sdk-7 for an authorized upgrade.
Read the resolved ai/docs/, provider docs and source/types for the exact minor
release. In a monorepo, resolve from the app using the dependency. Default web
docs and repository main can describe v7. ai bundles docs/ from 6.0.32; the
tree mirrors the website paths (mapping in ai-sdk). If installed docs are
unavailable, select the ai@<resolved-version> tag in vercel/ai and read
content/docs/.
Feature links here use a checked v6 documentation snapshot
as a fallback; match the project's release when available. This tag selects
documentation, not an application dependency version.
Boundaries that differ from old and new code
- Text functions use
system;ToolLoopAgentusesinstructions. - Loop limits use
stopWhen: stepCountIs(...). Text functions default to one step (tool execution without a follow-up answer);ToolLoopAgentdefaults to 20. convertToModelMessagesis async; await it.- Use text functions with
Outputfor new schema output; legacy object functions are deprecated. - Tools use
inputSchema; SDK-executed approval is tool-levelneedsApproval. V6 does not know v7'stoolApproval: unless a typecheck rejects it, it is ignored and the tool runs without approval. - React
useChatowns messages and stream status, not form input. Use the appropriate transport and UI-message response protocol. - Core completion callbacks are
onFinish; resultusageis final-step usage, whiletotalUsagecovers all steps.
Use a configured model verified for the actual provider. Typecheck and test a multi-turn stream with relevant tool/approval/error states after integration changes.
Core shape
Checked with ai@6.0.298, @ai-sdk/react@3.0.301, zod@4.6.5, React 19 and
TypeScript 5.9: tsc --noEmit, plus a mock-model run through one tool step and
the follow-up answer. A string model resolves through the AI Gateway. In v7,
system, stepCountIs and result.toUIMessageStreamResponse() become
instructions, isStepCount and
createUIMessageStreamResponse({ stream: toUIMessageStream({ stream: result.stream }) }).
// app/api/chat/route.ts
import { convertToModelMessages, stepCountIs, streamText, tool, validateUIMessages,
type InferUITools, type UIDataTypes, type UIMessage } from 'ai';
import { z } from 'zod';
const tools = {
weather: tool({
inputSchema: z.object({ city: z.string() }),
execute: async ({ city }) => ({ city, celsius: 21 }),
}),
};
export type ChatMessage = UIMessage<never, UIDataTypes, InferUITools<typeof tools>>;
export async function POST(req: Request) {
const { messages } = await req.json();
const uiMessages = await validateUIMessages<ChatMessage>({ messages, tools });
const result = streamText({
model: 'provider/model-id', // configured gateway ID, or a provider instance
system: 'Answer briefly.',
messages: await convertToModelMessages(uiMessages),
tools,
stopWhen: stepCountIs(5),
});
return result.toUIMessageStreamResponse();
}// app/page.tsx
'use client';
import { useChat } from '@ai-sdk/react';
import { DefaultChatTransport } from 'ai';
import type { ChatMessage } from './api/chat/route';
const transport = new DefaultChatTransport<ChatMessage>({ api: '/api/chat' });
export default function Chat() {
const { messages, sendMessage, status } = useChat<ChatMessage>({ transport });
return (
<form action={(form) => void sendMessage({ text: String(form.get('text')) })}>
{messages.map((m) => <div key={m.id}>{m.parts.map((part, i) =>
part.type === 'text' ? <p key={i}>{part.text}</p>
: part.type === 'tool-weather' && part.state === 'output-available'
? <p key={i}>{part.output.city}: {part.output.celsius} °C</p> : null)}</div>)}
<input name="text" disabled={status === 'submitted' || status === 'streaming'} />
</form>
);
}Read for the feature
- Agents: loop limits, call options and context.
- Core functions: output and stream contracts.
- Tools: execution, approval and typed states.
- UI hooks: transport, restoration and stream lifetime.
- Middleware: provider interception.
- MCP: transport and cleanup.
- Workflows: when a loop needs explicit orchestration.
- Examples: version-matched official implementations.
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.

