/vercel-ai-sdk:testing-patternsfrom vercel-ai-sdk
Provides testing patterns for Vercel AI SDK including mock providers, streaming tests, tool calling tests, snapshot testing, and coverage strategies.
Ships in vercel-ai-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Purpose: Provide comprehensive testing templates, mock providers, and testing strategies for Vercel AI SDK applications.
Activation Triggers:
Key Resources:
templates/mock-provider.ts - Mock language model implementationtemplates/streaming-test.ts - Test streaming responsestemplates/tool-calling-test.ts - Test tool executiontemplates/snapshot-test.ts - Snapshot testing for outputsscripts/generate-test-suite.sh - Generate test scaffoldsscripts/run-coverage.sh - Run tests with coverageexamples/ - Complete test suites for different featuresTemplate: templates/mock-provider.ts
import { createMockLanguageModelV1 } from 'ai/test'
const mockProvider = createMockLanguageModelV1({
doGenerate: async ({ prompt, mode }) => ({
text: 'Mocked response'
finishReason: 'stop'
usage: { promptTokens: 10, completionTokens: 20 }
})
doStream: async function* ({ prompt, mode }) {
yield { type: 'text-delta', textDelta: 'Mocked ' }
yield { type: 'text-delta', textDelta: 'streaming ' }
yield { type: 'text-delta', textDelta: 'response' }
yield {
type: 'finish'
finishReason: 'stop'
usage: { promptTokens: 10, completionTokens: 20 }
}
}
})
Test AI functions without real API calls
Test with real providers in CI (with rate limits)
Ensure consistent outputs over time
Test complete user flows with mocks
Templates:
mock-provider.ts - Complete mock implementationstreaming-test.ts - Streaming test patternstool-calling-test.ts - Tool execution testssnapshot-test.ts - Snapshot testing setupScripts:
generate-test-suite.sh - Scaffold testsrun-coverage.sh - Run with coverageExamples:
complete-test-suite.test.ts - Full test suite exampleTesting Frameworks: Vitest, Jest, Node Test Runner SDK Version: Vercel AI SDK 5+ Coverage Tool: c8, nyc, or built-in coverage
Best Practice: Use mock providers for fast, reliable tests
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub vanman2024/ai-dev-marketplace --plugin vercel-ai-sdk5 skills in this plugin
/agent-workflow-patternsAI agent workflow patterns including ReAct agents, multi-agent systems, loop control, tool orchestration, and autonomous agent architectures. Use when building AI agents, implementing workflows, creating autonomous systems, or when user mentions agents, workflows, ReAct, multi-step reasoning, loop control, agent orchestration, or autonomous AI./generative-ui-patternsGenerative UI implementation patterns for AI SDK RSC including server-side streaming components, dynamic UI generation, and client-server coordination. Use when implementing generative UI, building AI SDK RSC, creating streaming components, or when user mentions generative UI, React Server Components, dynamic UI, AI-generated interfaces, or server-side streaming./provider-config-validatorValidate and debug Vercel AI SDK provider configurations including API keys, environment setup, model compatibility, and rate limiting. Use when encountering provider errors, authentication failures, API key issues, missing environment variables, model compatibility problems, rate limiting errors, or when user mentions provider setup, configuration debugging, or SDK connection issues./rag-implementationRAG (Retrieval Augmented Generation) implementation patterns including document chunking, embedding generation, vector database integration, semantic search, and RAG pipelines. Use when building RAG systems, implementing semantic search, creating knowledge bases, or when user mentions RAG, embeddings, vector database, retrieval, document chunking, or knowledge retrieval.Other plugins' skills for the same job