Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
Claude Skills Maintainers avatar

Better Chatbot Patterns

  • 196 repo stars
  • Updated July 25, 2026
  • secondsky/claude-skills

Apply reusable better-chatbot patterns: server action validators, tool abstraction, and multi-AI providers for custom deployments.

About

This skill provides reusable better-chatbot patterns for custom deployments, including server action validators, tool abstraction, and multi-AI-provider support. A developer uses it when extending the better-chatbot stack and to debug auth validation, FormData parsing, and workflow-execution errors.

  • Server action validators
  • Tool abstraction layer
  • Multi-AI provider support
  • Fixes FormData & workflow-execution errors

Better Chatbot Patterns by the numbers

  • Data as of Jul 28, 2026 (Skillselion catalog sync)
/plugin marketplace add secondsky/claude-skills
/plugin install better-chatbot-patterns@claude-skills

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
repo stars196
Last updatedJuly 25, 2026
Repositorysecondsky/claude-skills

What it does

Apply reusable better-chatbot patterns: server action validators, tool abstraction, and multi-AI providers for custom deployments.

README.md

better-chatbot-patterns

Status: Production Ready ✅ Last Updated: 2025-10-29 Production Tested: Patterns extracted from https://betterchatbot.vercel.app


Auto-Trigger Keywords

Claude Code automatically discovers this skill when you mention:

Primary Keywords

  • AI chatbot patterns
  • server action validators
  • tool abstraction
  • multi-AI providers
  • workflow execution

Secondary Keywords

  • validated actions
  • validatedActionWithUser
  • tool type checking
  • MCP integration
  • Vercel AI SDK patterns
  • chatbot architecture
  • branded type tags
  • provider registry
  • Zustand patterns

Error-Based Keywords

  • "inconsistent auth checks"
  • "tool type mismatch"
  • "state mutation bugs"
  • "cross-field validation"
  • "provider configuration errors"

What This Skill Does

This skill provides reusable implementation patterns extracted from better-chatbot for custom AI chatbot deployments. Use this skill to implement server action validators, tool abstraction systems, multi-AI provider support, and workflow execution in your own projects.

Core Capabilities

✅ Server action validators (auth + validation + FormData) ✅ Tool abstraction system (branded type tags) ✅ Multi-AI provider setup (OpenAI, Anthropic, Google, xAI, Groq) ✅ Zustand state management patterns ✅ Cross-field validation with Zod superRefine


Known Issues This Skill Prevents

Issue Why It Happens How Skill Fixes It
Inconsistent auth checks Manual auth implementation validatedActionWithUser pattern
Tool type mismatches No runtime type checking Branded type tags with .isMaybe()
State mutation bugs Deep mutation of nested state Shallow Zustand update pattern
Cross-field validation failures Separate validators for related fields Zod superRefine pattern
Provider configuration errors Ad-hoc provider setup Provider registry pattern

When to Use This Skill

✅ Use When:

  • Building AI chatbot features in custom projects
  • Implementing server action validators
  • Creating tool abstraction layers
  • Setting up multi-AI provider support
  • Building workflow execution systems
  • Adapting better-chatbot patterns to your project

###❌ Don't Use When:

  • Contributing to better-chatbot itself (use better-chatbot skill instead)
  • Need project-specific better-chatbot conventions
  • Building non-chatbot applications

Quick Usage Example

// 1. Copy server action validators
// From templates/action-utils.ts to lib/action-utils.ts
// Adapt getUser() to your auth system (Better Auth, Clerk, Auth.js, etc.)

// 2. Use in your server actions
"use server"
import { validatedActionWithUser } from "@/lib/action-utils"
import { z } from "zod"

const schema = z.object({ name: z.string().min(1) })

export const updateProfile = validatedActionWithUser(
  schema,
  async (data, formData, user) => {
    // user is authenticated, data is validated
    await db.update(users).set(data).where(eq(users.id, user.id))
    return { success: true, data: { updated: true } }
  }
)

// 3. Copy other patterns as needed
// - Tool abstraction: templates/tool-tags.ts
// - AI providers: templates/providers.ts
// - State management: templates/workflow-store.ts

Result: Production-ready patterns with auth, validation, and type safety

Full instructions: See SKILL.md


Package Versions (Verified 2025-10-29)

Package Version Status
zod 3.24.2 ✅ Latest stable (required)
zustand 5.0.3 ✅ Latest stable (Pattern 4)
ai 5.0.82 ✅ Latest stable (Pattern 3)
@ai-sdk/openai latest ✅ Optional
@ai-sdk/anthropic latest ✅ Optional
@ai-sdk/google latest ✅ Optional

Dependencies

Prerequisites: None

Integrates With:

  • better-chatbot (optional - for project-specific conventions)
  • ai-sdk-core (optional - for Vercel AI SDK details)
  • clerk-auth (optional - for Clerk auth integration)
  • auth-js (optional - for Auth.js integration)

File Structure

better-chatbot-patterns/
├── SKILL.md              # Complete patterns documentation
├── README.md             # This file
└── templates/            # Copy-paste code templates
    ├── action-utils.ts   # Server action validators
    ├── tool-tags.ts      # Tool abstraction system
    ├── providers.ts      # Multi-AI provider setup
    └── workflow-store.ts # Zustand state management

Official Documentation


Related Skills

  • better-chatbot - Project-specific conventions for contributing to better-chatbot
  • ai-sdk-core - Vercel AI SDK core concepts (if available)
  • clerk-auth - Clerk authentication integration (if available)
  • auth-js - Auth.js integration (if available)

Contributing

Found an issue or have a suggestion?


License

MIT License - See main repo LICENSE file


Production Tested: Patterns from https://betterchatbot.vercel.app (48+ E2E tests passing) Token Savings: ~65% Error Prevention: 100% (5 documented issues prevented) Ready to use! See SKILL.md for complete patterns.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.