lobehub/lobehub▌
22 approved skills in this repository
drizzle
Productivity
Drizzle ORM schema definitions, type inference, and query patterns for PostgreSQL databases. \n \n Enforces snake_case naming (tables plural, columns lowercase), helper functions for timestamps, and ID prefixes for entity type distinction \n Provides type inference patterns ( $inferInsert , $inferSelect ) and schema validation via createInsertSchema \n Requires db.select() builder API for all queries; explicitly forbids the relational API ( findMany , with: ) due to fragile lateral join generati
zustand
Productivity
Zustand state management patterns and conventions for LobeHub store development. \n \n Three-tier action hierarchy: public actions for UI, internal actions for business logic, and dispatch methods for state updates; use reducer pattern for complex state and simple set for primitives \n Optimistic update pattern for non-destructive operations: update frontend immediately, call backend service, then refresh for consistency \n Class-based action implementation using private fields and flattenAction
microcopy
Marketing
Collaborative agent UI copy guidelines for LobeHub, covering buttons, errors, onboarding, and user-facing text in English and Chinese. \n \n Fixed terminology table ensures consistency across 18 key terms (Workspace, Agent, Integration, etc.) in both languages \n Brand principles emphasize clarity, multi-agent collaboration, and explainability; writing rules favor short sentences, strong verbs, and actionable next steps \n Human warmth calibrated to context: 80/20 information-to-warmth by defaul
project-overview
Productivity
Complete project architecture guide for LobeHub, an open-source AI Agent Workspace built on Next.js and React. \n \n Monorepo structure with @lobechat/ namespace packages covering agent runtime, model providers, database, tools, and platform-specific bridges (Electron, web, mobile) \n Tech stack includes Next.js 16, React 19, TypeScript, Zustand for state, tRPC for type-safe APIs, Neon PostgreSQL with Drizzle ORM, and antd-style for CSS-in-JS \n Three deployment targets: web (desktop/mobile), El
vercel-react-best-practices
Frontend
45 React and Next.js performance rules organized by impact, from eliminating waterfalls to advanced patterns. \n \n Covers 8 priority categories spanning async optimization, bundle size, server/client data fetching, re-renders, rendering, JavaScript performance, and advanced patterns \n Each rule includes explanation, before/after code examples, and context; rules prefixed by category (e.g., async- , bundle- , server- ) for easy reference \n Prioritizes critical issues like waterfall elimination
i18n
Productivity
Internationalization setup for React apps using react-i18next with flat dot-notation keys. \n \n Use flat key structure with dot notation (e.g., feature.context.action ) in src/locales/default/ files; never edit JSON files in locales/ \n Support dynamic parameters via {{variableName}} syntax and access translations in components with useTranslation() hook \n Run pnpm i18n to auto-generate translations for all languages; manually translate zh-CN and en-US files for dev preview \n Common namespace
data-fetching
Productivity
Related Skills:
debug
Productivity
Debug logging utility with namespace-based filtering across desktop, server, and client environments. \n \n Follows strict namespace conventions (e.g., lobe-server:[module] , lobe-desktop:[module] ) to organize logs by platform and module \n Supports format specifiers including %O for expanded objects, %s for strings, and %d for numbers \n Enable output via localStorage.debug in browsers, DEBUG environment variable in Node.js, or process.env.DEBUG in Electron \n Wildcard filtering (e.g., lobe-*
desktop
Productivity
Electron desktop development guide for LobeHub's main-renderer architecture. \n \n Covers controller creation, IPC type definitions, renderer services, and store actions for adding new desktop features \n Includes security best practices: input validation, limited API exposure, and preload script patterns for safe main-renderer communication \n Provides structured references for feature implementation, local tools workflow, menu configuration, and window management \n Emphasizes async methods, b
upstash-workflow
Productivity
This guide covers the standard patterns for implementing Upstash Workflow + QStash async workflows in the LobeHub codebase.
store-data-structures
Productivity
This guide covers how to structure data in Zustand stores for optimal performance and user experience.
version-release
Productivity
The primary development branch is canary. All day-to-day development happens on canary. When releasing, canary is merged into main. After merge, auto-tag-release.yml automatically handles tagging, version bumping, creating a GitHub Release, and syncing back to the canary branch.
hotkey
Productivity
Structured guide for implementing keyboard shortcuts in a chat application. \n \n Covers five-step implementation process: defining hotkey constants, registering default key combinations, adding i18n translations, creating and registering hooks, and optionally adding tooltips \n Supports scope-based hotkey management (global or chat-specific) with conflict detection and platform-agnostic key modifiers \n Includes best practices for grouping, conflict checking, and clear user descriptions, plus t
recent-data
Productivity
Session store integration for tracking recently accessed topics, resources, and pages. \n \n Three initialization hooks ( useInitRecentTopic , useInitRecentResource , useInitRecentPage ) load recent data into session store at app startup \n Read recent data via selectors ( recentSelectors.recentTopics , etc.) or hook return values; selectors are recommended for multi-component access \n Built-in features include auto login detection, data caching, SWR-based auto-refresh on focus, and full TypeSc
linear
Productivity
Linear issue management with workflows for retrieving, updating, and commenting on LOBE-xxx issues. \n \n Retrieve issue details, check for sub-issues, and update status using dedicated MCP tools before and after work \n Automatically link PRs to Linear issues using magic keywords (Fixes/Closes/Resolves LOBE-xxx) in PR body \n Add completion comments to all referenced issues immediately after PR creation with a standardized format summarizing changes, files modified, and PR reference \n Create n
add-setting-env
Productivity
Guide for implementing server-side environment variables to configure default user settings. \n \n Follows a three-tier priority system: user custom settings override server environment variables, which override hardcoded defaults \n Requires defining the environment variable in a domain-specific config file using @t3-oss/env-nextjs and Zod validation \n For new domains, involves updating type definitions, assembling server config, and merging settings into the user store \n Includes documentati
add-provider-doc
Documents
Step-by-step guide for documenting new AI provider integrations across docs, environment variables, and Docker configs. \n \n Create bilingual usage documentation (English and Chinese) with 5-6 screenshots, cover images, registration URLs, and pricing callouts, using placeholder API keys only \n Add environment variable documentation for both languages covering required API keys and optional model list configuration with examples \n Update three Dockerfile variants and .env.example with provider
modal
Productivity
Imperative modal dialog creation using createModal from @lobehub/ui. \n \n Eliminates the need for open state management by calling a function directly instead of rendering a declarative component \n Provides useModalContext hook within modal content to access close() and setCanDismissByClickOutside() methods \n Supports configuration for fullscreen mode, footer content, width, and destroy-on-hidden behavior \n Requires separate i18n handling: useTranslation hook in content components, direct i1
testing
Testing
Vitest testing guide for LobeHub with commands, patterns, and best practices. \n \n Run specific test files with bunx vitest run commands; avoid bun run test which runs 3000+ tests (~10 minutes) \n Prefer vi.spyOn over vi.mock for targeted, maintainable mocks; use vi.stubGlobal for browser APIs \n Test observable behavior rather than implementation details; delete param-forwarding tests that duplicate higher-level coverage \n Includes detailed guides for database models, Electron IPC, Zustand st
typescript
Backend
$22
react
Frontend
$23
pr
Productivity
If current branch is canary (or main) AND there are uncommitted changes: