chatbot-system

Operates a multi-tenant Groq chatbot SaaS with Sanity config sync and Supabase persistence.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/ebecerra-developer/ebecerra-web --skill chatbot-system-ebecerra-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: chatbot-system
Source: https://github.com/ebecerra-developer/ebecerra-web/tree/main/.claude/skills/chatbot-system
Command: npx skills add https://github.com/ebecerra-developer/ebecerra-web --skill chatbot-system-ebecerra-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing a centralized multi-tenant chatbot service involves scattered knowledge: editing system prompts in Sanity, provisioning new tenants in Supabase, debugging sync webhooks, and diagnosing why a bot gives wrong answers. This Skill consolidates the operational runbook for the chatbot system hosted at chats.ebecerra.es. ## Core Features & Use Cases - System prompt editing: Patch tenant system prompts in Sanity via MCP or curl mutations, with a validated 10-11 section prompt structure and cache-sync verification. - Tenant provisioning: Generate tenant keys, insert rows into Supabase tenants and chatbot_configs_cache, and wire up the client-side proxy and ChatbotWidget. - Diagnostics: A symptom-to-cause table covering 401 invalid keys, 503 config_not_synced, 429 quota exceeded, stale caches, and webhook fan-out failures. - Use Case: A new external client needs a chatbot. Follow the provisioning steps to generate a key, insert the tenant row, seed the config cache, and hand the client the proxy snippet and env vars. ## Quick Start Ask the assistant to diagnose why a specific tenant's chatbot is responding with outdated information and walk through the cache sync verification steps.

Frequently Asked Questions about chatbot-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit a chatbot system prompt stored in Sanity?▼

Patch the tenant's source document via the Sanity Mutate API using a curl POST with a write token, setting the field path like chatbot.systemPrompt.es. The revalidate webhook then fan-outs to the sync handler, which updates the chatbot_configs_cache row in Supabase.

How do I provision a new tenant for a multi-tenant chatbot?▼

Generate a raw key and its SHA-256 hash, insert a row into the Supabase tenants table with the Sanity document mapping, and seed chatbot_configs_cache with a placeholder prompt. Then set CHATBOT_API_URL and CHATBOT_TENANT_KEY env vars in the client app and add a local /api/chatbot proxy route.

Why does the chatbot return 503 config_not_synced?▼

A 503 config_not_synced means the chatbot_configs_cache table has no row for that tenant. Fix it by publishing the source document in Sanity to trigger the sync webhook, or by manually inserting a seed config row.

Why is the Sanity webhook not updating the chatbot config cache?▼

Sanity free tier allows only two webhooks per project, so the sync piggybacks on existing revalidate webhooks via a fan-out call to handleSyncWebhook. If the cache is stale, verify the latest Vercel deploy includes the fan-out and that the webhook projection sends the full document.

How does the Groq model fallback chain work when rate limits hit?▼

The MODEL_CHAIN tries llama-3.3-70b-versatile first, then falls through five backup models on 429 or 5xx errors. If all models fail, it raises GroqExhaustedError and the API returns a 503 to the client.

Why does the chatbot deny capabilities the business actually has?▼

The bot denies real capabilities when the system prompt omits them or lacks a contradiction-handling section. Add an explicit CUANDO TE CONTRADIGAN section and list projects or services directly in the prompt so the model accepts corrections.