What problem does it solve? Building custom AI chatbots with Next.js and the Vercel AI SDK repeatedly hits the same pitfalls: inconsistent auth checks in server actions, runtime tool type mismatches, fragmented multi-provider configuration, Zustand state mutation bugs, and broken cross-field validation. This Skill provides portable, production-verified patterns extracted from the better-chatbot project that you can adapt to any codebase. ## Core Features & Use Cases - Server Action Validators: Three composable patterns (validatedAction, validatedActionWithUser, validatedActionWithPermission) that unify auth, Zod validation, and FormData parsing, adaptable to Better Auth, Clerk, or Auth.js. - Tool Abstraction System: Branded type tags enabling runtime type narrowing for MCP, workflow, and default tools with full TypeScript safety. - Multi-AI Provider Setup: A provider registry supporting OpenAI, Anthropic, Google, xAI, and Groq with fallback strategies, health checks, and cost-aware selection. - State & Validation Patterns: Shallow-update Zustand stores and Zod superRefine cross-field validation for passwords, date ranges, and conditional fields. - Use Case: When building a chatbot API route that must support user-selected models across OpenAI and Anthropic with a fallback chain, load the provider-integration reference and copy the registry pattern into your project. ## Quick Start Ask the AI to implement a validated server action with user authentication using the better-chatbot-patterns skill, adapted to your auth provider.