[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M799YYZ5N7G98WN2BA9F1Z8C":3,"skill-same:01M799YYZ5N7G98WN2BA9F1Z8C":136},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":14,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M799YYZ5N7G98WN2BA9F1Z8C","better-chatbot",null,"better-chatbot project conventions and standards. Use for contributing code, following three-tier tool system (MCP\u002FWorkflow\u002FDefault), or encountering server action validators, repository patterns, component design errors.","Elogic360\u002Fsoftware-factory","Elogic360","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156535519?v=4","01M74NH3F0RB13PWB7JZDE2V80","elogic360","01M74NH3FPC65082MDZVMFHDM3",0,"MIT","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: better-chatbot\ndescription: \"better-chatbot project conventions and standards. Use for contributing code, following three-tier tool system (MCP\u002FWorkflow\u002FDefault), or encountering server action validators, repository patterns, component design errors.\"\nlicense: MIT\nmetadata:\n  version: 3.0.0\n  author: Claude Skills Maintainers\n  upstream: https:\u002F\u002Fgithub.com\u002Fcgoinglove\u002Fbetter-chatbot\n  last_verified: 2025-12-17\n  tech_stack: Next.js 15, Vercel AI SDK 5, Better Auth, Drizzle ORM, PostgreSQL, Playwright\n  token_savings: ~75%\n  errors_prevented: 8\n  optimization_date: 2025-12-17\n  keywords:\n    - better-chatbot\n    - chatbot contribution\n    - better-chatbot standards\n    - chatbot development\n    - AI chatbot patterns\n    - API architecture\n    - three-tier tool system\n    - repository pattern\n    - progressive enhancement\n    - defensive programming\n    - streaming-first\n    - compound component pattern\n    - Next.js chatbot\n    - Vercel AI SDK chatbot\n    - MCP tools\n    - workflow builder\n    - server action validators\n    - tool abstraction\n    - DAG workflows\n    - shared business logic\n    - safe() wrapper\n    - tool lifecycle\n---\n# better-chatbot Contribution & Standards Skill\n\n**Status**: Production Ready\n**Version**: 3.0.0 (Optimized with progressive disclosure)\n**Last Updated**: 2025-12-17\n**Dependencies**: None (references better-chatbot project)\n**Latest Versions**: Next.js 16.0.3, Vercel AI SDK 5.0.98, Better Auth 1.3.34, Drizzle ORM 0.41.0\n\n---\n\n## Overview\n\n**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.\n\n**This skill teaches Claude the project-specific conventions and patterns** used in better-chatbot to ensure contributions follow established standards and avoid common pitfalls.\n\n---\n\n## Quick Start\n\n### Setup Development Environment\n\n```bash\n# Clone and install\ngit clone https:\u002F\u002Fgithub.com\u002Fcgoinglove\u002Fbetter-chatbot.git\ncd better-chatbot\npnpm install\n\n# Configure environment\ncp .env.example .env\n# Add your API keys: OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.\n# Add database URL: DATABASE_URL=\"postgresql:\u002F\u002F...\"\n# Add auth secret: BETTER_AUTH_SECRET=\"your-secret\"\n\n# Run development server\npnpm dev\n```\n\n### Core Commands\n\n- `pnpm dev` - Start development server\n- `pnpm build` - Production build\n- `pnpm test` - Run unit tests\n- `pnpm test:e2e` - Run E2E tests (requires DB + API keys)\n- `pnpm check` - Lint + type check + tests (run before PR)\n\n### Repository Structure\n\n```\nbetter-chatbot\u002F\n├── src\u002F\n│   ├── app\u002F                # Next.js routes + API\n│   ├── components\u002F         # UI components by domain\n│   ├── lib\u002F               # Core logic (ai, db, validations)\n│   ├── hooks\u002F             # React hooks\n│   └── types\u002F             # TypeScript types\n├── tests\u002F                 # E2E Playwright tests\n└── drizzle\u002F              # Database migrations\n```\n\n---\n\n## Core Architecture\n\n### Three-Tier Tool System\n\nBetter-chatbot uses a three-tier tool architecture for AI capabilities:\n\n1. **MCP Tools** - External tools via Model Context Protocol\n2. **Workflow Tools** - Visual DAG-based workflows\n3. **Default Tools** - Built-in app tools (web search, image generation, etc.)\n\n**For details**: Load `references\u002Ftool-system.md` when implementing tools or understanding tool execution.\n\n### API Patterns\n\nRoutes follow RESTful conventions with streaming-first architecture and defensive programming using `safe()` wrapper.\n\n**For details**: Load `references\u002Fapi-architecture.md` when building API routes or implementing streaming.\n\n### Component Philosophy\n\nComponents organized by feature using compound component pattern. Tools execution separated from rendering.\n\n**For details**: Load `references\u002Fcomponent-patterns.md` when building UI components.\n\n### Database & Repository Pattern\n\nAll database access abstracted through repository classes using Drizzle ORM.\n\n**For details**: Load `references\u002Fdatabase-patterns.md` when implementing database queries.\n\n---\n\n## Top 5 Errors (Must Know)\n\n### Error #1: Forgetting Auth Checks in Server Actions\n\n**Error**: Unauthorized users accessing protected actions\n**Why**: Manual auth implementation is inconsistent\n**Prevention**: Use `validatedActionWithUser` or `validatedActionWithAdminPermission`\n\n```typescript\n\u002F\u002F ❌ BAD: Manual auth check\nexport async function updateProfile(data: ProfileData) {\n  const session = await getSession()\n  if (!session) throw new Error(\"Unauthorized\")\n  \u002F\u002F ... rest of logic\n}\n\n\u002F\u002F ✅ GOOD: Use validator\nexport const updateProfile = validatedActionWithUser(\n  profileSchema,\n  async (data, formData, user) => {\n    \u002F\u002F user is guaranteed to exist, auto-error handling\n  }\n)\n```\n\n### Error #2: Tool Type Mismatches\n\n**Error**: Runtime type errors when executing tools\n**Why**: Not checking tool type before execution\n**Prevention**: Use branded type tags for runtime narrowing\n\n```typescript\n\u002F\u002F ❌ BAD: Assuming tool type\nconst result = await executeMcpTool(tool)\n\n\u002F\u002F ✅ GOOD: Check tool type\nif (VercelAIMcpToolTag.isMaybe(tool)) {\n  const result = await executeMcpTool(tool)\n} else if (VercelAIWorkflowToolTag.isMaybe(tool)) {\n  const result = await executeWorkflowTool(tool)\n}\n```\n\n### Error #3: FormData Parsing Errors\n\n**Error**: Inconsistent error handling for form submissions\n**Why**: Manual FormData parsing with ad-hoc validation\n**Prevention**: Validators handle parsing automatically\n\n```typescript\n\u002F\u002F ❌ BAD: Manual parsing\nconst name = formData.get(\"name\") as string\nif (!name) throw new Error(\"Name required\")\n\n\u002F\u002F ✅ GOOD: Validator with Zod\nconst schema = z.object({ name: z.string().min(1) })\nexport const action = validatedAction(schema, async (data) => {\n  \u002F\u002F data.name is validated and typed\n})\n```\n\n### Error #4: Cross-Field Validation Issues\n\n**Error**: Password mismatch validation not working\n**Why**: Separate validation for related fields\n**Prevention**: Use Zod `superRefine`\n\n```typescript\n\u002F\u002F ❌ BAD: Separate checks\nif (data.password !== data.confirmPassword) { \u002F* error *\u002F }\n\n\u002F\u002F ✅ GOOD: Zod superRefine\nconst schema = z.object({\n  password: z.string(),\n  confirmPassword: z.string()\n}).superRefine((data, ctx) => {\n  if (data.password !== data.confirmPassword) {\n    ctx.addIssue({\n      code: z.ZodIssueCode.custom,\n      message: \"Passwords don't match\",\n      path: [\"confirmPassword\"]\n    })\n  }\n})\n```\n\n### Error #5: Zustand State Mutation\n\n**Error**: State updates not triggering re-renders\n**Why**: Mutating state directly instead of creating new objects\n**Prevention**: Use shallow updates with spread operator\n\n```typescript\n\u002F\u002F ❌ BAD: Direct mutation\nset((state) => {\n  state.user.name = \"New Name\" \u002F\u002F Mutation!\n})\n\n\u002F\u002F ✅ GOOD: Shallow update\nset((state) => ({\n  user: { ...state.user, name: \"New Name\" }\n}))\n```\n\n**For all errors**: Load `references\u002Fcommon-errors.md` when debugging issues beyond the top 5.\n\n---\n\n## Critical Rules\n\n### Always Do\n\n✅ Use `validatedActionWithUser` or `validatedActionWithAdminPermission` for server actions\n✅ Check tool types with branded type tags before execution\n✅ Use Zod `superRefine` for cross-field validation\n✅ Add unit tests (happy path + one failure mode)\n✅ Run `pnpm check` before PR submission\n✅ Include visual documentation for UI changes\n✅ Use Conventional Commit format for PR titles\n✅ Run E2E tests when touching critical flows\n\n### Never Do\n\n❌ Implement server actions without auth validators\n❌ Assume tool type without runtime check\n❌ Parse FormData manually (use validators)\n❌ Mutate Zustand state directly (use shallow updates)\n❌ Skip first-user tests on clean database\n❌ Commit without running `pnpm check`\n❌ Submit PR without visual docs (if UI change)\n❌ Use non-conventional commit format\n\n---\n\n## When to Load References\n\nLoad reference files when working on specific aspects of better-chatbot:\n\n### API Architecture (`references\u002Fapi-architecture.md`)\nLoad when:\n- Implementing new API routes or endpoints\n- Understanding route handler patterns\n- Working with streaming responses\n- Implementing defensive programming with safe()\n- Troubleshooting API-related issues\n- Building shared business logic\n\n### Tool System (`references\u002Ftool-system.md`)\nLoad when:\n- Adding new MCP tools\n- Creating workflow tools\n- Understanding tool lifecycle\n- Debugging tool execution\n- Implementing tool filtering or mentions\n- Working with the three-tier tool architecture\n\n### Component Patterns (`references\u002Fcomponent-patterns.md`)\nLoad when:\n- Building new UI components\n- Understanding compound component pattern\n- Implementing state management\n- Working with Zustand stores\n- Designing component APIs\n- Separating tool execution from rendering\n\n### Database Patterns (`references\u002Fdatabase-patterns.md`)\nLoad when:\n- Creating new repository classes\n- Writing complex database queries\n- Implementing transactions\n- Understanding the repository pattern\n- Troubleshooting database issues\n- Working with Drizzle ORM\n\n### Architectural Principles (`references\u002Farchitectural-principles.md`)\nLoad when:\n- Making architectural decisions\n- Understanding design philosophy\n- Implementing progressive enhancement\n- Following streaming-first patterns\n- Ensuring defensive programming\n- Understanding DRY principle application\n\n### Extension Points (`references\u002Fextension-points.md`)\nLoad when:\n- Extending the chatbot with custom features\n- Adding new tool types\n- Customizing existing behavior\n- Understanding plugin architecture\n- Integrating external services\n\n### UX Patterns (`references\u002Fux-patterns.md`)\nLoad when:\n- Implementing @mention functionality\n- Understanding UX patterns\n- Working with multi-model support\n- Designing interaction flows\n- Building chat UI components\n\n### Templates (`references\u002Ftemplates.md`)\nLoad when:\n- Adding new routes, tools, or components\n- Following code templates\n- Understanding complete implementation examples\n- Starting new features from scratch\n- Implementing standard patterns\n\n### Server Actions (`references\u002Fserver-actions.md`)\nLoad when:\n- Implementing server actions\n- Understanding action validators\n- Following server-side validation patterns\n- Troubleshooting server action issues\n- Working with FormData\n\n### Common Errors (`references\u002Fcommon-errors.md`)\nLoad when:\n- Debugging issues beyond the top 5 errors\n- Encountering specific error messages\n- Understanding error patterns\n- Looking for solutions to common problems\n- Preventing known issues\n\n### Repository Guidelines (`references\u002FAGENTS.md`)\nLoad when:\n- Understanding project structure\n- Following coding conventions\n- Setting up development environment\n- Running tests or builds\n- Understanding commit\u002FPR guidelines\n\n### Contributing (`references\u002FCONTRIBUTING.md`)\nLoad when:\n- Preparing to contribute\n- Understanding PR process\n- Following commit message conventions\n- Submitting pull requests\n- Adding visual documentation\n\n---\n\n## Using Bundled Resources\n\nThis skill includes 12 reference files:\n\n**Technical References** (10 files):\n- `api-architecture.md` - API patterns and route handlers\n- `tool-system.md` - Three-tier tool architecture\n- `component-patterns.md` - UI component design\n- `database-patterns.md` - Repository pattern and Drizzle ORM\n- `architectural-principles.md` - Design philosophy\n- `extension-points.md` - How to extend the system\n- `ux-patterns.md` - UX patterns and @mentions\n- `templates.md` - Code templates for routes\u002Ftools\u002Fcomponents\n- `server-actions.md` - Server action validators\n- `common-errors.md` - Complete error catalog\n\n**Repository References** (2 files):\n- `AGENTS.md` - Repository structure and development commands\n- `CONTRIBUTING.md` - Contribution workflow and PR guidelines\n\nLoad references on-demand when specific knowledge is needed. See \"When to Load References\" section for triggers.\n\n---\n\n## Dependencies\n\n**Core**:\n- Next.js 15+ (App Router)\n- Vercel AI SDK 5+\n- Better Auth 1.3+\n- Drizzle ORM 0.40+\n- PostgreSQL\n\n**Testing**:\n- Vitest (unit tests)\n- Playwright (E2E tests)\n\n**Tools**:\n- TypeScript 5+\n- Biome (formatting + linting)\n- pnpm 8+\n\n---\n\n## Official Documentation\n\n- **Repository**: https:\u002F\u002Fgithub.com\u002Fcgoinglove\u002Fbetter-chatbot\n- **Vercel AI SDK**: https:\u002F\u002Fsdk.vercel.ai\u002Fdocs\n- **Better Auth**: https:\u002F\u002Fwww.better-auth.com\u002Fdocs\n- **Drizzle ORM**: https:\u002F\u002Form.drizzle.team\u002Fdocs\u002Foverview\n- **MCP Spec**: https:\u002F\u002Fmodelcontextprotocol.io\u002Fintroduction\n\n---\n\n## Production Example\n\nThis skill is based on the production better-chatbot repository with 48 E2E tests covering core functionality, active development, and growing community contributions.\n\n---\n\n**Last verified**: 2025-12-17 | **Version**: 3.0.0\n","# better-chatbot Contribution & Standards Skill\n\n**Status**: Production Ready\n**Version**: 3.0.0 (Optimized with progressive disclosure)\n**Last Updated**: 2025-12-17\n**Dependencies**: None (references better-chatbot project)\n**Latest Versions**: Next.js 16.0.3, Vercel AI SDK 5.0.98, Better Auth 1.3.34, Drizzle ORM 0.41.0\n\n---\n\n## Overview\n\n**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.\n\n**This skill teaches Claude the project-specific conventions and patterns** used in better-chatbot to ensure contributions follow established standards and avoid common pitfalls.\n\n---\n\n## Quick Start\n\n### Setup Development Environment\n\n```bash\n# Clone and install\ngit clone https:\u002F\u002Fgithub.com\u002Fcgoinglove\u002Fbetter-chatbot.git\ncd better-chatbot\npnpm install\n\n# Configure environment\ncp .env.example .env\n# Add your API keys: OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.\n# Add database URL: DATABASE_URL=\"postgresql:\u002F\u002F...\"\n# Add auth secret: BETTER_AUTH_SECRET=\"your-secret\"\n\n# Run development server\npnpm dev\n```\n\n### Core Commands\n\n- `pnpm dev` - Start development server\n- `pnpm build` - Production build\n- `pnpm test` - Run unit tests\n- `pnpm test:e2e` - Run E2E tests (requires DB + API keys)\n- `pnpm check` - Lint + type check + tests (run before PR)\n\n### Repository Structure\n\n```\nbetter-chatbot\u002F\n├── src\u002F\n│   ├── app\u002F                # Next.js routes + API\n│   ├── components\u002F         # UI components by domain\n│   ├── lib\u002F               # Core logic (ai, db, validations)\n│   ├── hooks\u002F             # React hooks\n│   └── types\u002F             # TypeScript types\n├── tests\u002F                 # E2E Playwright tests\n└── drizzle\u002F              # Database migrations\n```\n\n---\n\n## Core Architecture\n\n### Three-Tier Tool System\n\nBetter-chatbot uses a three-tier tool architecture for AI capabilities:\n\n1. **MCP Tools** - External tools via Model Context Protocol\n2. **Workflow Tools** - Visual DAG-based workflows\n3. **Default Tools** - Built-in app tools (web search, image generation, etc.)\n\n**For details**: Load `references\u002Ftool-system.md` when implementing tools or understanding tool execution.\n\n### API Patterns\n\nRoutes follow RESTful conventions with streaming-first architecture and defensive programming using `safe()` wrapper.\n\n**For details**: Load `references\u002Fapi-architecture.md` when building API routes or implementing streaming.\n\n### Component Philosophy\n\nComponents organized by feature using compound component pattern. Tools execution separated from rendering.\n\n**For details**: Load `references\u002Fcomponent-patterns.md` when building UI components.\n\n### Database & Repository Pattern\n\nAll database access abstracted through repository classes using Drizzle ORM.\n\n**For details**: Load `references\u002Fdatabase-patterns.md` when implementing database queries.\n\n---\n\n## Top 5 Errors (Must Know)\n\n### Error #1: Forgetting Auth Checks in Server Actions\n\n**Error**: Unauthorized users accessing protected actions\n**Why**: Manual auth implementation is inconsistent\n**Prevention**: Use `validatedActionWithUser` or `validatedActionWithAdminPermission`\n\n```typescript\n\u002F\u002F ❌ BAD: Manual auth check\nexport async function updateProfile(data: ProfileData) {\n  const session = await getSession()\n  if (!session) throw new Error(\"Unauthorized\")\n  \u002F\u002F ... rest of logic\n}\n\n\u002F\u002F ✅ GOOD: Use validator\nexport const updateProfile = validatedActionWithUser(\n  profileSchema,\n  async (data, formData, user) => {\n    \u002F\u002F user is guaranteed to exist, auto-error handling\n  }\n)\n```\n\n### Error #2: Tool Type Mismatches\n\n**Error**: Runtime type errors when executing tools\n**Why**: Not checking tool type before execution\n**Prevention**: Use branded type tags for runtime narrowing\n\n```typescript\n\u002F\u002F ❌ BAD: Assuming tool type\nconst result = await executeMcpTool(tool)\n\n\u002F\u002F ✅ GOOD: Check tool type\nif (VercelAIMcpToolTag.isMaybe(tool)) {\n  const result = await executeMcpTool(tool)\n} else if (VercelAIWorkflowToolTag.isMaybe(tool)) {\n  const result = await executeWorkflowTool(tool)\n}\n```\n\n### Error #3: FormData Parsing Errors\n\n**Error**: Inconsistent error handling for form submissions\n**Why**: Manual FormData parsing with ad-hoc validation\n**Prevention**: Validators handle parsing automatically\n\n```typescript\n\u002F\u002F ❌ BAD: Manual parsing\nconst name = formData.get(\"name\") as string\nif (!name) throw new Error(\"Name required\")\n\n\u002F\u002F ✅ GOOD: Validator with Zod\nconst schema = z.object({ name: z.string().min(1) })\nexport const action = validatedAction(schema, async (data) => {\n  \u002F\u002F data.name is validated and typed\n})\n```\n\n### Error #4: Cross-Field Validation Issues\n\n**Error**: Password mismatch validation not working\n**Why**: Separate validation for related fields\n**Prevention**: Use Zod `superRefine`\n\n```typescript\n\u002F\u002F ❌ BAD: Separate checks\nif (data.password !== data.confirmPassword) { \u002F* error *\u002F }\n\n\u002F\u002F ✅ GOOD: Zod superRefine\nconst schema = z.object({\n  password: z.string(),\n  confirmPassword: z.string()\n}).superRefine((data, ctx) => {\n  if (data.password !== data.confirmPassword) {\n    ctx.addIssue({\n      code: z.ZodIssueCode.custom,\n      message: \"Passwords don't match\",\n      path: [\"confirmPassword\"]\n    })\n  }\n})\n```\n\n### Error #5: Zustand State Mutation\n\n**Error**: State updates not triggering re-renders\n**Why**: Mutating state directly instead of creating new objects\n**Prevention**: Use shallow updates with spread operator\n\n```typescript\n\u002F\u002F ❌ BAD: Direct mutation\nset((state) => {\n  state.user.name = \"New Name\" \u002F\u002F Mutation!\n})\n\n\u002F\u002F ✅ GOOD: Shallow update\nset((state) => ({\n  user: { ...state.user, name: \"New Name\" }\n}))\n```\n\n**For all errors**: Load `references\u002Fcommon-errors.md` when debugging issues beyond the top 5.\n\n---\n\n## Critical Rules\n\n### Always Do\n\n✅ Use `validatedActionWithUser` or `validatedActionWithAdminPermission` for server actions\n✅ Check tool types with branded type tags before execution\n✅ Use Zod `superRefine` for cross-field validation\n✅ Add unit tests (happy path + one failure mode)\n✅ Run `pnpm check` before PR submission\n✅ Include visual documentation for UI changes\n✅ Use Conventional Commit format for PR titles\n✅ Run E2E tests when touching critical flows\n\n### Never Do\n\n❌ Implement server actions without auth validators\n❌ Assume tool type without runtime check\n❌ Parse FormData manually (use validators)\n❌ Mutate Zustand state directly (use shallow updates)\n❌ Skip first-user tests on clean database\n❌ Commit without running `pnpm check`\n❌ Submit PR without visual docs (if UI change)\n❌ Use non-conventional commit format\n\n---\n\n## When to Load References\n\nLoad reference files when working on specific aspects of better-chatbot:\n\n### API Architecture (`references\u002Fapi-architecture.md`)\nLoad when:\n- Implementing new API routes or endpoints\n- Understanding route handler patterns\n- Working with streaming responses\n- Implementing defensive programming with safe()\n- Troubleshooting API-related issues\n- Building shared business logic\n\n### Tool System (`references\u002Ftool-system.md`)\nLoad when:\n- Adding new MCP tools\n- Creating workflow tools\n- Understanding tool lifecycle\n- Debugging tool execution\n- Implementing tool filtering or mentions\n- Working with the three-tier tool architecture\n\n### Component Patterns (`references\u002Fcomponent-patterns.md`)\nLoad when:\n- Building new UI components\n- Understanding compound component pattern\n- Implementing state management\n- Working with Zustand stores\n- Designing component APIs\n- Separating tool execution from rendering\n\n### Database Patterns (`references\u002Fdatabase-patterns.md`)\nLoad when:\n- Creating new repository classes\n- Writing complex database queries\n- Implementing transactions\n- Understanding the repository pattern\n- Troubleshooting database issues\n- Working with Drizzle ORM\n\n### Architectural Principles (`references\u002Farchitectural-principles.md`)\nLoad when:\n- Making architectural decisions\n- Understanding design philosophy\n- Implementing progressive enhancement\n- Following streaming-first patterns\n- Ensuring defensive programming\n- Understanding DRY principle application\n\n### Extension Points (`references\u002Fextension-points.md`)\nLoad when:\n- Extending the chatbot with custom features\n- Adding new tool types\n- Customizing existing behavior\n- Understanding plugin architecture\n- Integrating external services\n\n### UX Patterns (`references\u002Fux-patterns.md`)\nLoad when:\n- Implementing @mention functionality\n- Understanding UX patterns\n- Working with multi-model support\n- Designing interaction flows\n- Building chat UI components\n\n### Templates (`references\u002Ftemplates.md`)\nLoad when:\n- Adding new routes, tools, or components\n- Following code templates\n- Understanding complete implementation examples\n- Starting new features from scratch\n- Implementing standard patterns\n\n### Server Actions (`references\u002Fserver-actions.md`)\nLoad when:\n- Implementing server actions\n- Understanding action validators\n- Following server-side validation patterns\n- Troubleshooting server action issues\n- Working with FormData\n\n### Common Errors (`references\u002Fcommon-errors.md`)\nLoad when:\n- Debugging issues beyond the top 5 errors\n- Encountering specific error messages\n- Understanding error patterns\n- Looking for solutions to common problems\n- Preventing known issues\n\n### Repository Guidelines (`references\u002FAGENTS.md`)\nLoad when:\n- Understanding project structure\n- Following coding conventions\n- Setting up development environment\n- Running tests or builds\n- Understanding commit\u002FPR guidelines\n\n### Contributing (`references\u002FCONTRIBUTING.md`)\nLoad when:\n- Preparing to contribute\n- Understanding PR process\n- Following commit message conventions\n- Submitting pull requests\n- Adding visual documentation\n\n---\n\n## Using Bundled Resources\n\nThis skill includes 12 reference files:\n\n**Technical References** (10 files):\n- `api-architecture.md` - API patterns and route handlers\n- `tool-system.md` - Three-tier tool architecture\n- `component-patterns.md` - UI component design\n- `database-patterns.md` - Repository pattern and Drizzle ORM\n- `architectural-principles.md` - Design philosophy\n- `extension-points.md` - How to extend the system\n- `ux-patterns.md` - UX patterns and @mentions\n- `templates.md` - Code templates for routes\u002Ftools\u002Fcomponents\n- `server-actions.md` - Server action validators\n- `common-errors.md` - Complete error catalog\n\n**Repository References** (2 files):\n- `AGENTS.md` - Repository structure and development commands\n- `CONTRIBUTING.md` - Contribution workflow and PR guidelines\n\nLoad references on-demand when specific knowledge is needed. See \"When to Load References\" section for triggers.\n\n---\n\n## Dependencies\n\n**Core**:\n- Next.js 15+ (App Router)\n- Vercel AI SDK 5+\n- Better Auth 1.3+\n- Drizzle ORM 0.40+\n- PostgreSQL\n\n**Testing**:\n- Vitest (unit tests)\n- Playwright (E2E tests)\n\n**Tools**:\n- TypeScript 5+\n- Biome (formatting + linting)\n- pnpm 8+\n\n---\n\n## Official Documentation\n\n- **Repository**: https:\u002F\u002Fgithub.com\u002Fcgoinglove\u002Fbetter-chatbot\n- **Vercel AI SDK**: https:\u002F\u002Fsdk.vercel.ai\u002Fdocs\n- **Better Auth**: https:\u002F\u002Fwww.better-auth.com\u002Fdocs\n- **Drizzle ORM**: https:\u002F\u002Form.drizzle.team\u002Fdocs\u002Foverview\n- **MCP Spec**: https:\u002F\u002Fmodelcontextprotocol.io\u002Fintroduction\n\n---\n\n## Production Example\n\nThis skill is based on the production better-chatbot repository with 48 E2E tests covering core functionality, active development, and growing community contributions.\n\n---\n\n**Last verified**: 2025-12-17 | **Version**: 3.0.0\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"version":26,"keywords":27,"upstream":49,"tech_stack":50,"last_verified":51,"token_savings":52,"errors_prevented":53,"optimization_date":51},"Claude Skills Maintainers","3.0.0",[5,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"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","https:\u002F\u002Fgithub.com\u002Fcgoinglove\u002Fbetter-chatbot","Next.js 15, Vercel AI SDK 5, Better Auth, Drizzle ORM, PostgreSQL, Playwright",1765929600000,"~75%",8,"main","c475fc64e94e803b50d14a791dfee8853fbb2c5c","integrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory","https:\u002F\u002Fgithub.com\u002FElogic360","2026-11-08 22:21:22",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add Elogic360\u002Fsoftware-factory --skill better-chatbot",{"tool":66,"command":67},"bunx","bunx skills add Elogic360\u002Fsoftware-factory --skill better-chatbot",{"tool":69,"command":70},"pnpm","pnpm dlx skills add Elogic360\u002Fsoftware-factory --skill better-chatbot","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002FSKILL.md",true,[74,80,86,90,94,98,102,106,110,114,118,122,126,130],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"assets\u002Fexample-template.txt","ASSET","资产文件",416,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Fassets\u002Fexample-template.txt",{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002FAGENTS.md","REFERENCE","参考文档",2259,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002FAGENTS.md",{"path":87,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fapi-architecture.md",4584,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fapi-architecture.md",{"path":91,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Farchitectural-principles.md",1745,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Farchitectural-principles.md",{"path":95,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fcommon-errors.md",2511,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fcommon-errors.md",{"path":99,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fcomponent-patterns.md",3633,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fcomponent-patterns.md",{"path":103,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002FCONTRIBUTING.md",5096,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002FCONTRIBUTING.md",{"path":107,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Fdatabase-patterns.md",3037,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fdatabase-patterns.md",{"path":111,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":112,"sourceHtmlUrl":113},"references\u002Fextension-points.md",3509,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fextension-points.md",{"path":115,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":116,"sourceHtmlUrl":117},"references\u002Fserver-actions.md",1722,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fserver-actions.md",{"path":119,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":120,"sourceHtmlUrl":121},"references\u002Ftemplates.md",5877,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Ftemplates.md",{"path":123,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":124,"sourceHtmlUrl":125},"references\u002Ftool-system.md",4403,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Ftool-system.md",{"path":127,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":128,"sourceHtmlUrl":129},"references\u002Fux-patterns.md",5131,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Freferences\u002Fux-patterns.md",{"path":131,"resourceType":132,"resourceTypeDesc":133,"sizeBytes":134,"sourceHtmlUrl":135},"scripts\u002Fexample-script.sh","SCRIPT","脚本",302,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fbetter-chatbot\u002Fskills\u002Fbetter-chatbot\u002Fscripts\u002Fexample-script.sh",[137,145,152,159,166,173],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":141,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":19},"01M79G206MT3J6S0GY3C45P2KV","vss-summarize-video","Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-summarize-video\u002FSKILL.md",[],[],{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":141,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":19},"01M79G1WN63PGRE8CKD47WEBQ5","vss-setup-video-analytics-api","Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-video-analytics-api\u002FSKILL.md",[],[],{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":141,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":19},"01M79G1S9F7VY3EF6H53PRP5AN","vss-setup-behavior-analytics","Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-behavior-analytics\u002FSKILL.md",[],[],{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":141,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":19},"01M79G1N1S1Y27PFZPYMNK1MTQ","vss-search-archive","Use this skill to run top-level VSS fusion search on archived video, or to ingest video files \u002F RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-search-archive\u002FSKILL.md",[],[],{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":141,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":19},"01M79G1H6WN0Q6C0VCAXCZX6B7","vss-query-analytics","Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-query-analytics\u002FSKILL.md",[],[],{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":141,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":19},"01M79G1DYPNXQS7QHZ0AAF5FX5","vss-manage-video-io-storage","Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add\u002Fdelete sensors and streams). Not for VLM inference or search.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-manage-video-io-storage\u002FSKILL.md",[],[]]