Build backend AI with Vercel AI SDK v6, covering structured outputs, multi-modal capabilities, tools, and 15 error solutions.
Works with
Supports text generation, structured outputs (objects, arrays, choices), speech synthesis, transcription, embeddings, and image generation across 69+ providers (OpenAI, Anthropic, Google, Cloudflare)
Output API replaces deprecated generateObject/streamObject; use Output.object() , Output.array() , Output.choice() for type-safe structured data with Zod schemas
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionai-sdk-coreExecute the skills CLI command in your project's root directory to begin installation:
Fetches ai-sdk-core from jezweb/claude-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate ai-sdk-core. Access via /ai-sdk-core in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
695
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
695
stars
Backend AI with Vercel AI SDK v5 and v6.
Installation:
npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google zod
Status: Stable Latest: [email protected] (Jan 2026)
⚠️ CRITICAL: generateObject() and streamObject() are DEPRECATED and will be removed in a future version. Use the new Output API instead.
Before (v5 - DEPRECATED):
// ❌ DEPRECATED - will be removed
import { generateObject } from 'ai';
const result = await generateObject({
model: openai('gpt-5'),
schema: z.object({ name: z.string(), age: z.number() }),
prompt: 'Generate a person',
});
After (v6 - USE THIS):
// ✅ NEW OUTPUT API
import { generateText, Output } from 'ai';
const result = await generateText({
model: openai('gpt-5'),
output: Output.object({ schema: z.object({ name: z.string(), age: z.number() }) }),
prompt: 'Generate a person',
});
// Access the typed object
console.log(result.object); // { name: "Alice", age: 30 }
import { generateText, Output } from 'ai';
// Object with Zod schema
output: Output.object({ schema: myZodSchema })
// Array of typed objects
output: Output.array({ schema: personSchema })
// Enum/choice from options
output: Output.choice({ choices: ['positive', 'negative', 'neutral'] })
// Plain text (explicit)
output: Output.text()
// Unstructured JSON (no schema validation)
output: Output.json()
import { streamText, Output } from 'ai';
const result = streamText({
model: openai('gpt-5'),
output: Output.object({ schema: personSchema }),
prompt: 'Generate a person',
});
// Stream partial objects
for await (const partialObject of result.objectStream) {
console.log(partialObject); // { name: "Ali..." } -> { name: "Alice", age: ... }
}
// Get final object
const finalObject = await result.object;
1. Agent Abstraction
Unified interface for building agents with ToolLoopAgent class:
2. Tool Execution Approval (Human-in-the-Loop)
Use selective approval for better UX. Not every tool call needs approval.
tools: {
payment: tool({
// Dynamic approval based on input
needsApproval: async ({ amount }) => amount > 1000,
inputSchema: z.object({ amount: z.number() }),
execute: async ({ amount }) => { /* process payment */ },
}),
readFile: tool({
needsApproval: false, // Safe operations don't need approval
inputSchema: z.object({ path: z.string() }),
execute: async ({ path }) => fs.readFile(path),
}),
deleteFile: tool({
needsApproval: true, // Destructive operations always need approval
inputSchema: z.object({ path: z.string() }),
execute: async ({ path }) => fs.unlink(path),
}),
}
Best Practices:
Sources:
3. Reranking for RAG
import { rerank } from 'ai';
const result = await rerank({
model: cohere.reranker('rerank-v3.5'),
query: 'user question',
documents: searchResults,
topK: 5,
});
4. MCP Tools (Model Context Protocol)
⚠️ SECURITY WARNING: MCP tools have significant production risks. See security section below.
import { experimental_createMCPClient } from 'ai';
const mcpClient = await experimental_createMCPClient({
transport: { type: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem'] },
});
const tools = await mcpClient.tools();
const result = await generateText({
model: openaPrerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
jezweb/claude-skills
jezweb/claude-skills
jezweb/claude-skills
omer-metin/skills-for-antigravity
davila7/claude-code-templates
intellectronica/agent-skills
Useful defaults in ai-sdk-core — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
We added ai-sdk-core from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Registry listing for ai-sdk-core matched our evaluation — installs cleanly and behaves as described in the markdown.
Registry listing for ai-sdk-core matched our evaluation — installs cleanly and behaves as described in the markdown.
Keeps context tight: ai-sdk-core is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend ai-sdk-core for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
ai-sdk-core fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Keeps context tight: ai-sdk-core is the kind of skill you can hand to a new teammate without a long onboarding doc.
I recommend ai-sdk-core for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
I recommend ai-sdk-core for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
showing 1-10 of 59