Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

📝 docs: refresh stale agent skills and fix scrambled CLI refs (#20014)

YuTengjing70a3d94ad44d
diff --git a/.agents/skills/add-model-provider/SKILL.md b/.agents/skills/add-model-provider/SKILL.md
index aa62785d29f..cb9f59deec8 100644
--- a/.agents/skills/add-model-provider/SKILL.md
+++ b/.agents/skills/add-model-provider/SKILL.md
@@ -7,7 +7,7 @@ argument-hint: '[provider-name]'
# Add a Model Provider
-Deliver a provider that users can configure, recognize, and use through the supported API paths. This skill includes the documentation workflow formerly maintained in `add-provider-doc`.
+Deliver a provider that users can configure, recognize, and use through the supported API paths. This skill includes the provider documentation workflow.
Paths below are relative to the open-source repository root. In a Cloud checkout, prefix them with `lobehub/` and follow the parent repository's install and Git rules. Hosted model configuration is a separate workflow: use the deployment operator's model-onboarding process when that is the requested target. Do not copy private deployment settings or routing information into this skill or an OSS change.
diff --git a/.agents/skills/add-model-provider/references/documentation.md b/.agents/skills/add-model-provider/references/documentation.md
index 631b464770c..d30868d79ee 100644
--- a/.agents/skills/add-model-provider/references/documentation.md
+++ b/.agents/skills/add-model-provider/references/documentation.md
@@ -1,6 +1,6 @@
# Provider Documentation
-This replaces the former `add-provider-doc` workflow. Use it for a new integration or a documentation-only update. Derive instructions from implemented behavior and verified public sources, not from a generic API-key template.
+Use this workflow for a new integration or a documentation-only update. Derive instructions from implemented behavior and verified public sources, not from a generic API-key template.
## Usage Guide
diff --git a/.agents/skills/add-model-provider/references/integration-map.md b/.agents/skills/add-model-provider/references/integration-map.md
index 0920f3e8eea..866cf7bb59c 100644
--- a/.agents/skills/add-model-provider/references/integration-map.md
+++ b/.agents/skills/add-model-provider/references/integration-map.md
@@ -32,7 +32,7 @@ Read these as evidence of different integration shapes, not as code to copy whol
- [PR lobehub#17527](https://github.com/lobehub/lobehub/pull/17527), ChatGPT subscription authentication: a provider with OAuth device authorization, account metadata and Responses support. The diff also extends reasoning-signature transport and structured generation. It does not establish that all providers need OAuth, private protocol headers, or shared streaming changes. Its reported public endpoint checks are not proof of live authenticated inference.
- [PR lobehub#13713](https://github.com/lobehub/lobehub/pull/13713), AntGroup: a conventional API-key provider using the OpenAI-compatible factory, environment bindings, separate model/provider cards and provider-specific reasoning controls. Missing runtime tests or setup documentation in an older diff do not exempt a new integration from validation or documentation.
-- [PR lobehub#19152](https://github.com/lobehub/lobehub/pull/19152), Meta: Responses-only chat and structured generation, explicit RouterRuntime registration and package export, independent provider/model branding, and deliberate list placement. This was an open PR when inspected on 2026-09-06; verify which changes exist in the checkout before reusing them. Its shared error-translation and Workbench fixes are conditional regression lessons, not files every provider must modify.
+- [PR lobehub#19152](https://github.com/lobehub/lobehub/pull/19152), Meta: Responses-only chat and structured generation, explicit RouterRuntime registration and package export, independent provider/model branding, and deliberate list placement. Its shared error-translation and Workbench fixes are conditional regression lessons, not files every provider must modify.
## Focused Regression Lessons
diff --git a/.agents/skills/agent-runtime-hooks/SKILL.md b/.agents/skills/agent-runtime-hooks/SKILL.md
index 20f6070727b..6c942f960d7 100644
--- a/.agents/skills/agent-runtime-hooks/SKILL.md
+++ b/.agents/skills/agent-runtime-hooks/SKILL.md
@@ -203,7 +203,3 @@ Note: CallAgent hooks require `parentOperationId` in `ExecSubAgentTaskParams`.
- **Local only**: `beforeToolCall` mock only works in local mode (in-memory hooks). Webhook mode does not support mocking.
- **Scoped per operation**: Auto-cleaned via `hookDispatcher.unregister()` on completion.
- **Sandbox/MCP**: No separate hooks — they go through `executeTool`, so `beforeToolCall`/`afterToolCall` cover them. Use `event.identifier` to filter.
-
-## Real-World Example: agent-evals
-
-See `devtools/agent-evals/helpers/runner.ts` — `createEvalHooks()` uses `afterStep`, `onComplete`, `afterToolCall`, and `beforeToolCall` (for mock).
diff --git a/.agents/skills/builtin-tool/SKILL.md b/.agents/skills/builtin-tool/SKILL.md
index b06fe315460..400a71d70b8 100644
--- a/.agents/skills/builtin-tool/SKILL.md
+++ b/.agents/skills/builtin-tool/SKILL.md
@@ -80,7 +80,7 @@ packages/builtin-tool-<name>/
└── components/ # shared subcomponents used by the surfaces above
```
-**Older packages** (`builtin-tool-task`, `builtin-tool-calculator`, etc.) still have `src/executor/` as a sibling of `src/client/`. That's grandfathered; **don't relocate without a deliberate refactor**. New packages and new APIs added to existing packages should follow the layout above.
+**Older packages** (`builtin-tool-calculator`, etc.) still have `src/executor/` as a sibling of `src/client/`. That's grandfathered; **don't relocate without a deliberate refactor**. New packages and new APIs added to existing packages should follow the layout above.
`package.json` exports map:
diff --git a/.agents/skills/builtin-tool/references/architecture.md b/.agents/skills/builtin-tool/references/architecture.md
index 93ad86413a6..989be33c669 100644
--- a/.agents/skills/builtin-tool/references/architecture.md
+++ b/.agents/skills/builtin-tool/references/architecture.md
@@ -65,7 +65,7 @@ The split exists so:
## Why ExecutionRuntime is the Default Home for Logic
-**Old pattern (grandfathered):** business logic in `src/executor/` directly. Examples: `builtin-tool-task`, older tools. Works, but the executor mixes runtime logic with frontend service plumbing — hard to reuse on the server.
+**Old pattern (grandfathered):** business logic in `src/executor/` directly. Examples: `builtin-tool-calculator`, older tools. Works, but the executor mixes runtime logic with frontend service plumbing — hard to reuse on the server.
**New pattern (preferred):** business logic in `src/ExecutionRuntime/`, frontend wiring in `src/client/executor/`. Examples: `builtin-tool-local-system`, `builtin-tool-web-browsing`, `builtin-tool-calculator`.
diff --git a/.agents/skills/chat-sdk/SKILL.md b/.agents/skills/chat-sdk/SKILL.md
index 19e9ef80ed3..02e8bce4755 100644
--- a/.agents/skills/chat-sdk/SKILL.md
+++ b/.agents/skills/chat-sdk/SKILL.md
@@ -25,8 +25,8 @@ Key docs to read based on task:
- `docs/cards.mdx` — JSX interactive cards
- `docs/actions.mdx` — button/dropdown handlers
- `docs/modals.mdx` — form dialogs (Slack only)
-- `docs/adapters/*.mdx` — platform-specific adapter setup
-- `docs/state/*.mdx` — state adapter config (Redis, ioredis, memory)
+- `docs/adapters.mdx`, `docs/platform-adapters.mdx` — adapter overview and platform-specific setup
+- `docs/state-adapters.mdx` — state adapter config (Redis, ioredis, memory)
Also read the TypeScript types from `node_modules/chat/dist/` to understand the full API surface.
@@ -86,7 +86,7 @@ Pass any `AsyncIterable<string>` to `thread.post()`. Works with AI SDK's `textSt
```typescript
import { ToolLoopAgent } from 'ai';
-const agent = new ToolLoopAgent({ model: 'anthropic/claude-4.5-sonnet' });
+const agent = new ToolLoopAgent({ model: 'anthropic/claude-sonnet-5' });
bot.onNewMention(async (thread, message) => {
const result = await agent.stream({ prompt: message.text });
diff --git a/.agents/skills/cli/references/agent.md b/.agents/skills/cli/references/agent.md
index f4611f1391c..a111dcaf9f4 100644
--- a/.agents/skills/cli/references/agent.md
+++ b/.agents/skills/cli/references/agent.md
@@ -8,8 +8,8 @@ Manage AI agents: create, edit, delete, list, run, and check status.
List all agents.
-```bash
-lh agent list [-L [-k [--json [fields]] < n > ] < keyword > ]
+```text
+lh agent list [-L <n>] [-k <keyword>] [--json [fields]]
```
| Option | Description | Default |
@@ -22,12 +22,12 @@ lh agent list [-L [-k [--json [fields]] < n > ] < keyword > ]
---
-## `lh agent view <agentId>`
+## `lh agent view [agentId]`
-View agent configuration details.
+View agent configuration details. `agentId` may be omitted when `-s, --slug` is given instead.
-```bash
-lh agent view [fields]] < agentId > [--json
+```text
+lh agent view [agentId] [-s <slug>] [--json [fields]]
```
**Displays**: Title, description, model, provider, system role, plugins, tools.
@@ -38,8 +38,8 @@ lh agent view [fields]] < agentId > [--json
Create a new agent.
-```bash
-lh agent create [options]
+```text
+lh agent create [-t <title>] [-d <desc>] [-m <model>] [-p <provider>] [-s <role>] [--group <groupId>]
```
| Option | Description | Required |
@@ -55,22 +55,39 @@ lh agent create [options]
---
-## `lh agent edit <agentId>`
+## `lh agent edit [agentId]`
-Update an existing agent. Same options as `create`, all optional. Only specified fields are updated.
+Update an existing agent. `agentId` may be omitted when `--slug` is given instead (note: unlike
+`create`/`view`, this flag has no `-s` short alias here because `-s` is used for `--system-role`).
+Only specified fields are updated.
-```bash
-lh agent edit [-m [-s ... < agentId > [-t < title > ] < model > ] < role > ]
+```text
+lh agent edit [agentId] [--slug <slug>] [-t <title>] [-d <desc>] [-m <model>] [-p <provider>] [-s <role>] [--graph-file <path>] [--enable-graph] [--disable-graph] [--agency-config-file <path>] [--config-file <path>] [--json [fields]]
```
+| Option | Description |
+| ----------------------------- | -------------------------------------------------------------------------------------------------------- |
+| `--slug <slug>` | Agent slug, alternative to `agentId` |
+| `-t, --title <title>` | New title |
+| `-d, --description <desc>` | New description |
+| `-m, --model <model>` | New model ID |
+| `-p, --provider <provider>` | New provider ID |
+| `-s, --system-role <role>` | New system role prompt |
+| `--graph-file <path>` | AgentGraph JSON file |
+| `--enable-graph` | Enable graph runtime |
+| `--disable-graph` | Disable graph runtime |
+| `--agency-config-file <path>` | `agencyConfig` JSON, deep-merged into the agent (send `null` to clear a nested key) |
+| `--config-file <path>` | Agent config JSON for fields without a dedicated flag; deep-merged server-side, identity fields rejected |
+| `--json [fields]` | Output the updated agent as JSON, optionally selecting fields |
+
---
## `lh agent delete <agentId>`
Delete an agent.
-```bash
-lh agent delete < agentId > [--yes]
+```text
+lh agent delete <agentId> [--yes]
```
Requires confirmation unless `--yes` is provided.
@@ -81,8 +98,8 @@ Requires confirmation unless `--yes` is provided.
Duplicate an existing agent.
-```bash
-lh agent duplicate < agentId > [-t < title > ]
+```text
+lh agent duplicate <agentId> [-t <title>]
```
| Option | Description |
@@ -95,29 +112,35 @@ lh agent duplicate < agentId > [-t < title > ]
## `lh agent run`
-Start an agent execution (streaming SSE).
+Start an agent execution. Streams over the agent gateway WebSocket by default, or via SSE with
+`--sse`.
-```bash
-lh agent run [options]
+```text
+lh agent run [-a <id>] [-s <slug>] [-p <text>] [-t <id>] [--no-auto-start] [--device <target>] [--no-headless] [--json] [-v] [--replay <file>] [--sse]
```
-| Option | Description |
-| --------------------- | -------------------------------------------- |
-| `-a, --agent-id <id>` | Agent ID to run |
-| `-s, --slug <slug>` | Agent slug (alternative to ID) |
-| `-p, --prompt <text>` | User prompt |
-| `-t, --topic-id <id>` | Reuse existing topic |
-| `--no-auto-start` | Don't auto-start the agent |
-| `--json` | Output full JSON event stream |
-| `-v, --verbose` | Show detailed tool call info |
-| `--replay <file>` | Replay events from saved JSON file (offline) |
+| Option | Description |
+| --------------------- | -------------------------------------------------------------------------------------- |
+| `-a, --agent-id <id>` | Agent ID to run |
+| `-s, --slug <slug>` | Agent slug (alternative to ID) |
+| `-p, --prompt <text>` | User prompt |
+| `-t, --topic-id <id>` | Reuse existing topic |
+| `--no-auto-start` | Don't auto-start the agent |
+| `--device <target>` | Target device ID, or `local` for the current connected device |
+| `--no-headless` | Wait for human approval on tool calls instead of auto-running them (default: headless) |
+| `--json` | Output full JSON event stream |
+| `-v, --verbose` | Show detailed tool call info |
+| `--replay <file>` | Replay events from saved JSON file (offline) |
+| `--sse` | Force SSE stream instead of the WebSocket gateway |
### Streaming Behavior
-Uses `utils/agentStream.ts` to handle Server-Sent Events:
+Uses `utils/agentStream.ts`. By default, streams over the agent gateway WebSocket; pass `--sse` to
+force the legacy SSE endpoint instead. If the live stream drops before the run finishes, the CLI
+falls back to polling `agent status` every 10 seconds until the run reaches a terminal state.
-1. Sends agent run request to backend
-2. Streams SSE events in real-time
+1. Sends agent run request to backend, receiving an `operationId`
+2. Connects to the gateway WebSocket (or SSE endpoint with `--sse`) and streams events in real-time
3. Displays: text chunks, tool call status, operation progress
4. Shows final token usage and cost summary
@@ -131,8 +154,8 @@ Uses `utils/agentStream.ts` to handle Server-Sent Events:
Check agent operation status.
-```bash
-lh agent status [fields]] [--history] [--history-limit < operationId > [--json < n > ]
+```text
+lh agent status <operationId> [--json [fields]] [--history] [--history-limit <n>]
```
| Option | Description | Default |
diff --git a/.agents/skills/cli/references/conversation.md b/.agents/skills/cli/references/conversation.md
index ba4d07c22b7..0b16ef45567 100644
--- a/.agents/skills/cli/references/conversation.md
+++ b/.agents/skills/cli/references/conversation.md
@@ -8,28 +8,28 @@ Manage conversation topics (threads).
### `lh topic list`
-```bash
-lh topic list [--agent-id [-L [--page [--json [fields]] < id > ] < n > ] < n > ]
+```text
+lh topic list [--agent-id <id>] [-L <n>] [-P <n>] [--json [fields]]
```
| Option | Description | Default |
| ----------------- | --------------- | ------- |
| `--agent-id <id>` | Filter by agent | - |
| `-L, --limit <n>` | Page size | `30` |
-| `--page <n>` | Page number | `1` |
+| `-P, --page <n>` | Page number | `1` |
**Table columns**: ID, TITLE, FAV, UPDATED
### `lh topic search <keywords>`
-```bash
-lh topic search [--json [fields]] < keywords > [--agent-id < id > ]
+```text
+lh topic search <keywords> [--agent-id <id>] [--json [fields]]
```
### `lh topic create`
-```bash
-lh topic create -t [--favorite] < title > [--agent-id < id > ]
+```text
+lh topic create -t <title> [--agent-id <id>] [--favorite]
```
| Option | Description | Required |
@@ -40,20 +40,23 @@ lh topic create -t [--favorite] < title > [--agent-id < id > ]
### `lh topic edit <id>`
-```bash
-lh topic edit [--favorite] [--no-favorite] < id > [-t < title > ]
+```text
+lh topic edit <id> [-t <title>] [--favorite] [--no-favorite]
```
-### `lh topic delete <ids...>`
+### `lh topic delete [ids...]`
-```bash
-lh topic delete [--yes] < id1 > [id2...]
+IDs may be passed as arguments, read from a file with `-f, --file <path>` (one per line, or a
+JSON array), or both combined; at least one ID must resolve or the command errors.
+
+```text
+lh topic delete [id1] [id2...] [-f <path>] [--yes]
```
### `lh topic recent`
-```bash
-lh topic recent [-L [--json [fields]] < n > ]
+```text
+lh topic recent [-L <n>] [--json [fields]]
```
| Option | Description | Default |
@@ -70,52 +73,60 @@ Manage chat messages within topics.
### `lh message list`
-```bash
-lh message list [options] [--json [fields]]
+```text
+lh message list [--topic-id <id>] [--agent-id <id>] [--role <role>] [--start <date>] [--end <date>] [-L <n>] [-P <n>] [--user] [--json [fields]]
```
-| Option | Description | Default |
-| ----------------- | ----------------------- | ------- |
-| `--topic-id <id>` | Filter by topic | - |
-| `--agent-id <id>` | Filter by agent | - |
-| `-L, --limit <n>` | Page size | `30` |
-| `--page <n>` | Page number | `1` |
-| `--user` | Only show user messages | - |
+| Option | Description | Default |
+| ----------------- | ---------------------------------------------- | ------- |
+| `--topic-id <id>` | Filter by topic | - |
+| `--agent-id <id>` | Filter by agent | - |
+| `--role <role>` | Filter by role (user, assistant, tool, system) | - |
+| `--start <date>` | Only messages created at/after this date | - |
+| `--end <date>` | Only messages created at/before this date | - |
+| `-L, --limit <n>` | Page size | `50` |
+| `-P, --page <n>` | Page number | `1` |
+| `--user` | Shorthand for `--role user` | - |
-**Table columns**: ID, ROLE, CONTENT, CREATED
+**Table columns**: ID, ROLE, AGENT, CONTENT, TOPIC/THREAD, CREATED
-**Note**: When `--topic-id` or `--agent-id` is provided, uses `message.getMessages`; otherwise uses `message.listAll`.
+**Note**: Always queries via `message.listAll`.
### `lh message search <keywords>`
-```bash
-lh message search [fields]] < keywords > [--json
+```text
+lh message search <keywords> [--json [fields]]
```
Full-text search across all messages.
### `lh message delete <ids...>`
-```bash
-lh message delete [--yes] < id1 > [id2...]
+```text
+lh message delete <id1> [id2...] [--yes]
```
### `lh message count`
-```bash
-lh message count [--start [--end [--json] < date > ] < date > ]
+```text
+lh message count [--topic-id <id>] [--agent-id <id>] [--role <role>] [--start <date>] [--end <date>] [--group-by <field>] [--json]
```
-| Option | Description |
-| ---------------- | ------------------------------------------ |
-| `--start <date>` | Start date (ISO format, e.g. `2024-01-01`) |
-| `--end <date>` | End date (ISO format) |
+| Option | Description |
+| -------------------- | ------------------------------------------------ |
+| `--topic-id <id>` | Filter by topic |
+| `--agent-id <id>` | Filter by agent |
+| `--role <role>` | Filter by role (user, assistant, system) |
+| `--start <date>` | Start date (ISO format, e.g. `2024-01-01`) |
+| `--end <date>` | End date (ISO format) |
+| `--group-by <field>` | Group counts by field; only `topic` is supported |
-**Output**: Total message count for the specified period.
+**Output**: Total message count for the specified period, or a per-topic breakdown table with
+`--group-by topic`.
### `lh message heatmap`
-```bash
+```text
lh message heatmap [--json]
```
diff --git a/.agents/skills/cli/references/generate.md b/.agents/skills/cli/references/generate.md
index 53c86fde0d0..f8e90a2c6b4 100644
--- a/.agents/skills/cli/references/generate.md
+++ b/.agents/skills/cli/references/generate.md
@@ -12,9 +12,10 @@ lh generate (alias: gen)
├── image <prompt> # Image generation
├── video <prompt> # Video generation
├── tts <text> # Text-to-speech
-├── asr <audioFile> # Audio-to-text (speech recognition)
+├── asr <audio-file> # Audio-to-text (speech recognition)
├── download <generationId> <asyncTaskId> # Wait & download generation result
├── status <generationId> <asyncTaskId> # Check async task status
+├── delete <generationId> # Delete a generation record
└── list # List generation topics
```
@@ -30,8 +31,11 @@ Generate text completion.
**Source**: `apps/cli/src/commands/generate/text.ts`
+```text
+lh gen text <prompt> [-m <model>] [-p <provider>] [-s <prompt>] [--temperature <n>] [--max-tokens <n>] [--stream] [--json] [--pipe]
+```
+
```bash
-lh gen text "Explain quantum computing" [options]
echo "context" | lh gen text "summarize" --pipe
```
@@ -62,8 +66,11 @@ Generate images from text prompt. This is an async operation — the command sub
**Source**: `apps/cli/src/commands/generate/image.ts`
+```text
+lh gen image <prompt> [-m <model>] [-p <provider>] [-n <n>] [--width <px>] [--height <px>] [--steps <n>] [--seed <n>] [--json]
+```
+
```bash
-lh gen image "A sunset over mountains" [options]
lh gen image "A cute cat" --model dall-e-3 --provider openai --json
```
@@ -110,19 +117,22 @@ Generate video from text prompt. This is an async operation.
**Source**: `apps/cli/src/commands/generate/video.ts`
-```bash
-lh gen video "A cat playing piano" -m < model > -p < provider > [options]
+```text
+lh gen video <prompt> -m <model> -p <provider> [--aspect-ratio <ratio>] [--duration <sec>] [--resolution <res>] [--seed <n>] [--image <url>] [--images <urls...>] [--end-image <url>] [--json]
```
-| Option | Description | Required |
-| --------------------------- | ------------------------ | -------- |
-| `-m, --model <model>` | Model ID | Yes |
-| `-p, --provider <provider>` | Provider name | Yes |
-| `--aspect-ratio <ratio>` | Aspect ratio (e.g. 16:9) | No |
-| `--duration <sec>` | Duration in seconds | No |
-| `--resolution <res>` | Resolution (e.g. 720p) | No |
-| `--seed <n>` | Random seed | No |
-| `--json` | Output raw JSON | No |
+| Option | Description | Required |
+| --------------------------- | -------------------------------------- | -------- |
+| `-m, --model <model>` | Model ID | Yes |
+| `-p, --provider <provider>` | Provider name | Yes |
+| `--aspect-ratio <ratio>` | Aspect ratio (e.g. 16:9) | No |
+| `--duration <sec>` | Duration in seconds | No |
+| `--resolution <res>` | Resolution (e.g. 720p, 1080p) | No |
+| `--seed <n>` | Random seed | No |
+| `--image <url>` | First-frame image URL (image-to-video) | No |
+| `--images <urls...>` | Multiple reference image URLs | No |
+| `--end-image <url>` | Last-frame image URL | No |
+| `--json` | Output raw JSON | No |
**Note**: Unlike image, video requires `-m` and `-p` (no defaults). Use `lh model list <provider> --type video` to find available video models.
@@ -161,22 +171,40 @@ Text-to-speech generation.
**Source**: `apps/cli/src/commands/generate/tts.ts`
-```bash
-lh gen tts "Hello, world!" [options]
+```text
+lh gen tts <text> [-o <file>] [--voice <voice>] [--speed <n>] [--model <model>]
```
+| Option | Description | Default |
+| --------------------- | --------------------------- | ------------ |
+| `-o, --output <file>` | Output audio file path | `output.mp3` |
+| `--voice <voice>` | Voice name | `alloy` |
+| `--speed <n>` | Speed multiplier (0.25-4.0) | `1` |
+| `--model <model>` | TTS model | `tts-1` |
+
---
-## `lh generate asr <audioFile>` / `lh gen asr <audioFile>`
+## `lh generate asr <audio-file>` / `lh gen asr <audio-file>`
-Audio-to-text transcription (Automatic Speech Recognition).
+Audio-to-text transcription (Automatic Speech Recognition). Accepts a local path or a URL.
**Source**: `apps/cli/src/commands/generate/asr.ts`
+```text
+lh gen asr <audio-file> [--model <model>] [--provider <provider>] [--language <lang>] [--json]
+```
+
```bash
-lh gen asr recording.wav [options]
+lh gen asr recording.wav
```
+| Option | Description | Default |
+| ----------------------- | --------------------------- | ----------- |
+| `--model <model>` | STT model | `whisper-1` |
+| `--provider <provider>` | AI provider | `openai` |
+| `--language <lang>` | Language code (e.g. en, zh) | - |
+| `--json` | Output raw JSON | - |
+
---
## `lh generate download <generationId> <asyncTaskId>`
@@ -188,8 +216,11 @@ Wait for an async generation task to complete and download the result file.
> ⚠️ `<asyncTaskId>` is the UUID printed after "→ Task" in the video/image output.
> Do **not** pass the generation ID (`gen_xxx`) here — that will cause a server error.
+```text
+lh gen download <generationId> <asyncTaskId> [-o <path>] [--interval <sec>] [--timeout <sec>]
+```
+
```bash
-lh gen download <generationId> <asyncTaskId> [-o output.png]
lh gen download gen_xxx 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx -o ~/Desktop/result.mp4 --timeout 600
```
@@ -216,8 +247,11 @@ Check the status of an async generation task.
> ⚠️ `<asyncTaskId>` is the UUID printed after "→ Task" in the video/image output.
> Do **not** pass the generation ID (`gen_xxx`) here — that will cause a server error.
-```bash
+```text
lh gen status <generationId> <asyncTaskId> [--json]
+```
+
+```bash
lh gen status gen_xxx 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```
@@ -237,7 +271,7 @@ lh gen status gen_xxx 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx
List all generation topics.
-```bash
+```text
lh gen list [--json [fields]]
```
diff --git a/.agents/skills/cli/references/knowledge.md b/.agents/skills/cli/references/knowledge.md
index 174e046d95b..2f3035f4559 100644
--- a/.agents/skills/cli/references/knowledge.md
+++ b/.agents/skills/cli/references/knowledge.md
@@ -16,8 +16,8 @@ lh kb list [--json [fields]]
### `lh kb view <id>`
-```bash
-lh kb view [fields]] < id > [--json
+```text
+lh kb view <id> [--json [fields]]
```
**Displays**: Name, description, full directory tree with all files and documents (recursively fetched). Shows indented tree structure with item type (File/Doc), file type, and size.
@@ -26,8 +26,8 @@ lh kb view [fields]] < id > [--json
### `lh kb create`
-```bash
-lh kb create -n [--avatar < name > [-d < desc > ] < url > ]
+```text
+lh kb create -n <name> [-d <desc>] [--avatar <url>]
```
| Option | Description | Required |
@@ -40,16 +40,16 @@ lh kb create -n [--avatar < name > [-d < desc > ] < url > ]
### `lh kb edit <id>`
-```bash
-lh kb edit [-d [--avatar < id > [-n < name > ] < desc > ] < url > ]
+```text
+lh kb edit <id> [-n <name>] [-d <desc>] [--avatar <url>]
```
Requires at least one change flag. Errors if none specified.
### `lh kb delete <id>`
-```bash
-lh kb delete [--yes] < id > [--remove-files]
+```text
+lh kb delete <id> [--remove-files] [--yes]
```
| Option | Description |
@@ -59,24 +59,24 @@ lh kb delete [--yes] < id > [--remove-files]
### `lh kb add-files <knowledgeBaseId>`
-```bash
-lh kb add-files <kbId> --ids <fileId1> <fileId2> ...
+```text
+lh kb add-files <kbId> --ids <fileId1> [fileId2...]
```
Link existing files to a knowledge base.
### `lh kb remove-files <knowledgeBaseId>`
-```bash
-lh kb remove-files <kbId> --ids <fileId1> <fileId2> ... [--yes]
+```text
+lh kb remove-files <kbId> --ids <fileId1> [fileId2...] [--yes]
```
Unlink files from a knowledge base.
### `lh kb mkdir <knowledgeBaseId>`
-```bash
-lh kb mkdir < kbId > -n < name > [--parent < folderId > ]
+```text
+lh kb mkdir <kbId> -n <name> [--parent <folderId>]
```
Create a folder in a knowledge base. Uses `document.createDocument` with `fileType: 'custom/folder'`.
@@ -88,8 +88,8 @@ Create a folder in a knowledge base. Uses `document.createDocument` with `fileTy
### `lh kb create-doc <knowledgeBaseId>`
-```bash
-lh kb create-doc [--parent < kbId > -t < title > [-c < content > ] < folderId > ]
+```text
+lh kb create-doc <kbId> -t <title> [-c <content>] [--parent <folderId>]
```
Create a document in a knowledge base. Uses `document.createDocument` with `fileType: 'custom/document'`.
@@ -102,8 +102,8 @@ Create a document in a knowledge base. Uses `document.createDocument` with `file
### `lh kb move <id>`
-```bash
-lh kb move < id > --type < file | doc > [--parent < folderId > ]
+```text
+lh kb move <id> [--type <file|doc>] [--parent <folderId>]
```
Move a file or document to a different folder (or to root if `--parent` is omitted).
@@ -117,7 +117,7 @@ Uses `document.updateDocument` for docs, `file.updateFile` for files.
### `lh kb upload <knowledgeBaseId> <filePath>`
-```bash
+```text
lh kb upload <kbId> <filePath> [--parent <folderId>]
```
@@ -139,8 +139,8 @@ Manage uploaded files.
### `lh file list`
-```bash
-lh file list [--kb-id [-L [--json [fields]] < id > ] < n > ]
+```text
+lh file list [--kb-id <id>] [-L <n>] [--json [fields]]
```
| Option | Description | Default |
@@ -152,24 +152,24 @@ lh file list [--kb-id [-L [--json [fields]] < id > ] < n > ]
### `lh file view <id>`
-```bash
-lh file view [fields]] < id > [--json
+```text
+lh file view <id> [--json [fields]]
```
**Displays**: Name, type, size, chunking status, embedding status.
### `lh file delete <ids...>`
-```bash
-lh file delete [--yes] < id1 > [id2...]
+```text
+lh file delete <id1> [id2...] [--yes]
```
Supports deleting multiple files at once.
### `lh file recent`
-```bash
-lh file recent [-L [--json [fields]] < n > ]
+```text
+lh file recent [-L <n>] [--json [fields]]
```
| Option | Description | Default |
@@ -186,8 +186,8 @@ Manage text documents (notes, wiki pages).
### `lh doc list`
-```bash
-lh doc list [-L [--file-type [--source-type [--json [fields]] < n > ] < type > ] < type > ]
+```text
+lh doc list [-L <n>] [--file-type <type>] [--source-type <type>] [--json [fields]]
```
| Option | Description | Default |
@@ -200,16 +200,16 @@ lh doc list [-L [--file-type [--source-type [--json [fields]] < n > ] < type > ]
### `lh doc view <id>`
-```bash
-lh doc view [fields]] < id > [--json
+```text
+lh doc view <id> [--json [fields]]
```
**Displays**: Title, type, KB association, updated time, full content.
### `lh doc create`
-```bash
-lh doc create -t [-F [--parent [--slug [--kb [--file-type < title > [-b < body > ] < path > ] < id > ] < slug > ] < id > ] < type > ]
+```text
+lh doc create -t <title> [-b <content>] [-F <path>] [--parent <id>] [--slug <slug>] [--kb <id>] [--file-type <type>]
```
| Option | Description | Required |
@@ -236,22 +236,22 @@ Each object in the array can have: `title`, `content`, `fileType`, `knowledgeBas
### `lh doc edit <id>`
-```bash
-lh doc edit [-b [-F [--parent [--file-type < id > [-t < title > ] < body > ] < path > ] < id > ] < type > ]
+```text
+lh doc edit <id> [-t <title>] [-b <content>] [-F <path>] [--parent <id>] [--file-type <type>]
```
### `lh doc delete <ids...>`
-```bash
-lh doc delete [--yes] < id1 > [id2...]
+```text
+lh doc delete <id1> [id2...] [--yes]
```
### `lh doc parse <fileId>`
Parse an uploaded file into a document.
-```bash
-lh doc parse [--json [fields]] < fileId > [--with-pages]
+```text
+lh doc parse <fileId> [--with-pages] [--json [fields]]
```
| Option | Description |
@@ -264,7 +264,7 @@ lh doc parse [--json [fields]] < fileId > [--with-pages]
Associate a document with a topic. Creates a linked copy via the notebook router.
-```bash
+```text
lh doc link-topic <docId> <topicId>
```
@@ -272,8 +272,8 @@ lh doc link-topic <docId> <topicId>
List documents associated with a topic.
-```bash
-lh doc topic-docs [--json [fields]] < topicId > [--type < type > ]
+```text
+lh doc topic-docs <topicId> [--type <type>] [--json [fields]]
```
| Option | Description |
diff --git a/.agents/skills/cli/references/memory.md b/.agents/skills/cli/references/memory.md
index aab81f7e8af..81aa590163a 100644
--- a/.agents/skills/cli/references/memory.md
+++ b/.agents/skills/cli/references/memory.md
@@ -38,8 +38,8 @@ lh memory list preference # Only preferences
Create a new identity memory entry.
-```bash
-lh memory create [options]
+```text
+lh memory create [--type <type>] [--role <role>] [--relationship <rel>] [-d <desc>] [--labels <labels...>]
```
| Option | Description |
@@ -56,19 +56,19 @@ lh memory create [options]
Edit a memory entry. Options vary by category:
-```bash
-lh memory edit identity < id > [options]
-lh memory edit activity < id > [options]
-lh memory edit context < id > [options]
-lh memory edit experience < id > [options]
-lh memory edit preference < id > [options]
+```text
+lh memory edit identity <id> [--type <type>] [--role <role>] [--relationship <rel>] [-d <desc>] [--labels <labels...>]
+lh memory edit activity <id> [--narrative <text>] [--notes <text>] [--status <status>]
+lh memory edit context <id> [--title <title>] [--description <desc>] [--status <status>]
+lh memory edit experience <id> [--situation <text>] [--action <text>] [--key-learning <text>]
+lh memory edit preference <id> [--directives <text>] [--suggestions <text>]
```
### Category-specific Options
**identity**:
-- `--type <type>`, `--role <role>`, `--relationship <rel>`
+- `--type <type>`, `--role <role>`, `--relationship <rel>`, `--description <desc>`, `--labels <labels...>`
**activity**:
@@ -90,8 +90,8 @@ lh memory edit preference < id > [options]
## `lh memory delete <category> <id>`
-```bash
-lh memory delete identity < id > [--yes]
+```text
+lh memory delete <category> <id> [--yes]
```
---
@@ -100,7 +100,7 @@ lh memory delete identity < id > [--yes]
Display the compiled memory persona summary.
-```bash
+```text
lh memory persona [--json [fields]]
```
@@ -112,8 +112,8 @@ lh memory persona [--json [fields]]
Trigger async memory extraction from chat history.
-```bash
-lh memory extract [--from [--to < date > ] < date > ]
+```text
+lh memory extract [--from <date>] [--to <date>]
```
| Option | Description |
@@ -129,8 +129,8 @@ Starts a background task that analyzes chat history and creates new memory entri
Check the status of a memory extraction task.
-```bash
-lh memory extract-status [--task-id [--json [fields]] < id > ]
+```text
+lh memory extract-status [--task-id <id>] [--json [fields]]
```
| Option | Description |
diff --git a/.agents/skills/cli/references/models-providers.md b/.agents/skills/cli/references/models-providers.md
index 2fb187ee000..02bc2a7761d 100644
--- a/.agents/skills/cli/references/models-providers.md
+++ b/.agents/skills/cli/references/models-providers.md
@@ -20,7 +20,7 @@ lh model list lobehub --type video --json
| ----------------- | -------------------------------------------------------------------------------------- | ------- |
| `-L, --limit <n>` | Maximum items | `50` |
| `--enabled` | Only show enabled models | `false` |
-| `--type <type>` | Filter by model type (`chat\|embedding\|tts\|stt\|image\|video\|text2music\|realtime`) | - |
+| `--type <type>` | Filter by model type (`chat\|embedding\|tts\|asr\|image\|video\|text2music\|realtime`) | - |
| `--json [fields]` | Output JSON, optionally specify fields | - |
**Table columns**: ID, NAME, ENABLED, TYPE
@@ -29,16 +29,16 @@ lh model list lobehub --type video --json
### `lh model view <id>`
-```bash
-lh model view [fields]] < modelId > [--json
+```text
+lh model view <id> [--json [fields]]
```
**Displays**: Name, provider, type, enabled status, capabilities.
### `lh model create`
-```bash
-lh model create --id [--type < id > --provider < providerId > [--display-name < name > ] < type > ]
+```text
+lh model create --id <id> --provider <providerId> [--display-name <name>] [--type <type>]
```
| Option | Description | Default |
@@ -50,17 +50,17 @@ lh model create --id [--type < id > --provider < providerId > [--display-name <
### `lh model edit <id>`
-```bash
-lh model edit [--type < modelId > --provider < providerId > [--display-name < name > ] < type > ]
+```text
+lh model edit <id> --provider <providerId> [--display-name <name>] [--type <type>]
```
### `lh model toggle <id>`
Enable or disable a model.
-```bash
-lh model toggle < modelId > --provider < providerId > --enable
-lh model toggle < modelId > --provider < providerId > --disable
+```text
+lh model toggle <id> --provider <providerId> --enable
+lh model toggle <id> --provider <providerId> --disable
```
| Option | Description | Required |
@@ -79,16 +79,16 @@ lh model batch-toggle model1 model2 model3 --provider openai --enable
### `lh model delete <id>`
-```bash
-lh model delete < modelId > --provider < providerId > [--yes]
+```text
+lh model delete <id> --provider <providerId> [--yes]
```
### `lh model clear`
Clear all models (or only remote/fetched models) for a provider.
-```bash
-lh model clear --provider [--yes] < providerId > [--remote]
+```text
+lh model clear --provider <providerId> [--remote] [--yes]
```
---
@@ -101,7 +101,7 @@ Manage AI service providers.
### `lh provider list`
-```bash
+```text
lh provider list [--json [fields]]
```
@@ -109,16 +109,16 @@ lh provider list [--json [fields]]
### `lh provider view <id>`
-```bash
-lh provider view [fields]] < providerId > [--json
+```text
+lh provider view <id> [--json [fields]]
```
**Displays**: Name, enabled status, source, configuration.
### `lh provider create`
-```bash
-lh provider create --id [-d [--logo [--sdk-type < id > -n < name > [-s < source > ] < desc > ] < url > ] < type > ]
+```text
+lh provider create --id <id> -n <name> [-s <source>] [-d <desc>] [--logo <url>] [--sdk-type <type>]
```
| Option | Description | Default |
@@ -132,8 +132,8 @@ lh provider create --id [-d [--logo [--sdk-type < id > -n < name > [-s < source
### `lh provider edit <id>`
-```bash
-lh provider edit [-d [--logo [--sdk-type < providerId > [-n < name > ] < desc > ] < url > ] < type > ]
+```text
+lh provider edit <id> [-n <name>] [-d <desc>] [--logo <url>] [--sdk-type <type>]
```
Requires at least one change flag.
@@ -174,13 +174,13 @@ lh provider test openai -m gpt-4o --json
### `lh provider toggle <id>`
-```bash
-lh provider toggle < providerId > --enable
-lh provider toggle < providerId > --disable
+```text
+lh provider toggle <id> --enable
+lh provider toggle <id> --disable
```
### `lh provider delete <id>`
-```bash
-lh provider delete < providerId > [--yes]
+```text
+lh provider delete <id> [--yes]
```
diff --git a/.agents/skills/cli/references/search-config.md b/.agents/skills/cli/references/search-config.md
index 103b83021b0..d4aeccd7a74 100644
--- a/.agents/skills/cli/references/search-config.md
+++ b/.agents/skills/cli/references/search-config.md
@@ -2,20 +2,34 @@
## Global Search (`lh search`)
-Search across all LobeHub resource types.
+Search across local resources, or the web with `--web`.
**Source**: `apps/cli/src/commands/search.ts`
-### `lh search <query>`
+### `lh search`
+
+`-q, --query` is not a positional argument — it's an option. If omitted, the command prints help
+and exits instead of erroring.
+
+```text
+lh search -q <query> [-w] [-t <type>] [-L <n>] [-e <engines>] [-c <categories>] [-T <range>] [--json [fields]]
+```
```bash
-lh search "meeting notes" [-t [-L [--json [fields]] < type > ] < n > ]
+lh search -q "meeting notes"
+lh search -q "latest AI news" --web
```
-| Option | Description | Default |
-| ------------------- | ----------------------- | --------- |
-| `-t, --type <type>` | Filter by resource type | All types |
-| `-L, --limit <n>` | Results per type | `10` |
+| Option | Description | Default |
+| ------------------------------- | ----------------------------------------------------------------- | --------- |
+| `-q, --query <query>` | Search query (required) | - |
+| `-w, --web` | Search the web instead of local resources | `false` |
+| `-t, --type <type>` | Filter by resource type (local search only) | All types |
+| `-L, --limit <n>` | Results per type (local search only) | `10` |
+| `-e, --engines <engines>` | Web search engines (comma-separated, requires `--web`) | - |
+| `-c, --categories <categories>` | Web search categories (comma-separated, requires `--web`) | - |
+| `-T, --time-range <range>` | Time range filter (e.g. day, week, month, year, requires `--web`) | - |
+| `--json [fields]` | JSON output, optionally selecting fields | - |
### Searchable Types
@@ -33,7 +47,24 @@ lh search "meeting notes" [-t [-L [--json [fields]] < type > ] < n > ]
| `communityAgent` | Community marketplace agents |
| `knowledgeBase` | Knowledge bases |
-**Output**: Results grouped by type, showing ID, title/name, description.
+**Output**: Local search results grouped by type, showing ID, title/name, description. Web search
+results are printed as a table of TITLE, URL, SCORE, CONTENT.
+
+### `lh search view <target>`
+
+View details of a single result: a URL crawls the page (web result); `type:id` (e.g.
+`agent:abc123`) looks up a local resource.
+
+```text
+lh search view <target> [-i <impls>] [--json [fields]]
+```
+
+| Option | Description |
+| -------------------- | -------------------------------------------------------------------------------------------------------------------- |
+| `-i, --impl <impls>` | Crawler implementations for web URLs (comma-separated: browserless, exa, firecrawl, jina, naive, search1api, tavily) |
+
+**Local view support**: only `agent`, `file`, and `knowledgeBase` types are implemented; other
+`type:id` values error with "View not supported for type".
---
@@ -45,7 +76,7 @@ lh search "meeting notes" [-t [-L [--json [fields]] < type > ] < n > ]
Display current authenticated user information.
-```bash
+```text
lh whoami [--json [fields]]
```
@@ -55,14 +86,15 @@ lh whoami [--json [fields]]
Display usage statistics.
-```bash
-lh usage [--month [--daily] [--json [fields]] < YYYY-MM > ]
+```text
+lh usage [--month <YYYY-MM>] [--agent-id <id>] [--daily] [--json [fields]]
```
-| Option | Description | Default |
-| ------------------- | -------------- | ----------------------- |
-| `--month <YYYY-MM>` | Month to query | Current month |
-| `--daily` | Group by day | `false` (monthly total) |
+| Option | Description | Default |
+| ------------------- | ------------------------- | ----------------------- |
+| `--month <YYYY-MM>` | Month to query | Current month |
+| `--agent-id <id>` | Filter usage to one agent | All agents |
+| `--daily` | Group by day | `false` (monthly total) |
**Output**: Token usage, costs, and model breakdown for the specified period.
diff --git a/.agents/skills/cli/references/skills-plugins.md b/.agents/skills/cli/references/skills-plugins.md
index f64f390be13..3c246598aaa 100644
--- a/.agents/skills/cli/references/skills-plugins.md
+++ b/.agents/skills/cli/references/skills-plugins.md
@@ -8,8 +8,8 @@ Manage agent skills (custom instructions and capabilities).
### `lh skill list`
-```bash
-lh skill list [--source [--json [fields]] < source > ]
+```text
+lh skill list [--source <source>] [--json [fields]]
```
| Option | Description |
@@ -20,16 +20,16 @@ lh skill list [--source [--json [fields]] < source > ]
### `lh skill view <id>`
-```bash
-lh skill view [fields]] < id > [--json
+```text
+lh skill view <id> [--json [fields]]
```
**Displays**: Name, description, source, identifier, content.
### `lh skill create`
-```bash
-lh skill create -n < name > -d < desc > -c < content > [-i < identifier > ]
+```text
+lh skill create -n <name> -d <desc> -c <content> [-i <id>]
```
| Option | Description | Required |
@@ -41,20 +41,22 @@ lh skill create -n < name > -d < desc > -c < content > [-i < identifier > ]
### `lh skill edit <id>`
-```bash
-lh skill edit [-n [-d < id > [-c < content > ] < name > ] < desc > ]
+Requires at least one of `-c`/`-n`/`-d`; errors if none specified.
+
+```text
+lh skill edit <id> [-n <name>] [-d <desc>] [-c <content>]
```
### `lh skill delete <id>`
-```bash
-lh skill delete < id > [--yes]
+```text
+lh skill delete <id> [--yes]
```
### `lh skill search <query>`
-```bash
-lh skill search [fields]] < query > [--json
+```text
+lh skill search <query> [--json [fields]]
```
### `lh skill install <source>` (alias: `lh skill i`)
@@ -91,8 +93,8 @@ lh skill i my-cool-skill
List files/resources within a skill.
-```bash
-lh skill resources [fields]] < id > [--json
+```text
+lh skill resources <id> [--json [fields]]
```
**Displays**: Path, type, size.
@@ -101,8 +103,8 @@ lh skill resources [fields]] < id > [--json
Read a specific resource file from a skill.
-```bash
-lh skill read-resource <skillId> <path>
+```text
+lh skill read-resource <id> <path>
```
**Output**: File content or JSON metadata.
@@ -117,7 +119,7 @@ Install and manage plugins (external tool integrations).
### `lh plugin list`
-```bash
+```text
lh plugin list [--json [fields]]
```
@@ -125,8 +127,8 @@ lh plugin list [--json [fields]]
### `lh plugin install`
-```bash
-lh plugin install -i [--settings < identifier > --manifest < json > [--type < type > ] < json > ]
+```text
+lh plugin install -i <id> --manifest <json> [--type <type>] [--settings <json>]
```
| Option | Description | Required |
@@ -138,12 +140,14 @@ lh plugin install -i [--settings < identifier > --manifest < json > [--type < ty
### `lh plugin uninstall <id>`
-```bash
-lh plugin uninstall < id > [--yes]
+```text
+lh plugin uninstall <id> [--yes]
```
### `lh plugin update <id>`
-```bash
-lh plugin update [--settings < id > [--manifest < json > ] < json > ]
+Requires `--manifest` or `--settings` (at least one); errors if neither is specified.
+
+```text
+lh plugin update <id> [--manifest <json>] [--settings <json>]
```
diff --git a/.agents/skills/db-migrations/SKILL.md b/.agents/skills/db-migrations/SKILL.md
index 7fad976aaba..f1153e01220 100644
--- a/.agents/skills/db-migrations/SKILL.md
+++ b/.agents/skills/db-migrations/SKILL.md
@@ -101,14 +101,14 @@ Backfill scripts should be resumable, safe to retry, processed in bounded batche
Schema changes churn during feature development. When the schema changes before the migration has shipped, do not hand-edit the existing migration SQL to chase the new schema shape. Delete the draft migration artifacts added by this branch (SQL file, matching snapshot, and matching journal entry), then run the generator again and re-apply the normal migration review steps below.
-For example, if this branch's draft migration is `0110_add_verify_tables_and_ai_infra_id`:
+For example, if this branch's draft migration is `NNNN_add_verify_tables` (substitute the branch's real number — never an already-shipped migration):
```bash
# 1. Delete the draft SQL and its snapshot
-rm packages/database/migrations/0110_add_verify_tables_and_ai_infra_id.sql
-rm packages/database/migrations/meta/0110_snapshot.json
+rm packages/database/migrations/NNNN_add_verify_tables.sql
+rm packages/database/migrations/meta/NNNN_snapshot.json
-# 2. Remove the matching 0110 entry from the journal's "entries" array
+# 2. Remove the matching NNNN entry from the journal's "entries" array
# packages/database/migrations/meta/_journal.json
# 3. Regenerate from the current schema
@@ -119,14 +119,14 @@ This keeps the generated SQL, snapshot, and journal aligned with the actual sche
Before release, if a feature branch accumulated multiple development-only migrations, consolidate them into one migration when possible. Production does not need to replay every intermediate draft shape, and fewer migrations reduce deploy-time risk.
-For example, if this branch added `0110`, `0111`, and `0112`, delete all three drafts and regenerate a single migration:
+For example, if this branch added three drafts `AAAA`, `BBBB`, and `CCCC`, delete all three and regenerate a single migration:
```bash
# 1. Delete every draft SQL and snapshot this branch added
-rm packages/database/migrations/011{0,1,2}_*.sql
-rm packages/database/migrations/meta/011{0,1,2}_snapshot.json
+rm packages/database/migrations/{AAAA,BBBB,CCCC}_*.sql
+rm packages/database/migrations/meta/{AAAA,BBBB,CCCC}_snapshot.json
-# 2. Remove the 0110/0111/0112 entries from the journal's "entries" array
+# 2. Remove those entries from the journal's "entries" array
# packages/database/migrations/meta/_journal.json
# 3. Regenerate one migration covering the full schema delta
@@ -135,7 +135,7 @@ bun run db:generate
Do not make a migration compatible with earlier development-only versions of the same branch. While the migration has not shipped, there is no production history to preserve. Fix local/dev databases directly with whatever SQL is simplest (drop the draft table, rename a column, delete draft rows), then regenerate the branch migration from the current schema.
-For example, if an earlier draft on this branch created `signup_attempt_id` and you have since renamed it to `user_signup_log_id`, do not add a compatibility `ALTER ... RENAME` to the migration. Just fix the dev DB directly (see the `access-pg` skill for the `bun -e` + `pg` pattern), then regenerate:
+For example, if an earlier draft on this branch created `signup_attempt_id` and you have since renamed it to `user_signup_log_id`, do not add a compatibility `ALTER ... RENAME` to the migration. Just fix the dev DB directly, then regenerate:
```bash
# Fix the dev DB to match the new schema (simplest SQL wins)
diff --git a/.agents/skills/debug-package/SKILL.md b/.agents/skills/debug-package/SKILL.md
index 54c2bca6d7d..036a22ba372 100644
--- a/.agents/skills/debug-package/SKILL.md
+++ b/.agents/skills/debug-package/SKILL.md
@@ -44,7 +44,7 @@ localStorage.debug = 'lobe-*';
### Node.js
```bash
-DEBUG=lobe-* npm run dev
+DEBUG=lobe-* bun run dev
DEBUG=lobe-* pnpm dev
```
diff --git a/.agents/skills/desktop/SKILL.md b/.agents/skills/desktop/SKILL.md
index b2c6d7f7d5c..38e602a4721 100644
--- a/.agents/skills/desktop/SKILL.md
+++ b/.agents/skills/desktop/SKILL.md
@@ -80,10 +80,3 @@ See `references/` for specific topics:
- **Local tools workflow**: `references/local-tools.md`
- **Menu configuration**: `references/menu-config.md`
- **Window management**: `references/window-management.md`
-
-## Best Practices
-
-1. **Security**: Validate inputs, limit exposed APIs
-2. **Performance**: Use async methods, batch data transfers
-3. **UX**: Add progress indicators, provide error feedback
-4. **Code organization**: Follow existing patterns, add documentation
diff --git a/.agents/skills/desktop/references/feature-implementation.md b/.agents/skills/desktop/references/feature-implementation.md
index 4da27eb042e..ca2cd8dad62 100644
--- a/.agents/skills/desktop/references/feature-implementation.md
+++ b/.agents/skills/desktop/references/feature-implementation.md
@@ -70,15 +70,17 @@ export interface DesktopNotificationResult {
### 3. Create Service Layer
```typescript
-// src/services/electron/notificationService.ts
+// src/services/electron/desktopNotification.ts
import type { ShowDesktopNotificationParams } from '@lobechat/electron-client-ipc';
import { ensureElectronIpc } from '@/utils/electron/ipc';
-const ipc = ensureElectronIpc();
+export class DesktopNotificationService {
+ async showNotification(params: ShowDesktopNotificationParams) {
+ return ensureElectronIpc().notification.showDesktopNotification(params);
+ }
+}
-export const notificationService = {
- show: (params: ShowDesktopNotificationParams) => ipc.notification.showDesktopNotification(params),
-};
+export const desktopNotificationService = new DesktopNotificationService();
```
### 4. Implement Store Action
@@ -88,16 +90,9 @@ export const notificationService = {
showNotification: async (title: string, body: string) => {
if (!isElectron) return;
- const result = await notificationService.show({ title, body });
+ const result = await desktopNotificationService.showNotification({ title, body });
if (!result.success) {
console.error('Notification failed:', result.error);
}
},
```
-
-## Best Practices
-
-1. **Security**: Validate inputs, limit exposed APIs
-2. **Performance**: Use async methods for heavy operations
-3. **Error handling**: Always return structured results
-4. **UX**: Provide loading states and error feedback
diff --git a/.agents/skills/drizzle/SKILL.md b/.agents/skills/drizzle/SKILL.md
index 14a571dcb5a..c5deda0e44d 100644
--- a/.agents/skills/drizzle/SKILL.md
+++ b/.agents/skills/drizzle/SKILL.md
@@ -78,7 +78,7 @@ Do not use composite primary keys on new tables. Give every table a single-colum
surrogate PK and carry business uniqueness in a `uniqueIndex` instead. PK columns
cannot be nullable, so when the uniqueness scope later grows by a nullable
dimension the composite PK must be torn down and rebuilt — exactly what happened
-when `ai_providers` / `ai_models` were workspace-scoped (migration 0110 replaced
+when `ai_providers` / `ai_models` were workspace-scoped (migrations 0110–0111 replaced
their composite PKs with a surrogate `_id` plus partial unique indexes). A unique
index still works as the arbiter for `onConflictDoUpdate` upserts.
@@ -101,7 +101,7 @@ export const workspaceUserSettings = pgTable(
```
Existing composite PKs are legacy — leave them alone unless they block a scope
-change, then migrate them the 0110 way.
+change, then migrate them the 0110–0111 way.
### Foreign Keys
diff --git a/.agents/skills/skills-audit/SKILL.md b/.agents/skills/skills-audit/SKILL.md
index b0df1a427cc..6dc2924fde7 100644
--- a/.agents/skills/skills-audit/SKILL.md
+++ b/.agents/skills/skills-audit/SKILL.md
@@ -93,11 +93,8 @@ An audit-only request produces recommendations. When the user authorizes fixes,
## What NOT to do
+- ❌ Don't delete a table or section because some of its fields are stale. Update the stale fields (status, paths, counts) and keep decision data that code cannot reproduce: priorities, owners, dates, rationale.
- ❌ Don't rename skill directories without checking for cross-references AND user memory entries that name the old slug.
- ❌ Don't remove meaningful selection boundaries merely to shorten a description or fit a template.
- ❌ Don't fold a heavy 200+ line skill into another just because they share a domain — large skills get loaded selectively and merging makes everything load.
- ❌ Don't propose `.agents/skills/INDEX.md` or `<domain>-<skill>` prefix renames unless the user explicitly asks — costs > benefits for cosmetic reorgs.
-
-## Related history
-
-- First audit: `chore/skills-audit` branch (2026-05-25) — deleted `source-command-dedupe`, renamed `data-fetching` → `data-fetching-architecture`, normalized 9 descriptions, created this skill.
diff --git a/.agents/skills/spa-routes/SKILL.md b/.agents/skills/spa-routes/SKILL.md
index d18d231e373..78f1f810b39 100644
--- a/.agents/skills/spa-routes/SKILL.md
+++ b/.agents/skills/spa-routes/SKILL.md
@@ -150,10 +150,7 @@ Known variants today:
## 5. Progressive Migration (existing code)
-We are migrating existing routes to this structure step by step:
-
-- **Phase 1 (done):** `/page` route – segment files in `src/routes/(main)/page/`, implementation in `src/features/Pages/`.
-- **Later phases:** home, settings, agent/group, community/resource/memory, mobile/share/onboarding.
+Existing routes follow this structure unevenly: some are already thin segment files (e.g. `src/routes/(main)/page/`, `src/routes/(main)/settings/`), while others still hold logic or a `features/` folder under `src/routes/`. Check the route's current state instead of assuming.
When touching an old route that still has logic or `features/` inside `src/routes/`:
diff --git a/.agents/skills/typescript/SKILL.md b/.agents/skills/typescript/SKILL.md
index fa19a8d05a9..95a0dc4c1e2 100644
--- a/.agents/skills/typescript/SKILL.md
+++ b/.agents/skills/typescript/SKILL.md
@@ -21,10 +21,8 @@ user-invocable: false
## Async Patterns
-- Prefer `async`/`await` over callbacks or `.then()` chains
- **Async-first for IO**: new IO code (fs, child\_process, etc.) must use async APIs at its boundaries — use promise-based variants like `import { readFile } from 'fs/promises'`, never `*Sync` by default. Function coloring is asymmetric: async→sync migration is never needed, while sync→async (when IO gets slower, gains concurrency, or grows a subprocess/network call) forces rewriting every caller up the chain — sync-first debt that compounds. Micro-costs of async (thread-pool dispatch, cache races) are not valid reasons: races are solved by caching the promise instead of the result
- `*Sync` is acceptable in exactly one place: call sites locked inside a synchronous contract you don't control — an existing sync signature chain (don't virally refactor a legacy sync chain in a bugfix, but new standalone modules must not extend such chains), or sync-only callbacks like `process.on('exit')`. Module-load-time and CLI startup init are NOT exceptions — use top-level `await` (ESM) there
-- Use `Promise.all`, `Promise.race` for concurrent operations where safe
## Imports
diff --git a/.agents/skills/upstash-workflow/SKILL.md b/.agents/skills/upstash-workflow/SKILL.md
index e659bb9c722..2a5c22d6559 100644
--- a/.agents/skills/upstash-workflow/SKILL.md
+++ b/.agents/skills/upstash-workflow/SKILL.md
@@ -128,7 +128,7 @@ apps/server/src/workflows/
└── index.ts # Workflow class — static trigger*() methods that POST to the routes above
```
-Routes are no longer one `route.ts` file per layer under `src/app`; every layer is a handler mounted on a per-workflow Hono app under `apps/server/src/router-hono/workflows/`, and the Next.js route only dispatches into it.
+Every layer is a handler mounted on a per-workflow Hono app under `apps/server/src/router-hono/workflows/`; the Next.js route under `src/app` only dispatches into it.
---
diff --git a/AGENTS.md b/AGENTS.md
index 4633de259f3..cd220823936 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -15,6 +15,8 @@ Guidelines for using AI coding agents in this opensource LobeHub repository.
`AGENTS.md` owns repository-wide architecture and workflow. Keep detailed implementation rules in skills so they have one source of truth.
+In skill and agent Markdown, put command synopses or shell snippets containing `<placeholder>` or `[optional]` syntax in ` ```text ` fences. Prettier's shell plugin formats ` ```bash ` fences and rewrites those placeholders as redirections and globs, e.g. `<id>` becomes `< id >`.
+
The `acceptance` skill is generated from the default branch of [lobehub/acceptance](https://github.com/lobehub/acceptance). Maintain its source there; update the committed `.agents/skills/acceptance/` copy using `bun apps/cli/src/index.ts acceptance update`. Repository-specific acceptance setup stays in `.agents/acceptance/`.
- **React and TSX**: Before editing components, component state, render boundaries, or memoization, read the `react` skill. It owns component selection, styling, state locality, and render-performance rules.
@@ -106,4 +108,4 @@ When acceptance is required, put its published `https://app.lobehub.com/acceptan
Before reviewing a PR / diff / branch change, read the **deep-review** skill. Ordinary review requests use its light mode (one independent reviewer against the dimension quick checklists); the full multi-subagent deep mode runs only on explicit invocation.
-When designing or reviewing user-facing flows (empty/loading/error states, confirmations, async feedback, button hierarchy, lists at scale, pickers), follow LobeHub's design values in [`DESIGN.md`](./DESIGN.md) — Natural / Meaningful / Certainty / Growth (自然 / 意义感 / 确定性 / 成长).
+When designing or reviewing user-facing flows (empty/loading/error states, confirmations, async feedback, button hierarchy, lists at scale, pickers), follow LobeHub's design values — Natural / Meaningful / Certainty / Growth (自然 / 意义感 / 确定性 / 成长) — in the `ux` skill; [`DESIGN.md`](./DESIGN.md) covers visual tokens and voice.
diff --git a/e2e/CLAUDE.md b/e2e/CLAUDE.md
index 648316e6989..e8e69ac8430 100644
--- a/e2e/CLAUDE.md
+++ b/e2e/CLAUDE.md
@@ -18,13 +18,15 @@ Related: [LOBE-2417](https://linear.app/lobehub/issue/LOBE-2417/建立核心产
### 产品架构覆盖
-| 模块 | 子功能 | 优先级 | 状态 |
-| ---------------- | --------------------------------- | ------ | ---- |
-| **Agent** | Builder, 对话,Task | P0 | 🚧 |
-| **Agent Group** | Builder, 群聊 | P0 | ⏳ |
-| **Page(文稿)** | 侧边栏 CRUD ✅,文档编辑,Copilot | P0 | 🚧 |
-| **知识库** | 创建,上传,RAG 对话 | P1 | ⏳ |
-| **记忆** | 查看,编辑,关联 | P2 | ⏳ |
+| 模块 | 子功能 | 优先级 | 状态 |
+| ---------------- | ------------------------------------ | ------ | ---- |
+| **Agent** | Builder, 对话 ✅,Task | P0 | 🚧 |
+| **Agent Group** | Builder, 群聊(仅覆盖侧边栏入口) | P0 | ⏳ |
+| **Page(文稿)** | 侧边栏 CRUD ✅,文档编辑 ✅,Copilot | P0 | 🚧 |
+| **知识库** | 创建,上传,RAG 对话 | P1 | ⏳ |
+| **记忆** | 查看,编辑,关联 | P2 | ⏳ |
+
+此外已覆盖 Home、Community 和核心路由(未排优先级)。当前覆盖范围以 `e2e/src/features/` 为准。
### 标签系统
@@ -38,10 +40,11 @@ Related: [LOBE-2417](https://linear.app/lobehub/issue/LOBE-2417/建立核心产
@P2 # 中优先级(发版前)
@agent # Agent 模块
-@agent-group # Agent Group 模块
+@group # Agent Group 模块
@page # Page 文稿模块
-@knowledge # 知识库模块
-@memory # 记忆模块
+@home # Home 模块
+@community # 社区模块
+@routes # 核心路由
```
### 执行策略
@@ -73,30 +76,16 @@ pnpm exec cucumber-js --config cucumber.config.js
e2e/
├── src/
│ ├── features/ # Cucumber feature 文件
-│ │ ├── journeys/ # 用户旅程(体验基准线)
-│ │ │ ├── agent/
-│ │ │ │ ├── agent-builder.feature
-│ │ │ │ ├── agent-conversation.feature ✅
-│ │ │ │ └── agent-task.feature
-│ │ │ ├── agent-group/
-│ │ │ │ ├── group-builder.feature
-│ │ │ │ └── group-chat.feature
-│ │ │ ├── page/
-│ │ │ │ └── page-crud.feature ✅
-│ │ │ ├── knowledge/
-│ │ │ │ └── knowledge-rag.feature
-│ │ │ └── memory/
-│ │ │ └── memory-crud.feature
-│ │ ├── smoke/ # 冒烟测试
-│ │ │ └── discover/
+│ │ ├── journeys/agent/ # Agent 用户旅程(体验基准线)
+│ │ ├── home/ # Home 布局、侧边栏、聊天输入
+│ │ ├── page/ # Page 文稿 CRUD 与编辑器
+│ │ ├── community/ # 社区详情页与互动
+│ │ ├── routes/ # 核心路由冒烟
│ │ └── regression/ # 回归测试
-│ ├── steps/ # Step definitions
-│ │ ├── agent/ # Agent 相关 steps
-│ │ ├── page/ # Page 相关 steps
-│ │ ├── common/ # 通用 steps (auth, navigation)
+│ ├── steps/ # Step definitions,按模块分目录(agent/home/page/community/routes/auth/common)
│ │ └── hooks.ts # Before/After hooks
│ ├── mocks/ # Mock 框架
-│ │ └── llm/ # LLM Mock (拦截 AI 请求) ✅
+│ │ └── llm/ # LLM Mock (拦截 AI 请求)
│ └── support/ # 测试支持文件
│ └── world.ts # CustomWorld 定义
├── screenshots/ # 失败截图