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.

๐Ÿ”จ chore: add deep-review skill, superseding review-checklist (#16691)

YuTengjing8f0b0595b151
diff --git a/.agents/skills/deep-review/SKILL.md b/.agents/skills/deep-review/SKILL.md
new file mode 100644
index 00000000000..61a96402350
--- /dev/null
+++ b/.agents/skills/deep-review/SKILL.md
@@ -0,0 +1,94 @@
+---
+name: deep-review
+description: 'Multi-dimensional code review. Use when the user asks to review, evaluate, or audit a PR, diff, branch, or pasted change โ€” including informal review asks like "look at this change for problems" โ€” via light mode: inline review against the dimension quick checklists. Not for explain-only questions about what a change does or why. Deep mode runs only on explicit invocation (/deep-review): one review subagent per dimension plus independent verification subagents that falsify findings before reporting.'
+---
+
+# Deep Review
+
+Multi-dimensional code review built on independent subagents. Review breadth comes from parallel per-dimension reviewers; precision comes from an adversarial verification pass that falsifies findings before they reach the report.
+
+## Core principles
+
+Every design choice below serves one of these. When unsure how to execute a step, come back here.
+
+1. **Anti-hallucination** โ€” reviewers that only see diff fragments invent bugs. Candidate findings are therefore falsified one by one by an **independent verify subagent** that reads full context and returns a three-way verdict (`confirmed` / `false_positive` / `need_more_context`). Three-way verdicts beat confidence percentages: calibrated-sounding scores are unreliable as hard filters.
+2. **Anti self-approval** โ€” an agent that just wrote the code is grading its own homework and will pass it. Review must run in **independent subagents** with a third-party reviewer stance. Never silently degrade deep mode to "the main agent reviews and then verifies its own findings".
+3. **Rules over model** โ€” review quality comes from fine-grained, executable dimension rules, not from a smarter model. Subagents run on balanced/fast model tiers; each dimension file tells them exactly how to check, what counts, and what does not.
+4. **Calibrate to codebase and lifespan** โ€” hold the diff to the standard the codebase already meets, not an idealized one. If a pattern is widespread in the existing code and this diff does not make it worse, it is not a finding. Declared-temporary code (time-boxed campaign, experiment, one-off script) is judged against its lifespan: hardcoding and low-extensibility shortcuts are the intended trade-off for shipping fast, and "delete the code at expiry" is a valid plan โ€” do not demand configurability from code built to be deleted. (Security is exempt from all calibration โ€” see the dimension file.)
+5. **Speed is a feature** โ€” one wave of parallel reviewers, verification pipelined per dimension (never a global barrier), irrelevant dimensions pruned up front.
+
+## Two entry modes
+
+| Mode | Trigger | What runs |
+| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
+| **Light** (default) | Any ordinary review ask: "review this PR", an informal "look at this change for problems", a diff pasted for review โ€” but not explain-only questions about a change | Main agent reviews inline against the **Quick checklist** section of each applicable dimension file. No subagents. |
+| **Deep** | Explicit only: `/deep-review`, "run deep review", "full multi-agent review" | Full orchestration: per-dimension review subagents โ†’ pipelined verify subagents โ†’ structured report โ†’ interactive fix flow. |
+
+Do not auto-escalate light to deep. Do not run deep mode for a casual "็œ‹็œ‹่ฟ™ไธชๆ”นๅŠจ" โ€” that is light mode.
+
+## Dimensions
+
+Rules live in one place: [`references/dimensions/`](references/dimensions/), one file per dimension. Both modes read the same files (light mode reads only the `Quick checklist` section; deep-mode subagents read the full file plus its listed rule sources).
+
+| Dimension | id prefix | Covers | Verified? |
+| ----------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
+| [code-style](references/dimensions/code-style.md) | `style` | naming, readability, dead code, comments, i18n hardcoding, UI-library and styling conventions | yes |
+| [logic](references/dimensions/logic.md) | `logic` | logic correctness: edge cases, null, races, error handling, state machines, requirement deviation, test coverage | yes |
+| [business-logic](references/dimensions/business-logic.md) | `design` | design judgment: framework misuse, best-practice violations, solution-weight mismatch, self-inflicted complexity | yes |
+| [reuse-architecture](references/dimensions/reuse-architecture.md) | `reuse` | duplicate implementations, unused existing patterns, extensibility, architectural boundaries | yes |
+| [performance](references/dimensions/performance.md) | `perf` | N+1, blocking calls, resource leaks, render-path waste, **DB migration locking and idempotency** | yes |
+| [security](references/dimensions/security.md) | `sec` | injection, auth bypass, secret/PII leakage, business-slot confidentiality | yes |
+| [compatibility](references/dimensions/compatibility.md) | `compat` | light/dark theme, desktop app / web (desktop, mobile) / RN, released-client API compatibility, client vs server agent runtime (gateway on/off), Vercel vs Docker deploys, paired router configs | yes |
+| [ux](references/dimensions/ux.md) | `ux` | empty/loading/error states, async feedback, confirmation flows, design-value adherence | yes |
+| [observability](references/dimensions/observability.md) | `obs` | bug fixes without explanatory comments/issue links, uncommented hacks, silent catches, missing logs on key paths | yes |
+| [workflow](references/dimensions/workflow.md) | `flow` | issue tracking state, PR description freshness, undocumented key decisions, CI / preview build status | no (objective state) |
+| [skill-freshness](references/dimensions/skill-freshness.md) | `skill` | agent skills invalidated by this diff, knowledge worth distilling into a new skill | no (advisory) |
+
+`Verified? no` means findings from that dimension are objective state checks or advisories โ€” they skip the verify pass and go straight to the report.
+
+### Pruning table (deep mode)
+
+Before spawning, the main agent prunes dimensions that cannot apply to the diff. List pruned dimensions and the one-line reason in the report header. When in doubt, run the dimension.
+
+| Dimension | Skip when |
+| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
+| code-style, logic, business-logic, reuse-architecture | never (skip only for docs/lockfile-only diffs) |
+| performance | no server/db/loop/render-path code touched (e.g. docs, copy, pure type changes) |
+| security | lockfile/generated-only diff โ€” docs and copy still run it (text is a leak vector: secrets, internal URLs, commercial details) |
+| compatibility | diff touches no UI theming/routing, no API contract, no deployment config, no runtime-branching code |
+| ux | no user-facing surface changed (components, styles, copy, interaction flows) |
+| observability | no error handling, async flow, or server code touched |
+| workflow | never in deep mode (cheap external-state checks) |
+| skill-freshness | never in deep mode (cheap) |
+
+**"Docs-only" means human-facing prose only.** Files that are executable instructions for agents โ€” `.agents/skills/**`, `AGENTS.md` / `CLAUDE.md`, prompt templates, orchestration manuals โ€” count as code for pruning purposes: their "prose" carries control flow, contracts, and rules whose contradictions are exactly what logic / business-logic / reuse-architecture exist to catch. A diff touching them is never docs-only.
+
+Light mode applies the same table to decide which Quick checklists to read.
+
+## Extension packs
+
+A wrapping repository (e.g. a private deployment that vendors this repo as a submodule) can extend the rule set without forking this skill: any sibling skill directory in the active skills root matching `deep-review-*` (for example `.agents/skills/deep-review-cloud/`) is an extension pack.
+
+- Extension packs contain `dimensions/*.md` files in the same format; a file named after a built-in dimension **extends** it (load both), a new name **adds** a dimension.
+- Both modes must check for extension packs at startup and load whatever is present. Absence is normal โ€” this skill is self-sufficient.
+- Extension packs may carry rules that must not live in this open-source repo; never copy their content into files under this directory.
+
+## Light mode procedure
+
+1. Determine review scope exactly as deep mode step 0 does (see the environment manual's scope rules โ€” local default ref, three-dot diff, submodule diffs included), but skip the background-hunting extras when context already tells you what changed.
+2. Apply the pruning table; read the `Quick checklist` section of each surviving dimension file, plus extension-pack counterparts.
+3. Review inline. Findings must cite a rule source or code evidence; respect the codebase-calibration principle.
+4. Output in your environment's normal review format (light mode does NOT use the deep report template). Mention that deep mode exists if findings suggest the diff deserves a full pass.
+
+## Deep mode procedure
+
+Pick the manual for the current environment and follow it end to end:
+
+- **Claude Code** โ†’ [`references/claude-code/main.md`](references/claude-code/main.md)
+- **Codex** โ†’ [`references/codex/main.md`](references/codex/main.md)
+
+If the environment is not listed, tell the user deep mode does not support it yet and offer light mode instead. Do not improvise another environment's mechanics, and do not degrade to a single-agent pass (see principle 2).
+
+## Keeping this skill sharp
+
+The `skill-freshness` dimension and the `workflow_feedback` channel in the subagent return schema exist to feed observations back into these files. When a review surfaces a rule gap, an outdated rule, or a recurring team preference, update the relevant dimension file in the same PR or a follow-up โ€” that is how calibration stays current.
diff --git a/.agents/skills/deep-review/references/claude-code/main.md b/.agents/skills/deep-review/references/claude-code/main.md
new file mode 100644
index 00000000000..0affd815ce5
--- /dev/null
+++ b/.agents/skills/deep-review/references/claude-code/main.md
@@ -0,0 +1,76 @@
+# Deep Review ยท Claude Code Manual
+
+Deep mode in Claude Code, end to end. "Subagent" below means a Task-tool agent: subagents share no context with the main agent, so every prompt must be self-contained (scope summary, changes or fetch commands, return format โ€” all included).
+
+Model tier: review and verify subagents run fine on a balanced/fast tier โ€” quality comes from the dimension rules, not model brains. If the harness supports per-Task model selection, prefer the balanced tier (e.g. sonnet-class) over the largest model.
+
+## Step 0 โ€” Scope & background
+
+Follow [`../scoping.md`](../scoping.md). Outputs: the `{changes}` payload (diff text or fetch commands), the โ‰ค 200-word scope summary, and PR metadata in PR mode.
+
+## Step 1 โ€” Select dimensions
+
+1. Apply the pruning table in `SKILL.md` to the changed-file list; note each pruned dimension and its one-line reason (they go in the report header).
+2. Detect extension packs: list sibling `deep-review-*` directories in the active skills root (e.g. `.agents/skills/deep-review-cloud/`). For each surviving dimension, collect its rule-file paths: built-in `references/dimensions/<name>.md` plus any extension counterpart; extension-only files add new dimensions (prune those with the same table logic, using their frontmatter `skip_when`).
+
+## Step 2 โ€” Spawn all reviewers in one wave
+
+**Hard requirement: launch every selected dimension's review Task concurrently in a single response.** One dimension per Task keeps each reviewer's attention undivided; parallel latency โ‰ˆ the slowest single dimension.
+
+Per Task:
+
+1. Read [`../review-prompt.md`](../review-prompt.md) once; instantiate per dimension:
+ - `{dimensions}` โ†’ the dimension id
+ - `{dimension_files}` โ†’ that dimension's rule-file paths from step 1
+ - `{scope_summary}` / `{changes}` โ†’ step 0 outputs
+2. The substituted text is the Task's entire prompt.
+3. `description`: `review: <dimension>`; `subagent_type`: `general-purpose`.
+
+## Step 3 โ€” Pipelined verification
+
+Verification is per-dimension and starts the moment that dimension's reviewer returns โ€” never wait for the other reviewers (no global barrier).
+
+On each reviewer's return:
+
+1. Extract the ` ```json ` fence, `JSON.parse` it. Parse failure or wrong schema โ†’ reject and re-spawn that reviewer with the same prompt (malformed JSON is itself a laziness signal).
+2. Dimension marked `verify: false` (workflow, skill-freshness) โ†’ findings go straight to the report pool.
+3. Zero findings โ†’ done with this dimension.
+4. Otherwise spawn a verify Task immediately: read [`../verify-prompt.md`](../verify-prompt.md), substitute `{issues}` (this reviewer's findings array), `{scope_summary}`, `{changes}`; `description`: `verify: <dimension>`.
+
+Anti-shortcut validation on each verify return:
+
+- Extract + parse the JSON; `verifications.length` must equal the input count, ids matching one-to-one (Set difference finds gaps).
+- Mismatch โ†’ spawn a fresh verify Task carrying only the missing ids' original findings and the full verify prompt (every Task is a new subagent; re-supply full context). Do not loosen the check.
+- > 20 findings from one reviewer โ†’ split verification into 2 batches by id order (rare; default is one batch).
+
+Verdict handling: `confirmed` โ†’ report pool (apply `fix_options_override` / `nature_override` / `same_root_as`); `false_positive` โ†’ drop; `need_more_context` โ†’ "Needs your input" appendix. Never let the main agent "fill in context" and re-verify by itself โ€” that pollutes the main context and violates the independence principle; escalate through the appendix instead.
+
+## Step 4 โ€” Render the report
+
+Render strictly per [`../report-template.md`](../report-template.md) โ€” structure, ordering, P2 cap, unverified-dimension sections, statistics, and the PR-mode merge verdict (decision table lives in the template; the main agent fills it, never a subagent). Run the template's pre-send self-check before sending.
+
+## Step 5 โ€” Ask about the "safe to fix now" batch
+
+When the batch is non-empty, use `AskUserQuestion` (don't just write "want me to fix these?" in prose):
+
+- Question: `"Safe to fix now" has N low-risk findings โ€” apply them all in one pass?`
+- Options: `Fix all` (recommended; apply each finding's fix option) / `Not now` (report only). Partial picks arrive via the built-in "Other" answer.
+
+`Fix all` โ†’ apply each fix, add regression tests where `need_test: true`, one line per fix in the reply. Empty batch โ†’ skip this step silently.
+
+## Step 6 โ€” Walk the remaining decisions
+
+Confirmed findings with `can_auto_fix: false` plus the `need_more_context` appendix need user decisions. When non-empty, drive them through `AskUserQuestion`:
+
+- โ‰ค 4 questions per call; order by P0 โ†’ P1 โ†’ P2, `blocks_release: true` first; tell the user when more remain for the next round.
+- One finding = one question: confirmed items offer their `fix_options` as options (single option โ†’ `Apply the fix` / `Skip this round`); `need_more_context` items ask for the missing context (`I'll provide it` / `Park it`).
+- Apply whatever the user picks (tests included where flagged); park the rest.
+
+Both lists empty โ†’ the report ends the flow; ask nothing.
+
+## Notes
+
+- **Self-containment**: any information a subagent needs must be in its prompt โ€” especially the scope summary and changes payload.
+- **Small vs large diff**: โ‰ค 200 lines AND โ‰ค 5 files โ†’ inline diff text into prompts; larger โ†’ pass fetch commands (very-large check first โ€” see scoping.md).
+- **PR mode trigger**: GitHub PR URL in the user's message only.
+- **Do not degrade**: if Tasks cannot be spawned in this environment, stop and tell the user to use light mode โ€” a main-agent-only "deep review" violates the skill's core principles.
diff --git a/.agents/skills/deep-review/references/codex/main.md b/.agents/skills/deep-review/references/codex/main.md
new file mode 100644
index 00000000000..3741b334376
--- /dev/null
+++ b/.agents/skills/deep-review/references/codex/main.md
@@ -0,0 +1,77 @@
+# Deep Review ยท Codex Manual
+
+Deep mode in Codex, end to end. "Subagent" below means a `spawn_agent` agent: subagents share no context with the main agent, so every prompt must be self-contained.
+
+Codex constraints this manual is built around:
+
+- **Tool discovery first**: multi-agent tool names vary by Codex version and may stay hidden until discovered โ€” e.g. surfaced via `tool_search` as `multi_agent_v1.spawn_agent` / `wait_agent` / `close_agent`, or exposed directly as `spawn_agent` / `wait` / `close_agent`. Before step 2, search/list the session's tools and bind the spawn/wait/close verbs used below to the names actually exposed; do not assume this manual's names exist verbatim. If no multi-agent tools can be surfaced, stop and offer light mode.
+- **Concurrency budget**: multi\_agent\_v2 caps concurrent threads per session (default 4 including the root โ€” 3 usable subagent slots); the legacy `agents.max_threads` default is 6. The flow therefore runs dimensions as **3 composite groups** in a single wave instead of one agent per dimension.
+- **Slots are held until closed**: a finished agent still occupies its slot until `close_agent`. Close every agent as soon as you've consumed its result.
+- **Delegation policy**: Codex spawns subagents only when the user explicitly allows agent delegation. Deep mode is explicitly invoked, which is that permission; if your session policy still forbids spawning, stop and offer light mode โ€” never degrade to a single-agent "deep review".
+- Model per agent: balanced tier is enough (rules carry the quality); use a faster/mini tier for the `process` group, which is scan-heavy.
+
+## Group table
+
+Dimension rules stay one-per-file; Codex only changes how they are **packed**:
+
+| Group | Dimensions (in prompt order) |
+| ------------- | -------------------------------------------------- |
+| `quality` | code-style, reuse-architecture, business-logic, ux |
+| `correctness` | logic, performance, security, compatibility |
+| `process` | workflow, skill-freshness, observability |
+
+Pruning removes dimensions from a group; a fully pruned group is not spawned. The table is a starting point โ€” recalibrate the packing in this file if group runtimes drift far apart.
+
+Extension packs can also **add** dimensions (a `deep-review-*/dimensions/` file whose name matches no built-in). Added dimensions have no row in the table: collect them into a dynamic fourth group, `extras`. `extras` never joins the initial wave โ€” it queues until the first `close_agent` frees a slot (a slot is only free in the initial wave when a built-in group was fully pruned). Their verify routing follows each dimension file's own `verify` frontmatter flag (default: verified).
+
+## Step 0 โ€” Scope & background
+
+Follow [`../scoping.md`](../scoping.md). Outputs: `{changes}` (diff text or fetch commands), the โ‰ค 200-word scope summary, PR metadata in PR mode.
+
+## Step 1 โ€” Select dimensions
+
+Same as the pruning + extension-pack procedure in `SKILL.md`: apply the pruning table, detect sibling `deep-review-*` extension packs, collect each surviving dimension's rule-file paths (built-in + extension counterpart). Map surviving dimensions onto the group table; extension-added dimensions go to the `extras` group (see above) so downstream rules never get silently dropped.
+
+## Step 2 โ€” Spawn all groups in one wave
+
+Launch the three built-in groups' `spawn_agent` concurrently in a single turn (โ‰ค 3 agents โ€” fits the default slot budget). A non-empty `extras` group is NOT part of this wave: queue it โ€” step 3's dispatch priority gives it the first freed slot (step 3 closes each review agent as soon as its result is consumed, so the wait is short).
+
+Per group:
+
+1. Read [`../review-prompt.md`](../review-prompt.md); instantiate:
+ - `{dimensions}` โ†’ the group's surviving dimension ids (comma-separated)
+ - `{dimension_files}` โ†’ all their rule-file paths
+ - `{scope_summary}` / `{changes}` โ†’ step 0 outputs
+2. Substituted text โ†’ `spawn_agent.message`. Prompts are self-contained; `fork_context` stays `false` unless the session holds hard-to-summarize requirement background.
+
+## Step 3 โ€” Collect, close, verify (pipelined)
+
+Loop `wait` until all review agents have returned โ€” the initial wave plus a late-spawned `extras` (wait is wait-any โ€” call it repeatedly). For **each** returned review agent, immediately:
+
+1. `close_agent` it โ€” frees a slot. **Dispatch priority for the freed slot**: a still-queued `extras` group spawns first and joins the review wait set; only then does the slot go to a verifier.
+2. Extract the ` ```json ` fence and parse. Parse failure / wrong schema โ†’ reject, re-spawn that group with the same prompt.
+3. Partition its findings by dimension `verify` flag: `verify: false` dimensions (workflow, skill-freshness) go straight to the report pool; zero verifiable findings โ†’ done with this group.
+4. Otherwise spawn that group's verify agent in the next slot the dispatch priority allows (do not wait for other groups): [`../verify-prompt.md`](../verify-prompt.md) with `{issues}` = this group's verifiable findings, plus `{scope_summary}` / `{changes}`.
+
+On each verify return: `close_agent` first, then validate โ€” `verifications.length` equals input count, ids one-to-one (Set difference). Mismatch โ†’ spawn a fresh verify agent with the missing ids' findings and the full prompt; do not loosen. Verdicts: `confirmed` โ†’ report pool (apply overrides / `same_root_as`); `false_positive` โ†’ drop; `need_more_context` โ†’ "Needs your input" appendix. The main agent never re-verifies findings itself.
+
+Slot arithmetic: up to 3 review agents spawn together; every later spawn (queued `extras`, verifiers) fills a slot freed by `close_agent`, so the flow never exceeds 3 concurrent agents and never deadlocks on the default budget. When `extras` claims the first freed slot it delays that one verifier by a single turn โ€” acceptable, review coverage is the contract.
+
+## Step 4 โ€” Render the report
+
+Render strictly per [`../report-template.md`](../report-template.md) โ€” structure, P2 cap, unverified-dimension sections, statistics, PR-mode merge verdict (main agent fills the decision table; never delegated). Run the template's pre-send self-check. Do not fall back to Codex's default findings format.
+
+## Step 5 โ€” Ask about the "safe to fix now" batch
+
+Non-empty batch โ†’ one `request_user_input` (allowed regardless of delegation policy): `"Safe to fix now" has N low-risk findings โ€” apply them all in one pass?` with options `Fix all` (recommended) / `Not now`; free-text covers partial picks. `Fix all` โ†’ apply each fix option, add regression tests where `need_test: true`, one line per fix. Empty โ†’ skip silently.
+
+## Step 6 โ€” Walk the remaining decisions
+
+`can_auto_fix: false` confirmed findings + the `need_more_context` appendix, when non-empty, go through `request_user_input` one finding at a time โ€” P0 โ†’ P1 โ†’ P2, `blocks_release: true` first; offer the finding's `fix_options` as the choices. Apply what the user picks; park the rest. Both lists empty โ†’ the report ends the flow.
+
+## Notes
+
+- **Self-containment**: everything a subagent needs lives in its prompt โ€” especially scope summary and changes payload.
+- **Small vs large diff**: โ‰ค 200 lines AND โ‰ค 5 files โ†’ inline the diff; larger โ†’ pass fetch commands (very-large check first โ€” see scoping.md).
+- **PR mode trigger**: GitHub PR URL in the user's message only.
+- Raising `agents.max_threads` shortens nothing here (the wave already fits 3 slots) โ€” keep the group table as the execution grain for predictability.
diff --git a/.agents/skills/deep-review/references/dimensions/business-logic.md b/.agents/skills/deep-review/references/dimensions/business-logic.md
new file mode 100644
index 00000000000..b27dd77abd8
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/business-logic.md
@@ -0,0 +1,41 @@
+---
+id_prefix: design
+verify: true
+skip_when: docs/lockfile-only diff
+---
+
+# Business Logic Design
+
+Design-level judgment on how the change solves its requirement: does it use the platform as documented, match the solution's weight to the problem, and avoid self-inflicted complexity? Whether the code is _correct_ belongs to the logic dimension; this dimension asks whether it is _well-conceived_.
+
+## Quick checklist
+
+- Framework misuse: fighting Next.js/React/Drizzle instead of using the documented mechanism (check official docs before assuming custom code is needed)
+- Self-inflicted complexity ("ๆฒก่‹ฆ็กฌๅƒ"): hand-rolling what the framework, an external dependency, or a simpler design gives for free. "External" is the boundary โ€” duplicating a sibling in-repo implementation belongs to reuse-architecture, not here; report it there or leave it to that reviewer
+- Hand-built domain machinery the external platform offers natively: custom implementations of domain mechanisms (usage metering, billing math, invoice generation, subscription lifecycle, scheduling, webhook retry) when the platform the feature runs on โ€” payment provider, auth service, deployment platform โ€” ships the capability built in. Classic failure: hand-rolling usage records + charge calculation + invoices because nobody knew the payment provider has native metered billing. Reviewers share the author's blind spots โ€” check the platform's official docs, don't trust memory
+- Solution weight mismatched to requirement scale: a new abstraction layer, config system, or queue where a direct implementation satisfies the stated need โ€” and the inverse, a quick hack on a path the requirement marks critical (billing, auth, data integrity)
+- Best-practice violations with a citable source (official docs, a repo skill, `DESIGN.md`) โ€” not personal taste
+
+## Rule sources (deep mode: read before reviewing)
+
+- Framework docs when the diff leans on framework behavior (`node_modules/next/dist/docs/` for Next.js โ€” this repo pins a version with breaking changes; do not trust training data)
+- Official docs of the external platform the diff builds on (payment, auth, deployment, messaging) โ€” web-search them when not available locally; the question is always "does this platform already do this natively?"
+- The requirement background in the scope summary โ€” the yardstick for solution-weight judgments
+
+## How to check
+
+1. For each non-trivial mechanism the diff introduces, ask "does the framework or an existing dep already provide this?" โ€” check the docs, do not assume.
+2. For domain mechanisms, identify the external platform involved and search its official docs for a native solution โ€” "we didn't know it existed" is the most expensive form of self-inflicted complexity, and it survives review when the reviewer relies on the same memory the author did.
+3. Compare the solution's weight against the requirement's stated scope and lifespan (a temporary campaign does not need a config system; a billing path does not get a quick hack).
+4. For each best-practice finding, name the source you would cite in `rule_source` โ€” no citable source, no finding.
+
+## Violations
+
+- Custom machinery duplicating a documented framework feature or a native capability of the external platform the feature runs on (cite the doc).
+- Solution complexity unjustified by the requirement, or robustness shortcuts on paths the requirement marks critical.
+
+## Not violations
+
+- Simple implementations of simple needs (calibration principle โ€” match the codebase's bar, not an idealized one).
+- Personal-taste preferences without a citable source.
+- Complexity with a stated reason (a comment or the PR explains the constraint that forces it).
diff --git a/.agents/skills/deep-review/references/dimensions/code-style.md b/.agents/skills/deep-review/references/dimensions/code-style.md
new file mode 100644
index 00000000000..53cb857c98f
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/code-style.md
@@ -0,0 +1,49 @@
+---
+id_prefix: style
+verify: true
+skip_when: docs/lockfile-only diff
+---
+
+# Code Style
+
+Fragment-level readability and convention adherence. Look at each changed hunk in isolation โ€” cross-file reuse and abstraction questions belong to `reuse-architecture`.
+
+## Quick checklist
+
+- Leftover `console.log` / `console.debug` โ€” use the `debug` package or remove
+- Missing `return await` inside try/catch (the rejection escapes the catch) โ€” <https://typescript-eslint.io/rules/return-await/>
+- Hardcoded user-facing strings โ€” must go through i18n keys (`src/locales/default/<namespace>.ts`, named `{feature}.{context}.{action|status}`)
+- `antd` imports where `@lobehub/ui` (or `@lobehub/ui/base-ui`) wraps the same component โ€” base-ui first, then `@lobehub/ui`, antd last
+- Hardcoded colors / raw CSS values โ€” use `antd-style` tokens; prefer `createStaticStyles` + `cssVar.*` over `createStyles` + `token` unless styles need runtime computation
+- Dead code, commented-out blocks, unused exports introduced by this diff
+- Comments: missing on hacky/non-obvious logic; stale after a signature change; or merely restating the code
+- Nesting โ‰ฅ 3 levels that early returns / lookup tables would flatten
+- Redundant or derivable state: a variable/state field that mirrors a prop or is computable from existing state โ€” derive it (selector, `useMemo`, plain expression) instead of storing a second copy that can drift
+- Type looseness: `any`, runtime narrowing that the type signature hides, implicit contracts
+- File ballooning past \~800 lines without splitting
+
+## Rule sources (deep mode: read before reviewing)
+
+- `.agents/skills/typescript/SKILL.md` โ€” TS style and type-safety rules
+- `.agents/skills/react/SKILL.md` โ€” component conventions, base-ui/@lobehub/ui/antd priority, styling
+- `.agents/skills/i18n/SKILL.md` โ€” locale key conventions, what needs a key
+- Repo root `AGENTS.md` / `CLAUDE.md` โ€” repo-wide conventions
+
+## How to check
+
+1. Read the diff hunk by hunk; style issues must be visible within the fragment (plus its file).
+2. For UI imports: `rg "from 'antd'" <changed files>` and check whether `@lobehub/ui` or `@lobehub/ui/base-ui` exports the same component.
+3. For strings: scan added JSX/text literals; anything a user can see needs an i18n key.
+4. For comments: diff the signature/behavior changes against surrounding JSDoc โ€” flag stale docs.
+
+## Violations
+
+- Anything in the Quick checklist, when introduced or made worse by this diff.
+- Naming that misleads (name says X, code does Y) โ€” this is a violation even when the codebase has other weak names, because it is newly introduced.
+
+## Not violations
+
+- Formatting that Prettier/ESLint already enforces โ€” CI owns it, do not report.
+- Naming that is merely bland but accurate.
+- Pre-existing style debt in untouched lines (calibration principle: this diff didn't make it worse).
+- Comment density matching the file's existing norm โ€” do not demand JSDoc on every function in a file that comments sparsely.
diff --git a/.agents/skills/deep-review/references/dimensions/compatibility.md b/.agents/skills/deep-review/references/dimensions/compatibility.md
new file mode 100644
index 00000000000..734ee9fb11b
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/compatibility.md
@@ -0,0 +1,57 @@
+---
+id_prefix: compat
+verify: true
+skip_when: no UI theming/routing, no API contract, no deployment config, no data-scoping/permission logic, no runtime-branching code touched
+---
+
+# Compatibility
+
+The same change must work across every surface this product ships to. Authors (and reviewers) habitually validate only their own dev setup โ€” typically **cloud edition + web desktop + light mode + latest client + personal workspace** โ€” and every other cell of the matrix is where regressions hide.
+
+## The compatibility matrix
+
+| Axis | Variants to hold in mind |
+| -------------- | ------------------------------------------------------------------------------------------------------------------- |
+| Theme | light / dark (`cssVar.*` tokens handle both; hardcoded colors break one) |
+| Platform | desktop app (Electron) / web desktop / web mobile / React Native |
+| Client version | released desktop/mobile clients keep calling old endpoints after the server deploys |
+| Agent runtime | client-side runtime vs server runtime (gateway enabled or not) |
+| Deployment | Vercel (serverless: no local fs persistence, execution time limits) vs Docker (long-lived process) |
+| Edition | open-source self-hosted (business slots return safe no-op defaults) vs cloud (commercial overrides active) |
+| Tenancy | personal context (`workspaceId === null`) vs workspace context (workspace-scoped data, permissions, member sharing) |
+
+## Quick checklist
+
+- Hardcoded colors or light-only assets โ€” break dark mode; use theme tokens
+- New route/page registered in `src/spa/router/desktopRouter.config.tsx` but not `desktopRouter.config.desktop.tsx` (or vice versa) โ€” causes blank screens; `desktopRouter.sync.test.tsx` must stay green
+- Mobile variant missing: page/feature added to desktop routes with no `(mobile)` counterpart or responsive handling
+- Deleted/renamed TRPC procedure or webapi route still called by released clients โ€” keep a compatibility alias; for deprecated write paths a side-effect-free noop is acceptable **only when** the old client treats that success shape as "nothing to do" and no user-visible state, billing, permission, or deletion is falsely reported complete; for meaningful operations return a stable business error (`PRECONDITION_FAILED` / `410 Gone`) instead of blind success
+- Changed API input/output shape without versioning or optional-field fallback for older callers
+- Logic assuming the agent runtime location (client vs server/gateway) โ€” must branch or stay runtime-agnostic
+- Serverless-hostile code: local file writes, in-memory state expected to survive requests, long-running work beyond function limits
+- Workspace-blind logic: new data reads/writes, permission checks, or list scoping that silently assume the personal context โ€” must respect the active workspace scope (`useActiveWorkspaceId` / `workspaceSlug`) or be explicitly personal-only by design
+- Cloud-only assumption: logic that only works when a business slot has its cloud override โ€” must still function against the slot's open-source no-op default (feature hidden or gracefully degraded, not broken)
+- Renamed backend route paths (`src/app/(backend)/webapi/...`) or SSR page paths (`src/app/[variants]/(auth)/...`), or changed `@lobechat/business-*` exports โ€” downstream deployments override/extend these paths; flag so they can adapt
+- Dependency major bumps (`next`, `drizzle-orm`, ...) โ€” downstream lockstep required; call out in the PR description
+
+## Rule sources (deep mode: read before reviewing)
+
+- `.agents/skills/spa-routes/SKILL.md` โ€” router pair invariant, mobile/desktop variants
+- `.agents/skills/react/SKILL.md` โ€” theming/token rules
+- Git history of the old endpoint (`git log -p` on the deleted route) before trusting that a procedure is unused โ€” inspect what removed the caller and whether released clients predate it
+
+## How to check
+
+1. For each removed/renamed export, route, or procedure: search current code for callers, then check whether a _released_ client (desktop/mobile/RN) could still call it โ€” current-code absence is not proof.
+2. For UI changes: read the styles for hardcoded colors; check both router configs when routes change; look for the mobile counterpart.
+3. For server changes: scan for fs writes, timers, in-memory caches that assume process longevity.
+4. For data/permission logic: trace what happens when `workspaceId` is `null` (personal / self-hosted) and when the involved business slots return their open-source defaults โ€” both paths must stay sound.
+
+## Violations
+
+- Any matrix axis where the change demonstrably breaks or silently degrades, introduced by this diff.
+
+## Not violations
+
+- Axes the changed surface genuinely cannot reach (a server-only refactor does not need a dark-mode check).
+- Breaking changes explicitly coordinated in the PR description (migration window, paired client release) โ€” verify the coordination is stated, then leave a note-level finding at most.
diff --git a/.agents/skills/deep-review/references/dimensions/logic.md b/.agents/skills/deep-review/references/dimensions/logic.md
new file mode 100644
index 00000000000..228c3e52aef
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/logic.md
@@ -0,0 +1,43 @@
+---
+id_prefix: logic
+verify: true
+skip_when: docs/lockfile-only diff
+---
+
+# Logic Correctness
+
+Does the change do what the requirement asked, and does it hold up under real inputs? The classic bug hunt, plus the tests that pin the behavior down. Design-level judgment (framework misuse, self-inflicted complexity) lives in the business-logic dimension.
+
+## Quick checklist
+
+- Edge cases: empty arrays/strings, zero, boundary indexes, first/last page, single-item collections
+- Null/undefined flowing into code that assumes presence
+- Race conditions: concurrent mutations, stale closures, un-awaited promises whose order matters
+- Error handling: failure paths that leave state half-mutated or the UI stuck
+- State machines: unreachable/unhandled states after this change
+- Requirement deviation: the diff contradicts the stated need, acceptance criteria, or key decisions recorded in the PR/issue/conversation. Report even when the code is internally correct โ€” the reviewer cannot tell a legitimate mid-implementation adjustment from a forgotten decision (context loss, compaction), so the fix is always two-option: align the implementation with the recorded decision, or update the record to state why the decision changed
+- Bug fixes ship a regression test covering the fixed scenario; new services / store actions / utilities have test coverage; new database Model/Repository ships a sibling `__tests__/<name>.test.ts` incl. user isolation (see `.agents/skills/testing/`)
+
+## Rule sources (deep mode: read before reviewing)
+
+- The requirement background in the review prompt's scope summary โ€” the primary yardstick for requirement deviation
+- `.agents/skills/testing/SKILL.md` โ€” what needs tests and how they are structured here
+
+## How to check
+
+1. Read the diff line by line with side effects in mind; for each changed function ask "what input breaks this?"
+2. Trace each error path to its end state: user feedback, state rollback, log.
+3. Compare behavior against the scope summary; deviations are findings even when the code is internally correct.
+4. For fixes: `ls` the sibling `__tests__/` and check the fixed scenario is actually covered, not just any test touched.
+
+## Violations
+
+- A concrete input/state sequence produces a wrong result, crash, stuck UI, or half-committed state.
+- The change silently narrows/broadens behavior versus the requirement.
+- A bug fix without a test that would have caught the original bug.
+
+## Not violations
+
+- Hypothetical inputs the system cannot produce (verify against callers before reporting).
+- Missing tests for trivial glue code with no logic.
+- Simple implementations of simple needs โ€” do not demand defensive programming for states upstream code already guarantees. The existing codebase keeps e.g. optimistic updates deliberately simple; match that bar instead of demanding exhaustive edge handling (calibration principle).
diff --git a/.agents/skills/deep-review/references/dimensions/observability.md b/.agents/skills/deep-review/references/dimensions/observability.md
new file mode 100644
index 00000000000..86f2c1b0e37
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/observability.md
@@ -0,0 +1,40 @@
+---
+id_prefix: obs
+verify: true
+skip_when: no error handling, async flow, or server code touched
+---
+
+# Observability
+
+When this code misbehaves in production six months from now, can the person debugging it (possibly an agent) see what happened and why the code is the way it is?
+
+## Quick checklist
+
+- Bug fix without a comment explaining **why** the fix is needed, especially non-obvious workarounds โ€” future readers will "simplify" it back into the bug; link the issue/PR when one exists
+- Hacky or surprising code without a comment stating the constraint that forces it (and a reference link when the workaround comes from an upstream issue/SO answer)
+- `catch` blocks that swallow errors: no log, no rethrow, no user feedback โ€” silent failure is the most expensive kind
+- Key paths (payment-like flows, data migration, auth transitions, cross-system calls) with no log line at decision points โ€” success paths matter too, not just errors
+- New logging uses the `debug` package with a proper `lobe-*` namespace, not stray `console.*`
+- Log lines that would be useless when read cold: no identifiers (which user? which entity?), or dumping whole objects instead of the discriminating fields
+
+## Rule sources (deep mode: read before reviewing)
+
+- `.agents/skills/debug-package/SKILL.md` โ€” namespace conventions, format specifiers
+- Repo `CLAUDE.md` / `AGENTS.md` comment rules โ€” mandatory comment scenarios (complex logic, trade-offs, reference links)
+
+## How to check
+
+1. `rg "catch" <changed files>` โ€” read every catch body added/modified by this diff; classify as logged / rethrown / surfaced / swallowed.
+2. For each fix in the diff, look for the explanatory comment in the same hunk; check it explains _why_, not _what_.
+3. Walk the main execution path of new server-side flows and count observable checkpoints.
+
+## Violations
+
+- A swallowed error, uncommented hack, or unexplained fix introduced by this diff.
+- A new multi-step flow whose failure would be undiagnosable from logs alone.
+
+## Not violations
+
+- Missing logs on trivial pure functions or UI-only handlers with visible outcomes.
+- Comment/log density matching equivalent existing flows (calibration principle) โ€” except silent catches, which are always findings.
+- Intentionally ignored errors that say so (`// ignore: <reason>`).
diff --git a/.agents/skills/deep-review/references/dimensions/performance.md b/.agents/skills/deep-review/references/dimensions/performance.md
new file mode 100644
index 00000000000..88339851c01
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/performance.md
@@ -0,0 +1,44 @@
+---
+id_prefix: perf
+verify: true
+skip_when: no server/db/loop/render-path code touched (docs, copy, pure type changes)
+---
+
+# Performance
+
+Will this change be slow, leak, or block โ€” at production data volume, not dev-fixture volume? Database migrations are checked here too (both locking behavior and idempotency: the review target is the migration file, so the rules live together).
+
+## Quick checklist
+
+- N+1: per-item queries/fetches inside a loop that a join/batch endpoint would collapse
+- Blocking calls on hot paths: synchronous fs/crypto in request handlers, un-batched sequential awaits that could be `Promise.all`, blocking work added to startup/entry paths
+- Resource leaks: listeners/intervals/subscriptions/AbortControllers created without cleanup (React effects, service singletons)
+- Long-lived objects or callbacks built from closures that capture a large enclosing scope โ€” the closure retains the whole scope for the object's lifetime; copy the needed fields instead
+- Render-path waste: heavy computation in render without memoization, unstable identities re-rendering large lists, missing virtualization for unbounded lists
+- Unbounded growth: caches/maps/arrays that only ever grow
+- **Migration locking**: DDL that takes ACCESS EXCLUSIVE long enough to block production queries โ€” adding a column with a volatile default, non-`CONCURRENTLY` index creation on a large table, table rewrites (`ALTER COLUMN TYPE`), `NOT NULL` on existing columns without a prior validated constraint
+- **Migration idempotency**: statements must guard with `IF NOT EXISTS` / `IF EXISTS` so a re-run cannot fail half-applied
+
+## Rule sources (deep mode: read before reviewing)
+
+- `.agents/skills/db-migrations/SKILL.md` โ€” migration workflow, idempotency, regeneration rules
+- `.agents/skills/drizzle/SKILL.md` โ€” query patterns, index conventions
+- `.agents/skills/data-fetching-architecture/SKILL.md` โ€” where fetching/caching belongs when the diff adds client data flows
+
+## How to check
+
+1. For each loop in the diff, ask what the iteration count is at production scale and whether each iteration does IO.
+2. For each new query, check whether it runs per-render, per-item, or per-request, and whether an existing batched path exists.
+3. For migrations: read the generated SQL (not just the schema diff); classify each DDL statement by lock level and duration on a large table; check every statement for idempotency guards.
+4. For React: check dependency arrays and identity stability of props passed into memoized children/lists.
+
+## Violations
+
+- A concrete path where latency, memory, or lock time grows with data volume introduced or worsened by this diff.
+- Migration SQL that blocks reads/writes on a production-sized table or fails on re-run.
+
+## Not violations
+
+- Micro-optimizations with no measurable path (string concat in a settings handler, one extra render of a small component).
+- Costs on genuinely cold paths (one-shot scripts, dev tooling) unless egregious.
+- Patterns the codebase already uses at the same scale without incident (calibration principle) โ€” flag only if this diff increases the exposure.
diff --git a/.agents/skills/deep-review/references/dimensions/reuse-architecture.md b/.agents/skills/deep-review/references/dimensions/reuse-architecture.md
new file mode 100644
index 00000000000..1ce6f51458e
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/reuse-architecture.md
@@ -0,0 +1,82 @@
+---
+id_prefix: reuse
+verify: true
+skip_when: pure-deletion or docs-only diff
+---
+
+# Reuse & Architecture
+
+Cross-file thinking: does this diff reinvent something the repo already has, ignore an established pattern, or erode an architectural boundary? This is the only dimension whose findings require repo-wide searching โ€” never judge from the diff alone.
+
+Reuse operates at three levels, and AI-authored diffs most often fail at the upper two โ€” they write locally plausible code without checking how the repo already solves this class of problem:
+
+1. **Unit**: a function/hook/component that already exists
+2. **Idiom**: an established implementation pattern for this kind of operation (e.g. data fetching rides store SWR hooks + service + `lambdaClient`, never `useEffect` + `useState`)
+3. **Cross-layer route**: how a feature of this category threads through the layers (component โ†’ store โ†’ service โ†’ TRPC โ†’ repository) โ€” same-kind features follow the same route
+
+## Quick checklist
+
+- New behavior unit (file, exported hook/util/component/selector, โ‰ฅ 20-line nameable block) duplicating an existing implementation โ€” check `packages/utils`, `src/utils/`, `src/hooks/`, shared modules
+- Hand-rolled logic where a standard pattern exists (ad-hoc type guard, manual `setInterval` + ref cleanup, string-concatenated paths, custom validation) โ€” search before writing
+- Idiom deviation: the repo has an established pattern for this operation category but the diff invents its own (fetching server data with `useEffect`/`useState` instead of the store SWR pipeline; hand-rolled modal state instead of `createModal`; component calling `lambdaClient` directly instead of through a service)
+- Cross-layer route deviation: a new feature is structured differently from its nearest same-kind sibling โ€” skips a layer, merges layers, or invents new ones โ€” without a stated reason
+- Copy-pasted blocks with slight variation that should be one shared function
+- Parameter sprawl: piling boolean/option flags onto an existing function instead of generalizing or splitting
+- Leaky abstraction: exposing internals callers should not depend on, or breaking an existing abstraction boundary
+- Fix placed at the wrong layer of a long pipeline: the layer the fix touches does not match the layer that owns the problem โ€” a variant-specific quirk patched in a shared layer (special-case pollution affecting every other consumer), or a class-wide problem patched in one variant (symptom fix; the same bug stays alive on every other path)
+- Bare strings/numbers where the repo already has an enum/constant
+- New hand-maintained parallel catalog (menu/tab/config list duplicated across files) โ€” derive from one source; parallel copies drift (the settings category catalog has already lost items this way)
+- Business/domain code placed in the wrong layer (page segments under `src/routes/` must stay thin and delegate to `src/features/`)
+
+## Rule sources (deep mode: read before reviewing)
+
+- `.agents/skills/project-overview/SKILL.md` โ€” layer map: what belongs in apps/packages/src
+- `.agents/skills/spa-routes/SKILL.md` โ€” roots vs features split
+- `.agents/skills/data-fetching-architecture/SKILL.md` โ€” the canonical cross-layer route for server data (component โ†’ store SWR hook โ†’ service โ†’ `lambdaClient`)
+- `.agents/skills/store-data-structures/SKILL.md`, `.agents/skills/zustand/SKILL.md` โ€” store shape and action patterns when the diff touches stores
+- Category pattern skills when the diff's category has one (`modal`, `trpc-router`, `builtin-tool`, `drizzle`, ...) โ€” check `.agents/skills/` for a skill matching the touched domain; when one exists it is the yardstick, cite it in `rule_source`
+
+## How to check
+
+Three passes โ€” precedent, outward, inward:
+
+**Precedent (pattern alignment) โ€” run this first for any new feature/capability:**
+
+1. Classify what the diff adds (data fetching, store slice, service method, modal, route, builtin tool, DB model, ...).
+2. Find the nearest existing same-kind implementation โ€” a sibling directory, a similar store slice, a service doing an analogous job โ€” and read how it flows through the layers.
+3. Compare structure, not names: same layering? same naming scheme (`useFetchXxx` / `refreshXxx`)? same failure-handling shape? A structural deviation is a finding unless the diff or PR states why the precedent does not fit.
+4. When a category pattern skill exists, prefer it over the oldest code you find โ€” precedents can themselves be legacy.
+
+**Outward (dedup + pattern reuse):**
+
+1. List the behavior units this diff introduces.
+2. For each, `rg` the repo with action + context keyword combos (e.g. `window.open` + popup, `setInterval` + poll, `JSON.parse` + storage).
+3. Default reuse sources to check first: `packages/utils/`, `src/utils/`, `src/hooks/`, `src/lib/`, `*/store/selectors/`, sibling directories of the changed files.
+4. Open every hit and compare behavioral equivalence: same input โ†’ same output/side effect. Name/parameter differences still count as equivalent; syntactic similarity with different semantics does not.
+5. Report only with `existing_implementations` filled (`file:line` or `file:line-range`, โ‰ฅ 1 entry).
+
+**Inward (extensibility):** judge the diff's own design โ€” parameter sprawl, leaky abstractions, hardcoded literals with existing constants (`rg` to confirm the constant exists).
+
+**Fix placement (for bug fixes on long pipelines):** many bugs can be patched at several points of the chain they live on (e.g. user message โ†’ agent runtime โ†’ provider โ†’ render); correct placement is decided by problem ownership, not by where the patch is easiest:
+
+1. Identify the pipeline and list the candidate layers where this fix could live.
+2. Ask: is the root cause specific to one variant (one provider, one platform, one client) or common to the whole class?
+3. Variant-specific โ†’ the fix belongs in the variant's own layer: a DeepSeek parameter quirk goes in `packages/model-runtime/src/providers/deepseek/`, not in the shared `core/openaiCompatibleFactory/` where it would branch for every provider. Class-wide โ†’ the fix belongs in the shared layer, not replicated at one call site.
+4. Check the shared layer's existing extension points first (factory options, hooks, per-variant config) โ€” the repo usually already provides a seam for variant behavior; adding an `if (variant === ...)` branch to shared code when a seam exists is the violation.
+
+Large-repo fallback: if a single `rg` exceeds \~30s, restrict to the changed files' top-level directories plus the default reuse sources.
+
+## Violations
+
+- Diff introduces a new unit with โ‰ฅ 1 behaviorally equivalent existing implementation (`nature: "introduced"` even when the existing copy is old โ€” adding the duplicate is new).
+- Diff invents a new implementation route for a category the repo already handles with an established idiom or cross-layer pattern โ€” `existing_implementations` points at the precedent (and cite the category pattern skill when one exists).
+- A fix whose layer contradicts the problem's ownership (variant quirk in shared code, or class-wide bug fixed for one variant only) โ€” name the layer that owns the problem and, for shared-layer edits, the existing seam that was bypassed.
+- Diff extends a duplication-prone pattern (adds a third hand-maintained copy of a catalog).
+
+## Not violations
+
+- Pre-existing duplication among old files this diff does not touch or extend.
+- Repo-wide extensibility musings unrelated to this PR ("the project should have a generic useInterval") โ€” out of scope.
+- Deliberate duplication with a stated reason (comment or PR description explains why sharing is wrong here).
+- Deviating from a precedent that is itself legacy โ€” when a pattern skill or migration guide marks the newer way, following the skill against old code is correct, not a violation.
+- A shared-layer fix for a bug reported against one variant, when the root cause genuinely lives in the shared code (the reporter just happened to be the first variant to hit it) โ€” verify ownership before flagging placement.
diff --git a/.agents/skills/deep-review/references/dimensions/security.md b/.agents/skills/deep-review/references/dimensions/security.md
new file mode 100644
index 00000000000..322f19e4024
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/security.md
@@ -0,0 +1,43 @@
+---
+id_prefix: sec
+verify: true
+skip_when: lockfile/generated-only diff (docs, i18n copy, comments are leak vectors โ€” never skip for text changes)
+calibration_exempt: true
+---
+
+# Security
+
+Injection, authorization, and leakage. **This dimension is exempt from the codebase-calibration principle**: a vulnerability is a finding even if the same weakness exists elsewhere in the repo, and severity is never downgraded for precedent.
+
+## Quick checklist
+
+- Injection: user input reaching SQL (raw `sql` fragments), shell commands, `dangerouslySetInnerHTML`, path construction
+- Authorization: new TRPC procedures / API routes missing the auth middleware their siblings use; queries missing user-scoping (`userId` filter) that sibling queries apply
+- Sensitive data in logs: API keys, tokens, credentials, full request bodies in `console.*` / `debug()` output
+- No base64 blobs printed to terminal output (freezes output, may embed secrets)
+- Hardcoded secrets โ€” must come from environment variables
+- New env vars holding secrets must not be exposed client-side (`NEXT_PUBLIC_*` review)
+- SSRF: user-controlled URLs fetched server-side without allowlisting
+- **Business-slot confidentiality**: `src/business/` and `packages/business/` must not expose commercial logic, pricing, or private infrastructure details in code or comments โ€” slots export only minimal generic contracts and safe defaults
+
+## Rule sources (deep mode: read before reviewing)
+
+- Repo root `AGENTS.md` โ€” security guide section (business slots, secret files)
+- Sibling implementations of whatever the diff adds (the auth pattern of neighboring procedures is the yardstick for "missing auth")
+
+## How to check
+
+1. Trace every new external input (request params, user content, webhook payloads, env) to its sinks; look for an unescaped/unvalidated hop.
+2. For each new procedure/route: open two sibling procedures in the same router and compare middleware and user-scoping.
+3. `rg` the diff for `console.`, `debug(`, `NEXT_PUBLIC_`, `dangerouslySetInnerHTML`, raw `sql` template usage.
+4. For business-slot files: read the diff as an outside contributor would โ€” does any name, comment, or constant reveal private commercial behavior?
+
+## Violations
+
+- Any quick-checklist hit reachable by an attacker or visible in the open-source repo.
+- Auth/scoping weaker than the established sibling pattern.
+
+## Not violations
+
+- Inputs fully constrained upstream (e.g. an enum validated at the boundary) โ€” verify the constraint before dismissing, and cite it.
+- Secrets in local-only, gitignored files referenced by name (that is their job) โ€” but confirm the file is actually gitignored.
diff --git a/.agents/skills/deep-review/references/dimensions/skill-freshness.md b/.agents/skills/deep-review/references/dimensions/skill-freshness.md
new file mode 100644
index 00000000000..c1a1acaed03
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/skill-freshness.md
@@ -0,0 +1,32 @@
+---
+id_prefix: skill
+verify: false
+skip_when: never in deep mode (cheap)
+---
+
+# Skill Freshness
+
+Agent skills are load-bearing documentation: agents follow them literally. A diff that changes behavior a skill describes silently poisons every future agent session. This dimension keeps the skill library in sync with reality and spots knowledge worth capturing. Findings are advisories โ€” they skip the verify pass.
+
+## Quick checklist
+
+- Does this diff invalidate any skill? Renamed/moved files, changed commands, altered workflows, removed exports that a skill references by path or name
+- Does this diff invalidate any statement in `AGENTS.md` / `CLAUDE.md` / `README` setup docs?
+- Is this diff the kind of foundational work later tasks will build on (new subsystem, new convention, new tool) with no skill capturing it?
+- Did this change fix a mistake class that keeps recurring? Root-cause knowledge belongs in a skill (or an update to the relevant dimension file of this review skill)
+
+## How to check
+
+1. Extract the diff's "renames and removals": file paths, exported names, npm scripts, CLI commands, env vars.
+2. `rg` each old name across `.agents/skills/` and root-level agent docs (`AGENTS.md`, `CLAUDE.md`) โ€” a hit on a removed/renamed thing is a stale-skill finding.
+3. For new subsystems: check whether any existing skill's scope covers it; if none does and the subsystem has non-obvious workflow (setup steps, conventions, gotchas), propose a skill with a one-line scope.
+
+## Violations (advisories)
+
+- A skill or agent doc that now states something false, with the exact file and line quoted.
+- A clearly skill-worthy gap: repeated-mistake class or foundational feature with no home. Propose the skill name and 2-3 bullet contents โ€” concrete enough to act on, not "consider documenting this".
+
+## Not violations
+
+- Skills that are merely terse or could be "improved" without being wrong โ€” freshness, not quality review.
+- Speculative skills for one-off work unlikely to recur.
diff --git a/.agents/skills/deep-review/references/dimensions/ux.md b/.agents/skills/deep-review/references/dimensions/ux.md
new file mode 100644
index 00000000000..b28086f3701
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/ux.md
@@ -0,0 +1,43 @@
+---
+id_prefix: ux
+verify: true
+skip_when: no user-facing surface changed (components, styles, copy, interaction flows)
+---
+
+# UX
+
+Design-level review of user-facing flows, judged against this product's design values โ€” Natural / Meaningful / Certainty / Growth (่‡ช็„ถ / ๆ„ไน‰ๆ„Ÿ / ็กฎๅฎšๆ€ง / ๆˆ้•ฟ) โ€” not generic taste.
+
+## Quick checklist
+
+- Empty state: first-run and zero-data views designed, not a blank area
+- Loading state: async surfaces show skeleton/spinner/optimistic feedback โ€” no dead frames
+- Error state: failures tell the user what happened and what to do next; no silent swallow, no raw error codes
+- Async feedback: mutations confirm success/failure (toast, inline state); long operations show progress
+- Destructive/irreversible actions gated by confirmation that names the consequence
+- Button hierarchy: one primary action per surface; destructive actions not styled as primary
+- Lists at scale: 1000-item behavior considered (virtualization, pagination, search)
+- Copy: user-facing text is clear, i18n'd, and consistent with existing terminology
+- Interaction details: focus management, keyboard path (Enter/Escape), disabled-with-reason over silently inert
+
+## Rule sources (deep mode: read before reviewing)
+
+- `DESIGN.md` (repo root) โ€” the four design values; judge flows against them explicitly
+- `.agents/skills/ux/SKILL.md` โ€” product design principles and per-pattern checklists
+
+## How to check
+
+1. Identify every user-visible state the diff introduces or alters; enumerate empty/loading/error/success for each.
+2. Walk the flow as a first-time user: what do they see before data arrives, on failure, after success?
+3. Compare copy and interaction patterns with the closest existing feature โ€” divergence needs a reason.
+
+## Violations
+
+- A reachable user state with no designed presentation (blank, stuck, unexplained failure).
+- A flow contradicting a design value or an established interaction pattern in the app (cite the sibling feature).
+
+## Not violations
+
+- Visual choices within the established design system used consistently (taste disagreements are not findings).
+- Missing delight/polish on flows equivalent to the codebase's current bar (calibration principle) โ€” polish suggestions are P2 advisories at most.
+- States unreachable by real interaction (verify reachability before reporting).
diff --git a/.agents/skills/deep-review/references/dimensions/workflow.md b/.agents/skills/deep-review/references/dimensions/workflow.md
new file mode 100644
index 00000000000..17f56facafc
--- /dev/null
+++ b/.agents/skills/deep-review/references/dimensions/workflow.md
@@ -0,0 +1,40 @@
+---
+id_prefix: flow
+verify: false
+skip_when: never in deep mode (cheap external-state checks)
+---
+
+# Workflow
+
+Is the process around this change healthy? These are objective state checks โ€” findings report facts (a failing check, a stale description), so they skip the verify pass and go straight to the report.
+
+## Quick checklist
+
+- Tracked issue exists for non-trivial work (Linear for team members โ€” see `.agents/skills/linear/`; GitHub issue otherwise) and its status matches reality
+- PR description still matches the diff โ€” scope drift after review rounds leaves descriptions describing code that no longer exists
+- Key decisions made during implementation (trade-offs, rejected alternatives, scope cuts) recorded in the issue/PR, not only in a chat transcript
+- Decision records still match the implementation: when the implementation legitimately diverged from a decision written earlier in the issue/PR/conversation, the record is updated in the same PR โ€” a stale decision record misleads every later reader, and reviewers without the session context can only trust what is written
+- CI green; preview/deployment build succeeded โ€” a red or pending-forever check is a finding with the failing job named
+- PR targets the right branch (this repo: feature PRs โ†’ `canary`; DB schema changes ride a separate branch PR'd to `main` first)
+- Commit messages follow repo convention (gitmoji prefix)
+- Locale files: new keys shipped with en-US + zh-CN per the i18n workflow; other locales left to the auto-i18n CI
+
+## Rule sources
+
+- `.agents/skills/linear/SKILL.md`, `.agents/skills/pr/SKILL.md` โ€” expected issue/PR lifecycle
+- Repo `AGENTS.md` โ€” branch strategy, commit conventions
+
+## How to check
+
+1. `gh pr view <num> --json title,body,baseRefName,statusCheckRollup,isDraft` โ€” compare body against the actual diff; read check rollup.
+2. Search the PR body/commits for an issue reference; if the environment has the issue tracker connected, fetch the issue and compare status.
+3. `git log <base>..HEAD --oneline` โ€” scan message format.
+
+## Violations
+
+- Any quick-checklist item observably false, with the evidence (failing job name, missing reference, drifted paragraph) quoted.
+
+## Not violations
+
+- Process steps that explicitly don't apply (trivial one-line fixes may not need an issue; drafts may have pending CI).
+- Missing ceremony this repo does not practice โ€” check the repo's own conventions, not an imagined ideal process.
diff --git a/.agents/skills/deep-review/references/report-template.md b/.agents/skills/deep-review/references/report-template.md
new file mode 100644
index 00000000000..4448b5e33b1
--- /dev/null
+++ b/.agents/skills/deep-review/references/report-template.md
@@ -0,0 +1,141 @@
+# Final Report Template
+
+This file is deep mode's **output contract** and overrides any environment-default review format. Render the full report; never compress the result into a plain findings list. Write the report in the conversation's language โ€” the structure below is the contract, the wording translates.
+
+Only `verdict: confirmed` findings are rendered (plus unverified dimensions โ€” see below). Order: severity p0 โ†’ p1 โ†’ p2; within a severity bucket, group by dimension in table order from `SKILL.md`; within a dimension keep reviewer order.
+
+## Rendering rules
+
+- **Structure is mandatory**: title, header metadata, TL;DR, Findings, Statistics always render โ€” even with zero confirmed findings (then Findings states "no confirmed findings" and Statistics still shows the counts).
+- **Nature line**: `nature: "introduced"` โ†’ omit the line (default). `nature: "exposed_legacy"` โ†’ render `**Nature**: legacy surfaced by this change`.
+- **Issue type** renders the finding's `issue_type` verbatim โ€” never the dimension name.
+- **Blocks release** renders verify's `blocks_release` (`yes`/`no`) on every confirmed finding โ€” this is the user's ship/no-ship signal; never omit. Same-root merged entries take the value belonging to the highest merged severity.
+- **Existing implementations** line only for `reuse-architecture` dedup findings, listing all entries.
+- **Rule source** line renders the finding's `rule_source` when present.
+- Apply `fix_options_override` / `nature_override` before rendering.
+- **Same-root merge**: findings with `same_root_as: X` fold into X's entry โ€” no separate number; add `**Same root**: id (location, issue_type), ...` at the entry's end; entry severity upgrades to the highest among merged; statistics count merged entries once.
+- **P2 cap (noise control)**: if confirmed P2 count > 6, render the top 6 fully and collapse the rest into one line each under `More P2`: `**#n** [issue_type] summary (file:line)`.
+- Empty severity buckets omit their heading entirely.
+- **Unverified dimensions**: `workflow` findings render under `Process`, `skill-freshness` under `Skill updates` โ€” outside the severity buckets, excluded from P0/P1/P2 statistics. These findings use the same JSON schema as everything else; render one line each mapped from those fields: fact = `summary`, evidence = `location` (plus `scenario` when present), suggested action = the first `fix_options` entry. Their `severity` is advisory and never rendered.
+- **Missing sources**: if any reviewer returned `missing_sources`, append a note recommending the listed rule files be fixed/restored.
+- **Workflow feedback**: merge equivalent suggestions across subagents, accumulate sources (`sources: code-style, verify`), render at the end; omit the section when empty.
+- **PR mode** (the user's message contains a GitHub PR URL): render `Merge verdict` between TL;DR and Findings. Otherwise omit the section entirely. Bare `#123` / `pr 123` do NOT trigger PR mode.
+
+### Merge verdict decision table (PR mode; main agent fills, never delegated)
+
+First match wins:
+
+| Condition | Verdict |
+| --------------------------------- | ---------------- |
+| `isDraft: true` | do not merge yet |
+| `mergeable: "CONFLICTING"` | do not merge yet |
+| any check `conclusion: "FAILURE"` | do not merge yet |
+| P0 confirmed > 0 | fix before merge |
+| P1 confirmed > 0 | fix before merge |
+| otherwise (P2 only / clean) | good to merge |
+
+Severity only โ€” nature does not matter (a confirmed exposed-legacy P0 still blocks). Fallbacks: `mergeable: "UNKNOWN"` โ†’ treat as mergeable; all checks in progress/queued โ†’ CI pending, not blocking; no checks configured โ†’ CI pass. "fix before merge" lists all P0/P1 numbers + one-line summaries as prerequisites; "good to merge" lists P2s as follow-ups.
+
+## Pre-send self-check
+
+Before sending, confirm every item; fix and re-render if any is missing:
+
+- Title + header metadata (scope / background / execution mode with pruned dimensions)
+- TL;DR present; Findings present (or explicit "no confirmed findings"); Statistics present
+- Every confirmed finding has: issue type, location, blocks release, core problem, evidence, fix cost, fix options, needs test
+- Merge verdict only in PR mode
+
+---
+
+```markdown
+# Deep Review Report
+
+**Scope**: {e.g. `feat/user-batch-delete` vs local `main`, 8 files +240/-37, incl. submodule lobehub}
+**Background**: {1-2 sentence core of the step-0 scope summary}
+**Execution**: {N} dimension reviewers ({list}) + {M} verifiers; pruned: {dimension โ€” one-line reason, or "none"}
+
+## TL;DR
+
+{1-2 sentences: X confirmed (P0 a / P1 b / P2 c, K legacy-surfaced), the single biggest risk, one suggested next action.}
+
+> Only findings related to this change are kept. Findings marked "legacy surfaced by this change" live in old code that this diff triggers or depends on; everything else is newly introduced.
+
+๐Ÿ“ฃ {N} workflow feedback item(s) at the end of this report โ† only when workflow_feedback is non-empty
+
+## Merge verdict โ† PR mode only
+
+**Verdict**: {good to merge | fix before merge | do not merge yet}
+**Basis**: P0 {x} / P1 {y} / P2 {z} confirmed | CI {pass|fail|pending} | draft {yes|no} | mergeable {ok|conflicting}
+**Prerequisites**: #{n} {summary} โ† "fix before merge" only
+**Follow-ups**: #{n} {summary} โ† "good to merge" with P2s only
+
+---
+
+## ๐Ÿ“Œ Findings
+
+### ๐Ÿ”ด P0 ({n})
+
+#### 1. {summary}
+
+- **Issue type**: {issue_type}
+- **Location**: `src/api/user.ts:87`
+- **Blocks release**: yes
+- **Nature**: legacy surfaced by this change โ† exposed_legacy only
+- **Existing implementations**: `src/foo.ts:62-138`, ... โ† reuse dedup only
+- **Rule source**: {rule_source} โ† when present
+- **Core problem**: {core_problem}
+- **Scenario**: {scenario}
+- **Evidence**: {verify evidence}
+- **Fix cost**: low
+- **Fix options**:
+ - Option A: ...
+ - Option B: ...
+- **Needs test**: yes
+- **Same root**: {id} ({location}, {issue_type}) โ† merged entries only
+
+### ๐ŸŸก P1 ({n})
+
+...
+
+### ๐ŸŸข P2 ({n})
+
+...
+
+**More P2** โ† only when P2 > 6
+
+- **#{n}** [{issue_type}] {summary} ({file:line})
+
+---
+
+## ๐Ÿ” Process โ† workflow dimension findings, omit when empty
+
+- {summary} โ€” {location}{; scenario when present}; suggested: {fix_options[0]}
+
+## ๐Ÿ“š Skill updates โ† skill-freshness findings, omit when empty
+
+- {location: stale skill file:line or proposed skill} โ€” {summary}; suggested: {fix_options[0]}
+
+## Statistics
+
+- Confirmed: {n} ({k} legacy-surfaced) | False positives: {fp} (incl. {os} over-scrutiny) | Need more context: {nc}
+- Must-fix this round: {p0+p1} | Blocks release: {n}
+- By dimension: {dimension: count, ...}
+
+## ๐Ÿš€ Safe to fix now ({n}) โ† omit when empty
+
+> Single obvious fix, low risk, no product decisions. Can be applied in one batch.
+
+- **#{n}** `[{issue_type}]` {summary} (`file:line`)
+
+## Needs your input โ† need_more_context only, omit when empty
+
+- [ ] {summary} โ€” missing: {missing}
+
+## ๐Ÿ“ฃ Workflow feedback ({n}) โ† omit when empty
+
+> Observations from this run's subagents about the review workflow itself. Not action items โ€” use them to decide whether to update the skill files.
+
+- **Suggestion**: {suggestion}
+ **Why**: {why}
+ **Sources**: {code-style, verify}
+```
diff --git a/.agents/skills/deep-review/references/review-prompt.md b/.agents/skills/deep-review/references/review-prompt.md
new file mode 100644
index 00000000000..174770beea7
--- /dev/null
+++ b/.agents/skills/deep-review/references/review-prompt.md
@@ -0,0 +1,128 @@
+# Review Subagent Prompt Template
+
+One template for all review subagents in both environments. The `{dimensions}` placeholder makes it work for a single dimension (Claude Code spawns one subagent per dimension) or a composite group (Codex packs several dimensions into one subagent).
+
+How to instantiate:
+
+1. `{dimensions}` โ†’ the assigned dimension id(s), e.g. `code-style` or `performance, security, compatibility`
+2. `{dimension_files}` โ†’ the file paths of the assigned dimension rule files, **including extension-pack counterparts when present** (e.g. `.agents/skills/deep-review/references/dimensions/security.md` + `.agents/skills/deep-review-cloud/dimensions/security.md`)
+3. `{scope_summary}` โ†’ the โ‰ค 200-word scope summary from step 0
+4. `{changes}` โ†’ the full diff text for small diffs (wrap in a ` ```diff ` fence), or the command(s) to fetch it for large diffs
+5. Pass the substituted text as the subagent's entire prompt. Subagents share no context with the main agent โ€” the prompt must be self-contained.
+
+---
+
+`````text
+You are an independent third-party code reviewer. Review the following git changes strictly within your assigned dimension(s): {dimensions}. Other dimensions are covered by other reviewers โ€” do not report findings outside your assignment, even if you notice them.
+
+## Scope summary
+{scope_summary}
+
+## Changes
+The block below is either full diff text or the command(s) to fetch it. Check the head:
+- Starts with ```diff / `diff --git` โ†’ it is the diff, use it directly
+- Shell command(s) (`git diff ...` / `gh pr diff ...` / `git -C <submodule> diff ...`) โ†’ run them all yourself and combine the outputs
+
+After you have the diff, read whatever surrounding files you need for context.
+
+{changes}
+
+## Mandatory preparation
+
+Read every rule file listed below IN FULL, then read the rule sources each file lists (skills, docs). These files define how to check, what counts as a violation, and โ€” equally important โ€” what does NOT count:
+
+{dimension_files}
+
+Priority: repo-specific rules in those files > general experience. Use general experience only for angles the files don't cover.
+
+## Calibration (hard rule)
+
+Hold the diff to the standard this codebase already meets, not an idealized one. Before reporting a style/design-level finding, ask: is this pattern already widespread in the existing code, and does this diff make it worse? Widespread + not-worse โ†’ do not report. Dimension files may declare themselves exempt (`calibration_exempt: true`, e.g. security) โ€” for those, report regardless of precedent.
+
+Calibrate to lifespan as well: when the scope summary, PR/issue, or code comments declare the code short-lived (a time-boxed campaign, an experiment, a one-off script), judge it against its lifespan, not permanent-code standards. Hardcoded dates/copy/thresholds and low-extensibility designs are the intended trade-off for shipping fast โ€” do not demand configurability, extension points, or expiry automation; "delete the code and redeploy when it expires" is a legitimate expiry mechanism. Two things stay reportable in temporary code: `calibration_exempt` dimensions (security), and damage that outlives the window (wrong billing/credit/data writes that persist after the code is removed).
+
+Focus over completeness: findings must serve THIS change and its requirement. Do not audit unrelated legacy code, and do not propose rewrites beyond the change's scope.
+
+## Review scope (hard rules)
+
+- Finding locations must land on `+` lines of the diff by default.
+- Legacy code gets two treatments (the `nature` field marks which):
+ - **Old problems you merely stumbled on** (unrelated to this change) โ†’ do not investigate, do not return; report only if it is an obvious p0-level production bug, marked `nature: "exposed_legacy"` with the scenario noting it is a bystander find.
+ - **Legacy problems this diff triggers, exposes, or depends on** โ†’ report normally, location pointing at the implicated old code, `nature: "exposed_legacy"`, scenario explaining how this change surfaces it.
+ - Everything else (locations on `+` lines) โ†’ `nature: "introduced"`.
+
+## Effort budget
+
+Evidence gathering is bounded โ€” you are a finder, not the final judge:
+
+- Once a finding has concrete `file:line` evidence, stop expanding; do not keep browsing to make it stronger.
+- Deep falsification belongs to the independent verify pass, not to you: when settling a suspicion would take more than a handful of targeted file reads, report it with your best evidence instead of running a multi-file proof campaign.
+- Read rule sources selectively โ€” the sections relevant to the touched surfaces โ€” not cover to cover.
+
+## Return format (strict JSON)
+
+Output exactly ONE JSON object inside a ```` ```json ```` fence (the main agent extracts and `JSON.parse`s it). Valid JSON only: escape quotes/backslashes, no comments, no trailing commas, no single quotes.
+
+{
+ "missing_sources": ["path"], // only when a listed rule source could not be read; omit otherwise
+ "issues": [
+ {
+ "id": "logic-1", // required; dimension id_prefix + ordinal (prefix defined in the dimension file)
+ "dimension": "logic", // required; one of your assigned dimension ids
+ "issue_type": "edge case", // required; a precise short phrase (2-5 words), NOT the dimension name โ€” e.g. "missing auth scope", "N+1 query", "stale comment"
+ "nature": "introduced", // required; introduced | exposed_legacy
+ "severity": "p1", // required; p0 | p1 | p2 (definitions below)
+ "location": "src/api/user.ts:87", // required; exact file:line
+ "summary": "1-2 technical sentences for a reviewer who reads code", // required
+ "core_problem": "โ‰ค 2 plain-language sentences: impact + cause, understandable without reading code", // required
+ "scenario": "concrete trigger scenario", // optional; required when nature=exposed_legacy
+ "existing_implementations": ["src/foo.ts:62-138"], // required (โ‰ฅ 1 entry) only for dimension=reuse-architecture dedup findings; omit otherwise
+ "rule_source": "dimensions/code-style.md โ†’ antd import rule", // required for style/convention findings: which rule this violates; omit for logic bugs proven by evidence
+ "fix_cost": "low", // required; low | medium | high
+ "fix_options": ["option A", "option B"], // required; โ‰ฅ 1
+ "need_test": true // required; does the fix need an accompanying test
+ }
+ ],
+ "workflow_feedback": [ // optional; omit entirely when empty
+ { "suggestion": "concrete, actionable improvement to a named skill file/section", "why": "what happened this run" }
+ ]
+}
+
+### severity definitions
+- p0: likely production incident (data corruption / financial loss / auth bypass / outage) or directly violates the stated requirement and acceptance criteria
+- p1: a real bug that should be fixed in this change
+- p2: real but deferrable; bookkeeping level
+
+### core_problem style
+One breath: "Because ใ€ˆwhat the code/design lacksใ€‰, when ใ€ˆuser or caller does Xใ€‰, ใ€ˆconsequenceใ€‰." Split into two sentences (impact + cause) only when gluing them reads unnaturally. Plain over precise; keep API names and error strings in `summary`.
+
+### issue_type style
+Precise beats broad ("rename missed import" not "code style"). Short beats long (verb-object or compound noun). One primary type per finding, never slash-separated lists.
+
+## When you find nothing
+Return `{"issues": []}`. No silence, no pleasantries.
+
+## Example finding (format alignment)
+
+{
+ "issues": [
+ {
+ "id": "logic-1",
+ "dimension": "logic",
+ "issue_type": "edge case",
+ "nature": "introduced",
+ "severity": "p1",
+ "location": "src/api/user.ts:87",
+ "summary": "Batch delete endpoint doesn't validate userIds length; an empty array builds `DELETE FROM users WHERE id IN ()` which is a SQL syntax error.",
+ "core_problem": "Because input validation misses the empty-array branch, a UI that submits an empty selection gets a 500 and looks like a server outage.",
+ "scenario": "Front end submits an empty selection list; endpoint 500s instead of returning a friendly no-op.",
+ "fix_cost": "low",
+ "fix_options": [
+ "Add z.array(z.string()).min(1) at the input layer",
+ "Early-return in the service for empty arrays"
+ ],
+ "need_test": true
+ }
+ ]
+}
+`````
diff --git a/.agents/skills/deep-review/references/scoping.md b/.agents/skills/deep-review/references/scoping.md
new file mode 100644
index 00000000000..13f51ff3f41
--- /dev/null
+++ b/.agents/skills/deep-review/references/scoping.md
@@ -0,0 +1,63 @@
+# Step 0 โ€” Scope & Background (shared by all environments)
+
+Determine what to review, produce the scope summary, and decide whether to inline the diff or pass fetch commands. Light mode uses the same scope rules (steps 1โ€“4), skipping the background hunt when conversation context already explains the change.
+
+## 1. Probe size with stat-level commands first
+
+- PR: `gh pr view <num> --json title,body,files,baseRefName,headRefName`
+- Branch: `git diff <local-default-branch>...HEAD --stat`
+- Uncommitted: `git diff HEAD --stat` + `git status --short`
+
+### Range hard rules (do not review other people's commits)
+
+`<local-default-branch>` is always the **local** ref (`main` / `canary` / ...), never `origin/<default>`. When local default lags the remote, `origin/main..HEAD` injects other people's freshly merged commits into the diff as reverse changes. Local ref + **three-dot** diff (`<local-default>...HEAD`) diffs from the merge-base, yielding exactly what this branch introduced.
+
+No local default ref (detached HEAD, fresh clone)? `git fetch && git switch <default> && git switch -` to materialize one, or ask the user which base to use. Never fall back to `origin/<default>`.
+
+## 2. Pick the full-diff command by review target
+
+1. **User named a PR by URL** โ†’ `gh pr diff <num>`. Also fetch `gh pr view <num> --json mergeable,isDraft,reviewDecision,statusCheckRollup` and append those fields to the scope summary (feeds the merge-verdict table). URL only โ€” bare `#123` does not trigger PR mode.
+2. **User named a specific commit or range** (a SHA, `abc123..def456`) โ†’ review exactly that object: `git show <sha> --stat` then `git show <sha>` for a single commit, `git diff <a>..<b>` for a range. The named object IS the scope โ€” ignore branch/worktree state and do not fall through to the rules below.
+3. **Non-default branch AND uncommitted changes both exist** โ†’ ask the user which to review: uncommitted only (`git diff HEAD` + untracked files read separately), committed branch work (`git diff <local-default>...HEAD`), or both (`git diff $(git merge-base <local-default> HEAD)` โ€” worktree against the merge-base; the plain one-commit form `git diff <local-default>` would re-import default-branch advances as reverse diffs). Gitlink-only entries (`M <submodule>` where `git status` shows `(new commits)` and nothing else changed) do NOT count as uncommitted changes โ€” a superproject tracking an in-flight submodule branch shows this permanently; route them through ยง4 instead of triggering this question.
+4. **Uncommitted changes on the default branch** โ†’ `git diff HEAD`; list untracked via `git ls-files --others --exclude-standard` (ยง3 defines how their contents join `{changes}` โ€” `git diff HEAD` alone misses them entirely).
+5. **Clean tree on a non-default branch** โ†’ `git diff <local-default>...HEAD`
+6. None of the above โ†’ ask; don't guess.
+
+## 3. Exclude bulk files before judging size
+
+Filter lockfiles (`pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, `bun.lockb`, ...), snapshots (`*.snap`), generated files (`*.generated.*`, `*.gen.ts`), and build output (`dist/`, `build/`, `.next/`) from both stat and full-diff commands:
+
+```bash
+git diff main...HEAD --stat -- . \
+ ':(exclude)pnpm-lock.yaml' ':(exclude)*.snap' ':(exclude)dist/**'
+```
+
+Then judge with filtered numbers, checking in this order (very large first, so a few-files-but-huge diff never counts as small):
+
+- **Very large diff** (> 1500 lines) โ†’ split into multiple review scopes by directory and run the flow in batches.
+- **Small diff** (โ‰ค 200 lines AND โ‰ค 5 files) โ†’ run the full-diff command now; the diff text becomes `{changes}`.
+- **Large diff** (everything else) โ†’ do not fetch; the command itself (with excludes) becomes `{changes}`, subagents run it themselves.
+
+Untracked files in an uncommitted scope are part of the review, not just a name list: count their line counts toward the size judgment; on the small-diff path append each untracked file's full content to `{changes}` (one fenced block per file, path as header); on the large-diff path list their paths next to the fetch commands so subagents read them.
+
+Excluded files are out of scope; reviewing a lockfile on request is a separate task, not this flow.
+
+## 4. Submodules
+
+One change often spans the main repo and submodules โ€” review them together by default.
+
+1. Detect from the same command ยง2 selected โ€” append `--submodule=log` to it (`git diff <local-default>...HEAD --submodule=log`, `git show <sha> --submodule=log`, `git diff <a>..<b> --submodule=log`, ...). `git status` showing `modified: <path> (new commits)` is an extra signal only when the scope includes the worktree (ยง2 rules 3โ€“4); for a named commit/range the gitlink pair comes from that object, never from current branch/worktree state.
+2. Changed submodules join the review: the old/new gitlink pair from that output yields the submodule diff command (`git -C <path> diff <old>..<new>`), which merges into `{changes}` alongside the main-repo command; sizes add up for the small/large judgment.
+3. Prefix finding locations with the submodule path (`lobehub/src/x.ts:42`).
+4. Note "main repo + submodule: <names>" in the scope summary. Skip a submodule only when the user explicitly says so.
+
+## 5. Background (stop at the first source that answers)
+
+1. **Conversation context** โ€” deep mode usually runs right after implementation; the requirement is already here.
+2. An issue the user referenced (issue tracker MCP / `gh issue view`).
+3. The branch's PR: `gh pr list --head $(git branch --show-current)` โ†’ `gh pr view <num> --json title,body`.
+4. Fallback: `git log <local-default>..HEAD --oneline` (commit messages are thin; last resort).
+
+## 6. Produce the scope summary
+
+Condense **changed-file list + requirement/acceptance criteria** into โ‰ค 200 words. Every subagent prompt carries it โ€” it is the primary yardstick for "does this change violate the requirement".
diff --git a/.agents/skills/deep-review/references/verify-prompt.md b/.agents/skills/deep-review/references/verify-prompt.md
new file mode 100644
index 00000000000..b4b55f7a4e2
--- /dev/null
+++ b/.agents/skills/deep-review/references/verify-prompt.md
@@ -0,0 +1,102 @@
+# Verify Subagent Prompt Template
+
+Verification is the anti-hallucination backbone: review agents deliberately over-report; the verify agent independently falsifies each candidate. Review and verify must never share an agent โ€” their goals are opposite, and one agent doing both collapses into confirmation bias.
+
+Verification is pipelined per dimension (or per Codex group): as soon as a review subagent returns findings, spawn its verify subagent โ€” do not wait for other reviewers. Dimensions whose file says `verify: false` (workflow, skill-freshness) skip verification entirely.
+
+How to instantiate:
+
+1. `{issues}` โ†’ the JSON array of that reviewer's findings (wrap in a ` ```json ` fence), keeping original ids
+2. `{scope_summary}` โ†’ the same scope summary from step 0
+3. `{changes}` โ†’ the same diff text or fetch command(s) the reviewer received
+
+---
+
+`````text
+Verify the following code-review findings. Do not fix anything โ€” judge only.
+
+## Scope summary
+{scope_summary}
+
+## Changes (needed to judge `+` lines)
+Diff text or fetch command(s) โ€” check the head, run commands yourself if needed:
+
+{changes}
+
+## Findings to verify (process each id independently)
+{issues}
+
+## Verification actions (execute fully for EVERY finding)
+
+1. Open the finding's `location` file and read โ‰ฅ 30 lines of context on each side.
+2. Chase the relevant call chain, type definitions, and existing tests.
+3. Check whether the described scenario actually triggers.
+4. Validate the `nature` field against the actual location: `+` line โ†’ should be `introduced`; context/old line โ†’ should be `exposed_legacy` AND genuinely triggered/exposed/depended on by this diff (if merely a bystander find, keep only obvious p0s, otherwise `false_positive`). Fix mislabels with `nature_override`.
+5. **Over-scrutiny filter** (skip for findings from dimension files marked `calibration_exempt: true`): if the finding holds the diff to a standard the surrounding codebase itself does not meet โ€” the flagged pattern is widespread in equivalent existing code and this diff does not make it worse โ€” verdict `false_positive` with reason starting `over-scrutiny:`. Same verdict for lifespan mismatch: the finding demands configurability, extensibility, or expiry automation from code the scope summary / PR / comments declare temporary (time-boxed campaign, experiment, one-off script) โ€” reason starting `over-scrutiny: lifespan`; the only temporary-code findings that survive are those whose damage persists beyond the window (billing/credit/data writes). This filter exists because reviewers were instructed to over-report; you are the noise gate.
+6. **Extra steps for `dimension: reuse-architecture` dedup findings**: open EVERY file in `existing_implementations` (โ‰ฅ 30 lines context each) and compare behavioral equivalence โ€” same input โ†’ same output/side effects. At least one true equivalent โ†’ `confirmed`; all merely syntactically similar โ†’ `false_positive` naming the semantic difference; unable to tell without missing context โ†’ `need_more_context`.
+
+## Anti-shortcut red lines
+
+- Every finding gets the full procedure; no shared conclusions across findings, even in the same file.
+- No "skim all files once, then batch-label".
+- Verdicts must not infect each other (A false_positive says nothing about B).
+
+Violating any red line invalidates the verification. Slow is acceptable; shortcuts are not.
+
+## Stance: falsify by default
+
+Look for the counterexample first: existing validation, early return, upstream guarantee, framework behavior, type constraint that prevents the scenario. Found one โ†’ `false_positive`. `confirmed` requires evidence you actually read (file:line or snippet), not "sounds plausible". If you are about to confirm an entire batch, stop and ask whether you are rubber-stamping. A `false_positive` is high-value output, not an insult to the reviewer.
+
+Keep it pragmatic: `reason` is one sentence; `evidence` is file:line + the shortest necessary argument (do not restate summary/scenario). Unsure โ†’ `need_more_context`, never a guessed `confirmed`. `fix_options_override` only when clearly better (found a reusable util, original option introduces a new bug, misses a necessary edge).
+
+## can_auto_fix (confirmed only)
+
+The main agent lists `can_auto_fix: true` findings in the "safe to fix now" batch. You judge it โ€” you read the files. ALL four must hold:
+
+1. `fix_cost: low`
+2. Single obvious fix โ€” one option, or several that are equivalent implementation details (no product/architecture trade-off)
+3. No external resource or product decision needed (no third-party setup, env values, threshold choices, fail-open vs fail-closed calls)
+4. Small blast radius โ€” none of: 3+ files changed, architecture-layer changes (service split/merge, router restructure, store slice shape, core hook/context signature), database schema/migration, external contracts (API params, webhook payloads, third-party calls), user-perceivable behavior (UI flows, routes, hotkeys, end-user copy, permission boundaries)
+
+Any miss โ†’ `can_auto_fix: false` with `auto_fix_reason` naming the failed criterion. `reuse-architecture` findings default to `false` (caller migration violates #4); the rare exception (constant swap, single import switch, no signature change) needs its justification in `auto_fix_reason`.
+
+## blocks_release (confirmed only)
+
+Would shipping without this fix be unacceptable? `true`: production incident / data corruption / security hole / auth bypass, or breaks acceptance criteria or a main user path. `false`: real but shippable โ€” rare edges, degraded-but-working flows, internal/bookkeeping, code quality.
+
+Consistency: p0 โ†’ must be `true`; p2 โ†’ must be `false`; p1 โ†’ your call.
+
+## same_root_as (dedup, confirmed only)
+
+Multiple reviewers (or dimensions) often report the same underlying problem from different angles, or a set of findings one fix would resolve together. Process findings in input order; the first occurrence of a root cause returns normally; subsequent same-root findings add `same_root_as: <first id>`. "One fix resolves both" is the test โ€” same location not required. Their `evidence` may be shorthand (`same root as style-1`).
+
+## Return format (strict JSON)
+
+One JSON object in a ```` ```json ```` fence. Valid JSON only.
+
+{
+ "verifications": [
+ {
+ "id": "logic-1", // must match an input id exactly
+ "verdict": "confirmed", // confirmed | false_positive | need_more_context
+ "evidence": "src/api/user.ts:87 โ€” upstream zod schema lacks min(1); empty array reaches SQL", // confirmed only
+ "can_auto_fix": true, // confirmed only
+ "auto_fix_reason": null, // only when can_auto_fix=false: which criterion failed
+ "blocks_release": true, // confirmed only
+ "nature_override": null, // only when the original nature is mislabeled
+ "same_root_as": null, // optional; first-occurrence id of the shared root
+ "fix_options_override": null, // optional; string array, only when clearly better
+ "note": null, // optional caveat/risk remark
+
+ "reason": null, // false_positive only: one sentence why it does not hold
+ "missing": null // need_more_context only: what context is missing
+ }
+ ],
+ "workflow_feedback": [ // optional; omit when empty
+ { "suggestion": "...", "why": "..." }
+ ]
+}
+
+### Completeness (hard constraint)
+`verifications` must contain exactly one entry per input finding, ids matching one-to-one โ€” no omissions, no inventions, no merging. A missing id means the task is incomplete; the main agent will reject the result and re-run verification for missing ids.
+`````
diff --git a/.agents/skills/review-checklist/SKILL.md b/.agents/skills/review-checklist/SKILL.md
deleted file mode 100644
index 9009a660753..00000000000
--- a/.agents/skills/review-checklist/SKILL.md
+++ /dev/null
@@ -1,59 +0,0 @@
----
-name: review-checklist
-description: 'LobeHub code review checklist. Use when reviewing a PR, diff, or branch for console leftovers, return await, secrets, i18n, desktop router drift, UI imports, migrations, or cloud impact.'
-user-invocable: false
----
-
-# Review Checklist
-
-## Correctness
-
-- Leftover `console.log` / `console.debug` โ€” should use `debug` package or remove
-- Missing `return await` in try/catch โ€” see <https://typescript-eslint.io/rules/return-await/> (not in our ESLint config yet, requires type info)
-- Can the fix/implementation be more concise, efficient, or have better compatibility?
-
-## Security
-
-- No sensitive data (API keys, tokens, credentials) in `console.*` or `debug()` output
-- No base64 output to terminal โ€” extremely long, freezes output
-- No hardcoded secrets โ€” use environment variables
-
-## Testing
-
-- Bug fixes must include tests covering the fixed scenario
-- New logic (services, store actions, utilities) should have test coverage
-- **New database Model/Repository** (`packages/database/src/models/**`, `src/repositories/**`) must ship a sibling `__tests__/<name>.test.ts` โ€” incl. user-isolation tests; BM25 search guarded by `describe.skipIf(!isServerDB)` (see `/testing` โ†’ `db-model-test.md`)
-- Existing tests still cover the changed behavior?
-- Prefer `vi.spyOn` over `vi.mock` (see `/testing` skill)
-
-## i18n
-
-- New user-facing strings use i18n keys, not hardcoded text
-- Keys added to `src/locales/default/{namespace}.ts` with `{feature}.{context}.{action|status}` naming
-- For PRs: `locales/` translations for all languages updated (`pnpm i18n`)
-
-## SPA / routing
-
-- **`desktopRouter` pair:** If the diff touches `src/spa/router/desktopRouter.config.tsx`, does it also update `src/spa/router/desktopRouter.config.desktop.tsx` with the same route paths and nesting? Single-file edits often cause drift and blank screens.
-- **Single-source the nav/tab catalog:** A menu/tab list defined in more than one hand-maintained copy drifts. The settings catalog is duplicated across `settings/hooks/useCategory.tsx`, `WorkspaceSetting/hooks/useCategory.tsx`, and `(mobile)/me/settings/features/useCategory.tsx` โ€” the mobile copy has already lost Devices / Messenger / Notification. Adding/removing a tab must touch every copy (or, better, derive them from one source). Flag new parallel catalogs.
-
-## Reuse
-
-- Newly written code duplicates existing utilities in `packages/utils` or shared modules?
-- Copy-pasted blocks with slight variation โ€” extract into shared function
-- `antd` imports replaceable with `@lobehub/ui` wrapped components (`Input`, `Button`, `Modal`, `Avatar`, etc.)
-- Use `antd-style` token system, not hardcoded colors; prefer `createStaticStyles` + `cssVar.*` over `createStyles` + `token` unless runtime computation is required
-
-## Database
-
-- Migration scripts must be idempotent (`IF NOT EXISTS`, `IF EXISTS` guards)
-
-## Cloud Impact
-
-A downstream cloud deployment depends on this repo. Flag changes that may require cloud-side updates:
-
-- **Backend route paths changed** โ€” e.g., renaming `src/app/(backend)/webapi/chat/route.ts` or changing its exports
-- **SSR page paths changed** โ€” e.g., moving/renaming files under `src/app/[variants]/(auth)/`
-- **Dependency versions bumped** โ€” e.g., upgrading `next` or `drizzle-orm` in `package.json`
-- **`@lobechat/business-*` exports changed** โ€” e.g., renaming a function in `src/business/` or changing type signatures in `packages/business/`
-- `src/business/` and `packages/business/` must not expose cloud commercial logic in comments or code
diff --git a/.agents/skills/ux-audit/SKILL.md b/.agents/skills/ux-audit/SKILL.md
index c58b05cdbb9..b9025fca09d 100644
--- a/.agents/skills/ux-audit/SKILL.md
+++ b/.agents/skills/ux-audit/SKILL.md
@@ -262,6 +262,6 @@ An audit is not finished when the findings are written โ€” it is finished when t
generalizable findings get landed.
- **agent-testing** โ€” the automation framework L3 drives (agent-browser CDP: snapshot / eval
/ screenshot / GIF). L3 assumes its Step 0 env + auth are green.
-- **review-checklist** โ€” code-level review; this skill is its design-level sibling.
+- **deep-review** โ€” code-level review; this skill is its design-level sibling (deep-review's `ux` dimension checks flows inside a code review; this skill audits a whole surface).
- **skills-audit** โ€” the same "periodic, evidence-based audit" shape, applied to the skill
catalog.
diff --git a/.agents/skills/ux-audit/references/example/settings.md b/.agents/skills/ux-audit/references/example/settings.md
index 6a779c7bf6f..a25a03968a7 100644
--- a/.agents/skills/ux-audit/references/example/settings.md
+++ b/.agents/skills/ux-audit/references/example/settings.md
@@ -146,7 +146,7 @@ moved into Profile (PasswordRow / SSO / Email). Dead surface to prune.
L1 procedure** (`layer-1-static.md` step 3) to ask this cross-surface check on every surface
โ€” this gap was under-framed as "dead copy" in the first pass because L1 is structurally
blind to an entry point that was never built (no `file:line`).
- - review-checklist **"Single-source the nav/tab catalog"** (gap โ‘ฆ).
+ - deep-review `reuse-architecture` dimension **"single-source the nav/tab catalog"** (gap โ‘ฆ).
- **Noted, not yet landed:** breadcrumb that doesn't deepen per tab (โ‘ง-adjacent) โ€” promote
if a second surface repeats it.
diff --git a/AGENTS.md b/AGENTS.md
index c59ee023c27..34a76fad6fc 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -135,7 +135,7 @@ bun run type-check
### Code Review
-Before reviewing a PR / diff / branch change, read the **review-checklist** skill (`.agents/skills/review-checklist/SKILL.md`) โ€” it lists the recurring mistakes specific to this codebase.
+Before reviewing a PR / diff / branch change, read the **deep-review** skill (`.agents/skills/deep-review/SKILL.md`). Ordinary review requests use its light mode (inline review 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 (่‡ช็„ถ / ๆ„ไน‰ๆ„Ÿ / ็กฎๅฎšๆ€ง / ๆˆ้•ฟ).