mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
📝 docs: simplify and refresh skill docs (#14785)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: add-provider-doc
|
name: add-provider-doc
|
||||||
description: Guide for adding new AI provider documentation. Use when adding documentation for a new AI provider (like OpenAI, Anthropic, etc.), including usage docs, environment variables, Docker config, and image resources. Triggers on provider documentation tasks.
|
description: Add documentation for a new AI provider — usage docs, env vars, Docker config, image resources.
|
||||||
disable-model-invocation: true
|
disable-model-invocation: true
|
||||||
argument-hint: '[provider-name]'
|
argument-hint: '[provider-name]'
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: add-setting-env
|
name: add-setting-env
|
||||||
description: Guide for adding environment variables to configure user settings. Use when implementing server-side environment variables that control default values for user settings. Triggers on env var configuration or setting default value tasks.
|
description: Add server-side environment variables that control default values for user settings.
|
||||||
disable-model-invocation: true
|
disable-model-invocation: true
|
||||||
argument-hint: '[setting-name]'
|
argument-hint: '[setting-name]'
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: cli
|
name: cli
|
||||||
description: LobeHub CLI (@lobehub/cli) development guide. Use when working on CLI commands, adding new subcommands, fixing CLI bugs, or understanding CLI architecture. Triggers on CLI development, command implementation, or `lh` command questions.
|
description: LobeHub CLI (@lobehub/cli) development guide — commands, subcommands, architecture.
|
||||||
disable-model-invocation: true
|
disable-model-invocation: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: desktop
|
name: desktop
|
||||||
description: Electron desktop development guide. Use when implementing desktop features, IPC handlers, controllers, preload scripts, window management, menu configuration, or Electron-specific functionality. Triggers on desktop app development, Electron IPC, or desktop local tools implementation.
|
description: Electron desktop development guide — IPC handlers, controllers, preload scripts, window/menu management.
|
||||||
disable-model-invocation: true
|
disable-model-invocation: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ user-invocable: false
|
|||||||
|
|
||||||
# LobeHub Project Overview
|
# LobeHub Project Overview
|
||||||
|
|
||||||
|
> The directory listings below are a **curated map of key locations**, not an
|
||||||
|
> exhaustive tree. `packages/`, `src/store/`, route groups etc. grow over time —
|
||||||
|
> run `ls` against the real directory for the current set.
|
||||||
|
|
||||||
## Project Description
|
## Project Description
|
||||||
|
|
||||||
Open-source, modern-design AI Agent Workspace: **LobeHub** (previously LobeChat).
|
Open-source, modern-design AI Agent Workspace: **LobeHub** (previously LobeChat).
|
||||||
@@ -14,7 +18,7 @@ Open-source, modern-design AI Agent Workspace: **LobeHub** (previously LobeChat)
|
|||||||
|
|
||||||
- Web desktop/mobile
|
- Web desktop/mobile
|
||||||
- Desktop (Electron)
|
- Desktop (Electron)
|
||||||
- Mobile app (React Native) - coming soon
|
- Mobile app (React Native) — **separate repo, already launched** (not in this monorepo)
|
||||||
|
|
||||||
**Logo emoji:** 🤯
|
**Logo emoji:** 🤯
|
||||||
|
|
||||||
@@ -39,147 +43,92 @@ Open-source, modern-design AI Agent Workspace: **LobeHub** (previously LobeChat)
|
|||||||
| Database | Neon PostgreSQL + Drizzle ORM |
|
| Database | Neon PostgreSQL + Drizzle ORM |
|
||||||
| Testing | Vitest |
|
| Testing | Vitest |
|
||||||
|
|
||||||
## Complete Project Structure
|
> Exact versions live in the root `package.json` — check there, not here.
|
||||||
|
|
||||||
Monorepo using `@lobechat/` namespace for workspace packages.
|
## Monorepo Layout
|
||||||
|
|
||||||
|
This is a monorepo extending the open-source `lobehub` submodule. Two repos:
|
||||||
|
|
||||||
|
- **cloud repo root** — `src/` and `packages/business/` (`config`, `const`, `model-runtime`) hold cloud-only SaaS code that overrides/extends the submodule. See `AGENTS.md` for the override mechanism.
|
||||||
|
- **`lobehub/` submodule** — the open-source product core.
|
||||||
|
|
||||||
|
### `lobehub/` submodule — key directories
|
||||||
|
|
||||||
```
|
```
|
||||||
lobehub/
|
lobehub/
|
||||||
├── apps/
|
├── apps/
|
||||||
│ └── desktop/ # Electron desktop app
|
│ ├── cli/ # LobeHub CLI
|
||||||
├── docs/
|
│ ├── desktop/ # Electron desktop app
|
||||||
│ ├── changelog/
|
│ └── device-gateway/ # Device gateway service
|
||||||
│ ├── development/
|
├── docs/ # changelog, development, self-hosting, usage
|
||||||
│ ├── self-hosting/
|
├── locales/ # en-US, zh-CN, ...
|
||||||
│ └── usage/
|
├── packages/ # ~80 @lobechat/* workspace packages — `ls` for the full set. Key ones:
|
||||||
├── locales/
|
│ ├── agent-runtime/ # Agent runtime
|
||||||
│ ├── en-US/
|
│ ├── agent-signal/ # Agent Signal pipeline
|
||||||
│ └── zh-CN/
|
│ ├── builtin-tool-*/ # Builtin tool packages
|
||||||
├── packages/
|
│ ├── builtin-tools/ # Builtin tool registries
|
||||||
│ ├── agent-runtime/ # Agent runtime
|
|
||||||
│ ├── builtin-agents/
|
|
||||||
│ ├── builtin-tool-*/ # Builtin tool packages
|
|
||||||
│ ├── business/ # Cloud-only business logic
|
|
||||||
│ │ ├── config/
|
|
||||||
│ │ ├── const/
|
|
||||||
│ │ └── model-runtime/
|
|
||||||
│ ├── config/
|
|
||||||
│ ├── const/
|
|
||||||
│ ├── context-engine/
|
│ ├── context-engine/
|
||||||
│ ├── conversation-flow/
|
│ ├── database/ # src/{models,schemas,repositories}
|
||||||
│ ├── database/
|
│ ├── model-bank/ # Model definitions & provider cards
|
||||||
│ │ └── src/
|
│ ├── model-runtime/ # src/{core,providers}
|
||||||
│ │ ├── models/
|
|
||||||
│ │ ├── schemas/
|
|
||||||
│ │ └── repositories/
|
|
||||||
│ ├── desktop-bridge/
|
|
||||||
│ ├── edge-config/
|
|
||||||
│ ├── editor-runtime/
|
|
||||||
│ ├── electron-client-ipc/
|
|
||||||
│ ├── electron-server-ipc/
|
|
||||||
│ ├── fetch-sse/
|
|
||||||
│ ├── file-loaders/
|
|
||||||
│ ├── memory-user-memory/
|
|
||||||
│ ├── model-bank/
|
|
||||||
│ ├── model-runtime/
|
|
||||||
│ │ └── src/
|
|
||||||
│ │ ├── core/
|
|
||||||
│ │ └── providers/
|
|
||||||
│ ├── observability-otel/
|
|
||||||
│ ├── prompts/
|
|
||||||
│ ├── python-interpreter/
|
|
||||||
│ ├── ssrf-safe-fetch/
|
|
||||||
│ ├── types/
|
|
||||||
│ ├── utils/
|
|
||||||
│ └── web-crawler/
|
|
||||||
├── src/
|
|
||||||
│ ├── app/
|
|
||||||
│ │ ├── (backend)/
|
|
||||||
│ │ │ ├── api/
|
|
||||||
│ │ │ ├── f/
|
|
||||||
│ │ │ ├── market/
|
|
||||||
│ │ │ ├── middleware/
|
|
||||||
│ │ │ ├── oidc/
|
|
||||||
│ │ │ ├── trpc/
|
|
||||||
│ │ │ └── webapi/
|
|
||||||
│ │ ├── spa/ # SPA HTML template service
|
|
||||||
│ │ └── [variants]/
|
|
||||||
│ │ └── (auth)/ # Auth pages (SSR required)
|
|
||||||
│ ├── routes/ # SPA page components (Vite)
|
|
||||||
│ │ ├── (main)/
|
|
||||||
│ │ ├── (mobile)/
|
|
||||||
│ │ ├── (desktop)/
|
|
||||||
│ │ ├── onboarding/
|
|
||||||
│ │ └── share/
|
|
||||||
│ ├── spa/ # SPA entry points and router config
|
|
||||||
│ │ ├── entry.web.tsx
|
|
||||||
│ │ ├── entry.mobile.tsx
|
|
||||||
│ │ ├── entry.desktop.tsx
|
|
||||||
│ │ └── router/
|
|
||||||
│ ├── business/ # Cloud-only (client/server)
|
|
||||||
│ │ ├── client/
|
|
||||||
│ │ ├── locales/
|
|
||||||
│ │ └── server/
|
|
||||||
│ ├── components/
|
|
||||||
│ ├── config/
|
|
||||||
│ ├── const/
|
|
||||||
│ ├── envs/
|
|
||||||
│ ├── features/
|
|
||||||
│ ├── helpers/
|
|
||||||
│ ├── hooks/
|
|
||||||
│ ├── layout/
|
|
||||||
│ │ ├── AuthProvider/
|
|
||||||
│ │ └── GlobalProvider/
|
|
||||||
│ ├── libs/
|
|
||||||
│ │ ├── better-auth/
|
|
||||||
│ │ ├── oidc-provider/
|
|
||||||
│ │ └── trpc/
|
|
||||||
│ ├── locales/
|
|
||||||
│ │ └── default/
|
|
||||||
│ ├── server/
|
|
||||||
│ │ ├── featureFlags/
|
|
||||||
│ │ ├── globalConfig/
|
|
||||||
│ │ ├── modules/
|
|
||||||
│ │ ├── routers/
|
|
||||||
│ │ │ ├── async/
|
|
||||||
│ │ │ ├── lambda/
|
|
||||||
│ │ │ ├── mobile/
|
|
||||||
│ │ │ └── tools/
|
|
||||||
│ │ └── services/
|
|
||||||
│ ├── services/
|
|
||||||
│ ├── store/
|
|
||||||
│ │ ├── agent/
|
|
||||||
│ │ ├── chat/
|
|
||||||
│ │ └── user/
|
|
||||||
│ ├── styles/
|
|
||||||
│ ├── tools/
|
|
||||||
│ ├── types/
|
│ ├── types/
|
||||||
│ └── utils/
|
│ └── utils/
|
||||||
└── e2e/ # E2E tests (Cucumber + Playwright)
|
└── src/
|
||||||
|
├── app/
|
||||||
|
│ ├── (backend)/ # api, f, market, middleware, oidc, trpc, webapi
|
||||||
|
│ ├── spa/ # SPA HTML template service
|
||||||
|
│ └── [variants]/(auth)/ # Auth pages (SSR required)
|
||||||
|
├── routes/ # SPA page segments (thin — delegate to features/)
|
||||||
|
│ └── (main)/ (mobile)/ (desktop)/ (popup)/ onboarding/ share/
|
||||||
|
├── spa/ # SPA entries + router config
|
||||||
|
│ ├── entry.{web,mobile,desktop,popup}.tsx
|
||||||
|
│ └── router/
|
||||||
|
├── business/ # Open-source stubs (~50) overridden by cloud src/business/
|
||||||
|
├── features/ # Domain business components
|
||||||
|
├── store/ # ~28 zustand stores — `ls` for the full set
|
||||||
|
├── server/ # featureFlags, globalConfig, modules, routers, services
|
||||||
|
└── ... # components, hooks, layout, libs, locales, services, types, utils
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### cloud repo — key directories
|
||||||
|
|
||||||
|
```
|
||||||
|
(cloud root)
|
||||||
|
├── packages/business/ # Cloud overrides: config, const, model-runtime
|
||||||
|
├── src/
|
||||||
|
│ ├── business/ # Cloud impls of submodule stubs (client/server/locales)
|
||||||
|
│ ├── routes/ # Cloud-only route groups: (cloud)/, embed/
|
||||||
|
│ ├── store/ # Cloud-only stores (e.g. subscription/)
|
||||||
|
│ ├── server/ # Cloud routers & services (billing, budget, risk control...)
|
||||||
|
│ └── app/(backend)/cron/ # Vercel cron routes (schedules declared in root vercel.ts)
|
||||||
|
└── vercel.ts # Cron schedule declarations
|
||||||
|
```
|
||||||
|
|
||||||
|
> File search rule: a path like `@/store/x` resolves cloud `src/store/x` first, then
|
||||||
|
> `lobehub/packages/store/src/x`, then `lobehub/src/store/x`. Cloud override wins.
|
||||||
|
|
||||||
## Architecture Map
|
## Architecture Map
|
||||||
|
|
||||||
| Layer | Location |
|
| Layer | Location |
|
||||||
| ---------------- | --------------------------------------------------- |
|
| ---------------- | ---------------------------------------------------- |
|
||||||
| UI Components | `src/components`, `src/features` |
|
| UI Components | `src/components`, `src/features` |
|
||||||
| SPA Pages | `src/routes/` |
|
| SPA Pages | `src/routes/` |
|
||||||
| React Router | `src/spa/router/` |
|
| React Router | `src/spa/router/` |
|
||||||
| Global Providers | `src/layout` |
|
| Global Providers | `src/layout` |
|
||||||
| Zustand Stores | `src/store` |
|
| Zustand Stores | `src/store` |
|
||||||
| Client Services | `src/services/` |
|
| Client Services | `src/services/` |
|
||||||
| REST API | `src/app/(backend)/webapi` |
|
| REST API | `src/app/(backend)/webapi` |
|
||||||
| tRPC Routers | `src/server/routers/{async\|lambda\|mobile\|tools}` |
|
| tRPC Routers | `src/server/routers/{async\|lambda\|mobile\|tools}` |
|
||||||
| Server Services | `src/server/services` (can access DB) |
|
| Server Services | `src/server/services` (can access DB) |
|
||||||
| Server Modules | `src/server/modules` (no DB access) |
|
| Server Modules | `src/server/modules` (no DB access) |
|
||||||
| Feature Flags | `src/server/featureFlags` |
|
| Feature Flags | `src/server/featureFlags` |
|
||||||
| Global Config | `src/server/globalConfig` |
|
| Global Config | `src/server/globalConfig` |
|
||||||
| DB Schema | `packages/database/src/schemas` |
|
| DB Schema | `packages/database/src/schemas` |
|
||||||
| DB Model | `packages/database/src/models` |
|
| DB Model | `packages/database/src/models` |
|
||||||
| DB Repository | `packages/database/src/repositories` |
|
| DB Repository | `packages/database/src/repositories` |
|
||||||
| Third-party | `src/libs` (analytics, oidc, etc.) |
|
| Third-party | `src/libs` (analytics, oidc, etc.) |
|
||||||
| Builtin Tools | `src/tools`, `packages/builtin-tool-*` |
|
| Builtin Tools | `src/tools`, `packages/builtin-tool-*` |
|
||||||
| Cloud-only | `src/business/*`, `packages/business/*` |
|
| Cloud-only | `src/business/*`, `packages/business/*` (cloud repo) |
|
||||||
|
|
||||||
## Data Flow
|
## Data Flow
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: version-release
|
name: version-release
|
||||||
description: "Version release workflow. Use when the user mentions 'release', 'hotfix', 'version upgrade', 'weekly release', or '发版'/'发布'/'小班车'. This skill is for release process and GitHub Release notes (not docs/changelog page writing)."
|
description: 'Version release workflow — release process and GitHub Release notes (not docs/changelog pages).'
|
||||||
disable-model-invocation: true
|
disable-model-invocation: true
|
||||||
argument-hint: '[minor|patch] [version?]'
|
argument-hint: '[minor|patch] [version?]'
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user