Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat(better-chatbot): Enhance skill v2.1.0 with extension points + UX patterns

Jez36a59aeb3344
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 51381c6d..70021bbb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Enhanced - better-chatbot Skill v2.1.0 ✅
+
+**Date**: 2025-11-04
+
+**Incremental Enhancement**: Added Extension Points Reference and UX Patterns documentation.
+
+#### better-chatbot v2.1.0 (Skill #52 - Enhanced Again)
+- **New Content**: Extension points reference table, UX patterns & @mention system
+- **Token Savings**: ~60% (maintained)
+- **Errors Prevented**: 8 (maintained)
+- **Lines Added**: ~250 lines of quick reference and UX guidance
+
+**What's New in v2.1**:
+- ✅ **Extension Points Reference**: Quick lookup table for "I want to add X → Modify Y file"
+ - 15 common extension scenarios (tools, routes, DB tables, components, etc.)
+ - 3 end-to-end development flows (feature, tool, workflow node)
+- ✅ **UX Patterns & @Mention System**: Understanding the user-facing philosophy
+ - Three types of @mentions (@tool, @mcp, @workflow)
+ - Tool Choice Modes (Auto, Manual, None) with use cases
+ - Preset system explained
+ - User journey examples (beginner → intermediate → advanced)
+ - Design patterns developers should follow
+
+**New Keywords Added** (4):
+- "@mention system", "tool choice mode", "preset configuration", "extension points"
+
+**Enhancement Goal**: Provide quick reference for common development tasks and explain the UX philosophy behind the @mention system.
+
+---
+
### Enhanced - better-chatbot Skill v2.0.0 ✅
**Date**: 2025-11-04
diff --git a/skills/better-chatbot/README.md b/skills/better-chatbot/README.md
index 444f5696..088fdafb 100644
--- a/skills/better-chatbot/README.md
+++ b/skills/better-chatbot/README.md
@@ -1,7 +1,7 @@
# better-chatbot
**Status**: Production Ready ✅
-**Last Updated**: 2025-11-04 (v2.0.0 - Enhanced with architecture deep-dive)
+**Last Updated**: 2025-11-04 (v2.1.0 - Added extension points + UX patterns)
**Production Tested**: https://betterchatbot.vercel.app
---
@@ -54,6 +54,10 @@ Claude Code automatically discovers this skill when you mention:
- "database query optimization"
- "component composition pattern"
- "tool rendering separation"
+- "@mention system"
+- "tool choice mode"
+- "preset configuration"
+- "extension points"
---
diff --git a/skills/better-chatbot/SKILL.md b/skills/better-chatbot/SKILL.md
index a5a32649..211908ce 100644
--- a/skills/better-chatbot/SKILL.md
+++ b/skills/better-chatbot/SKILL.md
@@ -10,7 +10,7 @@ description: |
Keywords: better-chatbot, chatbot contribution, better-chatbot standards, chatbot development, AI chatbot patterns, API architecture, three-tier tool system, repository pattern, progressive enhancement, defensive programming, streaming-first, compound component pattern, Next.js chatbot, Vercel AI SDK chatbot, MCP tools, workflow builder, server action validators, tool abstraction, DAG workflows, shared business logic, safe() wrapper, tool lifecycle
license: MIT
metadata:
- version: 2.0.0
+ version: 2.1.0
author: Jeremy Dawes (Jez) | Jezweb
upstream: https://github.com/cgoinglove/better-chatbot
last_verified: 2025-11-04
@@ -23,7 +23,7 @@ metadata:
# better-chatbot Contribution & Standards Skill
**Status**: Production Ready
-**Last Updated**: 2025-11-04 (v2.0.0 - Enhanced with architecture deep-dive)
+**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
@@ -651,6 +651,250 @@ VercelAIMcpToolTag.isMaybe(tool)
---
+## Extension Points Reference
+
+**Quick lookup: "I want to add X" → "Modify Y file"**
+
+| Want to add... | Extend/Modify... | File Location | Notes |
+|----------------|------------------|---------------|-------|
+| **New default tool** | `AppDefaultToolkit` enum + `APP_DEFAULT_TOOL_KIT` | `lib/ai/tools/tool-kit.ts` | Add tool implementation in `lib/ai/tools/[category]/` + rendering in `components/tool-invocation/` |
+| **New tool category** | `AppDefaultToolkit` enum | `lib/ai/tools/index.ts` | Creates new toolkit group (e.g., Visualization, WebSearch) |
+| **New workflow node type** | `NodeKind` enum + executor + validator | `lib/ai/workflow/workflow.interface.ts` + `executor/node-executor.ts` + `validator/node-validate.ts` | Also add UI config in `components/workflow/node-config/` |
+| **New API endpoint** | Create route handler | `src/app/api/[resource]/route.ts` | Follow standard pattern: auth → validation → repository → response |
+| **New server action** | Use `validatedActionWithUser` | `src/app/api/[resource]/actions.ts` | Import from `lib/action-utils.ts` |
+| **New database table** | Add to schema + repository | `lib/db/pg/schema.pg.ts` + `lib/db/pg/repositories/[name]-repository.pg.ts` | Then `pnpm db:generate` and `pnpm db:migrate` |
+| **New UI component** | Create in domain folder | `src/components/[domain]/[name].tsx` | Use shadcn/ui primitives from `components/ui/` |
+| **New React hook** | Create with `use-` prefix | `src/hooks/use-[name].ts` or `src/hooks/queries/use-[name].ts` | Data fetching hooks go in `queries/` subfolder |
+| **New Zod schema** | Add to validations | `src/lib/validations/[domain].ts` | Use `z.infer<typeof schema>` for TypeScript types |
+| **New AI provider** | Add to providers registry | `lib/ai/providers.ts` | Use `createOpenAI`, `createAnthropic`, etc. from AI SDK |
+| **New MCP server** | Configure via UI | Settings → MCP Servers | No code changes needed (file or DB storage) |
+| **New agent template** | Create via UI | Agents page | Combine tools/workflows/prompts |
+| **New permission type** | Add to permissions enum | `lib/auth/permissions.ts` | Use in `validatedActionWithAdminPermission` |
+| **New E2E test** | Add test file | `tests/[feature].spec.ts` | Use Playwright, follow existing patterns |
+| **New system prompt** | Add to prompts | `lib/ai/prompts.ts` | Use `mergeSystemPrompt` for composition |
+
+### Common Development Flows
+
+**Adding a Feature End-to-End**:
+```
+1. Define types (src/types/[domain].ts)
+2. Create Zod schema (lib/validations/[domain].ts)
+3. Add DB table + repository (lib/db/pg/)
+4. Create API route (app/api/[resource]/route.ts)
+5. Create UI component (components/[domain]/)
+6. Create data hook (hooks/queries/use-[resource].ts)
+7. Add E2E test (tests/[feature].spec.ts)
+8. Run: pnpm check && pnpm test:e2e
+```
+
+**Adding a Tool End-to-End**:
+```
+1. Implement tool (lib/ai/tools/[category]/[name].ts)
+2. Add to toolkit (lib/ai/tools/tool-kit.ts)
+3. Create rendering component (components/tool-invocation/[name].tsx)
+4. Add to tool invocation switch (components/tool-invocation/index.tsx)
+5. Test with @toolname mention in chat
+```
+
+**Adding a Workflow Node End-to-End**:
+```
+1. Add NodeKind enum (lib/ai/workflow/workflow.interface.ts)
+2. Define node data type (same file)
+3. Add executor (lib/ai/workflow/executor/node-executor.ts)
+4. Add validator (lib/ai/workflow/validator/node-validate.ts)
+5. Create UI config (components/workflow/node-config/[name]-node.tsx)
+6. Test in workflow builder
+```
+
+---
+
+## UX Patterns & @Mention System
+
+### The @Mention Philosophy
+
+**Core Design Principle**: Every feature is instantly accessible via `@mentions` - no digging through menus.
+
+**Why This Matters**: Users can compose features on-the-fly without context switching.
+
+### Three Types of @Mentions
+
+#### 1. @tool (Default Tools)
+**Format**: `@tool("tool_name")`
+
+**Examples**:
+```
+@tool("web-search") find recent AI papers
+@tool("create-table") show sales data
+@tool("python-execution") calculate fibonacci
+```
+
+**How It Works**:
+- Parsed from message on server
+- Loads corresponding tools from `APP_DEFAULT_TOOL_KIT`
+- LLM decides when to invoke based on prompt
+
+**Use Case**: Built-in capabilities (search, visualization, code execution)
+
+#### 2. @mcp (MCP Server Tools)
+**Format**: `@mcp("server_name")` or specific tool `@mcp("server_name:tool_name")`
+
+**Examples**:
+```
+@mcp("github") create an issue in my repo
+@mcp("playwright") navigate to google.com
+@mcp("slack:send-message") post update to #general
+```
+
+**How It Works**:
+- Mentions filter which MCP servers/tools to load
+- Reduces token usage (only relevant tools sent to LLM)
+- MCP manager handles connection and execution
+
+**Use Case**: External integrations (GitHub, Slack, databases, etc.)
+
+#### 3. @workflow (Custom Workflows)
+**Format**: `@workflow("workflow_name")`
+
+**Examples**:
+```
+@workflow("customer-onboarding") process new signup
+@workflow("data-pipeline") transform and analyze CSV
+```
+
+**How It Works**:
+- Workflows are converted to callable tools
+- LLM sees workflow as a single tool with description
+- Execution streams intermediate node results
+
+**Use Case**: Multi-step automations, business processes
+
+#### 4. @agent (Agent Personas)
+**Format**: Select agent from dropdown (not typed in message)
+
+**How It Works**:
+- Agent's `instructions.mentions` auto-inject tools/workflows
+- System prompt prepended to conversation
+- Presets can override model/temperature
+
+**Use Case**: Role-specific contexts (coding assistant, data analyst, etc.)
+
+### Tool Choice Modes
+
+**Context**: User selects mode from dropdown
+
+#### Auto Mode (Default)
+- LLM can invoke tools autonomously
+- Multiple tool calls per message
+- Best for: Automation, workflows, exploration
+
+**Example Flow**:
+```
+User: @tool("web-search") find AI news, then @tool("create-table") summarize
+→ LLM searches → formats results → creates table → returns message
+```
+
+#### Manual Mode
+- LLM proposes tool calls, waits for user approval
+- User sees "Tool: web-search" with args, clicks "Execute"
+- Best for: Sensitive operations, learning, debugging
+
+**Example Flow**:
+```
+User: @mcp("github") create issue
+→ LLM proposes: create_issue(repo="...", title="...", body="...")
+→ User reviews and clicks "Execute"
+→ Tool runs → result shown
+```
+
+#### None Mode
+- No tools loaded (text-only conversation)
+- Reduces latency and token usage
+- Best for: Brainstorming, explanations, simple queries
+
+### Preset System
+
+**What Are Presets?**
+- Quick configurations for common scenarios
+- Stored per-user
+- Can override: model, temperature, toolChoice, allowed MCP servers
+
+**Example Use Cases**:
+```
+Preset: "Quick Chat"
+- Model: GPT-4o-mini (fast)
+- Tools: None
+- Use for: Rapid Q&A
+
+Preset: "Research Assistant"
+- Model: Claude Sonnet 4.5
+- Tools: @tool("web-search"), @mcp("wikipedia")
+- Use for: Deep research
+
+Preset: "Code Review"
+- Model: GPT-5
+- Tools: @mcp("github"), @tool("python-execution")
+- Use for: Reviewing PRs with tests
+```
+
+**How To Create**:
+1. Configure chat (model, tools, settings)
+2. Click "Save as Preset"
+3. Name it
+4. Select from dropdown in future chats
+
+### User Journey Examples
+
+#### Beginner: First-Time User
+```
+1. Start chat (no @mentions) → Default tools available
+2. Ask: "Search for news about AI"
+3. LLM automatically uses @tool("web-search")
+4. User sees: Search results → Formatted answer
+5. Learns: Tools work automatically in Auto mode
+```
+
+#### Intermediate: Using Workflows
+```
+1. Create workflow in Workflow Builder:
+ Input → Web Search → LLM Summary → Output
+2. Save as "research-workflow"
+3. In chat: "@workflow('research-workflow') AI trends 2025"
+4. Sees: Live progress per node
+5. Gets: Formatted research report
+```
+
+#### Advanced: Agent + MCP + Workflows
+```
+1. Create agent "DevOps Assistant"
+2. Agent instructions include: @mcp("github"), @workflow("deploy-pipeline")
+3. Select agent from dropdown
+4. Chat: "Deploy latest commit to staging"
+5. Agent: Uses GitHub MCP → triggers deploy workflow → monitors → reports
+```
+
+### Design Patterns Developers Should Follow
+
+**1. Discoverability**
+- Every tool should have clear description (shown in LLM context)
+- Use semantic names (`create-table` not `tool-42`)
+
+**2. Composability**
+- Tools should be single-purpose
+- Workflows compose tools
+- Agents compose workflows + tools + context
+
+**3. Progressive Disclosure**
+- Beginners: Auto mode, no @mentions (use defaults)
+- Intermediate: Explicit @tool/@mcp mentions
+- Advanced: Workflows, agents, presets
+
+**4. Feedback**
+- Streaming for long operations
+- Progress updates for workflows
+- Clear error messages with solutions
+
+---
+
## Practical Templates
### Template: Adding a New Default Tool