ai-orchestration-vercel-ai-sdk
Vercel AI SDK Patterns
Quick Guide: Use Vercel AI SDK (v6) to build AI-powered applications with a unified provider API. Use
generateText/streamTextfor text generation and streaming,Output.object()/Output.array()for structured data with Zod,tool()for function calling, anduseChat/useCompletionhooks for React chat UIs. Supports OpenAI, Anthropic, Google, and 20+ providers through a single API.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST use the ai package (v6) with Output.object() / Output.array() for structured output -- NOT the deprecated generateObject / streamObject functions)
(You MUST define tool input schemas with z.object() and use .describe() on each property to help the model understand expected inputs)
(You MUST use streamText for user-facing responses to enable progressive rendering -- use generateText only for background/non-interactive tasks)
(You MUST handle streaming errors via onError callback -- streamText errors become part of the stream and are NOT thrown)
More from agents-inc/skills
web-animation-css-animations
CSS Animation patterns - transitions, keyframes, scroll-driven animations, @property, GPU-accelerated properties, accessibility with prefers-reduced-motion
24web-animation-view-transitions
View Transitions API patterns - same-document transitions, cross-document MPA transitions, shared element animations, pseudo-element styling, accessibility
21web-testing-playwright-e2e
Playwright E2E testing patterns - test structure, Page Object Model, locator strategies, assertions, network mocking, visual regression, parallel execution, fixtures, and configuration
21web-styling-cva
Class Variance Authority - type-safe component variant styling with cva(), compound variants, and VariantProps
20web-animation-framer-motion
Motion (formerly Framer Motion) animation patterns - motion components, variants, gestures, layout animations, scroll-linked animations, accessibility
20web-i18n-next-intl
Type-safe i18n for Next.js App Router
19