Agent Skillslobehub/lobehub › project-overview

project-overview

GitHub

提供 LobeHub monorepo 架构地图,涵盖技术栈、目录结构及核心模块说明。用于帮助开发者快速理解项目布局、定位代码层级及进行仓库入职引导。

.agents/skills/project-overview/SKILL.md lobehub/lobehub

Trigger Scenarios

需要了解项目整体架构或目录结构 初次加入仓库需要入职引导 查找特定功能模块(如 agent-runtime)的位置

Install

npx skills add lobehub/lobehub --skill project-overview -g -y
More Options

Non-standard path

npx skills add https://github.com/lobehub/lobehub/tree/canary/.agents/skills/project-overview -g -y

Use without installing

npx skills use lobehub/lobehub@project-overview

指定 Agent (Claude Code)

npx skills add lobehub/lobehub --skill project-overview -a claude-code -g -y

安装 repo 全部 skill

npx skills add lobehub/lobehub --all -g -y

预览 repo 内 skill

npx skills add lobehub/lobehub --list

SKILL.md

Frontmatter
{
    "name": "project-overview",
    "description": "LobeHub open-source monorepo architecture map. Use when locating code layers, understanding apps\/packages\/src layout, business stubs, project structure, or onboarding to the repository.",
    "user-invocable": false
}

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

Open-source, modern-design AI Agent Workspace: LobeHub (previously LobeChat). This repo is the open-source root (github.com/lobehub/lobehub, package @lobehub/lobehub).

Supported platforms:

  • Web desktop/mobile
  • Desktop (Electron) — apps/desktop
  • Mobile app (React Native) — separate repo, already launched (not in this monorepo)

Logo emoji: 🤯

Complete Tech Stack

Category Technology
Framework Next.js 16 + React 19
Routing SPA inside Next.js with react-router-dom
Language TypeScript
UI Components @lobehub/ui, antd
CSS-in-JS antd-style
Icons lucide-react, @ant-design/icons
i18n react-i18next
State zustand
URL Params nuqs
Data Fetching SWR
React Hooks aHooks
Date/Time dayjs
Utilities es-toolkit
API TRPC (type-safe)
Database Neon PostgreSQL + Drizzle ORM
Testing Vitest

Exact versions live in the root package.json — check there, not here.

Monorepo Layout

Flat layout — apps/, packages/, and src/ all sit at the repo root. No git submodules.

(repo root)
├── apps/
│   ├── cli/                  # LobeHub CLI
│   ├── desktop/              # Electron desktop app
│   └── server/               # Next.js-backed server (`@/server/*` alias)
│       └── src/
│           ├── router-hono/  # Hono endpoint routers and standalone runtime
│           └── ...           # featureFlags, globalConfig, modules, routers, services, utils, workflows
├── docs/                     # changelog, development, self-hosting, usage
├── locales/                  # en-US, zh-CN, ...
├── packages/                 # ~80 @lobechat/* workspace packages — `ls` for the full set. Key ones:
│   ├── agent-runtime/        # Agent runtime core
│   ├── agent-signal/         # Agent Signal pipeline
│   ├── agent-tracing/        # Tracing / snapshots
│   ├── builtin-tool-*/       # Per-tool packages (calculator, web-browsing, claude-code, ...)
│   ├── builtin-tools/        # Central registries that compose builtin-tool-*
│   ├── context-engine/
│   ├── database/             # src/{models,schemas,repositories}
│   ├── model-bank/           # Model definitions & provider cards
│   ├── model-runtime/        # src/{core,providers}
│   ├── locales/              # i18n source of truth: packages/locales/src/default/
│   ├── env/                  # env schemas (@/envs/* → packages/env/src/*)
│   ├── app-config/
│   ├── business/             # Open-source stubs (config, const, model-bank, model-runtime) — overridden by cloud
│   ├── types/
│   └── utils/
└── src/
    ├── app/
    │   ├── (backend)/        # api, f, market, middleware, oidc, trpc, webapi
    │   ├── spa/              # SPA HTML template service
    │   └── spa-auth/         # Auth HTML shell (SSR)
    ├── routes/               # SPA page segments (thin — delegate to features/)
    │   └── (main)/ (mobile)/ (desktop)/ (popup)/ auth/ onboarding/ share/
    ├── spa/                  # SPA entries + router config
    │   ├── entry.{web,mobile,desktop,popup}.tsx
    │   └── router/
    ├── business/             # Open-source stubs (client/server) — cloud repo provides real impls
    ├── features/             # Domain business components
    ├── store/                # ~30 zustand stores — `ls` for the full set
    └── ...                   # components, hooks, layout, libs, services, types, utils

Architecture Map

Layer Location
UI Components src/components, src/features
SPA Pages src/routes/
React Router src/spa/router/
Global Providers src/layout
Zustand Stores src/store
Client Services src/services/
REST API src/app/(backend)/webapi
tRPC Routers apps/server/src/routers/{async|lambda|mobile|tools}
Server Services apps/server/src/services (can access DB)
Server Modules apps/server/src/modules (no DB access)
Feature Flags apps/server/src/featureFlags
Global Config apps/server/src/globalConfig
DB Schema packages/database/src/schemas
DB Model packages/database/src/models
DB Repository packages/database/src/repositories
Third-party src/libs (analytics, oidc, etc.)
Builtin Tools packages/builtin-tool-*, packages/builtin-tools
Open-source stub src/business/*, packages/business/* (this repo)

Data Flow

React UI → Store Actions → Client Service → TRPC Lambda → Server Services → DB Model → PostgreSQL

Note: Relationship to the Cloud Repo

This open-source repo is consumed by a separate, private cloud (SaaS) repo as a git submodule mounted at lobehub/. The cloud repo provides:

  • src/business/{client,server} and packages/business/* implementations that override the stubs shipped here.
  • Cloud-only routes (e.g. (cloud)/, embed/), cloud-only stores (e.g. subscription/), cloud-only TRPC routers (billing, budget, risk control, …), and Vercel cron routes under src/app/(backend)/cron/.
  • File-resolution order in cloud: @/store/x → cloud src/store/x first, then lobehub/packages/store/src/x, then lobehub/src/store/x. Cloud override wins.

When working in this repo alone, ignore the cloud layer — the stubs in src/business/ and packages/business/ are the source of truth here.

Version History

  • 29fe043 Current 2026-08-20 18:34

Same Skill Collection

.agents/skills/add-provider-doc/SKILL.md
.agents/skills/add-setting-env/SKILL.md
.agents/skills/agent-runtime-hooks/SKILL.md
.agents/skills/agent-signal/SKILL.md
.agents/skills/agent-testing-bot/SKILL.md
.agents/skills/agent-tracing/SKILL.md
.agents/skills/agent-work/SKILL.md
.agents/skills/builtin-tool/SKILL.md
.agents/skills/chat-sdk/SKILL.md
.agents/skills/cleanup-git-worktrees/SKILL.md
.agents/skills/cli/SKILL.md
.agents/skills/data-fetching-architecture/SKILL.md
.agents/skills/db-migrations/SKILL.md
.agents/skills/debug-package/SKILL.md
.agents/skills/deep-review/SKILL.md
.agents/skills/design-prototype/SKILL.md
.agents/skills/desktop/SKILL.md
.agents/skills/docs-changelog/SKILL.md
.agents/skills/drizzle/SKILL.md
.agents/skills/heterogeneous-agent/SKILL.md
.agents/skills/hotkey/SKILL.md
.agents/skills/i18n/SKILL.md
.agents/skills/linear/SKILL.md
.agents/skills/llm-generation/SKILL.md
.agents/skills/modal/SKILL.md
.agents/skills/model-bank-metadata/SKILL.md
.agents/skills/product-design/SKILL.md
.agents/skills/react/SKILL.md
.agents/skills/response-compliance/SKILL.md
.agents/skills/skills-audit/SKILL.md
.agents/skills/spa-routes/SKILL.md
.agents/skills/split-micro-app/SKILL.md
.agents/skills/store-data-structures/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/trpc-router/SKILL.md
.agents/skills/typescript/SKILL.md
.agents/skills/upstash-workflow/SKILL.md
.agents/skills/ux-audit/SKILL.md
.agents/skills/ux/SKILL.md
.agents/skills/version-release/SKILL.md
.agents/skills/zustand/SKILL.md
.agents/skills/agent-testing/SKILL.md
.agents/skills/compose-atoms/SKILL.md
.agents/skills/debug-frontend-with-browser/SKILL.md
.agents/skills/pr/SKILL.md
packages/builtin-skills/src/acceptance/SKILL.md

Metadata

Files
0
Version
a06b4e2
Hash
441852f0
Indexed
2026-08-20 18:34

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 14:56
浙ICP备14020137号-1 $お客様$