.cursor/skills/ai-sdk-ui-v6/SKILL.md
Build React chat interfaces with Vercel AI SDK v5/v6. Agent integration, tool approval, auto-submit. Use when: implementing AI SDK v5/v6 chat UIs or troubleshooting "useChat failed to parse stream", "useChat no response", or "stale body values" errors.
npx skillsauth add blockmatic-icebox/basilic-old AI SDK v6 UIInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@ai-sdk/react packageuseChat for chat interfaces with streaminguseCompletion for text completion (non-chat)useObject for structured data generationuseAssistant for OpenAI-compatible assistant APIsaddToolApprovalResponse (v6)toDataStreamResponse() in App Router, pipeDataStreamToResponse() in Pages RoutertoDataStreamResponse() or pipeDataStreamToResponse())sendMessage with data instead of body option)isLoading) and errors (error)stop function to allow users to cancel generationInferAgentUIMessage (v6) for type-safe agent integrationbody option with dynamic values (causes stale values)useEffect (only depend on messages, not callbacks)import { useChat } from '@ai-sdk/react'
export default function Chat() {
const { messages, input, handleInputChange, handleSubmit, isLoading } = useChat({
api: '/api/chat',
})
return (
<form onSubmit={handleSubmit}>
<input value={input} onChange={handleInputChange} />
<button disabled={isLoading}>Send</button>
</form>
)
}
import { useChat } from '@ai-sdk/react'
const { messages, addToolApprovalResponse } = useChat({
api: '/api/chat',
})
// Handle approval
addToolApprovalResponse({
toolCallId: 'id',
approved: true,
})
See Templates and Next.js Integration for detailed examples.
development
# Skill: wagmi ## Scope - React/Next.js wallet integration with Wagmi v3 for EVM chains - Contract interactions using viem v2 for address validation and transaction building - Transaction state management and error handling - Custom hooks wrapping wagmi for contract-specific interactions Does NOT cover: - Solana frontend development - Backend RPC interactions - Smart contract development ## Assumptions - Wagmi v3.3.2+ - viem v2.44.4 - React 18+ or Next.js 14+ - TypeScript v5+ with strict mo
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Advanced TypeScript patterns for type-safe, maintainable code using sophisticated type system features. Use when building type-safe APIs, implementing complex domain models, or leveraging TypeScript's advanced type capabilities.
development
TanStack Query (React Query) for async operations, data fetching, caching, and state management. Use when: fetching server data, managing async operations, caching responses, handling mutations, or any operation that benefits from automatic state management and caching.