jackspace/claudeskillz/better-chatbot
- community
Checking that the SKILL.md file is still in the repository.
Supplies the project-specific conventions, architecture, and contribution guidelines for the better-chatbot open-source AI chat platform (github.com/cgoinglove/better-chatbot; Next.js 15, Vercel AI SDK 5, Better Auth, Drizzle ORM, PostgreSQL). Covers the API architecture, the three- tier tool system (MCP, Workflow, Default), server action validators and the safe() wrapper, database repository patterns, compound component design, DAG workflow builder internals, Playwright E2E test setup, and principles such as progressive enhancement, defensive programming, and streaming-first, plus templates for adding tools, API routes, and repositories. Use when working in the better-chatbot repository, contributing features or fixes, adding API routes or database queries, implementing tools and workflows, building UI components, or integrating multiple AI providers.
Install
npx vskill@latest install jackspace/claudeskillz/better-chatbotSKILL.md
better-chatbot Contribution & Standards Skill
Status: Production Ready Last Updated: 2025-11-04 (v2.1.0 - Added extension points + UX patterns) Dependencies: None (references better-chatbot project) Latest Versions: Next.js 15.3.2, Vercel AI SDK 5.0.82, Better Auth 1.3.34, Drizzle ORM 0.41.0
Overview
better-chatbot is an open-source AI chatbot platform for individuals and teams, built with Next.js 15 and Vercel AI SDK v5. It combines multi-model AI support (OpenAI, Anthropic, Google, xAI, Ollama, OpenRouter) with advanced features like MCP (Model Context Protocol) tool integration, visual workflow builder, realtime voice assistant, and team collaboration.
This skill teaches Claude the project-specific conventions and patterns used in better-chatbot to ensure contributions follow established standards and avoid common pitfalls.
Project Architecture
Directory Structure
API Architecture & Design Patterns
Route Structure Philosophy
Convention: RESTful resources with Next.js App Router conventions
Standard Route Handler Pattern
Location: src/app/api/
Template structure:
Shared Business Logic Pattern
Key Insight: Extract complex orchestration logic into shared utilities
Example: src/app/api/chat/shared.chat.ts
This file demonstrates how to handle:
- Tool loading (
loadMcpTools,loadWorkFlowTools,loadAppDefaultTools) - Filtering and composition (
filterMCPToolsByMentions,excludeToolExecution) - System prompt building (
mergeSystemPrompt) - Manual tool execution handling
Pattern:
Why: DRY principle, single source of truth, consistent behavior
Defensive Programming with safe()
Library: ts-safe for functional error handling
Philosophy: Never crash the chat - degrade features gracefully
Streaming-First Architecture
Pattern: Use Vercel AI SDK streaming utilities
Why: Live feedback, better UX, handles long-running operations
Tool System Deep Dive
Three-Tier Tool Architecture
Design Goal: Balance extensibility (MCP), composability (workflows), and batteries-included (default tools)
Tier 1: MCP Tools (External Integrations)
Location: src/lib/ai/mcp/
Philosophy: Model Context Protocol servers become first-class tools
Manager Pattern:
Why Global Singleton?
- Next.js dev hot-reloading → reconnecting MCP servers on every change is expensive
- Persists across HMR updates
- Production: only one instance needed
Tool Wrapping:
Tier 2: Workflow Tools (Visual Composition)
Location: src/lib/ai/workflow/
Philosophy: Visual workflows become callable tools via @workflow_name
Node Types:
Execution with Streaming:
Key Feature: Live progress updates in chat UI
Tier 3: Default Tools (Built-In Capabilities)
Location: src/lib/ai/tools/
Categories:
Tool Implementation Pattern:
Why Separation?
- Server: Pure data/business logic
- Client: Rich visualization/interaction
- Easier testing, better performance
Tool Lifecycle
Convention-Based Extension
Adding a new tool type is simple:
- Add enum to
AppDefaultToolkit - Implement tool with
createTool() - Add to
APP_DEFAULT_TOOL_KIT - Tool automatically available via
@toolname
Component & Design Philosophy
Organization by Feature
Location: src/components/
Principle: Group by feature, not by type
Compound Component Pattern
Example: message.tsx + message-parts.tsx
Philosophy: Break complex components into composable parts
Client Component Wrapper Pattern
Example: chat-bot.tsx
Structure:
Why: Top-level orchestrates, delegates rendering to specialized components
Tool Result Rendering Separation
Key Architecture Decision:
- Tool execution lives in
lib/ai/tools/ - Tool rendering lives in
components/tool-invocation/
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/better-chatbot/SKILL.md
Popularity
- Repository stars
- 14
- Repository forks
- 5
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 13 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jackspace/claudeskillz/better-chatbot)