Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

docs: four-language documentation overhaul with verified facts and product screenshots (MUL-5057) (#5714)

Naiyuan Qinge395fb8744e0
diff --git a/apps/docs/app/[lang]/[...slug]/page.tsx b/apps/docs/app/[lang]/[...slug]/page.tsx
index 0a3cb37d0b..ea09a66326 100644
--- a/apps/docs/app/[lang]/[...slug]/page.tsx
+++ b/apps/docs/app/[lang]/[...slug]/page.tsx
@@ -7,6 +7,7 @@ import {
} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import defaultMdxComponents from "fumadocs-ui/mdx";
+import { ImageZoom } from "fumadocs-ui/components/image-zoom";
import type { Metadata } from "next";
import { docsAlternates } from "@/lib/site";
import { i18n, type Lang } from "@/lib/i18n";
@@ -33,11 +34,18 @@ export default async function Page(props: {
return (
<DocsPage toc={page.data.toc}>
<DocsTitle>{page.data.title}</DocsTitle>
- <DocsDescription>{page.data.description}</DocsDescription>
+ <DocsDescription className="mb-0">{page.data.description}</DocsDescription>
<DocsBody>
<DocsLocaleProvider lang={lang}>
<MDX
- components={{ ...defaultMdxComponents, a: LocaleLink, VideoEmbed }}
+ components={{
+ ...defaultMdxComponents,
+ // Every markdown image gets the standard Fumadocs lightbox:
+ // click to zoom to viewport, scroll/Esc/click to dismiss.
+ img: (props) => <ImageZoom {...props} />,
+ a: LocaleLink,
+ VideoEmbed,
+ }}
/>
</DocsLocaleProvider>
</DocsBody>
diff --git a/apps/docs/app/[lang]/page.tsx b/apps/docs/app/[lang]/page.tsx
index b361efde7c..99b1af02a0 100644
--- a/apps/docs/app/[lang]/page.tsx
+++ b/apps/docs/app/[lang]/page.tsx
@@ -2,10 +2,12 @@ import { source } from "@/lib/source";
import { DocsPage, DocsBody } from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import defaultMdxComponents from "fumadocs-ui/mdx";
+import { ImageZoom } from "fumadocs-ui/components/image-zoom";
import type { Metadata } from "next";
import { DocsHero } from "@/components/hero";
-import { Byline, NumberedCards, NumberedCard, NumberedSteps, Step } from "@/components/editorial";
+import { NumberedCards, NumberedCard, NumberedSteps, Step } from "@/components/editorial";
import { VideoEmbed } from "@/components/video-embed";
+import { CommunityLinks } from "@/components/community-links";
import { i18n, type Lang } from "@/lib/i18n";
import { homeCopy } from "@/lib/translations";
import { docsAlternates } from "@/lib/site";
@@ -52,18 +54,20 @@ export default async function Page({
}
subtitle={page.data.description}
/>
- <Byline items={[...copy.byline]} />
<DocsBody>
<DocsLocaleProvider lang={lang}>
<MDX
components={{
...defaultMdxComponents,
+ // Same lightbox mapping as [...slug]/page.tsx — keep in sync.
+ img: (props) => <ImageZoom {...props} />,
a: LocaleLink,
NumberedCards,
NumberedCard,
NumberedSteps,
Step,
VideoEmbed,
+ CommunityLinks,
}}
/>
</DocsLocaleProvider>
diff --git a/apps/docs/app/global.css b/apps/docs/app/global.css
index 2448d3487f..83aa08aa97 100644
--- a/apps/docs/app/global.css
+++ b/apps/docs/app/global.css
@@ -263,6 +263,12 @@ article > p.text-lg {
font-weight: 600;
}
+/* The page article is a flex column (gap-4), so the prose body's first
+ element must not stack its own top margin on top of that gap. */
+.prose > :first-child {
+ margin-top: 0 !important;
+}
+
.prose h2 {
font-family: var(--font-serif), ui-serif, serif;
font-size: 1.625rem; /* 26px */
@@ -316,7 +322,10 @@ article > p.text-lg {
* change) — the link "arrives" as a single color shift.
* ------------------------------------------------------------------------- */
-.prose a:not([data-card]):not(.not-prose) {
+.prose
+ a:not([data-card]):not(.not-prose):not(
+ :where([class~="not-prose"] *)
+ ) {
color: var(--foreground);
font-weight: 500;
text-decoration: underline;
@@ -325,7 +334,10 @@ article > p.text-lg {
text-underline-offset: 3px;
transition: text-decoration-color 150ms, color 150ms;
}
-.prose a:not([data-card]):not(.not-prose):hover {
+.prose
+ a:not([data-card]):not(.not-prose):not(
+ :where([class~="not-prose"] *)
+ ):hover {
color: var(--primary);
text-decoration-color: var(--primary);
}
@@ -334,8 +346,16 @@ article > p.text-lg {
* bg, uppercase NOTE label, body). Another decoration over-loads it — so
* links inside a callout drop the underline entirely. Color shift on
* hover is the full affordance. */
-.prose div.shadow-md:has(> [role="none"]) a:not([data-card]):not(.not-prose),
-.prose div.shadow-md:has(> [role="none"]) a:not([data-card]):not(.not-prose):hover {
+.prose
+ div.shadow-md:has(> [role="none"])
+ a:not([data-card]):not(.not-prose):not(
+ :where([class~="not-prose"] *)
+ ),
+.prose
+ div.shadow-md:has(> [role="none"])
+ a:not([data-card]):not(.not-prose):not(
+ :where([class~="not-prose"] *)
+ ):hover {
text-decoration: none;
}
@@ -557,6 +577,14 @@ article > p.text-lg {
align-items: center;
}
+/* The padding shorthand above flattens the folder tree indent
+ (ps-(--sidebar-item-offset)); restore it for links that carry the
+ offset utility so children clear the vertical guide line. */
+#nd-sidebar a[data-active][class*="ps-("],
+#nd-sidebar-mobile a[data-active][class*="ps-("] {
+ padding-inline-start: var(--sidebar-item-offset, 0.625rem);
+}
+
#nd-sidebar a[data-active="false"],
#nd-sidebar-mobile a[data-active="false"] {
color: var(--muted-foreground);
diff --git a/apps/docs/components/community-links.tsx b/apps/docs/components/community-links.tsx
new file mode 100644
index 0000000000..0eead27904
--- /dev/null
+++ b/apps/docs/components/community-links.tsx
@@ -0,0 +1,85 @@
+type CommunityLinksProps = {
+ discordDescription: string;
+ githubDescription: string;
+ xDescription: string;
+};
+
+export function CommunityLinks({
+ discordDescription,
+ githubDescription,
+ xDescription,
+}: CommunityLinksProps) {
+ const links = [
+ {
+ label: "Discord",
+ href: "https://discord.gg/W8gYBn226t",
+ description: discordDescription,
+ Icon: DiscordMark,
+ },
+ {
+ label: "GitHub",
+ href: "https://github.com/multica-ai/multica",
+ description: githubDescription,
+ Icon: GitHubMark,
+ },
+ {
+ label: "X(Twitter)",
+ href: "https://x.com/MulticaAI",
+ description: xDescription,
+ Icon: XMark,
+ },
+ ];
+
+ return (
+ <ul>
+ {links.map(({ label, href, description, Icon }) => (
+ <li key={label}>
+ <a href={href} target="_blank" rel="noreferrer">
+ <Icon className="mr-1.5 inline-block size-4 align-[-0.125em]" />
+ {label}
+ </a>{" "}
+ — {description}
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+function GitHubMark({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ aria-hidden="true"
+ className={className}
+ fill="currentColor"
+ >
+ <path d="M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2 .37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82A7.65 7.65 0 0 1 8 4.84c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />
+ </svg>
+ );
+}
+
+function DiscordMark({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={className}
+ fill="currentColor"
+ >
+ <path d="M20.317 4.3698a19.7913 19.7913 0 0 0-4.8851-1.5152.0741.0741 0 0 0-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 0 0-.0785-.037 19.7363 19.7363 0 0 0-4.8852 1.515.0699.0699 0 0 0-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 0 0 .0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 0 0 .0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 0 0-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 0 1-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 0 1 .0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 0 1 .0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 0 1-.0066.1276 12.2986 12.2986 0 0 1-1.873.8914.0766.0766 0 0 0-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 0 0 .0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 0 0 .0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 0 0-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" />
+ </svg>
+ );
+}
+
+function XMark({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={className}
+ fill="currentColor"
+ >
+ <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
+ </svg>
+ );
+}
diff --git a/apps/docs/components/editorial.tsx b/apps/docs/components/editorial.tsx
index 195788f7ab..d133f55bd6 100644
--- a/apps/docs/components/editorial.tsx
+++ b/apps/docs/components/editorial.tsx
@@ -5,28 +5,6 @@ import type { ReactNode } from "react";
import { useDocsLocale } from "@/components/locale-link";
import { prefixLocale } from "@/lib/locale-link";
-/**
- * Byline — editorial metadata strip with ruled top + bottom borders.
- *
- * Sits below DocsHero on showpiece pages (welcome). Carries the small
- * uppercase metadata: section · updated · read time. Mirrors the v2
- * editorial pattern of a "by-line" between title and body, separating
- * the heading hero from the article proper.
- */
-export function Byline({ items }: { items: string[] }) {
- return (
- <div className="not-prose mb-9 flex items-center gap-3.5 border-y border-[var(--docs-rule)] py-3.5 text-xs uppercase tracking-[0.08em] text-muted-foreground">
- {items.map((item, i) => (
- <span key={i} className="flex items-center gap-3.5">
- {i > 0 ? (
- <span className="size-[3px] rounded-full bg-[var(--docs-faint)]" />
- ) : null}
- <span>{item}</span>
- </span>
- ))}
- </div>
- );
-}
/**
* NumberedCards — three-column ruled-divider grid with No.01/02/03 serif
diff --git a/apps/docs/components/hero.tsx b/apps/docs/components/hero.tsx
index 2a7b4b4224..148268323b 100644
--- a/apps/docs/components/hero.tsx
+++ b/apps/docs/components/hero.tsx
@@ -24,7 +24,9 @@ export function DocsHero({
{eyebrow}
</p>
) : null}
- <h1 className="mb-5 font-[family-name:var(--font-serif)] text-[2.25rem] font-normal leading-[1.05] tracking-[-0.025em] text-foreground sm:text-[2.75rem]">
+ <h1
+ className={`${subtitle ? "mb-5" : "mb-0"} font-[family-name:var(--font-serif)] text-[2.25rem] font-normal leading-[1.05] tracking-[-0.025em] text-foreground sm:text-[2.75rem]`}
+ >
{title}
</h1>
{subtitle ? (
diff --git a/apps/docs/content/docs/agents-create.ja.mdx b/apps/docs/content/docs/agents-create.ja.mdx
index 863188f7d5..ed92e6b7e4 100644
--- a/apps/docs/content/docs/agents-create.ja.mdx
+++ b/apps/docs/content/docs/agents-create.ja.mdx
@@ -1,127 +1,154 @@
---
title: エージェントの作成と構成
-description: エージェントを作成するために必要な最小限のフィールドと、すべての任意設定 — システム指示、環境変数、公開範囲、同時実行制限、アーカイブ。
+description: 開始方法を選び、エージェントの職責・能力・実行方法・Access を定義します。
---
import { Callout } from "fumadocs-ui/components/callout";
-[エージェント](/agents)を作成するのに必要なのは 2 つだけです。**名前**と **[AI コーディングツール](/providers)の選択**です。それ以外はすべて任意です — システム指示、モデル、環境変数、CLI 引数、公開範囲、同時実行制限 — デフォルト値でも問題なく動作します。まず動かしてから後で調整しましょう。すべてのフィールドはいつでも変更できます。
+エージェントを作成するには、先に使える[ランタイム](/daemon-runtimes)が必要です。ランタイムは、そのエージェントがどのコンピュータとどの AI コーディングツールを使うかを決めます。エージェント側は、長く使うアイデンティティ、指示、能力を保持します。
-## エージェントを作成する
+ワークスペースの **エージェント** ページで **新規エージェント** をクリックします。
-前提条件: 使用中のマシンにサポートされている [AI コーディングツール](/providers)が少なくとも 1 つインストールされており(Claude Code、Codex など)、[デーモン](/daemon-runtimes)が実行中であること。まだそこまで準備できていない場合は、[Cloud クイックスタート](/cloud-quickstart)または[セルフホストクイックスタート](/self-host-quickstart)から始めてください。
+## 開始方法の選択
-準備が整ったら、ワークスペースの **Agents** ページに移動して **+ New** をクリックするか、CLI を使用します。
+作成ページには 2 つの方法があります。
-```bash
-multica agent create
-```
+| 方法 | 向いている場合 |
+|---|---|
+| **Start blank** | エージェントの職責がすでに決まっていて、各項目を自分で記入したい。 |
+| **Build with AI** | まず目標を説明し、Agent Builder に重要な点を確認させてドラフトを生成させたい。 |
-このフォームには必須フィールドが 2 つだけあります。**name**(ワークスペース内で一意であること)と **runtime**(= AI コーディングツールの選択)です。それ以外のすべてのフィールドは、以下でセクションごとに扱います。
+Build with AI には、Builder との対話のためにオンラインのランタイムが必要です。どちらの方法でも、作成前に最終的な構成を確認して修正できます。
-## AI コーディングツールを選ぶ
+![エージェント作成の開始方法選択画面:Start blank と Build with AI](/images/docs/quickstart-new-agent.png)
-各ランタイムは特定の AI コーディングツールを基盤としています。Multica はそのうち 16 個をサポートします。最も一般的な選択肢は次のとおりです。
+## 必須項目
-| ツール | 適している場合 |
-|---|---|
-| **Claude Code** | Anthropic の公式ツールで、最も完成度の高い機能セットを提供します。**最初の選択として最適です** |
-| **Codex** | OpenAI 製で、主流の代替手段です |
-| **Cursor** | Cursor エディターのエコシステムを使うユーザー |
-| **Copilot** | GitHub アカウントの権限を活用するチーム |
-| **CodeBuddy** | Tencent の Claude Code 互換 CLI を使うチーム |
+エージェントの作成に必要なのは 2 つだけです。
+
+- **名前** — ワークスペース内で一意である必要があります。
+- **ランタイム** — 実際にタスクを実行する環境です。
+
+他の項目はデフォルトのまま作成し、後から調整できます。新しいエージェントは、デフォルトでは作成者だけが実行できます。
+
+## 説明と指示
+
+**説明**はチーム向けの短い紹介文です。エージェントの一覧と詳細にだけ表示され、AI コーディングツールのプロンプトには入りません。
-残りの 9 個(Antigravity、Hermes、Kimi、Kiro CLI、OpenCode、Pi、OpenClaw、Qoder、Trae CLI)と、各ツールの完全な機能比較表(セッション再開、MCP、スキル注入パス、モデル選択)は、[AI コーディングツール比較](/providers)で扱います。
+**指示**は毎回の実行時にエージェントへ提供されます。通常は次の内容を書きます。
-## システム指示を書く
+- 何を担当し、何を担当しないか
+- 仕事を受け取ったら最初に何を確認するか
+- どの内容の変更を許可するか
+- 結果をどう提出するか
+- どんなときにメンバーへ確認するか
-**システム指示**(`instructions`)はすべてのタスクの先頭に追加され、エージェントがどんな役割を担い、どんなルールに従うべきかを伝えます。
+例:
```text
-You're a frontend code-review agent. When an issue comes in, read the diff first. Focus only on:
-- Styling issues (tailwind class names, box model)
-- Accessibility (a11y)
-Don't change code — leave suggestions in a comment.
+あなたはフロントエンドの Pull Request をレビューします。
+
+まず変更内容と関連テストを読み、次の点だけを確認します:
+- React と TypeScript の正しさ
+- アクセシビリティ
+- 既存のコンポーネントパターンとの一貫性
+
+コードを直接変更しないでください。指摘は重大度順に issue のコメントに書き、
+ブロッカーがなければ、マージできると明確に述べてください。
```
-空のままにすると(デフォルト)、エージェントは追加の制約なしに、基盤となる AI コーディングツールのネイティブな動作を使用します。
+## スキルの追加
-## モデルを選ぶ
+作成時に、ワークスペースから 1 つ以上の[スキル](/skills)を選べます。
-ほとんどの AI コーディングツールはモデル選択をサポートしています(例えば Claude Code では Sonnet と Opus のどちらかを選べます)。空のままにするとツール自体のデフォルト値が使われ、明示的に 1 つを選ぶとそのモデルが実行されます。各ツールがサポートするモデルは、[AI コーディングツール比較](/providers)にまとめられています。
+スキルは、エージェント間で再利用できる手法や資料の保存に向いています。このエージェントだけの長期的な要件は、指示に書いてください。
-モデルの変更は**新しいタスクにのみ適用されます**。すでにディスパッチされたタスクは、ディスパッチ時点で固定されたモデルで実行を続けます。
+## ランタイム・モデル・思考レベルの選択
-## カスタム環境変数 (custom_env)
+ランタイムは、それぞれ 1 つの AI コーディングツールに対応しています。ランタイムを選ぶと、そのツールがサポートするモデルと思考レベルを続けて選べます。一部のツール(Codex など)ではサービスティアも選べます。
-**カスタム環境変数**(`custom_env`)を使うと、タスク実行時に追加の環境変数を注入できます。代表的な用途は API キーの設定やアップストリームエンドポイントの切り替えです。
+- 空のままにすると、ランタイムまたはローカル CLI のデフォルトが使われます。
+- モデルを設定すると、それ以降にこのエージェントが受け取るタスクでその上書き値が使われます。
+- 一部のランタイムはモデルを自分で管理するため、モデル選択は表示されません。
-```
-ANTHROPIC_API_KEY = sk-...
-ANTHROPIC_BASE_URL = https://my-proxy.example.com
-```
+サポートするモデル、セッション再開、スキル、MCP の対応はツールごとに異なります。[AI コーディングツール対応表](/providers)を参照してください。
-システムにとって重要な変数は上書きできません。`PATH`、`HOME`、`USER`、`SHELL`、`TERM`、`CODEX_HOME`、そして `MULTICA_*` で始まるすべてのキーは、デーモンが静かに無視します(警告ログは残しますが、エラーは発生しません)。
+## Access の設定
-<Callout type="warning">
-**`custom_env` の値は Multica サーバーのデータベースに平文で保存されます。** エージェントの list/get レスポンスには環境変数の値がまったく含まれなくなり、不透明な個数だけが返されます。実際の値を読み取るには、そのエージェント自身の owner、またはワークスペースの owner / admin が、専用で監査される `GET /api/agents/{id}/env` エンドポイント(CLI: `multica agent env get <id>`)を呼び出す必要があります。タスクを実行中のエージェントは、ホストの owner 資格情報を使って他のエージェントの環境変数を明らかにすることはできません。同じ人物が owner のエージェントであっても同様です。このエンドポイントはエージェントアクターのセッションを拒否します。
+Access は、どのメンバーがこのエージェントを実行(割り当て、@メンション、チャット)できるかを決めます。
-**価値の高いシークレットは `custom_env` に入れないでください**(本番データベースのパスワード、root レベルのトークンなど)。エージェントには**権限範囲が限定された専用の資格情報**(読み取り専用 API キー、単一スコープの PAT)を使用し、定期的にローテーションしてください。データベースのバックアップと DB 監査は、依然として意味のある露出面として残ります。
-</Callout>
+| Access | 意味 |
+|---|---|
+| **Only me** | 自分だけが実行できます。デフォルトです。 |
+| **Entire workspace** | ワークスペースの全メンバーが実行できます。 |
+| **Specific people** | 自分と選択したメンバーだけが実行できます。 |
-## カスタム CLI 引数 (custom_args)
+![Access 設定:Only me、Entire workspace、Specific people の 3 択](/images/docs/agent-access-settings.png)
-**カスタム CLI 引数**(`custom_args`)は、AI コーディングツールのコマンドラインに 1 つずつ順に付け足される文字列配列です。
+Access を変更できるのはエージェントの owner だけで、ワークスペースの管理者にもできません。ワークスペースの `owner` と `admin` はその他の構成を管理できますが、管理者の立場を使って、許可されていないエージェントを実行することはできません。
-```json
-["--max-turns", "100", "--append-system-prompt", "always respond in Chinese"]
-```
+## 作成後の設定項目
-最終的なコマンドは次のように生成されます。
+エージェントの詳細ページでは、続けて次の項目を調整できます。
-```bash
-claude --model <model> --max-turns 100 --append-system-prompt "always respond in Chinese" [...]
-```
+| 設定 | 役割 |
+|---|---|
+| **同時実行上限** | 同じエージェントが同時に実行できるタスク数。デフォルトは 6 で、上限に達すると以降のタスクはキューで待機します。 |
+| **環境変数** | AI コーディングツールの起動時に変数を注入します。 |
+| **カスタム引数** | AI コーディングツールの CLI 引数に 1 つずつ追加されます。 |
+| **MCP** | 対応する AI コーディングツールに MCP サーバー構成を提供します。 |
+| **インテグレーション** | このエージェントが使える外部サービスを接続します。 |
+
+ランタイムが載っているデーモンにも全体の同時実行上限(デフォルト 20)があり、実際の同時実行数は 2 つの小さい方になります。
+
+構成を変更しても、すでに実行中のタスクは変わりません。以降のタスクは、ランタイムが取得した時点で保存されていたエージェント構成を使います。
+
+## 環境変数と認証情報
-引数はシェルを介さずそのまま渡されるため(注入リスクなし)、特定のフラグが認識されるかどうかは AI コーディングツール自体に依存します。この部分はツールによって大きな差があります。
+環境変数には、このエージェントが実行時に必要とする限定的な権限の認証情報が向いています。読み取り専用の API キーや、単一スコープのトークンなどです。
-<Callout type="tip">
-`custom_env` と `custom_args` には厳格な上限はありませんが、実際には**それぞれ 10 個以内に抑えてください**。多すぎるとコマンドラインが長くなり、起動が遅くなり、メンテナンスも難しくなります。
+<Callout type="warning">
+**`custom_env` の値は Multica サーバーのデータベースに平文で保存されます。**「このマシンから出ない」データではありません。エージェントの一覧・詳細エンドポイントは環境変数の値を一切返さず、キーの個数だけを返します。値のロック解除と変更ができるのはワークスペースの `owner` と `admin` だけで、読み取りや変更のたびに監査記録が残ります。実行中のエージェントが管理エンドポイントを呼び出して、他のエージェントの変数を読むことはできません。
</Callout>
-## 公開範囲
+本番データベースの管理者パスワードなど、価値の高い長期的な認証情報は使わないでください。
-- **ワークスペース**(`workspace`) — ワークスペースのすべてのメンバーが割り当てできます
-- **非公開**(`private`) — ワークスペースの owner、admin、またはエージェントの作成者だけが割り当てできます
+`PATH`、`HOME`、`MULTICA_*` などの実行環境の重要な変数は、ここから上書きできません。
-新しいエージェントはデフォルトで `private` です。
+## カスタム引数と MCP
-**非公開だからといって隠されるわけではありません** — すべてのメンバーが一覧で非公開エージェントの名前と説明を見ることができ、ただし機微な構成は読み取れません(環境変数の値はエージェントの list/get レスポンスに決して現れず、MCP 構成は owner 以外のユーザーにはマスキングされます)。詳しい意味は[エージェント → 誰がエージェントを割り当てられるか](/agents#who-can-assign-an-agent)を参照してください。
+カスタム引数は配列として 1 つずつ AI コーディングツールに渡され、シェル展開は行われません。引数名が有効かどうかは対応するツールが判断します。専用フィールドがあるモデル設定を、ここで重ねて指定する必要はありません。
-## 同時実行制限
+MCP 構成にはトークンが含まれることがあり、保存と表示のルールは環境変数と同じです。この項目が表示されるのは、マネージド MCP 構成をサポートするランタイムだけです。サポートしないツールが、構成を保存しただけで MCP 機能を獲得することはありません。
-**同時実行制限**(`max_concurrent_tasks`)は、このエージェントが一度に並列で実行できるタスク数を制御します。デフォルト値は **6** です。上限に達した新しいタスクは拒否されず、キューで待機します。
+## エージェントの複製
-これは 2 段階の制限のうち「エージェント層」にすぎません。デーモン自体がより広い上限(デフォルト値 20)を適用し、2 つのうちより厳しい方が優先されます。詳しくは[デーモンとランタイム → 並列で何個のタスクを実行できるか](/daemon-runtimes#how-many-tasks-can-run-in-parallel)にあります。
+複製すると、名前以外のほとんどの作業構成が引き継がれます。指示、スキル、カスタム引数、アバター、同時実行上限、Access 設定が含まれます。モデル、思考レベル、サービスティアも一緒に引き継がれますが、元のランタイムが利用できず、複製がやむを得ず別のランタイムに移る場合、この 3 つはクリアされるため選び直しが必要です。
-この値を変更しても**すでに実行中のタスクはキャンセルされず**、次に処理されるタスクからのみ適用されます。
+環境変数の値と MCP 構成は、どんな場合も複製されません。新しいエージェントで設定し直してください。複製では、元のエージェントのランタイム紐づけと Access 設定が保持されます。
-## ドメインの専門性をつなぐ: スキル
+## CLI での作成
-作成したエージェントには**スキル**をアタッチできます — タスク実行時に AI コーディングツールへ自動的に届けられる**ナレッジパック**(`SKILL.md` + 補助ファイル)です。新しいスキルを作成したり、GitHub または ClawHub からインポートしたり、マシン上の既存のスキルディレクトリからスキャンしたりできます。[スキル](/skills)を参照してください。
+```bash
+multica agent create \
+ --name "Frontend Reviewer" \
+ --runtime-id <runtime-id> \
+ --description "フロントエンドの Pull Request をレビューする" \
+ --instructions "まず変更とテストを読み、レビュー結果は issue のコメントだけに投稿する。"
+```
-## アーカイブと復元
+コマンドライン引数の平文はシェル履歴に残ります。stdin と権限を制限したファイルは残りません。
-もう使わないエージェントは**アーカイブ**できます — 日常的な画面からは消えますが、履歴データ(実行したタスク、投稿したコメント)はすべてそのまま保持されます。いつでも**復元**して再び作業に投入できます。
+構成の近いエージェントがすでにあるときは、直接コピーできます。
-<Callout type="warning">
-**アーカイブは、そのエージェントに属する未完了のすべてのタスクを即座にキャンセルします** — 実行中、ディスパッチ済み、キュー待ちのタスクがすべて `cancelled` としてマークされ、続行されません。進行中の重要なタスクがある場合は、アーカイブする前に最後まで完了させてください。
-</Callout>
+```bash
+multica agent copy <agent-id>
+```
-アーカイブ済みのエージェントには新しいタスクを割り当てられません。
+デフォルトでは同じランタイムに複製されます。`--runtime-id` を付けると別のランタイムへ移せますが、同時に `--model` の指定が必要です。環境変数、MCP 構成、`runtime_config` は決して複製されません。ランタイムの紐づけ自体は保持されます。完全なフラグは [CLI コマンドリファレンス](/cli)を参照してください。
## 次のステップ
-- [スキル](/skills) — エージェントにナレッジパックをアタッチする
-- [AI コーディングツール比較](/providers) — 16 個のツール全体の機能比較表
-- [エージェントへのイシューの割り当て](/assigning-issues) — 新しく作ったエージェントを作業に投入する
+- [エージェントにイシューを割り当てる](/assigning-issues) — 実際の仕事で構成を検証する。
+- [スキル](/skills) — チームの手法を作成、インポート、再利用する。
+- [デーモンとランタイム](/daemon-runtimes) — オンライン状態と実行場所のトラブルシューティング。
diff --git a/apps/docs/content/docs/agents-create.ko.mdx b/apps/docs/content/docs/agents-create.ko.mdx
index 6ac299d5b4..b776cb95eb 100644
--- a/apps/docs/content/docs/agents-create.ko.mdx
+++ b/apps/docs/content/docs/agents-create.ko.mdx
@@ -1,127 +1,154 @@
---
-title: 에이전트 생성 및 구성
-description: 에이전트를 생성하는 데 필요한 최소 필드와 모든 선택적 설정 — 시스템 지침, 환경 변수, 공개 범위, 동시 실행 제한, 보관.
+title: 에이전트 생성 및 설정
+description: 시작 방법을 선택하고 에이전트의 역할, 기능, 실행 방식, Access를 정의합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-[에이전트](/agents)를 생성하는 데는 단 두 가지만 필요합니다. **이름** 하나와 **[AI 코딩 도구](/providers) 선택** 하나입니다. 나머지는 모두 선택 사항입니다 — 시스템 지침, 모델, 환경 변수, CLI 인자, 공개 범위, 동시 실행 제한 — 기본값으로도 문제없이 작동합니다. 먼저 실행해 보고 나중에 조정하세요. 모든 필드는 언제든지 변경할 수 있습니다.
+에이전트를 만들기 전에 사용할 수 있는 [런타임](/daemon-runtimes)이 있어야 합니다. 런타임은 이 에이전트가 사용할 컴퓨터와 AI 코딩 도구를 결정하며, 에이전트에는 장기적으로 사용할 정체성, 지시문, 기능이 저장됩니다.
-## 에이전트 생성
+워크스페이스의 **에이전트** 페이지에서 **새 에이전트**를 클릭합니다.
-전제 조건: 사용 중인 기기에 지원되는 [AI 코딩 도구](/providers)가 최소 하나는 설치되어 있고(Claude Code, Codex 등) [데몬](/daemon-runtimes)이 실행 중이어야 합니다. 아직 여기까지 준비되지 않았다면 [Cloud 빠른 시작](/cloud-quickstart)이나 [자체 호스팅 빠른 시작](/self-host-quickstart)부터 시작하세요.
+## 시작 방법 선택
-준비가 끝나면 워크스페이스의 **에이전트** 페이지로 이동해 **+ New**를 클릭하거나 CLI를 사용하세요.
+생성 페이지에서는 두 가지 방법을 제공합니다.
-```bash
-multica agent create
-```
+| 방법 | 적합한 경우 |
+|---|---|
+| **빈 상태에서 시작** | 에이전트의 역할을 이미 알고 있고 각 설정을 직접 입력하려는 경우 |
+| **AI로 만들기** | 먼저 목표를 설명하고 Agent Builder가 핵심 정보를 추가로 질문해 초안을 만들게 하려는 경우 |
-이 폼에는 필수 필드가 두 개뿐입니다. **이름**(워크스페이스 내에서 고유해야 함)과 **런타임**(= AI 코딩 도구 선택)입니다. 나머지 모든 필드는 아래에서 섹션별로 다룹니다.
+AI로 만들려면 Builder 대화를 진행할 온라인 런타임이 필요합니다. 어느 방법을 선택하든 만들기 전에 최종 설정을 확인하고 수정할 수 있습니다.
-## AI 코딩 도구 선택
+![에이전트 생성 시작 방법 선택: Start blank와 Build with AI](/images/docs/quickstart-new-agent.png)
-각 런타임은 특정 AI 코딩 도구를 기반으로 합니다. Multica는 그중 16개를 지원합니다. 가장 일반적인 선택지는 다음과 같습니다.
+## 필수 항목
-| 도구 | 적합한 경우 |
-|---|---|
-| **Claude Code** | Anthropic의 공식 도구로, 가장 완성도 높은 기능 집합을 제공합니다. **첫 선택으로 가장 좋습니다** |
-| **Codex** | OpenAI 제품으로, 주류 대안입니다 |
-| **Cursor** | Cursor 에디터 생태계 사용자 |
-| **Copilot** | GitHub 계정 권한을 활용하는 팀 |
-| **CodeBuddy** | Tencent의 Claude Code 호환 CLI를 사용하는 팀 |
+에이전트를 만들 때 필요한 항목은 두 가지뿐입니다.
+
+- **이름**: 현재 워크스페이스에서 고유해야 합니다.
+- **런타임**: 태스크를 실제로 실행할 환경을 선택합니다.
+
+다른 필드는 기본값으로 두고 만든 뒤 조정할 수 있습니다. 새 에이전트는 기본적으로 생성자만 실행할 수 있습니다.
+
+## 설명과 지시문
+
+**설명**은 팀을 위한 짧은 소개로 에이전트 목록과 상세 화면에만 표시되며 AI 코딩 도구의 프롬프트에는 포함되지 않습니다.
-나머지 9개(Antigravity, Hermes, Kimi, Kiro CLI, OpenCode, Pi, OpenClaw, Qoder, Trae CLI)와 각 도구의 전체 기능 비교표(세션 재개, MCP, 스킬 주입 경로, 모델 선택)는 [AI 코딩 도구 비교](/providers)에서 다룹니다.
+**지시문**은 모든 실행에서 에이전트에게 제공되며 일반적으로 다음 내용을 포함합니다.
-## 시스템 지침 작성
+- 담당하는 일과 담당하지 않는 일
+- 작업을 받으면 먼저 확인할 사항
+- 수정해도 되는 내용
+- 결과 제출 방식
+- 멤버에게 확인해야 하는 시점
-**시스템 지침**(`instructions`)은 모든 작업 앞에 추가되어, 에이전트가 어떤 역할을 맡고 어떤 규칙을 따라야 하는지 알려줍니다.
+예시:
```text
-You're a frontend code-review agent. When an issue comes in, read the diff first. Focus only on:
-- Styling issues (tailwind class names, box model)
-- Accessibility (a11y)
-Don't change code — leave suggestions in a comment.
+프런트엔드 Pull Request 검토를 담당합니다.
+
+먼저 변경 사항과 관련 테스트를 읽고 다음 항목만 확인합니다.
+- React와 TypeScript의 정확성
+- 접근성
+- 기존 컴포넌트 패턴과의 일관성
+
+코드를 직접 수정하지 마세요. 문제를 심각도별로 이슈 댓글에 작성하고,
+차단 문제가 없다면 병합해도 된다고 명확히 설명하세요.
```
-비워 두면(기본값) 에이전트는 추가 제약 없이 기반이 되는 AI 코딩 도구의 기본 동작을 사용합니다.
+## 스킬 추가
-## 모델 선택
+만들 때 워크스페이스에서 하나 이상의 [스킬](/skills)을 선택할 수 있습니다.
-대부분의 AI 코딩 도구는 모델 선택을 지원합니다(예를 들어 Claude Code는 Sonnet과 Opus 중에서 고를 수 있습니다). 비워 두면 도구 자체의 기본값이 사용되고, 명시적으로 하나를 선택하면 그 모델이 실행됩니다. 각 도구가 지원하는 모델은 [AI 코딩 도구 비교](/providers)에 정리되어 있습니다.
+스킬은 여러 에이전트가 재사용할 수 있는 방법과 자료를 저장하기에 적합합니다. 이 에이전트에만 적용되는 장기 요구 사항은 지시문에 작성하세요.
-모델 변경은 **새 작업에만 적용됩니다**. 이미 디스패치된 작업은 디스패치 시점에 고정된 모델로 계속 실행됩니다.
+## 런타임, 모델, 사고 강도 선택
-## 사용자 지정 환경 변수 (custom_env)
+런타임은 이미 특정 AI 코딩 도구에 대응합니다. 런타임을 선택한 뒤 해당 도구가 지원하는 모델과 사고 강도를 선택할 수 있습니다. Codex 같은 일부 도구에서는 속도 단계도 선택할 수 있습니다.
-**사용자 지정 환경 변수**(`custom_env`)를 사용하면 작업 실행 시점에 추가 환경 변수를 주입할 수 있습니다. 대표적인 용도는 API 키 설정이나 업스트림 엔드포인트 전환입니다.
+- 비워 두면 런타임 또는 로컬 CLI의 기본 설정을 사용합니다.
+- 모델을 설정하면 이후 이 에이전트가 가져가는 태스크에 해당 값이 적용됩니다.
+- 일부 런타임은 모델을 자체 관리하므로 모델 선택이 표시되지 않습니다.
-```
-ANTHROPIC_API_KEY = sk-...
-ANTHROPIC_BASE_URL = https://my-proxy.example.com
-```
+도구별 모델, 세션 복원, 스킬, MCP 기능은 [AI 코딩 도구 비교](/providers)를 참고하세요.
-시스템에 핵심적인 변수는 재정의할 수 없습니다. `PATH`, `HOME`, `USER`, `SHELL`, `TERM`, `CODEX_HOME`, 그리고 `MULTICA_*`로 시작하는 모든 키는 데몬이 조용히 무시합니다(경고 로그는 남기지만 오류는 발생하지 않습니다).
+## Access 설정
-<Callout type="warning">
-**`custom_env`의 값은 Multica 서버 데이터베이스에 평문으로 저장됩니다.** 에이전트 list/get 응답은 더 이상 환경 변수 값을 전혀 포함하지 않으며, 불투명한 개수만 반환합니다. 실제 값을 읽으려면 해당 에이전트 자신의 owner 또는 워크스페이스 owner / admin이 전용으로 감사되는 `GET /api/agents/{id}/env` 엔드포인트(CLI: `multica agent env get <id>`)를 호출해야 합니다. 작업을 실행 중인 에이전트는 호스트의 owner 자격 증명을 이용해 다른 에이전트의 환경 변수를 드러낼 수 없으며, 같은 사람이 owner인 에이전트라도 마찬가지입니다. 이 엔드포인트는 에이전트 액터 세션을 거부합니다.
+Access는 어떤 멤버가 이 에이전트를 실행할 수 있는지 결정합니다. 실행에는 할당, @멘션, 대화가 포함됩니다.
-**가치가 높은 secret은 `custom_env`에 넣지 마세요**(운영 데이터베이스 비밀번호, root 수준 토큰 등). 에이전트에는 **권한 범위가 제한된 전용 자격 증명**(읽기 전용 API 키, 단일 스코프 PAT)을 사용하고 정기적으로 교체하세요. 데이터베이스 백업과 DB 감사는 여전히 의미 있는 노출 표면으로 남아 있습니다.
-</Callout>
+| Access | 의미 |
+|---|---|
+| **나만**(Only me) | 나만 실행할 수 있습니다. 기본값입니다. |
+| **전체 워크스페이스**(Entire workspace) | 모든 워크스페이스 멤버가 실행할 수 있습니다. |
+| **지정한 멤버**(Specific people) | 나와 선택한 멤버만 실행할 수 있습니다. |
-## 사용자 지정 CLI 인자 (custom_args)
+![Access 설정: 나만, 전체 워크스페이스, 지정한 멤버의 세 단계](/images/docs/agent-access-settings.png)
-**사용자 지정 CLI 인자**(`custom_args`)는 AI 코딩 도구의 명령줄에 하나씩 차례로 덧붙는 문자열 배열입니다.
+에이전트 owner만 Access를 수정할 수 있으며 워크스페이스 관리자도 수정할 수 없습니다. 워크스페이스 `owner`와 `admin`은 다른 설정을 관리할 수 있지만 관리자 권한으로 허가받지 않은 에이전트를 실행할 수는 없습니다.
-```json
-["--max-turns", "100", "--append-system-prompt", "always respond in Chinese"]
-```
+## 생성 후 설정 항목
-최종 명령은 다음과 같이 만들어집니다.
+에이전트 상세 페이지를 열면 다음 항목을 계속 조정할 수 있습니다.
-```bash
-claude --model <model> --max-turns 100 --append-system-prompt "always respond in Chinese" [...]
-```
+| 설정 | 역할 |
+|---|---|
+| **동시 실행 상한** | 같은 에이전트가 동시에 실행할 수 있는 태스크 수입니다. 기본값은 6이며 상한에 도달하면 계속 큐에서 기다립니다. |
+| **환경 변수** | AI 코딩 도구를 시작할 때 변수를 주입합니다. |
+| **사용자 지정 인수** | AI 코딩 도구의 CLI 인수에 항목별로 추가합니다. |
+| **MCP** | 지원되는 AI 코딩 도구에 MCP server 설정을 제공합니다. |
+| **연동** | 이 에이전트가 사용할 수 있는 외부 서비스를 연결합니다. |
+
+런타임이 속한 데몬에도 전체 동시 실행 상한(기본 20)이 있으며 실제 동시 실행 수에는 둘 중 더 작은 값이 적용됩니다.
+
+설정을 수정해도 이미 실행 중인 실행 태스크는 바뀌지 않습니다. 이후 태스크가 런타임에 의해 수령될 때 당시 저장된 에이전트 설정을 사용합니다.
+
+## 환경 변수와 자격 증명
-인자는 셸을 거치지 않고 있는 그대로 전달되므로(주입 위험 없음), 특정 플래그가 인식되는지 여부는 AI 코딩 도구 자체에 달려 있습니다. 이 부분은 도구마다 상당한 차이가 있습니다.
+환경 변수에는 이 에이전트 실행에 필요한 제한된 권한의 자격 증명을 넣는 것이 적합합니다. 예를 들면 읽기 전용 API key나 단일 scope token입니다.
-<Callout type="tip">
-`custom_env`와 `custom_args`에는 엄격한 상한이 없지만, 실제로는 **각각 10개 이내로 유지하세요**. 너무 많으면 명령줄이 길어지고 시작이 느려지며 유지 관리도 어려워집니다.
+<Callout type="warning">
+**`custom_env` 값은 Multica 서버 데이터베이스에 평문으로 저장되며** "로컬에만 남는" 데이터가 아닙니다. 에이전트 목록 및 상세 API는 env 값을 전혀 반환하지 않고 키 개수만 반환합니다. 워크스페이스 `owner`와 `admin`만 잠금을 해제하고 수정할 수 있으며 모든 읽기와 수정이 감사 기록에 남습니다. 실행 중인 에이전트는 관리 API로 다른 에이전트의 변수를 읽을 수 없습니다.
</Callout>
-## 공개 범위
+프로덕션 데이터베이스의 관리자 비밀번호나 가치가 높은 장기 자격 증명을 사용하지 마세요.
-- **워크스페이스**(`workspace`) — 워크스페이스의 모든 멤버가 할당할 수 있습니다
-- **비공개**(`private`) — 워크스페이스 owner, admin, 또는 에이전트 생성자만 할당할 수 있습니다
+`PATH`, `HOME`, `MULTICA_*` 같은 핵심 실행 환경 변수는 여기서 덮어쓸 수 없습니다.
-새 에이전트는 기본적으로 `private`입니다.
+## 사용자 지정 인수와 MCP
-**비공개라고 해서 숨겨지는 것은 아닙니다** — 모든 멤버가 목록에서 비공개 에이전트의 이름과 설명을 볼 수 있으며, 다만 민감한 구성은 읽을 수 없습니다(환경 변수 값은 에이전트 list/get 응답에 절대 나타나지 않으며, MCP 구성은 owner가 아닌 사용자에게는 마스킹됩니다). 자세한 의미는 [에이전트 → 누가 에이전트를 할당할 수 있나요](/agents#who-can-assign-an-agent)를 참고하세요.
+사용자 지정 인수는 배열의 각 항목으로 AI 코딩 도구에 전달되며 shell 확장을 거치지 않습니다. 인수 이름의 유효성은 해당 도구가 결정합니다. 별도 필드가 있는 모델 설정을 여기서 다시 입력할 필요는 없습니다.
-## 동시 실행 제한
+MCP 설정에는 token이 포함될 수 있으며 저장 및 표시 규칙은 환경 변수와 같습니다. 관리형 MCP 설정을 지원하는 런타임에서만 이 항목이 표시됩니다. 지원하지 않는 도구는 설정을 저장해도 MCP 기능을 자동으로 얻지 않습니다.
-**동시 실행 제한**(`max_concurrent_tasks`)은 이 에이전트가 한 번에 병렬로 실행할 수 있는 작업 수를 제어합니다. 기본값은 **6**입니다. 상한에 도달한 새 작업은 거부되지 않고 대기열에서 대기합니다.
+## 에이전트 복사
-이것은 두 단계 제한 중 "에이전트 계층"에 불과합니다. 데몬 자체가 더 넓은 상한(기본값 20)을 적용하며, 둘 중 더 빡빡한 쪽이 우선합니다. 자세한 내용은 [데몬과 런타임 → 병렬로 몇 개의 작업을 실행할 수 있나요](/daemon-runtimes#how-many-tasks-can-run-in-parallel)에 있습니다.
+복사하면 이름을 제외한 대부분의 작업 설정이 포함됩니다. 지시문, 스킬, 사용자 지정 인수, 아바타, 동시 실행 상한, Access 설정이 복사됩니다. 모델, 사고 강도, 속도 단계도 함께 복사되지만 원래 런타임을 사용할 수 없어 다른 런타임으로 바꿔야 하면 이 세 항목이 비워지므로 다시 선택해야 합니다.
-이 값을 변경해도 **이미 실행 중인 작업은 취소되지 않으며**, 다음에 처리될 작업부터만 적용됩니다.
+환경 변수 값과 MCP 설정은 어떤 경우에도 복사되지 않으며 새 에이전트에서 다시 설정해야 합니다. 복사본은 원래 에이전트의 런타임 연결과 Access 설정을 유지합니다.
-## 도메인 전문성 연결: 스킬
+## CLI로 만들기
-생성된 에이전트에는 **스킬**을 연결할 수 있습니다 — 작업 실행 시점에 AI 코딩 도구로 자동 전달되는 **지식 팩**(`SKILL.md` + 보조 파일)입니다. 새 스킬을 만들거나, GitHub 또는 ClawHub에서 가져오거나, 기기에 있는 기존 스킬 디렉터리에서 스캔할 수 있습니다. [스킬](/skills)을 참고하세요.
+```bash
+multica agent create \
+ --name "Frontend Reviewer" \
+ --runtime-id <runtime-id> \
+ --description "프런트엔드 Pull Request 검토" \
+ --instructions "먼저 변경 사항과 테스트를 읽고 이슈 댓글에만 검토 결론을 제출하세요."
+```
-## 보관 및 복원
+명령줄 인수의 평문은 shell 기록에 남습니다. stdin과 권한이 제한된 파일은 기록에 남지 않습니다.
-더 이상 사용하지 않는 에이전트는 **보관**할 수 있습니다 — 일상적인 화면에서는 사라지지만, 이력 데이터(실행한 작업, 작성한 댓글)는 모두 그대로 유지됩니다. 언제든지 **복원**하여 다시 작업에 투입할 수 있습니다.
+비슷한 설정의 에이전트가 이미 있다면 바로 복사할 수 있습니다.
-<Callout type="warning">
-**보관은 해당 에이전트에 속한 완료되지 않은 모든 작업을 즉시 취소합니다** — 실행 중, 디스패치됨, 대기 중인 작업이 모두 `cancelled`로 표시되며 계속 진행되지 않습니다. 진행 중인 중요한 작업이 있다면 보관하기 전에 끝까지 완료되도록 두세요.
-</Callout>
+```bash
+multica agent copy <agent-id>
+```
-보관된 에이전트에는 새 작업을 할당할 수 없습니다.
+기본적으로 같은 런타임으로 복사됩니다. 다른 런타임으로 바꾸려면 `--runtime-id`를 추가하고 `--model`도 함께 지정해야 합니다. 환경 변수, MCP 설정, `runtime_config`는 절대 복사되지 않지만 런타임 연결 자체는 유지됩니다. 전체 인수는 [CLI 사용](/cli)을 참고하세요.
## 다음 단계
-- [스킬](/skills) — 에이전트에 지식 팩 연결하기
-- [AI 코딩 도구 비교](/providers) — 16개 도구 전체의 기능 비교표
-- [에이전트에게 이슈 할당하기](/assigning-issues) — 새로 만든 에이전트를 작업에 투입하기
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 실제 작업으로 설정을 확인합니다.
+- [스킬](/skills) — 팀의 작업 방법을 만들고 가져오고 재사용합니다.
+- [데몬과 런타임](/daemon-runtimes) — 온라인 상태와 실행 위치 문제를 해결합니다.
diff --git a/apps/docs/content/docs/agents-create.mdx b/apps/docs/content/docs/agents-create.mdx
index f272a46f25..351ae8d926 100644
--- a/apps/docs/content/docs/agents-create.mdx
+++ b/apps/docs/content/docs/agents-create.mdx
@@ -1,127 +1,154 @@
---
title: Create and configure an agent
-description: The minimum fields to create an agent, plus every optional setting — system instructions, environment variables, visibility, concurrency limit, and archiving.
+description: Choose a starting point, then define the agent's responsibilities, capabilities, execution setup, and Access.
---
import { Callout } from "fumadocs-ui/components/callout";
-Creating an [agent](/agents) takes only two things: **a name** and **a choice of [AI coding tool](/providers)**. Everything else is optional — system instructions, model, environment variables, CLI arguments, visibility, concurrency limit — the defaults work fine. Get it running first and tune later; every field can be changed at any time.
+Creating an agent requires a working [runtime](/daemon-runtimes) first. The runtime decides which computer and which AI coding tool the agent uses; the agent holds the long-lived identity, instructions, and capabilities.
-## Create an agent
+On the workspace **Agents** page, click **New agent**.
-Prerequisite: you already have at least one supported [AI coding tool](/providers) installed on your machine (Claude Code, Codex, etc.) and a [daemon](/daemon-runtimes) running. If you're not there yet, start with [Cloud quickstart](/cloud-quickstart) or [Self-host quickstart](/self-host-quickstart).
+## Starting points
-Once that's in place, go to the **Agents** page in your workspace and click **+ New**, or use the CLI:
+The creation page offers two options:
-```bash
-multica agent create
-```
+| Option | When it fits |
+|---|---|
+| **Start blank** | You already know the agent's responsibilities and want to fill in every field yourself. |
+| **Build with AI** | Describe the goal first and let the Agent Builder ask the key questions and generate a draft. |
-The form has only two required fields: **name** (unique within the workspace) and **runtime** (= pick an AI coding tool). Every other field is covered section by section below.
+Build with AI needs an online runtime for the Builder conversation. Either way, you can review and edit the final configuration before creating.
-## Pick an AI coding tool
+![Agent creation starting points: Start blank and Build with AI](/images/docs/quickstart-new-agent.png)
-Each runtime is backed by a specific AI coding tool. Multica supports 16 of them. The most common choices:
+## Required fields
-| Tool | Good for |
-|---|---|
-| **Claude Code** | Anthropic's official tool, most complete feature set; **best first pick** |
-| **Codex** | OpenAI, the mainstream alternative |
-| **Cursor** | Users in the Cursor editor ecosystem |
-| **Copilot** | Teams leveraging their GitHub account entitlements |
-| **CodeBuddy** | Teams using Tencent's Claude Code-compatible CLI |
+Creating an agent requires only two things:
+
+- **Name** — must be unique within the workspace.
+- **Runtime** — the environment that actually executes tasks.
+
+Every other field can start with its default and be adjusted after creation. By default, only the creator can run a new agent.
+
+## Description and instructions
+
+The **description** is a short introduction for the team. It appears only in the agent list and detail page, and never enters the AI coding tool's prompt.
-The other nine (Antigravity, Hermes, Kimi, Kiro CLI, OpenCode, Pi, OpenClaw, Qoder, Trae CLI), along with each tool's full capability matrix (session resume, MCP, skill injection path, model selection), are covered in [AI coding tools comparison](/providers).
+**Instructions** are provided to the agent on every run and usually cover:
-## Writing system instructions
+- what it is and isn't responsible for;
+- what to check first when work arrives;
+- what it is allowed to modify;
+- how to deliver results;
+- when to check with a member before proceeding.
-**System instructions** (`instructions`) are prepended to every task, telling the agent what role it plays and what rules to follow:
+For example:
```text
-You're a frontend code-review agent. When an issue comes in, read the diff first. Focus only on:
-- Styling issues (tailwind class names, box model)
-- Accessibility (a11y)
-Don't change code — leave suggestions in a comment.
+You review frontend pull requests.
+
+Read the diff and related tests first, and check only:
+- React and TypeScript correctness
+- Accessibility
+- Consistency with existing component patterns
+
+Do not modify code directly. Post findings in an issue comment,
+ordered by severity; when nothing blocks, state clearly that the change can merge.
```
-When left blank (the default), the agent uses the native behavior of its underlying AI coding tool with no extra constraints.
+## Adding skills
-## Picking a model
+During creation you can pick one or more [skills](/skills) from the workspace.
-Most AI coding tools support model selection (for example, Claude Code lets you pick between Sonnet and Opus). Leave it blank and the tool's own default is used; pick one explicitly and that's what runs. Each tool's supported models are listed in [AI coding tools comparison](/providers).
+Skills suit methods and material reused across agents; long-lived requirements that belong only to this agent go in the instructions.
-Changing the model **only applies to new tasks**. Already-dispatched tasks continue with the model that was locked in at dispatch time.
+## Runtime, model, and thinking level
-## Custom environment variables (custom_env)
+Each runtime already maps to one AI coding tool. After picking a runtime, you can pick a model and thinking level the tool supports; some tools (such as Codex) also offer a service tier:
-**Custom environment variables** (`custom_env`) let you inject extra env vars at task execution time — typical uses are API keys or switching the upstream endpoint:
+- Left blank, the runtime or local CLI default applies.
+- With a model set, the agent uses that override for tasks it picks up afterwards.
+- Some runtimes manage models themselves, so no model picker is shown.
-```
-ANTHROPIC_API_KEY = sk-...
-ANTHROPIC_BASE_URL = https://my-proxy.example.com
-```
+Tools differ in supported models, session resume, skills, and MCP capabilities — see [AI coding tools comparison](/providers).
-System-critical variables cannot be overridden: `PATH`, `HOME`, `USER`, `SHELL`, `TERM`, `CODEX_HOME`, and any key starting with `MULTICA_*` are silently ignored by the daemon (with a warn log — no error).
+## Access
-<Callout type="warning">
-**Values in `custom_env` are stored in plaintext in Multica's server database.** Agent list/get responses no longer carry env values at all — only an opaque count. Reading values requires the agent's own owner — or a workspace owner/admin — to hit the dedicated, audited `GET /api/agents/{id}/env` endpoint (CLI: `multica agent env get <id>`). Agents running tasks can NOT use their host's owner credentials to reveal env on other agents, not even on an agent the same human owns — the endpoint denies agent-actor sessions.
+Access decides which members can run this agent (assign, @-mention, or chat):
-**Don't put high-value secrets in `custom_env`** (production database passwords, root-level tokens, etc.). Use **dedicated, limited-scope credentials** for agents (read-only API keys, single-scope PATs), and rotate them regularly. Database backups and DB audits remain a meaningful exposure surface.
-</Callout>
+| Access | Meaning |
+|---|---|
+| **Only me** | Only you can run it. The default. |
+| **Entire workspace** | Every workspace member can run it. |
+| **Specific people** | Only you and the selected members can run it. |
-## Custom CLI arguments (custom_args)
+![Access settings: Only me, Entire workspace, Specific people](/images/docs/agent-access-settings.png)
-**Custom CLI arguments** (`custom_args`) is a string array appended one-by-one to the AI coding tool's command line:
+Only the agent owner can change Access — workspace admins cannot. Workspace `owner`s and `admin`s can manage the rest of the configuration, but cannot use their admin role to run agents they aren't granted.
-```json
-["--max-turns", "100", "--append-system-prompt", "always respond in Chinese"]
-```
+## Configuration after creation
-The final command comes out as:
+On the agent's detail page you can keep adjusting:
-```bash
-claude --model <model> --max-turns 100 --append-system-prompt "always respond in Chinese" [...]
-```
+| Setting | What it does |
+|---|---|
+| **Concurrency limit** | How many tasks the agent can run at the same time. The default is 6; tasks beyond the cap keep queuing. |
+| **Environment variables** | Inject variables when the AI coding tool starts. |
+| **Custom arguments** | Appended item by item to the AI coding tool's CLI arguments. |
+| **MCP** | Provide MCP server configuration for AI coding tools that support it. |
+| **Integrations** | Connect external services this agent can use. |
+
+The daemon hosting the runtime also has a global concurrency cap (default 20); the effective concurrency is the smaller of the two.
+
+Editing configuration does not change tasks already running. Later tasks use the agent configuration saved at the time the runtime picks them up.
+
+## Environment variables and credentials
-Arguments are passed as-is, not through a shell (no injection risk), but whether a given flag is recognized is up to the AI coding tool itself — tools differ substantially here.
+Environment variables suit limited-privilege credentials the agent needs at run time, such as a read-only API key or a single-scope token.
-<Callout type="tip">
-`custom_env` and `custom_args` have no hard caps, but in practice **keep each under 10 entries**. Too many makes the command line long, slows startup, and gets harder to maintain.
+<Callout type="warning">
+**`custom_env` values are stored in plaintext in the Multica server database** — they are not "stays on this machine" data. Agent list and detail endpoints no longer return any env values, only an opaque count; only workspace `owner`s and `admin`s can unlock and modify values, and every read or change leaves an audit record. A running agent cannot call the admin endpoints to read another agent's variables.
</Callout>
-## Visibility
+Do not use production database admin passwords or other high-value long-lived credentials.
-- **Workspace** (`workspace`) — any member of the workspace can assign it
-- **Private** (`private`) — only workspace owners, admins, or the agent's creator can assign it
+Critical runtime variables such as `PATH`, `HOME`, and `MULTICA_*` cannot be overridden here.
-New agents default to `private`.
+## Custom arguments and MCP
-**Private does not mean hidden** — every member sees a private agent's name and description in the list, they just can't read sensitive config (env values never appear in agent list/get responses; MCP config is masked for non-owners). Full meaning in [Agents → Who can assign an agent](/agents#who-can-assign-an-agent).
+Custom arguments are passed to the AI coding tool as an array, item by item, without shell expansion. Whether an argument is valid is up to the tool; model configuration that already has a dedicated field doesn't need to be repeated here.
-## Concurrency limit
+MCP configuration may contain tokens; its storage and display rules match environment variables. Only runtimes that support managed MCP configuration show this section; tools without MCP support don't gain it just because a configuration is saved.
-**Concurrency limit** (`max_concurrent_tasks`) controls how many tasks this agent can run in parallel at once. The default is **6**. New tasks that hit the cap queue up — they aren't rejected.
+## Duplicating an agent
-This is only the "agent layer" of a two-tier limit — the daemon itself enforces a broader cap (default 20), and whichever is tighter wins. Details in [Daemon and runtimes → How many tasks can run in parallel](/daemon-runtimes#how-many-tasks-can-run-in-parallel).
+Duplicating carries over most working configuration except the name, including instructions, skills, custom arguments, avatar, concurrency limit, and Access settings. The model, thinking level, and service tier come along too; if the original runtime is unavailable and the copy is forced onto another runtime, those three are cleared and must be re-selected.
-Changing this value **does not cancel tasks already running** — it only applies to the next task about to be picked up.
+Environment variable values and MCP configuration are never copied and must be set again on the new agent. Duplication keeps the original agent's runtime binding and Access settings.
-## Attaching domain expertise: Skills
+## Creating with the CLI
-A created agent can have **Skills** attached — **knowledge packs** (`SKILL.md` + supporting files) automatically delivered to the AI coding tool at task execution time. You can create a new skill, import from GitHub or ClawHub, or scan one from an existing skill directory on your machine. See [Skills](/skills).
+```bash
+multica agent create \
+ --name "Frontend Reviewer" \
+ --runtime-id <runtime-id> \
+ --description "Reviews frontend pull requests" \
+ --instructions "Read the diff and tests first; post review conclusions only as issue comments."
+```
-## Archive and restore
+Plaintext in command-line arguments ends up in shell history; stdin and permission-restricted files do not.
-Agents you no longer use can be **archived** — they disappear from everyday views, but their historical data (tasks run, comments posted) is fully preserved. **Restore** them anytime to put them back to work.
+When a similarly configured agent already exists, copy it directly:
-<Callout type="warning">
-**Archiving immediately cancels every unfinished task belonging to the agent** — running, dispatched, and queued tasks are all marked `cancelled` and won't continue. If you have an important task in flight, let it finish before archiving.
-</Callout>
+```bash
+multica agent copy <agent-id>
+```
-Archived agents can't be assigned new tasks.
+By default the copy stays on the same runtime; add `--runtime-id` to move it to another runtime, which also requires `--model`. Environment variables, MCP configuration, and `runtime_config` are never copied; the runtime binding itself is kept. Full flags in [Using the CLI](/cli).
## Next steps
-- [Skills](/skills) — attach knowledge packs to an agent
-- [AI coding tools comparison](/providers) — full capability matrix across all 16 tools
-- [Assigning issues to agents](/assigning-issues) — put your new agent to work
+- [Assign issues to agents](/assigning-issues) — validate the configuration with real work.
+- [Skills](/skills) — create, import, and reuse team methods.
+- [Daemon and runtimes](/daemon-runtimes) — troubleshoot online status and where execution happens.
diff --git a/apps/docs/content/docs/agents-create.zh.mdx b/apps/docs/content/docs/agents-create.zh.mdx
index 0a1fcf0de2..874c7c1c64 100644
--- a/apps/docs/content/docs/agents-create.zh.mdx
+++ b/apps/docs/content/docs/agents-create.zh.mdx
@@ -1,127 +1,154 @@
---
title: 创建和配置智能体
-description: 创建一个智能体的最小字段,以及所有可选配置项——系统指令、环境变量、可见性、并发上限,和归档机制。
+description: 选择起点,定义智能体的职责、能力、运行方式和 Access。
---
import { Callout } from "fumadocs-ui/components/callout";
-创建一个 [智能体](/agents) 只要两件事:**名字** 和 **选一款 [AI 编程工具](/providers)**。其他全部可选——系统指令、模型、环境变量、命令行参数、可见性、并发上限——默认值都能用,先跑起来再慢慢调,所有字段随时能改。
+创建智能体前,需要先有一个可用的[运行时](/daemon-runtimes)。运行时决定这名智能体使用哪台电脑和哪款 AI 编程工具;智能体则保存它长期使用的身份、指令和能力。
-## 创建一个智能体
+在工作区的 **智能体** 页面点 **新建智能体**。
-前置条件:你本机已经装好至少一款受支持的 [AI 编程工具](/providers)(Claude Code、Codex 等),并跑着 [守护进程](/daemon-runtimes)。如果还没走到这一步,先看 [Cloud 快速开始](/cloud-quickstart) 或 [自部署快速开始](/self-host-quickstart)。
+## 选择起点
-满足之后,在工作区的**智能体**页点 **+ 新建**,或者用命令行:
+创建页面提供两种方式:
-```bash
-multica agent create
-```
+| 方式 | 适合什么情况 |
+|---|---|
+| **从空白开始** | 已经知道智能体的职责,想自己填写每项配置。 |
+| **通过 AI 创建** | 先描述目标,让 Agent Builder 追问关键信息并生成草稿。 |
-表单里只有两项必填:**名字**(工作区内唯一)和 **运行时**(= 选一款 AI 编程工具)。其他字段下面一节一节讲。
+通过 AI 创建需要一个在线运行时来完成 Builder 对话。无论选择哪种方式,创建前都可以检查并修改最终配置。
-## 选一款 AI 编程工具
+![创建智能体的起点选择页:Start blank 与 Build with AI](/images/docs/quickstart-new-agent.png)
-运行时背后是一款具体的 AI 编程工具。Multica 支持 16 款,最常用的几款:
+## 必填项
-| 工具 | 适合 |
-|---|---|
-| **Claude Code** | Anthropic 官方,功能最完整;**新手首选** |
-| **Codex** | OpenAI,主流替代 |
-| **Cursor** | Cursor 编辑器生态用户 |
-| **Copilot** | 用 GitHub 账号权益的团队 |
-| **CodeBuddy** | 使用 Tencent Claude Code 兼容 CLI 的团队 |
+创建智能体只要求两项:
+
+- **名称**:在当前工作区中必须唯一。
+- **运行时**:选择实际执行任务的环境。
+
+其他字段可以先使用默认值,创建后再调整。新智能体默认只有创建者可以运行。
+
+## 描述与指令
+
+**描述**是写给团队看的简短介绍,只显示在智能体列表和详情中,不会进入 AI 编程工具的提示。
-另外 9 款(Antigravity、Hermes、Kimi、Kiro CLI、OpenCode、Pi、OpenClaw、Qoder、Trae CLI)以及每款工具的完整能力差别(会话恢复、MCP、skill 注入路径、模型选择)见 [AI 编程工具对照](/providers)。
+**指令**会在每次执行时提供给智能体,通常包含:
-## 写系统指令
+- 它负责什么、不负责什么;
+- 收到工作后先检查什么;
+- 允许修改哪些内容;
+- 结果的提交方式;
+- 什么时候需要向成员确认。
-**系统指令**(`instructions`)会被拼在每次任务最前面,告诉这个智能体它扮演什么角色、遵守什么规则:
+例如:
```text
-你是一个前端代码审查智能体。拿到 issue 先读 diff,只关注:
-- 样式问题(tailwind 类名、盒模型)
-- 可访问性(a11y)
-不改代码,只在评论里给建议。
+你负责审查前端 Pull Request。
+
+先阅读改动和相关测试,只检查:
+- React 与 TypeScript 的正确性
+- 可访问性
+- 与现有组件模式是否一致
+
+不要直接修改代码。把问题按严重程度写在 issue 评论中;
+没有阻塞问题时,明确说明可以合并。
```
-留空时(默认),智能体用它背后 AI 编程工具的原生行为,没有额外约束。
+## 添加 skill
-## 选模型
+创建时可以从工作区选择一个或多个 [skill](/skills)。
-大多数 AI 编程工具支持选模型(例如 Claude Code 能在 Sonnet / Opus 里选)。留空 → 用工具自己的默认;明确选了 → 用选的。每款工具支持的模型见 [AI 编程工具对照](/providers)。
+Skill 适合保存可以跨智能体复用的方法和资料;只属于这名智能体的长期要求写在指令中。
-改模型**只对新任务生效**。已经派发出去的任务继续用派发时固化下来的模型。
+## 选择运行时、模型和思考强度
-## 自定义环境变量(custom_env)
+运行时已经对应一款 AI 编程工具。选择运行时后,可以继续选择该工具支持的模型和思考强度;部分工具(如 Codex)还可选择速度档:
-**自定义环境变量**(`custom_env`)让你在任务执行时注入额外的 env var——典型用途是 API key 或切换上游 endpoint:
+- 留空时,使用运行时或本地 CLI 的默认配置。
+- 设置模型后,该智能体之后领取任务时会使用这个覆盖值。
+- 某些运行时自行管理模型,因此不会显示模型选择。
-```
-ANTHROPIC_API_KEY = sk-...
-ANTHROPIC_BASE_URL = https://my-proxy.example.com
-```
+不同工具支持的模型、会话恢复、skill 和 MCP 能力不同,见[AI 编程工具对照](/providers)。
-系统关键变量不能被覆盖:`PATH`、`HOME`、`USER`、`SHELL`、`TERM`、`CODEX_HOME`,以及任何 `MULTICA_*` 开头的 key 都会被守护进程静默忽略(日志里有 warn,不会报错)。
+## 设置 Access
-<Callout type="warning">
-**`custom_env` 的值在 Multica 服务器的数据库里是明文存储的。** agent list/get 接口不再返回任何 env 值——只返回键的数量。读取真实值需要该智能体自己的 owner、或 workspace owner / admin 调用专用且会审计的 `GET /api/agents/{id}/env`(CLI: `multica agent env get <id>`)。正在执行任务的智能体即便宿主是 owner,也无法借此读取其它智能体的 env,哪怕那个智能体属于同一个人——这个接口拒绝 agent-actor 会话。数据库备份、DB 审计里仍然能看到真实值。
+Access 决定哪些成员可以运行这名智能体(分配、@提及或对话):
-**不要把高价值 secret 放进 `custom_env`**(生产数据库密码、root 级 token 等)。给智能体用**独立的、有限权限的凭证**(只读 API key、单 scope 的 PAT),定期轮换。
-</Callout>
+| Access | 含义 |
+|---|---|
+| **仅自己**(Only me) | 只有你可以运行。默认选项。 |
+| **整个工作区**(Entire workspace) | 所有工作区成员都可以运行。 |
+| **指定成员**(Specific people) | 只有你和选中的成员可以运行。 |
-## 自定义命令行参数(custom_args)
+![Access 设置:仅自己、整个工作区、指定成员三档](/images/docs/agent-access-settings.png)
-**自定义命令行参数**(`custom_args`)是一串字符串数组,会被逐个追加到 AI 编程工具的命令行尾部:
+只有智能体 owner 可以修改 Access,工作区管理员也不行。工作区 `owner` 和 `admin` 可以管理其他配置,但不能借管理员身份运行未授权的智能体。
-```json
-["--max-turns", "100", "--append-system-prompt", "always respond in Chinese"]
-```
+## 创建后的配置项
-拼完会是:
+打开智能体详情页,可以继续调整:
-```bash
-claude --model <model> --max-turns 100 --append-system-prompt "always respond in Chinese" [...]
-```
+| 配置 | 作用 |
+|---|---|
+| **并发上限** | 同一名智能体最多同时执行多少条任务,默认是 6;达到上限后继续排队。 |
+| **环境变量** | 在 AI 编程工具启动时注入变量。 |
+| **自定义参数** | 逐项追加到 AI 编程工具的 CLI 参数中。 |
+| **MCP** | 为支持的 AI 编程工具提供 MCP server 配置。 |
+| **集成** | 连接这名智能体可以使用的外部服务。 |
+
+运行时所在的守护进程还有一个全局并发上限(默认 20),实际并发取两者中的较小值。
+
+修改配置不会改变已经运行中的执行任务。后续任务被运行时领取时,会使用当时保存的智能体配置。
+
+## 环境变量与凭据
-参数按原样传,不走 shell 解析(没有注入风险),但传什么 flag 能不能被识别看 AI 编程工具本身——不同工具差异很大。
+环境变量适合放这名智能体执行时需要的有限权限凭据,例如只读 API key 或单一 scope 的 token。
-<Callout type="tip">
-`custom_env` 和 `custom_args` 没有硬限制,但**实际使用建议控制在 10 条以内**。太多会让命令行变长、启动变慢,也更难维护。
+<Callout type="warning">
+**`custom_env` 的值在 Multica 服务器的数据库里是明文存储的**,不属于"只留在本机"的数据。agent list/get 接口不再返回任何 env 值,只返回键的数量;只有工作区 `owner`、`admin` 可以解锁和修改,并且每次读取或修改都会留下审计记录。运行中的智能体不能调用管理接口读取其他智能体的变量。
</Callout>
-## 可见性
+不要使用生产数据库的管理员密码或其他高价值长期凭据。
-- **工作区可见**(`workspace`)—— 工作区里任何成员都能分配
-- **私有**(`private`)—— 只有工作区的 owner、admin,或智能体的创建者能分配
+`PATH`、`HOME` 和 `MULTICA_*` 等运行环境关键变量不能通过这里覆盖。
-新建默认 `private`。
+## 自定义参数和 MCP
-**私有不等于隐藏**——列表里所有成员都能看到私有智能体的名字和描述,只是看不到敏感配置(env 值从不会出现在 agent list/get 响应里;MCP 配置对非 owner 会被打码)。完整含义见 [智能体 → 谁能把智能体分配出去](/agents#谁能把智能体分配出去)。
+自定义参数按数组逐项传给 AI 编程工具,不经过 shell 展开。参数名称是否有效由对应工具决定;已有独立字段的模型配置不需要在这里重复设置。
-## 并发上限
+MCP 配置可能包含 token,保存与展示规则和环境变量相同。只有支持托管 MCP 配置的运行时会显示这一项;不支持的工具不会因为保存了配置就自动获得 MCP 能力。
-**并发上限**(`max_concurrent_tasks`)决定这个智能体同一时间最多同时跑几个任务,默认 **6**。达到上限的新任务留在队列排队,不会被拒绝。
+## 复制智能体
-这只是两层限额里的"智能体层"——守护进程本身还有一层更粗的限额(默认 20),两层中更紧的那层生效。详见 [守护进程与运行时 → 一次能并发跑多少任务](/daemon-runtimes#一次能并发跑多少任务)。
+复制会带上名称之外的大部分工作配置,包括指令、skill、自定义参数、头像、并发上限和 Access 设置。模型、思考强度和速度档也会一并带走;如果原运行时不可用、复制被迫换到其他运行时,这三项会清空,需要重新选择。
-修改这个值**不会取消已经在跑的任务**——只对下一个要被领走的任务生效。
+环境变量的值和 MCP 配置在任何情况下都不会复制,需要在新智能体中重新设置。复制会保留原智能体的运行时绑定和 Access 设置。
-## 挂专业知识:Skill
+## 使用 CLI 创建
-创建好的智能体可以挂 **Skill**——一种**专业知识包**(`SKILL.md` + 支持文件),任务执行时自动送到对应的 AI 编程工具。可以新建、从 GitHub / ClawHub 导入、或从你本机已有的 skill 目录扫入。详见 [Skills](/skills)。
+```bash
+multica agent create \
+ --name "Frontend Reviewer" \
+ --runtime-id <runtime-id> \
+ --description "审查前端 Pull Request" \
+ --instructions "先阅读改动和测试,只在 issue 评论中提交审查结论。"
+```
-## 归档和恢复
+命令行参数中的明文会进入 shell 历史;stdin 和权限受限的文件不会。
-不再用的智能体可以**归档**——它从日常视图里消失,但历史数据(跑过的任务、发过的评论)全部保留。想重新用时**恢复**即可。
+已有配置相近的智能体时,可以直接复制:
-<Callout type="warning">
-**归档会立刻取消这个智能体所有未结束的任务**——正在跑的、已派发的、还在排队的都会被标为 `cancelled`,不会继续执行。如果有重要任务在跑,先让它完成再归档。
-</Callout>
+```bash
+multica agent copy <agent-id>
+```
-已归档的智能体无法被分配新任务。
+默认复制到同一运行时;加 `--runtime-id` 换到其他运行时,必须同时指定 `--model`。环境变量、MCP 配置和 `runtime_config` 永不复制;运行时绑定本身会保留。完整参数见[使用 CLI](/cli)。
-## 下一步
+## 接下来
-- [Skills](/skills) —— 给智能体挂专业知识包
-- [AI 编程工具对照](/providers) —— 16 款工具的完整能力差别
-- [把 issue 分配给智能体](/assigning-issues) —— 创建完之后怎么用起来
+- [分配 issue 给智能体](/assigning-issues) — 用真实工作验证配置。
+- [Skills](/skills) — 创建、导入和复用团队方法。
+- [守护进程与运行时](/daemon-runtimes) — 排查在线状态和执行位置。
diff --git a/apps/docs/content/docs/agents.ja.mdx b/apps/docs/content/docs/agents.ja.mdx
index 1a07eb7d43..61178a6ced 100644
--- a/apps/docs/content/docs/agents.ja.mdx
+++ b/apps/docs/content/docs/agents.ja.mdx
@@ -1,49 +1,90 @@
---
title: エージェント
-description: "エージェントは Multica ワークスペースの一級メンバーです — イシューを割り当てられ、コメントを投稿し、@ でメンションされることができます。人間との核心的な違いは、エージェントは自分から作業を始め、通知を受け取らない点です。"
+description: エージェントは、ワークスペースで繰り返し使えるアイデンティティ・能力・実行設定のひとまとまりです。
---
import { Callout } from "fumadocs-ui/components/callout";
-エージェントは Multica [ワークスペース](/workspaces)の **一級メンバー** です — 人間と同じように、[イシューを割り当てられ](/assigning-issues)、[コメント](/comments)で発言し、[`@` でメンションされ](/mentioning-agents)、[プロジェクト](/projects)をリードできます。核心的な違いはこれです。すべてのエージェントの背後には、あなたのマシンで動作する [AI コーディングツール](/providers)があります。エージェントにタスクを割り当てると、特に促さなくても **数秒以内に自分から作業を始めます** — 急かす必要も、オフラインになることもなく、24時間いつでも利用できます。
+エージェントは [Multica ワークスペース](/workspaces)におけるコラボレーターです。イシューを割り当てる、コメントで @メンションする、直接チャットする、といった関わり方ができます。エージェントは紐づいたランタイムを通じて AI コーディングツールを動かし、進捗と結果をワークスペースに書き戻します。
-## エージェントができること
+エージェント自体は常時稼働するプロセスではありません。繰り返し使えるアイデンティティと設定のまとまりであり、仕事を受け取ったときにだけ具体的な[タスク](/tasks)が生まれます。
-エージェントは人間と同じ「メンバー」の表面を使っており、UI ではほとんど区別されません。
+## エージェントの設定項目
-- **[イシューを割り当てられる](/assigning-issues)** — 担当者に設定された瞬間、自動的に作業を始めます
-- **[`@` でメンションされる](/mentioning-agents)** — コメントに `@agent-name` と書くと、目覚めてそのコメントを読みます
-- **[コメント](/comments)を投稿する** — イシューの下で進捗を報告し、人々に返信します
-- **[プロジェクト](/projects)をリードする** — 人間と同じように、プロジェクトリードに設定できます
-- **自分で[イシュー](/issues)を開く** — タスクを実行している間に関連する問題を見つけると、直接新しいイシューを作成できます
+| 設定 | 役割 |
+|---|---|
+| **名前・アバター・説明** | それが誰で、何に向いているかをチームに伝えます。説明は表示専用で、実行プロンプトには入りません。 |
+| **指示** | 職責、仕事の進め方、境界、成果物の要件を定めます。毎回の実行で使われます。 |
+| **スキル** | 再利用できる手法、参考資料、補助ファイルを提供します。 |
+| **ランタイム・モデル・思考レベル** | どのランタイムで、どの AI コーディングツールとモデルで実行するかを決めます。一部のツール(Codex など)ではサービスティアも選べます。 |
+| **Access** | どのメンバーが実行できるかを決めます。 |
+| **実行設定** | 同時実行上限、環境変数、CLI 引数、MCP、外部インテグレーションを含みます。 |
-協業ビューから見ると、エージェントはただのワークスペースのメンバーです — 人間と同じメンバー一覧に名前が並び、通常はその前に小さなロボットアイコンが付きます。
+モデルの変更や指示の修正で新しいエージェントが作られることはなく、過去のイシュー、コメント、タスク履歴も失われません。
-## 人間との違い
+## エージェント・ランタイム・タスク
-いくつかの重要な違いは、実際にエージェントを使い始めて初めて見えてきます。
+| 概念 | 役割 |
+|---|---|
+| **エージェント** | 誰が、どのように仕事をするかを決める |
+| **ランタイム** | どのコンピュータで、どの AI コーディングツールで実行するかを決める |
+| **タスク** | 1 回の実行の過程と結果を記録する |
-- **自分から始めます** — イシューを割り当てたり `@` でメンションしたりすると、Multica が即座にそのタスクをエージェントのランタイムにディスパッチします。人間のようにメッセージを見て応答するまで待つことはありません。トリガーの詳細については、[エージェントにイシューを割り当てる](/assigning-issues)と[コメントでエージェントを @ メンションする](/mentioning-agents)を参照してください。
-- **通知を受け取りません** — エージェントはあなたの[インボックス](/inbox)の向こう側に現れることは決してなく、`@all` の受信対象にも含まれません。エージェントは「メッセージを読む受信者」ではなく「タスクを実行するためにトリガーされる作業の単位」です。
-- **1つの AI コーディングツールに紐づいています** — すべてのエージェントはランタイムに紐づいています(ランタイム = デーモン × 1つの AI コーディングツール。[デーモンとランタイム](/daemon-runtimes)を参照)。ツールがオフラインだとエージェントは作業できず、新しいタスクはランタイムが戻るまで待機します。
-- **アーカイブできます** — もう使わないエージェントをアーカイブすると日常的なビューから消えます。いつでも好きなときに復元できます。アーカイブすると、現在実行中のタスクはすべてキャンセルされます。
+1 つのランタイムは複数のエージェントを載せられ、1 つのエージェントは時間をかけて多くのタスクをこなせます。ランタイムがオフラインでも、エージェントのアイデンティティと履歴は残ります。ただし新しいタスクは、ランタイムが復帰するまで待機します。
-## 誰がエージェントを割り当てられるか
+## 作業への参加方法
-エージェントを作成するとき、誰がそのエージェントをイシューに割り当てたりプロジェクトリードに設定したりできるかを制御する **可視性(visibility)** を選択します。
+- **イシューを担当する** — エージェントを担当者に設定すると、タスクがキューに入り次第処理を始めます。
+- **コメントを処理する** — コメントでエージェントを @メンションします。イシューの担当者は変わりません。
+- **議論を続ける** — エージェントのコメントに返信すると、新しい情報が以降の実行に反映されます。
+- **直接チャットする** — イシューに紐づかない会話を始めます。
+- **プロジェクトやスクワッドに参加する** — エージェントは、プロジェクトリードにも、スクワッドのリーダーやメンバーにもなれます。
+- **オートパイロットで実行する** — スケジュールや外部イベントで所定の作業をトリガーします。手動でも実行できます。
-- **Workspace** — ワークスペースの任意のメンバーが割り当てられます
-- **Private** — ワークスペースの owner、admin、またはエージェントの作成者だけが割り当てられます
+エージェントはイシューの作成、コメントの投稿、作業ステータスの変更ができますが、インボックスを持たず、`@all` も受け取りません。エージェントへの @メンションは実行のトリガーであり、通知ではありません。
-新しいエージェントはデフォルトで **private** です。ワークスペース全体で利用できるようにするには、作成時に可視性を `workspace` に設定するか、後でエージェントの設定で変更してください。役割と権限の完全なマトリクスについては、[メンバーと役割](/members-roles)を参照してください。
+## 権限と Access
+
+すべてのエージェントには 1 人の owner と Access 設定があります。
+
+| Access | 実行できる人 |
+|---|---|
+| **Only me** | エージェントの owner だけ。 |
+| **Entire workspace** | ワークスペースのすべてのメンバー。 |
+| **Specific people** | エージェントの owner と指定したメンバー。 |
+
+新しいエージェントのデフォルトは **Only me** です。
<Callout type="info">
-**private は「誰が割り当てられるかを制限する」という意味であって、「他の全員から隠す」という意味ではありません。** ワークスペースのすべてのメンバーは、エージェント一覧で private エージェントの名前と説明を見ることができます — 見えないのは設定の詳細だけです(カスタム環境変数、MCP 設定、その他の機密フィールドはマスクされます)。「1人だけに見える」ようにしたい場合、現時点では実現できません。
+ワークスペースの `owner` と `admin` はすべてのエージェントを見て管理できますが、Access をバイパスして他人の「Only me」エージェントを実行することはできません。一般メンバーには、自分が所有するか実行を許可されたエージェントだけが表示されます。
+</Callout>
+
+**見える**かどうかは、owner であるか、ワークスペースの管理ロール、Access の 3 つで決まります。**変更**はエージェントの owner とワークスペースの `owner` / `admin` に開かれていますが、Access だけはエージェントの owner しか変更できません。
+
+環境変数や MCP など、認証情報を含みうる設定にはより厳しい読み取りルールがあります。[エージェントの作成と構成](/agents-create#環境変数と認証情報)を参照してください。
+
+## オンライン・オフラインと作業状態
+
+エージェント一覧には、2 種類のステータスが並んで表示されます。
+
+- **可用性**はランタイム由来です — オンライン、オフライン、不安定など。
+- **作業負荷**はタスク由来です — 処理中、キュー待ち、アイドルなど。
+
+「オフライン」は、エージェントが削除されたという意味ではありません。すでにキューに入ったタスクはランタイムの復帰を待ちます。新しい仕事を受け取れなくなるのは「アーカイブ済み」だけです。
+
+## アーカイブと復元
+
+使わなくなったエージェントはアーカイブできます。アーカイブすると、ピッカーに表示されなくなり、割り当ても @メンションもできなくなります。履歴は保持され、後から復元できます。
+
+<Callout type="warning">
+アーカイブすると、そのエージェントの未完了タスクは、キュー待ちと実行中を含めてすべてキャンセルされます。
</Callout>
+エージェントの owner と、ワークスペースの `owner`・`admin` がエージェントをアーカイブ・復元できます。
+
## 次のステップ
-- [エージェントの作成と構成](/agents-create) — エージェントを作る方法
-- [スキル](/skills) — エージェントに知識パックを添付する
-- [スクワッド](/squads) — 適切なエージェントが適切なイシューを担当するよう、リーダーの下にエージェントをグループ化する
-- [デーモンとランタイム](/daemon-runtimes) — エージェントが実際に動作するために必要なもの
+- [エージェントの作成と構成](/agents-create) — 空白から作るか、AI で組み立てる。
+- [スキル](/skills) — 再利用できる手法と資料をエージェントに追加する。
+- [スクワッド](/squads) — リーダーに仕事に合ったメンバーを選ばせる。
+- [デーモンとランタイム](/daemon-runtimes) — エージェントが実際に実行される場所。
diff --git a/apps/docs/content/docs/agents.ko.mdx b/apps/docs/content/docs/agents.ko.mdx
index ee03e55a43..d436f8d696 100644
--- a/apps/docs/content/docs/agents.ko.mdx
+++ b/apps/docs/content/docs/agents.ko.mdx
@@ -1,49 +1,90 @@
---
title: 에이전트
-description: "에이전트는 Multica 워크스페이스의 일급 멤버입니다 — 이슈를 할당받고, 댓글을 달고, @로 멘션될 수 있습니다. 사람과의 핵심 차이는, 에이전트는 스스로 작업을 시작하며 알림을 받지 않는다는 점입니다."
+description: 에이전트는 워크스페이스에서 반복해서 사용하는 정체성, 기능, 실행 설정의 묶음입니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-에이전트는 Multica [워크스페이스](/workspaces)의 **일급 멤버**입니다 — 사람과 마찬가지로 [이슈를 할당받고](/assigning-issues), [댓글](/comments)에서 발언하고, [`@`로 멘션되며](/mentioning-agents), [프로젝트](/projects)를 이끌 수 있습니다. 핵심 차이는 이것입니다. 모든 에이전트 뒤에는 여러분의 기기에서 실행되는 [AI 코딩 도구](/providers)가 있습니다. 에이전트에게 작업을 할당하면 별다른 재촉 없이 **수 초 내에 스스로 작업을 시작**합니다 — 닦달할 필요도, 오프라인이 되지도 않으며, 24시간 내내 가용합니다.
+에이전트는 [Multica 워크스페이스](/workspaces)의 협업자입니다. 이슈를 할당하거나 댓글에서 @멘션하거나 직접 대화할 수 있습니다. 에이전트는 연결된 런타임을 통해 AI 코딩 도구를 호출하고 진행 상황과 결과를 워크스페이스에 기록합니다.
-## 에이전트가 할 수 있는 일
+에이전트 자체는 계속 실행되는 프로세스가 아닙니다. 반복해서 사용할 수 있는 정체성과 설정의 묶음이며, 작업을 받을 때만 구체적인 [실행 태스크](/tasks)가 생성됩니다.
-에이전트는 사람과 동일한 "멤버" 표면을 사용하며, UI에서는 거의 구분되지 않습니다.
+## 에이전트 설정
-- **[이슈를 할당받기](/assigning-issues)** — 담당자로 지정되는 순간 자동으로 작업을 시작합니다
-- **[`@`로 멘션되기](/mentioning-agents)** — 댓글에 `@agent-name`을 쓰면 깨어나 해당 댓글을 읽습니다
-- **[댓글](/comments) 작성** — 이슈 아래에서 진행 상황을 보고하고 사람들에게 답글을 답니다
-- **[프로젝트](/projects) 이끌기** — 사람과 마찬가지로 프로젝트 리더로 지정될 수 있습니다
-- **스스로 [이슈](/issues) 열기** — 작업을 실행하는 동안 관련 문제를 발견하면 직접 새 이슈를 생성할 수 있습니다
+| 설정 | 역할 |
+|---|---|
+| **이름, 아바타, 설명** | 팀에 에이전트가 누구이며 어떤 작업에 적합한지 알려 줍니다. 설명은 표시용이며 실행 프롬프트에 포함되지 않습니다. |
+| **지시문** | 역할, 작업 방식, 경계, 결과물 요구 사항을 규정합니다. 모든 실행에서 사용됩니다. |
+| **스킬** | 재사용 가능한 방법, 참고 자료, 지원 파일을 제공합니다. |
+| **런타임, 모델, 사고 강도** | 어느 런타임에서 어떤 AI 코딩 도구와 모델을 사용할지 결정합니다. Codex 같은 일부 도구에서는 속도 단계도 선택할 수 있습니다. |
+| **Access** | 어떤 멤버가 에이전트를 실행할 수 있는지 결정합니다. |
+| **실행 설정** | 동시 실행 상한, 환경 변수, CLI 인수, MCP, 외부 연동을 포함합니다. |
-협업 뷰에서 보면 에이전트는 그저 워크스페이스의 한 멤버일 뿐입니다 — 사람과 같은 멤버 목록에 이름이 자리하며, 보통 앞에 작은 로봇 아이콘이 붙습니다.
+모델을 바꾸거나 지시문을 수정해도 새 에이전트가 만들어지지 않으며 이전 이슈, 댓글, 실행 기록도 사라지지 않습니다.
-## 사람과 다른 점
+## 에이전트, 런타임, 실행 태스크
-몇 가지 핵심 차이는 실제로 에이전트를 사용하기 시작해야 비로소 드러납니다.
+| 개념 | 역할 |
+|---|---|
+| **에이전트** | 누가 어떤 방식으로 작업할지 결정 |
+| **런타임** | 어느 컴퓨터에서 어떤 AI 코딩 도구로 실행할지 결정 |
+| **실행 태스크(task)** | 이번 실행의 과정과 결과를 기록 |
-- **스스로 시작합니다** — 이슈를 할당하거나 `@`로 멘션하면 Multica가 즉시 해당 작업을 에이전트의 런타임에 디스패치합니다. 사람처럼 메시지를 보고 응답할 때까지 기다리지 않습니다. 트리거에 대한 자세한 내용은 [에이전트에게 이슈 할당하기](/assigning-issues)와 [댓글에서 에이전트 @-멘션하기](/mentioning-agents)를 참고하세요.
-- **알림을 받지 않습니다** — 에이전트는 여러분의 [인박스](/inbox) 건너편에 결코 나타나지 않으며, `@all`의 수신 대상에도 포함되지 않습니다. 에이전트는 "메시지를 읽는 수신자"가 아니라 "작업을 실행하도록 트리거되는 작업 단위"입니다.
-- **하나의 AI 코딩 도구에 묶여 있습니다** — 모든 에이전트는 런타임에 묶여 있습니다(런타임 = 데몬 × 하나의 AI 코딩 도구. [데몬과 런타임](/daemon-runtimes) 참고). 도구가 오프라인이면 에이전트는 작업할 수 없으며, 새 작업은 런타임이 돌아올 때까지 대기합니다.
-- **보관할 수 있습니다** — 더 이상 사용하지 않는 에이전트를 보관하면 일상적인 뷰에서 사라지며, 원하면 언제든지 복원할 수 있습니다. 보관하면 현재 실행 중인 작업은 모두 취소됩니다.
+하나의 런타임이 여러 에이전트를 지원할 수 있고, 하나의 에이전트도 여러 실행 태스크를 차례로 완료할 수 있습니다. 런타임이 오프라인이어도 에이전트의 정체성과 기록은 남아 있지만 새 태스크는 런타임이 복구될 때까지 기다려야 합니다.
-## 누가 에이전트를 할당할 수 있나
+## 작업에 참여하는 방법
-에이전트를 생성할 때, 누가 그 에이전트를 이슈에 할당하거나 프로젝트 리더로 지정할 수 있는지를 제어하는 **가시성(visibility)** 을 선택합니다.
+- **이슈 담당**: 에이전트를 담당자로 지정하면 태스크가 큐에 들어간 뒤 처리를 시작합니다.
+- **댓글 하나 처리**: 댓글에서 에이전트를 @멘션하며 이슈 담당자는 바뀌지 않습니다.
+- **논의 이어가기**: 에이전트의 댓글에 답하면 새 정보가 이후 실행에 들어갑니다.
+- **직접 대화**: 이슈에 연결되지 않은 대화를 시작합니다.
+- **프로젝트와 스쿼드 참여**: 에이전트는 프로젝트 lead가 되거나 스쿼드 리더 또는 멤버가 될 수 있습니다.
+- **오토파일럿을 통한 실행**: 일정이나 외부 이벤트로 미리 설정한 작업을 트리거하거나 수동으로 실행합니다.
-- **워크스페이스(Workspace)** — 워크스페이스의 모든 멤버가 할당할 수 있습니다
-- **비공개(Private)** — 워크스페이스의 owner, admin, 또는 에이전트 생성자만 할당할 수 있습니다
+에이전트는 이슈를 만들고, 댓글을 작성하고, 작업 상태를 변경할 수 있지만 인박스가 없으며 `@all` 알림도 받지 않습니다. 에이전트 @멘션은 알림이 아니라 실행 트리거입니다.
-새 에이전트는 기본적으로 **비공개**입니다. 전체 워크스페이스에서 사용할 수 있게 하려면, 생성 시 가시성을 `workspace`로 설정하거나 이후에 에이전트 설정에서 변경하세요. 전체 역할-권한 매트릭스는 [멤버와 역할](/members-roles)을 참고하세요.
+## 권한과 Access
+
+각 에이전트에는 owner 한 명과 Access 설정 하나가 있습니다.
+
+| Access | 실행할 수 있는 사람 |
+|---|---|
+| **나만**(Only me) | 에이전트 owner만 실행할 수 있습니다. |
+| **전체 워크스페이스**(Entire workspace) | 워크스페이스의 모든 멤버가 실행할 수 있습니다. |
+| **지정한 멤버**(Specific people) | 에이전트 owner와 지정된 멤버가 실행할 수 있습니다. |
+
+새 에이전트의 기본값은 **나만**입니다.
<Callout type="info">
-**비공개는 "누가 할당할 수 있는지를 제한"한다는 뜻이지, "다른 모든 사람에게 숨긴다"는 뜻이 아닙니다.** 워크스페이스의 모든 멤버는 에이전트 목록에서 비공개 에이전트의 이름과 설명을 볼 수 있습니다 — 단지 설정 세부 정보는 볼 수 없을 뿐입니다(사용자 정의 환경 변수, MCP 설정 및 기타 민감한 필드는 마스킹됩니다). "단 한 사람에게만 보이게" 하고 싶다면, 현재로서는 불가능합니다.
+워크스페이스 `owner`와 `admin`은 모든 에이전트를 보고 관리할 수 있지만 다른 사람의 "나만" 에이전트를 Access를 우회해 실행할 수는 없습니다. 일반 멤버에게는 자신이 소유하거나 실행할 권한이 있는 에이전트만 표시됩니다.
+</Callout>
+
+**보기 권한**은 owner 여부, 워크스페이스 관리 역할, Access가 함께 결정합니다. **수정 권한**은 에이전트 owner와 워크스페이스 owner/admin에게 있으며, 이 중 Access는 에이전트 owner만 바꿀 수 있습니다.
+
+환경 변수와 MCP처럼 자격 증명이 포함될 수 있는 설정에는 더 엄격한 읽기 규칙이 적용됩니다. [에이전트 생성 및 설정](/agents-create#환경-변수와-자격-증명)을 참고하세요.
+
+## 온라인, 오프라인, 작업 상태
+
+에이전트 목록에는 두 종류의 상태가 함께 표시됩니다.
+
+- **가용성**은 런타임에서 오며 온라인, 오프라인, 불안정 등이 있습니다.
+- **작업량**은 실행 태스크에서 오며 처리 중, 대기 중, 유휴 등이 있습니다.
+
+"오프라인"은 에이전트가 삭제되었다는 뜻이 아닙니다. 이미 큐에 들어간 태스크는 런타임이 복구될 때까지 기다립니다. "보관됨" 상태에서만 새 작업을 받을 수 없습니다.
+
+## 보관 및 복원
+
+더 이상 사용하지 않는 에이전트는 보관할 수 있습니다. 보관 후에는 선택기에 표시되지 않고 할당하거나 @멘션할 수도 없습니다. 이전 기록은 유지되며 나중에 복원할 수 있습니다.
+
+<Callout type="warning">
+보관하면 큐 대기 중이거나 실행 중인 태스크를 포함해 해당 에이전트의 끝나지 않은 모든 실행 태스크가 취소됩니다.
</Callout>
+에이전트 owner와 워크스페이스 `owner`, `admin`은 모두 에이전트를 보관하거나 복원할 수 있습니다.
+
## 다음 단계
-- [에이전트 생성 및 구성](/agents-create) — 에이전트를 만드는 방법
-- [스킬](/skills) — 에이전트에 지식 팩 연결하기
-- [스쿼드](/squads) — 적합한 에이전트가 적합한 이슈를 맡도록 리더 아래 에이전트를 그룹으로 묶기
-- [데몬과 런타임](/daemon-runtimes) — 에이전트가 실제로 실행되기 위해 필요한 것
+- [에이전트 생성 및 설정](/agents-create) — 빈 상태에서 시작하거나 AI를 사용해 만듭니다.
+- [스킬](/skills) — 에이전트에 재사용 가능한 방법과 자료를 추가합니다.
+- [스쿼드](/squads) — 리더가 태스크에 맞는 멤버를 선택하게 합니다.
+- [데몬과 런타임](/daemon-runtimes) — 에이전트가 실제로 어디에서 실행되는지 알아봅니다.
diff --git a/apps/docs/content/docs/agents.mdx b/apps/docs/content/docs/agents.mdx
index 525003d5fc..7c4cdd7963 100644
--- a/apps/docs/content/docs/agents.mdx
+++ b/apps/docs/content/docs/agents.mdx
@@ -1,49 +1,90 @@
---
title: Agents
-description: "An agent is a first-class member of a Multica workspace — it can be assigned issues, post comments, and be @-mentioned. The core difference from a human: it starts working on its own, and it doesn't receive notifications."
+description: An agent is a reusable set of identity, capabilities, and execution configuration in a workspace.
---
import { Callout } from "fumadocs-ui/components/callout";
-An agent is a **first-class member** of a Multica [workspace](/workspaces) — like a human, it can be [assigned issues](/assigning-issues), speak up in [comments](/comments), be [`@`-mentioned](/mentioning-agents), and lead a [project](/projects). The core difference: behind every agent is an [AI coding tool](/providers) running on your machine. Assign it a task and it **starts working within seconds** on its own — no nudging, no going offline, available 24/7.
+An agent is a collaborator in a [Multica workspace](/workspaces). You can assign issues to it, @-mention it in comments, or chat with it directly. It drives an AI coding tool through its bound runtime and writes progress and results back to the workspace.
-## What an agent can do
+An agent is not a continuously running process. It is a reusable identity and configuration; it only produces concrete [tasks](/tasks) when work arrives.
-Agents use the same "member" surface as humans, and the UI barely distinguishes them:
+## Agent configuration
-- **[Be assigned issues](/assigning-issues)** — once set as the assignee, it starts working automatically
-- **[Be `@`-mentioned](/mentioning-agents)** — write `@agent-name` in a comment and it wakes up to read that comment
-- **Post [comments](/comments)** — it reports progress and replies to people under the issue
-- **Lead a [project](/projects)** — it can be set as project lead, same as a human
-- **Open [issues](/issues) itself** — while running a task, if it spots a related problem, it can create a new issue directly
+| Setting | What it does |
+|---|---|
+| **Name, avatar, and description** | Tell the team who the agent is and what it is good at. The description is display-only and never enters the execution prompt. |
+| **Instructions** | Define its responsibilities, working style, boundaries, and delivery requirements. Used on every run. |
+| **Skills** | Provide reusable methods, reference material, and supporting files. |
+| **Runtime, model, and thinking level** | Decide which runtime, AI coding tool, and model it runs on; some tools (such as Codex) also offer a service tier. |
+| **Access** | Decides which members can run it. |
+| **Execution settings** | Include the concurrency limit, environment variables, CLI arguments, MCP, and external integrations. |
-From the collaboration view, an agent is just a member of the workspace — its name sits in the same member list as humans, usually with a small robot icon in front.
+Switching models or editing instructions does not create a new agent, and past issues, comments, and task history are not lost.
-## How it differs from a human
+## Agents, runtimes, and tasks
-A few key differences only surface once you actually start using agents:
+| Concept | Responsibility |
+|---|---|
+| **Agent** | Decides who does the work and how |
+| **Runtime** | Decides which computer and which AI coding tool executes it |
+| **Task** | Records the process and result of one run |
-- **It starts on its own** — after you assign it an issue or `@` it, Multica dispatches the task to its runtime immediately. Unlike a human, it doesn't wait to see the message and respond. For trigger details, see [Assigning issues to agents](/assigning-issues) and [@-mentioning agents in comments](/mentioning-agents).
-- **It doesn't receive notifications** — an agent never shows up on the other side of your [inbox](/inbox), and it's not in the audience for `@all`. It isn't a "recipient who reads messages" — it's a "work unit that gets triggered to execute tasks."
-- **It's bound to one AI coding tool** — every agent is tied to a runtime (runtime = daemon × one AI coding tool; see [Daemon and runtimes](/daemon-runtimes)). If the tool is offline, the agent can't work; new tasks wait until the runtime comes back.
-- **It can be archived** — archive an agent you don't use anymore and it disappears from everyday views; restore it whenever you want. Archiving cancels any tasks currently running.
+One runtime can host multiple agents, and one agent can complete many tasks over time. When the runtime is offline, the agent's identity and history remain, but new tasks wait until the runtime comes back.
-## Who can assign an agent
+## Ways an agent participates
-When you create an agent, you pick a **visibility** that controls who can assign it to an issue or set it as project lead:
+- **Own an issue** — set the agent as the assignee; it starts once the task is enqueued.
+- **Handle a comment** — @-mention the agent in a comment without changing the issue's assignee.
+- **Continue a discussion** — reply to the agent's comment; the new information feeds into subsequent runs.
+- **Chat directly** — start a conversation that isn't attached to an issue.
+- **Join projects and squads** — an agent can be a project lead, a squad leader, or a squad member.
+- **Run through automations** — trigger preset work on a schedule or from external events, or run it manually.
-- **Workspace** — any member of the workspace can assign it
-- **Private** — only workspace owners, admins, or the agent's creator can assign it
+Agents can create issues, post comments, and change work status, but they have no inbox and don't receive `@all`. An @-mention of an agent is an execution trigger, not a notification.
-New agents default to **private**. To make one available to the whole workspace, set visibility to `workspace` at creation time, or change it later in the agent's config. For the full role-permission matrix, see [Members and roles](/members-roles).
+## Permissions and Access
+
+Every agent has one owner and an Access setting:
+
+| Access | Who can run it |
+|---|---|
+| **Only me** | Only the agent owner. |
+| **Entire workspace** | Every member of the workspace. |
+| **Specific people** | The agent owner and the selected members. |
+
+New agents default to **Only me**.
<Callout type="info">
-**Private means "restricted who can assign," not "hidden from everyone else."** Every member of the workspace sees a private agent's name and description in the agents list — they just can't see its config details (custom environment variables, MCP config, and other sensitive fields are masked). If you need "visible to only one person," that's not currently possible.
+Workspace `owner`s and `admin`s can see and manage every agent, but cannot bypass Access to run someone else's "Only me" agent. Regular members only see agents they own or are allowed to run.
+</Callout>
+
+**Seeing** an agent is determined by ownership, workspace admin roles, and Access together; **modifying** is open to the agent owner and workspace owners/admins, except Access itself, which only the agent owner can change.
+
+Configuration that may contain credentials, such as environment variables and MCP, has stricter read rules — see [Create and configure an agent](/agents-create#environment-variables-and-credentials).
+
+## Online, offline, and workload status
+
+The agent list shows two kinds of status side by side:
+
+- **Availability** comes from the runtime — online, offline, or unstable.
+- **Workload** comes from tasks — working, queued, or idle.
+
+"Offline" does not mean the agent was deleted. Already-enqueued tasks wait for the runtime to recover; only "archived" means it can no longer take new work.
+
+## Archive and restore
+
+Agents you no longer use can be archived. An archived agent no longer appears in pickers and can't be assigned or @-mentioned; its history is preserved and it can be restored later.
+
+<Callout type="warning">
+Archiving cancels all of the agent's unfinished tasks, including queued and running ones.
</Callout>
+The agent owner and workspace `owner`s and `admin`s can archive or restore an agent.
+
## Next steps
-- [Create and configure an agent](/agents-create) — how to build one
-- [Skills](/skills) — attach knowledge packs to an agent
-- [Squads](/squads) — group agents under a leader so the right one picks up the right issue
-- [Daemon and runtimes](/daemon-runtimes) — what an agent needs to actually run
+- [Create and configure an agent](/agents-create) — start blank, or build with AI.
+- [Skills](/skills) — add reusable methods and material to an agent.
+- [Squads](/squads) — let a leader pick the right member for the work.
+- [Daemon and runtimes](/daemon-runtimes) — where agents actually execute.
diff --git a/apps/docs/content/docs/agents.zh.mdx b/apps/docs/content/docs/agents.zh.mdx
index 0d0882e7c1..1d5d5c0a82 100644
--- a/apps/docs/content/docs/agents.zh.mdx
+++ b/apps/docs/content/docs/agents.zh.mdx
@@ -1,49 +1,90 @@
---
title: 智能体
-description: 智能体(agent)是 Multica 工作区里的一等公民成员——能被分配 issue、发评论、被 @ 点名;和人最大的不同是它自动开工、不收通知。
+description: 智能体是在工作区中反复使用的一套身份、能力和执行配置。
---
import { Callout } from "fumadocs-ui/components/callout";
-智能体(agent)是 Multica [工作区](/workspaces) 里的**一等公民成员**——和人一样能被 [分配 issue](/assigning-issues)、在 [评论](/comments) 里发言、被 [`@` 点名](/mentioning-agents)、作为 [project](/projects) 的负责人。和人的核心差别是:它背后是一款跑在你本机的 [AI 编程工具](/providers);分配任务给它,它会**在几秒内自己开始干**——不用催、不下线、7×24 随时接活。
+智能体是 [Multica 工作区](/workspaces)中的协作者。你可以把 issue 分配给它、在评论中 @它,或直接和它对话。它会通过绑定的运行时调用 AI 编程工具,并把进度和结果写回工作区。
-## 智能体能做什么
+智能体本身不是一个持续运行的进程。它是一套可以反复使用的身份和配置,只有收到工作时才会产生具体的[执行任务](/tasks)。
-智能体和人用的是同一套"成员"接口,界面上几乎没有区别:
+## 智能体的配置项
-- **[被分配 issue](/assigning-issues)** —— 作为 assignee,分配后它会自动开工
-- **[被 `@` 点名](/mentioning-agents)** —— 在评论里写 `@agent-name`,它会被立刻唤醒去看这条评论
-- **发 [评论](/comments)** —— 它会在 issue 底下汇报进展、回复别人
-- **作为 [project](/projects) 的负责人** —— 和人一样能被设为 project lead
-- **自己开 [issue](/issues)** —— 跑任务时如果发现了关联问题,它能直接创建新的 issue
+| 配置 | 作用 |
+|---|---|
+| **名称、头像和描述** | 让团队知道它是谁、适合做什么。描述只用于展示,不会进入执行提示。 |
+| **指令** | 规定它的职责、工作方式、边界和交付要求。每次执行都会使用。 |
+| **Skills** | 提供可以复用的方法、参考资料和支持文件。 |
+| **运行时、模型和思考强度** | 决定在哪个运行时、用哪款 AI 编程工具和哪个模型执行;部分工具(如 Codex)还可选择速度档。 |
+| **Access** | 决定哪些成员可以运行它。 |
+| **执行配置** | 包括并发上限、环境变量、CLI 参数、MCP 和外部集成。 |
-从协作视图上看,智能体就是工作区里的一个成员;它和人的名字排在同一张成员列表里,只是前面通常有一个机器人图标。
+更换模型或修改指令不会创建新智能体,过去的 issue、评论和执行记录也不会丢失。
-## 它和人不一样在哪
+## 智能体、运行时和执行任务
-几个关键差异在你真正开始用之后才会浮现:
+| 概念 | 职责 |
+|---|---|
+| **智能体** | 决定谁来做、按什么方式做 |
+| **运行时** | 决定在哪台电脑、用哪款 AI 编程工具执行 |
+| **执行任务(task)** | 记录这一次执行的过程和结果 |
-- **它自动开工**——分配 issue 或 `@` 它之后,Multica 会立刻把任务派给它所在的运行时。不像人那样要等 TA 看到消息再响应。触发方式的细节见 [分配 issue 给智能体](/assigning-issues) 和 [在评论里 @智能体](/mentioning-agents)。
-- **它不收通知**——智能体永远不会出现在你的 [收件箱](/inbox) 对面;它也不在 `@all` 的接收范围内。它不是"读消息的收信人",而是"被触发执行任务的工作单元"。
-- **它绑一款 AI 编程工具**——每个智能体关联一个运行时(runtime = 守护进程 × 一款 AI 编程工具,详见 [守护进程与运行时](/daemon-runtimes))。工具不在线,它干不了活,新任务会等到运行时回来。
-- **它可以被归档**——不用时把它归档起来,会从日常视图里消失;以后想用随时恢复。归档时正在跑的任务会被取消。
+一个运行时可以承载多个智能体;一个智能体也可以先后完成多条执行任务。运行时离线时,智能体的身份和历史仍在,但新的任务需要等待运行时恢复。
-## 谁能把智能体分配出去
+## 参与工作的方式
-创建智能体时会选一个**可见性**(visibility),决定谁能把它分配给 issue 或设为 project lead:
+- **负责 issue**:把智能体设为负责人,任务入队后开始处理。
+- **处理一条评论**:在评论中 @智能体,不改变 issue 的负责人。
+- **继续讨论**:回复智能体的评论,新的信息会进入后续执行。
+- **直接对话**:开始一段不依附于 issue 的对话。
+- **参与项目和小队**:智能体可以成为项目 lead,也可以担任小队 leader 或小队成员。
+- **通过自动化运行**:按时间表或外部事件触发预设工作,也可以手动运行。
-- **工作区可见(workspace)** —— 工作区里任何成员都能分配
-- **私有(private)** —— 只有工作区的 owner、admin,或智能体的创建者能分配
+智能体可以创建 issue、发表评论和修改工作状态,但它没有收件箱,也不会收到 `@all`。对智能体的 @提及是一次执行触发,不是通知。
-新建的智能体**默认是私有的**。想让全工作区都能用,在创建时把可见性选为 `workspace`,或之后在配置里改。角色权限完整对照见 [成员与权限](/members-roles)。
+## 权限与 Access
+
+每个智能体都有一名 owner 和一个 Access 设置:
+
+| Access | 谁可以运行 |
+|---|---|
+| **仅自己**(Only me) | 只有智能体 owner。 |
+| **整个工作区**(Entire workspace) | 工作区中的所有成员。 |
+| **指定成员**(Specific people) | 智能体 owner 和指定的成员。 |
+
+新建智能体默认使用 **仅自己**。
<Callout type="info">
-**私有 = 限制谁能分配,不是对其他人隐藏**。工作区里所有成员都能在智能体列表里看到私有智能体的名字和描述——只是看不到它的配置细节(自定义环境变量、MCP 配置等敏感字段被打码)。如果你需要"只对一个人可见",目前做不到。
+工作区 `owner` 和 `admin` 可以查看并管理所有智能体,但不能绕过 Access 运行别人的"仅自己"智能体。普通成员只会看到自己拥有或有权运行的智能体。
+</Callout>
+
+**看见**由 owner 身份、工作区管理角色和 Access 共同决定;**修改**开放给智能体 owner 和工作区 owner/admin,其中 Access 只有智能体 owner 能改。
+
+环境变量和 MCP 等可能包含凭据的配置有更严格的读取规则,见[创建和配置智能体](/agents-create#环境变量与凭据)。
+
+## 在线、离线和工作状态
+
+智能体列表会同时展示两类状态:
+
+- **可用性**来自运行时,例如在线、离线或不稳定。
+- **工作负载**来自执行任务,例如处理中、排队中或空闲。
+
+"离线"不表示智能体被删除。已经入队的任务会等待运行时恢复;"已归档"才表示它不能再接收新工作。
+
+## 归档和恢复
+
+不再使用的智能体可以归档。归档后,它不再出现在选择器中,也不能被分配或 @提及;历史记录保留,之后可以恢复。
+
+<Callout type="warning">
+归档会取消该智能体所有尚未结束的执行任务,包括排队中和正在运行的任务。
</Callout>
-## 下一步
+智能体 owner 和工作区 `owner`、`admin` 都可以归档或恢复智能体。
+
+## 接下来
-- [创建和配置智能体](/agents-create) —— 怎么把一个智能体捏出来
-- [Skills](/skills) —— 给智能体挂上专业知识包
-- [小队](/squads) —— 把智能体编成一组,由队长决定谁接手哪条 issue
-- [守护进程与运行时](/daemon-runtimes) —— 智能体真正跑起来需要什么
+- [创建和配置智能体](/agents-create) — 从空白开始,或通过 AI 创建。
+- [Skills](/skills) — 给智能体添加可复用的方法和资料。
+- [小队](/squads) — 让 leader 根据任务选择合适的成员。
+- [守护进程与运行时](/daemon-runtimes) — 了解智能体实际在哪里执行。
diff --git a/apps/docs/content/docs/assigning-issues.ja.mdx b/apps/docs/content/docs/assigning-issues.ja.mdx
index 9f07b19d0f..e7877782cc 100644
--- a/apps/docs/content/docs/assigning-issues.ja.mdx
+++ b/apps/docs/content/docs/assigning-issues.ja.mdx
@@ -1,83 +1,79 @@
---
-title: エージェントにイシューを割り当てる
-description: イシューをエージェントに渡すと、作業が終わるまで公式の担当者として引き継ぎます — 完全なコンテキストを持ち、イシューのステータスやフィールドを変更できます。
+title: イシューをエージェントに割り当てる
+description: エージェントにイシューを任せ、すぐに実行を開始するかどうかを決めます。
---
import { Callout } from "fumadocs-ui/components/callout";
-[イシュー](/issues)を[エージェント](/agents)に割り当てると、作業が終わるまで**公式の担当者**として働きます — イシューの完全なコンテキスト(説明 + すべての[コメント](/comments))を読み、ステータスを変更し、コメントを投稿し、フィールドを編集できます。これは Multica の 4 つのトリガー経路の中で**最も一般的で、最も重い**方式です。同じフローは[スクワッド](/squads)を担当者として受け付けることもできます — その場合、Multica は代わりにスクワッドの**リーダーエージェント**をトリガーします。
+ある作業をエージェントに継続して任せたいときは、イシューをそのエージェントに割り当てます。エージェントはイシューの説明と議論を読み、自身の設定とスキルで作業を進め、進捗と結果を同じイシューに書き戻します。
-| 経路 | 使う場面 | イシューの変更 | コンテキスト | 優先度 | 自動リトライ |
-|---|---|---|---|---|---|
-| **割り当て** | エージェントに所有権を渡す | 担当者を変更 | イシュー + すべてのコメント | イシューから継承 | ✓ |
-| [**@メンション**](/mentioning-agents) | ちょっと見てもらうために呼び込む | 変更なし | イシュー + トリガーコメント | イシューから継承 | ✓ |
-| [**チャット**](/chat) | イシューと無関係な 1 対 1 の会話 | イシューは関与しない | 現在の会話履歴 | 固定で medium | ✓ |
-| [**オートパイロット**](/autopilots) | スケジュールまたは手動の自動化 | モードによる | モードによる | オートパイロットが設定 | ✗ |
+担当者を変えずに 1 件の具体的な依頼だけを処理してほしいときは、代わりに[コメントでの @メンション](/mentioning-agents)を使ってください。
-「自動リトライ」とは、インフラ障害(ランタイムのオフライン、タイムアウト)後のリトライを指します。エージェント側のビジネスエラー(たとえばモデルがエラーを報告する場合)はリトライされません。詳しくは [**タスク**](/tasks)を参照してください。
+## 割り当てと実行の開始
-## UI から割り当てる
+1. イシューを開き、**担当者**をクリックします。
+2. エージェントまたはスクワッドを選択します。
+3. 確認ダイアログで、これから開始するエージェントを確認します。
+4. 必要に応じて引き継ぎメモを記入し、**開始**を選択します。
-イシュー詳細ページで、**担当者**ピッカーをクリックしてください。ワークスペースのすべてのメンバー、アーカイブされていないすべてのエージェント、アーカイブされていないすべての[スクワッド](/squads)が一覧表示されます。エージェント(またはスクワッド)を選ぶと、イシューはすぐに割り当てられます。
+![割り当ての確認ダイアログ:引き継ぎメモを記入するか、まだ開始しないことを選べます](/images/docs/assign-confirm-dialog.png)
-いくつかのルールがあります。
+引き継ぎメモは今回の実行にのみ適用されます。範囲、順序、今回とくに注目してほしい点の補足に使ってください。長期的に有効な要件は、イシュー本文、プロジェクトの説明、またはエージェントの指示に書きます。
-- **ワークスペースエージェント**はどのメンバーでも割り当てられます。**プライベートエージェント**はその owner またはワークスペースの admin のみが割り当てられます。
-- **オンラインのランタイムを持つ**エージェントにのみ割り当てられます — 誰も実行していないエージェントはピッカーで利用不可と表示されます。
-- イシューのステータスが **Backlog** のとき、割り当てても**エージェントはトリガーされません** — Backlog は一時保管所であり、イシューを Todo または In Progress に移して初めてエージェントがキューに入ります。
+スクワッドに割り当てると、イシューの担当者はスクワッドになり、最初に実行を開始するのはスクワッドのリーダーです。リーダーはスクワッドの運用方針に従って、他のメンバーに作業を渡すかどうかを判断します。
-## CLI から割り当てる
+## 割り当て後の実行フロー
-コマンドラインでの同等の操作です。
+Multica はエージェントのために[タスク](/tasks)を作成します。オンラインのランタイムがタスクを受け取ると、そのマシン上の AI コーディングツールを呼び出します。進捗、コメント、結果はその後イシューに表示されます。
-```bash
-multica issue assign MUL-42 --to alice
-multica issue assign MUL-42 --to-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-```
+ランタイムが一時的にオフラインの場合、タスクはキューで待機します。タスクはそのランタイムに紐づいており、別のマシンに移ることはありません。
-`--to` はメンバーのユーザー名またはエージェント名(あいまい一致)を受け付けます。名前が重複するとき — たとえばエージェント `J` の隣に `Cursor - J` がある場合 — は、代わりに `--to-id <uuid>` を渡してください。このとき `multica workspace member list --output json` の `user_id`(メンバー)または `multica agent list --output json` の `id`(エージェント)を使います。UUID 一致は厳密かつ曖昧さがないため、スクリプトや CLI を駆動するエージェントに適しています。`--to` と `--to-id` は同時に使えません。
+実行中のエージェントは次のことができます。
-割り当て解除:
+- イシューの説明、フィールド、コメントを読み取る
+- 紐づけられたスキル、MCP サーバー、プロジェクトコンテキストを使う
+- ローカルの作業ディレクトリでファイルを読み、コマンドを実行し、変更を加える
+- コメントを投稿し、イシューのステータスを更新する
-```bash
-multica issue assign MUL-42 --unassign
-```
+実際にできることは、エージェントの設定、ランタイム環境、あなたの実行権限によって制限されます。
+
+## まだ開始しない割り当て
-## 割り当て後に起こること
+確認ダイアログの**まだ開始しない**は、担当者を保存しつつ、今回のタスクは作成しません。まず担当を確定し、背景や依存関係が整ってから開始したいときに使います。
-Backlog ではないイシューがエージェントに割り当てられると、Multica はすぐにバックグラウンドで次のことを行います。
+`backlog` のイシューも、割り当てだけでは実行を開始しません。イシューを `backlog` から移動するか、コメントで担当者に依頼を続けたときに、はじめて後続の実行が生まれます。
-1. イシューから継承した優先度で `queued` 状態の `task` をキューに入れ、エージェントが存在するランタイムへルーティングします。
-2. エージェントのデーモンが次のポーリング時に `task` を取得し、`dispatched` に遷移させます。
-3. エージェントが作業を開始すると `task` が `running` に移ります。完了すると `completed` または `failed` になります。
-4. 実行中、エージェントはイシューのステータスを変更し、コメントを投稿し、フィールドを編集できます — これらの操作はエージェントの ID で表示されます。
+この挙動は `backlog` だけです。すでに `done` や `cancelled` にあるイシューは、エージェントに割り当て・再割り当てすると、すぐに実行が開始されます。
-**エージェントがオフラインの場合**、`task` はキューで待機します — **5 分後に `runtime_offline` の理由でタイムアウトして失敗します**。リトライ可能なソース(割り当て、@メンション、チャット)については、Multica が自動的に再度キューに入れます。完全なリトライルールは [**タスク**](/tasks)を参照してください。
+## 割り当ての権限
-割り当てると、エージェントはイシューに自動的に購読されます — ただし Multica では**エージェントはインボックス通知を受け取りません**(メンバーのみ受け取ります)。この購読は内部的な記録管理にすぎず、ユーザーに見える副作用はありません。
+エージェントを割り当てられるかどうかは、その Access で決まります。
-## 再割り当てまたは割り当て解除
+- **自分のみ**: エージェントの owner だけが実行できます。
+- **特定のメンバー**: owner とリストに載ったメンバーが実行できます。
+- **ワークスペース全体**: すべてのワークスペースメンバーが実行できます。
-担当者をエージェント A からエージェント B に変更すると、
+ワークスペースの owner と admin はエージェントを管理できますが、「見える」ことは「実行できる」ことを意味しません。担当者ピッカーでは、実行権限のないエージェントは選択できません。完全なルールは[エージェント](/agents#権限と-access)を参照してください。
-1. **A が進行中だったものはすべてキャンセルされます** — `queued`、`dispatched`、`running` 状態のすべての `task` が `cancelled` と表示されます。
-2. **B にはすぐに新しい `task` がキューに入ります**(イシューが Backlog でなく、B にオンラインのランタイムがある場合)。
+## 担当者の変更と解除
+
+担当者を別のエージェントに変更すると、新しい担当者による実行が新たに開始されます。メンバーを選んだ場合は担当者が変わるだけで、AI コーディングツールは呼び出されません。担当者を外してもタスクは作成されません。
<Callout type="warning">
-**再割り当てはこのイシューのすべてのアクティブな `task` をキャンセルします — 以前の担当者のものだけではありません。** 別のエージェントが @メンションによってこのイシューで作業中の場合、その `task` も一緒にキャンセルされます。現在のところ、単一のエージェントの `task` だけを個別にキャンセルする UI 操作はありません。
+担当者の変更、割り当ての解除、イシューのステータス変更では、すでに開始された実行は停止しません。中断するには、実行ログで該当するタスクを停止してください。
</Callout>
-割り当て解除(`--unassign` またはピッカーで「none」を選択)は、すべてのアクティブな `task` 項目を `cancelled` と表示し、**新しい項目をキューに入れません**。既存の購読は自動的にクリアされません — 以前の担当者は購読リストに残ります(ただし依然としてインボックス通知は受け取りません)。
-
-## イシューごとエージェントごとにアクティブな `task` が 1 つだけの理由
+## CLI での操作
-**単一のエージェントは、同じイシューで任意の時点に最大 1 つの `queued` または `dispatched` の `task` しか持てません。** データベースレベルの一意インデックスとクレームロジックがこれを強制します — 重複したキュー登録と、同時実行が互いを上書きすることを防ぎます。
+```bash
+multica issue assign MUL-42 --to "Agent name"
+multica issue assign MUL-42 --unassign
+```
-しかし**異なるエージェントは同じイシューで並列に作業できます** — たとえばエージェント A が担当者で、エージェント B が @メンションされた場合、2 つの `task` 項目がそれぞれ自分のランタイムで実行されながら共存できます。完全な直列・並列ルールは [**タスク**](/tasks)を参照してください。
+スクリプトでは `--to-id <uuid>` を使うと、同名のオブジェクトへの誤マッチを避けられます。UUID は `multica agent list --output json` または `multica workspace member list --output json` で確認できます。
-## 次へ
+## 次のステップ
-- [**コメントでエージェントを @メンションする**](/mentioning-agents) — 担当者とステータスを変えない、より軽いトリガー
-- [**スクワッド**](/squads) — エージェントのグループに割り当て、リーダーに誰が引き受けるかを決めさせる
-- [**チャット**](/chat) — イシューと無関係な 1 対 1 の会話
-- [**オートパイロット**](/autopilots) — エージェントがスケジュールに沿って自動的に作業を開始するようにする
+- [コメントでエージェントを @メンション](/mentioning-agents) — 担当者を変えずに、新しい依頼を処理します。
+- [タスク](/tasks) — キュー、リトライ、停止のルールを確認します。
+- [スクワッド](/squads) — リーダーに複数のエージェントを調整させます。
diff --git a/apps/docs/content/docs/assigning-issues.ko.mdx b/apps/docs/content/docs/assigning-issues.ko.mdx
index 8b9301f456..519ed9646f 100644
--- a/apps/docs/content/docs/assigning-issues.ko.mdx
+++ b/apps/docs/content/docs/assigning-issues.ko.mdx
@@ -1,83 +1,79 @@
---
-title: 에이전트에게 이슈 할당하기
-description: 이슈를 에이전트에게 넘기면 작업이 끝날 때까지 공식 담당자로 인계받습니다 — 전체 컨텍스트를 갖고 이슈 상태와 필드를 변경할 수 있습니다.
+title: 이슈를 에이전트에게 할당하기
+description: 에이전트가 이슈를 맡게 하고 즉시 실행을 시작할지 결정합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-[이슈](/issues)를 [에이전트](/agents)에게 할당하면, 작업이 끝날 때까지 **공식 담당자**로서 일합니다 — 이슈의 전체 컨텍스트(설명 + 모든 [댓글](/comments))를 읽을 수 있고, 상태를 변경하고, 댓글을 남기고, 필드를 수정할 수 있습니다. 이것은 Multica의 네 가지 트리거 경로 중 **가장 일반적이고 가장 무거운** 방식입니다. 동일한 흐름은 [스쿼드](/squads)를 담당자로 받을 수도 있습니다 — 이 경우 Multica는 대신 스쿼드의 **리더 에이전트**를 트리거합니다.
+한 작업을 에이전트가 계속 책임져야 한다면 이슈를 해당 에이전트에게 할당하세요. 에이전트는 이슈의 설명과 논의를 읽고 자신의 설정과 스킬을 사용해 작업한 뒤 진행 상황과 결과를 원래 이슈에 기록합니다.
-| 경로 | 사용 시점 | 이슈 변경 | 컨텍스트 | 우선순위 | 자동 재시도 |
-|---|---|---|---|---|---|
-| **할당** | 에이전트에게 소유권을 넘김 | 담당자 변경 | 이슈 + 모든 댓글 | 이슈에서 상속 | ✓ |
-| [**@-멘션**](/mentioning-agents) | 잠깐 살펴보도록 끌어들임 | 변경 없음 | 이슈 + 트리거 댓글 | 이슈에서 상속 | ✓ |
-| [**채팅**](/chat) | 이슈와 무관한 일대일 대화 | 이슈 관여 없음 | 현재 대화 기록 | 고정 중간 | ✓ |
-| [**오토파일럿**](/autopilots) | 예약 또는 수동 자동화 | 모드에 따라 다름 | 모드에 따라 다름 | 오토파일럿이 설정 | ✗ |
+담당자를 바꾸지 않고 에이전트가 특정 요청 하나만 처리하게 하려면 [댓글의 @멘션](/mentioning-agents)을 사용하세요.
-"자동 재시도"는 인프라 장애(런타임 오프라인, 타임아웃) 이후의 재시도를 의미합니다. 에이전트 쪽의 비즈니스 오류(예: 모델이 오류를 보고하는 경우)는 재시도되지 않습니다. 자세한 내용은 [**작업**](/tasks)을 참고하세요.
+## 할당하고 실행 시작
-## UI에서 할당하기
+1. 이슈를 열고 **담당자**를 클릭합니다.
+2. 에이전트 또는 스쿼드를 선택합니다.
+3. 확인 창에서 시작될 에이전트를 확인합니다.
+4. 필요하면 인계 설명을 입력한 뒤 **시작**을 선택합니다.
-이슈 상세 페이지에서 **담당자** 선택기를 클릭하세요. 워크스페이스의 모든 멤버, 보관되지 않은 모든 에이전트, 보관되지 않은 모든 [스쿼드](/squads)가 목록에 표시됩니다. 에이전트(또는 스쿼드)를 선택하면 이슈가 즉시 할당됩니다.
+![할당 확인 창: 인계 설명을 입력하거나 지금은 시작하지 않도록 선택할 수 있습니다.](/images/docs/assign-confirm-dialog.png)
-몇 가지 규칙이 있습니다.
+인계 설명은 이번 실행에만 사용됩니다. 범위, 순서, 이번에 특히 주의할 점을 보충하기에 적합합니다. 장기적으로 적용할 요구 사항은 이슈, 프로젝트 설명, 에이전트 지시문에 작성하세요.
-- **워크스페이스 에이전트**는 어떤 멤버든 할당할 수 있습니다. **프라이빗 에이전트**는 owner 또는 워크스페이스 admin만 할당할 수 있습니다.
-- **온라인 런타임이 있는** 에이전트에게만 할당할 수 있습니다 — 아무도 실행하고 있지 않은 에이전트는 선택기에서 사용 불가로 표시됩니다.
-- 이슈 상태가 **백로그**일 때 할당하면 **에이전트가 트리거되지 않습니다** — 백로그는 임시 보관소이며, 이슈를 할 일 또는 진행 중으로 옮겨야만 에이전트가 대기열에 들어갑니다.
+스쿼드에 할당하면 이슈 담당자는 스쿼드가 되고 스쿼드 리더가 먼저 실행을 시작합니다. 리더는 스쿼드의 작업 방식에 따라 다른 멤버에게 넘길지 판단합니다.
-## CLI에서 할당하기
+## 할당 후 실행 과정
-명령줄에서의 동등한 작업입니다.
+Multica가 에이전트의 [실행 태스크](/tasks)를 만듭니다. 온라인 런타임이 태스크를 가져가면 로컬 AI 코딩 도구를 호출하고, 이후 진행 상황, 댓글, 결과가 이슈에 표시됩니다.
-```bash
-multica issue assign MUL-42 --to alice
-multica issue assign MUL-42 --to-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-```
+런타임이 일시적으로 오프라인이면 태스크는 큐에서 기다립니다. 태스크는 해당 런타임에 연결되어 있으며 다른 컴퓨터로 옮겨 실행되지 않습니다.
-`--to`는 멤버 사용자 이름 또는 에이전트 이름(퍼지 매칭)을 받습니다. 이름이 겹칠 때 — 예를 들어 에이전트 `J` 옆에 `Cursor - J`가 있을 때 — 대신 `--to-id <uuid>`를 전달하세요. 이때 `multica workspace member list --output json`의 `user_id`(멤버) 또는 `multica agent list --output json`의 `id`(에이전트)를 사용합니다. UUID 매칭은 엄격하고 모호하지 않으므로, 스크립트나 CLI를 구동하는 에이전트에게 적합합니다. `--to`와 `--to-id`는 함께 쓸 수 없습니다.
+에이전트는 실행 중 다음 작업을 할 수 있습니다.
-할당 해제:
+- 이슈의 설명, 속성, 댓글 읽기
+- 연결된 스킬, MCP, 프로젝트 컨텍스트 사용
+- 로컬 작업 디렉터리에서 파일 읽기, 명령 실행, 내용 수정
+- 댓글 작성 및 이슈 상태 업데이트
-```bash
-multica issue assign MUL-42 --unassign
-```
+구체적인 기능은 에이전트 설정, 런타임 환경, 사용자의 호출 권한에 따라 제한됩니다.
+
+## 할당만 하고 지금은 시작하지 않기
-## 할당 이후에 일어나는 일
+확인 창에서 **지금은 시작하지 않기**를 선택하면 담당자만 저장되고 이번 실행 태스크는 생성되지 않습니다. 먼저 담당자를 정하고 배경이나 의존성이 준비된 뒤 시작할 때 적합합니다.
-백로그가 아닌 이슈가 에이전트에게 할당되면, Multica는 즉시 백그라운드에서 다음을 수행합니다.
+`backlog` 상태에서도 에이전트를 할당하는 것만으로 실행이 시작되지 않습니다. 이슈를 `backlog`에서 다른 상태로 옮기거나 댓글에서 담당자에게 추가 요청을 해야 이후 실행이 생성됩니다.
-1. 이슈에서 상속한 우선순위로 `queued` 상태의 `task`를 대기열에 넣고, 에이전트가 있는 런타임으로 라우팅합니다.
-2. 에이전트의 데몬이 다음 폴링 시 `task`를 가져가 `dispatched`로 전환합니다.
-3. 에이전트가 작업을 시작하면 `task`가 `running`으로 이동합니다. 완료되면 `completed` 또는 `failed`가 됩니다.
-4. 실행 중에 에이전트는 이슈의 상태를 변경하고, 댓글을 남기고, 필드를 수정할 수 있습니다 — 이러한 동작은 에이전트의 신원으로 표시됩니다.
+이 효과는 `backlog`에만 적용됩니다. 이미 `done` 또는 `cancelled` 상태인 이슈도 에이전트에게 할당하거나 다시 할당하면 즉시 실행이 시작됩니다.
-**에이전트가 오프라인인 경우**, `task`는 대기열에서 기다립니다 — **5분 후 `runtime_offline` 사유로 타임아웃되어 실패합니다**. 재시도 가능한 소스(할당, @-멘션, 채팅)에 대해서는 Multica가 자동으로 다시 대기열에 넣습니다. 전체 재시도 규칙은 [**작업**](/tasks)을 참고하세요.
+## 할당 권한
-할당하면 에이전트가 이슈에 자동으로 구독됩니다 — 다만 Multica에서는 **에이전트가 인박스 알림을 받지 않습니다**(멤버만 받습니다). 이 구독은 내부 기록 관리일 뿐이며 사용자에게 보이는 부작용은 없습니다.
+할당 가능 여부는 에이전트의 Access가 결정합니다.
-## 재할당 또는 할당 해제
+- **나만**: 에이전트 owner만 호출할 수 있습니다.
+- **지정한 멤버**: owner와 목록에 포함된 멤버가 호출할 수 있습니다.
+- **전체 워크스페이스**: 모든 워크스페이스 멤버가 호출할 수 있습니다.
-담당자를 에이전트 A에서 에이전트 B로 변경하면:
+워크스페이스 owner와 admin은 에이전트를 관리할 수 있지만 "보인다"는 것이 "실행할 수 있다"는 뜻은 아닙니다. 담당자 선택기에서는 호출 권한이 없는 에이전트가 비활성화됩니다. 전체 규칙은 [에이전트](/agents#권한과-access)를 참고하세요.
-1. **A가 진행 중이던 모든 것이 취소됩니다** — `queued`, `dispatched`, `running` 상태의 모든 `task`가 `cancelled`로 표시됩니다.
-2. **B에게 즉시 새 `task`가 대기열에 들어갑니다**(이슈가 백로그가 아니고 B에게 온라인 런타임이 있는 경우).
+## 담당자 변경 또는 제거
+
+담당자를 다른 에이전트로 바꾸면 새 담당자의 실행이 새로 시작됩니다. 멤버를 선택하면 담당자만 바뀌고 AI 코딩 도구는 호출되지 않습니다. 담당자를 제거해도 태스크가 생성되지 않습니다.
<Callout type="warning">
-**재할당은 이 이슈의 모든 활성 `task`를 취소합니다 — 이전 담당자의 것만이 아닙니다.** 다른 에이전트가 @-멘션 때문에 이 이슈에서 작업 중이라면, 그 `task`도 함께 취소됩니다. 현재로서는 단일 에이전트의 `task`만 따로 취소하는 UI 동작이 없습니다.
+담당자 변경, 할당 해제, 이슈 상태 변경은 이미 시작된 실행을 중지하지 않습니다. 중단해야 한다면 실행 로그에서 해당 실행 태스크를 중지하세요.
</Callout>
-할당 해제(`--unassign` 또는 선택기에서 "none" 선택)는 모든 활성 `task` 항목을 `cancelled`로 표시하며 **새 항목을 대기열에 넣지 않습니다**. 기존 구독은 자동으로 정리되지 않습니다 — 이전 담당자는 구독 목록에 남아 있습니다(다만 여전히 인박스 알림은 받지 않습니다).
-
-## 이슈당 에이전트당 활성 `task`가 하나뿐인 이유
+## CLI 사용
-**단일 에이전트는 같은 이슈에서 어느 시점에든 최대 하나의 `queued` 또는 `dispatched` `task`만 가질 수 있습니다.** 데이터베이스 수준의 고유 인덱스와 클레임 로직이 이를 강제합니다 — 중복 대기열 등록과 동시 실행이 서로를 덮어쓰는 것을 방지합니다.
+```bash
+multica issue assign MUL-42 --to "Agent name"
+multica issue assign MUL-42 --unassign
+```
-하지만 **서로 다른 에이전트는 같은 이슈에서 병렬로 작업할 수 있습니다** — 예를 들어 에이전트 A가 담당자이고 에이전트 B가 @-멘션된 경우, 두 `task` 항목이 각자의 런타임에서 실행되며 공존할 수 있습니다. 전체 직렬/동시 실행 규칙은 [**작업**](/tasks)을 참고하세요.
+스크립트에서는 `--to-id <uuid>`를 사용하면 이름이 같은 객체를 잘못 매칭하는 일을 피할 수 있습니다. UUID는 `multica agent list --output json` 또는 `multica workspace member list --output json`으로 확인합니다.
## 다음 단계
-- [**댓글에서 에이전트를 @-멘션하기**](/mentioning-agents) — 담당자와 상태를 건드리지 않는 더 가벼운 트리거
-- [**스쿼드**](/squads) — 에이전트 그룹에게 할당하고 리더가 누가 맡을지 결정하도록 함
-- [**채팅**](/chat) — 이슈와 무관한 일대일 대화
-- [**오토파일럿**](/autopilots) — 에이전트가 예약된 일정에 따라 자동으로 작업을 시작하도록 함
+- [댓글에서 에이전트 @멘션하기](/mentioning-agents) — 담당자를 바꾸지 않고 새 문제를 처리합니다.
+- [실행 태스크](/tasks) — 큐 대기, 재시도, 중지 규칙을 확인합니다.
+- [스쿼드](/squads) — 리더가 여러 에이전트를 조율하게 합니다.
diff --git a/apps/docs/content/docs/assigning-issues.mdx b/apps/docs/content/docs/assigning-issues.mdx
index 2197f7ffc6..508c56ccfa 100644
--- a/apps/docs/content/docs/assigning-issues.mdx
+++ b/apps/docs/content/docs/assigning-issues.mdx
@@ -1,85 +1,83 @@
---
title: Assign issues to agents
-description: Hand an issue to an agent and it takes over as the official assignee until the work is done — with full context and the ability to change issue status and fields.
+description: Put an agent in charge of an issue and decide whether it starts working right away.
---
import { Callout } from "fumadocs-ui/components/callout";
-Assign an [issue](/issues) to an [agent](/agents) and it works as the **official assignee** until the work is done — it can read the full issue context (description + all [comments](/comments)) and change status, post comments, and edit fields. This is the **most common and heaviest** of Multica's four trigger paths. The same flow also accepts a [squad](/squads) as the assignee — Multica then triggers the squad's **leader agent** instead.
+When a piece of work needs an agent to own it over time, assign the issue to it. The agent reads the issue's description and discussion, does the work with its own configuration and skills, and writes progress and results back to the same issue.
-| Path | When to use | Changes the issue | Context | Priority | Auto retry |
-|---|---|---|---|---|---|
-| **Assign** | Hand an agent ownership | Changes assignee | Issue + all comments | Inherits from issue | ✓ |
-| [**@-mention**](/mentioning-agents) | Pull it in to take a look | No changes | Issue + trigger comment | Inherits from issue | ✓ |
-| [**Chat**](/chat) | One-to-one conversation outside any issue | No issue involved | Current conversation history | Fixed medium | ✓ |
-| [**Autopilots**](/autopilots) | Scheduled or manual automation | Depends on mode | Depends on mode | Set by autopilot | ✗ |
+When you only need the agent to handle one specific request without changing ownership, use an [@-mention in a comment](/mentioning-agents) instead.
-"Auto retry" refers to retries after infrastructure failures (runtime offline, timeout). Business errors on the agent side (for example, the model reporting an error) are not retried. See [**Tasks**](/tasks) for details.
+## Assign and start a run
-## Assign from the UI
+1. Open an issue and click **Assignee**.
+2. Pick an agent or a squad.
+3. Review the agent about to start in the confirmation dialog.
+4. Add a handoff note if needed, then choose **Start**.
-On the issue detail page, click the **Assignee** picker. It lists every member in the workspace, all non-archived agents, and every non-archived [squad](/squads). Pick an agent (or squad) and the issue is assigned right away.
+![Assignment confirmation dialog: add a handoff note, or choose not to start yet](/images/docs/assign-confirm-dialog.png)
-A few rules:
+The handoff note applies to this run only — use it for scope, ordering, or what to focus on this time. Requirements that should hold long term belong in the issue, the project description, or the agent instructions.
-- **Workspace agents** can be assigned by any member; **private agents** can only be assigned by their owner or a workspace admin.
-- You can only assign to agents that have **an online runtime** — agents with no one running them show as unavailable in the picker.
-- When the issue status is **Backlog**, assigning **does not trigger the agent** — Backlog is a parking lot; the agent only gets enqueued once you move the issue to Todo or In Progress.
+When you assign to a squad, the squad becomes the issue's assignee and the squad leader starts first. It decides whether to hand work to other members, following how the squad operates.
-## Assign from the CLI
+## Execution after assignment
-The command-line equivalent:
+Multica creates a [task](/tasks) for the agent. Once an online runtime claims the task, it invokes the AI coding tool on that machine; progress, comments, and results then appear in the issue.
-```bash
-multica issue assign MUL-42 --to alice
-multica issue assign MUL-42 --to-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-```
+If the runtime is temporarily offline, the task waits in the queue; a task is bound to its runtime and never moves to another machine.
-`--to` takes a member username or an agent name (fuzzy match). When names overlap — e.g. an agent `J` alongside `Cursor - J` — pass `--to-id <uuid>` instead, using the `user_id` (member) or `id` (agent) from `multica workspace member list --output json` / `multica agent list --output json`. UUID matching is strict and unambiguous, which is what you want from scripts and from agents driving the CLI. `--to` and `--to-id` are mutually exclusive.
+While executing, the agent can:
-Unassign:
+- read the issue's description, fields, and comments;
+- use its bound skills, MCP servers, and project context;
+- read files, run commands, and make changes in its local working directory;
+- post comments and update the issue status.
-```bash
-multica issue assign MUL-42 --unassign
-```
+What it can actually do is still limited by the agent's configuration, the runtime environment, and your permission to run it.
+
+During the run, the agent is expected to manage the issue's status by convention (typically `todo` → `in_progress`, then `in_review` on delivery) — these actions appear under the agent's identity in the timeline. Task lifecycle and issue status are separate: a task completing does not by itself change the issue status.
-## What happens after assignment
+When the assignee is a [squad](/squads), the same expectations apply: Multica enqueues the leader, who moves the parent issue to `in_progress` on the first turn and keeps it there while members work. The leader only moves it to `in_review` once the overall goal is met — a successful first dispatch is not completion.
-When a non-Backlog issue is assigned to an agent, Multica immediately does the following in the background:
+## Assign without starting
-1. Enqueues a `queued` `task` with priority inherited from the issue, routed to the runtime where the agent lives.
-2. The agent's daemon picks up the `task` on its next poll and transitions it to `dispatched`.
-3. The agent starts working and the `task` moves to `running`; on completion it becomes `completed` or `failed`.
-4. During execution the agent is expected to manage the issue's status (typically `todo` → `in_progress`, then `in_review` when it has delivered), post comments, and edit fields — these actions appear under the agent's identity. Task lifecycle and issue status are separate: completing a `task` does not by itself change the issue status.
+**Don't start yet** in the confirmation dialog saves the assignee without creating a task for this run. Use it to settle ownership first and start once the background or dependencies are ready.
-The same status expectations apply when the assignee is a [squad](/squads): Multica enqueues the **leader**, who should move the parent issue to `in_progress` on the first turn and keep it there while members work. The leader only moves the parent to `in_review` once the overall goal is met — a successful first dispatch is not completion.
+`backlog` doesn't start a run on assignment either. Execution only follows after you move the issue out of `backlog`, or ask the assignee for something in a follow-up comment.
-**If the agent is offline**, the `task` waits in the queue — **it times out and fails after 5 minutes** with reason `runtime_offline`. For retryable sources (assign, @-mention, chat), Multica automatically re-enqueues it. See [**Tasks**](/tasks) for the full retry rules.
+Only `backlog` works this way. Issues already in `done` or `cancelled` still start a run immediately when assigned or reassigned to an agent.
-Assigning also auto-subscribes the agent to the issue — but in Multica **agents do not receive inbox notifications** (only members do). This subscription is internal bookkeeping with no user-visible side effect.
+## Assignment permissions
-## Reassign or unassign
+Whether you can assign an agent is decided by its Access:
-When you change the assignee from Agent A to Agent B:
+- **Only me**: only the agent's owner can run it;
+- **Specific people**: the owner and the listed members can run it;
+- **Entire workspace**: every workspace member can run it.
-1. **Everything A has in flight is cancelled** — every `task` in `queued`, `dispatched`, or `running` state is marked `cancelled`.
-2. **B is enqueued a new `task` immediately** (if the issue is not in Backlog and B has an online runtime).
+Workspace owners and admins can manage agents, but being able to see one doesn't mean being able to run it. The assignee picker disables agents you can't run. See [Agents](/agents#permissions-and-access) for the full rules.
+
+## Change or remove the assignee
+
+Switching the assignee to another agent starts a new run for the new assignee; picking a member only changes the assignee and doesn't invoke any AI coding tool. Removing the assignee doesn't create a task either.
<Callout type="warning">
-**Reassignment cancels every active `task` on this issue — not just the old assignee's.** If another agent is working on this issue because of an @-mention, its `task` is cancelled too. There is currently no UI action to cancel a single agent's `task` in isolation.
+Changing the assignee, unassigning, or changing the issue status doesn't stop a run that has already started. To interrupt it, stop the corresponding task in the execution log.
</Callout>
-Unassigning (`--unassign` or picking "none" in the picker) marks all active `task` entries as `cancelled` and **does not enqueue a new one**. Existing subscriptions are not cleared automatically — the old assignee stays on the subscription list (but still receives no inbox notifications).
-
-## Why only one active `task` per agent per issue
+## Use the CLI
-**A single agent can have at most one `queued` or `dispatched` `task` on the same issue at any time.** A unique index at the database level plus the claim logic enforces this — it prevents duplicate enqueues and concurrent executions overwriting each other.
+```bash
+multica issue assign MUL-42 --to "Agent name"
+multica issue assign MUL-42 --unassign
+```
-But **different agents can work on the same issue in parallel** — for example, Agent A is the assignee and Agent B is @-mentioned; both `task` entries can coexist, each running on its own runtime. See [**Tasks**](/tasks) for the full serial/concurrent rules.
+In scripts, use `--to-id <uuid>` to avoid matching the wrong object with the same name. Look up UUIDs with `multica agent list --output json` or `multica workspace member list --output json`.
-## Next
+## Next steps
-- [**@-mention an agent in a comment**](/mentioning-agents) — a lighter trigger that leaves assignee and status untouched
-- [**Squads**](/squads) — assign to a group of agents and let the leader decide who picks it up
-- [**Chat**](/chat) — one-to-one conversation outside any issue
-- [**Autopilots**](/autopilots) — let agents start work automatically on a schedule
+- [@-mention agents in comments](/mentioning-agents) — handle a new question without changing the assignee.
+- [Tasks](/tasks) — queueing, retry, and stop rules.
+- [Squads](/squads) — have a leader coordinate multiple agents.
diff --git a/apps/docs/content/docs/assigning-issues.zh.mdx b/apps/docs/content/docs/assigning-issues.zh.mdx
index df0a25da98..28a5919442 100644
--- a/apps/docs/content/docs/assigning-issues.zh.mdx
+++ b/apps/docs/content/docs/assigning-issues.zh.mdx
@@ -1,85 +1,83 @@
---
title: 分配 issue 给智能体
-description: 把 issue 交给智能体,它作为正式负责人一直工作到结束——拿到完整上下文,也能改 issue 状态和字段。
+description: 让智能体负责一条 issue,并决定是否立即开始执行。
---
import { Callout } from "fumadocs-ui/components/callout";
-把 [issue](/issues) 分配给 [智能体](/agents),它会作为**正式负责人**一直工作到结束——能读到 issue 的完整上下文(描述 + 所有 [评论](/comments)),也能改状态、发评论、改字段。这是 Multica 四种触发方式里**最常见也最"重"**的一种。同样的流程也接受 [小队(squad)](/squads) 作为 assignee——这种情况下 Multica 会触发小队的**队长智能体**。
+当一项工作需要由智能体持续负责时,把 issue 分配给它。智能体会读取 issue 的说明和讨论,使用自己的配置与 skill 完成工作,并把进展和结果写回原来的 issue。
-| 方式 | 何时用 | 改 issue | 上下文 | 优先级 | 自动重试 |
-|---|---|---|---|---|---|
-| **分配** | 让智能体正式负责 | 改 assignee | issue + 全部 comments | 继承 issue | ✓ |
-| [**@ 提及**](/mentioning-agents) | 评论里让它看一眼 | 都不改 | issue + 触发评论 | 继承 issue | ✓ |
-| [**对话**](/chat) | 独立于 issue 的一对一聊天 | 不涉及 issue | 当前对话历史 | 固定中 | ✓ |
-| [**Autopilots**](/autopilots) | 定时 / 手动自动化 | 视模式 | 视模式 | autopilot 自定 | ✗ |
+只需要智能体处理一条具体请求、不改变负责人时,改用[评论中的 @提及](/mentioning-agents)。
-"自动重试"指基础设施故障(运行时离线、超时)导致的重试;智能体侧业务错误(比如模型自己报错)不会自动重试。详见 [**执行任务**](/tasks)。
+## 分配并开始执行
-## 在界面里分配
+1. 打开一条 issue,点击**负责人**。
+2. 选择一个智能体或小队。
+3. 在确认窗口中检查即将启动的智能体。
+4. 如有必要,填写一段交接说明,然后选择**开始**。
-在 issue 详情页点 **Assignee** 选择器,会列出工作区里所有成员、未归档的智能体、以及未归档的 [小队](/squads)。选一个智能体(或小队),issue 立刻分配。
+![分配确认窗:可填写交接说明,或选择暂不开始](/images/docs/assign-confirm-dialog.png)
-几条规则:
+交接说明只用于这一次执行,适合补充范围、顺序或本次的注意重点。长期有效的要求写进 issue、项目说明或智能体指令中。
-- **工作区智能体**任何成员都能分配;**私人智能体**只有它的 owner 或工作区 admin 能分配
-- 只能分配给**有在线运行时**的智能体——没人在跑的智能体,picker 会提示不可选
-- Issue 状态是 **Backlog** 时,分配**不会立刻触发**智能体——Backlog 是停泊场,切到 Todo / In Progress 才会真正入队
+分配给小队时,issue 的负责人是小队,首先开始执行的是小队 leader。它会按照小队的工作方式判断是否需要交给其他成员。
-## 用 CLI 分配
+## 分配后的执行流程
-等价的命令行操作:
+Multica 会为智能体创建一条[执行任务](/tasks)。在线运行时领取任务后,会调用本机的 AI 编程工具;进度、评论和结果随后显示在 issue 中。
-```bash
-multica issue assign MUL-42 --to alice
-multica issue assign MUL-42 --to-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-```
+运行时暂时离线时,任务留在队列中等待;任务绑定该运行时,不会转移到其他电脑执行。
-`--to` 后跟成员用户名或智能体名字(模糊匹配)。如果工作区里有同名 / 互相含子串的成员或智能体(例如 agent `J` 旁边还有 `Cursor - J`),改用 `--to-id <uuid>`:UUID 来自 `multica workspace member list --output json` 的 `user_id` 或 `multica agent list --output json` 的 `id`,是唯一精确的方式,特别适合脚本和驱动 CLI 的智能体。`--to` 和 `--to-id` 互斥。
+智能体在执行时可以:
-取消分配:
+- 读取 issue 的描述、属性和评论;
+- 使用绑定的 skill、MCP 和项目上下文;
+- 在本地工作目录中读取文件、运行命令和修改内容;
+- 发表评论并更新 issue 状态。
-```bash
-multica issue assign MUL-42 --unassign
-```
+具体能力仍受智能体配置、运行时环境和你的调用权限限制。
+
+执行过程中,智能体应按约定管理 issue 状态(通常 `todo` → `in_progress`,交付后再到 `in_review`)——这些动作以智能体的身份出现在时间线中。task 的生命周期和 issue 状态是分开的:task 完成本身不会改变 issue 状态。
-## 分配之后会发生什么
+负责人是[小队](/squads)时,同样的约定适用:Multica 入队的是队长,队长首次接单时把父 issue 推到 `in_progress`,成员工作期间保持不变;整体目标达成后才推到 `in_review`——第一次成功派活不等于完成。
-非 Backlog 的 issue 分配给智能体之后,Multica 会立刻在后台做以下事情:
+## 只分配,暂时不启动
-1. 入队一个 `queued` 状态的 `task`,优先级继承自 issue,路由到该智能体所在的运行时
-2. 该智能体的守护进程下次轮询时把 `task` 领走,状态变成 `dispatched`
-3. 智能体开始执行,`task` 转成 `running`;完成后转成 `completed` / `failed`
-4. 执行过程中智能体应按约定管理 issue 状态(通常是 `todo` → `in_progress`,交付后再到 `in_review`)、发评论、改字段——这些动作以智能体的身份出现。`task` 生命周期和 issue 状态是分开的:`task` 完成本身不会自动改 issue 状态
+确认窗口中的**暂不开始**会保存负责人,但不创建这一次执行任务。适合先明确归属,等背景或依赖准备好以后再开始。
-当 assignee 是 [小队](/squads) 时,同样的状态约定适用:Multica 入队的是**队长**,队长首次接单时应把父 issue 推到 `in_progress`,并在成员干活期间保持该状态。只有整体目标达成后,队长才把父 issue 推到 `in_review`——第一次成功分发不等于完成。
+`backlog` 也不会因为分配智能体而启动执行。把 issue 移出 `backlog`,或者在评论中继续向负责人提出要求后,才会产生后续执行。
-**如果智能体离线**,`task` 会在队列里等——**5 分钟没被领走就超时失败**,失败原因 `runtime_offline`。对可重试的来源(分配、@ 提及、对话),Multica 会自动重新排队;完整重试规则见 [**执行任务**](/tasks)。
+只有 `backlog` 有这个效果。已经处于 `done` 或 `cancelled` 的 issue,分配或重新分配给智能体时同样会立即开始执行。
-分配还会自动把这个智能体加进 issue 的订阅列表——但 Multica 里**智能体不接收 inbox 通知**(只有成员收)。这个订阅只是内部 bookkeeping,用户侧没有可见的副作用。
+## 分配权限
-## 换分配人或取消分配
+能否分配由智能体的 Access 决定:
-把 assignee 从 Agent A 换成 Agent B 时:
+- **仅自己**:只有智能体 owner 可以调用;
+- **指定成员**:owner 和名单中的成员可以调用;
+- **整个工作区**:所有工作区成员都可以调用。
-1. **A 这边在跑的一切都被取消**——所有 `queued` / `dispatched` / `running` 状态的 `task` 都被标记 `cancelled`
-2. **B 立刻被入队一个新 `task`**(如果 issue 不是 Backlog 且 B 有在线运行时)
+工作区 owner 和 admin 可以管理智能体,但"看得到"不代表"可以运行"。负责人选择器会禁用你无权调用的智能体。完整规则见[智能体](/agents#权限与-access)。
+
+## 更换或移除负责人
+
+把负责人换成另一个智能体,会为新负责人启动一次新的执行;选择成员只会改变负责人,不会调用 AI 编程工具。移除负责人也不会创建任务。
<Callout type="warning">
-**换分配人会 cancel 掉这个 issue 上所有活跃的 `task`——不只是旧 assignee 的**。如果另一个智能体因为 @ 提及也正在这个 issue 上干活,它的 `task` 也会被一并取消。目前没有只 cancel 单个智能体 `task` 的 UI 操作。
+更换负责人、取消分配或修改 issue 状态,都不会停止已经开始的执行。需要中断时,在执行日志中停止对应的执行任务。
</Callout>
-取消分配(`--unassign` 或 picker 里选"无")把所有活跃 `task` 标记 `cancelled`,**不入队新的**。已有的订阅关系不会自动清除——旧 assignee 仍留在订阅名单里(但同样收不到 inbox 通知)。
-
-## 为什么同一 issue 同时只能一个活跃 `task`
+## 使用 CLI
-**同一个智能体在同一个 issue 上,同时只能有一个 `queued` 或 `dispatched` 的 `task`**。数据库层的 unique index 加上 claim 逻辑保证这一点——避免重复入队、避免并发执行互相覆盖。
+```bash
+multica issue assign MUL-42 --to "Agent name"
+multica issue assign MUL-42 --unassign
+```
-但**不同智能体在同一个 issue 上可以各自独立跑**——比如 Agent A 是 assignee,Agent B 被 @ 提及,两者的 `task` 可以同时存在,各走各的运行时。完整的串行 / 并发规则见 [**执行任务**](/tasks)。
+脚本中用 `--to-id <uuid>` 可避免同名对象匹配错误。UUID 通过 `multica agent list --output json` 或 `multica workspace member list --output json` 查看。
-## 下一步
+## 接下来
-- [**在评论里 @ 智能体**](/mentioning-agents) —— 更轻量的触发方式,不改 assignee / status
-- [**小队**](/squads) —— 把 issue 分给一组智能体,由队长决定谁接手
-- [**对话**](/chat) —— 脱离 issue 和智能体一对一聊
-- [**Autopilots**](/autopilots) —— 让智能体定时自动开工
+- [在评论中 @智能体](/mentioning-agents) — 不改变负责人,处理新的问题。
+- [执行任务](/tasks) — 查看排队、重试和停止规则。
+- [小队](/squads) — 由 leader 协调多个智能体。
diff --git a/apps/docs/content/docs/auth-setup.ja.mdx b/apps/docs/content/docs/auth-setup.ja.mdx
index e2b07b29b4..87f423873b 100644
--- a/apps/docs/content/docs/auth-setup.ja.mdx
+++ b/apps/docs/content/docs/auth-setup.ja.mdx
@@ -1,186 +1,156 @@
---
-title: ログインとサインアップの構成
-description: メール + 認証コードログイン、Google OAuth、サインアップ許可リスト、ローカルテストコードを構成します。
+title: ログインとサインアップ
+description: メール認証コード、Google ログイン、新規登録の範囲を設定します。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-Multica は 2 つのログイン方式をサポートしています。**メール + 認証コード**(デフォルト)と **Google OAuth**(オプション)です。ログインに成功すると、サーバーは 30 日間有効な JWT クッキーを発行します。このページでは、各方式の構成方法、誰がサインアップできるかを制限する方法、そしてセルフホストのデプロイで最も陥りやすい落とし穴を 1 つ取り上げます。
+Multica はデフォルトでメール認証コードによるログインを使い、Google OAuth を追加することもできます。既存のユーザーはいつでも再ログインできます。サインアップ制限は、新しいアカウントを作成できるかどうかだけを決めます。
-以下で参照する環境変数の一覧は[環境変数](/environment-variables)を参照してください。トークンの使い方とライフサイクルの詳細は[認証とトークン](/auth-tokens)を参照してください。
+## メール認証コード
-## メール + 認証コードログインの仕組み
+ユーザーがメールアドレスを入力すると、Multica は 6 桁の認証コードを送信します。コードは 10 分間有効で、検証に成功するとブラウザにログイン cookie が発行されます。
-ユーザーがログインページでメールを入力します → サーバーが 6 桁のコードを送信します → ユーザーがコードを入力します → サーバーがコードを検証します → JWT クッキーが発行されます。標準的なフローです。2 つの送信バックエンドがサポートされているので、デプロイ環境に合うほうを選んでください。
+メールは Resend または SMTP で送信できます。両方を設定した場合は `SMTP_HOST` が優先されます。
-### オプション A: Resend(クラウド / 公開インターネットのデプロイに推奨)
+### Resend を使う
-1. [Resend](https://resend.com/) アカウントを作成し、ドメインを認証します
-2. API キーを作成します
-3. 環境変数を設定します:
+1. [Resend](https://resend.com/) で送信ドメインを検証し、API key を作成します。
+2. 次を設定します:
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
- [email protected] # must be a domain verified in Resend
- ```
+ ```dotenv
+ RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
+ ```
-4. サーバーを再起動します
+3. API サービスを再起動します。
-### オプション B: SMTP relay(セルフホスト / オンプレミスのデプロイ用)
+`RESEND_FROM_EMAIL` は、Resend で検証済みのドメインに属している必要があります。
-デプロイ環境から `api.resend.com` に到達できない場合や、すでに内部メール relay(Microsoft Exchange、Postfix、オンプレミスの SendGrid など)がある場合に使用してください。両方が設定されている場合は `SMTP_HOST` が `RESEND_API_KEY` より優先されます。`SMTP_HOST` が空でなければ、`RESEND_API_KEY` も併せて構成されていても、サーバーは常に SMTP を経由するため、認証メールと招待メールが内部ネットワークの外に出ることは決してありません。
+### SMTP を使う
-SMTP 経路は、ほとんどのオンプレミスメールサーバー(特に Microsoft Exchange の receive connector)が公開する 3 つの relay モードをサポートします。
+最低限、ホストと送信元アドレスを設定します:
-| モード | ポート | 認証 | TLS |
-|---|---|---|---|
-| 匿名内部 relay | `25` | なし — IP / サブネットで送信を信頼 | 伝送経路上はなし(内部セグメント専用) |
-| 認証付き送信(submission) | `587` | `SMTP_USERNAME` + `SMTP_PASSWORD` | STARTTLS、自動アップグレード |
-| 暗黙的 TLS(SMTPS) | `465` | 任意(`SMTP_USERNAME` + `SMTP_PASSWORD`) | 接続時に TLS ハンドシェイク — ポート `465` で自動的に有効化、非標準ポートでは `SMTP_TLS=implicit` で強制 |
-
-**ポート 25 の匿名 Exchange relay** — 認証情報なしで信頼されたサブネットからのメールを受け入れる、典型的な「internal SMTP relay」/ Exchange 匿名 receive connector:
-
-```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # reused as the From: header
-```
-
-**ポート 587 の認証付き送信** — サービスアカウントを必要とする relay 用。サーバーが STARTTLS のサポートを通知すると自動的にアップグレードされます:
-
-```bash
-SMTP_HOST=smtp.internal.example.com
+```dotenv
+SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # set true only for self-signed / private CA
+SMTP_PASSWORD=<password>
```
-**ポート 465 の暗黙的 TLS(SMTPS)** — SMTPS のみを提供し STARTTLS を通知しないプロバイダー(例: Aliyun / Tencent のエンタープライズメール)向け。ポート `465` は暗黙的 TLS を自動的に有効化します。`SMTP_TLS=implicit`(別名: `smtps`、`ssl`)は非標準の SMTPS ポートでこれを強制します:
+一般的な接続方式:
-```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465 # implicit TLS auto-enabled on 465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # optional on 465; required on a non-standard SMTPS port
-```
+| シナリオ | 設定 |
+|---|---|
+| 内部の匿名 relay | `SMTP_PORT=25`。ユーザー名とパスワードは空のまま |
+| STARTTLS | `SMTP_PORT=587`。サーバーが対応していればデフォルトで TLS にアップグレード |
+| 暗黙的 TLS | `SMTP_PORT=465`、または `SMTP_TLS=implicit` を明示的に設定 |
-**厳格な公開 relay(例: Google Workspace `smtp-relay.gmail.com`)** はさらに有効な EHLO 名を必要とします。これらの relay は公開 IP からのデフォルトの `localhost` 挨拶を拒否し、relay が接続を切断します — これは挨拶の時点ではなく、後続のコマンドで不明瞭な `EOF`(`smtp auth: EOF`)として表面化します。`SMTP_EHLO_NAME` を relay が期待する FQDN に設定してください。デフォルトはマシンのホスト名で、コンテナ内では通常は有効な FQDN ではありません。
+`SMTP_FROM_EMAIL` が未設定の場合は `RESEND_FROM_EMAIL` にフォールバックします。プライベート CA や自己署名証明書を使う場合は、CA をコンテナの信頼ストアに追加してください。`SMTP_TLS_INSECURE=true` は証明書検証をスキップするため、信頼できる内部ネットワークで一時的に使う場合に限ってください。
-```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # FQDN the relay accepts; defaults to the (non-FQDN) container hostname
-```
+一部の厳格な relay は、有効な EHLO 名も要求します:
-起動時に、サーバーは選択したプロバイダーを、ネゴシエートされた TLS モードも含めて出力します。例えば `EmailService: SMTP relay exchange.internal.example.com:25 (starttls) [email protected]` や `… smtp.qiye.aliyun.com:465 (implicit-tls) from=…`(または `Resend API` / `DEV mode`)のように表示されます。パスワードがログに記録されることは決してありません。再起動後に SMTP の行が見えない場合は `SMTP_HOST` がプロセスに届いていないので、コンテナ環境(`docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP`)を確認してください。
+```dotenv
+SMTP_EHLO_NAME=mail.example.com
+```
-**どちらも設定しない場合**: サーバーはエラーを出しませんが、**送信されるはずだったすべてのメールがサーバーの stdout にのみ書き出されます**。ローカル開発には便利ですが(ログからコードをコピーできます)、プロダクションではブラックホールになります。
+### メールサービスがない場合の動作
-## 固定ローカルテストコード
+サーバーは起動しますが、認証コードと招待リンクはログに書き込まれるだけで、メールは送信されません。ローカル開発には向きますが、プロダクションには向きません。
-<Callout type="warning">
-**公開アクセス可能なインスタンスでは固定の認証コードを有効にしないでください。**
+起動ログには、現在使っているのが `Resend API`、`SMTP relay`、`DEV mode` のどれかが表示されます。
-非プロダクションのインスタンスがデフォルトで `888888` を受け入れていた従来の動作は削除されました。明示的に構成しない限り、`888888` の入力は他の誤ったコードと同じように扱われます。
+## ローカル固定認証コード
-メールバックエンドをまったく構成していない(Resend も SMTP もない)ローカル開発では、サーバーログに出力される生成されたコードを使用してください。決定論的なローカル / プライベートの自動化が必要な場合は、`MULTICA_DEV_VERIFICATION_CODE` を `888888` のような 6 桁の値に設定し、`APP_ENV` を非プロダクションに保ってください:
+ローカルの自動テストでは、固定の認証コードを設定できます:
-```bash
+```dotenv
APP_ENV=development
MULTICA_DEV_VERIFICATION_CODE=888888
```
-このショートカットは `APP_ENV=production` のときは無視されます。
-</Callout>
+認証コードは 6 桁の数字である必要があります。`APP_ENV=production` のときは固定コードは無視されます。
-プロダクションのデプロイでは `MULTICA_DEV_VERIFICATION_CODE` を空のままにし、`APP_ENV=production` に設定してください。`make selfhost` / `docker-compose.selfhost.yml` でデプロイする場合、`APP_ENV` はデフォルトで `production` です。
+<Callout type="warning">
+公開インスタンスで固定認証コードを有効にしないでください。プロダクションの組み合わせは `APP_ENV=production` と空の `MULTICA_DEV_VERIFICATION_CODE` です。
+</Callout>
-## Google OAuth の構成
+## Google ログイン
-オプションです。構成しないとメール + 認証コードのみが利用可能で、構成するとログインページに「Sign in with Google」ボタンが追加されます。
+1. [Google Cloud Console](https://console.cloud.google.com/) で OAuth 2.0 client を作成します。
+2. Multica フロントエンドのコールバックアドレスを **Authorized redirect URIs** に追加します:
-1. [Google Cloud Console](https://console.cloud.google.com/) で OAuth 2.0 クライアントを作成します
-2. **Authorized redirect URIs** を Multica フロントエンドのアドレスに `/auth/callback` を加えた値に設定します。例:
+ ```text
+ https://multica.example.com/auth/callback
+ ```
- ```text
- https://multica.yourdomain.com/auth/callback
- ```
+3. 次を設定します:
-3. クライアント ID とクライアント secret を取得したら、3 つの環境変数を設定します:
+ ```dotenv
+ GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
+ GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
+ GOOGLE_REDIRECT_URI=https://multica.example.com/auth/callback
+ ```
- ```bash
- GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
- GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
- GOOGLE_REDIRECT_URI=https://multica.yourdomain.com/auth/callback
- ```
+4. API サービスを再起動します。
-4. サーバーを再起動します。
+Google Console と `GOOGLE_REDIRECT_URI` のアドレスは、プロトコル、ポート、末尾のスラッシュを含めて完全に一致している必要があります。設定が反映されると、ログインページに Google ログインボタンが表示されます。フロントエンドイメージの再ビルドは不要です。
-**ランタイムで反映されます**: フロントエンドは `/api/config` を通じてランタイムにこれらの設定を読み込みます — 変更後にサーバーを再起動すると、フロントエンドはリビルドや再デプロイなしで新しい値を取得します。
+## サインアップ制限
-<Callout type="warning">
-**リダイレクト URI は Google Console と `GOOGLE_REDIRECT_URI` の両方で完全に一致している必要があります** — プロトコル(`http` と `https`)、末尾のスラッシュ、ポートを含みます。少しでも一致しないと Google は OAuth フロー全体を拒否し、ユーザーに表示されるエラーは `redirect_uri_mismatch` です。
-</Callout>
+3 つの変数が組み合わさって、新しいアカウントを作成できるかどうかを決めます:
-## 誰がサインアップできるかを制限する
+| 変数 | 効果 |
+|---|---|
+| `ALLOWED_EMAILS` | 登録を許可する完全なメールアドレス。複数はカンマ区切り |
+| `ALLOWED_EMAIL_DOMAINS` | 登録を許可するメールドメイン。複数はカンマ区切り |
+| `ALLOW_SIGNUP` | allowlist が一つも設定されていない場合に新規登録を許可するか。デフォルトは `true` |
-3 つの環境変数が優先順位に従って組み合わされます。
+判定順序は次のとおりです:
-<Mermaid chart={`
-graph TD
- Start[New user first sign-in] --> A{Email in<br/>ALLOWED_EMAILS?}
- A -- Yes --> Allow[Allow signup]
- A -- No --> B{Domain in<br/>ALLOWED_EMAIL_DOMAINS?}
- B -- Yes --> Allow
- B -- No --> C{Any allowlist<br/>non-empty?}
- C -- Yes --> Block[Reject]
- C -- No --> D{ALLOW_SIGNUP<br/>= true?}
- D -- Yes --> Allow
- D -- No --> Block
-`} />
+1. メールアドレスが `ALLOWED_EMAILS` に一致すれば許可。
+2. またはドメインが `ALLOWED_EMAIL_DOMAINS` に一致すれば許可。
+3. どちらにも一致せず、`ALLOW_SIGNUP=false` なら拒否。
+4. `ALLOW_SIGNUP=true` でも、いずれかの allowlist が設定されていて一致しなければ、やはり拒否。
+5. allowlist が一つも設定されておらず、`ALLOW_SIGNUP=true` なら許可。
-**既存のユーザーはいつでも再ログインできます** — サインアップ許可リストは**初回サインアップ**にのみ適用され、戻ってくるユーザーは妨げられません。
+よくある設定:
-- **`ALLOWED_EMAILS`**(最高優先度) — 明示的なメール許可リスト、カンマ区切り。**空でない場合、リストにあるメールのみがサインアップできます。**
-- **`ALLOWED_EMAIL_DOMAINS`** — ドメイン許可リスト、カンマ区切り(例: `company.io,partner.com`)。
-- **`ALLOW_SIGNUP`** — マスタースイッチ、デフォルト `true`。`false` に設定するとサインアップが完全に無効になります。
+```dotenv
+# 会社ドメインのみ許可
+ALLOW_SIGNUP=false
+ALLOWED_EMAIL_DOMAINS=company.com
-<Callout type="warning">
-**3 つの層は OR ではなく AND のセマンティクスです。** よくある誤った直感は、`ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true` が「company.io に加えて他の全員を許可する」という意味だと考えることです。そうでは**ありません**。いずれかの層に空でない値があると、**それに一致しないメールはただちに拒否され**、`ALLOW_SIGNUP=true` はそれを無効にできません。
+# 外部コラボレーターを 1 人追加で許可
+```
-実際に「全員を許可」するには、3 つの変数をすべて空のままにしてください(または `ALLOW_SIGNUP=true` を維持してください)。
+<Callout type="info">
+2 つの allowlist は、`ALLOW_SIGNUP=false` のときには明示的な例外リストとしても機能します。
</Callout>
-**典型的な構成**:
+## 招待とサインアップ制限
-| 目的 | 構成 |
-|---|---|
-| 内部専用、`company.io` の従業員のみ | `ALLOWED_EMAIL_DOMAINS=company.io` |
-| 内部 + 少数の外部コラボレーター | `ALLOWED_EMAIL_DOMAINS=company.io` + コラボレーターのアドレスを `ALLOWED_EMAILS` に追加 |
-| セルフサービスのサインアップを完全に無効化、招待のみ | `ALLOW_SIGNUP=false` |
-| 開放型サインアップ(プロダクションには非推奨) | 3 つすべて空 |
+招待はサインアップ制限を自動的には迂回しません:
-## サインアップを無効にしても人を招待できますか?
+- 相手がすでに Multica アカウントを持っている場合は、ログインして招待を受諾できます。
+- まだアカウントがない場合は、そのメールアドレスが上記のサインアップルールを満たす必要があります。
-**すでに Multica アカウントを持っている人のみ可能です。** 招待の受諾はサインアップ許可リストをチェックしません — 招待された人がすでにサインアップ済み(例えば別のワークスペースで)であれば、招待リンクをクリックしてログインすれば受諾できます。
+オープンなサインアップを無効にしたインスタンスで新しいメンバーを招待するときは、先に相手のメールアドレスを `ALLOWED_EMAILS` に追加してください。アカウントが作成され、招待が受諾されたら、エントリを削除して構いません。
-**しかし一度もサインアップしていない人は招待で救うことはできません。** 受諾する前にまずログインする必要があり、ログインの最初のステップ(認証コードの要求)はサインアップ許可リストのチェックを通過します。`ALLOW_SIGNUP=false` であるか、そのメールが `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS` にない場合、**サインアップを完了できず**、したがって招待を受諾することもできません。
+## セッション有効期間
-まだサインアップしていない外部コラボレーターを招待するには: そのメールを `ALLOWED_EMAILS` に一時的に追加し、その人がサインアップして招待を受諾するのを待ってから、エントリを削除してください。
+ブラウザのログインは、デフォルトで 30 日間保持されます。`AUTH_TOKEN_TTL` で調整でき、Go duration または正の整数秒を受け付けます:
+
+```dotenv
+AUTH_TOKEN_TTL=720h
+```
-招待の作成と使用方法については[メンバーとロール](/members-roles)を参照してください。
+変更後は API サービスの再起動が必要です。この値は、それ以降に発行されるログイン cookie と JWT にのみ影響し、発行済みのトークンを延長することはありません。
-## 次に
+## 次のステップ
-- [環境変数](/environment-variables) — このページで使用するすべての変数の完全な定義
-- [認証とトークン](/auth-tokens) — JWT / PAT / デーモントークンの分類と使い方
-- [トラブルシューティング](/troubleshooting) — 認証コードが届かない、OAuth `redirect_uri_mismatch`、サインアップ拒否
+- [環境変数](/environment-variables) — 変数の完全なリファレンス。
+- [認証とトークン](/auth-tokens) — ログインセッションとトークンの種類。
+- [メンバーとロール](/members-roles) — 招待とロール。
diff --git a/apps/docs/content/docs/auth-setup.ko.mdx b/apps/docs/content/docs/auth-setup.ko.mdx
index 8144dae9f0..79384e74d8 100644
--- a/apps/docs/content/docs/auth-setup.ko.mdx
+++ b/apps/docs/content/docs/auth-setup.ko.mdx
@@ -1,186 +1,156 @@
---
-title: 로그인 및 회원가입 구성
-description: 이메일 + 인증 코드 로그인, Google OAuth, 회원가입 허용 목록, 로컬 테스트 코드를 구성합니다.
+title: 로그인과 가입
+description: 이메일 인증 코드, Google 로그인, 신규 사용자 가입 범위를 설정합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-Multica는 두 가지 로그인 방식을 지원합니다. **이메일 + 인증 코드**(기본값)와 **Google OAuth**(선택). 로그인에 성공하면 서버가 30일 수명의 JWT 쿠키를 발급합니다. 이 페이지에서는 각 방식을 구성하는 방법, 누가 회원가입할 수 있는지 제한하는 방법, 그리고 자체 호스팅 배포에서 가장 빠지기 쉬운 함정 하나를 다룹니다.
+Multica는 기본적으로 이메일 인증 코드로 로그인하며 Google OAuth를 추가할 수도 있습니다. 기존 사용자는 언제든 다시 로그인할 수 있습니다. 가입 제한은 새 계정을 만들 수 있는지만 결정합니다.
-아래에서 참조하는 환경 변수 목록은 [환경 변수](/environment-variables)를 참고하세요. 토큰 사용법과 수명 주기 세부 사항은 [인증 및 토큰](/auth-tokens)을 참고하세요.
+## 이메일 인증 코드
-## 이메일 + 인증 코드 로그인의 작동 방식
+사용자가 이메일을 입력하면 Multica가 6자리 인증 코드를 보냅니다. 코드는 10분 동안 유효하며 인증에 성공하면 브라우저에 로그인 cookie가 발급됩니다.
-사용자가 로그인 페이지에서 이메일을 입력합니다 → 서버가 6자리 코드를 보냅니다 → 사용자가 코드를 입력합니다 → 서버가 코드를 검증합니다 → JWT 쿠키가 발급됩니다. 표준 흐름입니다. 두 가지 전송 백엔드가 지원되므로 배포 환경에 맞는 쪽을 선택하세요.
+이메일은 Resend 또는 SMTP로 보낼 수 있습니다. 둘 다 설정하면 `SMTP_HOST`가 우선합니다.
-### 옵션 A: Resend (클라우드 / 공용 인터넷 배포에 권장)
+### Resend 사용
-1. [Resend](https://resend.com/) 계정을 만들고 도메인을 인증합니다
-2. API 키를 생성합니다
-3. 환경 변수를 설정합니다:
+1. [Resend](https://resend.com/)에서 발신 도메인을 인증하고 API key를 만듭니다.
+2. 다음을 설정합니다.
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
- [email protected] # must be a domain verified in Resend
- ```
+ ```dotenv
+ RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
+ ```
-4. 서버를 재시작합니다
+3. API 서비스를 다시 시작합니다.
-### 옵션 B: SMTP relay (자체 호스팅 / 온프레미스 배포용)
+`RESEND_FROM_EMAIL`은 Resend에서 인증한 도메인에 속해야 합니다.
-배포 환경에서 `api.resend.com`에 접근할 수 없거나 이미 내부 메일 relay(Microsoft Exchange, Postfix, 온프레미스 SendGrid 등)가 있는 경우에 사용하세요. 둘 다 설정된 경우 `SMTP_HOST`가 `RESEND_API_KEY`보다 우선합니다. `SMTP_HOST`가 비어 있지 않으면 `RESEND_API_KEY`도 함께 구성되어 있더라도 서버는 항상 SMTP를 통하므로, 인증 및 초대 메일이 내부 네트워크를 벗어나는 일이 결코 없습니다.
+### SMTP 사용
-SMTP 경로는 대부분의 온프레미스 메일 서버(특히 Microsoft Exchange의 receive connector)가 노출하는 세 가지 relay 모드를 지원합니다:
+최소한 host와 발신 주소를 설정해야 합니다.
-| 모드 | 포트 | 인증 | TLS |
-|---|---|---|---|
-| 익명 내부 relay | `25` | 없음 — IP / 서브넷으로 제출을 신뢰 | 전송 경로상 없음(내부 세그먼트 전용) |
-| 인증된 제출(submission) | `587` | `SMTP_USERNAME` + `SMTP_PASSWORD` | STARTTLS, 자동 업그레이드 |
-| 암묵적 TLS (SMTPS) | `465` | 선택 사항(`SMTP_USERNAME` + `SMTP_PASSWORD`) | 연결 시 TLS 핸드셰이크 — 포트 `465`에서 자동 활성화, 비표준 포트에서는 `SMTP_TLS=implicit`로 강제 |
-
-**포트 25의 익명 Exchange relay** — 자격 증명 없이 신뢰된 서브넷에서 오는 메일을 받아들이는 일반적인 "internal SMTP relay" / Exchange 익명 receive connector:
-
-```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # reused as the From: header
-```
-
-**포트 587의 인증된 제출** — 서비스 계정이 필요한 relay용. 서버가 STARTTLS 지원을 알리면 자동으로 업그레이드됩니다:
-
-```bash
-SMTP_HOST=smtp.internal.example.com
+```dotenv
+SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # set true only for self-signed / private CA
+SMTP_PASSWORD=<password>
```
-**포트 465의 암묵적 TLS(SMTPS)** — SMTPS만 제공하고 STARTTLS를 알리지 않는 제공자(예: Aliyun / Tencent 엔터프라이즈 메일)용. 포트 `465`는 암묵적 TLS를 자동으로 활성화하며, `SMTP_TLS=implicit`(별칭: `smtps`, `ssl`)는 비표준 SMTPS 포트에서 이를 강제합니다:
+일반적인 연결 방식은 다음과 같습니다.
-```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465 # implicit TLS auto-enabled on 465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # optional on 465; required on a non-standard SMTPS port
-```
+| 환경 | 설정 |
+|---|---|
+| 내부 네트워크 익명 relay | `SMTP_PORT=25`, 사용자 이름과 비밀번호는 비워 둠 |
+| STARTTLS | `SMTP_PORT=587`, 서버가 지원하면 기본적으로 TLS로 업그레이드 |
+| 암시적 TLS | `SMTP_PORT=465` 또는 `SMTP_TLS=implicit` 명시 |
-**엄격한 공개 relay(예: Google Workspace `smtp-relay.gmail.com`)** 는 추가로 유효한 EHLO 이름을 요구합니다. 이들은 공개 IP에서 보내는 기본 `localhost` greeting을 거부하며, relay가 연결을 끊습니다 — 이는 greeting 단계가 아니라 이후 명령에서 불투명한 `EOF`(`smtp auth: EOF`)로 나타납니다. relay가 기대하는 FQDN으로 `SMTP_EHLO_NAME`을 설정하세요. 기본값은 머신 호스트명이며, 컨테이너 안에서는 보통 유효한 FQDN이 아닙니다:
+`SMTP_FROM_EMAIL`을 설정하지 않으면 `RESEND_FROM_EMAIL`을 사용합니다. 사설 CA 또는 자체 서명 인증서를 사용하려면 컨테이너 신뢰 저장소에 CA를 추가해야 합니다. `SMTP_TLS_INSECURE=true`는 인증서 검증을 건너뛰므로 신뢰할 수 있는 내부 네트워크에서만 임시로 사용하세요.
-```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # FQDN the relay accepts; defaults to the (non-FQDN) container hostname
-```
+일부 엄격한 relay에는 유효한 EHLO 이름도 필요합니다.
-시작 시 서버는 협상된 TLS 모드를 포함하여 선택한 제공자를 출력합니다. 예를 들어 `EmailService: SMTP relay exchange.internal.example.com:25 (starttls) [email protected]` 또는 `… smtp.qiye.aliyun.com:465 (implicit-tls) from=…`(또는 `Resend API` / `DEV mode`)와 같이 표시됩니다. 비밀번호는 절대 로그에 기록되지 않습니다. 재시작 후 SMTP 줄이 보이지 않는다면 `SMTP_HOST`가 프로세스에 도달하지 못한 것이므로, 컨테이너 환경(`docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP`)을 확인하세요.
+```dotenv
+SMTP_EHLO_NAME=mail.example.com
+```
-**둘 다 설정하지 않으면**: 서버는 오류를 내지 않지만, **전송되어야 했던 모든 이메일이 서버의 stdout에만 기록됩니다**. 로컬 개발에는 편리하지만(로그에서 코드를 복사하면 됩니다), 프로덕션에서는 블랙홀이 됩니다.
+### 이메일 서비스가 없을 때의 동작
-## 고정 로컬 테스트 코드
+서버는 계속 시작되지만 인증 코드와 초대 링크가 이메일로 전송되지 않고 로그에만 기록됩니다. 로컬 개발에는 적합하지만 프로덕션 환경에는 적합하지 않습니다.
-<Callout type="warning">
-**공용으로 접근 가능한 인스턴스에서는 고정 인증 코드를 활성화하지 마세요.**
+시작 로그에는 현재 `Resend API`, `SMTP relay`, `DEV mode` 중 무엇을 사용하는지 표시됩니다.
-프로덕션이 아닌 인스턴스가 기본적으로 `888888`을 받아들이던 기존 동작은 제거되었습니다. 명시적으로 구성하지 않는 한 `888888`을 입력하는 것은 다른 잘못된 코드와 동일하게 처리됩니다.
+## 로컬 고정 인증 코드
-이메일 백엔드를 전혀 구성하지 않은(Resend도 SMTP도 없는) 로컬 개발에서는 서버 로그에 출력되는 생성된 코드를 사용해야 합니다. 결정적인 로컬/사설 자동화가 필요하다면 `MULTICA_DEV_VERIFICATION_CODE`를 `888888` 같은 6자리 값으로 설정하고 `APP_ENV`를 프로덕션이 아닌 값으로 유지하세요:
+로컬 자동화 테스트에서는 고정 인증 코드를 설정할 수 있습니다.
-```bash
+```dotenv
APP_ENV=development
MULTICA_DEV_VERIFICATION_CODE=888888
```
-이 단축키는 `APP_ENV=production`일 때 무시됩니다.
-</Callout>
+인증 코드는 6자리 숫자여야 합니다. `APP_ENV=production`에서는 고정 코드가 무시됩니다.
-프로덕션 배포에서는 `MULTICA_DEV_VERIFICATION_CODE`를 비워 두고 `APP_ENV=production`으로 설정해야 합니다. `make selfhost` / `docker-compose.selfhost.yml`로 배포하는 경우 `APP_ENV`는 기본적으로 `production`입니다.
+<Callout type="warning">
+공개 인터넷에 노출된 인스턴스에서 고정 인증 코드를 사용하지 마세요. 프로덕션 환경에서는 `APP_ENV=production`을 사용하고 `MULTICA_DEV_VERIFICATION_CODE`를 비워 둡니다.
+</Callout>
-## Google OAuth 구성
+## Google 로그인
-선택 사항입니다. 구성하지 않으면 이메일 + 인증 코드만 사용할 수 있고, 구성하면 로그인 페이지에 "Google로 로그인" 버튼이 추가됩니다.
+1. [Google Cloud Console](https://console.cloud.google.com/)에서 OAuth 2.0 client를 만듭니다.
+2. Multica 프런트엔드의 callback 주소를 **Authorized redirect URIs**에 추가합니다.
-1. [Google Cloud Console](https://console.cloud.google.com/)에서 OAuth 2.0 클라이언트를 생성합니다
-2. **승인된 리디렉션 URI**(Authorized redirect URIs)를 Multica 프런트엔드 주소에 `/auth/callback`을 더한 값으로 설정합니다. 예:
+ ```text
+ https://multica.example.com/auth/callback
+ ```
- ```text
- https://multica.yourdomain.com/auth/callback
- ```
+3. 다음을 설정합니다.
-3. 클라이언트 ID와 클라이언트 secret을 얻은 후 세 개의 환경 변수를 설정합니다:
+ ```dotenv
+ GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
+ GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
+ GOOGLE_REDIRECT_URI=https://multica.example.com/auth/callback
+ ```
- ```bash
- GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
- GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
- GOOGLE_REDIRECT_URI=https://multica.yourdomain.com/auth/callback
- ```
+4. API 서비스를 다시 시작합니다.
-4. 서버를 재시작합니다.
+Google Console과 `GOOGLE_REDIRECT_URI`의 주소는 프로토콜, 포트, 마지막 슬래시까지 완전히 같아야 합니다. 설정이 적용되면 로그인 페이지에 Google 로그인 버튼이 표시됩니다. 프런트엔드 이미지를 다시 빌드할 필요는 없습니다.
-**런타임에 적용됨**: 프런트엔드는 `/api/config`를 통해 런타임에 이 설정을 읽습니다. 변경 후 서버를 재시작하면 프런트엔드가 다시 빌드하거나 다시 배포할 필요 없이 새 값을 가져옵니다.
+## 가입 범위 제어
-<Callout type="warning">
-**리디렉션 URI는 Google Console과 `GOOGLE_REDIRECT_URI` 양쪽에서 정확히 일치해야 합니다** — 프로토콜(`http` vs `https`), 끝의 슬래시, 포트까지 포함합니다. 조금이라도 일치하지 않으면 Google이 전체 OAuth 흐름을 거부하며, 사용자에게 표시되는 오류는 `redirect_uri_mismatch`입니다.
-</Callout>
+세 변수가 새 계정을 만들 수 있는지 함께 결정합니다.
-## 누가 회원가입할 수 있는지 제한하기
+| 변수 | 역할 |
+|---|---|
+| `ALLOWED_EMAILS` | 허용할 전체 이메일 주소, 여러 값은 쉼표로 구분 |
+| `ALLOWED_EMAIL_DOMAINS` | 허용할 이메일 도메인, 여러 값은 쉼표로 구분 |
+| `ALLOW_SIGNUP` | allowlist가 없을 때 가입 허용 여부, 기본값 `true` |
-세 개의 환경 변수가 우선순위에 따라 조합됩니다:
+판단 순서는 다음과 같습니다.
-<Mermaid chart={`
-graph TD
- Start[New user first sign-in] --> A{Email in<br/>ALLOWED_EMAILS?}
- A -- Yes --> Allow[Allow signup]
- A -- No --> B{Domain in<br/>ALLOWED_EMAIL_DOMAINS?}
- B -- Yes --> Allow
- B -- No --> C{Any allowlist<br/>non-empty?}
- C -- Yes --> Block[Reject]
- C -- No --> D{ALLOW_SIGNUP<br/>= true?}
- D -- Yes --> Allow
- D -- No --> Block
-`} />
+1. 이메일이 `ALLOWED_EMAILS`와 일치하면 허용합니다.
+2. 또는 도메인이 `ALLOWED_EMAIL_DOMAINS`와 일치하면 허용합니다.
+3. 어느 것과도 일치하지 않고 `ALLOW_SIGNUP=false`이면 거부합니다.
+4. `ALLOW_SIGNUP=true`여도 하나 이상의 allowlist가 설정되어 있고 일치하지 않으면 거부합니다.
+5. allowlist가 없고 `ALLOW_SIGNUP=true`이면 허용합니다.
-**기존 사용자는 언제든 다시 로그인할 수 있습니다** — 회원가입 허용 목록은 **최초 회원가입**에만 적용되며, 돌아오는 사용자는 막지 않습니다.
+일반적인 설정:
-- **`ALLOWED_EMAILS`** (최고 우선순위) — 명시적 이메일 허용 목록, 쉼표로 구분합니다. **비어 있지 않으면 목록에 있는 이메일만 회원가입할 수 있습니다.**
-- **`ALLOWED_EMAIL_DOMAINS`** — 도메인 허용 목록, 쉼표로 구분합니다(예: `company.io,partner.com`).
-- **`ALLOW_SIGNUP`** — 마스터 스위치, 기본값 `true`. `false`로 설정하면 회원가입이 완전히 비활성화됩니다.
+```dotenv
+# 회사 도메인만 허용
+ALLOW_SIGNUP=false
+ALLOWED_EMAIL_DOMAINS=company.com
-<Callout type="warning">
-**세 계층은 OR가 아니라 AND 의미입니다.** 흔한 잘못된 직관은 `ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true`가 "company.io에 더해 다른 모든 사람을 허용"한다는 것입니다. 그렇지 **않습니다**. 어느 계층이든 비어 있지 않은 값이 있으면 **그에 일치하지 않는 이메일은 곧바로 거부되며**, `ALLOW_SIGNUP=true`는 그것을 무효로 만들지 못합니다.
+# 외부 협업자 한 명 추가 허용
+```
-실제로 "모두 허용"하려면 세 변수를 모두 비워 두세요(또는 `ALLOW_SIGNUP=true`를 유지하세요).
+<Callout type="info">
+`ALLOW_SIGNUP=false`일 때도 두 allowlist를 명시적인 예외 목록으로 사용할 수 있습니다.
</Callout>
-**일반적인 구성**:
+## 초대와 가입 제한
-| 목표 | 구성 |
-|---|---|
-| 내부 전용, `company.io` 직원만 | `ALLOWED_EMAIL_DOMAINS=company.io` |
-| 내부 + 소수의 외부 협업자 | `ALLOWED_EMAIL_DOMAINS=company.io` + 협업자 주소를 `ALLOWED_EMAILS`에 추가 |
-| 셀프서비스 회원가입을 완전히 비활성화, 초대 전용 | `ALLOW_SIGNUP=false` |
-| 개방형 회원가입(프로덕션에는 권장하지 않음) | 셋 다 비움 |
+초대는 가입 제한을 자동으로 우회하지 않습니다.
-## 회원가입을 비활성화해도 사람을 초대할 수 있나요?
+- 상대방에게 이미 Multica 계정이 있으면 로그인하고 초대를 수락할 수 있습니다.
+- 상대방에게 계정이 없으면 이메일이 위의 가입 규칙을 만족해야 합니다.
-**이미 Multica 계정이 있는 사람만 가능합니다.** 초대 수락은 회원가입 허용 목록을 확인하지 않습니다. 초대받은 사람이 이미 회원가입한 상태라면(예: 다른 워크스페이스에서), 초대 링크를 클릭하고 로그인하면 수락할 수 있습니다.
+공개 가입을 닫은 인스턴스에서 새 멤버를 초대할 때는 먼저 상대방 이메일을 `ALLOWED_EMAILS`에 추가하세요. 계정을 만들고 초대를 수락한 뒤 목록에서 다시 제거할 수 있습니다.
-**하지만 한 번도 회원가입하지 않은 사람은 초대로 구제할 수 없습니다.** 수락하기 전에 먼저 로그인해야 하고, 로그인의 첫 단계(인증 코드 요청)는 회원가입 허용 목록 검사를 거칩니다. `ALLOW_SIGNUP=false`이거나 그들의 이메일이 `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS`에 없으면 **회원가입을 완료할 수 없으며**, 따라서 초대도 수락할 수 없습니다.
+## 로그인 유효 기간
-아직 회원가입하지 않은 외부 협업자를 초대하려면: 그들의 이메일을 `ALLOWED_EMAILS`에 임시로 추가하고, 그들이 회원가입하고 초대를 수락하기를 기다린 다음 항목을 제거하세요.
+브라우저 로그인은 기본적으로 30일 동안 유지됩니다. `AUTH_TOKEN_TTL`로 조정할 수 있으며 Go duration 또는 양의 정수 초를 지원합니다.
+
+```dotenv
+AUTH_TOKEN_TTL=720h
+```
-초대를 만들고 사용하는 방법은 [멤버 및 역할](/members-roles)을 참고하세요.
+변경 후 API 서비스를 다시 시작해야 합니다. 이 값은 이후 발급되는 로그인 cookie와 JWT에만 적용되며 이미 발급된 token의 기간은 연장하지 않습니다.
-## 다음
+## 다음 단계
-- [환경 변수](/environment-variables) — 이 페이지에서 사용하는 모든 변수의 전체 정의
-- [인증 및 토큰](/auth-tokens) — JWT / PAT / 데몬 토큰의 분류와 사용법
-- [문제 해결](/troubleshooting) — 인증 코드 미수신, OAuth `redirect_uri_mismatch`, 회원가입 거부
+- [환경 변수](/environment-variables) — 전체 변수 참조를 확인합니다.
+- [인증과 토큰](/auth-tokens) — 로그인 세션과 토큰 유형을 알아봅니다.
+- [멤버와 권한](/members-roles) — 초대와 역할을 알아봅니다.
diff --git a/apps/docs/content/docs/auth-setup.mdx b/apps/docs/content/docs/auth-setup.mdx
index d3f76fe70f..8d7f24acb9 100644
--- a/apps/docs/content/docs/auth-setup.mdx
+++ b/apps/docs/content/docs/auth-setup.mdx
@@ -1,186 +1,156 @@
---
-title: Sign-in and signup configuration
-description: Configure email + verification code sign-in, Google OAuth, signup allowlists, and local test codes.
+title: Sign-in and signup
+description: Configure email verification codes, Google sign-in, and who can sign up.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-Multica supports two sign-in methods: **email + verification code** (default) and **Google OAuth** (optional). On successful sign-in, the server issues a JWT cookie with a 30-day lifetime. This page covers how to configure each method, how to restrict who can sign up, and the single biggest trap for self-hosted deployments.
+Multica signs users in with email verification codes by default; Google OAuth can be added on top. Existing users can always sign in again — signup restrictions only decide whether new accounts can be created.
-For the list of environment variables referenced below, see [Environment variables](/environment-variables); for token usage and lifecycle details, see [Authentication and tokens](/auth-tokens).
+## Email verification codes
-## How email + verification code sign-in works
+After the user enters an email address, Multica sends a 6-digit verification code. The code is valid for 10 minutes; once it verifies, the browser receives a sign-in cookie.
-The user enters an email on the sign-in page → the server sends a 6-digit code → the user enters it → the server verifies it → a JWT cookie is issued. Standard flow. Two delivery backends are supported — pick whichever fits your deployment:
+Email can be delivered through Resend or SMTP. When both are configured, `SMTP_HOST` takes priority.
-### Option A: Resend (recommended for cloud / public-internet deployments)
+### Using Resend
-1. Create a [Resend](https://resend.com/) account and verify your domain
-2. Create an API key
-3. Set the environment variables:
+1. Verify a sending domain and create an API key at [Resend](https://resend.com/).
+2. Set:
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
- [email protected] # must be a domain verified in Resend
- ```
+ ```dotenv
+ RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
+ ```
-4. Restart the server
+3. Restart the API service.
-### Option B: SMTP relay (for self-hosted / on-premise deployments)
+`RESEND_FROM_EMAIL` must belong to a domain already verified in Resend.
-Use this when the deployment can't reach `api.resend.com` or you already have an internal mail relay (Microsoft Exchange, Postfix, on-prem SendGrid, etc.). `SMTP_HOST` takes priority over `RESEND_API_KEY` when both are set — if `SMTP_HOST` is non-empty the server always goes through SMTP, even if `RESEND_API_KEY` is also configured, so verification and invite mail never leaves the internal network.
+### Using SMTP
-The SMTP path supports the three relay modes most on-premise mail servers (notably Microsoft Exchange's receive connectors) expose:
+At minimum, set the host and sender address:
-| Mode | Port | Auth | TLS |
-|---|---|---|---|
-| Anonymous internal relay | `25` | none — submission is trusted by IP / subnet | none on the wire (internal segment only) |
-| Authenticated submission | `587` | `SMTP_USERNAME` + `SMTP_PASSWORD` | STARTTLS, upgraded automatically |
-| Implicit TLS (SMTPS) | `465` | optional (`SMTP_USERNAME` + `SMTP_PASSWORD`) | TLS handshake on connect — auto-enabled on port `465`, or force on a non-standard port with `SMTP_TLS=implicit` |
-
-**Anonymous Exchange relay on port 25** — the typical "internal SMTP relay" / Exchange anonymous receive connector that accepts mail from a trusted subnet without credentials:
-
-```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # reused as the From: header
-```
-
-**Authenticated submission on port 587** — for relays that require a service account; STARTTLS is upgraded automatically when the server advertises it:
-
-```bash
-SMTP_HOST=smtp.internal.example.com
+```dotenv
+SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # set true only for self-signed / private CA
+SMTP_PASSWORD=<password>
```
-**Implicit TLS (SMTPS) on port 465** — for providers that only offer SMTPS and don't advertise STARTTLS (e.g. Aliyun / Tencent enterprise mail). Port `465` auto-enables implicit TLS; `SMTP_TLS=implicit` (aliases: `smtps`, `ssl`) forces it on a non-standard SMTPS port:
+Common connection modes:
-```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465 # implicit TLS auto-enabled on 465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # optional on 465; required on a non-standard SMTPS port
-```
+| Scenario | Configuration |
+|---|---|
+| Internal anonymous relay | `SMTP_PORT=25`, leave username and password empty |
+| STARTTLS | `SMTP_PORT=587`; upgrades to TLS by default when the server supports it |
+| Implicit TLS | `SMTP_PORT=465`, or set `SMTP_TLS=implicit` explicitly |
-**Strict public relays (e.g. Google Workspace `smtp-relay.gmail.com`)** additionally require a valid EHLO name. They reject the default `localhost` greeting from a public IP, and the relay drops the connection — which surfaces as an opaque `EOF` on a later command (`smtp auth: EOF`) rather than at the greeting. Set `SMTP_EHLO_NAME` to the FQDN the relay expects; it defaults to the machine hostname, which inside a container is usually not a valid FQDN:
+If `SMTP_FROM_EMAIL` is unset, it falls back to `RESEND_FROM_EMAIL`. Private CAs or self-signed certificates require adding the CA to the container trust store; `SMTP_TLS_INSECURE=true` skips certificate verification and should only be used temporarily on a trusted internal network.
-```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # FQDN the relay accepts; defaults to the (non-FQDN) container hostname
-```
+Some strict relays also require a valid EHLO name:
-At startup the server prints which provider it picked, including the negotiated TLS mode — for example `EmailService: SMTP relay exchange.internal.example.com:25 (starttls) [email protected]` or `… smtp.qiye.aliyun.com:465 (implicit-tls) from=…` (or `Resend API` / `DEV mode`). The password is never logged. If you don't see the SMTP line after restart, `SMTP_HOST` didn't reach the process — check the container env (`docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP`).
+```dotenv
+SMTP_EHLO_NAME=mail.example.com
+```
-**What happens if you set neither**: the server doesn't error, but **every email that should have been sent is written to the server's stdout only**. Handy for local development (copy the code from the logs); in production it's a black hole.
+### Behavior without an email service
-## Fixed local testing codes
+The server still starts, but verification codes and invitation links are only written to the log; no email is sent. This suits local development, not production.
-<Callout type="warning">
-**Do not enable a fixed verification code on a publicly reachable instance.**
+The startup log states whether the current mode is `Resend API`, `SMTP relay`, or `DEV mode`.
-The old behavior where non-production instances accepted `888888` by default has been removed. Unless you explicitly configure it, typing `888888` is treated like any other wrong code.
+## Fixed local verification code
-Local development without any email backend configured (no Resend, no SMTP) should use the generated code printed in server logs. If you need deterministic local/private automation, set `MULTICA_DEV_VERIFICATION_CODE` to a 6-digit value such as `888888`, and keep `APP_ENV` non-production:
+Local automated tests can set a fixed verification code:
-```bash
+```dotenv
APP_ENV=development
MULTICA_DEV_VERIFICATION_CODE=888888
```
-This shortcut is ignored when `APP_ENV=production`.
-</Callout>
+The code must be 6 digits. The fixed code is ignored when `APP_ENV=production`.
-Production deployments should leave `MULTICA_DEV_VERIFICATION_CODE` empty and set `APP_ENV=production`. If you deploy via `make selfhost` / `docker-compose.selfhost.yml`, `APP_ENV` defaults to `production`.
+<Callout type="warning">
+Do not enable a fixed code on a publicly reachable instance. The production combination is `APP_ENV=production` with an empty `MULTICA_DEV_VERIFICATION_CODE`.
+</Callout>
-## Google OAuth configuration
+## Google sign-in
-Optional. Without it, only email + verification code is available; with it, the sign-in page gets a "Sign in with Google" button.
+1. Create an OAuth 2.0 client in the [Google Cloud Console](https://console.cloud.google.com/).
+2. Add the Multica frontend's callback URL to **Authorized redirect URIs**:
-1. Create an OAuth 2.0 client in the [Google Cloud Console](https://console.cloud.google.com/)
-2. Set the **Authorized redirect URIs** to your Multica frontend address plus `/auth/callback`, for example:
+ ```text
+ https://multica.example.com/auth/callback
+ ```
- ```text
- https://multica.yourdomain.com/auth/callback
- ```
+3. Set:
-3. Once you have the client ID and client secret, set three environment variables:
+ ```dotenv
+ GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
+ GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
+ GOOGLE_REDIRECT_URI=https://multica.example.com/auth/callback
+ ```
- ```bash
- GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
- GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
- GOOGLE_REDIRECT_URI=https://multica.yourdomain.com/auth/callback
- ```
+4. Restart the API service.
-4. Restart the server.
+The URLs in the Google Console and in `GOOGLE_REDIRECT_URI` must match exactly, including protocol, port, and trailing slash. Once configured, the sign-in page shows a Google sign-in button; the frontend image needs no rebuild.
-**Takes effect at runtime**: the frontend reads these settings at runtime via `/api/config` — after changing them, restart the server and the frontend picks up the new values with no rebuild or redeploy.
+## Signup restrictions
-<Callout type="warning">
-**The redirect URI must match exactly in both the Google Console and `GOOGLE_REDIRECT_URI`** — including protocol (`http` vs `https`), trailing slash, and port. Any mismatch and Google rejects the entire OAuth flow; the error shown to the user is `redirect_uri_mismatch`.
-</Callout>
+Three variables together decide whether a new account can be created:
-## Restricting who can sign up
+| Variable | Effect |
+|---|---|
+| `ALLOWED_EMAILS` | Full email addresses allowed to sign up, comma-separated |
+| `ALLOWED_EMAIL_DOMAINS` | Email domains allowed to sign up, comma-separated |
+| `ALLOW_SIGNUP` | Whether signup is allowed when no allowlist is configured; defaults to `true` |
-Three environment variables combine by priority:
+The evaluation order is:
-<Mermaid chart={`
-graph TD
- Start[New user first sign-in] --> A{Email in<br/>ALLOWED_EMAILS?}
- A -- Yes --> Allow[Allow signup]
- A -- No --> B{Domain in<br/>ALLOWED_EMAIL_DOMAINS?}
- B -- Yes --> Allow
- B -- No --> C{Any allowlist<br/>non-empty?}
- C -- Yes --> Block[Reject]
- C -- No --> D{ALLOW_SIGNUP<br/>= true?}
- D -- Yes --> Allow
- D -- No --> Block
-`} />
+1. The email matches `ALLOWED_EMAILS` — allow.
+2. Or its domain matches `ALLOWED_EMAIL_DOMAINS` — allow.
+3. With no match, if `ALLOW_SIGNUP=false` — reject.
+4. With `ALLOW_SIGNUP=true` but any allowlist configured and no match — still reject.
+5. With no allowlist configured and `ALLOW_SIGNUP=true` — allow.
-**Existing users can always sign in again** — the signup allowlist only applies to **first-time signup**, not returning users.
+Common configurations:
-- **`ALLOWED_EMAILS`** (highest priority) — explicit email allowlist, comma-separated. **When non-empty, only listed emails can sign up.**
-- **`ALLOWED_EMAIL_DOMAINS`** — domain allowlist, comma-separated (for example `company.io,partner.com`).
-- **`ALLOW_SIGNUP`** — master switch, default `true`. Set `false` to disable signup entirely.
+```dotenv
+# Company domain only
+ALLOW_SIGNUP=false
+ALLOWED_EMAIL_DOMAINS=company.com
-<Callout type="warning">
-**The three layers are AND semantics, not OR.** A common wrong intuition is that `ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true` means "allow company.io plus everyone else." It does **not**. If any layer has a non-empty value, **emails not matching it are rejected outright** — `ALLOW_SIGNUP=true` does not override that.
+# Also admit one external collaborator
+```
-To actually "allow everyone," leave all three variables empty (or keep `ALLOW_SIGNUP=true`).
+<Callout type="info">
+Both allowlists also work as an explicit exception list when `ALLOW_SIGNUP=false`.
</Callout>
-**Typical configurations**:
+## Invitations and signup restrictions
-| Goal | Configuration |
-|---|---|
-| Internal only, employees of `company.io` | `ALLOWED_EMAIL_DOMAINS=company.io` |
-| Internal + a few external collaborators | `ALLOWED_EMAIL_DOMAINS=company.io` + collaborator addresses added to `ALLOWED_EMAILS` |
-| Disable self-serve signup entirely, invite-only | `ALLOW_SIGNUP=false` |
-| Open signup (not recommended for production) | All three empty |
+Invitations do not automatically bypass signup restrictions:
-## Can you still invite people when signup is disabled?
+- If the invitee already has a Multica account, they can sign in and accept the invitation.
+- If they do not, their email must satisfy the signup rules above.
-**Only people who already have a Multica account.** Accepting an invite doesn't check the signup allowlist — if the invitee has signed up already (for example in another workspace), clicking the invite link and signing in lets them accept.
+To invite a new member on an instance with open signup disabled, add their email to `ALLOWED_EMAILS` first. Once the account is created and the invitation accepted, you can remove the entry again.
-**But people who have never signed up cannot be rescued by an invite.** Before accepting, they must sign in, and the first step of sign-in (requesting the verification code) passes through the signup allowlist check. If `ALLOW_SIGNUP=false`, or their email isn't in `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS`, they **cannot complete signup**, and therefore cannot accept the invite.
+## Session lifetime
-To invite an external collaborator who hasn't signed up yet: temporarily add their email to `ALLOWED_EMAILS`, wait for them to sign up and accept the invite, then remove the entry.
+Browser sign-ins last 30 days by default. Adjust with `AUTH_TOKEN_TTL`, which accepts a Go duration or a positive integer of seconds:
+
+```dotenv
+AUTH_TOKEN_TTL=720h
+```
-For how to create and use invites, see [Members and roles](/members-roles).
+Restart the API service after changing it. The value only affects sign-in cookies and JWTs issued afterwards; it does not extend tokens that were already issued.
-## Next
+## Next steps
-- [Environment variables](/environment-variables) — full definitions of every variable used on this page
-- [Authentication and tokens](/auth-tokens) — JWT / PAT / daemon token categories and usage
-- [Troubleshooting](/troubleshooting) — verification code not received, OAuth `redirect_uri_mismatch`, signup rejected
+- [Environment variables](/environment-variables) — the full variable reference.
+- [Authentication and tokens](/auth-tokens) — sign-in sessions and token types.
+- [Members and roles](/members-roles) — invitations and roles.
diff --git a/apps/docs/content/docs/auth-setup.zh.mdx b/apps/docs/content/docs/auth-setup.zh.mdx
index e977d80365..0e46973121 100644
--- a/apps/docs/content/docs/auth-setup.zh.mdx
+++ b/apps/docs/content/docs/auth-setup.zh.mdx
@@ -1,186 +1,156 @@
---
-title: 登录与注册配置
-description: 配 Email 验证码登录、Google OAuth、注册白名单和本地测试验证码。
+title: 登录与注册
+description: 配置邮箱验证码、Google 登录和新用户注册范围。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-Multica 支持两种登录方式:**Email + 验证码**(默认)和 **Google OAuth**(可选)。登录成功后 server 签发一个 30 天有效期的 JWT cookie。这一页讲怎么配、怎么限制谁能注册、以及本地测试验证码怎么安全使用。
+Multica 默认使用邮箱验证码登录,也可以增加 Google OAuth。已经存在的用户始终可以再次登录;注册限制只决定是否允许创建新账号。
-上面用到的环境变量的清单见 [环境变量](/environment-variables);token 怎么用、生命周期细节见 [认证与令牌](/auth-tokens)。
+## 邮箱验证码
-## Email + 验证码登录怎么工作
+用户输入邮箱后,Multica 会发送一个 6 位验证码。验证码 10 分钟内有效,验证成功后浏览器获得登录 cookie。
-用户在登录页输邮箱 → server 发 6 位验证码 → 用户填回 → server 验证 → 签发 JWT cookie。是标准流程。支持两种邮件发送通道,按部署环境二选一:
+邮件可以通过 Resend 或 SMTP 发送。两者同时配置时,`SMTP_HOST` 优先。
-### Option A:Resend(公网/云端部署推荐)
+### 使用 Resend
-1. 在 [Resend](https://resend.com/) 建账号、验证你的域名
-2. 创建 API key
-3. 设环境变量:
+1. 在 [Resend](https://resend.com/) 验证发信域名并创建 API key。
+2. 设置:
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
- [email protected] # 必须是 Resend 已验证的域名
- ```
+ ```dotenv
+ RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
+ ```
-4. 重启 server
+3. 重启 API 服务。
-### Option B:SMTP relay(内网/自部署)
+`RESEND_FROM_EMAIL` 必须属于已经在 Resend 验证的域名。
-适合内网无法访问 `api.resend.com`,或者已经有内部邮件中继(Microsoft Exchange、Postfix、自部署 SendGrid 等)的场景。同时设置时 `SMTP_HOST` 优先级高于 `RESEND_API_KEY`:只要 `SMTP_HOST` 非空,server 一律走 SMTP 路径,即便 `RESEND_API_KEY` 也配着,验证码和邀请邮件也不会经过 Resend 外发出内网。
+### 使用 SMTP
-SMTP 路径覆盖大多数本地邮件服务器(特别是 Microsoft Exchange 的 receive connector)暴露的三种 relay 模式:
+最少需要设置主机和发件地址:
-| 模式 | 端口 | 认证 | TLS |
-|---|---|---|---|
-| 匿名内部 relay | `25` | 无 —— 按 IP / 子网信任 | 链路上无 TLS(仅限内网段) |
-| 认证提交(submission) | `587` | `SMTP_USERNAME` + `SMTP_PASSWORD` | STARTTLS,自动升级 |
-| 隐式 TLS(SMTPS) | `465` | 可选(`SMTP_USERNAME` + `SMTP_PASSWORD`) | 连上即 TLS 握手 —— 端口 `465` 自动启用;非标准端口设 `SMTP_TLS=implicit` 强制开启 |
-
-**匿名 Exchange relay,端口 25** —— 经典的 "internal SMTP relay" / Exchange 匿名 receive connector,按可信子网放行,不要求凭据:
-
-```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # 同时作为 SMTP From: 头
-```
-
-**认证提交,端口 587** —— 需要 service account 的 relay;服务端 advertise STARTTLS 时会自动升级:
-
-```bash
-SMTP_HOST=smtp.internal.example.com
+```dotenv
+SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # 仅在私有 CA / 自签证书时改成 true
+SMTP_PASSWORD=<password>
```
-**隐式 TLS(SMTPS),端口 465** —— 适用于只提供 SMTPS、不广告 STARTTLS 的服务商(例如阿里云 / 腾讯企业邮箱)。端口 `465` 会自动启用隐式 TLS;非标准 SMTPS 端口设置 `SMTP_TLS=implicit`(别名:`smtps`、`ssl`)即可强制开启:
+常见连接方式:
-```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465 # 465 自动启用隐式 TLS
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # 465 上可省略;在非标准 SMTPS 端口上必填
-```
+| 场景 | 配置 |
+|---|---|
+| 内网匿名 relay | `SMTP_PORT=25`,用户名和密码留空 |
+| STARTTLS | `SMTP_PORT=587`,默认会在服务器支持时升级 TLS |
+| 隐式 TLS | `SMTP_PORT=465`,或显式设置 `SMTP_TLS=implicit` |
-**严格公网 relay(例如 Google Workspace `smtp-relay.gmail.com`)**还要求一个合法的 EHLO 名称。它们会拒绝来自公网 IP 的默认 `localhost` 问候,relay 随即断开连接——这不会在问候阶段报错,而是在后续某条命令上表现为一个不知所云的 `EOF`(`smtp auth: EOF`)。把 `SMTP_EHLO_NAME` 设成 relay 期望的 FQDN;它默认取机器主机名,而在容器内这通常不是合法的 FQDN:
+如果没有设置 `SMTP_FROM_EMAIL`,会回退到 `RESEND_FROM_EMAIL`。私有 CA 或自签证书需要把 CA 加入容器信任库;`SMTP_TLS_INSECURE=true` 会跳过证书校验,只应在可信内网中临时使用。
-```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # relay 接受的 FQDN;默认取(非 FQDN 的)容器主机名
-```
+有些严格的 relay 还要求合法的 EHLO 名称:
-启动时 server 会打印当前选择的 provider 和协商出的 TLS 模式,比如 `EmailService: SMTP relay exchange.internal.example.com:25 (starttls) [email protected]` 或 `… smtp.qiye.aliyun.com:465 (implicit-tls) from=…`(或 `Resend API` / `DEV mode`),密码不会出现在日志里。重启后没看到 SMTP 这行,说明 `SMTP_HOST` 没进到进程,确认下容器环境(`docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP`)。
+```dotenv
+SMTP_EHLO_NAME=mail.example.com
+```
-**两种都不配**:server 不报错,但所有本该发出去的邮件**只打到 server 的 stdout**。本地开发方便(你从日志抄验证码),生产环境等于黑洞。
+### 无邮件服务时的行为
-## 固定本地测试验证码
+服务器仍可启动,但验证码和邀请链接只会写入日志,不会发送邮件。这适合本地开发,不适合生产环境。
-<Callout type="warning">
-**不要在公网可访问实例上启用固定验证码。**
+启动日志会说明当前使用的是 `Resend API`、`SMTP relay` 还是 `DEV mode`。
-旧版「非 production 默认接受 `888888`」的行为已经移除。除非你显式配置,否则输入 `888888` 会和普通错误验证码一样被拒绝。
+## 本地固定验证码
-没配任何邮件后端(Resend 和 SMTP 都没设)的本地开发,应使用 server 日志里打印的随机验证码。如果你需要确定性的本地/私有自动化测试,可以把 `MULTICA_DEV_VERIFICATION_CODE` 设成一个 6 位数字,比如 `888888`,并保持 `APP_ENV` 为非 production:
+本地自动化测试可以设置固定验证码:
-```bash
+```dotenv
APP_ENV=development
MULTICA_DEV_VERIFICATION_CODE=888888
```
-`APP_ENV=production` 时这个快捷码会被忽略。
-</Callout>
+验证码必须是 6 位数字。`APP_ENV=production` 时固定验证码会被忽略。
-生产部署应保持 `MULTICA_DEV_VERIFICATION_CODE` 为空,并设置 `APP_ENV=production`。如果你用 `make selfhost` / `docker-compose.selfhost.yml` 自部署,`APP_ENV` 默认就是 `production`。
+<Callout type="warning">
+不要在公网实例中启用固定验证码。生产环境的组合是 `APP_ENV=production` 加空的 `MULTICA_DEV_VERIFICATION_CODE`。
+</Callout>
-## 怎么配 Google OAuth
+## Google 登录
-可选。不配就只有 Email + 验证码登录;配了后登录页会多出「用 Google 登录」按钮。
+1. 在 [Google Cloud Console](https://console.cloud.google.com/) 创建 OAuth 2.0 client。
+2. 把 Multica 前端的回调地址加入 **Authorized redirect URIs**:
-1. 去 [Google Cloud Console](https://console.cloud.google.com/) 创建一个 OAuth 2.0 client
-2. **授权的回调 URI**(Authorized redirect URIs)填你的 Multica 前端地址加 `/auth/callback`,例如:
+ ```text
+ https://multica.example.com/auth/callback
+ ```
- ```text
- https://multica.yourdomain.com/auth/callback
- ```
+3. 设置:
-3. 拿到 client ID 和 client secret 后设三个环境变量:
+ ```dotenv
+ GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
+ GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
+ GOOGLE_REDIRECT_URI=https://multica.example.com/auth/callback
+ ```
- ```bash
- GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
- GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
- GOOGLE_REDIRECT_URI=https://multica.yourdomain.com/auth/callback
- ```
+4. 重启 API 服务。
-4. 重启 server。
+Google Console 与 `GOOGLE_REDIRECT_URI` 中的地址必须完全一致,包括协议、端口和结尾斜杠。配置生效后,登录页会出现 Google 登录按钮;前端镜像不需要重新构建。
-**热生效**:前端通过 `/api/config` 运行时读这些配置——改完只要重启 server,前端不用重建镜像、不用重新部署。
+## 注册范围控制
-<Callout type="warning">
-**回调 URI 在 Google Console 和 `GOOGLE_REDIRECT_URI` 两处必须完全一致**,包括协议(`http` vs `https`)、尾部斜杠、端口。不一致 Google 会拒绝整个 OAuth 流程,用户看到的错误是 `redirect_uri_mismatch`。
-</Callout>
+三个变量共同决定新账号能否创建:
-## 怎么限制谁能注册
+| 变量 | 作用 |
+|---|---|
+| `ALLOWED_EMAILS` | 允许的完整邮箱,多个值用逗号分隔 |
+| `ALLOWED_EMAIL_DOMAINS` | 允许的邮箱域名,多个值用逗号分隔 |
+| `ALLOW_SIGNUP` | 未配置任何白名单时,是否允许注册;默认 `true` |
-三层环境变量按优先级组合:
+判断顺序如下:
-<Mermaid chart={`
-graph TD
- Start[新用户首次登录] --> A{email 在<br/>ALLOWED_EMAILS 里?}
- A -- 是 --> Allow[允许注册]
- A -- 否 --> B{domain 在<br/>ALLOWED_EMAIL_DOMAINS 里?}
- B -- 是 --> Allow
- B -- 否 --> C{任一白名单<br/>非空?}
- C -- 是 --> Block[拒绝]
- C -- 否 --> D{ALLOW_SIGNUP<br/>= true?}
- D -- 是 --> Allow
- D -- 否 --> Block
-`} />
+1. 邮箱命中 `ALLOWED_EMAILS`,允许;
+2. 或域名命中 `ALLOWED_EMAIL_DOMAINS`,允许;
+3. 未命中时,如果 `ALLOW_SIGNUP=false`,拒绝;
+4. `ALLOW_SIGNUP=true` 但设置了任意白名单且未命中,仍然拒绝;
+5. 没有设置白名单且 `ALLOW_SIGNUP=true`,允许。
-**已经登录过的老用户永远可以再次登录**——signup 白名单只对**首次注册**生效,不拦截老用户。
+常见配置:
-- **`ALLOWED_EMAILS`**(最高优先级)—— 显式邮箱白名单,逗号分隔。**非空时只有列表里的邮箱能注册**。
-- **`ALLOWED_EMAIL_DOMAINS`**—— 域名白名单,逗号分隔(例如 `company.io,partner.com`)。
-- **`ALLOW_SIGNUP`** —— 总开关,默认 `true`。设 `false` 完全关闭注册。
+```dotenv
+# 只允许公司域名
+ALLOW_SIGNUP=false
+ALLOWED_EMAIL_DOMAINS=company.com
-<Callout type="warning">
-**三层白名单是 AND 语义,不是 OR。** 很多人第一直觉是「设 `ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true` 就是允许 company.io 和其他所有人」——**不是**。任何一层白名单只要设了非空值,**不匹配的邮箱直接拒**,`ALLOW_SIGNUP=true` 挡不住。
+# 再放行一位外部协作者
+```
-要真的「允许所有人」,所有三个环境变量都留空(或 `ALLOW_SIGNUP=true`)。
+<Callout type="info">
+两个白名单在 `ALLOW_SIGNUP=false` 时也可以作为明确的例外名单。
</Callout>
-**典型配法**:
+## 邀请与注册限制
-| 需求 | 配置 |
-|---|---|
-| 公司内网,只允许 `company.io` 员工 | `ALLOWED_EMAIL_DOMAINS=company.io` |
-| 公司内网 + 几个外部合作者 | `ALLOWED_EMAIL_DOMAINS=company.io` + 合作者个人邮箱加到 `ALLOWED_EMAILS` |
-| 完全关闭自助注册,只能邀请 | `ALLOW_SIGNUP=false` |
-| 开放注册(不推荐生产用)| 三个都留空 |
+邀请不会自动绕过注册限制:
-## 关了注册还能邀请人进来吗
+- 对方已经有 Multica 账号时,可以登录并接受邀请;
+- 对方还没有账号时,邮箱必须符合上面的注册规则。
-**只对已经有 Multica 账号的人能**。接受邀请那一步不检查 signup 白名单——如果对方已经注册过(比如在别的工作区),他们点链接登录就能直接接受。
+在关闭开放注册的实例中邀请新成员时,先把对方邮箱加入 `ALLOWED_EMAILS`。账号创建并接受邀请后,可以再从名单中移除。
-**但还没注册过的人,邀请救不了他们**。他们接受邀请前必须先登录,登录的第一步(发验证码)会过 signup 白名单检查。如果你 `ALLOW_SIGNUP=false`、或他们的邮箱不在 `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS` 里,他们**没法完成注册**,也就没法接受邀请。
+## 登录有效期
-要邀请一个还没注册的外部协作者:临时把他们的邮箱加到 `ALLOWED_EMAILS`,等他们注册 + 接受邀请之后再把这条移掉。
+浏览器登录默认保持 30 天。可以用 `AUTH_TOKEN_TTL` 调整,支持 Go duration 或正整数秒数:
+
+```dotenv
+AUTH_TOKEN_TTL=720h
+```
-邀请的创建和使用见 [成员与权限](/members-roles)。
+修改后需要重启 API 服务。这个值只影响之后签发的登录 cookie 和 JWT,不会延长已经签发的令牌。
-## 下一步
+## 接下来
-- [环境变量](/environment-variables) —— 这一页用到的环境变量完整定义
-- [认证与令牌](/auth-tokens) —— JWT / PAT / Daemon Token 的分类和使用
-- [故障排查](/troubleshooting) —— 验证码收不到、OAuth 报 `redirect_uri_mismatch`、注册被拒的常见排查
+- [环境变量](/environment-variables) — 完整变量参考。
+- [认证与令牌](/auth-tokens) — 登录会话与令牌类型。
+- [成员与权限](/members-roles) — 邀请与角色。
diff --git a/apps/docs/content/docs/auth-tokens.ja.mdx b/apps/docs/content/docs/auth-tokens.ja.mdx
index 085e22e516..003e63e725 100644
--- a/apps/docs/content/docs/auth-tokens.ja.mdx
+++ b/apps/docs/content/docs/auth-tokens.ja.mdx
@@ -1,80 +1,101 @@
---
title: 認証とトークン
-description: Multica には 3 種類のトークンがあります — ブラウザ、CLI、デーモンにそれぞれ 1 つずつ。どの場面でどれを使うかを解説します。
+description: ブラウザのサインインセッション、個人アクセストークン、エージェント実行時に使われる一時的な認証情報を理解します。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica には 3 種類のトークンがあり、それぞれが 1 つのコンテキストに対応します。ブラウザの Web UI、コマンドラインとスクリプト、そしてデーモンです。3 つとも同じあなたを表しますが、スコープと有効期間が異なります。
+Multica の日常的な利用で主に扱う認証情報は 2 種類です: ブラウザのサインインセッションと個人アクセストークンです。ブラウザセッションは Web と Desktop で使われ、個人アクセストークンは CLI、デーモン、スクリプト、API で使われます。
-## 3 つのトークン
+## ブラウザのサインインセッション
-| トークン | 形式 | 使われる場所 | 有効期間 |
-|---|---|---|---|
-| **JWT クッキー** | `multica_auth` クッキー (HttpOnly) | Web ブラウザ | 30 日 |
-| **個人アクセストークン (PAT)** | `mul_` プレフィックス | CLI、スクリプト、直接の API 呼び出し | デフォルトでは期限なし。API で作成する際に `expires_in_days` を渡せます |
-| **デーモントークン** | `mdt_` プレフィックス | デーモンとサーバー間の通信 | デーモン自体が管理 |
+メールの確認コードまたは Google でサインインすると、Multica は `multica_auth` という名前の HttpOnly cookie に JWT を保存します。ブラウザが自動的に送信し、JavaScript から直接読み取ることはできません。
-日常的な利用では、最初の 2 つだけを直接扱うことになります。**[デーモン](/daemon-runtimes)トークン**は `multica daemon login` が自動的に作成・更新するため、気にする必要はありません。
+セッションはデフォルトで 30 日間有効です。セルフホストの管理者は、`AUTH_TOKEN_TTL` で以後発行されるセッションの有効期間を調整できます。[サインインとサインアップ](/auth-setup#セッション有効期間)を参照してください。サインアウトすると、現在のブラウザの認証 cookie と CSRF cookie が削除されます。
-## 各トークンがアクセスできるもの
+ブラウザの cookie をスクリプトや CLI にコピーするのは適切ではありません。ターミナルから Multica にアクセスするには個人アクセストークンを使います。
-| API ルート | JWT クッキー | PAT | デーモントークン |
-|---|---|---|---|
-| `/api/user/*` (ユーザーレベルの操作) | ✓ | ✓ | ✗ |
-| `/api/workspaces/:id/*` (ワークスペースレベル) | ✓ | ✓ | ✗ |
-| `/api/daemon/*` (デーモン専用) | ✗ | ✓ | ✓ |
-| WebSocket `/ws` (リアルタイムプッシュ) | ✓ (クッキー) | ✓ (最初のメッセージで認証) | ✗ |
+## 個人アクセストークン
-**PAT はほぼすべてにアクセスできます** — これは「完全なあなた」を表します。デーモントークンはデーモンに必要なこと、つまりタスクを取得して結果を報告することしかできません。
+個人アクセストークン(PAT)は `mul_` で始まり、あなたのアカウントを表します。あなたがアクセスできるすべてのワークスペースと API にアクセスできるため、パスワードと同じように保管してください。
-**どちらも `/api/daemon/*` にアクセスできますが、スコープが異なります。** PAT は**ユーザー全体**を表し、一度認証されると、あなたが所属するすべてのワークスペースを見ることができます。デーモントークンは作成時点で単一のワークスペースに固定され、そのワークスペースのリソースにしかアクセスできません。本番環境では、デーモンはデーモントークンで実行してください。手軽さのために PAT を使う近道を選ばないでください。そうしないと、デーモンに必要な以上にはるかに大きな権限を与えてしまいます。
+**設定 → API Token** でトークンを作成するときは、名前を入力し、有効期限を 30 日、90 日、1 年、無期限から選びます。デフォルトでは 90 日が選択されています。完全なトークンは一度だけ表示されます。ウィンドウを閉じた後、Multica が保持するのは次の情報だけです:
-## ログイン
+- トークンのハッシュ値
+- 識別用の先頭数文字
+- 名前、作成日時、有効期限、最終使用日時
-### メール + 認証コード
-
-1. メールアドレスを入力すると、サーバーが 6 桁のコードを送信します。
-2. コードを入力すると、サーバーが JWT クッキーを発行(ブラウザ)するか、PAT に交換(CLI)します。
+完全な値は復元できません。紛失した場合は、古いトークンを失効させて新しく作成してください。
<Callout type="warning">
-**セルフホストの運用者は注意してください**: 公開デプロイでは `MULTICA_DEV_VERIFICATION_CODE` を空のままにしておいてください。固定のローカルテストコードを有効にすると、`APP_ENV` が production 以外の間は、コードをリクエストできる人なら誰でもその値でサインインできてしまいます。[セルフホスト認証の構成](/auth-setup)を参照してください。
+PAT をリポジトリ、イシュー、コメント、スクリーンショット、ログに残さないでください。また、履歴に保存される shell コマンドに直接渡さないでください。
</Callout>
-### Google OAuth
+## CLI と PAT
-**Sign in with Google** をクリックして、標準の OAuth コールバックを通過してください。セルフホストには `GOOGLE_CLIENT_ID`、`GOOGLE_CLIENT_SECRET`、そしてリダイレクト URI を構成する必要があります — [セルフホスト認証の構成](/auth-setup)を参照してください。
+`multica login` を実行すると、CLI はブラウザ経由でサインインを完了し、有効期間 90 日の PAT を作成して、現在のプロファイルの設定ファイルに保存します:
-## PAT の作成、表示、失効
+```text
+~/.multica/config.json
+~/.multica/profiles/<name>/config.json
+```
-PAT の**作成**は 2 つの方法で行えます。
+デーモンは同じ PAT で Multica に接続します。有効期限付きの `mul_` PAT は、残りが 7 日を切ると自動的に更新され、その時点から 90 日後まで延長されます。更新に失敗してもトークン自体は変わりません。トークンがすでに期限切れまたは失効している場合は、`multica login` をもう一度実行してください。
-- **Web UI**: 設定 → 個人アクセストークン → 新しいトークン
-- **CLI**: `multica login` は、まだローカル PAT がない場合に自動的に 1 つ作成します
+ブラウザのない環境では、先に Web で PAT を作成しておき、CLI に安全に入力を促させます:
-<Callout type="warning">
-**完全な PAT は作成時に正確に 1 回だけ表示されます。** 更新したりダイアログを閉じたりした後は、二度と見ることができません。
+```bash
+multica login --token
+```
-Multica はデータベースに PAT のハッシュだけを保存します — サーバーでさえ元の値を取得できません。すぐにコピーして保存してください。紛失した場合の唯一の手段は、失効させて新しく作り直すことです。
-</Callout>
+## API リクエストで PAT を使う
-既存の PAT の**表示**(名前、作成時刻、最終使用時刻 — 完全なトークンは**含みません**)は、設定 → 個人アクセストークンにあります。
+PAT を `Authorization` ヘッダーに入れます:
-PAT の**失効**: 一覧で Revoke をクリックしてください。失効はすぐに反映されます — その PAT で送られる次のリクエストは 401 で拒否されます。
+```bash
+export MULTICA_TOKEN='mul_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-## ログアウトはローカルトークンを削除するだけ
+curl https://api.multica.ai/api/me \
+ -H "Authorization: Bearer $MULTICA_TOKEN"
+```
-`multica auth logout` を実行するか、Web UI でログアウトをクリックすると、
+ワークスペースレベルの API を呼び出すときは、エンドポイントの要求に応じてワークスペースも指定します:
-- **ローカルトークンが消去されます** — CLI は `~/.multica/config.json` から PAT を削除し、ブラウザはクッキーを削除します。
-- **PAT はサーバー上では依然として有効です** — ログアウトする前に誰かがあなたの PAT を入手していた場合(たとえば別のマシンにコピーしていた場合)、その人は**依然としてそれを使用できます**。
+```bash
+curl https://api.multica.ai/api/issues \
+ -H "Authorization: Bearer $MULTICA_TOKEN" \
+ -H "X-Workspace-ID: $MULTICA_WORKSPACE_ID"
+```
-<Callout type="warning">
-**PAT が漏洩したと疑われる場合は、単にログアウトするだけにしないでください。** 設定 → 個人アクセストークンに進み、そのトークンを**失効**させてください。失効だけが、漏洩したトークンを即座に無効化します。
-</Callout>
+スクリプト内のトークンは secret manager か保護された環境変数から取得し、ハードコードしないでください。セルフホストインスタンスでは、ドメインを自分の公開 API アドレスに置き換えます。
+
+## サインアウトと失効
+
+`multica auth logout` は、現在の CLI プロファイルに保存された PAT を削除するだけです。Web のサインアウトも、現在のブラウザの cookie を削除するだけです。どちらもサーバー上の個人アクセストークンを失効させません。
+
+トークンが漏洩した可能性がある場合は、**設定 → API Token** ですぐに失効させてください。失効した PAT は二度と使えなくなり、それを保存していた他のマシンやスクリプトもアクセスを失います。
+
+## エージェント実行用の一時トークン
+
+デーモンがタスクを受領すると、サーバーはその実行のために `mat_` で始まる一時トークンを作成します。トークンは現在のユーザー、ワークスペース、エージェント、タスクに紐付き、最長 24 時間有効で、タスクの終了時にクリーンアップされます。
+
+デーモンは、ユーザーの PAT をエージェントに渡す代わりに、この一時トークンを AI コーディングツールに注入します。そのため、エージェントが送るリクエストはエージェントの操作として記録され、このトークンでユーザーや owner だけに許可された機密操作を呼び出すこともできません。
+
+この種のトークンはサーバーが自動的に作成するため、ユーザーが保存・管理する必要はありません。
+
+## その他のマシン認証情報
+
+サーバーは、内部またはマネージドなシナリオで使われる 2 種類の認証情報も認識します:
+
+| プレフィックス | 用途 | 管理元 |
+| --- | --- | --- |
+| `mcn_` | Multica Cloud Node の接続 | Multica Cloud Fleet |
+| `mdt_` | ワークスペーススコープのデーモン認証プロトコル | サーバー内部のフロー |
+
+通常の Cloud、セルフホスト、Desktop のインストールでは、これらを手動で作成する必要はありません。ユーザー側の CLI とデーモンは常に `mul_` PAT を使います。他のプレフィックスのトークンを自分で組み立てないでください。
## 次のステップ
-- [CLI コマンドリファレンス](/cli) — すべての CLI コマンドの認証は自動です
-- [セルフホスト認証の構成](/auth-setup) — セルフホスト時にメール、OAuth、サインアップ許可リストを構成する方法
-- [デーモンとランタイム](/daemon-runtimes) — デーモントークンがどこから来るのか
+- [CLI を使う](/cli) — `login`、`auth status`、プロファイルの設定。
+- [デーモンとランタイム](/daemon-runtimes) — PAT の更新が行われる場所。
+- [サインインとサインアップ](/auth-setup) — セッション有効期間とサインアップ制限のサーバー側設定。
diff --git a/apps/docs/content/docs/auth-tokens.ko.mdx b/apps/docs/content/docs/auth-tokens.ko.mdx
index 2ba9e2b755..5a87372e52 100644
--- a/apps/docs/content/docs/auth-tokens.ko.mdx
+++ b/apps/docs/content/docs/auth-tokens.ko.mdx
@@ -1,80 +1,101 @@
---
title: 인증과 토큰
-description: Multica에는 세 종류의 토큰이 있습니다 — 브라우저, CLI, 데몬에 각각 하나씩. 어떤 상황에 무엇을 쓰는지 설명합니다.
+description: 브라우저 로그인, 개인 액세스 토큰, 에이전트 실행에 사용하는 임시 자격 증명을 알아봅니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica에는 세 종류의 토큰이 있으며, 각각 하나의 컨텍스트에 대응합니다: 브라우저 Web UI, 명령줄과 스크립트, 그리고 데몬입니다. 세 가지 모두 동일한 당신을 나타내지만, 범위와 수명이 다릅니다.
+Multica를 일상적으로 사용할 때 주로 접하는 자격 증명은 브라우저 로그인 세션과 개인 액세스 토큰 두 가지입니다. 브라우저 세션은 Web과 Desktop에서 사용하고 개인 액세스 토큰은 CLI, 데몬, 스크립트, API에서 사용합니다.
-## 세 가지 토큰
+## 브라우저 로그인 세션
-| 토큰 | 형식 | 사용되는 곳 | 수명 |
-|---|---|---|---|
-| **JWT 쿠키** | `multica_auth` 쿠키 (HttpOnly) | 웹 브라우저 | 30일 |
-| **개인 액세스 토큰 (PAT)** | `mul_` 접두사 | CLI, 스크립트, 직접 API 호출 | 기본적으로 만료 없음. API로 생성할 때 `expires_in_days`를 전달할 수 있습니다 |
-| **데몬 토큰** | `mdt_` 접두사 | 데몬-서버 통신 | 데몬 자체가 관리 |
+이메일 인증 코드 또는 Google로 로그인하면 Multica가 JWT를 `multica_auth`라는 HttpOnly cookie에 저장합니다. 브라우저가 자동으로 함께 보내며 JavaScript에서는 직접 읽을 수 없습니다.
-일상적인 사용에서는 앞의 두 가지만 직접 다루게 됩니다. **[데몬](/daemon-runtimes) 토큰**은 `multica daemon login`이 자동으로 생성하고 갱신하므로, 신경 쓸 필요가 없습니다.
+세션은 기본적으로 30일 동안 유효합니다. 자체 호스팅 관리자는 `AUTH_TOKEN_TTL`로 이후 발급되는 세션의 유효 기간을 조정할 수 있습니다. [로그인과 가입](/auth-setup#로그인-유효-기간)을 참고하세요. 로그아웃하면 현재 브라우저의 인증 및 CSRF cookie가 삭제됩니다.
-## 각 토큰이 접근할 수 있는 것
+브라우저 cookie는 스크립트나 CLI에 복사하기에 적합하지 않습니다. 터미널에서 Multica에 접근할 때는 개인 액세스 토큰을 사용하세요.
-| API 라우트 | JWT 쿠키 | PAT | 데몬 토큰 |
-|---|---|---|---|
-| `/api/user/*` (사용자 수준 작업) | ✓ | ✓ | ✗ |
-| `/api/workspaces/:id/*` (워크스페이스 수준) | ✓ | ✓ | ✗ |
-| `/api/daemon/*` (데몬 전용) | ✗ | ✓ | ✓ |
-| WebSocket `/ws` (실시간 푸시) | ✓ (쿠키) | ✓ (첫 메시지로 인증) | ✗ |
+## 개인 액세스 토큰
-**PAT는 거의 모든 것에 접근할 수 있습니다** — 이는 "완전한 당신"을 나타냅니다. 데몬 토큰은 데몬에 필요한 일, 즉 작업을 가져오고 결과를 보고하는 것만 할 수 있습니다.
+개인 액세스 토큰(PAT)은 `mul_`로 시작하며 사용자 계정을 나타냅니다. 사용자가 접근할 권한이 있는 모든 워크스페이스와 API에 접근할 수 있으므로 비밀번호처럼 보관해야 합니다.
-**둘 다 `/api/daemon/*`에 접근할 수 있지만, 범위가 다릅니다.** PAT는 **사용자 전체**를 나타내며 — 일단 인증되면 당신이 속한 모든 워크스페이스를 볼 수 있습니다. 데몬 토큰은 생성 시점에 단일 워크스페이스에 고정되며 해당 워크스페이스의 리소스에만 접근할 수 있습니다. 프로덕션에서는 데몬을 데몬 토큰으로 실행하세요. 편의를 위해 PAT를 사용하는 지름길을 택하지 마세요. 그렇지 않으면 데몬에 필요한 것보다 훨씬 많은 권한을 부여하게 됩니다.
+**설정 → API Token**에서 토큰을 만들 때 이름을 입력하고 30일, 90일, 1년, 만료 없음 중 하나를 선택합니다. 기본값은 90일입니다. 전체 토큰은 한 번만 표시됩니다. 창을 닫은 뒤 Multica에는 다음 정보만 남습니다.
-## 로그인
+- 토큰의 hash
+- 토큰을 식별하는 앞부분 몇 글자
+- 이름, 생성 시간, 만료 시간, 최근 사용 시간
-### Email + 인증 코드
-
-1. 이메일을 입력하면 서버가 6자리 코드를 보냅니다.
-2. 코드를 입력하면 서버가 JWT 쿠키를 발급(브라우저)하거나 PAT로 교환(CLI)합니다.
+전체 값을 다시 확인할 수 없으므로 잃어버리면 이전 토큰을 취소하고 새로 만드세요.
<Callout type="warning">
-**자체 호스팅 운영자는 주의하세요**: 공개 배포에서는 `MULTICA_DEV_VERIFICATION_CODE`를 비워 두세요. 고정된 로컬 테스트 코드를 활성화하면, `APP_ENV`가 production이 아닌 동안 코드를 요청할 수 있는 누구나 그 값으로 로그인할 수 있습니다. [자체 호스팅 인증 구성](/auth-setup)을 참고하세요.
+PAT를 저장소, 이슈, 댓글, 스크린샷, 로그에 넣지 마세요. 저장되는 shell 명령에 직접 입력해서도 안 됩니다.
</Callout>
-### Google OAuth
+## CLI와 PAT
-**Sign in with Google**을 클릭하고 표준 OAuth 콜백을 거치세요. 자체 호스팅에는 `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, 그리고 리디렉션 URI를 구성해야 합니다 — [자체 호스팅 인증 구성](/auth-setup)을 참고하세요.
+`multica login`을 실행하면 CLI가 브라우저에서 로그인을 완료한 뒤 90일 동안 유효한 PAT를 만들고 현재 profile의 설정 파일에 저장합니다.
-## PAT 생성, 조회, 취소
+```text
+~/.multica/config.json
+~/.multica/profiles/<name>/config.json
+```
-PAT **생성**은 두 가지 방법으로 할 수 있습니다:
+데몬도 같은 PAT로 Multica에 연결합니다. 만료 시간이 있는 `mul_` PAT는 남은 유효 기간이 7일 미만이면 자동으로 갱신되어 그 시점부터 90일 뒤까지 연장됩니다. 갱신 실패는 토큰 자체를 바꾸지 않습니다. 토큰이 이미 만료되었거나 취소되었다면 `multica login`을 다시 실행해야 합니다.
-- **Web UI**: 설정 → API 토큰 → 새 토큰
-- **CLI**: `multica login`은 아직 로컬 PAT가 없으면 자동으로 하나를 생성합니다
+브라우저가 없는 환경에서는 Web에서 PAT를 먼저 만든 뒤 CLI가 안전하게 입력을 요청하도록 할 수 있습니다.
-<Callout type="warning">
-**전체 PAT는 생성될 때 정확히 한 번만 표시됩니다.** 새로 고침하거나 대화상자를 닫은 후에는 다시 볼 수 없습니다.
+```bash
+multica login --token
+```
-Multica는 데이터베이스에 PAT의 해시만 저장합니다 — 서버조차 원본을 가져올 수 없습니다. 즉시 복사하여 저장하세요. 분실하면 유일한 방법은 취소하고 새로 생성하는 것입니다.
-</Callout>
+## API 요청에서 PAT 사용
-기존 PAT **조회**(이름, 생성 시각, 마지막 사용 시각 — 전체 토큰은 **포함하지 않음**)는 설정 → API 토큰에 있습니다.
+PAT를 `Authorization` header에 넣습니다.
-PAT **취소**: 목록에서 Revoke를 클릭하세요. 취소는 즉시 적용됩니다 — 그 PAT로 보낸 다음 요청은 401로 거부됩니다.
+```bash
+export MULTICA_TOKEN='mul_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-## 로그아웃은 로컬 토큰만 삭제합니다
+curl https://api.multica.ai/api/me \
+ -H "Authorization: Bearer $MULTICA_TOKEN"
+```
-`multica auth logout`을 실행하거나 Web UI에서 로그아웃을 클릭하면:
+워크스페이스 수준 API를 호출할 때는 인터페이스 요구 사항에 따라 워크스페이스도 제공해야 합니다.
-- **로컬 토큰이 지워집니다** — CLI는 `~/.multica/config.json`에서 PAT를 제거하고, 브라우저는 쿠키를 삭제합니다.
-- **PAT는 서버에서 여전히 유효합니다** — 로그아웃하기 전에 누군가 당신의 PAT를 입수했다면(예를 들어 다른 기기에 복사했다면), 그들은 **여전히 그것을 사용할 수 있습니다**.
+```bash
+curl https://api.multica.ai/api/issues \
+ -H "Authorization: Bearer $MULTICA_TOKEN" \
+ -H "X-Workspace-ID: $MULTICA_WORKSPACE_ID"
+```
-<Callout type="warning">
-**PAT가 유출되었다고 의심되면, 단순히 로그아웃하지 마세요.** 설정 → API 토큰로 가서 그 토큰을 **취소**하세요. 취소만이 유출된 토큰을 즉시 무효화합니다.
-</Callout>
+스크립트의 토큰은 secret manager나 보호된 환경 변수에서 가져오고 하드코딩하지 마세요. 자체 호스팅 인스턴스에서는 도메인을 공개 API 주소로 바꿉니다.
+
+## 로그아웃과 취소
+
+`multica auth logout`은 현재 CLI profile에 저장된 PAT만 삭제합니다. Web 로그아웃은 현재 브라우저의 cookie만 삭제합니다. 어느 쪽도 서버의 개인 액세스 토큰을 취소하지 않습니다.
+
+토큰이 노출되었을 가능성이 있다면 **설정 → API Token**에서 즉시 취소하세요. 취소된 PAT는 다시 사용할 수 없으며 이 PAT를 저장한 다른 컴퓨터와 스크립트도 접근 권한을 잃습니다.
+
+## 에이전트 실행용 임시 토큰
+
+데몬이 태스크를 가져가면 서버가 해당 실행을 위해 `mat_`로 시작하는 임시 토큰을 만듭니다. 현재 사용자, 워크스페이스, 에이전트, 태스크에 연결되고 최대 24시간 동안 유효하며 태스크가 끝나면 정리됩니다.
+
+데몬은 사용자 PAT 대신 이 임시 토큰을 AI 코딩 도구에 주입합니다. 따라서 에이전트가 보낸 요청은 에이전트의 동작으로 기록되며 사용자나 owner만 수행할 수 있는 민감한 작업을 이 토큰으로 호출할 수도 없습니다.
+
+이 토큰은 서버가 자동으로 만들며 사용자가 저장하거나 관리할 필요가 없습니다.
+
+## 기타 머신 자격 증명
+
+서버는 내부 또는 관리형 환경에서 사용하는 두 가지 자격 증명도 인식합니다.
+
+| 접두사 | 용도 | 관리 주체 |
+| --- | --- | --- |
+| `mcn_` | Multica Cloud Node 연결 | Multica Cloud Fleet |
+| `mdt_` | 워크스페이스 범위의 데몬 인증 프로토콜 | 서버 내부 절차 |
+
+일반 Cloud, 자체 호스팅, Desktop 설치에서는 이를 직접 만들 필요가 없습니다. 사용자 측 CLI와 데몬은 항상 `mul_` PAT를 사용합니다. 다른 접두사의 토큰을 직접 만들지 마세요.
## 다음 단계
-- [CLI 명령어 레퍼런스](/cli) — 모든 CLI 명령어의 인증은 자동입니다
-- [자체 호스팅 인증 구성](/auth-setup) — 자체 호스팅 시 이메일, OAuth, 가입 허용 목록을 구성하는 방법
-- [데몬과 런타임](/daemon-runtimes) — 데몬 토큰이 어디서 오는지
+- [CLI 사용](/cli) — `login`, `auth status`, profile 설정을 알아봅니다.
+- [데몬과 런타임](/daemon-runtimes) — PAT 갱신이 일어나는 위치를 알아봅니다.
+- [로그인과 가입](/auth-setup) — 세션 유효 기간과 가입 제한의 서버 설정을 알아봅니다.
diff --git a/apps/docs/content/docs/auth-tokens.mdx b/apps/docs/content/docs/auth-tokens.mdx
index 27aea8704b..c2783ffcc6 100644
--- a/apps/docs/content/docs/auth-tokens.mdx
+++ b/apps/docs/content/docs/auth-tokens.mdx
@@ -1,80 +1,101 @@
---
title: Authentication and tokens
-description: Multica has three kinds of tokens — one each for the browser, the CLI, and the daemon. When to use which.
+description: Understand browser sign-in sessions, personal access tokens, and the temporary credentials agents use during runs.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica has three kinds of tokens, one for each context: the browser Web UI, the command line and scripts, and the daemon. All three represent the same you, but their scopes and lifetimes differ.
+In day-to-day use of Multica you mainly deal with two kinds of credentials: browser sign-in sessions and personal access tokens. Browser sessions serve web and Desktop; personal access tokens serve the CLI, the daemon, scripts, and the API.
-## The three tokens
+## Browser sign-in sessions
-| Token | Format | Where it's used | Lifetime |
-|---|---|---|---|
-| **JWT cookie** | `multica_auth` cookie (HttpOnly) | Web browser | 30 days |
-| **Personal access token (PAT)** | Prefixed with `mul_` | CLI, scripts, direct API calls | No expiry by default; when you create one via the API you can pass `expires_in_days` |
-| **Daemon token** | Prefixed with `mdt_` | Daemon-to-server communication | Managed by the daemon itself |
+After signing in with an email verification code or Google, Multica stores a JWT in an HttpOnly cookie named `multica_auth`. The browser sends it automatically; JavaScript cannot read it directly.
-In day-to-day use you'll only touch the first two directly. The **[daemon](/daemon-runtimes) token** is created and refreshed automatically by `multica daemon login` — you don't have to think about it.
+Sessions last 30 days by default. Self-hosting admins can adjust the lifetime of sessions issued from then on with `AUTH_TOKEN_TTL`; see [Sign-in and signup configuration](/auth-setup#session-lifetime). Logging out clears the auth and CSRF cookies in the current browser.
-## What each token can hit
+Browser cookies are not meant to be copied into scripts or the CLI; use a personal access token to access Multica from a terminal.
-| API route | JWT cookie | PAT | Daemon token |
-|---|---|---|---|
-| `/api/user/*` (user-level actions) | ✓ | ✓ | ✗ |
-| `/api/workspaces/:id/*` (workspace-level) | ✓ | ✓ | ✗ |
-| `/api/daemon/*` (daemon-only) | ✗ | ✓ | ✓ |
-| WebSocket `/ws` (real-time push) | ✓ (cookie) | ✓ (authenticates via first message) | ✗ |
+## Personal access tokens
-**A PAT can hit almost anything** — it represents "the full you." A daemon token can only do what the daemon needs: fetch tasks and report results.
+A personal access token (PAT) starts with `mul_` and represents your account. It can access every workspace and API you have access to, so guard it like a password.
-**Both can hit `/api/daemon/*`, but their scopes differ.** A PAT represents an **entire user** — once authenticated, it can see every workspace you belong to. A daemon token is pinned to a single workspace at creation time and can only touch resources in that workspace. In production, run your daemon with a daemon token — don't take the shortcut of using a PAT, or you'll be granting far more privilege than the daemon needs.
+When creating a token under **Settings → API Token**, you provide a name and pick an expiry of 30 days, 90 days, 1 year, or never; 90 days is preselected. The full token is shown exactly once; after the dialog closes, Multica keeps only:
-## Logging in
+- the token's hash;
+- the first few characters, for identification;
+- the name, creation time, expiry, and last-used time.
-### Email + verification code
-
-1. Enter your email; the server sends a 6-digit code.
-2. Enter the code; the server issues a JWT cookie (browser) or exchanges it for a PAT (CLI).
+The full value cannot be recovered. If you lose it, revoke the old token and create a new one.
<Callout type="warning">
-**Self-hosting operators, take note**: keep `MULTICA_DEV_VERIFICATION_CODE` empty on public deployments. If you enable a fixed local test code, anyone who can request a code can sign in with that value while `APP_ENV` is non-production. See [Self-host auth configuration](/auth-setup).
+Don't put a PAT in repositories, issues, comments, screenshots, or logs, and don't pass it directly in shell commands that get saved.
</Callout>
-### Google OAuth
+## The CLI and PATs
-Click **Sign in with Google** and go through the standard OAuth callback. Self-hosting requires `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, and the redirect URI to be configured — see [Self-host auth configuration](/auth-setup).
+When you run `multica login`, the CLI completes sign-in through the browser, then creates a PAT valid for 90 days and saves it to the current profile's config file:
-## Creating, viewing, and revoking a PAT
+```text
+~/.multica/config.json
+~/.multica/profiles/<name>/config.json
+```
-**Creating** a PAT can be done two ways:
+The daemon connects to Multica with the same PAT. A `mul_` PAT with an expiry renews automatically when less than 7 days remain, extending it to 90 days from that moment. A failed renewal leaves the token unchanged; once a token has expired or been revoked, run `multica login` again.
-- **Web UI**: Settings → Personal Access Tokens → New token
-- **CLI**: `multica login` creates one automatically if there's no local PAT yet
+On a machine without a browser, create a PAT on the web first and let the CLI prompt for it safely:
-<Callout type="warning">
-**The full PAT is displayed exactly once when it's created.** After you refresh or close the dialog, you won't be able to see it again.
+```bash
+multica login --token
+```
-Multica stores only the hash of the PAT in the database — not even the server can retrieve the original. Copy and save it immediately. If you lose it, your only option is to revoke it and create a new one.
-</Callout>
+## Using a PAT in API requests
-**Viewing** existing PATs (name, creation time, last-used time — **not** the full token) lives under Settings → Personal Access Tokens.
+Put the PAT in the `Authorization` header:
-**Revoking** a PAT: click Revoke in the list. Revocation takes effect immediately — the next request made with that PAT will be rejected with a 401.
+```bash
+export MULTICA_TOKEN='mul_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-## Logging out only deletes the local token
+curl https://api.multica.ai/api/me \
+ -H "Authorization: Bearer $MULTICA_TOKEN"
+```
-When you run `multica auth logout` or click log out in the Web UI:
+Workspace-level API calls also need the workspace, as required by the endpoint:
-- **The local token is cleared** — the CLI removes the PAT from `~/.multica/config.json`; the browser deletes the cookie.
-- **The PAT is still valid on the server** — if someone obtained your PAT before you logged out (for example, by copying it to another machine), they **can still use it**.
+```bash
+curl https://api.multica.ai/api/issues \
+ -H "Authorization: Bearer $MULTICA_TOKEN" \
+ -H "X-Workspace-ID: $MULTICA_WORKSPACE_ID"
+```
-<Callout type="warning">
-**If you suspect your PAT has leaked, don't just log out.** Go to Settings → Personal Access Tokens and **revoke** the token. Only revocation invalidates a leaked token immediately.
-</Callout>
+In scripts, take the token from a secret manager or a protected environment variable — never hardcode it. On self-hosted instances, replace the domain with your own public API address.
+
+## Logging out and revocation
+
+`multica auth logout` only deletes the PAT saved in the current CLI profile; logging out on the web only deletes the current browser's cookies. Neither revokes the personal access token on the server.
+
+If a token may have leaked, revoke it immediately under **Settings → API Token**. Once revoked, the PAT can never be used again, and any other machines and scripts that saved it lose access too.
+
+## Temporary tokens for agent runs
+
+When the daemon claims a task, the server creates a temporary token for that run, prefixed with `mat_`. It is bound to the current user, workspace, agent, and task, is valid for at most 24 hours, and is cleaned up when the task ends.
+
+The daemon injects this temporary token into the AI coding tool instead of handing the user's PAT to the agent. Requests made by the agent are therefore recorded as agent actions, and the token can't be used to reach sensitive operations restricted to users or owners.
+
+These tokens are created automatically by the server; users never need to save or manage them.
+
+## Other machine credentials
+
+The server also recognizes two credentials used in internal or managed scenarios:
+
+| Prefix | Purpose | Managed by |
+| --- | --- | --- |
+| `mcn_` | Multica Cloud Node connections | Multica Cloud Fleet |
+| `mdt_` | Workspace-scoped daemon authentication protocol | Internal server flows |
+
+Regular Cloud, self-hosted, and Desktop installations never need to create them manually. The user-side CLI and daemon always use `mul_` PATs; don't construct tokens with other prefixes yourself.
## Next steps
-- [CLI command reference](/cli) — authentication is automatic for every CLI command
-- [Self-host auth configuration](/auth-setup) — how to configure email, OAuth, and signup allowlists when self-hosting
-- [Daemon and runtimes](/daemon-runtimes) — where the daemon token comes from
+- [Using the CLI](/cli) — `login`, `auth status`, and profile configuration.
+- [Daemon and runtimes](/daemon-runtimes) — where PAT renewal happens.
+- [Sign-in and signup configuration](/auth-setup) — server-side configuration for session lifetime and signup restrictions.
diff --git a/apps/docs/content/docs/auth-tokens.zh.mdx b/apps/docs/content/docs/auth-tokens.zh.mdx
index e907bfb23f..0cb12e7824 100644
--- a/apps/docs/content/docs/auth-tokens.zh.mdx
+++ b/apps/docs/content/docs/auth-tokens.zh.mdx
@@ -1,80 +1,101 @@
---
title: 认证与令牌
-description: Multica 有三种令牌——浏览器、CLI、守护进程各用一种。什么场景用哪种。
+description: 了解浏览器登录、个人访问令牌,以及智能体执行时使用的临时凭据。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica 有三种令牌,对应三种使用场景:浏览器 Web UI、命令行 / 脚本、守护进程(daemon)。三种都代表同一个你,但作用域和有效期不同。
+日常使用 Multica 时,你主要会接触两种凭据:浏览器登录会话和个人访问令牌。浏览器会话用于 Web 与 Desktop;个人访问令牌用于 CLI、守护进程、脚本和 API。
-## 三种令牌
+## 浏览器登录会话
-| 令牌 | 格式 | 用在哪 | 有效期 |
-|---|---|---|---|
-| **JWT Cookie** | `multica_auth` cookie(HttpOnly) | Web 浏览器 | 30 天 |
-| **个人访问令牌(PAT)** | 以 `mul_` 开头 | CLI / 脚本 / 直接调 API | 默认不过期;用 API 创建时可选传 `expires_in_days` |
-| **守护进程令牌(Daemon Token)** | 以 `mdt_` 开头 | Daemon 内部和 server 通信 | 由 daemon 自己管理 |
+通过邮箱验证码或 Google 登录后,Multica 会把 JWT 保存到名为 `multica_auth` 的 HttpOnly cookie 中。浏览器自动携带它,JavaScript 无法直接读取。
-日常使用你只会直接接触前两种。**[守护进程](/daemon-runtimes)令牌**是 `multica daemon login` 自动生成和刷新的,你不用关心。
+会话默认有效 30 天。自托管管理员可以通过 `AUTH_TOKEN_TTL` 调整之后签发的会话有效期,见[登录与注册](/auth-setup#登录有效期)。退出登录会清除当前浏览器的认证与 CSRF cookie。
-## 三种令牌能访问哪些 API
+浏览器 cookie 不适合复制到脚本或 CLI;从终端访问 Multica 使用个人访问令牌。
-| API 路由 | JWT Cookie | PAT | Daemon Token |
-|---|---|---|---|
-| `/api/user/*`(用户级操作) | ✓ | ✓ | ✗ |
-| `/api/workspaces/:id/*`(工作区级) | ✓ | ✓ | ✗ |
-| `/api/daemon/*`(daemon 专用) | ✗ | ✓ | ✓ |
-| WebSocket `/ws`(实时推送) | ✓(cookie) | ✓(首条消息认证) | ✗ |
+## 个人访问令牌
-**PAT 几乎什么都能命中**——它代表"完整的你"。Daemon Token 能做的事非常有限,只够 daemon 拉任务和汇报结果。
+个人访问令牌(PAT)以 `mul_` 开头,代表你的账号。它可以访问你有权访问的全部工作区和 API,需要像密码一样保管。
-**同样是访问 `/api/daemon/*`,两者作用域不同**:PAT 代表**一整个用户**——进来之后能看到你所有的工作区;daemon token 在创建时就绑死一个工作区,只能动这一个工作区的资源。生产部署用 daemon token 跑 daemon,不要图方便用 PAT——权限会被放大。
+在 **设置 → API Token** 中创建令牌时,需要填写名称,并选择 30 天、90 天、1 年或永不过期,默认选中 90 天。完整令牌只显示一次;关闭窗口后,Multica 只保留:
-## 登录
+- 令牌的哈希值;
+- 用于辨认它的开头几位;
+- 名称、创建时间、过期时间和最近使用时间。
-### Email + 验证码
-
-1. 填邮箱,server 发一封带 6 位验证码的邮件
-2. 输入验证码,server 签发 JWT cookie(浏览器)或交换出 PAT(CLI)
+完整值无法找回,丢失时吊销旧令牌并创建新的。
<Callout type="warning">
-**自部署运维注意**:公网部署时保持 `MULTICA_DEV_VERIFICATION_CODE` 为空。如果启用固定本地测试验证码,在 `APP_ENV` 非 production 时,任何能请求验证码的人都能用该固定值登录。详见 [自部署的认证配置](/auth-setup)。
+不要把 PAT 写入仓库、issue、评论、截图或日志,也不要直接放进会被保存的 shell 命令中。
</Callout>
-### Google OAuth
+## CLI 与 PAT
-点 **Sign in with Google**,走标准 OAuth 回调。自部署时需要配好 `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET` / redirect URI——详见 [自部署的认证配置](/auth-setup)。
+运行 `multica login` 时,CLI 会通过浏览器完成登录,再创建一个有效期为 90 天的 PAT,保存到当前 profile 的配置文件:
-## 创建、查看、撤销 PAT
+```text
+~/.multica/config.json
+~/.multica/profiles/<name>/config.json
+```
-**创建**有两种方式:
+守护进程使用同一个 PAT 连接 Multica。带过期时间的 `mul_` PAT 在剩余有效期不足 7 天时自动续期,延长到当时起 90 天后。续期失败不会改变令牌本身;令牌已经过期或被吊销时,需要重新运行 `multica login`。
-- **Web UI**:Settings → Personal Access Tokens → New token
-- **CLI**:`multica login` 在本地没有 PAT 时会自动创建一个
+无浏览器环境可以先在 Web 中创建 PAT,再让 CLI 安全地提示输入:
-<Callout type="warning">
-**PAT 创建时完整内容只显示一次。** 刷新页面或关闭对话框之后就看不到了。
+```bash
+multica login --token
+```
-Multica 在数据库里只保存 PAT 的哈希值——服务端也查不回来。创建时**立即复制保存**。丢了只能撤销后重新创建。
-</Callout>
+## 在 API 请求中使用 PAT
-**查看**已签发的 PAT 列表(名字、创建时间、最后使用时间,**不含**完整令牌):Settings → Personal Access Tokens。
+把 PAT 放进 `Authorization` header:
-**撤销** PAT:在列表里点 Revoke。撤销是立即生效的——被撤销的 PAT 下一次请求就 401。
+```bash
+export MULTICA_TOKEN='mul_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-## 退出登录只是删本地令牌
+curl https://api.multica.ai/api/me \
+ -H "Authorization: Bearer $MULTICA_TOKEN"
+```
-执行 `multica auth logout` 或在 Web UI 点退出时:
+调用工作区级 API 时,还需要按接口要求提供工作区:
-- **本地令牌被清除** —— CLI 从 `~/.multica/config.json` 里删掉 PAT;Web 删 cookie
-- **服务端的 PAT 仍然有效** —— 如果登出前有人已经拿到过你的 PAT(比如复制到了另一台机器),他们**还能继续用**
+```bash
+curl https://api.multica.ai/api/issues \
+ -H "Authorization: Bearer $MULTICA_TOKEN" \
+ -H "X-Workspace-ID: $MULTICA_WORKSPACE_ID"
+```
-<Callout type="warning">
-**如果怀疑 PAT 泄露,不要只 logout。** 去 Settings → Personal Access Tokens 把那个 PAT **撤销**。撤销才会让泄露出去的令牌立刻失效。
-</Callout>
+脚本中的令牌取自 secret manager 或受保护的环境变量,不要硬编码。自托管实例把域名替换为自己的公开 API 地址。
+
+## 退出登录与吊销
+
+`multica auth logout` 只删除当前 CLI profile 中保存的 PAT;Web 退出登录只删除当前浏览器的 cookie。它们不会吊销服务器上的个人访问令牌。
+
+如果令牌可能泄露,到 **设置 → API Token** 中立即吊销。吊销后,这个 PAT 无法再次使用,已经保存它的其他电脑和脚本也会失去访问权限。
+
+## 智能体执行的临时令牌
+
+守护进程领取 task 后,服务器会为这次执行创建一个以 `mat_` 开头的临时令牌。它绑定当前用户、工作区、智能体和 task,最长有效 24 小时,并在 task 结束时清理。
+
+守护进程把这个临时令牌注入 AI 编程工具,而不是把用户 PAT 交给智能体。因此,智能体发出的请求会记录为智能体行为,也不能借此调用只允许用户或 owner 执行的敏感操作。
+
+这类令牌由服务器自动创建,用户不需要保存或管理。
+
+## 其他机器凭据
+
+服务端还识别两种内部或托管场景中的凭据:
+
+| 前缀 | 用途 | 谁管理 |
+| --- | --- | --- |
+| `mcn_` | Multica Cloud Node 连接 | Multica Cloud Fleet |
+| `mdt_` | 工作区范围的守护进程认证协议 | 服务端内部流程 |
+
+普通 Cloud、自托管和 Desktop 安装都不需要手动创建它们。用户侧的 CLI 与守护进程始终使用 `mul_` PAT;不要自行构造其他前缀的令牌。
-## 下一步
+## 接下来
-- [CLI 命令速查](/cli) —— 每条 CLI 命令的认证是自动的
-- [自部署的认证配置](/auth-setup) —— 自部署时怎么配邮件 / OAuth / signup 白名单
-- [守护进程与运行时](/daemon-runtimes) —— 守护进程令牌是从哪来的
+- [使用 CLI](/cli) — `login`、`auth status` 和 profile 配置。
+- [守护进程与运行时](/daemon-runtimes) — PAT 续期发生的位置。
+- [登录与注册](/auth-setup) — 会话有效期与注册限制的服务端配置。
diff --git a/apps/docs/content/docs/autopilots.ja.mdx b/apps/docs/content/docs/autopilots.ja.mdx
index 516144c02e..de7bb656e0 100644
--- a/apps/docs/content/docs/autopilots.ja.mdx
+++ b/apps/docs/content/docs/autopilots.ja.mdx
@@ -1,249 +1,157 @@
---
title: オートパイロット
-description: エージェントが cron スケジュールやインバウンド webhook で作業を開始したり、UI や CLI で一度だけ手動でトリガーしたりできるようにします。
+description: 繰り返し行う作業を、スケジュールや Webhook に応じてエージェントへ自動的に任せます。
---
import { Callout } from "fumadocs-ui/components/callout";
-オートパイロットは、[エージェント](/agents)が**スケジュールに従って自動的に作業を開始**できるようにします — cron 式とタイムゾーンを設定すると、あなたが何もトリガーしなくても Multica が自ら [`task`](/tasks) をディスパッチします。定期点検、繰り返しのレポート、夜間のクリーンアップ作業など、「常設指示(standing order)」の形の作業に適しています。残りの 3 つのトリガー経路([割り当て](/assigning-issues)、[@-メンション](/mentioning-agents)、[チャット](/chat) — いずれもあなた自身が起点となる方式)と比べたとき、オートパイロットの核心的な違いは**時間駆動**であることです。
+オートパイロットは、毎日の進捗まとめ、依存関係の定期確認、外部システムからイベントを受け取ったときの対応など、繰り返し発生する作業に使います。
-## オートパイロットを構成する
+各オートパイロットには、Runbook、実行担当、1 つ以上のトリガーが保存されます。トリガーされると、Multica はイシューを作成するか、エージェントを直接実行し、実行ごとの記録を残します。
-ワークスペースの**オートパイロット**ページで新しいオートパイロットを作成します。次の項目を設定します。
+## オートパイロットを作成する
-- **名前(Name)** — 表示名
-- **エージェント(Agent)** — 実行をディスパッチする対象
-- **優先度(Priority)** — 生成される `task` に継承されます(イシューの優先度と同じ意味)
-- **説明 / プロンプト(Description / prompt)** — 実行のたびにエージェントが受け取る作業説明
-- **実行モード(Execution mode)** — 以下を参照
-- **トリガー(Triggers)** — `schedule`(cron + タイムゾーン)または `webhook` のうち少なくとも 1 つ
+サイドバーから**オートパイロット**を開き、テンプレートを選ぶか、空の状態から作成して次を設定します。
-## 実行モードを選ぶ
+- **名前**: このオートパイロットが担当する作業
+- **Runbook**: エージェントが実行ごとに読む目標、背景、制約、手順
+- **実行担当**: 1 つのエージェントまたはスクワッド
+- **関連プロジェクト**: 任意。自動作成したイシューを指定のプロジェクトに追加
+- **出力モード**: イシューを作成するか、実行のみ
+- **購読者**: 自動作成されたイシューの通知を受け取るメンバー
+- **トリガー**: スケジュールまたは Webhook
-オートパイロットには 2 つの実行モードがあります。**「イシュー作成」モードから始めてください。**
+保存すると、オートパイロットはデフォルトで有効になります。**今すぐ実行**を使えば、いつでも一連の処理を手動で 1 回実行できます。
-- **イシュー作成モード(Create issue mode)**(`create_issue`) — デフォルトであり、**推奨**されます。各トリガーはまずワークスペースにイシューを作成し(タイトルには現在、単一のプレースホルダー `{{date}}` のみがサポートされ、これは `YYYY-MM-DD` 形式の UTC 日付に補間されます。それ以外の `{{...}}` トークンは作成時点で拒否されるため、タイプミスがイシュータイトルにリテラル文字列として静かに紛れ込むことを防ぎます)、通常の割り当てフローを通じてそのイシューをエージェントに割り当てます。すべての作業は、手動で割り当てたイシューと同じ履歴、コメント、ステータスを持った状態でイシューボードに上がります。
-- **実行専用モード(Run-only mode)**(`run_only`) — イシュー作成をスキップし、`task` を直接キューに入れます。この実行はボードには表示されません — オートパイロットの実行履歴でのみ確認できます。
+## 出力モードを選ぶ
-## スケジュールに従って実行する
+| モード | 動作 | 適した用途 |
+|---|---|---|
+| **イシューを作成** | トリガーされるたびにイシューを作成して実行担当へ割り当てます。議論、状態、実行記録はすべてイシューに残ります。 | チームによる確認や対応の継続が必要な作業 |
+| **実行のみ** | イシューを作成せず、タスクを直接作成します。結果はオートパイロットの実行履歴からのみ確認できます。 | 共同作業の記録が不要なバックグラウンド処理 |
-すべてのオートパイロットには少なくとも 1 つの `schedule` トリガーが必要です。Cron は**標準の 5 フィールド形式**(分 時 日 月 曜日)を使用し、最小単位は **1 分**です(秒単位はありません)。タイムゾーンは IANA 形式(例: `Asia/Shanghai`)で、cron 式がどのタイムゾーンで解釈されるかを決定します。
+**イシューを作成**モードは、通常のイシューと同じタスクキューを使います。ランタイムがオフラインでも先にイシューを作成でき、タスクはランタイムがオンラインになるまで待機します。
-いくつかの例:
+**実行のみ**モードでは、トリガー時にランタイムが利用可能である必要があります。利用できない場合、その実行は「スキップ」と表示され、待機中のイシューは作成されません。
-- `0 9 * * 1-5`, `Asia/Shanghai` — 平日の北京時間午前 9 時
-- `*/30 * * * *`, `UTC` — 30 分ごと
-- `0 3 * * *`, `UTC` — 毎日 UTC 午前 3 時
+## スケジュールで実行する
-Multica サーバーは**30 秒**ごとに期限が来たトリガーをスキャンします — **実際の発火時刻は最大 30 秒まで遅れる可能性があり**、秒単位で正確ではありません。発火時刻のあたりでサーバーが再起動された場合、起動時に逃したトリガーを追いつきます(何も失われませんが、すぐに発火します)。
+スケジュールエディターでは、実行時刻、繰り返す曜日、時間帯、タイムゾーンを指定し、次回以降の実行時刻をプレビューできます。1 つのオートパイロットに複数のスケジュールを追加できます。個別のトリガーを有効または無効にする場合は、CLI の `autopilot trigger-update` を使います。引数は [CLI コマンド](/cli)を参照してください。
-## 一度だけ手動でトリガーする
+より複雑なルールが必要な場合は、標準の 5 フィールド cron を直接編集できます。
-オートパイロットのデバッグ中に cron を待たないためには、手動でトリガーしてください。
-
-- UI: オートパイロット詳細ページで「Run now」をクリック
-- CLI:
-
-```bash
-multica autopilot trigger <autopilot-id>
+```text
+分 時 日 月 曜日
```
-手動トリガーは `schedule` トリガーとまったく同じ実行フローを通り — 実行レコードの `source` フィールドのみが `manual` とマークされます。
+例:
-## webhook からトリガーする
+| Cron | タイムゾーン | 意味 |
+|---|---|---|
+| `0 9 * * 1-5` | `Asia/Shanghai` | 平日の 9:00 |
+| `*/30 * * * *` | `UTC` | 30 分ごと |
+| `0 3 * * *` | `UTC` | 毎日 3:00 |
-オートパイロットはインバウンドの HTTP webhook でも発火できます。オートパイロット詳細ページで **Webhook** トリガーを追加すると、Multica は次のような形の一意の URL を生成します。
+Cron に秒は含まれません。タイムゾーンには `Asia/Shanghai` のような IANA 名を使います。保存する前に、画面に表示される「次回」の時刻が意図どおりか確認してください。
-```
-https://<your-multica-host>/api/webhooks/autopilots/awt_…
-```
+![オートパイロットエディター。Runbook、スケジュール設定、次回以降の実行プレビューが表示されています。](/images/docs/autopilot-schedule.png)
-その URL に任意の JSON を POST してください。Multica はまず配信を永続化し、冪等な実行を同期的に受け付け、`status = accepted | skipped` と `run_id` を含む `200 OK` を返します。その後データベース-backed worker が accepted の実行を再開してエージェントをディスパッチします。受付とディスパッチの間にサーバーが再起動しても、キュー済みの配信は失われません。
+## Webhook で実行する
+
+Webhook トリガーを追加すると、Multica が一意の URL を生成します。この URL に JSON オブジェクトまたは配列を送ると、オートパイロットをトリガーできます。
```bash
curl -X POST "$MULTICA_WEBHOOK_URL" \
-H "Content-Type: application/json" \
- -d '{"event":"demo.received","eventPayload":{"message":"hello"}}'
+ -H "Idempotency-Key: demo-001" \
+ -d '{"event":"build.completed","eventPayload":{"status":"success"}}'
```
-**イシュー作成モード**では、インバウンドの payload が新しいイシューの説明に追記され、エージェントがインラインで読めるようになります。**実行専用モード**では、payload はデーモンがエージェントに渡す実行コンテキストの一部になります。
-
-### Payload の形
+Payload は配信記録と実行記録に保存され、エージェントへ渡されます。イシュー作成モードでは、イベントの内容がイシューの説明にも追加されます。
-独自のエンベロープ(envelope)を送れます。
-
-```json
-{ "event": "github.pull_request.opened", "eventPayload": { } }
-```
-
-…または任意の JSON オブジェクト / 配列を送ることもできます。Multica はこれを内部エンベロープに正規化します。
-
-```json
-{
- "event": "<inferred>",
- "eventPayload": <your body>,
- "request": { "receivedAt": "<rfc3339>", "contentType": "application/json" }
-}
-```
+Webhook リクエストには次の制約があります。
-`event` フィールドを指定しない場合、Multica は一般的なヘッダーと本文フィールドからこれを推論します(`X-GitHub-Event` + 本文 `action`、`X-Gitlab-Event`、`X-Event-Type`、本文の `event`/`type`/`action`)。どれも一致しない場合、イベントは `webhook.received` になります。
+- Body は有効な JSON オブジェクトまたは配列で、最大 256 KiB
+- `Idempotency-Key` を使うと、送信側の再試行による重複実行を防止可能。GitHub の場合は `X-GitHub-Delivery` も重複排除に使用
+- 安定した冪等キーがない場合、Multica は同じリクエストが 1 回だけ実行されることを保証できない
+- トリガーが無効、またはイベントがフィルターに一致しない場合、配信は「無視」として記録され、実行は作成されない
-GitHub のようなソースを構成するときは、content type を `application/json` に設定してください — フォームエンコードされた webhook payload は受け付けられません。
+### イベントをフィルターする
-GitHub の配信は `X-GitHub-Delivery` で重複排除されます。汎用の送信元は
-`Idempotency-Key` を指定できます。同じキーで再試行すると、元のキュー済み配信と
-run が再利用されます。どちらのヘッダーもない場合は安定したイベント ID がないため、
-重複排除はベストエフォートになります。
+同じ送信元から複数種類のイベントが届く場合、トリガーにイベントフィルターを追加できます。各行にイベント名と、任意で action の一覧を指定します。いずれか 1 行に一致すると実行され、すべて空の場合は全イベントを受け入れます。
-### イベントフィルター
+たとえばイベント名に `workflow_run`、Actions に `completed, failed` を指定すると、この 2 種類の `workflow_run` の結果だけを受け取ります。Multica は一般的なリクエストヘッダーと payload からイベントと action を判定します。GitHub の `X-GitHub-Event` と body の `action` にも対応しています。
-新しい webhook トリガーはインバウンドの POST ごとに発火します。単一用途の URL には問題ありませんが、多数のイベントタイプをファンアウトするソース(GitHub が代表的です — 単一のリポジトリ webhook 一つが `push`、`pull_request`、`workflow_run`、`check_suite` などを配信できます)にはノイズになります。webhook トリガーの**イベントフィルター(Event filters)**セクションを使うと、実際に実行をディスパッチするイベントを制限でき、それ以外のすべては `status = ignored`、`reason = event_filtered` で配信履歴に記録され、実行もイシューも作成されません。
+### Webhook URL を保護する
-各行は 1 つのルールです。**イベント名(event name)**と、任意でカンマ区切りの **action** リストで構成されます。Multica は**いずれか 1 つ**の行でも一致すれば webhook を許可します。セクションを空のままにすると、すべてを受け付けます(フィルタリング以前の動作)。
+<Callout type="warning">
+Webhook URL の token は、そのまま呼び出し用の認証情報です。完全な URL を公開リポジトリ、イシュー、スクリーンショットへ載せないでください。URL が漏えいした場合は、URL の横にある**URL を再生成**をクリックし、送信側の設定をすぐに更新してください。古い URL は直ちに無効になります。
+</Callout>
-例:
+完全な URL を確認できるのは、オートパイロットの作成者、ワークスペースの owner/admin、管理アクセスを付与された共同管理者だけです。画面では URL の token がデフォルトで隠されています。コピーするために表示する必要はありません。URL または目のアイコンをクリックすると完全なアドレスを確認できます。
-| イベント名 | Actions | 一致対象 |
-| -------------- | ------------------- | ------------------------------------------------------------------------ |
-| `workflow_run` | `completed, failed` | `action: completed` または `action: failed` の `workflow_run` イベントのみ |
-| `workflow_run` | _(空)_ | action に関係なくすべての `workflow_run` イベント |
-| `push` | _(空)_ | すべての `push` イベント |
+### Webhook レスポンス早見表
-#### イベント名と action の出所
+送信側をデバッグするときは、次の表で Multica のレスポンスを確認してください。
-Multica は次の順序でインバウンドリクエストから `event` 名と `action` を導き出します — **最初に一致したものが優先されます**。
+| HTTP ステータス | レスポンスの状態 | 意味 |
+|---|---|---|
+| 200 | `accepted` | 受け付けて実行を作成しました。配信 ID と実行 ID を返します。 |
+| 200 | `skipped` | 受け付けましたが、今回の実行はスキップされました。たとえば実行のみモードでランタイムがオフラインの場合です。理由も返します。 |
+| 200 | `ignored` | 実行は作成されません。トリガーが無効、オートパイロットが一時停止またはアーカイブ済み、イベントがフィルター対象などの場合で、`reason` に理由が入ります。 |
+| 200 | `duplicate` | 冪等キーが既存の配信と一致しました。元の配信 ID を返し、重複実行はしません。 |
+| 400 | エラーメッセージ | Body が空、有効な JSON ではない、または JSON オブジェクト/配列ではありません。 |
+| 401 | `rejected` | トリガーに署名用の秘密鍵が設定されていますが、署名がないか一致しません。 |
+| 404 | エラーメッセージ | URL の token が無効、または再生成済みです。 |
+| 413 | エラーメッセージ | Body が 256 KiB を超えています。 |
+| 429 | エラーメッセージ | リクエストが多すぎます。`Retry-After` レスポンスヘッダーに従って再試行してください。 |
+| 500 | エラーメッセージ | Multica の内部エラーです。送信側は後で再試行できます。 |
-**1. 本文エンベロープ(Body envelope)。** 本文が文字列の `event` フィールドを持つ JSON オブジェクトであれば、その値がそのままイベント名になります。任意の `eventPayload` オブジェクトは、自身の `action` / `state` / `conclusion` / `status` フィールドから action 候補を提供します。
+一時停止、アーカイブ、イベントフィルターなど、業務上の理由で無視した場合は 4xx ではなく 200 を返します。送信側が繰り返し再試行するのを防ぐためです。
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"event":"trigger","eventPayload":{"action":"true"}}'
-# inferred: event = trigger, action candidate = true
-```
+イベントと action は次の順番で判定します。
-**2. ヘッダー(Headers)。** 本文エンベロープがない場合、Multica は次のよく知られたプロバイダーヘッダーを読みます。
+1. body に文字列の `event` フィールドがあれば、その値を使用
+2. なければ `X-GitHub-Event` リクエストヘッダーを確認し、body の `action` と組み合わせて `github.<event>.<action>` を生成
+3. 次に `X-Gitlab-Event` リクエストヘッダーを確認
+4. 次に `X-Event-Type` リクエストヘッダーを確認
+5. 次に body の `event`、`type`、`action` フィールドを確認
+6. どれもない場合は `webhook.received`
-- `X-GitHub-Event: <event>` — (存在する場合)最上位の本文 `action` フィールドと組み合わされて `github.<event>.<action>` を形成します。
-- `X-Gitlab-Event: <event>` — `gitlab.<event>` になります。
-- `X-Event-Type: <event>` — そのまま通過します。
+## 実行と配信の履歴を確認する
-```bash
-# GitHub-style: header gives the event name, body gives the action.
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# inferred: event = github.workflow_run.completed
-# → matches a filter row of workflow_run / completed
-
-# Generic event-type header — no body fields needed.
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-Event-Type: trigger.true' \
- -H 'Content-Type: application/json' \
- -d '{}'
-# inferred: event = trigger.true → matches trigger / true
-```
+実行履歴には、トリガー元、時刻、状態、関連するイシューまたはタスク、失敗やスキップの理由が表示されます。Webhook トリガーでは、解析したイベント、レスポンス、重複排除情報、失敗理由を含む個別の配信履歴も保存されます。
-**3. 本文フォールバック(Body fallback)。** 本文エンベロープも既知のヘッダーもない場合、Multica は次の順序で最上位の本文文字列フィールドにフォールバックします: `event` → `type` → `action`。
+処理済みの Webhook 配信は詳細画面からリプレイできます。リプレイすると新しい配信と実行が作成され、元の記録は変更されません。署名検証に失敗した配信や、まだキューにある配信はリプレイできません。また、リプレイは重複排除の対象外です。
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"type":"trigger","action":"true"}'
-# inferred: event = trigger (from `type`), action candidate = true
-```
+## 失敗、一時停止、削除
-**4. デフォルト(Default)。** 上記のいずれも一致しない場合、イベントは `webhook.received` で、action 候補はありません。
+実行のみモードのタスクが失敗しても、自動では再試行しません。次回のスケジュールは予定どおりトリガーされます。イシュー作成モードで作成したタスクは通常のイシューのタスクとして扱われ、インフラ障害時は[タスク](/tasks#失敗と自動リトライ)のルールに従います。
-**action 候補、全リスト。** イベントが決定されると、Multica は以下のすべての値を可能な action 一致対象として考慮します。
+Multica は最近の実行が継続的に失敗していないか定期的に確認します。過去 7 日間に完了または失敗した実行が 50 回以上あり、失敗率が 90% 以上の場合、オートパイロットを一時停止して作成者へ通知します。原因を修正した後、手動で再開できます。
-- イベントが `provider.event.<action>` の形のときのイベント名のサフィックス(例: `github.workflow_run.completed` → `completed`)。
-- 本文フィールド `action`、`state`、`conclusion`、`status` — **JSON 文字列のときのみ該当します**。ブール値(`{"action": true}`)や数値は資格がないため、`event=trigger, action=true` を期待するフィルターは `{"trigger": true}` の本文とは決して一致しません。`true` は文字列ではなく bool だからです。
+手動で一時停止すると、スケジュール、Webhook、「今すぐ実行」がすべて停止します。削除は実際にはアーカイブであり、今後のトリガーは停止しますが、実行履歴と配信履歴は保持されます。
-**よくある落とし穴。** `Event name: trigger` / `Actions: true` のようなフィルター行は、「本文に `trigger: true` があれば発火せよ」という意味では**ありません** — イベントフィルターは任意の本文フィールドではなく、*推論されたイベントと action* に一致させます。これにヒットさせるには、`X-Event-Type` で `trigger.true` を送るか(または上に示した本文エンベロープを使ってください)。保存されたフィルター行の周囲の空白(`" workflow_run "`)はそのまま保存され、決して一致しないため — 保存する前に trim してください。
+## 管理権限
-#### クイックテスト
+- ワークスペースのすべてのメンバーがオートパイロットを作成可能
+- 作成者とワークスペースの owner/admin は、編集、実行、削除、トリガーの管理が可能
+- 作成者と owner/admin は、共同管理者を「管理アクセス」に追加可能
+- 共同管理者は、編集、実行、トリガーの管理ができるが、ほかのユーザーへ権限を付与することは不可
+- オートパイロットを管理できても、使用するエージェントを実行できるとは限らない。エージェントの Access は引き続き適用
-フィルターを構成したら、`curl` で両方の分岐を確認できます。
+## CLI を使う
```bash
-# Allowed — header drives event=workflow_run, body drives action=completed
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# → 200 {"status":"accepted", "delivery_id":"…", "run_id":"…", ...}
-
-# Filtered — same event, action not in allowlist
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"in_progress"}'
-# → 200 {"status":"ignored","reason":"event_filtered"}
+multica autopilot trigger <autopilot-id>
+multica autopilot runs <autopilot-id>
+multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>
```
-### URL は bearer secret です
-
-生成された URL **そのものが**認証情報です。それを持っている人は誰でもオートパイロットを発火できます。トークンのように扱ってください。
-
-- **公開のイシュースレッド、スクリーンショット、チャット履歴に貼り付けないでください。**
-- **漏洩したら交換してください** — トリガー行で「Rotate URL」をクリックするか、`multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>` を実行してください。古い URL はただちに動作を停止します。
-- 強力なソース認証が必要なソースの場合は、トリガーごとの HMAC 署名検証を待ってください。この v1 URL は bearer 方式のみをサポートします。
-- 現時点では、オートパイロットを閲覧できるワークスペースメンバーであればその webhook URL を読めます — 役割ごとのより厳格な secret の可視性は後続作業です。
-
-### ステータスコードの意味
-
-有効でアクティブな配信は、配信と冪等な実行の両方が永続化された後に `200 OK` で確認されます。
-
-- `{"status":"accepted","delivery_id":"…","run_id":"…","autopilot_id":"…","trigger_id":"…"}` — 受付が成功し、worker が復旧可能なディスパッチを所有します。
-- `{"status":"skipped","delivery_id":"…","run_id":"…","reason":"…"}` — たとえば担当エージェントのランタイムがオフラインの場合に、永続化された skipped の実行が作成されました。
-
-no-op と重複も `200 OK` を返します。
-
-- `{"status":"duplicate","delivery_id":"…","run_id":"…"}` — 同じ冪等キーの配信は既に受け付け済みです。元のリクエストが実行の受付前に終了した場合のみ `run_id` はなく、worker が復旧します。
-- `{"status":"ignored","reason":"trigger_disabled"}` — トリガーが無効になっています。
-- `{"status":"ignored","reason":"autopilot_paused"}` — オートパイロットが一時停止しています。
-- `{"status":"ignored","reason":"autopilot_archived"}` — オートパイロットがアーカイブされています。
-
-2xx 以外の応答は実際の失敗を扱います。
-
-- `400` — 無効な JSON、スカラー本文、空の本文。
-- `401` — 設定済みの webhook 署名がないか無効です。
-- `404` — 不明なトークン(`{"error":"webhook not found"}`)。
-- `413` — payload が 256 KiB を超えました。
-- `429` — IP の絶対上限、または不明なトークン / 無効な署名の試行上限を超えました。応答には `Retry-After` が含まれます。有効な配信は worker のトリガー別予算によって拒否されず、予算が戻るまでキューに残ります。
-
-### セルフホスト: 公開 URL を構成する
-
-サーバーに `MULTICA_PUBLIC_URL` が設定されている場合(例: `https://multica.example.com`)、トリガー応答に絶対パスの `webhook_url` が含まれ、UI にはすぐにコピーできる URL が表示されます。設定しない場合、UI はクライアントの API origin から URL を構成します — デスクトップと同一オリジンの Web には問題ありませんが、カスタムのセルフホストリバースプロキシには適しません。Multica は、誤って構成されたリバースプロキシが攻撃者の制御するホストを指す webhook URL をサーバーに発行させて欺くことができないよう、`Host` / `X-Forwarded-Host` ヘッダーから公開ホストを導出しないよう意図的に設計されています。
-
-## 実行履歴を見る
-
-すべてのトリガーは**実行レコード(run record)**を生成し、オートパイロット詳細ページの「History」タブで確認できます。
-
-- トリガーソース(`schedule` / `manual` / `webhook`)
-- 開始時刻、完了時刻
-- ステータス(`issue_created` / `running` / `completed` / `failed` / `skipped`)
-- 連携したイシュー(イシュー作成モード)または `task`(実行専用モード)
-- 失敗理由(失敗またはスキップした場合)
-
-## オートパイロットが失敗したらどうなるか
-
-<Callout type="warning">
-**オートパイロットの失敗は自動的に再試行されず、インボックス通知も送られません。** 失敗は実行履歴に `failed` のエントリを残すだけで — 割り当てや @-メンションのようなシステムレベルの再キューイングもなく、誰にも通知が行きません。オートパイロットが定期的な場合、**次の cron 発火が新しい実行をトリガー**しますが、失敗した作業が自動的に再実行されることはありません。
-
-オートパイロットが重要な場合は、独自のモニタリングを設計してください — 例えば、エージェントに成功時にコメントを残させ、コメントの欠落に気づくことで失敗を検出する、といった具合です。
-</Callout>
-
-自動再試行がない理由: オートパイロットはすでに定期的であるため、システムレベルの再試行を追加すると次の予定実行の上に重なり、重複した実行を生み出します。スケジューリングを完全に cron に任せることで、すっきりと保てます。
-
-## まだ提供されていない機能
-
-**API 種類のトリガーはまだ接続されていません。** トリガースキーマは `api` 種類を予約していますが、それを発火させるイングレスルートはありません。UI は既存の行に Deprecated バッジを表示し、コピー / 交換の操作は提供しません。トリガーごとの HMAC 署名検証、IP 許可リスト、プロバイダー固有のイベントプリセットは後続作業として追跡されており、v1 URL は bearer 方式のみをサポートします。
+すべての引数は [CLI](/cli)を参照してください。
-## 次へ
+## 次のステップ
-- [**エージェントにイシューを割り当てる**](/assigning-issues) — イシューをエージェントに一回限りで引き渡す
-- [**コメントでエージェントを @-メンションする**](/mentioning-agents) — コメントからエージェントを呼んで一度見てもらう
-- [**チャット**](/chat) — イシューの外での一対一の会話
+- [イシューをエージェントに割り当てる](/assigning-issues) — 割り当てと確認ダイアログ
+- [インボックスと購読](/inbox) — 実行通知の受信先
+- [タスク](/tasks) — 実行状態と失敗時の処理
diff --git a/apps/docs/content/docs/autopilots.ko.mdx b/apps/docs/content/docs/autopilots.ko.mdx
index 89e75c3bc0..1b8a3c3910 100644
--- a/apps/docs/content/docs/autopilots.ko.mdx
+++ b/apps/docs/content/docs/autopilots.ko.mdx
@@ -1,249 +1,157 @@
---
title: 오토파일럿
-description: 에이전트가 cron 스케줄, 인바운드 webhook으로 작업을 시작하거나, UI나 CLI로 한 번 수동 트리거하게 합니다.
+description: 시간 또는 Webhook에 따라 반복 작업을 에이전트에게 자동으로 맡깁니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-오토파일럿은 [에이전트](/agents)가 **스케줄에 따라 자동으로 작업을 시작**하게 합니다 — cron 표현식과 타임존을 설정하면, 여러분이 아무것도 트리거하지 않아도 Multica가 알아서 [`task`](/tasks)를 디스패치합니다. 정기 점검, 반복 보고서, 야간 정리 작업 등 "상시 지시(standing order)" 형태의 작업에 잘 맞습니다. 나머지 세 가지 트리거 경로([할당](/assigning-issues), [@-멘션](/mentioning-agents), [채팅](/chat) — 모두 여러분이 직접 시작하는 방식)와 비교했을 때, 오토파일럿의 핵심 차이는 **시간 기반**이라는 점입니다.
+오토파일럿는 매일 진행 상황을 요약하거나, 의존성을 정기적으로 확인하거나, 외부 시스템에서 이벤트를 받으면 에이전트를 시작하는 반복 작업에 사용합니다.
-## 오토파일럿 구성하기
+각 오토파일럿에는 런북 하나, 실행 주체 하나, 하나 이상의 트리거가 저장됩니다. 트리거되면 Multica가 이슈를 만들거나 에이전트를 바로 실행하고 모든 실행 기록을 보관합니다.
-워크스페이스의 **오토파일럿** 페이지에서 새 오토파일럿을 만듭니다. 다음 항목을 설정합니다.
+## 오토파일럿 만들기
-- **이름(Name)** — 표시 이름
-- **에이전트(Agent)** — 실행을 디스패치할 대상
-- **우선순위(Priority)** — 생성되는 `task`에 상속됩니다(이슈 우선순위와 동일한 의미)
-- **설명 / 프롬프트(Description / prompt)** — 매 실행마다 에이전트가 받는 작업 설명
-- **실행 모드(Execution mode)** — 아래 참고
-- **트리거(Triggers)** — `schedule`(cron + 타임존) 또는 `webhook` 중 최소 하나
+사이드바에서 **오토파일럿**를 열고 템플릿을 선택하거나 빈 상태에서 시작한 뒤 다음 항목을 설정합니다.
-## 실행 모드 선택하기
+- **이름**: 오토파일럿가 담당하는 일을 설명합니다.
+- **런북**: 에이전트가 실행할 때마다 읽는 목표, 배경, 제약, 단계입니다.
+- **실행 주체**: 에이전트 또는 스쿼드 하나입니다.
+- **연결 프로젝트**: 선택 항목이며 자동 생성된 이슈를 지정한 프로젝트에 넣습니다.
+- **출력 모드**: 이슈를 만들거나 실행만 합니다.
+- **구독자**: 자동 생성된 이슈의 알림을 받아야 하는 멤버입니다.
+- **트리거 방식**: 일정 또는 Webhook입니다.
-오토파일럿에는 두 가지 실행 모드가 있습니다. **"이슈 생성" 모드부터 시작하세요.**
+저장하면 오토파일럿가 기본적으로 활성화됩니다. **지금 실행**으로 언제든 전체 과정을 한 번 수동 실행할 수 있습니다.
-- **이슈 생성 모드(Create issue mode)**(`create_issue`) — 기본값이며 **권장**됩니다. 각 트리거는 먼저 워크스페이스에 이슈를 생성한 다음(제목에는 현재 단일 플레이스홀더 `{{date}}` 하나만 지원되며, 이는 `YYYY-MM-DD` 형식의 UTC 날짜로 보간됩니다. 그 외의 `{{...}}` 토큰은 생성 시점에 거부되므로, 오타가 이슈 제목에 리터럴 문자열로 조용히 들어가는 일을 막습니다), 일반 할당 흐름을 통해 그 이슈를 에이전트에게 할당합니다. 모든 작업은 수동으로 할당한 이슈와 동일한 히스토리, 댓글, 상태를 가진 채 이슈 보드에 올라갑니다.
-- **실행 전용 모드(Run-only mode)**(`run_only`) — 이슈 생성을 건너뛰고 `task`를 곧바로 대기열에 넣습니다. 이 실행은 보드에 표시되지 않으며 — 오토파일럿의 실행 히스토리에서만 확인할 수 있습니다.
+## 출력 모드 선택
-## 스케줄에 따라 실행하기
+| 모드 | 동작 | 적합한 경우 |
+|---|---|---|
+| **이슈 만들기** | 트리거할 때마다 이슈를 먼저 만든 뒤 실행 주체에 할당합니다. 논의, 상태, 실행 기록이 모두 이슈에 남습니다. | 팀이 확인하거나 승인하거나 후속 처리해야 하는 작업 |
+| **실행만** | 이슈 없이 실행 태스크를 바로 만듭니다. 결과는 오토파일럿 실행 기록에서만 확인합니다. | 협업 기록이 필요 없는 백그라운드 실행 태스크 |
-모든 오토파일럿에는 최소 하나의 `schedule` 트리거가 필요합니다. Cron은 **표준 5필드 형식**(분 시 일 월 요일)을 사용하며, 최소 단위는 **1분**입니다(초 단위는 없음). 타임존은 IANA 형식(예: `Asia/Shanghai`)이며, cron 표현식이 어느 타임존으로 해석될지를 결정합니다.
+**이슈 만들기** 모드는 일반 이슈와 같은 태스크 큐를 사용합니다. 런타임이 오프라인이어도 이슈를 먼저 만들고 실행 태스크는 런타임이 온라인이 될 때까지 기다릴 수 있습니다.
-몇 가지 예시입니다.
+**실행만** 모드는 트리거하는 시점에 런타임을 사용할 수 있어야 합니다. 사용할 수 없으면 이번 실행이 "건너뜀"으로 표시되며 대기 중인 이슈를 남기지 않습니다.
-- `0 9 * * 1-5`, `Asia/Shanghai` — 평일 베이징 시간 오전 9시
-- `*/30 * * * *`, `UTC` — 30분마다
-- `0 3 * * *`, `UTC` — 매일 UTC 오전 3시
+## 일정에 따라 실행
-Multica 서버는 **30초**마다 만료된 트리거를 스캔합니다 — **실제 발화 시각은 최대 30초까지 지연될 수 있으며**, 초 단위로 정확하지는 않습니다. 발화 시각 즈음에 서버가 재시작되면, 시작 시 놓친 트리거를 따라잡습니다(아무것도 유실되지 않지만 즉시 발화됩니다).
+일정 편집기에서 실행 시간, 반복 요일, 시간 범위, 시간대를 선택하고 다음 실행 시간을 미리 볼 수 있습니다. 오토파일럿 하나에 여러 일정을 추가할 수 있습니다. 특정 트리거를 개별적으로 켜거나 끄려면 CLI의 `autopilot trigger-update`를 사용하세요. 인수는 [CLI 명령](/cli)을 참고하세요.
-## 수동으로 한 번 트리거하기
+더 복잡한 규칙이 필요하면 표준 5필드 cron을 직접 수정할 수 있습니다.
-오토파일럿을 디버깅하는 동안 cron을 기다리지 않으려면 수동으로 트리거하세요.
-
-- UI: 오토파일럿 상세 페이지에서 "Run now" 클릭
-- CLI:
-
-```bash
-multica autopilot trigger <autopilot-id>
+```text
+분 시 일 월 요일
```
-수동 트리거는 `schedule` 트리거와 완전히 동일한 실행 흐름을 거치며 — 실행 레코드의 `source` 필드만 `manual`로 표시됩니다.
+예시:
-## Webhook으로 트리거하기
+| Cron | 시간대 | 의미 |
+|---|---|---|
+| `0 9 * * 1-5` | `Asia/Shanghai` | 평일 9:00 |
+| `*/30 * * * *` | `UTC` | 30분마다 |
+| `0 3 * * *` | `UTC` | 매일 3:00 |
-오토파일럿은 인바운드 HTTP webhook으로도 발화할 수 있습니다. 오토파일럿 상세 페이지에서 **Webhook** 트리거를 추가하면, Multica가 다음과 같은 형태의 고유 URL을 생성합니다.
+Cron에는 초가 없으며 시간대에는 `Asia/Shanghai` 같은 IANA 이름을 사용합니다. 저장하기 전에 페이지의 "다음 실행" 시간을 확인하세요.
-```
-https://<your-multica-host>/api/webhooks/autopilots/awt_…
-```
+![오토파일럿 편집기: 런북, 일정 설정, 다음 몇 번의 실행 미리보기](/images/docs/autopilot-schedule.png)
-그 URL로 아무 JSON이나 POST하세요. Multica는 먼저 전달을 영구 저장하고 멱등 실행을 동기적으로 승인한 뒤, `status = accepted | skipped`와 `run_id`가 포함된 `200 OK`를 반환합니다. 이후 데이터베이스-backed worker가 accepted 실행을 재개하고 에이전트를 디스패치합니다. 수신과 디스패치 사이에 서버가 재시작되어도 큐에 저장된 전달은 유실되지 않습니다.
+## Webhook으로 실행
+
+Webhook 트리거를 추가하면 Multica가 고유 URL을 생성합니다. 이 URL에 JSON 객체나 배열을 보내 오토파일럿를 트리거할 수 있습니다.
```bash
curl -X POST "$MULTICA_WEBHOOK_URL" \
-H "Content-Type: application/json" \
- -d '{"event":"demo.received","eventPayload":{"message":"hello"}}'
+ -H "Idempotency-Key: demo-001" \
+ -d '{"event":"build.completed","eventPayload":{"status":"success"}}'
```
-**이슈 생성 모드**에서는 인바운드 payload가 새 이슈의 설명에 덧붙여져 에이전트가 인라인으로 읽을 수 있습니다. **실행 전용 모드**에서는 payload가 데몬이 에이전트에게 넘기는 실행 컨텍스트의 일부가 됩니다.
-
-### Payload 형태
+Payload는 전달 및 실행 기록에 저장되고 에이전트에게 제공됩니다. 이슈 만들기 모드에서는 이벤트 내용도 이슈 설명에 첨부됩니다.
-직접 만든 봉투(envelope)를 보낼 수 있습니다.
-
-```json
-{ "event": "github.pull_request.opened", "eventPayload": { } }
-```
-
-…또는 임의의 JSON 객체/배열을 보낼 수도 있습니다. Multica는 이를 내부 봉투로 정규화합니다.
-
-```json
-{
- "event": "<inferred>",
- "eventPayload": <your body>,
- "request": { "receivedAt": "<rfc3339>", "contentType": "application/json" }
-}
-```
+Webhook 요청에는 다음 제약이 있습니다.
-`event` 필드를 제공하지 않으면, Multica는 일반적인 헤더와 본문 필드로부터 이를 추론합니다(`X-GitHub-Event` + 본문 `action`, `X-Gitlab-Event`, `X-Event-Type`, 본문의 `event`/`type`/`action`). 어느 것도 일치하지 않으면 이벤트는 `webhook.received`가 됩니다.
+- Body는 유효한 JSON 객체 또는 배열이어야 하며 최대 256 KiB입니다.
+- `Idempotency-Key`를 사용하면 발신자가 재시도할 때 중복 실행을 피할 수 있습니다. GitHub에서는 `X-GitHub-Delivery`도 중복 제거에 사용됩니다.
+- 안정적인 멱등성 key가 없으면 Multica는 중복 요청이 한 번만 실행된다고 보장할 수 없습니다.
+- 트리거가 비활성화되었거나 이벤트가 일치하지 않으면 전달이 "무시됨"으로 기록되고 실행은 생성되지 않습니다.
-GitHub 같은 소스를 구성할 때는 content type을 `application/json`으로 설정하세요 — 폼 인코딩된 webhook payload는 허용되지 않습니다.
+### 이벤트 필터링
-GitHub 전달은 `X-GitHub-Delivery`로 중복 제거됩니다. 일반 발신자는
-`Idempotency-Key`를 제공할 수 있습니다. 같은 키로 재시도하면 기존에 큐에 저장된
-전달과 run을 재사용합니다. 두 헤더가 모두 없으면 안정적인 이벤트 ID가 없으므로
-중복 제거는 최선 노력 방식으로만 제공됩니다.
+같은 소스에서 여러 종류의 이벤트를 보낸다면 트리거에 이벤트 필터를 추가할 수 있습니다. 각 줄에는 이벤트 이름과 선택적인 action 목록을 입력합니다. 어느 한 줄이라도 일치하면 실행되며 모두 비워 두면 모든 이벤트를 받습니다.
-### 이벤트 필터
+예를 들어 이벤트 이름에 `workflow_run`, Actions에 `completed, failed`를 입력하면 이 두 종류의 `workflow_run` 결과만 받습니다. Multica는 GitHub의 `X-GitHub-Event`와 body의 `action`을 포함해 일반적인 요청 header와 payload에서 이벤트와 action을 식별합니다.
-새 webhook 트리거는 인바운드 POST마다 발화합니다. 단일 용도 URL에는 괜찮지만, 여러 이벤트 타입을 팬아웃하는 소스(GitHub가 대표적입니다 — 단일 저장소 webhook 하나가 `push`, `pull_request`, `workflow_run`, `check_suite` 등을 전달할 수 있습니다)에는 시끄럽습니다. webhook 트리거의 **이벤트 필터(Event filters)** 섹션을 사용하면 실제로 실행을 디스패치할 이벤트를 제한할 수 있으며, 그 외의 모든 것은 `status = ignored`, `reason = event_filtered`로 전달 히스토리에 기록되고 실행이나 이슈는 생성되지 않습니다.
+### Webhook URL 보호
-각 행은 하나의 규칙입니다. **이벤트 이름(event name)**과 선택적으로 쉼표로 구분한 **action** 목록으로 구성됩니다. Multica는 **어느 한** 행이라도 일치하면 webhook을 허용합니다. 섹션을 비워 두면 모든 것을 수락합니다(필터링 이전 동작).
+<Callout type="warning">
+Webhook URL의 token이 호출 자격 증명입니다. 전체 URL을 공개 저장소, 이슈, 스크린샷에 넣지 마세요. URL이 노출되면 URL 옆의 **URL 재생성** 버튼을 클릭하고 발신자 설정을 즉시 업데이트하세요. 이전 URL은 바로 무효화됩니다.
+</Callout>
-예시:
+오토파일럿 생성자, 워크스페이스 owner/admin, 접근 권한을 받은 협업자만 전체 URL을 볼 수 있습니다. 화면에서는 기본적으로 URL의 token을 숨기며 표시하지 않아도 복사할 수 있습니다. URL 또는 눈 아이콘을 클릭하면 전체 주소가 표시됩니다.
-| 이벤트 이름 | Actions | 일치 대상 |
-| -------------- | ------------------- | ------------------------------------------------------------------------ |
-| `workflow_run` | `completed, failed` | `action: completed` 또는 `action: failed`인 `workflow_run` 이벤트만 |
-| `workflow_run` | _(비어 있음)_ | action에 상관없이 모든 `workflow_run` 이벤트 |
-| `push` | _(비어 있음)_ | 모든 `push` 이벤트 |
+### Webhook 응답 빠른 참조
-#### 이벤트 이름과 action의 출처
+발신자를 디버깅할 때 다음 표로 Multica 응답을 확인하세요.
-Multica는 다음 순서로 인바운드 요청에서 `event` 이름과 `action`을 도출하며 — **첫 번째로 일치하는 것이 우선합니다**.
+| HTTP 상태 | 응답 상태 | 의미 |
+|---|---|---|
+| 200 | `accepted` | 요청을 받아 실행을 만들었으며 전달 ID와 실행 ID를 반환합니다. |
+| 200 | `skipped` | 요청을 받았지만 이번 실행을 건너뛰었습니다. 예를 들어 실행만 모드에서 런타임이 오프라인일 때이며 이유가 포함됩니다. |
+| 200 | `ignored` | 실행을 만들지 않았습니다. 트리거가 비활성화되었거나 오토파일럿가 일시 중지 또는 보관되었거나 이벤트가 필터링되었습니다. `reason` 필드에 이유가 있습니다. |
+| 200 | `duplicate` | 멱등성 key가 기존 전달과 일치합니다. 원래 전달 ID를 반환하고 다시 실행하지 않습니다. |
+| 400 | 오류 메시지 | Body가 비어 있거나 유효한 JSON이 아니거나 JSON 객체/배열이 아닙니다. |
+| 401 | `rejected` | 트리거에 서명 key가 설정되어 있지만 요청에 서명이 없거나 일치하지 않습니다. |
+| 404 | 오류 메시지 | URL의 token이 유효하지 않거나 재생성되었습니다. |
+| 413 | 오류 메시지 | Body가 256 KiB를 초과합니다. |
+| 429 | 오류 메시지 | 요청이 너무 많습니다. 응답 header의 `Retry-After` 뒤에 다시 시도하세요. |
+| 500 | 오류 메시지 | Multica 내부 오류입니다. 발신자는 나중에 다시 시도할 수 있습니다. |
-**1. 본문 봉투(Body envelope).** 본문이 문자열 `event` 필드를 가진 JSON 객체이면, 그 값이 곧 이벤트 이름입니다. 선택적인 `eventPayload` 객체는 자신의 `action` / `state` / `conclusion` / `status` 필드에서 action 후보를 제공합니다.
+일시 중지, 보관, 이벤트 필터링처럼 비즈니스 규칙에 따른 무시는 4xx가 아니라 200을 반환해 발신자의 반복 재시도를 방지합니다.
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"event":"trigger","eventPayload":{"action":"true"}}'
-# inferred: event = trigger, action candidate = true
-```
+이벤트와 action의 추론 순서는 다음과 같습니다.
-**2. 헤더(Headers).** 본문 봉투가 없을 때, Multica는 다음의 잘 알려진 제공자 헤더를 읽습니다.
+1. body에 문자열 `event` 필드가 있으면 바로 사용합니다.
+2. 없으면 `X-GitHub-Event` 요청 header를 확인하고 body의 `action`과 합쳐 `github.<event>.<action>`으로 만듭니다.
+3. 다음으로 `X-Gitlab-Event` 요청 header를 확인합니다.
+4. 다음으로 `X-Event-Type` 요청 header를 확인합니다.
+5. 다음으로 body의 `event`, `type`, `action` 필드를 확인합니다.
+6. 모두 없으면 `webhook.received`로 기록합니다.
-- `X-GitHub-Event: <event>` — (있는 경우) 최상위 본문 `action` 필드와 결합해 `github.<event>.<action>`을 형성합니다.
-- `X-Gitlab-Event: <event>` — `gitlab.<event>`가 됩니다.
-- `X-Event-Type: <event>` — 그대로 통과합니다.
+## 실행 및 전달 기록 확인
-```bash
-# GitHub-style: header gives the event name, body gives the action.
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# inferred: event = github.workflow_run.completed
-# → matches a filter row of workflow_run / completed
-
-# Generic event-type header — no body fields needed.
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-Event-Type: trigger.true' \
- -H 'Content-Type: application/json' \
- -d '{}'
-# inferred: event = trigger.true → matches trigger / true
-```
+실행 기록에는 트리거 출처, 시간, 상태, 연결된 이슈 또는 실행 태스크, 실패하거나 건너뛴 이유가 표시됩니다. Webhook 트리거에는 별도 전달 기록도 저장되며 여기에는 해석한 이벤트, 응답, 중복 제거 정보, 실패 이유가 포함됩니다.
-**3. 본문 폴백(Body fallback).** 본문 봉투도 알려진 헤더도 없으면, Multica는 다음 순서로 최상위 본문 문자열 필드로 폴백합니다: `event` → `type` → `action`.
+처리가 끝난 Webhook 전달은 상세 화면에서 재생할 수 있습니다. 재생은 원래 기록을 바꾸지 않고 새 전달과 실행을 만듭니다. 서명 검증에 실패했거나 아직 큐에서 대기 중인 전달은 재생할 수 없으며 재생에는 중복 제거를 적용하지 않습니다.
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"type":"trigger","action":"true"}'
-# inferred: event = trigger (from `type`), action candidate = true
-```
+## 실패, 일시 중지, 삭제
-**4. 기본값(Default).** 위 어느 것도 일치하지 않으면, 이벤트는 `webhook.received`이고 action 후보는 없습니다.
+실행만 모드의 실행 태스크가 실패해도 자동으로 재시도하지 않습니다. 다음 일정은 원래 계획대로 트리거됩니다. 이슈 만들기 모드에서 생성된 실행 태스크는 일반 이슈 태스크이며 인프라 장애는 [실행 태스크](/tasks#실패와-자동-재시도)의 규칙에 따라 처리됩니다.
-**action 후보, 전체 목록.** 이벤트가 결정되면, Multica는 아래의 모든 값을 가능한 action 일치 대상으로 고려합니다.
+Multica는 최근 실행이 계속 실패하는지 정기적으로 확인합니다. 지난 7일 동안 완료되거나 실패한 실행이 50회 이상이고 실패율이 90% 이상이면 시스템이 오토파일럿를 일시 중지하고 생성자에게 알립니다. 원인을 해결한 뒤 수동으로 다시 시작할 수 있습니다.
-- 이벤트가 `provider.event.<action>` 형태일 때의 이벤트 이름 접미사(예: `github.workflow_run.completed` → `completed`).
-- 본문 필드 `action`, `state`, `conclusion`, `status` — **JSON 문자열일 때만 해당됩니다**. 불리언(`{"action": true}`)이나 숫자는 자격이 없으므로, `event=trigger, action=true`를 기대하는 필터는 `{"trigger": true}` 본문과 절대 일치하지 않습니다. `true`는 문자열이 아니라 bool이기 때문입니다.
+수동으로 일시 중지하면 일정, Webhook, "지금 실행"이 모두 중지됩니다. 삭제는 실제로 보관 처리합니다. 이후 트리거는 중지하지만 실행 및 전달 기록은 유지합니다.
-**흔한 함정.** `Event name: trigger` / `Actions: true` 같은 필터 행은 "본문에 `trigger: true`가 있으면 발화하라"는 뜻이 **아닙니다** — 이벤트 필터는 임의의 본문 필드가 아니라 *추론된 이벤트와 action*에 일치시킵니다. 이를 적중시키려면 `X-Event-Type`로 `trigger.true`를 보내거나(또는 위에 표시된 본문 봉투를 사용하세요). 저장된 필터 행에서 주변 공백(`" workflow_run "`)은 그대로 저장되어 절대 일치하지 않으므로 — 저장하기 전에 trim하세요.
+## 관리 권한
-#### 빠른 테스트
+- 모든 워크스페이스 멤버가 오토파일럿를 만들 수 있습니다.
+- 생성자와 워크스페이스 owner/admin은 수정, 실행, 삭제, 트리거 관리를 할 수 있습니다.
+- 생성자와 owner/admin은 협업자를 "관리 접근"에 추가할 수 있습니다.
+- 협업자는 수정, 실행, 트리거 관리를 할 수 있지만 다른 사람에게 권한을 다시 부여할 수는 없습니다.
+- 오토파일럿를 관리할 수 있다고 해서 반드시 그 오토파일럿가 사용하는 에이전트를 실행할 수 있는 것은 아닙니다. 에이전트 Access는 계속 적용됩니다.
-필터를 구성한 후에는 `curl`로 두 분기를 모두 확인할 수 있습니다.
+## CLI 사용
```bash
-# Allowed — header drives event=workflow_run, body drives action=completed
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# → 200 {"status":"accepted", "delivery_id":"…", "run_id":"…", ...}
-
-# Filtered — same event, action not in allowlist
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"in_progress"}'
-# → 200 {"status":"ignored","reason":"event_filtered"}
+multica autopilot trigger <autopilot-id>
+multica autopilot runs <autopilot-id>
+multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>
```
-### URL은 bearer secret입니다
-
-생성된 URL **자체가** 자격 증명입니다. 그것을 가진 사람은 누구나 오토파일럿을 발화할 수 있습니다. 토큰처럼 다루세요.
-
-- **공개된 이슈 스레드, 스크린샷, 채팅 히스토리에 붙여넣지 마세요.**
-- **유출되면 교체하세요** — 트리거 행에서 "Rotate URL"을 클릭하거나 `multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>`를 실행하세요. 기존 URL은 즉시 작동을 멈춥니다.
-- 강력한 소스 인증이 필요한 소스의 경우, 트리거별 HMAC 서명 검증을 기다리세요. 이 v1 URL은 bearer 방식만 지원합니다.
-- 현재로서는 오토파일럿을 볼 수 있는 워크스페이스 멤버라면 그 webhook URL을 읽을 수 있습니다 — 역할별로 더 엄격한 secret 가시성은 후속 작업입니다.
-
-### 상태 코드 의미
-
-유효하고 활성 상태인 전달은 전달과 멱등 실행이 모두 영구 저장된 뒤 `200 OK`로 확인됩니다.
-
-- `{"status":"accepted","delivery_id":"…","run_id":"…","autopilot_id":"…","trigger_id":"…"}` — 승인이 완료되었고 worker가 복구 가능한 디스패치를 맡습니다.
-- `{"status":"skipped","delivery_id":"…","run_id":"…","reason":"…"}` — 예를 들어 담당 에이전트의 런타임이 오프라인인 경우 영구 저장된 skipped 실행이 생성되었습니다.
-
-no-op과 중복도 `200 OK`를 반환합니다.
-
-- `{"status":"duplicate","delivery_id":"…","run_id":"…"}` — 같은 멱등 키의 전달이 이미 수신되었습니다. 원본 요청이 실행 승인 전에 종료된 경우에만 `run_id`가 생략되며 worker가 이를 복구합니다.
-- `{"status":"ignored","reason":"trigger_disabled"}` — 트리거가 비활성화되어 있습니다.
-- `{"status":"ignored","reason":"autopilot_paused"}` — 오토파일럿이 일시 정지되어 있습니다.
-- `{"status":"ignored","reason":"autopilot_archived"}` — 오토파일럿이 보관되어 있습니다.
-
-2xx가 아닌 응답은 실제 실패를 다룹니다.
-
-- `400` — 유효하지 않은 JSON, 스칼라 본문, 빈 본문.
-- `401` — 설정된 webhook 서명이 없거나 유효하지 않습니다.
-- `404` — 알 수 없는 토큰(`{"error":"webhook not found"}`).
-- `413` — payload가 256 KiB를 초과했습니다.
-- `429` — IP 절대 상한 또는 알 수 없는 토큰 / 잘못된 서명 시도 한도를 초과했습니다. 응답에는 `Retry-After`가 포함됩니다. 유효한 전달은 worker의 트리거별 예산 때문에 거부되지 않고, 예산이 복구될 때까지 큐에 남습니다.
-
-### 자체 호스팅: 공개 URL 구성하기
-
-서버에 `MULTICA_PUBLIC_URL`이 설정되어 있으면(예: `https://multica.example.com`), 트리거 응답에 절대 경로 `webhook_url`이 포함되고 UI에는 복사 가능한 URL이 바로 표시됩니다. 설정하지 않으면 UI는 클라이언트의 API origin으로부터 URL을 구성합니다 — 데스크톱과 동일 출처 웹에는 괜찮지만, 커스텀 자체 호스팅 리버스 프록시에는 적합하지 않습니다. Multica는 잘못 구성된 리버스 프록시가 공격자가 제어하는 호스트를 가리키는 webhook URL을 서버가 발행하도록 속이지 못하게, `Host` / `X-Forwarded-Host` 헤더로부터 공개 호스트를 도출하지 않도록 의도적으로 설계되었습니다.
-
-## 실행 히스토리 보기
-
-모든 트리거는 **실행 레코드(run record)**를 생성하며, 오토파일럿 상세 페이지의 "History" 탭에서 볼 수 있습니다.
-
-- 트리거 소스(`schedule` / `manual` / `webhook`)
-- 시작 시각, 완료 시각
-- 상태(`issue_created` / `running` / `completed` / `failed` / `skipped`)
-- 연결된 이슈(이슈 생성 모드) 또는 `task`(실행 전용 모드)
-- 실패 사유(실패하거나 건너뛴 경우)
-
-## 오토파일럿이 실패하면 어떻게 되나요
-
-<Callout type="warning">
-**오토파일럿 실패는 자동으로 재시도되지 않으며 인박스 알림도 보내지 않습니다.** 실패는 실행 히스토리에 `failed` 항목을 남길 뿐 — 할당이나 @-멘션처럼 시스템 수준에서 다시 대기열에 넣는 일도 없고, 누구에게도 알림이 가지 않습니다. 오토파일럿이 주기적이라면 **다음 cron 발화가 새 실행을 트리거**하지만, 실패한 작업이 자동으로 다시 실행되지는 않습니다.
-
-오토파일럿이 중요하다면 직접 모니터링을 설계하세요 — 예를 들어 에이전트가 성공 시 댓글을 남기게 하고, 댓글이 누락된 것을 알아채 실패를 잡아내는 식입니다.
-</Callout>
-
-자동 재시도가 없는 이유: 오토파일럿은 이미 주기적이므로, 시스템 수준의 재시도를 추가하면 다음 예약된 실행 위에 겹쳐 중복 실행을 만들어 냅니다. 스케줄링을 전적으로 cron에 맡기면 깔끔하게 유지됩니다.
-
-## 아직 제공되지 않는 기능
-
-**API 종류의 트리거는 아직 연결되어 있지 않습니다.** 트리거 스키마는 `api` 종류를 예약해 두었지만, 그것을 발화하는 인그레스 라우트가 없습니다. UI는 기존 행에 Deprecated 배지를 표시하며 복사/교체 기능을 제공하지 않습니다. 트리거별 HMAC 서명 검증, IP 허용 목록, 제공자별 이벤트 프리셋은 후속 작업으로 추적되고 있으며, v1 URL은 bearer 방식만 지원합니다.
+전체 인수는 [CLI 사용](/cli)을 참고하세요.
-## 다음
+## 다음 단계
-- [**에이전트에게 이슈 할당하기**](/assigning-issues) — 이슈를 에이전트에게 일회성으로 넘기기
-- [**댓글에서 에이전트 @-멘션하기**](/mentioning-agents) — 댓글에서 에이전트를 불러 한번 살펴보게 하기
-- [**채팅**](/chat) — 이슈 밖에서의 일대일 대화
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 할당과 확인 창을 알아봅니다.
+- [인박스와 구독](/inbox) — 실행 알림이 도착하는 위치를 확인합니다.
+- [실행 태스크](/tasks) — 실행 상태와 실패 처리를 알아봅니다.
diff --git a/apps/docs/content/docs/autopilots.mdx b/apps/docs/content/docs/autopilots.mdx
index 72650f09b2..d5a6a614b9 100644
--- a/apps/docs/content/docs/autopilots.mdx
+++ b/apps/docs/content/docs/autopilots.mdx
@@ -1,319 +1,157 @@
---
title: Autopilots
-description: Let agents start work on a cron schedule, an inbound webhook, or trigger once manually via the UI or CLI.
+description: Hand recurring work to agents automatically, on a schedule or from a webhook.
---
import { Callout } from "fumadocs-ui/components/callout";
-Autopilots let [agents](/agents) **start work automatically on a schedule** — configure a cron expression and a timezone, and Multica dispatches a [`task`](/tasks) on its own, without you triggering anything. It fits periodic checks, recurring reports, and overnight cleanup jobs — the "standing order" shape of work. Compared to the other three trigger paths ([assigning](/assigning-issues), [@-mention](/mentioning-agents), and [chat](/chat), where you are the one kicking things off), the core difference with Autopilots is that they are **time-driven**.
+Autopilots run work that happens over and over — a daily progress summary, a periodic dependency check, or an agent kicked off by an event from an external system.
-## Configure an autopilot
+Each autopilot stores a Runbook, an assignee, and one or more triggers. When triggered, Multica creates an issue or runs the agent directly, and keeps a record of every run.
-Create a new autopilot on the workspace's **Autopilot** page. You set:
+## Create an autopilot
-- **Name** — display name
-- **Agent** — who the run is dispatched to
-- **Priority** — inherited by the `task` it produces (same semantics as issue priority)
-- **Description / prompt** — the work description the agent receives each run
-- **Execution mode** — see below
-- **Triggers** — at least one `schedule` (cron + timezone) or `webhook`
+Open **Autopilot** in the sidebar, pick a template or start from scratch, then configure:
-## Pick an execution mode
+- **Name**: what this autopilot is responsible for;
+- **Runbook**: the goal, background, constraints, and steps the agent reads on every run;
+- **Assignee**: an agent or a squad;
+- **Project**: optional; puts auto-created issues into a specific project;
+- **Execution mode**: create an issue, or run only;
+- **Subscribers**: members to notify after an issue is auto-created;
+- **Triggers**: a schedule or a webhook.
-An autopilot has two execution modes. **Start with "create issue" mode.**
+An autopilot is enabled by default after saving; **Run now** manually executes the full flow once at any time.
-- **Create issue mode** (`create_issue`) — default, **recommended**. Each trigger first creates an issue in the workspace (the title currently supports a single placeholder, `{{date}}`, which interpolates to the UTC date in `YYYY-MM-DD` format; any other `{{...}}` token is rejected at create-time so a typo cannot silently land as the literal string in your issue titles), then assigns the issue to the agent through the normal assignment flow. All work lands on the issue board with the same history, comments, and status as a manually assigned issue.
-- **Run-only mode** (`run_only`) — skips issue creation and enqueues a `task` directly. The run is invisible on the board — you can only see it in the autopilot's run history.
+## Choose an execution mode
-## Run it on a schedule
+| Mode | Behavior | Best for |
+|---|---|---|
+| **Create issue** | Each trigger first creates an issue, then assigns it to the assignee; discussion, status, and run records all live on the issue. | Work the team needs to review, confirm, or follow up on. |
+| **Run only** | Creates a task directly with no issue; results are visible only in the autopilot's run history. | Background runs that need no collaboration record. |
-Every autopilot needs at least one `schedule` trigger. Cron uses the **standard 5-field format** (minute hour day month weekday), with **1-minute** minimum granularity (no seconds). Timezone is IANA-formatted (for example, `Asia/Shanghai`) and determines which timezone the cron expression is interpreted in.
+**Create issue** mode uses the same task queue as regular issues: when the runtime is offline, the issue is still created and the task waits for the runtime to come online.
-A few examples:
+**Run only** requires the runtime to be available at trigger time; otherwise the run shows as skipped, and no waiting issue is left behind.
-- `0 9 * * 1-5`, `Asia/Shanghai` — 9 AM Beijing time on weekdays
-- `*/30 * * * *`, `UTC` — every 30 minutes
-- `0 3 * * *`, `UTC` — every day at 3 AM UTC
+## Run on a schedule
-The Multica server scans for due triggers every **30 seconds** — **the actual fire time can lag by up to 30 seconds**, not down to the second. If the server is restarted across a fire time, it catches up missed triggers on startup (nothing is lost, but they fire right away).
+The schedule editor lets you pick the run time, repeat days, time window, and timezone, and previews the upcoming run times. One autopilot can have multiple schedules; enabling or disabling an individual trigger is done with the CLI's `autopilot trigger-update` — see [Using the CLI](/cli) for the parameters.
-## Trigger once manually
+When you need more complex rules, edit the standard 5-field cron directly:
-To avoid waiting for cron while debugging an autopilot, trigger it manually:
-
-- UI: click "Run now" on the autopilot detail page
-- CLI:
-
-```bash
-multica autopilot trigger <autopilot-id>
+```text
+minute hour day month weekday
```
-A manual trigger goes through the exact same execution flow as a `schedule` trigger — only the `source` field on the run record is marked `manual`.
+For example:
-## Trigger from a webhook
+| Cron | Timezone | Meaning |
+|---|---|---|
+| `0 9 * * 1-5` | `Asia/Shanghai` | 9:00 on weekdays |
+| `*/30 * * * *` | `UTC` | Every 30 minutes |
+| `0 3 * * *` | `UTC` | Every day at 3:00 |
-Autopilots can also fire on inbound HTTP webhooks. Add a **Webhook** trigger
-on the autopilot detail page; Multica generates a unique URL of the shape:
+Cron has no seconds field, and timezones use IANA names like `Asia/Shanghai`. Before saving, check the result against the "next runs" times shown on the page.
-```
-https://<your-multica-host>/api/webhooks/autopilots/awt_…
-```
+![The autopilot editor: Runbook, schedule settings, and a preview of the next few runs](/images/docs/autopilot-schedule.png)
+
+## Run from a webhook
-POST any JSON to that URL. Multica first stores a durable delivery and
-synchronously admits an idempotent run, returning `200 OK` with
-`status = accepted | skipped` and its `run_id`. A database-backed worker then
-resumes accepted runs, stores the body as the run's `trigger_payload`, and
-dispatches the agent exactly the way a schedule trigger would. A server restart
-between admission and dispatch does not lose the queued delivery.
+After adding a webhook trigger, Multica generates a unique URL. Send it a JSON object or array to trigger the autopilot:
```bash
curl -X POST "$MULTICA_WEBHOOK_URL" \
-H "Content-Type: application/json" \
- -d '{"event":"demo.received","eventPayload":{"message":"hello"}}'
+ -H "Idempotency-Key: demo-001" \
+ -d '{"event":"build.completed","eventPayload":{"status":"success"}}'
```
-In **create issue mode**, the inbound payload is appended to the new issue's
-description so the agent can read it inline. In **run-only mode**, the
-payload is part of the run context the daemon hands the agent.
-
-### Payload shape
-
-You can send your own envelope:
-
-```json
-{ "event": "github.pull_request.opened", "eventPayload": { } }
-```
-
-…or any JSON object/array. Multica normalizes it into an internal envelope:
-
-```json
-{
- "event": "<inferred>",
- "eventPayload": <your body>,
- "request": { "receivedAt": "<rfc3339>", "contentType": "application/json" }
-}
-```
+The payload is saved on the delivery and run records and handed to the agent. In create-issue mode it is also appended to the issue description.
-When you don't provide an `event` field, Multica infers it from common
-headers and body fields (`X-GitHub-Event` + body `action`,
-`X-Gitlab-Event`, `X-Event-Type`, body `event`/`type`/`action`). When
-nothing matches, the event is `webhook.received`.
+Constraints on webhook requests:
-When configuring GitHub or similar sources, set the content type to
-`application/json` — form-encoded webhook payloads are not accepted.
+- the body must be a valid JSON object or array, up to 256 KiB;
+- `Idempotency-Key` prevents duplicate runs when the sender retries; GitHub deliveries are also deduplicated by `X-GitHub-Delivery`;
+- without a stable idempotency key, Multica can't guarantee that repeated requests run only once;
+- when the trigger is disabled or the event doesn't match, the delivery is recorded as ignored and no run is created.
-GitHub deliveries are deduplicated by `X-GitHub-Delivery`; generic senders can
-provide `Idempotency-Key`. Retries with the same key reuse the original queued
-delivery and run. Without either header, delivery remains best-effort because
-there is no stable event identity to deduplicate.
+### Filter events
-### Event filters
+When one source sends several event types, add event filters to the trigger. Each row holds one event name plus an optional list of actions; a run fires if any row matches, and leaving all rows empty accepts every event.
-A new webhook trigger fires on every inbound POST, which is fine for a
-single-purpose URL but noisy for sources that fan out many event types
-(GitHub being the obvious one — a single repo webhook can deliver
-`push`, `pull_request`, `workflow_run`, `check_suite`, and more). The
-**Event filters** section on a webhook trigger lets you restrict which
-events actually dispatch a run; everything else is recorded in delivery
-history with `status = ignored` and `reason = event_filtered`, and no
-run or issue is created.
+For example, with `workflow_run` as the event name and `completed, failed` as the actions, only those two kinds of `workflow_run` results are accepted. Multica recognizes the event and action from common request headers and payload fields, including GitHub's `X-GitHub-Event` and the `action` field in the body.
-Each row is one rule: an **event name** plus an optional
-comma-separated **actions** list. Multica allows a webhook if **any**
-row matches; leave the section empty to accept everything (the
-pre-filter behavior).
+### Protect the webhook URL
-Examples:
+<Callout type="warning">
+The token in the webhook URL is the calling credential. Don't put the full URL in public repositories, issues, or screenshots. If the URL leaks, click the **Rotate URL** button next to it and update the sender immediately; the old URL stops working right away.
+</Callout>
-| Event name | Actions | Matches |
-| -------------- | ------------------- | ------------------------------------------------------------------------ |
-| `workflow_run` | `completed, failed` | `workflow_run` events with `action: completed` or `action: failed` only |
-| `workflow_run` | _(empty)_ | every `workflow_run` event, regardless of action |
-| `push` | _(empty)_ | every `push` event |
+Only the autopilot's creator, workspace owners/admins, and collaborators granted access can view the full URL. The UI hides the token in the URL by default, and copying doesn't require revealing it; click the URL or the eye icon to view the full address.
-#### Where the event name and action come from
+### Webhook response reference
-Multica derives the `event` name and `action` from the inbound request
-in this order — **the first match wins**.
+When debugging a sender, use this table to interpret Multica's responses:
-**1. Body envelope.** If the body is a JSON object with a string
-`event` field, that value is the event name directly. An optional
-`eventPayload` object then supplies action candidates from its
-`action` / `state` / `conclusion` / `status` fields.
+| HTTP status | Response status | Meaning |
+|---|---|---|
+| 200 | `accepted` | Accepted and a run was created; returns the delivery and run IDs. |
+| 200 | `skipped` | Accepted, but this run was skipped (for example, the runtime is offline in run-only mode); includes the reason. |
+| 200 | `ignored` | No run created: the trigger is disabled, the autopilot is paused or archived, or the event was filtered; the `reason` field explains why. |
+| 200 | `duplicate` | The idempotency key hit an existing delivery; returns the original delivery ID and doesn't run again. |
+| 400 | Error message | The body is empty, not valid JSON, or not a JSON object/array. |
+| 401 | `rejected` | The trigger has a signing secret configured, but the request is missing a signature or the signature doesn't match. |
+| 404 | Error message | The token in the URL is invalid or has been rotated. |
+| 413 | Error message | The body exceeds 256 KiB. |
+| 429 | Error message | Too many requests; retry later per the `Retry-After` response header. |
+| 500 | Error message | Multica internal error; the sender can retry later. |
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"event":"trigger","eventPayload":{"action":"true"}}'
-# inferred: event = trigger, action candidate = true
-```
+Business-level ignores — pausing, archiving, and event filtering — return 200 rather than 4xx, so senders don't retry endlessly.
-**2. Headers.** When no body envelope is present, Multica reads the
-following well-known provider headers:
+Event and action inference order:
-- `X-GitHub-Event: <event>` — combined with the top-level body
- `action` field (when present) to form `github.<event>.<action>`.
-- `X-Gitlab-Event: <event>` — becomes `gitlab.<event>`.
-- `X-Event-Type: <event>` — passed through verbatim.
+1. if the body has a string `event` field, it is used directly;
+2. otherwise the `X-GitHub-Event` request header, combined with the body's `action` into `github.<event>.<action>`;
+3. then the `X-Gitlab-Event` request header;
+4. then the `X-Event-Type` request header;
+5. then the body's `event`, `type`, and `action` fields;
+6. when all are missing, the event is recorded as `webhook.received`.
-```bash
-# GitHub-style: header gives the event name, body gives the action.
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# inferred: event = github.workflow_run.completed
-# → matches a filter row of workflow_run / completed
+## View runs and deliveries
-# Generic event-type header — no body fields needed.
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-Event-Type: trigger.true' \
- -H 'Content-Type: application/json' \
- -d '{}'
-# inferred: event = trigger.true → matches trigger / true
-```
+Run history shows the trigger source, time, status, the linked issue or task, and the reason for a failure or skip. Webhook triggers additionally keep separate delivery records, including the parsed event, the response, deduplication info, and the failure reason.
-**3. Body fallback.** If neither a body envelope nor a known header is
-present, Multica falls back to top-level body string fields in this
-order: `event` → `type` → `action`.
+A fully processed webhook delivery can be replayed from its detail view. A replay creates a new delivery and run without rewriting the original record; deliveries that failed signature verification or are still queued can't be replayed, and replays don't participate in deduplication.
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"type":"trigger","action":"true"}'
-# inferred: event = trigger (from `type`), action candidate = true
-```
+## Failures, pausing, and deletion
-**4. Default.** If nothing above matches, the event is
-`webhook.received` and there are no action candidates.
+A failed task in run-only mode is not retried automatically; the next schedule still fires as planned. Create-issue mode produces regular issue tasks, and infrastructure failures follow the rules in [Tasks](/tasks#failures-and-automatic-retries).
-**Action candidates, in full.** Once the event is determined, Multica
-considers every value below as a possible action match:
+Multica periodically checks whether recent runs keep failing: when the past 7 days have at least 50 completed or failed runs with a failure rate of 90%, the system pauses the autopilot and notifies its creator; fix the cause, then resume it manually.
-- The event-name suffix, when the event has the form
- `provider.event.<action>` (e.g. `github.workflow_run.completed` →
- `completed`).
-- The body fields `action`, `state`, `conclusion`, and `status` —
- **only when they are JSON strings**. A boolean (`{"action": true}`)
- or a number does not qualify, so a filter expecting
- `event=trigger, action=true` will never match a body of
- `{"trigger": true}` because `true` is a bool, not a string.
+Pausing manually stops schedules, webhooks, and **Run now**. Deletion is actually archiving: future triggers stop, and run and delivery history is kept.
-**Common gotcha.** A filter row like `Event name: trigger` /
-`Actions: true` does **not** mean "fire when the body has
-`trigger: true`" — Event filters match the *inferred event and
-action*, not arbitrary body fields. Send `trigger.true` via
-`X-Event-Type` (or use the body envelope shown above) to hit it.
-Surrounding whitespace in saved filter rows (`" workflow_run "`) is
-stored verbatim and will never match — trim before saving.
+## Permissions
-#### Quick test
+- Any workspace member can create autopilots;
+- the creator and workspace owners/admins can edit, run, delete, and manage triggers;
+- the creator and owners/admins can add collaborators to management access;
+- collaborators can edit, run, and manage triggers, but can't grant access to others;
+- being able to manage an autopilot doesn't guarantee being able to run its agent — agent Access still applies.
-Once a filter is configured, you can confirm both branches with `curl`:
+## Use the CLI
```bash
-# Allowed — header drives event=workflow_run, body drives action=completed
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# → 200 {"status":"accepted", "delivery_id":"…", "run_id":"…", ...}
-
-# Filtered — same event, action not in allowlist
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"in_progress"}'
-# → 200 {"status":"ignored","reason":"event_filtered"}
+multica autopilot trigger <autopilot-id>
+multica autopilot runs <autopilot-id>
+multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>
```
-### URL is a bearer secret
-
-The generated URL **is** the credential. Anyone with it can fire the
-autopilot. Treat it like a token:
-
-- **Don't paste it into public issue threads, screenshots, or chat history.**
-- **Rotate it if it leaks** — click "Rotate URL" on the trigger row, or run
- `multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>`. The
- old URL stops working immediately.
-- For sources that require strong source authentication, wait for
- per-trigger HMAC signature verification; this v1 URL is bearer-only.
-- Workspace members who can view the autopilot can read its webhook URLs
- for now — tighter per-role secret visibility is a follow-up.
-
-### Status-code semantics
-
-Multica acknowledges an active, valid delivery only after both its delivery and
-idempotent run are durable:
-
-- `200 {"status":"accepted","delivery_id":"…","run_id":"…","autopilot_id":"…","trigger_id":"…"}`
- — admission succeeded and the worker owns recoverable dispatch.
-- `200 {"status":"skipped","delivery_id":"…","run_id":"…","reason":"…"}`
- — admission produced a durable skipped run, for example when the assignee's
- runtime is offline.
-
-Normal no-op and deduplication outcomes return `200 OK` so providers do not
-retry them indefinitely:
-
-- `{"status":"duplicate","delivery_id":"…","run_id":"…"}` — the provider's
- idempotency key was already admitted. `run_id` is omitted only if the original
- request ended before its run could be admitted; the worker will recover it.
-- `{"status":"ignored","reason":"trigger_disabled"}` — the trigger is disabled.
-- `{"status":"ignored","reason":"autopilot_paused"}` — the autopilot is paused.
-- `{"status":"ignored","reason":"autopilot_archived"}` — the autopilot is archived.
-
-Non-2xx responses cover real failures:
-
-- `400` — invalid JSON, scalar body, or empty body.
-- `401` — a configured webhook signature is missing or invalid.
-- `404` — unknown token (`{"error":"webhook not found"}`).
-- `413` — payload exceeded 256 KiB.
-- `429` — the high absolute IP ceiling was exceeded, or the IP accumulated too
- many unknown-token/invalid-signature attempts. Responses include
- `Retry-After`. Valid admitted deliveries are not rejected by the worker's
- per-trigger budget; they remain queued until that budget is available.
-
-### Self-hosted: configure your public URL
-
-When `MULTICA_PUBLIC_URL` is set on the server (e.g. `https://multica.example.com`),
-the trigger response includes an absolute `webhook_url` and the UI shows a
-ready-to-copy URL. Without it, the UI composes the URL from the client's
-API origin — which is fine for desktop and same-origin web, but not for
-custom self-hosted reverse proxies. Multica deliberately does not derive
-the public host from `Host` / `X-Forwarded-Host` headers so a misconfigured
-reverse proxy cannot trick the server into minting webhook URLs pointing at
-an attacker-controlled host.
-
-## View run history
-
-Every trigger produces a **run record**, visible on the "History" tab of the autopilot detail page:
-
-- Trigger source (`schedule` / `manual` / `webhook`)
-- Start time, completion time
-- Status (`issue_created` / `running` / `completed` / `failed` / `skipped`)
-- The linked issue (create issue mode) or `task` (run-only mode)
-- Failure reason (if failed or skipped)
-
-## What happens when an autopilot fails
-
-<Callout type="warning">
-**Autopilot failures are not auto-retried and do not send inbox notifications.** A failure leaves a `failed` entry in run history — no system-level re-enqueue like assign or @-mention, and no notification to anyone. If the autopilot is periodic, **the next cron fire will trigger a new run**, but the failed work is not automatically re-run.
-
-If an autopilot is important, design your own monitoring — for example, have the agent post a comment on success, and catch failures by noticing missing comments.
-</Callout>
-
-Why no auto-retry: autopilots are already periodic, so adding system-level retries stacks on top of the next scheduled run and creates duplicate executions. Leaving the schedule entirely to cron keeps it clean.
-
-## What's not yet available
-
-**API-kind triggers are not wired up.** The trigger schema reserves an `api`
-kind, but no ingress route fires it; the UI shows a Deprecated badge for
-existing rows and offers no copy/rotate affordances. Per-trigger HMAC
-signature verification, IP allowlists, and provider-specific event presets
-are tracked as follow-ups; v1 URLs are bearer-only.
+See [Using the CLI](/cli) for the full parameters.
-## Next
+## Next steps
-- [**Assign issues to agents**](/assigning-issues) — a one-shot hand-off of an issue to an agent
-- [**@-mention agents in comments**](/mentioning-agents) — pull an agent in to take a look from a comment
-- [**Chat**](/chat) — one-to-one conversation outside any issue
+- [Assign issues to agents](/assigning-issues) — assignment and the confirmation window.
+- [Inbox and subscriptions](/inbox) — where run notifications arrive.
+- [Tasks](/tasks) — run states and failure handling.
diff --git a/apps/docs/content/docs/autopilots.zh.mdx b/apps/docs/content/docs/autopilots.zh.mdx
index d3eae8e624..bfeda1890c 100644
--- a/apps/docs/content/docs/autopilots.zh.mdx
+++ b/apps/docs/content/docs/autopilots.zh.mdx
@@ -1,298 +1,157 @@
---
-title: Autopilots
-description: 让智能体按 cron 定时自己开工,或在 webhook 到来时被触发——也可以通过 UI / CLI 手动触发一次。
+title: 自动化
+description: 按时间或 Webhook 自动把重复工作交给智能体。
---
import { Callout } from "fumadocs-ui/components/callout";
-Autopilots 让 [智能体](/agents) **按调度自动开工**——配好 cron 和时区,到点 Multica 自己派发 [`task`](/tasks),不需要你每次触发。适合定期巡检、周期性报告、凌晨跑的清理任务这类"standing order"场景。和前三种触发方式([分配](/assigning-issues) / [@ 提及](/mentioning-agents) / [对话](/chat) 都是你主动喊一声)相比,Autopilots 的核心差别是**时间驱动**。
+自动化用来执行反复发生的工作,例如每天汇总进展、定期检查依赖,或在外部系统发来事件时启动智能体。
-## 配置一个 Autopilot
+每条自动化保存一份 Runbook、一个执行方和一个或多个触发器。触发后,Multica 会创建 issue 或直接运行智能体,并保留每一次运行记录。
-在工作区的 **Autopilot** 页新建一条 autopilot,要定下:
+## 创建自动化
-- **名字** — 显示名
-- **执行智能体** — 到点派给谁
-- **优先级** — 继承给它产生的 `task`(语义同 issue 优先级)
-- **描述 / Prompt** — 智能体每次执行拿到的工作说明
-- **执行模式** — 见下节
-- **触发器** — 至少加一条 `schedule`(cron + 时区)或 `webhook`
+在侧边栏打开**自动化**,选择模板或从空白开始,然后配置:
-## 选择执行模式
+- **名称**:说明这条自动化负责什么;
+- **Runbook**:智能体每次运行时读取的目标、背景、约束和步骤;
+- **执行方**:一个智能体或小队;
+- **关联项目**:可选,让自动创建的 issue 进入指定项目;
+- **输出模式**:创建 issue,或仅运行;
+- **订阅者**:自动创建 issue 后需要收到通知的成员;
+- **触发方式**:时间表或 Webhook。
-Autopilot 有两种执行模式,**建议从"先建 issue 模式"开始**:
+保存后自动化默认为启用状态;**立即运行**可随时手动执行一次完整流程。
-- **先建 issue 模式**(`create_issue`)—— 默认,**推荐**。每次触发先在工作区里建一个 issue(标题目前只支持一个占位符 `{{date}}`,会插值成 UTC 日期 `YYYY-MM-DD`;其他 `{{...}}` 形式的占位符会在创建时被拒绝,避免拼错以后悄无声息地把原文当成 issue 标题),再按分配流程把 issue 派给智能体。所有工作都落在 issue 看板上,历史、评论、状态和手动分配的 issue 完全一致。
-- **直跑模式**(`run_only`)—— 不建 issue,直接入队一个 `task`。看板上看不到这一次运行——只能在 Autopilot 的运行历史里看到。
+## 选择输出模式
-## 让它按时间跑
+| 模式 | 行为 | 适合 |
+|---|---|---|
+| **创建 issue** | 每次触发先创建一条 issue,再分配给执行方;讨论、状态和执行记录都保留在 issue 中。 | 需要团队查看、确认或继续处理的工作。 |
+| **仅运行** | 直接创建执行任务,不产生 issue;结果只在自动化的运行历史中查看。 | 无需协作记录的后台执行任务。 |
-每个 Autopilot 至少要一个 `schedule` 触发器。Cron 是**标准 5 字段格式**(分 时 日 月 周),最小粒度 **1 分钟**(没有秒级)。时区用 IANA 格式(例如 `Asia/Shanghai`),决定 cron 表达式按哪个时区解读。
+**创建 issue** 模式与普通 issue 使用相同的任务队列:运行时离线时可以先创建 issue,执行任务等待运行时上线。
-几个例子:
+**仅运行**要求运行时在触发时可用;否则本次运行会显示为"已跳过",不会留下一个等待中的 issue。
-- `0 9 * * 1-5`,`Asia/Shanghai` —— 工作日北京时间早上 9 点
-- `*/30 * * * *`,`UTC` —— 每 30 分钟一次
-- `0 3 * * *`,`UTC` —— 每天 UTC 凌晨 3 点
+## 按时间运行
-Multica 服务器每 **30 秒**扫一次到期的触发器——**触发时刻最多延迟 30 秒**,不是秒级精准。服务器重启时如果恰好错过触发点,启动时会补扫漏掉的触发(不会丢触发,但会立刻补跑)。
+时间表编辑器可以选择运行时间、重复日期、时间窗口和时区,并预览接下来的运行时间。一条自动化可以添加多个时间表;单独启停某个触发器通过 CLI 的 `autopilot trigger-update` 完成,参数见 [CLI 命令](/cli)。
-## 手动触发一次
+需要更复杂的规则时,可以直接编辑标准 5 字段 cron:
-调试 Autopilot 时不想等 cron,可以手动触发一次:
-
-- UI:在 Autopilot 详情页点"手动运行"
-- CLI:
-
-```bash
-multica autopilot trigger <autopilot-id>
+```text
+分 时 日 月 星期
```
-手动触发走和 `schedule` 触发完全相同的执行流程,只是运行记录里 `source` 字段标为 `manual`。
+例如:
-## 通过 Webhook 触发
+| Cron | 时区 | 含义 |
+|---|---|---|
+| `0 9 * * 1-5` | `Asia/Shanghai` | 工作日 9:00 |
+| `*/30 * * * *` | `UTC` | 每 30 分钟 |
+| `0 3 * * *` | `UTC` | 每天 3:00 |
-Autopilot 也可以由入站 HTTP webhook 触发。在详情页添加一个 **Webhook**
-触发器,Multica 会生成一个唯一的 URL:
+Cron 不包含秒,时区使用 `Asia/Shanghai` 这样的 IANA 名称。保存前,用页面显示的"接下来"时间核对结果。
-```
-https://<你的 Multica host>/api/webhooks/autopilots/awt_…
-```
+![自动化编辑器:Runbook、时间表设置与接下来几次运行的预览](/images/docs/autopilot-schedule.png)
+
+## 通过 Webhook 运行
-向这个 URL POST 任意 JSON。Multica 会先持久化投递,并同步准入一条
-幂等 run,返回带有 `status = accepted | skipped` 和 `run_id` 的 `200 OK`。
-数据库 worker 随后恢复 accepted run,把请求体保存为 run 的
-`trigger_payload`,再按和 schedule 触发器完全一致的方式派发给智能体。
-接收与派发之间即使服务重启,已排队的投递也不会丢失。
+添加 Webhook 触发器后,Multica 会生成一个唯一 URL。向它发送 JSON 对象或数组,即可触发自动化:
```bash
curl -X POST "$MULTICA_WEBHOOK_URL" \
-H "Content-Type: application/json" \
- -d '{"event":"demo.received","eventPayload":{"message":"hello"}}'
+ -H "Idempotency-Key: demo-001" \
+ -d '{"event":"build.completed","eventPayload":{"status":"success"}}'
```
-在**先建 issue 模式**下,入站 payload 会附加在新 issue 的描述里供智能体
-直接读到;**直跑模式**下,payload 也会随 run 一并交给 daemon。
-
-### Payload 形态
-
-可以发自己的封装:
-
-```json
-{ "event": "github.pull_request.opened", "eventPayload": { } }
-```
-
-也可以直接发任意 JSON 对象 / 数组。Multica 会规范化为内部封装:
-
-```json
-{
- "event": "<推断>",
- "eventPayload": <你的 body>,
- "request": { "receivedAt": "<rfc3339>", "contentType": "application/json" }
-}
-```
+Payload 会保存在投递和运行记录中,并交给智能体。创建 issue 模式还会把事件内容附在 issue 描述中。
-不带 `event` 字段时,Multica 会按以下顺序从常见 header 和 body 字段
-推断:`X-GitHub-Event` + body `action`,`X-Gitlab-Event`、
-`X-Event-Type`、body 里的 `event` / `type` / `action`。都不命中时事件
-名退化为 `webhook.received`。
+Webhook 请求的约束:
-配置 GitHub 之类的来源时,请把 content type 设为 `application/json`——
-表单编码的 webhook payload 在 v1 里不接受。
+- Body 必须是有效的 JSON 对象或数组,最大 256 KiB;
+- `Idempotency-Key` 可以避免发送方重试时重复运行;GitHub 也会使用 `X-GitHub-Delivery` 去重;
+- 没有稳定幂等键时,Multica 无法保证重复请求只运行一次;
+- 触发器已禁用或事件不匹配时,投递会记录为"已忽略",不会创建运行。
-GitHub 投递用 `X-GitHub-Delivery` 去重;通用发送方可以提供
-`Idempotency-Key`。同一个 key 的重试会复用原来的排队投递和 run。不带
-这两个 header 时,因为没有稳定的事件标识,投递只能提供尽力而为的语义。
+### 过滤事件
-### 事件过滤
+同一个来源会发送多种事件时,可以为触发器添加事件过滤。每行包含一个事件名,以及可选的 action 列表;任意一行命中即可运行,全部留空则接收所有事件。
-新建的 webhook 触发器对每一条入站 POST 都会触发,这在单一用途的 URL
-上没问题,但对那种会扇出很多事件类型的来源(典型就是 GitHub——
-一个仓库 webhook 就会同时下发 `push`、`pull_request`、`workflow_run`、
-`check_suite` 等等)就会很吵。webhook 触发器上的**事件过滤**区块用来
-限制哪些事件真正派发一次 run;其它的只记录到投递历史里,
-`status = ignored`、`reason = event_filtered`,不会建任何 issue 或 run。
+例如,事件名填写 `workflow_run`,Actions 填写 `completed, failed`,只会接收这两类 `workflow_run` 结果。Multica 会从常见请求头和 payload 中识别事件与 action,包括 GitHub 的 `X-GitHub-Event` 和 body 中的 `action`。
-每一行是一条规则:一个**事件名**加可选的、逗号分隔的 **action** 列表。
-**任意一行命中**即放行;区块留空则接受所有事件(即过滤前的行为)。
+### 保护 Webhook URL
-例子:
+<Callout type="warning">
+Webhook URL 中的 token 就是调用凭证。不要把完整 URL 放进公开仓库、issue 或截图。URL 泄漏后,点击 URL 旁的**重新生成 URL**按钮,并立即更新发送方;旧 URL 会马上失效。
+</Callout>
-| 事件名 | Actions | 命中范围 |
-| ---------------- | ------------------- | ------------------------------------------------------------------------ |
-| `workflow_run` | `completed, failed` | 只有 `action` 为 `completed` 或 `failed` 的 `workflow_run` 事件 |
-| `workflow_run` | _(留空)_ | 所有 `workflow_run` 事件,不限 action |
-| `push` | _(留空)_ | 所有 `push` 事件 |
+只有自动化创建者、工作区 owner/admin 和获得访问权限的协作者可以查看完整 URL。界面默认隐藏 URL 中的 token,复制不需要先显示;点击 URL 或眼睛图标可以查看完整地址。
-#### 事件名和 action 从哪来
+### Webhook 响应速查
-Multica 按下面的顺序从入站请求里推断 `event` 和 `action`,**先命中先用**。
+调试发送方时,可以对照下表理解 Multica 的响应:
-**1. Body envelope。** 如果 body 是一个 JSON 对象、且带字符串字段
-`event`,就直接用它作为事件名。可选的 `eventPayload` 对象再
-从自己的 `action` / `state` / `conclusion` / `status` 字段里提供
-action 候选。
+| HTTP 状态 | 响应状态 | 含义 |
+|---|---|---|
+| 200 | `accepted` | 已受理并创建运行,返回投递和运行 ID。 |
+| 200 | `skipped` | 已受理,但本次运行被跳过(例如仅运行模式下运行时离线),附带原因。 |
+| 200 | `ignored` | 未创建运行:触发器已禁用、自动化已暂停或归档,或事件被过滤,`reason` 字段说明原因。 |
+| 200 | `duplicate` | 幂等键命中已有投递,返回原投递 ID,不会重复运行。 |
+| 400 | 错误信息 | Body 为空、不是有效 JSON,或不是 JSON 对象/数组。 |
+| 401 | `rejected` | 触发器配置了签名密钥,但请求缺少签名或签名不匹配。 |
+| 404 | 错误信息 | URL 中的 token 无效或已被重新生成。 |
+| 413 | 错误信息 | Body 超过 256 KiB。 |
+| 429 | 错误信息 | 请求过于频繁,按响应头 `Retry-After` 稍后重试。 |
+| 500 | 错误信息 | Multica 内部错误,发送方可稍后重试。 |
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"event":"trigger","eventPayload":{"action":"true"}}'
-# 推断结果:event = trigger,action 候选 = true
-```
+暂停、归档和事件过滤这类业务性忽略返回的是 200 而不是 4xx,避免发送方反复重试。
-**2. 请求头。** 没有 body envelope 时按以下头部识别:
+事件与 action 的推断顺序:
-- `X-GitHub-Event: <event>` —— 结合 body 顶层的 `action` 字段
- (如果有),拼成 `github.<event>.<action>`。
-- `X-Gitlab-Event: <event>` —— 拼成 `gitlab.<event>`。
-- `X-Event-Type: <event>` —— 原样使用。
+1. body 中带有字符串 `event` 字段时直接使用;
+2. 否则尝试 `X-GitHub-Event` 请求头,它会与 body 中的 `action` 拼成 `github.<event>.<action>`;
+3. 再尝试 `X-Gitlab-Event` 请求头;
+4. 再尝试 `X-Event-Type` 请求头;
+5. 再到 body 中的 `event`、`type`、`action` 字段;
+6. 全部缺失时记为 `webhook.received`。
-```bash
-# GitHub 风格:事件名来自 header,action 来自 body。
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# 推断结果:event = github.workflow_run.completed
-# → 命中 workflow_run / completed 的过滤规则
+## 查看运行和投递记录
-# 通用 event-type 头部 —— 不需要任何 body 字段。
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-Event-Type: trigger.true' \
- -H 'Content-Type: application/json' \
- -d '{}'
-# 推断结果:event = trigger.true → 命中 trigger / true
-```
+运行历史会显示触发来源、时间、状态、关联 issue 或执行任务,以及失败或跳过的原因。Webhook 触发器还会保存单独的投递记录,包括解析出的事件、响应、去重信息和失败原因。
-**3. Body 兜底。** Body envelope 和上面的 header 都没有时,
-从 body 顶层字符串字段里依次找:`event` → `type` → `action`。
+处理完成的 Webhook 投递可以从详情中重放。重放会创建一次新的投递和运行,不会改写原记录;签名校验失败或仍在排队的投递不能重放,重放也不参与去重。
-```bash
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'Content-Type: application/json' \
- -d '{"type":"trigger","action":"true"}'
-# 推断结果:event = trigger(取自 `type`),action 候选 = true
-```
+## 失败、暂停和删除
-**4. 默认值。** 以上都没命中时,事件名取 `webhook.received`,
-没有 action 候选。
+仅运行模式中的执行任务失败后不会自动重试;下一次时间表仍会按原计划触发。创建 issue 模式产生的是普通 issue 的执行任务,基础设施故障按照[执行任务](/tasks#失败与自动重试)中的规则处理。
-**action 候选的完整清单。** 事件名确定后,下面这些值都会被列为
-可能的 action:
+Multica 会定期检查近期运行是否持续失败:过去 7 天内已完成或失败的运行不少于 50 次且失败率达到 90% 时,系统会暂停这条自动化并通知创建者;修复原因后可以手动恢复。
-- 事件名后缀,当事件形如 `provider.event.<action>` 时
- (例如 `github.workflow_run.completed` → `completed`)。
-- body 里 `action`、`state`、`conclusion`、`status` 这四个字段——
- **必须是 JSON 字符串**。布尔(`{"action": true}`)或数字都不算
- 候选,所以 `event=trigger, action=true` 的过滤规则**永远命中不了**
- `{"trigger": true}` 这种 body,因为 `true` 是 bool 不是字符串。
+手动暂停会停止时间表、Webhook 和"立即运行"。删除实际是归档:停止后续触发,运行和投递历史保留。
-**常见误区。** 一条 `Event name: trigger` / `Actions: true` 的规则
-**不是**「body 里出现 `trigger: true` 就放行」的意思——事件过滤匹配的是
-**推断出来的事件和 action**,不是任意 body 字段。要命中它,请用
-`X-Event-Type` 头发送 `trigger.true`,或者用上面的 body envelope。
-保存时带空格的值(例如 `" workflow_run "`)会被原样保存,但永远命中
-不了——保存前请先 trim。
+## 管理权限
-#### 快速验证
+- 任何工作区成员都可以创建自动化;
+- 创建者和工作区 owner/admin 可以编辑、运行、删除及管理触发器;
+- 创建者和 owner/admin 可以把协作者加入"管理访问";
+- 协作者可以编辑、运行和管理触发器,但不能继续授予其他人权限;
+- 能管理自动化不代表一定能运行它使用的智能体,智能体 Access 仍然生效。
-配好过滤后,可以用 `curl` 同时验证「命中」和「被过滤」两条路径:
+## 使用 CLI
```bash
-# 命中 —— 请求头给出 event=workflow_run,body 给出 action=completed
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"completed"}'
-# → 200 {"status":"accepted", "delivery_id":"…", "run_id":"…", ...}
-
-# 被过滤 —— 同样的事件,但 action 不在白名单
-curl -X POST "$MULTICA_WEBHOOK_URL" \
- -H 'X-GitHub-Event: workflow_run' \
- -H 'Content-Type: application/json' \
- -d '{"action":"in_progress"}'
-# → 200 {"status":"ignored","reason":"event_filtered"}
+multica autopilot trigger <autopilot-id>
+multica autopilot runs <autopilot-id>
+multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>
```
-### URL 即 bearer secret
-
-生成的 URL **就是凭证**,谁拿到都能触发这个 Autopilot。请按 token 对待:
-
-- **不要贴到公开 issue 评论、截图、聊天记录里。**
-- **泄漏后立即重新生成**——在触发器上点"重新生成 URL",或运行
- `multica autopilot trigger-rotate-url <autopilot-id> <trigger-id>`。
- 旧 URL 立即失效。
-- 对需要强来源认证的源,等 per-trigger HMAC 签名校验上线;v1 URL 仅
- bearer。
-- 当前能查看 Autopilot 的工作区成员都能看到它的 webhook URL——更细的
- 权限可见性是后续工作。
-
-### 状态码语义
-
-有效且活跃的投递只有在投递和幂等 run 都持久化后才会确认:
-
-- `200 {"status":"accepted","delivery_id":"…","run_id":"…","autopilot_id":"…","trigger_id":"…"}`
- —— 准入成功,后续派发由 worker 接管并可恢复。
-- `200 {"status":"skipped","delivery_id":"…","run_id":"…","reason":"…"}`
- —— 准入生成了持久化的 skipped run,例如负责人运行时离线。
-
-正常 no-op 和去重路径返回 `200 OK`,避免外部 webhook 无限重试:
-
-- `{"status":"duplicate","delivery_id":"…","run_id":"…"}` —— 发送方的
- 幂等 key 已经接收。只有原请求在 run 准入前中断时才不带 `run_id`;worker
- 会恢复它。
-- `{"status":"ignored","reason":"trigger_disabled"}` —— 触发器已禁用。
-- `{"status":"ignored","reason":"autopilot_paused"}` —— Autopilot 已暂停。
-- `{"status":"ignored","reason":"autopilot_archived"}` —— Autopilot 已归档。
-
-非 2xx 是真正的失败:
-
-- `400` —— 无效 JSON、scalar body、空 body。
-- `401` —— 已配置的 webhook 签名缺失或无效。
-- `404` —— 未知 token(`{"error":"webhook not found"}`)。
-- `413` —— 请求体超过 256 KiB。
-- `429` —— 命中高位 IP 绝对上限,或者该 IP 累积了过多未知 token / 无效
- 签名请求;响应会带 `Retry-After`。worker 的单触发器预算不会拒绝已经接收的
- 有效投递,只会让它继续排队,等预算恢复后再派发。
-
-### 自托管:配置公开 URL
-
-服务端设置 `MULTICA_PUBLIC_URL`(例如 `https://multica.example.com`)后,
-触发器响应里会带绝对的 `webhook_url`,UI 直接显示可复制的 URL。没设
-时 UI 会用客户端的 API origin 拼出 URL——desktop 和同源 web 没问题,
-但自定义反向代理就不行了。Multica **故意不**从 `Host` /
-`X-Forwarded-Host` header 推断公开主机,避免反代配置失误时被诱导生成
-指向攻击者域名的 webhook URL。
-
-## 看运行历史
-
-每次触发都会产生一条**运行记录**(run),可以在 Autopilot 详情页的"历史"tab 看到:
-
-- 触发源(`schedule` / `manual` / `webhook`)
-- 开始时间、完成时间
-- 状态(`issue_created` / `running` / `completed` / `failed` / `skipped`)
-- 关联的 issue(先建 issue 模式)或 `task`(直跑模式)
-- 失败原因(失败或跳过时)
-
-## Autopilot 失败会怎样
-
-<Callout type="warning">
-**Autopilot 失败不自动重试,也不发 inbox 通知。** 失败后只在运行历史里留一条 `failed` 记录——不会像分配 / @ 提及那样由系统重新排队,也不会给任何人发通知。如果这条 Autopilot 是周期任务,**下一次 cron 到点会重新触发一次**(新的 run),但这一次失败的工作不会被自动补跑。
-
-如果 Autopilot 很重要,要自己设计监控——例如让智能体在成功时给自己发个评论,通过缺失评论来发现失败。
-</Callout>
-
-不自动重试的理由:Autopilot 本身是周期性的,系统层再加自动重试容易和下一次调度叠加,产生重复执行。调度权完全交给 cron 最干净。
-
-## 暂不可用的能力
-
-**API 类型触发器尚未接入。** 触发器 schema 里保留了 `api` 类型但没有
-入站路由会触发它;UI 会给已有的此类记录打 Deprecated 标签,也不显示
-copy / rotate 操作。Per-trigger HMAC 签名校验、IP allowlist、按提供方
-的事件预设是后续工作;v1 URL 仅 bearer。
+完整参数见[使用 CLI](/cli)。
-## 下一步
+## 接下来
-- [**分配 issue 给智能体**](/assigning-issues) —— 一次性把 issue 指派给智能体
-- [**在评论里 @ 智能体**](/mentioning-agents) —— 评论里让智能体看一眼
-- [**对话**](/chat) —— 独立于 issue 的一对一聊天
+- [分配 issue 给智能体](/assigning-issues) — 分配与确认窗口。
+- [收件箱与订阅](/inbox) — 运行通知的接收位置。
+- [执行任务](/tasks) — 执行状态与失败处理。
diff --git a/apps/docs/content/docs/channels.ja.mdx b/apps/docs/content/docs/channels.ja.mdx
index 58cf48c960..b0f1d6d331 100644
--- a/apps/docs/content/docs/channels.ja.mdx
+++ b/apps/docs/content/docs/channels.ja.mdx
@@ -1,93 +1,79 @@
---
-title: Chat 連携(channels)
-description: Multica がどのようにエージェントをチャットプラットフォームに接続するか——1 つのチャンネルエンジンと、Lark(飞书)および Slack 向けのプラットフォーム別アダプター——受信パイプライン、セッション、認可までを解説します。
+title: チャット連携
+description: Multica のエージェントを Feishu、Lark、Slack に接続し、チームが普段使っているチャットツールから利用する方法を説明します。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-
-**チャンネル**は、Multica の[エージェント](/agents)をチャットプラットフォームに接続し、チームが普段やり取りしている場所でそのまま使えるようにします。現在チャンネルは 2 つあり——[Lark(飞书)](/lark-bot-integration)と [Slack](/slack-bot-integration)——どちらも**同じエンジン**で動いています。プラットフォームに依存しないコアと、薄いプラットフォーム別アダプターの組み合わせです。プラットフォームを追加するということは「アダプターを実装する」ことであり、「パイプラインを作り直す」ことではありません。
-
-**インストール**は、それらを結びつける単位です。1 つの Bot が 1 つの `(workspace, agent)` に紐づきます。受信メッセージはまずインストールにルーティングされ、その後共有パイプラインを通り、エージェントの返信は同じチャットに送り返されます。
-
-## アーキテクチャ
-
-<Mermaid chart={`
-flowchart LR
- subgraph P["チャットプラットフォーム"]
- LK["Lark / 飞书"]
- SL["Slack"]
- end
- subgraph ENG["チャンネルエンジン(プラットフォーム非依存)"]
- direction TB
- SUP["Supervisor<br/>インストールごとに 1 本のライブ接続"]
- ROU["Router パイプライン:<br/>route → dedup → auth → session → trigger"]
- end
- LK -->|長時間接続| SUP
- SL -->|Socket Mode| SUP
- SUP -->|生イベント| ADP["プラットフォーム別アダプター<br/>変換 + ResolverSet"]
- ADP --> ROU
- ROU -->|エージェントタスク| RUN["デーモンがエージェントを実行"]
- RUN -->|返信| OUT["プラットフォーム別の送信<br/>(bot token → プラットフォーム API)"]
- OUT --> P
-`} />
-
-## 受信パイプライン(共通)
-
-すべての受信メッセージは——Lark でも Slack でも——エンジンの `Router` 内で同じ順序のステップを通ります。プラットフォームアダプターが供給するのはプラットフォーム別の部品(`ResolverSet`)だけで、ポリシーはエンジンの中にあります。
-
-1. **インストールへのルーティング** —— イベントを `channel_installation`(→ ワークスペース + エージェント)に対応づけます。Lark は `app_id` でルーティングし、Slack はイベントに含まれる app id でルーティングします。
-2. **宛先フィルター** —— グループ/チャンネルでは、**Bot を @ メンション**したメッセージだけが先へ進みます。アイドル状態のグループの雑談は破棄されます(読み取られません)。
-3. **重複排除(dedup)** —— 2 フェーズの `(installation, message_id)` クレームにより、サーバーのレプリカをまたいでも厳密に 1 回だけ処理されることを保証します。
-4. **アイデンティティ + 認可** —— 送信者のプラットフォームユーザー id を Multica ユーザーに解決し([アカウントの紐づけ](#認可))、その上でワークスペースのメンバーシップを再チェックします。紐づいていない送信者には「アカウントを紐づける」プロンプトが返され、メンバーでない場合は破棄されます。
-5. **セッション** —— この会話に対応する[chat セッション](/chat)を見つけるか作成し、メッセージを追加します([セッション](#セッションとコンテキスト)を参照)。
-6. **トリガー** —— エージェントの[タスク](/tasks)をエンキューします。[デーモン](/daemon-runtimes)がエージェントを実行し、返信がチャットに送り返されます。
-
-## セッションとコンテキスト
-
-エージェントのコンテキストは、**chat セッションのトランスクリプト**——そのセッションに時間をかけて取り込まれてきたメッセージ——です。このトランスクリプトのモデルは共通です(すべてのチャンネルで共有されます)。プラットフォームごとに異なるのは、アダプターが組み立てる**セッション分離キー**です。
-
-| プラットフォーム | 分離キー | 効果 |
+
+チャット連携を使うと、Multica を開かなくても、エージェントへの質問、グループチャットでの @メンション、チャット画面からのイシュー作成ができます。
+
+現在は Feishu/Lark と Slack に対応しています。どちらもセッション、ユーザー識別、実行の仕組みは共通ですが、インストール方法が異なります。
+
+## プラットフォームを選ぶ
+
+| | Feishu / Lark | Slack |
|---|---|---|
-| **Lark / 飞书** | チャット id | チャット/グループごとに 1 セッション——同じチャット内の連続したやり取りが 1 つのトランスクリプトに蓄積されます(複数ターンの記憶)。 |
-| **Slack** | DM: チャンネル/チャンネル: `channel + thread root` | 各 DM が 1 セッション。**各 @bot スレッドがそれぞれ独立したセッション**になるので、同じチャンネル内の 2 つのスレッドが混ざりません。 |
+| インストール | Multica で QR コードを生成し、Feishu でスキャンして認証 | Slack でアプリを作成し、2 つのトークンを Multica に入力 |
+| エージェントとの DM | 対応 | 対応 |
+| グループまたはチャンネル | Bot を @メンションするとトリガー | Bot を @メンションするとトリガー |
+| イシューの作成 | `/issue` メッセージコマンド。入力内容からそのまま作成 | `/issue` スラッシュコマンド。エージェントが説明を整理してから作成 |
+| 接続方式 | プラットフォームの常時接続 | Socket Mode |
-<Callout type="info">
-グループでは、**Bot を @ メンション**したメッセージだけが取り込まれます。どちらのチャンネルも、現時点ではチャンネルの他の(@ されていない)メッセージや過去ログを読まないため、エージェントは自分が宛先になっていないメッセージを見ることはありません。前後の履歴をコンテキストとして取得することは、今後の拡張として計画されています。
-</Callout>
+新規接続は現在、中国本土版の Feishu でのみ利用できます。既存の国際版 Lark 接続は、引き続き利用および管理できます。
-## 認可
+各 Bot は 1 つの Multica エージェントに紐づきます。同じチャットプラットフォームで複数のエージェントを使う場合は、エージェントごとに Bot を接続してください。
-共有グループ内で Bot を守るために、2 つの独立したゲートがあります——どちらもエンジンであらゆるメッセージに対し、Lark と Slack で同一に適用されます。
+詳しい手順:
-- **アカウントの紐づけ(認証)** —— 送信者のプラットフォームユーザー id が Multica ユーザーにリンクされている必要があります。誰かが初めて Bot にメッセージを送ると、**自分自身の** Multica アカウントにアイデンティティを紐づけるための使い切りリンクを受け取ります。それまではエージェントは実行されません。
-- **ワークスペースのメンバーシップ(認可)** —— 紐づいた Multica ユーザーが、そのインストールのワークスペースのメンバーである必要があり、これはメッセージごとに再チェックされます。メンバーでない場合は黙って破棄されます。
+- [Feishu / Lark Bot 連携](/lark-bot-integration)
+- [Slack Bot 連携](/slack-bot-integration)
-そのため、Bot を公開チャンネルに追加しても安全です。アイデンティティを紐づけたワークスペースメンバーだけがエージェントを動かせ、各送信者は独立してチェックされます。ユーザー向けのプロンプトについては、各プラットフォームのページを参照してください。
+## メッセージが処理される流れ
-## 2 つのチャンネル
+1. Multica が Bot に対応するワークスペースとエージェントを特定します。
+2. グループやチャンネルでは、Bot を明示的に @メンションしたメッセージだけを処理します。DM では @メンションは不要です。
+3. Multica が送信者のアカウント連携とワークスペースのメンバー資格を確認します。
+4. メッセージが[エージェントとのチャット](/chat)セッションに追加され、タスクが作成されます。
+5. エージェントの返信が元の DM またはスレッドに返されます。
-<Callout type="info">
-**Lark(飞书) — スキャンしてインストール。** ワークスペースの admin が Lark アプリで QR をスキャンするだけでエージェントを紐づけられます。開発者コンソールでの操作は不要です。エージェントごとに 1 つの Bot。[Lark Bot 連携](/lark-bot-integration)を参照してください。
-</Callout>
+Bot を @メンションしていないチャンネルメッセージは、エージェントをトリガーせず、会話コンテキストにも追加されません。
+
+## セッションの分離
+
+- Feishu/Lark はチャットごとにセッションを分けます。同じチャットの後続メッセージは同じセッションを継続します。
+- Slack は DM をチャンネルごとに分けます。チャンネル内では、スレッドごとに独立したセッションが保持されます。
+
+チャンネルで追加の依頼を送る場合も、Bot を再度 @メンションする必要があります。エージェントが受け取るのは自分宛てのメッセージだけで、チャンネルの履歴全体を自動的に読み取ることはありません。
+
+## アカウント連携
+
+メンバーが初めて Bot にメッセージを送ると、アカウント連携用のリンクが届きます。Multica にログインすると、チャットプラットフォームのアカウントが現在のワークスペースのメンバー資格に紐づきます。
+
+Multica がエージェントを実行するのは、アカウント連携が完了した後だけです。メッセージを受け取るたびにアカウント連携とワークスペースのメンバー資格を再確認するため、ワークスペースから退出した後は Bot 経由でアクセスできません。
<Callout type="info">
-**Slack — 自分のアプリを持ち込む。** ワークスペースの admin が Slack アプリを作成し、自分の Slack ワークスペースにインストールして、その bot token + app-level token を Multica に貼り付けます。エージェントごとに専用の Slack アプリを持つため、1 つの Slack ワークスペース内で複数のエージェントがそれぞれ異なる Bot を持てます。マニフェストと手順は [Slack Bot 連携](/slack-bot-integration)を参照してください。
+アカウント連携は送信者の本人確認にのみ使われます。チャットプラットフォームのほかのメンバーが Multica ワークスペースへ自動的に追加されることはありません。
</Callout>
+## 接続を管理する
+
+ワークスペースの owner と admin は Bot を接続または切断できます。Feishu/Lark Bot の場合は、エージェントの所有者も接続と切断ができます。通常のメンバーは接続済みの連携を確認し、自分に実行権限があるエージェントを利用できます。
+
+切断すると、Bot は新しいメッセージを受信しなくなります。既存の Multica の会話と実行記録は保持されます。
+
## セルフホスト
-各チャンネルは、**保存時の暗号化キーを設定するまでオフ**です(このキーは、各 Bot のトークンがデータベースに触れる前にそれを暗号化します)。
+セルフホスト環境では、Multica が接続エンドポイントを有効にする前に、プラットフォームごとに 32 バイトの暗号化キーを設定する必要があります。
```dotenv
MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
```
-Multica Cloud では両方ともすでに設定済みです。完全なリファレンスは[環境変数](/environment-variables)を参照してください。
+これらのキーは、保存された Bot の認証情報を暗号化します。生成、保管、ローテーションの方法は[環境変数](/environment-variables)を参照してください。Multica Cloud ではすでに設定済みです。
-## 次に
+## 次のステップ
-- [Lark Bot 連携](/lark-bot-integration) — スキャンしてインストール、DM / @ メンション / `/issue`
-- [Slack Bot 連携](/slack-bot-integration) — 自分のアプリを持ち込むセットアップ(マニフェスト + トークン)、エージェントごとの Bot
-- [エージェント](/agents) · [Chat](/chat) · [タスク](/tasks)
+- [Feishu / Lark Bot 連携](/lark-bot-integration)
+- [Slack Bot 連携](/slack-bot-integration)
+- [エージェントとチャットする](/chat)
diff --git a/apps/docs/content/docs/channels.ko.mdx b/apps/docs/content/docs/channels.ko.mdx
index e2b2651f7c..90d469f36a 100644
--- a/apps/docs/content/docs/channels.ko.mdx
+++ b/apps/docs/content/docs/channels.ko.mdx
@@ -1,93 +1,79 @@
---
-title: Chat 연동 (channels)
-description: Multica가 에이전트를 채팅 플랫폼에 어떻게 연결하는지 — 하나의 channel 엔진과 Lark(飞书) 및 Slack을 위한 플랫폼별 어댑터 — 인바운드 파이프라인, 세션, 권한을 다룹니다.
+title: 채팅 연동
+description: Multica 에이전트를 Feishu, Lark 또는 Slack에 연결해 팀이 이미 사용하는 채팅 도구에서 활용합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-
-**channel**은 Multica [에이전트](/agents)를 채팅 플랫폼에 연결하여, 팀이 이미 대화하고 있는 곳에서 그 에이전트와 함께 일할 수 있게 합니다. 현재 두 개의 channel이 있습니다 — [Lark (飞书)](/lark-bot-integration)와 [Slack](/slack-bot-integration) — 그리고 둘 다 **같은 엔진** 위에서 동작합니다: 플랫폼 중립적인 코어에 얇은 플랫폼별 어댑터가 더해진 구조입니다. 플랫폼을 추가하는 일은 "어댑터를 구현하는 것"이지, "파이프라인을 다시 만드는 것"이 아닙니다.
-
-**installation**은 이 모든 것을 하나로 묶는 단위입니다: 하나의 봇이 하나의 `(workspace, agent)`에 바인딩됩니다. 인바운드 메시지는 installation으로 라우팅된 다음 공유 파이프라인을 거치며, 에이전트의 답변은 동일한 채팅으로 돌아갑니다.
-
-## 아키텍처
-
-<Mermaid chart={`
-flowchart LR
- subgraph P["채팅 플랫폼"]
- LK["Lark / 飞书"]
- SL["Slack"]
- end
- subgraph ENG["Channel 엔진 (플랫폼 중립적)"]
- direction TB
- SUP["Supervisor<br/>installation당 하나의 활성 연결"]
- ROU["Router 파이프라인:<br/>route → dedup → auth → session → trigger"]
- end
- LK -->|long connection| SUP
- SL -->|Socket Mode| SUP
- SUP -->|raw event| ADP["플랫폼별 어댑터<br/>변환 + ResolverSet"]
- ADP --> ROU
- ROU -->|agent task| RUN["Daemon이 에이전트를 실행"]
- RUN -->|reply| OUT["플랫폼별 아웃바운드<br/>(bot token → platform API)"]
- OUT --> P
-`} />
-
-## 인바운드 파이프라인 (공통)
-
-모든 인바운드 메시지는 — Lark든 Slack이든 — 엔진의 `Router`에서 동일하게 정해진 순서의 단계를 거칩니다. 플랫폼 어댑터는 플랫폼별 조각(`ResolverSet`)만 공급하며, 정책은 엔진 안에 있습니다.
-
-1. **Route to installation** — 이벤트를 `channel_installation`(→ workspace + agent)에 매핑합니다. Lark는 `app_id`로 라우팅하고, Slack은 이벤트에 실린 app id로 라우팅합니다.
-2. **Addressing filter** — 그룹/채널에서는 **봇을 @로 멘션한** 메시지만 계속 진행되며, 한가한 그룹 잡담은 폐기됩니다(읽지 않음).
-3. **Dedup** — 두 단계로 이루어진 `(installation, message_id)` 클레임이 서버 레플리카가 여러 개여도 정확히 한 번만 처리됨을 보장합니다.
-4. **Identity + authorization** — 보낸 사람의 플랫폼 사용자 id를 Multica 사용자([계정 바인딩](#권한))로 해석한 다음, 워크스페이스 멤버십을 다시 확인합니다. 바인딩되지 않은 발신자에게는 "계정을 연결하세요" 안내가 표시되고, 멤버가 아닌 사람은 폐기됩니다.
-5. **Session** — 이 대화에 대한 [chat 세션](/chat)을 찾거나 생성하고 메시지를 추가합니다([세션](#세션과-컨텍스트) 참조).
-6. **Trigger** — 에이전트 [task](/tasks)를 큐에 넣습니다. [daemon](/daemon-runtimes)이 에이전트를 실행하고 그 답변이 채팅으로 돌아갑니다.
-
-## 세션과 컨텍스트
-
-에이전트의 컨텍스트는 **chat 세션 트랜스크립트**입니다 — 시간이 지나며 그 세션에 수집된 메시지들입니다. 이 트랜스크립트 모델은 공통(모든 channel이 공유)입니다. 플랫폼마다 다른 것은 어댑터가 구성하는 **세션 격리 키**입니다:
-
-| 플랫폼 | 격리 키 | 효과 |
+
+채팅 연동을 사용하면 팀이 Multica를 열지 않고도 에이전트에게 바로 질문하고, 그룹 채팅에서 @멘션하거나, 채팅 창에서 이슈를 만들 수 있습니다.
+
+현재 Feishu/Lark와 Slack을 지원합니다. 두 연동은 같은 대화, 신원, 실행 메커니즘을 사용하지만 설치 방법은 다릅니다.
+
+## 플랫폼 선택
+
+| | Feishu / Lark | Slack |
|---|---|---|
-| **Lark / 飞书** | 채팅 id | 채팅/그룹당 하나의 세션 — 같은 채팅에서의 연속된 턴이 하나의 트랜스크립트로 쌓입니다(멀티턴 메모리). |
-| **Slack** | DM: 채널; 채널: `channel + thread root` | 각 DM이 하나의 세션이고, **각 @bot 스레드가 자체 세션**이므로, 한 채널의 두 스레드는 섞이지 않습니다. |
+| 설치 방법 | Multica에서 QR 코드를 만든 뒤 Feishu로 스캔해 승인 | Slack에서 app을 만든 뒤 두 token을 Multica에 입력 |
+| 에이전트와 DM | 지원 | 지원 |
+| 그룹 채팅 또는 채널 | Bot을 @멘션하면 트리거 | Bot을 @멘션하면 트리거 |
+| 이슈 만들기 | `/issue` 메시지 명령으로 입력 내용을 바로 생성 | `/issue` slash 명령으로 에이전트가 설명을 정리한 뒤 생성 |
+| 연결 방식 | 플랫폼 장기 연결 | Socket Mode |
-<Callout type="info">
-그룹에서는 **봇을 @로 멘션한** 메시지만 수집됩니다. 어느 channel도 현재 채널의 다른(멘션되지 않은) 메시지나 스크롤백을 읽지 않으므로, 에이전트는 자신이 호출되지 않은 메시지를 보지 못합니다. 주변 기록을 컨텍스트로 가져오는 기능은 향후 개선 사항으로 계획되어 있습니다.
-</Callout>
+새 연결은 현재 중국 본토 버전 Feishu에서만 만들 수 있습니다. 기존 국제 버전 Lark 연결은 계속 사용하고 관리할 수 있습니다.
-## 권한
+Bot 하나는 Multica 에이전트 하나에 연결됩니다. 같은 채팅 플랫폼에서 여러 에이전트를 사용하려면 각각 별도의 Bot을 연결해야 합니다.
-공유 그룹에서 봇을 보호하는 두 개의 독립적인 관문이 있으며 — 둘 다 모든 메시지에 대해 엔진에서, Lark와 Slack에 동일하게 적용됩니다:
+자세한 단계는 다음 문서를 참고하세요.
-- **계정 바인딩(인증)** — 보낸 사람의 플랫폼 사용자 id가 Multica 사용자에 연결되어 있어야 합니다. 누군가 봇에게 처음 메시지를 보내면 **자기 자신의** Multica 계정에 신원을 바인딩하는 일회용 링크를 받으며, 그 전까지는 어떤 에이전트도 실행되지 않습니다.
-- **워크스페이스 멤버십(권한)** — 바인딩된 Multica 사용자는 installation의 워크스페이스 멤버여야 하며, 이는 모든 메시지마다 다시 확인됩니다. 멤버가 아닌 사람은 조용히 폐기됩니다.
+- [Feishu / Lark Bot 연결](/lark-bot-integration)
+- [Slack Bot 연결](/slack-bot-integration)
-따라서 공개 채널에 봇을 추가해도 안전합니다: 신원을 바인딩한 워크스페이스 멤버만 에이전트를 움직일 수 있고, 각 발신자는 독립적으로 확인됩니다. 사용자에게 표시되는 안내는 플랫폼별 페이지를 참고하세요.
+## 메시지 실행 과정
-## 두 개의 channel
+1. Multica가 Bot을 기준으로 해당 워크스페이스와 에이전트를 찾습니다.
+2. 그룹 채팅이나 채널에서는 Bot을 명시적으로 @멘션한 메시지만 처리됩니다. DM에서는 @멘션이 필요 없습니다.
+3. Multica가 보낸 사람의 계정 연결과 워크스페이스 멤버 자격을 확인합니다.
+4. 메시지가 [에이전트 대화](/chat)에 들어가고 실행 태스크가 하나 생성됩니다.
+5. 에이전트의 답변이 원래 DM 또는 스레드로 돌아옵니다.
-<Callout type="info">
-**Lark (飞书) — 스캔하여 설치.** 워크스페이스 admin이 Lark 앱으로 QR을 스캔하여 에이전트를 바인딩합니다. 개발자 콘솔 작업이 없습니다. 에이전트당 하나의 Bot. [Lark Bot 연동](/lark-bot-integration)을 참고하세요.
-</Callout>
+Bot을 @멘션하지 않은 채널 메시지는 에이전트를 트리거하지 않으며 대화 컨텍스트에도 추가되지 않습니다.
+
+## 대화 격리
+
+- Feishu/Lark는 채팅별로 대화를 구분하며 같은 채팅의 후속 메시지는 기존 대화를 이어갑니다.
+- Slack DM은 채널별로 구분하고, 채널 안에서는 각 thread가 별도 대화를 저장합니다.
+
+채널에서 후속 질문을 할 때도 Bot을 다시 @멘션해야 합니다. 에이전트는 자신에게 보낸 메시지만 받으며 전체 채널 기록을 자동으로 읽지 않습니다.
+
+## 계정 연결
+
+멤버가 Bot에 처음 메시지를 보내면 계정 연결 링크를 받습니다. Multica에 로그인하면 플랫폼 계정이 현재 워크스페이스 멤버와 연결됩니다.
+
+연결을 마친 뒤에만 Multica가 에이전트를 실행합니다. 메시지마다 계정 연결과 워크스페이스 멤버 자격을 다시 확인하므로 워크스페이스를 떠난 뒤에는 Bot으로 해당 에이전트를 계속 사용할 수 없습니다.
<Callout type="info">
-**Slack — 자체 앱 사용.** 워크스페이스 admin이 Slack 앱을 만들고, 자신의 Slack 워크스페이스에 설치한 다음, bot token과 app-level token을 Multica에 붙여넣습니다. 각 에이전트가 자체 Slack 앱을 갖기 때문에, 하나의 Slack 워크스페이스에서 여러 에이전트가 각각 별개의 봇을 가질 수 있습니다. 매니페스트와 단계별 설정은 [Slack Bot 연동](/slack-bot-integration)을 참고하세요.
+계정 연결은 보낸 사람의 신원을 확인하는 데만 사용됩니다. 채팅 플랫폼의 다른 멤버가 자동으로 Multica 워크스페이스에 참여하지는 않습니다.
</Callout>
+## 연결 관리
+
+워크스페이스 owner와 admin은 Bot을 연결하거나 연결 해제할 수 있습니다. Feishu/Lark Bot은 에이전트 owner도 연결하고 연결 해제할 수 있습니다. 일반 멤버는 이미 연결된 연동을 확인하고 자신에게 호출 권한이 있는 에이전트를 사용할 수 있습니다.
+
+연결을 해제하면 Bot이 새 메시지를 받지 않습니다. 기존 Multica 대화와 실행 기록은 그대로 유지됩니다.
+
## 자체 호스팅
-각 channel은 **at-rest 암호화 키를 설정하기 전까지 꺼져 있습니다**(이 키는 각 봇의 토큰이 데이터베이스에 닿기 전에 암호화합니다):
+자체 호스팅 환경에서는 해당 플랫폼에 32바이트 암호화 키를 먼저 설정해야 Multica에 연결 메뉴가 열립니다.
```dotenv
-MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
-MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
+MULTICA_LARK_SECRET_KEY=<base64로 인코딩한 32바이트 키>
+MULTICA_SLACK_SECRET_KEY=<base64로 인코딩한 32바이트 키>
```
-Multica Cloud에서는 둘 다 이미 구성되어 있습니다. 전체 참조는 [환경 변수](/environment-variables)를 참고하세요.
+이 키는 Bot 자격 증명을 암호화해 저장하는 데 사용됩니다. 생성, 보관, 교체 방법은 [환경 변수](/environment-variables)를 참고하세요. Multica Cloud에는 이미 설정되어 있습니다.
-## 다음
+## 다음 단계
-- [Lark Bot 연동](/lark-bot-integration) — 스캔하여 설치, DM / @-멘션 / `/issue`
-- [Slack Bot 연동](/slack-bot-integration) — 자체 앱 사용 설정(매니페스트 + 토큰), 에이전트별 봇
-- [에이전트](/agents) · [Chat](/chat) · [Tasks](/tasks)
+- [Feishu / Lark Bot 연결](/lark-bot-integration)
+- [Slack Bot 연결](/slack-bot-integration)
+- [에이전트와 대화](/chat)
diff --git a/apps/docs/content/docs/channels.mdx b/apps/docs/content/docs/channels.mdx
index 44906bbee7..e8cebe7e19 100644
--- a/apps/docs/content/docs/channels.mdx
+++ b/apps/docs/content/docs/channels.mdx
@@ -1,93 +1,79 @@
---
-title: Chat integrations (channels)
-description: How Multica connects agents to chat platforms — one channel engine, per-platform adapters for Lark (飞书) and Slack — covering the inbound pipeline, sessions, and authorization.
+title: Chat integrations
+description: Connect Multica agents to Feishu, Lark, or Slack and use them from the chat tools your team already uses.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-
-A **channel** connects a Multica [agent](/agents) to a chat platform so your team can work with it where they already talk. Today there are two channels — [Lark (飞书)](/lark-bot-integration) and [Slack](/slack-bot-integration) — and both run on the **same engine**: a platform-neutral core plus a thin per-platform adapter. Adding a platform is "implement the adapter," not "rebuild the pipeline."
-
-An **installation** is the unit that ties it together: one bot bound to one `(workspace, agent)`. Inbound messages are routed to an installation, then through a shared pipeline; the agent's reply is sent back to the same chat.
-
-## Architecture
-
-<Mermaid chart={`
-flowchart LR
- subgraph P["Chat platforms"]
- LK["Lark / 飞书"]
- SL["Slack"]
- end
- subgraph ENG["Channel engine (platform-neutral)"]
- direction TB
- SUP["Supervisor<br/>one live connection per installation"]
- ROU["Router pipeline:<br/>route → dedup → auth → session → trigger"]
- end
- LK -->|long connection| SUP
- SL -->|Socket Mode| SUP
- SUP -->|raw event| ADP["Per-platform adapter<br/>translate + ResolverSet"]
- ADP --> ROU
- ROU -->|agent task| RUN["Daemon runs the agent"]
- RUN -->|reply| OUT["Per-platform outbound<br/>(bot token → platform API)"]
- OUT --> P
-`} />
-
-## The inbound pipeline (generic)
-
-Every inbound message — Lark or Slack — runs through the same ordered steps in the engine `Router`. A platform adapter only supplies the per-platform pieces (the `ResolverSet`); the policy lives in the engine.
-
-1. **Route to installation** — map the event to a `channel_installation` (→ workspace + agent). Lark routes by `app_id`; Slack routes by the app id carried on the event.
-2. **Addressing filter** — in a group/channel, only messages that **@-mention the bot** continue; idle group chatter is dropped (not read).
-3. **Dedup** — a two-phase `(installation, message_id)` claim guarantees exactly-once processing, even across server replicas.
-4. **Identity + authorization** — resolve the sender's platform user id to a Multica user (the [account binding](#authorization)), then re-check workspace membership. Unbound senders get a "link your account" prompt; non-members are dropped.
-5. **Session** — find or create a [chat session](/chat) for this conversation and append the message (see [Sessions](#sessions-and-context)).
-6. **Trigger** — enqueue an agent [task](/tasks); a [daemon](/daemon-runtimes) runs the agent and the reply is sent back into the chat.
-
-## Sessions and context
-
-The agent's context is the **chat-session transcript** — the messages that have been ingested into that session over time. This transcript model is generic (shared by every channel). What differs per platform is the **session-isolation key** the adapter composes:
-
-| Platform | Isolation key | Effect |
+
+Chat integrations let the team ask an agent questions, @-mention it in a group chat, or create issues from the chat window — without opening Multica.
+
+Feishu/Lark and Slack are supported today. Both integrations share the same session, identity, and execution mechanics but install differently.
+
+## Choose a platform
+
+| | Feishu / Lark | Slack |
|---|---|---|
-| **Lark / 飞书** | the chat id | One session per chat/group — consecutive turns in the same chat accumulate into one transcript (multi-turn memory). |
-| **Slack** | DM: the channel; channel: `channel + thread root` | Each DM is one session; **each @bot thread is its own session**, so two threads in one channel don't mix. |
+| Installation | Generate a QR code in Multica and authorize by scanning it with Feishu | Create an app in Slack, then paste two tokens into Multica |
+| DM the agent | Supported | Supported |
+| Groups or channels | Triggered by @-mentioning the Bot | Triggered by @-mentioning the Bot |
+| Create issues | `/issue` message command; creates the issue from your input as-is | `/issue` slash command; the agent writes up the description before creating |
+| Connection | Platform long connection | Socket Mode |
-<Callout type="info">
-In a group, only messages that **@-mention the bot** are ingested. Neither channel reads the channel's other (un-@'d) messages or scrollback today, so the agent won't see messages it wasn't addressed in. Fetching surrounding history as context is a planned enhancement.
-</Callout>
+New connections are currently open only for mainland-China Feishu; existing international Lark connections keep working and can still be managed.
-## Authorization
+Each Bot is bound to one Multica agent. To use several agents on the same chat platform, connect a separate Bot for each.
-Two independent gates protect a bot in a shared group — both enforced in the engine for every message, identically for Lark and Slack:
+Step-by-step guides:
-- **Account binding (authentication)** — the sender's platform user id must be linked to a Multica user. The first time someone messages the bot they get a one-time link to bind their identity to **their own** Multica account; until then no agent runs.
-- **Workspace membership (authorization)** — the bound Multica user must be a member of the installation's workspace, re-checked on every message. Non-members are silently dropped.
+- [Feishu / Lark Bot integration](/lark-bot-integration)
+- [Slack Bot integration](/slack-bot-integration)
-So adding a bot to a public channel is safe: only workspace members who have bound their identity can drive the agent, and each sender is checked independently. See the per-platform pages for the user-facing prompts.
+## How a message is processed
-## The two channels
+1. Multica resolves the Bot to its workspace and agent.
+2. In a group or channel, only messages that explicitly @-mention the Bot continue; DMs need no mention.
+3. Multica verifies the sender's account binding and workspace membership.
+4. The message joins an [agent chat](/chat) session, and a task is created.
+5. The agent's reply goes back to the original DM or thread.
-<Callout type="info">
-**Lark (飞书) — scan to install.** A workspace admin binds an agent by scanning a QR with the Lark app; no developer console steps. One Bot per agent. See [Lark Bot integration](/lark-bot-integration).
-</Callout>
+Channel messages that don't @-mention the Bot never trigger the agent and are not added to its conversation context.
+
+## Session isolation
+
+- Feishu/Lark separates sessions by chat; later messages in the same chat continue the same session.
+- Slack separates DMs by channel; in a channel, each thread holds its own session.
+
+Follow-ups in a channel still need a fresh @-mention. The agent only receives messages addressed to it — it never reads the whole channel history automatically.
+
+## Account binding
+
+The first time a member messages the Bot, they receive an account binding link. After signing in to Multica, the platform account is linked to their membership in the current workspace.
+
+Multica only runs the agent after binding completes. Every message re-checks account binding and workspace membership; after leaving a workspace, the Bot can no longer be used to reach it.
<Callout type="info">
-**Slack — bring your own app.** A workspace admin creates a Slack app, installs it to their Slack workspace, and pastes its bot token + app-level token into Multica. Each agent gets its own Slack app, so several agents can each have a distinct bot in one Slack workspace. See [Slack Bot integration](/slack-bot-integration) for the manifest and step-by-step setup.
+Account binding only confirms who the sender is. Other members on the chat platform are not automatically added to the Multica workspace.
</Callout>
-## Self-host
+## Manage connections
+
+Workspace owners and admins can connect or disconnect Bots; for Feishu/Lark Bots, connecting and disconnecting is also open to the agent's owner. Regular members can view connected integrations and use the agents they have access to.
+
+After disconnecting, the Bot stops receiving new messages. Existing Multica conversations and run records are kept.
+
+## Self-hosting
-Each channel is **off until you set its at-rest encryption key** (the key encrypts each bot's tokens before they touch the database):
+A self-hosted deployment must configure a 32-byte encryption key for each platform before Multica opens its connection entry point:
```dotenv
MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
```
-On Multica Cloud both are already configured. See [Environment variables](/environment-variables) for the full reference.
+These keys encrypt stored Bot credentials. See [Environment variables](/environment-variables) for how to generate, store, and rotate them. Multica Cloud already has this configured.
-## Next
+## Next steps
-- [Lark Bot integration](/lark-bot-integration) — scan-to-install, DM / @-mention / `/issue`
-- [Slack Bot integration](/slack-bot-integration) — bring-your-own-app setup (manifest + tokens), per-agent bots
-- [Agents](/agents) · [Chat](/chat) · [Tasks](/tasks)
+- [Feishu / Lark Bot integration](/lark-bot-integration) — connect an agent by scanning a QR code.
+- [Slack Bot integration](/slack-bot-integration) — create a Slack app and paste its tokens into Multica.
+- [Chat](/chat) — the conversation and execution model behind every Bot.
diff --git a/apps/docs/content/docs/channels.zh.mdx b/apps/docs/content/docs/channels.zh.mdx
index 93b582821f..1ed8966c48 100644
--- a/apps/docs/content/docs/channels.zh.mdx
+++ b/apps/docs/content/docs/channels.zh.mdx
@@ -1,93 +1,79 @@
---
-title: 聊天集成(channels)
-description: Multica 如何把智能体接入聊天平台——一个统一的 channel 引擎,加上针对飞书(Lark)和 Slack 的各平台适配器——涵盖入站流水线、会话与授权。
+title: 聊天集成
+description: 把 Multica 智能体接入飞书、Lark 或 Slack,在团队已有的聊天工具中使用。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-
-**channel** 把一个 Multica [智能体](/agents)接入聊天平台,团队就能在他们日常沟通的地方直接使用它。目前有两个 channel——[Lark(飞书)](/lark-bot-integration) 和 [Slack](/slack-bot-integration)——两者都跑在**同一个引擎**上:一个平台无关的内核,加上一层很薄的各平台适配器。新增一个平台是「实现适配器」,而不是「重建流水线」。
-
-**安装(installation)** 是把这一切串起来的单元:一个 Bot 绑定到一个 `(workspace, agent)`。入站消息被路由到某个安装,再经过共享的流水线;智能体的回复会被发回同一个聊天里。
-
-## 架构
-
-<Mermaid chart={`
-flowchart LR
- subgraph P["聊天平台"]
- LK["Lark / 飞书"]
- SL["Slack"]
- end
- subgraph ENG["Channel 引擎(平台无关)"]
- direction TB
- SUP["Supervisor<br/>每个安装一条实时连接"]
- ROU["路由流水线:<br/>路由 → 去重 → 鉴权 → 会话 → 触发"]
- end
- LK -->|长连接| SUP
- SL -->|Socket Mode| SUP
- SUP -->|原始事件| ADP["各平台适配器<br/>转换 + ResolverSet"]
- ADP --> ROU
- ROU -->|智能体任务| RUN["守护进程运行智能体"]
- RUN -->|回复| OUT["各平台出站<br/>(bot token → 平台 API)"]
- OUT --> P
-`} />
-
-## 入站流水线(通用)
-
-每一条入站消息——无论来自 Lark 还是 Slack——都会走引擎 `Router` 里同一套有序步骤。平台适配器只提供各平台特有的部分(即 `ResolverSet`);策略本身住在引擎里。
-
-1. **路由到安装** —— 把事件映射到一个 `channel_installation`(→ workspace + agent)。Lark 按 `app_id` 路由;Slack 按事件携带的 app id 路由。
-2. **寻址过滤** —— 在群 / 频道里,只有 **@ 了 Bot** 的消息才会继续往下走;无关的群聊闲谈会被丢弃(不读取)。
-3. **去重** —— 一个两阶段的 `(installation, message_id)` 认领机制保证恰好处理一次,即便跨多个服务器副本也成立。
-4. **身份 + 授权** —— 把发送者的平台用户 id 解析成一个 Multica 用户(即[账号绑定](#账号绑定)),然后再次校验 workspace 成员身份。未绑定的发送者会收到一条「绑定你的账号」提示;非成员会被丢弃。
-5. **会话** —— 为这段对话找到或创建一个 [chat 会话](/chat),并把消息追加进去(见[会话](#会话与上下文))。
-6. **触发** —— 入队一个智能体[任务](/tasks);一个[守护进程](/daemon-runtimes)运行智能体,回复会被发回聊天里。
-
-## 会话与上下文
-
-智能体的上下文就是**这段 chat 会话的对话记录**——也就是随时间被纳入该会话的那些消息。这套对话记录模型是通用的(每个 channel 共用)。各平台不同的地方在于适配器拼出来的**会话隔离键**:
-
-| 平台 | 隔离键 | 效果 |
+
+聊天集成让团队不用打开 Multica,也能直接向智能体提问、在群聊中 @它,或从聊天窗口创建 issue。
+
+目前支持飞书/Lark 和 Slack。两种集成使用相同的会话、身份和执行机制,但安装方式不同。
+
+## 选择平台
+
+| | 飞书 / Lark | Slack |
|---|---|---|
-| **Lark / 飞书** | 聊天 id | 每个聊天 / 群一个会话——同一个聊天里连续的几轮会累积成一份对话记录(多轮记忆)。 |
-| **Slack** | 私聊:频道;频道:`channel + thread root` | 每段私聊是一个会话;**每个 @bot 的 thread 是它自己的会话**,所以同一个频道里的两个 thread 不会混在一起。 |
+| 安装方式 | 在 Multica 中生成二维码,用飞书扫码授权 | 在 Slack 创建 app,再把两个 token 填入 Multica |
+| 私聊智能体 | 支持 | 支持 |
+| 群聊或频道 | @ Bot 后触发 | @ Bot 后触发 |
+| 创建 issue | `/issue` 消息命令,按输入直接创建 | `/issue` slash 命令,智能体整理描述后创建 |
+| 连接方式 | 平台长连接 | Socket Mode |
-<Callout type="info">
-在群里,只有 **@ 了 Bot** 的消息才会被纳入。目前两个 channel 都不会读取频道里其他(没 @ 的)消息或历史滚动记录,所以智能体看不到那些没有点名它的消息。把周边历史作为上下文拉取进来,是计划中的增强功能。
-</Callout>
+新连接目前只开放中国大陆版飞书;已有的国际版 Lark 连接仍可继续使用和管理。
-## 账号绑定
+每个 Bot 绑定一个 Multica 智能体。需要在同一个聊天平台中使用多个智能体时,要分别连接多个 Bot。
-在共享群里,有两道相互独立的关卡保护着 Bot——两者都在引擎里对每一条消息强制执行,且 Lark 和 Slack 一视同仁:
+详细步骤:
-- **账号绑定(认证)** —— 发送者的平台用户 id 必须关联到一个 Multica 用户。某人第一次给 Bot 发消息时,会拿到一个一次性链接,把自己的身份绑定到**他自己的** Multica 账号;在那之前不会有任何智能体运行。
-- **Workspace 成员身份(授权)** —— 绑定后的 Multica 用户必须是该安装所属 workspace 的成员,每条消息都会重新校验。非成员会被静默丢弃。
+- [飞书 / Lark Bot 接入](/lark-bot-integration)
+- [Slack Bot 接入](/slack-bot-integration)
-所以把 Bot 加进一个公开频道是安全的:只有已绑定身份的 workspace 成员才能驱动智能体,而且每个发送者都会被独立校验。面向用户的提示文案请见各平台的页面。
+## 消息的执行流程
-## 两个 channel
+1. Multica 根据 Bot 找到对应的工作区和智能体。
+2. 在群聊或频道中,只有明确 @ Bot 的消息会继续处理;私聊不需要 @。
+3. Multica 校验发送者的账号绑定和工作区成员身份。
+4. 消息进入一段[智能体对话](/chat),并创建一次执行任务。
+5. 智能体的回复回到原来的私聊或讨论串。
-<Callout type="info">
-**Lark(飞书)—— 扫码安装。** workspace 管理员用飞书 App 扫一个二维码就能绑定一个智能体;无需任何开发者后台步骤。一个智能体一个 Bot。见 [Lark Bot 接入](/lark-bot-integration)。
-</Callout>
+没有 @ Bot 的频道消息不会触发智能体,也不会被加入它的对话上下文。
+
+## 会话隔离
+
+- 飞书/Lark 按聊天区分会话;同一个聊天中的后续消息会继续原会话。
+- Slack 私聊按频道区分;频道中的每个 thread 分别保存一段会话。
+
+在频道中继续追问时仍需再次 @ Bot。智能体只收到发给自己的消息,不会自动读取整个频道的历史。
+
+## 账号绑定
+
+成员第一次向 Bot 发消息时,会收到一个账号绑定链接。登录 Multica 后,平台账号与当前工作区成员关联。
+
+绑定完成后,Multica 才会运行智能体。每条消息都会重新检查账号绑定和工作区成员身份;离开工作区后,不能继续通过 Bot 使用它。
<Callout type="info">
-**Slack —— 自带应用。** workspace 管理员创建一个 Slack app,把它安装到自己的 Slack workspace,再把它的 bot token + app-level token 粘贴进 Multica。每个智能体都有自己的 Slack app,所以多个智能体可以在同一个 Slack workspace 里各自拥有一个独立的 Bot。manifest 和分步设置见 [Slack Bot 接入](/slack-bot-integration)。
+账号绑定只用于确认发送者身份。聊天平台中的其他成员不会因此自动加入 Multica 工作区。
</Callout>
-## 自部署
+## 管理连接
+
+工作区 owner 和 admin 可以连接或断开 Bot;飞书/Lark Bot 的连接和断开还对智能体所有者开放。普通成员可以查看已经连接的集成并使用自己有权调用的智能体。
+
+断开后,Bot 不再接收新消息。已有的 Multica 对话和执行记录仍然保留。
+
+## 自托管
-每个 channel 在**你设置好它的静态加密密钥之前都是关闭的**(这个密钥会在每个 Bot 的 token 落库之前对其加密):
+自托管部署需要先为对应平台配置一个 32 字节加密密钥,Multica 才会开放连接入口:
```dotenv
-MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
-MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
+MULTICA_LARK_SECRET_KEY=<base64 编码的 32 字节密钥>
+MULTICA_SLACK_SECRET_KEY=<base64 编码的 32 字节密钥>
```
-在 Multica Cloud 上两者都已配置好。完整参考见[环境变量](/environment-variables)。
+这些密钥用于加密保存 Bot 凭据。生成、保存和轮换方法见[环境变量](/environment-variables)。Multica Cloud 已完成这项配置。
-## 下一步
+## 接下来
-- [Lark Bot 接入](/lark-bot-integration) —— 扫码安装,私聊 / @ 提及 / `/issue`
-- [Slack Bot 接入](/slack-bot-integration) —— 自带应用的设置(manifest + token),每个智能体一个 Bot
-- [智能体](/agents) · [Chat](/chat) · [任务](/tasks)
+- [飞书 / Lark Bot 接入](/lark-bot-integration)
+- [Slack Bot 接入](/slack-bot-integration)
+- [与智能体对话](/chat)
diff --git a/apps/docs/content/docs/chat.ja.mdx b/apps/docs/content/docs/chat.ja.mdx
index 2d0a2836fd..6b1661178e 100644
--- a/apps/docs/content/docs/chat.ja.mdx
+++ b/apps/docs/content/docs/chat.ja.mdx
@@ -1,62 +1,69 @@
---
-title: チャット
+title: エージェントとのチャット
description: どのイシューにも属さない、エージェントとの一対一の会話。会話全体は完全に非公開で、エージェントは既定ではイシューのコンテキストを持たず、自動でイシューを作ることもありません — ただし、あなたが明示的に頼めば、あなたのワークスペース権限であなたに代わって操作します。
---
import { Callout } from "fumadocs-ui/components/callout";
+チャットは、まだ明確なイシューになっていない作業に向いています。アイデアの整理、ワークスペースの状況確認、方針の議論、あるいは小さな作業を先にエージェントに任せる、といった使い方です。
+
**チャットはあなたと[エージェント](/agents)との一対一の会話です** — [イシュー](/issues)ボードから外に出るものです。エージェントは既定では**イシューのコンテキストを持たず** — あなたのボードを見ておらず、会話を勝手にイシューに変えることもしません — 会話全体は**完全に非公開**です([ワークスペース](/workspaces)内の他の誰も、admin を含めて、この会話を見ることはできません)。エージェントとアプローチを議論したり、ブレインストーミングをしたり、どのイシューにも属さない質問をしたりするのに適しています。
-## エージェントを @-メンションするだけではだめなのですか?
+チャットは**特定のイシューに紐づきません**。エージェントはイシューの説明やコメントを自動的には受け取りませんが、権限の範囲内で Multica CLI を使い、ワークスペース、プロジェクト、イシュー、スキルを照会できます。
-[@-メンション](/mentioning-agents)はエージェントをイシューのコンテキスト**の中へ引き入れます** — エージェントはイシューの説明とすべての過去のコメントを読み、イシューを変更できます。チャットはこれを逆転させます。**あなたをイシューの外へ引き出します** — エージェントはこの単一の会話だけを見られ、既定ではイシューのコンテキストを持たないため、あなたが明示的に頼まない限り、どのイシューも読んだり操作したりしません。
+チャットに背景を持たせることもできます。入力欄左下の **+** をクリックして**プロジェクトコンテキスト**を選ぶと、チャットに[プロジェクト](/projects)を紐づけられます。エージェントの実行時に、そのプロジェクトの説明やリポジトリなどのリソースが渡されます。
-2 つの判断基準:
+![エージェントとのチャット:質問への回答が表に整理されて返ってくる](/images/docs/chat-conversation.png)
-- 特定のイシューのコンテキストに基づくフィードバックがほしいとき → [@-メンション](/mentioning-agents)
-- どのイシューとも無関係なトピックを議論したいとき(または他の誰にも議論を見られたくないとき) → チャット
+## チャットの開始
-## 会話を始める
+1. サイドバーの**チャット**を開きます。
+2. 新規作成をクリックし、実行権限のあるエージェントを選択します。
+3. メッセージを入力します。画像やファイルも添付できます。
+4. 送信すると、Multica はこのメッセージのための実行を作成し、返信は現在のチャットに戻ってきます。
-サイドバーから**チャット**を開き、エージェントを選んで、新しい会話を始めてください。インターフェースはどのメッセージングアプリとも似ています。メッセージを送るとエージェントが返信します。各メッセージはバックグラウンドで実行をトリガーするため(キューに入れられた `task`)、返信には数秒かかることがあります。
+ランタイムがオフラインの場合、メッセージはオンラインに戻るまで待機します。エージェントがアーカイブされたり、あなたが実行権限を失ったりすると、新しいメッセージは送信できません。
-## チャットでエージェントができることとできないこと
+## チャットとイシューの使い分け
-チャットの隔離は**コンテキストとプライバシーに関するものであり、権限に関するものではありません**。会話は非公開で、エージェントは既定ではイシューのコンテキストを持ちませんが、各返信は依然として**あなたのワークスペース権限**で実行され、あなたに代わって、あなたと同じ権限で動きます。したがって、あなたが明示的に頼めば、エージェントは `multica` CLI を使ってあなたのワークスペースを操作でき、イシューの作成や変更も可能です。
+| 目的 | 適した選択 |
+|---|---|
+| 手早い質問、方針の探索、個人的な下書き | **チャット** |
+| 明確な担当者、ステータス、優先度、成果物 | **イシュー** |
+| チームメンバーが背景を確認して議論を続ける | **イシュー** |
+| 作業記録を残さずにワークスペースの情報を確認する | **チャット** |
-**できること:**
+Multica で作成したダイレクトチャットは作成者だけが見られます。他のワークスペースメンバーや管理者は読めません。チームで共有すべき結論は、イシュー、プロジェクトの説明、またはスキルにまとめてください。
-- 現在のメッセージに含まれる質問に答える
-- 構成された[スキル](/skills)と MCP を使う
-- 自身の作業ディレクトリでファイルを読み書きする
-- `multica` CLI コマンドを実行する(**ワークスペースのデータを読み書きするコマンドを含む**)。例えば `multica issue list` はあなたのワークスペースのイシューを返し、イシューを作るよう頼めば `multica issue create` が実行されて実際のイシューが作られます(作成者としてそのエージェントが記録されます)。これらはこのワークスペースにおけるあなたの権限で実行されます。
+## マルチターンのコンテキスト
-**できないこと:**
+同じチャットは AI コーディングツール側の元のセッションを可能な限り継続するため、後続のメッセージで前の内容を繰り返す必要はありません。Multica はセッション ID を保存し、そのセッションにアクセスできるランタイムへ後続の実行をルーティングします。
-- **イシューを自動で作成したり自動で表示したりすること** — プロンプトにはイシュー ID がなく、会話の中にタスクらしい内容を認識しても、それ自体は何も作成したり呼び出したりしません。エージェントがイシューに触れるのは、あなたが明示的に頼んだときだけです。
-- **あなたの他の会話を見ること** — 各実行のプロンプトはこの単一のチャットに限定され、あなたの他のチャットセッションの内容が渡されることはありません。
-- **このワークスペースやあなたの権限の外に出ること** — 各実行はこのワークスペースに紐づき、あなたとして動くため、他のワークスペースに触れることも、あなた自身のアカウントにできないことを行うこともできません。
+ローカルのセッションがすでに存在しない、コンテキストを継続できない、直前のエラーを引き継ぐべきでない、といった場合、ランタイムは新しいセッションから開始します。チャットのメッセージ履歴はどちらの場合も保持されます。
-## 複数ターンのコンテキストが保持される仕組み
+## 実行の確認と停止
-チャットは**プロバイダーセッションの再開**を通じて複数ターンのコンテキストを維持します — エージェントは最初の返信でプロバイダーセッションを確立し(例: Claude セッション)、そのセッション ID が保存されます。次のメッセージでは、タスクのディスパッチがその ID を渡し直すため、エージェントは毎回履歴を読み直すことなく**中断したところから再開**します。
+エージェントの実行中は、現在のフェーズとツールのアクティビティが画面に表示されます。**詳細を表示**を展開すると、より完全な実行過程を確認できます。
-もし**1 つのターンが失敗した**場合、Multica はセッション ID を確立していた以前のタスク(そのタスクが成功したか失敗したかにかかわらず)を探し、再開を試みます — 途中で一度失敗したからといって、会話全体の記憶が失われることはありません。
+中断するには、入力欄の横にある停止ボタンをクリックします。すでにチャットへ返ってきた内容は保持され、まだ処理されていない入力は可能な限り編集欄に復元されます。
-注: すべてのプロバイダーが実際にセッション再開を実装しているわけではありません — サポート状況は[**プロバイダーマトリックス**](/providers)を参照してください。
+## チャット一覧の整理
-## 会話をアーカイブする
+チャットは名前の変更、ピン留め、アーカイブ、削除ができます。
-もう見たくない会話はアーカイブできます — 会話一覧で右クリックするか、詳細ページの「アーカイブ」ボタンを使ってください。アーカイブ後は次のようになります。
+- **ピン留め**: よく使うチャットを一覧の先頭に固定します。
+- **アーカイブ**: チャットを「アーカイブ済み」に移し、読み取り専用にします。
+- **アーカイブ解除**: 再びメッセージを送信できるようになります。
+- **削除**: チャットとその中のメッセージを完全に削除します。
-- 会話がアクティブな一覧から消えます(「アーカイブ済み」ビューで引き続き見つけられます)
-- 過去のメッセージ、セッション ID、作業ディレクトリはすべて保持されます — 何も削除されません
+チャットが外部チャネル(Slack など)に紐づいている場合、アーカイブすると紐づけは切断されます。アーカイブ解除では復元されないため、あらためて紐づけてください。
<Callout type="warning">
-**アーカイブ後には「復元」ボタンがありません。** 現在、アーカイブされた会話を再びアクティブな状態に戻す入口はありません。後でそのスレッドを続けたい場合は、新しい会話を始める必要があります。アーカイブされた会話の内容を再び見るには、「アーカイブ済み」ビューを開いて履歴を読んでください。
+チャットの削除は元に戻せず、その中の未完了の実行も停止します。当面使わないだけならアーカイブしてください。
</Callout>
-## 次へ
+## 次のステップ
-- [**オートパイロット**](/autopilots) — エージェントがスケジュールに従って自動的に作業を開始できるようにします
-- [**エージェントにイシューを割り当てる**](/assigning-issues) — トピックをイシューボードに戻します
+- [イシューをエージェントに割り当てる](/assigning-issues) — 議論を追跡可能な作業に変えます。
+- [インボックスと購読](/inbox) — フォローが必要なチームの動きを確認します。
+- [AI コーディングツール対応表](/providers) — セッションとモデルの機能を確認します。
diff --git a/apps/docs/content/docs/chat.ko.mdx b/apps/docs/content/docs/chat.ko.mdx
index 302ef1db8b..793ebe9928 100644
--- a/apps/docs/content/docs/chat.ko.mdx
+++ b/apps/docs/content/docs/chat.ko.mdx
@@ -1,62 +1,69 @@
---
-title: 채팅
+title: 에이전트와 대화
description: 어떤 이슈에도 속하지 않는, 에이전트와의 일대일 대화. 대화 전체가 완전히 비공개이며, 에이전트는 기본적으로 이슈 컨텍스트를 갖지 않고 이슈를 자동으로 만들지도 않습니다 — 다만 당신이 명시적으로 요청하면 당신의 워크스페이스 권한으로 당신을 대신해 작업합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-**채팅은 당신과 [에이전트](/agents) 사이의 일대일 대화입니다** — [이슈](/issues) 보드에서 벗어나는 것입니다. 에이전트는 기본적으로 **이슈 컨텍스트가 없으며** — 당신의 보드를 보고 있지 않고, 대화를 스스로 이슈로 바꾸지도 않습니다 — 대화 전체가 **완전히 비공개**입니다([워크스페이스](/workspaces) 내의 다른 누구도, admin을 포함해서, 이 대화를 볼 수 없습니다). 에이전트와 접근 방식을 논의하거나, 브레인스토밍을 하거나, 어떤 이슈에도 속하지 않는 질문을 하기에 적합합니다.
+대화는 아직 명확한 이슈가 되지 않은 작업에 적합합니다. 아이디어를 정리하고, 워크스페이스 상황을 조회하고, 방안을 논의하거나, 에이전트에게 작은 태스크를 먼저 맡길 수 있습니다.
-## 그냥 에이전트를 @-멘션하면 안 되나요?
+**대화(Chat)는 당신과 [에이전트](/agents) 사이의 일대일 소통입니다** — [이슈](/issues) 보드에서 벗어나는 것입니다. 에이전트는 기본적으로 **이슈 컨텍스트가 없으며** — 당신의 보드를 보고 있지 않고, 대화를 스스로 이슈로 바꾸지도 않습니다 — 대화 전체가 **완전히 비공개**입니다([워크스페이스](/workspaces) 내의 다른 누구도, admin을 포함해서, 이 대화를 볼 수 없습니다). 에이전트와 접근 방식을 논의하거나, 브레인스토밍을 하거나, 어떤 이슈에도 속하지 않는 질문을 하기에 적합합니다.
-[@-멘션](/mentioning-agents)은 에이전트를 이슈의 컨텍스트 **안으로 끌어들입니다** — 에이전트는 이슈 설명과 모든 과거 댓글을 읽고, 이슈를 변경할 수 있습니다. 채팅은 이를 뒤집습니다. **당신을 이슈 밖으로 끌어냅니다** — 에이전트는 이 단일 대화만 볼 수 있고 기본적으로 이슈 컨텍스트가 없으므로, 당신이 명시적으로 요청하지 않는 한 어떤 이슈도 읽거나 변경하지 않습니다.
+대화는 **특정 이슈에 연결되지 않습니다**. 에이전트가 이슈 설명과 댓글을 자동으로 받지는 않지만, 권한 범위 안에서 Multica CLI로 워크스페이스, 프로젝트, 이슈, 스킬을 조회할 수 있습니다.
-두 가지 판단 기준:
+대화에 배경을 추가할 수도 있습니다. 입력란 왼쪽 아래의 **+**를 클릭하고 **프로젝트 컨텍스트**를 선택해 대화에 [프로젝트](/projects)를 연결하세요. 에이전트는 실행할 때 해당 프로젝트의 설명과 저장소 같은 리소스를 받습니다.
-- 특정 이슈의 컨텍스트에 기반한 피드백을 원할 때 → [@-멘션](/mentioning-agents)
-- 어떤 이슈와도 무관한 주제를 논의하고 싶을 때(또는 다른 누구에게도 논의를 보이고 싶지 않을 때) → 채팅
+![에이전트와의 대화: 질문에 표로 정리된 답변이 돌아온 모습](/images/docs/chat-conversation.png)
-## 대화 시작하기
+## 대화 시작
-사이드바에서 **채팅**을 열고, 에이전트를 선택한 다음, 새 대화를 시작하세요. 인터페이스는 여느 메시징 앱과 비슷합니다. 메시지를 보내면 에이전트가 답장합니다. 각 메시지는 백그라운드에서 실행을 트리거하므로(대기열에 들어간 `task`), 답장에는 몇 초가 걸릴 수 있습니다.
+1. 사이드바에서 **대화**를 엽니다.
+2. 새 대화를 클릭하고 실행 권한이 있는 에이전트를 선택합니다.
+3. 메시지를 입력합니다. 이미지나 파일을 첨부할 수도 있습니다.
+4. 전송하면 Multica가 이 메시지에 대한 실행을 만들고 답변은 현재 대화로 돌아옵니다.
-## 채팅에서 에이전트가 할 수 있는 일과 할 수 없는 일
+런타임이 오프라인이면 다시 온라인이 될 때까지 메시지가 기다립니다. 에이전트가 보관 처리되거나 호출 권한을 잃으면 새 메시지를 보낼 수 없습니다.
-채팅의 격리는 **컨텍스트와 프라이버시에 관한 것이지 권한에 관한 것이 아닙니다**. 대화는 비공개이고 에이전트는 기본적으로 이슈 컨텍스트를 갖지 않지만, 각 답장은 여전히 **당신의 워크스페이스 권한**으로 실행되어 당신을 대신해 당신과 동일한 권한으로 동작합니다. 따라서 당신이 명시적으로 요청하면 에이전트는 `multica` CLI로 당신의 워크스페이스를 조작할 수 있으며, 이슈 생성이나 변경도 가능합니다.
+## 대화와 이슈 선택
-**할 수 있는 일:**
+| 필요 | 더 적합한 방식 |
+|---|---|
+| 빠른 질문, 방안 탐색, 개인 초안 처리 | **대화** |
+| 담당자, 상태, 우선순위, 결과물을 명확히 지정 | **이슈** |
+| 팀 멤버가 배경을 확인하고 논의를 이어가게 하기 | **이슈** |
+| 작업 기록을 만들 필요 없이 워크스페이스 정보를 임시로 확인 | **대화** |
-- 현재 메시지에 담긴 질문에 답하기
-- 구성된 [스킬](/skills)과 MCP 사용하기
-- 자신의 작업 디렉터리에서 파일 읽기 및 쓰기
-- `multica` CLI 명령 실행하기(**워크스페이스 데이터를 읽거나 변경하는 명령 포함**) — 예를 들어 `multica issue list`는 당신의 워크스페이스 이슈를 반환하고, 이슈를 만들어 달라고 요청하면 `multica issue create`가 실행되어 실제 이슈가 생성됩니다(생성자로 해당 에이전트가 기록됩니다). 이 명령들은 이 워크스페이스에서 당신의 권한으로 실행됩니다.
+Multica에서 만든 직접 대화는 만든 사람만 볼 수 있으며 다른 워크스페이스 멤버와 관리자도 읽을 수 없습니다. 팀이 함께 확인해야 하는 결론은 이슈, 프로젝트 설명, 스킬 중 하나로 정리하세요.
-**할 수 없는 일:**
+## 여러 대화 턴의 컨텍스트
-- **이슈를 자동으로 생성하거나 자동으로 띄우기** — 프롬프트에는 이슈 ID가 없으며, 대화에서 작업처럼 보이는 내용을 인식하더라도 그 자체로는 아무것도 생성하거나 불러오지 않습니다. 에이전트는 당신이 명시적으로 요청할 때만 이슈를 건드립니다.
-- **당신의 다른 대화 보기** — 각 실행의 프롬프트는 이 단일 채팅으로 한정되며, 당신의 다른 채팅 세션 내용은 전달되지 않습니다.
-- **이 워크스페이스나 당신의 권한 밖으로 나가기** — 각 실행은 이 워크스페이스에 묶여 당신으로서 동작하므로, 다른 워크스페이스에 접근하거나 당신 계정으로 할 수 없는 일을 하지 못합니다.
+같은 대화에서는 가능한 한 AI 코딩 도구의 기존 세션을 이어가므로 이후 메시지에서 앞선 내용을 반복할 필요가 없습니다. Multica는 세션 식별자를 저장하고, 이후 실행을 해당 세션에 접근할 수 있는 런타임으로 라우팅합니다.
-## 여러 턴에 걸친 컨텍스트가 보존되는 방식
+로컬 세션이 더 이상 존재하지 않거나 컨텍스트를 이어갈 수 없거나 이전 오류가 재사용에 적합하지 않으면 런타임이 새 세션을 시작합니다. 대화의 이전 메시지는 그대로 남습니다.
-채팅은 **제공자 세션 재개**를 통해 여러 턴에 걸친 컨텍스트를 유지합니다 — 에이전트는 첫 답장에서 제공자 세션을 설정하고(예: Claude 세션), 그 세션 ID가 저장됩니다. 다음 메시지에서는 작업 디스패치가 그 ID를 다시 전달하므로, 에이전트는 매번 기록을 다시 읽지 않고도 **중단했던 지점부터 이어서 재개**합니다.
+## 실행 확인 및 중지
-만약 **한 턴이 실패하면**, Multica는 세션 ID를 설정했던 이전 작업(그 작업이 성공했든 실패했든)을 찾아 재개를 시도합니다 — 중간에 한 번 실패한다고 해서 대화 전체의 기억이 사라지지는 않습니다.
+에이전트가 실행 중이면 화면에 현재 단계와 도구 활동이 표시됩니다. **상세 보기**를 펼치면 더 자세한 실행 과정을 확인할 수 있습니다.
-참고: 모든 제공자가 실제로 세션 재개를 구현하는 것은 아닙니다 — 지원 현황은 [**제공자 매트릭스**](/providers)를 참고하세요.
+중단하려면 입력란 옆의 중지 버튼을 클릭하세요. 대화에 이미 반환된 내용은 유지되며 아직 처리를 시작하지 않은 입력은 가능한 경우 편집란으로 복원됩니다.
-## 대화 보관하기
+## 대화 목록 정리
-더 이상 보고 싶지 않은 대화는 보관할 수 있습니다 — 대화 목록에서 우클릭하거나 상세 페이지의 "보관" 버튼을 사용하세요. 보관 후에는:
+대화는 이름 변경, 고정, 보관, 삭제할 수 있습니다.
-- 대화가 활성 목록에서 사라집니다("보관됨" 보기에서 여전히 찾을 수 있습니다)
-- 과거 메시지, 세션 ID, 작업 디렉터리가 모두 보존됩니다 — 아무것도 삭제되지 않습니다
+- **고정**하면 자주 쓰는 대화가 목록 앞쪽에 유지됩니다.
+- **보관**하면 대화가 "보관됨"으로 이동하고 읽기 전용이 됩니다.
+- **보관 해제**하면 메시지를 다시 보낼 수 있습니다.
+- **삭제**하면 대화와 그 안의 메시지가 영구적으로 제거됩니다.
+
+대화가 Slack 같은 외부 채널에 연결되어 있다면 보관할 때 연결이 끊어집니다. 보관을 해제해도 연결은 복원되지 않으므로 다시 연결해야 합니다.
<Callout type="warning">
-**보관 후에는 "복원" 버튼이 없습니다.** 현재 보관된 대화를 다시 활성 상태로 되돌리는 진입점이 없습니다. 나중에 그 스레드를 계속 이어가고 싶다면 새 대화를 시작해야 합니다. 보관된 대화의 내용을 다시 보려면 "보관됨" 보기를 열고 기록을 읽어 보세요.
+대화 삭제는 취소할 수 없으며 아직 끝나지 않은 실행도 중지합니다. 당분간 필요하지 않다면 보관하세요.
</Callout>
-## 다음
+## 다음 단계
-- [**오토파일럿**](/autopilots) — 에이전트가 일정에 따라 자동으로 작업을 시작하도록 하세요
-- [**에이전트에게 이슈 할당하기**](/assigning-issues) — 주제를 이슈 보드로 다시 가져오세요
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 논의를 추적 가능한 작업으로 전환합니다.
+- [인박스와 구독](/inbox) — 확인해야 할 팀 활동을 살펴봅니다.
+- [AI 코딩 도구 비교](/providers) — 세션과 모델 기능을 알아봅니다.
diff --git a/apps/docs/content/docs/chat.mdx b/apps/docs/content/docs/chat.mdx
index f671e7d28f..6f1f2b1b34 100644
--- a/apps/docs/content/docs/chat.mdx
+++ b/apps/docs/content/docs/chat.mdx
@@ -1,62 +1,69 @@
---
-title: Chat
+title: Chat with agents
description: One-to-one, fully private conversation with an agent, outside any issue. The agent starts with no issue context and never auto-creates issues — but it acts with your workspace access when you explicitly ask it to.
---
import { Callout } from "fumadocs-ui/components/callout";
-**Chat is a one-to-one conversation between you and an [agent](/agents)** — stepping outside the [issue](/issues) board. The agent starts with **no issue context** — it isn't looking at your board and won't turn the conversation into issues on its own — and the entire conversation is **fully private** (nobody else in the [workspace](/workspaces), including admins, can see it). It fits discussing an approach with an agent, brainstorming, or asking a question that does not belong to any issue.
+Chat fits work that hasn't formed a clear issue yet: sorting out ideas, checking on the workspace, discussing an approach, or having an agent finish a small task first.
-## Why not just @-mention the agent?
+**Chat is a one-to-one conversation between you and an [agent](/agents)** — stepping outside the [issue](/issues) board. The agent starts with **no issue context** — it isn't looking at your board and won't turn the conversation into issues on its own — and the entire conversation is **fully private** (nobody else in the [workspace](/workspaces), including admins, can see it). It fits discussing an approach with an agent, brainstorming, or asking a question that does not belong to any issue.
-[@-mention](/mentioning-agents) **pulls the agent into** an issue's context — it reads the issue description and every historical comment, and it can change the issue. Chat flips this: **it pulls you out of** the issue — the agent sees only this single conversation and starts with no issue context, so it isn't reading or acting on any issue unless you explicitly ask it to.
+A chat is **not bound to any issue**: the agent doesn't automatically receive an issue's description and comments, but it can still use the Multica CLI to query workspaces, projects, issues, and skills within its permissions.
-Two rules of thumb:
+A chat can also carry background. Click **+** at the bottom left of the input and choose **Project context** to attach a [project](/projects) to the conversation; when the agent runs, it receives that project's description, repositories, and other resources.
-- You want feedback grounded in the context of a specific issue → [@-mention](/mentioning-agents)
-- You want to discuss a topic unrelated to any issue (or you do not want anyone else to see the discussion) → Chat
+![A chat with an agent: a question answered with the result organized into a table](/images/docs/chat-conversation.png)
## Start a conversation
-Open **Chat** from the sidebar, pick an agent, and start a new conversation. The interface feels like any messaging app: you send a message, the agent replies. Each message triggers a run in the background (an enqueued `task`), so replies may take a few seconds.
+1. Open **Chat** in the sidebar.
+2. Click new and pick an agent you have permission to run.
+3. Type a message; you can also attach images or files.
+4. After you send, Multica creates a run for the message, and the reply comes back to the current conversation.
+
+If the runtime is offline, the message waits until it comes back online. Once the agent is archived, or you lose permission to run it, you can't send new messages.
-## What an agent can and cannot do in chat
+## Chat vs. issues
-The isolation in Chat is about **context and privacy, not permissions**. The conversation is private and the agent starts with no issue context — but each reply still runs with **your workspace access**, acting on your behalf with the same permissions you have. So when you explicitly ask, the agent can use the `multica` CLI to act on your workspace, including creating or changing issues.
+| Need | Better fit |
+|---|---|
+| Quick questions, exploring an approach, or private drafts | **Chat** |
+| A clear assignee, status, priority, and deliverable | **Issue** |
+| Letting teammates see the background and continue the discussion | **Issue** |
+| A quick look at workspace information with no work record needed | **Chat** |
-**Can do:**
+Direct chats created in Multica are visible only to their creator; other workspace members and admins cannot read them. Conclusions the team needs to see together should be written into an issue, a project description, or a skill.
-- Answer the questions in your current message
-- Use its configured [skills](/skills) and MCP
-- Read and write files in its own working directory
-- Run `multica` CLI commands, **including ones that read or change workspace data** — for example, `multica issue list` returns your workspace's issues, and asking the agent to file one runs `multica issue create`, producing a real issue recorded with the agent as its creator. These act with your permissions in this workspace.
+## Multi-turn context
-**Cannot do:**
+A conversation tries to continue the original session in the AI coding tool, so later messages don't need to repeat earlier content. Multica stores the session ID and routes subsequent runs to a runtime that can access that session.
-- **Auto-create or auto-surface issues** — the prompt has no issue IDs, and merely recognizing task-shaped content in the conversation does not, on its own, create or pull up anything; the agent only touches issues when you explicitly ask.
-- **Read your other conversations** — each run's prompt is scoped to this single chat; the contents of your other chat sessions are never given to it.
-- **Reach outside this workspace or your permissions** — every run is bound to this workspace and acts as you, so it can't touch another workspace or do anything your own account couldn't.
+If the local session no longer exists, the context can't be continued, or the previous error shouldn't be reused, the runtime starts from a fresh session. The conversation's message history is kept either way.
-## How multi-turn context is preserved
+## Watch and stop a run
-Chat maintains multi-turn context via **provider session resumption** — the agent establishes a provider session on its first reply (for example, a Claude session), and the session ID is stored. On the next message, the task dispatch passes that ID back so the agent **resumes from where it left off** without re-reading history every time.
+While the agent runs, the UI shows the current phase and tool activity. Expand **View details** to inspect the run in full.
-If **one turn fails**, Multica looks up the previous task that had established a session ID (whether that task succeeded or failed) and tries to resume — a single failure in the middle does not drop the memory of the whole conversation.
+To interrupt, click the stop button next to the input. Content already returned to the conversation is kept; input not yet processed is restored to the editor when possible.
-Note: not every provider actually implements session resumption — see the [**Providers Matrix**](/providers) for support status.
+## Organize the conversation list
-## Archive a conversation
+Conversations can be renamed, pinned, archived, and deleted:
-Conversations you no longer want to see can be archived — right-click in the conversation list or use the "Archive" button on the detail page. After archiving:
+- **Pin** keeps frequently used conversations at the top of the list;
+- **Archive** moves a conversation to Archived and makes it read-only;
+- **Unarchive** lets you send messages again;
+- **Delete** permanently removes the conversation and its messages.
-- The conversation disappears from the active list (you can still find it in the "Archived" view)
-- Historical messages, session ID, and the working directory are all preserved — nothing is deleted
+If a conversation is bound to an external channel (such as Slack), archiving breaks the binding; unarchiving does not restore it — bind again.
<Callout type="warning">
-**There is no "restore" button after archiving.** There is currently no entry point to move an archived conversation back to active. If you want to continue the thread later, you will need to start a new conversation. To revisit content in an archived conversation, open the "Archived" view and read through the history.
+Deleting a conversation cannot be undone and stops any runs in it that haven't finished. Archive instead when you just don't need it for now.
</Callout>
-## Next
+## Next steps
-- [**Autopilots**](/autopilots) — let agents start work automatically on a schedule
-- [**Assign issues to agents**](/assigning-issues) — bring the topic back onto the issue board
+- [Assign issues to agents](/assigning-issues) — turn a discussion into trackable work.
+- [Inbox and subscriptions](/inbox) — follow team activity that needs you.
+- [Providers matrix](/providers) — session and model capabilities per AI coding tool.
diff --git a/apps/docs/content/docs/chat.zh.mdx b/apps/docs/content/docs/chat.zh.mdx
index bc21c87632..6aaeefb1d9 100644
--- a/apps/docs/content/docs/chat.zh.mdx
+++ b/apps/docs/content/docs/chat.zh.mdx
@@ -1,62 +1,69 @@
---
-title: 对话
+title: 与智能体对话
description: 和智能体一对一独立聊天,整段对话完全私人。智能体默认没有任何 issue 上下文、也不会自动建 issue——但你明确要求时,它会以你的工作区权限代你操作。
---
import { Callout } from "fumadocs-ui/components/callout";
+对话适合还没有形成明确 issue 的工作:梳理想法、查询工作区情况、讨论方案,或者先让智能体完成一个小任务。
+
**对话(Chat)是你和 [智能体](/agents) 的一对一独立沟通**——跳出 [issue](/issues) 看板。智能体默认**没有任何 issue 上下文**——它不盯着你的看板,也不会自己把对话变成 issue——整段对话**完全私人**([工作区](/workspaces) 里其他人、包括 admin 都看不到)。适合和智能体讨论方案、做 brainstorming、问一个不属于任何 issue 的问题。
-## 为什么不用 @ 智能体就够
+对话**不绑定某一条 issue**:智能体不会自动收到 issue 的描述和评论,但仍可以在权限范围内用 Multica CLI 查询工作区、项目、issue 和 skill。
-[@ 提及](/mentioning-agents) 把智能体**拉进** issue 的上下文——它会读 issue 的描述和所有历史评论,也能改 issue。对话反过来:**把你拉出** issue——智能体只看得到这一次对话,默认没有任何 issue 上下文,除非你明确要求,否则它不会去读或改任何 issue。
+对话也可以携带背景。点击输入框左下角的 **+**,选择**项目上下文**,为对话挂上一个[项目](/projects);智能体执行时会收到该项目的描述和仓库等资源。
-两条判据:
+![与智能体的对话:提问后得到整理成表格的回答](/images/docs/chat-conversation.png)
-- 要智能体基于某个具体 issue 的上下文给反馈 → [@ 提及](/mentioning-agents)
-- 要和智能体聊一个不属于任何 issue 的话题(或不想让任何人看到讨论)→ 对话
+## 开始对话
-## 开始一次对话
+1. 打开侧边栏中的**对话**。
+2. 点击新建,选择一个你有权运行的智能体。
+3. 输入消息,也可以附加图片或文件。
+4. 发送后,Multica 会为这条消息创建一次执行,回复会回到当前对话。
-从侧边栏的 **Chat** 入口进,选一个智能体,开一段新对话。界面和普通聊天软件一样:你发消息,智能体回复。每条消息都会在后台触发一次执行(入队一个 `task`),所以回复可能要等几秒。
+运行时离线时,消息会等待它重新上线。智能体被归档,或者你失去调用权限后,不能继续发送新消息。
-## 智能体在对话里能做什么、不能做什么
+## 对话与 issue 的选择
-对话的隔离是**上下文和隐私层面的,而不是权限层面的**。对话完全私人、智能体默认也没有任何 issue 上下文——但每次回复仍然带着**你的工作区权限**跑,代你行事、和你有一样的权限。所以只要你明确要求,它就能用 `multica` CLI 操作你的工作区,包括创建或修改 issue。
+| 需要 | 更适合 |
+|---|---|
+| 快速提问、探索方案或处理私人草稿 | **对话** |
+| 明确负责人、状态、优先级和交付结果 | **Issue** |
+| 让团队成员查看背景并继续讨论 | **Issue** |
+| 临时查看工作区信息,不需要建立工作记录 | **对话** |
-**能做的**:
+在 Multica 中创建的直接对话只对创建者开放,其他工作区成员和管理员不能读取。需要团队共同查看的结论,应整理到 issue、项目说明或 skill 中。
-- 回答你当前消息里提的问题
-- 使用自己配置的 [skill](/skills) 和 MCP
-- 在自己的工作目录里读写文件
-- 调用 `multica` CLI 命令,**包括读取或修改工作区数据的命令**——比如 `multica issue list` 会返回你工作区里的 issue,让它去建一个 issue 就会跑 `multica issue create`、真的建出一个 issue(记录的创建者是这个智能体)。这些都以你在本工作区的权限执行。
+## 多轮上下文
-**不能做的**:
+同一段对话会尽量继续 AI 编程工具中的原会话,因此后续消息不需要重复前面的内容。Multica 会保存会话标识,并把后续执行路由到能够访问该会话的运行时。
-- **自动建 issue 或自动把内容变成 issue**——提示里没有 issue ID,光是识别出对话里像任务的内容,本身不会创建或调出任何东西;只有你明确要求时它才会去动 issue。
-- **看到你别的对话**——每次执行的提示都只限于这一段对话,你其他对话的内容不会给它。
-- **越过本工作区或你的权限**——每次执行都绑定在本工作区、以你的身份行事,碰不到别的工作区,也做不了你自己账号做不了的事。
+如果本地会话已经不存在、上下文无法继续,或者上一次错误不适合复用,运行时会从新会话开始。对话中的历史消息仍然保留。
-## 多轮对话怎么保留上下文
+## 查看和停止执行
-对话用 **provider 会话恢复**机制维持多轮上下文——智能体第一次回复时建立一个 provider 会话(比如 Claude 的 session),session ID 被存起来;下一条消息派任务时把这个 ID 传回去,智能体**接着上次的状态继续**,不需要每次重新读历史。
+智能体运行时,界面会显示当前阶段和工具活动。展开**查看详情**可以检查更完整的执行过程。
-如果**某一轮失败**,Multica 会查找上一轮建立过 session ID 的任务(不论它当时成功还是失败)并尝试 resume——不会因为中间一次出错就丢掉整段对话的记忆。
+需要中断时,点击输入框旁的停止按钮。已经返回到对话中的内容会保留;尚未开始处理的输入会尽量恢复到编辑框中。
-注意:并非所有 provider 都真正实现了 session 恢复——支持情况见 [**Providers Matrix**](/providers)。
+## 整理对话列表
-## 归档对话
+对话支持重命名、置顶、归档和删除:
-不想再看到的对话可以归档——在对话列表右键或详情页的"归档"按钮。归档后:
+- **置顶**把常用对话固定在列表前面;
+- **归档**把对话移到"已归档"并设为只读;
+- **取消归档**后可以继续发送消息;
+- **删除**会永久移除对话及其中的消息。
-- 对话从活跃列表隐藏(可以在"已归档"视图里翻到)
-- 历史消息、session ID、工作目录完整保留,不会被删
+如果对话绑定了外部渠道(如 Slack),归档时绑定会断开,取消归档不会恢复,需要重新绑定。
<Callout type="warning">
-**归档之后没有"恢复"按钮**——目前没有把归档对话重新设回活跃的入口。如果后续还想继续这段对话,只能另起一个新对话。需要翻看归档对话里的内容时,去"已归档"视图读历史消息。
+删除对话无法撤销,并会停止其中尚未结束的执行。暂时不需要时用归档。
</Callout>
-## 下一步
+## 接下来
-- [**Autopilots**](/autopilots) —— 让智能体定时自动开工
-- [**分配 issue 给智能体**](/assigning-issues) —— 把话题放回 issue 看板上
+- [分配 issue 给智能体](/assigning-issues) — 把讨论转成可追踪的工作。
+- [收件箱与订阅](/inbox) — 查看需要你跟进的团队动态。
+- [AI 编程工具对照](/providers) — 了解会话和模型能力。
diff --git a/apps/docs/content/docs/cli.ja.mdx b/apps/docs/content/docs/cli.ja.mdx
index efbb571fd5..c92f42751a 100644
--- a/apps/docs/content/docs/cli.ja.mdx
+++ b/apps/docs/content/docs/cli.ja.mdx
@@ -1,178 +1,303 @@
---
-title: CLI コマンドリファレンス
-description: すべてのトップレベル Multica CLI コマンドを 1 ページにまとめた概要です。完全な使い方は `multica <command> --help` を実行してください。
+title: CLI を使う
+description: Multica CLI をインストールしてサインインし、ターミナルからワークスペース、イシュー、エージェント、ランタイムを管理します。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica CLI は、Web UI でできるほぼすべての操作をそのまま提供します([イシュー](/issues)の作成、[エージェント](/agents)の割り当て、[デーモン](/daemon-runtimes)の起動など)。このページでは、すべてのトップレベルコマンドを 1 行の説明とともに一覧します。フラグや例の完全な一覧は `multica <command> --help` を実行してください。
+Multica CLI は、ローカルのランタイムを接続する役割と、ターミナルからワークスペース、イシュー、エージェント、オートパイロットを管理する役割の両方を担います。このページではよく使う操作の流れを紹介します。現在のバージョンがサポートするフラグは、常に各コマンド自身の `--help` が正です。
-## 認証する
+## インストール
-CLI を初めて使うときにこのコマンドを実行して、**パーソナルアクセストークン(PAT)**を取得します。
+**macOS / Linux**
```bash
-multica login
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-ブラウザが自動的に開きます。Web アプリで承認すると、CLI が PAT(`mul_` プレフィックス付き)を `~/.multica/config.json` に保存します。これ以降のすべてのコマンドはこの PAT で認証されます。
+Homebrew がインストールされていれば、次のコマンドでもインストールできます:
-<Callout type="tip">
-CI やヘッドレス環境では、ブラウザフローをスキップできます。Web アプリの **Settings → Personal Access Tokens** で PAT を作成し、`multica login --token <mul_...>` で直接渡してください。
-</Callout>
+```bash
+brew install multica-ai/tap/multica
+```
-トークンの種類による違いについては、[認証とトークン](/auth-tokens)を参照してください。
+**Windows PowerShell**
-## 認証とセットアップ
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-| コマンド | 用途 |
-|---|---|
-| `multica login` | ログインして PAT を保存 |
-| `multica auth status` | 現在のログイン状態、ユーザー、ワークスペースを表示 |
-| `multica auth logout` | ローカルの PAT を削除 |
-| `multica setup cloud` | Multica Cloud のワンショットセットアップ(ログイン + デーモンのインストール) |
-| `multica setup self-host` | セルフホストバックエンドのワンショットセットアップ |
+インストールを確認します:
-## ワークスペースとメンバー
+```bash
+multica version
+```
-| コマンド | 用途 |
-|---|---|
-| `multica workspace list` | アクセスできるすべてのワークスペースを一覧 |
-| `multica workspace create --name "..." --slug "..." [--issue-prefix "..."] [--description "..."] [--context "..."]` | ワークスペースを作成(作成者が owner になります)。`--name` と `--slug` は必須で、slug は作成後に変更できません。現在のワークスペースは切り替わりません。 |
-| `multica workspace get <slug>` | 1 つのワークスペースの詳細を表示 |
-| `multica workspace member list` | 現在のワークスペースのメンバーを一覧 |
-| `multica workspace update <id> --name "..." [--description "..."] [--context "..."] [--issue-prefix "..."]` | ワークスペースのメタデータを更新(admin/owner)。長いフィールドは `--description-stdin` / `--context-stdin` を使用できます。 |
+## 初回接続
-## イシューとプロジェクト
+Multica Cloud に接続する:
-<Callout type="info">
-`list` 系のコマンド(`multica issue list`、`autopilot list`、`project list` など)は、デフォルトで短く**そのままコピー&ペーストできる** ID を出力します。イシューは `MUL-123` のようなイシューキー、それ以外のリソースは短い UUID プレフィックスです。以下の後続コマンドの `<id>` 引数は短い ID と完全な UUID のどちらも受け取るため、一般的な流れは `multica issue list` → キーをコピー → `multica issue get MUL-123` となります。正式な UUID が必要なときは `list` コマンドに `--full-id` を渡してください。
-</Callout>
+```bash
+multica setup
+```
-| コマンド | 用途 |
-|---|---|
-| `multica issue list` | イシューを一覧(コピー&ペーストできるイシューキーを出力) |
-| `multica issue get <id>` | 単一のイシューを表示(イシューキーまたは UUID を受け取る) |
-| `multica issue create --title "..."` | 新しいイシューを作成 |
-| `multica issue update <id> ...` | イシューを更新(ステータス、優先度、担当者など) |
-| `multica issue assign <id> --to <name>` | メンバー、エージェント、またはスクワッドに割り当て(エージェントへの割り当ては実行をトリガー) |
-| `multica issue status <id> <status>` | ステータス変更のショートカット |
-| `multica issue search <query>` | キーワード検索 |
-| `multica issue children <id>` | サブイシューを stage ごとに一覧 |
-| `multica issue pull-requests <id>` | 紐付いた pull request と状態を一覧 |
-| `multica issue runs <id>` | イシュー上のエージェント実行を表示 |
-| `multica issue run-messages <task-id>` | 1 回の実行メッセージを表示 |
-| `multica issue usage <id>` | イシュー単位の集計 token 使用量を表示 |
-| `multica issue rerun <id>` | イシューの現在のエージェント担当者向けに新しいタスクを再キューイング |
-| `multica issue cancel-task <task-id>` | キュー中または実行中のタスクをキャンセル |
-| `multica issue comment <id> ...` | ネスト: コメントの表示 / 投稿 |
-| `multica issue comment resolve/unresolve <comment-id>` | コメントスレッドを解決済み / 未解決にする |
-| `multica issue subscriber <id> ...` | ネスト: 購読 / 購読解除 |
-| `multica issue metadata <id> ...` | ネスト: イシューメタデータの読み書き |
-| `multica issue label <id> ...` | ネスト: イシューのラベルを管理 |
-| `multica project list/get/create/update/delete/status` | プロジェクトの CRUD |
-| `multica label list/create/update/delete` | ワークスペースラベルの CRUD |
+セルフホストインスタンスに接続する:
-## エージェントとスキル
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-| コマンド | 用途 |
-|---|---|
-| `multica agent list` | ワークスペースのエージェントを一覧 |
-| `multica agent get <slug>` | エージェントの構成を表示 |
-| `multica agent create ...` | エージェントを作成 |
-| `multica agent update <slug> ...` | エージェントを更新 |
-| `multica agent archive <slug>` | アーカイブ |
-| `multica agent restore <slug>` | アーカイブ済みのエージェントを復元 |
-| `multica agent tasks <slug>` | エージェントのタスク履歴を表示 |
-| `multica agent avatar <slug>` | エージェントのアバターをアップロード |
-| `multica agent env <slug> ...` | エージェントの custom environment variables を読み取り / 置換 |
-| `multica agent skills ...` | ネスト: スキルのアタッチ / デタッチ |
-| `multica skill list/get/create/update/delete` | スキルの CRUD |
-| `multica skill import ...` | GitHub、ClawHub、またはローカルマシンからスキルをインポート |
-| `multica skill files ...` | ネスト: スキルのファイルを管理 |
+`setup` はサーバーアドレスを保存し、ブラウザを開いてサインインを完了し、デーモンを起動します。完了したら確認します:
-### スキルインポートの競合
+```bash
+multica auth status
+multica daemon status
+```
-`multica skill import --url <url>` の既定値は `--on-conflict fail` です。同じ名前のスキルがすでに存在する場合、コマンドは構造化された `conflict` 結果で終了し、ワークスペースは変更されません。
+他の設定を上書きせずにサインインだけやり直したい場合は、`multica login` を実行します。ブラウザのない環境では、先に Web の設定で個人アクセストークンを作成しておき、次のコマンドで入力します:
-既存スキルの作成者で、スキル ID とエージェントの紐付けを維持したまま内容を置き換える場合は `--on-conflict overwrite` を使います。既存スキルを残してコピーを取り込む場合は `--on-conflict rename` を使うと、`-2` のような接尾辞が自動で付きます。同名の項目を単に飛ばす場合は `--on-conflict skip` を使います。
+```bash
+multica login --token
+```
+
+このコマンドはターミナル上でトークンの貼り付けを促すため、完全な値が shell history に残りません。
+
+## ワークスペースを選ぶ
+
+ワークスペースを一覧し、デフォルトを切り替えます:
```bash
-multica skill import --url https://skills.sh/acme/repo/review-helper
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict overwrite
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict rename
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict skip
+multica workspace list
+multica workspace switch <slug>
```
-## スクワッド
+以降のコマンドはこのワークスペースを使います。単発のコマンドでは `--workspace-id` で一時的に上書きでき、`MULTICA_WORKSPACE_ID` を設定することもできます。
-| コマンド | 用途 |
-|---|---|
-| `multica squad list` | ワークスペースのスクワッドを一覧 |
-| `multica squad get <id>` | 単一のスクワッドを表示 |
-| `multica squad create --name "..." --leader <agent>` | スクワッドを作成(owner / admin) |
-| `multica squad update <id> ...` | 名前、説明、指示、リーダー、またはアバターを更新 |
-| `multica squad delete <id>` | アーカイブ(ソフト削除) — 割り当て済みのイシューをリーダーに移管 |
-| `multica squad member list/add/remove <squad-id>` | スクワッドメンバーを管理 |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | スクワッドリーダーエージェントがターンごとに評価を記録するために使用 |
+メンバーを招待する:
-完全なモデルについては[スクワッド](/squads)を参照してください。
+```bash
+multica workspace member invite [email protected]
+multica workspace member invite [email protected] --role admin
+```
-## オートパイロット
+## よく使うイシュー操作
-| コマンド | 用途 |
-|---|---|
-| `multica autopilot list` | ワークスペースのすべてのオートパイロットを一覧 |
-| `multica autopilot get <id>` | 単一のオートパイロットを表示 |
-| `multica autopilot create ...` | オートパイロットを作成 |
-| `multica autopilot update <id> ...` | 更新 |
-| `multica autopilot delete <id>` | 削除 |
-| `multica autopilot runs <id>` | 実行履歴を表示 |
-| `multica autopilot trigger <id>` | 手動で実行をトリガー |
-| `multica autopilot trigger-add/update/delete <id>` | schedule または webhook trigger を管理 |
-| `multica autopilot trigger-rotate-url <id> <trigger-id>` | webhook trigger URL をローテート |
-
-`multica autopilot create/update` は、`create_issue` モードの autopilot が作成するイシューの既定購読者を設定する `--subscriber` も受け取ります。`update` では `--clear-subscribers` で削除できます。
+```bash
+# 表示と検索
+multica issue list
+multica issue get MUL-123
+multica issue search "ログイン失敗"
+
+# 作成と更新
+multica issue create --title "ログイン失敗を修正"
+multica issue status MUL-123 in_progress
+multica issue assign MUL-123 --to "Backend Agent"
+
+# コメントと実行履歴
+multica issue comment list MUL-123
+multica issue comment add MUL-123 --content "まず回帰テストを確認してください"
+multica issue runs MUL-123
+```
+
+長い説明やコメントは stdin から読み込むと、改行や引用符の扱いに悩まずに済みます:
+
+```bash
+multica issue create --title "アップグレードメモ" --description-stdin < notes.md
+multica issue comment add MUL-123 --content-stdin < review.md
+```
+
+1 回の実行のメッセージを表示する、またはタスクを停止する:
+
+```bash
+multica issue run-messages <task-id> --issue MUL-123
+multica issue cancel-task <task-id> --issue MUL-123
+```
+
+## エージェントとスキル
+
+```bash
+multica agent list
+multica agent get <agent-id>
+multica agent create --help
+multica agent update <agent-id> --help
+
+multica skill list
+multica skill get <skill-id>
+multica skill import --url <skill-url>
+multica agent skills add <agent-id> --skill-ids <skill-id>
+```
+
+インポートで同名のスキルに当たった場合、デフォルトでは既存の内容を変更せずに停止します。意図に応じて選択してください:
+
+```bash
+multica skill import --url <skill-url> --on-conflict overwrite
+multica skill import --url <skill-url> --on-conflict rename
+multica skill import --url <skill-url> --on-conflict skip
+```
+
+`overwrite` はスキルの作成者だけが使え、元の ID とエージェントの紐付けを維持します。
## デーモンとランタイム
-| コマンド | 用途 |
-|---|---|
-| `multica daemon start` | デーモンを起動(デフォルトはバックグラウンド。`--foreground` を追加するとフォアグラウンドで実行) |
-| `multica daemon stop` | デーモンを停止 |
-| `multica daemon restart` | デーモンを再起動 |
-| `multica daemon status` | デーモンがオンラインかどうかと同時実行数を確認 |
-| `multica daemon logs` | デーモンのログを表示 |
-| `multica runtime list` | 現在のワークスペースのランタイムを一覧 |
-| `multica runtime usage` | リソース使用量を表示 |
-| `multica runtime activity` | 最近のアクティビティログ |
-| `multica runtime update <id> ...` | ランタイム上で CLI 更新を開始 |
-| `multica runtime delete <id> [--cascade]` | ランタイムを削除し、必要なら紐付くエージェントもアーカイブ |
-| `multica runtime profile ...` | カスタム runtime profile とローカルパス上書きを管理 |
-
-## その他
+```bash
+multica daemon start
+multica daemon stop
+multica daemon restart
+multica daemon status --output json
+multica daemon logs --follow
+
+multica runtime list
+multica runtime rename <runtime-id> "Office Mac"
+multica runtime usage <runtime-id>
+multica runtime activity <runtime-id>
+```
+
+アクティブなエージェントがまだ紐付いているランタイムの削除は、デフォルトで拒否されます。`multica runtime delete <id> --cascade` は、それらのエージェントをアーカイブし、アクティブなタスクもキャンセルします。
+
+仕組みとカスタムプロファイルについては[デーモンとランタイム](/daemon-runtimes)を参照してください。
+
+## コマンド概要
| コマンド | 用途 |
-|---|---|
-| `multica repo checkout <url>` | エージェントが使用できるようにリポジトリをローカルにクローン |
-| `multica config` | ローカルの CLI 構成を表示または編集 |
-| `multica version` | CLI のバージョンを出力 |
-| `multica update` | CLI を最新のリリースにアップグレード |
-| `multica attachment download <id>` | イシューまたはコメントから添付ファイルをダウンロード |
+| --- | --- |
+| `issue` | イシューの作成、更新、割り当て、検索。コメント、購読者、ラベル、プロパティ、実行履歴の管理 |
+| `project` | プロジェクトとそのリソースを管理 |
+| `label`、`property` | ワークスペースのラベルとカスタムプロパティを管理 |
+| `agent`、`skill`、`squad` | エージェント、スキル、スクワッドを管理 |
+| `autopilot` | オートパイロット、トリガー、実行履歴を管理 |
+| `workspace` | ワークスペースの作成、表示、切り替えとメンバーの招待 |
+| `repo` | ワークスペースのリポジトリを管理し、ローカルにチェックアウト |
+| `daemon`、`runtime` | ローカルデーモンの起動と停止。ランタイムの表示と管理 |
+| `attachment` | 添付ファイルのアップロードとダウンロード |
+| `user profile` | 現在のユーザーのプロフィールを表示・更新 |
+| `auth`、`login`、`setup` | サインイン、認証状態の確認、接続の初期化 |
+| `config` | 現在の CLI プロファイルのローカル設定を表示・編集 |
+| `update`、`version` | CLI の更新とバージョンの表示 |
+
+`multica chat` が読み取るのは、**エージェントが現在処理している外部チャットセッション**です。主にチャット統合の中のエージェントが使うもので、任意のワークスペースの会話を閲覧するための汎用コマンドではありません。
+
+## ID と出力形式
-## 完全なフラグを確認する
+イシューには `MUL-123` のようなキーまたは完全な UUID を使います。UUID の短いプレフィックスは受け付けません。
-すべてのコマンドが `--help` をサポートしています。
+その他のリソースの `list` コマンドは通常、コピーできる短い ID を表示し、`--full-id` で完全な UUID を出力できます。短い ID が一意に定まらない場合、CLI は文字の追加か完全な UUID への切り替えを求めます。タスクの短い ID は、所属するイシューを `--issue` で指定する必要もあります。
+
+多くのコマンドが構造化出力をサポートします:
```bash
-multica issue create --help
-multica agent update --help
+multica issue list --output json
+multica agent list --output json
```
-v2 では、各コマンドごとに専用の詳細なリファレンスページを提供する予定です。
+スクリプトでは、ターミナル向けの表を解析せず JSON 出力を使ってください。各コマンドがサポートする出力形式とページネーションのフラグは `multica <command> --help` が正です。
+
+## プロファイルと設定
+
+デフォルトの設定は `~/.multica/config.json` に保存されます。`--profile <name>` を使うと、サーバーアドレス、トークン、デフォルトワークスペース、デーモン状態を別のセットとして分離できます:
+
+```bash
+multica setup self-host --profile staging \
+ --server-url https://api.staging.example.com \
+ --app-url https://app.staging.example.com
+
+multica issue list --profile staging
+```
+
+名前付きプロファイルは `~/.multica/profiles/<name>/config.json` に保存されます。現在の値を確認する:
+
+```bash
+multica config show
+multica config show --profile staging
+```
+
+<Callout type="warning">
+CLI の設定ファイルには、あなたとして Multica にアクセスできるトークンが含まれます。リポジトリにコミットしたり、ログにアップロードしたり、他人と共有したりしないでください。
+</Callout>
+
+## コマンドリファレンス
+
+以下の表は、現在のすべてのトップレベルコマンドを CLI 自身のグループ分けに沿って掲載しています。すべてのコマンドがグローバルフラグ `--server-url`、`--workspace-id`、`--profile`、`--debug` を受け付けます。`--output` はコマンドごとに登録されるフラグで、デフォルトの形式はコマンドによって異なります: `list` 系は表、`get` や `create` 系は多くが JSON です。完全なフラグは `multica <command> --help` が正です。
+
+### Core
+
+| コマンド | サブコマンド | 用途 | 主なフラグ |
+| --- | --- | --- | --- |
+| `issue` | `list` | イシューを一覧 | `--status`、`--priority`、`--assignee`、`--project`、`--metadata`(繰り返し可)、`--limit`、`--offset`、`--sort`、`--full-id` |
+| | `get <id>` | 単一のイシューを表示 | |
+| | `create` | イシューを作成 | `--title`(必須)、`--description` / `--description-stdin` / `--description-file`、`--status`、`--priority`、`--assignee`、`--parent`、`--stage`、`--project`、`--start-date`、`--due-date`、`--attachment`(繰り返し可) |
+| | `update <id>` | イシューのフィールドを更新 | `create` と同系のフィールドに加え `--position` |
+| | `assign <id>` | 割り当てまたは割り当て解除 | `--to`(メンバー、エージェント、スクワッドを名前であいまいマッチ)、`--to-id`、`--unassign` |
+| | `status <id> <status>` | ステータスを変更 | |
+| | `reorder <id>` | カラム内で移動 | |
+| | `search <query>` | イシューを検索 | `--limit`、`--include-closed` |
+| | `children <id>` | サブイシューをステージごとに一覧 | |
+| | `pull-requests <id>` | 関連付けられた PR を一覧 | |
+| | `comment list/add/delete/resolve/unresolve` | コメントを管理 | `add`: `--content` / `--content-stdin` / `--content-file`、`--parent`、`--attachment`;`list`: `--since`、`--thread`、`--tail` |
+| | `subscriber list/add/remove <issue-id>` | 購読者を管理 | `--user`、`--user-id`(省略時は現在のユーザー) |
+| | `label list/add/remove <issue-id>` | イシューのラベルを管理 | |
+| | `metadata list/get/set/delete <issue-id>` | イシューレベルのキー・バリューメタデータを管理 | |
+| | `property list/set/unset <issue-id>` | カスタムプロパティの値を設定 | `set`: `--name`、`--value` |
+| | `runs <issue-id>` | 実行履歴を表示 | `--full-id` |
+| | `run-messages <task-id>` | 1 回の実行のメッセージを表示 | `--since`、`--issue` |
+| | `usage <issue-id>` | 集計されたトークン使用量を表示 | |
+| | `rerun <id>` | 現在の担当者で実行を再キューイング | |
+| | `cancel-task <task-id>` | 実行中またはキュー中のタスクをキャンセル | `--issue` |
+| `project` | `list/get/create/update/delete` | プロジェクトを管理 | |
+| | `status <id> <status>` | プロジェクトのステータスを変更 | |
+| | `resource list/add/update/remove` | プロジェクトの追加リソースを管理 | `--type`、`--url` |
+| `label` | `list/get/create/update/delete` | ワークスペースのラベルを管理 | |
+| `property` | `list/get/create/update/archive/unarchive` | ワークスペースのカスタムプロパティを管理 | `create`: `--name`、`--type`、`--option`(繰り返し可);`list`: `--include-archived`;タイプは作成後に変更できません |
+| `agent` | `list/get/create/update/archive/restore` | エージェントを管理 | `--name`、`--runtime-id`(`create` では必須)、`--instructions`、`--model`、`--thinking-level`、`--mcp-config`、`--permission-mode`、`--max-concurrent-tasks` |
+| | `copy <agent-id>` | 新しいエージェントとして複製。元のエージェントは変更されません | `--name`(デフォルトは元の名前 + ` (copy)`)、`--runtime-id`(別のランタイムへ複製する場合は `--model` の同時指定が必須)、`--no-skills`;`custom_env`、`mcp_config`、`runtime_config` などの機密設定は複製されないため、`create` と同じフラグで再指定してください |
+| | `tasks <id>` | エージェントのタスクを表示 | |
+| | `avatar <id>` | アバターをアップロード | |
+| | `env get/set <agent-id>` | カスタム環境変数の読み書き(owner と admin のみ) | |
+| | `skills list/set/add <agent-id>` | 紐付けられたスキルを管理 | `--skill-ids`(`set` は全置換、`add` は追加) |
+| `autopilot` | `list/get/create/update/delete` | オートパイロットを管理 | `create`: `--title`、`--agent`、`--mode`(いずれも必須)、`--priority`、`--project`、`--subscriber`(繰り返し可) |
+| | `trigger <id>` | 手動で 1 回トリガー | |
+| | `runs <id>` | 実行履歴を表示 | |
+| | `trigger-add/trigger-update/trigger-delete/trigger-rotate-url` | スケジュールと webhook のトリガーを管理 | |
+| `workspace` | `list/get/create/update/switch` | ワークスペースを管理。`switch` は現在のプロファイルのデフォルトワークスペースを設定 | |
+| | `member list/invite <email>` | メンバーの表示と招待 | `invite`: `--role`(member または admin。デフォルトは member) |
+| `repo` | `list/add/remove/checkout` | ワークスペースのリポジトリを管理し、ローカルにチェックアウト | `--url`(繰り返し可);`checkout`: `--ref` |
+| `skill` | `list/get/create/update/delete` | スキルを管理 | |
+| | `import` | URL またはローカルファイルからスキルをインポート | `--url` / `--file`、`--on-conflict`(`fail`、`overwrite`、`rename`、`skip`。デフォルトは `fail`) |
+| | `search <query>` | スキルを検索 | |
+| | `files list/upsert/delete <skill-id>` | スキル内のファイルを管理 | |
+| `squad` | `list/get/create/update/delete` | スクワッドを管理(`delete` はアーカイブ) | |
+| | `member list/add/set-role/remove` | スクワッドのメンバーを管理 | |
+| | `activity <issue-id> <outcome>` | リーダーの評価を記録 | |
+| `chat` | `history`、`thread [id]` | エージェントが現在処理している外部チャットセッションを読み取り | `--limit`、`--before` |
+
+### Runtime
+
+| コマンド | サブコマンド | 用途 | 主なフラグ |
+| --- | --- | --- | --- |
+| `daemon` | `start` | ローカルデーモンを起動 | `--foreground`、`--device-name`、`--runtime-name`、`--poll-interval`、`--heartbeat-interval`、`--agent-timeout`(`0` は上限なし)、`--max-concurrent-tasks`、`--no-auto-update`;それぞれに対応する `MULTICA_*` 環境変数があります |
+| | `stop` / `status` / `restart` | 停止、状態の確認、再起動(`restart` は `start` と同じフラグ) | |
+| | `logs` | デーモンのログを表示 | `--follow`、`--lines` |
+| | `disk-usage` | ローカルのディスク使用量を表示 | `--by-workspace`、`--by-task`、`--top` |
+| `runtime` | `list/usage/activity/update/rename/delete` | ランタイムを表示・管理 | `delete`: `--cascade`(紐付くエージェントをアーカイブし、そのタスクもキャンセル) |
+| | `profile list/create/update/delete` | カスタムランタイムプロファイルを管理 | |
+| | `profile set-path/unset-path <profile-id>` | ローカルの実行ファイルパスを固定(ローカルのみ有効。サーバーには送信されません) | |
+
+### Additional
+
+| コマンド | サブコマンド | 用途 | 主なフラグ |
+| --- | --- | --- | --- |
+| `auth` | `status` / `logout` | 認証状態を確認。`logout` はローカルに保存されたトークンを削除するだけで、サーバー側のトークンは失効させません | |
+| `user` | `profile get/update` | 現在のユーザーのプロフィールを表示・更新 | |
+| `login` | — | ブラウザでサインインし、すべてのワークスペースを自動設定 | `--token`(値なしで渡すとターミナルで対話的に入力) |
+| `setup` | `cloud`(デフォルト)、`self-host` | サーバーアドレスを保存し、サインインを完了してデーモンを起動 | `self-host`: `--server-url`、`--app-url`、`--port`、`--frontend-port` |
+| `attachment` | `download <attachment-id>`、`upload <path>` | 添付ファイルのダウンロードとアップロード | `download`: `--output-dir`;`upload`: `--task` |
+| `config` | `show`、`set <key> <value>` | 現在のプロファイルのローカル設定を表示・編集 | 優先順位: コマンドラインフラグ > 環境変数 > `config.json` > 組み込みデフォルト。空文字列を設定すると値をクリア |
+| `update` | — | CLI を最新バージョンに更新 | |
+| `version` | — | バージョン情報を表示 | `--output`(`text` または `json`) |
## 次のステップ
-- [認証とトークン](/auth-tokens) — PAT vs. JWT vs. デーモントークン
-- [デーモンとランタイム](/daemon-runtimes) — `daemon` コマンドが内部でどう動作するか
-- [エージェントの作成と構成](/agents-create) — `multica agent create` のすべてのオプション
+- [認証とトークン](/auth-tokens) — PAT の作成、更新、失効。
+- [トラブルシューティング](/troubleshooting) — コマンドのエラーと、いつまでも開始しないタスクの診断。
+- [エージェントの作成と設定](/agents-create) — `agent create` 各フィールドの完全な意味。
diff --git a/apps/docs/content/docs/cli.ko.mdx b/apps/docs/content/docs/cli.ko.mdx
index 7990279da9..f499c1369b 100644
--- a/apps/docs/content/docs/cli.ko.mdx
+++ b/apps/docs/content/docs/cli.ko.mdx
@@ -1,178 +1,303 @@
---
-title: CLI 명령어 레퍼런스
-description: "모든 최상위 Multica CLI 명령어를 한 페이지로 정리한 개요입니다. 전체 사용법은 `multica <command> --help`를 실행하세요."
+title: CLI 사용
+description: Multica CLI를 설치하고 로그인해 터미널에서 워크스페이스, 이슈, 에이전트, 런타임을 관리합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica CLI는 Web UI에서 할 수 있는 거의 모든 작업을 그대로 제공합니다([이슈](/issues) 생성, [에이전트](/agents) 할당, [데몬](/daemon-runtimes) 시작 등). 이 페이지는 모든 최상위 명령어를 한 줄 설명과 함께 나열합니다. 전체 플래그와 예제는 `multica <command> --help`를 실행하세요.
+Multica CLI는 로컬 런타임을 연결할 뿐 아니라 터미널에서 워크스페이스, 이슈, 에이전트, 자동화를 관리할 수 있습니다. 이 페이지에서는 자주 사용하는 경로를 설명합니다. 현재 버전에서 지원하는 인수는 항상 명령 자체의 `--help`를 기준으로 확인하세요.
-## 인증하기
+## 설치
-CLI를 처음 사용할 때 이 명령을 실행해 **개인 액세스 토큰(personal access token, PAT)**을 발급받으세요:
+**macOS / Linux**
```bash
-multica login
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-브라우저가 자동으로 열립니다. 웹 앱에서 승인하면 CLI가 PAT(`mul_` 접두사)를 `~/.multica/config.json`에 저장합니다. 이후 모든 명령은 이 PAT로 인증됩니다.
+Homebrew가 설치되어 있다면 다음 명령도 사용할 수 있습니다.
-<Callout type="tip">
-CI나 headless 환경에서는 브라우저 플로우를 건너뛰세요. 웹 앱의 **설정 → API 토큰**에서 PAT를 만든 뒤 `multica login --token <mul_...>`로 직접 전달하면 됩니다.
-</Callout>
+```bash
+brew install multica-ai/tap/multica
+```
-토큰 유형 간의 차이는 [인증과 토큰](/auth-tokens)을 참고하세요.
+**Windows PowerShell**
-## 인증과 설정
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-| 명령어 | 용도 |
-|---|---|
-| `multica login` | 로그인하고 PAT 저장 |
-| `multica auth status` | 현재 로그인 상태, 사용자, 워크스페이스 표시 |
-| `multica auth logout` | 로컬 PAT 삭제 |
-| `multica setup cloud` | Multica Cloud용 원샷 설정(로그인 + 데몬 설치) |
-| `multica setup self-host` | 자체 호스팅 백엔드용 원샷 설정 |
+설치 성공 여부를 확인합니다.
-## 워크스페이스와 멤버
+```bash
+multica version
+```
-| 명령어 | 용도 |
-|---|---|
-| `multica workspace list` | 접근할 수 있는 모든 워크스페이스 나열 |
-| `multica workspace create --name "..." --slug "..." [--issue-prefix "..."] [--description "..."] [--context "..."]` | 워크스페이스 생성(생성자가 owner가 됩니다). `--name`과 `--slug`는 필수이며 slug는 생성 후 변경할 수 없습니다. 현재 워크스페이스는 전환되지 않습니다. |
-| `multica workspace get <slug>` | 워크스페이스 하나의 상세 정보 표시 |
-| `multica workspace member list` | 현재 워크스페이스의 멤버 나열 |
-| `multica workspace update <id> --name "..." [--description "..."] [--context "..."] [--issue-prefix "..."]` | 워크스페이스 메타데이터 업데이트(admin/owner). 긴 필드는 `--description-stdin` / `--context-stdin`을 사용할 수 있습니다. |
+## 처음 연결
-## 이슈와 프로젝트
+Multica Cloud 연결:
-<Callout type="info">
-`list` 계열 명령(`multica issue list`, `autopilot list`, `project list` 등)은 기본적으로 짧고 **바로 복사해 붙여 넣을 수 있는** ID를 출력합니다. 이슈는 `MUL-123` 같은 이슈 키이고, 나머지 리소스는 짧은 UUID 접두사입니다. 아래 후속 명령의 `<id>` 인자는 짧은 ID와 전체 UUID를 모두 받으므로, 일반적인 흐름은 `multica issue list` → 키 복사 → `multica issue get MUL-123`입니다. 정식 UUID가 필요할 때는 `list` 명령에 `--full-id`를 전달하세요.
-</Callout>
+```bash
+multica setup
+```
+
+자체 호스팅 인스턴스 연결:
+
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
+
+`setup`은 서비스 주소를 저장하고 브라우저를 열어 로그인을 완료한 뒤 데몬을 시작합니다. 완료 후 다음을 확인하세요.
+
+```bash
+multica auth status
+multica daemon status
+```
+
+다른 설정을 덮어쓰지 않고 로그인만 다시 하려면 `multica login`을 실행합니다. 브라우저가 없는 환경에서는 Web 설정에서 개인 액세스 토큰을 먼저 만든 뒤 다음을 입력합니다.
+
+```bash
+multica login --token
+```
+
+명령이 터미널에서 token 붙여넣기를 요청하므로 전체 값이 shell history에 남지 않습니다.
+
+## 워크스페이스 선택
+
+기본 워크스페이스를 나열하고 전환합니다.
+
+```bash
+multica workspace list
+multica workspace switch <slug>
+```
+
+이후 명령은 이 워크스페이스를 사용합니다. 한 번의 명령에서 `--workspace-id`로 임시 덮어쓸 수 있고 `MULTICA_WORKSPACE_ID`를 설정할 수도 있습니다.
+
+멤버 초대:
+
+```bash
+multica workspace member invite [email protected]
+multica workspace member invite [email protected] --role admin
+```
+
+## 자주 사용하는 이슈 작업
+
+```bash
+# 확인 및 검색
+multica issue list
+multica issue get MUL-123
+multica issue search "로그인 실패"
+
+# 생성 및 수정
+multica issue create --title "로그인 실패 수정"
+multica issue status MUL-123 in_progress
+multica issue assign MUL-123 --to "Backend Agent"
+
+# 댓글 및 실행 기록
+multica issue comment list MUL-123
+multica issue comment add MUL-123 --content "회귀 테스트를 먼저 확인해 주세요"
+multica issue runs MUL-123
+```
+
+긴 설명이나 댓글은 stdin에서 읽어 줄바꿈과 따옴표 처리를 피할 수 있습니다.
+
+```bash
+multica issue create --title "업그레이드 안내" --description-stdin < notes.md
+multica issue comment add MUL-123 --content-stdin < review.md
+```
-| 명령어 | 용도 |
-|---|---|
-| `multica issue list` | 이슈 나열(복사해 붙여 넣을 수 있는 이슈 키 출력) |
-| `multica issue get <id>` | 단일 이슈 표시(이슈 키 또는 UUID를 받음) |
-| `multica issue create --title "..."` | 새 이슈 생성 |
-| `multica issue update <id> ...` | 이슈 업데이트(상태, 우선순위, 담당자 등) |
-| `multica issue assign <id> --to <name>` | 멤버, 에이전트, 또는 스쿼드에 할당(에이전트에 할당하면 실행이 트리거됨) |
-| `multica issue status <id> <status>` | 상태 변경 단축 명령 |
-| `multica issue search <query>` | 키워드 검색 |
-| `multica issue children <id>` | 하위 이슈를 stage별로 나열 |
-| `multica issue pull-requests <id>` | 연결된 pull request와 상태 나열 |
-| `multica issue runs <id>` | 이슈의 에이전트 실행 표시 |
-| `multica issue run-messages <task-id>` | 한 실행의 메시지 표시 |
-| `multica issue usage <id>` | 이슈의 집계 token 사용량 표시 |
-| `multica issue rerun <id>` | 이슈의 현재 에이전트 담당자에게 새 작업을 다시 큐에 넣기 |
-| `multica issue cancel-task <task-id>` | 대기 중이거나 실행 중인 작업 취소 |
-| `multica issue comment <id> ...` | 중첩: 댓글 보기 / 작성 |
-| `multica issue comment resolve/unresolve <comment-id>` | 댓글 스레드를 해결 / 미해결로 표시 |
-| `multica issue subscriber <id> ...` | 중첩: 구독 / 구독 취소 |
-| `multica issue metadata <id> ...` | 중첩: 이슈 metadata 읽기 / 쓰기 |
-| `multica issue label <id> ...` | 중첩: 이슈의 label 관리 |
-| `multica project list/get/create/update/delete/status` | 프로젝트 CRUD |
-| `multica label list/create/update/delete` | 워크스페이스 label CRUD |
+특정 실행의 메시지를 확인하거나 태스크를 중지합니다.
+
+```bash
+multica issue run-messages <task-id> --issue MUL-123
+multica issue cancel-task <task-id> --issue MUL-123
+```
## 에이전트와 스킬
-| 명령어 | 용도 |
-|---|---|
-| `multica agent list` | 워크스페이스의 에이전트 나열 |
-| `multica agent get <slug>` | 에이전트의 구성 표시 |
-| `multica agent create ...` | 에이전트 생성 |
-| `multica agent update <slug> ...` | 에이전트 업데이트 |
-| `multica agent archive <slug>` | 보관 |
-| `multica agent restore <slug>` | 보관된 에이전트 복원 |
-| `multica agent tasks <slug>` | 에이전트의 작업 기록 표시 |
-| `multica agent avatar <slug>` | 에이전트 아바타 업로드 |
-| `multica agent env <slug> ...` | 에이전트 custom environment variables 읽기 / 교체 |
-| `multica agent skills ...` | 중첩: 스킬 연결 / 분리 |
-| `multica skill list/get/create/update/delete` | 스킬 CRUD |
-| `multica skill import ...` | GitHub, ClawHub, 또는 로컬 기기에서 스킬 가져오기 |
-| `multica skill files ...` | 중첩: 스킬의 파일 관리 |
-
-### 스킬 가져오기 충돌
-
-`multica skill import --url <url>`의 기본값은 `--on-conflict fail`입니다. 같은 이름의 스킬이 이미 있으면 명령은 구조화된 `conflict` 결과로 종료되며 워크스페이스를 변경하지 않습니다.
-
-기존 스킬을 만든 사용자이고, 스킬 ID와 에이전트 연결은 유지한 채 내용을 바꾸려면 `--on-conflict overwrite`를 사용하세요. 기존 스킬을 그대로 두고 복사본을 가져오려면 `--on-conflict rename`을 사용하면 `-2` 같은 접미사가 자동으로 붙습니다. 같은 이름의 항목을 그냥 건너뛰려면 `--on-conflict skip`을 사용하세요.
-
-```bash
-multica skill import --url https://skills.sh/acme/repo/review-helper
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict overwrite
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict rename
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict skip
-```
-
-## 스쿼드
-
-| 명령어 | 용도 |
-|---|---|
-| `multica squad list` | 워크스페이스의 스쿼드 나열 |
-| `multica squad get <id>` | 단일 스쿼드 표시 |
-| `multica squad create --name "..." --leader <agent>` | 스쿼드 생성(owner / admin) |
-| `multica squad update <id> ...` | 이름, 설명, 지침, 리더, 또는 아바타 업데이트 |
-| `multica squad delete <id>` | 보관(소프트 삭제) — 할당된 이슈를 리더에게 이관 |
-| `multica squad member list/add/remove/set-role <squad-id>` | 스쿼드 멤버 관리 및 역할 직접 업데이트 |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | 스쿼드 리더 에이전트가 매 턴마다 평가를 기록할 때 사용 |
-
-전체 모델은 [스쿼드](/squads)를 참고하세요.
-
-## 오토파일럿
-
-| 명령어 | 용도 |
-|---|---|
-| `multica autopilot list` | 워크스페이스의 모든 오토파일럿 나열 |
-| `multica autopilot get <id>` | 단일 오토파일럿 표시 |
-| `multica autopilot create ...` | 오토파일럿 생성 |
-| `multica autopilot update <id> ...` | 업데이트 |
-| `multica autopilot delete <id>` | 삭제 |
-| `multica autopilot runs <id>` | 실행 기록 표시 |
-| `multica autopilot trigger <id>` | 수동으로 실행 트리거 |
-| `multica autopilot trigger-add/update/delete <id>` | schedule 또는 webhook trigger 관리 |
-| `multica autopilot trigger-rotate-url <id> <trigger-id>` | webhook trigger URL 회전 |
-
-`multica autopilot create/update`는 `create_issue` 모드 autopilot이 만드는 이슈의 기본 구독자를 설정하는 `--subscriber`도 받습니다. `update`에서는 `--clear-subscribers`로 제거할 수 있습니다.
+```bash
+multica agent list
+multica agent get <agent-id>
+multica agent create --help
+multica agent update <agent-id> --help
+
+multica skill list
+multica skill get <skill-id>
+multica skill import --url <skill-url>
+multica agent skills add <agent-id> --skill-ids <skill-id>
+```
+
+가져올 때 같은 이름의 스킬이 있으면 기본적으로 중지하고 기존 내용을 수정하지 않습니다. 의도에 맞는 방식을 선택하세요.
+
+```bash
+multica skill import --url <skill-url> --on-conflict overwrite
+multica skill import --url <skill-url> --on-conflict rename
+multica skill import --url <skill-url> --on-conflict skip
+```
+
+`overwrite`는 스킬 생성자만 사용할 수 있으며 기존 ID와 에이전트 연결을 유지합니다.
## 데몬과 런타임
-| 명령어 | 용도 |
-|---|---|
-| `multica daemon start` | 데몬 시작(기본은 백그라운드; `--foreground`를 추가하면 포그라운드 실행) |
-| `multica daemon stop` | 데몬 중지 |
-| `multica daemon restart` | 데몬 재시작 |
-| `multica daemon status` | 데몬의 온라인 여부와 동시 실행 수 확인 |
-| `multica daemon logs` | 데몬 로그 보기 |
-| `multica runtime list` | 현재 워크스페이스의 런타임 나열 |
-| `multica runtime usage` | 리소스 사용량 표시 |
-| `multica runtime activity` | 최근 활동 로그 |
-| `multica runtime update <id> ...` | 런타임에서 CLI 업데이트 시작 |
-| `multica runtime delete <id> [--cascade]` | 런타임 삭제, 필요하면 연결된 에이전트도 보관 |
-| `multica runtime profile ...` | 사용자 지정 runtime profile과 로컬 경로 override 관리 |
+```bash
+multica daemon start
+multica daemon stop
+multica daemon restart
+multica daemon status --output json
+multica daemon logs --follow
+
+multica runtime list
+multica runtime rename <runtime-id> "Office Mac"
+multica runtime usage <runtime-id>
+multica runtime activity <runtime-id>
+```
+
+활성 에이전트가 계속 연결된 런타임을 삭제하면 명령이 기본적으로 거부됩니다. `multica runtime delete <id> --cascade`는 연결된 에이전트도 함께 보관하고 활성 태스크를 취소합니다.
-## 기타
+실행 메커니즘과 사용자 지정 profile은 [데몬과 런타임](/daemon-runtimes)을 참고하세요.
-| 명령어 | 용도 |
-|---|---|
-| `multica repo checkout <url>` | 에이전트가 사용할 수 있도록 리포지토리를 로컬에 클론 |
-| `multica config` | 로컬 CLI 구성 보기 또는 편집 |
-| `multica version` | CLI 버전 출력 |
-| `multica update` | CLI를 최신 릴리스로 업그레이드 |
-| `multica attachment download <id>` | 이슈나 댓글에서 첨부 파일 다운로드 |
+## 명령 개요
-## 전체 플래그 확인하기
+| 명령 | 용도 |
+| --- | --- |
+| `issue` | 이슈 생성, 업데이트, 할당, 검색. 댓글, 구독, 라벨, 속성, 실행 기록 관리 |
+| `project` | 프로젝트와 프로젝트 리소스 관리 |
+| `label`, `property` | 워크스페이스 라벨과 사용자 지정 속성 관리 |
+| `agent`, `skill`, `squad` | 에이전트, 스킬, 스쿼드 관리 |
+| `autopilot` | 자동화, 트리거, 실행 기록 관리 |
+| `workspace` | 워크스페이스 생성, 확인, 전환 및 멤버 초대 |
+| `repo` | 워크스페이스 저장소 관리 및 로컬 checkout |
+| `daemon`, `runtime` | 로컬 데몬 시작 및 중지, 런타임 확인 및 관리 |
+| `attachment` | 첨부 파일 업로드 또는 다운로드 |
+| `user profile` | 현재 사용자 profile 확인 또는 업데이트 |
+| `auth`, `login`, `setup` | 로그인, 인증 상태 확인, 연결 초기화 |
+| `config` | 현재 CLI profile의 로컬 설정 확인 또는 변경 |
+| `update`, `version` | CLI 업데이트 또는 버전 확인 |
-모든 명령은 `--help`를 지원합니다:
+`multica chat`은 **에이전트가 현재 처리 중인 외부 채팅 대화**를 읽으며 주로 채팅 연동의 에이전트가 사용합니다. 워크스페이스의 임의 대화를 탐색하는 일반 명령이 아닙니다.
+
+## ID와 출력 형식
+
+이슈에는 `MUL-123` 같은 key 또는 전체 UUID를 사용하며 UUID 짧은 접두사는 허용하지 않습니다.
+
+다른 리소스의 `list` 명령은 일반적으로 복사 가능한 짧은 ID를 표시하고 `--full-id`로 전체 UUID를 출력할 수 있습니다. 짧은 ID가 고유하지 않으면 CLI가 더 많은 글자를 입력하거나 전체 UUID를 사용하도록 요청합니다. 실행 태스크의 짧은 ID에는 `--issue`로 소속 이슈도 지정해야 합니다.
+
+많은 명령이 구조화 출력을 지원합니다.
```bash
-multica issue create --help
-multica agent update --help
+multica issue list --output json
+multica agent list --output json
```
-v2에서는 각 명령마다 전용 상세 레퍼런스 페이지를 제공할 예정입니다.
+스크립트에서는 터미널용 표를 parsing하지 말고 JSON 출력을 사용하세요. 각 명령이 지원하는 출력 형식과 pagination 인수는 `multica <command> --help`를 기준으로 확인합니다.
+
+## Profile과 설정
+
+기본 설정은 `~/.multica/config.json`에 저장됩니다. `--profile <name>`을 사용하면 별도의 서비스 주소, token, 기본 워크스페이스, 데몬 상태를 격리할 수 있습니다.
+
+```bash
+multica setup self-host --profile staging \
+ --server-url https://api.staging.example.com \
+ --app-url https://app.staging.example.com
+
+multica issue list --profile staging
+```
+
+이름 있는 profile은 `~/.multica/profiles/<name>/config.json`에 저장됩니다. 현재 값을 확인합니다.
+
+```bash
+multica config show
+multica config show --profile staging
+```
+
+<Callout type="warning">
+CLI 설정 파일에는 사용자를 대신해 Multica에 접근할 수 있는 token이 들어 있습니다. 저장소에 commit하거나 로그에 올리거나 다른 사람과 공유하지 마세요.
+</Callout>
+
+## 명령 참조
+
+다음 표는 현재의 모든 최상위 명령을 CLI 자체 그룹 순서로 정리합니다. 모든 명령은 전역 flag `--server-url`, `--workspace-id`, `--profile`, `--debug`를 허용합니다. `--output`은 명령별로 등록되는 flag이며 기본 형식은 명령에 따라 다릅니다. `list` 계열은 기본적으로 표를 사용하고 `get`, `create` 계열은 주로 JSON을 사용합니다. 전체 인수는 `multica <command> --help`를 기준으로 확인하세요.
+
+### Core
+
+| 명령 | 하위 명령 | 용도 | 주요 flag |
+| --- | --- | --- | --- |
+| `issue` | `list` | 이슈 목록 | `--status`, `--priority`, `--assignee`, `--project`, `--metadata`(반복 가능), `--limit`, `--offset`, `--sort`, `--full-id` |
+| | `get <id>` | 이슈 하나 확인 | |
+| | `create` | 이슈 생성 | `--title`(필수), `--description` / `--description-stdin` / `--description-file`, `--status`, `--priority`, `--assignee`, `--parent`, `--stage`, `--project`, `--start-date`, `--due-date`, `--attachment`(반복 가능) |
+| | `update <id>` | 이슈 필드 업데이트 | `create`와 같은 종류의 필드에 `--position` 추가 |
+| | `assign <id>` | 할당 또는 할당 해제 | `--to`(이름으로 멤버, 에이전트, 스쿼드 fuzzy match), `--to-id`, `--unassign` |
+| | `status <id> <status>` | 상태 변경 | |
+| | `reorder <id>` | 열 안에서 이동 | |
+| | `search <query>` | 이슈 검색 | `--limit`, `--include-closed` |
+| | `children <id>` | 단계별로 묶은 하위 이슈 목록 | |
+| | `pull-requests <id>` | 연결된 PR 목록 | |
+| | `comment list/add/delete/resolve/unresolve` | 댓글 관리 | `add`: `--content` / `--content-stdin` / `--content-file`, `--parent`, `--attachment`. `list`: `--since`, `--thread`, `--tail` |
+| | `subscriber list/add/remove <issue-id>` | 구독자 관리 | `--user`, `--user-id`(생략하면 현재 사용자) |
+| | `label list/add/remove <issue-id>` | 이슈 라벨 관리 | |
+| | `metadata list/get/set/delete <issue-id>` | 이슈 수준 key-value metadata 관리 | |
+| | `property list/set/unset <issue-id>` | 사용자 지정 속성 값 설정 | `set`: `--name`, `--value` |
+| | `runs <issue-id>` | 실행 기록 확인 | `--full-id` |
+| | `run-messages <task-id>` | 단일 실행 메시지 확인 | `--since`, `--issue` |
+| | `usage <issue-id>` | 집계 token 사용량 확인 | |
+| | `rerun <id>` | 현재 할당을 기준으로 다시 큐에 넣어 실행 | |
+| | `cancel-task <task-id>` | 실행 중 또는 큐 대기 중인 태스크 취소 | `--issue` |
+| `project` | `list/get/create/update/delete` | 프로젝트 관리 | |
+| | `status <id> <status>` | 프로젝트 상태 변경 | |
+| | `resource list/add/update/remove` | 프로젝트 추가 리소스 관리 | `--type`, `--url` |
+| `label` | `list/get/create/update/delete` | 워크스페이스 라벨 관리 | |
+| `property` | `list/get/create/update/archive/unarchive` | 워크스페이스 사용자 지정 속성 관리 | `create`: `--name`, `--type`, `--option`(반복 가능). `list`: `--include-archived`. 유형은 생성 후 변경 불가 |
+| `agent` | `list/get/create/update/archive/restore` | 에이전트 관리 | `--name`, `--runtime-id`(`create`에서 필수), `--instructions`, `--model`, `--thinking-level`, `--mcp-config`, `--permission-mode`, `--max-concurrent-tasks` |
+| | `copy <agent-id>` | 원래 에이전트에 영향 없이 새 에이전트로 복사 | `--name`(기본값은 원래 이름 + ` (copy)`), `--runtime-id`(다른 런타임으로 복사할 때 `--model`도 필수), `--no-skills`. `custom_env`, `mcp_config`, `runtime_config` 같은 기밀 설정은 복사되지 않으며 `create`와 같은 flag로 다시 제공해야 함 |
+| | `tasks <id>` | 에이전트 태스크 확인 | |
+| | `avatar <id>` | 아바타 업로드 | |
+| | `env get/set <agent-id>` | 사용자 지정 환경 변수 읽기/쓰기(owner와 admin만) | |
+| | `skills list/set/add <agent-id>` | 연결된 스킬 관리 | `--skill-ids`(`set`은 전체 교체, `add`는 증분 추가) |
+| `autopilot` | `list/get/create/update/delete` | 자동화 관리 | `create`: `--title`, `--agent`, `--mode`(모두 필수), `--priority`, `--project`, `--subscriber`(반복 가능) |
+| | `trigger <id>` | 수동으로 한 번 트리거 | |
+| | `runs <id>` | 실행 기록 확인 | |
+| | `trigger-add/trigger-update/trigger-delete/trigger-rotate-url` | 일정 및 webhook 트리거 관리 | |
+| `workspace` | `list/get/create/update/switch` | 워크스페이스 관리. `switch`는 현재 profile의 기본 워크스페이스 설정 | |
+| | `member list/invite <email>` | 멤버 확인 및 초대 전송 | `invite`: `--role`(member 또는 admin, 기본 member) |
+| `repo` | `list/add/remove/checkout` | 워크스페이스 저장소 관리 및 로컬 checkout | `--url`(반복 가능). `checkout`: `--ref` |
+| `skill` | `list/get/create/update/delete` | 스킬 관리 | |
+| | `import` | URL 또는 로컬 파일에서 스킬 가져오기 | `--url` / `--file`, `--on-conflict`(`fail`, `overwrite`, `rename`, `skip`, 기본 `fail`) |
+| | `search <query>` | 스킬 검색 | |
+| | `files list/upsert/delete <skill-id>` | 스킬 내부 파일 관리 | |
+| `squad` | `list/get/create/update/delete` | 스쿼드 관리(`delete`는 보관) | |
+| | `member list/add/set-role/remove` | 스쿼드 멤버 관리 | |
+| | `activity <issue-id> <outcome>` | 리더 평가 기록 | |
+| `chat` | `history`, `thread [id]` | 에이전트가 현재 처리 중인 외부 채팅 대화 읽기 | `--limit`, `--before` |
+
+### Runtime
+
+| 명령 | 하위 명령 | 용도 | 주요 flag |
+| --- | --- | --- | --- |
+| `daemon` | `start` | 로컬 데몬 시작 | `--foreground`, `--device-name`, `--runtime-name`, `--poll-interval`, `--heartbeat-interval`, `--agent-timeout`(`0`은 상한 없음), `--max-concurrent-tasks`, `--no-auto-update`. 모두 대응하는 `MULTICA_*` 환경 변수가 있음 |
+| | `stop` / `status` / `restart` | 중지, 상태 확인, 다시 시작(`restart`와 `start`의 flag가 같음) | |
+| | `logs` | 데몬 로그 확인 | `--follow`, `--lines` |
+| | `disk-usage` | 로컬 디스크 사용량 확인 | `--by-workspace`, `--by-task`, `--top` |
+| `runtime` | `list/usage/activity/update/rename/delete` | 런타임 확인 및 관리 | `delete`: `--cascade`(연결된 에이전트도 보관하고 해당 태스크 취소) |
+| | `profile list/create/update/delete` | 사용자 지정 런타임 profile 관리 | |
+| | `profile set-path/unset-path <profile-id>` | 로컬 실행 파일 경로 고정(로컬에만 적용되고 서버에 업로드되지 않음) | |
+
+### Additional
+
+| 명령 | 하위 명령 | 용도 | 주요 flag |
+| --- | --- | --- | --- |
+| `auth` | `status` / `logout` | 인증 상태 확인. `logout`은 로컬에 저장된 token만 삭제하고 서버 token은 취소하지 않음 | |
+| `user` | `profile get/update` | 현재 사용자 profile 확인 또는 업데이트 | |
+| `login` | — | 브라우저에서 로그인하고 모든 워크스페이스 자동 설정 | `--token`(값을 함께 쓰지 않으면 터미널에서 대화형 입력) |
+| `setup` | `cloud`(기본), `self-host` | 서비스 주소 저장, 로그인 완료, 데몬 시작 | `self-host`: `--server-url`, `--app-url`, `--port`, `--frontend-port` |
+| `attachment` | `download <attachment-id>`, `upload <path>` | 첨부 파일 다운로드 또는 업로드 | `download`: `--output-dir`. `upload`: `--task` |
+| `config` | `show`, `set <key> <value>` | 현재 profile의 로컬 설정 확인 또는 변경 | 우선순위: 명령줄 flag > 환경 변수 > `config.json` > 내장 기본값. 빈 문자열로 설정하면 삭제 |
+| `update` | — | CLI를 최신 버전으로 업데이트 | |
+| `version` | — | 버전 정보 확인 | `--output`(`text` 또는 `json`) |
## 다음 단계
-- [인증과 토큰](/auth-tokens) — PAT vs. JWT vs. 데몬 토큰
-- [데몬과 런타임](/daemon-runtimes) — `daemon` 명령이 내부적으로 동작하는 방식
-- [에이전트 생성과 구성](/agents-create) — `multica agent create`의 모든 옵션
+- [인증과 토큰](/auth-tokens) — PAT 생성, 갱신, 취소를 알아봅니다.
+- [문제 해결](/troubleshooting) — 명령 오류와 태스크가 시작되지 않는 문제를 해결합니다.
+- [에이전트 생성 및 설정](/agents-create) — `agent create` 각 필드의 전체 의미를 알아봅니다.
diff --git a/apps/docs/content/docs/cli.mdx b/apps/docs/content/docs/cli.mdx
index f6b059386a..59f0cac6f5 100644
--- a/apps/docs/content/docs/cli.mdx
+++ b/apps/docs/content/docs/cli.mdx
@@ -1,186 +1,303 @@
---
-title: CLI command reference
-description: One-page overview of every top-level Multica CLI command. For full usage, run `multica <command> --help`.
+title: Using the CLI
+description: Install and log in to the Multica CLI, and manage workspaces, issues, agents, and runtimes from the terminal.
---
import { Callout } from "fumadocs-ui/components/callout";
-The Multica CLI mirrors almost everything the Web UI can do (create [issues](/issues), assign [agents](/agents), start the [daemon](/daemon-runtimes), and more). This page lists every top-level command with a one-line description. For the full set of flags and examples, run `multica <command> --help`.
+The Multica CLI both connects local runtimes and manages workspaces, issues, agents, and automations from the terminal. This page covers the common paths; the flags your installed version supports are always defined by each command's own `--help`.
-## Getting authenticated
+## Installation
-Run this the first time you use the CLI to obtain a **personal access token (PAT)**:
+**macOS / Linux**
```bash
-multica login
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-Your browser opens automatically. After you approve in the web app, the CLI saves the PAT (prefixed with `mul_`) to `~/.multica/config.json`. Every subsequent command authenticates with that PAT.
+With Homebrew installed, you can also run:
-<Callout type="tip">
-For CI or headless environments, skip the browser flow: create a PAT in the web app under **Settings → Personal Access Tokens**, then run `multica login --token <mul_...>` to supply it directly.
-</Callout>
+```bash
+brew install multica-ai/tap/multica
+```
-For the difference between token types, see [Authentication and tokens](/auth-tokens).
+**Windows PowerShell**
-## Auth and setup
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-| Command | Purpose |
-|---|---|
-| `multica login` | Log in and save a PAT |
-| `multica auth status` | Show current login status, user, and workspace |
-| `multica auth logout` | Clear the local PAT |
-| `multica setup cloud` | One-shot setup for Multica Cloud (login + install daemon) |
-| `multica setup self-host` | One-shot setup for a self-hosted backend |
+Confirm the install:
-## Workspaces and members
+```bash
+multica version
+```
-| Command | Purpose |
-|---|---|
-| `multica workspace list` | List every workspace you can access |
-| `multica workspace create --name "..." --slug "..." [--issue-prefix "..."] [--description "..."] [--context "..."]` | Create a workspace (you become its owner). `--name` and `--slug` are required; the slug is permanent. Does not switch your current workspace. |
-| `multica workspace get <slug>` | Show details for one workspace |
-| `multica workspace member list` | List members of the current workspace |
-| `multica workspace update <id> --name "..." [--description "..."] [--context "..."] [--issue-prefix "..."]` | Update workspace metadata (admin/owner). Long fields accept `--description-stdin` / `--context-stdin`. |
+## First connection
-## Issues and projects
+Connect to Multica Cloud:
-<Callout type="info">
-`list` commands (`multica issue list`, `autopilot list`, `project list`, etc.) print short, copy-paste-ready IDs by default — issue keys like `MUL-123` for issues, short UUID prefixes for the rest. The `<id>` argument on the follow-up commands below accepts either the short ID or the full UUID, so the typical flow is `multica issue list` → copy the key → `multica issue get MUL-123`. Pass `--full-id` to a list command when you need the canonical UUID.
-</Callout>
+```bash
+multica setup
+```
-| Command | Purpose |
-|---|---|
-| `multica issue list` | List issues (prints copy-paste-ready issue keys) |
-| `multica issue get <id>` | Show a single issue (accepts an issue key or a UUID) |
-| `multica issue create --title "..."` | Create a new issue |
-| `multica issue update <id> ...` | Update an issue (status, priority, assignee, etc.) |
-| `multica issue assign <id> --to <name>` | Assign to a member, agent, or squad (assigning to an agent triggers a run) |
-| `multica issue status <id> <status>` | Shortcut to change status |
-| `multica issue search <query>` | Keyword search |
-| `multica issue children <id>` | List sub-issues grouped by stage |
-| `multica issue pull-requests <id>` | List linked pull requests and their status |
-| `multica issue runs <id>` | Show agent runs on an issue |
-| `multica issue run-messages <task-id>` | Show messages for one execution |
-| `multica issue usage <id>` | Show aggregated token usage for an issue |
-| `multica issue rerun <id>` | Re-enqueue a fresh task for the issue's current agent assignee |
-| `multica issue cancel-task <task-id>` | Cancel a queued or running task |
-| `multica issue comment <id> ...` | Nested: view / post comments |
-| `multica issue comment resolve/unresolve <comment-id>` | Mark a comment thread resolved or unresolved |
-| `multica issue subscriber <id> ...` | Nested: subscribe / unsubscribe |
-| `multica issue metadata <id> ...` | Nested: read / write issue metadata |
-| `multica issue label <id> ...` | Nested: manage labels on an issue |
-| `multica project list/get/create/update/delete/status` | Project CRUD |
-| `multica label list/create/update/delete` | Workspace label CRUD |
+Connect to a self-hosted instance:
-## Agents and skills
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-| Command | Purpose |
-|---|---|
-| `multica agent list` | List the workspace's agents |
-| `multica agent get <slug>` | Show an agent's configuration |
-| `multica agent create ...` | Create an agent |
-| `multica agent update <slug> ...` | Update an agent |
-| `multica agent archive <slug>` | Archive |
-| `multica agent restore <slug>` | Restore an archived agent |
-| `multica agent tasks <slug>` | Show an agent's task history |
-| `multica agent avatar <slug>` | Upload an agent avatar |
-| `multica agent env <slug> ...` | Read or replace an agent's custom environment variables |
-| `multica agent skills ...` | Nested: attach / detach skills |
-| `multica skill list/get/create/update/delete` | Skill CRUD |
-| `multica skill import ...` | Import a skill from GitHub, ClawHub, or the local machine |
-| `multica skill files ...` | Nested: manage a skill's files |
-
-### Skill import conflicts
-
-`multica skill import --url <url>` defaults to `--on-conflict fail`. If a skill
-with the same name already exists, the command exits with a structured
-`conflict` result and does not change the workspace.
-
-Use `--on-conflict overwrite` when you created the existing skill and want to
-replace its content while preserving its ID and agent bindings. Use
-`--on-conflict rename` to import a copy with an automatic suffix such as `-2`.
-Use `--on-conflict skip` to leave the existing skill untouched and report
-`skipped`.
-
-```bash
-multica skill import --url https://skills.sh/acme/repo/review-helper
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict overwrite
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict rename
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict skip
-```
-
-## Squads
+`setup` saves the server address, opens a browser to complete sign-in, and starts the daemon. When it finishes, check:
-| Command | Purpose |
-|---|---|
-| `multica squad list` | List squads in the workspace |
-| `multica squad get <id>` | Show a single squad |
-| `multica squad create --name "..." --leader <agent>` | Create a squad (owner / admin) |
-| `multica squad update <id> ...` | Update name, description, instructions, leader, or avatar |
-| `multica squad delete <id>` | Archive (soft-delete) — transfers assigned issues to the leader |
-| `multica squad member list/add/remove/set-role <squad-id>` | Manage squad members and update roles in place |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | Used by squad leader agents to record an evaluation per turn |
+```bash
+multica auth status
+multica daemon status
+```
-See [Squads](/squads) for the full model.
+If you only need to sign in again without overwriting other configuration, run `multica login`. On a machine without a browser, create a personal access token in the web settings first, then enter it with:
-## Autopilots
+```bash
+multica login --token
+```
-| Command | Purpose |
-|---|---|
-| `multica autopilot list` | List every autopilot in the workspace |
-| `multica autopilot get <id>` | Show a single autopilot |
-| `multica autopilot create ...` | Create an autopilot |
-| `multica autopilot update <id> ...` | Update |
-| `multica autopilot delete <id>` | Delete |
-| `multica autopilot runs <id>` | Show run history |
-| `multica autopilot trigger <id>` | Trigger a run manually |
-| `multica autopilot trigger-add/update/delete <id>` | Manage schedule or webhook triggers |
-| `multica autopilot trigger-rotate-url <id> <trigger-id>` | Rotate a webhook trigger URL |
-
-`multica autopilot create/update` also accepts `--subscriber` to set default
-subscribers for issues created by a `create_issue` autopilot; update accepts
-`--clear-subscribers` to remove them.
+The command prompts you to paste the token in the terminal, keeping the full value out of shell history.
+
+## Choosing a workspace
+
+List workspaces and switch the default:
+
+```bash
+multica workspace list
+multica workspace switch <slug>
+```
+
+Subsequent commands use this workspace. A single command can override it with `--workspace-id`, or you can set `MULTICA_WORKSPACE_ID`.
+
+Invite members:
+
+```bash
+multica workspace member invite [email protected]
+multica workspace member invite [email protected] --role admin
+```
+
+## Common issue operations
+
+```bash
+# View and search
+multica issue list
+multica issue get MUL-123
+multica issue search "login failure"
+
+# Create and update
+multica issue create --title "Fix login failure"
+multica issue status MUL-123 in_progress
+multica issue assign MUL-123 --to "Backend Agent"
+
+# Comments and runs
+multica issue comment list MUL-123
+multica issue comment add MUL-123 --content "Check the regression tests first"
+multica issue runs MUL-123
+```
+
+Read long descriptions or comments from stdin to avoid dealing with newlines and quoting:
+
+```bash
+multica issue create --title "Upgrade notes" --description-stdin < notes.md
+multica issue comment add MUL-123 --content-stdin < review.md
+```
+
+View the messages of a single run, or stop a task:
+
+```bash
+multica issue run-messages <task-id> --issue MUL-123
+multica issue cancel-task <task-id> --issue MUL-123
+```
+
+## Agents and skills
+
+```bash
+multica agent list
+multica agent get <agent-id>
+multica agent create --help
+multica agent update <agent-id> --help
+
+multica skill list
+multica skill get <skill-id>
+multica skill import --url <skill-url>
+multica agent skills add <agent-id> --skill-ids <skill-id>
+```
+
+When an import hits a skill with the same name, the default is to stop without modifying existing content. Pick by intent:
+
+```bash
+multica skill import --url <skill-url> --on-conflict overwrite
+multica skill import --url <skill-url> --on-conflict rename
+multica skill import --url <skill-url> --on-conflict skip
+```
+
+`overwrite` is only allowed for the skill's creator and preserves the original ID and agent bindings.
## Daemon and runtimes
-| Command | Purpose |
-|---|---|
-| `multica daemon start` | Start the daemon (background by default; add `--foreground` to run in the foreground) |
-| `multica daemon stop` | Stop the daemon |
-| `multica daemon restart` | Restart the daemon |
-| `multica daemon status` | Check whether the daemon is online and its concurrency |
-| `multica daemon logs` | View daemon logs |
-| `multica runtime list` | List runtimes in the current workspace |
-| `multica runtime usage` | Show resource usage |
-| `multica runtime activity` | Recent activity log |
-| `multica runtime update <id> ...` | Initiate a CLI update on a runtime |
-| `multica runtime delete <id> [--cascade]` | Delete a runtime, optionally archiving bound agents |
-| `multica runtime profile ...` | Manage custom runtime profiles and local path overrides |
-
-## Miscellaneous
+```bash
+multica daemon start
+multica daemon stop
+multica daemon restart
+multica daemon status --output json
+multica daemon logs --follow
+
+multica runtime list
+multica runtime rename <runtime-id> "Office Mac"
+multica runtime usage <runtime-id>
+multica runtime activity <runtime-id>
+```
+
+Deleting a runtime that still has active agents bound to it is refused by default. `multica runtime delete <id> --cascade` also archives those agents and cancels their active tasks.
+
+See [Daemon and runtimes](/daemon-runtimes) for how it works and for custom profiles.
+
+## Command overview
| Command | Purpose |
-|---|---|
-| `multica repo checkout <url>` | Clone a repo locally for agents to use |
-| `multica config` | View or edit local CLI configuration |
-| `multica version` | Print the CLI version |
-| `multica update` | Upgrade the CLI to the latest release |
-| `multica attachment download <id>` | Download an attachment from an issue or comment |
+| --- | --- |
+| `issue` | Create, update, assign, and search issues; manage comments, subscribers, labels, properties, and runs |
+| `project` | Manage projects and their resources |
+| `label`, `property` | Manage workspace labels and custom properties |
+| `agent`, `skill`, `squad` | Manage agents, skills, and squads |
+| `autopilot` | Manage automations, triggers, and run history |
+| `workspace` | Create, view, and switch workspaces, and invite members |
+| `repo` | Manage workspace repositories and check them out locally |
+| `daemon`, `runtime` | Start and stop the local daemon; view and manage runtimes |
+| `attachment` | Upload or download attachments |
+| `user profile` | View or update the current user's profile |
+| `auth`, `login`, `setup` | Log in, check auth status, and initialize a connection |
+| `config` | View or edit the current CLI profile's local configuration |
+| `update`, `version` | Update the CLI or print the version |
+
+`multica chat` reads **the external chat session an agent is currently handling**; it is mainly for agents in chat integrations, not a general command for browsing arbitrary workspace conversations.
+
+## IDs and output formats
-## Getting full flags
+Issues use keys like `MUL-123` or full UUIDs; short UUID prefixes are not accepted.
-Every command supports `--help`:
+`list` commands for other resources usually print copyable short IDs and support `--full-id` for the full UUID. When a short ID is ambiguous, the CLI asks for more characters or the full UUID. Short task IDs also require `--issue` to identify the owning issue.
+
+Many commands support structured output:
```bash
-multica issue create --help
-multica agent update --help
+multica issue list --output json
+multica agent list --output json
```
-v2 will ship a dedicated detailed reference page for each command.
+Scripts should use JSON output rather than parsing the terminal-oriented tables. The output formats and pagination flags each command supports are defined by `multica <command> --help`.
+
+## Profiles and configuration
+
+The default configuration lives in `~/.multica/config.json`. Use `--profile <name>` to isolate a separate set of server address, token, default workspace, and daemon state:
+
+```bash
+multica setup self-host --profile staging \
+ --server-url https://api.staging.example.com \
+ --app-url https://app.staging.example.com
+
+multica issue list --profile staging
+```
+
+Named profiles live in `~/.multica/profiles/<name>/config.json`. Inspect the current values:
+
+```bash
+multica config show
+multica config show --profile staging
+```
+
+<Callout type="warning">
+CLI configuration files contain tokens that can access Multica as you. Don't commit them to a repository, upload them to logs, or share them with others.
+</Callout>
+
+## Command reference
+
+The tables below cover every current top-level command, grouped the way the CLI itself groups them. All commands accept the global flags `--server-url`, `--workspace-id`, `--profile`, and `--debug`. `--output` is registered per command, and the default format varies: `list` commands default to a table, while `get` and `create` commands mostly default to JSON. Full flags are defined by `multica <command> --help`.
+
+### Core
+
+| Command | Subcommand | Purpose | Key flags |
+| --- | --- | --- | --- |
+| `issue` | `list` | List issues | `--status`, `--priority`, `--assignee`, `--project`, `--metadata` (repeatable), `--limit`, `--offset`, `--sort`, `--full-id` |
+| | `get <id>` | Show a single issue | |
+| | `create` | Create an issue | `--title` (required), `--description` / `--description-stdin` / `--description-file`, `--status`, `--priority`, `--assignee`, `--parent`, `--stage`, `--project`, `--start-date`, `--due-date`, `--attachment` (repeatable) |
+| | `update <id>` | Update issue fields | Same fields as `create`, plus `--position` |
+| | `assign <id>` | Assign or unassign | `--to` (fuzzy name match against members, agents, and squads), `--to-id`, `--unassign` |
+| | `status <id> <status>` | Change status | |
+| | `reorder <id>` | Move within a column | |
+| | `search <query>` | Search issues | `--limit`, `--include-closed` |
+| | `children <id>` | List sub-issues grouped by stage | |
+| | `pull-requests <id>` | List linked PRs | |
+| | `comment list/add/delete/resolve/unresolve` | Manage comments | `add`: `--content` / `--content-stdin` / `--content-file`, `--parent`, `--attachment`; `list`: `--since`, `--thread`, `--tail` |
+| | `subscriber list/add/remove <issue-id>` | Manage subscribers | `--user`, `--user-id` (defaults to the current user) |
+| | `label list/add/remove <issue-id>` | Manage labels on an issue | |
+| | `metadata list/get/set/delete <issue-id>` | Manage issue-level key-value metadata | |
+| | `property list/set/unset <issue-id>` | Set custom property values | `set`: `--name`, `--value` |
+| | `runs <issue-id>` | View run history | `--full-id` |
+| | `run-messages <task-id>` | View the messages of a single run | `--since`, `--issue` |
+| | `usage <issue-id>` | View aggregated token usage | |
+| | `rerun <id>` | Re-enqueue a run for the current assignee | |
+| | `cancel-task <task-id>` | Cancel a running or queued task | `--issue` |
+| `project` | `list/get/create/update/delete` | Manage projects | |
+| | `status <id> <status>` | Change project status | |
+| | `resource list/add/update/remove` | Manage project resources | `--type`, `--url` |
+| `label` | `list/get/create/update/delete` | Manage workspace labels | |
+| `property` | `list/get/create/update/archive/unarchive` | Manage workspace custom properties | `create`: `--name`, `--type`, `--option` (repeatable); `list`: `--include-archived`; the type cannot be changed after creation |
+| `agent` | `list/get/create/update/archive/restore` | Manage agents | `--name`, `--runtime-id` (required for `create`), `--instructions`, `--model`, `--thinking-level`, `--mcp-config`, `--permission-mode`, `--max-concurrent-tasks` |
+| | `copy <agent-id>` | Copy into a new agent; the original is untouched | `--name` (defaults to the original name plus ` (copy)`), `--runtime-id` (copying to another runtime also requires `--model`), `--no-skills`; secret configuration such as `custom_env`, `mcp_config`, and `runtime_config` is not copied — re-provide it with the same flags as `create` |
+| | `tasks <id>` | View an agent's tasks | |
+| | `avatar <id>` | Upload an avatar | |
+| | `env get/set <agent-id>` | Read and write custom environment variables (owner and admin only) | |
+| | `skills list/set/add <agent-id>` | Manage attached skills | `--skill-ids` (`set` replaces the full list, `add` appends) |
+| `autopilot` | `list/get/create/update/delete` | Manage automations | `create`: `--title`, `--agent`, `--mode` (all required), `--priority`, `--project`, `--subscriber` (repeatable) |
+| | `trigger <id>` | Trigger a run manually | |
+| | `runs <id>` | View run history | |
+| | `trigger-add/trigger-update/trigger-delete/trigger-rotate-url` | Manage schedule and webhook triggers | |
+| `workspace` | `list/get/create/update/switch` | Manage workspaces; `switch` sets the current profile's default workspace | |
+| | `member list/invite <email>` | View members, send invites | `invite`: `--role` (member or admin, default member) |
+| `repo` | `list/add/remove/checkout` | Manage workspace repositories and check them out locally | `--url` (repeatable); `checkout`: `--ref` |
+| `skill` | `list/get/create/update/delete` | Manage skills | |
+| | `import` | Import a skill from a URL or local file | `--url` / `--file`, `--on-conflict` (`fail`, `overwrite`, `rename`, `skip`; default `fail`) |
+| | `search <query>` | Search skills | |
+| | `files list/upsert/delete <skill-id>` | Manage the files inside a skill | |
+| `squad` | `list/get/create/update/delete` | Manage squads (`delete` archives) | |
+| | `member list/add/set-role/remove` | Manage squad members | |
+| | `activity <issue-id> <outcome>` | Record a leader evaluation | |
+| `chat` | `history`, `thread [id]` | Read the external chat session an agent is currently handling | `--limit`, `--before` |
+
+### Runtime
+
+| Command | Subcommand | Purpose | Key flags |
+| --- | --- | --- | --- |
+| `daemon` | `start` | Start the local daemon | `--foreground`, `--device-name`, `--runtime-name`, `--poll-interval`, `--heartbeat-interval`, `--agent-timeout` (`0` means no limit), `--max-concurrent-tasks`, `--no-auto-update`; each has a matching `MULTICA_*` environment variable |
+| | `stop` / `status` / `restart` | Stop, check status, restart (`restart` takes the same flags as `start`) | |
+| | `logs` | View daemon logs | `--follow`, `--lines` |
+| | `disk-usage` | View local disk usage | `--by-workspace`, `--by-task`, `--top` |
+| `runtime` | `list/usage/activity/update/rename/delete` | View and manage runtimes | `delete`: `--cascade` (also archives bound agents and cancels their tasks) |
+| | `profile list/create/update/delete` | Manage custom runtime profiles | |
+| | `profile set-path/unset-path <profile-id>` | Pin a local executable path (local only, never uploaded to the server) | |
+
+### Additional
+
+| Command | Subcommand | Purpose | Key flags |
+| --- | --- | --- | --- |
+| `auth` | `status` / `logout` | Check auth status; `logout` only deletes the locally saved token and does not revoke it on the server | |
+| `user` | `profile get/update` | View or update the current user's profile | |
+| `login` | — | Sign in via the browser and configure all workspaces automatically | `--token` (prompts interactively in the terminal when passed without a value) |
+| `setup` | `cloud` (default), `self-host` | Save the server address, complete sign-in, and start the daemon | `self-host`: `--server-url`, `--app-url`, `--port`, `--frontend-port` |
+| `attachment` | `download <attachment-id>`, `upload <path>` | Download or upload attachments | `download`: `--output-dir`; `upload`: `--task` |
+| `config` | `show`, `set <key> <value>` | View or edit the current profile's local configuration | Precedence: command-line flags > environment variables > `config.json` > built-in defaults; set an empty string to clear a value |
+| `update` | — | Update the CLI to the latest version | |
+| `version` | — | Print version information | `--output` (`text` or `json`) |
## Next steps
-- [Authentication and tokens](/auth-tokens) — PAT vs. JWT vs. daemon token
-- [Daemon and runtimes](/daemon-runtimes) — how the `daemon` commands work under the hood
-- [Creating and configuring agents](/agents-create) — all options for `multica agent create`
+- [Authentication and tokens](/auth-tokens) — creating, renewing, and revoking PATs.
+- [Troubleshooting](/troubleshooting) — diagnosing command errors and tasks that never start.
+- [Create and configure an agent](/agents-create) — the full semantics of every `agent create` field.
diff --git a/apps/docs/content/docs/cli.zh.mdx b/apps/docs/content/docs/cli.zh.mdx
index b66686fc9c..5f172a3eb3 100644
--- a/apps/docs/content/docs/cli.zh.mdx
+++ b/apps/docs/content/docs/cli.zh.mdx
@@ -1,178 +1,303 @@
---
-title: CLI 命令速查
-description: Multica CLI 的所有顶级命令一页概览。完整用法查 `multica <命令> --help`。
+title: 使用 CLI
+description: 安装并登录 Multica CLI,在终端中管理工作区、issue、智能体和运行时。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica CLI 把 Web UI 能做的事几乎全部搬到了命令行上(创建 [issue](/issues)、分配 [智能体](/agents)、启动 [守护进程](/daemon-runtimes) 等等)。这一页把所有顶级命令列出来,每条配一句用途。完整 flag 和示例用 `multica <命令> --help` 查。
+Multica CLI 既负责连接本机运行时,也可以在终端中管理工作区、issue、智能体和自动化。这里介绍常用路径;当前版本支持的参数始终以命令自身的 `--help` 为准。
-## 认证入口
+## 安装
-第一次用 CLI 时先登录,拿一个**个人访问令牌(Personal Access Token,PAT)**:
+**macOS / Linux**
```bash
-multica login
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-浏览器会自动打开,你在 Web 端同意后,CLI 把 PAT(`mul_` 前缀)保存到 `~/.multica/config.json`。此后所有命令都会自动用这个 PAT 认证。
+安装了 Homebrew 时也可以运行:
-<Callout type="tip">
-CI / 无浏览器环境跳过浏览器流程:先在 Web 端 **Settings → Personal Access Tokens** 创建一个 PAT,然后 `multica login --token <mul_...>` 直接填入。
-</Callout>
+```bash
+brew install multica-ai/tap/multica
+```
-Token 类型的详细区分见 [认证与令牌](/auth-tokens)。
+**Windows PowerShell**
-## 认证与初始化
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-| 命令 | 用途 |
-|---|---|
-| `multica login` | 登录并保存 PAT |
-| `multica auth status` | 查看当前登录状态、用户、工作区 |
-| `multica auth logout` | 清除本地 PAT |
-| `multica setup cloud` | Multica Cloud 一键初始化(登录 + 装 daemon) |
-| `multica setup self-host` | 自部署后端的一键初始化 |
+确认安装成功:
-## 工作区和成员
+```bash
+multica version
+```
-| 命令 | 用途 |
-|---|---|
-| `multica workspace list` | 列出你有权访问的所有工作区 |
-| `multica workspace create --name "..." --slug "..." [--issue-prefix "..."] [--description "..."] [--context "..."]` | 创建工作区(你会成为 owner)。`--name` 和 `--slug` 必填,slug 创建后不可修改;不会切换你当前的工作区。 |
-| `multica workspace get <slug>` | 查看一个工作区的详情 |
-| `multica workspace member list` | 列出当前工作区的成员 |
-| `multica workspace update <id> --name "..." [--description "..."] [--context "..."] [--issue-prefix "..."]` | 修改 workspace 元数据(admin/owner 权限)。长文本可用 `--description-stdin` / `--context-stdin`。 |
+## 第一次连接
-## Issue 和 Project
+连接 Multica Cloud:
-<Callout type="info">
-`list` 类命令(`multica issue list`、`autopilot list`、`project list` 等)表格里默认显示**可直接复制**的短 ID:issue 是 key(如 `MUL-123`),其余资源是 UUID 短前缀。下面表格里的 `<id>` 同时接受短 ID 和完整 UUID,所以典型用法是 `multica issue list` → 复制 key → `multica issue get MUL-123`。需要完整 UUID 时给 `list` 加 `--full-id`。
-</Callout>
+```bash
+multica setup
+```
-| 命令 | 用途 |
-|---|---|
-| `multica issue list` | 列出 issue(默认显示可复制的 issue key) |
-| `multica issue get <id>` | 查看单条 issue(接受 issue key 或 UUID) |
-| `multica issue create --title "..."` | 创建新 issue |
-| `multica issue update <id> ...` | 修改 issue(状态、优先级、分配人等) |
-| `multica issue assign <id> --to <name>` | 分配给成员、智能体或小队(分配给智能体会触发一次运行) |
-| `multica issue status <id> <status>` | 快捷改状态 |
-| `multica issue search <query>` | 关键字搜索 |
-| `multica issue children <id>` | 按 stage 分组查看子 issue |
-| `multica issue pull-requests <id>` | 查看关联 PR 及其状态 |
-| `multica issue runs <id>` | 查看 issue 上智能体跑过的任务 |
-| `multica issue run-messages <task-id>` | 查看某次执行的消息 |
-| `multica issue usage <id>` | 查看单个 issue 聚合 token 用量 |
-| `multica issue rerun <id>` | 给该 issue 当前的智能体分配人重新创建一条任务 |
-| `multica issue cancel-task <task-id>` | 取消排队中或运行中的任务 |
-| `multica issue comment <id> ...` | 嵌套:看 / 发评论 |
-| `multica issue comment resolve/unresolve <comment-id>` | 标记评论线程已解决 / 未解决 |
-| `multica issue subscriber <id> ...` | 嵌套:订阅 / 取消订阅 |
-| `multica issue metadata <id> ...` | 嵌套:读写 issue metadata |
-| `multica issue label <id> ...` | 嵌套:管理 issue 上的 label |
-| `multica project list/get/create/update/delete/status` | Project CRUD |
-| `multica label list/create/update/delete` | Workspace label CRUD |
-
-## 智能体和 Skill
+连接自托管实例:
-| 命令 | 用途 |
-|---|---|
-| `multica agent list` | 列出工作区的智能体 |
-| `multica agent get <slug>` | 查看智能体配置 |
-| `multica agent create ...` | 创建智能体 |
-| `multica agent update <slug> ...` | 修改智能体 |
-| `multica agent archive <slug>` | 归档 |
-| `multica agent restore <slug>` | 恢复归档的智能体 |
-| `multica agent tasks <slug>` | 查看智能体的任务历史 |
-| `multica agent avatar <slug>` | 上传智能体头像 |
-| `multica agent env <slug> ...` | 读取或替换智能体的 custom environment variables |
-| `multica agent skills ...` | 嵌套:挂载 / 卸载 Skill |
-| `multica skill list/get/create/update/delete` | Skill CRUD |
-| `multica skill import ...` | 从 GitHub / ClawHub / 本机导入 Skill |
-| `multica skill files ...` | 嵌套:管理 Skill 的文件 |
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-### Skill 导入冲突
+`setup` 会保存服务地址、打开浏览器完成登录,并启动守护进程。完成后检查:
-`multica skill import --url <url>` 默认等同于 `--on-conflict fail`。如果工作区里已经有同名 Skill,命令会返回结构化 `conflict` 结果并退出,不会修改工作区。
+```bash
+multica auth status
+multica daemon status
+```
-如果你是已有 Skill 的 creator,并且想用新导入内容覆盖它,同时保留原 Skill 的 ID 和 agent 绑定,用 `--on-conflict overwrite`。如果想保留已有 Skill、另存一份,用 `--on-conflict rename`,系统会自动加 `-2` 这类后缀。如果只是批量导入时遇到同名项就跳过,用 `--on-conflict skip`。
+如果只需要重新登录,不想覆盖其他配置,运行 `multica login`。没有浏览器的环境可以先在 Web 设置中创建个人访问令牌,再输入:
```bash
-multica skill import --url https://skills.sh/acme/repo/review-helper
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict overwrite
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict rename
-multica skill import --url https://skills.sh/acme/repo/review-helper --on-conflict skip
+multica login --token
```
-## 小队
+命令会在终端中提示粘贴令牌,避免把完整值留在 shell history 中。
-| 命令 | 用途 |
-|---|---|
-| `multica squad list` | 列出工作区里的小队 |
-| `multica squad get <id>` | 查看一个小队 |
-| `multica squad create --name "..." --leader <agent>` | 创建小队(owner / admin)|
-| `multica squad update <id> ...` | 修改名字、描述、instructions、队长、头像 |
-| `multica squad delete <id>` | 归档(软删除)—— 同时把分配给小队的 issue 转给队长 |
-| `multica squad member list/add/remove/set-role <squad-id>` | 管理小队成员并原地更新 role |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | 队长智能体每轮结束时调用,记录 evaluation |
+## 选择工作区
-完整模型见 [小队](/squads)。
+列出并切换默认工作区:
-## Autopilots
+```bash
+multica workspace list
+multica workspace switch <slug>
+```
-| 命令 | 用途 |
-|---|---|
-| `multica autopilot list` | 列出工作区所有 autopilot |
-| `multica autopilot get <id>` | 查看单个 autopilot |
-| `multica autopilot create ...` | 创建 autopilot |
-| `multica autopilot update <id> ...` | 修改 |
-| `multica autopilot delete <id>` | 删除 |
-| `multica autopilot runs <id>` | 查看运行历史 |
-| `multica autopilot trigger <id>` | 手动触发一次 |
-| `multica autopilot trigger-add/update/delete <id>` | 管理 schedule 或 webhook trigger |
-| `multica autopilot trigger-rotate-url <id> <trigger-id>` | 轮换 webhook trigger URL |
-
-`multica autopilot create/update` 还支持 `--subscriber`,为 `create_issue` 模式创建的 issue 设置默认订阅人;`update` 支持 `--clear-subscribers` 清空默认订阅人。
+之后的命令会使用这个工作区。单次命令可以通过 `--workspace-id` 临时覆盖,也可以设置 `MULTICA_WORKSPACE_ID`。
+
+邀请成员:
+
+```bash
+multica workspace member invite [email protected]
+multica workspace member invite [email protected] --role admin
+```
+
+## 常用 issue 操作
+
+```bash
+# 查看和搜索
+multica issue list
+multica issue get MUL-123
+multica issue search "登录失败"
+
+# 创建和修改
+multica issue create --title "修复登录失败"
+multica issue status MUL-123 in_progress
+multica issue assign MUL-123 --to "Backend Agent"
+
+# 评论和执行记录
+multica issue comment list MUL-123
+multica issue comment add MUL-123 --content "请先检查回归测试"
+multica issue runs MUL-123
+```
+
+长描述或评论从 stdin 读取,避免处理换行和引号:
+
+```bash
+multica issue create --title "升级说明" --description-stdin < notes.md
+multica issue comment add MUL-123 --content-stdin < review.md
+```
+
+查看某次执行的消息,或停止 task:
+
+```bash
+multica issue run-messages <task-id> --issue MUL-123
+multica issue cancel-task <task-id> --issue MUL-123
+```
+
+## 智能体和 skill
+
+```bash
+multica agent list
+multica agent get <agent-id>
+multica agent create --help
+multica agent update <agent-id> --help
+
+multica skill list
+multica skill get <skill-id>
+multica skill import --url <skill-url>
+multica agent skills add <agent-id> --skill-ids <skill-id>
+```
+
+导入时遇到同名 skill,默认会停止且不修改现有内容。按意图选择:
+
+```bash
+multica skill import --url <skill-url> --on-conflict overwrite
+multica skill import --url <skill-url> --on-conflict rename
+multica skill import --url <skill-url> --on-conflict skip
+```
+
+`overwrite` 只允许 skill 的创建者使用,并保留原来的 ID 与智能体绑定关系。
## 守护进程和运行时
-| 命令 | 用途 |
-|---|---|
-| `multica daemon start` | 启动 daemon(默认后台;加 `--foreground` 前台跑)|
-| `multica daemon stop` | 停止 daemon |
-| `multica daemon restart` | 重启 daemon |
-| `multica daemon status` | 查看 daemon 是否在线 + 并发情况 |
-| `multica daemon logs` | 查看 daemon 日志 |
-| `multica runtime list` | 列出当前工作区的 runtime |
-| `multica runtime usage` | 查看资源使用情况 |
-| `multica runtime activity` | 近期活动记录 |
-| `multica runtime update <id> ...` | 在某个 runtime 上触发 CLI 更新 |
-| `multica runtime delete <id> [--cascade]` | 删除 runtime,可选择同时归档绑定的智能体 |
-| `multica runtime profile ...` | 管理自定义 runtime profile 和本机路径覆盖 |
-
-## 杂项
+```bash
+multica daemon start
+multica daemon stop
+multica daemon restart
+multica daemon status --output json
+multica daemon logs --follow
+
+multica runtime list
+multica runtime rename <runtime-id> "Office Mac"
+multica runtime usage <runtime-id>
+multica runtime activity <runtime-id>
+```
+
+删除仍绑定活跃智能体的运行时时,命令默认拒绝。`multica runtime delete <id> --cascade` 会同时归档这些智能体并取消它们的活动 task。
+
+运行机制和自定义 profile 见[守护进程与运行时](/daemon-runtimes)。
+
+## 命令概览
| 命令 | 用途 |
-|---|---|
-| `multica repo checkout <url>` | 把 repo 拉到本地以供智能体使用 |
-| `multica config` | 查看 / 修改 CLI 本地配置 |
-| `multica version` | 显示 CLI 版本 |
-| `multica update` | 升级 CLI 到最新版 |
-| `multica attachment download <id>` | 下载 issue / 评论的附件 |
+| --- | --- |
+| `issue` | 创建、更新、分配和搜索 issue;管理评论、订阅、标签、属性与执行记录 |
+| `project` | 管理项目及其资源 |
+| `label`、`property` | 管理工作区标签和自定义属性 |
+| `agent`、`skill`、`squad` | 管理智能体、skill 和小队 |
+| `autopilot` | 管理自动化、触发器和运行历史 |
+| `workspace` | 创建、查看、切换工作区和邀请成员 |
+| `repo` | 管理工作区仓库,并把仓库检出到本机 |
+| `daemon`、`runtime` | 启停本机守护进程,查看和管理运行时 |
+| `attachment` | 上传或下载附件 |
+| `user profile` | 查看或更新当前用户资料 |
+| `auth`、`login`、`setup` | 登录、查看认证状态和初始化连接 |
+| `config` | 查看或修改当前 CLI profile 的本地配置 |
+| `update`、`version` | 更新 CLI 或查看版本 |
+
+`multica chat` 读取的是**智能体当前正在处理的外部聊天会话**,主要供聊天集成中的智能体使用;它不是用于浏览任意工作区对话的通用命令。
+
+## ID 和输出格式
+
+Issue 使用 `MUL-123` 这样的 key 或完整 UUID,不接受 UUID 短前缀。
+
+其他资源的 `list` 命令通常显示可复制的短 ID,并支持 `--full-id` 输出完整 UUID。短 ID 不唯一时,CLI 会要求增加字符或改用完整 UUID。执行任务的短 ID 还需要通过 `--issue` 指明所属 issue。
+
+许多命令支持结构化输出:
+
+```bash
+multica issue list --output json
+multica agent list --output json
+```
-## 查完整 flag
+脚本使用 JSON 输出,不解析面向终端的表格。各命令支持的输出格式和分页参数以 `multica <command> --help` 为准。
-每条命令都支持 `--help`:
+## Profile 与配置
+
+默认配置保存在 `~/.multica/config.json`。使用 `--profile <name>` 可以隔离另一套服务地址、令牌、默认工作区和守护进程状态:
```bash
-multica issue create --help
-multica agent update --help
+multica setup self-host --profile staging \
+ --server-url https://api.staging.example.com \
+ --app-url https://app.staging.example.com
+
+multica issue list --profile staging
```
-v2 会给每条命令一个独立的详细 reference 页。
+命名 profile 保存在 `~/.multica/profiles/<name>/config.json`。查看当前值:
-## 下一步
+```bash
+multica config show
+multica config show --profile staging
+```
+
+<Callout type="warning">
+CLI 配置文件包含可代表你访问 Multica 的令牌。不要提交到仓库、上传到日志或与他人共享。
+</Callout>
-- [认证与令牌](/auth-tokens) —— PAT / JWT / Daemon Token 的区别
-- [守护进程与运行时](/daemon-runtimes) —— `daemon` 命令背后的工作机制
-- [创建和配置智能体](/agents-create) —— `multica agent create` 的完整选项
+## 命令参考
+
+下表覆盖当前全部顶层命令,按 CLI 自身的分组排列。所有命令都接受全局 flag `--server-url`、`--workspace-id`、`--profile` 和 `--debug`。`--output` 是逐命令注册的 flag,默认格式因命令而异:`list` 类默认表格,`get`、`create` 类多默认 JSON。完整参数以 `multica <command> --help` 为准。
+
+### Core
+
+| 命令 | 子命令 | 用途 | 关键 flag |
+| --- | --- | --- | --- |
+| `issue` | `list` | 列出 issue | `--status`、`--priority`、`--assignee`、`--project`、`--metadata`(可重复)、`--limit`、`--offset`、`--sort`、`--full-id` |
+| | `get <id>` | 查看单个 issue | |
+| | `create` | 创建 issue | `--title`(必填)、`--description` / `--description-stdin` / `--description-file`、`--status`、`--priority`、`--assignee`、`--parent`、`--stage`、`--project`、`--start-date`、`--due-date`、`--attachment`(可重复) |
+| | `update <id>` | 更新 issue 字段 | 与 `create` 同类字段,另有 `--position` |
+| | `assign <id>` | 指派或取消指派 | `--to`(名称模糊匹配成员、智能体或小队)、`--to-id`、`--unassign` |
+| | `status <id> <status>` | 修改状态 | |
+| | `reorder <id>` | 在列内移动 | |
+| | `search <query>` | 搜索 issue | `--limit`、`--include-closed` |
+| | `children <id>` | 按阶段分组列出子 issue | |
+| | `pull-requests <id>` | 列出关联的 PR | |
+| | `comment list/add/delete/resolve/unresolve` | 管理评论 | `add`:`--content` / `--content-stdin` / `--content-file`、`--parent`、`--attachment`;`list`:`--since`、`--thread`、`--tail` |
+| | `subscriber list/add/remove <issue-id>` | 管理订阅者 | `--user`、`--user-id`(缺省为当前用户) |
+| | `label list/add/remove <issue-id>` | 管理 issue 上的标签 | |
+| | `metadata list/get/set/delete <issue-id>` | 管理 issue 级键值元数据 | |
+| | `property list/set/unset <issue-id>` | 设置自定义属性值 | `set`:`--name`、`--value` |
+| | `runs <issue-id>` | 查看执行历史 | `--full-id` |
+| | `run-messages <task-id>` | 查看单次执行的消息 | `--since`、`--issue` |
+| | `usage <issue-id>` | 查看聚合 token 用量 | |
+| | `rerun <id>` | 按当前指派重新入队执行 | |
+| | `cancel-task <task-id>` | 取消运行中或排队中的 task | `--issue` |
+| `project` | `list/get/create/update/delete` | 管理项目 | |
+| | `status <id> <status>` | 修改项目状态 | |
+| | `resource list/add/update/remove` | 管理项目附加资源 | `--type`、`--url` |
+| `label` | `list/get/create/update/delete` | 管理工作区标签 | |
+| `property` | `list/get/create/update/archive/unarchive` | 管理工作区自定义属性 | `create`:`--name`、`--type`、`--option`(可重复);`list`:`--include-archived`;类型创建后不可修改 |
+| `agent` | `list/get/create/update/archive/restore` | 管理智能体 | `--name`、`--runtime-id`(`create` 必填)、`--instructions`、`--model`、`--thinking-level`、`--mcp-config`、`--permission-mode`、`--max-concurrent-tasks` |
+| | `copy <agent-id>` | 复制为新智能体,原智能体不受影响 | `--name`(默认为原名加 ` (copy)`)、`--runtime-id`(复制到其他运行时时必须同时指定 `--model`)、`--no-skills`;`custom_env`、`mcp_config`、`runtime_config` 等机密配置不会复制,需用与 `create` 相同的 flag 重新提供 |
+| | `tasks <id>` | 查看智能体的 task | |
+| | `avatar <id>` | 上传头像 | |
+| | `env get/set <agent-id>` | 读写自定义环境变量(仅 owner 和 admin) | |
+| | `skills list/set/add <agent-id>` | 管理绑定的 skill | `--skill-ids`(`set` 全量替换,`add` 增量添加) |
+| `autopilot` | `list/get/create/update/delete` | 管理自动化 | `create`:`--title`、`--agent`、`--mode`(均必填)、`--priority`、`--project`、`--subscriber`(可重复) |
+| | `trigger <id>` | 手动触发一次 | |
+| | `runs <id>` | 查看运行历史 | |
+| | `trigger-add/trigger-update/trigger-delete/trigger-rotate-url` | 管理定时和 webhook 触发器 | |
+| `workspace` | `list/get/create/update/switch` | 管理工作区;`switch` 设置当前 profile 的默认工作区 | |
+| | `member list/invite <email>` | 查看成员、发出邀请 | `invite`:`--role`(member 或 admin,默认 member) |
+| `repo` | `list/add/remove/checkout` | 管理工作区仓库并检出到本机 | `--url`(可重复);`checkout`:`--ref` |
+| `skill` | `list/get/create/update/delete` | 管理 skill | |
+| | `import` | 从 URL 或本地文件导入 skill | `--url` / `--file`、`--on-conflict`(`fail`、`overwrite`、`rename`、`skip`,默认 `fail`) |
+| | `search <query>` | 搜索 skill | |
+| | `files list/upsert/delete <skill-id>` | 管理 skill 内的文件 | |
+| `squad` | `list/get/create/update/delete` | 管理小队(`delete` 为归档) | |
+| | `member list/add/set-role/remove` | 管理小队成员 | |
+| | `activity <issue-id> <outcome>` | 记录队长评价 | |
+| `chat` | `history`、`thread [id]` | 读取智能体当前正在处理的外部聊天会话 | `--limit`、`--before` |
+
+### Runtime
+
+| 命令 | 子命令 | 用途 | 关键 flag |
+| --- | --- | --- | --- |
+| `daemon` | `start` | 启动本机守护进程 | `--foreground`、`--device-name`、`--runtime-name`、`--poll-interval`、`--heartbeat-interval`、`--agent-timeout`(`0` 表示不设上限)、`--max-concurrent-tasks`、`--no-auto-update`;均有对应的 `MULTICA_*` 环境变量 |
+| | `stop` / `status` / `restart` | 停止、查看状态、重启(`restart` 与 `start` 同一套 flag) | |
+| | `logs` | 查看守护进程日志 | `--follow`、`--lines` |
+| | `disk-usage` | 查看本机磁盘占用 | `--by-workspace`、`--by-task`、`--top` |
+| `runtime` | `list/usage/activity/update/rename/delete` | 查看和管理运行时 | `delete`:`--cascade`(同时归档绑定的智能体并取消其 task) |
+| | `profile list/create/update/delete` | 管理自定义运行时 profile | |
+| | `profile set-path/unset-path <profile-id>` | 固定本机可执行文件路径(仅本地生效,不上传服务器) | |
+
+### Additional
+
+| 命令 | 子命令 | 用途 | 关键 flag |
+| --- | --- | --- | --- |
+| `auth` | `status` / `logout` | 查看认证状态;`logout` 只删除本地保存的令牌,不吊销服务端令牌 | |
+| `user` | `profile get/update` | 查看或更新当前用户资料 | |
+| `login` | — | 浏览器登录并自动配置全部工作区 | `--token`(不带值时在终端交互式输入) |
+| `setup` | `cloud`(默认)、`self-host` | 保存服务地址、完成登录并启动守护进程 | `self-host`:`--server-url`、`--app-url`、`--port`、`--frontend-port` |
+| `attachment` | `download <attachment-id>`、`upload <path>` | 下载或上传附件 | `download`:`--output-dir`;`upload`:`--task` |
+| `config` | `show`、`set <key> <value>` | 查看或修改当前 profile 的本地配置 | 优先级:命令行 flag > 环境变量 > `config.json` > 内置默认;设为空串可清除 |
+| `update` | — | 更新 CLI 到最新版本 | |
+| `version` | — | 查看版本信息 | `--output`(`text` 或 `json`) |
+
+## 接下来
+
+- [认证与令牌](/auth-tokens) — PAT 的创建、续期和吊销。
+- [故障排查](/troubleshooting) — 命令报错和任务不开始的排查路径。
+- [创建和配置智能体](/agents-create) — `agent create` 各字段的完整语义。
diff --git a/apps/docs/content/docs/cli/installation.zh.mdx b/apps/docs/content/docs/cli/installation.zh.mdx
deleted file mode 100644
index eeaf0f6a87..0000000000
--- a/apps/docs/content/docs/cli/installation.zh.mdx
+++ /dev/null
@@ -1,104 +0,0 @@
----
-title: CLI Installation
-description: Install the Multica CLI and start the agent daemon.
----
-
-## Installation
-
-### Homebrew (macOS/Linux)
-
-```bash
-brew install multica-ai/tap/multica
-```
-
-### Build from Source
-
-```bash
-git clone https://github.com/multica-ai/multica.git
-cd multica
-make build
-cp server/bin/multica /usr/local/bin/multica
-```
-
-### Download from GitHub Releases
-
-If Homebrew is not available, download the binary directly:
-
-```bash
-OS=$(uname -s | tr '[:upper:]' '[:lower:]') # "darwin" or "linux"
-ARCH=$(uname -m) # "x86_64" or "arm64"
-
-# Normalize architecture name
-if [ "$ARCH" = "x86_64" ]; then
- ARCH="amd64"
-fi
-
-# Get the latest release tag from GitHub
-LATEST=$(curl -sI https://github.com/multica-ai/multica/releases/latest \
- | grep -i '^location:' | sed 's/.*tag\///' | tr -d '\r\n')
-
-# Download and extract
-curl -sL "https://github.com/multica-ai/multica/releases/download/${LATEST}/multica_${OS}_${ARCH}.tar.gz" \
- -o /tmp/multica.tar.gz
-tar -xzf /tmp/multica.tar.gz -C /tmp multica
-sudo mv /tmp/multica /usr/local/bin/multica
-rm /tmp/multica.tar.gz
-```
-
-### Update
-
-```bash
-brew upgrade multica-ai/tap/multica
-```
-
-For install script or manual installs, use:
-
-```bash
-multica update
-```
-
-`multica update` auto-detects your installation method and upgrades accordingly.
-
-## Quick Start
-
-```bash
-# One command: configure, authenticate, and start the daemon
-multica setup
-```
-
-This configures the CLI for Multica Cloud, opens your browser for login, discovers your workspaces, and starts the agent daemon.
-
-For self-hosted servers, use `multica setup self-host` instead. See [Self-Hosting](/getting-started/self-hosting) for details.
-
-## Verify
-
-```bash
-multica daemon status
-```
-
-Confirm:
-1. Status is `running`
-2. At least one agent is listed (e.g. `claude`, `codex`, `codebuddy`, `opencode`, `openclaw`, `hermes`, `kiro-cli`, `qodercli`, or `traecli`)
-3. At least one workspace is being watched
-
-If the agents list is empty, install at least one supported AI agent CLI:
-- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
-- Antigravity (`agy`)
-- CodeBuddy (`codebuddy`)
-- [Codex](https://github.com/openai/codex) (`codex`)
-- Copilot (`copilot`)
-- Cursor Agent (`cursor-agent`)
-- OpenCode (`opencode`)
-- OpenClaw (`openclaw`)
-- Hermes (`hermes`)
-- Kimi (`kimi`)
-- Kiro CLI (`kiro-cli`)
-- Pi (`pi`)
-- Qoder (`qodercli`)
-- Trae CLI (`traecli`)
-
-Then restart the daemon:
-
-```bash
-multica daemon stop && multica daemon start
-```
diff --git a/apps/docs/content/docs/cli/meta.zh.json b/apps/docs/content/docs/cli/meta.zh.json
deleted file mode 100644
index a75eaa8b24..0000000000
--- a/apps/docs/content/docs/cli/meta.zh.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "title": "CLI & Daemon",
- "pages": ["installation", "reference"]
-}
diff --git a/apps/docs/content/docs/cli/reference.zh.mdx b/apps/docs/content/docs/cli/reference.zh.mdx
deleted file mode 100644
index 23cc2b286b..0000000000
--- a/apps/docs/content/docs/cli/reference.zh.mdx
+++ /dev/null
@@ -1,457 +0,0 @@
----
-title: CLI Reference
-description: Complete command reference for the Multica CLI and agent daemon.
----
-
-The `multica` CLI connects your local machine to Multica. It handles authentication, workspace management, issue tracking, and runs the agent daemon that executes AI tasks locally.
-
-## Authentication
-
-### Browser Login
-
-```bash
-multica login
-```
-
-Opens your browser for OAuth authentication, creates a 90-day personal access token, and auto-configures your workspaces.
-
-### Token Login
-
-```bash
-multica login --token <mul_...>
-```
-
-Authenticate using a personal access token directly. Useful for headless environments. Pass `--token=` with an empty value to be prompted interactively (so the token never lands in shell history).
-
-### Check Status
-
-```bash
-multica auth status
-```
-
-Shows your current server, user, and token validity.
-
-### Logout
-
-```bash
-multica auth logout
-```
-
-Removes the stored authentication token.
-
-## Agent Daemon
-
-The daemon is the local agent runtime. It detects available AI CLIs on your machine, registers them with the Multica server, and executes tasks when agents are assigned work.
-
-### Start
-
-```bash
-multica daemon start
-```
-
-By default, the daemon runs in the background and logs to `~/.multica/daemon.log`.
-
-To run in the foreground (useful for debugging):
-
-```bash
-multica daemon start --foreground
-```
-
-### Stop
-
-```bash
-multica daemon stop
-```
-
-### Status
-
-```bash
-multica daemon status
-multica daemon status --output json
-```
-
-Shows PID, uptime, detected agents, and watched workspaces.
-
-### Logs
-
-```bash
-multica daemon logs # Last 50 lines
-multica daemon logs -f # Follow (tail -f)
-multica daemon logs -n 100 # Last 100 lines
-```
-
-### Supported Agents
-
-The daemon auto-detects these AI CLIs on your PATH:
-
-| CLI | Command | Description |
-|-----|---------|-------------|
-| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `claude` | Anthropic's coding agent |
-| Antigravity | `agy` | Google's coding agent |
-| CodeBuddy | `codebuddy` | Tencent's Claude Code-compatible coding agent |
-| [Codex](https://github.com/openai/codex) | `codex` | OpenAI's coding agent |
-| Copilot | `copilot` | GitHub's coding agent |
-| Cursor Agent | `cursor-agent` | Cursor coding agent |
-| OpenCode | `opencode` | Open-source coding agent |
-| OpenClaw | `openclaw` | Open-source coding agent |
-| Hermes | `hermes` | Nous Research coding agent |
-| Kimi | `kimi` | Moonshot coding agent |
-| Kiro CLI | `kiro-cli` | Kiro ACP coding agent |
-| Pi | `pi` | Inflection coding agent |
-| Qoder | `qodercli` | Alibaba coding agent |
-| Trae CLI | `traecli` | ByteDance coding agent |
-
-You need at least one installed. The daemon registers each detected CLI as an available runtime.
-
-### How It Works
-
-1. On start, the daemon detects installed agent CLIs and registers a runtime for each agent in each watched workspace
-2. It polls the server at a configurable interval (default: 3s) for claimed tasks
-3. When a task arrives, it creates an isolated workspace directory, spawns the agent CLI, and streams results back
-4. Heartbeats are sent periodically (default: 15s) so the server knows the daemon is alive
-5. On shutdown, all runtimes are deregistered
-
-### Configuration
-
-Daemon behavior is configured via flags or environment variables:
-
-| Setting | Flag | Env Variable | Default |
-|---------|------|--------------|---------|
-| Poll interval | `--poll-interval` | `MULTICA_DAEMON_POLL_INTERVAL` | `3s` |
-| Heartbeat interval | `--heartbeat-interval` | `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` |
-| Agent timeout | `--agent-timeout` | `MULTICA_AGENT_TIMEOUT` | `0`(不限制,由看门狗兜底)|
-| Codex app-server handshake timeout | `--codex-handshake-timeout` | `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` |
-| Max concurrent tasks | `--max-concurrent-tasks` | `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` |
-| Daemon ID | `--daemon-id` | `MULTICA_DAEMON_ID` | hostname |
-| Device name | `--device-name` | `MULTICA_DAEMON_DEVICE_NAME` | hostname |
-| Runtime name | `--runtime-name` | `MULTICA_AGENT_RUNTIME_NAME` | `Local Agent` |
-| Workspaces root | — | `MULTICA_WORKSPACES_ROOT` | `~/multica_workspaces` |
-
-Agent-specific overrides:
-
-| Variable | Description |
-|----------|-------------|
-| `MULTICA_CLAUDE_PATH` | Custom path to the `claude` binary |
-| `MULTICA_CLAUDE_MODEL` | Override the Claude model used |
-| `MULTICA_CODEX_PATH` | Custom path to the `codex` binary |
-| `MULTICA_CODEX_MODEL` | Override the Codex model used |
-| `MULTICA_CODEBUDDY_PATH` | Custom path to the `codebuddy` binary |
-| `MULTICA_CODEBUDDY_MODEL` | Override the CodeBuddy model used |
-| `MULTICA_ANTIGRAVITY_PATH` | Custom path to the `agy` binary |
-| `MULTICA_ANTIGRAVITY_MODEL` | Override the Antigravity model used |
-| `MULTICA_OPENCODE_PATH` | Custom path to the `opencode` binary |
-| `MULTICA_OPENCODE_MODEL` | Override the OpenCode model used |
-| `MULTICA_OPENCLAW_PATH` | Custom path to the `openclaw` binary |
-| `MULTICA_OPENCLAW_MODEL` | Override the OpenClaw model used |
-| `MULTICA_HERMES_PATH` | Custom path to the `hermes` binary |
-| `MULTICA_HERMES_MODEL` | Override the Hermes model used |
-| `MULTICA_GEMINI_PATH` | Custom path to the `gemini` binary |
-| `MULTICA_GEMINI_MODEL` | Override the Gemini model used |
-| `MULTICA_PI_PATH` | Custom path to the `pi` binary |
-| `MULTICA_PI_MODEL` | Override the Pi model used |
-| `MULTICA_CURSOR_PATH` | Custom path to the `cursor-agent` binary |
-| `MULTICA_CURSOR_MODEL` | Override the Cursor model used |
-| `MULTICA_KIMI_PATH` | Custom path to the `kimi` binary |
-| `MULTICA_KIMI_MODEL` | Override the Kimi model used |
-| `MULTICA_KIRO_PATH` | Custom path to the `kiro-cli` binary |
-| `MULTICA_KIRO_MODEL` | Override the Kiro model used |
-| `MULTICA_QODER_PATH` | Custom path to the `qodercli` binary |
-| `MULTICA_QODER_MODEL` | Override the Qoder model used |
-| `MULTICA_TRAECLI_PATH` | Custom path to the `traecli` binary |
-| `MULTICA_TRAECLI_MODEL` | Override the Trae CLI model used |
-
-### Self-Hosted Server
-
-When connecting to a self-hosted Multica instance, point the CLI to your server before logging in:
-
-```bash
-export MULTICA_APP_URL=https://app.example.com
-export MULTICA_SERVER_URL=wss://api.example.com/ws
-
-multica login
-multica daemon start
-```
-
-Or set them persistently:
-
-```bash
-multica config set app_url https://app.example.com
-multica config set server_url wss://api.example.com/ws
-```
-
-### Profiles
-
-Profiles let you run multiple daemons on the same machine — for example, one for production and one for a staging server.
-
-```bash
-# Set up a staging profile
-multica setup self-host --profile staging --server-url https://api-staging.example.com --app-url https://staging.example.com
-
-# Start its daemon
-multica daemon start --profile staging
-
-# Default profile runs separately
-multica daemon start
-```
-
-Each profile gets its own config directory (`~/.multica/profiles/<name>/`), daemon state, health port, and workspace root.
-
-## Workspaces
-
-### List Workspaces
-
-```bash
-multica workspace list
-```
-
-Watched workspaces are marked with `*`. The daemon only processes tasks for watched workspaces.
-
-### Watch / Unwatch
-
-```bash
-multica workspace watch <workspace-id>
-multica workspace unwatch <workspace-id>
-```
-
-### Get Details
-
-```bash
-multica workspace get <workspace-id>
-multica workspace get <workspace-id> --output json
-```
-
-### List Members
-
-```bash
-multica workspace member list <workspace-id>
-```
-
-### Invite Member
-
-按邮箱邀请成员加入 workspace。被邀请人会收到一条待接受(pending)的邀请,接受后才真正加入——不是即时添加。workspace 参数可选,接受完整 UUID、slug 或短 UUID 前缀(≥4 位十六进制),省略时用当前默认 workspace(`--workspace-id` / `MULTICA_WORKSPACE_ID` / profile 默认)。
-
-```bash
-multica workspace member invite [email protected]
-multica workspace member invite [email protected] <workspace-id> --role admin
-multica workspace member invite [email protected] --output json
-```
-
-`--role` 默认 `member`,可传 `admin`;不允许邀请 `owner`。目前只支持邮箱标识(不做用户名/工号解析)。若该邮箱已是成员或已有待接受邀请,服务端返回 409 并给出对应提示。
-
-### Update Workspace
-
-需要 admin 或 owner 权限。所有字段都是部分更新(PATCH 语义):未传的字段保持不变。
-
-```bash
-multica workspace update <workspace-id> --name "Acme Eng"
-multica workspace update <workspace-id> \
- --description "Engineering team workspace" \
- --issue-prefix ENG
-```
-
-长文本走 stdin(保留换行/反斜杠):
-
-```bash
-cat <<'CTX' | multica workspace update <workspace-id> --context-stdin
-我们是一支 5 人 AI-native 团队。
-工作语言:中文 + 英文混合。
-CTX
-```
-
-可编辑字段:`--name`、`--description` / `--description-stdin`、`--context` / `--context-stdin`、`--issue-prefix`。`slug` 创建后只读,不暴露在 CLI。`--description` 与 `--description-stdin`(以及 `context` 同名对)互斥。未传任何字段 flag 时命令拒绝执行,避免空 PATCH 触发无意义的 workspace 更新事件。`--issue-prefix ""` 也会被拒绝:当前后端在 prefix 为空时静默跳过该字段,CLI 在本地拦下避免“看似成功的 no-op”。
-
-## Issues
-
-### List Issues
-
-```bash
-multica issue list
-multica issue list --status in_progress
-multica issue list --priority urgent --assignee "Agent Name"
-multica issue list --assignee-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-multica issue list --full-id
-multica issue list --limit 20 --output json
-```
-
-表格输出默认显示可直接复制到后续命令的 issue `KEY`(例如 `MUL-123`);需要完整 UUID 时使用 `--full-id`。Available filters: `--status`, `--priority`, `--assignee` / `--assignee-id`, `--project`, `--limit`. 在重名 workspace 下用 `--assignee-id <uuid>` 可以精确锁定一个成员或 agent。
-
-### Get Issue
-
-```bash
-multica issue get MUL-123
-multica issue get <uuid>
-multica issue get <id> --output json
-```
-
-`<id>` 同时接受 issue key(`multica issue list` 表格里直接显示,例如 `MUL-123`)和完整 UUID(给 `list` 加 `--full-id` 可显示)。同样的规则适用于下面 `update` / `assign` / `status` / `comment` / `subscriber` / `runs` 等接受 `<id>` 的命令。
-
-### Create Issue
-
-```bash
-multica issue create --title "Fix login bug" --description "..." --priority high --assignee "Lambda"
-multica issue create --title "Fix login bug" --assignee-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-```
-
-Flags: `--title` (required), `--description`, `--status`, `--priority`, `--assignee` / `--assignee-id`, `--parent`, `--project`, `--due-date`. 脚本里如果已经拿到了 UUID(例如来自 `multica workspace member list --output json`),传 `--assignee-id <uuid>`(与 `--assignee` 互斥)以精确锁定。
-
-### Update Issue
-
-```bash
-multica issue update <id> --title "New title" --priority urgent
-```
-
-### Assign Issue
-
-```bash
-multica issue assign <id> --to "Lambda"
-multica issue assign <id> --to-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d
-multica issue assign <id> --unassign
-```
-
-`--to-id <uuid>`(与 `--to` 互斥)按 UUID 精确分配;适合重名 workspace 下脚本化场景。
-
-### Change Status
-
-```bash
-multica issue status <id> in_progress
-```
-
-Valid statuses: `backlog`, `todo`, `in_progress`, `in_review`, `done`, `blocked`, `cancelled`.
-
-### Comments
-
-```bash
-# List comments
-multica issue comment list <issue-id>
-
-# Add a comment
-multica issue comment add <issue-id> --content "Looks good, merging now"
-
-# Reply to a specific comment
-multica issue comment add <issue-id> --parent <comment-id> --content "Thanks!"
-
-# Delete a comment
-multica issue comment delete <comment-id>
-```
-
-### Execution History
-
-```bash
-# List all execution runs for an issue
-multica issue runs <issue-id>
-multica issue runs <issue-id> --full-id
-multica issue runs <issue-id> --output json
-
-# View messages for a specific execution run
-multica issue run-messages <task-id>
-multica issue run-messages <short-task-id> --issue <issue-id>
-multica issue run-messages <task-id> --output json
-
-# Incremental fetch (only messages after a given sequence number)
-multica issue run-messages <task-id> --since 42 --output json
-```
-
-`runs` 的表格输出默认显示 task UUID 短前缀;需要完整 task UUID 时使用 `--full-id`。`run-messages` 可直接接受完整 task UUID;从 `runs` 表格复制短前缀时需要同时传 `--issue <issue-id>`,CLI 只会在该 issue 的 runs 内解析。
-
-## Projects
-
-Projects group related issues (e.g. a sprint, an epic, a workstream). Every project
-belongs to a workspace and can optionally have a lead (member or agent).
-
-### List Projects
-
-```bash
-multica project list
-multica project list --status in_progress
-multica project list --output json
-```
-
-Available filters: `--status`.
-
-### Get Project
-
-```bash
-multica project get <id>
-multica project get <id> --output json
-```
-
-### Create Project
-
-```bash
-multica project create --title "2026 Week 16 Sprint" --icon "🏃" --lead "Lambda"
-```
-
-Flags: `--title` (required), `--description`, `--status`, `--icon`, `--lead`, `--start-date`, `--due-date`。日期是日历日(`YYYY-MM-DD`)。
-
-### Update Project
-
-```bash
-multica project update <id> --title "New title" --status in_progress
-multica project update <id> --lead "Lambda"
-multica project update <id> --due-date 2026-04-15
-```
-
-Flags: `--title`, `--description`, `--status`, `--icon`, `--lead`, `--start-date`, `--due-date`。日期传空字符串(如 `--start-date ""`)可清除。
-
-### Change Status
-
-```bash
-multica project status <id> in_progress
-```
-
-Valid statuses: `planned`, `in_progress`, `paused`, `completed`, `cancelled`.
-
-### Delete Project
-
-```bash
-multica project delete <id>
-```
-
-### Associating Issues with Projects
-
-Use the `--project` flag on `issue create` / `issue update` to attach an issue to a
-project, or on `issue list` to filter issues by project:
-
-```bash
-multica issue create --title "Login bug" --project <project-id>
-multica issue update <issue-id> --project <project-id>
-multica issue list --project <project-id>
-```
-
-## Configuration
-
-### View Config
-
-```bash
-multica config show
-```
-
-Shows config file path, server URL, app URL, and default workspace.
-
-### Set Values
-
-```bash
-multica config set server_url wss://api.example.com/ws
-multica config set app_url https://app.example.com
-multica config set workspace_id <workspace-id>
-```
-
-## Other Commands
-
-```bash
-multica version # Show CLI version and commit hash
-multica update # Update to latest version
-multica agent list # List agents in the current workspace
-```
-
-## Output Formats
-
-Most commands support `--output` with two formats:
-
-- `table` — human-readable table (default for list commands)
-- `json` — structured JSON (useful for scripting and automation)
-
-```bash
-multica issue list --output json
-multica daemon status --output json
-```
diff --git a/apps/docs/content/docs/cloud-quickstart.ja.mdx b/apps/docs/content/docs/cloud-quickstart.ja.mdx
index ae3e4e994e..4a0df16edc 100644
--- a/apps/docs/content/docs/cloud-quickstart.ja.mdx
+++ b/apps/docs/content/docs/cloud-quickstart.ja.mdx
@@ -1,119 +1,95 @@
---
-title: Cloud クイックスタート
-description: サインアップからエージェントへの最初のタスク割り当てまで 5 分で。
+title: クイックスタート
+description: コンピュータを接続し、最初のエージェントを作成して、最初のタスクを完了させます。
---
import { Callout } from "fumadocs-ui/components/callout";
-このページは Multica Cloud を最初から最後まで案内します — **サインアップ → [CLI](/cli) のインストール → [デーモン](/daemon-runtimes)の起動 → [エージェント](/agents)の作成 → 最初の[タスク](/tasks)の割り当て**。約 5 分かかります。
-
-前提条件は 1 つだけです: ローカルに [AI コーディングツール](/providers)([Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code) のいずれか)を少なくとも 1 つ、すでにインストールしておくこと。デーモンは起動時にこれらを自動検出し、1 つもなければ起動を拒否します。
-
-## 1. アカウントを作成する
-
-[multica.ai](https://multica.ai) でサインアップしてください。メール(6 桁の確認コード)または Google でログインできます。
-
-サインアップ後は(アカウント名から生成された)デフォルトのワークスペースに自動的に配置されます。後で名前を変更したり、新しいワークスペースを作成したりできます。
-
-## 2. Multica CLI をインストールする
+<Callout type="info">
+エージェントが実行するには、実行するコンピュータに Claude Code、Codex、Cursor などの[サポートされている AI コーディングツール](/providers)が少なくとも 1 つインストールされ、ログイン済みである必要があります。Multica にこれらのツールは同梱されていません。
+</Callout>
-**macOS / Linux(Homebrew 推奨)**:
+## 1. ログインしてワークスペースに入る
-```bash
-brew install multica-ai/tap/multica
-```
+Web([multica.ai](https://multica.ai))または [Multica Desktop](https://multica.ai/download) でログインします。メール認証コードと Google に対応しています。
-**macOS / Linux(Homebrew なし)**:
+- **Desktop**:このコンピュータを自動で接続できます。
+- **Web**:次のステップでコマンドラインから接続します。
-```bash
-curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
-```
+## 2. コンピュータを接続する
-**Windows(PowerShell)**:
+エージェントは接続されたコンピュータ上で作業を実行します。サイドバー下部の **設定 → ランタイム** を開きます。
-```powershell
-irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
-```
+- **Desktop の場合**:Desktop がこのコンピュータをランタイムとして自動登録し、インストール済みの AI コーディングツールを検出します。インストールしたばかりのツールは、「更新」をクリックして再検出します。
+- **Web の場合、または別のコンピュータを追加する場合**:右上の **コンピュータを追加** をクリックし、ダイアログに表示される 2 つのコマンドを対象コンピュータのターミナルで実行します。
-インストールを確認します。
+ **macOS / Linux**
-```bash
-multica version
-```
+ ```bash
+ curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
+ multica setup
+ ```
-## 3. ログイン + デーモンの起動
+ **Windows PowerShell**
-コマンド 1 つでログインとデーモンの起動を処理します。
+ ```powershell
+ irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+ multica setup
+ ```
-```bash
-multica setup
-```
+ `multica setup` はブラウザを開いてログインを完了し、その後デーモンをバックグラウンドで実行し続けます。デーモンがオンラインになると、通常 1 分以内にダイアログがこのコンピュータを検出します。
-`multica setup` は次を実行します。
+**成功の目安**:ランタイム一覧にオンラインのコンピュータが表示されます。
-1. CLI が Multica Cloud に接続するよう構成します
-2. ログインのためにブラウザを開きます(Web と同じメール確認コード / Google OAuth)
-3. 生成された PAT を `~/.multica/config.json` に保存します
-4. **デーモンを自動的に起動します** — 3 秒ごとにタスクをポーリングし、15 秒ごとにハートビートを送信し始めます
+![「コンピュータを追加」ダイアログ:2 つのコマンドと検出待ちの案内](/images/docs/quickstart-add-computer.png)
<Callout type="info">
-**デスクトップアプリを使用していますか?** デスクトップアプリは起動時に**デーモンを自動的に起動します** — `multica setup` を手動で実行する必要はありません。[デスクトップアプリ](/desktop-app)を参照してください。
+セルフホストインスタンスでは接続コマンドが少し異なります。[セルフホストクイックスタート](/self-host-quickstart)を参照してください。
</Callout>
-デーモンが実行中かどうかを確認します。
-
-```bash
-multica daemon status
-```
-
-`online` はサーバーに登録されたことを意味します。
+## 3. エージェントを作成する
-## 4. ランタイムがオンラインか確認する
+サイドバーの **ワークスペース → エージェント** を開き、**新規エージェント** をクリックして、どちらかの方法を選びます。
-Web UI で **Settings → Runtimes** に移動します。先ほど起動したデーモンが、1 つ以上のアクティブなランタイムとして表示されるはずです — ローカルにインストールされた AI コーディングツールごとに 1 つです。
+- **空白から始める**:自分でフィールドを入力します。最低限必要なのは名前だけで、あとはランタイムと AI コーディングツールを確認すれば作成できます。
+- **AI で作成**:欲しいエージェントを説明すると、Agent Builder が質問しながら設定を生成します。この方法にはオンラインのランタイムが必要です。
-オフラインと表示されても慌てないでください — [トラブルシューティング → デーモンがサーバーに接続できない](/troubleshooting#daemon-cant-connect-to-the-server)を参照してください。
+残りの設定は後から整えられます。詳しくは[エージェントの作成と構成](/agents-create)を参照してください。
-## 5. エージェントを作成する
+**成功の目安**:エージェント一覧に作成したエージェントが表示され、オンラインと表示されます。
-Web UI で **Settings → Agents** に移動し、**New Agent** をクリックします。
+![エージェント作成の開始方法の選択画面:「Start blank」と「Build with AI」](/images/docs/quickstart-new-agent.png)
-- **Name** — ボードやコメントでこのエージェントに表示される名前です。好きな名前を選んでください
-- **Provider** — ローカルにインストールした AI コーディングツールを選択します(ドロップダウンにはランタイムで検出されたツールのみが表示されます)
-- **Model**(任意) — そのツール内部のモデル選択(プロバイダーによって静的な一覧または動的探索)
-- **Instructions**(任意) — このエージェントのためのシステムプロンプト
+## 4. 最初のイシューを任せる
-作成されると、エージェントはワークスペースのメンバー一覧に表示され、人間のメンバーと同じように作業を割り当てられます。
+サイドバー上部の **新規イシュー** をクリックします(またはショートカット `C`)。デフォルトのエージェントモードでは次のように進めます。
-## 6. 最初のタスクを割り当てる
+1. **作成者** で、作成したばかりのエージェントを選択します。
+2. やってほしいことを一言二言で説明します。例:「このワークスペースの使い方を紹介して」。
+3. 送信します。Multica がイシューを作成し、エージェントを担当者に設定して、すぐに実行を開始します。
-Web UI でイシューを作成するか、CLI から作成します。
+![新規イシューダイアログのエージェントモード:Created by に Multica Assistant が選択されている](/images/docs/quickstart-new-issue.png)
-```bash
-multica issue create --title "Add an ASCII architecture diagram to the README"
-```
+## 5. 進捗と結果を確認する
-先ほど作成したエージェントにイシューを割り当てます — Web UI でアバターをクリックするか、CLI を使用します。
+送信後にそのイシューを開きます。実行ログには実行のステータスが表示され、エージェントの進捗と返信はタイムラインに表示されます。
-```bash
-multica issue assign MUL-1 --to my-agent-name
-```
+**成功の目安**:実行ログのステータスが「完了」に変わり、タイムラインにエージェントの返信が表示されます。全過程を確認するには、「トランスクリプトを表示」をクリックします。
-`--to` はエージェントまたはメンバーの**名前**を受け取ります。部分文字列の一致も機能します — エージェント名が `my-code-reviewer` なら、`reviewer` でそれに解決されます。ワークスペースに名前が重複している場合は、代わりに `--to-id <uuid>`(`--to` と相互排他)を渡してください。UUID は `multica agent list --output json` または `multica workspace member list --output json` で調べられます。
+![イシュー内のエージェントの返信と完了した実行ログ](/images/docs/quickstart-run-result.png)
-**次にデーモンで起きること**:
+## よくある問題
-1. 3 秒以内にタスクを取得します(ステータスが `queued` から `dispatched` に変わります)
-2. 一致する AI コーディングツールを呼び出して作業を開始します(ステータスが `running` になります)
-3. AI がローカルで作業します — コードディレクトリを読んだり、コマンドを実行したり、ファイルを編集したりできます
-4. 完了すると結果を Multica に報告します(自動リトライが作動するかどうかに応じて、ステータスが `completed` または `failed` になります)
+| 症状 | まず確認すること |
+|---|---|
+| ランタイムが見つからない | AI コーディングツールがインストール済みで、ターミナルから実行できることを確認します。Desktop では「更新」をクリックし、CLI の場合は `multica setup` を再実行します。 |
+| ランタイムがオフラインと表示される | Desktop を開いたままにします。CLI の場合は `multica daemon status` を実行し、起動していなければ `multica daemon start` を実行します。 |
+| イシューがキューに入ったまま | エージェントが使うランタイムがオンラインであることを確認します。ランタイムが同時実行の上限に達している場合、新しいタスクはキューで待機し続けます。 |
-Web UI は**リアルタイムで**(WebSocket を通じて)更新されます — 再読み込みは不要です。
+その他のケースは[トラブルシューティング](/troubleshooting)を参照してください。
## 次のステップ
-- [デーモンとランタイム](/daemon-runtimes) — デーモンがどう動作するかとランタイムの意味
-- [タスク](/tasks) — タスクのライフサイクルとリトライルール
-- [AI コーディングツール比較](/providers) — 16 個のツール間の機能差
-- [デスクトップアプリ](/desktop-app) — デーモンを自分で実行したくない場合
-- [セルフホストクイックスタート](/self-host-quickstart) — 自前のバックエンドを実行する
+- [コアコンセプト](/concepts) — Multica のすべてのコアオブジェクトを 3 分で把握する。
+- [Multica の仕組み](/how-multica-works) — イシュー、エージェント、ランタイム、各実行の関係を理解する。
+- [エージェントに仕事を任せる](/triggering-agents) — 割り当てのほかに、@コメント、チャット、オートパイロットという 3 つのトリガー方法。
diff --git a/apps/docs/content/docs/cloud-quickstart.ko.mdx b/apps/docs/content/docs/cloud-quickstart.ko.mdx
index 287ece8d16..dbe68f480b 100644
--- a/apps/docs/content/docs/cloud-quickstart.ko.mdx
+++ b/apps/docs/content/docs/cloud-quickstart.ko.mdx
@@ -1,119 +1,95 @@
---
-title: Cloud 빠른 시작
-description: 가입부터 에이전트에게 첫 작업을 할당하기까지 5분 만에.
+title: 빠른 시작
+description: 컴퓨터를 연결하고 첫 에이전트를 만든 뒤 첫 태스크를 완료하게 합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-이 페이지는 Multica Cloud를 처음부터 끝까지 안내합니다 — **가입 → [CLI](/cli) 설치 → [데몬](/daemon-runtimes) 시작 → [에이전트](/agents) 생성 → 첫 [작업](/tasks) 할당**. 약 5분이 걸립니다.
-
-전제 조건은 하나뿐입니다: 로컬에 [AI 코딩 도구](/providers)([Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code) 중 하나)를 이미 최소 하나는 설치해 두어야 합니다. 데몬은 시작할 때 이들을 자동으로 감지하며, 하나도 없으면 시작을 거부합니다.
-
-## 1. 계정 만들기
-
-[multica.ai](https://multica.ai)에서 가입하세요. 이메일(6자리 인증 코드) 또는 Google로 로그인할 수 있습니다.
-
-가입 후에는 (계정 이름으로 생성된) 기본 워크스페이스에 자동으로 배치됩니다. 나중에 이름을 변경하거나 새 워크스페이스를 만들 수 있습니다.
-
-## 2. Multica CLI 설치하기
+<Callout type="info">
+에이전트를 실행하기 전에 해당 컴퓨터에 Claude Code, Codex, Cursor 같은 [지원되는 AI 코딩 도구](/providers)가 하나 이상 설치되어 있고 로그인되어 있어야 합니다. Multica에는 이 도구들이 포함되어 있지 않습니다.
+</Callout>
-**macOS / Linux (Homebrew 권장)**:
+## 1. 로그인하고 워크스페이스 열기
-```bash
-brew install multica-ai/tap/multica
-```
+Web([multica.ai](https://multica.ai)) 또는 [Multica Desktop](https://multica.ai/download)에서 로그인합니다. 이메일 인증 코드와 Google 로그인을 지원합니다.
-**macOS / Linux (Homebrew 없이)**:
+- **Desktop**: 현재 컴퓨터를 자동으로 연결할 수 있습니다.
+- **Web**: 다음 단계에서 명령줄을 통해 연결해야 합니다.
-```bash
-curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
-```
+## 2. 컴퓨터 연결
-**Windows (PowerShell)**:
+에이전트는 연결된 컴퓨터에서 작업을 실행합니다. 사이드바 아래쪽의 **설정 → 런타임**을 엽니다.
-```powershell
-irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
-```
+- **Desktop 사용**: Desktop이 이 컴퓨터를 런타임으로 자동 등록하고 설치된 AI 코딩 도구를 감지합니다. 도구를 방금 설치했다면 "새로고침"을 클릭해 다시 감지하세요.
+- **Web을 사용하거나 다른 컴퓨터를 추가해야 하는 경우**: 오른쪽 위의 **컴퓨터 추가**를 클릭하고 대상 컴퓨터의 터미널에서 팝업에 표시된 두 명령을 실행합니다.
-설치를 확인하세요:
+ **macOS / Linux**
-```bash
-multica version
-```
+ ```bash
+ curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
+ multica setup
+ ```
-## 3. 로그인 + 데몬 시작하기
+ **Windows PowerShell**
-명령어 하나로 로그인과 데몬 시작을 처리합니다:
+ ```powershell
+ irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+ multica setup
+ ```
-```bash
-multica setup
-```
+ `multica setup`이 브라우저를 열어 로그인을 마친 뒤 데몬을 백그라운드에서 실행합니다. 데몬이 온라인이 되면 보통 1분 안에 팝업이 이 컴퓨터를 자동으로 감지합니다.
-`multica setup`은 다음을 수행합니다:
+**성공 기준**: 런타임 목록에 온라인 컴퓨터가 표시됩니다.
-1. CLI가 Multica Cloud에 연결하도록 구성합니다
-2. 로그인을 위해 브라우저를 엽니다(웹과 동일한 이메일 인증 코드 / Google OAuth)
-3. 생성된 PAT를 `~/.multica/config.json`에 저장합니다
-4. **데몬을 자동으로 시작합니다** — 3초마다 작업을 폴링하고 15초마다 하트비트를 전송하기 시작합니다
+![컴퓨터 추가 팝업: 두 명령과 감지 대기 안내](/images/docs/quickstart-add-computer.png)
<Callout type="info">
-**데스크톱 앱을 사용 중이신가요?** 데스크톱 앱은 실행 시 **데몬을 자동으로 시작합니다** — `multica setup`을 직접 실행할 필요가 없습니다. [데스크톱 앱](/desktop-app)을 참고하세요.
+자체 호스팅 인스턴스의 연결 명령은 조금 다릅니다. [자체 호스팅 빠른 시작](/self-host-quickstart)을 참고하세요.
</Callout>
-데몬이 실행 중인지 확인하세요:
-
-```bash
-multica daemon status
-```
-
-`online`은 서버에 등록되었음을 의미합니다.
+## 3. 에이전트 만들기
-## 4. 런타임이 온라인인지 확인하기
+사이드바에서 **워크스페이스 → 에이전트**를 열고 **새 에이전트**를 클릭한 뒤 방법을 선택합니다.
-웹 UI에서 **설정 → 런타임**으로 이동하세요. 방금 시작한 데몬이 하나 이상의 활성 런타임으로 표시되어야 합니다 — 로컬에 설치된 AI 코딩 도구당 하나씩입니다.
+- **빈 상태로 시작**: 필드를 직접 입력합니다. 최소한 이름만 입력하고 런타임과 AI 코딩 도구를 확인하면 만들 수 있습니다.
+- **AI로 만들기**: 원하는 내용을 설명하면 Agent Builder가 질문하고 설정을 생성합니다. 이 방법에는 온라인 런타임이 필요합니다.
-오프라인으로 표시되더라도 당황하지 마세요 — [문제 해결 → 데몬이 서버에 연결할 수 없음](/troubleshooting#daemon-cant-connect-to-the-server)을 참고하세요.
+나머지 설정은 나중에 보완할 수 있습니다. [에이전트 생성 및 설정](/agents-create)을 참고하세요.
-## 5. 에이전트 생성하기
+**성공 기준**: 에이전트 목록에 만든 에이전트가 온라인으로 표시됩니다.
-웹 UI에서 **설정 → 에이전트**로 이동하여 **새 에이전트**를 클릭하세요:
+![에이전트 생성 시작 방법 선택: Start blank와 Build with AI](/images/docs/quickstart-new-agent.png)
-- **이름** — 보드와 댓글에서 이 에이전트에 표시되는 이름입니다. 원하는 이름을 고르세요
-- **제공자** — 로컬에 설치한 AI 코딩 도구를 선택하세요(드롭다운에는 런타임에서 감지된 도구만 나열됩니다)
-- **모델**(선택) — 해당 도구 내부의 모델 선택(제공자에 따라 정적 목록 또는 동적 발견)
-- **지침**(선택) — 이 에이전트를 위한 시스템 프롬프트
+## 4. 첫 이슈 맡기기
-생성되면 에이전트는 워크스페이스 멤버 목록에 나타나며, 사람 멤버처럼 작업을 할당할 수 있습니다.
+사이드바 위쪽의 **새 이슈**를 클릭하거나 단축키 `C`를 누릅니다. 기본 에이전트 모드에서 다음과 같이 진행합니다.
-## 6. 첫 작업 할당하기
+1. **생성자**에서 방금 만든 에이전트를 선택합니다.
+2. "이 워크스페이스를 어떻게 활용할 수 있는지 소개해 줘"처럼 할 일을 한두 문장으로 설명합니다.
+3. 제출합니다. Multica가 이슈를 만들고 에이전트를 담당자로 지정한 뒤 즉시 실행을 시작합니다.
-웹 UI에서 이슈를 만들거나, CLI에서 만드세요:
+![새 이슈 팝업의 에이전트 모드: Created by에 Multica Assistant가 선택된 모습](/images/docs/quickstart-new-issue.png)
-```bash
-multica issue create --title "Add an ASCII architecture diagram to the README"
-```
+## 5. 진행 상황과 결과 확인
-방금 만든 에이전트에게 이슈를 할당하세요 — 웹 UI에서 아바타를 클릭하거나, CLI를 사용하세요:
+제출 후 해당 이슈를 엽니다. 실행 로그에는 실행 상태가 표시되고 에이전트의 진행 상황과 답변은 타임라인에 나타납니다.
-```bash
-multica issue assign MUL-1 --to my-agent-name
-```
+**성공 기준**: 실행 로그 상태가 "완료됨"으로 바뀌고 타임라인에 에이전트의 답변이 나타납니다. 전체 과정을 확인하려면 "트랜스크립트 보기"를 클릭하세요.
-`--to`는 에이전트 또는 멤버의 **이름**을 받습니다. 부분 문자열 일치도 동작합니다 — 에이전트 이름이 `my-code-reviewer`라면 `reviewer`로 해석됩니다. 워크스페이스에 이름이 겹치는 경우, 대신 `--to-id <uuid>`(`--to`와 상호 배타적)를 전달하세요. UUID는 `multica agent list --output json` 또는 `multica workspace member list --output json`으로 조회하세요.
+![이슈의 에이전트 답변과 완료된 실행 로그](/images/docs/quickstart-run-result.png)
-**다음으로 데몬에서 일어나는 일**:
+## 자주 묻는 문제
-1. 3초 이내에 작업을 가져갑니다(상태가 `queued`에서 `dispatched`로 바뀝니다)
-2. 일치하는 AI 코딩 도구를 호출하여 작업을 시작합니다(상태가 `running`이 됩니다)
-3. AI가 로컬에서 작업합니다 — 코드 디렉터리를 읽고, 명령을 실행하고, 파일을 편집할 수 있습니다
-4. 완료되면 결과를 Multica로 다시 보고합니다(자동 재시도 동작 여부에 따라 상태가 `completed` 또는 `failed`가 됩니다)
+| 증상 | 먼저 확인할 사항 |
+|---|---|
+| 런타임을 찾지 못함 | AI 코딩 도구가 설치되어 있고 터미널에서 실행되는지 확인합니다. Desktop에서는 "새로고침"을 클릭하고 CLI 방식에서는 `multica setup`을 다시 실행합니다. |
+| 런타임이 오프라인으로 표시됨 | Desktop을 계속 열어 둡니다. CLI 방식에서는 `multica daemon status`를 실행하고 시작되지 않았다면 `multica daemon start`를 실행합니다. |
+| 이슈가 계속 큐에서 대기함 | 에이전트가 사용하는 런타임이 온라인인지 확인합니다. 런타임이 동시 실행 상한에 도달하면 새 태스크는 계속 대기합니다. |
-웹 UI는 **실시간으로**(WebSocket을 통해) 업데이트됩니다 — 새로 고침이 필요 없습니다.
+더 많은 경우는 [문제 해결](/troubleshooting)을 참고하세요.
## 다음 단계
-- [데몬과 런타임](/daemon-runtimes) — 데몬이 어떻게 동작하는지와 런타임의 의미
-- [작업](/tasks) — 작업 생명주기와 재시도 규칙
-- [AI 코딩 도구 비교](/providers) — 16개 도구 간의 기능 차이
-- [데스크톱 앱](/desktop-app) — 데몬을 직접 실행하고 싶지 않은 경우
-- [자체 호스팅 빠른 시작](/self-host-quickstart) — 자체 백엔드 실행하기
+- [핵심 개념](/concepts) — 3분 안에 Multica의 모든 핵심 객체를 알아봅니다.
+- [Multica의 작동 방식](/how-multica-works) — 이슈, 에이전트, 런타임, 각 실행의 관계를 이해합니다.
+- [에이전트에게 작업 맡기기](/triggering-agents) — 할당 외에 @댓글, 대화, 오토파일럿으로 트리거하는 세 가지 방법을 알아봅니다.
diff --git a/apps/docs/content/docs/cloud-quickstart.mdx b/apps/docs/content/docs/cloud-quickstart.mdx
index d30fcf8178..c1e8cfd6e8 100644
--- a/apps/docs/content/docs/cloud-quickstart.mdx
+++ b/apps/docs/content/docs/cloud-quickstart.mdx
@@ -1,119 +1,95 @@
---
-title: Cloud quickstart
-description: From sign-up to assigning your first task to an agent in 5 minutes.
+title: Quickstart
+description: Connect a computer, create your first agent, and have it complete its first task.
---
import { Callout } from "fumadocs-ui/components/callout";
-This page walks you end-to-end through Multica Cloud — **sign up → install the [CLI](/cli) → start the [daemon](/daemon-runtimes) → create an [agent](/agents) → assign your first [task](/tasks)**. Takes about 5 minutes.
-
-One prerequisite: you already have at least one [AI coding tool](/providers) installed locally ([Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), or [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code)). The daemon auto-detects them on startup and refuses to start if none are present.
-
-## 1. Create an account
-
-Sign up at [multica.ai](https://multica.ai). You can log in with email (6-digit verification code) or Google.
-
-After sign-up you're automatically placed in a default workspace (generated from your account name). You can rename it later, or create new workspaces.
-
-## 2. Install the Multica CLI
+<Callout type="info">
+Before an agent can execute, the computer that runs it needs at least one [supported AI coding tool](/providers) installed and signed in — for example Claude Code, Codex, or Cursor. Multica does not ship these tools.
+</Callout>
-**macOS / Linux (Homebrew recommended)**:
+## 1. Sign in and open your workspace
-```bash
-brew install multica-ai/tap/multica
-```
+Sign in on the web ([multica.ai](https://multica.ai)) or with [Multica Desktop](https://multica.ai/download). Email verification codes and Google are both supported.
-**macOS / Linux (no Homebrew)**:
+- **Desktop**: can connect this computer automatically.
+- **Web**: connect from the command line in the next step.
-```bash
-curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
-```
+## 2. Connect a computer
-**Windows (PowerShell)**:
+Agents execute work on the computers you connect. Open **Configure → Runtimes** at the bottom of the sidebar:
-```powershell
-irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
-```
+- **With Desktop**: Desktop automatically registers this computer as a runtime and detects the installed AI coding tools. For a tool you just installed, click **Refresh** to detect it again.
+- **With Web, or to add another computer**: click **Add a computer** in the top right, then run the two commands from the dialog in a terminal on the target computer:
-Verify the install:
+ **macOS / Linux**
-```bash
-multica version
-```
+ ```bash
+ curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
+ multica setup
+ ```
-## 3. Log in + start the daemon
+ **Windows PowerShell**
-A single command handles login and starts the daemon:
+ ```powershell
+ irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+ multica setup
+ ```
-```bash
-multica setup
-```
+ `multica setup` opens a browser to complete sign-in, then leaves the daemon running in the background. Once the daemon is online, the dialog usually detects the computer within a minute.
-`multica setup` will:
+**Success check**: an online computer appears in the runtime list.
-1. Configure the CLI to connect to Multica Cloud
-2. Open your browser for login (same email verification code / Google OAuth as the web)
-3. Store the generated PAT in `~/.multica/config.json`
-4. **Start the daemon automatically** — it begins polling for tasks every 3 seconds and sending heartbeats every 15 seconds
+![Add a computer dialog: two commands and the waiting-for-detection notice](/images/docs/quickstart-add-computer.png)
<Callout type="info">
-**Using the desktop app?** The desktop app **starts the daemon automatically** on launch — no need to run `multica setup` by hand. See [Desktop app](/desktop-app).
+The connection commands differ slightly on self-hosted instances — see the [Self-host quickstart](/self-host-quickstart).
</Callout>
-Verify the daemon is running:
-
-```bash
-multica daemon status
-```
-
-`online` means it has registered with the server.
+## 3. Create an agent
-## 4. Verify the runtime is online
+Open **Workspace → Agents** in the sidebar, click **New agent**, and pick a path:
-In the web UI, go to **Settings → Runtimes**. The daemon you just started should appear as one or more active runtimes — one per AI coding tool installed locally.
+- **Start blank**: fill in the fields yourself. Only a name is strictly required — confirm the runtime and AI coding tool, then create.
+- **Build with AI**: describe what you want, and the Agent Builder asks questions and generates the configuration. This path needs an online runtime.
-If it shows as offline, don't panic — see [Troubleshooting → Daemon can't connect to the server](/troubleshooting#daemon-cant-connect-to-the-server).
+Everything else can be refined later — see [Create and configure agents](/agents-create).
-## 5. Create an agent
+**Success check**: your agent appears in the agent list and shows as online.
-In the web UI, go to **Settings → Agents** and click **New Agent**:
+![Agent creation starting-point picker: Start blank and Build with AI](/images/docs/quickstart-new-agent.png)
-- **Name** — the name shown for this agent on boards and in comments. Pick something you like
-- **Provider** — choose an AI coding tool you have installed locally (the dropdown only lists tools detected by your runtimes)
-- **Model** (optional) — the model selection inside that tool (a static list or dynamic discovery, depending on the provider)
-- **Instructions** (optional) — system prompt for this agent
+## 4. Hand it your first issue
-Once created, the agent shows up in your workspace member list and can be assigned work like a human member.
+Click **New Issue** at the top of the sidebar (or press `C`). In the default agent mode:
-## 6. Assign your first task
+1. Under **Created by**, select the agent you just created.
+2. Describe the work in a sentence or two, for example "Explain how this workspace can be used."
+3. Submit. Multica creates the issue, sets the agent as the assignee, and starts executing immediately.
-Create an issue in the web UI, or from the CLI:
+![New issue dialog in agent mode: Created by set to Multica Assistant](/images/docs/quickstart-new-issue.png)
-```bash
-multica issue create --title "Add an ASCII architecture diagram to the README"
-```
+## 5. Watch progress and results
-Assign the issue to the agent you just created — click its avatar in the web UI, or use the CLI:
+After submitting, open the issue: the execution log shows the run status, and the agent's progress and replies appear in the timeline.
-```bash
-multica issue assign MUL-1 --to my-agent-name
-```
+**Success check**: the execution log status changes to Completed and the agent's reply appears in the timeline. To see the full transcript, click **View transcript**.
-`--to` takes the **name** of an agent or member. A substring match works — if the agent is called `my-code-reviewer`, `reviewer` resolves to it. If your workspace has overlapping names, pass `--to-id <uuid>` instead (mutually exclusive with `--to`); look up the UUID via `multica agent list --output json` or `multica workspace member list --output json`.
+![The agent's reply in the issue and a completed execution log](/images/docs/quickstart-run-result.png)
-**What happens next from the daemon**:
+## Common problems
-1. It picks up the task within 3 seconds (status goes from `queued` to `dispatched`)
-2. It invokes the matching AI coding tool to start work (status becomes `running`)
-3. The AI works locally — it may read your code directory, run commands, edit files
-4. When done, it reports the result back to Multica (status becomes `completed` or `failed`, depending on whether auto-retry kicks in)
+| Symptom | Check first |
+|---|---|
+| No runtime found | Confirm the AI coding tool is installed and runs in a terminal. On Desktop, click **Refresh**; on the CLI path, rerun `multica setup`. |
+| Runtime shows offline | Keep Desktop open; on the CLI path, run `multica daemon status`, and `multica daemon start` if it is not running. |
+| Issue stays queued | Confirm the runtime the agent uses is online. When a runtime hits its concurrency limit, new tasks keep queueing. |
-The web UI updates in **real time** (via WebSocket) — no refresh needed.
+For more cases, see [Troubleshooting](/troubleshooting).
## Next steps
-- [Daemon and runtimes](/daemon-runtimes) — how the daemon operates and what runtimes mean
-- [Tasks](/tasks) — task lifecycle and retry rules
-- [AI coding tools compared](/providers) — capability differences across the 16 tools
-- [Desktop app](/desktop-app) — if you'd rather not run the daemon yourself
-- [Self-host quickstart](/self-host-quickstart) — run your own backend
+- [Core concepts](/concepts) — meet all of Multica's core objects in three minutes.
+- [How Multica works](/how-multica-works) — how issues, agents, runtimes, and each run relate.
+- [Put agents to work](/triggering-agents) — beyond assignment: @-mentions, chat, and Autopilots.
diff --git a/apps/docs/content/docs/cloud-quickstart.zh.mdx b/apps/docs/content/docs/cloud-quickstart.zh.mdx
index f2bb68fa40..70b0281dbd 100644
--- a/apps/docs/content/docs/cloud-quickstart.zh.mdx
+++ b/apps/docs/content/docs/cloud-quickstart.zh.mdx
@@ -1,119 +1,95 @@
---
-title: Cloud 快速上手
-description: 5 分钟从注册到给智能体分配第一个任务。
+title: 快速上手
+description: 连接一台电脑,创建你的第一个智能体,并让它完成第一个任务。
---
import { Callout } from "fumadocs-ui/components/callout";
-这一页带你走一遍 Multica Cloud 的端到端流程——**注册 → 装 [命令行工具](/cli) → 启动 [守护进程](/daemon-runtimes) → 创建 [智能体](/agents) → 分配第一个 [任务](/tasks)**,约 5 分钟完成。
-
-前置只有一个:你本地已经装了至少一款 [AI 编程工具](/providers)([Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder) 或 [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code))中的一款。守护进程启动时会自动探测它们,没装任何一个的话守护进程会直接拒绝启动。
-
-## 1. 注册账号
-
-到 [multica.ai](https://multica.ai) 注册账号。可以用邮箱(6 位验证码)或 Google 登录。
-
-注册完成后你会被自动分到一个默认工作区(以你的账号名生成)。之后可以改名字,也可以创建新的工作区。
-
-## 2. 装 Multica 命令行工具
+<Callout type="info">
+智能体执行前,运行它的电脑上需要有至少一款已安装并登录的[支持的 AI 编程工具](/providers),例如 Claude Code、Codex 或 Cursor。Multica 不自带这些工具。
+</Callout>
-**macOS / Linux(推荐走 Homebrew)**:
+## 1. 登录,进入工作区
-```bash
-brew install multica-ai/tap/multica
-```
+用 Web([multica.ai](https://multica.ai))或 [Multica Desktop](https://multica.ai/download) 登录,支持邮箱验证码和 Google。
-**macOS / Linux(没有 Homebrew)**:
+- **Desktop**:可以自动连接这台电脑。
+- **Web**:需要在下一步通过命令行连接。
-```bash
-curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
-```
+## 2. 连接一台电脑
-**Windows(PowerShell)**:
+智能体在你连接的电脑上执行工作。打开侧边栏底部的 **配置 → 运行时**:
-```powershell
-irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
-```
+- **用 Desktop**:Desktop 会自动把这台电脑注册为运行时,并检测已安装的 AI 编程工具。刚安装的工具,点"刷新"重新检测。
+- **用 Web,或需要添加另一台电脑**:点右上角的 **添加电脑**,在目标电脑的终端里运行弹窗给出的两条命令:
-装完验证一下:
+ **macOS / Linux**
-```bash
-multica version
-```
+ ```bash
+ curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
+ multica setup
+ ```
-## 3. 登录 + 启动守护进程
+ **Windows PowerShell**
-一条命令完成登录 + 启动守护进程:
+ ```powershell
+ irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+ multica setup
+ ```
-```bash
-multica setup
-```
+ `multica setup` 会打开浏览器完成登录,然后让守护进程在后台运行。守护进程上线后,弹窗通常在一分钟内自动检测到这台电脑。
-`multica setup` 会:
+**成功标志**:运行时列表里出现一台在线的电脑。
-1. 把命令行工具配置成连接 Multica Cloud
-2. 打开浏览器让你登录(和 Web 登录一样的邮箱验证码 / Google OAuth)
-3. 把生成的 PAT 存到 `~/.multica/config.json`
-4. **自动启动守护进程**——开始每 3 秒轮询任务、每 15 秒发心跳
+![Add a computer 弹窗:两条命令与等待检测提示](/images/docs/quickstart-add-computer.png)
<Callout type="info">
-**用的是桌面应用?** 桌面应用启动时**自动拉起守护进程**,不需要手动跑 `multica setup`。见 [桌面应用](/desktop-app)。
+自托管实例的连接命令略有不同,见[自托管快速上手](/self-host-quickstart)。
</Callout>
-验证守护进程在运行:
-
-```bash
-multica daemon status
-```
-
-看到 `online` 就说明它成功注册到服务器了。
+## 3. 创建一个智能体
-## 4. 验证 Runtime 在线
+打开侧边栏的 **工作区 → 智能体**,点 **新建智能体**,选择一条路径:
-到 Web 界面的 **Settings → Runtimes**,你应该能看到你刚启动的守护进程作为一个或多个活跃 Runtime 列出——每款你本地装好的 AI 编程工具对应一个。
+- **从空白开始**:自己填字段。最少只需要名称,再确认运行时和 AI 编程工具即可创建。
+- **通过 AI 创建**:描述你想要什么,由 Agent Builder 提问并生成配置。这条路径需要一个在线运行时。
-看到"离线"不要慌,先看 [故障排查 → 守护进程连不上服务器](/troubleshooting#守护进程连不上服务器)。
+其余配置可以之后完善,详见[创建和配置智能体](/agents-create)。
-## 5. 创建智能体
+**成功标志**:智能体列表中出现你的智能体,并显示为在线。
-到 Web 界面的 **Settings → Agents**,点 **New Agent**:
+![创建智能体的起点选择页:Start blank 与 Build with AI](/images/docs/quickstart-new-agent.png)
-- **名字**——智能体在看板上、评论里显示的名字,自己起一个
-- **Provider**——选一款你本地装好的 AI 编程工具(下拉里只会出现运行时里检测到的那些)
-- **Model**(可选)——这款工具内部的模型选择(静态列表或动态发现,取决于 provider)
-- **Instructions**(可选)——给这个智能体的系统提示词
+## 4. 把第一个 issue 交给它
-创建完成后智能体就进入你的工作区成员列表,可以像人类成员一样被分配任务。
+点侧边栏顶部的 **新建 issue**(或按快捷键 `C`)。在默认的智能体模式下:
-## 6. 分配第一个任务
+1. 在 **创建者** 中选择刚创建的智能体;
+2. 用一两句话描述要做的事,例如"介绍一下这个工作区可以怎么用";
+3. 提交。Multica 会创建 issue、把智能体设为负责人并立即开始执行。
-在 Web 界面创建一条 issue,或者用命令行:
+![新建 issue 弹窗的智能体模式:Created by 已选中 Multica Assistant](/images/docs/quickstart-new-issue.png)
-```bash
-multica issue create --title "给 README 加一段 ASCII 架构图"
-```
+## 5. 查看进度和结果
-把这条 issue 分配给你刚创建的那个智能体——可以在 Web 上点它的头像,或用命令行:
+提交后打开这条 issue:执行日志显示运行状态,智能体的进展和回复出现在时间线中。
-```bash
-multica issue assign MUL-1 --to my-agent-name
-```
+**成功标志**:执行日志状态变为"已完成",时间线中出现智能体的回复。需要查看完整过程时,点"查看记录"。
-`--to` 后面填智能体或成员的**名字**,子串就行——如果智能体叫 `my-code-reviewer`,填 `reviewer` 也能命中。如果工作区里名字相互重叠或冲突,改用 `--to-id <uuid>`(与 `--to` 互斥);UUID 来自 `multica agent list --output json` 或 `multica workspace member list --output json`。
+![issue 中智能体的回复与已完成的执行日志](/images/docs/quickstart-run-result.png)
-**接下来守护进程会**:
+## 常见问题
-1. 3 秒内领走这条任务(任务状态从 `queued` 变 `dispatched`)
-2. 调用对应的 AI 编程工具开始执行(状态变 `running`)
-3. AI 在本地工作——可能会读你的代码目录、执行命令、编辑文件
-4. 结束后把结果发回 Multica(状态变 `completed` 或 `failed`,根据是否自动重试)
+| 现象 | 先检查什么 |
+|---|---|
+| 没有找到运行时 | 确认 AI 编程工具已经安装并能在终端中运行。Desktop 点"刷新";CLI 方式重新运行 `multica setup`。 |
+| 运行时显示离线 | Desktop 保持打开;CLI 方式运行 `multica daemon status`,未启动时运行 `multica daemon start`。 |
+| issue 一直排队 | 确认智能体使用的运行时在线。运行时达到并发上限时,新任务会继续排队。 |
-Web 界面会**实时**(通过 WebSocket)显示进度——不需要刷新。
+更多情况见[故障排查](/troubleshooting)。
-## 下一步
+## 接下来
-- [守护进程与运行时](/daemon-runtimes) —— 守护进程怎么运作、运行时概念
-- [执行任务](/tasks) —— 任务生命周期、重试规则
-- [AI 编程工具对照](/providers) —— 16 款工具的能力差异
-- [桌面应用](/desktop-app) —— 不想自己跑守护进程的话
-- [Self-Host 快速上手](/self-host-quickstart) —— 在自己服务器上跑一套
+- [核心概念](/concepts) — 三分钟认识 Multica 的全部核心对象。
+- [Multica 的工作方式](/how-multica-works) — 理解 issue、智能体、运行时和每次执行之间的关系。
+- [让智能体开始工作](/triggering-agents) — 除了分配,还有 @评论、对话和自动化三种触发方式。
diff --git a/apps/docs/content/docs/comments.ja.mdx b/apps/docs/content/docs/comments.ja.mdx
index 5621ee27c2..5f0c012090 100644
--- a/apps/docs/content/docs/comments.ja.mdx
+++ b/apps/docs/content/docs/comments.ja.mdx
@@ -1,81 +1,62 @@
---
-title: コメントとメンション
-description: イシューの下での共同作業 — コメント、返信、`@` メンション、リアクション、そしてコメントからエージェントをトリガーする方法。
+title: コメント
+description: イシューに情報を補足し、スレッドに返信し、メンバーやエージェントを @メンションして、完全な協働の記録を残します。
---
import { Callout } from "fumadocs-ui/components/callout";
-すべての[イシュー](/issues)にはコメントスレッドがあります。コメントを投稿し、誰かに返信し、[メンバー](/members-roles)や[エージェント](/agents)を `@` でメンションし、リアクションを追加する — これまで使ってきたどのタスク管理ツールでも行ってきたのと同じ操作です。唯一の違いは、**`@` でエージェントをメンションすると、そのエージェントが作業を開始するようトリガーされる**ことです。
+コメントは、[イシュー](/issues)上で継続的な協働が行われる場所です。メンバーとエージェントはここで背景を補足し、質問し、結果を報告します。次にイシューを開いたときも、完全なコンテキストがそのまま残っています。
-## コメントを投稿する
+## コメントと返信の投稿
-イシュー詳細ページ下部の入力欄に内容を入力し、**送信**を押してください。コメントはすぐにスレッドに表示されます。コメントは Markdown に対応しています — 見出し、リスト、コードブロック、リンクがすべて使えます。
+イシューのアクティビティ欄に入力して送信すると、コメントが作成されます。コメントは書式、コードブロック、リンク、添付ファイルに対応しています。
-## コメントに返信する
+コメントに返信するとスレッドになります。返信はさらにネストできますが、すべて同じトップレベルのスレッドの下にまとまります。
-任意のコメントの右上にある**返信**をクリックすると、その下にネストされた入力欄が開きます。返信はそのコメントの子要素として表示され、会話スレッドを形成します。返信にもさらに返信を付けられ、必要なだけ深くネストできます。
+## スレッドの解決
-イシュー一覧にはトップレベルのコメント数だけが表示され、イシューを開くと会話ツリー全体が見えます。
+疑問に結論が出たら、スレッド全体を解決済みにするか、いずれかの返信を結論に設定できます。1 つのスレッドが同時に保持できる結論は 1 つだけです。解決済みのスレッドは折りたたまれますが、展開して確認できます。
-## リアクション
-
-各コメントの右上には、素早く意思を伝えるためのリアクションボタンがあります(👍、👀、🎉)— 同意を示すために「+1」コメントをわざわざ投稿する必要はありません。
-
-## `@` メンション
-
-コメントに `@` を入力するとピッカーが開きます。メンバーまたはエージェントを選ぶと、`@` と対象のスラッグが挿入されます(`@alice` や `@reviewer-bot`)。メンションされた相手は自分の[インボックス](/inbox)に通知を受け取ります。
-
-**エージェントをメンションすると自動的にトリガーされます** — [コメントでエージェントをメンションする](/mentioning-agents)を参照してください。
+解決済みのスレッドで返信を続けると、スレッドは自動的に再オープンされます。
-1 つのコメントで同じ人を複数回メンションしても、通知は**1 つだけ**発生します。
+## @メンション
-### `@all` はワークスペース全体に通知する
-
-`@all` は特別な対象です。ワークスペースのすべてのメンバーに通知を送ります。人もエージェントも `@all` を使えます — つまり進捗を報告するエージェントも `@all` できるので、エージェントの指示には控えめに使うよう伝えておきましょう。
-
-<Callout type="warning">
-**`@all` は慎重に使ってください。** 規模の大きいワークスペースでは、たった 1 回の `@all` がその人数分のインボックス通知を瞬時に生成します。全員が本当に知る必要があることだけに使い、日常的な更新には使わないでください。
-</Callout>
+`@` を入力し、リストから対象を選択します。
-## イシューを参照する
+| 対象 | 効果 |
+|---|---|
+| **メンバー** | インボックスにメンション通知が届きます。コメント内の @ では購読は発生しません。 |
+| **エージェント** | そのエージェントのタスクを作成します。エージェントにインボックスはありません。 |
+| **スクワッド** | スクワッドのメンバーに通知し、スクワッドのリーダーをトリガーします。 |
+| **イシュー** | 別のイシューへのリンクを挿入します。通知もエージェントのトリガーもありません。 |
+| **@all** | すべてのワークスペースメンバーに通知し、どのエージェントもトリガーしません。 |
-別のイシューをリンクするには、コメントの mention ピッカーからそのイシューを選択してください。Multica はイシューリンクを明示的な `[MUL-123](mention://issue/<uuid>)` mention リンクとして保存します。イシューリンクは単なる相互参照にすぎません。人に通知を送ることはなく、エージェントをトリガーすることもありません。
-
-`MUL-123` のような裸のイシューキーを入力しても、通常のテキストのまま残ります。そのため、`feature/MUL-123` のようなコメント内のブランチ名やパスも書き換えられません。
+プレーンテキストで `@name` と入力してもメンションにはなりません。エディターの候補リストから選択してください。有効なイシューキーを入力すると、エディターが自動的にイシューリンクへ変換します。
<Callout type="info">
-Markdown の強調は CommonMark のルールに従います。太字テキストが句読点や閉じ引用符で終わり、その直後に韓国語の助詞が続く場合、閉じの `**` が認識されないことがあります。
+コメントでエージェントを @メンションしても、イシューの担当者やステータスは変わりません。トリガープレビュー、通常の返信の自動ルーティング、連続コメントの統合については、[コメントでエージェントを @メンション](/mentioning-agents)を参照してください。
+</Callout>
-引用符を太字の範囲の外に出すことをおすすめします。
+## 購読とインボックス
-```markdown
-"**무엇을 먼저 정해두고 시작할지**"가
-```
+コメントしたメンバーはそのイシューを自動的に購読し、以降のアクティビティと @メンションが[インボックス](/inbox)に届きます。イシュー右上から手動で購読・購読解除もできます。購読の発生源と通知ルールの全体は[インボックスと購読](/inbox)を参照してください。
-次の代わりに:
+## リアクション
-```markdown
-**"무엇을 먼저 정해두고 시작할지"**가
-```
-</Callout>
+コメントに絵文字のリアクションを付けて、既読の合図、同意、手早いフィードバックに使えます。リアクションはエージェントをトリガーせず、イシューのステータスも変えません。
-## コメントの編集と削除
+## 編集と削除
-コメントは作成者のみが編集または削除できます。
+コメントの作成者は自分のコメントを編集・削除できます。ワークスペースの `owner` と `admin` は誰のコメントでも編集・削除できます。エージェントが投稿したコメントについては、UI は削除のみを提供し、編集はできません。
-コメントを削除すると、その下の**すべての返信も一緒に削除されます**(返信への返信も含む)。内容だけを変えたい場合は、削除ではなく編集を使ってください。
+コメントを編集すると、Multica は新しい内容でトリガーを再計算します。編集で追加した @メンションも同様にタスクを作成します。保存前に、入力欄の下にトリガープレビューが表示されます。
<Callout type="warning">
-**コメントを編集して `@` を追加しても、エージェントはトリガーされません。** トリガーはコメントが**作成された**その瞬間に発生します — 後から編集して新しい `@` を追加したり、対象を変えたりしても、新しい通知は送られず、エージェントも起きません。見逃したエージェントを呼び出すには、そのエージェントを `@` する**新しいコメントを投稿**してください。
+コメントの削除は元に戻せません。トップレベルのコメントを削除すると、その下のすべての返信も削除されます。内容が間違っている場合は編集してください。
</Callout>
----
-
-ここまで扱ってきた内容はすべて「人の世界」です — ワークスペース、メンバー、イシュー、プロジェクト、コメント。Linear や Jira を使ったことがあれば、これまでの内容はまったく目新しくないはずです。
-
-しかし Multica の決定的な特徴はまだ登場していません。**エージェントをワークスペースの一級メンバーとして扱うこと**です。次はまさにこの話に移ります。
-
-## 次へ
+## 次のステップ
-- [エージェント](/agents) — 何であり、人とどう違うのか
-- [コメントでエージェントをメンションする](/mentioning-agents) — コメントで `@` を使ってエージェントを起動する
+- [コメントでエージェントを @メンション](/mentioning-agents) — @メンション、返信、割り当ての違い。
+- [インボックスと購読](/inbox) — フォローすべき作業の動きを管理します。
+- [イシューをエージェントに割り当てる](/assigning-issues) — エージェントをイシューの担当者にします。
diff --git a/apps/docs/content/docs/comments.ko.mdx b/apps/docs/content/docs/comments.ko.mdx
index 2633bdffc0..d028458ac9 100644
--- a/apps/docs/content/docs/comments.ko.mdx
+++ b/apps/docs/content/docs/comments.ko.mdx
@@ -1,81 +1,62 @@
---
-title: 댓글과 멘션
-description: 이슈 아래에서 협업하기 — 댓글, 답글, `@` 멘션, 반응, 그리고 댓글에서 에이전트를 트리거하기.
+title: 댓글
+description: 이슈에 정보를 보충하고, 논의에 답하고, 멤버나 에이전트를 @멘션하며 전체 협업 기록을 남깁니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-모든 [이슈](/issues)에는 댓글 스레드가 있습니다. 댓글을 작성하고, 다른 사람에게 답글을 달고, [멤버](/members-roles)나 [에이전트](/agents)를 `@`로 멘션하고, 반응을 추가하세요 — 지금까지 써온 어떤 작업 관리 도구에서나 하던 것과 똑같은 동작입니다. 단 한 가지 다른 점은: **`@`로 에이전트를 멘션하면 에이전트가 작업을 시작하도록 트리거된다**는 것입니다.
+댓글은 [이슈](/issues)에서 지속적으로 협업하는 공간입니다. 멤버와 에이전트가 배경을 보충하고, 질문을 남기고, 결과를 제출할 수 있으며 나중에 이슈를 다시 열어도 전체 컨텍스트를 확인할 수 있습니다.
-## 댓글 작성하기
+## 댓글 작성 및 답글
-이슈 상세 페이지 하단의 입력란에 내용을 입력하고 **보내기**를 누르세요. 댓글이 스레드에 즉시 나타납니다. 댓글은 Markdown을 지원합니다 — 제목, 목록, 코드 블록, 링크를 모두 사용할 수 있습니다.
+이슈의 활동 영역에 내용을 입력하고 보내면 댓글이 만들어집니다. 댓글에는 서식, 코드 블록, 링크, 첨부 파일을 사용할 수 있습니다.
-## 댓글에 답글 달기
+댓글에 답글을 달면 논의 스레드가 만들어집니다. 답글은 계속 중첩할 수 있지만 모두 같은 최상위 논의 아래에 속합니다.
-어떤 댓글이든 오른쪽 상단의 **답글**을 클릭하면 그 아래에 중첩된 입력란이 열립니다. 작성한 답글은 해당 댓글의 하위 항목으로 표시되어 대화 스레드를 이룹니다. 답글에도 다시 답글을 달 수 있으며, 필요한 만큼 깊이 중첩됩니다.
+## 논의 해결
-이슈 목록에는 최상위 댓글 수만 표시되며, 이슈를 열어야 전체 대화 트리를 볼 수 있습니다.
+문제에 결론이 나면 전체 논의를 해결됨으로 표시하거나 특정 답글을 결론으로 지정할 수 있습니다. 한 논의에는 한 번에 하나의 결론만 유지됩니다. 해결된 논의는 접히지만 다시 펼쳐서 볼 수 있습니다.
-## 반응
+해결된 논의에 답글을 추가하면 해당 논의가 자동으로 다시 열립니다.
-각 댓글의 오른쪽 상단에는 빠른 신호를 보내기 위한 반응 버튼이 있습니다(👍, 👀, 🎉) — 동의를 표시하려고 "+1" 댓글을 따로 달 필요가 없습니다.
+## @멘션
-## `@` 멘션
+`@`를 입력하고 목록에서 대상을 선택합니다.
-댓글에 `@`를 입력하면 선택 창이 열립니다. 멤버나 에이전트를 고르면 `@`와 대상의 slug가 함께 삽입됩니다(`@alice` 또는 `@reviewer-bot`). 멘션된 대상은 자신의 [인박스](/inbox)에서 알림을 받습니다.
+| 대상 | 결과 |
+|---|---|
+| **멤버** | 인박스에 멘션 알림이 도착합니다. 댓글의 @멘션 자체로는 구독되지 않습니다. |
+| **에이전트** | 해당 에이전트의 실행 태스크가 생성됩니다. 에이전트에는 인박스가 없습니다. |
+| **스쿼드** | 스쿼드의 멤버에게 알리고 스쿼드 리더의 실행을 트리거합니다. |
+| **이슈** | 다른 이슈의 링크를 삽입합니다. 알림을 보내거나 에이전트를 트리거하지 않습니다. |
+| **@all** | 워크스페이스의 모든 멤버에게 알립니다. 에이전트는 트리거하지 않습니다. |
-**에이전트를 멘션하면 자동으로 트리거됩니다** — [댓글에서 에이전트 멘션하기](/mentioning-agents)를 참고하세요.
-
-하나의 댓글에서 같은 사람을 여러 번 멘션해도 알림은 **하나만** 발생합니다.
-
-### `@all`은 워크스페이스 전체에 알립니다
-
-`@all`은 특별한 대상입니다. 워크스페이스의 모든 멤버에게 알림을 보냅니다. 사람과 에이전트 모두 `@all`을 사용할 수 있습니다 — 즉 진행 상황을 보고하는 에이전트도 `@all`을 할 수 있으므로, 에이전트의 지침에 이를 아껴서 사용하라고 일러두세요.
-
-<Callout type="warning">
-**`@all`은 신중하게 사용하세요.** 규모가 큰 워크스페이스에서는 단 한 번의 `@all`이 그만큼의 인박스 알림을 순식간에 생성합니다. 모두가 정말로 알아야 하는 일에만 사용하고 — 일상적인 업데이트에는 쓰지 마세요.
-</Callout>
-
-## 이슈 참조하기
-
-다른 이슈를 링크하려면 댓글 mention 선택기에서 해당 이슈를 선택하세요. Multica는 이슈 링크를 명시적인 `[MUL-123](mention://issue/<uuid>)` mention 링크로 저장합니다. 이슈 링크는 단순한 상호 참조일 뿐입니다. 사람에게 알림을 보내지 않으며 에이전트를 트리거하지도 않습니다.
-
-`MUL-123` 같은 bare 이슈 키를 입력하면 일반 텍스트로 유지됩니다. 따라서 `feature/MUL-123` 같은 댓글 안의 브랜치 이름과 경로도 다시 작성되지 않습니다.
+일반 텍스트로 `@name`을 직접 입력하면 멘션이 만들어지지 않습니다. 편집기의 후보 목록에서 선택해야 합니다. 유효한 이슈 번호를 입력하면 편집기가 자동으로 이슈 링크로 변환합니다.
<Callout type="info">
-Markdown 강조는 CommonMark 규칙을 따릅니다. 굵은 텍스트가 문장 부호나 닫는 따옴표로 끝나고 그 뒤에 한국어 조사가 바로 이어지면, 닫는 `**`가 인식되지 않을 수 있습니다.
+댓글에서 에이전트를 @멘션해도 이슈의 담당자나 상태는 바뀌지 않습니다. 트리거 미리보기, 일반 답글의 자동 라우팅, 연속 댓글이 합쳐지는 방식은 [댓글에서 에이전트 @멘션하기](/mentioning-agents)를 참고하세요.
+</Callout>
-따옴표를 굵게 표시 범위 밖으로 옮기는 것을 권장합니다:
+## 구독과 인박스
-```markdown
-"**무엇을 먼저 정해두고 시작할지**"가
-```
+댓글에 참여한 멤버는 해당 이슈를 자동으로 구독하며, 이후 활동과 @멘션은 [인박스](/inbox)에 들어옵니다. 이슈 오른쪽 위에서 직접 구독하거나 구독을 취소할 수도 있습니다. 전체 구독 경로와 알림 규칙은 [인박스와 구독](/inbox)을 참고하세요.
-다음 대신:
+## 이모지 반응
-```markdown
-**"무엇을 먼저 정해두고 시작할지"**가
-```
-</Callout>
+댓글에 이모지를 추가해 읽었음을 확인하거나, 동의를 표현하거나, 빠르게 피드백할 수 있습니다. 이모지는 에이전트를 트리거하지 않으며 이슈 상태도 바꾸지 않습니다.
-## 댓글 편집과 삭제
+## 수정 및 삭제
-댓글은 작성자만 편집하거나 삭제할 수 있습니다.
+댓글 작성자는 자신의 댓글을 수정하거나 삭제할 수 있고, 워크스페이스의 `owner`와 `admin`은 누구의 댓글이든 수정하고 삭제할 수 있습니다. 에이전트가 작성한 댓글에는 삭제 메뉴만 제공되고 수정 메뉴는 제공되지 않습니다.
-댓글을 삭제하면 그 아래의 **모든 답글도 함께 삭제됩니다**(답글의 답글 포함). 내용만 바꾸려면 삭제 대신 편집을 사용하세요.
+댓글을 수정하면 Multica가 새 내용을 기준으로 트리거를 다시 계산합니다. 수정하면서 새로 추가한 @멘션도 실행 태스크를 생성하며, 저장하기 전에 입력란 아래에 트리거 미리보기가 표시됩니다.
<Callout type="warning">
-**댓글을 편집하면서 `@`를 추가해도 에이전트는 트리거되지 않습니다.** 트리거는 댓글이 **생성되는** 그 순간에 발생합니다 — 나중에 편집해서 새로운 `@`를 추가하거나 대상을 바꿔도 새 알림이 발송되지 않고 에이전트가 깨어나지도 않습니다. 놓친 에이전트를 불러오려면 그 에이전트를 `@`하는 **새 댓글을 작성**하세요.
+댓글 삭제는 취소할 수 없습니다. 최상위 댓글을 삭제하면 그 아래의 모든 답글도 함께 삭제됩니다. 내용이 잘못되었다면 수정하세요.
</Callout>
----
-
-여기까지 다룬 내용은 모두 "사람의 세계"입니다 — 워크스페이스, 멤버, 이슈, 프로젝트, 댓글. Linear나 Jira를 써본 적이 있다면 지금까지의 내용은 전혀 낯설지 않을 것입니다.
-
-하지만 Multica의 결정적인 특징은 아직 등장하지 않았습니다: **에이전트를 워크스페이스의 일급 멤버로 대우하는 것**입니다. 다음 장에서 바로 이 이야기를 다룹니다.
-
-## 다음
+## 다음 단계
-- [에이전트](/agents) — 무엇이며, 사람과 어떻게 다른지
-- [댓글에서 에이전트 멘션하기](/mentioning-agents) — 댓글에서 `@`로 에이전트를 시작시키기
+- [댓글에서 에이전트 @멘션하기](/mentioning-agents) — @멘션, 답글, 할당의 차이를 이해합니다.
+- [인박스와 구독](/inbox) — 확인해야 할 작업 활동을 관리합니다.
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 에이전트를 이슈 담당자로 지정합니다.
diff --git a/apps/docs/content/docs/comments.mdx b/apps/docs/content/docs/comments.mdx
index f8367effc9..67860d51b3 100644
--- a/apps/docs/content/docs/comments.mdx
+++ b/apps/docs/content/docs/comments.mdx
@@ -1,81 +1,62 @@
---
-title: Comments and mentions
-description: Collaborating under an issue — comments, replies, `@` mentions, reactions, and triggering agents from a comment.
+title: Comments
+description: Add information, reply to discussions, and @-mention members or agents on an issue, keeping a complete collaboration record.
---
import { Callout } from "fumadocs-ui/components/callout";
-Every [issue](/issues) has a comment thread. Post comments, reply to someone, `@` a [member](/members-roles) or an [agent](/agents), add reactions — the same moves you make in any task manager you've used. The one difference: **mentioning an agent with `@` triggers it to start working.**
+Comments are where ongoing collaboration on an [issue](/issues) happens. Members and agents add background, ask questions, and post results here, and the full context is still there the next time the issue is opened.
-## Posting a comment
+## Post comments and replies
-Type into the input at the bottom of the issue detail page and hit **Send**. The comment appears in the thread immediately. Comments support Markdown — headings, lists, code blocks, links, all available.
+Type into the issue's activity area and send to create a comment. Comments support formatting, code blocks, links, and attachments.
-## Replying to a comment
+Replying to a comment forms a discussion thread. Replies can nest further, but they all stay under the same top-level discussion.
-Click **Reply** on the top-right of any comment to open a nested input underneath it. Your reply is displayed as a child of that comment, forming a conversation thread. Replies can have their own replies, nesting as deep as you need.
+## Resolve a discussion
-The issue list shows only the top-level comment count; opening the issue reveals the full conversation tree.
+When a question reaches a conclusion, mark the whole discussion as resolved, or set one reply as the conclusion; a discussion keeps only one conclusion at a time. Resolved discussions collapse but can still be expanded.
-## Reactions
-
-Each comment has a reaction button in the top-right for quick signals (👍, 👀, 🎉) — no need to post a "+1" comment to agree.
-
-## `@` mentions
-
-Typing `@` in a comment opens a picker. Choose a member or an agent, and `@` plus the target's slug gets inserted (`@alice` or `@reviewer-bot`). The mentioned party gets a notification in their [inbox](/inbox).
-
-**If you mention an agent, it triggers automatically** — see [Mentioning agents in comments](/mentioning-agents).
+Replying in a resolved discussion reopens it automatically.
-Mentioning the same person multiple times in one comment still produces **only one** notification.
+## @-mentions
-### `@all` notifies the entire workspace
-
-`@all` is a special target: it pushes a notification to every member of the workspace. Both people and agents can use `@all` — which means an agent reporting progress could also `@all`, so remind agents in their instructions to use it sparingly.
-
-<Callout type="warning">
-**Use `@all` carefully.** In a larger workspace, a single `@all` generates that many inbox notifications instantly. Reserve it for things everyone genuinely needs to know — not day-to-day updates.
-</Callout>
+Type `@` and pick a target from the list:
-## Referencing issues
+| Target | Effect |
+|---|---|
+| **Member** | Gets a mention notification in the inbox; an @ in a comment does not create a subscription. |
+| **Agent** | Creates a task for that agent; agents have no inbox. |
+| **Squad** | Notifies the squad's members and triggers the squad leader. |
+| **Issue** | Inserts a link to another issue — no notification, no agent trigger. |
+| **@all** | Notifies every workspace member and triggers no agent. |
-To link another issue, choose it from the comment mention picker. Multica stores issue links as an explicit `[MUL-123](mention://issue/<uuid>)` mention link. Issue links are cross-references only: they do not notify people and they do not trigger agents.
-
-Typing a bare issue key, such as `MUL-123`, keeps it as plain text. This also keeps branch names and paths, such as `feature/MUL-123`, from being rewritten inside comments.
+Typing plain-text `@name` does not create a mention; pick from the editor's suggestion list. Typing a valid issue key converts it into an issue link automatically.
<Callout type="info">
-Markdown emphasis follows CommonMark rules. When bold text ends with punctuation or a closing quote and is immediately followed by a Korean particle, the closing `**` may not be recognized.
+@-mentioning an agent in a comment does not change the issue's assignee or status. For the trigger preview, automatic routing of plain replies, and how consecutive comments merge, see [@-mention agents in comments](/mentioning-agents).
+</Callout>
-Prefer moving the quote outside the bold span:
+## Subscriptions and the inbox
-```markdown
-"**무엇을 먼저 정해두고 시작할지**"가
-```
+Members who comment subscribe to the issue automatically, and later activity and @-mentions land in the [inbox](/inbox); you can also subscribe or unsubscribe manually at the top right of the issue. See [Inbox and subscriptions](/inbox) for the full subscription sources and notification rules.
-instead of:
+## Reactions
-```markdown
-**"무엇을 먼저 정해두고 시작할지"**가
-```
-</Callout>
+Add an emoji reaction to a comment to acknowledge, agree, or give quick feedback. Reactions do not trigger agents and do not change issue status.
-## Editing and deleting a comment
+## Edit and delete
-Only the author of a comment can edit or delete it.
+Comment authors can edit or delete their own comments; workspace `owner`s and `admin`s can also edit and delete anyone's comments. For comments posted by agents, the UI only offers delete, not edit.
-Deleting a comment also **deletes every reply** under it (including replies to replies). To change content only, use edit instead.
+After a comment is edited, Multica recalculates triggers from the new content. @-mentions added during the edit create tasks too; the trigger preview shows under the input before you save.
<Callout type="warning">
-**Adding an `@` while editing a comment does not trigger the agent.** The trigger fires the moment a comment is **created** — editing to add a new `@`, or changing the target, does not send a new notification or wake the agent. To summon an agent you missed, **post a new comment** that `@`s it.
+Deleting a comment cannot be undone. Deleting a top-level comment deletes every reply under it. If the content is wrong, edit it instead.
</Callout>
----
-
-Everything we've covered so far is "the human world" — workspaces, members, issues, projects, comments. If you've used Linear or Jira, none of it should feel unfamiliar.
-
-But Multica's defining trait hasn't entered the picture yet: **treating agents as first-class members of a workspace**. That's what we turn to next.
-
-## Next
+## Next steps
-- [Agents](/agents) — what they are, and how they differ from people
-- [Mentioning agents in comments](/mentioning-agents) — use `@` in a comment to start an agent
+- [@-mention agents in comments](/mentioning-agents) — how @-mentions, replies, and assignment differ.
+- [Inbox and subscriptions](/inbox) — manage the work activity you need to follow.
+- [Assign issues to agents](/assigning-issues) — make an agent the issue's assignee.
diff --git a/apps/docs/content/docs/comments.zh.mdx b/apps/docs/content/docs/comments.zh.mdx
index 61ccf8e0e1..ac21c501a1 100644
--- a/apps/docs/content/docs/comments.zh.mdx
+++ b/apps/docs/content/docs/comments.zh.mdx
@@ -1,81 +1,62 @@
---
-title: 评论与提及
-description: 在 issue 下协作——评论、回复、@ 提及、表情反应,以及在评论里触发智能体工作。
+title: 评论
+description: 在 issue 中补充信息、回复讨论、@成员或智能体,并保留完整的协作记录。
---
import { Callout } from "fumadocs-ui/components/callout";
-每个 [issue](/issues) 都有一个评论区。你可以在里面发评论、回复别人、用 `@` 点名 [成员](/members-roles) 或 [智能体](/agents)、加表情反应——和你在熟悉的任务管理工具里做的是同一件事。唯一不同的是:**`@` 一个智能体会自动触发它开始工作**。
+评论是 [issue](/issues) 中持续协作的地方。成员和智能体可以在这里补充背景、提出问题、提交结果,后续打开 issue 时仍能看到完整上下文。
-## 发评论
+## 发表评论和回复
-在 issue 详情页底部的输入框里写内容,点**发送**,评论立刻出现在评论流里。评论支持 Markdown——标题、列表、代码块、链接都能用。
+在 issue 的动态区输入内容并发送,即可创建一条评论。评论支持格式、代码块、链接和附件。
-## 回复某条评论
+回复某条评论会形成一条讨论线程。回复可以继续嵌套,但都归在同一条顶层讨论下。
-点任意一条评论右上角的**回复**,会在这条评论下方展开嵌套输入框。你写的回复会显示为这条评论的子项,形成一条对话线。回复之下还能继续回复,层层展开。
+## 解决一条讨论
-在 issue 列表里看到的只是顶层评论数,点进 issue 里才能看到完整的对话树。
+问题得到结论时,可以把整条讨论标记为已解决,或将某条回复设为结论;一条讨论同时只保留一个结论。已解决的讨论会折叠,仍可展开查看。
-## 表情反应
-
-每条评论右上角可以加表情反应(比如 👍、👀、🎉),用来快速表态——不用为了赞同单独发一条"+1"。
-
-## `@` 提及
-
-在评论里输入 `@` 会弹出提示,从里面选一个成员或智能体,`@` 后面会填入对方的 slug(比如 `@alice` 或 `@reviewer-bot`)。被提及的人会在自己的 [收件箱](/inbox) 里收到通知。
-
-**如果你提及的是一个智能体,它会被自动触发开始工作**——详见 [在评论里召唤智能体](/mentioning-agents)。
+在已解决的讨论中继续回复,会自动重新打开这条讨论。
-同一条评论里 `@` 同一个人多次,对方只会收到**一条**通知。
+## @提及
-### `@all` 会通知整个工作区
-
-`@all` 是一个特殊目标:它会把通知推送给工作区里的每一个成员。人和智能体都能发 `@all`——这意味着被触发的智能体在汇报进展时也可能 `@all`,需要在智能体的指令里提醒它谨慎使用。
-
-<Callout type="warning">
-**谨慎使用 `@all`**。工作区人数较多时,一条 `@all` 的评论会瞬间生成同等数量的收件箱通知。只在确实需要全员知晓的重大事项上使用——不是日常琐事。
-</Callout>
+输入 `@`,从列表中选择目标:
-## 引用 issue
+| 目标 | 效果 |
+|---|---|
+| **成员** | 收件箱收到提及通知;评论中的 @ 不会产生订阅。 |
+| **智能体** | 为该智能体创建一次执行任务;智能体没有收件箱。 |
+| **小队** | 通知小队中的成员,并触发小队 leader 执行。 |
+| **Issue** | 插入另一条 issue 的链接,不发通知,不触发智能体。 |
+| **@all** | 通知全部工作区成员,不触发任何智能体。 |
-要链接另一个 issue,请在评论的 mention 选择器里选择它。Multica 会把 issue 链接存成显式的 `[MUL-123](mention://issue/<uuid>)` mention 链接。Issue 链接只是交叉引用:不会通知成员,也不会触发智能体。
-
-直接输入裸 issue key,例如 `MUL-123`,会保持为普通文本。这样评论里的分支名和路径,例如 `feature/MUL-123`,也不会被改写。
+直接输入纯文本 `@name` 不会创建提及,需从编辑器的候选列表中选择。输入有效的 issue 编号时,编辑器会自动转换为 issue 链接。
<Callout type="info">
-Markdown 加粗遵循 CommonMark 规则。当加粗文本以标点或闭引号结尾,并且后面紧跟韩语助词时,结尾的 `**` 可能不会被识别。
+在评论中 @智能体不会改变 issue 的负责人或状态。关于触发预览、普通回复的自动路由和连续评论如何合并,见[在评论中 @智能体](/mentioning-agents)。
+</Callout>
-推荐把引号放到加粗范围外:
+## 订阅和收件箱
-```markdown
-"**무엇을 먼저 정해두고 시작할지**"가
-```
+参与评论的成员会自动订阅这条 issue,后续动态和 @提及会进入[收件箱](/inbox);也可以在 issue 右上角手动订阅或取消。完整的订阅来源和通知规则见[收件箱与订阅](/inbox)。
-而不是:
+## 表情反应
-```markdown
-**"무엇을 먼저 정해두고 시작할지"**가
-```
-</Callout>
+给评论添加表情,可用于确认已读、表达同意或快速反馈。表情不触发智能体,也不改变 issue 状态。
-## 编辑和删除评论
+## 编辑和删除
-只有评论的作者能编辑或删除自己的评论。
+评论作者可以编辑或删除自己的评论,工作区的 `owner` 和 `admin` 也可以编辑和删除任何人的评论。对智能体发表的评论,界面只提供删除入口,不提供编辑入口。
-删除一条评论会**一并删除**它下面的所有回复(包括回复的回复)。如果只是想改内容,用编辑功能。
+编辑评论后,Multica 会按新内容重新计算触发。编辑时新增的 @提及同样会创建执行任务;保存前输入框下方会显示触发预览。
<Callout type="warning">
-**编辑评论里加 `@` 不会触发智能体**。触发发生在评论**创建**那一刻——事后修改评论内容加入新的 `@`、或改 `@` 对象,系统不会重新发通知、也不会唤醒智能体。要召唤一个没触发到的智能体,**发一条新的评论** `@` 它。
+删除评论无法撤销。删除顶层评论时,其下所有回复一并删除。内容有误时编辑即可。
</Callout>
----
-
-到这里,我们讲的都是"人的世界"——工作区、成员、issue、project、评论。如果你熟悉 Linear 或 Jira 之类的产品,到目前为止的内容应该没有陌生感。
-
-但 Multica 的核心特色还没登场:**把智能体作为工作区的一等公民成员**。下一章开始,我们正式认识这个新物种。
-
-## 下一步
+## 接下来
-- [智能体](/agents) —— 它们是什么、和人有什么区别
-- [在评论里召唤智能体](/mentioning-agents) —— 用 `@` 在评论里触发智能体开工
+- [在评论中 @智能体](/mentioning-agents) — 区分 @提及、回复和分配。
+- [收件箱与订阅](/inbox) — 管理需要关注的工作动态。
+- [分配 issue 给智能体](/assigning-issues) — 让智能体成为 issue 的负责人。
diff --git a/apps/docs/content/docs/concepts.ja.mdx b/apps/docs/content/docs/concepts.ja.mdx
new file mode 100644
index 0000000000..8610fef11b
--- /dev/null
+++ b/apps/docs/content/docs/concepts.ja.mdx
@@ -0,0 +1,70 @@
+---
+title: コアコンセプト
+description: Multica のすべてのコアオブジェクトとその関係を、1 ページで把握できます。
+---
+
+![Multica のコアオブジェクト関係図:ワークスペース内で、イシューが割り当てまたはメンションによってエージェントをトリガーし、エージェントがタスクを作成し、タスクがランタイム上で実行され、結果がイシューに書き戻される。チャットとオートパイロットはさらに 2 つのトリガー源で、スキルとスクワッドはエージェントに取り付けられ、プロジェクトがイシューを整理し、通知はインボックスに届く](/images/docs/concepts-core-objects.png)
+
+## 基本オブジェクト
+
+### ワークスペース
+
+チームが一緒に働く独立した範囲で、すべての仕事と設定はその中で行われます。人間とエージェントは同じワークスペースで協働します。詳しくは[ワークスペース](/workspaces)を参照してください。
+
+### イシュー
+
+完了すべき 1 件の仕事と、その周りに蓄積される説明、議論、ステータス、履歴。イシューは Multica の日常業務の基本単位で、担当者はメンバー、エージェント、スクワッドのいずれかです。詳しくは[イシュー](/issues)を参照してください。
+
+### プロジェクト
+
+関連するイシューを 1 つの目標の下に整理し、全体の進捗を追跡します。リポジトリやディレクトリなどのリソースを紐づけて、実行時に使わせることもできます。詳しくは[プロジェクト](/projects)を参照してください。
+
+## エージェントと実行
+
+### エージェント
+
+ワークスペースに参加する AI の協働者で、名前、指示、モデル、スキル、Access、ランタイムからなる再利用可能な設定です。エージェントは常駐して動き続けるプロセスではなく、トリガーされたときだけ実行します。詳しくは[エージェント](/agents)を参照してください。
+
+### スキル
+
+再利用可能な能力パッケージ。指示が「このエージェントは誰か」を定義するのに対し、スキルは「この種の仕事をどうやるか」を記述し、複数のエージェントに取り付けて共用できます。詳しくは[スキル](/skills)を参照してください。
+
+### ランタイム
+
+実行が実際に行われる場所、つまり Multica に接続されたコンピュータと、その上の AI コーディングツールです。エージェントがアイデンティティで、ランタイムはそれを実行するコンピュータです。詳しくは[デーモンとランタイム](/daemon-runtimes)を参照してください。
+
+### 実行タスク(task)
+
+エージェントの 1 回の具体的な実行記録。トリガーのたびに 1 件のタスクが作られ、いずれかのランタイムが完了させて結果を書き戻します。1 つのイシューは複数のタスクを順に生むことがあり、実行の終了はイシューの完了を意味しません。詳しくは[タスク](/tasks)を参照してください。
+
+## 協働と自動化
+
+### スクワッド
+
+1 体のリーダーエージェントが率いる、エージェントとメンバーのグループ。イシューをスクワッドに割り当てると、リーダーが調整して完了させます。詳しくは[スクワッド](/squads)を参照してください。
+
+### チャット
+
+イシューに紐づかないやり取りの方法で、質問や素早い試行に向いています。メッセージ 1 件ごとに 1 回の実行がトリガーされます。詳しくは[エージェントとのチャット](/chat)を参照してください。
+
+### インボックス
+
+メンバーの通知センターで、購読しているイシューの動き、メンション、割り当てがここに集まります。エージェントはインボックスを使いません。詳しくは[インボックスと購読](/inbox)を参照してください。
+
+### オートパイロット
+
+スケジュールまたは外部イベントに応じて、エージェントの実行を自動的にトリガーします。手動で 1 回だけ実行することもできます。詳しくは[オートパイロット](/autopilots)を参照してください。
+
+## オブジェクト間の関係
+
+- **ワークスペース**はすべての入れ物で、人間と**エージェント**がその中で協働します。
+- **イシュー**は 1 件の仕事を記録し、関連するイシューは**プロジェクト**で整理します。
+- 割り当て、@メンション、**チャット**、**オートパイロット**がエージェントをトリガーすると、**タスク**が 1 件作られます。
+- タスクはいずれかの**ランタイム**上で完了し、結果はトリガーされた場所に書き戻されます。
+- **スキル**は成功したやり方をエージェント間で再利用させ、**スクワッド**は複数のエージェントを協働させます。
+- 過程で人間に届く通知は、すべて**インボックス**に入ります。
+
+## 次のステップ
+
+- [エージェントに仕事を任せる](/triggering-agents) — 4 つのトリガー方法の入口。
+- [Multica の仕組み](/how-multica-works) — 1 回の実行の流れ。
diff --git a/apps/docs/content/docs/concepts.ko.mdx b/apps/docs/content/docs/concepts.ko.mdx
new file mode 100644
index 0000000000..600dc37c8e
--- /dev/null
+++ b/apps/docs/content/docs/concepts.ko.mdx
@@ -0,0 +1,70 @@
+---
+title: 핵심 개념
+description: 한 페이지에서 Multica의 핵심 객체와 서로의 관계를 살펴봅니다.
+---
+
+![Multica 핵심 객체 관계도: 워크스페이스 안에서 이슈를 할당하거나 에이전트를 멘션하면 에이전트가 태스크를 만들고, 태스크는 런타임에서 실행된 뒤 결과를 이슈에 다시 기록합니다. 대화와 오토파일럿도 에이전트를 실행할 수 있으며, 스킬과 스쿼드는 에이전트에 연결되고, 프로젝트는 이슈를 정리하며, 알림은 인박스로 전달됩니다.](/images/docs/concepts-core-objects.png)
+
+## 기본 객체
+
+### 워크스페이스
+
+팀이 함께 일하는 독립된 공간입니다. 모든 작업과 설정은 워크스페이스 안에서 이루어지며, 사람과 에이전트가 같은 워크스페이스에서 협업합니다. 자세한 내용은 [워크스페이스](/workspaces)를 참고하세요.
+
+### 이슈
+
+해야 할 일과 그에 관한 설명, 논의, 상태, 이력을 한곳에 모은 객체입니다. 이슈는 Multica에서 일상적인 작업을 관리하는 기본 단위이며, 멤버나 에이전트, 스쿼드를 담당자로 지정할 수 있습니다. 자세한 내용은 [이슈](/issues)를 참고하세요.
+
+### 프로젝트
+
+관련 이슈를 하나의 목표 아래 정리하고 전체 진행 상황을 추적합니다. 실행할 때 사용할 저장소나 디렉터리 같은 리소스도 연결할 수 있습니다. 자세한 내용은 [프로젝트](/projects)를 참고하세요.
+
+## 에이전트와 실행
+
+### 에이전트
+
+워크스페이스에서 함께 일하는 AI 협업자입니다. 이름, 지침, 모델, 스킬, Access, 런타임으로 이루어진 재사용 가능한 설정이며, 계속 실행되는 프로세스가 아니라 트리거될 때만 동작합니다. 자세한 내용은 [에이전트](/agents)를 참고하세요.
+
+### 스킬
+
+재사용할 수 있는 기능 패키지입니다. 지침이 "이 에이전트가 누구인가"를 정의한다면, 스킬은 "이런 종류의 작업을 어떻게 수행하는가"를 설명합니다. 하나의 스킬을 여러 에이전트에 연결해 함께 사용할 수 있습니다. 자세한 내용은 [스킬](/skills)을 참고하세요.
+
+### 런타임
+
+실제 실행이 일어나는 곳으로, Multica에 연결된 컴퓨터와 그 컴퓨터의 AI 코딩 도구를 뜻합니다. 에이전트가 정체성을 나타낸다면 런타임은 그 에이전트를 실행하는 컴퓨터입니다. 자세한 내용은 [데몬과 런타임](/daemon-runtimes)을 참고하세요.
+
+### 실행 태스크(task)
+
+에이전트가 한 번 실행된 기록입니다. 트리거할 때마다 태스크가 하나 만들어지고, 런타임이 이를 실행한 뒤 결과를 다시 기록합니다. 하나의 이슈에서 시간에 따라 여러 태스크가 만들어질 수 있으며, 실행이 끝났다고 해서 이슈까지 완료된 것은 아닙니다. 자세한 내용은 [태스크](/tasks)를 참고하세요.
+
+## 협업과 자동화
+
+### 스쿼드
+
+리더 에이전트 한 명이 이끄는 에이전트와 멤버의 그룹입니다. 이슈를 스쿼드에 할당하면 리더가 작업을 조율합니다. 자세한 내용은 [스쿼드](/squads)를 참고하세요.
+
+### 대화
+
+이슈에 연결하지 않고 대화하는 방식으로, 질문이나 간단한 시도에 적합합니다. 메시지를 보낼 때마다 한 번의 실행이 트리거됩니다. 자세한 내용은 [에이전트와 대화](/chat)를 참고하세요.
+
+### 인박스
+
+멤버를 위한 알림 센터입니다. 구독한 이슈의 활동, 멘션, 할당 알림이 이곳에 모입니다. 에이전트는 인박스를 사용하지 않습니다. 자세한 내용은 [인박스와 구독](/inbox)을 참고하세요.
+
+### 오토파일럿
+
+일정이나 외부 이벤트에 따라 에이전트 실행을 자동으로 트리거하며, 필요하면 한 번만 수동으로 실행할 수도 있습니다. 자세한 내용은 [오토파일럿](/autopilots)을 참고하세요.
+
+## 객체의 관계
+
+- **워크스페이스**는 모든 객체를 담는 공간이며, 사람과 **에이전트**가 그 안에서 협업합니다.
+- **이슈**는 해야 할 일을 기록하고, 관련 이슈는 **프로젝트**로 정리합니다.
+- 이슈 할당, @멘션, **대화**, **오토파일럿**으로 에이전트를 트리거하면 **태스크**가 하나 만들어집니다.
+- 태스크는 **런타임**에서 실행되고, 결과는 태스크를 트리거한 곳에 다시 기록됩니다.
+- **스킬**은 검증된 작업 방식을 여러 에이전트에서 재사용하게 하고, **스쿼드**는 여러 에이전트가 함께 일하게 합니다.
+- 이 과정에서 사람에게 보내는 모든 알림은 **인박스**에 들어갑니다.
+
+## 다음 단계
+
+- [에이전트에게 작업 맡기기](/triggering-agents) — 네 가지 트리거 방식의 시작점입니다.
+- [Multica의 작동 방식](/how-multica-works) — 한 번의 실행이 진행되는 전체 과정입니다.
diff --git a/apps/docs/content/docs/concepts.mdx b/apps/docs/content/docs/concepts.mdx
new file mode 100644
index 0000000000..d85513655f
--- /dev/null
+++ b/apps/docs/content/docs/concepts.mdx
@@ -0,0 +1,70 @@
+---
+title: Core concepts
+description: All of Multica's core objects and how they relate, on one page.
+---
+
+![Multica core object diagram: inside a workspace, an issue triggers an agent via assignment or mention, the agent creates a task, the task executes on a runtime, and results are written back to the issue; chat and Autopilot are two more trigger sources, skills and squads attach to agents, projects organize issues, and notifications go to the inbox](/images/docs/concepts-core-objects.png)
+
+## Basic objects
+
+### Workspace
+
+The self-contained scope where a team works together; all work and configuration happen inside it. Humans and agents collaborate in the same workspace. See [Workspaces](/workspaces).
+
+### Issue
+
+A piece of work to be done, plus the description, discussion, status, and history that accumulate around it. Issues are the basic unit of day-to-day work in Multica; the assignee can be a member, an agent, or a squad. See [Issues](/issues).
+
+### Project
+
+Organizes related issues under one goal, tracks overall progress, and can bind resources such as repositories and directories for use during execution. See [Projects](/projects).
+
+## Agents and execution
+
+### Agent
+
+An AI collaborator in the workspace — a reusable configuration: name, instructions, model, skills, Access, and runtime. An agent is not a long-running process; it executes only when triggered. See [Agents](/agents).
+
+### Skill
+
+A reusable capability package. Instructions define who an agent is; a skill describes how a kind of work is done, and can be attached to multiple agents. See [Skills](/skills).
+
+### Runtime
+
+Where execution actually happens: a computer connected to Multica and the AI coding tools on it. The agent is the identity; the runtime is the computer that executes it. See [Daemon and runtimes](/daemon-runtimes).
+
+### Task
+
+One concrete execution record for an agent. Every trigger produces a task, which a runtime completes before writing the results back. One issue can produce multiple tasks over time; a finished run does not mean the issue is done. See [Tasks](/tasks).
+
+## Collaboration and automation
+
+### Squad
+
+A group of agents and members led by an agent leader. Assign an issue to a squad and the leader coordinates the work. See [Squads](/squads).
+
+### Chat
+
+A way to talk that is not attached to an issue — good for questions and quick experiments. Each message triggers one run. See [Chat with agents](/chat).
+
+### Inbox
+
+A member's notification center: activity on subscribed issues, mentions, and assignments all land here. Agents do not use the inbox. See [Inbox and subscriptions](/inbox).
+
+### Autopilot
+
+Triggers agent runs automatically on a schedule or from external events; you can also run one manually. See [Autopilots](/autopilots).
+
+## How the objects relate
+
+- The **workspace** is the container for everything; humans and **agents** collaborate inside it.
+- An **issue** records a piece of work; related issues are organized with **projects**.
+- Assigning, @-mentioning, **chat**, or an **Autopilot** triggers an agent, producing a **task**.
+- The task completes on a **runtime**, and the results are written back to where it was triggered.
+- **Skills** let what works be reused across agents; **squads** let multiple agents work together.
+- Every notification for humans along the way goes to the **inbox**.
+
+## Next steps
+
+- [Put agents to work](/triggering-agents) — the entry point for the four trigger methods.
+- [How Multica works](/how-multica-works) — the full path of a run.
diff --git a/apps/docs/content/docs/concepts.zh.mdx b/apps/docs/content/docs/concepts.zh.mdx
new file mode 100644
index 0000000000..619f7ebc6d
--- /dev/null
+++ b/apps/docs/content/docs/concepts.zh.mdx
@@ -0,0 +1,70 @@
+---
+title: 核心概念
+description: 一页认识 Multica 的全部核心对象,以及它们之间的关系。
+---
+
+![Multica 核心对象关系图:Workspace 内,Issue 经分配或提及触发 Agent,Agent 创建 Task,Task 在 Runtime 上执行,结果写回 Issue;Chat 和 Autopilot 是另两个触发源,Skill 和 Squad 挂载于 Agent,Project 组织 issue,通知进入 Inbox](/images/docs/concepts-core-objects.png)
+
+## 基础对象
+
+### 工作区
+
+团队共同工作的独立范围,所有工作和配置都发生在其中;人和智能体在同一个工作区里协作。详见[工作区](/workspaces)。
+
+### Issue
+
+一项要完成的工作,以及围绕它积累的描述、讨论、状态和历史。Issue 是 Multica 中日常工作的基本单位,负责人可以是成员、智能体或小队。详见 [Issues](/issues)。
+
+### 项目
+
+把相关的 issue 组织在一个目标下,跟踪整体进度,并可以绑定仓库、目录等资源供执行时使用。详见[项目](/projects)。
+
+## 智能体与执行
+
+### 智能体
+
+加入工作区的 AI 协作者,是一份可复用的配置:名称、指令、模型、skill、Access 和运行时。智能体不是一个常驻运行的进程,只在被触发时执行。详见[智能体](/agents)。
+
+### Skill
+
+可复用的能力包。指令定义"这名智能体是谁",skill 说明"这类工作怎么做",可以挂载给多个智能体共用。详见 [Skills](/skills)。
+
+### 运行时
+
+执行实际发生的地方:连接到 Multica 的电脑和其中的 AI 编程工具。智能体是身份,运行时是执行它的电脑。详见[守护进程与运行时](/daemon-runtimes)。
+
+### 执行任务(task)
+
+智能体的一次具体执行记录。每次触发产生一条执行任务,由某个运行时完成后把结果写回。一个 issue 可以先后产生多条执行任务;执行结束不等于 issue 完成。详见[执行任务](/tasks)。
+
+## 协作与自动化
+
+### 小队
+
+一组智能体和成员,由一个智能体 leader 带领。把 issue 分配给小队,由 leader 协调完成。详见[小队](/squads)。
+
+### 对话
+
+不依附于 issue 的交流方式,适合提问和快速尝试。每条消息触发一轮执行。详见[与智能体对话](/chat)。
+
+### 收件箱
+
+成员的通知中心:订阅的 issue 动态、提及和分配都汇聚在这里。智能体不使用收件箱。详见[收件箱与订阅](/inbox)。
+
+### 自动化
+
+按时间表或外部事件自动触发智能体执行,也可以手动运行一次。详见[自动化](/autopilots)。
+
+## 对象之间的关系
+
+- **工作区**是一切的容器,人和**智能体**都在其中协作。
+- **Issue** 记录一件要做的工作;相关的 issue 用**项目**组织。
+- 分配、@提及、**对话**或**自动化**触发智能体时,产生一条**执行任务**。
+- 执行任务在某个**运行时**上完成,结果写回触发它的地方。
+- **Skill** 让成功经验跨智能体复用;**小队**让多个智能体协同。
+- 所有过程中给人的通知,都进**收件箱**。
+
+## 接下来
+
+- [让智能体开始工作](/triggering-agents) — 四种触发方式的入口。
+- [Multica 的工作方式](/how-multica-works) — 一次执行的完整链路。
diff --git a/apps/docs/content/docs/daemon-runtimes.ja.mdx b/apps/docs/content/docs/daemon-runtimes.ja.mdx
index cd749a9b34..3878bc357c 100644
--- a/apps/docs/content/docs/daemon-runtimes.ja.mdx
+++ b/apps/docs/content/docs/daemon-runtimes.ja.mdx
@@ -1,160 +1,129 @@
---
title: デーモンとランタイム
-description: エージェントは Multica のサーバーでは実行されません — あなた自身のマシンで実行されます。
+description: Multica がどのようにコンピュータを接続し、AI コーディングツールを検出してタスクを実行するかを説明します。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-Multica では、[エージェント](/agents)は私たちのサーバーでは実行され**ません** — ローカルにインストールされた [AI コーディングツール](/providers)を呼び出す**デーモン**という小さなプログラムが駆動し、あなた自身のマシンで実行されます。Multica サーバーは調整役に徹します。[イシュー](/issues)を保存し、[タスク](/tasks)をキューに入れ、適切な**ランタイム**へ分配します(ランタイム = デーモン × AI コーディングツール 1 つ)。
+Multica は作業の記録と調整を担い、接続されたコンピュータが実行を担います。コンピュータ上の**デーモン**(daemon)がタスクを取得し、そのマシンにインストールされた AI コーディングツールを呼び出します。
-この構造が Multica と Linear / Jira の最大の違いです。**あなたの API キー、ツールチェーン、コードディレクトリはすべてあなたのマシンに残り**、Multica サーバーはそのどれも見ることはありません。つまり「自分のエージェントが動かない」はほとんど常にローカルの問題です。デーモンが実行されていない、AI ツールがインストールされていない、キーが期限切れになっている、といったことです。まずローカルを確認してください。案内は[トラブルシューティング](/troubleshooting)を参照してください。
+## デーモンとランタイムの違い
-## デーモンを起動する
+- **デーモン**は、1 台のコンピュータで動く Multica のバックグラウンドプロセスです。サーバーへの接続、ローカルツールの検出、タスクの取得、結果の報告を担当します。
+- **ランタイム**は、ワークスペースが利用できる 1 つの具体的な実行環境を表します。1 台のコンピュータと、そのコンピュータ上の 1 つの AI コーディングツール(またはカスタムランタイムプロファイル)の組み合わせに対応します。
-デーモンは Multica CLI の一部です。[Multica CLI](/cli) をインストールしたら、あなた自身のマシンで実行してください。
+たとえば、Claude Code と Codex の両方をインストールした 1 台のコンピュータが、2 つのワークスペースに接続しているとします。デーモンはそれぞれのワークスペースに Claude Code と Codex のランタイムを登録します。デーモンを再起動すると既存のレコードが更新されるだけで、同じ組み合わせに対して新しいランタイムが増え続けることはありません。
-```bash
-multica daemon start
-```
-
-起動時にデーモンは 4 つのことを行います。
-
-1. ログイン時に保存された認証情報を読み込みます
-2. `PATH` にインストールされた AI コーディングツールを検出します(内蔵 16 種: [Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae)、[DevEco Code](/providers#deveco-code)、[Grok](/providers#grok))
-3. 検出した各ツールに対するランタイムとともに、自身をサーバーに登録します
-4. **3 秒ごと**に取得すべきタスクがないかポーリングし、**15 秒ごとにハートビートを送信**し続けます
-
-よく使うコマンド:
-
-| コマンド | 用途 |
-|---|---|
-| `multica daemon start` | 起動(デフォルトはバックグラウンド。フォアグラウンドで実行するには `--foreground` を追加) |
-| `multica daemon stop` | 停止 |
-| `multica daemon restart` | 再起動 |
-| `multica daemon status` | ステータス表示 |
-| `multica daemon logs` | ログ表示(追従するには `-f` を追加) |
+## 実行場所とデータ境界
-完全な CLI リファレンスは [CLI コマンド](/cli)を確認してください。
+ローカルランタイムが呼び出す AI コーディングツール、それらのツール自身のログイン認証情報、ローカルのコードディレクトリは、いずれも接続されたコンピュータに残ります。Multica サーバーがローカルツールの代わりにコマンドを実行することはなく、作業ディレクトリ全体を自動でアップロードすることもありません。
-**デスクトップアプリにはデーモンが同梱されています。** [デスクトップアプリ](/desktop-app)を使う場合、`multica daemon start` を手動で実行する必要はありません。起動時にデーモンを自動的に立ち上げます。あなたのワークフローにどの方式が合うかは、[デスクトップアプリ](/desktop-app)ページを参照してください。
+チームが協働できるように、サーバーはイシュー、コメント、エージェント設定、タスクのコンテキスト、実行記録、エージェントが書き戻した結果を保存します。これらには、エージェントが自ら読み取って返信に含めたコードスニペットやその他のプロジェクトコンテキストが含まれることがあります。
-## 1 つのマシンに複数のランタイムができる理由
-
-ランタイムはサーバーでもコンテナでもありません。「**デーモン × AI コーディングツール 1 つ**」の組み合わせです。たとえば、Claude Code と Codex の両方がインストールされた MacBook でデーモンを起動し、あなたが 2 つのワークスペースのメンバーだとします。すると Multica は 4 つのランタイムを登録します。
+<Callout type="warning">
+エージェントのカスタム環境変数はサーバー側に保存され、実行時にランタイムへ送られます。「ローカル実行」を「すべてのシークレットがこのマシンにしか存在しない」と読み替えないでください。カスタム環境変数と MCP 設定はサーバー側にあり、その表示は機密値のルールによって制限されます。
+</Callout>
-<Mermaid chart={`
-graph TD
- D["あなたのデーモン<br/>MacBook"]
- D --> R1["ランタイム<br/>ワークスペース A × Claude Code"]
- D --> R2["ランタイム<br/>ワークスペース A × Codex"]
- D --> R3["ランタイム<br/>ワークスペース B × Claude Code"]
- D --> R4["ランタイム<br/>ワークスペース B × Codex"]
-`} />
+## デーモンの起動
-要点:
+Multica Desktop を使う場合、アプリがデーモンを自動的に起動するため、追加のコマンドは不要です。
-- **1 つのデーモンは複数のランタイムにマッピングされ得ます** — インストールされたツールと、あなたが所属するワークスペースの組み合わせごとに 1 つできます
-- **同じデーモン、ワークスペース、ツールは、ちょうど 1 つのランタイムを作ります** — デーモンを再起動しても重複レコードは生まれません
-- Multica UI の**ランタイム**ページがこれらの行を一覧表示します
+Web、リモートのコンピュータ、ヘッドレス環境では、先に [Multica CLI をインストール](/cli)してから実行します。
-## カスタムランタイムプロファイル
+```bash
+multica daemon start
+```
-組み込み provider 検出は一般的なツールを対象にしています。Multica が対応するプロトコルファミリーで動作し、別の起動コマンドが必要な AI CLI には **custom runtime profile** を定義できます。たとえば、Codex の社内 wrapper、バージョンを固定した実行ファイル、モデル引数を事前設定したチーム CLI などです。
+デーモンはデフォルトでバックグラウンドで動きます。よく使うコマンド:
-Claude Code、Codex、Kimi などの組み込み provider を通常のコマンドで使うだけなら、カスタムプロファイルは不要です。デーモンが自動的に検出します。
+| コマンド | 役割 |
+| --- | --- |
+| `multica daemon status` | デーモンと接続の状態を表示する |
+| `multica daemon logs -f` | ログを追跡表示する |
+| `multica daemon restart` | デーモンを再起動し、ローカルツールを再検出する |
+| `multica daemon stop` | デーモンを停止する |
+| `multica daemon start --foreground` | デバッグ用に現在のターミナルで実行する |
-### 作成前の確認
+起動時、デーモンは `PATH` 上の対応する AI コーディングツールを検出し、あなたが接続を許可されているワークスペースにランタイムを登録します。ツールをインストールまたはログインした直後の場合は、デーモンを再起動すると再検出されます。
-- Multica デーモンが動作する少なくとも 1 台のマシンにカスタムコマンドをインストールし、同じコマンドがそのマシンのターミナルで動くことを確認します。
-- ツールが UI に表示されるベースプロトコルファミリーのいずれかを実装していることを確認します。ファミリーの選択は Multica に通信方法を伝えるもので、互換性のない CLI を互換にするものではありません。
-- プロファイルを作成、編集、削除できるのはワークスペースの owner または admin だけです。
+デーモンは、組み込みで対応している AI コーディングツールを少なくとも 1 つ検出できないと起動しません。インストール方法と実行コマンド名は [AI コーディングツールのインストール](/install-agent-runtime)を参照してください。
-### Runtimes UI から作成する
+## ディスパッチとオンライン状態
-1. **Runtimes** を開き、コマンドをインストールしたマシンを選択します。
-2. **カスタムランタイムを追加**を選択します。
-3. コマンドが実装しているベースプロトコルファミリーを選びます。
-4. 表示名と、固定引数を含むターミナルで実行するコマンドを入力します。チーム向けに用途の説明も追加できます。
-5. **ランタイムを作成**を選択します。
+登録されたランタイムは接続を維持し続けます。新しいタスクがキューに入ると、サーバーは対応するデーモンに通知します。デーモン側も定期的にポーリングし、接続断のあとの補完として機能します。そのため、ランタイムがオンラインで空き容量があれば、タスクは通常すぐに開始されます。
-プロファイル定義はワークスペース全体に属し、接続済みのすべてのデーモンへ同期されます。各マシンはそのコマンドを解決できる場合にだけ独自のランタイムを登録します。作成を開始したマシンには待機中の **登録中** 行が一時的に表示されます。オンラインにならない場合は、そのマシンでコマンドがインストールされ、デーモンから見えることを確認してください。
+デーモンは 15 秒ごとにハートビートを送ります。サーバーはハートビートと接続状態を組み合わせてランタイムのオンラインを判定し、デーモンが予期せず終了した場合、通常は遅くとも約 3 分以内にオフラインと表示されます。
-プロファイルを作成しても CLI のインストール、認証、他のマシンへのコピーは行われません。このランタイムを提供する各マシンで、基盤となるツールを個別にインストールしてログインしてください。
+![オンラインのコンピュータ 1 台のランタイム詳細: 同じデーモンが 7 個のランタイムを登録し、検出された AI コーディングツールごとに 1 行、いずれもオンライン状態と CLI バージョンを表示している](/images/docs/runtime-machine-detail.png)
-### CLI から管理する
+ランタイムがオフラインのとき:
-同じワークスペースプロファイルを CLI から管理できます。
+- キュー済みのタスクは、最長 2 時間、ランタイムの復帰を待ちます。
+- 実行中だったタスクは失敗します。条件を満たすイシューまたはチャットのタスクは自動リトライできます。
+- デーモンが再起動すると、ランタイムを再登録し、前回正常に終了しなかったタスクを回収します。
+- 7 日を超えてオフラインで、(アーカイブ済みを含め)どのエージェントにも紐づいていないランタイムは、自動的にクリーンアップされます。
-```bash
-multica runtime profile list
-multica runtime profile create --display-name "Composer" --protocol-family codex --command-name agent
-multica runtime profile update <profile-id> --command-name agent
-multica runtime profile delete <profile-id>
-```
+詳細な状態とリトライのルールは[実行タスク](/tasks)を参照してください。
-組み込みランタイムとカスタムランタイムは同じマシン一覧に表示されます。カスタムランタイム行の操作メニューから、プロファイルを編集または削除できます。プロファイルを削除すると、デーモンの同期後に登録済みランタイムインスタンスも削除されます。エージェントがまだ依存している場合、削除はブロックされることがあります。
+## 同時実行の上限
-入力するコマンドは shell 文字列ではなく argv 形式です。Multica は実行ファイル名と固定引数を保存し、デーモンは `exec.Command(command_name, fixed_args...)` で直接起動します。通常の引数、引用符、バックスラッシュエスケープは使えますが、パイプ、リダイレクト、`&&`、`;`、バッククォート、`$VAR` / `$(...)` 展開は使えません。shell の動作が必要な場合は wrapper script を使ってください。
-現在、コマンドと引数の解析は Runtimes UI が担当します。CLI の profile コマンドは profile 行とローカルのパス上書きを管理します。
+1 つのデーモンはデフォルトで最大 20 件のタスクを同時に実行します。各エージェントはデフォルトで最大 6 件です。実効的な同時実行数は両者の小さい方になります。
-デスクトップアプリから起動したデーモンが、ターミナルでは動くコマンドを見つけられない場合は、そのマシンで絶対パスを固定できます。
+上限に達すると、新しいタスクはキューで待ち続けます。個々のエージェントの同時実行数はエージェント設定で、マシン全体の上限は `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` で調整できます。並列実行は、マシンの性能、ツールアカウントのクォータ、同じ作業ディレクトリを同時に取り合います。
-```bash
-multica runtime profile set-path <profile-id> --path /abs/path/to/agent
-multica runtime profile unset-path <profile-id>
-```
+## プライベートと公開
-profile のコマンドや引数の変更は、デーモンが再登録された後に新しく取得するタスクへ適用されます。実行中のタスクは開始時の引数を使い続けます。混在デプロイでは、先に server をアップグレードしてから daemon を順次更新することを推奨します。`fixed_args` の入力は server 側の Runtimes UI が担い、`failed_profiles` 登録レポートも server が表示します。古いコンポーネントは未知のフィールドを明示的に失敗させず無視することがあるため、server を先に更新すると rollout を観測しやすくなります。
+ローカルランタイムはデフォルトで**プライベート**です。ランタイムの所有者と、ワークスペースの owner・admin がその上にエージェントを作成できます。
-<Callout type="info">
-**クラウドランタイムが近日提供されます。** 現在は順番待ちリストの段階です。提供が始まれば、ローカルのデーモンを実行せずに Multica Cloud 上で直接エージェントタスクを実行できるようになります。[ダウンロードページ](https://multica.ai/download)でメールアドレスを登録すると通知を受け取れます。
-</Callout>
+ランタイムの所有者または管理者は、ランタイムを**公開**に変更できます。公開すると、ワークスペースの他のメンバーもこのランタイムを選べるようになります。これは基盤の AI コーディングツールのログイン認証情報を共有するものではなく、メンバーがエージェントの実行タスクをこのコンピュータにルーティングできるようになるだけです。
-## ランタイムがオフラインと表示される時点
+## カスタムランタイムプロファイル
-Multica はハートビートでランタイムがオンラインかどうかを判断します。3 つの重要な数値があります。
+チームで社内 wrapper やバージョン固定の実行ファイルを使う場合、あるいは互換ツールに固定引数を追加したい場合は、**カスタムランタイムプロファイル**を作成できます。
-| イベント | しきい値 |
-|---|---|
-| デーモンのハートビート頻度 | **15 秒**ごと |
-| 欠落として表示 | **45 秒**間ハートビートなし(3 回欠落) |
-| 自動削除 | 関連するエージェントがない状態で **7 日**以上欠落 |
+カスタムプロファイルが新しい通信プロトコルを追加することはありません。作成時には、Multica がすでに対応しているプロトコルファミリー(ツールの連携プロトコルの種類。[AI コーディングツール対照表](/providers)を参照)を選ぶ必要があり、コマンド自体がそのプロトコルファミリーと互換でなければなりません。
-欠落は永続的ではありません。デーモンが再びハートビートを送った瞬間にオンラインに戻り、ランタイムレコードも保持されます。デーモンを再起動してもランタイムは失われません。
+### プロファイルの作成
-<Callout type="warning">
-**欠落したランタイムで実行中だったタスクは失敗として表示されます**(失敗理由 `runtime_offline`)。リトライ可能なソース(イシュー、チャット)については、Multica が自動的に再度キューに入れます。オートパイロットがトリガーしたタスクは自動的にはリトライされません。[タスク → どの失敗が自動リトライされるか](/tasks#which-failures-retry-automatically-which-dont)を参照してください。
-</Callout>
+カスタムランタイムプロファイルを作成・変更・削除できるのは、ワークスペースの owner と admin だけです。
-## いくつのタスクを並列に実行できるか
+1. **ランタイム**を開き、対象のコマンドがインストール済みのコンピュータに移動します。
+2. **カスタムランタイムを追加**をクリックします。
+3. コマンドが実際に互換のあるプロトコルファミリーを選びます。
+4. 名前、コマンド、固定引数を入力して保存します。
-Multica は 2 つの層で同時実行数の制限を適用します。
+プロファイルはワークスペース内で共有されます。接続済みの各コンピュータが自分でこのコマンドを探し、`PATH` 上で解決できたコンピュータだけが対応するランタイムを登録します。プロファイルを作成してもコマンドはインストールされず、他のメンバーのツールログインが代行されることもありません。
-- **デーモン層**: デフォルトで**同時タスク 20 個**(環境変数 `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` で調整可能)
-- **エージェント層**: デフォルトで**エージェントあたり同時タスク 6 個**(エージェントごとに設定)
+ここに入力するのは実行ファイルと引数であり、shell スクリプトではありません。通常の引数、引用符、バックスラッシュによるエスケープは使えますが、パイプ、リダイレクト、`&&`、`;`、バッククォート、環境変数の展開は使えません。これらの挙動が必要な場合は wrapper script にまとめ、そのスクリプトをコマンドとして指定してください。
-2 つのうち厳しい方が適用されます。デーモンがすでにタスク 20 個を実行中なら、あるエージェントに余裕が残っていても新しいタスクは待機します。
+Desktop が起動したデーモンが、ターミナルでは実行できるコマンドを見つけられない場合は、現在のコンピュータに絶対パスを設定できます。
-タスクが `dispatched` に進めず `queued` で止まっている場合、通常はこの 2 つの制限のいずれかが飽和しています。
+```bash
+multica runtime profile set-path <profile-id> --path /absolute/path/to/command
+```
-## デーモンのクラッシュ後、進行中だったタスクはどうなるか
+パスの上書きを解除するには:
-デーモンがクラッシュしたり強制終了されたりすると、デーモンが取得していたタスクは `dispatched` または `running` 状態に残ります。次回の起動時、デーモンはサーバーに「これらのタスクはもう私のものではないので、失敗として表示してください」と伝えます。サーバーはそれを理由 `runtime_recovery` とともに `failed` に切り替えます。リトライ可能なソースについては、タスクが自動的に再度キューに入ります。
+```bash
+multica runtime profile unset-path <profile-id>
+```
-この手順がネットワークの問題で失敗しても、バックアップとして**30 秒ごと**にサーバー側のスキャンが回ります。45 秒以上ハートビートのないランタイムは欠落として表示され、その上のタスクも一緒に回収されます。
+プロファイルの変更は、それ以降に取得されるタスクにのみ影響します。プロファイルを削除する前に、対応するランタイムにまだ紐づいているアクティブなエージェントを先に処理してください。あるコンピュータ上のランタイムインスタンスだけを削除してもプロファイルは消えず、実行中のデーモンが再登録します。
-## 動かないエージェントのトラブルシューティング
+## ランタイムがオフラインのときの確認手順
-「自分のエージェントが動かない」という問題に遭遇したら、まずこの 3 ステップのチェックリストを進めてください。
+次の順に確認します。
-1. `multica daemon status` を実行し、デーモンが実行中でオンラインかを確認します
-2. `multica daemon logs -f` を実行し、エラーがないかを確認します
-3. Multica UI の**ランタイム**ページを開き、ランタイムが「オンライン」と表示されているかを確認します
+1. `multica daemon status` を実行し、デーモンが起動していることを確認する。
+2. `multica daemon logs -f` を実行し、ログイン、ネットワーク、ツール検出のエラーを確認する。
+3. 同じ実行環境で `command -v <ツールコマンド>` を実行し、デーモンがコマンドを見つけられることを確認する。
+4. Multica の**ランタイム**ページを開き、対象のコンピュータと対応する AI コーディングツールがオンラインと表示されているか確認する。
+5. ツールのインストール直後、パスの変更直後、プロファイルの更新直後は `multica daemon restart` を実行する。
-より多くのシナリオは[トラブルシューティング](/troubleshooting)を参照してください。
+それでも解決しない場合は[トラブルシューティング](/troubleshooting)を参照してください。
-## 次へ
+## 次のステップ
-- [タスク](/tasks) — デーモンがタスクを取得した後の全ライフサイクル
-- [プロバイダー対照表](/providers) — 16 種の AI コーディングツールの機能の違い
+- [AI コーディングツールのインストール](/install-agent-runtime) — 対応する AI コーディングツールをインストールして動作を確認する。
+- [AI コーディングツール対照表](/providers) — モデル、セッション再開、MCP、スキル対応を比較する。
+- [実行タスク](/tasks) — キュー、停止、リトライの仕組みを知る。
diff --git a/apps/docs/content/docs/daemon-runtimes.ko.mdx b/apps/docs/content/docs/daemon-runtimes.ko.mdx
index 13aaec8752..e45400c28a 100644
--- a/apps/docs/content/docs/daemon-runtimes.ko.mdx
+++ b/apps/docs/content/docs/daemon-runtimes.ko.mdx
@@ -1,160 +1,129 @@
---
title: 데몬과 런타임
-description: 에이전트는 Multica 서버에서 실행되지 않습니다. 여러분의 기기에서 실행됩니다.
+description: Multica가 컴퓨터를 연결하고 AI 코딩 도구를 찾아 태스크를 실행하는 방식을 알아봅니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-Multica에서 [에이전트](/agents)는 우리 서버에서 실행되지 **않습니다**. 로컬에 설치된 [AI 코딩 도구](/providers)를 호출하는 **데몬**이라는 작은 프로그램이 구동하여, 여러분 자신의 기기에서 실행됩니다. Multica 서버는 조율만 담당합니다. [이슈](/issues)를 저장하고, [작업](/tasks)을 대기열에 넣고, 알맞은 **런타임**으로 분배합니다(런타임 = 데몬 × AI 코딩 도구 하나).
+Multica는 작업을 기록하고 조율하며 연결된 컴퓨터가 실행을 담당합니다. 컴퓨터의 **데몬**(daemon)이 태스크를 가져간 뒤 로컬에 설치된 AI 코딩 도구를 호출합니다.
-이 구조가 Multica와 Linear / Jira의 가장 큰 차이점입니다. **여러분의 API 키, 툴체인, 코드 디렉터리는 모두 여러분의 기기에 남아 있으며**, Multica 서버는 그중 어느 것도 보지 못합니다. 따라서 "내 에이전트가 동작하지 않는다"는 거의 항상 로컬 문제입니다. 데몬이 실행 중이 아니거나, AI 도구가 설치되어 있지 않거나, 키가 만료되었을 수 있습니다. 먼저 로컬을 확인하세요. 안내는 [문제 해결](/troubleshooting)을 참고하세요.
+## 개념 구분
-## 데몬 시작하기
+- **데몬**은 한 컴퓨터에서 실행되는 Multica 백그라운드 프로그램입니다. 서버 연결, 로컬 도구 검색, 태스크 수령, 결과 반환을 담당합니다.
+- **런타임**은 워크스페이스가 사용할 수 있는 구체적인 실행 환경을 나타냅니다. 컴퓨터 한 대와 그 컴퓨터의 AI 코딩 도구 하나 또는 사용자 지정 런타임 설정의 조합입니다.
-데몬은 Multica CLI의 일부입니다. [Multica CLI](/cli)를 설치한 뒤, 여러분의 기기에서 실행하세요.
+예를 들어 한 컴퓨터에 Claude Code와 Codex가 모두 설치되어 있고 두 워크스페이스에 연결되어 있다면 데몬이 각 워크스페이스에 Claude Code와 Codex 런타임을 각각 등록합니다. 데몬을 다시 시작하면 기존 기록이 업데이트되며 같은 조합의 런타임이 계속 새로 생기지 않습니다.
-```bash
-multica daemon start
-```
-
-시작 시 데몬은 네 가지 일을 합니다.
-
-1. 로그인할 때 저장된 인증 정보를 읽습니다
-2. `PATH`에 설치된 AI 코딩 도구를 감지합니다(내장 16종: [Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code), [Grok](/providers#grok))
-3. 감지된 각 도구에 대한 런타임과 함께 자신을 서버에 등록합니다
-4. **3초마다** 가져올 작업이 있는지 폴링하고, **15초마다 하트비트를 전송**합니다
-
-자주 쓰는 명령:
-
-| 명령 | 용도 |
-|---|---|
-| `multica daemon start` | 시작(기본은 백그라운드. 포그라운드로 실행하려면 `--foreground` 추가) |
-| `multica daemon stop` | 중지 |
-| `multica daemon restart` | 재시작 |
-| `multica daemon status` | 상태 표시 |
-| `multica daemon logs` | 로그 표시(따라가려면 `-f` 추가) |
+## 실행 위치와 데이터 경계
-전체 CLI 참고는 [CLI 명령](/cli)을 확인하세요.
+로컬 런타임이 호출하는 AI 코딩 도구, 도구 자체의 로그인 자격 증명, 로컬 코드 디렉터리는 연결된 컴퓨터에 남습니다. Multica 서버가 로컬 도구를 대신해 명령을 실행하거나 전체 작업 디렉터리를 자동으로 업로드하지 않습니다.
-**데스크톱 앱에는 데몬이 포함되어 있습니다.** [데스크톱 앱](/desktop-app)을 사용한다면 `multica daemon start`를 수동으로 실행할 필요가 없습니다. 시작할 때 데몬을 자동으로 띄웁니다. 여러분의 워크플로에 어떤 방식이 맞는지는 [데스크톱 앱](/desktop-app) 페이지를 참고하세요.
+팀 협업을 위해 서버에는 이슈, 댓글, 에이전트 설정, 태스크 컨텍스트, 실행 기록, 에이전트가 반환한 결과가 저장됩니다. 이 내용에는 에이전트가 직접 읽고 답변에 포함한 코드 조각이나 다른 프로젝트 컨텍스트가 들어갈 수 있습니다.
-## 한 기기에 여러 런타임이 생기는 이유
-
-런타임은 서버도 아니고 컨테이너도 아닙니다. "**데몬 × AI 코딩 도구 하나**"의 조합입니다. 예를 들어, Claude Code와 Codex가 모두 설치된 MacBook에서 데몬을 시작하고, 여러분이 두 개의 워크스페이스 멤버라고 합시다. 그러면 Multica는 4개의 런타임을 등록합니다.
+<Callout type="warning">
+에이전트의 사용자 지정 환경 변수는 서버에 저장되고 실행할 때 런타임으로 전송됩니다. "로컬 실행"이 모든 secret이 로컬에만 존재한다는 뜻은 아닙니다. 사용자 지정 환경 변수와 MCP 설정은 서버에 저장되며 민감 정보 규칙에 따라 표시가 제한됩니다.
+</Callout>
-<Mermaid chart={`
-graph TD
- D["여러분의 데몬<br/>MacBook"]
- D --> R1["런타임<br/>워크스페이스 A × Claude Code"]
- D --> R2["런타임<br/>워크스페이스 A × Codex"]
- D --> R3["런타임<br/>워크스페이스 B × Claude Code"]
- D --> R4["런타임<br/>워크스페이스 B × Codex"]
-`} />
+## 데몬 시작
-핵심 포인트:
+Multica Desktop을 사용하면 앱이 데몬을 자동으로 시작하므로 별도 명령을 실행할 필요가 없습니다.
-- **하나의 데몬은 여러 런타임에 매핑될 수 있습니다.** 설치된 도구와 가입한 워크스페이스의 조합마다 하나씩 생깁니다
-- **같은 데몬, 워크스페이스, 도구는 정확히 하나의 런타임을 만듭니다.** 데몬을 재시작해도 중복 레코드가 생기지 않습니다
-- Multica UI의 **런타임** 페이지가 이 행들을 나열합니다
+Web, 원격 컴퓨터, 화면 없는 환경에서는 먼저 [Multica CLI를 설치](/cli)한 뒤 다음을 실행합니다.
-## 사용자 지정 런타임 프로필
+```bash
+multica daemon start
+```
-기본 provider 감지는 일반적인 도구를 다룹니다. Multica가 지원하는 프로토콜 패밀리로 동작하지만 다른 실행 명령이 필요한 AI CLI에는 **custom runtime profile**을 정의할 수 있습니다. 예를 들면 Codex용 사내 wrapper, 버전을 고정한 실행 파일, 모델 인수를 미리 추가하는 팀 CLI가 있습니다.
+데몬은 기본적으로 백그라운드에서 실행됩니다. 자주 사용하는 명령은 다음과 같습니다.
-Claude Code, Codex, Kimi 같은 기본 제공 provider를 기본 명령으로 사용하는 경우에는 사용자 지정 프로필이 필요하지 않습니다. 데몬이 자동으로 감지합니다.
+| 명령 | 역할 |
+| --- | --- |
+| `multica daemon status` | 데몬과 연결 상태 확인 |
+| `multica daemon logs -f` | 로그 계속 보기 |
+| `multica daemon restart` | 데몬을 다시 시작하고 로컬 도구 다시 감지 |
+| `multica daemon stop` | 데몬 중지 |
+| `multica daemon start --foreground` | 디버깅을 위해 현재 터미널에서 실행 |
-### 만들기 전에 확인할 사항
+시작할 때 데몬은 `PATH`에서 지원되는 AI 코딩 도구를 감지하고 사용자가 연결할 권한이 있는 워크스페이스에 런타임을 등록합니다. 도구를 방금 설치하거나 로그인했다면 데몬을 다시 시작해 다시 감지할 수 있습니다.
-- Multica 데몬을 실행하는 기기 중 하나 이상에 사용자 지정 명령을 설치하고, 같은 명령이 해당 기기의 터미널에서 실행되는지 확인합니다.
-- 도구가 UI에 표시되는 기본 프로토콜 패밀리 중 하나를 구현하는지 확인합니다. 패밀리를 선택하는 것은 Multica에 프로세스와 통신하는 방법을 알려 줄 뿐, 호환되지 않는 CLI를 호환되게 만들지는 않습니다.
-- 프로필을 만들고 수정하고 삭제하려면 워크스페이스 owner 또는 admin이어야 합니다.
+데몬을 시작하려면 기본 지원 AI 코딩 도구를 하나 이상 감지해야 합니다. 설치 방법과 실행 파일 이름은 [AI 코딩 도구 설치](/install-agent-runtime)를 참고하세요.
-### Runtimes UI에서 만들기
+## 디스패치와 온라인 상태
-1. **Runtimes**를 열고 명령을 설치한 기기를 선택합니다.
-2. **사용자 지정 런타임 추가**를 선택합니다.
-3. 명령이 실제로 구현하는 기본 프로토콜 패밀리를 선택합니다.
-4. 표시 이름과 터미널에서 실행할 명령을 고정 인수와 함께 입력합니다. 팀원이 용도를 알 수 있도록 설명을 추가할 수도 있습니다.
-5. **런타임 생성**을 선택합니다.
+런타임이 등록되면 연결을 계속 유지합니다. 새 태스크가 큐에 들어오면 서버가 해당 데몬에 알리고, 연결이 끊겼을 때를 대비해 데몬도 주기적으로 폴링합니다. 따라서 런타임이 온라인이고 여유 용량이 있으면 태스크는 보통 즉시 시작됩니다.
-프로필 정의는 워크스페이스 전체에 속하며 연결된 모든 데몬에 동기화됩니다. 각 기기는 해당 명령을 찾을 수 있을 때만 자체 런타임을 등록합니다. 만들기를 시작한 기기에는 기다리는 동안 임시 **등록 중** 행이 표시됩니다. 온라인으로 바뀌지 않으면 해당 기기에 명령이 설치되어 있고 데몬에서 찾을 수 있는지 확인하세요.
+데몬은 15초마다 heartbeat를 보냅니다. 서버는 heartbeat와 연결 상태를 함께 사용해 런타임의 온라인 여부를 판단합니다. 데몬이 예기치 않게 종료되면 보통 늦어도 약 3분 안에 오프라인으로 표시됩니다.
-프로필을 만들어도 CLI가 설치되거나 인증되거나 다른 기기로 복사되지는 않습니다. 이 런타임을 제공할 각 기기에서 기반 도구를 별도로 설치하고 로그인해야 합니다.
+![온라인 컴퓨터의 런타임 상세: 같은 데몬이 감지된 AI 코딩 도구마다 한 줄씩 총 7개 런타임을 등록했고 모두 온라인 상태와 CLI 버전을 표시합니다.](/images/docs/runtime-machine-detail.png)
-### CLI에서 관리하기
+런타임이 오프라인일 때는 다음과 같이 처리됩니다.
-같은 워크스페이스 프로필을 CLI에서도 관리할 수 있습니다.
+- 이미 큐에 들어간 태스크는 런타임이 복구될 때까지 최대 2시간 기다립니다.
+- 실행 중인 태스크는 실패합니다. 조건을 만족하는 이슈 또는 대화 태스크는 자동으로 재시도될 수 있습니다.
+- 데몬이 다시 시작되면 런타임을 재등록하고 이전에 정상적으로 끝나지 않은 태스크를 회수합니다.
+- 7일 넘게 오프라인이고 연결된 에이전트가 하나도 없는 런타임은 보관된 에이전트까지 확인한 뒤 자동으로 정리됩니다.
-```bash
-multica runtime profile list
-multica runtime profile create --display-name "Composer" --protocol-family codex --command-name agent
-multica runtime profile update <profile-id> --command-name agent
-multica runtime profile delete <profile-id>
-```
+자세한 상태와 재시도 규칙은 [실행 태스크](/tasks)를 참고하세요.
-기본 제공 런타임과 사용자 지정 런타임은 같은 기기 목록에 표시됩니다. 사용자 지정 런타임 행의 작업 메뉴에서 프로필을 수정하거나 삭제할 수 있습니다. 프로필을 삭제하면 데몬이 동기화된 뒤 등록된 런타임 인스턴스도 제거됩니다. 에이전트가 아직 이 프로필에 의존하면 삭제가 차단될 수 있습니다.
+## 동시 실행 제한
-명령은 shell 문자열이 아니라 argv 형식입니다. Multica는 실행 파일 이름과 고정 인수를 저장하고, 데몬은 `exec.Command(command_name, fixed_args...)`로 직접 실행합니다. 일반 인수, 따옴표, 백슬래시 이스케이프는 지원하지만 파이프, 리다이렉션, `&&`, `;`, 백틱, `$VAR` / `$(...)` 확장은 지원하지 않습니다. shell 동작이 필요하면 wrapper script를 사용하세요.
-현재 명령과 인수 파싱은 Runtimes UI가 담당합니다. CLI의 profile 명령은 profile 행과 로컬 경로 override를 관리합니다.
+데몬 한 대는 기본적으로 태스크를 최대 20개까지 동시에 실행하며, 에이전트 한 명은 기본적으로 최대 6개까지 동시에 실행합니다. 실제 동시 실행 수에는 둘 중 더 작은 값이 적용됩니다.
-데스크톱 앱에서 시작한 데몬이 터미널에서는 동작하는 명령을 찾지 못한다면, 해당 기기에서 절대 경로를 고정할 수 있습니다.
+상한에 도달하면 새 태스크는 계속 큐에서 기다립니다. 에이전트 설정에서 개별 에이전트의 동시 실행 수를 조정할 수 있고 `MULTICA_DAEMON_MAX_CONCURRENT_TASKS`로 컴퓨터 전체 상한을 조정할 수도 있습니다. 병렬 실행은 컴퓨터 성능, 도구 계정 사용량, 같은 작업 디렉터리를 동시에 사용합니다.
-```bash
-multica runtime profile set-path <profile-id> --path /abs/path/to/agent
-multica runtime profile unset-path <profile-id>
-```
+## 비공개와 공개
-profile의 명령이나 인수 변경은 데몬이 다시 등록된 뒤 새로 가져오는 작업부터 적용됩니다. 이미 실행 중인 작업은 시작할 때의 인수를 유지합니다. 혼합 배포에서는 server를 먼저 업그레이드한 뒤 daemon을 순차적으로 업데이트하는 것을 권장합니다. `fixed_args` 입력은 server 쪽 Runtimes UI가 담당하고, `failed_profiles` 등록 보고도 server가 표시합니다. 오래된 구성요소는 알 수 없는 필드를 명확히 실패시키기보다 무시할 수 있으므로 server를 먼저 올리면 rollout을 더 잘 관찰할 수 있습니다.
+로컬 런타임의 기본값은 **비공개**입니다. 런타임 owner와 워크스페이스 owner, admin이 그 위에 에이전트를 만들 수 있습니다.
-<Callout type="info">
-**클라우드 런타임이 곧 제공됩니다.** 현재는 대기자 명단 단계입니다. 제공이 시작되면 로컬 데몬을 실행하지 않고도 Multica Cloud에서 직접 에이전트 작업을 실행할 수 있습니다. [다운로드 페이지](https://multica.ai/download)에서 이메일로 등록하면 알림을 받을 수 있습니다.
-</Callout>
+런타임 owner 또는 관리자가 **공개**로 바꿀 수 있습니다. 공개하면 워크스페이스의 다른 멤버도 이 런타임을 선택할 수 있습니다. 기반 AI 코딩 도구의 로그인 자격 증명을 공유하는 것이 아니라 멤버가 에이전트 실행 태스크를 해당 컴퓨터로 라우팅할 수 있게 하는 것입니다.
-## 런타임이 오프라인으로 표시되는 시점
+## 사용자 지정 런타임 설정
-Multica는 하트비트로 런타임이 온라인인지 판단합니다. 세 가지 핵심 수치:
+팀에서 내부 wrapper, 고정 버전 실행 파일을 사용하거나 호환 도구에 고정 인수를 추가해야 한다면 **사용자 지정 런타임 설정**을 만들 수 있습니다.
-| 이벤트 | 임곗값 |
-|---|---|
-| 데몬 하트비트 빈도 | **15초**마다 |
-| 누락으로 표시 | **45초** 동안 하트비트 없음(3회 누락) |
-| 자동 삭제 | 연결된 에이전트 없이 **7일** 넘게 누락 상태 |
+사용자 지정 설정이 새 통신 프로토콜을 추가하지는 않습니다. 만들 때 Multica가 이미 지원하는 프로토콜 계열 중 하나를 선택해야 하며(도구 연동 프로토콜 유형은 [AI 코딩 도구 비교](/providers) 참고), 명령 자체도 해당 프로토콜과 호환되어야 합니다.
-누락은 영구적이지 않습니다. 데몬이 다시 하트비트를 보내는 즉시 온라인으로 돌아오며, 런타임 레코드도 보존됩니다. 데몬을 재시작해도 런타임은 사라지지 않습니다.
+### 설정 만들기
-<Callout type="warning">
-**누락된 런타임에서 실행 중이던 작업은 실패로 표시됩니다**(실패 사유 `runtime_offline`). 재시도 가능한 출처(이슈, 채팅)에 대해서는 Multica가 자동으로 다시 대기열에 넣습니다. 오토파일럿이 트리거한 작업은 자동으로 재시도되지 않습니다. [작업 → 어떤 실패가 자동 재시도되는지](/tasks#which-failures-retry-automatically-which-dont)를 참고하세요.
-</Callout>
+워크스페이스 owner와 admin만 사용자 지정 런타임 설정을 만들고 수정하거나 삭제할 수 있습니다.
-## 동시에 실행할 수 있는 작업 수
+1. **런타임**을 열고 해당 명령이 설치된 컴퓨터로 들어갑니다.
+2. **사용자 지정 런타임 추가**를 클릭합니다.
+3. 명령이 실제로 호환되는 프로토콜 계열을 선택합니다.
+4. 이름, 명령, 고정 인수를 입력하고 저장합니다.
-Multica는 두 계층에서 동시성 제한을 적용합니다.
+설정은 워크스페이스에서 공유됩니다. 연결된 각 컴퓨터가 이 명령을 개별적으로 찾으며 `PATH`에서 명령을 확인할 수 있는 컴퓨터만 해당 런타임을 등록합니다. 설정을 만든다고 명령이 자동으로 설치되거나 다른 멤버의 도구 로그인이 완료되지는 않습니다.
-- **데몬 계층**: 기본 **동시 작업 20개**(환경 변수 `MULTICA_DAEMON_MAX_CONCURRENT_TASKS`로 조정 가능)
-- **에이전트 계층**: 기본 **에이전트당 동시 작업 6개**(에이전트별로 설정)
+여기에는 shell script가 아니라 실행 파일과 인수를 입력합니다. 일반 인수, 따옴표, 백슬래시 이스케이프는 사용할 수 있지만 파이프, 리디렉션, `&&`, `;`, 역따옴표, 환경 변수 확장은 사용할 수 없습니다. 이런 동작이 필요하면 wrapper script에 넣고 해당 스크립트를 명령으로 입력하세요.
-둘 중 더 엄격한 쪽이 적용됩니다. 데몬이 이미 작업 20개를 실행 중이라면, 어떤 에이전트에 여유가 남아 있어도 새 작업은 대기합니다.
+Desktop이 시작한 데몬에서 터미널에서는 실행되는 명령을 찾지 못한다면 현재 컴퓨터에 절대 경로를 설정할 수 있습니다.
-작업이 `dispatched`로 넘어가지 못하고 `queued`에 멈춰 있다면, 보통 이 두 제한 중 하나가 포화 상태인 것입니다.
+```bash
+multica runtime profile set-path <profile-id> --path /absolute/path/to/command
+```
-## 데몬 충돌 후 진행 중이던 작업은 어떻게 되나
+경로 덮어쓰기를 제거하려면 다음을 실행합니다.
-데몬이 충돌하거나 강제 종료되면, 데몬이 가져갔던 작업은 `dispatched` 또는 `running` 상태에 남습니다. 다음 시작 시 데몬은 서버에 "이 작업들은 더 이상 제 것이 아니니, 실패로 표시해 주세요"라고 알립니다. 서버는 이를 사유 `runtime_recovery`와 함께 `failed`로 전환합니다. 재시도 가능한 출처에 대해서는 작업이 자동으로 다시 대기열에 들어갑니다.
+```bash
+multica runtime profile unset-path <profile-id>
+```
-이 단계가 네트워크 문제로 실패하더라도, 백업으로 **30초마다** 서버 측 스캔이 돕니다. 45초 넘게 하트비트가 없는 런타임은 누락으로 표시되며, 그 위의 작업도 함께 회수됩니다.
+설정 변경은 이후 가져가는 태스크에만 적용됩니다. 설정을 삭제하기 전에 해당 런타임에 계속 연결된 활성 에이전트를 먼저 처리해야 합니다. 특정 컴퓨터의 런타임 인스턴스만 삭제해도 설정은 삭제되지 않으며 실행 중인 데몬이 다시 등록합니다.
-## 동작하지 않는 에이전트 문제 해결
+## 런타임 오프라인 문제 해결
-"내 에이전트가 동작하지 않는다"는 문제를 만나면, 먼저 이 세 단계 체크리스트를 진행하세요.
+다음 순서로 확인하세요.
-1. `multica daemon status`를 실행해 데몬이 실행 중이고 온라인인지 확인하세요
-2. `multica daemon logs -f`를 실행해 오류가 있는지 확인하세요
-3. Multica UI의 **런타임** 페이지를 열어 런타임이 "온라인"으로 표시되는지 확인하세요
+1. `multica daemon status`를 실행해 데몬이 시작되었는지 확인합니다.
+2. `multica daemon logs -f`를 실행해 로그인, 네트워크, 도구 감지 오류를 확인합니다.
+3. 같은 실행 환경에서 `command -v <도구 명령>`을 실행해 데몬이 도구를 찾을 수 있는지 확인합니다.
+4. Multica의 **런타임** 페이지를 열고 대상 컴퓨터와 해당 AI 코딩 도구가 온라인으로 표시되는지 확인합니다.
+5. 도구를 방금 설치했거나 경로 또는 설정을 변경했다면 `multica daemon restart`를 실행합니다.
-더 많은 시나리오는 [문제 해결](/troubleshooting)을 참고하세요.
+그래도 해결되지 않으면 [문제 해결](/troubleshooting)을 참고하세요.
-## 다음
+## 다음 단계
-- [작업](/tasks) — 데몬이 작업을 가져온 뒤의 전체 생애 주기
-- [제공자 대조표](/providers) — 12종 AI 코딩 도구의 기능 차이
+- [AI 코딩 도구 설치](/install-agent-runtime) — 지원되는 AI 코딩 도구를 설치하고 확인합니다.
+- [AI 코딩 도구 비교](/providers) — 모델, 세션 복원, MCP, 스킬 지원을 비교합니다.
+- [실행 태스크](/tasks) — 큐 대기, 중지, 재시도를 알아봅니다.
diff --git a/apps/docs/content/docs/daemon-runtimes.mdx b/apps/docs/content/docs/daemon-runtimes.mdx
index 63ea6b60e3..cce57fdcf4 100644
--- a/apps/docs/content/docs/daemon-runtimes.mdx
+++ b/apps/docs/content/docs/daemon-runtimes.mdx
@@ -1,192 +1,129 @@
---
title: Daemon and runtimes
-description: Agents don't run on Multica's servers — they run on your own machines.
+description: How Multica connects computers, discovers AI coding tools, and executes tasks.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-In Multica, [agents](/agents) do **not** run on our servers — they run on your own machines, driven by a small program called the **daemon** that invokes the [AI coding tools](/providers) installed locally. The Multica server only coordinates: it stores [issues](/issues), queues [tasks](/tasks), and dispatches them to the right **runtime** (runtime = daemon × one AI coding tool).
+Multica records and coordinates the work; connected computers execute it. The **daemon** on a computer claims tasks and invokes the AI coding tools installed on that machine.
-This structure is the biggest difference between Multica and Linear / Jira: **your API keys, toolchain, and code directories stay on your machine** — the Multica server never sees any of them. That means "my agent isn't working" is almost always a local problem — the daemon isn't running, an AI tool isn't installed, a key has expired. Check locally first; see [Troubleshooting](/troubleshooting) for a guide.
+## Daemon vs runtime
-## Starting the daemon
-
-The daemon is part of the Multica CLI. Once you've installed the [Multica CLI](/cli), run on your own machine:
-
-```bash
-multica daemon start
-```
-
-On startup it does four things:
-
-1. Reads the credentials saved when you logged in
-2. Detects AI coding tools installed on your `PATH` (17 built-in: [Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Qwen Code](/providers#qwen-code), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code), [Grok](/providers#grok))
-3. Registers itself with the server, along with a runtime for each detected tool
-4. Keeps **polling every 3 seconds** for tasks to pick up, and **sends a heartbeat every 15 seconds**
+- The **daemon** is the Multica background process running on one computer. It connects to the server, discovers local tools, claims tasks, and reports results back.
+- A **runtime** represents one concrete execution environment available to a workspace. It corresponds to one computer plus one AI coding tool — or one custom runtime profile — on that computer.
-Common commands:
+For example, a computer has both Claude Code and Codex installed and is connected to two workspaces. The daemon registers Claude Code and Codex runtimes for each workspace. Restarting the daemon updates the existing records; it does not keep creating new runtimes for the same combination.
-| Command | Purpose |
-|---|---|
-| `multica daemon start` | Start (background by default; add `--foreground` to run in the foreground) |
-| `multica daemon stop` | Stop |
-| `multica daemon restart` | Restart |
-| `multica daemon status` | Show status |
-| `multica daemon logs` | Show logs (add `-f` to follow) |
-
-Full CLI reference in [CLI commands](/cli).
+## Execution location and data boundaries
-**The desktop app ships with a daemon.** If you use the [desktop app](/desktop-app), you don't need to run `multica daemon start` manually — it launches the daemon automatically on startup. See the [Desktop app](/desktop-app) page for which option fits your workflow.
+The AI coding tools a local runtime invokes, those tools' own login credentials, and your local code directories all stay on the connected computer. The Multica server does not execute commands on behalf of local tools, and it does not automatically upload your entire working directory.
-## Why one machine has multiple runtimes
+So the team can collaborate, the server stores issues, comments, agent configuration, task context, run records, and the results agents write back. That content can include code snippets or other project context an agent chose to read and include in its replies.
-A runtime is not a server and not a container — it's the combination of "**daemon × one AI coding tool**". For example: you start the daemon on a MacBook with both Claude Code and Codex installed, and you're a member of two workspaces. Multica then registers 4 runtimes:
+<Callout type="warning">
+An agent's custom environment variables are stored server-side and sent to the runtime at execution time. Do not read "local execution" as "every secret exists only on this machine": custom environment variables and MCP configuration live on the server, and their display is limited by the sensitive-value rules.
+</Callout>
-<Mermaid chart={`
-graph TD
- D["Your daemon<br/>MacBook"]
- D --> R1["Runtime<br/>Workspace A × Claude Code"]
- D --> R2["Runtime<br/>Workspace A × Codex"]
- D --> R3["Runtime<br/>Workspace B × Claude Code"]
- D --> R4["Runtime<br/>Workspace B × Codex"]
-`} />
+## Starting the daemon
-Key points:
+With Multica Desktop, the app starts the daemon automatically — no extra command needed.
-- **One daemon can map to multiple runtimes** — one per combination of installed tool and workspace you belong to
-- **The same daemon, workspace, and tool produces exactly one runtime** — restarting the daemon never creates duplicate records
-- The **Runtimes** page in the Multica UI lists these rows
+On the web, a remote computer, or a headless environment, [install the Multica CLI](/cli) first, then run:
-## Custom runtime profiles
+```bash
+multica daemon start
+```
-Built-in provider detection covers the common tools, but teams can also define
-**custom runtime profiles** for AI CLIs that speak one of Multica's supported
-protocol families and need a different launch command. Typical examples include
-an internal wrapper around Codex, a version-pinned executable, or a team CLI
-that adds fixed model arguments.
+The daemon runs in the background by default. Common commands:
-Do not create a custom profile just to use Claude Code, Codex, Kimi, or another
-built-in provider with its normal command. The daemon detects those tools
-automatically.
+| Command | Purpose |
+| --- | --- |
+| `multica daemon status` | Show daemon and connection status |
+| `multica daemon logs -f` | Follow the logs |
+| `multica daemon restart` | Restart the daemon and re-detect local tools |
+| `multica daemon stop` | Stop the daemon |
+| `multica daemon start --foreground` | Run in the current terminal, for debugging |
-### Before you create one
+On startup, the daemon detects supported AI coding tools on `PATH` and registers runtimes for the workspaces you are allowed to connect. If a tool was just installed or signed in, restart the daemon to detect it again.
-- Install the custom command on at least one machine running a Multica daemon,
- and confirm the same command works in that machine's terminal.
-- Confirm the tool speaks one of the base protocol families shown in the UI.
- Choosing a family tells Multica how to communicate with the process; it does
- not make an incompatible CLI compatible.
-- You must be a workspace owner or admin to create, edit, or delete a profile.
+The daemon needs at least one built-in supported AI coding tool detected before it will start. Install methods and executable names are in [Install AI coding tools](/install-agent-runtime).
-### Create one from the Runtimes UI
+## Dispatch and online status
-1. Open **Runtimes**, then select the machine where you installed the command.
-2. Select **Add custom runtime**.
-3. Choose the base protocol family implemented by the command.
-4. Enter a display name and the command you would run in a terminal, including
- any fixed arguments. Add an optional description so teammates know what it
- is for.
-5. Select **Create runtime**.
+Once registered, a runtime keeps a persistent connection. When a new task enters the queue, the server notifies the matching daemon; the daemon also polls periodically as a backstop after connection interruptions. So when a runtime is online with spare capacity, tasks usually start immediately.
-The profile definition belongs to the whole workspace and syncs to every
-connected daemon. Each machine registers its own runtime only when it can
-resolve that command. The machine where you started the flow shows a temporary
-**Registering** row while it waits. If the row does not become online, check
-that the command is installed and available to the daemon on that machine.
+The daemon sends a heartbeat every 15 seconds. The server combines heartbeats and connection state to decide whether a runtime is online; after a daemon exits unexpectedly, the runtime usually shows as offline within about 3 minutes at the latest.
-Creating a profile does not install the CLI, authenticate it, or copy it to
-other machines. Install and sign in to the underlying tool separately on every
-machine that should provide this runtime.
+![Runtime details for one online computer: the same daemon registered 7 runtimes, one row per detected AI coding tool, each showing online status and CLI version](/images/docs/runtime-machine-detail.png)
-### Manage profiles from the CLI
+When a runtime is offline:
-The same workspace profiles can be managed from the CLI:
+- Tasks already queued wait for the runtime to recover, for up to 2 hours.
+- Tasks that were running fail; eligible issue or chat tasks can retry automatically.
+- When the daemon starts again, it re-registers its runtimes and reclaims tasks that did not end cleanly last time.
+- A runtime offline for more than 7 days with no agents bound to it (including archived ones) is cleaned up automatically.
-```bash
-multica runtime profile list
-multica runtime profile create --display-name "Composer" --protocol-family codex --command-name agent
-multica runtime profile update <profile-id> --command-name agent
-multica runtime profile delete <profile-id>
-```
+Detailed states and retry rules are in [Tasks](/tasks).
-Custom and built-in runtimes share the same machine list. Use a custom runtime
-row's actions menu to edit or delete its profile. Deleting a profile removes its
-registered runtime instances after the daemons synchronize; it can be blocked
-while agents still depend on it.
+## Concurrency limits
-The command is argv-oriented, not a shell string. Multica stores an executable
-name plus fixed arguments, then the daemon launches it directly with
-`exec.Command(command_name, fixed_args...)`. Plain arguments, quotes, and
-backslash escaping are supported; pipes, redirects, `&&`, `;`, backticks, and
-`$VAR` / `$(...)` expansion are not. Use a wrapper script when the runtime needs
-shell behavior. Today the Runtimes UI owns command-and-argument parsing; the CLI
-profile commands manage the profile row and local path overrides.
+One daemon executes at most 20 tasks at a time by default; each agent at most 6. Effective concurrency is the smaller of the two.
-If a desktop-launched daemon cannot find a command that works in your terminal,
-pin the absolute path on that machine:
+Once a limit is reached, new tasks keep queueing. You can adjust a single agent's concurrency in the agent settings, and the machine-wide cap through `MULTICA_DAEMON_MAX_CONCURRENT_TASKS`. Parallel runs compete for machine capacity, tool account quota, and the same working directory all at once.
-```bash
-multica runtime profile set-path <profile-id> --path /abs/path/to/agent
-multica runtime profile unset-path <profile-id>
-```
+## Private and public runtimes
-Profile command or argument edits apply to newly claimed tasks after the daemon
-re-registers. Running tasks keep the launch arguments they started with. For
-mixed deployments, upgrade the server before rolling out newer daemons: the
-server-side Runtimes UI stores `fixed_args`, and the server is what surfaces
-`failed_profiles` registration reports. Older components may ignore fields they
-do not understand instead of failing loudly, so treating the server upgrade as
-the first step keeps the rollout observable.
+A local runtime is **private** by default: the runtime owner and the workspace's owners and admins can create agents on it.
-<Callout type="info">
-**Cloud runtimes are coming**, currently in a waitlist phase. Once available, you'll be able to execute agent tasks directly on Multica Cloud without running a local daemon. Sign up with your email on the [download page](https://multica.ai/download) to get notified.
-</Callout>
+The runtime owner or an admin can make it **public**. Other workspace members can then select this runtime as well; that does not share the underlying AI coding tool's login credentials — it only lets members route their agents' tasks to this computer.
-## When a runtime is marked offline
+## Custom runtime profiles
-Multica uses heartbeats to decide whether a runtime is online. Three key numbers:
+If your team uses an internal wrapper, a version-pinned executable, or needs fixed extra arguments for a compatible tool, create a **custom runtime profile**.
-| Event | Threshold |
-|---|---|
-| Daemon heartbeat frequency | Every **15 seconds** |
-| Marked as missing | No heartbeat for **45 seconds** (3 missed beats) |
-| Auto-deleted | Missing with no associated agents for over **7 days** |
+A custom profile does not add a new communication protocol. You still pick one of the protocol families Multica already supports (the tool's integration protocol type; see [AI coding tools comparison](/providers)), and the command itself must be compatible with that family.
-Missing is not permanent — as soon as the daemon sends another heartbeat it returns to online, and the runtime record is preserved. Restarting the daemon does not lose runtimes.
+### Creating a profile
-<Callout type="warning">
-**Tasks running on a missing runtime are marked as failed** (failure reason `runtime_offline`). For retryable sources (issues, chat), Multica automatically requeues them; Autopilot-triggered tasks are not retried automatically. See [Tasks → Which failures retry automatically](/tasks#which-failures-retry-automatically-which-dont).
-</Callout>
+Only workspace owners and admins can create, edit, or delete custom runtime profiles:
-## How many tasks can run in parallel
+1. Open **Runtimes** and go to a computer where the command is installed.
+2. Click **Add custom runtime**.
+3. Choose the protocol family the command is actually compatible with.
+4. Fill in the name, command, and fixed arguments, then save.
-Multica enforces concurrency limits at two layers:
+The profile is shared across the workspace. Each connected computer looks up the command on its own; only computers that can resolve it on `PATH` register the corresponding runtime. Creating a profile does not install the command, and it does not sign other members in to the tool.
-- **Daemon layer**: **20 concurrent tasks** by default (tunable via env var `MULTICA_DAEMON_MAX_CONCURRENT_TASKS`)
-- **Agent layer**: **6 concurrent tasks per agent** by default (configured per-agent)
+The command field takes an executable and arguments, not a shell script. Plain arguments, quotes, and backslash escapes work; pipes, redirects, `&&`, `;`, backticks, and environment variable expansion do not. When you need those behaviors, put them in a wrapper script and use that script as the command.
-The tighter of the two wins. If your daemon is already running 20 tasks, new tasks wait even if an agent still has headroom.
+If a Desktop-launched daemon cannot find a command your terminal can run, set an absolute path for the current computer:
-If you see tasks stuck in `queued` without moving to `dispatched`, one of these two limits is usually saturated.
+```bash
+multica runtime profile set-path <profile-id> --path /absolute/path/to/command
+```
-## What happens to in-flight tasks after a daemon crash
+Remove the path override:
-When the daemon crashes or is force-killed, the tasks it had picked up are left in `dispatched` or `running`. On the next start, the daemon tells the server: "these tasks are no longer mine, please mark them failed." The server flips them to `failed` with reason `runtime_recovery` — for retryable sources, the tasks are automatically requeued.
+```bash
+multica runtime profile unset-path <profile-id>
+```
-Even if this step fails due to a network issue, there's a server-side scan **every 30 seconds** as a backstop: any runtime without a heartbeat for over 45 seconds is marked missing, and its tasks are reclaimed along with it.
+Editing a profile only affects tasks claimed afterwards. Before deleting a profile, deal with the active agents still bound to its runtimes. Deleting only the runtime instance on one computer does not delete the profile — a running daemon will re-register it.
-## Troubleshooting agents that aren't working
+## Troubleshooting an offline runtime
-When you hit a "my agent isn't working" problem, run this three-step checklist first:
+Check in this order:
-1. Run `multica daemon status` — confirm the daemon is running and online
-2. Run `multica daemon logs -f` — check for errors
-3. Open the **Runtimes** page in the Multica UI — confirm your runtime shows "online"
+1. Run `multica daemon status` to confirm the daemon is running.
+2. Run `multica daemon logs -f` to look for login, network, or tool-detection errors.
+3. Run `command -v <tool-command>` in the same environment to confirm the daemon can find it.
+4. Open Multica's **Runtimes** page and check whether the target computer and the matching AI coding tool show as online.
+5. After a tool install, a path change, or a profile update, run `multica daemon restart`.
-More scenarios in [Troubleshooting](/troubleshooting).
+If the problem persists, see [Troubleshooting](/troubleshooting).
-## Next
+## Next steps
-- [Tasks](/tasks) — the full lifecycle of a task once the daemon picks it up
-- [Providers Matrix](/providers) — capability differences across the 17 AI coding tools
+- [Install AI coding tools](/install-agent-runtime) — install and verify a supported AI coding tool.
+- [AI coding tools comparison](/providers) — compare models, session resumption, MCP, and skill support.
+- [Tasks](/tasks) — queueing, stopping, and retries.
diff --git a/apps/docs/content/docs/daemon-runtimes.zh.mdx b/apps/docs/content/docs/daemon-runtimes.zh.mdx
index 0620cbea02..aec3150eae 100644
--- a/apps/docs/content/docs/daemon-runtimes.zh.mdx
+++ b/apps/docs/content/docs/daemon-runtimes.zh.mdx
@@ -1,160 +1,129 @@
---
title: 守护进程与运行时
-description: 智能体不在 Multica 服务器上运行——它们跑在你自己的机器上。
+description: 了解 Multica 如何连接电脑、发现 AI 编程工具并执行任务。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-在 Multica 里,[智能体](/agents) **不**在我们的服务器上运行——它们跑在你自己的机器上,由一个叫**守护进程**(daemon)的小程序调用本地安装的 [AI 编程工具](/providers)。Multica 服务器只做协调:存 [issue](/issues)、排 [任务](/tasks)、派发给正确的**运行时**(runtime = 守护进程 × 一款 AI 编程工具)。
+Multica 负责记录和协调工作,连接的电脑负责执行。电脑上的**守护进程**(daemon)领取 task,再调用本机安装的 AI 编程工具。
-这个结构带来 Multica 和 Linear / Jira 最大的差别:**你的 API 密钥、工具链、代码目录都留在本地**,Multica 服务器一个都看不到。"我的智能体不工作"类问题几乎都是本地问题——守护进程没启动、某款 AI 工具没装、密钥过期——请先从本地查起;定位指引见 [故障排查](/troubleshooting)。
+## 概念区分
-## 启动守护进程
-
-守护进程是 Multica CLI 的一部分。装好 [Multica CLI](/cli) 后,在自己机器上跑:
+- **守护进程**是运行在一台电脑上的 Multica 后台程序。它负责连接服务器、发现本机工具、领取 task 和回传结果。
+- **运行时**代表一个工作区可以使用的具体执行环境。它对应一台电脑,以及这台电脑上的一款 AI 编程工具或自定义运行时配置。
-```bash
-multica daemon start
-```
+例如,一台电脑同时安装了 Claude Code 和 Codex,并连接两个工作区。守护进程会分别为两个工作区注册 Claude Code 和 Codex 运行时。重启守护进程会更新原有记录,不会为同一个组合不断创建新运行时。
-启动后它会做四件事:
-
-1. 读取你登录时保存的凭证
-2. 探测本机 `PATH` 上已安装的 AI 编程工具(内置支持 16 款:[Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae)、[DevEco Code](/providers#deveco-code)、[Grok](/providers#grok))
-3. 向服务器注册自己,以及每款检测到的工具对应的运行时
-4. 持续**每 3 秒轮询一次**是否有任务要领,**每 15 秒发一次心跳**
-
-常用命令:
-
-| 命令 | 作用 |
-|---|---|
-| `multica daemon start` | 启动(默认后台,加 `--foreground` 前台运行)|
-| `multica daemon stop` | 停止 |
-| `multica daemon restart` | 重启 |
-| `multica daemon status` | 查看状态 |
-| `multica daemon logs` | 查看日志(加 `-f` 跟随)|
+## 执行位置与数据边界
-完整 CLI 参考见 [CLI 命令速查](/cli)。
+本地运行时调用的 AI 编程工具、这些工具自己的登录凭据,以及本地代码目录都留在连接的电脑上。Multica 服务器不会代替本地工具执行命令,也不会自动上传整个工作目录。
-**桌面应用自带守护进程。**用 [桌面应用](/desktop-app) 就不必手动 `multica daemon start`——它启动时会自动拉起守护进程。哪种方式更适合你的工作流,详见 [桌面应用](/desktop-app) 页面。
+为了让团队能够协作,服务器会保存 issue、评论、智能体配置、task 上下文、执行记录和智能体写回的结果。这些内容可能包含智能体主动读取并写入回复的代码片段或其他项目上下文。
-## 为什么一台机器会有多个运行时
-
-运行时不是一个服务器,也不是一个容器——它是「**守护进程 × 一款 AI 编程工具**」的组合。举例:你在一台 MacBook 上启动守护进程,本机装了 Claude Code 和 Codex;你是两个工作区的成员。那么 Multica 会注册 4 个运行时:
+<Callout type="warning">
+智能体的自定义环境变量保存在服务器侧,并在执行时发送给运行时。不要把"本地执行"理解为所有 secret 都只存在本机;自定义环境变量和 MCP 配置保存在服务器侧,展示受敏感信息规则限制。
+</Callout>
-<Mermaid chart={`
-graph TD
- D["你的守护进程<br/>MacBook"]
- D --> R1["运行时<br/>工作区 A × Claude Code"]
- D --> R2["运行时<br/>工作区 A × Codex"]
- D --> R3["运行时<br/>工作区 B × Claude Code"]
- D --> R4["运行时<br/>工作区 B × Codex"]
-`} />
+## 启动守护进程
-关键的点:
+使用 Multica Desktop 时,应用会自动启动守护进程,不需要额外运行命令。
-- **一个守护进程可以对应多个运行时**——装了多款工具、加入了多个工作区,每个组合就各一个
-- **同一个守护进程在同一个工作区同一款工具上只会有一条运行时**——重启守护进程不会产生重复记录
-- Multica 界面的 **Runtimes** 页面列的就是这些行
+使用 Web、远程电脑或无界面环境时,先[安装 Multica CLI](/cli),再运行:
-## 自定义运行时配置
+```bash
+multica daemon start
+```
-内置 provider 探测覆盖常见工具;如果团队的 AI CLI 兼容 Multica 已支持的协议族、但需要不同的启动命令,可以定义**自定义运行时配置(custom runtime profile)**。常见场景包括:给 Codex 套一层团队内部 wrapper、固定使用某个版本的可执行文件,或者为团队 CLI 预设模型参数。
+守护进程默认在后台运行。常用命令如下:
-如果只是按默认命令使用 Claude Code、Codex、Kimi 或其他内置 provider,不需要创建自定义配置;守护进程会自动探测它们。
+| 命令 | 作用 |
+| --- | --- |
+| `multica daemon status` | 查看守护进程和连接状态 |
+| `multica daemon logs -f` | 持续查看日志 |
+| `multica daemon restart` | 重启守护进程并重新检测本机工具 |
+| `multica daemon stop` | 停止守护进程 |
+| `multica daemon start --foreground` | 在当前终端中运行,便于调试 |
-### 创建前确认
+启动时,守护进程会检测 `PATH` 中受支持的 AI 编程工具,并为你有权连接的工作区注册运行时。如果一款工具刚刚安装或登录,重启守护进程即可重新检测。
-- 至少在一台运行 Multica 守护进程的机器上安装好自定义命令,并确认同一条命令能在这台机器的终端中运行。
-- 确认这个工具实现了界面中某一种基础协议。选择协议族只是告诉 Multica 如何与进程通信,并不能让不兼容的 CLI 自动变得兼容。
-- 只有工作区所有者或管理员可以创建、编辑和删除自定义运行时配置。
+守护进程至少需要检测到一款内置支持的 AI 编程工具才能启动。安装方法和可执行文件名见[安装 AI 编程工具](/install-agent-runtime)。
-### 从 Runtimes 界面创建
+## 派发与在线状态
-1. 打开 **运行时(Runtimes)**,进入已经安装该命令的机器。
-2. 点击**添加自定义运行时**。
-3. 选择这个命令实际实现的基础协议类型。
-4. 填写显示名称,以及你会在终端中执行的命令;命令可以带固定参数。建议补充用途描述,方便其他成员识别。
-5. 点击**创建运行时**。
+运行时注册后会持续保持连接。新 task 入队时,服务器会通知对应守护进程;守护进程也会定期轮询,作为连接中断后的补充。因此运行时在线且有空闲容量时,task 通常会立即开始。
-配置定义属于整个工作区,会同步到所有已连接的守护进程;每台机器只有在本机能找到对应命令时,才会注册自己的运行时。从哪台机器发起创建,该机器就会先显示一条临时的**注册中**记录。如果它迟迟没有变成在线,请确认命令已安装,并且该机器的守护进程能找到它。
+守护进程每 15 秒发送一次心跳。服务端综合心跳与连接状态判断运行时是否在线;守护进程意外退出后,最迟通常会在约 3 分钟内显示为离线。
-创建配置不会自动安装 CLI、完成登录,也不会把命令复制到其他机器。每一台需要提供该运行时的机器,都必须单独安装并登录底层工具。
+![一台在线电脑的运行时详情:同一守护进程注册了 7 个运行时,每款检测到的 AI 编程工具各占一行,均显示在线状态与 CLI 版本](/images/docs/runtime-machine-detail.png)
-### 使用 CLI 管理
+运行时离线时:
-同一组工作区配置也可以通过 CLI 管理:
+- 已经排队的 task 会等待运行时恢复,最多保留 2 小时。
+- 正在执行的 task 会失败;符合条件的 issue 或对话 task 可以自动重试。
+- 守护进程重新启动后,会重新注册运行时,并回收上一次没有正常结束的 task。
+- 离线超过 7 天且没有任何智能体(包括已归档的)绑定的运行时,会被自动清理。
-```bash
-multica runtime profile list
-multica runtime profile create --display-name "Composer" --protocol-family codex --command-name agent
-multica runtime profile update <profile-id> --command-name agent
-multica runtime profile delete <profile-id>
-```
+详细状态和重试规则见[执行任务](/tasks)。
-内置和自定义运行时都显示在同一份机器列表里。打开自定义运行时所在行的操作菜单,即可编辑或删除配置。删除配置后,各机器上由它注册的运行时实例会在守护进程同步后移除;如果仍有智能体依赖它,删除操作可能会被阻止。
+## 并发限制
-这里填写的是 argv 风格命令,不是 shell 字符串。Multica 存的是可执行文件名和固定参数,守护进程会直接用 `exec.Command(command_name, fixed_args...)` 启动。支持普通参数、引号和反斜杠转义;不支持管道、重定向、`&&`、`;`、反引号、`$VAR` / `$(...)` 展开。需要 shell 行为时,用 wrapper script 包一层。
-目前命令和参数的解析入口在 Runtimes UI;CLI 的 profile 命令负责管理 profile 记录和本机路径覆盖。
+一台守护进程默认最多同时执行 20 条 task;每个智能体默认最多同时执行 6 条。实际并发取两者中的较小值。
-如果桌面应用拉起的守护进程找不到你在终端里能运行的命令,可以在这台机器上固定绝对路径:
+达到上限后,新 task 会继续排队。你可以在智能体设置中调整单个智能体的并发数,也可以通过 `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` 调整整台电脑的上限。并行执行会同时占用机器性能、工具账号额度和同一工作目录。
-```bash
-multica runtime profile set-path <profile-id> --path /abs/path/to/agent
-multica runtime profile unset-path <profile-id>
-```
+## 私有与公开
-修改 profile 的命令或参数后,已开始的任务仍使用启动时的参数;守护进程重新注册后,新领取的任务才会使用新配置。混合版本部署时,建议先升级 server,再逐步升级 daemon:`fixed_args` 的录入在 server 侧 Runtimes UI,`failed_profiles` 注册报告也由 server 展示。旧组件可能会忽略自己不认识的字段,而不是明确报错;先升 server 能让 rollout 更可观察。
+本地运行时默认是**私有**的:运行时所有者和工作区的 owner、admin 可以在它上面创建智能体。
-<Callout type="info">
-**云端运行时即将开放**,目前处于等待名单阶段。上线后,你无需在本地运行守护进程,即可在 Multica Cloud 上直接执行智能体任务。在 [下载页面](https://multica.ai/download) 登记邮箱以获取通知。
-</Callout>
+运行时所有者或管理员可以把它改为**公开**。公开后,工作区中的其他成员也可以选择这条运行时;这不会分享底层 AI 编程工具的登录凭据,只是允许成员把智能体的执行任务路由到这台电脑。
-## 运行时什么时候被判定为离线
+## 自定义运行时配置
-Multica 用心跳判断运行时是否在线。三个关键数字:
+如果团队使用内部 wrapper、固定版本的可执行文件,或需要为一款兼容工具追加固定参数,可以创建**自定义运行时配置**。
-| 事件 | 阈值 |
-|---|---|
-| 守护进程心跳频率 | 每 **15 秒** |
-| 标记为失联 | 超过 **45 秒** 没心跳(漏了 3 次)|
-| 自动删除 | 失联且无关联智能体超过 **7 天** |
+自定义配置不会增加新的通信协议。创建时仍需选择一种 Multica 已支持的协议族(工具的对接协议类型,见 [AI 编程工具对照](/providers));命令本身必须与该协议兼容。
-失联不是永久的——守护进程只要再次发出心跳就立刻回到在线,运行时记录也会保留。重启守护进程不会丢运行时。
+### 创建配置
-<Callout type="warning">
-**失联的运行时上正在跑的执行任务会被标记为失败**(失败原因 `runtime_offline`)。对可重试的来源(issue、chat),Multica 会自动重新排队;Autopilots 触发的任务不自动重试。详见 [执行任务 → 哪些失败会自动重试](/tasks#哪些失败会自动重试哪些不会)。
-</Callout>
+只有工作区 owner 和 admin 可以创建、修改或删除自定义运行时配置:
-## 一次能并发跑多少任务
+1. 打开 **运行时**,进入已经安装该命令的电脑。
+2. 点击**添加自定义运行时**。
+3. 选择命令实际兼容的协议族。
+4. 填写名称、命令和固定参数,然后保存。
-Multica 对并发有两层限额:
+配置会在工作区内共享。每台已连接电脑会自行查找这个命令;只有能在 `PATH` 中解析到它的电脑才会注册对应运行时。创建配置不会自动安装命令,也不会替其他成员完成工具登录。
-- **守护进程层**:默认 **20 个执行任务并发**(环境变量 `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` 可调)
-- **智能体层**:每个智能体默认 **6 个执行任务并发**(智能体配置里改)
+这里填写的是可执行文件和参数,不是 shell 脚本。可以使用普通参数、引号和反斜杠转义,但不能使用管道、重定向、`&&`、`;`、反引号或环境变量展开。需要这些行为时,把它们放进 wrapper script,再把该脚本作为命令填写。
-两层中更紧的那层生效。如果你的守护进程已经在跑 20 个任务,即使某个智能体还有余量,新的任务也要等。
+如果 Desktop 启动的守护进程找不到终端里能够执行的命令,可以为当前电脑设置绝对路径:
-如果你看到执行任务卡在 `queued` 状态不 `dispatched`,通常就是这两层里某一层打满了。
+```bash
+multica runtime profile set-path <profile-id> --path /absolute/path/to/command
+```
-## 守护进程崩溃后,没跑完的任务会怎样
+移除路径覆盖:
-守护进程崩溃或被强行结束时,它领走的执行任务会停在 `dispatched` 或 `running` 状态。下次启动时,守护进程会告诉服务器:「这些任务不是我的了,请标记失败。」服务器把它们改成 `failed`,失败原因 `runtime_recovery`——对可重试的来源,任务自动重新排队。
+```bash
+multica runtime profile unset-path <profile-id>
+```
-即使这一步因网络问题没完成,还有**每 30 秒**一次的服务器端扫描作为后备:超过 45 秒没心跳的运行时会被统一标记为失联,上面的任务也一并回收。
+修改配置只影响之后领取的 task。删除配置前,需要先处理仍绑定在对应运行时上的活动智能体。只删除某台电脑上的运行时实例并不会删除配置,运行中的守护进程还会重新注册它。
-## Agent 不工作怎么排查
+## 运行时离线的排查
-遇到「我的智能体不工作」类问题,先过一遍这三步:
+按以下顺序检查:
-1. 跑 `multica daemon status`,确认守护进程在运行且在线
-2. 跑 `multica daemon logs -f`,看是否有错误
-3. 去 Multica 界面的 **Runtimes** 页面,确认你的运行时显示「在线」
+1. 运行 `multica daemon status`,确认守护进程已经启动。
+2. 运行 `multica daemon logs -f`,查看登录、网络或工具检测错误。
+3. 在同一运行环境中执行 `command -v <工具命令>`,确认守护进程能够找到它。
+4. 打开 Multica 的**运行时**页面,检查目标电脑和对应的 AI 编程工具是否显示在线。
+5. 工具刚安装、路径刚修改或配置刚更新时,运行 `multica daemon restart`。
-更多场景见 [Troubleshooting](/troubleshooting)。
+仍未解决时,参见[故障排查](/troubleshooting)。
-## 下一步
+## 接下来
-- [执行任务](/tasks) —— 守护进程领到任务后,它的完整生命周期
-- [Providers Matrix](/providers) —— 16 款 AI 编程工具的能力差异对照
+- [安装 AI 编程工具](/install-agent-runtime) — 安装并验证一款受支持的 AI 编程工具。
+- [AI 编程工具对照](/providers) — 比较模型、会话恢复、MCP 和 skill 支持。
+- [执行任务](/tasks) — 了解排队、停止和重试。
diff --git a/apps/docs/content/docs/desktop-app.ja.mdx b/apps/docs/content/docs/desktop-app.ja.mdx
index f9ffd3e56b..e356694e92 100644
--- a/apps/docs/content/docs/desktop-app.ja.mdx
+++ b/apps/docs/content/docs/desktop-app.ja.mdx
@@ -1,95 +1,108 @@
---
title: デスクトップアプリ
-description: Multica Desktop とは何か、Web アプリとどう違うのか、そしてどんなときに使う価値があるのかを解説します。
+description: Multica Desktop をインストールし、デスクトップタブと内蔵デーモンを使い、セルフホストインスタンスに接続します。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica Desktop は macOS、Windows、Linux 向けのネイティブデスクトップアプリです。設定された環境に対して、Web アプリと同じバックエンドに接続し、同じデータを表示します。Desktop はデフォルトで Multica Cloud を使用しますが、セルフホスト環境はローカルのランタイム設定ファイルで構成できます。Desktop はブラウザにはできないいくつかの機能も追加で提供します。**[ワークスペース](/workspaces)ごとの独立したタブグループ**、**[デーモン](/daemon-runtimes)の自動起動**、**ワンクリックアップグレード**です。
+Multica Desktop は macOS、Windows、Linux で利用できます。Web 版と同じアカウントとワークスペースデータを使いますが、ローカルマシンのデーモンを自動で管理し、ワークスペースごとに独立したタブのセットを保持します。
-## Desktop か Web か — どちらを選ぶか
+## Desktop と Web
| | Web | Desktop |
-|---|---|---|
-| アクセス方法 | ブラウザで URL を開く | ネイティブアプリをインストール |
-| 複数タブ | ブラウザ自体のタブ(ワークスペースの区別なし) | **ワークスペースごとに独立したタブグループ 1 つ** |
-| デーモン | `multica daemon start` を自分で実行 | 起動時に**自動的に開始** |
-| アップグレード | 更新すると最新版になる | アプリがバックグラウンドで確認し、次回起動時にインストール |
-| ログイン後のデータ | 同一 | 同一 |
+| --- | --- | --- |
+| 開き方 | ブラウザ | デスクトップアプリをインストール |
+| ワークスペースのタブ | ブラウザのタブを使用 | ワークスペースごとに独立したタブのセットを保持 |
+| デーモン | CLI を別途インストールして起動 | サインイン後にアプリが自動で起動 |
+| 更新 | ページを再読み込み | デスクトップアプリ経由で更新 |
-**Web を選ぶ**: 一度きりの利用、他人のマシンでの作業、何もインストールしたくないとき。
-**Desktop を選ぶ**: 毎日の利用、複数のワークスペースを同時に扱うとき、デーモンを手動で管理したくないとき。
+ちょっと確認するだけのときや共用のパソコンでは、Web のほうが手軽です。
-## 複数タブ: ワークスペースを切り替えるとどうなるか
+両方に同時にサインインできます。同じ Multica サービスに接続している限り、表示されるデータは共有されます。
-Desktop は**参加しているすべてのワークスペース**ごとに独立したタブグループを保持します。ワークスペースを切り替えると、現在のワークスペースのタブが 1 つの単位として非表示になり、以前のワークスペースのタブは離れたときのまま復元されます — VSCode のマルチワークスペースの挙動や、Slack でワークスペースを切り替えるのに似ています。
+## インストール
-例: ワークスペース A でイシューのタブを 3 つ開いた状態でワークスペース B に切り替えます。A のタブ 3 つは消え、B には B で最後に開いていたものが表示されます。再び A に切り替えると、その 3 つのタブが以前の状態そのままに戻ってきます。**タブはワークスペース間で決して漏れ出しません。**
+[Multica ダウンロードページ](https://multica.ai/download)から、OS と CPU アーキテクチャに合ったインストーラーを選びます:
-ログアウトすると**すべてのワークスペースのタブ状態が消去される**ため、複数のユーザーでマシンを共有していてもデータが漏れることはありません。
+| プラットフォーム | インストーラー |
+| --- | --- |
+| macOS | `.dmg` |
+| Windows | `.exe` |
+| Linux | `.AppImage`、`.deb` または `.rpm` |
-## Desktop の自動更新の仕組み
+インストール後、Web 版と同じメールアドレスでサインインします。サインインすると、Desktop は内蔵の Multica CLI を起動し、マシンにすでにインストールされている AI コーディングツールを検出します。
-起動時に Desktop は GitHub Releases でより新しいバージョンがないかを確認します。新しいバージョンが見つかると、
+<Callout type="info">
+Desktop に内蔵された CLI は、アプリが管理するランタイム専用です。ターミナルで `multica issue` などのコマンドも実行したい場合は、[クイックスタートのステップ 2](/cloud-quickstart#2-コンピュータを接続する)に従って CLI を別途インストールしてください。
+</Callout>
-1. バックグラウンドで新しいバージョンを静かにダウンロードします。
-2. 「準備完了 — 次回起動時にインストールされます」と通知します。
-3. 終了時(または次回の再起動時)に、アプリが閉じる前に更新をインストールします。
-4. 次回起動時に新しいバージョンが実行されます。
+## デスクトップタブ
-このプロセス全体は**作業中の内容を妨げません**。
+Desktop はワークスペースごとにタブを保存します。たとえば、ワークスペース A でイシューを 3 つ開いてからワークスペース B に切り替えると、B 自身のタブが表示されます。A に戻ると、先ほどの 3 つのタブがそのまま残っています。
-<Callout type="warning">
-**Windows では ARM64 と x64 は別々の更新チャンネルです** — 間違ったアーキテクチャをインストールすると更新が検出されません。ダウンロードする際は、マシンに合った `.exe` を選んでください(ARM ビルドには `arm64` のサフィックスが付いています)。
-</Callout>
+同じリソースは現在のワークスペースで一度しか開きません。タブは並べ替え、ピン留め、クローズができ、それぞれが進む・戻るの履歴とスクロール位置を保持します。このデプロイのアプリリンクをクリックまたは貼り付けると、ブラウザに移動せずタブ内で直接開きます。
-macOS ビルドは署名・公証されているため、初回起動時に「未確認の開発者」の警告は表示されません。Linux ビルドは `.AppImage` です — 自動更新は electron-updater に依存しており、一部のディストリビューションでは不安定になることがあります。**自動更新が動作しない場合は、新しいバージョンを手動でダウンロードして古いファイルを置き換えてください。**
+サインアウトすると、このマシンに保存されたすべてのタブが消去されるため、次にサインインした人が前のアカウントの残したページを見ることはありません。
-## 単体の CLI とデーモンはまだ必要ですか?
+## 内蔵デーモン
-**いいえ。** Desktop には同じ `multica` CLI バイナリが内蔵されており、起動時に独自のデーモンプロファイルを起動します(ターミナルから手動で実行しているデーモンとは隔離されます)。
+サインイン後、Desktop は現在の Multica サービス専用の CLI プロファイルを作成し、それを使ってデーモンを起動します。プロファイルの場所:
-すでに CLI をインストールして `multica daemon start` を手動で実行していても、Desktop はそのデーモンを乗っ取りません — 別のプロファイルで独自のデーモンを開始します。両者は**異なるランタイム**として登録され、UI では 2 つの独立したランタイムが表示されます。
+```text
+~/.multica/profiles/desktop-<host>/
+```
-ターミナルで CLI コマンドを実行したい場合、Desktop は特別な経路を提供しません — 別途インストールした CLI を使うか、アプリのリソースディレクトリ内 `resources/bin/multica` にあるバンドル済みのコピーを実行してください。
+このプロファイルが、ターミナルで使っているデフォルトのプロファイルを読み取ったり上書きしたりすることはありません。別のデーモンを手動で起動した場合、Multica はそれらを別々のランタイムとして表示します。
-## ダウンロードとインストール
+ランタイムの状態とログは Desktop の設定で確認できます。ツールが検出されないときは、まず通常のターミナルで動作しサインイン済みであることを確認してから、Desktop のデーモンを再起動してください。
-[Multica ダウンロードページ](https://multica.ai/download)から、使用するプラットフォームのインストーラーを入手してください。
+## Desktop の更新
-| プラットフォーム | ファイル |
-|---|---|
-| macOS (Intel または Apple Silicon) | `.dmg` |
-| Windows x64 | `.exe`(標準) |
-| Windows ARM64 | `.exe`(`arm64` サフィックス付き) |
-| Linux | `.AppImage` |
+自動更新はデフォルトで有効です。アプリはバックグラウンドで新しいバージョンを確認してダウンロードします。ダウンロードが完了したら、すぐに再起動してインストールすることも、次回終了時にインストールさせることもできます。**設定 → アップデート** で自動確認をオフにしたり、手動で新しいバージョンを確認したりもできます。
-初回起動時にはログインが必要です — Web アプリと同じメール + 認証コードのフローです。ログインすると、Desktop はワークスペース一覧を自動的に同期します。
+更新は OS と CPU アーキテクチャごとに配布されます:
-<Callout type="info">
-**Desktop はデフォルトで Multica Cloud を使用しますが、ローカルの設定ファイルでセルフホスト環境を指すように設定できます。** アプリ内には依然として「セルフホストに接続」を選ぶピッカーはありません。Desktop はレンダラーが起動する前に `~/.multica/desktop.json` を読み込みます。ファイルがない場合は Cloud のデフォルト値を使用します。
+- Windows arm64 と macOS x64(Intel)は、それぞれ専用の更新フィードを使います。
+- その他のアーキテクチャはデフォルトの更新フィードを使います。
+- アプリが更新フィードを自動で選択するため、手動で選ぶ必要はありません。
+- Linux で自動更新が有効なのは `.AppImage` だけです。`.deb` と `.rpm` は新しいパッケージをダウンロードして上書きインストールします。
+- 自動更新が失敗した場合も、同様にダウンロードページから対応するインストーラーを取得して上書きインストールしてください。
-最小構成のセルフホスト設定:
+## セルフホストインスタンスへの接続
+
+Desktop はデフォルトで Multica Cloud に接続します。セルフホストインスタンスに接続するには、ホームディレクトリに `~/.multica/desktop.json` を作成します:
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain"
+ "apiUrl": "https://api.example.com"
}
```
-`apiUrl` は必須で、`http` または `https` を使用する必要があります。Desktop は同一オリジン上で `wsUrl` を `/ws` として導出し(`https` なら `wss`、`http` なら `ws`)、API オリジンから `appUrl` を導出します。デプロイ環境が異なるオリジンを使用する場合は明示的に設定してください。
+`apiUrl` はバックエンドの公開アドレスです。必須で、`http` または `https` を使う必要があります。残りの 2 つのアドレスは省略でき、Desktop が自動で導出します:
+
+- `wsUrl`: `apiUrl` のスキームを `ws` または `wss` に置き換え、パスの末尾に `/ws` を追加します。
+- `appUrl`: ホスト名が `api.` で始まりラベルが 3 つ以上ある場合は `api.` プレフィックスを取り除きます(`api.example.com` → `example.com`)。それ以外は `apiUrl` と同じままです。
+
+通常は `apiUrl` だけで十分です。導出結果がデプロイと合わない場合にのみ明示的に上書きします。よくあるのは次の 3 つのケースです:
+
+- Web アプリと API が異なるドメインにある。
+- WebSocket を別途デプロイしている。
+- ホスト名がプレフィックス除去の規則に合わない(`api.local` のような 2 ラベルのホストはプレフィックスが残ります)。
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain",
- "wsUrl": "wss://api.your-domain/ws",
- "appUrl": "https://your-domain"
+ "apiUrl": "https://api.example.com",
+ "appUrl": "https://app.example.com",
+ "wsUrl": "wss://ws.example.com/socket"
}
```
-`desktop.json` は存在するが無効な場合、Desktop は安全側に倒して動作を停止し、Cloud に静かにフォールバックする代わりにブロック型の設定エラーを表示します。開発ビルドの場合、`electron-vite dev` 中は依然として `VITE_API_URL` / `VITE_WS_URL` / `VITE_APP_URL` が優先されます。ランタイムでの Desktop セルフホスト構成は [issue #1371](https://github.com/multica-ai/multica/issues/1371) で実装されました。
+保存後に Desktop を再起動します。ファイルが存在するのに JSON、バージョン、URL のいずれかが無効な場合、アプリは設定エラーを表示し、自動では Cloud にフォールバックしません。そのファイルを削除して再起動すれば、デフォルトの Cloud 設定に戻ります。
+
+<Callout type="warning">
+Desktop が接続できるのは、ブラウザと実行マシンの両方から到達できるアドレスだけです。リモートのセルフホストインスタンスが HTTPS を使っていない、または WebSocket をプロキシしていない場合、Desktop は接続を確立できません。完全な設定は[セルフホストクイックスタート](/self-host-quickstart#3-アクセス方法を選ぶ)を参照してください。
</Callout>
## Windows Defender が Multica をウイルスとして検出する
@@ -126,6 +139,6 @@ Get-FileHash .\multica-cli-<version>-windows-amd64.zip -Algorithm SHA256
## 次のステップ
-- [Cloud Quickstart](/cloud-quickstart) — Desktop 向けの Cloud オンボーディングフロー
-- [Self-Host Quickstart](/self-host-quickstart) — 自前のバックエンドを実行し、CLI または Desktop のランタイム設定で接続する
-- [デーモンとランタイム](/daemon-runtimes) — デーモンの仕組み(Desktop が代わりに起動してくれますが、動作は同じです)
+- [クイックスタート](/cloud-quickstart) — 初回接続の流れ。
+- [デーモンとランタイム](/daemon-runtimes) — 内蔵デーモンの仕組み。
+- [トラブルシューティング](/troubleshooting) — 接続問題の診断。
diff --git a/apps/docs/content/docs/desktop-app.ko.mdx b/apps/docs/content/docs/desktop-app.ko.mdx
index c57b1a9b98..28bc957f21 100644
--- a/apps/docs/content/docs/desktop-app.ko.mdx
+++ b/apps/docs/content/docs/desktop-app.ko.mdx
@@ -1,95 +1,108 @@
---
title: 데스크톱 앱
-description: Multica Desktop이 무엇인지, 웹 앱과 어떻게 다른지, 언제 쓸 만한지 알아봅니다.
+description: Multica Desktop을 설치하고 데스크톱 탭과 내장 데몬을 사용하며 자체 호스팅 인스턴스에 연결합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica Desktop은 macOS, Windows, Linux용 네이티브 데스크톱 앱입니다. 구성된 환경에 대해 웹 앱과 동일한 백엔드에 연결되며 동일한 데이터를 보여줍니다. 기본적으로 Desktop은 Multica Cloud를 사용하며, 자체 호스팅 인스턴스는 로컬 런타임 설정 파일로 구성할 수 있습니다. Desktop은 브라우저가 할 수 없는 몇 가지 기능도 추가로 제공합니다: **[워크스페이스](/workspaces)별 독립적인 탭 그룹**, **[데몬](/daemon-runtimes) 자동 시작**, **원클릭 업그레이드**입니다.
+Multica Desktop은 macOS, Windows, Linux에서 사용할 수 있습니다. Web 버전과 같은 계정 및 워크스페이스 데이터를 사용하지만 로컬 데몬을 자동으로 관리하고 워크스페이스별 탭을 따로 유지합니다.
-## Desktop 또는 웹 — 무엇을 선택할까
+## Desktop과 Web
-| | 웹 | Desktop |
-|---|---|---|
-| 접근 방식 | 브라우저에서 URL 열기 | 네이티브 앱 설치 |
-| 다중 탭 | 브라우저 자체 탭 (워크스페이스 구분 없음) | **워크스페이스별 독립 탭 그룹 한 개** |
-| 데몬 | `multica daemon start`를 직접 실행 | 실행 시 **자동으로 시작** |
-| 업그레이드 | 새로고침하면 최신 버전 | 앱이 백그라운드에서 확인하고 다음 실행 시 설치 |
-| 로그인 후 데이터 | 동일 | 동일 |
+| | Web | Desktop |
+| --- | --- | --- |
+| 여는 방법 | 브라우저 | 데스크톱 앱 설치 |
+| 워크스페이스 탭 | 브라우저 탭 사용 | 워크스페이스별 독립 탭 모음 유지 |
+| 데몬 | CLI를 별도로 설치하고 시작 | 로그인 후 앱이 자동으로 시작 |
+| 업데이트 | 페이지 새로 고침 | 데스크톱 앱을 통해 업데이트 |
-**웹을 선택**: 일회성으로 사용하거나, 다른 사람의 기기에서 작업하거나, 아무것도 설치하고 싶지 않을 때.
-**Desktop을 선택**: 매일 사용하거나, 여러 워크스페이스를 동시에 다루거나, 데몬을 수동으로 관리하고 싶지 않을 때.
+잠시 확인하거나 공용 컴퓨터에서 사용할 때는 Web이 더 편리합니다.
-## 다중 탭: 워크스페이스를 전환하면 어떻게 되나
+둘 다 동시에 로그인할 수 있습니다. 같은 Multica 서비스에 연결되어 있으면 표시되는 데이터가 공유됩니다.
-Desktop은 **참여한 모든 워크스페이스**마다 독립적인 탭 그룹을 유지합니다. 워크스페이스를 전환하면 현재 워크스페이스의 탭이 하나의 단위로 숨겨지고, 이전 워크스페이스의 탭은 떠났던 그대로 복원됩니다 — VSCode의 멀티 워크스페이스 동작이나 Slack에서 워크스페이스를 전환하는 것과 비슷합니다.
+## 설치
-예시: 워크스페이스 A에서 이슈 탭 3개를 열어 둔 상태로 워크스페이스 B로 전환합니다. A의 탭 3개는 사라지고, B에는 B에서 마지막으로 열어 두었던 것이 표시됩니다. 다시 A로 전환하면 그 3개의 탭이 정확히 이전 상태 그대로 돌아옵니다. **탭은 워크스페이스 간에 절대 새어 나가지 않습니다.**
+[Multica 다운로드 페이지](https://multica.ai/download)에서 운영체제와 프로세서 아키텍처에 맞는 설치 패키지를 선택합니다.
-로그아웃하면 **모든 워크스페이스의 탭 상태가 지워지므로**, 여러 사용자가 기기를 공유하더라도 데이터가 새어 나가지 않습니다.
+| 플랫폼 | 설치 패키지 |
+| --- | --- |
+| macOS | `.dmg` |
+| Windows | `.exe` |
+| Linux | `.AppImage`, `.deb`, `.rpm` |
-## Desktop의 자동 업데이트 방식
+설치 후 Web 버전과 같은 이메일로 로그인합니다. 로그인하면 Desktop이 내장 Multica CLI를 시작하고 로컬에 설치된 AI 코딩 도구를 감지합니다.
-실행 시 Desktop은 GitHub Releases에서 더 최신 버전이 있는지 확인합니다. 새 버전이 발견되면:
+<Callout type="info">
+Desktop 내장 CLI는 앱이 런타임을 관리할 때만 사용합니다. 터미널에서 `multica issue` 같은 명령도 실행하려면 [빠른 시작 2단계](/cloud-quickstart#2-컴퓨터-연결)에 따라 CLI를 별도로 설치하세요.
+</Callout>
-1. 백그라운드에서 새 버전을 조용히 다운로드합니다.
-2. "준비 완료 — 다음 실행 시 설치됩니다"라고 알려 줍니다.
-3. 종료(또는 다음 재시작) 시, 앱이 닫히기 전에 업데이트를 설치합니다.
-4. 다음 실행 시 새 버전이 실행됩니다.
+## 데스크톱 탭
-이 전체 과정은 **작업 중인 내용을 방해하지 않습니다**.
+Desktop은 워크스페이스마다 탭을 따로 저장합니다. 예를 들어 워크스페이스 A에서 이슈 세 개를 연 뒤 워크스페이스 B로 전환하면 B의 탭이 표시됩니다. A로 돌아오면 이전 세 탭이 그대로 남아 있습니다.
-<Callout type="warning">
-**Windows에서는 ARM64와 x64가 별도의 업데이트 채널입니다** — 잘못된 아키텍처를 설치하면 업데이트가 감지되지 않습니다. 다운로드할 때 기기에 맞는 `.exe`를 선택하세요 (ARM 빌드에는 `arm64` 접미사가 붙어 있습니다).
-</Callout>
+같은 리소스는 현재 워크스페이스에서 한 번만 열립니다. 탭은 순서를 바꾸고, 고정하고, 닫을 수 있으며 각각의 앞으로 가기, 뒤로 가기, 스크롤 위치도 유지됩니다. 현재 배포 환경의 앱 링크를 클릭하거나 붙여 넣으면 브라우저로 이동하지 않고 탭에서 바로 열립니다.
-macOS 빌드는 서명 및 공증되어 있으므로, 첫 실행 시 "확인되지 않은 개발자" 경고가 표시되지 않습니다. Linux 빌드는 `.AppImage`입니다 — 자동 업데이트는 electron-updater에 의존하는데, 일부 배포판에서는 불안정할 수 있습니다. **자동 업데이트가 작동하지 않으면, 새 버전을 수동으로 다운로드하여 기존 파일을 교체하세요.**
+로그아웃하면 로컬에 저장된 모든 탭이 삭제되어 다음 로그인 사용자가 이전 계정의 페이지를 보지 못합니다.
-## 별도의 CLI와 데몬이 여전히 필요한가요?
+## 내장 데몬
-**아닙니다.** Desktop에는 동일한 `multica` CLI 바이너리가 내장되어 있으며, 시작 시 자체 데몬 프로필을 실행합니다 (터미널에서 수동으로 실행 중인 데몬과는 격리됩니다).
+로그인하면 Desktop이 현재 Multica 서비스 전용 CLI profile을 만들고 이 profile로 데몬을 시작합니다. profile은 다음 위치에 있습니다.
-이미 CLI를 설치하고 `multica daemon start`를 직접 실행했더라도, Desktop은 그 데몬을 가로채지 않습니다 — 별도의 프로필로 자체 데몬을 시작합니다. 둘은 **서로 다른 런타임**으로 등록되며, UI에서 두 개의 독립된 런타임을 볼 수 있습니다.
+```text
+~/.multica/profiles/desktop-<host>/
+```
-터미널에서 CLI 명령을 실행하고 싶다면, Desktop이 특별한 경로를 제공하지는 않습니다 — 별도로 설치한 CLI를 사용하거나, 앱의 리소스 디렉터리 안 `resources/bin/multica`에 있는 번들 사본을 실행하세요.
+터미널에서 사용하는 기본 profile을 읽거나 덮어쓰지 않습니다. 다른 데몬을 직접 동시에 시작하면 Multica에는 각각 별도 런타임으로 표시됩니다.
-## 다운로드 및 설치
+Desktop 설정에서 실행 상태와 로그를 확인할 수 있습니다. 도구가 감지되지 않으면 먼저 일반 터미널에서 실행되고 로그인되어 있는지 확인한 뒤 Desktop 데몬을 다시 시작하세요.
-[Multica 다운로드 페이지](https://multica.ai/download)에서 사용하는 플랫폼의 설치 프로그램을 받으세요:
+## Desktop 업데이트
-| 플랫폼 | 파일 |
-|---|---|
-| macOS (Intel 또는 Apple Silicon) | `.dmg` |
-| Windows x64 | `.exe` (표준) |
-| Windows ARM64 | `.exe` (`arm64` 접미사 포함) |
-| Linux | `.AppImage` |
+자동 업데이트는 기본으로 켜져 있습니다. 앱이 백그라운드에서 새 버전을 확인하고 다운로드합니다. 다운로드가 끝나면 즉시 다시 시작해 설치하거나 다음 종료 시 설치할 수 있습니다. **설정 → 업데이트**에서 자동 확인을 끄거나 새 버전을 직접 확인할 수도 있습니다.
-첫 실행 시 로그인이 필요합니다 — 웹 앱과 동일한 이메일 + 인증 코드 흐름입니다. 로그인하면 Desktop이 워크스페이스 목록을 자동으로 동기화합니다.
+업데이트는 운영체제와 프로세서 아키텍처에 따라 배포됩니다.
-<Callout type="info">
-**Desktop은 기본적으로 Multica Cloud를 사용하지만, 로컬 설정 파일로 자체 호스팅 인스턴스를 가리키도록 할 수 있습니다.** 앱 안에는 여전히 "자체 호스팅에 연결" 선택기가 없습니다. Desktop은 렌더러가 시작되기 전에 `~/.multica/desktop.json`을 읽습니다. 파일이 없으면 Cloud 기본값을 사용합니다.
+- Windows arm64와 macOS x64(Intel)는 각각 별도 업데이트 소스를 사용합니다.
+- 나머지 아키텍처는 기본 업데이트 소스를 사용합니다.
+- 앱이 업데이트 소스를 자동으로 맞추므로 직접 선택할 필요가 없습니다.
+- Linux 자동 업데이트는 `.AppImage`에서만 작동합니다. `.deb`와 `.rpm`은 새 설치 패키지를 내려받아 덮어씁니다.
+- 자동 업데이트에 실패해도 다운로드 페이지에서 해당 설치 패키지를 받아 덮어쓸 수 있습니다.
-최소 자체 호스팅 설정:
+## 자체 호스팅 인스턴스 연결
+
+Desktop은 기본적으로 Multica Cloud에 연결됩니다. 자체 호스팅 인스턴스에 연결하려면 사용자 디렉터리에 `~/.multica/desktop.json`을 만듭니다.
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain"
+ "apiUrl": "https://api.example.com"
}
```
-`apiUrl`은 필수이며 `http` 또는 `https`를 사용해야 합니다. Desktop은 동일 오리진에서 `wsUrl`을 `/ws`로 유도하고(`https`이면 `wss`, `http`이면 `ws`), API 오리진에서 `appUrl`을 유도합니다. 배포 환경이 서로 다른 오리진을 사용한다면 명시적으로 설정하세요:
+`apiUrl`은 backend의 공개 주소로 필수이며 `http` 또는 `https`를 사용해야 합니다. 다음 두 주소는 생략할 수 있으며 Desktop이 자동으로 추론합니다.
+
+- `wsUrl`: `apiUrl`의 프로토콜을 `ws` 또는 `wss`로 바꾸고 경로 뒤에 `/ws`를 추가합니다.
+- `appUrl`: 도메인이 `api.`로 시작하고 세 구간 이상이면 `api.` 접두사를 제거합니다(`api.example.com` → `example.com`). 그렇지 않으면 `apiUrl`과 동일하게 유지합니다.
+
+보통 `apiUrl`만 작성하면 됩니다. 추론 결과가 맞지 않을 때 명시적으로 덮어쓰면 됩니다. 일반적인 경우는 세 가지입니다.
+
+- Web과 API가 서로 다른 도메인을 사용
+- WebSocket을 별도로 배포
+- 도메인이 접두사 제거 규칙을 만족하지 않음(`api.local` 같은 두 구간 도메인은 접두사를 제거하지 않음)
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain",
- "wsUrl": "wss://api.your-domain/ws",
- "appUrl": "https://your-domain"
+ "apiUrl": "https://api.example.com",
+ "appUrl": "https://app.example.com",
+ "wsUrl": "wss://ws.example.com/socket"
}
```
-`desktop.json`이 존재하지만 유효하지 않으면, Desktop은 안전하게 동작을 차단하여 Cloud로 조용히 되돌아가는 대신 차단형 설정 오류를 표시합니다. 개발 빌드의 경우, `electron-vite dev` 중에는 여전히 `VITE_API_URL` / `VITE_WS_URL` / `VITE_APP_URL`이 우선합니다. 런타임 Desktop 자체 호스팅 구성은 [issue #1371](https://github.com/multica-ai/multica/issues/1371)에서 구현되었습니다.
+저장한 뒤 Desktop을 다시 시작합니다. 설정 파일이 존재하지만 JSON, 버전, URL이 유효하지 않으면 앱에 설정 오류가 표시되고 Cloud에 자동 연결되지 않습니다. 해당 파일을 삭제하고 다시 시작하면 기본 Cloud 설정으로 돌아갑니다.
+
+<Callout type="warning">
+Desktop은 브라우저와 실행 컴퓨터에서 모두 접근할 수 있는 주소에만 연결할 수 있습니다. 원격 자체 호스팅 인스턴스에 HTTPS가 없거나 WebSocket 프록시가 설정되지 않으면 Desktop이 연결되지 않습니다. 전체 설정은 [자체 호스팅 빠른 시작](/self-host-quickstart#3-접근-방식-선택)을 참고하세요.
</Callout>
## Windows Defender가 Multica를 바이러스로 탐지하는 경우
@@ -126,6 +139,6 @@ Get-FileHash .\multica-cli-<version>-windows-amd64.zip -Algorithm SHA256
## 다음 단계
-- [Cloud Quickstart](/cloud-quickstart) — Desktop을 위한 Cloud 온보딩 흐름
-- [Self-Host Quickstart](/self-host-quickstart) — 자체 백엔드를 실행하고 CLI 또는 Desktop 런타임 설정으로 연결하기
-- [데몬 및 런타임](/daemon-runtimes) — 데몬의 작동 방식 (Desktop이 대신 시작해 주지만 동작은 동일합니다)
+- [빠른 시작](/cloud-quickstart) — 처음 연결하는 과정을 진행합니다.
+- [데몬과 런타임](/daemon-runtimes) — 내장 데몬의 작동 방식을 알아봅니다.
+- [문제 해결](/troubleshooting) — 연결 문제를 해결합니다.
diff --git a/apps/docs/content/docs/desktop-app.mdx b/apps/docs/content/docs/desktop-app.mdx
index 0b76506cb7..700ce12104 100644
--- a/apps/docs/content/docs/desktop-app.mdx
+++ b/apps/docs/content/docs/desktop-app.mdx
@@ -1,95 +1,108 @@
---
title: Desktop app
-description: What Multica Desktop is, how it differs from the web app, and when it's worth using.
+description: Install Multica Desktop, use desktop tabs and the built-in daemon, and connect to a self-hosted instance.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica Desktop is a native desktop app for macOS, Windows, and Linux. For the environment it is configured for, it talks to the same backend as the web app and shows the same data. By default Desktop uses Multica Cloud; self-hosted instances can be configured with a local runtime config file. Desktop also adds a few things the browser can't: **independent tab groups per [workspace](/workspaces)**, **automatic [daemon](/daemon-runtimes) startup**, and **one-click upgrades**.
+Multica Desktop is available for macOS, Windows, and Linux. It uses the same account and workspace data as the web app, but it manages the daemon on your machine automatically and keeps a separate set of tabs for each workspace.
-## Desktop or web — which to pick
+## Desktop and web
| | Web | Desktop |
-|---|---|---|
-| Access | Open a URL in your browser | Install a native app |
-| Multiple tabs | Your browser's own tabs (no workspace separation) | **One independent tab group per workspace** |
-| Daemon | You run `multica daemon start` yourself | **Started automatically** on launch |
-| Upgrades | Refresh to get the latest | App checks in the background and installs on next launch |
-| Signed-in data | Identical | Identical |
+| --- | --- | --- |
+| How you open it | Browser | Install the desktop app |
+| Workspace tabs | Uses browser tabs | Each workspace keeps its own set of tabs |
+| Daemon | Install and start the CLI separately | Started by the app automatically after sign-in |
+| Updates | Refresh the page | Updated through the desktop app |
-**Pick web** for one-off use, working on someone else's machine, or when you'd rather not install anything.
-**Pick desktop** for daily use, juggling multiple workspaces, or avoiding manual daemon management.
+Web is more convenient for a quick look or on a shared computer.
-## Multiple tabs: what happens when you switch workspaces
+You can be signed in to both at the same time. As long as they connect to the same Multica service, the data they show is shared.
-Desktop maintains an independent tab group for **every workspace you've joined**. When you switch workspaces, the current workspace's tabs are hidden as a unit and the previous workspace's tabs are restored as you left them — similar to VSCode's multi-workspace behavior or switching workspaces in Slack.
+## Installation
-Example: you open 3 issue tabs in workspace A and switch to workspace B. A's 3 tabs disappear, and B shows whatever you last had open in B. Switch back to A and those 3 tabs come back exactly as they were. **Tabs never leak across workspaces.**
+Pick the installer that matches your OS and CPU architecture from the [Multica downloads page](https://multica.ai/download):
-Logging out **clears every workspace's tab state**, so you don't leak data when a machine is shared between users.
+| Platform | Installer |
+| --- | --- |
+| macOS | `.dmg` |
+| Windows | `.exe` |
+| Linux | `.AppImage`, `.deb`, or `.rpm` |
-## How Desktop auto-updates
+After installing, sign in with the same email you use on the web. Once signed in, Desktop starts its own bundled Multica CLI and detects the AI coding tools already installed on the machine.
-On launch, Desktop checks GitHub Releases for a newer version. If one is found:
+<Callout type="info">
+The CLI bundled with Desktop only serves the app's managed runtime. If you also want to run commands like `multica issue` in a terminal, install the CLI separately following [step 2 of the quickstart](/cloud-quickstart#2-connect-a-computer).
+</Callout>
-1. It downloads the new version silently in the background.
-2. It tells you "ready — will install on next launch."
-3. When you quit (or next restart), the app installs the update before closing.
-4. The next launch runs the new version.
+## Desktop tabs
-The whole process **doesn't interrupt what you're working on**.
+Desktop saves tabs per workspace. For example, if you open three issues in workspace A and switch to workspace B, you see B's own tabs; switch back to A and the three earlier tabs are still there.
-<Callout type="warning">
-**On Windows, ARM64 and x64 are separate update channels** — install the wrong architecture and updates won't be detected. When you download, pick the `.exe` that matches your machine (the ARM build has an `arm64` suffix).
-</Callout>
+A given resource opens only once in the current workspace. Tabs can be reordered, pinned, and closed, and each keeps its own forward/back history and scroll position. Clicking or pasting an app link for this deployment opens it directly in a tab instead of jumping to the browser.
-The macOS build is signed and notarized, so you won't see an "unidentified developer" warning on first launch. The Linux build is an `.AppImage` — auto-updates rely on electron-updater, which can be flaky on some distros. **If auto-update doesn't work, download the new version manually and replace the old file.**
+Logging out clears every tab saved on the machine, so the next person to sign in never sees pages left behind by the previous account.
-## Do I still need the standalone CLI and daemon?
+## Built-in daemon
-**No.** Desktop ships with the same `multica` CLI binary embedded inside it, and it launches its own daemon profile at startup (isolated from any daemon you may be running manually from the terminal).
+After sign-in, Desktop creates a dedicated CLI profile for the current Multica service and uses it to start the daemon. The profile lives at:
-If you've already installed the CLI and run `multica daemon start` by hand, Desktop won't take over your daemon — it starts its own with a separate profile. Both register as **different runtimes**, and you'll see two independent runtimes in the UI.
+```text
+~/.multica/profiles/desktop-<host>/
+```
-If you want to run CLI commands in your terminal, Desktop doesn't offer a special path — use the CLI you installed separately, or run the bundled copy at `resources/bin/multica` inside the app's resources directory.
+It never reads or overwrites the default profile you use in the terminal. If you also start another daemon manually, Multica shows them as separate runtimes.
-## Downloading and installing
+You can check runtime status and logs in Desktop's settings. If a tool isn't detected, first confirm it runs in a regular terminal and is logged in, then restart Desktop's daemon.
-Grab the installer for your platform from the [Multica downloads page](https://multica.ai/download):
+## Updating Desktop
-| Platform | File |
-|---|---|
-| macOS (Intel or Apple Silicon) | `.dmg` |
-| Windows x64 | `.exe` (standard) |
-| Windows ARM64 | `.exe` (with `arm64` suffix) |
-| Linux | `.AppImage` |
+Auto-update is on by default. The app checks for and downloads new versions in the background; once a download finishes you can restart to install immediately or let it install on the next quit. You can also turn off automatic checks or check for new versions manually under **Settings → Updates**.
-On first launch you'll need to sign in — the same email + verification code flow as the web app. Once you're in, Desktop syncs your workspace list automatically.
+Updates are distributed per OS and CPU architecture:
-<Callout type="info">
-**Desktop defaults to Multica Cloud, but can be pointed at a self-hosted instance with a local config file.** There is still no in-app "connect to self-host" picker. Desktop reads `~/.multica/desktop.json` before the renderer starts; if the file is missing, it uses the Cloud defaults.
+- Windows arm64 and macOS x64 (Intel) each use their own update feed;
+- all other architectures use the default feed;
+- the app matches the update feed automatically — no manual selection needed;
+- on Linux, auto-update only works for `.AppImage`; update `.deb` and `.rpm` by installing a new package over the old one;
+- if auto-update fails, likewise install over the top with the matching installer from the downloads page.
-Minimal self-host config:
+## Connecting to a self-hosted instance
+
+Desktop connects to Multica Cloud by default. To connect to a self-hosted instance, create `~/.multica/desktop.json` in your home directory:
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain"
+ "apiUrl": "https://api.example.com"
}
```
-`apiUrl` is required and must use `http` or `https`. Desktop derives `wsUrl` as `/ws` on the same origin (`wss` for `https`, `ws` for `http`) and derives `appUrl` from the API origin. If your deployment uses different origins, set them explicitly:
+`apiUrl` is the backend's public address; it is required and must use `http` or `https`. The other two URLs can be omitted — Desktop derives them automatically:
+
+- `wsUrl`: swaps the `apiUrl` scheme to `ws` or `wss` and appends `/ws` to the path;
+- `appUrl`: strips the `api.` prefix when the host starts with `api.` and has at least three labels (`api.example.com` → `example.com`); otherwise it stays the same as `apiUrl`.
+
+Usually `apiUrl` alone is enough. Override explicitly only when the derivation doesn't match your deployment; the three common cases:
+
+- the web app and the API are on different domains;
+- WebSocket is deployed separately;
+- the host doesn't fit the prefix-stripping convention (two-label hosts like `api.local` keep their prefix).
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain",
- "wsUrl": "wss://api.your-domain/ws",
- "appUrl": "https://your-domain"
+ "apiUrl": "https://api.example.com",
+ "appUrl": "https://app.example.com",
+ "wsUrl": "wss://ws.example.com/socket"
}
```
-If `desktop.json` exists but is invalid, Desktop fails closed and shows a blocking config error instead of silently falling back to Cloud. For development builds, `VITE_API_URL` / `VITE_WS_URL` / `VITE_APP_URL` still take precedence during `electron-vite dev`. Runtime Desktop self-host configuration was implemented for [issue #1371](https://github.com/multica-ai/multica/issues/1371).
+Restart Desktop after saving. If the file exists but the JSON, version, or URLs are invalid, the app shows a configuration error and does not fall back to Cloud automatically. Delete the file and restart to return to the default Cloud configuration.
+
+<Callout type="warning">
+Desktop can only connect to addresses reachable from both the browser and the executing machine. If a remote self-hosted instance doesn't use HTTPS or doesn't proxy WebSocket, Desktop can't establish a connection; see the [self-host quickstart](/self-host-quickstart#3-choose-how-to-access) for the full configuration.
</Callout>
## Windows Defender flags Multica as a virus
@@ -126,6 +139,6 @@ Only add these exclusions if you installed Multica from the [downloads page](htt
## Next steps
-- [Cloud Quickstart](/cloud-quickstart) — the Cloud onboarding flow for Desktop
-- [Self-Host Quickstart](/self-host-quickstart) — running your own backend and connecting with the CLI or Desktop runtime config
-- [Daemon and runtimes](/daemon-runtimes) — how the daemon works (Desktop starts it for you, but the behavior is the same)
+- [Quickstart](/cloud-quickstart) — the first-connection flow.
+- [Daemon and runtimes](/daemon-runtimes) — how the built-in daemon works.
+- [Troubleshooting](/troubleshooting) — diagnosing connection issues.
diff --git a/apps/docs/content/docs/desktop-app.zh.mdx b/apps/docs/content/docs/desktop-app.zh.mdx
index b1eb0e7a79..c3074a174a 100644
--- a/apps/docs/content/docs/desktop-app.zh.mdx
+++ b/apps/docs/content/docs/desktop-app.zh.mdx
@@ -1,95 +1,108 @@
---
title: 桌面应用
-description: Multica Desktop 是什么、和 Web 有什么区别、什么时候值得用。
+description: 安装 Multica Desktop,使用桌面标签页和内置守护进程,并连接自托管实例。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica Desktop 是原生桌面应用——macOS / Windows / Linux 三个平台。对它当前配置的环境来说,它和 Web 版连同一个后端、看到的数据完全一样。Desktop 默认使用 Multica Cloud;自部署实例可以通过本地运行时配置文件接入。它还给了几个 Web 做不到的能力:**[工作区](/workspaces) 独立的多标签页**、**自动启动 [守护进程](/daemon-runtimes)**、**一键升级**。
+Multica Desktop 提供 macOS、Windows 和 Linux 版本。它和 Web 版使用相同的账号与工作区数据,但会在本机自动管理守护进程,并为不同工作区保留各自的标签页。
-## Desktop 和 Web 该用哪个
+## Desktop 与 Web
| | Web | Desktop |
-|---|---|---|
-| 访问方式 | 浏览器打开 URL | 装一个本地应用 |
-| 多标签页 | 浏览器自己的标签页(不区分工作区)| **每个工作区一组独立标签页** |
-| 守护进程 | 要你自己跑 `multica daemon start` | 启动时**自动拉起** |
-| 升级 | 刷新页面就是最新 | 应用自动检查 + 下次启动安装 |
-| 登录后的数据 | 完全一样 | 完全一样 |
+| --- | --- | --- |
+| 打开方式 | 浏览器 | 安装桌面应用 |
+| 工作区标签页 | 使用浏览器标签页 | 每个工作区保留独立的一组标签页 |
+| 守护进程 | 需要单独安装并启动 CLI | 登录后由应用自动启动 |
+| 更新 | 刷新页面 | 通过桌面应用更新 |
-**选 Web**:临时用、在别人电脑上、不想装应用的场景。
-**选 Desktop**:每天用 Multica、会同时操作多个工作区、不想自己管守护进程的场景。
+临时查看或在公共电脑上使用时,Web 更方便。
-## 多 tab:工作区之间切换怎么表现
+两者可以同时登录。只要连接的是同一个 Multica 服务,看到的数据就是共享的。
-Desktop 为**每个你加入的工作区**独立维护一组标签页。切换工作区时,当前工作区的标签页会被整体隐藏,上次那个工作区的标签页会原样恢复——像 VSCode 的多 workspace 行为或 Slack 的 workspace 切换。
+## 安装
-举例:你在工作区 A 打开了 3 个 issue 标签页,切到工作区 B,A 的那 3 个标签页消失,B 里显示你上次在 B 留下的标签页;切回 A,那 3 个原样回来。**不同工作区的标签页不会互相串到对方**。
+从 [Multica 下载页](https://multica.ai/download) 选择与系统和处理器架构对应的安装包:
-登出会**清空所有工作区的标签页状态**,防止多用户共用同一台机器时的数据泄露。
+| 平台 | 安装包 |
+| --- | --- |
+| macOS | `.dmg` |
+| Windows | `.exe` |
+| Linux | `.AppImage`、`.deb` 或 `.rpm` |
-## Desktop 怎么自动更新
+安装后使用和 Web 版相同的邮箱登录。登录后,Desktop 会启动自己内置的 Multica CLI,并检测本机已有的 AI 编程工具。
-Desktop 启动时会去 GitHub Releases 检查新版本。检查到新版本:
+<Callout type="info">
+Desktop 内置的 CLI 只供应用管理运行时使用。如果你还要在终端中运行 `multica issue` 等命令,按[快速上手第 2 步](/cloud-quickstart#2-连接一台电脑)单独安装 CLI。
+</Callout>
-1. 在后台静默下载新版本
-2. 提示你「准备就绪,下次启动时安装」
-3. 你点击退出(或下次重启)时,应用关闭前把新版本装好
-4. 再次打开时就是新版本
+## 桌面标签页
-整个过程**不中断你正在做的事**。
+Desktop 会为每个工作区单独保存标签页。例如,你在工作区 A 打开了三个 issue,切到工作区 B 后会看到 B 自己的标签页;切回 A 时,之前的三个标签页仍然保留。
-<Callout type="warning">
-**Windows 的 ARM64 和 x64 是独立的更新通道**——装错架构会识别不到更新。安装时下载对应你机器架构的那个 `.exe`(带 `arm64` 后缀的是 ARM 版)。
-</Callout>
+同一资源只会在当前工作区打开一次。标签页可以重新排序、固定、关闭,也会保留各自的前进、后退和滚动位置。点击或粘贴本部署的应用链接会直接在标签页中打开,不会跳转到浏览器。
-macOS 版本已经签名 + 公证,第一次打开不会有"未知开发者"的警告。Linux 版是 `.AppImage`——自动更新机制依赖 electron-updater,在某些发行版可能不稳定,**不工作时手动下载新版本覆盖**。
+退出登录会清除本机保存的所有标签页,避免下一位登录者看到上一个账号留下的页面。
-## 还要单独装 CLI 和守护进程吗
+## 内置守护进程
-**不用**。Desktop 包里**内置了同一个 `multica` CLI 二进制**——Desktop 启动时会自动启动守护进程的独立 profile(和你命令行手动跑的守护进程互不干扰)。
+登录后,Desktop 会为当前 Multica 服务创建一个专用 CLI profile,并用它启动守护进程。这个 profile 位于:
-如果你已经装过 CLI 并手动跑过 `multica daemon start`,Desktop 不会抢占你那个守护进程——它起自己的,用不同的 profile 隔离。两边注册的是**不同的运行时**,在 UI 里能看到两个独立运行时。
+```text
+~/.multica/profiles/desktop-<host>/
+```
-想在终端里跑 CLI 命令,Desktop 不提供特殊方式——照常用系统的 CLI(如果你单独装了),或者用 Desktop 自带的版本(在应用的资源目录里,`resources/bin/multica`)。
+它不会读取或覆盖你在终端中使用的默认 profile。如果你同时手动启动了另一个守护进程,Multica 会把它们显示为不同的运行时。
-## 怎么下载安装
+可以在 Desktop 的设置中查看运行状态和日志。工具没有被检测到时,先确认它能在普通终端中运行并且已经登录,再重启 Desktop 的守护进程。
-去 [多卡下载页](https://multica.ai/download) 拿对应平台的安装包:
+## 更新 Desktop
-| 平台 | 文件 |
-|---|---|
-| macOS(Intel 或 Apple Silicon)| `.dmg` |
-| Windows x64 | `.exe`(常规)|
-| Windows ARM64 | `.exe`(带 `arm64` 后缀)|
-| Linux | `.AppImage` |
+自动更新默认开启。应用会在后台检查并下载新版本,下载完成后可以立即重启安装,也可以等下次退出时安装。你也可以在 **设置 → 更新**中关闭自动检查或手动检查新版本。
-安装后第一次打开需要登录——和 Web 版一样的 email + 验证码流程。登录成功后 Desktop 自动把工作区列表同步下来。
+更新按操作系统和处理器架构分发:
-<Callout type="info">
-**Desktop 默认连接 Multica Cloud,但可以通过本地配置文件指向自部署实例。** 应用内仍然没有“连接自部署”的切换入口。Desktop 会在 renderer 启动前读取 `~/.multica/desktop.json`;如果这个文件不存在,就使用 Cloud 默认值。
+- Windows arm64 和 macOS x64(Intel)使用各自独立的更新源;
+- 其余架构使用默认更新源;
+- 应用会自动匹配更新源,无需手动选择;
+- Linux 上自动更新只对 `.AppImage` 生效,`.deb` 和 `.rpm` 通过下载新安装包覆盖安装;
+- 自动更新失败时,同样从下载页获取对应安装包覆盖安装。
-最小自部署配置:
+## 连接自托管实例
+
+Desktop 默认连接 Multica Cloud。连接自托管实例时,在用户目录创建 `~/.multica/desktop.json`:
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain"
+ "apiUrl": "https://api.example.com"
}
```
-`apiUrl` 是必填项,必须使用 `http` 或 `https`。Desktop 会自动从它推导 `wsUrl`(同源 `/ws`,`https` 对应 `wss`,`http` 对应 `ws`)和 `appUrl`(API 的同源地址)。如果你的部署使用不同域名,可以显式设置:
+`apiUrl` 是 backend 的公开地址,必须填写,且必须使用 `http` 或 `https`。另外两个地址可以省略,Desktop 会自动推导:
+
+- `wsUrl`:把 `apiUrl` 的协议换成 `ws` 或 `wss`,并在路径后追加 `/ws`;
+- `appUrl`:域名以 `api.` 开头且至少三段时去掉 `api.` 前缀(`api.example.com` → `example.com`),否则保持与 `apiUrl` 相同。
+
+通常只写 `apiUrl` 即可。推导不符合预期时再显式覆盖,常见情况有三类:
+
+- Web 与 API 不同域;
+- WebSocket 单独部署;
+- 域名不满足剥前缀的约定(`api.local` 这类两段域名不会去掉前缀)。
```json
{
"schemaVersion": 1,
- "apiUrl": "https://api.your-domain",
- "wsUrl": "wss://api.your-domain/ws",
- "appUrl": "https://your-domain"
+ "apiUrl": "https://api.example.com",
+ "appUrl": "https://app.example.com",
+ "wsUrl": "wss://ws.example.com/socket"
}
```
-如果 `desktop.json` 存在但内容无效,Desktop 会 fail closed,显示阻塞式配置错误,而不是悄悄回退到 Cloud。开发构建里,`electron-vite dev` 仍然优先使用 `VITE_API_URL` / `VITE_WS_URL` / `VITE_APP_URL`。Desktop 运行时自部署配置能力对应 [issue #1371](https://github.com/multica-ai/multica/issues/1371)。
+保存后重启 Desktop。配置文件存在但 JSON、版本或 URL 无效时,应用会显示配置错误,不会自动连接 Cloud。删除该文件并重启即可恢复默认的 Cloud 配置。
+
+<Callout type="warning">
+Desktop 只能连接浏览器和执行电脑都能访问的地址。远程自托管实例未使用 HTTPS 或未代理 WebSocket 时,Desktop 无法建立连接;完整配置见[自托管快速上手](/self-host-quickstart#3-选择访问方式)。
</Callout>
## Windows Defender 把 Multica 报成病毒
@@ -124,8 +137,8 @@ Get-FileHash .\multica-cli-<version>-windows-amd64.zip -Algorithm SHA256
只有在你是从[下载页](https://multica.ai/download)或 [GitHub releases](https://github.com/multica-ai/multica/releases) 安装、且校验和对得上的前提下,才加这些排除项。排除项会关闭该文件夹内所有文件的实时保护。
</Callout>
-## 下一步
+## 接下来
-- [Cloud Quickstart](/cloud-quickstart) —— Desktop 版的 Cloud 接入流程
-- [Self-Host Quickstart](/self-host-quickstart) —— 自部署后端,并通过 CLI 或 Desktop 运行时配置连接
-- [守护进程与运行时](/daemon-runtimes) —— 守护进程机制(Desktop 自动起它,但行为一样)
+- [快速上手](/cloud-quickstart) — 首次连接流程。
+- [守护进程与运行时](/daemon-runtimes) — 内置守护进程的机制。
+- [故障排查](/troubleshooting) — 连接问题排查。
diff --git a/apps/docs/content/docs/developers/architecture.ja.mdx b/apps/docs/content/docs/developers/architecture.ja.mdx
new file mode 100644
index 0000000000..ceaab4095c
--- /dev/null
+++ b/apps/docs/content/docs/developers/architecture.ja.mdx
@@ -0,0 +1,129 @@
+---
+title: プロジェクトアーキテクチャ
+description: Multica のクライアント、Go サービス、実行デーモン、共有フロントエンドパッケージがどのように連携するかを説明します。
+---
+
+Multica は Go バックエンド、複数のクライアント、実行用コンピューター上で動作するデーモンで構成されています。PostgreSQL がコラボレーションデータを保存し、デーモンがタスクを取得してローカルの AI コーディングツールを呼び出します。
+
+```text
+Web / Desktop / Mobile / CLI
+ │
+ HTTP + WebSocket
+ │
+ Go API ───────── PostgreSQL
+ │
+ daemon WebSocket
+ │
+ ローカルデーモン ─── AI コーディングツール
+```
+
+プロダクト利用者向けの説明は [Multica の仕組み](/how-multica-works)を参照してください。このページではコードの階層構造に焦点を当てます。
+
+## リポジトリ構成
+
+| ディレクトリ | 責務 | 主な技術 |
+| --- | --- | --- |
+| `server/` | API、認証、タスクスケジューリング、インテグレーション、CLI、デーモン | Go、Chi、sqlc、gorilla/websocket |
+| `apps/web/` | ブラウザクライアントとランディングページ | Next.js App Router |
+| `apps/desktop/` | デスクトップクライアントとローカルプロセス管理 | Electron、electron-vite |
+| `apps/mobile/` | 独立した iOS クライアント | Expo、React Native |
+| `apps/docs/` | 多言語ドキュメントサイト | Next.js、Fumadocs |
+| `packages/core/` | API クライアント、型、クエリ、mutation、プラットフォーム非依存のビジネスロジック | TanStack Query、Zustand |
+| `packages/ui/` | ビジネスロジックを含まない基礎 UI | shadcn、Base UI |
+| `packages/views/` | Web と Desktop で共有するビジネスページとコンポーネント | React |
+| `packages/tsconfig/`、`packages/eslint-config/` | 共有ツール設定 | TypeScript、ESLint |
+
+共有パッケージは `.ts` と `.tsx` のソースファイルを直接エクスポートし、利用するアプリケーション側でコンパイルします。依存方向は `views → core + ui` であり、`core` と `ui` は互いに依存しません。
+
+## Web と Desktop のコード共有
+
+Web と Desktop は次の 3 層を共有します。
+
+1. `packages/core` が API、キャッシュ、権限、プラットフォーム非依存の状態を扱います。
+2. `packages/ui` が基礎コンポーネントを提供します。
+3. `packages/views` がビジネスページを構成します。
+
+ルーティング、cookie、Electron IPC などのプラットフォーム機能はアプリケーション層に残します。共有ページは `NavigationAdapter` を通じて遷移し、`next/*` や `react-router-dom` を直接インポートしません。
+
+たとえば Web と Desktop の両方で必要なイシュー機能は、通常次の場所にまたがります。
+
+```text
+packages/core/issues/ クエリ、mutation、キャッシュ更新
+packages/views/issues/ ページとビジネスコンポーネント
+apps/web/platform/ Next.js ルーティングアダプター
+apps/desktop/.../platform/ Electron ルーティングアダプター
+```
+
+Mobile はこれらの React ページを再利用しません。`@multica/core` の型や純粋関数をインポートできますが、UI、query key、状態、リアルタイム購読、リリースフローは独自に持ちます。
+
+## フロントエンドの状態
+
+サーバーデータとクライアント状態は分けて管理します。
+
+- **TanStack Query** はイシュー、エージェント、メンバー、受信トレイなどのサーバーデータを保持します。
+- **Zustand** はフィルター、下書き、ダイアログ、レイアウトなどのクライアント状態を保持します。
+- 現在のワークスペースはルートで決まり、リクエスト、永続化 namespace、再接続に必要な範囲だけプラットフォーム層へ反映します。
+- React Context はワークスペース ID やナビゲーションアダプターなど、プラットフォームの plumbing だけを渡します。
+
+WebSocket イベントは TanStack Query のキャッシュを更新または無効化します。サーバーオブジェクトを Zustand にコピーしてはいけません。ワークスペースの作成、削除、退出のように画面遷移を伴う mutation は、サーバーの確認を待ってからローカル状態を消去する必要があります。
+
+API レスポンスは `packages/core/api/` の境界で zod schema により解析します。インストール済みの Desktop がより新しいバックエンドへ接続する場合があるため、ネットワーク JSON を TypeScript 型へ直接キャストしてはいけません。
+
+## バックエンドの階層
+
+主なエントリーポイントは `server/cmd/` にあります。
+
+| エントリーポイント | 役割 |
+| --- | --- |
+| `server` | HTTP API、WebSocket、スケジューラー、インテグレーション worker を起動 |
+| `multica` | CLI とローカルデーモン |
+| `migrate` | データベース migration を実行 |
+| `backfill_*` | 特定バージョン向けのデータ backfill ツール |
+
+リクエストは通常、次の方向に流れます。
+
+```text
+router → middleware → handler → service → sqlc query → PostgreSQL
+```
+
+- `internal/middleware/` は認証、ワークスペース、リクエスト境界を扱います。
+- `internal/handler/` は HTTP 入力を解析し、レスポンスを生成します。
+- `internal/service/` は複数クエリにまたがるビジネスフローとトランザクションを担当します。
+- `pkg/db/queries/` には手書きの SQL を置きます。
+- `pkg/db/generated/` は sqlc により生成されるため、直接編集できません。
+- `internal/integrations/` は GitHub、Slack、飛書などの外部イベントを扱います。
+- `internal/storage/` はローカルまたは S3 の添付ファイルを扱います。
+
+PostgreSQL がビジネスデータの信頼できる情報源です。Redis は任意のコンポーネントで、複数インスタンス間のリアルタイムイベント、キャッシュ、一時的な調整に使います。未設定の場合、単一インスタンスの開発環境ではプロセス内実装を使用します。
+
+## リアルタイム接続
+
+Multica には異なる 2 つの WebSocket パスがあります。
+
+- `internal/realtime/` はイシュー、コメント、受信トレイなどの変更をユーザークライアントへ配信します。
+- `internal/daemonws/` はデーモンを接続し、ランタイムの起動通知と daemon RPC に使います。
+
+WebSocket は遅延を減らしますが、最終的な状態はデータベースにあります。クライアントは再接続後にクエリで再同期する必要があります。デーモンも polling 経路を保持し、1 回の切断で queued タスクが永久に止まらないようにします。
+
+## 1 回の実行におけるコードパス
+
+1. ユーザーがイシューを割り当てる、エージェントをメンションする、または自動化がトリガーされます。
+2. `TaskService` が queued タスクを作成し、対応するランタイムへ通知します。
+3. デーモンが daemon API を通じてタスクを取得します。
+4. サーバーがタスクとエージェントに紐づく一時的な認証情報を発行します。
+5. デーモンがローカルディレクトリを準備し、`pkg/agent` の対応する provider backend を呼び出します。
+6. ツールがローカルで動作し、デーモンが進捗、メッセージ、最終状態をアップロードします。
+7. サーバーがタスクとイシューを更新し、リアルタイムイベントでクライアントを更新します。
+
+provider アダプター層は AI コーディングツールごとの起動、ストリーミングイベント、キャンセル、使用量データを統一しますが、ローカルディレクトリとセッションは引き続きデーモンが管理します。
+
+## 複数ワークスペースの境界
+
+ビジネスクエリは必ず `workspace_id` で限定し、リクエストがワークスペースルートへ入る前にメンバーシップを確認します。`X-Workspace-ID` は現在のワークスペースを選択しますが、権限確認の代わりにはなりません。
+
+イシューの担当者は多態的な関係であり、メンバー、エージェント、スクワッドのいずれかを指します。クエリ、キャッシュ key、リアルタイムイベントを追加するときは、リソース ID だけでグローバルに一意なコンテキストだと仮定せず、ワークスペースと担当者の型を保持する必要があります。
+
+## 次のステップ
+
+- [開発に参加する](/developers/contributing) — ローカル環境、worktree、テストの配置。
+- [開発規約](/developers/conventions) — 命名、用語、中国語文言に関するリポジトリの契約。
diff --git a/apps/docs/content/docs/developers/architecture.ko.mdx b/apps/docs/content/docs/developers/architecture.ko.mdx
new file mode 100644
index 0000000000..39205421bd
--- /dev/null
+++ b/apps/docs/content/docs/developers/architecture.ko.mdx
@@ -0,0 +1,129 @@
+---
+title: 프로젝트 아키텍처
+description: Multica의 클라이언트, Go 서비스, 실행 데몬, 공유 프런트엔드 패키지가 함께 작동하는 방식을 알아봅니다.
+---
+
+Multica는 Go backend, 여러 클라이언트, 실행 컴퓨터에서 동작하는 데몬으로 구성됩니다. PostgreSQL이 협업 데이터를 저장하고 데몬이 태스크를 가져가 로컬 AI 코딩 도구를 호출합니다.
+
+```text
+Web / Desktop / Mobile / CLI
+ │
+ HTTP + WebSocket
+ │
+ Go API ───────── PostgreSQL
+ │
+ daemon WebSocket
+ │
+ 로컬 데몬 ─── AI 코딩 도구
+```
+
+제품 사용자 관점의 설명은 [Multica의 작동 방식](/how-multica-works)을 참고하세요. 이 페이지에서는 코드의 계층 구조를 설명합니다.
+
+## 저장소 구조
+
+| 디렉터리 | 역할 | 주요 기술 |
+| --- | --- | --- |
+| `server/` | API, 인증, 태스크 스케줄링, 연동, CLI, 데몬 | Go, Chi, sqlc, gorilla/websocket |
+| `apps/web/` | 브라우저 클라이언트와 landing page | Next.js App Router |
+| `apps/desktop/` | 데스크톱 클라이언트와 로컬 프로세스 관리 | Electron, electron-vite |
+| `apps/mobile/` | 독립적인 iOS 클라이언트 | Expo, React Native |
+| `apps/docs/` | 다국어 문서 사이트 | Next.js, Fumadocs |
+| `packages/core/` | API client, 유형, query, mutation, 플랫폼 독립 비즈니스 로직 | TanStack Query, Zustand |
+| `packages/ui/` | 비즈니스 로직이 없는 기본 UI | shadcn, Base UI |
+| `packages/views/` | Web과 Desktop이 공유하는 비즈니스 페이지 및 컴포넌트 | React |
+| `packages/tsconfig/`, `packages/eslint-config/` | 공유 도구 설정 | TypeScript, ESLint |
+
+공유 패키지는 `.ts`와 `.tsx` 소스 파일을 직접 export하며 사용하는 애플리케이션이 컴파일합니다. 의존 방향은 `views → core + ui`이고 `core`와 `ui`는 서로 의존하지 않습니다.
+
+## Web과 Desktop의 코드 공유
+
+Web과 Desktop은 세 계층을 공유합니다.
+
+1. `packages/core`가 API, cache, 권한, 플랫폼 독립 상태를 처리합니다.
+2. `packages/ui`가 기본 컴포넌트를 제공합니다.
+3. `packages/views`가 비즈니스 페이지를 구성합니다.
+
+라우팅, cookie, Electron IPC 같은 플랫폼 기능은 애플리케이션 계층에 둡니다. 공유 페이지는 `NavigationAdapter`를 통해 이동하며 `next/*` 또는 `react-router-dom`을 직접 import하지 않습니다.
+
+예를 들어 Web과 Desktop에 모두 필요한 이슈 기능은 일반적으로 다음 위치에 걸쳐 있습니다.
+
+```text
+packages/core/issues/ query, mutation, cache 업데이트
+packages/views/issues/ 페이지와 비즈니스 컴포넌트
+apps/web/platform/ Next.js 라우팅 adapter
+apps/desktop/.../platform/ Electron 라우팅 adapter
+```
+
+Mobile은 이 React 페이지를 재사용하지 않습니다. `@multica/core`의 유형과 순수 함수를 import할 수 있지만 UI, query key, 상태, 실시간 구독, 출시 절차는 별도로 소유합니다.
+
+## 프런트엔드 상태
+
+서버 데이터와 클라이언트 상태를 분리해 관리합니다.
+
+- **TanStack Query**는 이슈, 에이전트, 멤버, 인박스 같은 서버 데이터를 보관합니다.
+- **Zustand**는 필터, 초안, 팝업, 레이아웃 같은 클라이언트 상태를 보관합니다.
+- 현재 워크스페이스는 route가 결정하며 요청, 영속화 namespace, 재연결에 필요한 범위만 플랫폼 계층에 반영합니다.
+- React Context는 워크스페이스 ID와 navigation adapter 같은 플랫폼 plumbing만 전달합니다.
+
+WebSocket 이벤트는 TanStack Query cache를 업데이트하거나 무효화해야 합니다. 서버 객체를 Zustand에 복사하면 안 됩니다. 워크스페이스 생성, 삭제, 나가기처럼 화면 이동을 동반하는 mutation은 서버 확인을 기다린 뒤 로컬 상태를 정리해야 합니다.
+
+API 응답은 `packages/core/api/` 경계에서 zod schema로 parsing합니다. 설치된 Desktop이 더 새로운 backend에 연결될 수 있으므로 network JSON을 TypeScript 유형으로 바로 강제 변환하면 안 됩니다.
+
+## Backend 계층
+
+주요 entry point는 `server/cmd/`에 있습니다.
+
+| entry point | 역할 |
+| --- | --- |
+| `server` | HTTP API, WebSocket, scheduler, 연동 worker 시작 |
+| `multica` | CLI와 로컬 데몬 |
+| `migrate` | 데이터베이스 migration 실행 |
+| `backfill_*` | 특정 버전의 데이터 backfill 도구 |
+
+요청은 일반적으로 다음 방향으로 흐릅니다.
+
+```text
+router → middleware → handler → service → sqlc query → PostgreSQL
+```
+
+- `internal/middleware/`는 인증, 워크스페이스, 요청 경계를 처리합니다.
+- `internal/handler/`는 HTTP 입력을 해석하고 응답을 생성합니다.
+- `internal/service/`는 여러 query에 걸친 비즈니스 흐름과 transaction을 담당합니다.
+- `pkg/db/queries/`에는 직접 작성한 SQL이 있습니다.
+- `pkg/db/generated/`는 sqlc가 생성하므로 직접 수정하면 안 됩니다.
+- `internal/integrations/`는 GitHub, Slack, Feishu 같은 외부 이벤트를 처리합니다.
+- `internal/storage/`는 로컬 또는 S3 첨부 파일을 처리합니다.
+
+PostgreSQL은 비즈니스 데이터의 신뢰할 수 있는 원본입니다. Redis는 선택 컴포넌트이며 여러 인스턴스 간 실시간 이벤트, cache, 임시 조율에 사용합니다. 설정하지 않으면 단일 인스턴스 개발 환경이 프로세스 내부 구현을 사용합니다.
+
+## 실시간 연결
+
+Multica에는 서로 다른 두 WebSocket 경로가 있습니다.
+
+- `internal/realtime/`은 이슈, 댓글, 인박스 등의 변경을 사용자 클라이언트로 전달합니다.
+- `internal/daemonws/`는 데몬을 연결해 런타임을 깨우고 daemon RPC를 실행합니다.
+
+WebSocket은 지연을 줄이지만 최종 상태는 데이터베이스에 있습니다. 클라이언트는 재연결 후 query로 다시 동기화해야 합니다. 데몬도 polling 경로를 유지해 한 번의 연결 끊김으로 queued 태스크가 영구히 멈추지 않게 합니다.
+
+## 한 번의 실행 코드 경로
+
+1. 사용자가 이슈를 할당하거나 에이전트를 멘션하거나 자동화가 트리거됩니다.
+2. `TaskService`가 queued 태스크를 만들고 해당 런타임에 알립니다.
+3. 데몬이 daemon API를 통해 태스크를 가져갑니다.
+4. 서버가 태스크와 에이전트에 연결된 임시 자격 증명을 발급합니다.
+5. 데몬이 로컬 디렉터리를 준비하고 `pkg/agent`에서 해당 provider backend를 호출합니다.
+6. 도구가 로컬에서 실행되고 데몬이 진행 상황, 메시지, 최종 상태를 업로드합니다.
+7. 서버가 태스크와 이슈를 업데이트하고 실시간 이벤트로 클라이언트를 새로 고칩니다.
+
+provider adapter 계층은 AI 코딩 도구별 시작, streaming 이벤트, 취소, 사용량 데이터를 통일하지만 로컬 디렉터리와 세션은 계속 데몬이 관리합니다.
+
+## 여러 워크스페이스의 경계
+
+비즈니스 query는 반드시 `workspace_id`로 제한해야 하며 요청이 워크스페이스 route에 들어가기 전에 멤버 자격을 확인합니다. `X-Workspace-ID`는 현재 워크스페이스를 선택하지만 권한 검사를 대체하지 않습니다.
+
+이슈 담당자는 polymorphic 관계이며 멤버, 에이전트, 스쿼드 중 하나를 가리킬 수 있습니다. 새 query, cache key, 실시간 이벤트를 추가할 때 리소스 ID만으로 전역에서 고유한 컨텍스트라고 가정하지 말고 워크스페이스와 담당자 유형을 유지해야 합니다.
+
+## 다음 단계
+
+- [개발 참여](/developers/contributing) — 로컬 환경, worktree, 테스트 위치를 알아봅니다.
+- [개발 규칙](/developers/conventions) — 이름, 용어, 중국어 문구에 관한 저장소 규칙을 확인합니다.
diff --git a/apps/docs/content/docs/developers/architecture.mdx b/apps/docs/content/docs/developers/architecture.mdx
new file mode 100644
index 0000000000..f22f71fe5c
--- /dev/null
+++ b/apps/docs/content/docs/developers/architecture.mdx
@@ -0,0 +1,129 @@
+---
+title: Project architecture
+description: Learn how Multica's clients, Go service, execution daemon, and shared frontend packages work together.
+---
+
+Multica consists of a Go backend, multiple clients, and a daemon that runs on execution computers. PostgreSQL stores collaboration data; the daemon claims tasks and invokes local AI coding tools.
+
+```text
+Web / Desktop / Mobile / CLI
+ │
+ HTTP + WebSocket
+ │
+ Go API ───────── PostgreSQL
+ │
+ daemon WebSocket
+ │
+ local daemon ─── AI coding tools
+```
+
+For a product-facing explanation, see [How Multica works](/how-multica-works). This page focuses on how the code is layered.
+
+## Repository layout
+
+| Directory | Responsibility | Main technologies |
+| --- | --- | --- |
+| `server/` | API, authentication, task scheduling, integrations, CLI, and daemon | Go, Chi, sqlc, gorilla/websocket |
+| `apps/web/` | Browser client and landing page | Next.js App Router |
+| `apps/desktop/` | Desktop client and local process management | Electron, electron-vite |
+| `apps/mobile/` | Standalone iOS client | Expo, React Native |
+| `apps/docs/` | Multilingual documentation site | Next.js, Fumadocs |
+| `packages/core/` | API client, types, queries, mutations, and platform-independent business logic | TanStack Query, Zustand |
+| `packages/ui/` | Foundational UI with no business logic | shadcn, Base UI |
+| `packages/views/` | Business pages and components shared by Web and Desktop | React |
+| `packages/tsconfig/`, `packages/eslint-config/` | Shared tooling configuration | TypeScript, ESLint |
+
+Shared packages export `.ts` and `.tsx` source files directly and are compiled by their consuming applications. The dependency direction is `views → core + ui`; `core` and `ui` do not depend on each other.
+
+## Code sharing between Web and Desktop
+
+Web and Desktop share three layers:
+
+1. `packages/core` handles APIs, caching, permissions, and platform-independent state.
+2. `packages/ui` provides foundational components.
+3. `packages/views` composes business pages.
+
+Platform capabilities such as routing, cookies, and Electron IPC stay in the application layer. Shared pages navigate through `NavigationAdapter` and do not import `next/*` or `react-router-dom` directly.
+
+For example, an issue feature needed by both Web and Desktop usually touches:
+
+```text
+packages/core/issues/ queries, mutations, cache updates
+packages/views/issues/ pages and business components
+apps/web/platform/ Next.js routing adapter
+apps/desktop/.../platform/ Electron routing adapter
+```
+
+Mobile does not reuse these React pages. It may import types and pure functions from `@multica/core`, but it owns its UI, query keys, state, realtime subscriptions, and release process.
+
+## Frontend state
+
+Server data and client state are managed separately:
+
+- **TanStack Query** owns server data such as issues, agents, members, and inbox items.
+- **Zustand** owns client state such as filters, drafts, dialogs, and layout.
+- The current workspace is route-driven and is mirrored at the platform layer only where requests, persisted namespaces, or reconnection require it.
+- React Context carries only platform plumbing such as the workspace ID and navigation adapter.
+
+WebSocket events should update or invalidate the TanStack Query cache. Do not copy server objects into Zustand. Mutations that navigate, such as creating, deleting, or leaving a workspace, must wait for server confirmation before clearing local state.
+
+API responses are parsed with zod schemas at the `packages/core/api/` boundary. An installed Desktop client may connect to a newer backend, so network JSON must not be asserted directly as a TypeScript type.
+
+## Backend layers
+
+The main entry points are in `server/cmd/`:
+
+| Entry point | Purpose |
+| --- | --- |
+| `server` | Starts the HTTP API, WebSocket services, scheduler, and integration workers |
+| `multica` | CLI and local daemon |
+| `migrate` | Runs database migrations |
+| `backfill_*` | Data backfill tools for specific releases |
+
+Requests usually flow in this direction:
+
+```text
+router → middleware → handler → service → sqlc query → PostgreSQL
+```
+
+- `internal/middleware/` handles authentication, workspace, and request boundaries.
+- `internal/handler/` parses HTTP input and produces responses.
+- `internal/service/` owns cross-query business workflows and transactions.
+- `pkg/db/queries/` contains handwritten SQL.
+- `pkg/db/generated/` is generated by sqlc and must not be edited directly.
+- `internal/integrations/` handles external events from GitHub, Slack, Feishu, and other services.
+- `internal/storage/` handles local and S3 attachments.
+
+PostgreSQL is the source of truth for business data. Redis is optional and is used for cross-instance realtime events, caching, or temporary coordination. Without Redis, a single-instance development environment uses in-process implementations.
+
+## Realtime connections
+
+Multica has two distinct WebSocket paths:
+
+- `internal/realtime/` pushes issue, comment, inbox, and other changes to user clients.
+- `internal/daemonws/` connects daemons to wake runtimes and perform daemon RPC.
+
+WebSocket reduces latency, but the database remains the final state. Clients must recalibrate through queries after reconnecting. The daemon also keeps a polling path so that one disconnect cannot leave a queued task stuck forever.
+
+## Code path for one execution
+
+1. A user assigns an issue, mentions an agent, or an automation triggers.
+2. `TaskService` creates a queued task and notifies the corresponding runtime.
+3. The daemon claims the task through the daemon API.
+4. The server issues temporary credentials bound to the task and agent.
+5. The daemon prepares a local directory and invokes the matching provider backend in `pkg/agent`.
+6. The tool runs locally while the daemon uploads progress, messages, and final status.
+7. The server updates the task and issue, then refreshes clients through realtime events.
+
+The provider adapter layer normalizes startup, streaming events, cancellation, and usage data across AI coding tools, while the daemon still owns local directories and sessions.
+
+## Multi-workspace boundaries
+
+Business queries must be scoped by `workspace_id`, and membership is checked before a request enters a workspace route. `X-Workspace-ID` selects the current workspace but does not replace authorization checks.
+
+An issue's assignee is polymorphic and may point to a member, agent, or squad. New queries, cache keys, and realtime events must preserve both the workspace and assignee type instead of assuming that a resource ID is globally unique context.
+
+## Next steps
+
+- [Contributing](/developers/contributing) — Local environments, worktrees, and test locations.
+- [Development conventions](/developers/conventions) — Repository contracts for naming, terminology, and Chinese copy.
diff --git a/apps/docs/content/docs/developers/architecture.zh.mdx b/apps/docs/content/docs/developers/architecture.zh.mdx
index ec82928a7b..6e3004a492 100644
--- a/apps/docs/content/docs/developers/architecture.zh.mdx
+++ b/apps/docs/content/docs/developers/architecture.zh.mdx
@@ -1,75 +1,129 @@
---
-title: Architecture
-description: Technical architecture of the Multica platform.
+title: 项目架构
+description: 了解 Multica 的客户端、Go 服务、执行守护进程和共享前端包如何协作。
---
-## Overview
+Multica 由一个 Go backend、多种客户端和运行在执行电脑上的守护进程组成。PostgreSQL 保存协作数据;守护进程领取 task,并调用本机的 AI 编程工具。
+
+```text
+Web / Desktop / Mobile / CLI
+ │
+ HTTP + WebSocket
+ │
+ Go API ───────── PostgreSQL
+ │
+ daemon WebSocket
+ │
+ 本机守护进程 ─── AI 编程工具
+```
-Multica is a Go backend + monorepo frontend (pnpm workspaces + Turborepo) with shared packages.
+面向产品用户的解释见 [Multica 的工作方式](/how-multica-works)。本页关注代码如何分层。
-```
-┌──────────────┐ ┌──────────────┐ ┌──────────────────┐
-│ Next.js │────>│ Go Backend │────>│ PostgreSQL │
-│ Frontend │<────│ (Chi + WS) │<────│ (pgvector) │
-└──────────────┘ └──────┬───────┘ └──────────────────┘
- │
- ┌──────┴───────┐
- │ Agent Daemon │ (runs on your machine)
- │Claude/Codex/ │
- │OpenClaw/Code │
- └──────────────┘
-```
+## 仓库结构
-## Project Structure
+| 目录 | 职责 | 主要技术 |
+| --- | --- | --- |
+| `server/` | API、认证、任务调度、集成、CLI 和守护进程 | Go、Chi、sqlc、gorilla/websocket |
+| `apps/web/` | 浏览器客户端和 landing page | Next.js App Router |
+| `apps/desktop/` | 桌面客户端和本机进程管理 | Electron、electron-vite |
+| `apps/mobile/` | 独立的 iOS 客户端 | Expo、React Native |
+| `apps/docs/` | 多语言文档站 | Next.js、Fumadocs |
+| `packages/core/` | API client、类型、查询、mutation 和平台无关业务逻辑 | TanStack Query、Zustand |
+| `packages/ui/` | 不包含业务逻辑的基础 UI | shadcn、Base UI |
+| `packages/views/` | Web 与 Desktop 共用的业务页面和组件 | React |
+| `packages/tsconfig/`、`packages/eslint-config/` | 共享工具配置 | TypeScript、ESLint |
-| Directory | Purpose | Technology |
-|-----------|---------|------------|
-| `server/` | Go backend | Chi router, sqlc for DB, gorilla/websocket |
-| `apps/web/` | Next.js frontend | App Router |
-| `apps/desktop/` | Electron desktop app | electron-vite |
-| `apps/docs/` | Documentation site | Fumadocs |
-| `packages/core/` | Headless business logic | Zero react-dom, all-platform reuse |
-| `packages/ui/` | Atomic UI components | Zero business logic, shadcn-based |
-| `packages/views/` | Shared business pages | Zero next/\*, zero react-router imports |
-| `packages/tsconfig/` | Shared TypeScript config | — |
-| `packages/eslint-config/` | Shared ESLint config | — |
+共享包直接导出 `.ts` 和 `.tsx` 源文件,由使用它们的应用编译。依赖方向是 `views → core + ui`;`core` 和 `ui` 互不依赖。
-## Backend Structure
+## Web 与 Desktop 的代码共享
-- **Entry points** (`cmd/`): `server` (HTTP API), `multica` (CLI + daemon), `migrate`
-- **Handlers** (`internal/handler/`): One file per domain (issue, comment, agent, auth, daemon)
-- **Real-time** (`internal/realtime/`): Hub manages WebSocket clients, server broadcasts events
-- **Auth** (`internal/auth/` + `internal/middleware/`): JWT (HS256), middleware sets `X-User-ID` and `X-User-Email` headers
-- **Task lifecycle** (`internal/service/task.go`): enqueue → claim → start → complete/fail
-- **Agent SDK** (`pkg/agent/`): Unified `Backend` interface for executing prompts via Claude Code or Codex
-- **Daemon** (`internal/daemon/`): Auto-detects CLIs, registers runtimes, polls for tasks
-- **Database**: PostgreSQL 17 with pgvector, sqlc generates code from SQL in `pkg/db/queries/`
+Web 和 Desktop 共用三层:
-## Frontend Architecture
+1. `packages/core` 处理 API、缓存、权限和平台无关状态;
+2. `packages/ui` 提供基础组件;
+3. `packages/views` 组合业务页面。
-### Internal Packages Pattern
+路由、cookie 和 Electron IPC 等平台能力留在应用层。共享页面通过 `NavigationAdapter` 导航,不直接导入 `next/*` 或 `react-router-dom`。
-All shared packages export raw `.ts`/`.tsx` files (no pre-compilation). The consuming app's bundler compiles them directly. This gives zero-config HMR and instant go-to-definition.
+例如,一项 Web 与 Desktop 都需要的 issue 功能通常会涉及:
-### Package Boundaries
+```text
+packages/core/issues/ 查询、mutation、缓存更新
+packages/views/issues/ 页面和业务组件
+apps/web/platform/ Next.js 路由适配
+apps/desktop/.../platform/ Electron 路由适配
+```
-- `packages/core/` — zero react-dom, zero localStorage, zero UI libs. All Zustand stores live here.
-- `packages/ui/` — pure UI components, zero business logic.
-- `packages/views/` — zero `next/*`, zero `react-router-dom`. Uses `NavigationAdapter` for routing.
+Mobile 不复用这些 React 页面。它可以导入 `@multica/core` 的类型和纯函数,但拥有自己的 UI、query key、状态、实时订阅和发布流程。
-### State Management
+## 前端状态
-- **TanStack Query** owns all server state (issues, users, workspaces)
-- **Zustand** owns all client state (UI selections, filters, drafts)
-- **React Context** reserved for cross-cutting plumbing (`WorkspaceIdProvider`, `NavigationProvider`)
+服务端数据和客户端状态分开管理:
-### Data Flow
+- **TanStack Query** 保存 issue、智能体、成员、收件箱等服务端数据;
+- **Zustand** 保存筛选条件、草稿、弹窗和布局等客户端状态;
+- 当前工作区由路由决定,只在平台层为请求、持久化命名空间和重连做必要镜像;
+- React Context 只传递工作区 ID、导航适配器等平台 plumbing。
+WebSocket 事件应更新或失效 TanStack Query cache,不能把服务端对象复制进 Zustand。创建、删除或离开工作区这类会导航的 mutation,需要等待服务端确认后再清理本地状态。
+
+API 返回值在 `packages/core/api/` 边界通过 zod schema 解析。已安装的 Desktop 可能连接更新的 backend,因此不能直接把网络 JSON 强制转换成 TypeScript 类型。
+
+## Backend 分层
+
+主要入口位于 `server/cmd/`:
+
+| 入口 | 作用 |
+| --- | --- |
+| `server` | 启动 HTTP API、WebSocket、调度器和集成 worker |
+| `multica` | CLI 与本机守护进程 |
+| `migrate` | 执行数据库 migration |
+| `backfill_*` | 特定版本的数据回填工具 |
+
+请求通常按以下方向流动:
+
+```text
+router → middleware → handler → service → sqlc query → PostgreSQL
```
-Browser → ApiClient (shared/api) → REST API (Chi handlers) → sqlc queries → PostgreSQL
-Browser ← WSClient (shared/api) ← WebSocket ← Hub.Broadcast() ← Handlers/TaskService
-```
-## Multi-tenancy
+- `internal/middleware/` 处理认证、工作区和请求边界;
+- `internal/handler/` 解析 HTTP 输入并生成响应;
+- `internal/service/` 负责跨查询的业务流程和事务;
+- `pkg/db/queries/` 保存手写 SQL;
+- `pkg/db/generated/` 由 sqlc 生成,不能直接编辑;
+- `internal/integrations/` 处理 GitHub、Slack、飞书等外部事件;
+- `internal/storage/` 处理本地或 S3 附件。
+
+PostgreSQL 是业务数据的权威来源。Redis 是可选组件,用于跨实例实时事件、缓存或临时协调;没有配置时,单实例开发环境使用进程内实现。
+
+## 实时连接
+
+Multica 有两条不同的 WebSocket 路径:
+
+- `internal/realtime/` 把 issue、评论、收件箱等变化推送给用户客户端;
+- `internal/daemonws/` 连接守护进程,用于唤醒运行时和执行 daemon RPC。
+
+WebSocket 负责降低延迟,数据库仍然是最终状态。客户端重连后需要通过查询重新校准;守护进程也保留轮询路径,避免一次断线让 queued task 永久停住。
+
+## 一次执行的代码路径
+
+1. 用户分配 issue、提及智能体,或由自动化触发;
+2. `TaskService` 创建 queued task,并通知对应运行时;
+3. 守护进程通过 daemon API 领取 task;
+4. 服务端签发绑定 task 和智能体的临时凭据;
+5. 守护进程准备本地目录,调用 `pkg/agent` 中对应的 provider backend;
+6. 工具在本地运行,守护进程上传进度、消息和最终状态;
+7. 服务端更新 task 与 issue,并通过实时事件刷新客户端。
+
+provider 适配层统一了不同 AI 编程工具的启动、流式事件、取消和用量数据,但本地目录与会话仍由守护进程管理。
+
+## 多工作区边界
+
+业务查询必须限定 `workspace_id`,请求进入工作区路由前会检查成员身份。`X-Workspace-ID` 选择当前工作区,但不能替代权限检查。
+
+Issue 的负责人是多态关系,可以指向成员、智能体或小队。新增查询、缓存 key 或实时事件时,都要保留工作区与负责人类型,不能只按资源 ID 假设全局唯一上下文。
+
+## 接下来
-All queries filter by `workspace_id`. Membership checks gate access. `X-Workspace-ID` header routes requests to the correct workspace.
+- [参与开发](/developers/contributing) — 本地环境、worktree 和测试位置。
+- [开发规范](/developers/conventions) — 命名、术语和中文文案的仓库契约。
diff --git a/apps/docs/content/docs/developers/contributing.ja.mdx b/apps/docs/content/docs/developers/contributing.ja.mdx
new file mode 100644
index 0000000000..32c42165eb
--- /dev/null
+++ b/apps/docs/content/docs/developers/contributing.ja.mdx
@@ -0,0 +1,199 @@
+---
+title: 開発に参加する
+description: Multica のローカル開発環境を構築し、テストを実行して、リポジトリの規約に従って変更を提出します。
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+Multica は Go バックエンドと pnpm monorepo で構成されています。ローカルで起動する最も簡単な方法は `make dev` です。現在の checkout 用に環境、データベース、migration を準備し、Web と API を起動します。
+
+## 必要な環境
+
+- Node.js 22
+- pnpm 10.28.2
+- Go 1.26.1
+- Docker Engine または Docker Desktop
+- Git と Make
+
+バージョンについては、ルートの `package.json`、`server/go.mod`、CI workflow を信頼できる情報源としてください。
+
+## 初回起動
+
+```bash
+git clone https://github.com/multica-ai/multica.git
+cd multica
+make dev
+```
+
+メイン checkout は `.env` を使用します。ファイルがなければ `make dev` が `.env.example` から作成し、共有 PostgreSQL を起動して依存関係をインストールし、migration を実行して API と Web を起動します。
+
+デフォルトのアドレス:
+
+```text
+Web: http://localhost:3000
+API: http://localhost:8080
+```
+
+ローカルの固定確認コードは開発環境の設定から取得されます。ローカルの `.env` を公開インターネット向けのデプロイに使用しないでください。
+
+## worktree での開発
+
+このリポジトリでは、メイン checkout と複数の worktree を同時に実行できます。1 つの PostgreSQL コンテナを共有しますが、データベースとポートは分かれています。
+
+```bash
+git worktree add ../multica-feature -b feat/my-change main
+cd ../multica-feature
+make setup-worktree
+make start-worktree
+```
+
+`make setup-worktree` は `.env.worktree` を生成し、パスからデータベース名とポートを決定します。再び起動するには次を実行します。
+
+```bash
+make start-worktree
+```
+
+現在の worktree の Web と API を停止するには:
+
+```bash
+make stop-worktree
+```
+
+`make dev` を直接実行することもできます。スクリプトが `.git` ファイルから worktree を判定し、`.env.worktree` を選択します。
+
+<Callout type="info">
+worktree 間で共有するのは PostgreSQL コンテナであり、データベースではありません。worktree ごとに新しい Compose project を起動しないでください。まず `.env.worktree` の `POSTGRES_DB`、`PORT`、`FRONTEND_PORT` を確認してください。
+</Callout>
+
+## よく使うコマンド
+
+### 全体フロー
+
+```bash
+make dev # 現在の checkout を準備して起動
+make start # 既存の環境で API と Web を起動
+make stop # 現在の checkout のプロセスを停止
+make check # ローカルの完全な検証フローを実行
+make build # server、CLI、migrate バイナリをビルド
+```
+
+### フロントエンド
+
+```bash
+pnpm install
+pnpm dev:web
+pnpm dev:desktop
+pnpm build
+pnpm typecheck
+pnpm lint
+pnpm test
+```
+
+ルートコマンドはデフォルトで Mobile を除外します。Mobile には独自のスクリプトと CI があるため、変更前に `apps/mobile/CLAUDE.md` を読んでください。
+
+### バックエンド
+
+```bash
+make server
+make daemon
+make test
+make migrate-up
+make migrate-down
+make sqlc
+```
+
+ソースから CLI コマンドを実行するには:
+
+```bash
+make cli ARGS="issue list"
+```
+
+## フロントエンド機能の変更
+
+Web と Desktop の両方で必要な機能は、責務に応じて配置します。
+
+1. API 型、query、mutation、プラットフォーム非依存のロジックは `packages/core/` に置きます。
+2. 基礎 UI は `packages/ui/` に置き、ビジネスコードへ依存させません。
+3. ビジネスページとコンポーネントは `packages/views/` に置きます。
+4. Next.js、Electron、ルーティングアダプターは対応する app に残します。
+5. 共有ページは Web と Desktop の両方へ接続します。
+
+サーバーデータは TanStack Query、フィルター、下書き、レイアウトなどのクライアント状態は Zustand が管理します。具体的な境界は[プロジェクトアーキテクチャ](/developers/architecture)とルートの `CLAUDE.md` を参照してください。
+
+API を追加または変更するときは `packages/core/api/` の zod schema も更新し、欠落フィールド、未知の enum、形式不正に対する解析テストを追加します。
+
+## データベースの変更
+
+Migration は `server/migrations/`、クエリは `server/pkg/db/queries/` にあります。
+
+1. 次の未使用の数値 prefix を使い、`.up.sql` と `.down.sql` の両方を作成します。
+2. データベースの foreign key、cascade delete、cascade update を追加しません。関係の検証とクリーンアップはアプリケーション層で行います。
+3. 新しいインデックスはすべて `CREATE INDEX CONCURRENTLY` または `CREATE UNIQUE INDEX CONCURRENTLY` を使用します。
+4. concurrent index は、その 1 文だけを含む migration ファイルに分けます。
+5. クエリ変更後に `make sqlc` を実行し、生成された `server/pkg/db/generated/` の変更をコミットします。
+6. sqlc の生成ファイルを直接編集しません。
+
+複数の書き込みをまとめて成功またはロールバックさせる必要がある場合は、service 層でアプリケーショントランザクションを使用します。
+
+## テストの配置
+
+| 変更 | テストの配置 |
+| --- | --- |
+| 共有ビジネスロジック、query、store | `packages/core/*.test.ts` |
+| 共有ページとコンポーネント | `packages/views/*.test.tsx` |
+| Web または Desktop のプラットフォーム wiring | 対応する `apps/*` ディレクトリ |
+| エンドツーエンドフロー | `e2e/*.spec.ts` |
+| バックエンド | 関連する Go package の `*_test.go` |
+
+まず変更に最も近いチェックを実行し、その後に範囲を広げます。Docs だけの変更例:
+
+```bash
+pnpm --filter @multica/docs typecheck
+```
+
+共有フロントエンドの変更:
+
+```bash
+pnpm typecheck
+pnpm test
+```
+
+バックエンドの変更:
+
+```bash
+make test
+```
+
+提出前:
+
+```bash
+make check
+```
+
+`make check` は TypeScript の typecheck とユニットテスト、Go テスト、Playwright E2E を実行します。CI は変更範囲に応じて build と lint を行い、プラットフォームまたはインストーラー専用テストも実行します。
+
+## 現在の開発データベースをリセット
+
+クリーンなデータが必要な場合は、**現在の checkout の環境ファイルで指定されたデータベース**をリセットできます。
+
+```bash
+make stop
+make db-reset
+make start
+```
+
+`make db-reset` は現在の `POSTGRES_DB` を削除して再作成し、リモートデータベースへの接続を拒否します。実行前に `.env` または `.env.worktree` を確認し、対象データベースが正しいことを確かめてください。
+
+## 提出前の確認
+
+- ルートの `CLAUDE.md` と関連するサブディレクトリの説明を読みます。
+- 現在のタスクに必要な範囲だけを変更します。
+- コードコメントは英語で記述します。
+- `.env`、トークン、ビルド成果物、ローカルパスをコミットしません。
+- `feat(scope)`、`fix(scope)`、`docs` などの conventional commit を使用します。
+- PR に動作変更と実際に実行した検証コマンドを記載します。
+
+## 次のステップ
+
+- [開発規約](/developers/conventions) — 命名、用語、中国語文言に関するリポジトリの契約。
+- [プロジェクトアーキテクチャ](/developers/architecture) — 階層、共有パッケージ、1 回の実行におけるコードパス。
diff --git a/apps/docs/content/docs/developers/contributing.ko.mdx b/apps/docs/content/docs/developers/contributing.ko.mdx
new file mode 100644
index 0000000000..00572e186d
--- /dev/null
+++ b/apps/docs/content/docs/developers/contributing.ko.mdx
@@ -0,0 +1,199 @@
+---
+title: 개발 참여
+description: Multica 로컬 개발 환경을 설정하고 테스트를 실행하며 저장소 규칙에 따라 변경 사항을 제출합니다.
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+Multica는 Go backend와 pnpm monorepo로 구성됩니다. 로컬에서 시작하는 가장 간단한 방법은 `make dev`입니다. 현재 checkout의 환경, 데이터베이스, migration을 준비한 뒤 Web과 API를 시작합니다.
+
+## 환경 요구 사항
+
+- Node.js 22
+- pnpm 10.28.2
+- Go 1.26.1
+- Docker Engine 또는 Docker Desktop
+- Git과 Make
+
+버전은 루트 `package.json`, `server/go.mod`, CI workflow를 기준으로 확인합니다.
+
+## 처음 시작
+
+```bash
+git clone https://github.com/multica-ai/multica.git
+cd multica
+make dev
+```
+
+기본 checkout은 `.env`를 사용합니다. 파일이 없으면 `make dev`가 `.env.example`에서 만들고 공유 PostgreSQL을 시작한 뒤 의존성을 설치하고 migration을 실행해 API와 Web을 시작합니다.
+
+기본 주소:
+
+```text
+Web: http://localhost:3000
+API: http://localhost:8080
+```
+
+로컬 고정 인증 코드는 개발 환경 설정에서 가져옵니다. 로컬 `.env`를 공개 인터넷 배포에 사용하지 마세요.
+
+## worktree에서 개발
+
+저장소는 기본 checkout과 여러 worktree를 동시에 실행할 수 있습니다. 하나의 PostgreSQL 컨테이너를 공유하지만 서로 다른 데이터베이스와 port를 사용합니다.
+
+```bash
+git worktree add ../multica-feature -b feat/my-change main
+cd ../multica-feature
+make setup-worktree
+make start-worktree
+```
+
+`make setup-worktree`는 `.env.worktree`를 만들고 경로를 기준으로 데이터베이스 이름과 port를 정합니다. 다시 시작하려면 다음을 실행합니다.
+
+```bash
+make start-worktree
+```
+
+현재 worktree의 Web과 API를 중지하려면 다음을 실행합니다.
+
+```bash
+make stop-worktree
+```
+
+`make dev`를 바로 실행할 수도 있습니다. 스크립트가 `.git` 파일을 통해 worktree를 감지하고 `.env.worktree`를 선택합니다.
+
+<Callout type="info">
+worktree는 PostgreSQL 컨테이너만 공유하며 데이터베이스는 공유하지 않습니다. worktree마다 새 Compose project를 시작하지 마세요. 먼저 `.env.worktree`의 `POSTGRES_DB`, `PORT`, `FRONTEND_PORT`를 확인하세요.
+</Callout>
+
+## 자주 사용하는 명령
+
+### 전체 절차
+
+```bash
+make dev # 현재 checkout 준비 및 시작
+make start # 기존 환경으로 API와 Web 시작
+make stop # 현재 checkout의 프로세스 중지
+make check # 전체 로컬 검증 절차 실행
+make build # server, CLI, migrate binary 빌드
+```
+
+### 프런트엔드
+
+```bash
+pnpm install
+pnpm dev:web
+pnpm dev:desktop
+pnpm build
+pnpm typecheck
+pnpm lint
+pnpm test
+```
+
+루트 명령은 기본적으로 Mobile을 제외합니다. Mobile에는 별도 스크립트와 CI가 있으므로 변경하기 전에 `apps/mobile/CLAUDE.md`를 읽으세요.
+
+### Backend
+
+```bash
+make server
+make daemon
+make test
+make migrate-up
+make migrate-down
+make sqlc
+```
+
+소스에서 CLI 명령을 실행하려면 다음을 사용합니다.
+
+```bash
+make cli ARGS="issue list"
+```
+
+## 프런트엔드 기능 변경
+
+Web과 Desktop에 모두 필요한 기능은 역할에 따라 배치합니다.
+
+1. API 유형, query, mutation, 플랫폼 독립 로직은 `packages/core/`에 둡니다.
+2. 기본 UI는 `packages/ui/`에 두며 비즈니스 코드에 의존하면 안 됩니다.
+3. 비즈니스 페이지와 컴포넌트는 `packages/views/`에 둡니다.
+4. Next.js, Electron, 라우팅 adapter는 해당 app에 남깁니다.
+5. 공유 페이지는 Web과 Desktop 양쪽에 연결합니다.
+
+서버 데이터는 TanStack Query가 관리하고 필터, 초안, 레이아웃 같은 클라이언트 상태는 Zustand가 관리합니다. 구체적인 경계는 [프로젝트 아키텍처](/developers/architecture)와 루트 `CLAUDE.md`를 참고하세요.
+
+API를 추가하거나 변경하면 `packages/core/api/`의 zod schema도 업데이트하고 누락된 필드, 알 수 없는 enum, 잘못된 형식에 대한 parsing 테스트를 추가해야 합니다.
+
+## 데이터베이스 변경
+
+Migration은 `server/migrations/`에 있고 query는 `server/pkg/db/queries/`에 있습니다.
+
+1. 다음 사용하지 않은 숫자 접두사를 사용해 `.up.sql`과 `.down.sql`을 모두 만듭니다.
+2. 데이터베이스 foreign key, cascade delete, cascade update를 추가하지 않습니다. 관계 검사와 정리는 애플리케이션 계층에서 수행합니다.
+3. 모든 새 index는 `CREATE INDEX CONCURRENTLY` 또는 `CREATE UNIQUE INDEX CONCURRENTLY`를 사용합니다.
+4. concurrent index 하나는 해당 문장만 포함한 별도 migration 파일에 둡니다.
+5. query를 수정한 뒤 `make sqlc`를 실행하고 생성된 `server/pkg/db/generated/` 변경 사항을 commit합니다.
+6. sqlc 생성 파일을 직접 수정하지 않습니다.
+
+여러 쓰기 작업이 함께 성공하거나 rollback되어야 하면 service 계층에서 애플리케이션 transaction을 사용합니다.
+
+## 테스트 위치
+
+| 변경 | 테스트 위치 |
+| --- | --- |
+| 공유 비즈니스 로직, query, store | `packages/core/*.test.ts` |
+| 공유 페이지와 컴포넌트 | `packages/views/*.test.tsx` |
+| Web 또는 Desktop 플랫폼 wiring | 해당 `apps/*` 디렉터리 |
+| end-to-end 흐름 | `e2e/*.spec.ts` |
+| Backend | 관련 Go package의 `*_test.go` |
+
+변경 사항과 가장 가까운 검사를 먼저 실행한 뒤 범위를 넓히세요. Docs만 변경한 경우:
+
+```bash
+pnpm --filter @multica/docs typecheck
+```
+
+공유 프런트엔드 변경:
+
+```bash
+pnpm typecheck
+pnpm test
+```
+
+Backend 변경:
+
+```bash
+make test
+```
+
+제출 전:
+
+```bash
+make check
+```
+
+`make check`는 TypeScript typecheck와 단위 테스트, Go 테스트, Playwright E2E를 실행합니다. CI는 변경 범위에 따라 build와 lint를 수행하고 플랫폼 또는 installer 전용 테스트도 실행합니다.
+
+## 현재 개발 데이터베이스 초기화
+
+깨끗한 데이터가 필요하면 **현재 checkout의 환경 파일에 지정된 데이터베이스**를 초기화할 수 있습니다.
+
+```bash
+make stop
+make db-reset
+make start
+```
+
+`make db-reset`은 현재 `POSTGRES_DB`를 삭제하고 다시 만들며 원격 데이터베이스 연결을 거부합니다. 실행 전에 `.env` 또는 `.env.worktree`를 확인해 대상 데이터베이스가 맞는지 확인하세요.
+
+## 제출 전 확인
+
+- 루트 `CLAUDE.md`와 관련 하위 디렉터리 안내를 읽습니다.
+- 현재 태스크에 필요한 범위만 변경합니다.
+- 코드 주석은 영어로 작성합니다.
+- `.env`, token, 빌드 결과물, 로컬 경로를 commit하지 않습니다.
+- `feat(scope)`, `fix(scope)`, `docs` 같은 conventional commit을 사용합니다.
+- PR에 동작 변경과 실제 실행한 검증 명령을 작성합니다.
+
+## 다음 단계
+
+- [개발 규칙](/developers/conventions) — 이름, 용어, 중국어 문구에 관한 저장소 규칙을 확인합니다.
+- [프로젝트 아키텍처](/developers/architecture) — 계층, 공유 패키지, 한 번의 실행 코드 경로를 알아봅니다.
diff --git a/apps/docs/content/docs/developers/contributing.mdx b/apps/docs/content/docs/developers/contributing.mdx
new file mode 100644
index 0000000000..1702cbb02d
--- /dev/null
+++ b/apps/docs/content/docs/developers/contributing.mdx
@@ -0,0 +1,199 @@
+---
+title: Contributing
+description: Set up a local Multica development environment, run tests, and submit changes using the repository conventions.
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+Multica is a Go backend and pnpm monorepo. The simplest way to start locally is `make dev`; it prepares the environment, database, and migrations for the current checkout, then starts Web and API.
+
+## Requirements
+
+- Node.js 22
+- pnpm 10.28.2
+- Go 1.26.1
+- Docker Engine or Docker Desktop
+- Git and Make
+
+Treat the root `package.json`, `server/go.mod`, and CI workflows as the source of truth for versions.
+
+## First start
+
+```bash
+git clone https://github.com/multica-ai/multica.git
+cd multica
+make dev
+```
+
+The primary checkout uses `.env`. If the file does not exist, `make dev` creates it from `.env.example`, then starts the shared PostgreSQL instance, installs dependencies, runs migrations, and starts API and Web.
+
+Default addresses:
+
+```text
+Web: http://localhost:3000
+API: http://localhost:8080
+```
+
+The fixed local verification code comes from the development configuration. Do not use a local `.env` for an internet-facing deployment.
+
+## Developing in a worktree
+
+The repository supports running the primary checkout and multiple worktrees at the same time. They share one PostgreSQL container but use separate databases and ports.
+
+```bash
+git worktree add ../multica-feature -b feat/my-change main
+cd ../multica-feature
+make setup-worktree
+make start-worktree
+```
+
+`make setup-worktree` generates `.env.worktree`; the database name and ports are derived from the path. To start it again:
+
+```bash
+make start-worktree
+```
+
+To stop Web and API for the current worktree:
+
+```bash
+make stop-worktree
+```
+
+You may also run `make dev` directly. The script detects a worktree through its `.git` file and selects `.env.worktree`.
+
+<Callout type="info">
+Different worktrees share the PostgreSQL container, not the database. Do not start a new Compose project for every worktree. Check `POSTGRES_DB`, `PORT`, and `FRONTEND_PORT` in `.env.worktree` first.
+</Callout>
+
+## Common commands
+
+### Full workflow
+
+```bash
+make dev # Prepare and start the current checkout
+make start # Start API and Web with the existing environment
+make stop # Stop processes for the current checkout
+make check # Run the complete local verification workflow
+make build # Build the server, CLI, and migrate binaries
+```
+
+### Frontend
+
+```bash
+pnpm install
+pnpm dev:web
+pnpm dev:desktop
+pnpm build
+pnpm typecheck
+pnpm lint
+pnpm test
+```
+
+Root commands exclude Mobile by default. Mobile has separate scripts and CI; read `apps/mobile/CLAUDE.md` before changing it.
+
+### Backend
+
+```bash
+make server
+make daemon
+make test
+make migrate-up
+make migrate-down
+make sqlc
+```
+
+To run a CLI command from source:
+
+```bash
+make cli ARGS="issue list"
+```
+
+## Changing frontend features
+
+Place features needed by both Web and Desktop according to responsibility:
+
+1. Put API types, queries, mutations, and platform-independent logic in `packages/core/`.
+2. Put foundational UI in `packages/ui/`; it must not depend on business code.
+3. Put business pages and components in `packages/views/`.
+4. Keep Next.js, Electron, and routing adapters in the corresponding app.
+5. Wire shared pages into both Web and Desktop.
+
+TanStack Query owns server data. Zustand owns client state such as filters, drafts, and layout. See [Project architecture](/developers/architecture) and the root `CLAUDE.md` for the exact boundary.
+
+When adding or changing an API, update the zod schema in `packages/core/api/` and add parsing tests for missing fields, unknown enum values, and malformed data.
+
+## Changing the database
+
+Migrations live in `server/migrations/`, and queries live in `server/pkg/db/queries/`.
+
+1. Use the next unused numeric prefix and create both `.up.sql` and `.down.sql`.
+2. Do not add database foreign keys, cascade deletes, or cascade updates. Enforce relationships and cleanup in the application layer.
+3. Every new index must use `CREATE INDEX CONCURRENTLY` or `CREATE UNIQUE INDEX CONCURRENTLY`.
+4. Put each concurrent index in a migration file containing only that statement.
+5. Run `make sqlc` after changing queries and commit the generated changes in `server/pkg/db/generated/`.
+6. Do not edit sqlc-generated files directly.
+
+Use an application transaction in the service layer when multiple writes must succeed or roll back together.
+
+## Test locations
+
+| Change | Test location |
+| --- | --- |
+| Shared business logic, queries, stores | `packages/core/*.test.ts` |
+| Shared pages and components | `packages/views/*.test.tsx` |
+| Web or Desktop platform wiring | Corresponding `apps/*` directory |
+| End-to-end workflows | `e2e/*.spec.ts` |
+| Backend | `*_test.go` in the relevant Go package |
+
+Run the check closest to the change first, then expand the scope. For a Docs-only change:
+
+```bash
+pnpm --filter @multica/docs typecheck
+```
+
+For shared frontend changes:
+
+```bash
+pnpm typecheck
+pnpm test
+```
+
+For backend changes:
+
+```bash
+make test
+```
+
+Before submitting:
+
+```bash
+make check
+```
+
+`make check` runs TypeScript typechecking and unit tests, Go tests, and Playwright E2E. CI also builds and lints according to the changed scope and runs platform- or installer-specific tests.
+
+## Resetting the current development database
+
+When you need clean data, reset the database named by the **current checkout's environment file**:
+
+```bash
+make stop
+make db-reset
+make start
+```
+
+`make db-reset` drops and recreates the current `POSTGRES_DB` and refuses to connect to a remote database. Before running it, check `.env` or `.env.worktree` and confirm the target database.
+
+## Before submitting
+
+- Read the root `CLAUDE.md` and relevant nested instructions.
+- Change only the scope required by the task.
+- Write code comments in English.
+- Do not commit `.env`, tokens, build artifacts, or local paths.
+- Use conventional commits such as `feat(scope)`, `fix(scope)`, or `docs`.
+- Describe behavior changes and the verification commands actually run in the PR.
+
+## Next steps
+
+- [Development conventions](/developers/conventions) — Repository contracts for naming, terminology, and Chinese copy.
+- [Project architecture](/developers/architecture) — Layers, shared packages, and the code path for one execution.
diff --git a/apps/docs/content/docs/developers/contributing.zh.mdx b/apps/docs/content/docs/developers/contributing.zh.mdx
index f31e0dd61d..a7d094c1a1 100644
--- a/apps/docs/content/docs/developers/contributing.zh.mdx
+++ b/apps/docs/content/docs/developers/contributing.zh.mdx
@@ -1,175 +1,180 @@
---
-title: Contributing
-description: Local development workflow for contributors working on the Multica codebase.
+title: 参与开发
+description: 配置 Multica 本地开发环境,运行测试,并按仓库约定提交改动。
---
-## Development Model
+import { Callout } from "fumadocs-ui/components/callout";
-Local development uses one shared PostgreSQL container and one database per checkout.
+Multica 是 Go backend 与 pnpm monorepo。最简单的本地启动方式是 `make dev`;它会为当前 checkout 准备环境、数据库和 migration,再启动 Web 与 API。
-- The main checkout usually uses `.env` and `POSTGRES_DB=multica`
-- Each Git worktree uses its own `.env.worktree`
-- Every checkout connects to the same PostgreSQL host: `localhost:5432`
-- Isolation happens at the database level, not by starting a separate Docker Compose project
-- Backend and frontend ports are still unique per worktree
+## 环境要求
-## Prerequisites
+- Node.js 22;
+- pnpm 10.28.2;
+- Go 1.26.1;
+- Docker Engine 或 Docker Desktop;
+- Git 和 Make。
-- Node.js `v20+`
-- `pnpm` `v10.28+`
-- Go `v1.26+`
-- Docker
+版本以根目录 `package.json`、`server/go.mod` 和 CI workflow 为准。
-## First-Time Setup
-
-### Main Checkout
+## 第一次启动
```bash
-cp .env.example .env
-make setup-main
+git clone https://github.com/multica-ai/multica.git
+cd multica
+make dev
```
-What `make setup-main` does:
-
-- Installs JavaScript dependencies with `pnpm install`
-- Ensures the shared PostgreSQL container is running
-- Creates the application database if it does not exist
-- Runs all migrations against that database
+主 checkout 会使用 `.env`。文件不存在时,`make dev` 会从 `.env.example` 创建;然后启动共享 PostgreSQL、安装依赖、执行 migration,并运行 API 与 Web。
-Start the app:
+默认地址:
-```bash
-make start-main
+```text
+Web: http://localhost:3000
+API: http://localhost:8080
```
-### Worktree
+本地固定验证码来自开发环境配置。不要把本地 `.env` 用到公网部署。
-From the worktree directory:
+## 在 worktree 中开发
+
+仓库支持主 checkout 和多个 worktree 同时运行。它们共用一个 PostgreSQL 容器,但使用不同数据库和端口。
```bash
-make worktree-env
+git worktree add ../multica-feature -b feat/my-change main
+cd ../multica-feature
make setup-worktree
+make start-worktree
```
-Start the worktree app:
+`make setup-worktree` 会生成 `.env.worktree`,数据库名和端口根据路径确定。再次启动:
```bash
make start-worktree
```
-## Daily Workflow
-
-### Main Checkout
+停止当前 worktree 的 Web 与 API:
```bash
-make start-main
-make stop-main
-make check-main
+make stop-worktree
```
-### Feature Worktree
+也可以直接运行 `make dev`,脚本会通过 `.git` 文件识别 worktree 并选择 `.env.worktree`。
+
+<Callout type="info">
+不同 worktree 共用 PostgreSQL 容器,不共用数据库。不要为每个 worktree 启动新的 Compose project;先检查 `.env.worktree` 中的 `POSTGRES_DB`、`PORT` 和 `FRONTEND_PORT`。
+</Callout>
+
+## 常用命令
+
+### 整体流程
```bash
-git worktree add ../multica-feature -b feat/my-change main
-cd ../multica-feature
-make worktree-env
-make setup-worktree
-make start-worktree
+make dev # 准备并启动当前 checkout
+make start # 使用已有环境启动 API 与 Web
+make stop # 停止当前 checkout 的进程
+make check # 完整本地验证流程
+make build # 构建 server、CLI 和 migrate 二进制
```
-Day-to-day:
+### 前端
```bash
-make start-worktree
-make stop-worktree
-make check-worktree
+pnpm install
+pnpm dev:web
+pnpm dev:desktop
+pnpm build
+pnpm typecheck
+pnpm lint
+pnpm test
```
-## Running Main and Worktree Simultaneously
+根命令默认排除 Mobile。移动端有独立脚本和 CI,修改前先阅读 `apps/mobile/CLAUDE.md`。
-This is a first-class workflow. Both checkouts use the same PostgreSQL container but different databases and ports:
+### Backend
-| | Main | Worktree |
-|---|---|---|
-| Database | `multica` | `multica_my_feature_702` |
-| Backend port | `8080` | generated (e.g. `18782`) |
-| Frontend port | `3000` | generated (e.g. `13702`) |
+```bash
+make server
+make daemon
+make test
+make migrate-up
+make migrate-down
+make sqlc
+```
-## Commands
+从源码运行某条 CLI 命令:
```bash
-# Frontend (all commands go through Turborepo)
-pnpm install
-pnpm dev:web # Next.js dev server (port 3000)
-pnpm dev:desktop # Electron dev (electron-vite, HMR)
-pnpm build # Build all frontend apps
-pnpm typecheck # TypeScript check
-pnpm lint # ESLint
-pnpm test # TS tests (Vitest)
-
-# Backend (Go)
-make dev # Run Go server (port 8080)
-make daemon # Run local daemon
-make build # Build server + CLI binaries
-make test # Go tests
-make sqlc # Regenerate sqlc code
-make migrate-up # Run database migrations
-make migrate-down # Rollback migrations
+make cli ARGS="issue list"
```
-## Testing
+## 修改前端功能
-Run all local checks:
+Web 与 Desktop 都需要的功能按职责放置:
-```bash
-make check
-```
+1. API 类型、query、mutation 和平台无关逻辑放在 `packages/core/`;
+2. 基础 UI 放在 `packages/ui/`,不能依赖业务代码;
+3. 业务页面和组件放在 `packages/views/`;
+4. Next.js、Electron 和路由适配留在对应 app;
+5. 共享页面需要同时接入 Web 与 Desktop。
-This runs:
+服务端数据由 TanStack Query 管理,筛选、草稿和布局等客户端状态由 Zustand 管理。具体边界见[项目架构](/developers/architecture)和根目录 `CLAUDE.md`。
-1. TypeScript typecheck
-2. TypeScript unit tests
-3. Go tests
-4. Playwright E2E tests
+新增或修改 API 时,要同步更新 `packages/core/api/` 中的 zod schema,并为缺失字段、未知枚举或格式错误增加解析测试。
-## Troubleshooting
+## 修改数据库
-### Missing Env File
+Migration 位于 `server/migrations/`,查询位于 `server/pkg/db/queries/`。
-Create the expected env file:
+1. 使用下一个未占用的数字前缀,同时创建 `.up.sql` 和 `.down.sql`;
+2. 不添加数据库 foreign key、级联删除或级联更新;关系检查和清理由应用层完成;
+3. 每个新索引都使用 `CREATE INDEX CONCURRENTLY` 或 `CREATE UNIQUE INDEX CONCURRENTLY`;
+4. 一个 concurrent index 单独放在只包含这一条语句的 migration 文件中;
+5. 修改查询后运行 `make sqlc`,提交生成的 `server/pkg/db/generated/` 变化;
+6. 不直接编辑 sqlc 生成文件。
-```bash
-# Main checkout
-cp .env.example .env
+需要让多项写操作一起成功或回滚时,在 service 层使用应用事务。
-# Worktree
-make worktree-env
-```
+## 测试位置
-### Check Which Database a Checkout Uses
+| 改动 | 测试位置 |
+| --- | --- |
+| 共享业务逻辑、query、store | `packages/core/*.test.ts` |
+| 共享页面和组件 | `packages/views/*.test.tsx` |
+| Web 或 Desktop 平台 wiring | 对应 `apps/*` 目录 |
+| 端到端流程 | `e2e/*.spec.ts` |
+| Backend | 相关 Go package 的 `*_test.go` |
+
+先运行与改动最接近的检查,再扩大范围。例如只改 Docs:
```bash
-cat .env # or .env.worktree
+pnpm --filter @multica/docs typecheck
```
-Look for `POSTGRES_DB`, `DATABASE_URL`, `PORT`, `FRONTEND_PORT`.
-
-### List All Local Databases
+共享前端改动:
```bash
-docker compose exec -T postgres psql -U multica -d postgres \
- -At -c "select datname from pg_database order by datname;"
+pnpm typecheck
+pnpm test
```
-### Destructive Reset
+Backend 改动:
-Stop PostgreSQL and keep local databases:
+```bash
+make test
+```
+
+提交前运行:
```bash
-make db-down
+make check
```
-Reset only the current checkout's database (drops `POSTGRES_DB`, recreates it, re-runs all migrations). Other worktree databases are untouched.
+`make check` 会执行 TypeScript typecheck 与单元测试、Go 测试和 Playwright E2E。CI 还会按改动范围构建、lint,并运行平台或安装器专项测试。
+
+## 重置当前开发数据库
+
+需要干净数据时,可以重置**当前 checkout 在环境文件中指定的数据库**:
```bash
make stop
@@ -177,12 +182,18 @@ make db-reset
make start
```
-> `make db-reset` refuses to run if `DATABASE_URL` points at a remote host.
+`make db-reset` 会删除并重建当前 `POSTGRES_DB`,且会拒绝连接远程数据库。操作前检查 `.env` 或 `.env.worktree`,确认目标数据库正确。
-Wipe all local PostgreSQL data:
+## 提交前检查
-```bash
-docker compose down -v
-```
+- 阅读根目录 `CLAUDE.md` 和相关子目录说明;
+- 只修改当前任务需要的范围;
+- 代码注释使用英文;
+- 不提交 `.env`、令牌、构建产物或本机路径;
+- 使用 `feat(scope)`、`fix(scope)`、`docs` 等 conventional commit;
+- 在 PR 中写清行为变化和实际运行的验证命令。
+
+## 接下来
-> **Warning:** This deletes the shared Docker volume and all databases. After that you must run `make setup-main` or `make setup-worktree` again.
+- [开发规范](/developers/conventions) — 命名、术语和中文文案的仓库契约。
+- [项目架构](/developers/architecture) — 分层、共享包和一次执行的代码路径。
diff --git a/apps/docs/content/docs/developers/conventions.ja.mdx b/apps/docs/content/docs/developers/conventions.ja.mdx
index 19853b3419..27a35d8292 100644
--- a/apps/docs/content/docs/developers/conventions.ja.mdx
+++ b/apps/docs/content/docs/developers/conventions.ja.mdx
@@ -35,8 +35,9 @@ Multica のコードを書く、翻訳を変更する、あるいは中国語の
| `packages/views` | `core/`, `ui/` | `next/*`, `react-router-dom`, stores |
| `apps/web/platform/` | `next/*` | 他のアプリ |
| `apps/desktop/.../platform/` | `react-router-dom`, electron | 他のアプリ |
+| `apps/mobile/` | `@multica/core` の型と純粋関数 | Web/Desktop の React ページ、store、プラットフォーム実装 |
-両方のアプリに同じロジックが現れる場合は、必ず共有パッケージに抽出しなければなりません。「ささいな」重複という例外はありません。
+両方のアプリに同じロジックが現れる場合は、必ず共有パッケージに抽出しなければなりません。「ささいな」重複という例外はありません。Mobile は独自の UI、データ層、リリースフローを持ち、型と純粋関数だけを共有します。
### ファイルとコンポーネント
@@ -53,6 +54,8 @@ Multica のコードを書く、翻訳を変更する、あるいは中国語の
- 外部キー: `<table>_id`
- ブール値: `is_<state>` または `<state>_at`(状態変更にはタイムスタンプ形式を推奨)
- マイグレーションファイル: `NNN_descriptive_name.up.sql` + `.down.sql` — 常に双方向を提供する
+- データベースの foreign key、cascade delete、cascade update は作成せず、関係の検証とクリーンアップをアプリケーション層で行う
+- すべてのインデックスで `CREATE INDEX CONCURRENTLY` または `CREATE UNIQUE INDEX CONCURRENTLY` を使用し、各 concurrent index を 1 文だけの migration ファイルに分ける
### Go
@@ -68,6 +71,13 @@ Multica のコードを書く、翻訳を変更する、あるいは中国語の
- 列挙: string literal union を推奨し、ランタイムで反復処理が必要な場合にのみ `enum` を使用。
- TanStack Query のキー: `<feature>/queries.ts` 内のファクトリ関数、例: `issueKeys.detail(id)`。
+### API 境界
+
+- ネットワークレスポンスは `packages/core/api/schema.ts` の `parseWithFallback` と zod schema で解析し、`as T` で直接キャストしない
+- endpoint を追加または変更するときは schema も更新し、フィールド欠落や形式不正をテストで網羅する
+- 下流 UI は任意フィールドにデフォルト値を用意し、サーバー enum の `switch` には必ず `default` 分岐を設ける
+- インストール済みの Desktop がより新しい backend に接続する場合があるため、フロントエンドとバックエンドが常に同じバージョンだと仮定しない
+
### イシューキー
すべてのイシューには `MUL-123` のような人が読めるキーがあります。ワークスペースの `issue_prefix`(大文字と数字、通常 3 文字、最大 10 文字)+ 連番です。ワークスペースの admin は Settings → General で接頭辞を変更できますが、変更すると既存のすべてのイシューが番号を振り直されるため、古い接頭辞が埋め込まれた外部参照(PR タイトル、ブランチ名、ドキュメントやチャット内のリンク)は解決されなくなります。
diff --git a/apps/docs/content/docs/developers/conventions.ko.mdx b/apps/docs/content/docs/developers/conventions.ko.mdx
index af6a7c033b..940c04da71 100644
--- a/apps/docs/content/docs/developers/conventions.ko.mdx
+++ b/apps/docs/content/docs/developers/conventions.ko.mdx
@@ -35,8 +35,9 @@ Multica 코드를 작성하거나, 번역을 변경하거나, 중국어 제품
| `packages/views` | `core/`, `ui/` | `next/*`, `react-router-dom`, stores |
| `apps/web/platform/` | `next/*` | 다른 앱 |
| `apps/desktop/.../platform/` | `react-router-dom`, electron | 다른 앱 |
+| `apps/mobile/` | `@multica/core`의 유형과 순수 함수 | Web/Desktop의 React 페이지, store, 플랫폼 구현 |
-두 앱 모두에 동일한 로직이 나타난다면 반드시 공유 패키지로 추출해야 합니다. "사소한" 중복이라는 예외는 없습니다.
+두 앱 모두에 동일한 로직이 나타난다면 반드시 공유 패키지로 추출해야 합니다. "사소한" 중복이라는 예외는 없습니다. Mobile은 독립된 UI, 데이터 계층, 출시 절차를 가지며 유형과 순수 함수만 공유합니다.
### 파일과 컴포넌트
@@ -53,6 +54,8 @@ Multica 코드를 작성하거나, 번역을 변경하거나, 중국어 제품
- 외래 키: `<table>_id`
- 불리언: `is_<state>` 또는 `<state>_at` (상태 변경에는 타임스탬프 형태 선호)
- 마이그레이션 파일: `NNN_descriptive_name.up.sql` + `.down.sql` — 항상 양방향을 모두 제공
+- 데이터베이스 foreign key, cascade delete, cascade update를 만들지 않고 관계 검사와 정리는 애플리케이션 계층에서 수행
+- 모든 index는 `CREATE INDEX CONCURRENTLY` 또는 `CREATE UNIQUE INDEX CONCURRENTLY`를 사용하고 각 concurrent index를 단일 문장 migration 파일에 분리
### Go
@@ -68,6 +71,13 @@ Multica 코드를 작성하거나, 번역을 변경하거나, 중국어 제품
- 열거형: string literal union을 선호하고, 런타임 순회가 필요한 경우에만 `enum`을 사용.
- TanStack Query 키: `<feature>/queries.ts` 안의 팩토리 함수, 예: `issueKeys.detail(id)`.
+### API 경계
+
+- 네트워크 응답은 `packages/core/api/schema.ts`의 `parseWithFallback`과 zod schema로 parsing하며 `as T`로 직접 강제 변환하지 않음
+- endpoint를 추가하거나 변경할 때 schema도 업데이트하고 필드 누락 또는 잘못된 형식을 테스트로 포함
+- 하위 UI는 선택 필드에 기본값을 제공하고 서버 enum의 `switch`에는 반드시 `default` 분기를 포함
+- 설치된 Desktop이 더 새로운 backend에 연결될 수 있으므로 프런트엔드와 backend가 항상 같은 버전이라고 가정하지 않음
+
### 이슈 키
모든 이슈에는 `MUL-123` 같은 사람이 읽을 수 있는 키가 있습니다: 워크스페이스 `issue_prefix`(대문자와 숫자, 보통 3자, 최대 10자) + 일련번호. 워크스페이스 admin은 Settings → General에서 접두사를 변경할 수 있는데, 변경하면 기존의 모든 이슈가 다시 번호 매겨지므로 옛 접두사가 박혀 있는 외부 참조(PR 제목, 브랜치 이름, 문서와 채팅 속 링크)는 더 이상 연결되지 않습니다.
diff --git a/apps/docs/content/docs/developers/conventions.mdx b/apps/docs/content/docs/developers/conventions.mdx
index 574be1f9cc..a497e947be 100644
--- a/apps/docs/content/docs/developers/conventions.mdx
+++ b/apps/docs/content/docs/developers/conventions.mdx
@@ -35,8 +35,9 @@ The monorepo enforces strict package boundaries:
| `packages/views` | `core/`, `ui/` | `next/*`, `react-router-dom`, stores |
| `apps/web/platform/` | `next/*` | other apps |
| `apps/desktop/.../platform/` | `react-router-dom`, electron | other apps |
+| `apps/mobile/` | types and pure functions from `@multica/core` | Web/Desktop React pages, stores, and platform implementations |
-If logic appears in both apps, it MUST be extracted to a shared package. There are no exceptions for "small" duplication.
+If logic appears in both apps, it MUST be extracted to a shared package. There are no exceptions for "small" duplication. Mobile owns a separate UI, data layer, and release process; it shares only types and pure functions.
### Files and components
@@ -53,6 +54,8 @@ If logic appears in both apps, it MUST be extracted to a shared package. There a
- Foreign keys: `<table>_id`
- Booleans: `is_<state>` or `<state>_at` (timestamp form preferred for state changes)
- Migration files: `NNN_descriptive_name.up.sql` + `.down.sql` — always provide both directions
+- Do not create database foreign keys or use cascade deletes or updates; enforce relationships and cleanup in the application layer.
+- Every index must use `CREATE INDEX CONCURRENTLY` or `CREATE UNIQUE INDEX CONCURRENTLY`, with each concurrent index in its own single-statement migration file.
### Go
@@ -68,6 +71,13 @@ If logic appears in both apps, it MUST be extracted to a shared package. There a
- Enums: prefer string literal unions; reserve `enum` for runtime-iterable cases.
- TanStack Query keys: factory functions in `<feature>/queries.ts`, e.g. `issueKeys.detail(id)`.
+### API boundaries
+
+- Parse network responses with `parseWithFallback` and zod schemas from `packages/core/api/schema.ts`; do not cast them directly with `as T`.
+- When adding or changing an endpoint, update its schema and cover missing or malformed fields in tests.
+- Downstream UI must provide defaults for optional fields, and every `switch` over a server enum must include a `default` branch.
+- An installed Desktop client may connect to a newer backend; never assume that frontend and backend versions always match.
+
### Runtime display names
`AgentRuntime.name` is the daemon's raw technical name (e.g. `Codex (host)`); the user's alias lives in `custom_name`. User-visible copy must never render `runtime.name` directly — use the shared helpers so aliases and provider stay consistent (MUL-5248, #5260):
diff --git a/apps/docs/content/docs/developers/conventions.zh.mdx b/apps/docs/content/docs/developers/conventions.zh.mdx
index 77375d0179..a09e2cde8f 100644
--- a/apps/docs/content/docs/developers/conventions.zh.mdx
+++ b/apps/docs/content/docs/developers/conventions.zh.mdx
@@ -1,5 +1,5 @@
---
-title: 规范
+title: 开发规范
description: 代码命名规范、i18n 翻译术语表、中文风格指南的唯一权威来源。
---
@@ -35,8 +35,9 @@ monorepo 的包边界是硬约束:
| `packages/views` | `core/`、`ui/` | `next/*`、`react-router-dom`、stores |
| `apps/web/platform/` | `next/*` | 其他 app |
| `apps/desktop/.../platform/` | `react-router-dom`、electron | 其他 app |
+| `apps/mobile/` | `@multica/core` 的类型和纯函数 | Web/Desktop 的 React 页面、store 和平台实现 |
-两个 app 都有的逻辑,**必须**抽到共享包。"小段重复"也不算例外。
+Web 和 Desktop 都有的逻辑,**必须**抽到共享包。"小段重复"也不算例外。Mobile 拥有独立的 UI、数据层和发布流程,只共享类型与纯函数。
### 文件与组件
@@ -50,9 +51,11 @@ monorepo 的包边界是硬约束:
- 表名:`snake_case` 单数(`user`、`workspace`、`agent_runtime`)
- 字段:`snake_case`(`workspace_id`、`created_at`、`last_seen_at`)
-- 外键:`<table>_id`
+- 关联字段:`<table>_id`
- 布尔:`is_<state>` 或者 `<state>_at`(状态变化优先用时间戳形式)
- 迁移文件:`NNN_descriptive_name.up.sql` + `.down.sql`,**永远写双向**
+- 不创建数据库 foreign key,也不使用级联删除或级联更新;关系校验和清理由应用层完成
+- 所有索引都使用 `CREATE INDEX CONCURRENTLY` 或 `CREATE UNIQUE INDEX CONCURRENTLY`,每条 concurrent index 单独占一个 migration 文件
### Go
@@ -68,6 +71,13 @@ monorepo 的包边界是硬约束:
- 枚举:优先用 string literal union,需要 runtime 迭代时才用 `enum`
- TanStack Query key:用 `<feature>/queries.ts` 里的工厂函数,例如 `issueKeys.detail(id)`
+### API 边界
+
+- 网络响应必须用 `packages/core/api/schema.ts` 中的 `parseWithFallback` 和 zod schema 解析,不能直接 `as T`
+- 新增或修改 endpoint 时,同步更新 schema,并覆盖字段缺失或格式错误的测试
+- 下游 UI 对可选字段提供默认值;服务端枚举的 `switch` 必须有 `default` 分支
+- 已安装的 Desktop 可能连接更新的 backend,不能假设前后端永远同版本
+
### Runtime 显示名
`AgentRuntime.name` 是 daemon 的原始技术名(例如 `Codex (host)`),用户别名在 `custom_name`。用户可见文案不得直接渲染 `runtime.name`,要用共享 helper,保证别名和 provider 一致(MUL-5248、#5260):
@@ -81,7 +91,7 @@ monorepo 的包边界是硬约束:
### Issue 编号
-每个 issue 有人类可读的编号,比如 `MUL-123`:工作区 `issue_prefix`(大写字母和数字,通常 3 个字符,最长 10 个)+ 流水号。工作区管理员可以在 Settings → General 中修改前缀;修改会让所有现有 issue 重新编号,外部引用——PR 标题、分支名、文档与聊天里的链接——里的旧前缀会失效。
+每个 issue 有人类可读的编号,比如 `MUL-123`:工作区 `issue_prefix`(大写字母和数字,通常 3 个字符,最长 10 个)+ 流水号。工作区管理员可以在**设置 → 通用**中修改前缀;修改会让所有现有 issue 重新编号,外部引用——PR 标题、分支名、文档与聊天里的链接——里的旧前缀会失效。
### 代码注释
@@ -113,13 +123,13 @@ Multica 的产品名词分两类:
| 场景 | 写法 | 例 |
| --- | --- | --- |
| **UI 短句 / 状态名 / 代码上下文** | 小写英文 | "排队中的 task"、"创建子 issue"、"为智能体注入 skill" |
-| **doc 标题 / 章节标题** | 首字母大写英文,**或**对应中文术语 | "Issue 与 project"、"Skills"、"执行任务" |
+| **doc 标题 / 章节标题** | 首字母大写英文,**或**对应中文术语 | "Issue 与项目"、"Skills"、"执行任务" |
| **doc 正文长篇讨论中作为主语** | 中文术语,首次出现配括号英文 | "**执行任务**(task)是智能体每一次工作的单位" |
| **API / DB 字段** | 永远 `task` / `issue` / `skill` | `task_id`、`issue_status`、`skill_uuid` |
中文术语对照:
-- `task` ↔ `执行任务`(上下文清楚后可简写为「任务」)
+- `task` ↔ `执行任务`(上下文清楚后可简写为"任务")
- `issue` 没有公认中文译法 —— 保留英文;标题可大写为 `Issue`
- `skill` 没有公认中文译法 —— 保留英文;标题可大写为 `Skills`
@@ -127,8 +137,8 @@ Multica 的产品名词分两类:
- **`issue` / `task`**:dev 团队习惯说英文,"任务"在中文里和"工作"几乎同义太空泛,"工单"是 IT 工单语义,"议题"是 GitHub 风格但用户场景不匹配 —— 三个候选都不如 `issue` 准确。**但**在长篇 doc 正文里,重复 50 次 `task` 节奏不顺,所以正文允许用 `执行任务`,UI 短句、状态名仍保持小写英文。
- **`skill`**:Multica 特有概念,没有公认中文译法。
-- **`project` 翻成「项目」**:中文里早就稳定的日常词。飞书 / Tower / Teambition / PingCode / GitHub Projects 中文版 0 例外都翻译成「项目」,没有产品保留 `project`。
-- **`autopilot` 翻成「自动化」**:autopilot 在中文里联想到特斯拉的「自动驾驶」,跟产品功能(按周期跑 task)对应不上。Notion / 飞书都用「自动化」,是行业共识。
+- **`project` 翻成"项目"**:中文里早就稳定的日常词。飞书 / Tower / Teambition / PingCode / GitHub Projects 中文版 0 例外都翻译成"项目",没有产品保留 `project`。
+- **`autopilot` 翻成"自动化"**:autopilot 在中文里联想到特斯拉的"自动驾驶",跟产品功能(按周期跑 task)对应不上。Notion / 飞书都用"自动化",是行业共识。
### 完整翻译 —— 概念词
diff --git a/apps/docs/content/docs/developers/meta.ja.json b/apps/docs/content/docs/developers/meta.ja.json
index 8aa903186c..5614db6d09 100644
--- a/apps/docs/content/docs/developers/meta.ja.json
+++ b/apps/docs/content/docs/developers/meta.ja.json
@@ -1,4 +1,4 @@
{
"title": "開発者",
- "pages": ["conventions"]
+ "pages": ["contributing", "architecture", "conventions"]
}
diff --git a/apps/docs/content/docs/developers/meta.json b/apps/docs/content/docs/developers/meta.json
index 8aa9ab8c10..a3ecbd2741 100644
--- a/apps/docs/content/docs/developers/meta.json
+++ b/apps/docs/content/docs/developers/meta.json
@@ -1,4 +1,4 @@
{
"title": "Developers",
- "pages": ["conventions"]
+ "pages": ["contributing", "architecture", "conventions"]
}
diff --git a/apps/docs/content/docs/developers/meta.ko.json b/apps/docs/content/docs/developers/meta.ko.json
index 8aa9ab8c10..d95df05b56 100644
--- a/apps/docs/content/docs/developers/meta.ko.json
+++ b/apps/docs/content/docs/developers/meta.ko.json
@@ -1,4 +1,4 @@
{
- "title": "Developers",
- "pages": ["conventions"]
+ "title": "개발자",
+ "pages": ["contributing", "architecture", "conventions"]
}
diff --git a/apps/docs/content/docs/developers/meta.zh.json b/apps/docs/content/docs/developers/meta.zh.json
index a3ecbd2741..3ef38e535e 100644
--- a/apps/docs/content/docs/developers/meta.zh.json
+++ b/apps/docs/content/docs/developers/meta.zh.json
@@ -1,4 +1,4 @@
{
- "title": "Developers",
+ "title": "参与开发",
"pages": ["contributing", "architecture", "conventions"]
}
diff --git a/apps/docs/content/docs/environment-variables.ja.mdx b/apps/docs/content/docs/environment-variables.ja.mdx
index 739d7bdcf7..399135f932 100644
--- a/apps/docs/content/docs/environment-variables.ja.mdx
+++ b/apps/docs/content/docs/environment-variables.ja.mdx
@@ -1,287 +1,267 @@
---
title: 環境変数
-description: セルフホストの Multica サーバーを実行するための環境変数の完全な一覧です。
+description: セルフホスト Multica でよく使うサーバー、ストレージ、連携、ランタイムの設定。
---
import { Callout } from "fumadocs-ui/components/callout";
-セルフホストの Multica [サーバー](/self-host-quickstart)は、起動時に環境変数から設定を読み込みます — データベース、サインイン、メール、ストレージ、サインアップ許可リストはすべてここにあります。このページでは、すべての変数を用途別にグループ化しています。各セクションでは、**設定しないと何が起きるか**、そして**プロダクションで必ず設定すべきものはどれか**を明確に説明します。auth 関連の変数を実際にどう設定するかについては、[サインインとサインアップの設定](/auth-setup)を参照してください。
+Multica はプロセス起動時に環境変数を読み込みます。変更後は、該当する API・Web・デーモンのプロセスを再起動してください。Docker Compose の `docker compose restart` は `.env` を再読み込みしません。`up -d` でコンテナを再作成して初めて反映されます。
-## コアサーバー変数
+このページにはデプロイ運用者向けの設定のみを載せています。テスト用変数や内部タスク用の変数は扱いません。グループ別のリファレンスとして使い、完全なデプロイ手順は[セルフホストクイックスタート](/self-host-quickstart)を参照してください。
-デプロイ前に必ず検討すべきコア変数です — 一部はサーバーを起動できるようにするデフォルト値を持っていますが、プロダクションでは必須項目を明示的に設定すべきです。
+## プロダクションの最小構成
-| 変数 | デフォルト | プロダクションで必須? |
-|---|---|---|
-| `DATABASE_URL` | `postgres://multica:multica@localhost:5432/multica?sslmode=disable` | **はい** |
-| `PORT` | `8080` | いいえ(ポートを変更する場合を除く) |
-| `JWT_SECRET` | `multica-dev-secret-change-in-production` | **はい**(デフォルトは安全ではありません) |
-| `APP_ENV` | 空 | **はい**(`production` である必要があります) |
-| `FRONTEND_ORIGIN` | 空 | **はい**(セルフホストは自身のドメインを設定する必要があります) |
-| `MULTICA_DEV_VERIFICATION_CODE` | 空 | いいえ(プロダクションでは必ず空のままにしてください) |
-| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | いいえ。`SIGTERM`/`SIGINT` の受信後、グレースフルシャットダウンを開始する前の任意の待機時間。`300s` や `5m` などの非負の Go duration を受け付けます。空または `0` の場合は直ちにシャットダウンを開始します |
+```dotenv
+DATABASE_URL=postgres://user:password@postgres:5432/multica?sslmode=require
+JWT_SECRET=<long-random-secret>
+APP_ENV=production
+FRONTEND_ORIGIN=https://multica.example.com
+MULTICA_APP_URL=https://multica.example.com
+MULTICA_PUBLIC_URL=https://api.multica.example.com
+```
-Kubernetes で `MULTICA_SHUTDOWN_HOLD_DURATION` を使用する場合、`terminationGracePeriodSeconds` は hold 時間とその後のグレースフルシャットダウン時間の合計より長く設定してください。両方を同じ時間にすると、クリーンアップが完了する前に kubelet が `SIGKILL` を送信する可能性があります。
+さらにメールサービスを 1 つ選ぶ必要があります。選ばない場合、認証コードと招待はサーバーログに書き込まれるだけです。
<Callout type="warning">
-**プロダクションでは `MULTICA_DEV_VERIFICATION_CODE` を空のままにしてください。** 固定のローカルテストコードはデフォルトで無効になっていますが、`MULTICA_DEV_VERIFICATION_CODE=888888` で有効にすると、`APP_ENV` が production 以外の間は、コードを要求できる誰もがその固定値でサインインできてしまいます。このショートカットは `APP_ENV=production` のときには無視されます。
+プロダクションでデフォルトの `JWT_SECRET` を使わないでください。`MULTICA_DEV_VERIFICATION_CODE` も設定しないでください。
</Callout>
-### データベース接続プール
+## API とデータベース
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `DATABASE_MAX_CONNS` | `25` | pgxpool の最大接続数。デーモンは頻繁に(3 秒ごとに)ポーリングして接続を使用するため、規模の大きいデプロイではより高い値が必要になる場合があります |
-| `DATABASE_MIN_CONNS` | `5` | 最小アイドル接続数 |
+| `DATABASE_URL` | ローカルの `multica` データベース | PostgreSQL 接続文字列 |
+| `DATABASE_MAX_CONNS` | `25` | API プロセスあたりの最大データベース接続数 |
+| `DATABASE_MIN_CONNS` | `5` | API プロセスが保持する最小接続数 |
+| `PORT` | `8080` | API のリッスンポート |
+| `JWT_SECRET` | 開発用の固定値 | ログイン JWT と一部の署名フローに使うシークレット |
+| `APP_ENV` | 空 | プロダクションでは `production` を設定 |
+| `AUTH_TOKEN_TTL` | `720h`(30 日) | ブラウザ JWT と cookie の有効期間。Go duration または正の整数秒を受け付けます |
+| `LOG_LEVEL` | アプリのデフォルト | ログレベル |
+| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | 終了シグナル受信後、グレースフルシャットダウンを開始するまでの待機時間 |
-**設定しない場合**、上記の値が使われます — 以前プロダクションでプール枯渇を引き起こした pgx 組み込みの 4/NumCPU デフォルトでは**ありません**。
+Kubernetes で shutdown hold を設定する場合、`terminationGracePeriodSeconds` は hold と実際のシャットダウンにかかる時間の合計より大きくしてください。
-## メール設定
-
-Multica は 2 つの配信バックエンドをサポートします — クラウドデプロイ向けの [Resend](https://resend.com/) と、内部 / オンプレミスネットワーク向けの SMTP relay です。両方が設定されている場合は `SMTP_HOST` が `RESEND_API_KEY` より優先されます。
-
-### Resend
+## 公開アドレスとブラウザアクセス
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `RESEND_API_KEY` | 空 | Resend API key |
-| `RESEND_FROM_EMAIL` | `[email protected]` | Resend の送信元アドレス(Resend アカウントで検証済みのドメインである必要があります)。`SMTP_FROM_EMAIL` が未設定の場合、SMTP でも使われます |
+| `FRONTEND_ORIGIN` | 空 | ユーザーがアクセスするフロントエンドの origin。CORS、cookie、招待リンクに使われます |
+| `MULTICA_APP_URL` | `FRONTEND_ORIGIN` にフォールバック | ユーザーが到達できる Web アドレス。CLI ログインとアカウント連携リンクが使います |
+| `MULTICA_PUBLIC_URL` | 空 | 公開 API アドレス。webhook URL とランタイム接続案内に使われます |
+| `CORS_ALLOWED_ORIGINS` | 空 | 追加で許可する HTTP origin。カンマ区切り |
+| `ALLOWED_ORIGINS` | CORS / フロントエンド設定にフォールバック | WebSocket origin の許可リスト。カンマ区切り |
+| `COOKIE_DOMAIN` | 空 | フロントエンドと API の host が異なり、ブラウザが API ドメインへ直接アクセスする場合は必須。単一ドメイン構成では空のまま |
-### SMTP relay
+フロントエンドと API が異なる host を使い、ブラウザが API ドメインへ直接アクセスする構成では、`COOKIE_DOMAIN` の設定が必須です。設定しないとブラウザが CSRF cookie を読めず、すべての書き込みリクエストが `403 CSRF validation failed` を返す一方、読み取りは正常に動きます。値には、両方の host を同時にカバーできる最も狭い親ドメインを使ってください(`.example.com` より `.agent.example.com`)。この設定はログインセッション cookie をそのドメイン配下のすべての host に広げるため、それらの host がすべて同一の信頼できる運用主体のものである場合にのみ使えます。変更後は両方の host で古い cookie を削除し、再ログインしてください。[セルフホストクイックスタート](/self-host-quickstart#3-アクセス方法を選ぶ)の同一オリジン構成(ブラウザは app ドメインのみアクセス)に従う場合は、空のままで構いません。IP アドレスは指定しないでください。ブラウザは Domain が IP の cookie を無視します。
-| 変数 | デフォルト | 説明 |
-|---|---|---|
-| `SMTP_HOST` | 空 | SMTP relay のホスト名。これを設定すると SMTP モードが有効になり、Resend を上書きします |
-| `SMTP_PORT` | `25` | SMTP ポート。STARTTLS サブミッションには `587` を、SMTPS(暗黙的 TLS、自動有効化)には `465` を使用します |
-| `SMTP_USERNAME` | 空 | SMTP ユーザー名。認証なしの relay の場合は空のままにしてください |
-| `SMTP_PASSWORD` | 空 | SMTP パスワード |
-| `SMTP_FROM_EMAIL` | 空 | SMTP の `MAIL FROM` と `From:` に使う送信元アドレス。未設定の場合は `RESEND_FROM_EMAIL` にフォールバックします |
-| `SMTP_TLS` | `starttls` | TLS モード。`implicit`(別名 `smtps`、`ssl`)は接続時に即座に TLS ハンドシェイクを行います(SMTPS)。`465` ポートでは自動的に有効になります。未設定 / `starttls` の場合は接続後に STARTTLS でアップグレードします |
-| `SMTP_TLS_INSECURE` | `false` | TLS 証明書の検証をスキップするには `true` に設定(プライベート CA / 自己署名証明書のみ) |
-| `SMTP_EHLO_NAME` | マシンのホスト名 | relay に通知する EHLO/HELO 名。厳格な relay(例: Google Workspace `smtp-relay.gmail.com`)が公開 IP からのデフォルトの挨拶を拒否する場合は、実際の FQDN を設定してください — そうしないと relay が接続を切断し、後続のコマンドで不明瞭な `EOF` として表面化します |
-
-サーバーが STARTTLS を通知すると自動的にアップグレードされます。dial タイムアウトは 10 秒で、SMTP セッション全体には 30 秒のデッドラインがあるため、ブラックホール化した relay が auth ハンドラーをハングさせることはできません。
-
-**どちらも設定していない場合の動作**: サーバーはエラーを出しませんが、送信されるはずだったすべてのメール(検証コード、招待リンク)は**サーバーの stdout にのみ記録されます**。ローカル開発には便利です — サーバーログからコードをコピーして使ってください。**プロダクションでこれを設定し忘れると、静かなブラックホールが生まれ**、ユーザーはメールをまったく受け取れず、エラーも一切表面化しません。
-
-## Google OAuth 設定
-
-任意です。メール + 検証コードのみを使用する場合は設定しないままにし、サインインページに「Sign in with Google」を追加する場合は設定してください。
-
-| 変数 | デフォルト | 説明 |
-|---|---|---|
-| `GOOGLE_CLIENT_ID` | 空 | Google Cloud OAuth client ID |
-| `GOOGLE_CLIENT_SECRET` | 空 | Google Cloud OAuth secret |
-| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | OAuth コールバック URL(セルフホスト: 自身のフロントエンドドメインに置き換えてください) |
-
-**ランタイムで適用されます**: フロントエンドはこれらの設定をランタイムに `/api/config` 経由で読み込むため、**変更してもフロントエンドのリビルドや再デプロイは不要です** — サーバーを再起動すれば適用されます。
-
-完全なセットアップ(Google Cloud Console の手順を含む)は[サインインとサインアップの設定](/auth-setup#google-oauth-configuration)にあります。
-
-## ファイルストレージ設定
+<Callout type="warning">
+セルフホストのデプロイでは `FRONTEND_ORIGIN` の設定が必須です。設定しないと、招待リンク、cookie のセキュリティ属性、WebSocket の origin 検証が実際のドメインと食い違うおそれがあります。
+</Callout>
-Multica はユーザーがアップロードした添付ファイル(コメント内の画像やファイル)を保存します。**S3 が推奨されます**。S3 が設定されていない場合はローカルディスクにフォールバックします。
+## メールとログイン
-### S3 / S3 互換ストレージ
+### Resend
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `S3_BUCKET` | 空 | **バケット名のみ**(例: `my-bucket`)。`.s3.<region>.amazonaws.com` サフィックスは含め**ないでください** — サーバーが `S3_BUCKET` + `S3_REGION` から公開ホストを構築します。これを設定すると S3 ストレージが有効になります |
-| `S3_REGION` | `us-west-2` | AWS リージョン。バケットの実際のリージョンと一致する必要があります — SDK 署名と公開 URL の構築の両方に使われます |
-| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | 空 | 静的な認証情報。両方を設定しない場合は AWS SDK のデフォルト認証情報チェーン(IAM role / 環境認証情報)が使われます |
-| `AWS_ENDPOINT_URL` | 空 | カスタムの S3 互換エンドポイント(例: [MinIO](https://min.io/))。これを設定すると path-style URL に切り替わります |
-| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | 添付ファイルのダウンロード方式: `auto`、`cloudfront`、`presign`、`proxy`。`auto` では CloudFront が完全に設定されている場合は優先し、内部/プライベート endpoint host は server proxy、公開 S3 互換 endpoint は対応時に presigned GET を使います |
-| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | CloudFront signed URL と S3 presigned download URL の有効期間。Go duration 形式を受け付けます |
-
-**`S3_BUCKET` を設定しない場合**: サーバーは起動時に `"S3_BUCKET not set, cloud upload disabled"` をログに記録し、すべてのアップロードはローカルディスクにフォールバックします。
-
-**保存されるオブジェクト URL** は次の優先順位で構築されます。
+| `RESEND_API_KEY` | 空 | 設定すると Resend が有効になります |
+| `RESEND_FROM_EMAIL` | `[email protected]` | 送信元アドレス。検証済みドメインに属している必要があります |
-1. `CLOUDFRONT_DOMAIN` が設定されている場合は `https://<CLOUDFRONT_DOMAIN>/<key>`。
-2. `AWS_ENDPOINT_URL` が設定されている場合は `<AWS_ENDPOINT_URL>/<S3_BUCKET>/<key>`(path-style)。
-3. `https://<S3_BUCKET>.s3.<S3_REGION>.amazonaws.com/<key>`(virtual-hosted-style)。`S3_BUCKET` にドットが含まれる場合、AWS が発行するワイルドカード TLS 証明書がドットを含むバケットホストを検証できないため、サーバーは `https://s3.<S3_REGION>.amazonaws.com/<S3_BUCKET>/<key>`(path-style)にフォールバックします。
+### SMTP
-API の `download_url` は、CloudFront 署名が設定されていない場合 `GET /api/attachments/{id}/download` を使います。この endpoint は安全な場合 CloudFront/S3 presigned URL にリダイレクトし、`http://rustfs:9000` のようなプライベート/内部 endpoint では server がストリーミングします。Docker/VPC 内部のオブジェクトストアでは `ATTACHMENT_DOWNLOAD_MODE=proxy` を明示できます。
-
-### ローカルディスク(S3 が設定されていない場合)
+`SMTP_HOST` が空でない限り、SMTP が Resend より優先されます。
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `LOCAL_UPLOAD_DIR` | `./data/uploads` | ローカルストレージのディレクトリ |
-| `LOCAL_UPLOAD_BASE_URL` | 空(相対パスを返します) | 公開 base URL — 設定しないとフロントエンドが添付ファイルの完全な URL を解決できません |
-
-### CloudFront(任意)
-
-S3 の前段に CloudFront を置く場合、3 つの変数が適用されます: `CLOUDFRONT_DOMAIN`、`CLOUDFRONT_KEY_PAIR_ID`、`CLOUDFRONT_PRIVATE_KEY`(または Secrets Manager から読み込むには `CLOUDFRONT_PRIVATE_KEY_SECRET`)。CloudFront を使わない場合はスキップしてください — S3 設定とは競合しません。
+| `SMTP_HOST` | 空 | SMTP ホスト。設定すると SMTP が有効になります |
+| `SMTP_PORT` | `25` | よく使う値: 25、587、465 |
+| `SMTP_USERNAME` | 空 | ユーザー名。匿名 relay では空のまま |
+| `SMTP_PASSWORD` | 空 | パスワード |
+| `SMTP_FROM_EMAIL` | `RESEND_FROM_EMAIL` にフォールバック | Envelope From とメールの From |
+| `SMTP_TLS` | `starttls` | `implicit`、`smtps`、`ssl` は暗黙的 TLS を意味します。465 では自動的に有効 |
+| `SMTP_TLS_INSECURE` | `false` | 証明書検証をスキップ。信頼できる内部ネットワーク専用 |
+| `SMTP_EHLO_NAME` | ホスト名 | 厳格な relay が要求する EHLO/FQDN |
-### Cookie ドメイン
+### Google OAuth
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `COOKIE_DOMAIN` | 空 | セッション cookie のスコープ |
+| `GOOGLE_CLIENT_ID` | 空 | Google OAuth client ID |
+| `GOOGLE_CLIENT_SECRET` | 空 | Google OAuth client secret |
+| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | Google Console のコールバックアドレスと完全に一致している必要があります |
-- **空**: cookie は訪問した正確なホストでのみ有効です(単一ホストのデプロイに適切)
-- **`.example.com` に設定**: cookie がサブドメイン間で共有されます(そのため `app.example.com` と `api.example.com` がサインインセッションを共有します)
-- **フロントエンドとバックエンドが別のホストにある場合は任意ではなく必須です**: ブラウザがページ自身の origin から `multica_csrf` cookie を読める必要があり、読み取りは動作したまま書き込みリクエストがすべて `403 CSRF validation failed` で失敗します
-- 両方のホストを含む**最も狭い**親ドメインを使ってください(`.example.com` ではなく `.agent.example.com`)。この値は `multica_auth` セッション cookie もそのドメイン配下のすべてのホストに広げるため、それらがすべて同一の信頼できる主体によって運用されている場合にのみこの構成を使ってください — 詳細な設定は [Self-Hosting](/getting-started/self-hosting) を参照してください
-- 警告: IP アドレスにはできません(ブラウザは無視します)
-
-## 誰がサインアップできるかを制限する
-
-3 つの許可リストの層が優先順位に従って組み合わされます。**いずれか 1 つの層でも空でない値に設定されると、一致しないメールは拒否されます** — `ALLOW_SIGNUP=true` でさえこれを上書きできません。
+### サインアップ範囲
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `ALLOWED_EMAILS` | 空 | 明示的なメール許可リスト(カンマ区切り)。空でない場合、リストにあるメールのみがサインアップできます |
-| `ALLOWED_EMAIL_DOMAINS` | 空 | ドメイン許可リスト(カンマ区切り)。空でない場合、リストにあるドメインのみがサインアップできます |
-| `ALLOW_SIGNUP` | `true` | サインアップのマスタースイッチ。サインアップを完全に無効にするには `false` に設定 |
+| `ALLOW_SIGNUP` | `true` | allowlist が一つも設定されていない場合に新規登録を許可するか |
+| `ALLOWED_EMAILS` | 空 | 登録を許可する完全なメールアドレス。カンマ区切り |
+| `ALLOWED_EMAIL_DOMAINS` | 空 | 登録を許可するメールドメイン。カンマ区切り |
+| `DISABLE_WORKSPACE_CREATION` | `false` | すべてのユーザーのワークスペース新規作成を禁止。owner/admin の例外はありません |
+| `MULTICA_DEV_VERIFICATION_CODE` | 空 | 非 production 環境で使う固定 6 桁のテスト認証コード |
-**直感に反する部分**: `ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true` は「company.io または全員を許可」という意味では**なく**、**company.io のみを許可**という意味です。許可リストの層は AND セマンティクスです — 完全な決定木は[サインインとサインアップの設定 → サインアップ許可リスト](/auth-setup#restricting-who-can-sign-up)にあります。
+allowlist の正確な判定順序は[ログインとサインアップ](/auth-setup#サインアップ制限)を参照してください。
-**招待フロー自体はサインアップ許可リストをチェックしません** — ただし、招待された人は招待を承諾する前に依然として**サインイン**できる必要があります。すでに Multica アカウントを持っている場合(例: 別のワークスペースから)、許可リストの影響を受けずに直接承諾できます。**一度もサインアップしたことがない場合**、サインインの最初のステップ(検証コードの要求)は依然として許可リストのチェックを通過し、`ALLOW_SIGNUP=false` や `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS` によって拒否されたメールは**サインアップを完了できず、したがって招待を承諾できません**。
+## 添付ファイルストレージ
-## ワークスペース作成をロックダウンする
+`S3_BUCKET` が未設定の場合、Multica はローカルディスクを使います。
-`ALLOW_SIGNUP=false` は新しいアカウントをブロックしますが、すでにサインイン済みのユーザーが `POST /api/workspaces` 経由で別のワークスペースを作成することは**ブロックしません**。すべてのイシュー、リポジトリ、エージェントがプラットフォーム管理者に見えなければならないセルフホストインスタンスでは、そのギャップを塞ぐために `DISABLE_WORKSPACE_CREATION=true` を設定してください。
+### S3 または互換ストレージ
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `DISABLE_WORKSPACE_CREATION` | `false` | `true` の場合、`POST /api/workspaces` へのすべての呼び出しが `403 workspace creation is disabled for this instance` を返します。Web UI は `/api/config` 経由ですべての「ワークスペース作成」要素を非表示にします。役割 / owner の例外はありません — このゲートはインスタンス単位で全体に適用されます |
-
-推奨されるブートストラップ手順:
-
-1. `DISABLE_WORKSPACE_CREATION` を設定しないまま(デフォルト)インスタンスを起動します。
-2. 管理者としてサインインし、共有ワークスペースを作成します。
-3. `DISABLE_WORKSPACE_CREATION=true` を設定してバックエンドを再起動します。この時点から、ユーザーは招待によってのみ参加できます。
+| `S3_BUCKET` | 空 | バケット名。完全な hostname は指定しないでください |
+| `S3_REGION` | `us-west-2` | バケットのあるリージョン |
+| `AWS_ACCESS_KEY_ID` | SDK デフォルトの資格情報チェーン | 静的な access key |
+| `AWS_SECRET_ACCESS_KEY` | SDK デフォルトの資格情報チェーン | 静的な secret key |
+| `AWS_ENDPOINT_URL` | 空 | MinIO などの S3 互換 endpoint |
+| `S3_USE_PATH_STYLE` | カスタム endpoint 時は `true` | path-style アドレスを使うか |
+| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | `auto`、`cloudfront`、`presign`、`proxy` |
+| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | 署名付きダウンロード URL の有効期間 |
-招待されたユーザーが最初の検証コードでサインアップを完了できるよう `ALLOW_SIGNUP=true` を維持したい場合は、`DISABLE_WORKSPACE_CREATION=true` を `ALLOWED_EMAIL_DOMAINS` / `ALLOWED_EMAILS` と組み合わせて、どのアドレスがサインアップできるかの範囲を指定してください。`ALLOW_SIGNUP=false` を設定すると、保留中の招待対象者がアカウントを作成すること自体も追加でブロックされます — すべてのメンバーがすでに Multica アカウントを持っているインスタンスでのみ有用です。
+内部ネットワークの MinIO など、ブラウザから endpoint に直接到達できない場合は `ATTACHMENT_DOWNLOAD_MODE=proxy` を使ってください。
-## レート制限(任意の Redis)
-
-公開 auth エンドポイント — `/auth/send-code`、`/auth/verify-code`、`/auth/google` — の前段には、IP ごとの固定ウィンドウのレート制限があります。リミッターは Redis によって支えられています。`REDIS_URL` を設定しない場合、ミドルウェアは **no-op**(fail-open)になり、バックエンドは起動時に `rate limiting disabled: REDIS_URL not configured` をログに記録します。
+### ローカルディスク
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `REDIS_URL` | 空 | Redis 接続 URL(例: `redis://localhost:6379/0`)。設定しないと auth エンドポイントのレート制限が無効になります。同じ Redis はリアルタイムハブの fan-out、PAT キャッシュ、デーモントークンキャッシュでも使われます — 設定しない場合はすべてインメモリ / 直接 DB モードにフォールバックします |
-| `REDIS_DISABLE_CLIENT_NAME` | `false` | `true` に設定すると、すべての Redis 接続で `CLIENT SETNAME` ハンドシェイクをスキップします。`CLIENT` コマンドをブロックするマネージド Redis プロバイダー(GCP Memorystore や ACL 制限付きの AWS ElastiCache など)を使用する場合に**必須**です。有効にすると `CLIENT LIST` 出力で接続の説明的な名前が失われますが、制限付きプロバイダーとの互換性が得られます |
-| `RATE_LIMIT_AUTH` | `5` | `/auth/send-code` および `/auth/google` に対する IP あたり毎分の最大リクエスト数 |
-| `RATE_LIMIT_AUTH_VERIFY` | `20` | `/auth/verify-code` に対する IP あたり毎分の最大リクエスト数 |
-| `RATE_LIMIT_TRUSTED_PROXIES` | 空 | リミッターがその `X-Forwarded-For` ヘッダーを信頼することを許可する、カンマ区切りの CIDR。空(デフォルト)は **XFF を決して信頼しない**ことを意味します — リミッターは直接接続の `RemoteAddr` のみを使用します |
+| `LOCAL_UPLOAD_DIR` | `./data/uploads` | ファイルと metadata の保存ディレクトリ。永続ボリュームが必要です |
+| `LOCAL_UPLOAD_BASE_URL` | 空 | 任意の公開 base URL。空の場合はアプリ内の相対アドレスを返します |
-リクエストが制限を超えると、サーバーは `429 Too Many Requests`、`Retry-After: 60`、そして本文 `{"error":"too many requests"}` で応答します。
+### CloudFront
-<Callout type="warning">
-**リバースプロキシの背後では `RATE_LIMIT_TRUSTED_PROXIES` を必ず設定する必要があります。** そうしないと、バックエンドの観点ではすべての実際のユーザーがプロキシの IP を共有することになり、デプロイ全体が 1 つのバケットに入り、`/auth/send-code` がサイト全体で毎分 5 リクエストになってしまいます。一般的な値: 同一ホストの Caddy / Nginx には `127.0.0.1/32,::1/128`、Cloudflare / ALB / CloudFront には該当 CDN が公開している IP 範囲。`RemoteAddr` がこれらの CIDR のいずれかに含まれる IP のみが、`X-Forwarded-For` を使ってクライアントを識別できます。
-</Callout>
+| 変数 | 説明 |
+|---|---|
+| `CLOUDFRONT_DOMAIN` | CDN ドメイン |
+| `CLOUDFRONT_KEY_PAIR_ID` | CloudFront key pair ID |
+| `CLOUDFRONT_PRIVATE_KEY` | 完全な秘密鍵 |
+| `CLOUDFRONT_PRIVATE_KEY_SECRET` | Secrets Manager から秘密鍵を読み込む場合に使用 |
-この独立した `RATE_LIMIT_TRUSTED_PROXIES` は、オートパイロット webhook リミッター(`/api/webhooks/autopilots/{token}`)を制御する `MULTICA_TRUSTED_PROXIES` とは**異なります**。各リミッターは自身のリストをパースするため、プロキシの背後にあるデプロイは両方を設定すべきです。
-
-## デーモンのチューニングパラメータ
-
-デーモンはユーザーのローカルマシン上で実行され、その設定もローカル環境変数から読み込まれます。一般的なものは次のとおりです。
+## Redis とレート制限
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | サーバーアドレス(セルフホスト: 自身のドメインに置き換えてください) |
-| `MULTICA_DAEMON_DEVICE_NAME` | ホスト名 | Runtimes 画面に表示されるデバイス名 |
-| `MULTICA_AGENT_RUNTIME_NAME` | 組み込みデフォルト | ランタイムの表示名 |
-| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | ハートビート間隔 |
-| `MULTICA_DAEMON_POLL_INTERVAL` | `3s` | タスクのポーリング間隔 |
-| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | 最大同時タスク数 |
-| `MULTICA_AGENT_TIMEOUT` | `0` | エージェント実行あたりの絶対壁時計上限。`0` は上限なしを意味し、実行時間は inactivity watchdog のみで抑えられます。ハードなリソース/コスト上限が欲しい場合は正の Go 期間を設定してください |
-| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex 固有の inactivity watchdog の待ち時間 |
-| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex `app-server` 起動 RPC のタイムアウト |
-| `MULTICA_DAEMON_AUTO_UPDATE` | cloud: `true`, self-host: `false` | `false`/`0`/`no`/`off` でデーモンの CLI 自動アップデートを無効化。`true`/`1`/`yes`/`on` はセルフホストのデーモンにアップストリーム更新を購読させます |
-| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | デーモンが CLI の新リリースを GitHub でチェックする間隔 |
-| `MULTICA_<PROVIDER>_PATH` | CLI 名に一致 | 各 AI コーディングツールの実行ファイルへのパス(例: `MULTICA_CLAUDE_PATH`) |
-| `MULTICA_<PROVIDER>_MODEL` | 空 | 各 AI コーディングツールのデフォルトモデル |
-| `MULTICA_<PROVIDER>_ARGS` | 空 | バックエンドごとのデーモン全体のデフォルト CLI 引数。各タスクに対し、各エージェント自身の `custom_args` より前に適用される。`MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS` をサポート |
+| `REDIS_URL` | 空 | 認証レート制限、リアルタイムイベント、token cache に使用。未設定の場合、リアルタイムイベントはプロセス内メモリにフォールバックし、認証レート制限は無効になります |
+| `REDIS_DISABLE_CLIENT_NAME` | `false` | マネージド Redis が `CLIENT SETNAME` を禁止している場合に `true` を設定 |
+| `RATE_LIMIT_AUTH` | `5` | 認証コード送信または Google ログイン開始の、IP あたり毎分の回数 |
+| `RATE_LIMIT_AUTH_VERIFY` | `20` | 認証コード検証の、IP あたり毎分の回数 |
+| `RATE_LIMIT_TRUSTED_PROXIES` | 空 | `X-Forwarded-For` の提供を許可するプロキシ CIDR。カンマ区切り |
+| `MULTICA_TRUSTED_PROXIES` | 空 | オートパイロット webhook とリアルタイム接続が使う信頼済みプロキシ CIDR |
-### デーモン設定を `config.json` に永続化する
+リバースプロキシ配下のデプロイでは、実際のプロキシのネットワーク範囲を設定してください。すべての送信元を無条件に信頼してはいけません。クライアントが転送元 IP を偽装できてしまいます。
-上表の各デーモンキー — `device_name`、`runtime_name`、`max_concurrent_tasks`、`poll_interval`、`heartbeat_interval`、`agent_timeout`、`codex_semantic_inactivity_timeout`、`codex_handshake_timeout`、`disable_auto_update`、`auto_update_check_interval` — は、プロファイルの `~/.multica/config.json`(もしくは `~/.multica/profiles/<name>/config.json`)に永続化することもできます。これにより、`daemon start` のたびにフラグを再指定したり環境変数を export したりする必要がなくなります。
-
-```bash
-multica config set device_name my-vm-custom-name
-multica config set runtime_name worker-a
-multica config set max_concurrent_tasks 8
-multica config set poll_interval 10s # Go の期間、必ず > 0
-multica config set heartbeat_interval 30s
-multica config set agent_timeout 1h # 0s を渡すと壁時計上限を明示的に無効化
-multica config set codex_semantic_inactivity_timeout 15m
-multica config set codex_handshake_timeout 45s
-multica config set disable_auto_update true # 単方向: 自動アップデートを無効化する用途のみ
-multica config set auto_update_check_interval 12h
-```
+上記の `RATE_LIMIT_*` は `REDIS_URL` を設定した場合にのみ有効です。未設定の場合、起動ログに rate limiting disabled と表示されます。Redis が一時的に利用できないときは、レート制限はリクエストを通す側に倒れ、通常のログインを妨げません。
-期間系キーは正の Go 期間(`500ms`、`10s`、`1m30s` など)のみを受け付けます。`0s`、負値、パース不能な文字列は `config set` の時点で拒否されます。**ただし `agent_timeout` は例外で、ここでは `0s` は「壁時計上限を明示的に無効化する」意味を持つ有効値**です(負値はやはり拒否されます)。永続化した値をクリアして環境変数 / 組み込みデフォルトに戻すには空文字を渡してください: `multica config set poll_interval ""`。
+## 外部連携
-`disable_auto_update` は単方向のブール値です。`true` にするとデーモンの CLI 自動アップデートを無効化し、`false`(もしくは `""` でクリア)にすると判定を `MULTICA_DAEMON_AUTO_UPDATE` / cloud-vs-self-host のデフォルトに委ねます。config ファイルから自動アップデートを *強制的に有効化* することはできません。
-
-優先順位は上から順に: `daemon start` の `--flag` > `MULTICA_…` 環境変数 > `config.json` > 組み込みデフォルト。systemd unit などで環境変数を設定するとファイルより優先され、明示的な CLI フラグは両者よりさらに優先されます。
-
-`--profile <name>` で同一ホスト上に複数のデーモンを走らせるときに特に有用です。プロファイルごとに `device_name` を独立して設定すれば、Runtimes 画面でも共有ホスト名で潰れることなく別々の行として区別できます。
-
-各パラメータがデーモンの動作にどう影響するかの完全な説明は、[デーモンとランタイム](/daemon-runtimes)を参照してください。
+| 連携 | 変数 | 説明 |
+|---|---|---|
+| GitHub | `GITHUB_APP_SLUG` | GitHub App の slug |
+| GitHub | `GITHUB_WEBHOOK_SECRET` | Webhook HMAC と接続 state の署名シークレット |
+| GitHub | `GITHUB_APP_ID` | PR カードの CI ステータス・マージ可否と「GitHub から選択」リポジトリに必要です |
+| GitHub | `GITHUB_APP_PRIVATE_KEY` | App ID と対になる完全な PEM 秘密鍵。用途は同上 |
+| Lark | `MULTICA_LARK_SECRET_KEY` | base64 エンコードされた 32 バイトの資格情報暗号化キー |
+| Slack | `MULTICA_SLACK_SECRET_KEY` | base64 エンコードされた 32 バイトの token 暗号化キー |
+| Composio | `COMPOSIO_API_KEY` | Composio ツール接続を有効化 |
+| Composio | `COMPOSIO_CALLBACK_BASE_URL` | コールバック API アドレス。`MULTICA_PUBLIC_URL` にフォールバック可能 |
+| Composio | `COMPOSIO_STATE_SECRET` | OAuth state の署名シークレット。`JWT_SECRET` から派生可能 |
+| セルフホスト Git | `MULTICA_VCS_INTEGRATION_ENABLED` | Forgejo/Gitea/GitLab 連携のスイッチ。compose ではデフォルトで有効 |
+| セルフホスト Git | `MULTICA_VCS_SECRET_KEY` | base64 エンコードされた 32 バイトの暗号化キー(`openssl rand -base64 32`)。未設定の場合、この機能全体が利用できません |
-### デフォルトのエージェント引数(`MULTICA_<PROVIDER>_ARGS`)
+`GITHUB_APP_ID` と秘密鍵を設定しなくても、PR の関連付け・ミラー・マージによる done への遷移は通常どおり動きますが、カードに CI とマージ可否のステータスが表示されず、「GitHub から選択」のリポジトリ入口も無効になります。
-バックエンドに対して**フリート全体のデフォルト**となる CLI フラグの層を設定します。各エージェントの `custom_args` を個別に編集することなく、デーモン上のすべてのエージェントにデフォルトのコスト・リソースのベースライン(例: `--max-turns`)を適用できる便利な手段です。これはデフォルトの層であり、超えられない上限ではありません。各エージェント自身の `custom_args` が後から追加され、これを上書きできます(下記の**優先順位**を参照)。
+設定手順は [GitHub 連携](/github-integration#セルフホスト設定)、[Lark Bot](/lark-bot-integration#セルフホスト設定)、[Slack Bot](/slack-bot-integration#セルフホスト設定)を参照してください。
-- **優先順位:** デフォルト引数が先に適用され、その後に各エージェント自身の `custom_args` が追加されます。値を取るフラグについては、下流 CLI 自身の引数パーサーが最終的な勝者を決めます(多くのツールでは最後の出現が優先)。そのため個々のエージェントはデーモンのデフォルトを引き上げられますが、エージェントが上書きしない箇所ではデフォルトが引き続き有効です。
-- **パース:** 値は POSIX シェルワード規則で分割されるため、クォートが使えます——`MULTICA_CLAUDE_ARGS='--append-system-prompt "multi word"'` は 2 つのトークンに解析されます。
-- **安全性:** デフォルト引数の層と各エージェントの `custom_args` の層は、いずれも同じ blocked-flags フィルターを通過します。そのためプロトコル上重要なフラグ(Claude の `-p`、`--output-format`、`--input-format`、`--permission-mode`、`--mcp-config`、および Codex の `--listen` など)はどちらの層からも注入できません。
-- **未設定・空** の場合は動作に変化はありません。
+## サーバーサイド LLM
-## フロントエンドのアクセス制御
+このグループは、会話タイトルなどサーバー側の補助生成機能の設定です。エージェントがタスクを実行するときに使う AI コーディングツールの資格情報ではありません。
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `FRONTEND_ORIGIN` | 空 | フロントエンドアドレス。招待メールのリンク、CORS 許可リスト、cookie ドメインはすべてこの値から派生します。設定しない場合、招待メールのリンクはホスト型ドメイン `https://multica.ai` にフォールバックします — セルフホストはこれを明示的に設定する必要があります |
-| `CORS_ALLOWED_ORIGINS` | 空 | 追加で許可する CORS origin(カンマ区切り) |
-| `ALLOWED_ORIGINS` | 空 | WebSocket 専用の origin 許可リスト(カンマ区切り)。設定しない場合、フォールバック順序は `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174` です |
+| `MULTICA_LLM_API_KEY` | 空 | OpenAI 互換の API key |
+| `MULTICA_LLM_BASE_URL` | 空 | OpenAI 互換の endpoint |
+| `MULTICA_LLM_DEFAULT_MODEL` | 組み込みデフォルト | リクエストがモデルを指定しない場合に使用 |
-<Callout type="warning">
-**`FRONTEND_ORIGIN` を設定しないと 2 つの静かな失敗が発生します**: (1) 招待メールのリンクが `https://multica.ai`(ホスト型ドメイン)を指し、クリックしてもユーザーがセルフホストインスタンスに戻ってこない。(2) WebSocket の Origin チェックが `localhost:3000 / 5173 / 5174` にフォールバックするため、プロダクションデプロイのすべての WebSocket 接続が拒否され、フロントエンドが「リアルタイム更新を受け取れない」ように見える。
-</Callout>
+API key と base URL の両方が空の場合、サーバーサイド LLM 生成は無効になり、呼び出し側はローカルのフォールバックロジックを使います。
-## GitHub 連携
+## デーモン設定
-[GitHub PR ↔ イシュー連携](/github-integration)には、設定で Connect GitHub を有効にし受信 webhook を受け付けるために `GITHUB_APP_SLUG` と `GITHUB_WEBHOOK_SECRET` が必要です。`GITHUB_APP_ID` と `GITHUB_APP_PRIVATE_KEY` は、PR カードの CI ステータスとマージ可否に**必須**です — これらがなくても連携は PR をミラーリングしイシューを自動で紐づけますが、カードには CI やマージ状態が表示されません。
+以下の変数は、エージェントを実行するコンピューター上で読み込まれます。API コンテナ内ではありません。
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `GITHUB_APP_SLUG` | 空 | GitHub App の slug(`https://github.com/apps/<slug>` の末尾部分)。設定 → GitHub のインストールボタン URL を構成します |
-| `GITHUB_WEBHOOK_SECRET` | 空 | GitHub App に設定した Webhook secret。すべての `pull_request` / `installation` delivery の HMAC-SHA256 検証に使われ、setup コールバックの state token の HMAC キーとしても使われます |
-| `GITHUB_APP_ID` | 空 | App 設定ページに表示される数値の App ID。`GITHUB_APP_PRIVATE_KEY` と併せて、PR カードの CI ステータスとマージ可否、Settings → Repositories → GitHub から選択する機能、インストール時の連携先アカウント名取得に使われます |
-| `GITHUB_APP_PRIVATE_KEY` | 空 | App の RSA 秘密鍵の完全な PEM ブロック(`-----BEGIN/END-----` 行を含み、改行を保持)。`GITHUB_APP_ID` と併せて、App 認証による PR スナップショットとリポジトリ参照に使われます |
-
-**いずれかの必須変数が設定されていない場合の動作:**
+| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | Multica API / WebSocket アドレス。`http(s)` も受け付けます |
+| `MULTICA_DAEMON_DEVICE_NAME` | ホスト名 | ランタイム一覧に表示されるデバイス名 |
+| `MULTICA_AGENT_RUNTIME_NAME` | `Local Agent` | ランタイムの表示名 |
+| `MULTICA_DAEMON_POLL_INTERVAL` | `30s` | ウェイクイベントがないときのタスクポーリング間隔 |
+| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | ハートビート間隔 |
+| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | デーモン 1 つあたりの同時実行タスク上限 |
+| `MULTICA_AGENT_TIMEOUT` | `0` | 1 回の実行の絶対時間上限。`0` は上限なし |
+| `MULTICA_AGENT_IDLE_WATCHDOG` | `30m` | 出力もツール実行もない状態の静穏上限 |
+| `MULTICA_AGENT_TOOL_WATCHDOG` | `2h` | 単一のツール呼び出しが静穏なままでいられる上限 |
+| `MULTICA_OPENCODE_IDLE_WATCHDOG` | `10m` | OpenCode 専用の静穏しきい値 |
+| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex のセマンティック静穏しきい値 |
+| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex app-server 起動ハンドシェイクの上限 |
+| `MULTICA_DAEMON_AUTO_UPDATE` | Cloud は `true`、セルフホストは `false` | CLI の更新を自動でチェックして適用するか |
+| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | 更新チェックの間隔 |
+| `MULTICA_WORKSPACES_ROOT` | `~/multica_workspaces` | タスク作業ディレクトリのルート |
+| `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | デバッグ用にタスクディレクトリを保持 |
+
+各 AI コーディングツールは `MULTICA_<PROVIDER>_PATH` と `MULTICA_<PROVIDER>_MODEL` でコマンドパスとデフォルトモデルを上書きできます。マシン全体のデフォルト引数 `MULTICA_<PROVIDER>_ARGS` は、現在 Claude Code、Codex、CodeBuddy、Qwen Code の 4 ツールに対応しています。対応する変数は `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS`、`MULTICA_QWEN_ARGS` です。例:
+
+```dotenv
+MULTICA_CLAUDE_PATH=/opt/bin/claude
+MULTICA_CLAUDE_ARGS=--max-turns 40
+```
-- 設定 → GitHub の `Connect GitHub` が**無効**になり、admin に「not configured」というヒントを表示します。
-- `/api/webhooks/github` エンドポイントは **`503 github webhooks not configured`** を返します — Multica はすべての署名を有効として扱うのではなく、secret なしではイベント処理を拒否します。
+優先順位はコマンドラインフラグ → 環境変数 → `~/.multica/config.json` → 組み込みデフォルトです。watchdog の動作は[デーモンとランタイム](/daemon-runtimes)を参照してください。
-**`GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY` が設定されていない場合の動作:**
+### デーモン設定の永続化
-- PR カードに **CI ステータスもマージ可否も表示されません** — 連携はきれいに縮退します: PR は引き続きミラーリングされ、イシューは引き続き自動で紐づき、マージ時に Done へ移動します。
-- インストール直後、接続カードには一時的に `Connected to unknown` とも表示されます。GitHub から `installation.created` webhook が届くと(通常は数秒以内)、Multica は行を実際の組織名/ユーザー名に更新し、リアルタイムブロードキャストを発行するため、開いている Settings → GitHub タブは手動更新なしで反映されます。
-- サーバーがリポジトリ一覧に必要な installation token を発行できないため、Settings → Repositories → GitHub から選択する機能は無効になります。
+デーモン側のよく使う設定は、シェルの環境変数に頼らず `~/.multica/config.json` に書き込むこともできます。名前付きプロファイルの設定ファイルは `~/.multica/profiles/<name>/config.json` にあります:
-**注:** `GITHUB_WEBHOOK_SECRET` はインストールフローの state token の署名キーとして再利用されるため、運用者は secret を 1 つだけ管理すればよいです。これは GitHub App の *Client* secret では**ありません** — Client secret は OAuth 関連であり、この連携では使われません。完全な手順は [GitHub 連携 → セルフホストのセットアップ](/github-integration#self-host-setup)を参照してください。
+```bash
+multica config set poll_interval 10s
+multica config show
+```
-## 使用量分析
+サポートされるキー:
-デフォルトでは、サーバーは Multica の公式 PostHog インスタンスにレポートします。オプトアウトするには `ANALYTICS_DISABLED=true` を設定してください。
+| キー | デフォルト | 説明 |
+|---|---|---|
+| `server_url` | `ws://localhost:8080/ws` | Multica API / WebSocket アドレス |
+| `app_url` | 空 | ブラウザログインに使う Web アドレス |
+| `workspace_id` | 空 | デフォルトのワークスペース |
+| `device_name` | ホスト名 | ランタイム一覧に表示されるデバイス名 |
+| `runtime_name` | `Local Agent` | ランタイムの表示名 |
+| `max_concurrent_tasks` | `20` | 同時実行タスク上限。`0` または空は未設定を意味します |
+| `poll_interval` | `30s` | タスクのポーリング間隔 |
+| `heartbeat_interval` | `15s` | ハートビート間隔 |
+| `agent_timeout` | 無制限 | 1 回の実行の絶対時間上限 |
+| `codex_semantic_inactivity_timeout` | `10m` | Codex のセマンティック静穏しきい値 |
+| `codex_handshake_timeout` | `30s` | Codex app-server ハンドシェイクの上限 |
+| `disable_auto_update` | 環境に従う | `true` で自動更新を無効化。`false` はローカルの上書きをクリアし、環境変数またはデフォルトに戻します |
+| `auto_update_check_interval` | `6h` | 更新チェックの間隔 |
+
+値のルール:
+
+- duration 系のキーは正の Go duration(`10s`、`2h` など)を受け付け、`0s` と負の値は拒否されます。唯一の例外は `agent_timeout` で、`0s` は有効な値として実行時間上限を明示的に無効化します。
+- 空文字列を渡すと永続化された値がクリアされ、環境変数または組み込みデフォルトに戻ります。例: `multica config set poll_interval ""`。
+- `max_concurrent_tasks` には非負の整数が必要です。
+
+## 可観測性と分析
| 変数 | デフォルト | 説明 |
|---|---|---|
-| `ANALYTICS_DISABLED` | `false` | バックエンド分析を完全に無効にするには `true` に設定 |
-| `POSTHOG_API_KEY` | 組み込みのデフォルトキー | 自身の PostHog インスタンスを指す場合に設定 |
-| `POSTHOG_HOST` | `https://us.i.posthog.com` | PostHog をセルフホストする場合は自身のホストに変更 |
+| `ANALYTICS_DISABLED` | `false` | `true` で PostHog への送信を無効化 |
+| `POSTHOG_API_KEY` | 空 | 未設定の場合は分析送信が無効。自前の PostHog プロジェクトを使う場合に設定 |
+| `POSTHOG_HOST` | `https://us.i.posthog.com` | PostHog アドレス |
+| `METRICS_ADDR` | 空 | Prometheus metrics のリッスンアドレス。空なら起動しません |
+| `REALTIME_METRICS_TOKEN` | 空 | `/health/realtime` を保護する bearer token |
-## 次へ
+## 次のステップ
-- [サインインとサインアップの設定](/auth-setup) — 上記の auth 関連変数を実際にどう設定するか、そして落とし穴がどこにあるか
-- [GitHub 連携](/github-integration) — `GITHUB_APP_SLUG` / `GITHUB_WEBHOOK_SECRET` を支える GitHub App をどうセットアップするか
-- [トラブルシューティング](/troubleshooting) — よくある設定ミスの症状と対処法
-- [デーモンとランタイム](/daemon-runtimes) — `MULTICA_DAEMON_*` パラメータが実際に何をするか
+- [ログインとサインアップ](/auth-setup) — ログイン方式とサインアップ制限。
+- [トラブルシューティング](/troubleshooting) — デプロイ問題の症状別診断。
+- [デーモンとランタイム](/daemon-runtimes) — デーモン側の対応する設定。
diff --git a/apps/docs/content/docs/environment-variables.ko.mdx b/apps/docs/content/docs/environment-variables.ko.mdx
index 3a652d451f..fd369792ad 100644
--- a/apps/docs/content/docs/environment-variables.ko.mdx
+++ b/apps/docs/content/docs/environment-variables.ko.mdx
@@ -1,287 +1,267 @@
---
title: 환경 변수
-description: 자체 호스팅 Multica 서버를 실행하기 위한 환경 변수 전체 목록입니다.
+description: 자체 호스팅 Multica에서 자주 사용하는 서버, 저장소, 연동, 런타임 설정입니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-자체 호스팅 Multica [서버](/self-host-quickstart)는 시작 시 환경 변수에서 설정을 읽습니다 — 데이터베이스, 로그인, 이메일, 스토리지, 가입 허용 목록이 모두 여기에 있습니다. 이 페이지는 모든 변수를 용도별로 그룹화합니다: 각 섹션은 **설정하지 않으면 어떻게 되는지**, 그리고 **프로덕션에서 반드시 설정해야 하는 변수가 무엇인지**를 명확히 설명합니다. auth 관련 변수를 실제로 어떻게 설정하는지는 [로그인 및 가입 설정](/auth-setup)을 참고하세요.
+Multica는 프로세스를 시작할 때 환경 변수를 읽습니다. 수정 후에는 보통 해당 API, Web 또는 데몬을 다시 시작해야 합니다. Docker Compose의 `docker compose restart`는 `.env`를 다시 읽지 않으므로 `up -d`로 컨테이너를 다시 만들어야 적용됩니다.
-## 핵심 서버 변수
+이 페이지에는 배포자를 위한 설정만 나열하며 테스트 변수와 내부 태스크 변수는 다루지 않습니다. 여기서는 그룹별 참조를 제공하고 전체 배포 단계는 [자체 호스팅 빠른 시작](/self-host-quickstart)을 참고하세요.
-배포 전에 반드시 고려해야 하는 핵심 변수입니다 — 일부는 서버를 시작할 수 있게 해주는 기본값을 가지고 있지만, 프로덕션에서는 필수 항목을 명시적으로 설정해야 합니다.
+## 프로덕션 최소 설정
-| 변수 | 기본값 | 프로덕션 필수? |
-|---|---|---|
-| `DATABASE_URL` | `postgres://multica:multica@localhost:5432/multica?sslmode=disable` | **예** |
-| `PORT` | `8080` | 아니오 (포트를 변경하는 경우 제외) |
-| `JWT_SECRET` | `multica-dev-secret-change-in-production` | **예** (기본값은 안전하지 않음) |
-| `APP_ENV` | 비어 있음 | **예** (`production`이어야 함) |
-| `FRONTEND_ORIGIN` | 비어 있음 | **예** (자체 호스팅은 자체 도메인을 설정해야 함) |
-| `MULTICA_DEV_VERIFICATION_CODE` | 비어 있음 | 아니오 (프로덕션에서는 반드시 비워 두어야 함) |
-| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | 아니오. `SIGTERM`/`SIGINT` 수신 후 정상 종료를 시작하기 전의 선택적 대기 시간입니다. `300s`, `5m` 같은 음수가 아닌 Go duration을 허용하며, 비어 있거나 `0`이면 즉시 종료를 시작합니다 |
+```dotenv
+DATABASE_URL=postgres://user:password@postgres:5432/multica?sslmode=require
+JWT_SECRET=<long-random-secret>
+APP_ENV=production
+FRONTEND_ORIGIN=https://multica.example.com
+MULTICA_APP_URL=https://multica.example.com
+MULTICA_PUBLIC_URL=https://api.multica.example.com
+```
-Kubernetes에서 `MULTICA_SHUTDOWN_HOLD_DURATION`을 사용할 때는 `terminationGracePeriodSeconds`를 hold 시간과 이후 정상 종료 시간의 합보다 길게 설정하세요. 두 값을 같은 시간으로 설정하면 정리가 끝나기 전에 kubelet이 `SIGKILL`을 보낼 수 있습니다.
+이메일 서비스도 하나 선택해야 합니다. 설정하지 않으면 인증 코드와 초대가 서버 로그에만 기록됩니다.
<Callout type="warning">
-**프로덕션에서는 `MULTICA_DEV_VERIFICATION_CODE`를 비워 두세요.** 고정된 로컬 테스트 코드는 기본적으로 비활성화되어 있지만, `MULTICA_DEV_VERIFICATION_CODE=888888`로 활성화하면 `APP_ENV`가 production이 아닌 동안에는 코드를 요청할 수 있는 누구나 그 고정 값으로 로그인할 수 있습니다. 이 단축 코드는 `APP_ENV=production`일 때 무시됩니다.
+프로덕션 환경에서 기본 `JWT_SECRET`을 사용하거나 `MULTICA_DEV_VERIFICATION_CODE`를 설정하지 마세요.
</Callout>
-### 데이터베이스 커넥션 풀
+## API와 데이터베이스
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `DATABASE_MAX_CONNS` | `25` | pgxpool 최대 연결 수. 데몬은 자주(3초마다) 폴링하며 연결을 사용하므로, 규모가 큰 배포에서는 더 높은 값이 필요할 수 있습니다 |
-| `DATABASE_MIN_CONNS` | `5` | 최소 유휴 연결 수 |
-
-**설정하지 않으면** 위 값이 사용됩니다 — 이전에 프로덕션에서 풀 고갈을 일으켰던 pgx 내장 기본값 4/NumCPU가 **아닙니다**.
-
-## 이메일 설정
-
-Multica는 두 가지 전송 백엔드를 지원합니다 — 클라우드 배포용 [Resend](https://resend.com/), 또는 내부 / 온프레미스 네트워크용 SMTP relay. 둘 다 설정된 경우 `SMTP_HOST`가 `RESEND_API_KEY`보다 우선합니다.
-
-### Resend
+| `DATABASE_URL` | 로컬 `multica` 데이터베이스 | PostgreSQL 연결 주소 |
+| `DATABASE_MAX_CONNS` | `25` | API 프로세스 하나의 최대 데이터베이스 연결 수 |
+| `DATABASE_MIN_CONNS` | `5` | API 프로세스 하나가 유지하는 최소 연결 수 |
+| `PORT` | `8080` | API listen port |
+| `JWT_SECRET` | 개발용 고정값 | 로그인 JWT와 일부 서명 절차에서 사용하는 키 |
+| `APP_ENV` | 비어 있음 | 프로덕션 환경에서는 `production`으로 설정 |
+| `AUTH_TOKEN_TTL` | `720h`(30일) | 브라우저 JWT와 cookie 유효 기간. Go duration 또는 양의 정수 초 허용 |
+| `LOG_LEVEL` | 앱 기본값 | 로그 수준 |
+| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | 종료 신호를 받은 뒤 graceful shutdown을 시작하기 전 대기 시간 |
-| 변수 | 기본값 | 설명 |
-|---|---|---|
-| `RESEND_API_KEY` | 비어 있음 | Resend API key |
-| `RESEND_FROM_EMAIL` | `[email protected]` | Resend 발신 주소(Resend 계정에서 검증된 도메인이어야 함). `SMTP_FROM_EMAIL`이 비어 있으면 SMTP에서도 사용됩니다 |
+Kubernetes에서 shutdown hold를 설정하면 `terminationGracePeriodSeconds`가 hold와 실제 종료에 필요한 시간의 합보다 커야 합니다.
-### SMTP relay
+## 공개 주소와 브라우저 접근
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `SMTP_HOST` | 비어 있음 | SMTP relay 호스트명. 이를 설정하면 SMTP 모드가 활성화되고 Resend를 덮어씁니다 |
-| `SMTP_PORT` | `25` | SMTP 포트. STARTTLS 제출에는 `587`을, SMTPS(암묵적 TLS, 자동 활성화)에는 `465`를 사용하세요 |
-| `SMTP_USERNAME` | 비어 있음 | SMTP 사용자명. 인증 없는 relay의 경우 비워 두세요 |
-| `SMTP_PASSWORD` | 비어 있음 | SMTP 비밀번호 |
-| `SMTP_FROM_EMAIL` | 비어 있음 | SMTP `MAIL FROM` 및 `From:`에 사용할 발신 주소. 설정하지 않으면 `RESEND_FROM_EMAIL`로 대체됩니다 |
-| `SMTP_TLS` | `starttls` | TLS 모드. `implicit`(별칭 `smtps`, `ssl`)은 연결 시 즉시 TLS 핸드셰이크를 수행합니다(SMTPS). `465` 포트에서는 자동으로 활성화됩니다. 미설정 / `starttls`는 연결 후 STARTTLS로 업그레이드합니다 |
-| `SMTP_TLS_INSECURE` | `false` | TLS 인증서 검증을 건너뛰려면 `true`로 설정 (사설 CA / 자체 서명 인증서만 해당) |
-| `SMTP_EHLO_NAME` | 머신 호스트명 | relay에 알리는 EHLO/HELO 이름. 엄격한 relay(예: Google Workspace `smtp-relay.gmail.com`)가 공개 IP에서 보내는 기본 greeting을 거부하는 경우 실제 FQDN을 설정하세요 — 그렇지 않으면 relay가 연결을 끊고, 이는 이후 명령에서 불투명한 `EOF`로 나타납니다 |
-
-서버가 STARTTLS를 알리면 자동으로 업그레이드됩니다. dial 타임아웃은 10초이고 전체 SMTP 세션에는 30초 데드라인이 있어, 블랙홀이 된 relay가 auth 핸들러를 멈추게 할 수 없습니다.
-
-**둘 다 설정하지 않았을 때의 동작**: 서버는 오류를 내지 않지만, 전송되어야 했던 모든 이메일(인증 코드, 초대 링크)은 **서버의 stdout에만 기록됩니다**. 로컬 개발에는 편리합니다 — 서버 로그에서 코드를 복사해 사용하세요; **프로덕션에서는 이를 설정하는 것을 잊으면 조용한 블랙홀이 되어**, 사용자는 이메일을 전혀 받지 못하고 아무런 오류도 드러나지 않습니다.
-
-## Google OAuth 설정
+| `FRONTEND_ORIGIN` | 비어 있음 | 사용자가 접근하는 프런트엔드 origin. CORS, cookie, 초대 링크에 사용 |
+| `MULTICA_APP_URL` | `FRONTEND_ORIGIN`으로 fallback | 사용자가 접근할 수 있는 Web 주소. CLI 로그인과 계정 연결 링크에 사용 |
+| `MULTICA_PUBLIC_URL` | 비어 있음 | 공개 API 주소. webhook URL과 런타임 연결 안내에 사용 |
+| `CORS_ALLOWED_ORIGINS` | 비어 있음 | 추가로 허용할 HTTP origin, 쉼표로 구분 |
+| `ALLOWED_ORIGINS` | CORS 또는 프런트엔드 주소로 fallback | WebSocket origin allowlist, 쉼표로 구분 |
+| `COOKIE_DOMAIN` | 비어 있음 | 프런트엔드와 backend의 host가 다르고 브라우저가 API 도메인에 직접 접근할 때 필수. 단일 도메인 배포에서는 비워 둠 |
-선택 사항입니다. 이메일 + 인증 코드만 사용하려면 설정하지 않은 채로 두고, 로그인 페이지에 "Sign in with Google"을 추가하려면 설정하세요.
+프런트엔드와 API가 서로 다른 host를 사용하고 브라우저가 API 도메인에 직접 접근한다면 `COOKIE_DOMAIN`을 설정해야 합니다. 설정하지 않으면 브라우저가 CSRF cookie를 읽지 못해 모든 쓰기 요청이 `403 CSRF validation failed`를 반환하고 읽기 요청만 정상 작동합니다. 두 host를 모두 포함하는 가장 좁은 상위 도메인을 사용하세요(`.example.com`보다 `.agent.example.com`이 더 적합). 이 설정은 로그인 세션 cookie를 해당 도메인의 모든 host로 확장하므로 모든 host를 같은 신뢰 주체가 운영할 때만 사용할 수 있습니다. 수정 후 두 host에서 이전 cookie를 삭제하고 다시 로그인해야 합니다. [자체 호스팅 빠른 시작](/self-host-quickstart#3-접근-방식-선택)의 same-origin 구성을 사용해 브라우저가 app 도메인에만 접근한다면 비워 두세요. IP 주소는 입력하지 마세요. 브라우저가 IP Domain이 포함된 cookie를 무시합니다.
-| 변수 | 기본값 | 설명 |
-|---|---|---|
-| `GOOGLE_CLIENT_ID` | 비어 있음 | Google Cloud OAuth client ID |
-| `GOOGLE_CLIENT_SECRET` | 비어 있음 | Google Cloud OAuth secret |
-| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | OAuth 콜백 URL (자체 호스팅: 자신의 프론트엔드 도메인으로 교체) |
-
-**런타임에 적용됨**: 프론트엔드는 런타임에 `/api/config`를 통해 이 설정을 읽으므로, **변경해도 프론트엔드 리빌드나 재배포가 필요 없습니다** — 서버를 재시작하면 적용됩니다.
-
-전체 설정(Google Cloud Console 단계 포함)은 [로그인 및 가입 설정](/auth-setup#google-oauth-configuration)에 있습니다.
-
-## 파일 스토리지 설정
+<Callout type="warning">
+자체 호스팅 배포에서는 `FRONTEND_ORIGIN`을 설정해야 합니다. 없으면 초대 링크, cookie 보안 속성, WebSocket origin 검증이 실제 도메인과 맞지 않을 수 있습니다.
+</Callout>
-Multica는 사용자가 업로드한 첨부 파일(댓글의 이미지와 파일)을 저장합니다. **S3가 권장됩니다**; S3가 설정되어 있지 않으면 로컬 디스크로 폴백합니다.
+## 이메일과 로그인
-### S3 / S3 호환 스토리지
+### Resend
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `S3_BUCKET` | 비어 있음 | **버킷 이름만** (예: `my-bucket`). `.s3.<region>.amazonaws.com` 접미사를 포함하지 **마세요** — 서버가 `S3_BUCKET` + `S3_REGION`으로 공개 호스트를 구성합니다. 이를 설정하면 S3 스토리지가 활성화됩니다 |
-| `S3_REGION` | `us-west-2` | AWS 리전. 버킷의 실제 리전과 일치해야 합니다 — SDK 서명과 공개 URL 구성 모두에 사용됩니다 |
-| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | 비어 있음 | 정적 자격 증명. 둘 다 설정하지 않으면 AWS SDK 기본 자격 증명 체인(IAM role / 환경 자격 증명)이 사용됩니다 |
-| `AWS_ENDPOINT_URL` | 비어 있음 | 사용자 정의 S3 호환 엔드포인트 (예: [MinIO](https://min.io/)). 이를 설정하면 path-style URL로 전환됩니다 |
-| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | 첨부 파일 다운로드 방식: `auto`, `cloudfront`, `presign`, `proxy`. `auto`에서는 CloudFront가 완전히 설정되어 있으면 우선 사용하고, 내부/프라이빗 endpoint host는 server proxy를, 공개 S3 호환 endpoint는 지원되는 경우 presigned GET을 사용합니다 |
-| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | CloudFront signed URL 및 S3 presigned download URL의 유효 기간. Go duration 형식을 받습니다 |
-
-**`S3_BUCKET`을 설정하지 않으면**: 서버는 시작 시 `"S3_BUCKET not set, cloud upload disabled"`를 로깅하고, 모든 업로드는 로컬 디스크로 폴백합니다.
-
-**저장된 객체 URL**은 다음 우선순위 순서로 구성됩니다:
-
-1. `CLOUDFRONT_DOMAIN`이 설정된 경우 `https://<CLOUDFRONT_DOMAIN>/<key>`.
-2. `AWS_ENDPOINT_URL`이 설정된 경우 `<AWS_ENDPOINT_URL>/<S3_BUCKET>/<key>` (path-style).
-3. `https://<S3_BUCKET>.s3.<S3_REGION>.amazonaws.com/<key>` (virtual-hosted-style). `S3_BUCKET`에 점이 포함된 경우, AWS가 발급한 와일드카드 TLS 인증서가 점이 포함된 버킷 호스트를 검증하지 못하므로 서버는 `https://s3.<S3_REGION>.amazonaws.com/<S3_BUCKET>/<key>` (path-style)로 폴백합니다.
+| `RESEND_API_KEY` | 비어 있음 | 설정하면 Resend 활성화 |
+| `RESEND_FROM_EMAIL` | `[email protected]` | 발신 주소. 인증된 도메인에 속해야 함 |
-API `download_url` 값은 CloudFront 서명이 설정되지 않은 경우 `GET /api/attachments/{id}/download`를 사용합니다. 이 endpoint는 안전한 경우 CloudFront/S3 presigned URL로 리디렉션하고, `http://rustfs:9000` 같은 프라이빗/내부 endpoint에서는 server가 스트리밍합니다. Docker/VPC 내부 객체 저장소에서는 `ATTACHMENT_DOWNLOAD_MODE=proxy`를 명시할 수 있습니다.
+### SMTP
-### 로컬 디스크 (S3가 설정되지 않은 경우)
+`SMTP_HOST`가 비어 있지 않으면 SMTP가 Resend보다 우선합니다.
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `LOCAL_UPLOAD_DIR` | `./data/uploads` | 로컬 스토리지 디렉터리 |
-| `LOCAL_UPLOAD_BASE_URL` | 비어 있음 (상대 경로 반환) | 공개 base URL — 설정하지 않으면 프론트엔드가 첨부 파일의 전체 URL을 확인할 수 없습니다 |
+| `SMTP_HOST` | 비어 있음 | SMTP host. 설정하면 SMTP 활성화 |
+| `SMTP_PORT` | `25` | 일반적인 값: 25, 587, 465 |
+| `SMTP_USERNAME` | 비어 있음 | 사용자 이름. 익명 relay에서는 비워 둠 |
+| `SMTP_PASSWORD` | 비어 있음 | 비밀번호 |
+| `SMTP_FROM_EMAIL` | `RESEND_FROM_EMAIL`로 fallback | Envelope From과 이메일 From |
+| `SMTP_TLS` | `starttls` | `implicit`, `smtps`, `ssl`은 암시적 TLS를 의미하며 465에서는 자동 활성화 |
+| `SMTP_TLS_INSECURE` | `false` | 인증서 검증 건너뛰기. 신뢰할 수 있는 내부 네트워크에서만 사용 |
+| `SMTP_EHLO_NAME` | host 이름 | 엄격한 relay에서 요구하는 EHLO/FQDN |
-### CloudFront (선택)
-
-S3 앞에 CloudFront를 두는 경우 세 가지 변수가 적용됩니다: `CLOUDFRONT_DOMAIN`, `CLOUDFRONT_KEY_PAIR_ID`, `CLOUDFRONT_PRIVATE_KEY` (또는 Secrets Manager에서 읽으려면 `CLOUDFRONT_PRIVATE_KEY_SECRET`). CloudFront를 사용하지 않으면 건너뛰세요 — S3 설정과 충돌하지 않습니다.
-
-### Cookie 도메인
+### Google OAuth
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `COOKIE_DOMAIN` | 비어 있음 | 세션 cookie의 범위 |
-
-- **비어 있음**: cookie는 방문한 정확한 호스트에서만 유효합니다 (단일 호스트 배포에 적합)
-- **`.example.com`으로 설정**: cookie가 하위 도메인 간에 공유됩니다 (그래서 `app.example.com`과 `api.example.com`이 로그인 세션을 공유함)
-- **프런트엔드와 백엔드가 서로 다른 호스트에 있으면 선택이 아니라 필수입니다**: 브라우저가 페이지 자체 origin에서 `multica_csrf` cookie를 읽을 수 있어야 하며, 그렇지 않으면 읽기는 계속 동작하는 반면 모든 쓰기 요청이 `403 CSRF validation failed`로 실패합니다
-- 두 호스트를 모두 포함하는 **가장 좁은** 상위 도메인을 사용하세요 (`.example.com`이 아니라 `.agent.example.com`). 이 값은 `multica_auth` 세션 cookie도 해당 도메인 아래의 모든 호스트로 확장하므로, 그 호스트들이 모두 동일한 신뢰 주체가 운영하는 경우에만 이 구성을 사용하세요 — 전체 설정은 [Self-Hosting](/getting-started/self-hosting)을 참고하세요
-- 경고: IP 주소일 수 없습니다 (브라우저가 무시함)
+| `GOOGLE_CLIENT_ID` | 비어 있음 | Google OAuth client ID |
+| `GOOGLE_CLIENT_SECRET` | 비어 있음 | Google OAuth client secret |
+| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | Google Console의 callback 주소와 완전히 같아야 함 |
-## 누가 가입할 수 있는지 제한하기
-
-세 개의 허용 목록 계층이 우선순위에 따라 결합됩니다. **어느 한 계층이라도 비어 있지 않은 값으로 설정되면, 일치하지 않는 이메일은 거부됩니다** — `ALLOW_SIGNUP=true`조차 이를 무시할 수 없습니다.
+### 가입 범위
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `ALLOWED_EMAILS` | 비어 있음 | 명시적 이메일 허용 목록 (쉼표로 구분). 비어 있지 않으면 목록에 있는 이메일만 가입할 수 있습니다 |
-| `ALLOWED_EMAIL_DOMAINS` | 비어 있음 | 도메인 허용 목록 (쉼표로 구분). 비어 있지 않으면 목록에 있는 도메인만 가입할 수 있습니다 |
-| `ALLOW_SIGNUP` | `true` | 가입 마스터 스위치. 가입을 완전히 비활성화하려면 `false`로 설정 |
+| `ALLOW_SIGNUP` | `true` | allowlist가 없을 때 새 계정 생성 허용 여부 |
+| `ALLOWED_EMAILS` | 비어 있음 | 가입을 허용할 전체 이메일 주소, 쉼표로 구분 |
+| `ALLOWED_EMAIL_DOMAINS` | 비어 있음 | 가입을 허용할 이메일 도메인, 쉼표로 구분 |
+| `DISABLE_WORKSPACE_CREATION` | `false` | 모든 사용자의 새 워크스페이스 생성을 금지. owner/admin 예외 없음 |
+| `MULTICA_DEV_VERIFICATION_CODE` | 비어 있음 | production이 아닌 환경에서 사용하는 고정 6자리 테스트 인증 코드 |
-**직관에 반하는 부분**: `ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true`는 "company.io 또는 모두를 허용"한다는 뜻이 **아니라** **company.io만 허용**한다는 뜻입니다. 허용 목록 계층은 AND 시맨틱입니다 — 전체 결정 트리는 [로그인 및 가입 설정 → 가입 허용 목록](/auth-setup#restricting-who-can-sign-up)에 있습니다.
+allowlist의 정확한 판단 순서는 [로그인과 가입](/auth-setup#가입-범위-제어)을 참고하세요.
-**초대 흐름 자체는 가입 허용 목록을 확인하지 않습니다** — 하지만 초대받은 사람은 초대를 수락하기 전에 여전히 **로그인**할 수 있어야 합니다. 이미 Multica 계정이 있다면(예: 다른 워크스페이스에서) 허용 목록의 영향을 받지 않고 바로 수락할 수 있습니다; **한 번도 가입한 적이 없다면**, 로그인의 첫 단계(인증 코드 요청)는 여전히 허용 목록 확인을 거치며, `ALLOW_SIGNUP=false`나 `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS`에 의해 거부된 이메일은 **가입을 완료할 수 없고, 따라서 초대를 수락할 수 없습니다**.
+## 첨부 파일 저장소
-## 워크스페이스 생성 잠그기
+`S3_BUCKET`을 설정하지 않으면 Multica가 로컬 디스크를 사용합니다.
-`ALLOW_SIGNUP=false`는 새 계정을 차단하지만, 이미 로그인한 사용자가 `POST /api/workspaces`를 통해 또 다른 워크스페이스를 생성하는 것은 **차단하지 않습니다**. 모든 이슈, 저장소, 에이전트가 플랫폼 관리자에게 보여야 하는 자체 호스팅 인스턴스에서는, 그 틈을 막기 위해 `DISABLE_WORKSPACE_CREATION=true`로 설정하세요.
+### S3 또는 호환 저장소
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `DISABLE_WORKSPACE_CREATION` | `false` | `true`이면 `POST /api/workspaces`에 대한 모든 호출이 `403 workspace creation is disabled for this instance`를 반환합니다. 웹 UI는 `/api/config`를 통해 모든 "워크스페이스 생성" 요소를 숨깁니다. 역할/owner 예외는 없습니다 — 이 게이트는 인스턴스 단위로 전역 적용됩니다 |
-
-권장 부트스트랩 순서:
-
-1. `DISABLE_WORKSPACE_CREATION`을 설정하지 않은 채로(기본값) 인스턴스를 시작합니다.
-2. 관리자로 로그인하여 공유 워크스페이스를 생성합니다.
-3. `DISABLE_WORKSPACE_CREATION=true`로 설정하고 백엔드를 재시작합니다. 이 시점부터 사용자는 초대를 통해서만 참여할 수 있습니다.
+| `S3_BUCKET` | 비어 있음 | Bucket 이름. 전체 hostname을 입력하지 않음 |
+| `S3_REGION` | `us-west-2` | Bucket region |
+| `AWS_ACCESS_KEY_ID` | SDK 기본 자격 증명 chain | 정적 access key |
+| `AWS_SECRET_ACCESS_KEY` | SDK 기본 자격 증명 chain | 정적 secret key |
+| `AWS_ENDPOINT_URL` | 비어 있음 | MinIO 같은 S3 호환 endpoint |
+| `S3_USE_PATH_STYLE` | 사용자 지정 endpoint에서는 `true` | path-style 주소 사용 여부 |
+| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | `auto`, `cloudfront`, `presign`, `proxy` 중 하나 |
+| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | 서명된 다운로드 주소의 유효 기간 |
-초대받은 사용자가 첫 인증 코드로 가입을 완료할 수 있도록 `ALLOW_SIGNUP=true`를 유지하고 싶다면, `DISABLE_WORKSPACE_CREATION=true`를 `ALLOWED_EMAIL_DOMAINS` / `ALLOWED_EMAILS`와 결합하여 어떤 주소가 가입할 수 있는지 범위를 지정하세요. `ALLOW_SIGNUP=false`로 설정하면 대기 중인 초대 대상자가 계정을 만드는 것조차 추가로 차단됩니다 — 모든 멤버가 이미 Multica 계정을 가지고 있는 인스턴스에서만 유용합니다.
+내부 네트워크의 MinIO처럼 브라우저에서 endpoint에 직접 접근할 수 없다면 `ATTACHMENT_DOWNLOAD_MODE=proxy`를 사용하세요.
-## 속도 제한 (선택적 Redis)
-
-공개 auth 엔드포인트 — `/auth/send-code`, `/auth/verify-code`, `/auth/google` — 앞에는 IP별 고정 윈도우 속도 제한이 있습니다. 리미터는 Redis로 뒷받침됩니다. `REDIS_URL`을 설정하지 않으면 미들웨어는 **no-op**(fail-open)이 되고, 백엔드는 시작 시 `rate limiting disabled: REDIS_URL not configured`를 로깅합니다.
+### 로컬 디스크
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `REDIS_URL` | 비어 있음 | Redis 연결 URL (예: `redis://localhost:6379/0`). 설정하지 않으면 auth 엔드포인트의 속도 제한이 비활성화됩니다. 동일한 Redis는 실시간 허브 fan-out, PAT 캐시, 데몬 토큰 캐시에서도 사용됩니다 — 설정하지 않으면 모두 인메모리 / 직접 DB 모드로 폴백합니다 |
-| `REDIS_DISABLE_CLIENT_NAME` | `false` | `true`로 설정하면 모든 Redis 연결에서 `CLIENT SETNAME` 핸드셰이크를 건너뜁니다. `CLIENT` 명령을 차단하는 관리형 Redis 제공자(GCP Memorystore 또는 ACL이 제한된 AWS ElastiCache 등)를 사용할 때 **필수**입니다. 활성화하면 `CLIENT LIST` 출력에서 연결의 설명 이름이 사라지지만, 제한된 제공자와의 호환성을 얻을 수 있습니다 |
-| `RATE_LIMIT_AUTH` | `5` | `/auth/send-code` 및 `/auth/google`에 대한 IP당 분당 최대 요청 수 |
-| `RATE_LIMIT_AUTH_VERIFY` | `20` | `/auth/verify-code`에 대한 IP당 분당 최대 요청 수 |
-| `RATE_LIMIT_TRUSTED_PROXIES` | 비어 있음 | 리미터가 그 `X-Forwarded-For` 헤더를 신뢰하도록 허용하는, 쉼표로 구분된 CIDR. 비어 있음(기본값)은 **XFF를 절대 신뢰하지 않음**을 의미합니다 — 리미터는 직접 연결의 `RemoteAddr`만 사용합니다 |
-
-요청이 제한을 초과하면 서버는 `429 Too Many Requests`, `Retry-After: 60`, 그리고 본문 `{"error":"too many requests"}`로 응답합니다.
-
-<Callout type="warning">
-**리버스 프록시 뒤에서는 `RATE_LIMIT_TRUSTED_PROXIES`를 반드시 설정해야 합니다.** 그렇지 않으면 백엔드 관점에서 모든 실제 사용자가 프록시의 IP를 공유하게 되어, 배포 전체가 하나의 버킷에 들어가고, `/auth/send-code`가 사이트 전체에 대해 분당 5회가 됩니다. 일반적인 값: 같은 호스트의 Caddy / Nginx에는 `127.0.0.1/32,::1/128`; Cloudflare / ALB / CloudFront에는 해당 CDN의 공개된 IP 범위. `RemoteAddr`이 이 CIDR 중 하나에 속하는 IP만 `X-Forwarded-For`를 사용해 클라이언트를 식별할 수 있습니다.
-</Callout>
+| `LOCAL_UPLOAD_DIR` | `./data/uploads` | 파일과 metadata를 저장할 디렉터리. persistent volume 필요 |
+| `LOCAL_UPLOAD_BASE_URL` | 비어 있음 | 선택적인 공개 base URL. 비워 두면 사이트 내부 상대 주소 반환 |
-이 별도의 `RATE_LIMIT_TRUSTED_PROXIES`는 오토파일럿 webhook 리미터(`/api/webhooks/autopilots/{token}`)를 제어하는 `MULTICA_TRUSTED_PROXIES`와는 **다릅니다**. 각 리미터는 자체 목록을 파싱하므로, 프록시 뒤에 있는 배포는 둘 다 설정해야 합니다.
+### CloudFront
-## 데몬 튜닝 파라미터
+| 변수 | 설명 |
+|---|---|
+| `CLOUDFRONT_DOMAIN` | CDN 도메인 |
+| `CLOUDFRONT_KEY_PAIR_ID` | CloudFront key pair ID |
+| `CLOUDFRONT_PRIVATE_KEY` | 전체 private key |
+| `CLOUDFRONT_PRIVATE_KEY_SECRET` | Secrets Manager에서 private key를 읽을 때 사용 |
-데몬은 사용자의 로컬 기기에서 실행되며, 그 설정도 로컬 환경 변수에서 읽습니다. 일반적으로 사용되는 것들:
+## Redis와 rate limit
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | 서버 주소 (자체 호스팅: 자신의 도메인으로 교체) |
-| `MULTICA_DAEMON_DEVICE_NAME` | 호스트명 | Runtimes UI에 표시되는 장치 이름 |
-| `MULTICA_AGENT_RUNTIME_NAME` | 기본값 | 런타임 표시 이름 |
-| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | 하트비트 간격 |
-| `MULTICA_DAEMON_POLL_INTERVAL` | `3s` | 작업 폴링 간격 |
-| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | 최대 동시 작업 수 |
-| `MULTICA_AGENT_TIMEOUT` | `0` | 에이전트 실행당 절대 벽시계 상한. `0`은 상한 없음 — inactivity watchdog만이 긴 실행을 제한합니다. 하드 리소스/비용 상한이 필요하면 양의 Go 기간을 지정하세요 |
-| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex 전용 inactivity watchdog 시간 |
-| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex `app-server` 시작 RPC 타임아웃 |
-| `MULTICA_DAEMON_AUTO_UPDATE` | 클라우드: `true`, 자체 호스팅: `false` | `false`/`0`/`no`/`off`로 설정하면 데몬의 CLI 자동 업데이트 폴링이 꺼집니다. `true`/`1`/`yes`/`on`은 자체 호스팅 데몬이 업스트림 업데이트를 구독하도록 합니다 |
-| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | 데몬이 새 CLI 릴리스를 GitHub에서 확인하는 주기 |
-| `MULTICA_<PROVIDER>_PATH` | CLI 이름과 일치 | 각 AI 코딩 도구 실행 파일의 경로 (예: `MULTICA_CLAUDE_PATH`) |
-| `MULTICA_<PROVIDER>_MODEL` | 비어 있음 | 각 AI 코딩 도구의 기본 모델 |
-| `MULTICA_<PROVIDER>_ARGS` | 비어 있음 | 백엔드별 데몬 전역 기본 CLI 인자. 각 작업에 대해 각 에이전트 자체의 `custom_args`보다 먼저 적용됩니다. `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`를 지원 |
-
-### `config.json`에 데몬 설정 유지하기
-
-위 표의 모든 데몬 키 — `device_name`, `runtime_name`, `max_concurrent_tasks`, `poll_interval`, `heartbeat_interval`, `agent_timeout`, `codex_semantic_inactivity_timeout`, `codex_handshake_timeout`, `disable_auto_update`, `auto_update_check_interval` — 는 프로파일의 `~/.multica/config.json`(또는 `~/.multica/profiles/<name>/config.json`)에 유지할 수도 있어, `daemon start` 마다 플래그를 다시 전달하거나 환경 변수를 export 할 필요가 없습니다.
+| `REDIS_URL` | 비어 있음 | 인증 rate limit, 실시간 이벤트, token cache에 사용. 설정하지 않으면 실시간 이벤트는 프로세스 메모리로 fallback하고 인증 rate limit은 비활성화 |
+| `REDIS_DISABLE_CLIENT_NAME` | `false` | 관리형 Redis가 `CLIENT SETNAME`을 금지하면 `true`로 설정 |
+| `RATE_LIMIT_AUTH` | `5` | IP당 1분에 인증 코드 전송 또는 Google 로그인 시작 허용 횟수 |
+| `RATE_LIMIT_AUTH_VERIFY` | `20` | IP당 1분에 인증 코드 검증 허용 횟수 |
+| `RATE_LIMIT_TRUSTED_PROXIES` | 비어 있음 | `X-Forwarded-For`를 제공하도록 허용할 proxy CIDR, 쉼표로 구분 |
+| `MULTICA_TRUSTED_PROXIES` | 비어 있음 | 자동화 webhook과 실시간 연결에서 사용할 신뢰 proxy CIDR |
-```bash
-multica config set device_name my-vm-custom-name
-multica config set runtime_name worker-a
-multica config set max_concurrent_tasks 8
-multica config set poll_interval 10s # Go 기간, 반드시 > 0
-multica config set heartbeat_interval 30s
-multica config set agent_timeout 1h # 또는 0s로 벽시계 상한을 명시적으로 비활성화
-multica config set codex_semantic_inactivity_timeout 15m
-multica config set codex_handshake_timeout 45s
-multica config set disable_auto_update true # 단방향: 자동 업데이트를 끄는 용도로만 사용
-multica config set auto_update_check_interval 12h
-```
-
-기간 키는 양수인 Go 기간(`500ms`, `10s`, `1m30s` 등)만 허용합니다. `0s`, 음수, 파싱 불가능한 문자열은 `config set` 시점에 거부됩니다 — **단 `agent_timeout`은 예외로, 여기서 `0s`는 "벽시계 상한을 명시적으로 비활성화" 하는 의미 있는 값**입니다(음수는 여전히 거부됨). 이미 저장된 값을 지우고 환경 변수 / 내장 기본값으로 되돌리려면 빈 문자열을 전달하세요: `multica config set poll_interval ""`.
-
-`disable_auto_update`는 단방향 불리언입니다. `true`로 설정하면 데몬의 CLI 자동 업데이트 폴링이 꺼지고, `false`(또는 `""`로 클리어)로 설정하면 결정을 `MULTICA_DAEMON_AUTO_UPDATE` / 클라우드-vs-자체호스팅 기본값에 다시 넘깁니다. config 파일에서 자동 업데이트를 *강제로 켜는* 데는 사용할 수 없습니다.
+reverse proxy 뒤에 배포한다면 실제 proxy 네트워크를 입력해야 합니다. 모든 출처를 그대로 신뢰하지 마세요. 클라이언트가 전달 IP를 위조할 수 있습니다.
-우선순위(위쪽이 우선): `daemon start`의 `--flag` > `MULTICA_…` 환경 변수 > `config.json` > 내장 기본값. systemd unit 등에서 설정한 라이브 환경 변수는 파일을 이깁니다. 명시적인 CLI 플래그는 둘 다 이깁니다.
+위 `RATE_LIMIT_*` 변수는 `REDIS_URL`을 설정한 경우에만 작동합니다. 설정하지 않으면 시작 로그에 rate limiting disabled가 표시됩니다. Redis를 일시적으로 사용할 수 없을 때는 rate limit이 요청을 허용하는 쪽으로 동작해 정상 로그인을 차단하지 않습니다.
-같은 호스트에서 `--profile <name>`으로 여러 데몬을 실행할 때 특히 유용합니다: 프로파일마다 별도의 `device_name`을 지정하면 Runtimes UI에서 공유된 호스트명 아래로 뭉치지 않고 서로 다른 행으로 구분됩니다.
+## 외부 연동
-각 파라미터가 데몬 동작에 어떻게 영향을 미치는지에 대한 전체 설명은 [데몬과 런타임](/daemon-runtimes)을 참고하세요.
+| 연동 | 변수 | 설명 |
+|---|---|---|
+| GitHub | `GITHUB_APP_SLUG` | GitHub App slug |
+| GitHub | `GITHUB_WEBHOOK_SECRET` | Webhook HMAC 및 연결 state 서명 키 |
+| GitHub | `GITHUB_APP_ID` | PR 카드의 CI 상태, merge 가능 여부, "GitHub에서 선택" 저장소에 필요 |
+| GitHub | `GITHUB_APP_PRIVATE_KEY` | App ID와 짝을 이루는 전체 PEM private key. 용도는 위와 같음 |
+| Feishu | `MULTICA_LARK_SECRET_KEY` | base64로 인코딩한 32바이트 자격 증명 암호화 키 |
+| Slack | `MULTICA_SLACK_SECRET_KEY` | base64로 인코딩한 32바이트 token 암호화 키 |
+| Composio | `COMPOSIO_API_KEY` | Composio 도구 연결 활성화 |
+| Composio | `COMPOSIO_CALLBACK_BASE_URL` | callback API 주소. `MULTICA_PUBLIC_URL`로 fallback 가능 |
+| Composio | `COMPOSIO_STATE_SECRET` | OAuth state 서명 키. `JWT_SECRET`에서 파생 가능 |
+| 자체 호스팅 Git | `MULTICA_VCS_INTEGRATION_ENABLED` | Forgejo/Gitea/GitLab 연동 스위치. compose에서는 기본 활성화 |
+| 자체 호스팅 Git | `MULTICA_VCS_SECRET_KEY` | base64로 인코딩한 32바이트 암호화 키(`openssl rand -base64 32`). 없으면 전체 기능을 사용할 수 없음 |
-### 기본 에이전트 인자 (`MULTICA_<PROVIDER>_ARGS`)
+`GITHUB_APP_ID`와 private key를 설정하지 않아도 PR 연결, 미러링, merge 시 done 전환은 정상적으로 작동합니다. 다만 카드에 CI와 merge 가능 상태가 표시되지 않고 "GitHub에서 선택" 저장소 메뉴도 비활성화됩니다.
-백엔드에 대해 **플릿 전역 기본값** 계층의 CLI 플래그를 설정합니다. 각 에이전트의 `custom_args`를 일일이 수정하지 않고도 데몬의 모든 에이전트에 기본 비용·리소스 기준선(예: `--max-turns`)을 적용할 수 있는 편리한 방법입니다. 이는 넘을 수 없는 상한이 아니라 기본 계층입니다. 각 에이전트 자체의 `custom_args`가 뒤에 추가되어 이를 덮어쓸 수 있습니다(아래 **우선순위** 참고).
+설정 단계는 [GitHub 연동](/github-integration#자체-호스팅-설정), [Feishu Bot](/lark-bot-integration#자체-호스팅-설정), [Slack Bot](/slack-bot-integration#자체-호스팅-설정)을 참고하세요.
-- **우선순위:** 기본 인자가 먼저 적용되고, 그다음 각 에이전트 자체의 `custom_args`가 추가됩니다. 값을 받는 플래그의 경우 다운스트림 CLI 자체의 인자 파서가 최종 적용 값을 결정합니다(대부분의 도구는 마지막 항목이 우선). 따라서 개별 에이전트는 데몬 기본값을 높일 수 있지만, 에이전트가 덮어쓰지 않은 부분에는 기본값이 계속 적용됩니다.
-- **파싱:** 값은 POSIX 셸 단어 규칙으로 분할되므로 따옴표를 사용할 수 있습니다 — `MULTICA_CLAUDE_ARGS='--append-system-prompt "multi word"'`는 두 개의 토큰으로 파싱됩니다.
-- **안전성:** 기본 인자 계층과 에이전트별 `custom_args` 계층 모두 동일한 blocked-flags 필터를 통과합니다. 따라서 프로토콜에 중요한 플래그(Claude의 `-p`, `--output-format`, `--input-format`, `--permission-mode`, `--mcp-config` 및 Codex의 `--listen` 등)는 어느 계층을 통해서도 주입할 수 없습니다.
-- **미설정/빈 값**은 동작에 변화가 없음을 의미합니다.
+## 서버 측 LLM
-## 프론트엔드 액세스 제어
+이 설정 그룹은 대화 제목 같은 서버 측 보조 생성 기능에 사용됩니다. 에이전트가 태스크를 실행할 때 사용하는 AI 코딩 도구의 자격 증명이 아닙니다.
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `FRONTEND_ORIGIN` | 비어 있음 | 프론트엔드 주소. 초대 이메일 링크, CORS 허용 목록, cookie 도메인이 모두 이 값에서 파생됩니다. 설정하지 않으면 초대 이메일 링크는 호스팅 도메인 `https://multica.ai`로 폴백합니다 — 자체 호스팅은 이를 명시적으로 설정해야 합니다 |
-| `CORS_ALLOWED_ORIGINS` | 비어 있음 | 추가로 허용할 CORS origin (쉼표로 구분) |
-| `ALLOWED_ORIGINS` | 비어 있음 | WebSocket 전용 origin 허용 목록 (쉼표로 구분); 설정하지 않으면 폴백 순서는 `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174`입니다 |
+| `MULTICA_LLM_API_KEY` | 비어 있음 | OpenAI 호환 API key |
+| `MULTICA_LLM_BASE_URL` | 비어 있음 | OpenAI 호환 endpoint |
+| `MULTICA_LLM_DEFAULT_MODEL` | 내장 기본값 | 요청에 모델이 지정되지 않았을 때 사용 |
-<Callout type="warning">
-**`FRONTEND_ORIGIN`을 설정하지 않으면 두 가지 조용한 실패가 발생합니다**: (1) 초대 이메일 링크가 `https://multica.ai`(호스팅 도메인)를 가리켜, 클릭해도 사용자가 자체 호스팅 인스턴스로 돌아오지 않습니다; (2) WebSocket Origin 검사가 `localhost:3000 / 5173 / 5174`로 폴백하여, 프로덕션 배포의 모든 WebSocket 연결이 거부되고 프론트엔드가 "실시간 업데이트를 받지 못하는" 것처럼 보입니다.
-</Callout>
+API key와 base URL이 모두 비어 있으면 서버 측 LLM 생성이 꺼지고 호출자가 로컬 fallback 로직을 사용합니다.
-## GitHub 연동
+## 데몬 설정
-[GitHub PR ↔ 이슈 연동](/github-integration)에는 설정에서 Connect GitHub를 활성화하고 들어오는 webhook을 수락하기 위해 `GITHUB_APP_SLUG`와 `GITHUB_WEBHOOK_SECRET`이 필요합니다. `GITHUB_APP_ID`와 `GITHUB_APP_PRIVATE_KEY`는 PR 카드의 CI 상태와 머지 가능 여부에 **필수**입니다 — 이 둘이 없어도 연동은 PR을 미러링하고 이슈를 자동 연결하지만, 카드에는 CI나 머지 상태가 표시되지 않습니다.
+아래 변수는 API 컨테이너가 아니라 에이전트를 실행하는 컴퓨터에서 읽습니다.
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `GITHUB_APP_SLUG` | 비어 있음 | GitHub App의 slug (`https://github.com/apps/<slug>`의 끝부분). 설정 → GitHub 설치 버튼 URL을 구성합니다 |
-| `GITHUB_WEBHOOK_SECRET` | 비어 있음 | GitHub App에 설정한 Webhook secret. 모든 `pull_request` / `installation` delivery의 HMAC-SHA256 검증에 사용되며, setup 콜백 state token의 HMAC 키로도 사용됩니다 |
-| `GITHUB_APP_ID` | 비어 있음 | App 설정 페이지에 표시되는 숫자 App ID. `GITHUB_APP_PRIVATE_KEY`와 함께 PR 카드의 CI 상태와 머지 가능 여부, Settings → Repositories → GitHub에서 선택 기능, 설치 시 연결된 계정 이름 가져오기에 사용됩니다 |
-| `GITHUB_APP_PRIVATE_KEY` | 비어 있음 | App RSA 비공개 키의 전체 PEM 블록(`-----BEGIN/END-----` 줄 포함, 줄바꿈 유지). `GITHUB_APP_ID`와 함께 App 인증 PR 스냅샷과 저장소 탐색에 사용됩니다 |
-
-**필수 변수 중 하나라도 설정하지 않았을 때의 동작:**
+| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | Multica API / WebSocket 주소. `http(s)`도 허용 |
+| `MULTICA_DAEMON_DEVICE_NAME` | host 이름 | 런타임 목록의 기기 이름 |
+| `MULTICA_AGENT_RUNTIME_NAME` | `Local Agent` | 런타임 표시 이름 |
+| `MULTICA_DAEMON_POLL_INTERVAL` | `30s` | wakeup 이벤트가 없을 때 실행 태스크 polling 간격 |
+| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | heartbeat 간격 |
+| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | 데몬 하나의 동시 실행 태스크 상한 |
+| `MULTICA_AGENT_TIMEOUT` | `0` | 단일 실행의 절대 시간 제한. `0`은 제한 없음 |
+| `MULTICA_AGENT_IDLE_WATCHDOG` | `30m` | 출력과 도구 실행이 모두 없을 때의 무응답 상한 |
+| `MULTICA_AGENT_TOOL_WATCHDOG` | `2h` | 단일 도구 호출이 계속 무응답인 시간 상한 |
+| `MULTICA_OPENCODE_IDLE_WATCHDOG` | `10m` | OpenCode 전용 무응답 기준값 |
+| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex 의미 활동 없음 기준값 |
+| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex app-server 시작 handshake 상한 |
+| `MULTICA_DAEMON_AUTO_UPDATE` | Cloud `true`, 자체 호스팅 `false` | CLI 자동 확인 및 업데이트 여부 |
+| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | 업데이트 확인 간격 |
+| `MULTICA_WORKSPACES_ROOT` | `~/multica_workspaces` | 실행 태스크 작업 디렉터리의 루트 |
+| `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | 디버깅을 위해 실행 태스크 디렉터리 유지 |
+
+각 AI 코딩 도구는 `MULTICA_<PROVIDER>_PATH`와 `MULTICA_<PROVIDER>_MODEL`로 명령 경로와 기본 모델을 덮어쓸 수 있습니다. 컴퓨터 전체 기본 인수 `MULTICA_<PROVIDER>_ARGS`는 현재 Claude Code, Codex, CodeBuddy, Qwen Code 네 도구를 지원합니다. 해당 변수는 `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`, `MULTICA_QWEN_ARGS`입니다. 예시:
+
+```dotenv
+MULTICA_CLAUDE_PATH=/opt/bin/claude
+MULTICA_CLAUDE_ARGS=--max-turns 40
+```
-- 설정 → GitHub의 `Connect GitHub`가 **비활성화**되고 admin에게 "not configured" 힌트를 표시합니다.
-- `/api/webhooks/github` 엔드포인트는 **`503 github webhooks not configured`**를 반환합니다 — Multica는 모든 서명을 유효한 것으로 취급하기보다, secret 없이는 이벤트 처리를 거부합니다.
+우선순위는 명령줄 flag → 환경 변수 → `~/.multica/config.json` → 내장 기본값입니다. watchdog 동작은 [데몬과 런타임](/daemon-runtimes)을 참고하세요.
-**`GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY`가 설정되지 않았을 때의 동작:**
+### 데몬 설정 영속화
-- PR 카드에 **CI 상태도 머지 가능 여부도 표시되지 않습니다** — 연동은 깔끔하게 축소됩니다: PR은 계속 미러링되고, 이슈는 계속 자동 연결되며 머지 시 Done으로 이동합니다.
-- 설치 직후 연결 카드에 잠시 `Connected to unknown`도 표시됩니다. GitHub의 `installation.created` 웹훅이 도착하면(보통 몇 초 이내) Multica가 행을 실제 조직/사용자 이름으로 갱신하고 실시간 브로드캐스트를 보내, 열려 있는 Settings → GitHub 탭이 수동 새로고침 없이 업데이트됩니다.
-- 서버가 저장소 목록에 필요한 installation token을 발급할 수 없으므로 Settings → Repositories → GitHub에서 선택 기능이 비활성화됩니다.
+자주 사용하는 데몬 측 설정은 shell 환경 변수에 의존하지 않고 `~/.multica/config.json`에 기록할 수도 있습니다. 이름 있는 profile의 설정 파일은 `~/.multica/profiles/<name>/config.json`에 있습니다.
-**참고:** `GITHUB_WEBHOOK_SECRET`은 설치 흐름 state token의 서명 키로 재사용되므로, 운영자는 secret 하나만 관리하면 됩니다. 이것은 GitHub App의 *Client* secret이 **아닙니다** — Client secret은 OAuth 관련이며 이 연동에서는 사용되지 않습니다. 전체 안내는 [GitHub 연동 → 자체 호스팅 설정](/github-integration#self-host-setup)을 참고하세요.
+```bash
+multica config set poll_interval 10s
+multica config show
+```
-## 사용량 분석
+지원되는 key:
-기본적으로 서버는 Multica의 공식 PostHog 인스턴스로 보고합니다. 옵트아웃하려면 `ANALYTICS_DISABLED=true`로 설정하세요.
+| key | 기본값 | 설명 |
+|---|---|---|
+| `server_url` | `ws://localhost:8080/ws` | Multica API / WebSocket 주소 |
+| `app_url` | 비어 있음 | 브라우저 로그인에 사용할 Web 주소 |
+| `workspace_id` | 비어 있음 | 기본 워크스페이스 |
+| `device_name` | host 이름 | 런타임 목록의 기기 이름 |
+| `runtime_name` | `Local Agent` | 런타임 표시 이름 |
+| `max_concurrent_tasks` | `20` | 동시 실행 태스크 상한. `0` 또는 빈 값은 설정되지 않음을 의미 |
+| `poll_interval` | `30s` | 실행 태스크 polling 간격 |
+| `heartbeat_interval` | `15s` | heartbeat 간격 |
+| `agent_timeout` | 제한 없음 | 단일 실행의 절대 시간 제한 |
+| `codex_semantic_inactivity_timeout` | `10m` | Codex 의미 활동 없음 기준값 |
+| `codex_handshake_timeout` | `30s` | Codex app-server handshake 상한 |
+| `disable_auto_update` | 환경을 따름 | `true`는 자동 업데이트를 끔. `false`는 로컬 덮어쓰기를 지우고 환경 변수 또는 기본값으로 복귀 |
+| `auto_update_check_interval` | `6h` | 업데이트 확인 간격 |
+
+값에는 다음 규칙이 적용됩니다.
+
+- duration key는 양의 Go duration(예: `10s`, `2h`)을 허용하며 `0s`와 음수는 거부합니다. 유일한 예외는 `agent_timeout`입니다. `0s`가 유효하며 실행 시간 제한을 명시적으로 끕니다.
+- 빈 문자열을 전달하면 저장된 값을 지우고 환경 변수 또는 내장 기본값으로 돌아갑니다. 예: `multica config set poll_interval ""`
+- `max_concurrent_tasks`는 0 이상의 정수여야 합니다.
+
+## 관측과 통계
| 변수 | 기본값 | 설명 |
|---|---|---|
-| `ANALYTICS_DISABLED` | `false` | 백엔드 분석을 완전히 비활성화하려면 `true`로 설정 |
-| `POSTHOG_API_KEY` | 내장 기본 키 | 자신의 PostHog 인스턴스를 가리킬 때 설정 |
-| `POSTHOG_HOST` | `https://us.i.posthog.com` | PostHog를 자체 호스팅하는 경우 자신의 호스트로 변경 |
+| `ANALYTICS_DISABLED` | `false` | `true`로 설정하면 PostHog 전송 비활성화 |
+| `POSTHOG_API_KEY` | 비어 있음 | 설정하지 않으면 통계 전송 비활성화. 자체 PostHog 프로젝트 연결 시 입력 |
+| `POSTHOG_HOST` | `https://us.i.posthog.com` | PostHog 주소 |
+| `METRICS_ADDR` | 비어 있음 | Prometheus metrics listen 주소. 비어 있으면 시작하지 않음 |
+| `REALTIME_METRICS_TOKEN` | 비어 있음 | `/health/realtime`을 보호하는 bearer token |
-## 다음
+## 다음 단계
-- [로그인 및 가입 설정](/auth-setup) — 위의 auth 관련 변수를 실제로 어떻게 설정하는지, 그리고 함정이 어디에 있는지
-- [GitHub 연동](/github-integration) — `GITHUB_APP_SLUG` / `GITHUB_WEBHOOK_SECRET`을 뒷받침하는 GitHub App을 어떻게 설정하는지
-- [문제 해결](/troubleshooting) — 흔한 설정 오류의 증상과 해결책
-- [데몬과 런타임](/daemon-runtimes) — `MULTICA_DAEMON_*` 파라미터가 실제로 하는 일
+- [로그인과 가입](/auth-setup) — 로그인 방식과 가입 제한을 알아봅니다.
+- [문제 해결](/troubleshooting) — 배포 문제의 증상을 확인합니다.
+- [데몬과 런타임](/daemon-runtimes) — 데몬 측 대응 설정을 알아봅니다.
diff --git a/apps/docs/content/docs/environment-variables.mdx b/apps/docs/content/docs/environment-variables.mdx
index a60060b191..704f5b1806 100644
--- a/apps/docs/content/docs/environment-variables.mdx
+++ b/apps/docs/content/docs/environment-variables.mdx
@@ -1,292 +1,267 @@
---
title: Environment variables
-description: The full list of environment variables for running a self-hosted Multica server.
+description: Common server, storage, integration, and runtime configuration for self-hosting Multica.
---
import { Callout } from "fumadocs-ui/components/callout";
-A self-hosted Multica [server](/self-host-quickstart) reads its configuration from environment variables at startup — database, sign-in, email, storage, signup allowlists all live here. This page groups every variable by purpose: each section spells out **what happens if you leave it unset** and **which ones you must set in production**. For how to actually configure the auth-related ones, see [Sign-in and signup configuration](/auth-setup).
+Multica reads environment variables at process startup. After changing one, restart the affected API, web, or daemon process. Docker Compose's `docker compose restart` does not re-read `.env`; recreate containers with `up -d` for changes to take effect.
-## Core server variables
+This page lists deployment-facing configuration only; test variables and internal task variables are not covered here. It is a grouped reference — for full deployment steps, see the [self-host quickstart](/self-host-quickstart).
-These are the core variables you must think about before deploying — some have defaults that let the server start, but in production you should set the required ones explicitly.
+## Minimum production configuration
-| Variable | Default | Required in production? |
-|---|---|---|
-| `DATABASE_URL` | `postgres://multica:multica@localhost:5432/multica?sslmode=disable` | **Yes** |
-| `PORT` | `8080` | No (unless you change the port) |
-| `JWT_SECRET` | `multica-dev-secret-change-in-production` | **Yes** (the default is unsafe) |
-| `APP_ENV` | empty | **Yes** (must be `production`) |
-| `FRONTEND_ORIGIN` | empty | **Yes** (self-host must set its own domain) |
-| `MULTICA_DEV_VERIFICATION_CODE` | empty | No (must stay empty in production) |
-| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | No. Optional delay after `SIGTERM`/`SIGINT` before graceful shutdown begins. Accepts non-negative Go duration strings such as `300s` or `5m`; empty or `0` starts shutdown immediately |
+```dotenv
+DATABASE_URL=postgres://user:password@postgres:5432/multica?sslmode=require
+JWT_SECRET=<long-random-secret>
+APP_ENV=production
+FRONTEND_ORIGIN=https://multica.example.com
+MULTICA_APP_URL=https://multica.example.com
+MULTICA_PUBLIC_URL=https://api.multica.example.com
+```
-When using `MULTICA_SHUTDOWN_HOLD_DURATION` under Kubernetes, set `terminationGracePeriodSeconds` longer than the hold plus the server's subsequent graceful-shutdown budget. Setting both to the same duration can make kubelet send `SIGKILL` before cleanup finishes.
+You also need to pick an email service, otherwise verification codes and invitations are only written to the server log.
<Callout type="warning">
-**Keep `MULTICA_DEV_VERIFICATION_CODE` empty in production.** A fixed local test code is disabled by default, but if you opt in with `MULTICA_DEV_VERIFICATION_CODE=888888`, anyone who can request a code can sign in with that fixed value while `APP_ENV` is non-production. The shortcut is ignored when `APP_ENV=production`.
+Do not use the default `JWT_SECRET` in production, and do not set `MULTICA_DEV_VERIFICATION_CODE`.
</Callout>
-### Database connection pool
+## API and database
| Variable | Default | Description |
|---|---|---|
-| `DATABASE_MAX_CONNS` | `25` | pgxpool max connections. The daemon polls frequently (every 3s) and uses connections; larger deployments may need a higher value |
-| `DATABASE_MIN_CONNS` | `5` | Minimum idle connections |
-
-**When unset**, the values above are used — **not** pgx's built-in 4/NumCPU defaults, which previously caused pool exhaustion in production.
-
-## Email configuration
-
-Multica supports two delivery backends — [Resend](https://resend.com/) for cloud deployments, or an SMTP relay for internal / on-premise networks. `SMTP_HOST` takes priority over `RESEND_API_KEY` when both are set.
-
-### Resend
+| `DATABASE_URL` | local `multica` database | PostgreSQL connection string |
+| `DATABASE_MAX_CONNS` | `25` | Maximum database connections per API process |
+| `DATABASE_MIN_CONNS` | `5` | Minimum connections each API process keeps |
+| `PORT` | `8080` | API listen port |
+| `JWT_SECRET` | fixed development value | Secret for sign-in JWTs and some signing flows |
+| `APP_ENV` | empty | Set to `production` in production |
+| `AUTH_TOKEN_TTL` | `720h` (30 days) | Lifetime of browser JWTs and cookies; accepts a Go duration or a positive integer of seconds |
+| `LOG_LEVEL` | application default | Log level |
+| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | How long to wait after a termination signal before graceful shutdown begins |
-| Variable | Default | Description |
-|---|---|---|
-| `RESEND_API_KEY` | empty | Resend API key |
-| `RESEND_FROM_EMAIL` | `[email protected]` | Sender address for Resend (must be a domain verified in your Resend account). SMTP also uses it when `SMTP_FROM_EMAIL` is unset |
+When setting a shutdown hold on Kubernetes, `terminationGracePeriodSeconds` must exceed the hold plus the time the actual shutdown needs.
-### SMTP relay
+## Public URLs and browser access
| Variable | Default | Description |
|---|---|---|
-| `SMTP_HOST` | empty | SMTP relay hostname. Setting this activates SMTP mode and overrides Resend |
-| `SMTP_PORT` | `25` | SMTP port. Use `587` for STARTTLS submission, or `465` for SMTPS (implicit TLS, auto-enabled) |
-| `SMTP_USERNAME` | empty | SMTP username. Leave empty for unauthenticated relay |
-| `SMTP_PASSWORD` | empty | SMTP password |
-| `SMTP_FROM_EMAIL` | empty | Sender address for SMTP `MAIL FROM` and `From:`. Falls back to `RESEND_FROM_EMAIL` when unset |
-| `SMTP_TLS` | `starttls` | TLS mode. `implicit` (aliases `smtps`, `ssl`) forces an immediate TLS handshake on connect (SMTPS); port `465` auto-enables it. Unset / `starttls` upgrades via STARTTLS after connect |
-| `SMTP_TLS_INSECURE` | `false` | Set `true` to skip TLS certificate verification (private CA / self-signed only) |
-| `SMTP_EHLO_NAME` | machine hostname | EHLO/HELO name announced to the relay. Set a real FQDN when a strict relay (e.g. Google Workspace `smtp-relay.gmail.com`) rejects the default greeting from a public IP — otherwise the relay drops the connection and it surfaces as an opaque `EOF` on a later command |
+| `FRONTEND_ORIGIN` | empty | Frontend origin users visit; used for CORS, cookies, and invitation links |
+| `MULTICA_APP_URL` | falls back to `FRONTEND_ORIGIN` | User-reachable web URL; CLI sign-in and account-link URLs use it |
+| `MULTICA_PUBLIC_URL` | empty | Public API URL; used for webhook URLs and runtime connection instructions |
+| `CORS_ALLOWED_ORIGINS` | empty | Extra allowed HTTP origins, comma-separated |
+| `ALLOWED_ORIGINS` | falls back to CORS / frontend origins | WebSocket origin allowlist, comma-separated |
+| `COOKIE_DOMAIN` | empty | Required when the frontend and API use different hosts and the browser talks to the API domain directly; keep empty for single-domain deployments |
-STARTTLS is upgraded automatically when the server advertises it. The dial timeout is 10s and the whole SMTP session has a 30s deadline, so a black-holed relay can't hang the auth handler.
+When the frontend and API run on different hosts and the browser talks to the API domain directly, you must set `COOKIE_DOMAIN` — otherwise the browser cannot read the CSRF cookie: every write request returns `403 CSRF validation failed` while reads work fine. Use the narrowest parent domain that covers both hosts (`.agent.example.com` over `.example.com`). It spreads the sign-in session cookie to every host under that domain, which is only acceptable when all of those hosts are operated by the same trusted party. After changing it, clear the old cookies on both hosts and sign in again. If you follow the same-origin recipe in the [self-host quickstart](/self-host-quickstart#3-choose-how-to-access) (the browser only visits the app domain), keep it empty. Do not use an IP address — browsers ignore cookies whose Domain is an IP.
-**Behavior when neither is set**: the server does not error, but every email that should have been sent (verification codes, invite links) **is written to the server's stdout only**. Convenient for local development — copy the code out of the server logs; **in production, forgetting to set this creates a silent black hole**, with users never receiving email and no error surfaced.
+<Callout type="warning">
+Self-hosted deployments must set `FRONTEND_ORIGIN`. Without it, invitation links, cookie security attributes, and WebSocket origin checks can all disagree with your actual domain.
+</Callout>
-## Google OAuth configuration
+## Email and sign-in
-Optional. Leave unset for email + verification code only; configure it to add "Sign in with Google" on the sign-in page.
+### Resend
| Variable | Default | Description |
|---|---|---|
-| `GOOGLE_CLIENT_ID` | empty | Google Cloud OAuth client ID |
-| `GOOGLE_CLIENT_SECRET` | empty | Google Cloud OAuth secret |
-| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | OAuth callback URL (self-host: replace with your frontend domain) |
+| `RESEND_API_KEY` | empty | Setting it enables Resend |
+| `RESEND_FROM_EMAIL` | `[email protected]` | Sender address; must belong to a verified domain |
-**Takes effect at runtime**: the frontend reads these settings via `/api/config` at runtime, so **changing them requires no frontend rebuild or redeploy** — restart the server and they apply.
+### SMTP
-Full setup (including Google Cloud Console steps) is in [Sign-in and signup configuration](/auth-setup#google-oauth-configuration).
-
-## File storage configuration
-
-Multica stores user-uploaded attachments (images and files in comments). **S3 is preferred**; if S3 is not configured, it falls back to local disk.
-
-### S3 / S3-compatible storage
+SMTP takes priority over Resend whenever `SMTP_HOST` is non-empty.
| Variable | Default | Description |
|---|---|---|
-| `S3_BUCKET` | empty | **Bucket name only** (for example `my-bucket`). Do **not** include the `.s3.<region>.amazonaws.com` suffix — the server constructs the public host from `S3_BUCKET` + `S3_REGION`. Setting this enables S3 storage |
-| `S3_REGION` | `us-west-2` | AWS region. Must match the bucket's actual region — it is used both for SDK signing and for building the public URL |
-| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | empty | Static credentials. When both are unset, the AWS SDK default credential chain is used (IAM role / environment credentials) |
-| `AWS_ENDPOINT_URL` | empty | Custom S3-compatible endpoint (for example [MinIO](https://min.io/)). Setting this switches to path-style URLs |
-| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | Attachment download path: `auto`, `cloudfront`, `presign`, or `proxy`. In `auto`, CloudFront is preferred when fully configured; internal/private endpoint hosts use the server proxy; public S3-compatible endpoints use presigned GET URLs when supported |
-| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | TTL for CloudFront signed URLs and S3 presigned download URLs. Accepts Go duration strings |
-
-**When `S3_BUCKET` is unset**: the server logs `"S3_BUCKET not set, cloud upload disabled"` at startup, and all uploads fall back to local disk.
-
-**Stored object URLs** are constructed in this order of priority:
-
-1. `https://<CLOUDFRONT_DOMAIN>/<key>` if `CLOUDFRONT_DOMAIN` is set.
-2. `<AWS_ENDPOINT_URL>/<S3_BUCKET>/<key>` (path-style) if `AWS_ENDPOINT_URL` is set.
-3. `https://<S3_BUCKET>.s3.<S3_REGION>.amazonaws.com/<key>` (virtual-hosted-style). When `S3_BUCKET` contains dots, the server falls back to `https://s3.<S3_REGION>.amazonaws.com/<S3_BUCKET>/<key>` (path-style) because the AWS-issued wildcard TLS certificate does not validate dotted bucket hosts.
+| `SMTP_HOST` | empty | SMTP host; setting it enables SMTP |
+| `SMTP_PORT` | `25` | Common values: 25, 587, 465 |
+| `SMTP_USERNAME` | empty | Username; leave empty for anonymous relays |
+| `SMTP_PASSWORD` | empty | Password |
+| `SMTP_FROM_EMAIL` | falls back to `RESEND_FROM_EMAIL` | Envelope From and message From |
+| `SMTP_TLS` | `starttls` | `implicit`, `smtps`, or `ssl` means implicit TLS; port 465 enables it automatically |
+| `SMTP_TLS_INSECURE` | `false` | Skips certificate verification; trusted internal networks only |
+| `SMTP_EHLO_NAME` | hostname | EHLO/FQDN required by strict relays |
-API `download_url` values use `GET /api/attachments/{id}/download` unless CloudFront signing is configured. The endpoint redirects to CloudFront/S3 presigned URLs when safe, or streams through the server for private/internal endpoints such as `http://rustfs:9000`. For Docker/VPC-only object stores, set `ATTACHMENT_DOWNLOAD_MODE=proxy` if auto detection is not conservative enough for your network.
-
-### Local disk (when S3 is not configured)
+### Google OAuth
| Variable | Default | Description |
|---|---|---|
-| `LOCAL_UPLOAD_DIR` | `./data/uploads` | Local storage directory |
-| `LOCAL_UPLOAD_BASE_URL` | empty (returns relative paths) | Public base URL — leave unset and the frontend can't resolve a full URL for attachments |
-
-### CloudFront (optional)
-
-If you front S3 with CloudFront, three variables apply: `CLOUDFRONT_DOMAIN`, `CLOUDFRONT_KEY_PAIR_ID`, `CLOUDFRONT_PRIVATE_KEY` (or `CLOUDFRONT_PRIVATE_KEY_SECRET` to read from Secrets Manager). Skip them if you don't use CloudFront — they don't conflict with S3 configuration.
+| `GOOGLE_CLIENT_ID` | empty | Google OAuth client ID |
+| `GOOGLE_CLIENT_SECRET` | empty | Google OAuth client secret |
+| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | Must exactly match the callback URL in the Google Console |
-### Cookie domain
+### Signup scope
| Variable | Default | Description |
|---|---|---|
-| `COOKIE_DOMAIN` | empty | Scope of the session cookie |
+| `ALLOW_SIGNUP` | `true` | Whether new accounts can be created when no allowlist is configured |
+| `ALLOWED_EMAILS` | empty | Full email addresses allowed to sign up, comma-separated |
+| `ALLOWED_EMAIL_DOMAINS` | empty | Email domains allowed to sign up, comma-separated |
+| `DISABLE_WORKSPACE_CREATION` | `false` | Blocks all users from creating workspaces; no owner/admin exception |
+| `MULTICA_DEV_VERIFICATION_CODE` | empty | Fixed 6-digit test code for non-production environments |
-- **Empty**: the cookie is valid only on the exact host visited (correct for single-host deployments)
-- **Set to `.example.com`**: the cookie is shared across subdomains (so `app.example.com` and `api.example.com` share a sign-in session)
-- **Required, not optional, when the frontend and backend are on different hostnames**: the browser has to read the `multica_csrf` cookie from the page's own origin, and without it every write request fails with `403 CSRF validation failed` while reads keep working
-- Use the **narrowest** parent domain that still covers both hosts (`.agent.example.com`, not `.example.com`). It also scopes the `multica_auth` session cookie to every host under that domain, so only use this layout when they are all operated by the same trusted party — see [Self-Hosting](/getting-started/self-hosting) for the full configuration
-- Warning: it cannot be an IP address (browsers ignore it)
+For the exact allowlist evaluation order, see [Sign-in and signup](/auth-setup#signup-restrictions).
-## Restricting who can sign up
+## Attachment storage
-Three allowlist layers combine by priority. **If any layer is set to a non-empty value, emails that don't match are rejected** — even `ALLOW_SIGNUP=true` won't override that.
-
-| Variable | Default | Description |
-|---|---|---|
-| `ALLOWED_EMAILS` | empty | Explicit email allowlist (comma-separated). When non-empty, only listed emails can sign up |
-| `ALLOWED_EMAIL_DOMAINS` | empty | Domain allowlist (comma-separated). When non-empty, only listed domains can sign up |
-| `ALLOW_SIGNUP` | `true` | Signup master switch. Set `false` to disable signup entirely |
+When `S3_BUCKET` is unset, Multica uses local disk.
-**The counterintuitive part**: `ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true` does **not** mean "allow company.io or everyone" — it means **only allow company.io**. The allowlist layers are AND semantics — the full decision tree is in [Sign-in and signup configuration → Signup allowlists](/auth-setup#restricting-who-can-sign-up).
-
-**Invite flows themselves do not check the signup allowlist** — but the invitee must still be able to **sign in** before accepting the invite. If they already have a Multica account (for example from another workspace), they can accept directly, unaffected by the allowlist; **if they have never signed up**, the first step of sign-in (requesting a verification code) still passes through the allowlist check, and an email rejected by `ALLOW_SIGNUP=false` or by `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS` **cannot finish signup, and therefore cannot accept the invite**.
-
-## Locking down workspace creation
-
-`ALLOW_SIGNUP=false` blocks new accounts, but it does **not** block an already-signed-in user from creating another workspace via `POST /api/workspaces`. On a self-hosted instance where every issue, repo, and agent must be visible to the platform admin, set `DISABLE_WORKSPACE_CREATION=true` to close that gap.
+### S3 or compatible storage
| Variable | Default | Description |
|---|---|---|
-| `DISABLE_WORKSPACE_CREATION` | `false` | When `true`, every call to `POST /api/workspaces` returns `403 workspace creation is disabled for this instance`. The web UI hides every "Create workspace" affordance via `/api/config`. There is no role/owner exception — the gate is global per instance |
-
-Recommended bootstrap sequence:
-
-1. Start the instance with `DISABLE_WORKSPACE_CREATION` unset (the default).
-2. Sign in as the admin and create the shared workspace.
-3. Set `DISABLE_WORKSPACE_CREATION=true` and restart the backend. From this point on, users join via invitation only.
-
-If you also want to keep `ALLOW_SIGNUP=true` so invited users can finish signup with their first verification code, combine `DISABLE_WORKSPACE_CREATION=true` with `ALLOWED_EMAIL_DOMAINS` / `ALLOWED_EMAILS` to scope which addresses can sign up. Setting `ALLOW_SIGNUP=false` will additionally block pending invitees from creating their account at all — useful only on instances where every member already has a Multica account.
+| `S3_BUCKET` | empty | Bucket name; do not use the full hostname |
+| `S3_REGION` | `us-west-2` | Region the bucket lives in |
+| `AWS_ACCESS_KEY_ID` | SDK default credential chain | Static access key |
+| `AWS_SECRET_ACCESS_KEY` | SDK default credential chain | Static secret key |
+| `AWS_ENDPOINT_URL` | empty | S3-compatible endpoint such as MinIO |
+| `S3_USE_PATH_STYLE` | `true` with a custom endpoint | Whether to use path-style addressing |
+| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | `auto`, `cloudfront`, `presign`, or `proxy` |
+| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | Lifetime of signed download URLs |
-## Rate limiting (optional Redis)
+Use `ATTACHMENT_DOWNLOAD_MODE=proxy` when the endpoint — an internal MinIO, for example — is not reachable from the browser.
-Public auth endpoints — `/auth/send-code`, `/auth/verify-code`, `/auth/google` — have per-IP fixed-window rate limiting in front of them. The limiter is backed by Redis. When `REDIS_URL` is unset the middleware is a **no-op** (fail-open) and the backend logs `rate limiting disabled: REDIS_URL not configured` at startup.
+### Local disk
| Variable | Default | Description |
|---|---|---|
-| `REDIS_URL` | empty | Redis connection URL (for example `redis://localhost:6379/0`). When unset, rate limiting on auth endpoints is disabled. The same Redis is also used by the realtime hub fan-out, the PAT cache, and the daemon-token cache — they all fall back to in-memory / direct-DB mode when unset |
-| `REDIS_DISABLE_CLIENT_NAME` | `false` | Set to `true` to skip the `CLIENT SETNAME` handshake on every Redis connection. **Required** for managed Redis providers that block the `CLIENT` command, such as GCP Memorystore or AWS ElastiCache with restricted ACLs. When enabled, connections lose their descriptive name in `CLIENT LIST` output but gain compatibility with restricted providers |
-| `RATE_LIMIT_AUTH` | `5` | Max requests per IP per minute against `/auth/send-code` and `/auth/google` |
-| `RATE_LIMIT_AUTH_VERIFY` | `20` | Max requests per IP per minute against `/auth/verify-code` |
-| `RATE_LIMIT_TRUSTED_PROXIES` | empty | Comma-separated CIDRs whose `X-Forwarded-For` header the limiter is allowed to trust. Empty (the default) means **never trust XFF** — the limiter only uses the direct connection's `RemoteAddr` |
+| `LOCAL_UPLOAD_DIR` | `./data/uploads` | Directory for files and metadata; needs a persistent volume |
+| `LOCAL_UPLOAD_BASE_URL` | empty | Optional public base URL; when empty, in-app relative URLs are returned |
-When a request is over the limit, the server replies with `429 Too Many Requests`, `Retry-After: 60`, and body `{"error":"too many requests"}`.
+### CloudFront
-<Callout type="warning">
-**Behind a reverse proxy you must set `RATE_LIMIT_TRUSTED_PROXIES`.** Otherwise every real user shares the proxy's IP from the backend's point of view, the whole deployment ends up in one bucket, and `/auth/send-code` becomes 5 req/min for the entire site. Typical values: `127.0.0.1/32,::1/128` for a same-host Caddy / Nginx; the CDN's published ranges for Cloudflare / ALB / CloudFront. Only IPs whose `RemoteAddr` falls inside one of these CIDRs may use `X-Forwarded-For` to identify the client.
-</Callout>
-
-This separate `RATE_LIMIT_TRUSTED_PROXIES` is **not** the same as `MULTICA_TRUSTED_PROXIES`, which controls the autopilot-webhook limiter (`/api/webhooks/autopilots/{token}`). Each limiter parses its own list, so a deployment behind a proxy should set both.
+| Variable | Description |
+|---|---|
+| `CLOUDFRONT_DOMAIN` | CDN domain |
+| `CLOUDFRONT_KEY_PAIR_ID` | CloudFront key pair ID |
+| `CLOUDFRONT_PRIVATE_KEY` | Full private key |
+| `CLOUDFRONT_PRIVATE_KEY_SECRET` | Use when reading the private key from Secrets Manager |
-## Daemon tuning parameters
-
-The daemon runs on the user's local machine, and its config is read from local environment variables too. The common ones:
+## Redis and rate limiting
| Variable | Default | Description |
|---|---|---|
-| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | Server address (self-host: replace with your domain) |
-| `MULTICA_DAEMON_DEVICE_NAME` | hostname | Human-readable device label shown in the Runtimes UI |
-| `MULTICA_AGENT_RUNTIME_NAME` | built-in default | Runtime display name |
-| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | Heartbeat interval |
-| `MULTICA_DAEMON_POLL_INTERVAL` | `3s` | Task polling interval |
-| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | Max concurrent tasks |
-| `MULTICA_AGENT_TIMEOUT` | `0` | Absolute wall-clock cap per agent run. `0` disables the cap and lets the inactivity watchdogs alone bound long runs. Set a positive Go duration when you want a hard resource/cost ceiling |
-| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex-specific inactivity watchdog window |
-| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex `app-server` startup RPC timeout |
-| `MULTICA_DAEMON_AUTO_UPDATE` | cloud: `true`, self-host: `false` | Set to `false`/`0`/`no`/`off` to turn off the daemon's periodic CLI self-update; `true`/`1`/`yes`/`on` opts a self-host daemon into upstream updates |
-| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | How often the daemon polls GitHub for a newer CLI release |
-| `MULTICA_AGENT_IDLE_WATCHDOG` | `30m` | Global no-message watchdog for runs with no tool in flight. `0` disables the whole watchdog, including provider-specific overrides |
-| `MULTICA_OPENCODE_IDLE_WATCHDOG` | `10m` | OpenCode-specific no-message window for missing first tokens or stalled streams. `0` falls back to `MULTICA_AGENT_IDLE_WATCHDOG`; larger values cannot extend that global bound |
-| `MULTICA_AGENT_TOOL_WATCHDOG` | `2h` | Silence budget while a tool call is in flight. `0` disables the stuck-tool backstop |
-| `MULTICA_<PROVIDER>_PATH` | matches the CLI name | Path to each AI coding tool's executable (for example `MULTICA_CLAUDE_PATH`) |
-| `MULTICA_<PROVIDER>_MODEL` | empty | Default model for each AI coding tool |
-| `MULTICA_<PROVIDER>_ARGS` | empty | Daemon-wide default CLI arguments for a backend, applied to every task before each agent's own `custom_args`. Supported for `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, and `MULTICA_CODEBUDDY_ARGS` |
-
-For a full explanation of how each parameter affects daemon behavior, see [Daemon and runtimes](/daemon-runtimes).
-
-### Persisting daemon settings in `config.json`
-
-Every daemon knob in the table above — `device_name`, `runtime_name`, `max_concurrent_tasks`, `poll_interval`, `heartbeat_interval`, `agent_timeout`, `codex_semantic_inactivity_timeout`, `codex_handshake_timeout`, `disable_auto_update`, `auto_update_check_interval` — can also be persisted in the profile's `~/.multica/config.json` (or `~/.multica/profiles/<name>/config.json`) so you don't have to re-pass flags or export env vars on every `daemon start`. Set them with:
+| `REDIS_URL` | empty | Used for auth rate limiting, realtime events, and the token cache; when unset, realtime events fall back to in-process memory and auth rate limiting is off |
+| `REDIS_DISABLE_CLIENT_NAME` | `false` | Set `true` when a managed Redis blocks `CLIENT SETNAME` |
+| `RATE_LIMIT_AUTH` | `5` | Per-IP requests per minute to send a verification code or start Google sign-in |
+| `RATE_LIMIT_AUTH_VERIFY` | `20` | Per-IP code verifications per minute |
+| `RATE_LIMIT_TRUSTED_PROXIES` | empty | Comma-separated proxy CIDRs allowed to provide `X-Forwarded-For` |
+| `MULTICA_TRUSTED_PROXIES` | empty | Trusted proxy CIDRs for automation webhooks and realtime connections |
-```bash
-multica config set device_name my-vm-custom-name
-multica config set runtime_name worker-a
-multica config set max_concurrent_tasks 8
-multica config set poll_interval 10s # Go duration, must be > 0
-multica config set heartbeat_interval 30s
-multica config set agent_timeout 1h # or 0s to explicitly disable the cap
-multica config set codex_semantic_inactivity_timeout 15m
-multica config set codex_handshake_timeout 45s
-multica config set disable_auto_update true # single-direction: only turns auto-update off
-multica config set auto_update_check_interval 12h
-```
-
-Duration keys accept any positive Go duration (`500ms`, `10s`, `1m30s`, ...). Values ≤ 0 (`0s`, `-5s`) and un-parseable strings are rejected at `config set` time — **except `agent_timeout`, where `0s` is a meaningful "disable the wall-clock cap" sentinel** (negative values are still rejected). To clear a persisted value and fall back to the env / built-in default, pass an empty string: `multica config set poll_interval ""`.
+Deployments behind a reverse proxy must list their real proxy ranges. Do not blanket-trust all sources, or clients can forge forwarded IPs.
-`disable_auto_update` is a single-direction bool: setting it to `true` turns off the daemon's periodic CLI self-update, and setting it to `false` (or clearing with `""`) hands the decision back to `MULTICA_DAEMON_AUTO_UPDATE` / the cloud-vs-self-host default. It cannot be used to *force* auto-update on from the config file.
+The `RATE_LIMIT_*` variables above only take effect once `REDIS_URL` is set; without it, the startup log notes that rate limiting is disabled. If Redis becomes temporarily unavailable, the limiter fails open and does not block normal sign-ins.
-Precedence, highest first: `--flag` on `daemon start` > `MULTICA_…` env var > `config.json` value > built-in default. A live env override (typical for systemd units) always wins over the file, and an explicit CLI flag wins over both.
+## External integrations
-This is especially useful when running multiple daemons on one host via `--profile <name>`: each profile can pin its own `device_name` so the Runtimes UI shows distinct rows instead of collapsing them under the shared hostname.
+| Integration | Variable | Description |
+|---|---|---|
+| GitHub | `GITHUB_APP_SLUG` | GitHub App slug |
+| GitHub | `GITHUB_WEBHOOK_SECRET` | Webhook HMAC and connect-state signing secret |
+| GitHub | `GITHUB_APP_ID` | Needed for CI status and mergeability on PR cards and the "pick from GitHub" repository picker |
+| GitHub | `GITHUB_APP_PRIVATE_KEY` | Full PEM private key paired with the App ID; same uses as above |
+| Lark | `MULTICA_LARK_SECRET_KEY` | Base64-encoded 32-byte credential encryption key |
+| Slack | `MULTICA_SLACK_SECRET_KEY` | Base64-encoded 32-byte token encryption key |
+| Composio | `COMPOSIO_API_KEY` | Enables Composio tool connections |
+| Composio | `COMPOSIO_CALLBACK_BASE_URL` | Callback API URL; can fall back to `MULTICA_PUBLIC_URL` |
+| Composio | `COMPOSIO_STATE_SECRET` | OAuth state signing secret; can be derived from `JWT_SECRET` |
+| Self-hosted Git | `MULTICA_VCS_INTEGRATION_ENABLED` | Forgejo/Gitea/GitLab integration switch; enabled by default in compose |
+| Self-hosted Git | `MULTICA_VCS_SECRET_KEY` | Base64-encoded 32-byte encryption key (`openssl rand -base64 32`); the feature is entirely unavailable without it |
-### Default agent arguments (`MULTICA_<PROVIDER>_ARGS`)
+Without `GITHUB_APP_ID` and the private key, PRs still link, mirror, and trigger merge-to-done normally, but cards show no CI or mergeability status, and the "pick from GitHub" repository entry is disabled.
-These set a **fleet-wide default** layer of CLI flags for a backend — a convenient way to apply a default cost or resource baseline (for example `--max-turns`) across every agent on a daemon without editing each agent's `custom_args` individually. This is a default layer, not a hard ceiling: per-agent `custom_args` are appended afterward and can override it (see **Precedence** below).
+For setup steps, see [GitHub integration](/github-integration#self-hosting-setup), [Lark bot](/lark-bot-integration#self-hosting-setup), and [Slack bot](/slack-bot-integration#self-hosting-setup).
-- **Precedence:** the default args are applied first, then each agent's own `custom_args` are appended after. For flags that take a value, the downstream CLI's own argument parser decides the winner (last occurrence wins for most tools), so an individual agent can raise a daemon default but the default still applies wherever the agent doesn't override it.
-- **Parsing:** the value is split with POSIX shell-word rules, so quoting works — `MULTICA_CLAUDE_ARGS='--append-system-prompt "multi word"'` parses into two tokens.
-- **Safety:** both the default-args and per-agent `custom_args` layers pass through the same blocked-flags filter, so protocol-critical flags (such as `-p`, `--output-format`, `--input-format`, `--permission-mode`, `--mcp-config` for Claude, and `--listen` for Codex) cannot be injected through either layer.
-- **Unset/empty** means no change to behavior.
+## Server-side LLM
-## Frontend access control
+This group configures server-side assist generation, such as conversation titles; it is not the AI coding tool credentials agents use to execute tasks.
| Variable | Default | Description |
|---|---|---|
-| `FRONTEND_ORIGIN` | empty | Frontend address. Invite email links, the CORS allowlist, and the cookie domain are all derived from this. When unset, invite email links fall back to the hosted domain `https://multica.ai` — self-host must set this explicitly |
-| `MULTICA_APP_URL` | empty | Frontend URL for CLI login flow. Also used by the web UI to show self-host daemon setup commands with your app domain; for same-origin deployments this is also used as daemon `server_url` when `MULTICA_PUBLIC_URL` is unset |
-| `MULTICA_PUBLIC_URL` | empty | Public API URL, without trailing slash. Used for autopilot webhook URLs and by the web UI as the daemon `server_url` |
-| `CORS_ALLOWED_ORIGINS` | empty | Additional allowed CORS origins (comma-separated) |
-| `ALLOWED_ORIGINS` | empty | WebSocket-specific origin allowlist (comma-separated); when unset, fallback order is `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174` |
+| `MULTICA_LLM_API_KEY` | empty | OpenAI-compatible API key |
+| `MULTICA_LLM_BASE_URL` | empty | OpenAI-compatible endpoint |
+| `MULTICA_LLM_DEFAULT_MODEL` | built-in default | Used when a request does not specify a model |
-<Callout type="warning">
-**Leaving `FRONTEND_ORIGIN` unset creates two silent failures**: (1) invite email links point at `https://multica.ai` (the hosted domain), and clicking them doesn't bring users back to your self-hosted instance; (2) WebSocket Origin checks fall back to `localhost:3000 / 5173 / 5174`, so every WebSocket connection in a production deployment is rejected and the frontend appears to "lose real-time updates."
-</Callout>
+When both the API key and base URL are empty, server-side LLM generation is off and callers use local fallback logic.
-## GitHub integration
+## Daemon configuration
-The [GitHub PR ↔ issue integration](/github-integration) needs `GITHUB_APP_SLUG` and `GITHUB_WEBHOOK_SECRET` to enable Connect GitHub in Settings and accept incoming webhooks. `GITHUB_APP_ID` and `GITHUB_APP_PRIVATE_KEY` are additionally **required** for the PR card's CI status and mergeability — without them the integration still mirrors PRs and auto-links issues, but the card shows no CI or merge status.
+The variables below are read on the computer that runs your agents, not in the API container.
| Variable | Default | Description |
|---|---|---|
-| `GITHUB_APP_SLUG` | empty | The slug of your GitHub App (the tail of `https://github.com/apps/<slug>`). Drives the Settings → GitHub install button URL |
-| `GITHUB_WEBHOOK_SECRET` | empty | The Webhook secret you set on the GitHub App. Used for HMAC-SHA256 verification of every `pull_request` / `installation` delivery, and as the HMAC key for the setup-callback state token |
-| `GITHUB_APP_ID` | empty | Numeric App ID from the App's settings page. Required (with `GITHUB_APP_PRIVATE_KEY`) for PR-card CI status and mergeability, Settings → Repositories → Choose from GitHub, and fetching the connected account name on install |
-| `GITHUB_APP_PRIVATE_KEY` | empty | Full App RSA private-key PEM block (including `-----BEGIN/END-----` lines, newlines preserved). Required (with `GITHUB_APP_ID`) for App-authenticated PR snapshots and repository browsing |
-
-**Behavior when either of the required variables is unset:**
+| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | Multica API / WebSocket URL; also accepts `http(s)` |
+| `MULTICA_DAEMON_DEVICE_NAME` | hostname | Device name shown in the runtime list |
+| `MULTICA_AGENT_RUNTIME_NAME` | `Local Agent` | Runtime display name |
+| `MULTICA_DAEMON_POLL_INTERVAL` | `30s` | Task polling interval when no wake event arrives |
+| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | Heartbeat interval |
+| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | Concurrent task ceiling per daemon |
+| `MULTICA_AGENT_TIMEOUT` | `0` | Absolute time limit per run; `0` means no limit |
+| `MULTICA_AGENT_IDLE_WATCHDOG` | `30m` | Silence ceiling with no output and no tool execution |
+| `MULTICA_AGENT_TOOL_WATCHDOG` | `2h` | Silence ceiling for a single tool call |
+| `MULTICA_OPENCODE_IDLE_WATCHDOG` | `10m` | OpenCode-specific silence threshold |
+| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex semantic-silence threshold |
+| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex app-server startup handshake ceiling |
+| `MULTICA_DAEMON_AUTO_UPDATE` | Cloud `true`; self-hosted `false` | Whether to check for and apply CLI updates automatically |
+| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | Update check interval |
+| `MULTICA_WORKSPACES_ROOT` | `~/multica_workspaces` | Root directory for task working directories |
+| `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | Keep task directories for debugging |
+
+Each AI coding tool accepts `MULTICA_<PROVIDER>_PATH` and `MULTICA_<PROVIDER>_MODEL` to override the command path and default model. Machine-wide default arguments via `MULTICA_<PROVIDER>_ARGS` are currently supported for four tools: Claude Code, Codex, CodeBuddy, and Qwen Code. The variables are `MULTICA_CLAUDE_ARGS`, `MULTICA_CODEX_ARGS`, `MULTICA_CODEBUDDY_ARGS`, and `MULTICA_QWEN_ARGS`. For example:
+
+```dotenv
+MULTICA_CLAUDE_PATH=/opt/bin/claude
+MULTICA_CLAUDE_ARGS=--max-turns 40
+```
-- `Connect GitHub` in Settings → GitHub is **disabled** and shows a "not configured" hint to admins.
-- The `/api/webhooks/github` endpoint returns **`503 github webhooks not configured`** — Multica refuses to process events with no secret rather than treating every signature as valid.
+Precedence is command-line flag → environment variable → `~/.multica/config.json` → built-in default. For watchdog behavior, see [Daemon and runtimes](/daemon-runtimes).
-**Behavior when `GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY` are unset:**
+### Persisting daemon configuration
-- The PR card shows **no CI status or mergeability** — the integration degrades cleanly: PRs still mirror, and issues still auto-link and move to Done on merge.
-- The connection card also briefly shows `Connected to unknown` after install. Multica refreshes the row to the real org/user name as soon as GitHub delivers the `installation.created` webhook (typically within a few seconds), and broadcasts a realtime update so any open Settings → GitHub tab reflects the change without a manual refresh.
-- Settings → Repositories → Choose from GitHub is disabled because the server cannot mint the installation token needed to list repositories.
+Common daemon-side settings can also be written to `~/.multica/config.json` instead of relying on shell environment variables; named profiles keep theirs at `~/.multica/profiles/<name>/config.json`:
-**Note:** `GITHUB_WEBHOOK_SECRET` is reused as the signing key for the install-flow state token, so operators only need to manage one secret. It is **not** the GitHub App's *Client* secret — Client secrets are OAuth-related and not used by this integration. See [GitHub integration → Self-host setup](/github-integration#self-host-setup) for the full walkthrough.
+```bash
+multica config set poll_interval 10s
+multica config show
+```
-## Usage analytics
+Supported keys:
-By default, the server reports to Multica's official PostHog instance. To opt out, set `ANALYTICS_DISABLED=true`.
+| Key | Default | Description |
+|---|---|---|
+| `server_url` | `ws://localhost:8080/ws` | Multica API / WebSocket URL |
+| `app_url` | empty | Web URL used for browser sign-in |
+| `workspace_id` | empty | Default workspace |
+| `device_name` | hostname | Device name shown in the runtime list |
+| `runtime_name` | `Local Agent` | Runtime display name |
+| `max_concurrent_tasks` | `20` | Concurrent task ceiling; `0` or empty means unset |
+| `poll_interval` | `30s` | Task polling interval |
+| `heartbeat_interval` | `15s` | Heartbeat interval |
+| `agent_timeout` | unlimited | Absolute time limit per run |
+| `codex_semantic_inactivity_timeout` | `10m` | Codex semantic-silence threshold |
+| `codex_handshake_timeout` | `30s` | Codex app-server handshake ceiling |
+| `disable_auto_update` | follows environment | `true` turns auto-update off; `false` clears the local override and returns to the env var or default |
+| `auto_update_check_interval` | `6h` | Update check interval |
+
+A few value rules:
+
+- Duration keys accept positive Go durations (such as `10s`, `2h`); `0s` and negative values are rejected. The one exception is `agent_timeout`: `0s` is valid and explicitly disables the run time limit.
+- Passing an empty string clears a persisted value and falls back to the env var or built-in default, for example `multica config set poll_interval ""`.
+- `max_concurrent_tasks` requires a non-negative integer.
+
+## Observability and analytics
| Variable | Default | Description |
|---|---|---|
-| `ANALYTICS_DISABLED` | `false` | Set `true` to disable backend analytics entirely |
-| `POSTHOG_API_KEY` | built-in default key | Set when pointing at your own PostHog instance |
-| `POSTHOG_HOST` | `https://us.i.posthog.com` | Change to your own host if you self-host PostHog |
+| `ANALYTICS_DISABLED` | `false` | Set `true` to turn off PostHog reporting |
+| `POSTHOG_API_KEY` | empty | Reporting is off when unset; set it to use your own PostHog project |
+| `POSTHOG_HOST` | `https://us.i.posthog.com` | PostHog host |
+| `METRICS_ADDR` | empty | Prometheus metrics listen address; empty means not started |
+| `REALTIME_METRICS_TOKEN` | empty | Bearer token protecting `/health/realtime` |
-## Next
+## Next steps
-- [Sign-in and signup configuration](/auth-setup) — how to actually configure the auth-related variables above and where the traps are
-- [GitHub integration](/github-integration) — how to set up the GitHub App that backs `GITHUB_APP_SLUG` / `GITHUB_WEBHOOK_SECRET`
-- [Troubleshooting](/troubleshooting) — symptoms and fixes for common misconfigurations
-- [Daemon and runtimes](/daemon-runtimes) — what the `MULTICA_DAEMON_*` parameters actually do
+- [Sign-in and signup](/auth-setup) — sign-in methods and signup restrictions.
+- [Troubleshooting](/troubleshooting) — symptom-based diagnosis of deployment problems.
+- [Daemon and runtimes](/daemon-runtimes) — the daemon-side counterparts of this configuration.
diff --git a/apps/docs/content/docs/environment-variables.zh.mdx b/apps/docs/content/docs/environment-variables.zh.mdx
index 68e75636b0..56801e0b08 100644
--- a/apps/docs/content/docs/environment-variables.zh.mdx
+++ b/apps/docs/content/docs/environment-variables.zh.mdx
@@ -1,292 +1,267 @@
---
title: 环境变量
-description: self-host Multica 服务器需要配置的环境变量清单。
+description: 自托管 Multica 常用的服务端、存储、集成和运行时配置。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica 的 [自部署](/self-host-quickstart) 服务器启动时从环境变量读取配置——数据库、登录、邮件、存储、注册白名单都在这里配。这一页按用途分组给完整清单:每组说清楚**不设会怎样**、**生产必须设哪几个**。Auth 相关那几个怎么真正配见 [登录与注册配置](/auth-setup)。
+Multica 在进程启动时读取环境变量。修改后通常需要重启对应的 API、Web 或守护进程。Docker Compose 的 `docker compose restart` 不会重新读取 `.env`,要用 `up -d` 重建容器才能生效。
-## 核心 server 环境变量
+本页只列面向部署者的配置;测试变量和内部任务变量不在这里展开。本页是分组参考;完整部署步骤见[自托管快速上手](/self-host-quickstart)。
-这些是你部署前必须考虑的核心变量——有些有默认值能让 server 启动,但生产环境里你应该显式配置必填项。
+## 生产环境最小配置
-| 环境变量 | 默认值 | 生产必须设? |
-|---|---|---|
-| `DATABASE_URL` | `postgres://multica:multica@localhost:5432/multica?sslmode=disable` | **是** |
-| `PORT` | `8080` | 否(除非换端口)|
-| `JWT_SECRET` | `multica-dev-secret-change-in-production` | **是**(默认值不安全)|
-| `APP_ENV` | 空 | **是**(必须 `production`)|
-| `FRONTEND_ORIGIN` | 空 | **是**(self-host 要填你自己的域名)|
-| `MULTICA_DEV_VERIFICATION_CODE` | 空 | 否(生产必须保持为空)|
-| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | 否。收到 `SIGTERM`/`SIGINT` 后、开始优雅退出前的可选等待时间。接受 `300s`、`5m` 等非负 Go duration;留空或设为 `0` 时立即开始退出 |
+```dotenv
+DATABASE_URL=postgres://user:password@postgres:5432/multica?sslmode=require
+JWT_SECRET=<long-random-secret>
+APP_ENV=production
+FRONTEND_ORIGIN=https://multica.example.com
+MULTICA_APP_URL=https://multica.example.com
+MULTICA_PUBLIC_URL=https://api.multica.example.com
+```
-在 Kubernetes 中使用 `MULTICA_SHUTDOWN_HOLD_DURATION` 时,`terminationGracePeriodSeconds` 必须大于 hold 时长与后续优雅退出预算之和。如果两者配置成相同时长,kubelet 可能在清理完成前发送 `SIGKILL`。
+还需要选择一种邮件服务,否则验证码和邀请只会写入服务端日志。
<Callout type="warning">
-**生产环境保持 `MULTICA_DEV_VERIFICATION_CODE` 为空。** 固定本地测试验证码默认关闭;如果你设置 `MULTICA_DEV_VERIFICATION_CODE=888888`,在 `APP_ENV` 非 production 时,任何能请求验证码的人都能用这个固定值登录。`APP_ENV=production` 时该快捷码会被忽略。
+不要在生产环境使用默认的 `JWT_SECRET`,也不要设置 `MULTICA_DEV_VERIFICATION_CODE`。
</Callout>
-### 数据库连接池
+## API 与数据库
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `DATABASE_MAX_CONNS` | `25` | pgxpool 最大连接数。守护进程高频轮询(每 3 秒)会占用连接;大规模部署可能需要调高 |
-| `DATABASE_MIN_CONNS` | `5` | 最小常驻连接 |
-
-**不设时**使用上表默认值,**不是** pgx 内置的 4/NumCPU——后者在生产曾引发连接池耗尽。
+| `DATABASE_URL` | 本地 `multica` 数据库 | PostgreSQL 连接地址 |
+| `DATABASE_MAX_CONNS` | `25` | 单个 API 进程的最大数据库连接数 |
+| `DATABASE_MIN_CONNS` | `5` | 单个 API 进程保留的最小连接数 |
+| `PORT` | `8080` | API 监听端口 |
+| `JWT_SECRET` | 开发用固定值 | 登录 JWT、部分签名流程使用的密钥 |
+| `APP_ENV` | 空 | 生产环境设为 `production` |
+| `AUTH_TOKEN_TTL` | `720h`(30 天) | 浏览器 JWT 与 cookie 有效期;接受 Go duration 或正整数秒数 |
+| `LOG_LEVEL` | 应用默认 | 日志级别 |
+| `MULTICA_SHUTDOWN_HOLD_DURATION` | `0` | 收到终止信号后,开始优雅退出前等待多久 |
-## 怎么配邮件
+在 Kubernetes 中设置 shutdown hold 时,`terminationGracePeriodSeconds` 要大于 hold 与实际退出所需时间之和。
-Multica 支持两种邮件发送通道——[Resend](https://resend.com/) 适合公网部署,SMTP relay 适合内网/自部署。同时设置时 `SMTP_HOST` 优先级高于 `RESEND_API_KEY`。
+## 对外地址与浏览器访问
-### Resend
-
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `RESEND_API_KEY` | 空 | Resend API key |
-| `RESEND_FROM_EMAIL` | `[email protected]` | Resend 发件地址(必须是 Resend 账号已验证的域名;`SMTP_FROM_EMAIL` 未设置时,SMTP 也会使用它)|
+| `FRONTEND_ORIGIN` | 空 | 用户访问的前端 origin;用于 CORS、cookie 和邀请链接 |
+| `MULTICA_APP_URL` | 回退到 `FRONTEND_ORIGIN` | 用户可访问的 Web 地址;CLI 登录和账号绑定链接使用它 |
+| `MULTICA_PUBLIC_URL` | 空 | 公网 API 地址;用于 webhook URL 和运行时连接说明 |
+| `CORS_ALLOWED_ORIGINS` | 空 | 额外允许的 HTTP origin,逗号分隔 |
+| `ALLOWED_ORIGINS` | 回退到 CORS / 前端地址 | WebSocket origin 白名单,逗号分隔 |
+| `COOKIE_DOMAIN` | 空 | 前后端不同 host 且浏览器直接访问 API 域时必须设置;单域部署保持为空 |
-### SMTP relay
+前端和 API 使用不同 host、且浏览器直接访问 API 域时,必须设置 `COOKIE_DOMAIN`,否则浏览器读不到 CSRF cookie——所有写请求返回 `403 CSRF validation failed`,而读请求一切正常。取值用能同时覆盖两个 host 的最窄父域(`.agent.example.com` 优于 `.example.com`)。它会把登录会话 cookie 扩散到该域下的所有 host,只有这些 host 都由同一可信主体运维时才可用。修改后需要在两个 host 上清除旧 cookie 并重新登录。若采用[自托管快速上手](/self-host-quickstart#3-选择访问方式)的同源配方(浏览器只访问 app 域),保持为空即可。不要填写 IP 地址,浏览器会忽略带 IP Domain 的 cookie。
-| 环境变量 | 默认值 | 说明 |
-|---|---|---|
-| `SMTP_HOST` | 空 | SMTP relay 主机名。设置后即启用 SMTP 模式并覆盖 Resend |
-| `SMTP_PORT` | `25` | SMTP 端口。STARTTLS 提交端口用 `587`;SMTPS(隐式 TLS,自动启用)用 `465` |
-| `SMTP_USERNAME` | 空 | SMTP 用户名。留空表示未认证 relay |
-| `SMTP_PASSWORD` | 空 | SMTP 密码 |
-| `SMTP_FROM_EMAIL` | 空 | SMTP 的 `MAIL FROM` 和 `From:` 发件地址。未设置时回退到 `RESEND_FROM_EMAIL` |
-| `SMTP_TLS` | `starttls` | TLS 模式。`implicit`(别名 `smtps`、`ssl`)在连接时立即进行 TLS 握手(SMTPS);`465` 端口会自动启用。未设置 / `starttls` 则在连接后通过 STARTTLS 升级 |
-| `SMTP_TLS_INSECURE` | `false` | 设为 `true` 跳过 TLS 证书校验(仅限私有 CA / 自签证书)|
-| `SMTP_EHLO_NAME` | 机器主机名 | 向 relay 通告的 EHLO/HELO 名称。当严格的 relay(例如 Google Workspace `smtp-relay.gmail.com`)拒绝来自公网 IP 的默认问候时,填一个真实的 FQDN——否则 relay 会直接断开连接,并在后续某条命令上表现为一个不知所云的 `EOF` |
-
-服务端 advertise STARTTLS 时会自动升级。dial 超时 10s,整个 SMTP 会话有 30s deadline,避免 relay 黑洞把 auth handler 挂死。
-
-**两种都不设的行为**:server 不会报错,但所有本该发出去的邮件(验证码、邀请链接)**只打到 server 的 stdout**。本地开发方便(你从 server 日志里抄验证码);**生产环境忘记设就是黑洞**,用户收不到邮件也没任何错误提示。
+<Callout type="warning">
+自托管部署需要设置 `FRONTEND_ORIGIN`。缺少它时,邀请链接、cookie 安全属性和 WebSocket origin 校验都可能与实际域名不一致。
+</Callout>
-## 怎么配 Google OAuth
+## 邮件与登录
-可选。不设则只有邮箱 + 验证码登录;设了就在登录页出现「用 Google 登录」。
+### Resend
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `GOOGLE_CLIENT_ID` | 空 | Google Cloud OAuth client ID |
-| `GOOGLE_CLIENT_SECRET` | 空 | Google Cloud OAuth secret |
-| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | OAuth 回调地址(self-host 换成你的前端域名)|
+| `RESEND_API_KEY` | 空 | 设置后启用 Resend |
+| `RESEND_FROM_EMAIL` | `[email protected]` | 发件地址,必须属于已验证域名 |
-**热生效**:前端在运行时通过 `/api/config` 拿这些配置,**改了不用重启前端也不用重建镜像**——改完重启 server 即可。
+### SMTP
-完整配置步骤(含 Google Cloud Console 操作)详见 [登录与注册配置](/auth-setup#怎么配-google-oauth)。
+只要 `SMTP_HOST` 非空,SMTP 就会优先于 Resend。
-## 怎么配文件存储
-
-Multica 存储用户上传的附件(评论里的图片、文件等)。**优先走 S3**;不配 S3 就回落本地磁盘。
+| 变量 | 默认值 | 说明 |
+|---|---|---|
+| `SMTP_HOST` | 空 | SMTP 主机;设置后启用 SMTP |
+| `SMTP_PORT` | `25` | 常见值:25、587、465 |
+| `SMTP_USERNAME` | 空 | 用户名;匿名 relay 留空 |
+| `SMTP_PASSWORD` | 空 | 密码 |
+| `SMTP_FROM_EMAIL` | 回退到 `RESEND_FROM_EMAIL` | Envelope From 与邮件 From |
+| `SMTP_TLS` | `starttls` | `implicit`、`smtps` 或 `ssl` 表示隐式 TLS;465 会自动启用 |
+| `SMTP_TLS_INSECURE` | `false` | 跳过证书校验,仅用于可信内网 |
+| `SMTP_EHLO_NAME` | 主机名 | 严格 relay 要求的 EHLO/FQDN |
+
+### Google OAuth
+
+| 变量 | 默认值 | 说明 |
+|---|---|---|
+| `GOOGLE_CLIENT_ID` | 空 | Google OAuth client ID |
+| `GOOGLE_CLIENT_SECRET` | 空 | Google OAuth client secret |
+| `GOOGLE_REDIRECT_URI` | `http://localhost:3000/auth/callback` | 必须与 Google Console 中的回调地址完全一致 |
-### S3 / S3 兼容存储
+### 注册范围
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `S3_BUCKET` | 空 | **只填 bucket 名**(例如 `my-bucket`),**不要**带 `.s3.<region>.amazonaws.com` 后缀——server 会用 `S3_BUCKET` + `S3_REGION` 自己拼公开 host。设了就启用 S3 存储 |
-| `S3_REGION` | `us-west-2` | AWS 区域。必须和 bucket 所在区域一致——SDK 签名和公开 URL 都用它 |
-| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | 空 | 静态凭证。全未设时用 AWS SDK 默认凭证链(IAM role / 环境凭证)|
-| `AWS_ENDPOINT_URL` | 空 | 自定义 S3 兼容端点(例如 [MinIO](https://min.io/))。设了会切到 path-style URL |
-| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | 附件下载路径:`auto`、`cloudfront`、`presign` 或 `proxy`。`auto` 下 CloudFront 配完整时优先 CloudFront;内网/私有 endpoint host 走 server proxy;公网 S3 兼容 endpoint 在支持时走 presigned GET |
-| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | CloudFront signed URL 和 S3 presigned download URL 的有效期。使用 Go duration 格式 |
+| `ALLOW_SIGNUP` | `true` | 未配置任何白名单时是否允许创建新账号 |
+| `ALLOWED_EMAILS` | 空 | 允许注册的完整邮箱,逗号分隔 |
+| `ALLOWED_EMAIL_DOMAINS` | 空 | 允许注册的邮箱域名,逗号分隔 |
+| `DISABLE_WORKSPACE_CREATION` | `false` | 禁止所有用户新建工作区;没有 owner/admin 例外 |
+| `MULTICA_DEV_VERIFICATION_CODE` | 空 | 非 production 环境使用的固定 6 位测试验证码 |
-**`S3_BUCKET` 未设时**:server 启动时打 info 日志 `"S3_BUCKET not set, cloud upload disabled"`,所有上传回落到本地磁盘。
+白名单的准确判断顺序见[登录与注册](/auth-setup#注册范围控制)。
-**对象存储 URL** 按优先级拼装:
+## 附件存储
-1. 设了 `CLOUDFRONT_DOMAIN` → `https://<CLOUDFRONT_DOMAIN>/<key>`
-2. 设了 `AWS_ENDPOINT_URL` → `<AWS_ENDPOINT_URL>/<S3_BUCKET>/<key>`(path-style)
-3. 默认走 AWS S3 → `https://<S3_BUCKET>.s3.<S3_REGION>.amazonaws.com/<key>`(virtual-hosted-style)。bucket 名含点时会回落到 `https://s3.<S3_REGION>.amazonaws.com/<S3_BUCKET>/<key>`(path-style),因为 AWS 通配证书无法覆盖含点 host。
+没有设置 `S3_BUCKET` 时,Multica 使用本地磁盘。
-API 返回的 `download_url` 在未配置 CloudFront 签名时会指向 `GET /api/attachments/{id}/download`。这个端点会在安全时跳转到 CloudFront/S3 presigned URL;遇到 `http://rustfs:9000` 这类私有或内网 endpoint 时则由 server 流式转发。Docker/VPC 内部对象存储建议显式设置 `ATTACHMENT_DOWNLOAD_MODE=proxy`。
+### S3 或兼容存储
-### 本地磁盘(S3 未配时)
-
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `LOCAL_UPLOAD_DIR` | `./data/uploads` | 本地存储目录 |
-| `LOCAL_UPLOAD_BASE_URL` | 空(返回相对路径)| 公开访问的 base URL——不设前端就拿不到附件的完整 URL |
-
-### CloudFront(可选)
+| `S3_BUCKET` | 空 | Bucket 名称,不要填写完整 hostname |
+| `S3_REGION` | `us-west-2` | Bucket 所在区域 |
+| `AWS_ACCESS_KEY_ID` | SDK 默认凭据链 | 静态 access key |
+| `AWS_SECRET_ACCESS_KEY` | SDK 默认凭据链 | 静态 secret key |
+| `AWS_ENDPOINT_URL` | 空 | MinIO 等 S3 兼容 endpoint |
+| `S3_USE_PATH_STYLE` | 自定义 endpoint 时为 `true` | 是否使用 path-style 地址 |
+| `ATTACHMENT_DOWNLOAD_MODE` | `auto` | `auto`、`cloudfront`、`presign` 或 `proxy` |
+| `ATTACHMENT_DOWNLOAD_URL_TTL` | `30m` | 签名下载地址的有效期 |
-如果你用 CloudFront 给 S3 做 CDN,三个相关的环境变量:`CLOUDFRONT_DOMAIN`、`CLOUDFRONT_KEY_PAIR_ID`、`CLOUDFRONT_PRIVATE_KEY`(或从 Secrets Manager 读的 `CLOUDFRONT_PRIVATE_KEY_SECRET`)。不用 CloudFront 就不用管——和配置 S3 不冲突。
+内网 MinIO 等 endpoint 无法被浏览器直接访问时,使用 `ATTACHMENT_DOWNLOAD_MODE=proxy`。
-### Cookie 域
+### 本地磁盘
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `COOKIE_DOMAIN` | 空 | session cookie 的作用域 |
+| `LOCAL_UPLOAD_DIR` | `./data/uploads` | 文件与 metadata 的保存目录,需要持久化卷 |
+| `LOCAL_UPLOAD_BASE_URL` | 空 | 可选的公开 base URL;留空时返回站内相对地址 |
-- **空**:cookie 只对访问的那个 host 生效(单主机部署正确)
-- **设成 `.example.com`**:cookie 在所有子域共享(让 `app.example.com` 和 `api.example.com` 共用登录态)
-- **前后端在不同 host 上时,这是必需项而非可选项**:浏览器必须能从页面自身的 origin 读到 `multica_csrf` cookie,否则所有写请求都会 `403 CSRF validation failed`,而读请求照常
-- 用能覆盖前后端的**最窄**父域(`.agent.example.com`,而不是 `.example.com`)。这个值同时会把 `multica_auth` 会话 cookie 扩散到该域下的每个 host,所以只有当这些 host 都由同一可信主体运维时才用这种部署方式——完整配置见 [Self-Hosting](/getting-started/self-hosting)
-- ⚠️ 不能是 IP 地址(浏览器会忽略)
+### CloudFront
-## 怎么限制谁能注册
+| 变量 | 说明 |
+|---|---|
+| `CLOUDFRONT_DOMAIN` | CDN 域名 |
+| `CLOUDFRONT_KEY_PAIR_ID` | CloudFront key pair ID |
+| `CLOUDFRONT_PRIVATE_KEY` | 完整私钥 |
+| `CLOUDFRONT_PRIVATE_KEY_SECRET` | 从 Secrets Manager 读取私钥时使用 |
-三层白名单按优先级组合。**任何一层白名单一旦设置非空,不匹配的邮箱就会被拒**——即使 `ALLOW_SIGNUP=true` 也挡不住。
+## Redis 与限流
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `ALLOWED_EMAILS` | 空 | 显式邮箱白名单(逗号分隔)。非空时只有列表里的邮箱能注册 |
-| `ALLOWED_EMAIL_DOMAINS` | 空 | 域名白名单(逗号分隔)。非空时只有列表里的域名能注册 |
-| `ALLOW_SIGNUP` | `true` | 注册总开关。设 `false` 完全关闭注册 |
-
-**不直观的点**:`ALLOWED_EMAIL_DOMAINS=company.io` + `ALLOW_SIGNUP=true` 的组合**不是**「允许 company.io 或所有人」,而是**只允许 company.io**。白名单的 AND 语义——决策树详见 [登录与注册配置 → Signup 白名单](/auth-setup#怎么限制谁能注册)。
+| `REDIS_URL` | 空 | 用于认证限流、实时事件和 token cache;未设置时实时事件回退到进程内存,认证限流不生效 |
+| `REDIS_DISABLE_CLIENT_NAME` | `false` | 托管 Redis 禁止 `CLIENT SETNAME` 时设为 `true` |
+| `RATE_LIMIT_AUTH` | `5` | 单 IP 每分钟发送验证码或发起 Google 登录的次数 |
+| `RATE_LIMIT_AUTH_VERIFY` | `20` | 单 IP 每分钟验证验证码的次数 |
+| `RATE_LIMIT_TRUSTED_PROXIES` | 空 | 允许提供 `X-Forwarded-For` 的代理 CIDR,逗号分隔 |
+| `MULTICA_TRUSTED_PROXIES` | 空 | 自动化 webhook 与实时连接使用的可信代理 CIDR |
-**邀请流程本身不检查 signup 白名单**——但被邀请人必须先能**登录**才能接受邀请。如果对方已经有 Multica 账号(比如在其他工作区注册过),可以直接接受,不受白名单影响;**如果对方还没注册过**,他们登录的第一步(发送验证码)仍然会过白名单检查,被 `ALLOW_SIGNUP=false` 或 `ALLOWED_EMAILS` / `ALLOWED_EMAIL_DOMAINS` 拒绝的邮箱**无法完成注册,也就没法接受邀请**。
+反向代理后的部署需要填写真实代理网段。不要直接信任所有来源,否则客户端可以伪造转发 IP。
-## 锁死工作区创建
+上面的 `RATE_LIMIT_*` 只有在设置了 `REDIS_URL` 后才生效;未设置时启动日志会提示 rate limiting disabled。Redis 临时不可用时限流选择放行请求,不会阻断正常登录。
-`ALLOW_SIGNUP=false` 能挡住新注册,但**挡不住**已经登录的用户继续 `POST /api/workspaces` 自助开新工作区。在希望平台管理员能看到全部 issue / 仓库 / 智能体的自部署实例里,把 `DISABLE_WORKSPACE_CREATION=true` 打开以堵上这个口子。
+## 外部集成
-| 环境变量 | 默认值 | 说明 |
+| 集成 | 变量 | 说明 |
|---|---|---|
-| `DISABLE_WORKSPACE_CREATION` | `false` | 设为 `true` 时,对 `POST /api/workspaces` 的任何调用都返回 `403 workspace creation is disabled for this instance`。Web UI 通过 `/api/config` 隐藏所有「创建工作区」入口。该开关是实例级的,没有 owner / admin 例外 |
+| GitHub | `GITHUB_APP_SLUG` | GitHub App slug |
+| GitHub | `GITHUB_WEBHOOK_SECRET` | Webhook HMAC 与连接 state 签名密钥 |
+| GitHub | `GITHUB_APP_ID` | PR 卡片的 CI 状态、可合并性和"从 GitHub 选择"仓库都需要它 |
+| GitHub | `GITHUB_APP_PRIVATE_KEY` | 与 App ID 配套的完整 PEM 私钥,用途同上 |
+| 飞书 | `MULTICA_LARK_SECRET_KEY` | base64 编码的 32 字节凭据加密密钥 |
+| Slack | `MULTICA_SLACK_SECRET_KEY` | base64 编码的 32 字节 token 加密密钥 |
+| Composio | `COMPOSIO_API_KEY` | 启用 Composio 工具连接 |
+| Composio | `COMPOSIO_CALLBACK_BASE_URL` | 回调 API 地址;可回退到 `MULTICA_PUBLIC_URL` |
+| Composio | `COMPOSIO_STATE_SECRET` | OAuth state 签名密钥;可从 `JWT_SECRET` 派生 |
+| 自托管 Git | `MULTICA_VCS_INTEGRATION_ENABLED` | Forgejo/Gitea/GitLab 集成开关,compose 默认开启 |
+| 自托管 Git | `MULTICA_VCS_SECRET_KEY` | base64 编码的 32 字节加密密钥(`openssl rand -base64 32`);未配置时该功能整体不可用 |
-推荐的开服流程:
+不配置 `GITHUB_APP_ID` 和私钥时,PR 仍会正常关联、镜像和触发合并转 done,但卡片上不显示 CI 与可合并状态,"从 GitHub 选择"仓库入口也会禁用。
-1. 启动实例时保持 `DISABLE_WORKSPACE_CREATION` 未设置(默认)。
-2. 管理员登录并创建共享工作区。
-3. 把 `DISABLE_WORKSPACE_CREATION=true` 设上并重启 backend。之后新用户只能通过邀请加入。
+配置步骤见 [GitHub 集成](/github-integration#自托管配置)、[飞书 Bot](/lark-bot-integration#自托管配置)和 [Slack Bot](/slack-bot-integration#自托管配置)。
-如果还想让被邀请的新用户能完成首次注册,保留 `ALLOW_SIGNUP=true`(必要时用 `ALLOWED_EMAIL_DOMAINS` / `ALLOWED_EMAILS` 限定可注册邮箱),只把 `DISABLE_WORKSPACE_CREATION=true` 打开即可;如果同时设 `ALLOW_SIGNUP=false`,连有 pending invite 的邮箱都无法完成首次注册,仅适合所有成员都已有 Multica 账号的实例。
+## 服务端 LLM
-## 速率限制(可选 Redis)
+这组配置用于服务端的辅助生成能力,例如对话标题;它不是智能体执行任务时使用的 AI 编程工具凭据。
-公开认证端点——`/auth/send-code`、`/auth/verify-code`、`/auth/google`——前面挂了按 IP 的固定窗口限流。限流器后端是 Redis。`REDIS_URL` 不设时中间件**直通**(fail-open),后端启动会打日志 `rate limiting disabled: REDIS_URL not configured`。
-
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `REDIS_URL` | 空 | Redis 连接 URL(例如 `redis://localhost:6379/0`)。不设时认证端点的限流功能直接关闭。同一个 Redis 也被实时事件 fan-out、PAT 缓存、守护进程 token 缓存复用;不设时这些组件分别回落到内存模式 / 直查 DB |
-| `REDIS_DISABLE_CLIENT_NAME` | `false` | 设为 `true` 可跳过每次 Redis 连接时的 `CLIENT SETNAME` 握手。使用托管 Redis(如 GCP Memorystore 或限制了 ACL 的 AWS ElastiCache)等封禁 `CLIENT` 命令的服务时**必须开启**。启用后连接在 `CLIENT LIST` 输出中会失去描述性名称,但能兼容受限的托管服务 |
-| `RATE_LIMIT_AUTH` | `5` | 单 IP 每分钟对 `/auth/send-code` 和 `/auth/google` 的最大请求数 |
-| `RATE_LIMIT_AUTH_VERIFY` | `20` | 单 IP 每分钟对 `/auth/verify-code` 的最大请求数 |
-| `RATE_LIMIT_TRUSTED_PROXIES` | 空 | 逗号分隔的 CIDR 列表,列在内的来源 IP 才允许通过 `X-Forwarded-For` 标识客户端。默认空 = **永不信任 XFF**,限流器只看直连的 `RemoteAddr` |
-
-被限流的请求会返回 `429 Too Many Requests`,带 `Retry-After: 60` 头和 `{"error":"too many requests"}` 响应体。
-
-<Callout type="warning">
-**部署在反向代理后面时必须设 `RATE_LIMIT_TRUSTED_PROXIES`。** 否则在后端看来所有真实用户都共用代理那个 IP,整个部署落到同一个桶里,`/auth/send-code` 会变成全站每分钟只能发 5 次。常见值:本机 Caddy / Nginx 用 `127.0.0.1/32,::1/128`;Cloudflare / ALB / CloudFront 用各家公开的 CDN IP 段。只有 `RemoteAddr` 落在这些 CIDR 内的请求才被允许通过 `X-Forwarded-For` 改写客户端 IP。
-</Callout>
+| `MULTICA_LLM_API_KEY` | 空 | OpenAI 兼容 API key |
+| `MULTICA_LLM_BASE_URL` | 空 | OpenAI 兼容 endpoint |
+| `MULTICA_LLM_DEFAULT_MODEL` | 内置默认 | 请求未指定模型时使用 |
-这里的 `RATE_LIMIT_TRUSTED_PROXIES` 和 `MULTICA_TRUSTED_PROXIES` **不是同一个**变量——后者控制的是 autopilot webhook 端点(`/api/webhooks/autopilots/{token}`)的限流器。两个限流器各自读各自的列表,部署在代理后面的实例需要两个都配上。
+API key 与 base URL 都为空时,服务端 LLM 生成关闭,调用方会使用本地回退逻辑。
-## 守护进程的调节参数
+## 守护进程配置
-守护进程跑在用户本地机器上,配置也是读本地环境变量。常用的几个:
+下面的变量在运行智能体的电脑上读取,不是在 API 容器中读取。
-| 环境变量 | 默认值 | 说明 |
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | server 地址(self-host 换成你的域名)|
-| `MULTICA_DAEMON_DEVICE_NAME` | 主机名 | 运行时页面显示的设备名 |
-| `MULTICA_AGENT_RUNTIME_NAME` | 内置默认 | 运行时显示名 |
-| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | 心跳频率 |
-| `MULTICA_DAEMON_POLL_INTERVAL` | `3s` | 任务轮询频率 |
-| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | 并发任务上限 |
-| `MULTICA_AGENT_TIMEOUT` | `0` | 单次任务的绝对墙钟上限;`0` = 不设上限,任务只受看门狗约束(活跃任务不会因为跑得久被杀)。想要硬性成本/资源天花板时再设一个正值 |
-| `MULTICA_AGENT_IDLE_WATCHDOG` | `30m` | 空闲看门狗:backend 持续静默(无消息、消息队列为空、且没有工具在途)这么久就 force-stop。`0` = 关闭整套看门狗,包括 provider 专用阈值 |
-| `MULTICA_OPENCODE_IDLE_WATCHDOG` | `10m` | OpenCode 首 token 未到或流式回复中断时的专用无消息阈值;`0` = 回退到 `MULTICA_AGENT_IDLE_WATCHDOG`,更大的值不能放宽全局阈值 |
-| `MULTICA_AGENT_TOOL_WATCHDOG` | `2h` | 工具在途时的静默上限:某个工具调用发出后长时间无任何输出(疑似卡死的子进程)这么久就 force-stop。`0` = 关闭该兜底(在途工具永不被停)|
-| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex 专用的静默看门狗窗口 |
-| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex `app-server` 启动 RPC 超时 |
-| `MULTICA_DAEMON_AUTO_UPDATE` | cloud:`true`,self-host:`false` | 设为 `false`/`0`/`no`/`off` 关闭守护进程的 CLI 自动更新轮询;`true`/`1`/`yes`/`on` 让 self-host 守护进程订阅上游更新 |
-| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | 守护进程轮询 GitHub 检查 CLI 新版本的间隔 |
-| `MULTICA_<PROVIDER>_PATH` | 对应 CLI 名 | 各 AI 编程工具的可执行文件路径(如 `MULTICA_CLAUDE_PATH`)|
-| `MULTICA_<PROVIDER>_MODEL` | 空 | 各 AI 编程工具的默认模型 |
-| `MULTICA_<PROVIDER>_ARGS` | 空 | 守护进程级的默认 CLI 参数,作用于该后端的每个任务,并排在各智能体自身的 `custom_args` 之前。支持 `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS` |
-
-完整解释每个参数对守护进程行为的影响,见 [守护进程与运行时](/daemon-runtimes)。
-
-### 把守护进程参数持久化到 `config.json`
-
-上面表格里的每个守护进程键 —— `device_name`、`runtime_name`、`max_concurrent_tasks`、`poll_interval`、`heartbeat_interval`、`agent_timeout`、`codex_semantic_inactivity_timeout`、`codex_handshake_timeout`、`disable_auto_update`、`auto_update_check_interval` —— 都可以持久化到 profile 对应的 `~/.multica/config.json`(或 `~/.multica/profiles/<name>/config.json`),这样就不用每次 `daemon start` 都重传 flag 或 export 环境变量。写入方式:
-
-```bash
-multica config set device_name my-vm-custom-name
-multica config set runtime_name worker-a
-multica config set max_concurrent_tasks 8
-multica config set poll_interval 10s # Go 时长格式,必须 > 0
-multica config set heartbeat_interval 30s
-multica config set agent_timeout 1h # 或 0s 显式关闭墙钟上限
-multica config set codex_semantic_inactivity_timeout 15m
-multica config set codex_handshake_timeout 45s
-multica config set disable_auto_update true # 单向:只能关闭自动更新
-multica config set auto_update_check_interval 12h
+| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | Multica API / WebSocket 地址,也接受 `http(s)` |
+| `MULTICA_DAEMON_DEVICE_NAME` | 主机名 | 运行时列表中的设备名 |
+| `MULTICA_AGENT_RUNTIME_NAME` | `Local Agent` | 运行时显示名 |
+| `MULTICA_DAEMON_POLL_INTERVAL` | `30s` | 没有唤醒事件时的执行任务轮询间隔 |
+| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | 心跳间隔 |
+| `MULTICA_DAEMON_MAX_CONCURRENT_TASKS` | `20` | 单个守护进程的并发执行任务上限 |
+| `MULTICA_AGENT_TIMEOUT` | `0` | 单次执行的绝对时限;`0` 表示不设置 |
+| `MULTICA_AGENT_IDLE_WATCHDOG` | `30m` | 没有输出且没有工具执行时的静默上限 |
+| `MULTICA_AGENT_TOOL_WATCHDOG` | `2h` | 单个工具调用持续静默的上限 |
+| `MULTICA_OPENCODE_IDLE_WATCHDOG` | `10m` | OpenCode 专用静默阈值 |
+| `MULTICA_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | `10m` | Codex 语义静默阈值 |
+| `MULTICA_CODEX_HANDSHAKE_TIMEOUT` | `30s` | Codex app-server 启动握手上限 |
+| `MULTICA_DAEMON_AUTO_UPDATE` | Cloud `true`;自托管 `false` | 是否自动检查并更新 CLI |
+| `MULTICA_DAEMON_AUTO_UPDATE_INTERVAL` | `6h` | 检查更新的间隔 |
+| `MULTICA_WORKSPACES_ROOT` | `~/multica_workspaces` | 执行任务工作目录的根目录 |
+| `MULTICA_KEEP_ENV_AFTER_TASK` | `false` | 保留执行任务目录用于调试 |
+
+各 AI 编程工具可以使用 `MULTICA_<PROVIDER>_PATH` 和 `MULTICA_<PROVIDER>_MODEL` 覆盖命令路径与默认模型。全机默认参数 `MULTICA_<PROVIDER>_ARGS` 目前支持 Claude Code、Codex、CodeBuddy 和 Qwen Code 四款工具。对应变量是 `MULTICA_CLAUDE_ARGS`、`MULTICA_CODEX_ARGS`、`MULTICA_CODEBUDDY_ARGS` 和 `MULTICA_QWEN_ARGS`。例如:
+
+```dotenv
+MULTICA_CLAUDE_PATH=/opt/bin/claude
+MULTICA_CLAUDE_ARGS=--max-turns 40
```
-时长类键只接受**正的** Go 时长(`500ms`、`10s`、`1m30s` 等)。`0s`、负值以及无法解析的字符串在 `config set` 阶段就会被拒绝——**唯一例外是 `agent_timeout`:这里 `0s` 是有意义的"显式关闭墙钟上限"哨兵**(负值仍然被拒)。若要清除已持久化的值、退回到环境变量 / 内置默认,传空串:`multica config set poll_interval ""`。
-
-`disable_auto_update` 是单向布尔:设为 `true` 会关闭守护进程的 CLI 自动更新轮询;设为 `false`(或用 `""` 清除)会把决策交回 `MULTICA_DAEMON_AUTO_UPDATE` / cloud-vs-self-host 默认。它不能从 config 文件强制开启自动更新。
-
-优先级从高到低:`--flag`(`daemon start` 命令行)> `MULTICA_…` 环境变量 > `config.json` > 内置默认。运行时环境变量(如 systemd unit 里设的)优先级高于 config 文件;显式命令行 flag 又高于两者。
-
-当你在同一台机器上用 `--profile <name>` 起多个 daemon 时,尤为好用:给每个 profile 独立设置 `device_name`,运行时页面就能看到独立的机器,而不是全部挤在同一个主机名下。
-
-### 默认智能体参数(`MULTICA_<PROVIDER>_ARGS`)
+优先级为命令行 flag → 环境变量 → `~/.multica/config.json` → 内置默认。watchdog 的行为见[守护进程与运行时](/daemon-runtimes)。
-为某个后端设置一层**全机队默认**的 CLI 参数——可以方便地给一台守护进程上的所有智能体应用一个默认的成本或资源基线(例如 `--max-turns`),而不必逐个修改每个智能体的 `custom_args`。这是一层默认值,而不是不可突破的硬上限:每个智能体自己的 `custom_args` 会追加在后面,并可以覆盖它(见下方**优先级**)。
+### 守护进程配置的持久化
-- **优先级:** 默认参数先生效,随后追加各智能体自己的 `custom_args`。对于带取值的参数,由下游 CLI 自己的参数解析器决定最终生效值(多数工具采用「后者覆盖」),因此单个智能体可以调高某个守护进程默认值,但在智能体没有覆盖的地方,默认值依然生效。
-- **解析:** 取值按 POSIX shell-word 规则切分,因此引号可用——`MULTICA_CLAUDE_ARGS='--append-system-prompt "multi word"'` 会解析为两个 token。
-- **安全:** 默认参数层和各智能体的 `custom_args` 层都会经过同一套 blocked-flags 过滤,因此协议关键标志(如 Claude 的 `-p`、`--output-format`、`--input-format`、`--permission-mode`、`--mcp-config`,以及 Codex 的 `--listen`)无法从任何一层注入。
-- **未设置 / 为空** 表示不改变行为。
-
-## 前端访问控制
-
-| 环境变量 | 默认值 | 说明 |
-|---|---|---|
-| `FRONTEND_ORIGIN` | 空 | 前端地址。邀请邮件里的链接、CORS 白名单、cookie domain 都从这里推导。邮件链接在不设时会 fallback 到托管版域名 `https://multica.ai`——self-host 必须显式填 |
-| `MULTICA_APP_URL` | 空 | CLI 登录流程使用的前端 URL。Web UI 也会用它显示带你自己 app domain 的 self-host 守护进程 setup 命令;同源部署中,如果 `MULTICA_PUBLIC_URL` 未设置,它也会作为守护进程的 `server_url` |
-| `MULTICA_PUBLIC_URL` | 空 | 公开 API URL,不带结尾 slash。用于 autopilot webhook URL,也会被 Web UI 用作守护进程的 `server_url` |
-| `CORS_ALLOWED_ORIGINS` | 空 | 额外的 CORS 允许来源(逗号分隔)|
-| `ALLOWED_ORIGINS` | 空 | WebSocket 专用的 origin 白名单(逗号分隔);不设就按 `CORS_ALLOWED_ORIGINS` → `FRONTEND_ORIGIN` → `localhost:3000/5173/5174` 顺序回落 |
-
-<Callout type="warning">
-**`FRONTEND_ORIGIN` 不设就有两个静默失败**:(1)邀请邮件里的链接指向 `https://multica.ai`(托管版的域名),用户点了跳不回你的 self-host 实例;(2)WebSocket 连接的 Origin 校验回落到 `localhost:3000 / 5173 / 5174`,生产部署的 WebSocket 全部被拒,前端看起来「实时更新不工作」。
-</Callout>
+守护进程侧的常用配置也可以写入 `~/.multica/config.json`,不必依赖 shell 环境变量;命名 profile 的配置文件在 `~/.multica/profiles/<name>/config.json`:
-## GitHub 集成
+```bash
+multica config set poll_interval 10s
+multica config show
+```
-[GitHub PR ↔ issue 集成](/github-integration) 依赖 `GITHUB_APP_SLUG` 和 `GITHUB_WEBHOOK_SECRET` 来启用 Settings 里的 Connect GitHub 并接受 webhook。`GITHUB_APP_ID` 和 `GITHUB_APP_PRIVATE_KEY` 则是 PR 卡片 CI 状态与可合并性的**必填项**——不配这两个,集成仍会镜像 PR、自动关联 issue,但卡片不显示任何 CI 或 merge 状态。
+支持的键:
-| 环境变量 | 默认值 | 说明 |
+| 键 | 默认值 | 说明 |
|---|---|---|
-| `GITHUB_APP_SLUG` | 空 | 你的 GitHub App slug(`https://github.com/apps/<slug>` 的尾部)。Settings → GitHub 里安装按钮的跳转 URL 用它拼 |
-| `GITHUB_WEBHOOK_SECRET` | 空 | 你在 GitHub App 上设置的 Webhook secret。每条 `pull_request` / `installation` delivery 都用它做 HMAC-SHA256 校验;同一个值也用作 setup 回调里 state token 的签名密钥 |
-| `GITHUB_APP_ID` | 空 | App 设置页上的数字 App ID。配合 `GITHUB_APP_PRIVATE_KEY`,用于 PR 卡片 CI 状态与可合并性、Settings → Repositories → 从 GitHub 选择,以及安装时直接获取关联账号名 |
-| `GITHUB_APP_PRIVATE_KEY` | 空 | App RSA 私钥的完整 PEM 块(包含 `-----BEGIN/END-----` 两行,保留换行)。配合 `GITHUB_APP_ID`,用于 App 鉴权的 PR 快照和仓库浏览 |
-
-**任一必填变量未设时:**
-
-- Settings → GitHub 里 `Connect GitHub` 按钮 **disable**,对 admin 显示「not configured」提示
-- `/api/webhooks/github` 直接返回 **`503 github webhooks not configured`**——secret 没配置时 Multica 拒绝处理任何 webhook 事件,而不是把所有签名当 valid
-
-**`GITHUB_APP_ID` / `GITHUB_APP_PRIVATE_KEY` 未设时:**
-
-- PR 卡片**不显示任何 CI 状态或可合并性**——集成干净降级:PR 照常镜像,issue 照常自动关联并在 merge 时转 Done。
-- 安装完成后,连接卡片还会先短暂显示 `已连接到 unknown`。等 GitHub 的 `installation.created` webhook 到达(通常几秒内),Multica 会把 row 刷成真实的组织/用户名,并通过 realtime 推送让正在打开的 Settings → GitHub 页面无需手动刷新即可更新。
-- Settings → Repositories → 从 GitHub 选择会被禁用,因为服务端无法签发列出仓库所需的 installation token。
-
-**注意:** `GITHUB_WEBHOOK_SECRET` 同时被复用为 install 流程里 state token 的签名密钥,所以运维只需要维护一个 secret。它**不是** GitHub App 的 *Client* secret——Client secret 是 OAuth 用的,和本集成无关。完整配置流程见 [GitHub 集成 → Self-Host 配置](/github-integration#self-host-配置)。
-
-## 用量统计
-
-默认上报到 Multica 官方 PostHog 实例。不想上报就把 `ANALYTICS_DISABLED=true`。
-
-| 环境变量 | 默认值 | 说明 |
+| `server_url` | `ws://localhost:8080/ws` | Multica API / WebSocket 地址 |
+| `app_url` | 空 | 浏览器登录使用的 Web 地址 |
+| `workspace_id` | 空 | 默认工作区 |
+| `device_name` | 主机名 | 运行时列表中的设备名 |
+| `runtime_name` | `Local Agent` | 运行时显示名 |
+| `max_concurrent_tasks` | `20` | 并发执行任务上限;`0` 或留空表示未设置 |
+| `poll_interval` | `30s` | 执行任务轮询间隔 |
+| `heartbeat_interval` | `15s` | 心跳间隔 |
+| `agent_timeout` | 不限制 | 单次执行的绝对时限 |
+| `codex_semantic_inactivity_timeout` | `10m` | Codex 语义静默阈值 |
+| `codex_handshake_timeout` | `30s` | Codex app-server 握手上限 |
+| `disable_auto_update` | 跟随环境 | `true` 关闭自动更新;`false` 清除本地覆盖,回到环境变量或默认 |
+| `auto_update_check_interval` | `6h` | 检查更新的间隔 |
+
+几条取值规则:
+
+- duration 类键接受正的 Go duration(如 `10s`、`2h`),`0s` 和负值会被拒绝。唯一例外是 `agent_timeout`:`0s` 合法,表示明确关闭执行时限。
+- 传空字符串清除已持久化的值,回到环境变量或内置默认,例如 `multica config set poll_interval ""`。
+- `max_concurrent_tasks` 要求非负整数。
+
+## 观测与统计
+
+| 变量 | 默认值 | 说明 |
|---|---|---|
-| `ANALYTICS_DISABLED` | `false` | 设 `true` 完全关闭后端上报 |
-| `POSTHOG_API_KEY` | 内置默认 key | 换成你自己的 PostHog 实例时填 |
-| `POSTHOG_HOST` | `https://us.i.posthog.com` | 自建 PostHog 的话改成你自己的地址 |
+| `ANALYTICS_DISABLED` | `false` | 设为 `true` 关闭 PostHog 上报 |
+| `POSTHOG_API_KEY` | 空 | 不设置时统计上报关闭;接入自己的 PostHog 项目时填写 |
+| `POSTHOG_HOST` | `https://us.i.posthog.com` | PostHog 地址 |
+| `METRICS_ADDR` | 空 | Prometheus metrics 监听地址;空表示不启动 |
+| `REALTIME_METRICS_TOKEN` | 空 | 保护 `/health/realtime` 的 bearer token |
-## 下一步
+## 接下来
-- [登录与注册配置](/auth-setup) —— 上面 auth 相关的那几个环境变量怎么真的配、陷阱在哪
-- [GitHub 集成](/github-integration) —— `GITHUB_APP_SLUG` / `GITHUB_WEBHOOK_SECRET` 背后的 GitHub App 怎么建
-- [故障排查](/troubleshooting) —— 配错了常见的症状和修复
-- [守护进程与运行时](/daemon-runtimes) —— `MULTICA_DAEMON_*` 参数的行为含义
+- [登录与注册](/auth-setup) — 登录方式与注册限制。
+- [故障排查](/troubleshooting) — 部署问题的症状排查。
+- [守护进程与运行时](/daemon-runtimes) — 守护进程侧的对应配置。
diff --git a/apps/docs/content/docs/getting-started/cloud-quickstart.zh.mdx b/apps/docs/content/docs/getting-started/cloud-quickstart.zh.mdx
deleted file mode 100644
index 784fe1808f..0000000000
--- a/apps/docs/content/docs/getting-started/cloud-quickstart.zh.mdx
+++ /dev/null
@@ -1,64 +0,0 @@
----
-title: Cloud Quickstart
-description: Get started with Multica Cloud — no setup required.
----
-
-The fastest way to get started with Multica — no setup required.
-
-## 1. Sign up
-
-Go to [multica.ai](https://multica.ai) and create an account.
-
-## 2. Install the CLI and start the daemon
-
-Give this instruction to your AI agent (Claude Code, Codex, Qoder, OpenClaw, OpenCode, etc.):
-
-```
-Fetch https://github.com/multica-ai/multica/blob/main/CLI_INSTALL.md and follow the instructions to install Multica CLI, log in, and start the daemon on this machine.
-```
-
-Or install manually:
-
-### macOS / Linux (Homebrew - recommended)
-
-```bash
-brew install multica-ai/tap/multica
-```
-
-### macOS / Linux (install script)
-
-```bash
-# Install the CLI
-curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
-```
-
-### Windows (PowerShell)
-
-```powershell
-irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
-```
-
-Then configure, authenticate, and start the daemon:
-
-```bash
-# Configure, authenticate, and start the daemon
-multica setup
-```
-
-The daemon auto-detects supported agent CLIs (`agy`, `claude`, `codebuddy`, `codex`, `copilot`, `cursor-agent`, `hermes`, `kimi`, `kiro-cli`, `opencode`, `openclaw`, `pi`, `qodercli`, `traecli`) on your PATH. When an agent is assigned a task, the daemon creates an isolated environment, runs the agent, and reports results back.
-
-## 3. Verify your runtime
-
-Open your workspace in the Multica web app. Navigate to **Settings → Runtimes** — you should see your machine listed as an active **Runtime**.
-
-> **What is a Runtime?** A Runtime is a compute environment that can execute agent tasks. It can be your local machine (via the daemon) or a cloud instance. Each runtime reports which agent CLIs are available, so Multica knows where to route work.
-
-## 4. Create an agent
-
-Go to **Settings → Agents** and click **New Agent**. Pick the runtime you just connected and choose a provider (Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Pi, Qoder, or Trae CLI). Give your agent a name — this is how it will appear on the board, in comments, and in assignments.
-
-## 5. Assign your first task
-
-Create an issue from the board (or via `multica issue create`), then assign it to your new agent. The agent will automatically pick up the task, execute it on your runtime, and report progress — just like a human teammate.
-
-That's it! Your agent is now part of the team.
diff --git a/apps/docs/content/docs/getting-started/meta.zh.json b/apps/docs/content/docs/getting-started/meta.zh.json
deleted file mode 100644
index c6b038979c..0000000000
--- a/apps/docs/content/docs/getting-started/meta.zh.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "title": "Getting Started",
- "pages": ["cloud-quickstart", "self-hosting"]
-}
diff --git a/apps/docs/content/docs/getting-started/self-hosting.zh.mdx b/apps/docs/content/docs/getting-started/self-hosting.zh.mdx
deleted file mode 100644
index 9726433866..0000000000
--- a/apps/docs/content/docs/getting-started/self-hosting.zh.mdx
+++ /dev/null
@@ -1,586 +0,0 @@
----
-title: Self-Hosting Guide
-description: Deploy Multica on your own infrastructure.
----
-
-## Architecture Overview
-
-Multica has three components:
-
-| Component | Description | Technology |
-|-----------|-------------|------------|
-| **Backend** | REST API + WebSocket server | Go (single binary) |
-| **Frontend** | Web application | Next.js 16 |
-| **Database** | Primary data store | PostgreSQL 17 with pgvector |
-
-Each user who wants to run AI agents locally also installs the **`multica` CLI** and runs the **agent daemon** on their own machine.
-
-## Prerequisites
-
-- Docker and Docker Compose
-
-## Quick Install
-
-Two commands to set up everything:
-
-```bash
-# Install CLI + provision self-host server
-curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash -s -- --with-server
-
-# Configure CLI, authenticate, and start the daemon
-multica setup self-host
-```
-
-This installs the CLI, checks out the latest self-host assets, pulls the official Multica images from GHCR, and configures everything for localhost. Then open http://localhost:3000 and pick a login method: configure `RESEND_API_KEY` in `.env` for email-based codes (recommended), or leave Resend unset and copy the generated code from backend logs. See [Step 2 — Log In](#step-2--log-in) for details.
-
-<Callout>
-If the self-host server is already running and you only need the CLI on a macOS/Linux machine, install it with Homebrew: `brew install multica-ai/tap/multica`.
-</Callout>
-
-<Callout>
-For a step-by-step setup, see below.
-</Callout>
-
-## Step-by-Step Setup
-
-### Step 1 — Start the Server
-
-```bash
-git clone https://github.com/multica-ai/multica.git
-cd multica
-make selfhost
-```
-
-`make selfhost` automatically creates `.env`, generates a random `JWT_SECRET` and Postgres password, and starts all services via Docker Compose.
-
-By default it pulls the latest stable release images from GHCR. To build the backend/web from your current checkout instead, run `make selfhost-build`.
-If the selected GHCR tag has not been published yet, `make selfhost` now tells you to fall back to `make selfhost-build`.
-`make selfhost-build` uses local `multica-backend:dev` / `multica-web:dev` tags, so it does not overwrite the pulled `:latest` images.
-
-Once ready:
-
-- **Frontend:** http://localhost:3000
-- **Backend API:** http://localhost:8080
-
-<Callout>
-If you prefer running the Docker Compose steps manually: `cp .env.example .env`, edit `JWT_SECRET`, `POSTGRES_PASSWORD`, and the password segment in `DATABASE_URL`, then `docker compose -f docker-compose.selfhost.yml pull && docker compose -f docker-compose.selfhost.yml up -d`.
-</Callout>
-
-### Step 2 — Log In
-
-Open http://localhost:3000. The Docker self-host stack defaults to `APP_ENV=production` (set in `docker-compose.selfhost.yml`), and there is no fixed verification code by default. Pick one of the following to log in:
-
-- **Recommended (production):** configure `RESEND_API_KEY` in `.env`, then restart the backend. Real verification codes will be sent to the email address you enter. See [Configuration](#configuration) below.
-- **Without email configured:** the verification code is generated server-side and printed to the backend container logs (look for `[DEV] Verification code for ...:`). Useful for one-off testing on a single machine.
-- **Deterministic local/private testing:** set `APP_ENV=development` and `MULTICA_DEV_VERIFICATION_CODE=888888` in `.env`, then restart the backend. This fixed code is ignored when `APP_ENV=production`.
-
-Changes to `ALLOW_SIGNUP` and `GOOGLE_CLIENT_ID` also take effect after restarting the backend / compose stack. The web UI reads both from `/api/config` at runtime, so no web rebuild is needed.
-
-<Callout>
-**Warning:** do **not** set `MULTICA_DEV_VERIFICATION_CODE` on a publicly reachable instance — anyone who knows an email address can then log in with that fixed code.
-</Callout>
-
-### Step 3 — Install CLI & Start Daemon
-
-The daemon runs on your local machine (not inside Docker). It detects installed AI agent CLIs, registers them with the server, and executes tasks.
-
-### a) Install the CLI and an AI agent
-
-```bash
-brew install multica-ai/tap/multica
-```
-
-You also need at least one AI agent CLI:
-- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude` on PATH)
-- Antigravity (`agy` on PATH)
-- CodeBuddy (`codebuddy` on PATH)
-- [Codex](https://github.com/openai/codex) (`codex` on PATH)
-- Copilot (`copilot` on PATH)
-- Cursor Agent (`cursor-agent` on PATH)
-- OpenCode (`opencode` on PATH)
-- OpenClaw (`openclaw` on PATH)
-- Hermes (`hermes` on PATH)
-- Kimi (`kimi` on PATH)
-- Kiro CLI (`kiro-cli` on PATH)
-- Pi (`pi` on PATH)
-- Qoder (`qodercli` on PATH)
-- Trae CLI (`traecli` on PATH)
-
-### b) One-command setup
-
-```bash
-multica setup self-host
-```
-
-This automatically:
-1. Configures the CLI to connect to `localhost`
-2. Opens your browser for authentication
-3. Discovers your workspaces
-4. Starts the daemon in the background
-
-For on-premise deployments with custom domains:
-
-```bash
-multica setup self-host --server-url https://api.example.com --app-url https://app.example.com
-```
-
-Verify the daemon is running:
-
-```bash
-multica daemon status
-```
-
-<Callout>
-Alternatively, configure step by step: `multica config set server_url http://localhost:8080 && multica config set app_url http://localhost:3000 && multica login && multica daemon start`
-</Callout>
-
-### Step 4 — Verify & Start Using
-
-1. Open your workspace at http://localhost:3000
-2. Navigate to **Settings → Runtimes** — you should see your machine listed
-3. Go to **Settings → Agents** and create a new agent
-4. Create an issue and assign it to your agent
-
-## Usage Dashboard Rollup
-
-The Usage / Runtime dashboards read from a derived `task_usage_hourly` table populated by `rollup_task_usage_hourly()`. As of MUL-2957 the backend runs this rollup **in-process** on every replica via a DB-backed scheduler (`sys_cron_executions`). A fresh self-host install needs no operator action — the bundled `pgvector/pgvector:pg17` image works as-is, and you do **not** need to swap it for an image that ships `pg_cron`, register an external cron job, run a systemd timer, or schedule a Kubernetes `CronJob`.
-
-Multiple backend replicas are safe: every replica ticks every 30 seconds and tries to claim the current 5-minute UTC plan, but the unique key `(job_name, scope_kind, scope_id, plan_time)` means only one wins each plan. Inspect the audit table to confirm steady-state operation:
-
-```sql
-SELECT plan_time, status, attempt, runner_id,
- error_code, error_msg, started_at, finished_at
- FROM sys_cron_executions
- WHERE job_name = 'rollup_task_usage_hourly'
- ORDER BY plan_time DESC
- LIMIT 20;
-```
-
-<Callout>
-**Upgrading from `v0.3.4` to `v0.3.5+`?** As of MUL-2957 the `migrate up` command runs an idempotent monthly-slice backfill automatically right before applying migration `103`, so the upgrade completes in a single invocation — no operator step required. If you are on a pre-MUL-2957 binary or the auto-hook fails for an environmental reason, run `backfill_task_usage_hourly` against the same database and re-run the upgrade. Full recovery flow lives in [`SELF_HOSTING_ADVANCED.md → Usage Dashboard Rollup`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING_ADVANCED.md#usage-dashboard-rollup).
-</Callout>
-
-### Compatibility paths (existing deployments only)
-
-External schedulers — **`pg_cron` registered on the database, an external cron job, a systemd timer, or a Kubernetes `CronJob`** — that call `SELECT rollup_task_usage_hourly()` directly were the only option before MUL-2957 and remain a supported compatibility path. They are no longer the recommended setup; new deployments should rely on the in-process scheduler. The SQL function holds advisory lock 4246 internally, so the in-process scheduler and any pre-existing external schedule can coexist without ever double-writing the rollup.
-
-If you already have a `pg_cron` job in production and want to retire it, the safe sequence is:
-
-1. Confirm the in-process scheduler is healthy on at least one backend replica — recent SUCCESS rows should be landing in `sys_cron_executions` for `rollup_task_usage_hourly`:
-
- ```sql
- SELECT plan_time, status, runner_id, finished_at
- FROM sys_cron_executions
- WHERE job_name = 'rollup_task_usage_hourly'
- AND status = 'SUCCESS'
- ORDER BY plan_time DESC
- LIMIT 5;
- ```
-
-2. Once SUCCESS rows are arriving on schedule, unschedule the redundant `pg_cron` entry:
-
- ```sql
- SELECT cron.unschedule('rollup_task_usage_hourly')
- FROM cron.job WHERE jobname = 'rollup_task_usage_hourly';
- ```
-
-3. Leave the `pg_cron` extension itself installed unless you are sure no other workload depends on it. The bundled `pgvector/pgvector:pg17` image does **not** ship `pg_cron`, so nothing in Multica's default install needs it; uninstalling `pg_cron` from a custom image that other workloads still use is a separate decision.
-
-External cron / systemd timer / Kubernetes `CronJob` setups that call `SELECT rollup_task_usage_hourly()` directly can be retired the same way — once `sys_cron_executions` shows steady SUCCESS rows from the in-process scheduler, the external job is redundant and can be removed.
-
-Full reference (audit table semantics, advisory lock 4246, the standalone backfill command, flag descriptions, the migration auto-hook) lives in [`SELF_HOSTING_ADVANCED.md → Usage Dashboard Rollup`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING_ADVANCED.md#usage-dashboard-rollup).
-
-## Stopping Services
-
-```bash
-# Stop Docker Compose services
-make selfhost-stop
-
-# Stop the local daemon
-multica daemon stop
-```
-
-## Switching to Multica Cloud
-
-If you've been self-hosting and want to switch your CLI to [Multica Cloud](https://multica.ai):
-
-```bash
-multica setup
-```
-
-This reconfigures the CLI for multica.ai, re-authenticates, and restarts the daemon. You will be prompted before overwriting the existing configuration.
-
-<Callout>
-Your local Docker services are unaffected. Stop them separately if you no longer need them.
-</Callout>
-
-## Upgrading
-
-```bash
-docker compose -f docker-compose.selfhost.yml pull
-docker compose -f docker-compose.selfhost.yml up -d
-```
-
-Pin `MULTICA_IMAGE_TAG` in `.env` to an exact version like `v0.2.4` if you want to stay on a specific release. Migrations run automatically on backend startup.
-If the selected GHCR tag has not been published yet, fall back to `make selfhost-build` or `docker compose -f docker-compose.selfhost.yml -f docker-compose.selfhost.build.yml up -d --build`.
-
----
-
-## Configuration
-
-All configuration is done via environment variables. Copy `.env.example` as a starting point.
-
-### Required Variables
-
-| Variable | Description | Example |
-|----------|-------------|---------|
-| `DATABASE_URL` | PostgreSQL connection string. Keep the password segment in sync with `POSTGRES_PASSWORD`. | `postgres://multica:<postgres-password>@localhost:5432/multica?sslmode=disable` |
-| `POSTGRES_PASSWORD` | **Must change from default.** Password used by the bundled Postgres container. Keep it in sync with `DATABASE_URL`. | `openssl rand -hex 24` |
-| `JWT_SECRET` | **Must change from default.** Secret key for signing JWT tokens. Use a long random string. | `openssl rand -hex 32` |
-| `FRONTEND_ORIGIN` | URL where the frontend is served (used for CORS) | `https://app.example.com` |
-
-### Email (Required for Authentication)
-
-Multica uses email-based magic link authentication via [Resend](https://resend.com).
-
-| Variable | Description |
-|----------|-------------|
-| `RESEND_API_KEY` | Your Resend API key |
-| `RESEND_FROM_EMAIL` | Sender email address (default: `[email protected]`) |
-
-### Google OAuth (Optional)
-
-| Variable | Description |
-|----------|-------------|
-| `GOOGLE_CLIENT_ID` | Google OAuth client ID |
-| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret |
-| `GOOGLE_REDIRECT_URI` | OAuth callback URL (e.g. `https://app.example.com/auth/callback`) |
-
-Changes take effect after restarting the backend / compose stack. The web UI reads `GOOGLE_CLIENT_ID` from `/api/config` at runtime, so no web rebuild is needed.
-
-### Signup Controls (Optional)
-
-| Variable | Description |
-|----------|-------------|
-| `ALLOW_SIGNUP` | Set to `false` to disable new user signups on a private instance |
-| `ALLOWED_EMAIL_DOMAINS` | Optional comma-separated allowlist of email domains |
-| `ALLOWED_EMAILS` | Optional comma-separated allowlist of exact email addresses |
-
-Changes take effect after restarting the backend / compose stack. The web UI reads `ALLOW_SIGNUP` from `/api/config` at runtime, so no web rebuild is needed.
-
-### File Storage (Optional)
-
-For file uploads and attachments, configure S3 and (optionally) CloudFront:
-
-| Variable | Description |
-|----------|-------------|
-| `S3_BUCKET` | Bucket name only (e.g. `my-bucket`). Do **not** include the `.s3.<region>.amazonaws.com` suffix — the server constructs the public URL from `S3_BUCKET` + `S3_REGION` |
-| `S3_REGION` | AWS region (default: `us-west-2`). Must match the bucket's actual region — used for both SDK signing and public URLs |
-| `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` | Static credentials. When both are unset, the AWS SDK default credential chain is used |
-| `AWS_ENDPOINT_URL` | Custom S3-compatible endpoint (e.g. MinIO, R2, B2). Setting this switches to path-style URLs |
-| `CLOUDFRONT_DOMAIN` | CloudFront distribution domain — when set, public URLs use this host instead of the S3 host |
-| `CLOUDFRONT_KEY_PAIR_ID` | CloudFront key pair ID for signed URLs |
-| `CLOUDFRONT_PRIVATE_KEY` | CloudFront private key (PEM format) |
-
-### Cookies
-
-| Variable | Description |
-|----------|-------------|
-| `COOKIE_DOMAIN` | Optional `Domain` attribute for session + CloudFront cookies. **Leave empty** for single-host deployments (localhost, LAN IP, or a single hostname). Only set it when the frontend and backend sit on different subdomains of one registered domain (e.g. `.example.com`). **Do not use an IP literal** — RFC 6265 forbids IP addresses in the cookie `Domain` attribute and browsers will drop such `Set-Cookie` headers. |
-
-The `Secure` flag on session cookies is derived automatically from the scheme of `FRONTEND_ORIGIN`: HTTPS origins get `Secure` cookies; plain-HTTP origins (LAN / private-network self-host) get non-secure cookies so the browser can actually store them.
-
-If the frontend and backend are served from different hostnames, `COOKIE_DOMAIN` is **required**, not optional: the browser must be able to read the `multica_csrf` cookie from the page's own origin to send the `X-CSRF-Token` header, and without it every write request fails with `403 {"error":"CSRF validation failed"}`. Scope it to the narrowest parent domain that covers both hosts — it also shares the `multica_auth` session cookie with every host under that domain. See [Reverse Proxy](#reverse-proxy) for the full split-domain configuration and its trust requirements.
-
-### Server
-
-| Variable | Default | Description |
-|----------|---------|-------------|
-| `PORT` | `8080` | Backend server port |
-| `FRONTEND_PORT` | `3000` | Frontend port |
-| `CORS_ALLOWED_ORIGINS` | Value of `FRONTEND_ORIGIN` | Comma-separated list of allowed origins |
-| `LOG_LEVEL` | `info` | Log level: `debug`, `info`, `warn`, `error` |
-
-### CLI / Daemon
-
-These are configured on each user's machine, not on the server:
-
-| Variable | Default | Description |
-|----------|---------|-------------|
-| `MULTICA_SERVER_URL` | `ws://localhost:8080/ws` | WebSocket URL for daemon → server connection |
-| `MULTICA_APP_URL` | `http://localhost:3000` | Frontend URL for CLI login flow |
-| `MULTICA_DAEMON_POLL_INTERVAL` | `3s` | How often the daemon polls for tasks |
-| `MULTICA_DAEMON_HEARTBEAT_INTERVAL` | `15s` | Heartbeat frequency |
-
-Agent-specific overrides:
-
-| Variable | Description |
-|----------|-------------|
-| `MULTICA_CLAUDE_PATH` | Custom path to the `claude` binary |
-| `MULTICA_CLAUDE_MODEL` | Override the Claude model used |
-| `MULTICA_CODEX_PATH` | Custom path to the `codex` binary |
-| `MULTICA_CODEX_MODEL` | Override the Codex model used |
-| `MULTICA_CODEBUDDY_PATH` | Custom path to the `codebuddy` binary |
-| `MULTICA_CODEBUDDY_MODEL` | Override the CodeBuddy model used |
-| `MULTICA_ANTIGRAVITY_PATH` | Custom path to the `agy` binary |
-| `MULTICA_ANTIGRAVITY_MODEL` | Override the Antigravity model used |
-| `MULTICA_OPENCODE_PATH` | Custom path to the `opencode` binary |
-| `MULTICA_OPENCODE_MODEL` | Override the OpenCode model used |
-| `MULTICA_OPENCLAW_PATH` | Custom path to the `openclaw` binary |
-| `MULTICA_OPENCLAW_MODEL` | Override the OpenClaw model used |
-| `MULTICA_HERMES_PATH` | Custom path to the `hermes` binary |
-| `MULTICA_HERMES_MODEL` | Override the Hermes model used |
-| `MULTICA_QODER_PATH` | Custom path to the `qodercli` binary |
-| `MULTICA_QODER_MODEL` | Override the Qoder model used |
-| `MULTICA_TRAECLI_PATH` | Custom path to the `traecli` binary |
-| `MULTICA_TRAECLI_MODEL` | Override the Trae CLI model used |
-
-## Database Setup
-
-Multica requires PostgreSQL 17 with the pgvector extension.
-
-### Using the Included Docker Compose
-
-```bash
-docker compose up -d postgres
-```
-
-This starts a `pgvector/pgvector:pg17` container on port 5432 with default credentials (`multica`/`multica`).
-
-### Using Your Own PostgreSQL
-
-Ensure the pgvector extension is available:
-
-```sql
-CREATE EXTENSION IF NOT EXISTS vector;
-```
-
-### Running Migrations
-
-Migrations must be run before starting the server:
-
-```bash
-# Using the built binary
-./server/bin/migrate up
-
-# Or from source
-cd server && go run ./cmd/migrate up
-```
-
-## Manual Setup (Without Docker Compose)
-
-If you prefer to build and run services manually:
-
-**Prerequisites:** Go 1.26+, Node.js 20+, pnpm 10.28+, PostgreSQL 17 with pgvector.
-
-```bash
-# Start your PostgreSQL (or use: docker compose up -d postgres)
-
-# Build the backend
-make build
-
-# Run database migrations
-DATABASE_URL="your-database-url" ./server/bin/migrate up
-
-# Start the backend server
-DATABASE_URL="your-database-url" PORT=8080 JWT_SECRET="your-secret" ./server/bin/server
-```
-
-For the frontend:
-
-```bash
-pnpm install
-pnpm build
-
-# Start the frontend (production mode)
-cd apps/web
-REMOTE_API_URL=http://localhost:8080 pnpm start
-```
-
-## Reverse Proxy
-
-In production, put a reverse proxy in front of both the backend and frontend to handle TLS and routing.
-
-### Caddy (Recommended)
-
-**Single-domain layout** — frontend and backend served on the same hostname (this is what `docker-compose.selfhost.yml` defaults to):
-
-```
-multica.example.com {
- # WebSocket route — must come before the catch-all
- @multica_ws path /ws /ws/*
- handle @multica_ws {
- reverse_proxy localhost:8080 {
- flush_interval -1
- }
- }
-
- # Everything else → frontend
- reverse_proxy localhost:3000
-}
-```
-
-**Separate-domain layout** — frontend and backend on different hostnames:
-
-```
-app.example.com {
- reverse_proxy localhost:3000
-}
-
-api.example.com {
- @multica_ws path /ws /ws/*
- handle @multica_ws {
- reverse_proxy localhost:8080 {
- flush_interval -1
- }
- }
-
- reverse_proxy localhost:8080
-}
-```
-
-Two non-obvious bits inside the `/ws` block are worth calling out — both are common reasons real-time updates "stop working" on a Caddy-fronted self-host:
-
-- **`path /ws /ws/*` (not `/ws*`)** — bare `handle /ws` is an exact match, so future path variants under `/ws/` fall through to the frontend block. The obvious shortcut `handle /ws*` overcorrects in the other direction: Caddy's `*` is a glob without a path-segment boundary, so it would also catch unrelated paths like `/ws-foo`, which is a legitimate workspace URL (only the exact slug `ws` is reserved). Listing `/ws` and `/ws/*` explicitly covers both real cases without overreach.
-- **`flush_interval -1`** — disables response buffering so WebSocket frames are forwarded as soon as they arrive. Without it, frames can sit behind Caddy's default flush window, which looks like delayed comments, missing typing indicators, or "comments only appear after a page refresh."
-
-### Nginx
-
-```nginx
-# Frontend
-server {
- listen 443 ssl;
- server_name app.example.com;
-
- ssl_certificate /path/to/cert.pem;
- ssl_certificate_key /path/to/key.pem;
-
- location / {
- proxy_pass http://localhost:3000;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- }
-}
-
-# Backend API
-server {
- listen 443 ssl;
- server_name api.example.com;
-
- ssl_certificate /path/to/cert.pem;
- ssl_certificate_key /path/to/key.pem;
-
- location / {
- proxy_pass http://localhost:8080;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- }
-
- # WebSocket support
- location /ws {
- proxy_pass http://localhost:8080;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $host;
- proxy_read_timeout 86400;
- }
-}
-```
-
-When using separate domains for frontend and backend, set these environment variables accordingly:
-
-```bash
-# Backend
-FRONTEND_ORIGIN=https://app.example.com
-CORS_ALLOWED_ORIGINS=https://app.example.com
-COOKIE_DOMAIN=.example.com # narrowest parent covering both hosts — read the scope warning below
-
-# Frontend (runtime env; no rebuild required)
-REMOTE_API_URL=https://api.example.com
-NEXT_PUBLIC_API_URL=https://api.example.com
-NEXT_PUBLIC_WS_URL=wss://api.example.com/ws
-# Optional: route /docs through a separately deployed docs service
-DOCS_URL=https://docs.example.com
-```
-
-<Callout type="warning">
-`COOKIE_DOMAIN` is required in this setup — omitting it breaks every write. The web app authenticates with an HttpOnly `multica_auth` cookie plus a JS-readable `multica_csrf` cookie, and sends the CSRF value as an `X-CSRF-Token` header on every non-GET request. Both cookies are host-only unless `COOKIE_DOMAIN` is set, so a frontend on `app.example.com` cannot read a cookie issued by `api.example.com`. The header is then never sent and the backend rejects the request with `403 {"error":"CSRF validation failed"}` — while GET requests keep working, so the app renders but nothing can be created or edited.
-
-After changing `COOKIE_DOMAIN`, delete the existing `multica_auth` / `multica_csrf` cookies on **both** hosts and log in again. Stale host-only cookies otherwise sit alongside the new domain-scoped ones and the browser sends both.
-</Callout>
-
-<Callout type="warning">
-**Scope `COOKIE_DOMAIN` as narrowly as possible.** The same value also scopes `multica_auth`, the session JWT, and the browser then sends it to **every** host under that domain. `HttpOnly` only stops page scripts from reading the cookie — it does not stop the server behind a sibling subdomain from receiving it on every request. Use the narrowest parent that still covers both hosts: for `agent.example.com` + `api.agent.example.com` that is `.agent.example.com`, **not** `.example.com`, which would also hand your users' session cookie to unrelated hosts such as the separately deployed `docs.example.com` above.
-</Callout>
-
-Both of these must hold, or this layout is not safe to use:
-
-- The frontend and backend share a common parent domain. Unrelated domains (`app.com` and `api.io`) cannot be covered by any `COOKIE_DOMAIN` value.
-- Every host under that parent domain is operated by the same trusted party. If anything in scope is third-party hosted, or other teams can create records under it, a compromise or a rogue service there receives valid sessions for your deployment.
-
-If either condition fails, use the same-origin layout below, which keeps the session cookie host-only.
-
-### Same Origin (Recommended)
-
-A separate API domain is not required. Leave `NEXT_PUBLIC_API_URL` and `NEXT_PUBLIC_WS_URL` at their defaults and the browser calls `/api` and `/ws` on the page's own origin, so no cross-host cookie problem can arise in the first place:
-
-```bash
-# Backend
-FRONTEND_ORIGIN=https://app.example.com
-CORS_ALLOWED_ORIGINS=https://app.example.com
-COOKIE_DOMAIN= # empty: cookies are host-only on app.example.com, which is correct here
-
-# Frontend
-NEXT_PUBLIC_API_URL= # empty: the client uses relative /api paths on the page origin
-NEXT_PUBLIC_WS_URL= # empty
-REMOTE_API_URL=http://backend:8080 # target the Next.js rewrites proxy /api, /auth and /uploads to
-```
-
-Serve everything from the single `app.example.com` vhost. HTTP works out of the box, because Next.js rewrites forward `/api`, `/auth` and `/uploads` to `REMOTE_API_URL`. WebSockets do **not** go through those rewrites, so add a `/ws` block to the frontend vhost that reaches the backend directly:
-
-```nginx
-# Add to the app.example.com server block above
-location /ws {
- proxy_pass http://localhost:8080;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $host;
- proxy_read_timeout 86400;
-}
-```
-
-This keeps cookies, CORS, and the WebSocket origin check on a single origin. It is both the configuration least likely to break and the safer one: the session cookie stays host-only, so no sibling subdomain can ever receive it. An `api.example.com` vhost can still be kept for CLI and daemon use: those clients authenticate with a `mul_` personal access token over `Authorization: Bearer`, which never goes through the cookie or CSRF path.
-
-## Health Check
-
-The backend exposes public health endpoints:
-
-```text
-GET /health
-→ {"status":"ok"}
-
-GET /readyz
-→ {"status":"ok","checks":{"db":"ok","migrations":"ok"}}
-
-GET /healthz
-→ same response as /readyz
-```
-
-Use `/health` for basic liveness / reachability checks. Use `/readyz` for
-dependency-aware readiness probes and external monitoring that should fail when
-the database is unavailable or migrations are not fully applied. `/healthz` is
-kept as an alias for operator familiarity.
-
-## Upgrading
-
-1. Pull the latest code or image
-2. Run migrations: `./server/bin/migrate up`
-3. Restart the backend and frontend
-
-Migrations are forward-only and safe to run on a live database. They are idempotent — running them multiple times has no effect.
diff --git a/apps/docs/content/docs/github-integration.ja.mdx b/apps/docs/content/docs/github-integration.ja.mdx
index 73a89412bd..465d47ff99 100644
--- a/apps/docs/content/docs/github-integration.ja.mdx
+++ b/apps/docs/content/docs/github-integration.ja.mdx
@@ -1,229 +1,185 @@
---
title: GitHub 連携
-description: GitHub App を一度連携すれば、ブランチ・タイトル・本文にイシュー識別子を含む PR が該当イシューに自動で紐づきます。そして PR をマージするとイシューが Done に移動します。
+description: pull request を Multica のイシューに紐づけ、開発の進捗をイシューから確認します。
---
import { Callout } from "fumadocs-ui/components/callout";
-**設定 → GitHub** で GitHub アカウントまたは組織を一度だけ連携してください。その後は、ブランチ名・タイトル・本文にイシュー識別子(例: `MUL-123`)を含むあらゆる pull request が該当する[イシュー](/issues)に**自動で紐づき**、イシューサイドバーの **Pull requests** に表示され、PR がマージされるとイシューが **Done** に移動します。
+GitHub を接続すると、Multica はイシュー番号を使って pull request を自動的に紐づけます。イシューの詳細画面から、PR の状態、変更規模、CI の結果、マージ競合を直接確認できます。
-イシューごとの設定はありません。フロー全体が識別子で駆動されます。
+GitHub 連携が読み取るのは、インストール時に許可されたリポジトリだけです。コード、コメント、status check を書き込むことはありません。
-## 連携が行うこと
+セルフホスト版 Multica では、セルフホストの Forgejo、Gitea、GitLab インスタンスも同時に接続できます。PR の自動紐づけ、マージ時の Done への変更、CI 表示を同じように利用できます。**設定 → 連携 → Git ホスティング**から設定してください。詳しくは[セルフホスト Git ホスティング](/vcs-integration)を参照してください。Multica Cloud にはこの項目はありません。
-| 場所 | 動作 |
+## GitHub を接続する
+
+ワークスペースの owner または admin が接続できます。
+
+1. **設定 → GitHub** を開きます。
+2. GitHub 連携のメインスイッチを有効にします。
+3. **GitHub に接続**をクリックします。
+4. GitHub でアカウントまたは organization を選び、すべてのリポジトリか指定したリポジトリを許可します。
+5. インストールが完了したら Multica に戻ります。
+
+接続状態は同じページに表示されます。通常のメンバーは状態を確認できますが、接続、切断、スイッチの変更はできません。
+
+<Callout type="info">
+**GitHub 接続**は、Multica がどのリポジトリから PR イベントを受け取るかを決めます。**コードリポジトリ**設定は、エージェントがタスクを実行するときに選べるリポジトリを決めます。用途が異なるため、それぞれ設定する必要があります。
+</Callout>
+
+## 機能スイッチ
+
+**設定 → GitHub** には 4 つのスイッチがあります。
+
+| スイッチ | 機能 |
|---|---|
-| **設定 → GitHub** | ワークスペースの admin には、マスタートグル、**Connect GitHub** ボタン、機能スイッチ(PR サイドバー、Co-authored-by、自動紐づけ)を備えた GitHub タブが表示されます。インストール後は GitHub タブに戻ります。 |
-| **イシューサイドバー → Pull requests** | このイシューに自動で紐づいたすべての PR が、タイトル、リポジトリ、状態(`Open` / `Draft` / `Merged` / `Closed`)、作成者とともに表示されます。行をクリックすると GitHub の該当 PR に移動します。 |
-| **Webhook(バックグラウンド)** | すべての `pull_request` イベントで、Multica は PR 行を upsert し、PR からイシュー識別子をスキャンして、紐づけ行を(再)構築します。冪等性があり、同じ delivery を再送しても変化はありません。 |
-| **マージ時のステータス自動変更** | PR が `merged` に遷移すると、まだ `Done` でも `Cancelled` でもない、紐づいたすべてのイシューが `Done` に移動します。ステータス変更は source `github_pr_merged` でタイムラインに記録されます。 |
+| GitHub 連携 | メインスイッチ。無効にすると下の 3 項目は機能しなくなりますが、GitHub App の接続は解除されません。 |
+| PR サイドバー | 紐づいた pull request をイシューの詳細画面に表示します。 |
+| Co-authored-by | エージェントが作成する commit に `Co-authored-by: multica-agent <[email protected]>` を追加します。 |
+| PR の自動紐づけ | PR のブランチ名、タイトル、本文からイシュー番号を検出します。 |
| **PR カード → CI とマージ可否** | 紐づいた各 PR について、Multica は認証済みの GitHub API スナップショットを取得し、その **CI ステータス**と**マージ可否**をカードにミラーリングします(下記の **PR カードに表示される内容** を参照)。 |
-PR 自体の状態に加えて、この連携は紐づいた各 PR について、その **CI ステータス**(すべて成功、x 件が失敗(名前付き)、または x 件が実行中)と**マージ可否**(マージ可能、コンフリクトあり、blocked、behind)を、認証済みの GitHub API スナップショットから取得してミラーリングします。コミットやオープンな PR のないブランチ ref は引き続きモデル化されません。
-## PR カードに表示される内容
+## PR をイシューに紐づける
-紐づいた各 PR のカードには、それぞれ認証済みの GitHub API スナップショットから構築される 2 つの**独立した**要素があります。
+最も簡単な方法は、イシュー番号をブランチ名または PR タイトルへ入れることです。イシューが `MUL-123` の場合:
-- **CI ステータス** — 次のいずれか: **すべて成功**(件数付き、例: `7/7`)、**x 件が失敗**(失敗したチェック名を表示)、または **x 件が実行中**(進行中)。チェックがまだ 1 つも設定されていない PR ではどちらも表示されません — 「チェックなし」が成功として報告されることは決してありません。
-- **マージ可否** — 次のいずれか: **マージ可能**(GitHub がマージ状態を clean、つまりコンフリクトがなく**かつ**ブランチ保護を満たしていると報告した場合のみ表示)、**コンフリクトあり**、**blocked**、または **behind**。
-
-2 つは互いを隠しません — 1 つの PR がチェックの失敗**と**マージコンフリクトを同時に表示できます。マージ済み / クローズ済みの PR ではどちらも表示されません。行の状態アイコンがすでにそれを示しています。
+```text
+mul-123-fix-login-redirect
+```
-スナップショットは GitHub API から取得され、webhook イベント(`pull_request`、`check_run`、`check_suite`、`status`)の到着時、カードを開いたとき、および PR がまだオープンで未決の間は定期的に更新されます。GitHub の一時的な障害中は、カードは空白になるのではなく、最後に判明したスナップショットを **stale** として表示し続けます。
+```text
+MUL-123 ログイン後のリダイレクトを修正
+```
-## 識別子のマッチング方法
+Multica は大文字と小文字を区別せず、現在のワークスペースのイシュー接頭辞だけを照合します。1 つの PR を複数のイシューに紐づけることもできます。
-Webhook は次の順序で 3 つのフィールドから識別子を抽出します: **PR head ブランチ**、**PR タイトル**、**PR 本文**。マッチャーは次のとおりです。
+イシュー番号を PR 本文だけに書く場合は、GitHub の closing keyword を使ってください。
-- 大文字小文字を区別しません — `mul-123`、`MUL-123`、`Mul-123` はすべてマッチします。
-- 境界があります — 左側の `\b` と右側の数字アンカーにより、`v1.2-3` のようなバージョン番号やメール形式の文字列を誤って拾わないようにしています。
-- ワークスペーススコープに限定されます — そのワークスペース固有の[イシュー prefix](/workspaces)にのみマッチします。prefix が `MUL` のワークスペースでは、整数が別のイシューと一致しても `FOO-1` は無視されます。
-- 重複が除去されます — 本文に `MUL-1, MUL-1` と並べても、イシューは一度だけ紐づきます。
+```text
+Closes MUL-123
+Fixes MUL-123
+Resolves MUL-123
+```
-1 つの PR で**複数のイシュー**を参照できます。`Closes MUL-1, MUL-2` は PR を両方のイシューに紐づけ、マージすると両方が `Done` に進みます。
+本文に `Related to MUL-123` のような通常の参照を書いただけでは、そのイシューの作業 PR として表示されません。Commit message と PR コメントも紐づけの対象外です。
-## マージ時の Done 自動変更ルール
+## イシューから PR を確認する
-PR の `merged` フィールドが `true` に切り替わると、紐づいたすべてのイシューが評価されます。
+紐づけが完了すると、PR がイシュー詳細の **Pull requests** セクションに表示されます。各項目には次の情報が含まれます。
-| イシューの現在のステータス | 結果 |
-|---|---|
-| `done` | 変化なし(すでに終了状態)。 |
-| `cancelled` | **変化なし** — cancelled はユーザーが作業を明示的に放棄したことを意味するため、連携はこのシグナルを上書きしません。 |
-| それ以外すべて(`todo`、`in_progress`、`in_review`、`blocked`、`backlog`) | `done` に移動。 |
+- リポジトリ、番号、タイトル、作成者
+- `Open`、`Draft`、`Merged`、`Closed` の状態
+- 追加行数、削除行数、変更ファイル数
+- CI の状態: すべて成功した check の件数、失敗した check の名前、実行中の check の件数。check が 1 つも設定されていない PR ではこの項目を表示せず、「check なし」を成功として扱いません。
+- マージ可能性: GitHub がマージ状態を clean と報告した場合だけマージ可能。ほかに競合、blocked、behind を表示します。
-PR をマージ**せずに**クローズした場合は、PR カードの状態が `Closed` に更新されるだけです。紐づいたイシューはそのまま維持されます — マージせずにクローズすることが何を意味するかはユーザーが決めるからです。
+CI の状態とマージ可能性は、Multica が GitHub API から取得したスナップショットで、互いに独立しています。マージ済みまたはクローズ済みの PR では、この 2 項目を表示しません。GitHub が一時的に利用できない場合、カードを空にせず、前回のスナップショットを古い情報として表示します。
-<Callout type="info">
-この動作はタイムライン上で `system` アクターに帰属します。イシューの購読者は、人がステータスを移動したときと同じように、ステータス変更に関するインボックス通知を受け取ります。
-</Callout>
+項目をクリックすると GitHub の PR が開きます。**PR サイドバー**を無効にしてもこのセクションが非表示になるだけで、接続は解除されません。
-## 自動で紐づかないもの
+## PR のマージで Done になる条件
-- **コミットメッセージ内の識別子** — ブランチ / タイトル / 本文のみがスキャンされます。`MUL-123: fix login` というタイトルのコミットは、同じ文字列が PR タイトルや本文にも現れない限り自動では紐づきません。
-- **PR コメント内の識別子** — PR 自体のメタデータのみがスキャンされ、後から付いた GitHub コメントは無視されます。
-- **App がインストールされていないリポジトリの PR** — App がなければ、Multica は webhook をまったく受け取りません。
-- **PR をイシューに手動で紐づける** — まだこのための UI はありません。チームの慣習で識別子を Multica が読まない場所に置いている場合は、PR タイトルや本文に追加してください。
+PR がマージされても、必ずしもイシューが完了するわけではありません。Multica がイシューを `Done` に変更するのは、次の条件をすべて満たす場合だけです。
-## 連携解除
+1. 紐づいたマージ済み PR のうち少なくとも 1 つで、`Closes MUL-123` のように closing keyword の直後にイシュー番号を指定している。`Closes login MUL-123` のように間に別の単語がある形式は無効です。
+2. そのイシューに、`Open` または `Draft` の作業 PR がほかに残っていない。本文中の通常の参照は作業 PR に含みません。
+3. イシューの現在の状態が `done` または `cancelled` ではない。
-**設定 → GitHub** にはインストール一覧はありません — 既存のインストールは GitHub から直接管理します。
+そのため、ブランチ名やタイトルに `MUL-123` を含めるだけで紐づけは作成されますが、それだけではイシューを完了にしません。PR をマージせずにクローズした場合も、イシューは完了しません。
-- **GitHub から** — `https://github.com/settings/installations`(個人)または `https://github.com/organizations/<org>/settings/installations`(組織)で Multica GitHub App をアンインストールします。Multica は `installation.deleted` webhook を受け取ってリアルタイムで行を削除し、開いている Settings タブはリロードなしで更新されます。
-- **Multica 内部からの連携解除は admin 専用です** — GitHub タブの連携解除コントロールは、admin 以外のユーザーには非表示です。マスター GitHub スイッチがオフでも利用可能なままなので、admin はワンクリックで機能を無効化した後でも、古いインストールを取り消せます。
+状態の変更はシステム操作としてタイムラインに記録され、そのイシューを購読しているメンバーへ通知されます。
-連携解除後も、ミラーリングされた PR 行はデータベースに残り、過去のイシューサイドバーで何が紐づいていたかを引き続き表示しますが、そのインストールから新たに入ってくる webhook イベントは受理されなくなります。
+## 複数のワークスペース
-## 権限と可視性
+同じ GitHub App installation を複数の Multica ワークスペースへ接続できます。GitHub イベントは各ワークスペースにそれぞれ送られ、各ワークスペースのイシュー接頭辞に従って照合されます。
-- **連携 / 連携解除**にはワークスペースの **owner または admin** が必要です。member にはカードの説明は見えますが、Connect ボタンは見えません。
-- イシューの **Pull requests** サイドバーは、そのイシューを閲覧できる誰にでも表示されます — イシュー詳細の他の部分と同じ権限です。
-- GitHub App は pull request、checks、commit statuses、メタデータへの**読み取り専用**アクセスを要求します。Multica はコミット、コメント、ステータスチェックを GitHub に書き戻すことはありません — PR カードに表示される CI ステータスとマージ可否は読み取り専用で取得され、書き込まれることはありません。
+たとえば、1 つの PR が `MUL-1` と `ENG-2` の両方を参照している場合、異なる接頭辞を持つ 2 つのワークスペースでそれぞれ紐づけられます。ワークスペース間で相手のイシューが見えることはありません。
-## セルフホストのセットアップ
+## 接続を解除する
-Multica Cloud で Multica を実行している場合、連携はすでに構成済みです — このセクションは飛ばしてください。
+**設定 → GitHub** の**接続解除**をクリックすると、現在の Multica ワークスペースと installation の関係だけが削除されます。GitHub から App がアンインストールされることはありません。既存の PR 記録は保持されますが、新しいイベントはこのワークスペースに届かなくなります。
-セルフホストの場合は、GitHub App を 1 つ作成し、サーバーを指すように設定し、環境変数を設定します。フロー全体は以下のとおりです。
+GitHub 側のリポジトリアクセスを取り消す場合は、個人または organization の GitHub App installations ページで App をアンインストールするか、リポジトリの範囲を変更してください。App をアンインストールすると、その installation に接続していたすべての Multica ワークスペースがイベントを受信しなくなります。
-### 1. GitHub App を作成する
+## セルフホスト設定
-次のいずれかにアクセスしてください。
+Multica Cloud ではこのセクションの作業は不要です。セルフホスト環境では、自分の GitHub App を先に作成します。
-- 個人アカウント → `https://github.com/settings/apps/new`
-- 組織 → `https://github.com/organizations/<org>/settings/apps/new`
+### 1. GitHub App を作成する
-次を入力します。
+GitHub の **Developer settings → GitHub Apps** で App を作成し、次の値を入力します。
| フィールド | 値 |
|---|---|
-| **GitHub App name** | 見分けやすい名前、例: `Multica` または `Multica (staging)`。 |
-| **Homepage URL** | Multica フロントエンド、例: `https://multica.example.com`。 |
-| **Callback URL** | 空欄のままにしてください — Multica は OAuth ユーザー ID を使用しません。 |
-| **Setup URL** | `https://<api-host>/api/github/setup`。**「Redirect on update」をチェックしてください。** |
-| **Webhook → Active** | 有効。 |
-| **Webhook URL** | `https://<api-host>/api/webhooks/github`。 |
-| **Webhook secret** | 長いランダム文字列を生成してください(例: `openssl rand -hex 32`)。手順 2 で同じ値を Multica の env に貼り付けます。 |
-| **Permissions → Repository → Pull requests** | **Read-only**。 |
-| **Permissions → Repository → Checks** | **Read-only** — PR カードの CI ステータスを支えます。 |
-| **Permissions → Repository → Commit statuses** | **Read-only** — CI ロールアップのうち従来の status context 側です。 |
-| **Permissions → Repository → Metadata** | Read-only(必須)。 |
-| **Subscribe to events** | **Pull request**、**Check suite**、**Check run**、**Status** をチェックしてください。 |
-| **Where can this GitHub App be installed?** | お好みで。単一組織のセットアップなら `Only on this account` で十分です。 |
+| Homepage URL | Multica のフロントエンド URL。例: `https://multica.example.com` |
+| Callback URL | 空欄 |
+| Setup URL | `https://<api-host>/api/github/setup`。**Redirect on update** を有効にする |
+| Webhook URL | `https://<api-host>/api/webhooks/github` |
+| Webhook secret | 長期保管するランダムな文字列 |
-<Callout type="warning">
-**read だけを付与し、write は付与せず、それ以上は付けないでください。** **Checks: Read and write** は付与し**ないで**ください — write 権限を付けると、GitHub はこの App が自身の check run を報告することを期待し、その結果 check が永久に pending のままになります。読み取り専用が正しい設定です。この機能は **Actions: read** や **Contents: read** も**必要としません** — 追加しないでください。
-</Callout>
+Repository permissions:
-<Callout type="warning">
-**すでにインストール済みの App にこれらの権限を追加するには承認が必要です。** 既存の App に Checks、Commit statuses、Check run、Status を追加すると、GitHub はその変更を**保留中の権限リクエスト**として保持します — 各インストールの owner が(GitHub 上のそのインストールの設定で)承認するまで有効になりません。あるインストールが承認するまで、そのリポジトリの PR カードには CI / マージ状態が表示されません。
-</Callout>
+| 権限 | レベル |
+|---|---|
+| Metadata | Read-only |
+| Pull requests | Read-only |
+| Checks | Read-only。CI の状態表示に使用 |
+| Commit statuses | Read-only。legacy status 形式の CI 集計に使用 |
+
+次のイベントを購読します。
-**Create GitHub App** の後、App の詳細ページから 2 つのことを控えておいてください。
+- **Pull request**
+- **Check suite**、**Check run**、**Status**。CI とマージ可能性を更新するために使用します。
-- 上部の **public link** — その末尾が slug です。`https://github.com/apps/multica-acme` → slug = `multica-acme`。
-- 先ほど生成した **webhook secret**(後で GitHub から読み戻すことはできません — 今すぐ保存してください)。
+Multica で CI を表示しない場合は、Checks と Commit statuses の権限、および関連イベントの購読を省略できます。
<Callout type="warning">
-**Webhook secret ≠ Client secret。** App 設定ページには両方のフィールドが並んで配置されています。**Webhook secret** は `pull_request` の payload に署名する値で、Multica が必要とするものです。**Client secret** は OAuth 用で、この連携では使用しません。この 2 つを混同すると、すべての webhook delivery で紛らわしい `401 invalid signature` が発生します。
+必要なのは **Webhook secret** であり、OAuth Client secret ではありません。GitHub と Multica に入力した Webhook secret が異なる場合、GitHub delivery は `401 invalid signature` を返します。
</Callout>
### 2. 環境変数を設定する
-API サーバーで:
+App の公開 URL から slug を確認します。たとえば `https://github.com/apps/multica-acme` の slug は `multica-acme` です。
```dotenv
GITHUB_APP_SLUG=multica-acme
-GITHUB_WEBHOOK_SECRET=<the webhook secret you generated>
-
-# PR カードの CI ステータスとマージ可否に必須。これらがなくても連携は
-# PR のミラーリングとイシューの自動紐づけ / 自動クローズを続けますが、
-# PR カードには CI やマージ状態が一切表示されません:
-GITHUB_APP_ID=<App 設定ページに表示される数値の App ID>
-GITHUB_APP_PRIVATE_KEY=<BEGIN/END 行を含む完全な PEM ブロック>
+GITHUB_WEBHOOK_SECRET=<webhook secret entered when creating the App>
+FRONTEND_ORIGIN=https://multica.example.com
```
-`GITHUB_APP_SLUG` と `GITHUB_WEBHOOK_SECRET` は連携を起動するために必須です。どちらかが欠けていると:
-
-- Settings の `Connect GitHub` が**無効**になり、「not configured」のヒントが表示されます。
-- `/api/webhooks/github` エンドポイントが **`503 github webhooks not configured`** を返します — Multica は secret なしでイベントを処理することを拒否し、すべての署名を黙って有効として扱うことはありません。
-
-`GITHUB_APP_ID` と `GITHUB_APP_PRIVATE_KEY` は、**PR カードの CI ステータスとマージ可否**、および **Settings → Repositories → GitHub から選択**の両方に必要です。これらにより Multica は App として認証し(App JWT → installation token)、PR カードの GitHub API スナップショットを取得するとともに、metadata read のみに限定した短命 token で installation のリポジトリを一覧します。秘密鍵は App 設定ページの **Private keys → Generate a private key** で生成し、PEM ブロック全体(`-----BEGIN/END RSA PRIVATE KEY-----` の行を含む)を改行を保ったまま env 変数に貼り付けてください。これらがない場合、連携は**きれいに縮退**します: PR は引き続きミラーリングされ、イシューは引き続き自動で紐づき、マージ時に Done へ移動し、接続済みアカウント名も `installation.created` webhook から解決されます — ただし PR カードには CI やマージ状態が表示されず、リポジトリ参照も無効になります。
-
-`FRONTEND_ORIGIN` も設定されている必要があります(どのプロダクションのセルフホストでもすでに設定されています)。インストール後、setup コールバックがユーザーを `<FRONTEND_ORIGIN>/settings?tab=github` に戻します。
-
-env 変数を設定した後は API を再起動してください。
-
-### 3. マイグレーションを実行する
+`GITHUB_APP_SLUG` と `GITHUB_WEBHOOK_SECRET` のいずれかがない場合、接続ボタンは無効になり、webhook エンドポイントもイベントを拒否します。
-この連携はテーブルをマイグレーション `079_github_integration` で提供します。古いデプロイをアップグレードする場合:
+次の 2 つの変数は、PR カードに CI の状態とマージ可能性を表示するために必要です。Multica は App として認証し、スナップショットを取得します。
-```bash
-make migrate-up
+```dotenv
+GITHUB_APP_ID=<numeric GitHub App ID>
+GITHUB_APP_PRIVATE_KEY=<complete PEM private key, including BEGIN/END lines and newlines>
```
-3 つのテーブルが作成されます: `github_installation`、`github_pull_request`、`issue_pull_request`。これらはワークスペースとともに cascade-delete されるため、ワークスペースを削除すると自動的にクリーンアップされます。
-
-### 4. UI から連携する
-
-Multica で:
-
-1. owner または admin 権限で **設定 → GitHub** を開きます。
-2. **Connect GitHub** をクリックします。GitHub が新しいタブで開きます。
-3. アクセスを付与するリポジトリを選び、**Install** します。
-4. GitHub が `<api-host>/api/github/setup` にリダイレクトしてインストールを記録し、`<FRONTEND_ORIGIN>/settings?tab=github&github_connected=1` に戻します。
+秘密鍵は GitHub App の **Private keys → Generate a private key** から生成します。設定しない場合も連携は安全に縮退します。PR のミラー、イシューの自動紐づけ、マージ時の Done への変更は動作しますが、PR カードに CI やマージ状態は表示されません。
-その後、ブランチ / タイトル / 本文にイシュー識別子を含む PR を開いてみてください — 数秒以内に、そのイシューの詳細ページに Pull requests ブロックが表示されます。
+### 3. データベースを更新して接続する
-### 5. curl プローブで検証する
-
-インストール後に GitHub の **Recent Deliveries** ページで `401 invalid signature` が報告される場合、両側の secret が異なっています。どちらが間違っているかを最も速く突き止める方法は、GitHub を迂回することです。
-
-```bash
-SECRET="<the value you put in GITHUB_WEBHOOK_SECRET>"
-BODY='{"zen":"test"}'
-SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')
-curl -i -X POST https://<api-host>/api/webhooks/github \
- -H "X-Hub-Signature-256: sha256=$SIG" \
- -H "X-GitHub-Event: ping" \
- -H "Content-Type: application/json" \
- -d "$BODY"
-```
-
-| HTTP ステータス | 意味 | 解決方法 |
-|---|---|---|
-| `200` `{"ok":"pong"}` | サーバーがロードした secret が `$SECRET` と一致します。不一致は GitHub 側にあります。 | App → Webhook secret を編集 → **同じ値を貼り付け** → **Save changes**(保存せずにフィールドの外をクリックすると古い secret が維持されます)。再送してください。 |
-| `401 invalid signature` | サーバーがロードした secret が思っている値で**ありません**。 | env 変数が実行中のプロセスに反映されたか確認してください(例: `kubectl exec` → `echo -n "$GITHUB_WEBHOOK_SECRET" \| wc -c`)。再デプロイしてください。 |
-| `503 github webhooks not configured` | プロセスで `GITHUB_WEBHOOK_SECRET` が空です。 | env 変数を設定し、API を再起動してください。 |
-
-**App のイベントと権限を確認する。** 公開されている App メタデータのエンドポイントは、付与した内容をそのまま返します — 認証は不要です:
+既存のデプロイをアップグレードする場合は、通常のデータベースマイグレーションを先に実行します。
```bash
-curl -s https://api.github.com/apps/<slug>
+make migrate-up
```
-- `events` 配列には `pull_request`、`check_suite`、`check_run`、`status` が含まれているはずです。
-- `permissions` オブジェクトには `checks: read` と `statuses: read` が、`pull_requests: read` と `metadata: read` とともに含まれているはずです。
-
-いずれかが欠けている場合は、App の **Subscribe to events** / **Permissions** を修正してください — そして、すでにインストール済みの App に権限を追加しても、各インストールの owner が保留中のリクエストを承認して初めて有効になることを忘れないでください。
-
-**「PR カードに CI / マージ状態が表示されない」。** カードは PR を問題なくミラーリングするのに、チェックやマージ可否を一切表示しない場合:
-
-- 実行中の API プロセスに `GITHUB_APP_ID` と `GITHUB_APP_PRIVATE_KEY` が設定されているか確認してください — スナップショット取得の認証はこれらが担います。
-- 各インストールが Checks と Commit statuses の**保留中の権限リクエストを承認済み**か確認してください(上記のプローブを参照)。
-
-## 制限事項
+API サービスを再起動し、**設定 → GitHub** から接続します。
-現時点で知っておくべき、いくつかの粗い部分があります。
+## よくある問題
-- **まだ手動の紐づけ UI はありません** — PR を紐づける唯一の方法は、ブランチ、タイトル、本文に識別子を置くことです。
-- **レビュースレッドやレビュアー一覧はありません** — CI ステータスとマージ可否は PR カードに表示されるようになりました(**PR カードに表示される内容** を参照)が、レビューコメント、個々のレビュアー、その承認状態は表示されません。
-- マージ → Done ルールに対する**ワークスペースレベルの設定はありません** — 固定のデフォルトです(`cancelled` でない限り `merged → done`)。ワークスペースでカスタマイズできるマッピングは将来の追加予定です。
-- **1 つのイシューに複数の PR が紐づく場合、マージは保守的です** — 2 つの PR がどちらも `MUL-123` を参照していて最初の 1 つがマージされると、イシューはただちに `Done` に移動します。進める前に紐づいたすべての PR が解決されるのを待つ後続の変更が進行中です。
+- **接続ボタンを使用できない**: `GITHUB_APP_SLUG` と `GITHUB_WEBHOOK_SECRET` が API プロセスに設定されていることを確認します。
+- **Webhook が 401 を返す**: GitHub App と API が同じ Webhook secret を使っていることを確認し、GitHub の **Recent Deliveries** から再配信します。
+- **PR が紐づかない**: リポジトリが App の許可範囲にあること、PR の自動紐づけが有効であること、番号が現在のワークスペースのものかを確認します。
+- **本文に番号を書いても表示されない**: `Closes MUL-123` を使うか、番号をブランチ名または PR タイトルに入れます。
+- **CI の状態がない**: `GITHUB_APP_ID` と `GITHUB_APP_PRIVATE_KEY` が設定済みで、App に Checks と Commit statuses の read-only 権限があり、関連イベントを購読していることを確認します。インストール済み App に権限を追加した場合は、各 installation の所有者が GitHub 上で承認するまで有効になりません。
+- **PR のマージ後もイシューが完了しない**: PR で closing keyword を使っていることと、`Open` または `Draft` の関連 PR がほかに残っていないことを確認します。
-## 次に
+## 次のステップ
-- [イシュー](/issues) — PR から参照されるイシュー識別子(`MUL-123`)
-- [ワークスペース](/workspaces) — ワークスペース固有のイシュー prefix を設定する場所
-- [環境変数](/environment-variables) — 上記の GitHub 変数を含む env の完全なリファレンス
+- [イシュー](/issues) — 状態遷移と PR マージによる Done への変更
+- [プロジェクトリソース](/project-resources) — エージェントが実行時に使えるリポジトリ
+- [環境変数](/environment-variables) — セルフホスト GitHub App の全設定
diff --git a/apps/docs/content/docs/github-integration.ko.mdx b/apps/docs/content/docs/github-integration.ko.mdx
index 8b63156b92..834c73ce42 100644
--- a/apps/docs/content/docs/github-integration.ko.mdx
+++ b/apps/docs/content/docs/github-integration.ko.mdx
@@ -1,229 +1,185 @@
---
title: GitHub 연동
-description: GitHub App을 한 번만 연결하면, 브랜치·제목·본문에 이슈 식별자가 들어간 PR이 해당 이슈에 자동으로 연결됩니다. 그리고 PR을 머지하면 이슈가 완료로 이동합니다.
+description: pull request를 Multica 이슈에 연결하고 이슈에서 개발 진행 상황을 확인합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-**설정 → GitHub**에서 GitHub 계정 또는 조직을 한 번만 연결하세요. 그 후에는 브랜치 이름, 제목, 본문에 이슈 식별자(예: `MUL-123`)가 들어 있는 모든 pull request가 해당 [이슈](/issues)에 **자동으로 연결**되고, 이슈 사이드바의 **Pull requests** 아래에 표시되며, PR이 머지되면 이슈가 **완료**로 이동합니다.
+GitHub를 연결하면 Multica가 이슈 번호를 기준으로 pull request를 자동 연결합니다. 이슈 상세 화면에서 PR 상태, 변경 규모, CI 결과, merge conflict를 바로 확인할 수 있습니다.
-이슈별 설정은 없습니다. 전체 흐름은 식별자로 동작합니다.
+GitHub 연동은 설치할 때 승인한 저장소만 읽으며 코드, 댓글, status check를 제출하지 않습니다.
-## 연동이 하는 일
+자체 배포한 Multica에서는 자체 호스팅 Forgejo, Gitea, GitLab 인스턴스도 동시에 연결해 동일한 PR 자동 연결, merge 시 Done 전환, CI 표시 기능을 사용할 수 있습니다. **설정 → 연동 → Git 코드 호스팅**에서 연결하며 자세한 내용은 [자체 호스팅 Git 코드 호스팅](/vcs-integration)을 참고하세요. Multica Cloud에는 이 메뉴가 없습니다.
-| 위치 | 동작 |
+## GitHub 연결
+
+워크스페이스 owner 또는 admin이 연결할 수 있습니다.
+
+1. **설정 → GitHub**를 엽니다.
+2. GitHub 연동 전체 스위치를 켭니다.
+3. **GitHub 연결**을 클릭합니다.
+4. GitHub에서 계정 또는 조직을 선택하고 모든 저장소나 지정한 저장소를 승인합니다.
+5. 설치가 끝나면 Multica로 돌아옵니다.
+
+연결 상태는 같은 페이지에 표시됩니다. 일반 멤버는 상태를 볼 수 있지만 연결, 연결 해제, 스위치 변경은 할 수 없습니다.
+
+<Callout type="info">
+**GitHub 연결**은 Multica가 어느 저장소에서 PR 이벤트를 받을지 결정합니다. **코드 저장소** 설정은 에이전트가 태스크를 실행할 때 선택할 수 있는 저장소를 결정합니다. 용도가 다르므로 각각 설정해야 합니다.
+</Callout>
+
+## 기능 스위치
+
+**설정 → GitHub**에는 네 가지 스위치가 있습니다.
+
+| 스위치 | 역할 |
|---|---|
-| **설정 → GitHub** | 워크스페이스 admin에게는 마스터 토글, **Connect GitHub** 버튼, 기능 스위치(PR 사이드바, Co-authored-by, 자동 연결)가 있는 GitHub 탭이 보입니다. 설치 후에는 GitHub 탭으로 다시 돌아옵니다. |
-| **이슈 사이드바 → Pull requests** | 이 이슈에 자동 연결된 모든 PR이 제목, 저장소, 상태(`Open` / `Draft` / `Merged` / `Closed`), 작성자와 함께 표시됩니다. 행을 클릭하면 GitHub의 해당 PR로 이동합니다. |
-| **Webhook(백그라운드)** | 모든 `pull_request` 이벤트에서 Multica는 PR 행을 upsert하고, PR에서 이슈 식별자를 스캔한 뒤, 연결 행을 (다시) 구성합니다. 멱등성이 있어 동일 delivery를 재전송해도 변화가 없습니다. |
-| **머지 시 상태 자동 변경** | PR이 `merged`로 전환되면, 아직 `Done`이나 `Cancelled`가 아닌 모든 연결된 이슈가 `Done`으로 이동합니다. 상태 변경은 source `github_pr_merged`로 타임라인에 기록됩니다. |
+| GitHub 연동 | 전체 스위치입니다. 끄면 아래 세 기능이 작동하지 않지만 GitHub App 연결은 해제되지 않습니다. |
+| PR 사이드바 | 이슈 상세 화면에 연결된 pull request를 표시합니다. |
+| Co-authored-by | 에이전트가 만든 commit에 `Co-authored-by: multica-agent <[email protected]>`를 추가합니다. |
+| PR 자동 연결 | PR의 브랜치 이름, 제목, 본문에서 이슈 번호를 찾습니다. |
| **PR 카드 → CI와 머지 가능 여부** | 연결된 각 PR에 대해 Multica는 인증된 GitHub API 스냅샷을 가져와, 그 **CI 상태**와 **머지 가능 여부**를 카드에 미러링합니다(아래 **PR 카드에 표시되는 것** 참조). |
-PR 자체의 상태 외에도, 이 연동은 연결된 각 PR에 대해 그 **CI 상태**(모두 통과, x개 실패(이름 표시), 또는 x개 실행 중)와 **머지 가능 여부**(머지 가능, 충돌 있음, blocked, behind)를 인증된 GitHub API 스냅샷에서 가져와 미러링합니다. 커밋과 열린 PR이 없는 브랜치 ref는 여전히 모델링되지 않습니다.
-
-## PR 카드에 표시되는 것
-연결된 각 PR의 카드에는 각각 인증된 GitHub API 스냅샷에서 구성되는 두 개의 **독립적인** 요소가 있습니다.
+## PR을 이슈에 연결
-- **CI 상태** — 다음 중 하나: **모두 통과**(개수와 함께, 예: `7/7`), **x개 실패**(실패한 체크 이름 표시), 또는 **x개 실행 중**(진행 중). 아직 체크가 하나도 설정되지 않은 PR은 둘 다 표시하지 않습니다 — 「체크 없음」이 통과로 보고되는 일은 결코 없습니다.
-- **머지 가능 여부** — 다음 중 하나: **머지 가능**(GitHub가 머지 상태를 clean, 즉 충돌이 없고 **또한** 브랜치 보호를 충족한다고 보고할 때만 표시), **충돌 있음**, **blocked**, 또는 **behind**.
+가장 간단한 방법은 이슈 번호를 브랜치 이름이나 PR 제목에 넣는 것입니다. 예를 들어 이슈가 `MUL-123`인 경우:
-두 요소는 서로를 가리지 않습니다 — 하나의 PR이 체크 실패**와** 머지 충돌을 동시에 표시할 수 있습니다. 머지됨 / 닫힘 PR은 둘 다 표시하지 않습니다. 행의 상태 아이콘이 이미 그것을 나타냅니다.
+```text
+mul-123-fix-login-redirect
+```
-스냅샷은 GitHub API에서 가져오며, webhook 이벤트(`pull_request`, `check_run`, `check_suite`, `status`) 도착 시, 카드를 열 때, 그리고 PR이 아직 열려 있고 미결 상태인 동안 주기적으로 새로고침됩니다. GitHub의 일시적 장애 중에는 카드가 비워지는 대신 마지막으로 알려진 스냅샷을 **stale**로 표시한 채 계속 보여줍니다.
+```text
+MUL-123 로그인 후 리디렉션 수정
+```
-## 식별자 매칭 방식
+Multica는 대소문자를 구분하지 않으며 현재 워크스페이스의 이슈 접두사만 매칭합니다. 하나의 PR을 여러 이슈에 연결할 수 있습니다.
-Webhook은 다음 순서로 세 필드에서 식별자를 추출합니다: **PR head 브랜치**, **PR 제목**, **PR 본문**. 매처는 다음과 같습니다.
+이슈 번호를 PR 본문에만 쓸 때는 GitHub의 종료 문구를 사용해야 합니다.
-- 대소문자를 구분하지 않습니다 — `mul-123`, `MUL-123`, `Mul-123`이 모두 매칭됩니다.
-- 경계가 있습니다 — 왼쪽의 `\b`와 오른쪽의 숫자 앵커 덕분에 `v1.2-3` 같은 버전 번호나 이메일 형식 문자열을 잘못 잡지 않습니다.
-- 워크스페이스 범위로 제한됩니다 — 해당 워크스페이스 고유의 [이슈 prefix](/workspaces)에만 매칭됩니다. prefix가 `MUL`인 워크스페이스에서는 정수가 다른 이슈와 일치하더라도 `FOO-1`이 무시됩니다.
-- 중복이 제거됩니다 — 본문에 `MUL-1, MUL-1`을 나열해도 이슈는 한 번만 연결됩니다.
+```text
+Closes MUL-123
+Fixes MUL-123
+Resolves MUL-123
+```
-하나의 PR에서 **여러 이슈**를 참조할 수 있습니다. `Closes MUL-1, MUL-2`는 PR을 두 이슈에 모두 연결하고, 머지하면 두 이슈 모두 `Done`으로 진행됩니다.
+본문의 `Related to MUL-123` 같은 일반 언급은 해당 이슈의 작업 PR로 표시되지 않습니다. Commit message와 PR 댓글도 연결을 트리거하지 않습니다.
-## 머지 시 완료 자동 변경 규칙
+## 이슈에서 PR 확인
-PR의 `merged` 필드가 `true`로 바뀌면, 연결된 모든 이슈가 평가됩니다.
+연결에 성공하면 PR이 이슈 상세 화면의 **Pull requests** 영역에 나타납니다. 각 항목에는 다음 내용이 표시됩니다.
-| 이슈 현재 상태 | 결과 |
-|---|---|
-| `done` | 변화 없음(이미 종료 상태). |
-| `cancelled` | **변화 없음** — 취소됨은 사용자가 작업을 명시적으로 포기했다는 의미이므로, 연동이 이 신호를 덮어쓰지 않습니다. |
-| 그 외 모두(`todo`, `in_progress`, `in_review`, `blocked`, `backlog`) | `done`으로 이동. |
+- 저장소, 번호, 제목, 작성자
+- `Open`, `Draft`, `Merged`, `Closed` 상태
+- 추가 및 삭제한 줄 수와 변경한 파일 수
+- CI 상태: 모두 통과(개수 표시), 일부 실패(실패한 check 이름 표시), 일부 진행 중. 설정된 check가 없는 PR에는 이 항목을 표시하지 않으며 "check 없음"을 통과로 간주하지 않습니다.
+- merge 가능 여부: merge 가능(GitHub가 merge 상태를 clean으로 보고한 경우만), conflict 있음, blocked, behind
-PR을 머지하지 **않고** 닫으면 PR 카드의 상태만 `Closed`로 업데이트됩니다. 연결된 이슈는 그대로 유지됩니다 — 머지 없이 닫는 것이 무엇을 의미하는지는 사용자가 결정합니다.
+CI 상태와 merge 가능 여부는 Multica가 GitHub API에서 가져온 snapshot이며 서로 독립적입니다. 이미 merge되거나 닫힌 PR에는 두 항목을 더 이상 표시하지 않습니다. GitHub를 일시적으로 사용할 수 없으면 카드가 비워지는 대신 마지막 snapshot을 유지하고 만료된 정보라고 표시합니다.
-<Callout type="info">
-이 동작은 타임라인에서 `system` 액터에게 귀속됩니다. 이슈 구독자는 사람이 상태를 옮겼을 때와 동일하게 상태 변경에 대한 인박스 알림을 받습니다.
-</Callout>
+항목을 클릭하면 GitHub의 PR이 열립니다. **PR 사이드바**를 꺼도 이 영역만 숨겨질 뿐 연결은 해제되지 않습니다.
-## 자동 연결되지 않는 것
+## PR merge 시 Done 전환 조건
-- **커밋 메시지의 식별자** — 브랜치 / 제목 / 본문만 스캔됩니다. `MUL-123: fix login`이라는 제목의 커밋은 동일한 문자열이 PR 제목이나 본문에도 나타나지 않는 한 자동 연결되지 않습니다.
-- **PR 댓글의 식별자** — PR 자체의 메타데이터만 스캔되며, 이후의 GitHub 댓글은 무시됩니다.
-- **App이 설치되지 않은 저장소의 PR** — App이 없으면 Multica는 webhook을 전혀 받지 못합니다.
-- **PR을 이슈에 수동으로 연결하기** — 아직 이를 위한 UI는 없습니다. 팀의 규칙상 식별자를 Multica가 읽지 않는 위치에 둔다면, PR 제목이나 본문에 추가하세요.
+PR이 merge되었다고 이슈가 반드시 완료된 것은 아닙니다. Multica는 다음 조건이 모두 충족될 때만 이슈를 `Done`으로 바꿉니다.
-## 연결 해제
+1. merge된 연결 PR이 하나 이상 있고, `Closes MUL-123`처럼 종료 문구 바로 뒤에 번호가 있습니다(`Closes login MUL-123`처럼 중간에 다른 단어가 있으면 적용되지 않음).
+2. 해당 이슈에 `Open` 또는 `Draft` 상태인 다른 작업 PR이 없습니다. 본문의 일반 언급은 작업 PR에 포함되지 않습니다.
+3. 이슈의 현재 상태가 `done` 또는 `cancelled`가 아닙니다.
-**설정 → GitHub**에는 설치 목록이 없습니다 — 기존 설치는 GitHub에서 직접 관리합니다.
+따라서 브랜치 이름이나 제목에 `MUL-123`만 넣으면 연결은 되지만 그것만으로 완료를 트리거하지 않습니다. PR을 merge하지 않고 닫아도 이슈가 완료되지 않습니다.
-- **GitHub에서** — `https://github.com/settings/installations`(개인) 또는 `https://github.com/organizations/<org>/settings/installations`(조직)에서 Multica GitHub App을 제거합니다. Multica는 `installation.deleted` webhook을 받아 실시간으로 행을 삭제하며, 열려 있는 Settings 탭은 새로고침 없이 업데이트됩니다.
-- **Multica 내부에서의 연결 해제는 admin 전용입니다** — GitHub 탭의 연결 해제 컨트롤은 admin이 아닌 사용자에게는 숨겨집니다. 마스터 GitHub 스위치가 꺼져 있어도 계속 사용할 수 있어, admin이 원클릭으로 기능을 비활성화한 후에도 오래된 설치를 해제할 수 있습니다.
+상태 변경은 시스템 작업으로 타임라인에 기록되고 해당 이슈 구독자에게 알림이 전달됩니다.
-연결 해제 후에도 미러링된 PR 행은 데이터베이스에 남아 과거 이슈 사이드바에서 무엇이 연결되어 있었는지 계속 보여주지만, 해당 설치에서 새로 들어오는 webhook 이벤트는 더 이상 수락되지 않습니다.
+## 여러 워크스페이스
-## 권한 및 가시성
+같은 GitHub App installation을 여러 Multica 워크스페이스에 연결할 수 있습니다. GitHub 이벤트는 각 워크스페이스로 따로 들어가고 각 워크스페이스의 이슈 접두사를 기준으로 매칭됩니다.
-- **연결 / 연결 해제**에는 워크스페이스 **owner 또는 admin**이 필요합니다. member에게는 카드 설명은 보이지만 Connect 버튼은 보이지 않습니다.
-- 이슈의 **Pull requests** 사이드바는 해당 이슈를 읽을 수 있는 모든 사람에게 보입니다 — 이슈 상세의 나머지 부분과 동일한 권한입니다.
-- GitHub App은 pull request, checks, commit statuses, 메타데이터에 대한 **읽기 전용** 액세스를 요청합니다. Multica는 커밋, 댓글, 상태 체크를 GitHub로 다시 푸시하지 않습니다 — PR 카드에 표시되는 CI 상태와 머지 가능 여부는 읽기 전용으로 가져오며, 절대 쓰지 않습니다.
+예를 들어 PR 하나에서 `MUL-1`과 `ENG-2`를 함께 참조하면 서로 다른 접두사를 사용하는 두 워크스페이스에 각각 연결될 수 있습니다. 워크스페이스는 서로의 이슈를 볼 수 없습니다.
-## 자체 호스팅 설정
+## 연결 해제
-Multica Cloud에서 Multica를 실행 중이라면 연동이 이미 구성되어 있습니다 — 이 섹션은 건너뛰세요.
+**설정 → GitHub**에서 **연결 해제**를 클릭하면 현재 Multica 워크스페이스와 해당 installation의 관계만 제거됩니다. GitHub에서 App을 대신 제거하지는 않습니다. 기존 PR 기록은 유지되고 새 이벤트만 해당 워크스페이스에 들어오지 않습니다.
-자체 호스팅의 경우, GitHub App을 하나 만들고, 서버를 가리키게 한 뒤, 환경 변수를 설정합니다. 전체 흐름은 아래와 같습니다.
+GitHub 측의 저장소 승인을 취소하려면 개인 또는 조직의 GitHub App installations 페이지에서 App을 제거하거나 저장소 범위를 조정해야 합니다. App을 제거하면 해당 installation에 연결된 모든 Multica 워크스페이스가 이벤트 수신을 중지합니다.
-### 1. GitHub App 만들기
+## 자체 호스팅 설정
-다음 중 하나로 이동하세요.
+Multica Cloud에서는 이 절차가 필요 없습니다. 자체 호스팅 환경에서는 자신의 GitHub App을 먼저 만들어야 합니다.
-- 개인 계정 → `https://github.com/settings/apps/new`
-- 조직 → `https://github.com/organizations/<org>/settings/apps/new`
+### 1. GitHub App 만들기
-다음을 입력하세요.
+GitHub의 **Developer settings → GitHub Apps**에서 App을 만들고 다음 값을 입력합니다.
| 필드 | 값 |
|---|---|
-| **GitHub App name** | 알아보기 쉬운 이름, 예: `Multica` 또는 `Multica (staging)`. |
-| **Homepage URL** | Multica 프론트엔드, 예: `https://multica.example.com`. |
-| **Callback URL** | 비워 두세요 — Multica는 OAuth 사용자 신원을 사용하지 않습니다. |
-| **Setup URL** | `https://<api-host>/api/github/setup`. **"Redirect on update"를 체크하세요.** |
-| **Webhook → Active** | 활성화. |
-| **Webhook URL** | `https://<api-host>/api/webhooks/github`. |
-| **Webhook secret** | 긴 무작위 문자열을 생성하세요(예: `openssl rand -hex 32`). 2단계에서 동일한 값을 Multica의 env에 붙여넣게 됩니다. |
-| **Permissions → Repository → Pull requests** | **Read-only**. |
-| **Permissions → Repository → Checks** | **Read-only** — PR 카드의 CI 상태를 구동합니다. |
-| **Permissions → Repository → Commit statuses** | **Read-only** — CI 롤업 중 레거시 status context 쪽입니다. |
-| **Permissions → Repository → Metadata** | Read-only(필수). |
-| **Subscribe to events** | **Pull request**, **Check suite**, **Check run**, **Status**를 체크하세요. |
-| **Where can this GitHub App be installed?** | 선택 사항. 단일 조직 설정에는 `Only on this account`로 충분합니다. |
+| Homepage URL | Multica 프런트엔드 주소. 예: `https://multica.example.com` |
+| Callback URL | 비워 둠 |
+| Setup URL | `https://<api-host>/api/github/setup`, **Redirect on update** 활성화 |
+| Webhook URL | `https://<api-host>/api/webhooks/github` |
+| Webhook secret | 장기 보관할 임의 문자열 |
-<Callout type="warning">
-**read만 부여하고, write는 부여하지 말고, 그 이상도 추가하지 마세요.** **Checks: Read and write**는 부여하지 **마세요** — write 권한을 주면 GitHub는 이 App이 자체 check run을 보고할 것으로 기대하여, 결과적으로 check가 영구히 pending 상태로 남습니다. 읽기 전용이 올바른 설정입니다. 이 기능은 **Actions: read**나 **Contents: read**도 **필요로 하지 않습니다** — 추가하지 마세요.
-</Callout>
+Repository permissions:
-<Callout type="warning">
-**이미 설치된 App에 이 권한들을 추가하려면 승인이 필요합니다.** 기존 App에 Checks, Commit statuses, Check run, Status를 추가하면 GitHub는 그 변경을 **대기 중인 권한 요청**으로 보류합니다 — 각 설치의 owner가 (GitHub의 해당 설치 설정에서) 승인해야 적용됩니다. 어떤 설치가 승인하기 전까지 그 저장소의 PR 카드에는 CI / 머지 상태가 표시되지 않습니다.
-</Callout>
+| 권한 | 수준 |
+|---|---|
+| Metadata | Read-only |
+| Pull requests | Read-only |
+| Checks | Read-only. CI 상태 표시에 사용 |
+| Commit statuses | Read-only. legacy status 형식의 CI 집계에 사용 |
+
+다음 이벤트를 구독합니다.
-**Create GitHub App** 후, App 상세 페이지에서 두 가지를 기록해 두세요.
+- **Pull request**
+- CI와 merge 가능 여부 새로 고침을 트리거할 **Check suite**, **Check run**, **Status**
-- 상단의 **public link** — 그 꼬리가 slug입니다. `https://github.com/apps/multica-acme` → slug = `multica-acme`.
-- 방금 생성한 **webhook secret**(나중에 GitHub에서 다시 읽을 수 없으니 — 지금 저장하세요).
+Multica에서 CI를 표시할 필요가 없다면 Checks 및 Commit statuses 권한을 부여하거나 관련 이벤트를 구독하지 않아도 됩니다.
<Callout type="warning">
-**Webhook secret ≠ Client secret.** App 설정 페이지에는 두 필드가 함께 쌓여 있습니다. **Webhook secret**은 `pull_request` payload에 서명하는 값으로, Multica가 필요로 하는 것입니다. **Client secret**은 OAuth용이며 이 연동에서는 사용되지 않습니다. 이 둘을 혼동하면 모든 webhook delivery에서 혼란스러운 `401 invalid signature`가 발생합니다.
+여기에는 OAuth Client secret이 아니라 **Webhook secret**이 필요합니다. 양쪽에 입력한 Webhook secret이 다르면 GitHub delivery가 `401 invalid signature`를 반환합니다.
</Callout>
### 2. 환경 변수 설정
-API 서버에서:
+App의 공개 주소에서 slug를 확인합니다. 예를 들어 `https://github.com/apps/multica-acme`의 slug는 `multica-acme`입니다.
```dotenv
GITHUB_APP_SLUG=multica-acme
-GITHUB_WEBHOOK_SECRET=<the webhook secret you generated>
-
-# PR 카드의 CI 상태와 머지 가능 여부에 필수. 이 둘이 없어도 연동은
-# PR 미러링과 이슈 자동 연결 / 자동 종료를 계속하지만,
-# PR 카드에는 CI나 머지 상태가 전혀 표시되지 않습니다:
-GITHUB_APP_ID=<App 설정 페이지에 표시되는 숫자 App ID>
-GITHUB_APP_PRIVATE_KEY=<BEGIN/END 줄을 포함한 전체 PEM 블록>
+GITHUB_WEBHOOK_SECRET=<App을 만들 때 입력한 webhook secret>
+FRONTEND_ORIGIN=https://multica.example.com
```
-`GITHUB_APP_SLUG`와 `GITHUB_WEBHOOK_SECRET`은 연동을 시작하기 위한 필수 항목입니다. 둘 중 하나라도 누락되면:
-
-- Settings의 `Connect GitHub`이 **비활성화**되고 "not configured" 힌트가 표시됩니다.
-- `/api/webhooks/github` 엔드포인트가 **`503 github webhooks not configured`**를 반환합니다 — Multica는 secret 없이 이벤트를 처리하기를 거부하며, 모든 서명을 조용히 유효한 것으로 취급하지 않습니다.
-
-`GITHUB_APP_ID`와 `GITHUB_APP_PRIVATE_KEY`는 **PR 카드의 CI 상태와 머지 가능 여부** 및 **Settings → Repositories → GitHub에서 선택** 기능 모두에 필요합니다. 이 둘로 Multica가 App으로 인증하고(App JWT → installation token), PR 카드의 GitHub API 스냅샷을 가져오며, metadata read로 제한된 단명 token으로 installation의 저장소를 나열합니다. 비공개 키는 App 설정 페이지의 **Private keys → Generate a private key**에서 생성한 뒤, PEM 블록 전체(`-----BEGIN/END RSA PRIVATE KEY-----` 줄 포함)를 줄바꿈을 유지한 채 env 값에 붙여넣으세요. 이 둘이 없으면 연동은 **깔끔하게 축소**됩니다: PR은 계속 미러링되고, 이슈는 계속 자동 연결되며 머지 시 Done으로 이동하고, 연결된 계정 이름도 `installation.created` 웹훅에서 확인됩니다 — 다만 PR 카드에는 CI나 머지 상태가 표시되지 않고 저장소 탐색도 비활성화됩니다.
-
-`FRONTEND_ORIGIN`도 설정되어 있어야 합니다(어떤 프로덕션 자체 호스팅이든 이미 설정되어 있습니다). 설치 후 setup 콜백이 사용자를 `<FRONTEND_ORIGIN>/settings?tab=github`으로 다시 돌려보냅니다.
-
-env 변수를 설정한 후 API를 재시작하세요.
+`GITHUB_APP_SLUG`와 `GITHUB_WEBHOOK_SECRET` 중 하나라도 없으면 연결 버튼이 비활성화되고 webhook endpoint도 이벤트 처리를 거부합니다.
-### 3. 마이그레이션 실행
+다음 두 변수는 PR 카드에서 CI 상태와 merge 가능 여부를 표시하기 위해 필요합니다. Multica는 이 값으로 App 신원을 인증하고 snapshot을 가져옵니다.
-이 연동은 테이블을 마이그레이션 `079_github_integration`으로 제공합니다. 기존 배포를 업그레이드하는 경우:
-
-```bash
-make migrate-up
+```dotenv
+GITHUB_APP_ID=<GitHub App 숫자 ID>
+GITHUB_APP_PRIVATE_KEY=<BEGIN/END 줄과 줄바꿈을 유지한 전체 PEM private key>
```
-세 개의 테이블이 생성됩니다: `github_installation`, `github_pull_request`, `issue_pull_request`. 이들은 워크스페이스와 함께 cascade-delete되므로, 워크스페이스를 제거하면 자동으로 정리됩니다.
-
-### 4. UI에서 연결
-
-Multica에서:
+Private key는 GitHub App의 **Private keys → Generate a private key**에서 생성합니다. 설정하지 않으면 연동 기능이 자연스럽게 축소됩니다. PR은 계속 미러링되고 이슈 자동 연결과 merge 시 Done 전환도 정상적으로 작동하지만 PR 카드에 CI 또는 merge 상태가 표시되지 않습니다.
-1. owner 또는 admin 권한으로 **설정 → GitHub**를 엽니다.
-2. **Connect GitHub**를 클릭합니다. GitHub가 새 탭에서 열립니다.
-3. 액세스를 부여할 저장소를 선택하고 **Install**합니다.
-4. GitHub가 `<api-host>/api/github/setup`으로 리디렉션하여 설치를 기록한 뒤, `<FRONTEND_ORIGIN>/settings?tab=github&github_connected=1`로 돌려보냅니다.
+### 3. 데이터베이스 업데이트 및 연결
-그 후, 브랜치 / 제목 / 본문에 이슈 식별자가 들어 있는 PR을 열어 보세요 — 몇 초 내에 해당 이슈의 상세 페이지에 Pull requests 블록이 나타납니다.
-
-### 5. curl 프로브로 검증
-
-설치 후 GitHub의 **Recent Deliveries** 페이지에서 `401 invalid signature`가 보고된다면, 양쪽의 secret이 다른 것입니다. 어느 쪽이 잘못되었는지 가장 빠르게 찾는 방법은 GitHub를 우회하는 것입니다.
-
-```bash
-SECRET="<the value you put in GITHUB_WEBHOOK_SECRET>"
-BODY='{"zen":"test"}'
-SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')
-curl -i -X POST https://<api-host>/api/webhooks/github \
- -H "X-Hub-Signature-256: sha256=$SIG" \
- -H "X-GitHub-Event: ping" \
- -H "Content-Type: application/json" \
- -d "$BODY"
-```
-
-| HTTP 상태 | 의미 | 해결 방법 |
-|---|---|---|
-| `200` `{"ok":"pong"}` | 서버가 로드한 secret이 `$SECRET`과 일치합니다. 불일치는 GitHub 쪽에 있습니다. | App → Webhook secret 편집 → **동일한 값을 붙여넣기** → **Save changes**(저장하지 않고 필드 밖을 클릭하면 이전 secret이 유지됩니다). 재전송하세요. |
-| `401 invalid signature` | 서버가 로드한 secret이 생각하는 값이 **아닙니다**. | env 변수가 실행 중인 프로세스에 적용되었는지 확인하세요(예: `kubectl exec` → `echo -n "$GITHUB_WEBHOOK_SECRET" \| wc -c`). 재배포하세요. |
-| `503 github webhooks not configured` | 프로세스에서 `GITHUB_WEBHOOK_SECRET`이 비어 있습니다. | env 변수를 설정하고 API를 재시작하세요. |
-
-**App의 이벤트와 권한을 확인하세요.** 공개된 App 메타데이터 엔드포인트는 부여한 내용을 그대로 반환합니다 — 인증이 필요 없습니다:
+기존 배포를 업그레이드할 때는 먼저 일반 데이터베이스 migration을 실행합니다.
```bash
-curl -s https://api.github.com/apps/<slug>
+make migrate-up
```
-- `events` 배열에는 `pull_request`, `check_suite`, `check_run`, `status`가 포함되어야 합니다.
-- `permissions` 객체에는 `checks: read`와 `statuses: read`가 `pull_requests: read`, `metadata: read`와 함께 포함되어야 합니다.
-
-빠진 것이 있으면 App의 **Subscribe to events** / **Permissions**를 고치세요 — 그리고 이미 설치된 App에 권한을 추가해도 각 설치의 owner가 대기 중인 요청을 승인해야 비로소 적용된다는 점을 기억하세요.
-
-**「PR 카드에 CI / 머지 상태가 표시되지 않음」.** 카드가 PR은 정상적으로 미러링하지만 체크나 머지 가능 여부를 전혀 표시하지 않는 경우:
-
-- 실행 중인 API 프로세스에 `GITHUB_APP_ID`와 `GITHUB_APP_PRIVATE_KEY`가 설정되어 있는지 확인하세요 — 스냅샷 가져오기의 인증은 이 둘이 담당합니다.
-- 각 설치가 Checks와 Commit statuses의 **대기 중인 권한 요청을 승인**했는지 확인하세요(위 프로브 참조).
-
-## 제한 사항
+API 서비스를 다시 시작한 뒤 **설정 → GitHub**에서 연결을 완료합니다.
-현재 알아 둬야 할 몇 가지 거친 부분이 있습니다.
+## 자주 묻는 문제
-- **아직 수동 연결 UI가 없습니다** — PR을 연결하는 유일한 방법은 브랜치, 제목, 본문에 식별자를 두는 것입니다.
-- **리뷰 스레드나 리뷰어 목록이 없습니다** — CI 상태와 머지 가능 여부는 이제 PR 카드에 표시됩니다(**PR 카드에 표시되는 것** 참조). 다만 리뷰 댓글, 개별 리뷰어, 그 승인 상태는 표시되지 않습니다.
-- 머지 → 완료 규칙에 대한 **워크스페이스 수준 설정이 없습니다** — 고정된 기본값입니다(`cancelled`가 아닌 한 `merged → done`). 워크스페이스에서 커스터마이즈할 수 있는 매핑은 향후 추가될 예정입니다.
-- **하나의 이슈에 여러 PR이 연결된 경우 머지가 보수적입니다** — 두 PR이 모두 `MUL-123`을 참조하고 첫 번째가 머지되면, 이슈는 즉시 `Done`으로 이동합니다. 진행하기 전에 연결된 모든 PR이 해결되기를 기다리는 후속 변경이 진행 중입니다.
+- **연결 버튼을 사용할 수 없음**: `GITHUB_APP_SLUG`와 `GITHUB_WEBHOOK_SECRET`이 API 프로세스에 전달되었는지 확인합니다.
+- **Webhook이 401을 반환함**: GitHub App과 API가 같은 Webhook secret을 사용하는지 확인하고 GitHub의 **Recent Deliveries**에서 다시 전달합니다.
+- **PR이 연결되지 않음**: 저장소가 App 승인 범위에 있는지, 자동 연결이 켜져 있는지, 번호가 현재 워크스페이스에 속하는지 확인합니다.
+- **본문에 번호를 썼지만 표시되지 않음**: `Closes MUL-123`을 사용하거나 번호를 브랜치 이름 또는 PR 제목에 넣습니다.
+- **CI 상태가 없음**: `GITHUB_APP_ID`와 `GITHUB_APP_PRIVATE_KEY`가 설정되었는지, App에 Checks 및 Commit statuses 읽기 권한이 있고 관련 이벤트를 구독했는지 확인합니다. 설치된 App에 권한을 추가한 뒤에는 각 installation owner가 GitHub에서 승인해야 적용됩니다.
+- **PR merge 후 이슈가 완료되지 않음**: PR에 종료 문구가 있는지 확인하고 다른 연결 PR이 Open 또는 Draft 상태로 남아 있는지 확인합니다.
-## 다음
+## 다음 단계
-- [이슈](/issues) — PR에서 참조하는 이슈 식별자(`MUL-123`)
-- [워크스페이스](/workspaces) — 워크스페이스별 이슈 prefix를 설정하는 곳
-- [환경 변수](/environment-variables) — 위의 GitHub 변수를 포함한 전체 env 참조
+- [이슈](/issues) — 상태 전환과 PR merge 시 Done 전환의 관계를 알아봅니다.
+- [프로젝트 리소스](/project-resources) — 에이전트 실행에서 사용할 저장소를 정합니다.
+- [환경 변수](/environment-variables) — 자체 호스팅 GitHub App의 전체 설정을 확인합니다.
diff --git a/apps/docs/content/docs/github-integration.mdx b/apps/docs/content/docs/github-integration.mdx
index 68dc9a6c2a..1ee0081e4b 100644
--- a/apps/docs/content/docs/github-integration.mdx
+++ b/apps/docs/content/docs/github-integration.mdx
@@ -1,242 +1,186 @@
---
title: GitHub integration
-description: Connect a GitHub App once, then PRs whose branch, title, or body reference an issue identifier auto-attach to that issue — and merging the PR moves the issue to Done.
+description: Link pull requests to Multica issues and watch development progress from the issue.
---
import { Callout } from "fumadocs-ui/components/callout";
-Connect a GitHub account or organization once in **Settings → GitHub**. After that, any pull request whose branch name, title, or body contains an issue identifier (for example `MUL-123`) is **auto-linked** to that [issue](/issues), appears under **Pull requests** in the issue sidebar, and — when the PR is merged — moves the issue to **Done**.
+Once GitHub is connected, Multica automatically links pull requests based on issue identifiers. Issue detail shows PR state, change size, CI results, and merge conflicts in place.
-There is no per-issue setup. The whole flow is identifier-driven.
+The GitHub integration only reads the repositories authorized at install time; it never pushes commits, comments, or status checks.
-## What the integration does
+Self-hosted Multica can also connect self-hosted Forgejo, Gitea, or GitLab instances in parallel, with the same PR auto-linking, merge-to-Done, and CI display. The entry point is **Settings → Integrations → Git hosting**; see [Self-hosted Git hosting](/vcs-integration). Multica Cloud does not offer this entry point.
-| Surface | Behavior |
-|---|---|
-| **Settings → GitHub** | Workspace admins see the GitHub tab with a master toggle, **Connect GitHub** button, and feature switches (PR sidebar, Co-authored-by, auto-link). After install you bounce back to the GitHub tab. |
-| **Issue sidebar → Pull requests** | Every PR auto-linked to this issue, with title, repo, state (`Open` / `Draft` / `Merged` / `Closed`), and author. Click a row to jump to the PR on GitHub. |
-| **Webhook (background)** | On every `pull_request` event, Multica upserts the PR row, scans the PR for issue identifiers, and (re)builds the link rows. Idempotent — replaying a delivery is a no-op. |
-| **Auto-status on merge** | When a PR transitions to `merged`, every linked issue not already `Done` or `Cancelled` is moved to `Done`. The status change is timeline-logged with source `github_pr_merged`. |
-| **PR card → CI & mergeability** | For each linked PR, Multica fetches an authenticated GitHub API snapshot and mirrors its **CI status** and **mergeability** onto the card (see **What the PR card shows** below). |
+## Connect GitHub
-Alongside the PR's own state, the integration mirrors — for each linked PR — its **CI status** (all checks passed, N failed with the failing check names, or N running) and its **mergeability** (ready to merge, has conflicts, blocked, or behind), fetched from an authenticated GitHub API snapshot. Commits and branch refs without an open PR are still not modeled.
+A workspace owner or admin can complete the connection:
-## What the PR card shows
+1. Open **Settings → GitHub**.
+2. Turn on the GitHub integration master switch.
+3. Click **Connect GitHub**.
+4. In GitHub, pick the account or organization and authorize all repositories or a chosen subset.
+5. Return to Multica after the installation completes.
-Each linked PR's card carries two **independent** elements, each built from an authenticated GitHub API snapshot:
+The connection status shows on the same page. Regular members can view the status but can't connect, disconnect, or change the switches.
-- **CI status** — one of: **all checks passed** (with the count, e.g. `7/7`), **N failed** (naming the failing checks), or **N running** (still in progress). A PR with no checks configured yet shows neither — "no checks" is never reported as passed.
-- **Mergeability** — one of: **ready to merge** (shown only when GitHub reports the merge state is clean, i.e. no conflicts *and* branch protection satisfied), **has conflicts**, **blocked**, or **behind**.
+<Callout type="info">
+The **GitHub connection** decides which repositories Multica receives PR events from; the **code repositories** setting decides which repositories agents can pick when running tasks. They serve different purposes and are configured separately.
+</Callout>
-The two never mask each other — a PR can show failed checks *and* a merge conflict at the same time. Merged and closed PRs show neither; the row's own state icon already says so.
+## Feature switches
-The snapshot is fetched from the GitHub API and refreshed on webhook events (`pull_request`, `check_run`, `check_suite`, `status`), when you open the card, and periodically while the PR is still open and undecided. During a temporary GitHub outage the card keeps showing the last-known snapshot marked **stale** rather than going blank.
+**Settings → GitHub** has four switches:
-## Multiple workspaces
+| Switch | Effect |
+|---|---|
+| GitHub integration | Master switch. When off, the three below stop working, but the GitHub App stays connected. |
+| PR sidebar | Shows linked pull requests in issue detail. |
+| Co-authored-by | Adds `Co-authored-by: multica-agent <[email protected]>` to commits created by agents. |
+| Auto-link PRs | Detects issue identifiers in a PR's branch name, title, and body. |
+| **PR card → CI & mergeability** | For each linked PR, Multica fetches an authenticated GitHub API snapshot and mirrors its **CI status** and **mergeability** onto the card (see **What the PR card shows** below). |
-One GitHub App installation can be connected in **several** workspaces at once — for example when different teams in the same organization run separate workspaces. When it is, every connected workspace receives each repository's `pull_request` events **independently**:
-- Each workspace mirrors the PR and auto-links it against **its own** [issue prefix](/workspaces) and GitHub feature switches. A PR that references `MUL-1` and `ENG-2` links `MUL-1` in the workspace whose prefix is `MUL` and `ENG-2` in the one whose prefix is `ENG` — neither sees the other's issues.
-- Disconnecting the installation from one workspace only stops **that** workspace from receiving events; the others keep working.
-Repository scope is whatever you granted the GitHub App (all repositories, or a chosen subset). Connecting the installation in a workspace is itself the subscription — there is no separate per-repository selection inside Multica.
+## Link a PR to an issue
-<Callout type="warning">
-**Upgrading a self-host deployment:** event delivery is keyed on the GitHub connection, not on a workspace's code-repository list. If a workspace previously received a repo's PRs *without* connecting GitHub in that workspace (by listing the repo in its code-repositories entry alone), it will stop receiving events after this upgrade. To restore delivery, **connect the same GitHub installation** in that workspace under **Settings → GitHub**.
-</Callout>
+The simplest approach is to put the issue identifier in the branch name or PR title. For example, for issue `MUL-123`:
-## How identifiers are matched
+```text
+mul-123-fix-login-redirect
+```
-The webhook extracts identifiers from three fields, in this order: **PR head branch**, **PR title**, **PR body**. The matcher is:
+```text
+MUL-123 Fix the redirect after login
+```
-- Case-insensitive — `mul-123`, `MUL-123`, `Mul-123` all match.
-- Bounded — a `\b` on the left and a digit anchor on the right keep it from grabbing version numbers like `v1.2-3` or email-style strings.
-- Workspace-scoped — only matches the workspace's own [issue prefix](/workspaces). `FOO-1` in a workspace whose prefix is `MUL` is ignored, even if the integer matches another issue.
-- Deduplicated — listing `MUL-1, MUL-1` in the body links the issue once.
+Multica ignores case and only matches the current workspace's issue prefix. One PR can link to multiple issues.
-You can reference **multiple issues** in one PR. `Closes MUL-1, MUL-2` links the PR to both, and merging it advances both to `Done`.
+If the identifier appears only in the PR body, use one of GitHub's close intents:
-## The auto-merge-to-Done rule
+```text
+Closes MUL-123
+Fixes MUL-123
+Resolves MUL-123
+```
-When a PR's `merged` field flips to `true`, every linked issue is evaluated:
+A reference-only mention in the body, such as `Related to MUL-123`, is not shown as a working PR for that issue. Commit messages and PR comments don't trigger linking either.
-| Issue current status | Result |
-|---|---|
-| `done` | No change (already terminal). |
-| `cancelled` | **No change** — cancelled means the user explicitly abandoned the work; the integration does not override that signal. |
-| Anything else (`todo`, `in_progress`, `in_review`, `blocked`, `backlog`) | Moved to `done`. |
+## View PRs on an issue
-Closing a PR **without** merging it only updates the PR card's state to `Closed`. The linked issues stay where they were — the user is the one who decides what closing-without-merge means.
+Once linked, PRs appear in the **Pull requests** block of issue detail. Each entry shows:
-<Callout type="info">
-The action is attributed to the `system` actor on the timeline. Subscribers of the issue receive an inbox notification for the status change, the same way they would if a human had moved it.
-</Callout>
+- repository, number, title, and author;
+- `Open`, `Draft`, `Merged`, or `Closed` state;
+- added and deleted lines and the number of changed files;
+- CI status: all passed (with a count), some failed (naming the failing checks), or some in progress; PRs with no checks configured don't show this item — "no checks" is never treated as passing;
+- mergeability: mergeable (only when GitHub reports a clean merge state), conflicting, blocked, or behind.
+
+CI status and mergeability come from snapshots Multica pulls from the GitHub API, and the two are independent; merged or closed PRs no longer show either. When GitHub is temporarily unavailable, the card keeps the last snapshot and marks it stale instead of going blank.
-## What's not auto-linked
+Click an entry to open the PR on GitHub. Turning off the **PR sidebar** only hides this block; it doesn't disconnect anything.
-- **Identifiers in commit messages** — only branch / title / body are scanned. A commit titled `MUL-123: fix login` does not auto-link unless the same string also appears in the PR title or body.
-- **Identifiers in PR comments** — only the PR's own metadata is scanned; later GitHub comments are ignored.
-- **PRs in repos the App isn't installed on** — without the App, Multica never receives the webhook.
-- **Manually linking a PR to an issue** — there is no UI for this yet. If your team's convention puts identifiers in a place Multica isn't reading, add them to the PR title or body.
+## When a merged PR moves an issue to Done
-## Disconnecting
+A merged PR doesn't necessarily mean the issue is finished. Multica only moves an issue to `Done` when all of the following hold:
-In **Settings → GitHub** there is no installation list — you manage existing installations from GitHub directly:
+1. at least one merged linked PR used a close intent immediately followed by the identifier, such as `Closes MUL-123` (forms with words in between, like `Closes login MUL-123`, don't count);
+2. the issue has no other working PR still `Open` or `Draft` (reference-only mentions in the body don't count);
+3. the issue is not currently `done` or `cancelled`.
-- **From GitHub** — uninstall the Multica GitHub App at `https://github.com/settings/installations` (personal) or `https://github.com/organizations/<org>/settings/installations` (org). Multica receives the `installation.deleted` webhook and drops the row in real time; any open Settings tab updates without a refresh.
-- **Disconnect from inside Multica is admin-only** — the Disconnect control on the GitHub tab is hidden for non-admins. It stays available even when the master GitHub switch is off, so admins can still revoke a stale installation after one-click-disabling the feature.
+So writing `MUL-123` only in the branch name or title establishes the link but doesn't by itself trigger completion. A PR closed without merging doesn't complete the issue either.
-After disconnect, mirrored PR rows stay in the database so historical issue sidebars still show what was linked, but no new webhook events from that installation will be accepted.
+The status change is written to the timeline as a system action, and members subscribed to the issue are notified.
-## Permissions and visibility
+## Multiple workspaces
-- **Connect / disconnect** require workspace **owner or admin**. Members see the card description but no Connect button.
-- The **Pull requests** sidebar on an issue is visible to anyone who can read the issue — same permissions as the rest of issue detail.
-- The GitHub App requests **read-only** access to pull requests, checks, commit statuses, and metadata. Multica never pushes commits, comments, or status checks back to GitHub — the CI status and mergeability shown on the PR card are fetched read-only, never written.
+The same GitHub App installation can be connected to multiple Multica workspaces. GitHub events flow into each workspace separately and are matched against each workspace's own issue prefix.
-## Self-host setup
+For example, a PR that references both `MUL-1` and `ENG-2` can link in two workspaces with different prefixes. Workspaces never see each other's issues.
-If you're running Multica on Multica Cloud, the integration is already configured — skip this section.
+## Disconnect
-For self-host, you create one GitHub App, point it at your server, and set its environment variables. The whole flow is below.
+Clicking **Disconnect** in **Settings → GitHub** only removes the relationship between the current Multica workspace and the installation; it does not uninstall the App from GitHub for you. Existing PR records are kept, and new events stop flowing into that workspace.
-### 1. Create a GitHub App
+To revoke repository authorization on the GitHub side, uninstall the App or adjust its repository scope from your personal or organization GitHub App installations page. After uninstalling, every Multica workspace linked to that installation stops receiving events.
+
+## Self-hosting setup
-Go to one of:
+Multica Cloud doesn't need this section. Self-hosting requires creating your own GitHub App first.
-- Personal account → `https://github.com/settings/apps/new`
-- Organization → `https://github.com/organizations/<org>/settings/apps/new`
+### 1. Create a GitHub App
-Fill in:
+Create the App under GitHub's **Developer settings → GitHub Apps** and fill in:
| Field | Value |
|---|---|
-| **GitHub App name** | Anything recognizable, e.g. `Multica` or `Multica (staging)`. |
-| **Homepage URL** | Your Multica frontend, e.g. `https://multica.example.com`. |
-| **Callback URL** | Leave blank — Multica doesn't use OAuth user identity. |
-| **Setup URL** | `https://<api-host>/api/github/setup`. **Check "Redirect on update"**. |
-| **Webhook → Active** | Enabled. |
-| **Webhook URL** | `https://<api-host>/api/webhooks/github`. |
-| **Webhook secret** | Generate a long random string (e.g. `openssl rand -hex 32`). You'll paste the same value into Multica's env in step 2. |
-| **Permissions → Repository → Pull requests** | **Read-only**. |
-| **Permissions → Repository → Checks** | **Read-only** — powers the PR card's CI status. |
-| **Permissions → Repository → Commit statuses** | **Read-only** — the legacy status-context half of the CI rollup. |
-| **Permissions → Repository → Metadata** | Read-only (mandatory). |
-| **Subscribe to events** | Tick **Pull request**, **Check suite**, **Check run**, and **Status**. |
-| **Where can this GitHub App be installed?** | Your choice. `Only on this account` is fine for single-org setups. |
+| Homepage URL | Your Multica frontend address, e.g. `https://multica.example.com` |
+| Callback URL | Leave blank |
+| Setup URL | `https://<api-host>/api/github/setup`, with **Redirect on update** enabled |
+| Webhook URL | `https://<api-host>/api/webhooks/github` |
+| Webhook secret | A random string you keep long-term |
-<Callout type="warning">
-**Grant read, never write, and nothing more.** Do **not** grant **Checks: Read and write** — write access makes GitHub expect this App to report its own check runs, which leaves them stuck permanently pending. Read-only is correct. The feature also does **not** need **Actions: read** or **Contents: read** — don't add them.
-</Callout>
+Repository permissions:
-<Callout type="warning">
-**Adding these permissions to an App that's already installed needs approval.** When you extend an existing App with Checks, Commit statuses, Check run, and Status, GitHub holds the change as a **pending permission request** — it does not take effect until each installation's owner approves it (on GitHub, under that installation's settings). Until an installation approves, the PR card stays without CI or merge status on its repos.
-</Callout>
+| Permission | Level |
+|---|---|
+| Metadata | Read-only |
+| Pull requests | Read-only |
+| Checks | Read-only; used to show CI status |
+| Commit statuses | Read-only; used to aggregate legacy-status CI |
-After **Create GitHub App**, note two things from the App's detail page:
+Subscribe to these events:
-- The **public link** at the top — its tail is the slug. `https://github.com/apps/multica-acme` → slug = `multica-acme`.
-- The **webhook secret** you just generated (you can't read it back from GitHub later — save it now).
+- **Pull request**;
+- **Check suite**, **Check run**, and **Status**, which trigger CI and mergeability refreshes.
+
+If you don't need CI shown in Multica, you can skip the Checks and Commit statuses permissions and their events.
<Callout type="warning">
-**Webhook secret ≠ Client secret.** The App settings page has both fields stacked together. The **Webhook secret** is what signs `pull_request` payloads — that's the one Multica needs. The **Client secret** is for OAuth and is not used by this integration. Mixing them up produces a confusing `401 invalid signature` on every webhook delivery.
+This is the **Webhook secret**, not the OAuth Client secret. If the two sides have different webhook secrets, GitHub deliveries return `401 invalid signature`.
</Callout>
### 2. Set environment variables
-On the API server:
+Take the slug from the App's public URL. For example, the slug of `https://github.com/apps/multica-acme` is `multica-acme`.
```dotenv
GITHUB_APP_SLUG=multica-acme
-GITHUB_WEBHOOK_SECRET=<the webhook secret you generated>
-
-# Required for the PR card's CI status and mergeability. Without them the
-# integration still mirrors PRs and auto-links / auto-closes issues, but the
-# PR card shows no CI or merge status:
-GITHUB_APP_ID=<numeric App ID from the App's settings page>
-GITHUB_APP_PRIVATE_KEY=<full PEM block, including BEGIN/END lines>
+GITHUB_WEBHOOK_SECRET=<the webhook secret you entered when creating the App>
+FRONTEND_ORIGIN=https://multica.example.com
```
-`GITHUB_APP_SLUG` and `GITHUB_WEBHOOK_SECRET` are required for the integration to start at all. If either is missing:
-
-- `Connect GitHub` in Settings is **disabled** and shows a "not configured" hint.
-- The `/api/webhooks/github` endpoint returns **`503 github webhooks not configured`** — Multica refuses to process events with no secret, rather than silently treating every signature as valid.
-
-`GITHUB_APP_ID` and `GITHUB_APP_PRIVATE_KEY` are required for both **PR-card CI status and mergeability** and **Settings → Repositories → Choose from GitHub**. They let Multica authenticate as the App (App JWT → installation token), pull each PR card's GitHub API snapshot, and mint a short-lived metadata-only token to list an installation's repositories. Generate the key under **Private keys → Generate a private key** on the App's settings page; paste the full PEM block (including the `-----BEGIN/END RSA PRIVATE KEY-----` lines) into the env var, preserving newlines. Without them the integration **degrades cleanly**: PRs still mirror, issues still auto-link and move to Done on merge, and the connected account name still resolves from the `installation.created` webhook — but the PR card shows no CI or merge status and repository browsing is disabled.
-
-`FRONTEND_ORIGIN` must also be set (it already is for any production self-host); the setup callback bounces the user back to `<FRONTEND_ORIGIN>/settings?tab=github` after install.
-
-Restart the API after setting the env vars.
+If either `GITHUB_APP_SLUG` or `GITHUB_WEBHOOK_SECRET` is missing, the connect button is disabled and the webhook endpoint refuses to process events.
-### 3. Run migrations
+The next two variables are required for the PR card to show CI status and mergeability — Multica uses them to authenticate as the App and pull snapshots:
-The integration ships its tables in migration `079_github_integration`. If you're upgrading an older deployment:
-
-```bash
-make migrate-up
+```dotenv
+GITHUB_APP_ID=<the GitHub App's numeric ID>
+GITHUB_APP_PRIVATE_KEY=<full PEM private key, keeping the BEGIN/END lines and newlines>
```
-Three tables get created: `github_installation`, `github_pull_request`, `issue_pull_request`. They cascade-delete with their workspace, so removing a workspace cleans them up automatically.
-
-### 4. Connect from the UI
-
-In Multica:
+Generate the private key under the GitHub App's **Private keys → Generate a private key**. Without them the integration degrades gracefully: PRs still mirror, issues still auto-link and move to Done on merge — the PR card just shows no CI or merge state.
-1. Open **Settings → GitHub** as an owner or admin.
-2. Click **Connect GitHub**. GitHub opens in a new tab.
-3. Pick the repositories to grant access to and **Install**.
-4. GitHub redirects back to `<api-host>/api/github/setup`, which records the installation and bounces you to `<FRONTEND_ORIGIN>/settings?tab=github&github_connected=1`.
+### 3. Update the database and connect
-After that, open any PR whose branch / title / body contains an issue identifier — within a few seconds the Pull requests block appears on that issue's detail page.
-
-### 5. Verify with a curl probe
-
-If GitHub's **Recent Deliveries** page reports `401 invalid signature` after install, the two sides have different secrets. The fastest way to find out which side is wrong is to bypass GitHub:
-
-```bash
-SECRET="<the value you put in GITHUB_WEBHOOK_SECRET>"
-BODY='{"zen":"test"}'
-SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')
-curl -i -X POST https://<api-host>/api/webhooks/github \
- -H "X-Hub-Signature-256: sha256=$SIG" \
- -H "X-GitHub-Event: ping" \
- -H "Content-Type: application/json" \
- -d "$BODY"
-```
-
-| HTTP status | Meaning | Fix |
-|---|---|---|
-| `200` `{"ok":"pong"}` | Server's loaded secret matches your `$SECRET`. The mismatch is on GitHub. | Edit the App → Webhook secret → **paste the same value** → **Save changes** (clicking out of the field without Save keeps the old secret). Redeliver. |
-| `401 invalid signature` | Server's loaded secret is **not** what you think it is. | Confirm the env var landed in the running process (e.g. `kubectl exec` → `echo -n "$GITHUB_WEBHOOK_SECRET" | wc -c`). Re-deploy. |
-| `503 github webhooks not configured` | `GITHUB_WEBHOOK_SECRET` is empty in the process. | Set the env var, restart the API. |
-
-**Confirm the App's events and permissions.** The public App-metadata endpoint reports exactly what you granted — no auth needed:
+When upgrading an existing deployment, run the regular database migrations first:
```bash
-curl -s https://api.github.com/apps/<slug>
+make migrate-up
```
-- The `events` array should include `pull_request`, `check_suite`, `check_run`, and `status`.
-- The `permissions` object should include `checks: read` and `statuses: read`, alongside `pull_requests: read` and `metadata: read`.
-
-If any are missing, fix the App's **Subscribe to events** / **Permissions** — and remember that adding permissions to an already-installed App only takes effect once each installation's owner approves the pending request.
-
-**"PR card shows no CI or merge status."** The card mirrors the PR fine but never shows checks or mergeability:
-
-- Confirm `GITHUB_APP_ID` and `GITHUB_APP_PRIVATE_KEY` are set in the running API process — they are what authenticate the snapshot fetch.
-- Confirm each installation has **approved the pending permission request** for Checks and Commit statuses (see the probe above).
-
-## Limitations
+Restart the API server, then complete the connection in **Settings → GitHub**.
-A few rough edges to be aware of today:
+## Troubleshooting
-- **No manual link UI yet** — the only way to link a PR is to have the identifier in its branch, title, or body.
-- **No review threads or reviewer list** — CI status and mergeability are now surfaced on the PR card (see **What the PR card shows**), but review comments, individual reviewers, and their approval state are not.
-- **No workspace-level config** for the merge → Done rule — it's a fixed default (`merged → done`, unless `cancelled`). Workspace-customizable mappings are a future addition.
-- **Multi-PR-to-one-issue is conservative on merge** — if two PRs both reference `MUL-123` and the first one merges, the issue is moved to `Done` immediately. A follow-up change to wait for all linked PRs to resolve before advancing is in progress.
+- **Connect button disabled**: check that `GITHUB_APP_SLUG` and `GITHUB_WEBHOOK_SECRET` reached the API process.
+- **Webhook returns 401**: confirm the GitHub App and the API use the same webhook secret, then redeliver from GitHub's **Recent Deliveries**.
+- **PR not linked**: check that the repository is in the App's authorized scope, auto-linking is on, and the identifier belongs to the current workspace.
+- **Identifier in the body but not shown**: switch to `Closes MUL-123`, or put the identifier in the branch name or PR title.
+- **No CI status**: confirm `GITHUB_APP_ID` and `GITHUB_APP_PRIVATE_KEY` are configured, and that the App has read-only Checks and Commit statuses permissions with the matching events subscribed. After adding permissions to an installed App, each installation's owner must also approve them on GitHub before they take effect.
+- **Issue not completed after the PR merged**: confirm the PR used a close intent, and check whether other linked PRs are still Open or Draft.
-## Next
+## Next steps
-- [Issues](/issues) — the issue identifiers (`MUL-123`) referenced from PRs
-- [Workspaces](/workspaces) — where the workspace-specific issue prefix is set
-- [Environment variables](/environment-variables) — full env reference, including the GitHub variables above
+- [Issues](/issues) — how status transitions relate to merge-to-Done.
+- [Project resources](/project-resources) — which repositories agents use when running.
+- [Environment variables](/environment-variables) — the full self-hosted GitHub App configuration.
diff --git a/apps/docs/content/docs/github-integration.zh.mdx b/apps/docs/content/docs/github-integration.zh.mdx
index 3919a58278..3280a65a04 100644
--- a/apps/docs/content/docs/github-integration.zh.mdx
+++ b/apps/docs/content/docs/github-integration.zh.mdx
@@ -1,241 +1,186 @@
---
title: GitHub 集成
-description: 一次性连接 GitHub App,之后 PR 的分支名、标题或正文里写了 issue 编号(例如 MUL-123),就会自动挂到那个 issue 上——PR 合并时 issue 自动转 Done。
+description: 把 pull request 与 Multica issue 关联,并在 issue 中查看开发进展。
---
import { Callout } from "fumadocs-ui/components/callout";
-在 **Settings → GitHub** 里一次性连一个 GitHub 账号或组织。之后任何 PR 只要分支名、标题或正文里出现 issue 编号(例如 `MUL-123`),就会**自动关联**到那个 [issue](/issues),出现在 issue 详情页右侧的 **Pull requests** 区块里——PR 合并时,issue 自动转 **Done**。
+连接 GitHub 后,Multica 根据 issue 编号自动关联 pull request。issue 详情中可直接查看 PR 状态、改动规模、CI 结果和合并冲突。
-没有 per-issue 的配置,整个流程是「编号驱动」的。
+GitHub 集成只读取安装时授权的仓库,不会提交代码、评论或 status check。
-## 集成做了什么
+自部署的 Multica 还可以并行连接自托管的 Forgejo、Gitea 或 GitLab 实例,获得同样的 PR 自动关联、合并转 Done 和 CI 展示,入口在 **设置 → 集成 → Git 代码托管**,详见[自托管 Git 代码托管](/vcs-integration)。Multica Cloud 不提供该入口。
-| 出现位置 | 行为 |
-|---|---|
-| **Settings → GitHub** | 工作区 owner / admin 看到 GitHub 这个 tab,里面有主开关、**Connect GitHub** 按钮,以及功能开关(PR 侧栏、Co-authored-by、auto-link)。点 Connect 会打开 GitHub 的 App 安装页;装好后跳回 GitHub tab。 |
-| **Issue 详情侧栏 → Pull requests** | 列出所有自动关联到该 issue 的 PR,含标题、仓库、状态(`Open` / `Draft` / `Merged` / `Closed`)和作者。点一行跳到 GitHub。 |
-| **Webhook(后台)** | 每次 `pull_request` 事件触发:upsert PR 行 → 扫描里面的 issue 编号 →(重新)建立 link。幂等——重投 delivery 不会产生重复记录。 |
-| **Merge 自动改 status** | PR 转 `merged` 时,所有已关联且状态不是 `Done` / `Cancelled` 的 issue 会被推到 `Done`。时间线里以 source 为 `github_pr_merged` 记录。 |
-| **PR 卡片 → CI 与可合并性** | 对每个关联的 PR,Multica 从 GitHub API 拉取一份经鉴权的快照,把它的 **CI 状态**和**可合并性**镜像到卡片上(见下方 **PR 卡片展示什么**)。 |
+## 连接 GitHub
-除了 PR 自身的状态,集成还会为每个关联的 PR 镜像它的 **CI 状态**(全部通过、x 个失败并点名、或 x 个进行中)和**可合并性**(可合并、有冲突、blocked、behind),数据来自一份经鉴权的 GitHub API 快照。Commit、没开 PR 的分支仍然不入库。
+工作区 owner 或 admin 可以完成连接:
-## PR 卡片展示什么
+1. 打开 **设置 → GitHub**。
+2. 打开 GitHub 集成总开关。
+3. 点击 **连接 GitHub**。
+4. 在 GitHub 中选择账号或组织,并授权全部仓库或指定仓库。
+5. 安装完成后回到 Multica。
-每个关联 PR 的卡片上有两个**互相独立**的元素,各自基于一份经鉴权的 GitHub API 快照:
+连接状态会显示在同一页面。普通成员可以查看状态,但不能连接、断开或修改开关。
-- **CI 状态**——三态之一:**全部通过**(带计数,例如 `7/7`)、**x 个失败**(点出失败的 check 名)、或 **x 个进行中**(还在跑)。还没配任何 check 的 PR 两者都不显示——「没有 check」绝不会被当成通过。
-- **可合并性**——四态之一:**可合并**(仅当 GitHub 报告合并状态为 clean,即无冲突**且**满足分支保护时才显示)、**有冲突**、**blocked**、或 **behind**。
+<Callout type="info">
+**GitHub 连接**决定 Multica 从哪些仓库接收 PR 事件;**代码仓库**设置决定智能体执行任务时可以选择哪些仓库。两者用途不同,需要分别配置。
+</Callout>
-两个元素互不遮挡——一个 PR 可以同时显示 check 失败**和**合并冲突。已合并 / 已关闭的 PR 两者都不显示;行首的状态图标已经表达了。
+## 功能开关
-快照从 GitHub API 拉取,并在 webhook 事件(`pull_request`、`check_run`、`check_suite`、`status`)到达时、打开卡片时、以及 PR 仍处于 open 且未决时周期性地刷新。GitHub 临时故障期间,卡片会继续显示上一次已知的快照并标记为 **stale**,而不是清空。
+**设置 → GitHub** 中有四个开关:
-## 多个工作区
+| 开关 | 作用 |
+|---|---|
+| GitHub 集成 | 总开关。关闭后,下面三项不再生效,但不会断开 GitHub App。 |
+| PR 侧栏 | 在 issue 详情中显示关联的 pull request。 |
+| Co-authored-by | 在智能体创建的 commit 中加入 `Co-authored-by: multica-agent <[email protected]>`。 |
+| 自动关联 PR | 从 PR 的分支名、标题和正文中识别 issue 编号。 |
+| **PR 卡片 → CI 与可合并性** | 对每个关联的 PR,Multica 从 GitHub API 拉取一份经鉴权的快照,把它的 **CI 状态**和**可合并性**镜像到卡片上(见下方 **PR 卡片展示什么**)。 |
-同一个 GitHub App installation 可以同时连接到**多个**工作区——比如同一组织下不同团队各自用独立工作区。此时每个已连接的工作区都会**各自独立**收到每个仓库的 `pull_request` 事件:
-- 每个工作区各自镜像 PR,并按**自己的** [issue 前缀](/workspaces) 和 GitHub 功能开关做自动关联。一个同时引用 `MUL-1` 和 `ENG-2` 的 PR,会在前缀为 `MUL` 的工作区关联 `MUL-1`、在前缀为 `ENG` 的工作区关联 `ENG-2`,两边互不可见对方的 issue。
-- 从某个工作区断开连接,只会让**该**工作区停止接收事件,其它工作区照常工作。
-仓库范围由你授予 GitHub App 的权限决定(全部仓库或指定子集)。在工作区连接这个 installation 本身就是一次订阅——Multica 里不需要再单独逐仓库勾选。
+## 让 PR 关联到 issue
-<Callout type="warning">
-**升级 self-host 部署时注意:** 事件投递以 GitHub 连接为准,而不是工作区的代码仓库列表。如果某个工作区之前是在**没有**连接 GitHub 的情况下、仅靠代码仓库列表里登记该仓库来接收 PR 事件,升级后它将不再收到事件。要恢复投递,需在该工作区的 **Settings → GitHub** 里**连接同一个 GitHub installation**。
-</Callout>
+最简单的做法,是把 issue 编号写进分支名或 PR 标题。例如 issue 为 `MUL-123`:
-## 编号是怎么匹配的
+```text
+mul-123-fix-login-redirect
+```
-Webhook 从三个字段抽取编号,顺序是:**PR head 分支** → **PR 标题** → **PR 正文**。匹配规则:
+```text
+MUL-123 修复登录后的跳转
+```
-- 大小写不敏感——`mul-123`、`MUL-123`、`Mul-123` 都能匹配
-- 有边界——左侧 `\b`、右侧只接数字,避免误抓 `v1.2-3`、email 地址等
-- 限定到本工作区——只匹配本工作区的 [issue prefix](/workspaces)。前缀是 `MUL` 的工作区里,PR 出现 `FOO-1` 不会匹配,即使数字撞另一个 issue 也不会
-- 自动去重——`Closes MUL-1, MUL-1` 只关联一次
+Multica 会忽略大小写,并且只匹配当前工作区的 issue 前缀。一个 PR 可以关联多个 issue。
-一个 PR 里**可以同时引用多个 issue**。比如 `Closes MUL-1, MUL-2`:PR 同时关联两个 issue,合并时两个 issue 都会转 `Done`。
+只在 PR 正文中写编号时,需要使用 GitHub 的关闭语句:
-## Merge 自动转 Done 的规则
+```text
+Closes MUL-123
+Fixes MUL-123
+Resolves MUL-123
+```
-PR 的 `merged` 字段翻成 `true` 时,逐个评估关联的 issue:
+正文中的普通提及,例如 `Related to MUL-123`,不会作为该 issue 的工作 PR 显示。Commit message 和 PR 评论也不会触发关联。
-| Issue 当前状态 | 结果 |
-|---|---|
-| `done` | 不变(已经是终态)|
-| `cancelled` | **不变**——cancelled 是用户明确放弃工作的信号,集成不覆盖 |
-| 其他(`todo` / `in_progress` / `in_review` / `blocked` / `backlog`)| 转成 `done` |
+## 在 issue 中查看 PR
-PR **关闭但没合并**——只更新 PR 卡片的状态为 `Closed`,issue 状态不变。"关闭但不合并"语义因团队而异,Multica 不替用户做决定。
+关联成功后,PR 会出现在 issue 详情的 **Pull requests** 区块。每条记录会显示:
-<Callout type="info">
-状态变更的 actor 是 `system`。订阅了该 issue 的成员会收到 inbox 通知,和成员手动改状态时一致。
-</Callout>
+- 仓库、编号、标题和作者;
+- `Open`、`Draft`、`Merged` 或 `Closed` 状态;
+- 新增、删除行数和改动文件数;
+- CI 状态:全部通过(带计数)、若干个失败(点名失败的 check),或若干个进行中;没有配置任何 check 的 PR 不显示这一项,"没有 check"不会被当成通过;
+- 可合并性:可合并(仅当 GitHub 报告合并状态为 clean)、有冲突、blocked 或 behind。
-## 哪些情况不会自动关联
+CI 状态和可合并性来自 Multica 从 GitHub API 拉取的快照,两者互相独立;已合并或已关闭的 PR 不再显示这两项。GitHub 暂时不可用时,卡片会保留上一次的快照并标记为过期,而不是清空。
-- **Commit message 里的编号**——只扫 PR 的分支 / 标题 / 正文。一个 commit message 写 `MUL-123: fix login` 不会触发关联,除非同样的字符串也出现在 PR 标题或正文里
-- **PR 评论里的编号**——只扫 PR 自己的元数据,后续的 GitHub comment 不读
-- **App 没安装的仓库里的 PR**——没 App,Multica 收不到 webhook
-- **手动把 PR 关联到 issue**——暂时没有这个 UI。如果你们的约定把编号放到 Multica 不扫的地方,请改放到 PR 标题或正文里
+点击记录可以打开 GitHub 上的 PR。关闭 **PR 侧栏** 只会隐藏这个区块,不会断开连接。
-## 断开连接
+## PR 合并转 Done 的条件
-**Settings → GitHub** 里没有 installation 列表——现有 installation 直接到 GitHub 上管理:
+PR 合并不一定代表 issue 已完成。Multica 只有在以下条件同时成立时,才把 issue 改为 `Done`:
-- **从 GitHub 卸载** —— 个人在 `https://github.com/settings/installations`、组织在 `https://github.com/organizations/<org>/settings/installations` 卸载 Multica App。Multica 收到 `installation.deleted` webhook 后立刻删行;任何已打开的 Settings tab 实时更新,不用刷新
-- **Multica 这边的断开是 admin only** —— GitHub tab 上的 Disconnect 控件对非 admin 不显示;主开关关掉时 Disconnect 仍然可用,方便 admin 一键关闭功能后再单独清理已连接的 installation
+1. 至少一个已合并的关联 PR 使用了紧跟编号的关闭语句,例如 `Closes MUL-123`(`Closes login MUL-123` 这类中间隔词的写法不生效);
+2. 该 issue 没有其他仍为 `Open` 或 `Draft` 的工作 PR(正文中的普通提及不算);
+3. issue 当前不是 `done` 或 `cancelled`。
-断开之后,已经镜像的 PR 行保留在数据库里——历史 issue 侧栏仍能显示当时关联的 PR,但来自这个 installation 的新 webhook 事件不再被接受。
+因此,仅在分支名或标题中写 `MUL-123` 会建立关联,但不会单独触发完成。PR 关闭但没有合并,也不会完成 issue。
+
+状态变化会以系统操作写入时间线,订阅该 issue 的成员会收到通知。
+
+## 多个工作区
-## 权限和可见性
+同一个 GitHub App installation 可以连接到多个 Multica 工作区。GitHub 事件会分别进入每个工作区,再按照各自的 issue 前缀匹配。
-- **Connect / Disconnect** 需要工作区 **owner 或 admin**。普通成员能看到卡片描述但看不到 Connect 按钮
-- **Pull requests** 侧栏对所有能看到该 issue 的成员可见——和 issue 详情页其他部分权限一致
-- GitHub App 申请的是 PR、Checks、Commit statuses 和 Metadata 的 **只读** 权限。Multica 从不向 GitHub 推 commit、评论或 status check——卡片上的 CI 状态与可合并性都是只读拉取,绝不写回
+例如一个 PR 同时引用 `MUL-1` 和 `ENG-2`,它可以在两个不同前缀的工作区中分别关联。工作区之间不会看到对方的 issue。
-## Self-Host 配置
+## 断开连接
-如果你在 Multica Cloud 上,集成已经配好——跳过本节。
+在 **设置 → GitHub** 点击 **断开**,只会移除当前 Multica 工作区与该 installation 的关系,不会替你从 GitHub 卸载 App。已有 PR 记录会保留,新的事件不再进入该工作区。
-Self-Host 需要:建一个 GitHub App、指向你的 server、设好环境变量。完整流程如下。
+撤销 GitHub 侧的仓库授权,需到个人或组织的 GitHub App installations 页面卸载或调整仓库范围。卸载后,与该 installation 关联的所有 Multica 工作区都会停止接收事件。
-### 1. 创建一个 GitHub App
+## 自托管配置
-到下面其中一个页面:
+Multica Cloud 无需执行本节。自托管需要先创建自己的 GitHub App。
-- 个人账号 → `https://github.com/settings/apps/new`
-- 组织 → `https://github.com/organizations/<org>/settings/apps/new`
+### 1. 创建 GitHub App
-按下表填写:
+在 GitHub 的 **Developer settings → GitHub Apps** 中创建 App,并填写:
| 字段 | 值 |
|---|---|
-| **GitHub App name** | 任何能辨识的名字,例如 `Multica` 或 `Multica (staging)` |
-| **Homepage URL** | 你的 Multica 前端,例如 `https://multica.example.com` |
-| **Callback URL** | 留空——本集成不使用 OAuth 用户身份 |
-| **Setup URL** | `https://<api-host>/api/github/setup`。**勾选 "Redirect on update"** |
-| **Webhook → Active** | 启用 |
-| **Webhook URL** | `https://<api-host>/api/webhooks/github` |
-| **Webhook secret** | 生成一个长随机字符串(例如 `openssl rand -hex 32`)。这个值会同样填到 step 2 的 env 里 |
-| **Permissions → Repository → Pull requests** | **Read-only** |
-| **Permissions → Repository → Checks** | **Read-only**——驱动 PR 卡片的 CI 状态 |
-| **Permissions → Repository → Commit statuses** | **Read-only**——CI 汇总里 legacy status context 的那一半 |
-| **Permissions → Repository → Metadata** | Read-only(必填)|
-| **Subscribe to events** | 勾选 **Pull request**、**Check suite**、**Check run**、**Status** |
-| **Where can this GitHub App be installed?** | 自选。单组织部署建议选 `Only on this account` |
+| Homepage URL | Multica 前端地址,例如 `https://multica.example.com` |
+| Callback URL | 留空 |
+| Setup URL | `https://<api-host>/api/github/setup`,并启用 **Redirect on update** |
+| Webhook URL | `https://<api-host>/api/webhooks/github` |
+| Webhook secret | 一段长期保存的随机字符串 |
-<Callout type="warning">
-**只给 read,别给 write,也别多给。** **不要**授予 **Checks: Read and write**——写权限会让 GitHub 期待这个 App 自己上报 check run,结果 check 永久卡在 pending。只读才对。这个功能也**不需要** **Actions: read** 或 **Contents: read**——别加。
-</Callout>
+Repository permissions:
-<Callout type="warning">
-**给一个已安装的 App 新增这些权限需要 accept。** 当你给现有 App 补上 Checks、Commit statuses、Check run、Status 时,GitHub 会把变更挂起为一条**待批准的权限请求**——直到每个 installation 的 owner 点 accept(在 GitHub 上该 installation 的设置里)它才生效。在某个 installation 批准之前,它名下仓库的 PR 卡片不会显示 CI / merge 状态。
-</Callout>
+| 权限 | 级别 |
+|---|---|
+| Metadata | Read-only |
+| Pull requests | Read-only |
+| Checks | Read-only;用于显示 CI 状态 |
+| Commit statuses | Read-only;用于汇总 legacy status 形式的 CI |
-点 **Create GitHub App** 之后,从详情页记下两件事:
+订阅以下事件:
-- 顶部 **public link** 的尾部即 slug。`https://github.com/apps/multica-acme` → slug = `multica-acme`
-- 你刚生成的 **webhook secret**(GitHub 之后不会再让你读取这个值——现在就保存好)
+- **Pull request**;
+- **Check suite**、**Check run** 和 **Status**,用于触发 CI 与可合并性刷新。
+
+如果不需要在 Multica 中显示 CI,可以不授予 Checks 和 Commit statuses 权限,也不订阅对应事件。
<Callout type="warning">
-**Webhook secret ≠ Client secret。** App 设置页里两个字段紧挨着。**Webhook secret** 用于签 `pull_request` payload,这才是 Multica 需要的那个;**Client secret** 是 OAuth 用的,和本集成无关。混淆这两个会得到「每条 webhook 都 `401 invalid signature`」的诡异症状。
+这里需要的是 **Webhook secret**,不是 OAuth Client secret。两边填写的 Webhook secret 不一致时,GitHub delivery 会返回 `401 invalid signature`。
</Callout>
### 2. 配置环境变量
-API server 上:
+从 App 的公开地址取得 slug。例如 `https://github.com/apps/multica-acme` 的 slug 是 `multica-acme`。
```dotenv
GITHUB_APP_SLUG=multica-acme
-GITHUB_WEBHOOK_SECRET=<你刚生成的 webhook secret>
-
-# CI 状态与可合并性必填。不配这两个,集成仍会镜像 PR、自动关联 / 自动
-# 关闭 issue,但 PR 卡片不显示任何 CI 或 merge 状态:
-GITHUB_APP_ID=<App 设置页上的数字 App ID>
-GITHUB_APP_PRIVATE_KEY=<完整 PEM 块,包含 BEGIN/END 行>
+GITHUB_WEBHOOK_SECRET=<创建 App 时填写的 webhook secret>
+FRONTEND_ORIGIN=https://multica.example.com
```
-`GITHUB_APP_SLUG` 和 `GITHUB_WEBHOOK_SECRET` 是集成启动的必填项。任何一个缺失:
-
-- Settings 里 `Connect GitHub` 按钮会被 **disable**,并显示「not configured」提示
-- `/api/webhooks/github` 直接返回 **`503 github webhooks not configured`**——Multica 在 secret 没配置时拒绝处理事件,不会出现「没 secret 也接受 webhook」的安全坑
-
-`GITHUB_APP_ID` 和 `GITHUB_APP_PRIVATE_KEY` 同时用于 **PR 卡片的 CI 状态与可合并性**和 **Settings → Repositories → 从 GitHub 选择**。它们让 Multica 以 App 身份鉴权(App JWT → installation token)、拉取 PR 卡片依赖的 GitHub API 快照,并签发仅有 metadata read 权限的短效 token 来列出 installation 的仓库。私钥从 App 设置页 **Private keys → Generate a private key** 生成,把整段 PEM(含 `-----BEGIN/END RSA PRIVATE KEY-----` 两行)粘到 env 里,保留换行。不配这两个时集成会**干净降级**:PR 照常镜像、issue 照常自动关联并在 merge 时转 Done、关联账号名仍由 `installation.created` webhook 解析——但 PR 卡片不显示 CI/merge 状态,仓库浏览也会被禁用。
-
-`FRONTEND_ORIGIN` 也必须设置(任何生产 self-host 都已经设了)——setup 回调结束后用它把用户跳回 `<FRONTEND_ORIGIN>/settings?tab=github`。
-
-设完 env 重启 API。
+`GITHUB_APP_SLUG` 和 `GITHUB_WEBHOOK_SECRET` 缺少任意一个时,连接按钮会被禁用,webhook 接口也会拒绝处理事件。
-### 3. 执行 migration
+下面两个变量是 PR 卡片显示 CI 状态与可合并性的必要条件——Multica 用它们以 App 身份鉴权并拉取快照:
-集成的表在 migration `079_github_integration` 里。如果是升级既有部署:
-
-```bash
-make migrate-up
+```dotenv
+GITHUB_APP_ID=<GitHub App 的数字 ID>
+GITHUB_APP_PRIVATE_KEY=<完整 PEM 私钥,保留 BEGIN/END 行和换行>
```
-会创建三张表:`github_installation`、`github_pull_request`、`issue_pull_request`。三张表都 cascade 跟随 workspace——删工作区会自动清理。
-
-### 4. 在 UI 里连接
-
-到 Multica:
+私钥在 GitHub App 的 **Private keys → Generate a private key** 中生成。不配置时集成会平稳降级:PR 照常镜像,issue 照常自动关联并在合并时转 Done,只是 PR 卡片不显示 CI 或合并状态。
-1. 以 owner 或 admin 身份打开 **Settings → GitHub**
-2. 点 **Connect GitHub**,GitHub 在新 tab 打开
-3. 选择要授权的仓库,点 **Install**
-4. GitHub 跳回 `<api-host>/api/github/setup`,落库后再跳到 `<FRONTEND_ORIGIN>/settings?tab=github&github_connected=1`
+### 3. 更新数据库并连接
-之后在任意一个仓库开一个分支 / 标题 / 正文带本工作区 issue 编号的 PR——几秒内对应 issue 的详情页上就能看到 Pull requests 区块。
-
-### 5. 用 curl 自检
-
-如果 GitHub 的 **Recent Deliveries** 里第一次 PR 事件就报 `401 invalid signature`,说明两边的 secret 不一致。绕过 GitHub 直接测 server 是最快的定位方法:
-
-```bash
-SECRET="<你填给 GITHUB_WEBHOOK_SECRET 的值>"
-BODY='{"zen":"test"}'
-SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')
-curl -i -X POST https://<api-host>/api/webhooks/github \
- -H "X-Hub-Signature-256: sha256=$SIG" \
- -H "X-GitHub-Event: ping" \
- -H "Content-Type: application/json" \
- -d "$BODY"
-```
-
-| HTTP 状态 | 含义 | 修法 |
-|---|---|---|
-| `200` `{"ok":"pong"}` | server 加载的 secret 和你 `$SECRET` 一致——GitHub 那边的 secret 才是错的 | 编辑 App → Webhook secret 字段**粘相同的值** → **必须点 Save changes**(不点 Save 等于没改)→ Redeliver |
-| `401 invalid signature` | server 加载的 secret **不是**你以为的那个 | 进容器确认 env 实际生效(例如 `kubectl exec` → `echo -n "$GITHUB_WEBHOOK_SECRET" \| wc -c`),重新部署 |
-| `503 github webhooks not configured` | `GITHUB_WEBHOOK_SECRET` 在进程里是空的 | 配上 env,重启 API |
-
-**确认 App 的事件与权限。** 公开的 App 元数据接口会如实返回你授予的内容——不需要鉴权:
+升级已有部署时,先执行常规数据库迁移:
```bash
-curl -s https://api.github.com/apps/<slug>
+make migrate-up
```
-- `events` 数组里应包含 `pull_request`、`check_suite`、`check_run`、`status`。
-- `permissions` 对象里应包含 `checks: read` 和 `statuses: read`,以及 `pull_requests: read` 和 `metadata: read`。
-
-如果缺了,去修 App 的 **Subscribe to events** / **Permissions**——并记住:给一个已安装的 App 新增权限,要等每个 installation 的 owner 批准待处理的请求后才会生效。
-
-**「PR 卡片不显示 CI / merge 状态」。** 卡片能正常镜像 PR,但从不显示 check 或可合并性:
-
-- 确认运行中的 API 进程里配了 `GITHUB_APP_ID` 和 `GITHUB_APP_PRIVATE_KEY`——快照拉取靠它们鉴权。
-- 确认每个 installation 都**批准了 Checks 与 Commit statuses 的待处理权限请求**(见上面的探针)。
-
-## 已知限制
+重启 API 服务,再到 **设置 → GitHub** 完成连接。
-目前还没做的几个边界:
+## 常见问题
-- **手动 link UI 暂未提供**——关联 PR 的唯一方法是把 issue 编号写到 PR 分支 / 标题 / 正文
-- **不接 review 讨论和 reviewer 列表**——CI 状态与可合并性现在会展示在 PR 卡片上(见 **PR 卡片展示什么**),但 review 评论、具体 reviewer 及其审批状态没接进 Multica
-- **没有工作区级别的 merge → status 映射配置**——默认固定是 `merged → done`(cancelled 除外)。可配置映射是后续迭代
-- **同 issue 多 PR 时,merge 行为偏激进**——两个 PR 都引用 `MUL-123` 时,第一个 merge 就把 issue 转 Done。"等所有关联 PR 都解决再推进 issue 状态"的优化已经在做了
+- **连接按钮不可用**:检查 `GITHUB_APP_SLUG` 和 `GITHUB_WEBHOOK_SECRET` 是否已进入 API 进程。
+- **Webhook 返回 401**:确认 GitHub App 与 API 使用同一个 Webhook secret,然后在 GitHub 的 **Recent Deliveries** 中重新投递。
+- **PR 没有关联**:检查仓库是否在 App 授权范围内、自动关联是否开启,以及编号是否属于当前工作区。
+- **正文写了编号但没显示**:改用 `Closes MUL-123`,或把编号放到分支名、PR 标题中。
+- **没有 CI 状态**:确认 `GITHUB_APP_ID` 和 `GITHUB_APP_PRIVATE_KEY` 已配置,App 具有 Checks 与 Commit statuses 的只读权限并订阅了对应事件。给已安装的 App 补加权限后,还需要各 installation 的所有者在 GitHub 上批准才会生效。
+- **PR 合并后 issue 没完成**:确认 PR 使用了关闭语句,并检查是否还有其他关联 PR 处于 Open 或 Draft。
-## 下一步
+## 接下来
-- [Issues](/issues) —— PR 引用的 issue 编号(`MUL-123`)的来源
-- [工作区](/workspaces) —— 工作区 issue prefix 的设置位置
-- [环境变量](/environment-variables) —— 完整 env 清单,包含上面提到的 GitHub 变量
+- [Issues](/issues) — 状态流转与 PR 合并转 Done 的关系。
+- [项目资源](/project-resources) — 智能体执行时使用哪些仓库。
+- [环境变量](/environment-variables) — 自托管 GitHub App 的完整配置。
diff --git a/apps/docs/content/docs/guides/agents.zh.mdx b/apps/docs/content/docs/guides/agents.zh.mdx
deleted file mode 100644
index ab2f0aba27..0000000000
--- a/apps/docs/content/docs/guides/agents.zh.mdx
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: Agents
-description: How AI agents work in Multica — execution model, skills, and runtime guidelines.
----
-
-## Agents as Teammates
-
-In Multica, agents are first-class citizens. They have profiles, show up on the board, post comments, create issues, and report blockers proactively.
-
-Assignees are polymorphic — an issue can be assigned to a member or an agent. The `assignee_type` + `assignee_id` fields on issues distinguish between the two. Agents render with distinct styling (purple background, robot icon).
-
-## Agent Execution Model
-
-When an agent is assigned a task in Multica:
-
-1. The daemon detects the task assignment
-2. It creates an isolated workspace directory
-3. It spawns the appropriate agent CLI (Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Pi, Qoder, or Trae CLI)
-4. The agent executes autonomously, streaming progress back to Multica
-5. Results are reported — success, failure, or blockers
-
-The full task lifecycle is: **enqueue → claim → start → complete/fail**.
-
-Real-time progress is streamed via WebSocket so you can follow along in the Multica UI.
-
-## Supported Agent Providers
-
-| Provider | CLI Command | Description |
-|----------|-------------|-------------|
-| Claude Code | `claude` | Anthropic's coding agent |
-| Codex | `codex` | OpenAI's coding agent |
-| Antigravity | `agy` | Google's coding agent |
-| CodeBuddy | `codebuddy` | Tencent's Claude Code-compatible coding agent |
-| Copilot | `copilot` | GitHub's coding agent |
-| Cursor | `cursor-agent` | Anysphere's coding agent |
-| OpenClaw | `openclaw` | Open-source coding agent |
-| OpenCode | `opencode` | Open-source coding agent |
-| Hermes | `hermes` | Nous Research coding agent |
-| Kimi | `kimi` | Moonshot coding agent |
-| Kiro CLI | `kiro-cli` | Amazon coding agent |
-| Pi | `pi` | Inflection AI coding agent |
-| Qoder | `qodercli` | Alibaba coding agent |
-| Trae CLI | `traecli` | ByteDance coding agent |
-
-The daemon auto-detects which CLIs are available on your PATH and registers them as available runtimes.
-
-## Reusable Skills
-
-Multica supports two layers of skills:
-
-- **Local skills** — Skills already installed in your local runtime (e.g., `.claude/skills/`, `.opencode/skills/`) are automatically discovered and used by agents. You do **not** need to upload them to Multica.
-- **Workspace skills** — Skills created or imported in the Multica Skills page are shared across the workspace. They are automatically injected into agent runs as supplementary context, so every team member's agents benefit from them.
-
-Workspace skills are designed for team-wide sharing and collaboration — codify your team's best practices once, and every agent can leverage them:
-
-- Deployments
-- Migrations
-- Code reviews
-- Common patterns
-
-Your skill library compounds over time. Local skills give individual agents their capabilities; workspace skills align the entire team.
-
-## Multi-Workspace Support
-
-Each workspace has its own set of agents, issues, and settings. The daemon can watch multiple workspaces simultaneously, routing tasks to the appropriate agent based on workspace configuration.
diff --git a/apps/docs/content/docs/guides/meta.zh.json b/apps/docs/content/docs/guides/meta.zh.json
deleted file mode 100644
index 512caab428..0000000000
--- a/apps/docs/content/docs/guides/meta.zh.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "title": "Guides",
- "pages": ["quickstart", "agents"]
-}
diff --git a/apps/docs/content/docs/guides/quickstart.zh.mdx b/apps/docs/content/docs/guides/quickstart.zh.mdx
deleted file mode 100644
index cbf1298db7..0000000000
--- a/apps/docs/content/docs/guides/quickstart.zh.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: Quickstart
-description: Assign your first task to an agent in under 5 minutes.
----
-
-Once you have the CLI installed (or signed up for [Multica Cloud](https://multica.ai)), follow these steps to assign your first task to an agent.
-
-## 1. Set up and start the daemon
-
-```bash
-multica setup # Configure, authenticate, and start the daemon
-```
-
-This configures the CLI, opens your browser for login, discovers your workspaces, and starts the agent daemon in the background. It auto-detects supported agent CLIs (`agy`, `claude`, `codebuddy`, `codex`, `copilot`, `cursor-agent`, `hermes`, `kimi`, `kiro-cli`, `opencode`, `openclaw`, `pi`, `qodercli`, `traecli`) available on your PATH.
-
-## 2. Verify your runtime
-
-Open your workspace in the Multica web app. Navigate to **Settings → Runtimes** — you should see your machine listed as an active **Runtime**.
-
-> **What is a Runtime?** A Runtime is a compute environment that can execute agent tasks. It can be your local machine (via the daemon) or a cloud instance. Each runtime reports which agent CLIs are available, so Multica knows where to route work.
-
-## 3. Create an agent
-
-Go to **Settings → Agents** and click **New Agent**. Pick the runtime you just connected and choose a provider (Antigravity, Claude Code, CodeBuddy, Codex, Copilot, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Pi, Qoder, or Trae CLI). Give your agent a name — this is how it will appear on the board, in comments, and in assignments.
-
-## 4. Assign your first task
-
-Create an issue from the board (or via `multica issue create`), then assign it to your new agent. The agent will automatically pick up the task, execute it on your runtime, and report progress — just like a human teammate.
-
-That's it! Your agent is now part of the team.
diff --git a/apps/docs/content/docs/how-multica-works.ja.mdx b/apps/docs/content/docs/how-multica-works.ja.mdx
index 032bc2cd71..16d71ad8da 100644
--- a/apps/docs/content/docs/how-multica-works.ja.mdx
+++ b/apps/docs/content/docs/how-multica-works.ja.mdx
@@ -1,54 +1,48 @@
---
title: Multica の仕組み
-description: 3 つのコア構成要素(サーバー / デーモン / AI コーディングツール)がどのように連携してエージェントの作業を実行するかを説明します。
+description: Multica が仕事を記録・調整し、実行は接続されたコンピュータが担います。
---
-import { ArchitectureDiagram } from "@/components/architecture-diagram";
+import { Callout } from "fumadocs-ui/components/callout";
-Multica は**分散型**プラットフォームです。あなたが目にする Web インターフェースは表に見えている部分にすぎず、実際の作業は 3 つの構成要素が処理します。**Multica サーバー**はデータを保持します([ワークスペース](/workspaces)、[イシュー](/issues)、[メンバー](/members-roles)、[タスク](/tasks)キューなど)。**[デーモン](/daemon-runtimes)**はあなた自身のマシンで実行され、タスクを取得して AI コーディングツールを駆動します。そして **[AI コーディングツール](/providers)**(Claude Code、Codex、その他のローカル CLI)が、実際にコードを書く構成要素です。これが Multica と Linear や Jira との最大の違いです。**[エージェント](/agents)は当社のサーバーではなく、あなたのマシンで実行されます。**
+イシューをエージェントに割り当てると、Multica はタスクを作成し、接続されたコンピュータ上のランタイムがそれを引き受けます。ランタイムはローカルの AI コーディングツールを呼び出し、進捗と結果を元のイシューに書き戻します。
-## 3 つのコア構成要素
+## 1 回の実行の流れ
-<ArchitectureDiagram />
+![1 回の実行の流れ図:左側の Multica 領域が記録とスケジューリングを担当し、イシューがタスクの作成をトリガーする。右側の「あなたのコンピュータ」領域では、デーモンがタスクを引き受け、AI コーディングツールを起動し、作業ディレクトリを読み書きする。進捗メッセージはリアルタイムで実行ログに流れ、最終結果はデーモンがイシューに書き戻す](/images/docs/how-a-run-works.png)
-- **Multica サーバー** — あなたが目にするワークスペース、イシュー一覧、コメントスレッドは、すべてここのデータベースに保存されます。また、あなたと同僚の間でリアルタイム更新をプッシュする WebSocket ハブでもあります。エージェントのタスクは**実行しません**。
-- **デーモン** — Multica CLI の一部であり、あなた自身のマシンで実行されます。起動時にローカルにインストールされた AI コーディングツールを検出し、サーバーに登録したうえで、3 秒ごとにタスクをポーリングし、15 秒ごとにハートビートを送信し始めます。
-- **AI コーディングツール** — 次の 16 種類のうちの 1 つ(または複数を並列で): [Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae)、[DevEco Code](/providers#deveco-code)、[Grok](/providers#grok)。デーモンがタスクを取得した後は、これらのツールを使って実際の作業を行います。
+1. **イシューがコンテキストを提供します。** イシューには作業の説明、議論、担当者が保存されます。エージェントに割り当てると、そのエージェントの指示、モデル、スキル、ランタイム設定が使われます。
+2. **Multica がタスクを作成します。** タスクはキューに入ります。オンラインのランタイムがなければ、キューで待機します。
+3. **ランタイムがタスクを引き受けます。** 接続されたコンピュータ上のオンラインのランタイムがタスクを引き受け、エージェントに設定された AI コーディングツールを呼び出します。
+4. **AI コーディングツールがローカルで実行します。** ツールは作業ディレクトリを読み、コマンドを実行し、結果を生成します。
+5. **結果がイシューに書き戻されます。** 進捗、コメント、結果はイシューのタイムラインと実行ログに表示されます。
-ツールチェーンがローカルに留まるため、**あなたの API キー、コードディレクトリ、認可されたツール**は、あなたのマシン上でのみ使用されます。Multica サーバーはそのいずれも目にすることはありません。これはセルフホストでも Cloud でも同じように適用されます。
+イシュー、エージェント、タスク、ランタイムの全体像と関係は、[コアコンセプト](/concepts)を参照してください。
-## タスクのライフサイクル
+## データと実行の境界
-最も一般的なシナリオである、イシューをエージェントに割り当てる場合を見てみましょう。
+| Multica | 接続されたコンピュータ |
+|---|---|
+| ワークスペース、イシュー、コメント、ステータス | AI コーディングツールとその認証情報 |
+| エージェントの設定とスキル | コードディレクトリとローカルファイル |
+| タスクのステータス、実行記録、結果 | 実際のファイル変更とコマンド実行 |
-1. あなたが Web UI で割り当てをクリックします。ブラウザが Multica サーバーへ HTTP リクエストを送ります。
-2. サーバーがそのイシューの担当者をエージェントに設定し、同時にタスクキューに状態 `queued` の実行タスクを作成します。
-3. あなたのマシンにあるデーモンが、次のポーリング(3 秒以内)でタスクを取得します。タスクの状態が `dispatched` に変わります。
-4. デーモンがローカルに隔離された作業ディレクトリを作成し、該当する AI コーディングツールを呼び出します。タスクの状態が `running` に変わります。
-5. AI がローカルでコードを書き、テストを実行し、コメントをサーバーへ投稿します。
-6. 実行が終了します。デーモンが結果(成功 / 失敗)をサーバーに報告し、タスクの状態が `completed` または `failed` に変わります。あなたは Web UI で進捗の更新をリアルタイムに(WebSocket を通じて)確認します。
+この境界は Multica Cloud でもセルフホストでも同じです。
-詳しい動作の仕組みは、[デーモンとランタイム](/daemon-runtimes)および[タスク](/tasks)を参照してください。
+<Callout type="warning">
+例外が 1 つあります。エージェントの `custom_env` に保存した内容は Multica のサーバー側に保存され、実行時にランタイムへ渡されます。コンピュータの外に出したくないシークレットは、`custom_env` に入れないでください。
+</Callout>
-## エージェントを動かす 4 つの方法
+## エージェントのトリガー方法
-「イシューの割り当て」だけではありません。Multica にはコラボレーションのスタイルごとに 1 つずつ、4 つのトリガーがあります。
+エージェントが自分から作業を始めることはなく、すべての実行は明確なアクションでトリガーされます。イシューの割り当て、コメントでの @メンション、直接のチャット、またはオートパイロットです。4 つの方法の選び方と共通のルールは、[エージェントに仕事を任せる](/triggering-agents)を参照してください。
-| 方法 | 一般的なシナリオ | ドキュメント |
-|---|---|---|
-| **イシューの割り当て** | 最も一般的な方法。イシューをエージェントに割り当てると、自分で作業を始めます | [イシューの割り当て](/assigning-issues) |
-| **コメントでエージェントを @メンション** | 「これちょっと見てくれる?」— 担当者や状態を変えず、コメント 1 つで実行を開始します | [エージェントのメンション](/mentioning-agents) |
-| **ダイレクトチャット** | イシューに紐づかない独立した会話 — 質問したり、イシューの下書きを作らせたりします | [チャット](/chat) |
-| **オートパイロット(スケジュール)** | 常時の指示 — 「毎週月曜の朝にスタンドアップのまとめをして」のようなもの | [オートパイロット](/autopilots) |
+## 実行の終了とイシューの完了
-## ランタイム: どこで実行され、ツールは何個か
-
-**ランタイム**とは「デーモン × 1 つの AI コーディングツール」の組み合わせです。あるマシンのデーモンに Claude Code と Codex の両方がインストールされており、2 つのワークスペースに参加している場合、Multica は 4 つの独立したランタイム(ワークスペース 2 個 × ツール 2 個)を登録します。
-
-現在は**ローカルデーモン**のランタイムモデルのみがサポートされています。クラウドランタイム(自分のマシンを起動しておく必要がない方式)は**近日提供予定**で、現在はウェイトリストの登録のみを受け付けています。[ダウンロード](https://multica.ai/download)ページでお申し込みください。
+実行ログに「完了」と表示されても、それはその 1 回の実行が終わったことを意味するだけです。イシューでは引き続き議論したり、要件を追加したり、エージェントを再度トリガーしたりできます。イシューが完了したかどうかは、実際の作業の進み具合とイシューのステータスで判断します。
## 次のステップ
-- [Cloud Quickstart](/cloud-quickstart) — 5 分で Multica Cloud に接続する
-- [Self-Host Quickstart](/self-host-quickstart) — 自前のバックエンドを実行する
-- [デーモンとランタイム](/daemon-runtimes) — アーキテクチャが依存する構成要素を深掘りする
+- [デーモンとランタイム](/daemon-runtimes) — コンピュータが Multica に接続する仕組みと、ランタイムのオンライン・オフライン時の挙動。
+- [タスク](/tasks) — タスクのステータス、リトライ、キャンセルのルール。
+- [エージェントにイシューを割り当てる](/assigning-issues) — 最もよく使われる協働の方法。
diff --git a/apps/docs/content/docs/how-multica-works.ko.mdx b/apps/docs/content/docs/how-multica-works.ko.mdx
index b730efffbe..543c6c2d0e 100644
--- a/apps/docs/content/docs/how-multica-works.ko.mdx
+++ b/apps/docs/content/docs/how-multica-works.ko.mdx
@@ -1,54 +1,48 @@
---
title: Multica의 작동 방식
-description: 세 가지 핵심 구성 요소(서버 / 데몬 / AI 코딩 도구)가 어떻게 협력하여 에이전트의 작업을 실행하는지 설명합니다.
+description: Multica는 작업을 기록하고 조율하며, 연결된 컴퓨터가 실행을 담당합니다.
---
-import { ArchitectureDiagram } from "@/components/architecture-diagram";
+import { Callout } from "fumadocs-ui/components/callout";
-Multica는 **분산형** 플랫폼입니다. 여러분이 보는 웹 인터페이스는 겉으로 드러난 부분일 뿐이고, 실제 작업은 세 가지 구성 요소가 처리합니다. **Multica 서버**는 데이터를 소유합니다([워크스페이스](/workspaces), [이슈](/issues), [멤버](/members-roles), [작업](/tasks) 대기열 등). **[데몬](/daemon-runtimes)**은 여러분 자신의 기기에서 실행되며 작업을 가져와 AI 코딩 도구를 구동합니다. 그리고 **[AI 코딩 도구](/providers)**(Claude Code, Codex, 그 밖의 로컬 CLI)는 실제로 코드를 작성하는 구성 요소입니다. 이것이 Multica와 Linear 또는 Jira의 가장 큰 차이입니다. **[에이전트](/agents)는 우리 서버가 아니라 여러분의 기기에서 실행됩니다.**
+이슈를 에이전트에게 할당하면 Multica가 실행 태스크를 만들고, 연결된 컴퓨터의 런타임이 이를 가져갑니다. 런타임은 로컬 AI 코딩 도구를 호출하고 진행 상황과 결과를 원래 이슈에 다시 기록합니다.
-## 세 가지 핵심 구성 요소
+## 한 번의 실행이 이루어지는 전체 과정
-<ArchitectureDiagram />
+![한 번의 실행 흐름도: 왼쪽 Multica 영역은 기록과 스케줄링을 담당하며 이슈가 태스크 생성을 트리거합니다. 오른쪽 '내 컴퓨터' 영역에서는 데몬이 태스크를 가져와 AI 코딩 도구를 시작하고 작업 디렉터리를 읽고 씁니다. 진행 메시지는 실행 로그로 실시간 전송되고, 최종 결과는 데몬이 이슈에 다시 기록합니다.](/images/docs/how-a-run-works.png)
-- **Multica 서버** — 여러분이 보는 워크스페이스, 이슈 목록, 댓글 스레드는 모두 이곳의 데이터베이스에 저장됩니다. 또한 여러분과 동료 사이의 실시간 업데이트를 푸시하는 WebSocket 허브이기도 합니다. 에이전트 작업은 **실행하지 않습니다.**
-- **데몬** — Multica CLI의 일부로, 여러분 자신의 기기에서 실행됩니다. 시작 시 로컬에 설치된 AI 코딩 도구를 감지하고, 서버에 등록한 다음, 3초마다 작업을 폴링하고 15초마다 하트비트를 전송하기 시작합니다.
-- **AI 코딩 도구** — 다음 16가지 중 하나(또는 여러 개를 병렬로): [Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code), [Grok](/providers#grok). 데몬이 작업을 가져온 뒤에는 이러한 도구를 사용해 실제 작업을 수행합니다.
+1. **이슈가 컨텍스트를 제공합니다.** 이슈에는 작업 설명, 논의, 담당자가 저장됩니다. 에이전트에게 할당되면 시스템은 해당 에이전트의 지시문, 모델, 스킬, 런타임 설정을 사용합니다.
+2. **Multica가 실행 태스크를 만듭니다.** 실행 태스크가 큐에 들어갑니다. 온라인 런타임이 없으면 큐에서 기다립니다.
+3. **런타임이 태스크를 가져갑니다.** 연결된 컴퓨터의 온라인 런타임이 태스크를 가져와 에이전트에 설정된 AI 코딩 도구를 호출합니다.
+4. **AI 코딩 도구가 로컬에서 실행됩니다.** 도구는 작업 디렉터리를 읽고 명령을 실행해 결과를 만듭니다.
+5. **결과가 이슈에 기록됩니다.** 진행 상황, 댓글, 결과가 이슈 타임라인과 실행 로그에 표시됩니다.
-도구 체인이 로컬에 유지되므로 **여러분의 API 키, 코드 디렉터리, 인증된 도구**는 오직 여러분의 기기에서만 사용됩니다. Multica 서버는 그중 어떤 것도 보지 못합니다. 이는 자체 호스팅을 하든 Cloud를 사용하든 동일하게 적용됩니다.
+이슈, 에이전트, 실행 태스크, 런타임의 전체 목록과 관계는 [핵심 개념](/concepts)을 참고하세요.
-## 작업의 수명 주기
+## 데이터와 실행의 경계
-가장 흔한 시나리오인, 이슈를 에이전트에게 할당하는 경우를 살펴보겠습니다.
+| Multica | 연결된 컴퓨터 |
+|---|---|
+| 워크스페이스, 이슈, 댓글, 상태 | AI 코딩 도구와 그 자격 증명 |
+| 에이전트 설정과 스킬 | 코드 디렉터리와 로컬 파일 |
+| 실행 태스크의 상태, 실행 기록, 결과 | 실제 파일 변경과 명령 실행 |
-1. 여러분이 웹 UI에서 할당을 클릭합니다. 브라우저가 Multica 서버로 HTTP 요청을 보냅니다.
-2. 서버가 해당 이슈의 담당자를 에이전트로 설정하고, 동시에 작업 대기열에 상태 `queued`인 실행 작업을 생성합니다.
-3. 여러분의 기기에 있는 데몬이 다음 폴링(3초 이내) 때 작업을 가져옵니다. 작업 상태가 `dispatched`로 바뀝니다.
-4. 데몬이 로컬에 격리된 작업 디렉터리를 생성하고 해당 AI 코딩 도구를 호출합니다. 작업 상태가 `running`으로 바뀝니다.
-5. AI가 로컬에서 코드를 작성하고, 테스트를 실행하고, 댓글을 서버로 다시 게시합니다.
-6. 실행이 종료됩니다. 데몬이 결과(성공 / 실패)를 서버에 보고하고, 작업 상태가 `completed` 또는 `failed`로 바뀝니다. 여러분은 웹 UI에서 진행 상황 업데이트를 실시간으로(WebSocket을 통해) 확인합니다.
+이 경계는 Multica Cloud와 자체 호스팅 환경에서 동일합니다.
-자세한 동작 원리는 [데몬과 런타임](/daemon-runtimes) 및 [작업](/tasks)을 참조하세요.
+<Callout type="warning">
+한 가지 예외가 있습니다. 에이전트의 `custom_env`에 저장한 내용은 Multica 서버에 보관되며 실행할 때 런타임으로 전달됩니다. 컴퓨터 밖으로 나가면 안 되는 secret은 `custom_env`에 넣지 마세요.
+</Callout>
-## 에이전트를 작동시키는 네 가지 방법
+## 에이전트를 트리거하는 방법
-"이슈 할당"만 있는 것은 아닙니다. Multica에는 협업 스타일별로 하나씩, 4가지 트리거가 있습니다.
+에이전트는 스스로 작업을 시작하지 않습니다. 모든 실행은 이슈 할당, 댓글에서 에이전트 @멘션, 직접 대화, 자동화 중 하나의 명시적인 동작으로 트리거됩니다. 네 가지 방법의 선택 기준과 공통 규칙은 [에이전트가 작업을 시작하게 하기](/triggering-agents)를 참고하세요.
-| 방법 | 일반적인 시나리오 | 문서 |
-|---|---|---|
-| **이슈 할당** | 가장 흔한 방법. 이슈를 에이전트에게 할당하면 스스로 작업을 시작합니다 | [이슈 할당하기](/assigning-issues) |
-| **댓글에서 에이전트 @멘션** | "이거 한번 봐 줘" — 담당자나 상태를 바꾸지 않고 댓글 하나로 실행을 시작합니다 | [에이전트 멘션하기](/mentioning-agents) |
-| **다이렉트 채팅** | 이슈에 묶이지 않은 독립적인 대화 — 질문하거나, 이슈 초안을 작성하게 합니다 | [채팅](/chat) |
-| **오토파일럿(예약)** | 상시 지시 — "매주 월요일 아침에 스탠드업 요약을 해 줘" 같은 것 | [오토파일럿](/autopilots) |
+## 실행 종료와 이슈 완료
-## 런타임: 어디서 실행되고, 도구는 몇 개인가
-
-**런타임**은 "데몬 × 하나의 AI 코딩 도구"의 조합입니다. 한 기기의 데몬에 Claude Code와 Codex가 모두 설치되어 있고 두 개의 워크스페이스에 참여해 있다면, Multica는 4개의 독립적인 런타임(워크스페이스 2개 × 도구 2개)을 등록합니다.
-
-현재는 **로컬 데몬** 런타임 모델만 지원됩니다. 클라우드 런타임(여러분 자신의 기기를 켜 둘 필요가 없는 방식)은 **곧 제공될 예정**이며, 현재는 대기자 명단 등록만 받고 있습니다. [다운로드](https://multica.ai/download) 페이지에서 신청하세요.
+실행 로그에 "완료됨"이 표시되는 것은 이번 실행이 끝났다는 뜻일 뿐입니다. 이슈에서는 계속 논의하거나 요구 사항을 추가하고 에이전트를 다시 트리거할 수 있습니다. 이슈의 완료 여부는 실제 작업 진행 상황과 이슈 상태를 기준으로 판단합니다.
## 다음 단계
-- [Cloud Quickstart](/cloud-quickstart) — 5분 만에 Multica Cloud에 연결하기
-- [Self-Host Quickstart](/self-host-quickstart) — 자체 백엔드 실행하기
-- [데몬과 런타임](/daemon-runtimes) — 아키텍처가 의존하는 구성 요소에 대한 심층 분석
+- [데몬과 런타임](/daemon-runtimes) — 컴퓨터가 Multica에 연결되는 방식과 런타임이 온라인 또는 오프라인일 때 일어나는 일을 알아봅니다.
+- [실행 태스크](/tasks) — 실행 태스크의 상태, 재시도, 취소 규칙을 확인합니다.
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 가장 자주 사용하는 협업 방식을 알아봅니다.
diff --git a/apps/docs/content/docs/how-multica-works.mdx b/apps/docs/content/docs/how-multica-works.mdx
index e4ef4698be..9eaf8162ec 100644
--- a/apps/docs/content/docs/how-multica-works.mdx
+++ b/apps/docs/content/docs/how-multica-works.mdx
@@ -1,54 +1,48 @@
---
title: How Multica works
-description: How the three core components (server / daemon / AI coding tool) coordinate to run an agent's work.
+description: Multica records and coordinates the work; connected computers execute it.
---
-import { ArchitectureDiagram } from "@/components/architecture-diagram";
+import { Callout } from "fumadocs-ui/components/callout";
-Multica is a **distributed** platform. The web interface you see is just the front of house — the real work is done by three components: the **Multica server** owns the data ([workspaces](/workspaces), [issues](/issues), [members](/members-roles), the [task](/tasks) queue, and so on); the **[daemon](/daemon-runtimes)** runs on your own machine, picks up tasks, and drives the AI coding tool; and the **[AI coding tool](/providers)** (Claude Code, Codex, and other local CLIs) is the component that actually writes code. This is the biggest difference between Multica and Linear or Jira — **[agents](/agents) don't run on our servers, they run on your machine**.
+When you assign an issue to an agent, Multica creates a task that a runtime on a connected computer claims. The runtime invokes a local AI coding tool and writes progress and results back to the original issue.
-## The three core components
+## The full path of a run
-<ArchitectureDiagram />
+![Diagram of a run: on the left, the Multica area records and schedules — an issue triggers the creation of a task; on the right, in the "your computer" area, the daemon claims the task, launches the AI coding tool, and reads and writes the working directory; progress messages stream back to the execution log in real time, and the daemon writes the final result back to the issue](/images/docs/how-a-run-works.png)
-- **Multica server** — the workspaces, issue lists, and comment threads you see all live in its database. It's also a WebSocket hub that pushes real-time updates between you and your teammates. It does **not** execute any agent tasks.
-- **Daemon** — part of the Multica CLI, running on your own machine. On start it detects which AI coding tools are installed locally, registers with the server, and begins polling for tasks every 3 seconds and sending heartbeats every 15 seconds.
-- **AI coding tools** — one of the seventeen (or several in parallel): [Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code), [Grok](/providers#grok), [Qwen Code](/providers#qwen-code). Once the daemon has picked up a task, it uses these tools to actually do the work.
+1. **The issue provides the context.** The issue holds the work description, the discussion, and the assignee. When it is assigned to an agent, the system uses that agent's instructions, model, skills, and runtime configuration.
+2. **Multica creates a task.** The task enters the queue; if no runtime is online, it waits there.
+3. **A runtime claims the task.** An online runtime on a connected computer claims the task and invokes the AI coding tool the agent is configured to use.
+4. **The AI coding tool executes locally.** The tool reads the working directory, runs commands, and produces results.
+5. **Results are written back to the issue.** Progress, comments, and results appear in the issue's timeline and execution log.
-Because the toolchain stays local, **your API keys, code directories, and authorized tools** are only ever used on your machine — the Multica server never sees any of them. This holds whether you self-host or use Cloud.
+For the full list of issues, agents, tasks, and runtimes and how they relate, see [Core concepts](/concepts).
-## The lifecycle of a task
+## The data and execution boundary
-Take the most common scenario — you assign an issue to an agent:
+| Multica | Connected computer |
+|---|---|
+| Workspaces, issues, comments, and statuses | AI coding tools and their credentials |
+| Agent configuration and skills | Code directories and local files |
+| Task status, run records, and results | Actual file changes and command execution |
-1. You click assign in the web UI. The browser sends an HTTP request to the Multica server.
-2. The server sets the assignee on that issue to the agent and, at the same time, creates an execution task in the task queue with status `queued`.
-3. The daemon on your machine picks up the task on its next poll (within 3 seconds). Task status becomes `dispatched`.
-4. The daemon creates an isolated working directory locally and invokes the corresponding AI coding tool. Task status becomes `running`.
-5. The AI writes code locally, runs tests, and posts comments back to the server.
-6. Execution ends. The daemon reports the result (success / failure) to the server, and task status becomes `completed` or `failed`. You see the progress update in real time in the web UI (via WebSocket).
+This boundary is the same on Multica Cloud and in self-hosted deployments.
-For the detailed mechanics, see [Daemon and runtimes](/daemon-runtimes) and [Tasks](/tasks).
+<Callout type="warning">
+One exception: anything saved to an agent's `custom_env` is stored on the Multica server and passed to the runtime at execution time. Do not put secrets in `custom_env` that must never leave your computer.
+</Callout>
-## Four ways to get an agent working
+## How agents are triggered
-It's not only "assign an issue" — Multica has 4 triggers, one per collaboration style:
+Agents never start work on their own — every run is triggered by an explicit action: assigning an issue, @-mentioning the agent in a comment, chatting with it directly, or an Autopilot. For how to choose between the four and the rules they share, see [Put agents to work](/triggering-agents).
-| How | Typical scenario | Docs |
-|---|---|---|
-| **Assign an issue** | The most common. Assign an issue to an agent and it starts on its own | [Assigning issues](/assigning-issues) |
-| **@mention an agent in a comment** | "Take a look at this one for me" — don't change the assignee or status, just fire off a comment | [Mentioning agents](/mentioning-agents) |
-| **Direct chat** | Standalone conversation, not tied to an issue — ask questions, have it draft an issue | [Chat](/chat) |
-| **Autopilots (scheduled)** | Standing instructions — "do a standup summary every Monday morning" and the like | [Autopilots](/autopilots) |
+## Run completion and issue completion
-## Runtimes: where it runs, and how many tools
-
-A **runtime** is the pairing of "daemon × one AI coding tool." If the daemon on one machine has both Claude Code and Codex installed and is joined to two workspaces, Multica registers 4 independent runtimes (2 workspaces × 2 tools).
-
-Only the **local daemon** runtime model is supported today. Cloud runtimes (where you don't need your own machine running) are **coming soon**, currently waitlist-only — sign up on the [Downloads](https://multica.ai/download) page.
+When the execution log shows Completed, it only means that one run has ended. The issue can still take further discussion, added requirements, or another agent trigger. Whether the issue is done depends on the actual progress of the work and its status.
## Next steps
-- [Cloud Quickstart](/cloud-quickstart) — connect to Multica Cloud in 5 minutes
-- [Self-Host Quickstart](/self-host-quickstart) — run your own backend
-- [Daemon and runtimes](/daemon-runtimes) — a deep dive into the component the architecture rests on
+- [Daemon and runtimes](/daemon-runtimes) — how computers connect to Multica, and what happens when runtimes go online or offline.
+- [Tasks](/tasks) — task statuses, retries, and cancellation rules.
+- [Assign issues to agents](/assigning-issues) — the most common way to collaborate.
diff --git a/apps/docs/content/docs/how-multica-works.zh.mdx b/apps/docs/content/docs/how-multica-works.zh.mdx
index 8374221179..ddabbcffa7 100644
--- a/apps/docs/content/docs/how-multica-works.zh.mdx
+++ b/apps/docs/content/docs/how-multica-works.zh.mdx
@@ -1,54 +1,48 @@
---
-title: Multica 是怎么工作的
-description: 三个核心组件(server / 守护进程 / AI 编程工具)怎么协同完成一次智能体工作。
+title: Multica 的工作方式
+description: Multica 记录并协调工作,连接的电脑负责执行。
---
-import { ArchitectureDiagram } from "@/components/architecture-diagram";
+import { Callout } from "fumadocs-ui/components/callout";
-Multica 是一个**分布式**平台。你看到的 Web 界面只是前台——真正干活的有三个组件:**Multica 服务器**管数据([工作区](/workspaces)、[issue](/issues)、[成员](/members-roles)、[任务](/tasks) 队列等);**[守护进程](/daemon-runtimes)** 跑在你自己机器上,领任务、调用 AI 编程工具;**[AI 编程工具](/providers)**(Claude Code、Codex 等本地 CLI)是真正写代码的那一环。这个结构是 Multica 和 Linear / Jira 最大的差别——**[智能体](/agents) 不跑在我们的服务器上,而是在你自己的机器上**。
+把一个 issue 分配给智能体后,Multica 会创建一条执行任务,由连接电脑上的运行时领取。运行时调用本地 AI 编程工具,并把进度和结果写回原来的 issue。
-## 系统的三个核心组件
+## 一次执行的完整链路
-<ArchitectureDiagram />
+![一次执行的流程图:左侧 Multica 区域负责记录与调度,Issue 触发创建 Task;右侧"你的电脑"区域中,守护进程领取任务、启动 AI 编程工具、读写工作目录;过程消息实时流回执行日志,最终结果由守护进程写回 Issue](/images/docs/how-a-run-works.png)
-- **Multica 服务器**——你看到的工作区、issue 列表、评论线都存在它的数据库里。它同时是 WebSocket hub,把你和同事之间的实时更新推送过去。它**不**执行任何智能体任务。
-- **守护进程**(daemon)——Multica CLI 的一部分,跑在你自己的机器上。启动后它探测本地装了哪些 AI 编程工具,注册到 server,开始每 3 秒领一次任务、每 15 秒发一次心跳。
-- **AI 编程工具**——[Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae)、[DevEco Code](/providers#deveco-code)、[Grok](/providers#grok) 16 款之一(或多款并存)。守护进程领到任务后,用这些工具真正去写代码。
+1. **Issue 提供上下文。** Issue 保存工作说明、讨论和负责人。分配给智能体后,系统会使用该智能体的指令、模型、skill 和运行时配置。
+2. **Multica 创建执行任务。** 执行任务进入队列;没有在线运行时时,它会在队列中等待。
+3. **运行时领取任务。** 连接电脑上的在线运行时领取任务,并调用智能体配置的 AI 编程工具。
+4. **AI 编程工具在本地执行。** 工具读取工作目录、运行命令并生成结果。
+5. **结果写回 issue。** 进度、评论和结果显示在 issue 的时间线与执行日志中。
-工具链在本地的结果:**你的 API 密钥、代码目录、已授权的工具**都只在本地使用;Multica 服务器一个都看不到。自部署还是用 Cloud 都不改变这一点。
+issue、智能体、执行任务和运行时的完整清单与关系,见[核心概念](/concepts)。
-## 一个任务从创建到完成会经历什么
+## 数据与执行的边界
-以"你把一个 issue 分配给某个智能体"这个最常见的场景为例:
+| Multica | 连接的电脑 |
+|---|---|
+| 工作区、issue、评论和状态 | AI 编程工具及其凭据 |
+| 智能体配置与 skill | 代码目录和本地文件 |
+| 执行任务的状态、执行记录和结果 | 实际的文件修改与命令执行 |
-1. 你在 Web 上点击分配。浏览器发 HTTP 请求到 Multica 服务器。
-2. 服务器把这条 issue 的 assignee 改成那个智能体,**同时**在任务队列里创建一条执行任务,状态 `queued`。
-3. 你机器上的守护进程下一次轮询(3 秒内)把这条任务领走。任务状态变 `dispatched`。
-4. 守护进程在本地创建隔离工作目录、调用对应 AI 编程工具开始执行。任务状态变 `running`。
-5. AI 在本地写代码、跑测试、发评论回服务器。
-6. 执行结束。守护进程把结果(成功 / 失败)汇报给服务器,任务状态变 `completed` 或 `failed`。你在 Web 上看到进度实时更新(WebSocket 推送)。
+这条边界在 Multica Cloud 和自托管中相同。
-详细机制见 [守护进程与运行时](/daemon-runtimes) 和 [执行任务](/tasks)。
+<Callout type="warning">
+有一个例外:保存到智能体 `custom_env` 的内容会存放在 Multica 服务器端,执行时传给运行时。不希望离开你电脑的 secret,不要写进 `custom_env`。
+</Callout>
-## 让智能体开工的四种方式
+## 智能体的触发方式
-不只是"分配 issue"——Multica 有 4 种触发方式,对应不同协作场景:
+智能体不会自己开始工作,每次执行都由一个明确的动作触发:分配 issue、在评论中 @智能体、直接对话,或自动化。四种方式的选择和通用规则见[让智能体开始工作](/triggering-agents)。
-| 方式 | 典型场景 | 文档 |
-|---|---|---|
-| **分配 issue** | 最常见。把一条 issue 指派给智能体,它自动开工 | [分配 issue](/assigning-issues) |
-| **在评论里 @智能体** | "这条你帮我看一下"——不改 assignee、不改状态,用一条评论触发 | [在评论里 @智能体](/mentioning-agents) |
-| **直接聊天** | 独立对话,不绑 issue——问问题、让它帮起草任务 | [聊天](/chat) |
-| **Autopilots(定时)** | 长期指令——每周一早上做 standup 总结之类 | [Autopilots](/autopilots) |
+## 执行结束与 issue 完成
-## 运行时:在哪里跑,跑几家工具
+执行日志显示"已完成",只表示这一次执行已经结束。Issue 仍然可以继续讨论、补充要求或再次触发智能体。Issue 是否完成,以实际工作进展和它的状态为准。
-**运行时**(runtime)是"守护进程 × 一款 AI 编程工具"的组合。同一台机器上的守护进程装了 Claude Code 和 Codex,两个工作区都加入了,那么 Multica 会注册 4 个独立运行时(2 工作区 × 2 工具)。
+## 接下来
-目前只支持**本地守护进程**这一种运行模式。云端运行时(不需要你自己开机)**即将开放**,当前处于等待名单阶段——在 [下载页面](https://multica.ai/download) 登记邮箱。
-
-## 下一步
-
-- [Cloud Quickstart](/cloud-quickstart) —— 5 分钟接入 Multica Cloud
-- [Self-Host Quickstart](/self-host-quickstart) —— 在自己的服务器上跑一套
-- [守护进程与运行时](/daemon-runtimes) —— 架构的灵魂组件深度讲解
+- [守护进程与运行时](/daemon-runtimes) — 了解电脑如何连接 Multica,以及运行时上线、离线时会发生什么。
+- [执行任务](/tasks) — 查看执行任务的状态、重试和取消规则。
+- [分配 issue 给智能体](/assigning-issues) — 了解最常用的协作方式。
diff --git a/apps/docs/content/docs/inbox.ja.mdx b/apps/docs/content/docs/inbox.ja.mdx
index 07badec41a..4e87b467e8 100644
--- a/apps/docs/content/docs/inbox.ja.mdx
+++ b/apps/docs/content/docs/inbox.ja.mdx
@@ -1,65 +1,73 @@
---
title: インボックスと購読
-description: Multica がいつ通知を送るか、そして関心のないイシューをミュートする方法。
+description: 割り当て、メンション、コメント、エージェントの失敗など、フォローが必要な動きを 1 か所で確認します。
---
import { Callout } from "fumadocs-ui/components/callout";
-インボックスは Multica があなたを**割り込む**場所です。あなたに割り当てられた[イシュー](/issues)、[`@` メンション](/comments)、そしてあなたが購読しているイシューのアクティビティがすべてここに届きます。
+インボックスは、あなたに関係する作業の動きを集約します。完全なアクティビティログではなく、「注意が必要な変化がどこで起きたか」を知らせるためのものです。完全なコンテキストは対応するイシューに残ります。
-あなたは**購読**と**購読解除**を通じて、どのイシューのアクティビティが自分に届くかを制御します。
+## インボックスに届くもの
-## インボックスに表示されるもの
+主な通知は次のとおりです。
-次のイベントがあなたのインボックスに通知を届けます。
+- イシューがあなたに割り当てられた、またはあなたから外された
+- 購読中のイシューに新しいコメントが付いた、または担当者・ステータス・優先度・日付が変わった
+- イシューの説明やコメントで誰かがあなたを @メンションした
+- あなたが作成したイシューやコメントにリアクションが付いた
+- 購読中のイシューでエージェントの実行が失敗した
+- エージェント経由のイシュー作成が完了または失敗した
+- 購読中のオートパイロットが新しいイシューを作成した、または連続した失敗により一時停止された
-- **イシューの割り当て / 割り当て解除 / 再割り当て** — あなたが新しい担当者(または以前の担当者)になると通知を受け取ります
-- **あなたが購読しているイシューのステータス、優先度、期限の変更**
-- **あなたが購読しているイシューの新しいコメント**
-- **あなたがコメントで `@` メンションされた** — 購読しているかどうかに関係なく届きます
-- **誰かがあなたのイシューやコメントにリアクションした**
-- **あなたが割り当てたエージェントの[タスク](/tasks)が失敗した**
+自分の操作は自分には通知されません。同じイシューの複数の通知は 1 件にまとめられ、開くとそのイシューの最近の変化を確認できます。
-## `@all` はワークスペース全体に通知します
+## 自動購読の発生源
-`@all` は特殊な対象です。ワークスペースの**すべてのメンバー**に通知をプッシュします。
+次の関係者はイシューを自動的に購読します。
-<Callout type="warning">
-**`@all` は控えめに使ってください。** 50 人規模のワークスペースでは、`@all` コメント 1 つで瞬時に 50 件のインボックス通知が生成されます。日常的な議論ではなく、重大な事案(プロダクション障害、マイルストーンの告知)にのみ使ってください。
-</Callout>
+- イシューの作成者
+- 新しい担当者
+- コメントした人
+- イシューの説明で新たに @メンションされた人
+- オートパイロットで事前設定された購読メンバー
-## エージェントは通知を受け取りません
+担当者が変わっても、既存の購読は解除されません。イシューのページでいつでも購読・購読解除できます。購読解除後は通常の更新はインボックスに届かなくなりますが、あなたへの直接の @メンションは引き続き個別に通知されます。
-エージェントは**決して**インボックス通知を受け取りません。担当者や作成者であるときも、コメントで `@` メンションされたときも受け取りません。
+<Callout type="info">
+サブイシューのステータスが変わると、親イシューの購読者にも通知されます。サブイシューのコメント、優先度、日付の変更は親イシューには伝わりません。
+</Callout>
-これはバグではありません。エージェントはインボックスを読みません。エージェントは[**即時トリガー**](/assigning-issues)方式で動作します。イシューを割り当てたり、コメントでエージェントを `@` メンションしたりすると、ただちにそのエージェント向けのタスクが始まります。インボックスは人間のためのリマインダーの仕組みであり、エージェントにとっては何の意味も持ちません。
+## エージェントはインボックスを使わない
-## 購読のルール
+インボックスはワークスペースメンバー専用です。エージェントが担当者や購読者であっても、インボックスの通知を読むことはありません。
-次の 4 つの状況で、あなたはイシューに**自動購読**されます。
+コメントでの @メンション、イシューの割り当て、オートパイロットのトリガーは、エージェントに通知を残すのではなく、直接実行を作成します。`@all` もメンバーにのみ通知します。
-- あなたがそのイシューを**作成**した場合
-- あなたがそのイシューに**割り当て**られた場合
-- あなたがそのイシューに**コメント**した場合
-- あなたがそのイシューまたはそのコメントで **`@` メンション**された場合
+## 通知の処理
-自動購読は一度だけ起こります。作成者であり同時にメンション対象でもあっても、2 回購読されることはありません。
+通知を選択すると既読になります。対応が済んだらアーカイブできます。アーカイブしても対応するイシューは変更・削除されません。イシューが `in_review`、`done`、`cancelled` になると、その「実行失敗」の通知は自動的にアーカイブされます。
-<Callout type="warning">
-**再割り当ては自動で購読を解除しません。** あなたが以前は担当者だったのに交代させられた場合でも、**そのイシューの更新を引き続き受け取ります** — 自動購読がデータベースにそのまま残っているためです。
+インボックスのメニューからは次の操作もできます。
-通知を受け取らないようにするには、イシューを開いて手動で購読を解除してください。
-</Callout>
+- すべて既読にする
+- すべてアーカイブする、または既読の項目をすべてアーカイブする
+- `done` または `cancelled` のイシューの通知をアーカイブする
+- 「アーカイブ済み」を開いて通知を復元する
-また、どのイシュー(無関係なイシューでも)でも**手動で購読**したり、どの自動購読でも**手動で購読解除**したりできます。UI ではイシューページの右パネルを使い、CLI では `multica issue subscriber add/remove` を使ってください。
+## 通知タイプの調整
-## 子イシューのステータス変更は親イシューに伝播します
+**設定 → 通知**では、次のグループを個別にオン・オフできます。
-子イシューの**ステータス**が変更されると、親イシューの購読者も通知を受け取ります。たとえ子イシューを購読していなくても同様です。
+- 担当の割り当て
+- ステータス変更
+- コメントとメンション
+- 優先度と期限
+- エージェントのアクティビティ
-これは**ステータスにのみ**適用されます。子イシューのコメント、優先度、期限の変更は親イシューに伝播**しません**。
+グループをオフにしても、関連する変更はイシューに記録され続けます。インボックス通知が作られなくなるだけです。リアクション、エージェント経由の作成結果、オートパイロットの一時停止など一部のタイプはこの 5 グループの対象外で、常に届きます。システム通知とブラウザ通知はデスクトップのバナーを制御するもので、インボックス自体は変わりません。
-## 次へ
+## 次のステップ
-- [コメントとメンション](/comments) — `@` メンションの仕組みと注意点
-- [エージェントにイシューを割り当てる](/assigning-issues) — エージェントがトリガーされる仕組み(そしてエージェントがインボックスを読まない理由)
+- [コメント](/comments) — 返信、メンション、スレッドを理解します。
+- [コメントでエージェントを @メンション](/mentioning-agents) — メンバーへの通知とエージェントの実行の違い。
+- [オートパイロット](/autopilots) — 作業の自動作成とデフォルトの購読者を設定します。
diff --git a/apps/docs/content/docs/inbox.ko.mdx b/apps/docs/content/docs/inbox.ko.mdx
index 265a91d117..b1624d2b7a 100644
--- a/apps/docs/content/docs/inbox.ko.mdx
+++ b/apps/docs/content/docs/inbox.ko.mdx
@@ -1,65 +1,73 @@
---
title: 인박스와 구독
-description: Multica가 언제 알림을 보내는지, 그리고 관심 없는 이슈를 음소거하는 방법.
+description: 할당, 멘션, 댓글, 에이전트 실패처럼 확인이 필요한 활동을 한곳에서 봅니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-인박스는 Multica가 여러분을 **방해**하는 곳입니다. 여러분에게 할당된 [이슈](/issues), [`@` 멘션](/comments), 그리고 여러분이 구독한 이슈의 활동이 모두 여기에 도착합니다.
+인박스는 나와 관련된 작업 활동을 모아 보여 줍니다. 전체 활동 로그가 아니라 "확인해야 할 변화가 어디에서 일어났는지" 알려 주는 곳입니다. 전체 컨텍스트는 여전히 해당 이슈에 저장됩니다.
-여러분은 **구독**과 **구독 취소**를 통해 어떤 이슈 활동이 여러분에게 도달할지 제어합니다.
+## 인박스에 들어오는 내용
-## 인박스에 표시되는 것
+일반적인 알림은 다음과 같습니다.
-다음 이벤트가 여러분의 인박스로 알림을 전달합니다.
+- 이슈가 나에게 할당되거나 내 할당에서 해제됨
+- 구독한 이슈에 새 댓글이 달리거나 담당자, 상태, 우선순위, 날짜가 변경됨
+- 누군가 이슈 설명이나 댓글에서 나를 @멘션함
+- 내가 만든 이슈나 댓글에 이모지 반응이 추가됨
+- 구독한 이슈에서 에이전트 실행이 실패함
+- 에이전트를 통한 이슈 생성 작업이 완료되거나 실패함
+- 구독한 자동화가 새 이슈를 만들거나 연속 실패로 일시 중지됨
-- **이슈 할당 / 할당 해제 / 재할당** — 여러분이 새 담당자(또는 이전 담당자)가 되면 알림을 받습니다
-- **여러분이 구독한 이슈의 상태, 우선순위, 마감일 변경**
-- **여러분이 구독한 이슈의 새 댓글**
-- **여러분이 댓글에서 `@`로 멘션됨** — 구독 여부와 관계없이 전달됩니다
-- **누군가 여러분의 이슈나 댓글에 반응함**
-- **여러분이 할당한 에이전트 [작업](/tasks)이 실패함**
+자신이 수행한 작업은 자신에게 알리지 않습니다. 같은 이슈의 여러 알림은 하나로 합쳐지며, 열면 해당 이슈의 최근 변경 사항을 확인할 수 있습니다.
-## `@all`은 워크스페이스 전체에 알립니다
+## 자동 구독되는 경우
-`@all`은 특수한 대상입니다. 워크스페이스의 **모든 멤버**에게 알림을 푸시합니다.
+다음 참여자는 이슈를 자동으로 구독합니다.
-<Callout type="warning">
-**`@all`은 아껴서 사용하세요.** 50명 규모의 워크스페이스에서 `@all` 댓글 하나는 즉시 50개의 인박스 알림을 생성합니다. 일상적인 논의가 아니라 중대한 사안(프로덕션 장애, 마일스톤 공지)에만 사용하세요.
-</Callout>
+- 이슈 생성자
+- 새 담당자
+- 댓글을 작성한 사람
+- 이슈 설명에 새로 @멘션된 사람
+- 자동화에 미리 설정된 구독 멤버
-## 에이전트는 알림을 받지 않습니다
+담당자가 바뀌어도 기존 구독은 취소되지 않습니다. 이슈 페이지에서 언제든 구독하거나 구독을 취소할 수 있습니다. 취소하면 일반 업데이트는 더 이상 인박스에 들어오지 않지만 나를 직접 @멘션한 알림은 별도로 전달됩니다.
-에이전트는 **절대** 인박스 알림을 받지 않습니다. 담당자나 생성자일 때도, 댓글에서 `@`로 멘션될 때도 받지 않습니다.
+<Callout type="info">
+하위 이슈의 상태가 변경되면 상위 이슈 구독자에게도 알림이 갑니다. 하위 이슈의 댓글, 우선순위, 날짜 변경은 상위 이슈로 전달되지 않습니다.
+</Callout>
-이것은 버그가 아닙니다. 에이전트는 인박스를 읽지 않습니다. 에이전트는 [**즉시 트리거**](/assigning-issues) 방식으로 동작합니다. 이슈를 할당하거나 댓글에서 에이전트를 `@`로 멘션하면 곧바로 해당 에이전트를 위한 작업이 시작됩니다. 인박스는 사람을 위한 알림 메커니즘이며, 에이전트에게는 아무런 의미가 없습니다.
+## 에이전트는 인박스를 사용하지 않습니다
-## 구독 규칙
+인박스는 워크스페이스 멤버만 사용합니다. 에이전트가 담당자나 구독자여도 인박스 알림을 읽지 않습니다.
-다음 네 가지 상황에서 여러분은 이슈에 **자동 구독**됩니다.
+댓글에서 에이전트를 @멘션하거나 이슈를 에이전트에게 할당하거나 자동화를 트리거하면 에이전트에게 알림을 남기는 대신 실행이 직접 생성됩니다. `@all`도 멤버에게만 알립니다.
-- 여러분이 이슈를 **생성**한 경우
-- 여러분이 이슈에 **할당**된 경우
-- 여러분이 이슈에 **댓글**을 단 경우
-- 여러분이 이슈 또는 그 댓글에서 **`@`로 멘션**된 경우
+## 알림 처리
-자동 구독은 한 번만 일어납니다. 생성자이면서 동시에 멘션 대상이더라도 두 번 구독되지는 않습니다.
+알림을 선택하면 읽음으로 표시됩니다. 처리한 뒤 보관할 수 있으며, 보관해도 해당 이슈가 변경되거나 삭제되지 않습니다. 이슈가 `in_review`, `done`, `cancelled` 상태가 되면 그 이슈의 "실행 실패" 알림은 자동으로 보관됩니다.
-<Callout type="warning">
-**재할당은 자동으로 구독을 취소하지 않습니다.** 여러분이 예전에 담당자였다가 교체되었더라도, **그 이슈의 업데이트를 계속 받게 됩니다.** 자동 구독이 데이터베이스에 그대로 남아 있기 때문입니다.
+인박스 메뉴에서는 다음 작업도 할 수 있습니다.
-더 이상 알림을 받지 않으려면 이슈를 열어 직접 구독을 취소하세요.
-</Callout>
+- 모두 읽음으로 표시
+- 전체 또는 읽은 알림 모두 보관
+- 상태가 `done` 또는 `cancelled`인 이슈 알림 보관
+- "보관됨"을 열고 특정 알림 복원
-또한 어떤 이슈든(관련 없는 이슈라도) **직접 구독**하거나, 어떤 자동 구독이든 **직접 구독을 취소**할 수 있습니다. UI에서는 이슈 페이지의 오른쪽 패널을 사용하고, CLI에서는 `multica issue subscriber add/remove`를 사용하세요.
+## 알림 유형 조정
-## 하위 이슈의 상태 변경은 상위 이슈로 전파됩니다
+**설정 → 알림**을 열면 다음 유형을 각각 켜거나 끌 수 있습니다.
-하위 이슈의 **상태**가 변경되면, 상위 이슈의 구독자도 알림을 받습니다. 그들이 하위 이슈를 구독하지 않았더라도 마찬가지입니다.
+- 할당
+- 상태 변경
+- 댓글과 멘션
+- 우선순위와 날짜
+- 에이전트 활동
-이것은 **상태에만** 적용됩니다. 하위 이슈의 댓글, 우선순위, 마감일 변경은 상위 이슈로 전파되지 **않습니다**.
+특정 유형을 꺼도 관련 변경 사항은 이슈에 계속 저장되며 인박스 알림만 생성되지 않습니다. 이모지 반응, 빠른 생성 결과, 자동화 일시 중지 같은 일부 유형은 이 다섯 그룹의 설정과 관계없이 항상 전달됩니다. 시스템 알림과 브라우저 알림 설정은 데스크톱 배너를 제어할 뿐 인박스 자체를 바꾸지 않습니다.
-## 다음
+## 다음 단계
-- [댓글과 멘션](/comments) — `@` 멘션의 작동 방식과 주의할 점
-- [에이전트에게 이슈 할당하기](/assigning-issues) — 에이전트가 트리거되는 방식(그리고 에이전트가 인박스를 읽지 않는 이유)
+- [댓글](/comments) — 답글, 멘션, 논의 스레드를 알아봅니다.
+- [댓글에서 에이전트 @멘션하기](/mentioning-agents) — 멤버 알림과 에이전트 실행의 차이를 이해합니다.
+- [자동화](/autopilots) — 작업 자동 생성과 기본 구독자를 설정합니다.
diff --git a/apps/docs/content/docs/inbox.mdx b/apps/docs/content/docs/inbox.mdx
index 297279213f..fdb170f414 100644
--- a/apps/docs/content/docs/inbox.mdx
+++ b/apps/docs/content/docs/inbox.mdx
@@ -1,65 +1,73 @@
---
title: Inbox and subscriptions
-description: When Multica notifies you, and how to mute issues you don't care about.
+description: One place for assignments, mentions, comments, and agent failures that need your follow-up.
---
import { Callout } from "fumadocs-ui/components/callout";
-The inbox is where Multica **interrupts** you — [issues](/issues) assigned to you, [`@` mentions](/comments), and activity on issues you're subscribed to all land here.
+The inbox collects the work activity that concerns you. It's not a full activity log — it flags where something changed that needs your attention; the full context stays on the corresponding issue.
-You control which issue activity reaches you by **subscribing** and **unsubscribing**.
+## What lands in the inbox
-## What shows up in your inbox
+Common notifications include:
-The following events deliver a notification to your inbox:
+- an issue is assigned to you, or moved away from you;
+- an issue you subscribe to gets a new comment, or its assignee, status, priority, or dates change;
+- someone @-mentions you in an issue description or comment;
+- an issue or comment you created gets a reaction;
+- an agent run fails on an issue you subscribe to;
+- creating an issue through an agent completes or fails;
+- an autopilot you subscribe to creates a new issue, or is paused after consecutive failures.
-- **Issue assigned / unassigned / reassigned** — you're notified when you're the new (or former) assignee
-- **Status, priority, or due date change on an issue you're subscribed to**
-- **New comment on an issue you're subscribed to**
-- **You're `@`-mentioned in a comment** — delivered whether or not you're subscribed
-- **Someone reacts to your issue or comment**
-- **An agent [task](/tasks) you assigned fails**
+Your own actions don't notify you. Multiple notifications on the same issue merge into one entry; open it to see the issue's recent changes.
-## `@all` notifies the entire workspace
+## Sources of automatic subscription
-`@all` is a special target — it pushes a notification to **every member** of the workspace.
+These participants subscribe to an issue automatically:
-<Callout type="warning">
-**Use `@all` sparingly.** In a 50-person workspace, one `@all` comment produces 50 inbox notifications instantly. Reserve it for high-stakes events (production incidents, milestone announcements) — not everyday discussion.
-</Callout>
+- the issue's creator;
+- a new assignee;
+- anyone who comments;
+- anyone newly @-mentioned in the issue description;
+- subscribers preconfigured in an autopilot.
-## Agents never receive notifications
+Changing the assignee does not remove existing subscriptions. Subscribe or unsubscribe anytime on the issue page; after unsubscribing, ordinary updates stop reaching your inbox, while direct @-mentions still notify you individually.
-Agents **never** get inbox notifications — not even when they're the assignee, creator, or `@`-mentioned in a comment.
+<Callout type="info">
+When a sub-issue's status changes, subscribers of the parent issue are notified as well. Sub-issue comments, priority, and date changes do not bubble up to the parent.
+</Callout>
-This isn't a bug: agents don't read an inbox. They work by [**immediate trigger**](/assigning-issues) — assigning an issue or `@`-mentioning the agent in a comment kicks off a task for it right away. The inbox is a reminder mechanism for humans; it has no meaning for agents.
+## Agents don't use the inbox
-## Subscription rules
+The inbox is only for workspace members. Even when an agent is the assignee or a subscriber, it never reads inbox notifications.
-You're **auto-subscribed** to an issue in four situations:
+@-mentioning an agent in a comment, assigning an issue to it, or triggering an autopilot creates a run directly instead of leaving the agent a notification. `@all` notifies members only.
-- You **created** it
-- You were **assigned** to it
-- You **commented** on it
-- You were **`@`-mentioned** on it or in one of its comments
+## Handle notifications
-Auto-subscription happens once — being both the creator and a mentionee doesn't subscribe you twice.
+Selecting a notification marks it as read. Archive it when you're done; archiving doesn't modify or delete the corresponding issue. Once an issue reaches `in_review`, `done`, or `cancelled`, its run-failure notifications archive automatically.
-<Callout type="warning">
-**Reassignment doesn't auto-unsubscribe you.** If you used to be the assignee and got replaced, you'll **still receive updates on that issue** — the auto-subscription stays in the database.
+From the inbox menu you can also:
-To stop getting notified, open the issue and unsubscribe manually.
-</Callout>
+- mark all as read;
+- archive all, or archive all read;
+- archive notifications for issues in `done` or `cancelled`;
+- open Archived and restore a notification.
-You can also **manually subscribe** to any issue (even unrelated ones), or **manually unsubscribe** from any auto-subscription. In the UI, use the right panel on the issue page; in the CLI, use `multica issue subscriber add/remove`.
+## Tune notification types
-## Sub-issue status changes bubble up to the parent
+Open **Settings → Notifications** to toggle each group separately:
-When a sub-issue's **status** changes, subscribers of the parent issue are notified too — even if they haven't subscribed to the sub-issue.
+- assignments;
+- status changes;
+- comments and mentions;
+- priority and dates;
+- agent activity.
-This applies to **status only**: comment, priority, and due date changes on sub-issues do **not** bubble up.
+Turning a group off doesn't stop the changes from being recorded on the issue — it only stops the inbox notifications. A few types, such as reactions, quick-create results, and autopilot pauses, sit outside these five groups and are always delivered. System and browser notifications control desktop banners and don't change the inbox itself.
-## Next
+## Next steps
-- [Comments and mentions](/comments) — how `@` mentions work and the gotchas
-- [Assigning issues to agents](/assigning-issues) — how agents are triggered (and why they don't read the inbox)
+- [Comments](/comments) — replies, mentions, and discussion threads.
+- [@-mention agents in comments](/mentioning-agents) — member notifications vs. agent runs.
+- [Autopilots](/autopilots) — configure automatic work creation and default subscribers.
diff --git a/apps/docs/content/docs/inbox.zh.mdx b/apps/docs/content/docs/inbox.zh.mdx
index e5a91be405..1df514ac8d 100644
--- a/apps/docs/content/docs/inbox.zh.mdx
+++ b/apps/docs/content/docs/inbox.zh.mdx
@@ -1,65 +1,73 @@
---
title: 收件箱与订阅
-description: Multica 什么时候通知你,怎么静音不关心的 issue。
+description: 集中查看分配、提及、评论和智能体失败等需要跟进的动态。
---
import { Callout } from "fumadocs-ui/components/callout";
-收件箱(Inbox)是你在 Multica 里**被打扰**的地方——分配给你的 [issue](/issues)、有人 [`@` 你](/comments)、你订阅的 issue 有动态时,都会出现在这里。
+收件箱汇总与你有关的工作动态。它不是完整的活动日志,而是提醒你"哪里发生了需要关注的变化";完整上下文仍然保存在对应的 issue 中。
-你通过**订阅 / 取消订阅** issue 来控制哪些 issue 的变化会打扰你。
+## 收件箱的内容
-## 收件箱里会收到什么
+常见通知包括:
-下面这些事件会往你的收件箱里送一条通知:
+- issue 分配给你,或从你名下移走;
+- 你订阅的 issue 出现新评论,或负责人、状态、优先级和日期发生变化;
+- 有人在 issue 描述或评论中 @你;
+- 你创建的 issue 或评论收到表情回应;
+- 你订阅的 issue 中,智能体执行失败;
+- 通过智能体创建 issue 的操作完成或失败;
+- 你订阅的自动化创建了新 issue,或自动化因连续失败被暂停。
-- **issue 被分配 / 取消分配 / 换了分配人** —— 你是新分配人(或前分配人)时收到
-- **你订阅的 issue 改了状态、优先级、截止日期**
-- **你订阅的 issue 下有新评论**
-- **你在评论里被 `@` 提及** —— 无论是否订阅都会收到
-- **你的 issue 或评论被加了表情反应**
-- **你分配的智能体[任务](/tasks)失败了**
+自己的操作不会通知自己。同一 issue 的多条通知会合并成一项,打开后可查看这条 issue 最近的变化。
-## `@all` 会通知整个工作区
+## 自动订阅的来源
-`@all` 是个特殊的目标——它会把通知推送给工作区里的**每一个成员**。
+以下参与者会自动订阅 issue:
-<Callout type="warning">
-**谨慎使用 `@all`**。在 50 人的工作区里发一条 `@all` 评论,会瞬间产生 50 条收件箱通知。只在重大事项(生产事故、里程碑宣布)上用——不是日常讨论。
-</Callout>
+- issue 的创建者;
+- 新的负责人;
+- 发表评论的人;
+- 在 issue 描述中被新增 @提及的人;
+- 自动化中预先配置的订阅成员。
-## 智能体永远不会收到通知
+负责人变更不会取消原有订阅。可以在 issue 页面随时订阅或取消;取消后普通更新不再进入收件箱,直接 @你仍会单独通知。
-智能体(agent)**永远**不会收到收件箱通知——即使它是 issue 的分配人、创建者、或者在评论里被 `@` 了。
+<Callout type="info">
+子 issue 的状态发生变化时,也会通知父 issue 的订阅者。子 issue 的评论、优先级和日期变化不会向父 issue 冒泡。
+</Callout>
-这不是 bug:智能体不看收件箱。它的工作方式是被[**立即触发**](/assigning-issues)——分配 issue 或在评论里 `@` 它,系统会马上起一个任务给它执行。收件箱是给人用的提醒机制,对智能体没有意义。
+## 智能体不使用收件箱
-## 订阅规则
+收件箱只面向工作区成员。即使智能体是负责人或订阅者,它也不会读取收件箱通知。
-四种情况下你会被**自动订阅**一个 issue:
+在评论中 @智能体、把 issue 分配给智能体或触发自动化,都会直接创建一次执行,而不是给智能体留一条通知。`@all` 也只通知成员。
-- 你**创建**了它
-- 你**被分配**为 assignee
-- 你**在它下面发过评论**
-- 你**在它或它的评论里被 `@` 提及**
+## 处理通知
-自动订阅只发生一次——你创建了又被 @ 了,不会订阅两次。
+选择一条通知会把它标为已读。处理完后可以归档;归档不会修改或删除对应的 issue。issue 进入 `in_review`、`done` 或 `cancelled` 后,它的"执行失败"通知会自动归档。
-<Callout type="warning">
-**换了分配人不会自动取消你的订阅。** 如果你之前是某 issue 的分配人,后来被换掉了,你**仍然会收到这个 issue 的后续动态**——因为自动订阅留在了数据库里。
+收件箱菜单还可以:
-如果不想再被打扰,去 issue 页面手动取消订阅。
-</Callout>
+- 全部标为已读;
+- 归档全部或全部已读;
+- 归档状态为 `done` 或 `cancelled` 的 issue 通知;
+- 打开"已归档"并恢复某条通知。
-你也可以**手动订阅**任何 issue(即使和你无关),或**手动取消订阅**任何自动订阅。UI 上在 issue 详情页右侧,CLI 用 `multica issue subscriber add/remove`。
+## 调整通知类型
-## 子 issue 状态变化会冒泡到父 issue
+打开**设置 → 通知**,可以分别开关:
-如果一个 sub-issue 的**状态**发生变化,父 issue 的订阅者也会收到通知——即使他们没订阅这个 sub-issue。
+- 分配;
+- 状态变更;
+- 评论与提及;
+- 优先级与日期;
+- 智能体活动。
-这只对**状态**生效:sub-issue 的评论、优先级、截止日期变化**不会**冒泡到父 issue。
+关闭某一类后,相关变化仍然保存在 issue 中,只是不再创建收件箱通知。表情回应、快速创建结果和自动化暂停等少数类型不受这五组控制,始终投递。系统通知和浏览器通知控制的是桌面横幅,不会改变收件箱本身。
-## 下一步
+## 接下来
-- [评论与提及](/comments) —— `@` 提及的用法和陷阱
-- [把 issue 分配给智能体](/assigning-issues) —— 智能体的触发机制(为什么它不看收件箱)
+- [评论](/comments) — 了解回复、提及和讨论线程。
+- [在评论中 @智能体](/mentioning-agents) — 区分成员通知和智能体执行。
+- [自动化](/autopilots) — 配置自动创建工作及默认订阅者。
diff --git a/apps/docs/content/docs/index.ja.mdx b/apps/docs/content/docs/index.ja.mdx
index 2dd09e1695..1f173d3101 100644
--- a/apps/docs/content/docs/index.ja.mdx
+++ b/apps/docs/content/docs/index.ja.mdx
@@ -1,50 +1,36 @@
---
title: ようこそ
-description: 人間と AI エージェントが同じワークスペースで一緒に働く、タスクコラボレーションプラットフォーム。
---
-import { Callout } from "fumadocs-ui/components/callout";
+## Multica でできること
-Multica は、人間と AI [エージェント](/agents)が同じ[ワークスペース](/workspaces)で一緒に働くタスクコラボレーションプラットフォームです。同僚に仕事を渡すのと同じように[エージェントにイシューを割り当てる](/assigning-issues)ことができ、エージェントは作業を実行し、進捗を報告し、コメントで返信します。また、[チャットウィンドウを開いて直接対話](/chat)し、イシューの下書き作成、質問への回答、単発のリクエスト処理を任せることもできます。
+- **仕事をエージェントに任せる**:同僚に割り当てるようにイシューを割り当てると、エージェントが進捗を更新し、成果を届けます。
+- **コンテキストをすべて共有する**:議論、記録、成果物はワークスペースに残り、チームのメンバーがいつでも参照できます。
+- **仕事を自動で回す**:スケジュール実行を設定し、複数のエージェントに自動で協働させられます。
+- **チームのノウハウを蓄積する**:有効だったやり方をスキルとして保存し、すべてのエージェントで再利用できます。
-このページでは、エージェントがどこで実行されるか、そして Multica を使い始めるさまざまな方法を説明します。
+![ワークスペースのボード:人間のメンバーと複数のエージェントが一緒に仕事を進めている](/images/docs/workspace-overview.png)
-## エージェントが実行される場所
+## ここから始める
-エージェントは Multica のサーバー上でタスクを実行**しません**。現在 Multica は 1 つのランタイムモデルをサポートしています。
+- **[最初の実行を完了する](/cloud-quickstart)** — エージェントを作成し、最初のタスクを任せて、返ってくる結果を確認します。
+- **[コアコンセプト](/concepts)** — Multica のすべてのコアオブジェクトとその関係を 3 分で把握します。
+- **[Multica をセルフホストする](/self-host-quickstart)** — 自分のインフラに Multica をデプロイします。
-- **ローカル[デーモン](/daemon-runtimes)** — 自分のマシンで `multica daemon` を実行すると、デーモンがローカルにインストールされた [AI コーディングツール](/providers)を駆動します。現在 16 種類が標準で組み込まれています: [Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae)、[DevEco Code](/providers#deveco-code)、[Grok](/providers#grok)。API キー、ツールチェーン、コードディレクトリはすべて自分のマシンに留まります。
+## よく開かれるページ
-<Callout type="info">
-**クラウドランタイムが近日提供予定です。** 現在はウェイトリストのみで運用されています。提供が開始されればローカルデーモンは不要になり、エージェントのタスクは Multica Cloud 上で直接実行されます。[ダウンロード](https://multica.ai/download)ページで登録すると通知を受け取れます。
-</Callout>
+- [エージェントを動かす](/triggering-agents) — エージェントをトリガーする 4 つの方法。
+- [エージェントの作成と設定](/agents-create) — 空白から、または AI で最初のエージェントを作成します。
+- [AI コーディングツールのインストール](/install-agent-runtime) — コンピュータに実行の能力を持たせます。
+- [タスク](/tasks) — 実行ごとのステータス、リトライ、ログの読み方。
+- [トラブルシューティング](/troubleshooting) — エージェントが動かないときは、ここから切り分けます。
-## Multica を使う 3 つの方法
+## コミュニティ
-最初の 2 つのカードは**バックエンドの選択肢**で、Multica サーバーがどこで実行されるかを決めます。3 つ目は**クライアントの選択肢**で、どのインターフェースを使うかを決めます。デスクトップアプリはどちらのバックエンドとも組み合わせて使えます。
+困ったことや製品への提案があるとき、あるいは Multica に参加したいときは、次のチャンネルから連絡できます。
-<NumberedCards>
- <NumberedCard number="01" title="Multica Cloud" href="/cloud-quickstart" tag="ウェイトリスト">
- マネージドバックエンド。CLI をインストールし、ローカルでデーモンを実行してから、Multica がホスティングするサーバーに接続します。約 5 分で完了します。
- </NumberedCard>
- <NumberedCard number="02" title="セルフホスト" href="/self-host-quickstart" tag="Docker · Helm">
- Docker Compose を使って自分のサーバーでバックエンド全体を実行します。データベース、サーバー、ストレージがすべて自分のインフラ上に配置されます。
- </NumberedCard>
- <NumberedCard number="03" title="デスクトップアプリ" href="/desktop-app" tag="推奨">
- ネイティブのマルチタブウィンドウ。CLI が内蔵されており、起動時にデーモンを自動的に開始します。インストール後に実行するコマンドは一切ありません。Multica Cloud またはセルフホストのバックエンドに接続します。
- </NumberedCard>
-</NumberedCards>
-
-## 次のステップ
-
-<NumberedSteps>
- <Step number="01" title="ランタイムモデルから理解する">
- [Multica の仕組み](/how-multica-works) — 30 秒で読めて、「サーバーはエージェントを実行せず、エージェントはユーザーのマシンで実行される」という点をしっかり押さえられます。
- </Step>
- <Step number="02" title="始める方法を選ぶ">
- 上記の 3 つから 1 つを選びましょう。ほとんどの方は[デスクトップアプリ](/desktop-app)から始めます。CLI のセットアップが不要で、5 分で動き出します。
- </Step>
- <Step number="03" title="最初のイシューを割り当てる">
- [イシュー](/issues)を作成し、担当者として同僚の代わりにエージェントを選びましょう。エージェントが結果を届けるのを待つだけです。
- </Step>
-</NumberedSteps>
+<CommunityLinks
+ discordDescription="チームや他のユーザーと交流できます。"
+ githubDescription="問題の報告、機能の提案、コントリビュートはこちら。"
+ xDescription="製品のアップデートやリリース情報をフォローできます。"
+/>
diff --git a/apps/docs/content/docs/index.ko.mdx b/apps/docs/content/docs/index.ko.mdx
index d0f91f6ce4..861d4c2b04 100644
--- a/apps/docs/content/docs/index.ko.mdx
+++ b/apps/docs/content/docs/index.ko.mdx
@@ -1,50 +1,36 @@
---
title: 환영합니다
-description: 인간과 AI 에이전트가 같은 워크스페이스에서 함께 일하는 작업 협업 플랫폼.
---
-import { Callout } from "fumadocs-ui/components/callout";
+## Multica로 할 수 있는 일
-Multica는 인간과 AI [에이전트](/agents)가 같은 [워크스페이스](/workspaces)에서 함께 일하는 작업 협업 플랫폼입니다. 동료에게 일을 넘기듯이 [에이전트에게 이슈를 할당](/assigning-issues)할 수 있으며 — 에이전트는 작업을 실행하고, 진행 상황을 보고하며, 댓글로 답합니다. 또한 [채팅 창을 열어 직접 대화](/chat)하면서 이슈 초안 작성, 질문 답변, 일회성 요청 처리를 맡길 수도 있습니다.
+- **에이전트에게 작업 맡기기**: 동료에게 맡기듯 이슈를 할당하면 에이전트가 진행 상황을 업데이트하고 결과를 제출합니다.
+- **모든 컨텍스트 공유하기**: 논의, 기록, 결과물이 모두 워크스페이스에 남아 언제든 팀 멤버가 확인할 수 있습니다.
+- **작업을 자동으로 운영하기**: 예약 태스크를 설정해 여러 에이전트가 자동으로 협업하게 할 수 있습니다.
+- **팀의 경험 축적하기**: 효과가 검증된 방법을 스킬로 저장해 모든 에이전트가 재사용할 수 있습니다.
-이 페이지에서는 에이전트가 어디에서 실행되는지, 그리고 Multica를 사용하기 시작하는 여러 방법을 설명합니다.
+![워크스페이스 보드: 사람 멤버와 여러 에이전트가 함께 작업을 진행하는 모습](/images/docs/workspace-overview.png)
-## 에이전트가 실행되는 곳
+## 여기서 시작하세요
-에이전트는 Multica 서버에서 작업을 실행하지 **않습니다**. 현재 Multica는 하나의 런타임 모델을 지원합니다:
+- **[첫 실행 완료하기](/cloud-quickstart)** — 에이전트를 만들고 첫 태스크를 맡긴 뒤 반환된 결과를 확인합니다.
+- **[핵심 개념](/concepts)** — 3분 안에 Multica의 핵심 객체와 그 관계를 모두 알아봅니다.
+- **[Multica 자체 호스팅하기](/self-host-quickstart)** — 자체 인프라에 Multica를 배포합니다.
-- **로컬 [데몬](/daemon-runtimes)** — 자신의 기기에서 `multica daemon`을 실행하면, 데몬이 로컬에 설치된 [AI 코딩 도구](/providers)를 구동합니다. 현재 16가지가 기본 내장되어 있습니다: [Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code), [Grok](/providers#grok). API 키, 툴체인, 코드 디렉터리는 모두 자신의 기기에 머뭅니다.
+## 자주 찾는 페이지
-<Callout type="info">
-**클라우드 런타임이 곧 제공됩니다.** 현재는 대기 명단으로만 운영됩니다. 출시되면 로컬 데몬이 필요 없어지며 — 에이전트 작업이 Multica Cloud에서 직접 실행됩니다. [다운로드](https://multica.ai/download) 페이지에서 등록하면 알림을 받을 수 있습니다.
-</Callout>
+- [에이전트가 작업을 시작하게 하기](/triggering-agents) — 에이전트를 트리거하는 네 가지 방법입니다.
+- [에이전트 생성 및 설정](/agents-create) — 빈 상태에서 시작하거나 AI를 이용해 첫 에이전트를 만듭니다.
+- [AI 코딩 도구 설치](/install-agent-runtime) — 컴퓨터에서 작업을 실행할 수 있게 준비합니다.
+- [실행 태스크](/tasks) — 각 실행의 상태, 재시도, 로그를 이해합니다.
+- [문제 해결](/troubleshooting) — 에이전트가 움직이지 않을 때 여기서 원인을 찾습니다.
-## Multica를 사용하는 세 가지 방법
+## 커뮤니티에 참여하세요
-처음 두 카드는 **백엔드 선택지** — Multica 서버가 어디에서 실행되는지를 정합니다. 세 번째는 **클라이언트 선택지** — 어떤 인터페이스를 사용할지를 정합니다. 데스크톱 앱은 두 백엔드 중 어느 쪽과도 함께 사용할 수 있습니다.
+문제가 있거나 제품을 제안하고 싶거나 Multica에 기여하고 싶다면 다음 채널에서 만날 수 있습니다.
-<NumberedCards>
- <NumberedCard number="01" title="Multica Cloud" href="/cloud-quickstart" tag="대기 명단">
- 관리형 백엔드. CLI를 설치하고 로컬에서 데몬을 실행한 뒤, Multica가 호스팅하는 서버에 연결합니다. 약 5분이면 됩니다.
- </NumberedCard>
- <NumberedCard number="02" title="자체 호스팅" href="/self-host-quickstart" tag="Docker · Helm">
- Docker Compose로 자신의 서버에서 전체 백엔드를 실행합니다. 데이터베이스, 서버, 스토리지가 모두 자신의 인프라에 위치합니다.
- </NumberedCard>
- <NumberedCard number="03" title="데스크톱 앱" href="/desktop-app" tag="추천">
- 네이티브 멀티탭 창. CLI가 내장되어 있고 실행 시 데몬을 자동으로 시작합니다 — 설치 후 실행할 명령이 전혀 없습니다. Multica Cloud 또는 자체 호스팅 백엔드에 연결합니다.
- </NumberedCard>
-</NumberedCards>
-
-## 다음 단계
-
-<NumberedSteps>
- <Step number="01" title="런타임 모델부터 이해하기">
- [Multica는 어떻게 작동하나요](/how-multica-works) — 30초면 읽을 수 있으며, "서버는 에이전트를 실행하지 않고 에이전트는 사용자의 기기에서 실행된다"는 점을 확실히 짚어줍니다.
- </Step>
- <Step number="02" title="시작할 방법 고르기">
- 위의 세 가지 중 하나를 선택하세요 — 대부분은 [데스크톱 앱](/desktop-app)으로 시작합니다. CLI 설정이 필요 없고 5분이면 실행됩니다.
- </Step>
- <Step number="03" title="첫 이슈 할당하기">
- [이슈](/issues)를 만들고 담당자로 동료 대신 에이전트를 선택하세요. 에이전트가 결과를 가져올 때까지 기다리면 됩니다.
- </Step>
-</NumberedSteps>
+<CommunityLinks
+ discordDescription="팀 및 다른 사용자와 소통하세요."
+ githubDescription="문제를 신고하고, 기능을 제안하거나, 개발에 기여하세요."
+ xDescription="제품 업데이트와 출시 소식을 확인하세요."
+/>
diff --git a/apps/docs/content/docs/index.mdx b/apps/docs/content/docs/index.mdx
index 1a765a6f4e..9a0485fb26 100644
--- a/apps/docs/content/docs/index.mdx
+++ b/apps/docs/content/docs/index.mdx
@@ -1,50 +1,36 @@
---
title: Welcome
-description: A task collaboration platform — humans and AI agents working together in the same workspace.
---
-import { Callout } from "fumadocs-ui/components/callout";
+## What Multica can do
-Multica is a task collaboration platform where humans and AI [agents](/agents) work together in the same [workspace](/workspaces). You can [assign an issue to an agent](/assigning-issues) the way you'd hand work to a teammate — it executes the work, reports progress, and replies in the comments. You can also [open a chat window and talk to it directly](/chat), asking it to draft an issue, answer a question, or handle a one-off request.
+- **Hand work to agents** — assign an issue the way you would to a teammate; the agent posts progress and delivers results.
+- **Share all context** — discussions, records, and deliverables stay in the workspace, visible to the whole team at any time.
+- **Let work run itself** — set up scheduled runs and let multiple agents collaborate automatically.
+- **Capture team know-how** — save what works as a skill that every agent can reuse.
-This page explains where agents run and the ways you can start using Multica.
+![Workspace board: human members and multiple agents driving work forward together](/images/docs/workspace-overview.png)
-## Where agents run
+## Where to start
-Agents do **not** execute tasks on Multica's servers. Multica currently supports one runtime model:
+- **[Complete your first run](/cloud-quickstart)** — create an agent, hand it its first task, and see the result come back.
+- **[Core concepts](/concepts)** — meet all of Multica's core objects and how they relate, in three minutes.
+- **[Self-host Multica](/self-host-quickstart)** — deploy Multica on your own infrastructure.
-- **Local [daemon](/daemon-runtimes)** — you run `multica daemon` on your own machine, and it drives the [AI coding tools](/providers) installed locally. Seventeen are built in today: [Antigravity](/providers#antigravity), [Claude Code](/providers#claude-code), [CodeBuddy](/providers#codebuddy), [Codex](/providers#codex), [Cursor](/providers#cursor), [Copilot](/providers#copilot), [Hermes](/providers#hermes), [Kimi](/providers#kimi), [Kiro CLI](/providers#kiro-cli), [OpenCode](/providers#opencode), [OpenClaw](/providers#openclaw), [Pi](/providers#pi), [Qoder](/providers#qoder), [Trae CLI](/providers#trae), [DevEco Code](/providers#deveco-code), [Grok](/providers#grok), [Qwen Code](/providers#qwen-code). Your API keys, toolchain, and code directories stay on your machine.
+## Most-visited pages
-<Callout type="info">
-**Cloud runtimes are coming**, currently waitlist-only. Once live, you won't need a local daemon — agent tasks will execute on Multica Cloud directly. Sign up on the [Downloads](https://multica.ai/download) page to get notified.
-</Callout>
+- [Get agents working](/triggering-agents) — the four ways to trigger an agent.
+- [Create and configure agents](/agents-create) — create your first agent from blank or with AI.
+- [Install AI coding tools](/install-agent-runtime) — give your computer the ability to execute.
+- [Tasks](/tasks) — read the status, retries, and logs of every run.
+- [Troubleshooting](/troubleshooting) — agent not moving? Start here.
-## Three ways to use Multica
+## Community
-The first two cards are **backend choices** — where the Multica server runs. The third is a **client choice** — which interface you use. The desktop app pairs with either backend.
+Questions, product suggestions, or interest in contributing to Multica — reach us through these channels:
-<NumberedCards>
- <NumberedCard number="01" title="Multica Cloud" href="/cloud-quickstart" tag="Waitlist">
- Managed backend. Install the CLI, run the daemon locally, and connect to the Multica-hosted server. Takes about 5 minutes.
- </NumberedCard>
- <NumberedCard number="02" title="Self-host" href="/self-host-quickstart" tag="Docker · Helm">
- Run the full backend on your own server with Docker Compose. Database, server, and storage all live on your infrastructure.
- </NumberedCard>
- <NumberedCard number="03" title="Desktop app" href="/desktop-app" tag="Recommended">
- Native multi-tab window. Ships with the CLI built in and starts the daemon on launch — zero commands to run after install. Connects to Multica Cloud or your self-hosted backend.
- </NumberedCard>
-</NumberedCards>
-
-## Next steps
-
-<NumberedSteps>
- <Step number="01" title="Start with the runtime model">
- [How Multica works](/how-multica-works) — 30 seconds to read, and it settles the "server doesn't run agents, agents run on your machine" point once and for all.
- </Step>
- <Step number="02" title="Pick a way to start">
- Choose one of the three above — most people start with the [desktop app](/desktop-app). No CLI setup, up and running in 5 minutes.
- </Step>
- <Step number="03" title="Assign your first issue">
- Create an [issue](/issues) and pick an agent as the assignee instead of a teammate. Wait for it to deliver.
- </Step>
-</NumberedSteps>
+<CommunityLinks
+ discordDescription="Chat with the team and other users."
+ githubDescription="Report issues, request features, or contribute."
+ xDescription="Follow product updates and release news."
+/>
diff --git a/apps/docs/content/docs/index.zh.mdx b/apps/docs/content/docs/index.zh.mdx
index f3dc4317a5..a2f71d7a12 100644
--- a/apps/docs/content/docs/index.zh.mdx
+++ b/apps/docs/content/docs/index.zh.mdx
@@ -1,52 +1,42 @@
---
title: 欢迎
-description: 一个任务协作平台——人类和 AI 智能体在同一个工作区里共同工作。
---
-import { Callout } from "fumadocs-ui/components/callout";
+## Multica 能做什么
-Multica 是一个任务协作平台,让人类和 AI [智能体](/agents) 在同一个 [工作区](/workspaces) 里共同工作。你可以像给同事派活一样,[把一个任务分配给智能体](/assigning-issues) ——由它去执行、汇报进展、在评论里回复你;也可以[打开聊天窗口直接和它对话](/chat),让它帮你起草任务、回答问题、或完成一次性请求。
+- **把工作交给智能体**:像分配给同事一样分配 issue,它会更新进度、提交结果。
+- **共享全部上下文**:讨论、记录和产出都留在工作区,团队成员随时可见。
+- **让工作自动运转**:设置定时任务,让多个智能体自动协作。
+- **沉淀团队经验**:把有效的做法存成 skill,供所有智能体复用。
-<VideoEmbed provider="bilibili" id="BV1cv7Y6gEg7" title="Multica 中文介绍视频" />
+![工作区看板:人类成员与多个智能体共同推进工作](/images/docs/workspace-overview.png)
-这一页讲清楚智能体在哪里运行,以及你有哪几种方式开始使用 Multica。
+## 从这里开始
-## 智能体在哪里运行
+- **[完成第一次运行](/cloud-quickstart)** — 创建智能体,把第一个任务交给它,并查看返回的结果。
+- **[核心概念](/concepts)** — 三分钟认识 Multica 的全部核心对象和它们的关系。
+- **[自托管 Multica](/self-host-quickstart)** — 在自己的基础设施上部署 Multica。
-智能体执行任务**不**发生在 Multica 服务器上。目前 Multica 支持一种运行方式:
+## 最常打开的页面
-- **本地 [守护进程](/daemon-runtimes)** — 你在自己的机器上运行 `multica daemon`,由它调用本地安装的 [AI 编程工具](/providers)。目前内置 16 款:[Antigravity](/providers#antigravity)、[Claude Code](/providers#claude-code)、[CodeBuddy](/providers#codebuddy)、[Codex](/providers#codex)、[Cursor](/providers#cursor)、[Copilot](/providers#copilot)、[Hermes](/providers#hermes)、[Kimi](/providers#kimi)、[Kiro CLI](/providers#kiro-cli)、[OpenCode](/providers#opencode)、[OpenClaw](/providers#openclaw)、[Pi](/providers#pi)、[Qoder](/providers#qoder)、[Trae CLI](/providers#trae)、[DevEco Code](/providers#deveco-code)、[Grok](/providers#grok)。你的 API 密钥、工具链、代码目录都保留在本地。
+- [让智能体开始工作](/triggering-agents) — 触发智能体的四种方式。
+- [创建和配置智能体](/agents-create) — 从空白或用 AI 创建你的第一个智能体。
+- [安装 AI 编程工具](/install-agent-runtime) — 让你的电脑具备执行能力。
+- [执行任务](/tasks) — 看懂每一次执行的状态、重试和日志。
+- [故障排查](/troubleshooting) — 智能体不动了?从这里定位。
-<Callout type="info">
-**云端运行时即将开放**,目前处于等待名单阶段。上线后,你无需在本地运行守护进程,即可在 Multica Cloud 上直接执行智能体任务。在 [下载页面](https://multica.ai/download) 登记邮箱以获取通知。
-</Callout>
+## 看一段演示
-## 三种使用方式
+如果你更习惯先看演示,可以从这段中文视频开始。
-前两张卡是**后端选择**——Multica 服务器运行在哪里;第三张是**客户端选择**——你从哪个界面使用。桌面应用可以搭配前两种后端中的任意一种。
+<VideoEmbed provider="bilibili" id="BV1cv7Y6gEg7" title="Multica 中文介绍视频" />
-<NumberedCards>
- <NumberedCard number="01" title="Multica Cloud" href="/cloud-quickstart" tag="等待名单">
- 托管后端。安装命令行工具并在本地运行守护进程,连接到 Multica 托管的服务器。约 5 分钟完成。
- </NumberedCard>
- <NumberedCard number="02" title="自部署" href="/self-host-quickstart" tag="Docker · Helm">
- 用 Docker Compose 在自己的服务器上运行完整后端。数据库、服务器、存储都在你自己的基础设施上。
- </NumberedCard>
- <NumberedCard number="03" title="桌面应用" href="/desktop-app" tag="推荐">
- 原生多标签窗口。内置命令行工具并在启动时自动拉起守护进程——安装后无需运行任何命令即可使用。可连接 Multica Cloud 或你自部署的后端。
- </NumberedCard>
-</NumberedCards>
+## 和我们交流
-## 下一步
+遇到问题、有产品建议,或者想参与 Multica,可以通过这些渠道找到我们:
-<NumberedSteps>
- <Step number="01" title="先理解运行模型">
- [Multica 是怎么工作的](/how-multica-works) — 30 秒读完,把"server 不跑 agent,agent 跑在你本地"这件事一次讲透。
- </Step>
- <Step number="02" title="挑一种使用方式开始">
- 上面三种里选一种——大多数人从 [桌面应用](/desktop-app) 起步,零命令行配置,5 分钟跑起来。
- </Step>
- <Step number="03" title="派出第一个任务">
- 创建一个 [Issue](/issues),把执行人选成智能体而不是同事。等它来交活。
- </Step>
-</NumberedSteps>
+<CommunityLinks
+ discordDescription="和团队及其他用户交流。"
+ githubDescription="提交问题、提出功能建议或参与贡献。"
+ xDescription="关注产品更新和发布动态。"
+/>
diff --git a/apps/docs/content/docs/install-agent-runtime.ja.mdx b/apps/docs/content/docs/install-agent-runtime.ja.mdx
index 09ce6fb904..862a1457f2 100644
--- a/apps/docs/content/docs/install-agent-runtime.ja.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.ja.mdx
@@ -1,222 +1,106 @@
---
-title: エージェントランタイムをインストールする
-description: Multica はあなたのマシンにインストールされている AI コーディングツールを駆動します。このページでは、デーモンがそれらを検出できるように、サポートされている 16 種のツールをそれぞれインストールする方法を説明します。
+title: AI コーディングツールをインストールする
+description: 対応する AI コーディングツールをインストールしてログインし、Multica がローカル環境でタスクを実行できるようにします。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica における**ランタイム**とは、あなたのマシンのデーモンと、デーモンが `PATH` で見つけた AI コーディングツール 1 つが組になったものです。オンボーディングの「ランタイムを接続」ステップで **No supported tools detected** と表示される場合、それはデーモンが `PATH` をスキャンしたものの、駆動方法を知っている 16 種のツールのいずれも見つけられなかったことを意味します。以下のツールのいずれか(または複数)をインストールしてから、そのステップに戻って再スキャンしてください — 数秒以内にランタイムが表示されます。
+ローカルランタイムは、Multica デーモンと、デーモンが呼び出せる AI コーディングツールの 2 つで構成されます。使用するツールだけをインストールすればよく、すべてをインストールする必要はありません。
-このページは次のドキュメントのインストール側の補完ドキュメントです。
+## 1. ツールを選ぶ
-- [デーモンとランタイム](/daemon-runtimes) — 検出の仕組み
-- [AI コーディングツールマトリクス](/providers) — 各ツールができることとできないこと(セッション再開、MCP、モデル選択)
+すでにインストールしてログイン済みのツールには、追加設定は不要です。モデル、MCP、セッション再開、スキルの対応状況はツールごとに異なります。詳しくは [AI コーディングツール比較](/providers)を参照してください。
-<Callout type="info">
-Multica サーバーがあなたの API キーやツール自体を見ることは決してありません。以下のすべて — インストール、認証、モデルアクセス — はあなたのローカルマシン上に存在します。何かが失敗する場合、それはほぼ常にローカルの問題です。
-</Callout>
-
-## 始める前に
-
-以下の**すべての**ツールに 2 つの前提条件が適用されます。
-
-1. **Multica デーモンが実行中である必要があります。** [Multica CLI](/cli) をインストールした後に `multica daemon start` を実行するか、デーモンを自動的に起動する [Multica デスクトップアプリ](/desktop-app)を使用してください。デーモンが実行されていなければ、ツールを検出する主体がありません。
-2. **ツールのバイナリが `PATH` で到達可能である必要があります。** デーモンは各ツールを名前で呼び出して実行します(各セクションの**デーモンが探す名前**の列を参照)。ターミナルで `which <name>` で見つからなければ、デーモンも見つけられません。インストール後は、新しいターミナルを開く(またはデーモンを再起動する)ことで、新しい `PATH` エントリが反映されるようにしてください。
-
-ツールをインストールした後は、デーモンを再起動してください。
-
-```bash
-multica daemon restart
-```
-
-または、デスクトップアプリではアプリを再起動するだけで構いません。デーモンは起動するたびに `PATH` を再スキャンします。
-
-## サポートされている 16 種のツール
-
-おおよそ利用者の多い順に並べています。すでに認証情報を持っているものを選んで使ってください — 16 種すべてをインストールする必要はありません。
-
-### Claude Code (Anthropic)
-
-最も完全な連携です。セッション再開が動作し、MCP が動作し、エージェントの `mcp_config` フィールドを消費します(詳しくは[マトリクス](/providers)を参照)。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `claude` |
-| インストール | [claude.com/claude-code](https://www.claude.com/claude-code) の公式ガイドに従ってください。標準的な方法は npm パッケージ `@anthropic-ai/claude-code` です(Node.js 18+ が必要)。 |
-| 認証 | `claude` を一度実行して CLI 内のログイン手順に従うか、`ANTHROPIC_API_KEY` を設定してください。 |
-| 備考 | 新しいユーザーに最初に推奨する選択肢です。 |
-
-### Codex (OpenAI)
-
-よりきめ細かい承認ゲートを備えた JSON-RPC 2.0 のトランスポートです。**セッション再開は動作します** — Multica は Codex app-server の `thread/resume` で再開し、古いまたは存在しない thread では新しい thread にフォールバックします。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `codex` |
-| インストール | [github.com/openai/codex](https://github.com/openai/codex) の公式ガイドに従ってください。標準的な方法は npm パッケージ `@openai/codex` です。 |
-| 認証 | `codex login`(ブラウザベース)または `OPENAI_API_KEY`。 |
-
-### Cursor (Anysphere)
-
-Cursor エディタに対応する CLI です。**セッション再開は動作します** — 現在の Cursor Agent は stream-json イベントで `session_id` を返し、Multica は次回実行時に `--resume <id>` でそれを渡します。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `cursor-agent` |
-| インストール | [Cursor エディタ](https://cursor.com/)をインストールしてから、[docs.cursor.com](https://docs.cursor.com/) のドキュメントに従って CLI をインストールしてください。バイナリ名は `cursor` ではなく `cursor-agent` です。 |
-| 認証 | Cursor エディタを通じてログインすると、CLI がそのセッションを再利用します。 |
-
-### GitHub Copilot
-
-モデルのルーティングはあなたの GitHub アカウントのエンタイトルメント(entitlement)を通じて行われます — ツールが自分でモデルを選ぶのではなく、どのモデルを受け取るかは GitHub が決めます。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `copilot` |
-| インストール | GitHub の CLI ドキュメント [github.com/github/copilot-cli](https://github.com/github/copilot-cli) を参照してください。 |
-| 認証 | CLI を通じたブラウザベースの GitHub ログイン。 |
-| 備考 | ログインしているアカウントに有効な GitHub Copilot サブスクリプションが必要です。 |
-
-### OpenCode (SST)
+Multica は現在、次のコマンドを検出します。
-オープンソースの CLI エージェントです。独自の設定ファイルから利用可能なモデルを動的に発見します — 自分のモデルカタログを持ち込みたいユーザーによく合います。
+| ツール | 検出するコマンド | 公式インストールガイド |
+| --- | --- | --- |
+| Antigravity CLI | `agy` | [Antigravity のインストールとログイン](https://antigravity.google/docs/cli-install) |
+| Claude Code | `claude` | [Claude Code クイックスタート](https://code.claude.com/docs/en/quickstart) |
+| CodeBuddy Code | `codebuddy` | [CodeBuddy クイックスタート](https://www.codebuddy.ai/docs/cli/quickstart) |
+| Codex CLI | `codex` | [Codex CLI](https://developers.openai.com/codex/cli/) |
+| GitHub Copilot CLI | `copilot` | [Copilot CLI のインストール](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) |
+| Cursor Agent | `cursor-agent` | [Cursor CLI のインストール](https://docs.cursor.com/en/cli/installation) |
+| DevEco Code | `deveco` | [DevEco Code](https://gitcode.com/openharmony-sig/deveco-code) |
+| Grok Build | `grok` | [Grok Build クイックスタート](https://docs.x.ai/build/overview) |
+| Hermes Agent | `hermes` | [Hermes クイックスタート](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) |
+| Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
+| Kiro CLI | `kiro-cli` | [Kiro CLI のインストール](https://kiro.dev/docs/cli/installation/) |
+| OpenClaw | `openclaw` | [OpenClaw のインストール](https://docs.openclaw.ai/install) |
+| OpenCode | `opencode` | [OpenCode クイックスタート](https://opencode.ai/en/docs) |
+| Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |
+| Qoder CLI | `qodercli` | [Qoder CLI クイックスタート](https://docs.qoder.com/en/cli/quick-start) |
+| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
+| TRAE CLI | `traecli` | [TRAE 公式サイト](https://www.trae.cn/) |
-| | |
-|---|---|
-| デーモンが探す名前 | `opencode` |
-| インストール | [opencode.ai](https://opencode.ai/) の公式ガイド、または GitHub リポジトリ [github.com/sst/opencode](https://github.com/sst/opencode) に従ってください。一般的な方法はインストールスクリプトまたは npm パッケージです。 |
-| 認証 | OpenCode のドキュメントに従ってモデルプロバイダー(Anthropic、OpenAI など)を構成してください。 |
+ここでの「対応」とは、Multica が該当する CLI を呼び出せるという意味です。そのツールのアカウント、サブスクリプション、モデルの利用枠を Multica が提供するわけではありません。
-### DevEco Code (Huawei)
+## 2. ローカル環境でログインする
-**DevEco Code** は Huawei の HarmonyOS 開発向け独立コーディングエージェントで、OpenCode エンジンをベースに構築されています。独自のモデルカタログと Huawei アカウント認証を備えます。Multica は `deveco run --format json` で駆動し、モデルは `deveco models` から動的に探索されます(内蔵 `deveco/GLM-5.1`)。MCP サーバーは DevEco ネイティブ設定(`DEVECO_CONFIG_CONTENT`)で行います。Multica 側の `mcp_config` 連携は開発中です。
+インストール後、まずターミナルからツールを単独で起動し、各ツールの手順に従ってログインするか、モデルプロバイダーを設定してください。ターミナル上でリクエストを実行できない場合は、デーモンから呼び出しても失敗します。
-| | |
-|---|---|
-| デーモンが探す名前 | `deveco` |
-| インストール | `npm install -g @deveco/deveco-code`。公式 README [gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code/blob/develop/README.en.md) または npm ページ [npmjs.com/package/@deveco/deveco-code](https://www.npmjs.com/package/@deveco/deveco-code) を参照してください。 |
-| 対応プラットフォーム | Windows x64 と macOS(arm64/x64)のみ。Linux ビルドは提供されていません。 |
-| 認証 | DevEco CLI 経由の Huawei アカウントログイン。 |
+ログイン情報はツールがローカル環境に保存します。Multica が Claude、Codex、Cursor などの CLI のログイントークンを受け取ることはありません。
-### Kiro CLI (Amazon)
-
-ACP-over-stdio のトランスポートです。セッション再開は ACP `session/load` を通じて動作し、スキルは `.kiro/skills/` にコピーされます。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `kiro-cli` |
-| インストール | [kiro.dev](https://kiro.dev/) の Kiro ドキュメントを参照してください。バイナリ名は `kiro` ではなく `kiro-cli` です。 |
-| 認証 | AWS アカウントベースで、Kiro 独自のオンボーディングに従ってください。 |
-
-### Kimi (Moonshot)
-
-ACP プロトコルのエージェントで、主に中国市場を対象としています。スキルは `.kimi/skills/` 配下に置かれます(ネイティブ発見)。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `kimi` |
-| インストール | [github.com/MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli) の公式ガイドに従ってください。 |
-| 認証 | Moonshot API キーで、ベンダーのドキュメントに従って構成します。 |
-
-### Hermes (Nous Research)
-
-ACP プロトコルのエージェントです(Kimi とトランスポートを共有)。セッション再開が動作します。スキル注入のパスは汎用の `.agent_context/skills/` にフォールバックします — 依存する前に、スキルが正しくロードされているか確認してください。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `hermes` |
-| インストール | 最新の CLI ディストリビューションは Nous Research のリポジトリ [github.com/NousResearch](https://github.com/NousResearch) を参照してください。 |
-| 認証 | ベンダーのドキュメントに従います。 |
-
-### OpenClaw
-
-オープンソースの CLI エージェントオーケストレーターです。**モデルはエージェント層にバインドされます**(`openclaw agents add --model`) — タスクごとに上書きすることはできず、Multica から `--model` や `--system-prompt` を渡すこともできません。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `openclaw` |
-| インストール | プロジェクト [github.com/openclaw-org/openclaw](https://github.com/openclaw-org/openclaw) を参照してください(コミュニティによる保守)。 |
-| 認証 | OpenClaw のドキュメントに従って、基盤となるモデルプロバイダーを構成してください。 |
-
-### Pi (Inflection AI)
-
-ミニマルです。**セッション再開の方式が特殊です** — 再開 id が文字列 id ではなく、ディスク上のセッションファイルへのパスです。
-
-| | |
-|---|---|
-| デーモンが探す名前 | `pi` |
-| インストール | Inflection の CLI ドキュメント [pi.ai](https://pi.ai/) を参照してください。 |
-| 認証 | ベンダーのドキュメントに従います。 |
-
-### CodeBuddy (Tencent)
+<Callout type="info">
+Claude Code は 2.0.0 以降、Codex は 0.100.0 以降、Copilot は 1.0.0 以降、Grok は 0.2.89 以降、Qwen Code は 0.20.0 以降が必要です。最低バージョンを満たしていない場合、デーモンはそのランタイムを登録しません。
+</Callout>
-Claude Code 互換の CLI エージェントです。Multica は Claude Code と同じ stream-json プロトコルで駆動します: セッション再開は `--resume` で動作し、MCP 構成は `--mcp-config` で渡されます。CodeBuddy は Claude のディレクトリを再利用せず独自の設定ディレクトリを使うため、スキルは `.codebuddy/skills/` に配置され、ランタイムのブリーフは `CODEBUDDY.md` に書き込まれます。モデルは動的に探索されます。
+## 3. デーモンからコマンドを見つけられることを確認する
-| | |
-|---|---|
-| デーモンが探す名前 | `codebuddy` |
-| インストール | 公式 CLI ドキュメント [codebuddy.ai/cli](https://www.codebuddy.ai/cli) を参照してください。 |
-| 認証 | ベンダーのドキュメントに従います。 |
+macOS、Linux、WSL では、次を実行します。
-### Qoder (Alibaba)
+```bash
+command -v <command>
+<command> --version
+```
-stdio 上で ACP プロトコルを使用するエージェント型のコーディング CLI です(Hermes、Kimi、Kiro CLI とトランスポートを共有します)。セッション再開は ACP `session/resume` を通じて動作し、MCP 構成は ACP `mcpServers` として渡され、モデル選択は動的に探索され、スキルは `.qoder/skills/` にコピーされます。
+Windows PowerShell では、次を実行します。
-| | |
-|---|---|
-| デーモンが探す名前 | `qodercli` |
-| インストール | 公式 CLI ドキュメント [qoder.com/cli](https://qoder.com/cli) を参照してください。 |
-| 認証 | ベンダーのドキュメントに従います。 |
+```powershell
+Get-Command <command>
+<command> --version
+```
-### Trae CLI (ByteDance)
+`<command>` は表にあるコマンド名に置き換えてください。たとえば `claude`、`codex`、`cursor-agent` です。最初のコマンドで実行ファイルのパスが返れば、検出できています。
-ByteDance 公式の TRAE CLI(`traecli`、Trae IDE と組み合わせて使う製品で、**オープンソースの `bytedance/trae-agent` ではありません**)です。ACP ネイティブのため、Multica は stdio 上で `traecli acp serve --yolo` を通じて駆動し、Hermes、Kimi、Kiro CLI、Qoder とトランスポートを共有します。セッション再開は ACP `session/load`、MCP 構成は ACP `mcpServers`、モデル選択は動的探索で動作し、スキルは `.traecli/skills/` にコピーされます。
+ターミナルではツールを見つけられるのに、Desktop やバックグラウンドのデーモンでは見つからない場合、両者が異なる `PATH` を使っていることが一般的な原因です。アプリを再起動するか、対応する `MULTICA_<PROVIDER>_PATH` 環境変数で絶対パスを指定してください。設定の詳細は[環境変数](/environment-variables#デーモン設定)を参照してください。
-| | |
-|---|---|
-| デーモンが探す名前 | `traecli` |
-| インストール | 公式 CLI ドキュメント [docs.trae.cn/cli](https://docs.trae.cn/cli) を参照してください。 |
-| 認証 | `traecli` を一度対話的に実行してブラウザベースの企業ログインを完了してください。Trae IDE へのログインと CLI へのログインは別です。 |
+## 4. 再検出してオンライン状態を確認する
-### Antigravity (Google)
+CLI でデーモンを起動します。
-Google の Antigravity CLI(`agy`)です。Google の Antigravity サービスと組になり、Gemini ベースのモデルを実行します。セッション再開は `--conversation <id>` を通じて動作し、デーモンが CLI のログファイルからこれをキャプチャします。モデル選択は Antigravity CLI 自体の内部で管理されます — Multica はこのプロバイダーに対してエージェントごとのモデルピッカーを無効にします。スキルは `.agents/skills/` に書き込まれます(CLI が Gemini CLI のワークスペーススキルレイアウトを継承します — [Antigravity ドキュメント](https://antigravity.google/docs/gcli-migration)を参照)。
+```bash
+multica daemon start
+```
-| | |
-|---|---|
-| デーモンが探す名前 | `agy` |
-| インストール | [antigravity.google/docs/cli-overview](https://antigravity.google/docs/cli-overview) の公式ガイドに従ってください。CLI はあらかじめビルドされて提供されます — `agy install` を一度実行して PATH とシェルエイリアスを設定してください。 |
-| 認証 | `agy` を対話的に一度実行して Google アカウントのログインを完了するか、Antigravity デスクトップアプリを通じてログインしてください — CLI は GUI が書き込んだ keyring エントリを再利用します。 |
-| 備考 | CLI は構造化されたイベントストリームではなく、stdout に通常のアシスタントテキストを出力します。途中の「I will run X」の行と最終的な応答の両方がテキストとして Multica に中継されます。 |
+デーモンがすでに実行中の場合は、新しいツールをインストールした後に再起動します。
-### Grok (xAI)
+```bash
+multica daemon restart
+```
-xAI の Grok Build CLI(`grok`)です。Multica は `grok --no-auto-update agent --always-approve stdio` で ACP 接続し、`initialize` 後に CLI が提示した認証方式を選んで `authenticate` を完了してからセッションを作成します。セッション再開は ACP `session/load`、モデル検出は `session/new`、MCP は ACP `mcpServers` で動作します。スキルは `.grok/skills/` にコピーされ、ユーザーのスキルは `$GROK_HOME/skills/`(既定は `~/.grok/skills/`)または共通の `~/.agents/skills/` から検出されます。
+Multica Desktop を使っている場合は、アプリを終了して開き直してください。
-| | |
-|---|---|
-| デーモンが探す名前 | `grok` |
-| インストール | Grok Build CLI をインストールし、`grok` を `PATH` に追加してください(通常は `~/.grok/bin`)。 |
-| 認証 | `grok login` を実行するか、`XAI_API_KEY` を設定してください。ACP が提示した対応方式がない場合、Multica はセッション作成前に明示的に失敗します。 |
-| 備考 | バイナリは `MULTICA_GROK_PATH`、既定モデルは `MULTICA_GROK_MODEL` で上書きできます。最小 CLI バージョンは `0.2.89` です。 |
+次に Multica の**ランタイム**ページを開きます。対象のコンピューターの下にツールが表示され、オンライン状態になっていることを確認してください。これで、エージェントを作成または編集するときにこのランタイムを選択できます。
-## インストールした後
+<Callout type="warning">
+デーモンの起動時には、標準対応している CLI が少なくとも 1 つ検出される必要があります。カスタムランタイム設定はデーモンの起動後に同期されるため、ツールが何もないコンピューターで唯一の起動条件として使うことはできません。
+</Callout>
-1. **バイナリが `PATH` にあるか確認してください。** 新しいターミナルを開いて `which <name>`(例: `which claude`、`which cursor-agent`、`which kiro-cli`、`which agy`)を実行してください。パスが出力されれば、デーモンが見つけられます。何も出力されない場合は、まずシェルの `PATH` を修正してください(典型的な原因は、リロードされていないシェルごとの rc ファイルです)。
-2. **デーモンを再起動してください。** `multica daemon restart` を実行するか、デスクトップアプリを再起動してください。デーモンは起動時にのみ `PATH` をスキャンします。
-3. **ランタイムページを確認してください。** Multica UI の**ランタイム**ページに、`(ワークスペース × ツール)` の組み合わせごとに 1 行ずつ表示されるはずです。行に「offline」と表示される場合は、[デーモンとランタイム → ランタイムがオフラインと表示されるとき](/daemon-runtimes#when-a-runtime-is-marked-offline)を参照してください。
-4. **オンボーディングに戻ってください。** 「ランタイムを接続」ステップはポーリングを行い、数秒以内に新しいランタイムを認識します — リロードは不要です。
+## ツールが検出されない場合
-## トラブルシューティング
+次の順番で確認してください。
-- **`which` はバイナリを見つけるのにデーモンは見つけません。** デーモンが古い `PATH` で起動されています。再起動してください。
-- **バイナリは存在するのに起動に失敗します。** ターミナルからツール自体の `--version` や `--help` を一度実行してください — ここで発生する失敗のほとんどは、認証の欠落、期限切れのトークン、または Node.js / ランタイムの不一致です。
-- **ランタイムページに行は表示されるのに、タスクがすぐに失敗します。** タスクをトリガーしながら `multica daemon logs -f` を確認してください。デーモンはツール自体のエラー出力をそのまま表示します。
+1. ターミナルからツール自体を実行し、インストールとログインが完了していることを確認します。
+2. `command -v` または `Get-Command` で、実際のコマンド名とパスを確認します。
+3. `multica daemon logs -f` を実行し、バージョン、パス、認証に関するエラーを確認します。
+4. デーモンを再起動し、現在の環境を読み込み直します。
+5. **ランタイム**ページに戻り、コンピューターとツールがどちらもオンラインであることを確認します。
-より広範な症状については、[トラブルシューティングガイド](/troubleshooting)を参照してください。
+ツールがオンラインと表示されているのに実行が失敗する場合は、イシューの実行ログで CLI が返した具体的なエラーを確認するか、[トラブルシューティング](/troubleshooting)を参照してください。
-## 次に
+## 次のステップ
-- [デーモンとランタイム](/daemon-runtimes) — 検出、ハートビート、オフライン処理の仕組み
-- [AI コーディングツールマトリクス](/providers) — ツールが接続された後の機能差
-- [エージェントの作成と構成](/agents-create) — エージェントに使うツールを選び、タスクの実行を開始する
+- [エージェントを作成・設定する](/agents-create) — 接続したランタイムを選択する
+- [デーモンとランタイム](/daemon-runtimes) — オンライン状態、同時実行、カスタムランタイムについて確認する
+- [AI コーディングツール比較](/providers) — Multica で使える機能をツールごとに比較する
diff --git a/apps/docs/content/docs/install-agent-runtime.ko.mdx b/apps/docs/content/docs/install-agent-runtime.ko.mdx
index 28ac1d1c9e..14b37e18ab 100644
--- a/apps/docs/content/docs/install-agent-runtime.ko.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.ko.mdx
@@ -1,222 +1,106 @@
---
-title: 에이전트 런타임 설치하기
-description: Multica는 사용자 기기에 설치된 AI 코딩 도구를 구동합니다. 이 페이지에서는 데몬이 도구를 감지할 수 있도록 지원되는 16종의 도구를 각각 설치하는 방법을 설명합니다.
+title: AI 코딩 도구 설치
+description: 지원되는 AI 코딩 도구를 설치하고 로그인해 Multica가 로컬에서 태스크를 실행하게 합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica에서 **런타임**이란 사용자 기기의 데몬과, 데몬이 `PATH`에서 찾아낸 AI 코딩 도구 하나가 짝을 이룬 것입니다. 온보딩의 "런타임 연결" 단계에서 **지원되는 도구를 감지하지 못했습니다**라고 표시된다면, 데몬이 `PATH`를 스캔했지만 구동 방법을 아는 16종의 도구 중 어느 것도 찾지 못했다는 뜻입니다. 아래 도구 중 하나(또는 여러 개)를 설치한 다음 해당 단계로 돌아와 다시 스캔하세요. 몇 초 안에 런타임이 나타납니다.
+로컬 런타임은 Multica 데몬과 데몬이 호출할 수 있는 AI 코딩 도구 하나, 두 부분으로 구성됩니다. 사용할 도구만 설치하면 되며 모든 도구를 설치할 필요는 없습니다.
-이 페이지는 다음 문서의 설치 측면 동반 문서입니다.
+## 1. 도구 선택
-- [데몬과 런타임](/daemon-runtimes) — 감지가 작동하는 방식
-- [AI 코딩 도구 매트릭스](/providers) — 각 도구가 할 수 있는 것과 할 수 없는 것(세션 재개, MCP, 모델 선택)
+이미 설치되어 로그인된 도구에는 추가 설정이 필요 없습니다. 도구마다 모델, MCP, 세션 복원, 스킬 지원이 다릅니다. 자세한 차이는 [AI 코딩 도구 비교](/providers)를 참고하세요.
-<Callout type="info">
-Multica 서버는 사용자의 API 키나 도구 자체를 결코 보지 못합니다. 아래의 모든 것 — 설치, 인증, 모델 접근 — 은 사용자의 로컬 기기에 존재합니다. 무언가 실패한다면 거의 항상 로컬 문제입니다.
-</Callout>
-
-## 시작하기 전에
-
-아래 **모든** 도구에 두 가지 사전 조건이 적용됩니다.
-
-1. **Multica 데몬이 실행 중이어야 합니다.** [Multica CLI](/cli)를 설치한 후 `multica daemon start`를 실행하거나, 데몬을 자동으로 시작하는 [Multica 데스크톱 앱](/desktop-app)을 사용하세요. 데몬이 실행 중이지 않으면 도구를 감지할 주체가 없습니다.
-2. **도구의 바이너리가 `PATH`에서 접근 가능해야 합니다.** 데몬은 각 도구를 이름으로 호출하여 실행합니다(각 섹션의 **데몬이 찾는 이름** 열 참고). 터미널에서 `which <name>`으로 찾을 수 없다면 데몬도 찾지 못합니다. 설치한 후에는 새 터미널을 열거나(또는 데몬을 재시작하여) 새 `PATH` 항목이 반영되도록 하세요.
-
-도구를 설치한 후에는 데몬을 재시작하세요.
-
-```bash
-multica daemon restart
-```
-
-또는 데스크톱 앱에서는 앱을 다시 실행하기만 하면 됩니다. 데몬은 시작될 때마다 `PATH`를 다시 스캔합니다.
-
-## 지원되는 16종의 도구
-
-대략 많이 쓰이는 순서대로 나열했습니다. 이미 자격 증명을 갖고 있는 것을 골라 사용하세요. 16종을 모두 설치할 필요는 없습니다.
-
-### Claude Code (Anthropic)
-
-가장 완전한 연동입니다. 세션 재개가 작동하고, MCP가 작동하며, 에이전트의 `mcp_config` 필드를 소비합니다(자세한 내용은 [매트릭스](/providers) 참고).
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `claude` |
-| 설치 | [claude.com/claude-code](https://www.claude.com/claude-code)의 공식 가이드를 따르세요. 일반적인 방법은 npm 패키지 `@anthropic-ai/claude-code`입니다(Node.js 18+ 필요). |
-| 인증 | `claude`를 한 번 실행하고 CLI 내 로그인 절차를 따르거나, `ANTHROPIC_API_KEY`를 설정하세요. |
-| 비고 | 새 사용자에게 가장 먼저 권장하는 선택지입니다. |
-
-### Codex (OpenAI)
-
-더 세분화된 승인 게이트를 갖춘 JSON-RPC 2.0 전송 방식입니다. MCP 구성은 작업별 `$CODEX_HOME/config.toml`에 기록됩니다. **세션 재개가 동작합니다** — Multica는 Codex app-server의 `thread/resume`으로 재개하며, 오래되었거나 없는 thread는 새 thread로 폴백합니다.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `codex` |
-| 설치 | [github.com/openai/codex](https://github.com/openai/codex)의 공식 가이드를 따르세요. 일반적인 방법은 npm 패키지 `@openai/codex`입니다. |
-| 인증 | `codex login`(브라우저 기반) 또는 `OPENAI_API_KEY`. |
-
-### Cursor (Anysphere)
-
-Cursor 에디터에 대응하는 CLI입니다. **세션 재개가 동작합니다** — 현재 Cursor Agent는 stream-json 이벤트에서 `session_id`를 반환하고, Multica는 다음 실행 때 이를 `--resume <id>`로 전달합니다.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `cursor-agent` |
-| 설치 | [Cursor 에디터](https://cursor.com/)를 설치한 다음 [docs.cursor.com](https://docs.cursor.com/)의 문서에 따라 CLI를 설치하세요. 바이너리 이름은 `cursor`가 아니라 `cursor-agent`입니다. |
-| 인증 | Cursor 에디터를 통해 로그인하면 CLI가 해당 세션을 재사용합니다. |
-
-### GitHub Copilot
-
-모델 라우팅은 사용자의 GitHub 계정 권한(entitlement)을 통해 이루어집니다 — 도구가 직접 모델을 고르지 않고, 어떤 모델을 받을지는 GitHub가 결정합니다.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `copilot` |
-| 설치 | GitHub의 CLI 문서 [github.com/github/copilot-cli](https://github.com/github/copilot-cli)를 참고하세요. |
-| 인증 | CLI를 통한 브라우저 기반 GitHub 로그인. |
-| 비고 | 로그인한 계정에 활성화된 GitHub Copilot 구독이 필요합니다. |
-
-### OpenCode (SST)
+Multica는 현재 다음 명령을 감지합니다.
-오픈 소스 CLI 에이전트입니다. 자체 설정 파일에서 사용 가능한 모델을 동적으로 발견합니다 — 자신만의 모델 카탈로그를 직접 가져오려는 사용자에게 잘 맞습니다. `OPENCODE_CONFIG_CONTENT`를 통해 에이전트의 `mcp_config` 필드도 소비합니다.
+| 도구 | 감지하는 명령 | 공식 설치 안내 |
+| --- | --- | --- |
+| Antigravity CLI | `agy` | [Antigravity 설치 및 로그인](https://antigravity.google/docs/cli-install) |
+| Claude Code | `claude` | [Claude Code 빠른 시작](https://code.claude.com/docs/en/quickstart) |
+| CodeBuddy Code | `codebuddy` | [CodeBuddy 빠른 시작](https://www.codebuddy.ai/docs/cli/quickstart) |
+| Codex CLI | `codex` | [Codex CLI](https://developers.openai.com/codex/cli/) |
+| GitHub Copilot CLI | `copilot` | [Copilot CLI 설치](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) |
+| Cursor Agent | `cursor-agent` | [Cursor CLI 설치](https://docs.cursor.com/en/cli/installation) |
+| DevEco Code | `deveco` | [DevEco Code](https://gitcode.com/openharmony-sig/deveco-code) |
+| Grok Build | `grok` | [Grok Build 빠른 시작](https://docs.x.ai/build/overview) |
+| Hermes Agent | `hermes` | [Hermes 빠른 시작](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) |
+| Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
+| Kiro CLI | `kiro-cli` | [Kiro CLI 설치](https://kiro.dev/docs/cli/installation/) |
+| OpenClaw | `openclaw` | [OpenClaw 설치](https://docs.openclaw.ai/install) |
+| OpenCode | `opencode` | [OpenCode 빠른 시작](https://opencode.ai/en/docs) |
+| Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |
+| Qoder CLI | `qodercli` | [Qoder CLI 빠른 시작](https://docs.qoder.com/en/cli/quick-start) |
+| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
+| TRAE CLI | `traecli` | [TRAE 공식 사이트](https://www.trae.cn/) |
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `opencode` |
-| 설치 | [opencode.ai](https://opencode.ai/)의 공식 가이드 또는 GitHub 저장소 [github.com/sst/opencode](https://github.com/sst/opencode)를 따르세요. 일반적인 방법은 설치 스크립트 또는 npm 패키지입니다. |
-| 인증 | OpenCode의 문서에 따라 모델 제공자(Anthropic, OpenAI 등)를 구성하세요. |
+"지원됨"은 Multica가 해당 CLI를 호출할 수 있다는 뜻이며 Multica가 도구의 계정, 구독, 모델 사용량을 제공한다는 뜻은 아닙니다.
-### DevEco Code (Huawei)
+## 2. 로컬에서 로그인 완료
-**DevEco Code**는 Huawei의 HarmonyOS 개발용 독립 코딩 에이전트로, OpenCode 엔진을 기반으로 구축되었습니다. 자체 모델 카탈로그와 Huawei 계정 인증을 갖추고 있습니다. Multica는 `deveco run --format json`으로 구동하며, 모델은 `deveco models`에서 동적으로 탐색됩니다(내장 `deveco/GLM-5.1`). MCP 서버는 DevEco 네이티브 설정(`DEVECO_CONFIG_CONTENT`)으로 진행합니다. Multica 측 `mcp_config` 연동은 개발 중입니다.
+설치 후 터미널에서 도구를 한 번 직접 실행하고 도구 자체의 절차에 따라 로그인하거나 모델 서비스를 설정합니다. 터미널에서 요청을 완료하지 못하면 데몬이 호출할 때도 실패합니다.
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `deveco` |
-| 설치 | `npm install -g @deveco/deveco-code`. 공식 README [gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code/blob/develop/README.en.md) 또는 npm 페이지 [npmjs.com/package/@deveco/deveco-code](https://www.npmjs.com/package/@deveco/deveco-code)를 참고하세요. |
-| 지원 플랫폼 | Windows x64 및 macOS(arm64/x64)만 지원하며, Linux 빌드는 제공되지 않습니다. |
-| 인증 | DevEco CLI를 통한 Huawei 계정 로그인. |
+로그인 자격 증명은 도구가 로컬에 저장합니다. Multica는 Claude, Codex, Cursor 또는 다른 CLI의 로그인 token을 받지 않습니다.
-### Kiro CLI (Amazon)
-
-ACP-over-stdio 전송 방식입니다. 세션 재개는 ACP `session/load`를 통해 작동하며, MCP 구성은 ACP `mcpServers`로 전달되고, 스킬은 `.kiro/skills/`로 복사됩니다.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `kiro-cli` |
-| 설치 | [kiro.dev](https://kiro.dev/)의 Kiro 문서를 참고하세요. 바이너리 이름은 `kiro`가 아니라 `kiro-cli`입니다. |
-| 인증 | AWS 계정 기반이며, Kiro 자체 온보딩을 따르세요. |
-
-### Kimi (Moonshot)
-
-ACP 프로토콜 에이전트로, 주로 중국 시장을 겨냥합니다. MCP 구성은 ACP `mcpServers`로 전달되며, 스킬은 `.kimi/skills/` 아래에 위치합니다(네이티브 발견).
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `kimi` |
-| 설치 | [github.com/MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli)의 공식 가이드를 따르세요. |
-| 인증 | Moonshot API 키이며, 공급사 문서에 따라 구성합니다. |
-
-### Hermes (Nous Research)
-
-ACP 프로토콜 에이전트입니다(Kimi와 전송 방식을 공유). 세션 재개가 작동하고, MCP 구성은 ACP `mcpServers`로 전달됩니다. 스킬 주입 경로는 일반적인 `.agent_context/skills/`로 폴백됩니다 — 의존하기 전에 스킬이 제대로 로드되는지 확인하세요.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `hermes` |
-| 설치 | 최신 CLI 배포본은 Nous Research의 저장소 [github.com/NousResearch](https://github.com/NousResearch)를 참고하세요. |
-| 인증 | 공급사 문서에 따릅니다. |
-
-### OpenClaw
-
-오픈 소스 CLI 에이전트 오케스트레이터입니다. MCP 구성은 Multica의 작업별 config wrapper를 통해 기록됩니다. **모델은 에이전트 계층에 바인딩됩니다**(`openclaw agents add --model`) — 작업별로 재정의할 수 없으며, Multica에서 `--model`이나 `--system-prompt`를 전달할 수 없습니다.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `openclaw` |
-| 설치 | 프로젝트 [github.com/openclaw-org/openclaw](https://github.com/openclaw-org/openclaw)를 참고하세요(커뮤니티 유지 관리). |
-| 인증 | OpenClaw의 문서에 따라 기반 모델 제공자를 구성하세요. |
-
-### Pi (Inflection AI)
-
-미니멀합니다. **세션 재개 방식이 특이합니다** — 재개 id가 문자열 id가 아니라 디스크에 있는 세션 파일의 경로입니다.
-
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `pi` |
-| 설치 | Inflection의 CLI 문서 [pi.ai](https://pi.ai/)를 참고하세요. |
-| 인증 | 공급사 문서에 따릅니다. |
-
-### CodeBuddy (Tencent)
+<Callout type="info">
+Claude Code는 2.0.0 이상, Codex는 0.100.0 이상, Copilot은 1.0.0 이상, Grok은 0.2.89 이상, Qwen Code는 0.20.0 이상이 필요합니다. 최소 버전보다 낮으면 데몬이 해당 런타임을 등록하지 않습니다.
+</Callout>
-Claude Code 호환 CLI 에이전트입니다. Multica는 Claude Code와 동일한 stream-json 프로토콜로 구동합니다: 세션 재개는 `--resume`로 동작하고, MCP 구성은 `--mcp-config`로 전달됩니다. CodeBuddy는 Claude의 디렉터리를 재사용하지 않고 자체 설정 디렉터리를 사용하므로, 스킬은 `.codebuddy/skills/`에 배치되고 런타임 브리핑은 `CODEBUDDY.md`에 기록됩니다. 모델은 동적으로 탐색됩니다.
+## 3. 데몬이 명령을 찾을 수 있는지 확인
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `codebuddy` |
-| 설치 | 공식 CLI 문서 [codebuddy.ai/cli](https://www.codebuddy.ai/cli)를 참고하세요. |
-| 인증 | 공급사 문서에 따릅니다. |
+macOS, Linux 또는 WSL에서 실행합니다.
-### Qoder (Alibaba)
+```bash
+command -v <command>
+<command> --version
+```
-stdio 위에서 ACP 프로토콜을 사용하는 에이전트형 코딩 CLI입니다(Hermes, Kimi, Kiro CLI와 전송 계층을 공유합니다). 세션 재개는 ACP `session/resume`를 통해 동작하고, MCP 구성은 ACP `mcpServers`로 전달되며, 모델 선택은 동적으로 탐색되고, 스킬은 `.qoder/skills/`로 복사됩니다.
+Windows PowerShell에서 실행합니다.
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `qodercli` |
-| 설치 | 공식 CLI 문서 [qoder.com/cli](https://qoder.com/cli)를 참고하세요. |
-| 인증 | 공급사 문서에 따릅니다. |
+```powershell
+Get-Command <command>
+<command> --version
+```
-### Trae CLI (ByteDance)
+`<command>`를 표에 있는 `claude`, `codex`, `cursor-agent` 같은 명령으로 바꾸세요. 첫 명령이 실행 파일 경로를 반환합니다.
-ByteDance의 공식 TRAE CLI(`traecli`, Trae IDE와 함께 쓰는 제품이며 **오픈소스 `bytedance/trae-agent`가 아닙니다**)입니다. ACP 네이티브라서 Multica는 `traecli acp serve --yolo`로 stdio 위에서 구동하며 Hermes, Kimi, Kiro CLI, Qoder와 전송 계층을 공유합니다. 세션 재개는 ACP `session/load`로 동작하고, MCP 구성은 ACP `mcpServers`로 전달되며, 모델 선택은 동적으로 탐색되고, 스킬은 `.traecli/skills/`로 복사됩니다.
+터미널에서는 도구를 찾지만 Desktop이나 백그라운드 데몬에서는 찾지 못한다면 보통 서로 다른 `PATH`를 사용하기 때문입니다. 앱을 다시 시작하거나 해당 `MULTICA_<PROVIDER>_PATH` 환경 변수로 절대 경로를 지정할 수 있습니다. 전체 설정은 [환경 변수](/environment-variables#데몬-설정)를 참고하세요.
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `traecli` |
-| 설치 | 공식 CLI 문서 [docs.trae.cn/cli](https://docs.trae.cn/cli)를 참고하세요. |
-| 인증 | `traecli`를 한 번 대화형으로 실행해 브라우저 기반 기업 로그인을 완료하세요. Trae IDE 로그인과 CLI 로그인은 별개입니다. |
+## 4. 다시 감지하고 온라인 상태 확인
-### Antigravity (Google)
+CLI로 데몬을 시작합니다.
-Google의 Antigravity CLI(`agy`)입니다. Google의 Antigravity 서비스와 짝을 이루며 Gemini 기반 모델을 실행합니다. 세션 재개는 `--conversation <id>`를 통해 작동하며, 데몬이 CLI 로그 파일에서 이를 캡처합니다. 모델 선택은 Antigravity CLI 자체 내부에서 관리됩니다 — Multica는 이 제공자에 대해 에이전트별 모델 선택기를 비활성화합니다. 스킬은 `.agents/skills/`에 기록됩니다(CLI가 Gemini CLI의 워크스페이스 스킬 레이아웃을 상속함 — [Antigravity 문서](https://antigravity.google/docs/gcli-migration) 참고).
+```bash
+multica daemon start
+```
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `agy` |
-| 설치 | [antigravity.google/docs/cli-overview](https://antigravity.google/docs/cli-overview)의 공식 가이드를 따르세요. CLI는 미리 빌드되어 제공됩니다 — `agy install`을 한 번 실행하여 PATH와 셸 별칭을 설정하세요. |
-| 인증 | `agy`를 대화형으로 한 번 실행하여 Google 계정 로그인을 완료하거나, Antigravity 데스크톱 앱을 통해 로그인하세요 — CLI는 GUI가 기록한 keyring 항목을 재사용합니다. |
-| 비고 | CLI는 구조화된 이벤트 스트림이 아니라 stdout에 일반 어시스턴트 텍스트를 출력합니다. 중간의 "I will run X" 줄과 최종 응답 모두 텍스트로 Multica에 전달됩니다. |
+데몬이 이미 실행 중이고 새 도구를 설치했다면 다시 시작합니다.
-### Grok (xAI)
+```bash
+multica daemon restart
+```
-xAI의 Grok Build CLI(`grok`)입니다. Multica는 `grok --no-auto-update agent --always-approve stdio`로 ACP에 연결하고, `initialize` 후 CLI가 광고한 인증 방식을 선택해 `authenticate`를 완료한 다음 세션을 만듭니다. 세션 재개는 ACP `session/load`, 모델 탐색은 `session/new`, MCP는 ACP `mcpServers`로 동작합니다. 스킬은 `.grok/skills/`에 복사되며, 사용자 스킬은 `$GROK_HOME/skills/`(기본값 `~/.grok/skills/`) 또는 공용 `~/.agents/skills/`에서 탐색됩니다.
+Multica Desktop을 사용한다면 앱을 종료한 뒤 다시 열면 됩니다.
-| | |
-|---|---|
-| 데몬이 찾는 이름 | `grok` |
-| 설치 | Grok Build CLI를 설치하고 `grok`이 `PATH`에 있도록 설정하세요(일반적으로 `~/.grok/bin`). |
-| 인증 | `grok login`을 실행하거나 `XAI_API_KEY`를 설정하세요. ACP가 지원되는 인증 방식을 광고하지 않으면 Multica는 세션을 만들기 전에 명시적으로 실패합니다. |
-| 비고 | 바이너리는 `MULTICA_GROK_PATH`, 기본 모델은 `MULTICA_GROK_MODEL`로 재정의할 수 있습니다. 최소 CLI 버전은 `0.2.89`입니다. |
+그런 다음 Multica의 **런타임** 페이지를 엽니다. 대상 컴퓨터 아래에 해당 도구가 나타나고 온라인으로 표시됩니다. 이제 에이전트를 만들거나 수정할 때 이 런타임을 선택할 수 있습니다.
-## 설치한 후에
+<Callout type="warning">
+데몬이 시작될 때 기본 지원 CLI를 하나 이상 감지해야 합니다. 사용자 지정 런타임 설정은 데몬이 시작된 뒤 동기화되므로 빈 컴퓨터에서 유일한 시작 조건으로 사용할 수 없습니다.
+</Callout>
-1. **바이너리가 `PATH`에 있는지 확인하세요.** 새 터미널을 열고 `which <name>`(예: `which claude`, `which cursor-agent`, `which kiro-cli`, `which agy`)을 실행하세요. 경로가 출력되면 데몬이 찾을 수 있습니다. 아무것도 출력되지 않으면 먼저 셸의 `PATH`를 수정하세요(전형적인 원인은 다시 로드되지 않은 셸별 rc 파일입니다).
-2. **데몬을 재시작하세요.** `multica daemon restart`를 실행하거나 데스크톱 앱을 다시 실행하세요. 데몬은 시작 시에만 `PATH`를 스캔합니다.
-3. **런타임 페이지를 확인하세요.** Multica UI의 **런타임** 페이지에 이제 `(워크스페이스 × 도구)` 조합별로 한 행씩 나열되어야 합니다. 행에 "offline"이라고 표시되면 [데몬과 런타임 → 런타임이 오프라인으로 표시될 때](/daemon-runtimes#when-a-runtime-is-marked-offline)를 참고하세요.
-4. **온보딩으로 돌아가세요.** "런타임 연결" 단계는 폴링을 수행하며 몇 초 안에 새 런타임을 인식합니다 — 새로 고칠 필요가 없습니다.
+## 도구가 감지되지 않을 때
-## 문제 해결
+다음 순서로 확인하세요.
-- **`which`는 바이너리를 찾는데 데몬은 찾지 못합니다.** 데몬이 예전 `PATH`로 시작되었습니다. 재시작하세요.
-- **바이너리는 존재하지만 실행에 실패합니다.** 터미널에서 도구 자체의 `--version`이나 `--help`를 한 번 실행하세요 — 여기서 발생하는 대부분의 실패는 인증 누락, 만료된 토큰, 또는 Node.js / 런타임 불일치입니다.
-- **런타임 페이지에 행은 표시되지만 작업이 즉시 실패합니다.** 작업을 트리거하면서 `multica daemon logs -f`를 확인하세요. 데몬은 도구 자체의 오류 출력을 그대로 보여줍니다.
+1. 터미널에서 도구 자체를 실행해 설치와 로그인이 모두 완료되었는지 확인합니다.
+2. `command -v` 또는 `Get-Command`로 실제 명령 이름과 경로를 확인합니다.
+3. `multica daemon logs -f`를 실행해 버전, 경로, 인증 오류를 확인합니다.
+4. 데몬을 다시 시작해 현재 환경을 다시 읽게 합니다.
+5. **런타임** 페이지로 돌아가 컴퓨터와 도구가 모두 온라인인지 확인합니다.
-더 광범위한 증상은 [문제 해결 가이드](/troubleshooting)를 참고하세요.
+도구가 온라인으로 표시되지만 실행이 계속 실패한다면 이슈의 실행 기록에서 CLI가 반환한 구체적인 오류를 확인하거나 [문제 해결](/troubleshooting)을 계속 읽어 보세요.
-## 다음
+## 다음 단계
-- [데몬과 런타임](/daemon-runtimes) — 감지, 하트비트, 오프라인 처리가 작동하는 방식
-- [AI 코딩 도구 매트릭스](/providers) — 도구가 연결된 후의 기능 차이
-- [에이전트 생성 및 구성](/agents-create) — 에이전트에 사용할 도구를 선택하고 작업 실행 시작하기
+- [에이전트 생성 및 설정](/agents-create) — 방금 연결한 런타임을 선택합니다.
+- [데몬과 런타임](/daemon-runtimes) — 온라인 상태, 동시 실행, 사용자 지정 런타임을 알아봅니다.
+- [AI 코딩 도구 비교](/providers) — Multica에서 도구별 기능을 비교합니다.
diff --git a/apps/docs/content/docs/install-agent-runtime.mdx b/apps/docs/content/docs/install-agent-runtime.mdx
index a1cd69d47d..08c5cef6a3 100644
--- a/apps/docs/content/docs/install-agent-runtime.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.mdx
@@ -1,236 +1,106 @@
---
-title: Install an agent runtime
-description: Multica drives whichever AI coding tools you have on your machine. This page shows you how to install each of the 17 supported tools so the daemon can detect them.
+title: Install AI coding tools
+description: Install and sign in to a supported AI coding tool so Multica can execute tasks on your machine.
---
import { Callout } from "fumadocs-ui/components/callout";
-A **runtime** in Multica is the daemon on your machine paired with one AI coding tool the daemon found on your `PATH`. If the onboarding "Connect a runtime" step shows **No supported tools detected**, it means the daemon scanned `PATH` and didn't find any of the 17 tools it knows how to drive. Install one (or several) of the tools below, then come back to the step and re-scan — the runtime will show up within a few seconds.
+A local runtime has two parts: the Multica daemon, and one AI coding tool it can invoke. Install only the tool you intend to use — you do not need all of them.
-This page is the install-side companion to:
+## 1. Choose a tool
-- [Daemon and runtimes](/daemon-runtimes) — how detection works
-- [AI coding tools matrix](/providers) — what each tool can and can't do (session resumption, MCP, model selection)
+A tool that is already installed and signed in needs no extra setup. Tools differ in models, MCP, session resumption, and skill support; the details are in [AI coding tools comparison](/providers).
-<Callout type="info">
-The Multica server never sees your API keys or the tools themselves. Everything below — installation, authentication, model access — lives on your local machine. If something fails, it's almost always a local problem.
-</Callout>
-
-## Before you start
-
-Two prerequisites apply to **every** tool below:
-
-1. **The Multica daemon must be running.** Either run `multica daemon start` after installing the [Multica CLI](/cli), or use the [Multica desktop app](/desktop-app), which launches the daemon automatically. Without a running daemon there is nothing to detect tools.
-2. **The tool's binary must be reachable on `PATH`.** The daemon shells out to each tool by name (see the **Daemon looks for** column in each section). If `which <name>` doesn't find it in your terminal, the daemon won't find it either. After installing, open a fresh terminal (or restart the daemon) so the new `PATH` entry is picked up.
-
-After installing a tool, restart the daemon:
-
-```bash
-multica daemon restart
-```
-
-Or, in the desktop app, just relaunch the app. The daemon re-scans `PATH` on every start.
-
-## The 17 supported tools
-
-Listed roughly from most to least common. Pick whichever ones you already have credentials for — you don't need all 17.
-
-### Claude Code (Anthropic)
-
-The most complete integration. Session resumption works, MCP works, and it consumes the `mcp_config` field on agents (see the [matrix](/providers#mcp-configuration-provider-specific-support)).
-
-| | |
-|---|---|
-| Daemon looks for | `claude` |
-| Install | Follow the official guide at [claude.com/claude-code](https://www.claude.com/claude-code). The standard route is the npm package `@anthropic-ai/claude-code` (Node.js 18+ required). |
-| Authentication | Run `claude` once and follow the in-CLI login flow, or set `ANTHROPIC_API_KEY`. |
-| Notes | First-choice recommendation for new users. |
-
-### Codex (OpenAI)
-
-JSON-RPC 2.0 transport with finer-grained approval gates. MCP config is written into the per-task `$CODEX_HOME/config.toml`. **Session resumption works** through Codex app-server `thread/resume`; stale or missing threads fall back to a fresh thread.
-
-| | |
-|---|---|
-| Daemon looks for | `codex` |
-| Install | Follow the official guide at [github.com/openai/codex](https://github.com/openai/codex). The standard route is the npm package `@openai/codex`. |
-| Authentication | `codex login` (browser-based) or `OPENAI_API_KEY`. |
-
-### Cursor (Anysphere)
-
-The CLI counterpart to the Cursor editor. **Session resumption works** with current Cursor Agent releases: Multica reads `session_id` from the stream-json events and passes it back with `--resume <id>`.
-
-| | |
-|---|---|
-| Daemon looks for | `cursor-agent` |
-| Install | Install the [Cursor editor](https://cursor.com/) and then the CLI per their docs at [docs.cursor.com](https://docs.cursor.com/). The binary name is `cursor-agent`, not `cursor`. |
-| Authentication | Sign in through the Cursor editor; the CLI reuses that session. |
-
-For authenticated MCP servers, Cursor stores OAuth state in the project data directory where the auth flow first ran. Multica isolates managed Cursor MCP runs with a per-task `CURSOR_DATA_DIR`, so it does not scan or copy every file under `~/.cursor/projects`. To opt in for one agent, set the agent custom env key `CURSOR_MCP_AUTH_SOURCE` to the absolute path of the trusted `mcp-auth.json` file, or to the Cursor project data directory containing that file. Multica links or seeds only that `mcp-auth.json` into the isolated task project data directory. When symlinks are supported, Cursor token refreshes may write back to the trusted source; environments that cannot create symlinks fall back to copying the file.
-
-### GitHub Copilot
-
-Model routing goes through your GitHub account entitlement — the tool doesn't pick a model itself; GitHub decides which model you get.
-
-| | |
-|---|---|
-| Daemon looks for | `copilot` |
-| Install | See GitHub's CLI docs at [github.com/github/copilot-cli](https://github.com/github/copilot-cli). |
-| Authentication | Browser-based GitHub login through the CLI. |
-| Notes | Requires an active GitHub Copilot subscription on the signed-in account. |
-
-### OpenCode (SST)
-
-Open-source CLI agent. Dynamically discovers available models from its own configuration file — good fit for users who want to bring their own model catalog. Consumes the agent's `mcp_config` field through `OPENCODE_CONFIG_CONTENT`.
+Multica currently detects these commands:
-| | |
-|---|---|
-| Daemon looks for | `opencode` |
-| Install | Follow the official guide at [opencode.ai](https://opencode.ai/) or the GitHub repo at [github.com/sst/opencode](https://github.com/sst/opencode). The typical route is the install script or the npm package. |
-| Authentication | Configure your model provider(s) per OpenCode's docs (Anthropic, OpenAI, etc.). |
+| Tool | Detected command | Official install guide |
+| --- | --- | --- |
+| Antigravity CLI | `agy` | [Antigravity install and sign-in](https://antigravity.google/docs/cli-install) |
+| Claude Code | `claude` | [Claude Code quickstart](https://code.claude.com/docs/en/quickstart) |
+| CodeBuddy Code | `codebuddy` | [CodeBuddy quickstart](https://www.codebuddy.ai/docs/cli/quickstart) |
+| Codex CLI | `codex` | [Codex CLI](https://developers.openai.com/codex/cli/) |
+| GitHub Copilot CLI | `copilot` | [Install Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) |
+| Cursor Agent | `cursor-agent` | [Install Cursor CLI](https://docs.cursor.com/en/cli/installation) |
+| DevEco Code | `deveco` | [DevEco Code](https://gitcode.com/openharmony-sig/deveco-code) |
+| Grok Build | `grok` | [Grok Build quickstart](https://docs.x.ai/build/overview) |
+| Hermes Agent | `hermes` | [Hermes quickstart](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) |
+| Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
+| Kiro CLI | `kiro-cli` | [Install Kiro CLI](https://kiro.dev/docs/cli/installation/) |
+| OpenClaw | `openclaw` | [Install OpenClaw](https://docs.openclaw.ai/install) |
+| OpenCode | `opencode` | [OpenCode quickstart](https://opencode.ai/en/docs) |
+| Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |
+| Qoder CLI | `qodercli` | [Qoder CLI quickstart](https://docs.qoder.com/en/cli/quick-start) |
+| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
+| TRAE CLI | `traecli` | [TRAE official site](https://www.trae.cn/) |
-### DevEco Code (Huawei)
+"Supported" means Multica can invoke that CLI. It does not mean Multica provides the tool's account, subscription, or model quota for you.
-**DevEco Code** is Huawei's independent coding agent for HarmonyOS, built on the OpenCode engine. It ships its own model catalog and Huawei-account auth. Multica drives it over `deveco run --format json`; models are discovered dynamically from `deveco models` (built-in `deveco/GLM-5.1`). MCP servers are configured through DevEco's native config (`DEVECO_CONFIG_CONTENT`); Multica-side `mcp_config` wiring is in progress.
+## 2. Sign in on your machine
-| | |
-|---|---|
-| Daemon looks for | `deveco` |
-| Install | `npm install -g @deveco/deveco-code`. See the official README at [gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code/blob/develop/README.en.md) or the npm page at [npmjs.com/package/@deveco/deveco-code](https://www.npmjs.com/package/@deveco/deveco-code). |
-| Platforms | Windows x64 and macOS (arm64/x64) only — no Linux build is published. |
-| Authentication | Huawei-account login through the DevEco CLI. |
+After installing, launch the tool once in a terminal on its own and complete its sign-in or model provider setup. If the tool cannot complete requests in the terminal, the daemon's invocations fail the same way.
-### Kiro CLI (Amazon)
+Those login credentials are stored locally by the tool itself. Multica never receives login tokens from Claude, Codex, Cursor, or any other CLI.
-ACP-over-stdio transport. Session resumption works through ACP `session/load`; MCP config is passed through ACP `mcpServers`; skills are copied into `.kiro/skills/`.
-
-| | |
-|---|---|
-| Daemon looks for | `kiro-cli` |
-| Install | See the Kiro docs at [kiro.dev](https://kiro.dev/). The binary name is `kiro-cli`, not `kiro`. |
-| Authentication | AWS-account-based; follow Kiro's own onboarding. |
-
-### Kimi (Moonshot)
-
-ACP-protocol agent, primarily aimed at the Chinese market. MCP config is passed through ACP `mcpServers`; skills live under `.kimi/skills/` (native discovery).
-
-| | |
-|---|---|
-| Daemon looks for | `kimi` |
-| Install | Follow the official guide at [github.com/MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli). |
-| Authentication | Moonshot API key, configured per the vendor's docs. |
-
-### Hermes (Nous Research)
-
-ACP-protocol agent (shares the transport with Kimi). Session resumption works, and MCP config is passed through ACP `mcpServers`. Hermes discovers skills only from its home (`~/.hermes/skills/`), so when an agent has skills assigned Multica points `HERMES_HOME` at a per-task overlay of your `~/.hermes/` (real home mirrored by symlink; a derived `config.yaml` references your existing skills as external roots) and writes the assigned skills into its `skills/` directory for native discovery. The SQLite `state.db` session store and its journal files remain task-local, so host conversation history is neither linked nor copied and live Windows WAL locks cannot block setup. Tasks with no assigned skills run against your real home unchanged.
-
-| | |
-|---|---|
-| Daemon looks for | `hermes` |
-| Install | See Nous Research's repository at [github.com/NousResearch](https://github.com/NousResearch) for the latest CLI distribution. |
-| Authentication | Per the vendor's docs. |
-
-### OpenClaw
-
-Open-source CLI agent orchestrator. MCP config is materialized through Multica's per-task config wrapper. **Model is bound at the agent layer** (`openclaw agents add --model`) — it can't be overridden per task, and you can't pass `--model` or `--system-prompt` from Multica.
-
-| | |
-|---|---|
-| Daemon looks for | `openclaw` |
-| Install | See the project at [github.com/openclaw-org/openclaw](https://github.com/openclaw-org/openclaw) (community-maintained). |
-| Authentication | Configure the underlying model provider per OpenClaw's docs. |
-
-### Pi (Inflection AI)
-
-Minimalist. **Session resumption is unusual** — the resume id is the path to a session file on disk, not a string id.
-
-| | |
-|---|---|
-| Daemon looks for | `pi` |
-| Install | See Inflection's CLI docs at [pi.ai](https://pi.ai/). |
-| Authentication | Per the vendor's docs. |
-
-### CodeBuddy (Tencent)
-
-A Claude Code–compatible CLI agent. Multica drives it with the same stream-json protocol as Claude Code: session resumption works via `--resume`, MCP config is passed through `--mcp-config`. CodeBuddy ships its own native config directory rather than reusing Claude's, so skills land in `.codebuddy/skills/` and the runtime brief is written to `CODEBUDDY.md`. Models are discovered dynamically.
-
-| | |
-|---|---|
-| Daemon looks for | `codebuddy` |
-| Install | See the official CLI docs at [codebuddy.ai/cli](https://www.codebuddy.ai/cli). |
-| Authentication | Per the vendor's docs. |
-
-### Qoder (Alibaba)
+<Callout type="info">
+Claude Code requires 2.0.0 or later, Codex 0.100.0 or later, Copilot 1.0.0 or later, Grok 0.2.89 or later, and Qwen Code 0.20.0 or later. Below the minimum version, the daemon does not register the corresponding runtime.
+</Callout>
-Agentic coding CLI using the ACP protocol over stdio (shares the transport with Hermes, Kimi, and Kiro CLI). Session resumption works through ACP `session/resume`, MCP config is passed through ACP `mcpServers`, model selection is discovered dynamically, and skills are copied into `.qoder/skills/`.
+## 3. Confirm the daemon can find the command
-| | |
-|---|---|
-| Daemon looks for | `qodercli` |
-| Install | See the official CLI docs at [qoder.com/cli](https://qoder.com/cli). |
-| Authentication | Per the vendor's docs. |
+On macOS, Linux, or WSL, run:
-### Qwen Code (Alibaba)
+```bash
+command -v <command>
+<command> --version
+```
-Qwen Code uses its native JSONL protocol in daemon mode: `qwen -p <prompt> --output-format stream-json --yolo`. Multica owns `--yolo` for unattended runs so shell, edit, and write tools remain available without an approval UI. This does not enable Qwen's sandbox: unless the deployment explicitly enables `--sandbox` or `QWEN_SANDBOX`, tools run with the daemon OS user's permissions and credential scope. Use `--exclude-tools` in custom arguments to hard-deny specific tools. Session resumption works through `--resume`; the task runtime brief is written to `QWEN.md`; assigned skills are copied to `.qwen/skills/`; and personal skills use `$QWEN_HOME/skills/` (default `~/.qwen/skills/`).
+In Windows PowerShell, run:
-| | |
-|---|---|
-| Daemon looks for | `qwen` |
-| Install | Install Qwen Code using Alibaba's current Qwen Code instructions, then ensure `qwen` is on `PATH`. |
-| Authentication | Run `qwen` once interactively and complete its configured authentication flow before starting the daemon. |
-| Notes | Minimum CLI version: `0.20.0`. Override the binary with `MULTICA_QWEN_PATH` and set a daemon-wide default model with `MULTICA_QWEN_MODEL`. Add daemon-wide non-managed flags with `MULTICA_QWEN_ARGS` (POSIX shellword parsing). Managed agent `mcp_config` is written to a 0600 temporary JSON file and passed through `--mcp-config`; the file is removed after the run. Leave the field null to inherit native Qwen Code MCP settings. |
+```powershell
+Get-Command <command>
+<command> --version
+```
-### Trae CLI (ByteDance)
+Replace `<command>` with a command from the table, such as `claude`, `codex`, or `cursor-agent`. The first command prints the executable path.
-ByteDance's official TRAE CLI (`traecli`, paired with the Trae IDE — **not** the open-source `bytedance/trae-agent`). It is ACP-native, so Multica drives it over stdio via `traecli acp serve --yolo`, sharing the transport with Hermes, Kimi, Kiro CLI, and Qoder. Session resumption works through ACP `session/load`, MCP config is passed through ACP `mcpServers`, model selection is discovered dynamically (switched per task via `session/set_model`), and skills are copied into `.traecli/skills/`.
+If the terminal finds the tool but Desktop or the background daemon does not, the two are usually using different `PATH` values. Restart the app, or set an absolute path through the matching `MULTICA_<PROVIDER>_PATH` environment variable; full configuration is in [Environment variables](/environment-variables#daemon-configuration).
-| | |
-|---|---|
-| Daemon looks for | `traecli` |
-| Install | See the official CLI docs at [docs.trae.cn/cli](https://docs.trae.cn/cli). |
-| Authentication | Run `traecli` once interactively to complete the browser-based enterprise login (the token persists in `~/.trae` plus the OS keyring). Logging into the Trae **IDE** does not log in the CLI — they are separate. |
-| Notes | traecli reads project rules from `.trae/rules/` and has no `--system-prompt` flag, so Multica delivers its runtime brief inline in the prompt. Set a daemon-wide default model with `MULTICA_TRAECLI_MODEL`. |
+## 4. Re-detect and confirm the runtime is online
-### Antigravity (Google)
+Start the daemon with the CLI:
-Google's Antigravity CLI (`agy`). Pairs with Google's Antigravity service and runs Gemini-backed models. Multica launches it with `agy -p`, the daemon-compatible non-interactive mode; current Antigravity CLI releases can execute tools from that mode, while `agy -i` requires an attached TTY. Session resumption works through `--conversation <id>`, captured by the daemon from the CLI log file. Model selection is managed inside the Antigravity CLI itself — Multica disables the per-agent model picker for this provider. Skills are written to `.agents/skills/` (the CLI inherits Gemini CLI's workspace skill layout — see [Antigravity docs](https://antigravity.google/docs/gcli-migration)).
+```bash
+multica daemon start
+```
-| | |
-|---|---|
-| Daemon looks for | `agy` |
-| Install | Follow the official guide at [antigravity.google/docs/cli-overview](https://antigravity.google/docs/cli-overview). The CLI ships pre-built — run `agy install` once to wire up PATH and shell aliases. |
-| Authentication | Run `agy` once interactively and complete the Google account login, or sign in via the Antigravity desktop app — the CLI reuses the keyring entry the GUI writes. |
-| Notes | The CLI emits plain assistant text on stdout, not a structured event stream; intermediate "I will run X" lines and the final reply are both relayed to Multica as text, and per-tool telemetry is not available today. |
+If the daemon is already running, restart it after installing a new tool:
-### Grok (xAI)
+```bash
+multica daemon restart
+```
-xAI's Grok Build CLI (`grok`). Multica drives it over ACP via `grok --no-auto-update agent --always-approve stdio`, sharing the transport with Hermes, Kimi, Kiro CLI, Qoder, and Trae. It selects an auth method advertised by `initialize` and completes the headless `authenticate` handshake before any session operation. Session resumption works through ACP `session/load`. Models are discovered from `session/new`. MCP config is passed through ACP `mcpServers`. Skills are copied into `.grok/skills/`; user skills are discovered from `$GROK_HOME/skills/` (default `~/.grok/skills/`) and `~/.agents/skills/`.
+With Multica Desktop, quit and reopen the app.
-| | |
-|---|---|
-| Daemon looks for | `grok` |
-| Install | Install the Grok Build CLI and ensure `grok` is on `PATH` (often `~/.grok/bin`). |
-| Authentication | Run `grok login` for cached-token auth, or set `XAI_API_KEY`. The CLI must advertise the corresponding ACP method. |
-| Notes | Override the binary with `MULTICA_GROK_PATH` and the default model with `MULTICA_GROK_MODEL` (e.g. `grok-4.5`). Minimum CLI version: `0.2.89`. |
+Then open Multica's **Runtimes** page. The tool appears under the target computer and shows as online. You can now select this runtime when creating or editing an agent.
-## After installing
+<Callout type="warning">
+The daemon must detect at least one built-in supported CLI before it will start. Custom runtime profiles sync after the daemon is up, so they cannot be the sole startup condition on a blank machine.
+</Callout>
-1. **Confirm the binary is on `PATH`.** Open a fresh terminal and run `which <name>` (for example `which claude`, `which cursor-agent`, `which kiro-cli`, `which agy`). If it prints a path, the daemon will find it. If it prints nothing, fix your shell `PATH` first (the typical cause is a per-shell rc file that wasn't reloaded).
-2. **Restart the daemon.** `multica daemon restart`, or relaunch the desktop app. The daemon only scans `PATH` at startup.
-3. **Check the Runtimes page.** In the Multica UI, the **Runtimes** page should now list one row per `(workspace × tool)` combination. If the row says "offline", see [Daemon and runtimes → When a runtime is marked offline](/daemon-runtimes#when-a-runtime-is-marked-offline).
-4. **Go back to onboarding.** The "Connect a runtime" step polls and will pick up the new runtime within a few seconds — no need to refresh.
+## No tools detected
-## Troubleshooting
+Check in order:
-- **`which` finds the binary but the daemon doesn't.** The daemon was started with an older `PATH`. Restart it.
-- **The binary exists but launching fails.** Run the tool's own `--version` or `--help` once from the terminal — most failures here are missing auth, expired tokens, or a Node.js / runtime mismatch.
-- **The Runtimes page shows the row, but tasks fail immediately.** Check `multica daemon logs -f` while triggering a task. The daemon surfaces the tool's own error output.
+1. Run the tool itself in a terminal to confirm installation and sign-in are complete.
+2. Check the actual command name and path with `command -v` or `Get-Command`.
+3. Run `multica daemon logs -f` and look for version, path, or authentication errors.
+4. Restart the daemon so it re-reads the current environment.
+5. Return to the **Runtimes** page and confirm the computer and the tool are online.
-For broader symptoms, see the [Troubleshooting guide](/troubleshooting).
+If the tool shows as online but runs still fail, open the issue's run record to see the exact error the CLI returned, or continue with [Troubleshooting](/troubleshooting).
-## Next
+## Next steps
-- [Daemon and runtimes](/daemon-runtimes) — how detection, heartbeats, and offline handling work
-- [AI coding tools matrix](/providers) — capability differences once a tool is connected
-- [Creating and configuring agents](/agents-create) — pick a tool for your agent and start running tasks
+- [Create and configure an agent](/agents-create) — select the runtime you just connected.
+- [Daemon and runtimes](/daemon-runtimes) — online status, concurrency, and custom runtimes.
+- [AI coding tools comparison](/providers) — compare what each tool can do in Multica.
diff --git a/apps/docs/content/docs/install-agent-runtime.zh.mdx b/apps/docs/content/docs/install-agent-runtime.zh.mdx
index de9e56b6f2..d86d92d871 100644
--- a/apps/docs/content/docs/install-agent-runtime.zh.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.zh.mdx
@@ -1,222 +1,106 @@
---
-title: 安装一个 Agent 运行时
-description: Multica 驱动本机上已安装的 AI 编程工具。这一页讲清楚怎么安装目前支持的 16 款工具,让守护进程能扫到。
+title: 安装 AI 编程工具
+description: 安装并登录一款受支持的 AI 编程工具,让 Multica 在本机执行任务。
---
import { Callout } from "fumadocs-ui/components/callout";
-在 Multica 里,一个**运行时**(runtime)就是你机器上的守护进程,配上守护进程在 `PATH` 里扫到的某一款 AI 编程工具。如果 onboarding 的 "连接运行时" 这一步显示 **未检测到支持的工具**,说明守护进程扫了 `PATH`,但 16 款它认得的工具一个都没找到。装下面任意一款(或几款),回到这一步重新扫描,几秒内运行时就会出现。
+本地运行时由两部分组成:Multica 守护进程,以及它能够调用的一款 AI 编程工具。只需要安装你准备使用的工具,不必安装全部工具。
-这一页是装机的入口,和它配套的是:
+## 1. 选择一款工具
-- [守护进程与运行时](/zh/daemon-runtimes) — 检测是怎么工作的
-- [AI 编程工具矩阵](/zh/providers) — 每款工具的能力差异(会话续接、MCP、模型选择)
+已经安装并登录的工具不需要额外配置。工具之间的模型、MCP、会话恢复和 skill 支持有所不同,详细差异见 [AI 编程工具对照](/providers)。
-<Callout type="info">
-Multica 服务器从不接触你的 API key,也不接触工具本身。下面这些操作 —— 安装、登录、模型访问 —— 全部发生在你本机。出问题几乎都是本地问题。
-</Callout>
-
-## 开始前
-
-下面每一款工具都有两个共同前提:
-
-1. **Multica 守护进程在运行。** 装完 [Multica CLI](/zh/cli) 后跑 `multica daemon start`;或者用 [Multica 桌面端](/zh/desktop-app),它启动时自动拉起守护进程。守护进程没起来,就没人去扫工具。
-2. **工具的可执行文件在 `PATH` 上。** 守护进程通过名字 shell out 调起工具(见每一节里 **守护进程扫描** 那行的命令名)。终端里 `which <名字>` 找不到,守护进程也找不到。装完后打开新终端(或者重启守护进程),让新的 `PATH` 生效。
-
-装完一款工具后,重启守护进程:
-
-```bash
-multica daemon restart
-```
-
-桌面端的话,重启 app 即可。守护进程只在启动时扫一次 `PATH`。
-
-## 16 款支持的工具
-
-大致按常见程度排序。挑你已经有账号 / API key 的那几款就行 —— 不需要 16 个全装。
-
-### Claude Code(Anthropic)
-
-集成最完整的一款。会话续接好用,MCP 好用,会消费 agent 配置里的 `mcp_config` 字段(见[矩阵](/zh/providers))。
-
-| | |
-|---|---|
-| 守护进程扫描 | `claude` |
-| 安装 | 看官方指引 [claude.com/claude-code](https://www.claude.com/claude-code)。常见装法是 npm 包 `@anthropic-ai/claude-code`(需要 Node.js 18+)。 |
-| 认证 | 跑一次 `claude`,跟着 CLI 里的登录流程走;或者设置 `ANTHROPIC_API_KEY`。 |
-| 备注 | 新用户首选。 |
-
-### Codex(OpenAI)
-
-JSON-RPC 2.0 传输,审批粒度更细。MCP 配置会写入单次任务的 `$CODEX_HOME/config.toml`。**会话续接可用**——Multica 通过 Codex app-server 的 `thread/resume` 续接;thread 过期或不存在时会回退到新 thread。
-
-| | |
-|---|---|
-| 守护进程扫描 | `codex` |
-| 安装 | 看官方指引 [github.com/openai/codex](https://github.com/openai/codex)。常见装法是 npm 包 `@openai/codex`。 |
-| 认证 | `codex login`(浏览器登录),或 `OPENAI_API_KEY`。 |
-
-### Cursor(Anysphere)
-
-Cursor 编辑器的 CLI 对应物。**会话续接可用**——当前 Cursor Agent 会在 stream-json 事件里返回 `session_id`,Multica 会在下一次运行时用 `--resume <id>` 传回去。
-
-| | |
-|---|---|
-| 守护进程扫描 | `cursor-agent` |
-| 安装 | 先装 [Cursor 编辑器](https://cursor.com/),再按 [docs.cursor.com](https://docs.cursor.com/) 的说明装 CLI。可执行文件叫 `cursor-agent`,不是 `cursor`。 |
-| 认证 | 在 Cursor 编辑器里登录,CLI 复用同一份会话。 |
-
-### GitHub Copilot
-
-模型走的是你 GitHub 账号的 entitlement —— 工具自己不挑模型,GitHub 决定你拿到哪个模型。
-
-| | |
-|---|---|
-| 守护进程扫描 | `copilot` |
-| 安装 | 看 GitHub 的 CLI 文档 [github.com/github/copilot-cli](https://github.com/github/copilot-cli)。 |
-| 认证 | CLI 里走 GitHub 浏览器登录。 |
-| 备注 | 登录账号必须有有效的 GitHub Copilot 订阅。 |
-
-### OpenCode(SST)
+Multica 当前会检测以下命令:
-开源 CLI agent。会从自己的配置文件里动态发现可用模型 —— 适合想自己掌控模型清单的用户。会通过 `OPENCODE_CONFIG_CONTENT` 消费 agent 配置里的 `mcp_config` 字段。
+| 工具 | 检测的命令 | 官方安装说明 |
+| --- | --- | --- |
+| Antigravity CLI | `agy` | [Antigravity 安装与登录](https://antigravity.google/docs/cli-install) |
+| Claude Code | `claude` | [Claude Code 快速开始](https://code.claude.com/docs/en/quickstart) |
+| CodeBuddy Code | `codebuddy` | [CodeBuddy 快速开始](https://www.codebuddy.ai/docs/cli/quickstart) |
+| Codex CLI | `codex` | [Codex CLI](https://developers.openai.com/codex/cli/) |
+| GitHub Copilot CLI | `copilot` | [安装 Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) |
+| Cursor Agent | `cursor-agent` | [安装 Cursor CLI](https://docs.cursor.com/en/cli/installation) |
+| DevEco Code | `deveco` | [DevEco Code](https://gitcode.com/openharmony-sig/deveco-code) |
+| Grok Build | `grok` | [Grok Build 快速开始](https://docs.x.ai/build/overview) |
+| Hermes Agent | `hermes` | [Hermes 快速开始](https://hermes-agent.nousresearch.com/docs/getting-started/quickstart/) |
+| Kimi CLI | `kimi` | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) |
+| Kiro CLI | `kiro-cli` | [安装 Kiro CLI](https://kiro.dev/docs/cli/installation/) |
+| OpenClaw | `openclaw` | [安装 OpenClaw](https://docs.openclaw.ai/install) |
+| OpenCode | `opencode` | [OpenCode 快速开始](https://opencode.ai/en/docs) |
+| Pi coding agent | `pi` | [Pi coding agent](https://github.com/earendil-works/pi) |
+| Qoder CLI | `qodercli` | [Qoder CLI 快速开始](https://docs.qoder.com/en/cli/quick-start) |
+| Qwen Code | `qwen` | [Qwen Code](https://github.com/QwenLM/qwen-code) |
+| TRAE CLI | `traecli` | [TRAE 官方站](https://www.trae.cn/) |
-| | |
-|---|---|
-| 守护进程扫描 | `opencode` |
-| 安装 | 看官方指引 [opencode.ai](https://opencode.ai/) 或仓库 [github.com/sst/opencode](https://github.com/sst/opencode)。一般是装脚本或 npm 包。 |
-| 认证 | 按 OpenCode 的文档配你自己的模型供应商(Anthropic、OpenAI 等)。 |
+"受支持"表示 Multica 能够调用对应 CLI,不代表 Multica 会替你提供该工具的账号、订阅或模型额度。
-### DevEco Code(华为)
+## 2. 在本机完成登录
-**DevEco Code** 是华为面向鸿蒙开发的独立编程智能体,基于 OpenCode 引擎构建。自带模型目录与华为账号认证。Multica 通过 `deveco run --format json` 驱动;模型通过 `deveco models` 动态发现(内置 `deveco/GLM-5.1`)。MCP server 通过 DevEco 原生配置(`DEVECO_CONFIG_CONTENT`)接入;Multica 侧的 `mcp_config` 透传正在开发中。
+安装后,先在终端中单独启动一次工具,并按照它自己的流程登录或配置模型服务。工具在终端中无法完成请求时,守护进程调用它同样会失败。
-| | |
-|---|---|
-| 守护进程扫描 | `deveco` |
-| 安装 | `npm install -g @deveco/deveco-code`。参见官方 README [gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code/blob/develop/README.en.md) 或 npm 页面 [npmjs.com/package/@deveco/deveco-code](https://www.npmjs.com/package/@deveco/deveco-code)。 |
-| 支持平台 | 仅 Windows x64 与 macOS(arm64/x64),未发布 Linux 版本。 |
-| 认证 | 通过 DevEco CLI 使用华为账号登录。 |
+这些登录凭据由工具保存在本机。Multica 不会接收 Claude、Codex、Cursor 或其他 CLI 的登录 token。
-### Kiro CLI(Amazon)
-
-ACP-over-stdio 传输。会话续接通过 ACP `session/load` 工作;MCP 配置通过 ACP `mcpServers` 传入;skills 拷到 `.kiro/skills/`。
-
-| | |
-|---|---|
-| 守护进程扫描 | `kiro-cli` |
-| 安装 | 看 Kiro 的文档 [kiro.dev](https://kiro.dev/)。可执行文件叫 `kiro-cli`,不是 `kiro`。 |
-| 认证 | 基于 AWS 账号,按 Kiro 自己的引导走。 |
-
-### Kimi(Moonshot)
-
-ACP 协议 agent,主要面向中国市场。MCP 配置通过 ACP `mcpServers` 传入;skills 放在 `.kimi/skills/`(原生发现路径)。
-
-| | |
-|---|---|
-| 守护进程扫描 | `kimi` |
-| 安装 | 看官方指引 [github.com/MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli)。 |
-| 认证 | Moonshot API key,按厂商文档配置。 |
-
-### Hermes(Nous Research)
-
-ACP 协议 agent(和 Kimi 共享传输层)。会话续接可用,MCP 配置通过 ACP `mcpServers` 传入。Skill 注入用的是通用回退路径 `.agent_context/skills/` —— 用之前先验证 skills 真的被加载了。
-
-| | |
-|---|---|
-| 守护进程扫描 | `hermes` |
-| 安装 | 看 Nous Research 的仓库 [github.com/NousResearch](https://github.com/NousResearch) 获取最新 CLI。 |
-| 认证 | 按厂商文档。 |
-
-### OpenClaw
-
-开源 CLI agent 编排器。MCP 配置通过 Multica 的单次任务配置 wrapper 写入。**模型绑在 agent 层**(`openclaw agents add --model`)—— 不能按任务覆盖,从 Multica 也传不了 `--model` / `--system-prompt`。
-
-| | |
-|---|---|
-| 守护进程扫描 | `openclaw` |
-| 安装 | 看项目 [github.com/openclaw-org/openclaw](https://github.com/openclaw-org/openclaw)(社区维护)。 |
-| 认证 | 按 OpenClaw 的文档配底层模型供应商。 |
-
-### Pi(Inflection AI)
-
-极简风格。**会话续接的方式不太一样** —— resume id 是磁盘上的会话文件路径,不是字符串 id。
-
-| | |
-|---|---|
-| 守护进程扫描 | `pi` |
-| 安装 | 看 Inflection 的 CLI 文档 [pi.ai](https://pi.ai/)。 |
-| 认证 | 按厂商文档。 |
-
-### CodeBuddy(Tencent)
+<Callout type="info">
+Claude Code 需要 2.0.0 或更高版本,Codex 需要 0.100.0 或更高版本,Copilot 需要 1.0.0 或更高版本,Grok 需要 0.2.89 或更高版本,Qwen Code 需要 0.20.0 或更高版本。低于最低版本时,守护进程不会注册对应运行时。
+</Callout>
-一款兼容 Claude Code 的 CLI agent。Multica 用和 Claude Code 一样的 stream-json 协议驱动它:会话续接通过 `--resume` 可用,MCP 配置通过 `--mcp-config` 传入。CodeBuddy 使用自己原生的配置目录,而不是复用 Claude 的,所以 skill 放在 `.codebuddy/skills/`,运行时说明写入 `CODEBUDDY.md`。模型为动态发现。
+## 3. 确认守护进程能够找到命令
-| | |
-|---|---|
-| 守护进程扫描 | `codebuddy` |
-| 安装 | 看官方 CLI 文档 [codebuddy.ai/cli](https://www.codebuddy.ai/cli)。 |
-| 认证 | 按厂商文档。 |
+在 macOS、Linux 或 WSL 中运行:
-### Qoder(Alibaba)
+```bash
+command -v <command>
+<command> --version
+```
-一款 agentic 编程 CLI,在 stdio 上使用 ACP 协议(和 Hermes、Kimi、Kiro CLI 共享传输层)。会话续接通过 ACP `session/resume` 工作,MCP 配置通过 ACP `mcpServers` 传入,模型为动态发现,skill 复制到 `.qoder/skills/`。
+在 Windows PowerShell 中运行:
-| | |
-|---|---|
-| 守护进程扫描 | `qodercli` |
-| 安装 | 看官方 CLI 文档 [qoder.com/cli](https://qoder.com/cli)。 |
-| 认证 | 按厂商文档。 |
+```powershell
+Get-Command <command>
+<command> --version
+```
-### Trae CLI(ByteDance)
+把 `<command>` 换成表格中的命令,例如 `claude`、`codex` 或 `cursor-agent`。第一条命令返回可执行文件路径。
-ByteDance 官方 TRAE CLI(`traecli`,搭配 Trae IDE,**不是**开源的 `bytedance/trae-agent`)。它是 ACP 原生工具,Multica 通过 `traecli acp serve --yolo` 在 stdio 上驱动它,和 Hermes、Kimi、Kiro CLI、Qoder 共享传输层。会话续接通过 ACP `session/load` 工作,MCP 配置通过 ACP `mcpServers` 传入,模型为动态发现,skill 复制到 `.traecli/skills/`。
+如果终端能够找到工具,但 Desktop 或后台守护进程找不到,通常是两者使用的 `PATH` 不同。可以重启应用,或通过对应的 `MULTICA_<PROVIDER>_PATH` 环境变量指定绝对路径;完整配置见[环境变量](/environment-variables#守护进程配置)。
-| | |
-|---|---|
-| 守护进程扫描 | `traecli` |
-| 安装 | 看官方 CLI 文档 [docs.trae.cn/cli](https://docs.trae.cn/cli)。 |
-| 认证 | 交互式跑一次 `traecli` 完成浏览器企业登录。Trae IDE 登录和 CLI 登录是分开的。 |
+## 4. 重新检测并确认上线
-### Antigravity(Google)
+使用 CLI 启动守护进程:
-Google 的 Antigravity CLI(`agy`)。搭配 Google Antigravity 服务,默认走 Gemini 系列模型。Multica 使用 `agy -p` 启动它,这是适合 daemon 后台任务的一次性非交互模式;当前 Antigravity CLI 在这个模式下仍可执行工具,而 `agy -i` 需要连接 TTY,不适合 daemon 驱动。会话续接通过 `--conversation <id>` 工作——守护进程从 CLI 的日志文件里抓取 conversation UUID。模型选择保存在 Antigravity CLI 自己的设置里——Multica 里这款工具的「模型」选择项被禁用。Skill 文件写入 `.agents/skills/`(CLI 沿用 Gemini CLI 的 workspace 布局——见 [Antigravity 文档](https://antigravity.google/docs/gcli-migration))。
+```bash
+multica daemon start
+```
-| | |
-|---|---|
-| 守护进程扫描 | `agy` |
-| 安装 | 看官方指引 [antigravity.google/docs/cli-overview](https://antigravity.google/docs/cli-overview)。CLI 是预编译的,跑一次 `agy install` 配好 PATH 和 shell 别名即可。 |
-| 认证 | 交互式跑一次 `agy` 走 Google 账号登录流程;或者通过 Antigravity 桌面端登录——CLI 会复用 GUI 写入 keyring 的凭据。 |
-| 备注 | CLI 的 stdout 是纯文本,不是结构化事件流;中间的 "I will run X" 过程和最终回复都会作为 text 消息送回 Multica,目前无法展示 Antigravity 的逐工具 telemetry。 |
+如果守护进程已经运行,安装新工具后重新启动:
-### Grok(xAI)
+```bash
+multica daemon restart
+```
-xAI 的 Grok Build CLI(`grok`)。Multica 通过 `grok --no-auto-update agent --always-approve stdio` 接入 ACP;收到 `initialize` 响应后,先从 CLI 公布的认证方式里选择一项并完成 `authenticate`,再创建会话。会话续接走 ACP `session/load`,模型从 `session/new` 动态发现,MCP 通过 ACP `mcpServers` 传入。Skill 文件会复制到 `.grok/skills/`;用户 skill 从 `$GROK_HOME/skills/`(默认 `~/.grok/skills/`)或通用目录 `~/.agents/skills/` 发现。
+使用 Multica Desktop 时,退出并重新打开应用即可。
-| | |
-|---|---|
-| 守护进程扫描 | `grok` |
-| 安装 | 安装 Grok Build CLI,并确保 `grok` 在 `PATH` 上(通常位于 `~/.grok/bin`)。 |
-| 认证 | 跑 `grok login`,或者设置 `XAI_API_KEY`。如果 ACP 没有公布 Multica 支持的认证方式,任务会在创建会话前明确失败。 |
-| 备注 | 用 `MULTICA_GROK_PATH` 覆盖二进制路径,用 `MULTICA_GROK_MODEL` 设置默认模型。最低 CLI 版本为 `0.2.89`。 |
+然后打开 Multica 的**运行时**页面。目标电脑下面会出现对应工具,并显示为在线。现在可以在创建或编辑智能体时选择这条运行时。
-## 装完之后
+<Callout type="warning">
+守护进程启动时必须先检测到至少一款内置支持的 CLI。自定义运行时配置会在守护进程启动后同步,因此不能作为一台空白机器上的唯一启动条件。
+</Callout>
-1. **确认可执行文件在 `PATH` 上。** 开一个新终端,跑 `which <名字>`(比如 `which claude`、`which cursor-agent`、`which kiro-cli`、`which agy`)。打印出路径,守护进程就找得到;什么都不打印,先修 shell 的 `PATH`(最常见原因是 rc 文件没重新加载)。
-2. **重启守护进程。** `multica daemon restart`,或者重启桌面端。守护进程只在启动时扫一次 `PATH`。
-3. **看 Runtimes 页面。** Multica UI 的 **Runtimes** 页应该会出现一行 `(工作区 × 工具)`。如果显示 "offline",看[守护进程与运行时 → 运行时何时被标记为离线](/zh/daemon-runtimes#运行时何时被标记为离线)。
-4. **回到 onboarding。** "连接运行时" 这一步会一直轮询,几秒内就能扫到新运行时,不需要手动刷新。
+## 未检测到工具
-## 排错
+依次检查:
-- **`which` 找得到,但守护进程找不到。** 守护进程是用旧 `PATH` 启的,重启它。
-- **可执行文件在,但启动就失败。** 在终端单独跑一次工具的 `--version` 或 `--help`,绝大多数失败都是登录没做、token 过期、Node.js / 运行时版本不对。
-- **Runtimes 页面看到行,但任务一跑就失败。** 一边触发任务一边跑 `multica daemon logs -f`。守护进程会把工具自己的报错原样吐出来。
+1. 在终端运行工具本身,确认安装和登录都已完成。
+2. 用 `command -v` 或 `Get-Command` 检查实际命令名和路径。
+3. 运行 `multica daemon logs -f`,查看版本、路径或认证错误。
+4. 重启守护进程,让它重新读取当前环境。
+5. 回到**运行时**页面,确认电脑和工具都已上线。
-更宽的症状看[排错指南](/zh/troubleshooting)。
+工具已经显示在线,但执行仍然失败时,打开 issue 的执行记录查看 CLI 返回的具体错误,或继续阅读[故障排查](/troubleshooting)。
## 接下来
-- [守护进程与运行时](/zh/daemon-runtimes) — 检测、心跳、离线处理
-- [AI 编程工具矩阵](/zh/providers) — 工具连上之后的能力差异
-- [创建并配置智能体](/zh/agents-create) — 给你的 agent 挑一款工具,开始跑任务
+- [创建和配置智能体](/agents-create) — 选择刚刚连接的运行时。
+- [守护进程与运行时](/daemon-runtimes) — 了解在线状态、并发和自定义运行时。
+- [AI 编程工具对照](/providers) — 比较各工具在 Multica 中的能力。
diff --git a/apps/docs/content/docs/issues.ja.mdx b/apps/docs/content/docs/issues.ja.mdx
index 311cb5d5ad..336748721a 100644
--- a/apps/docs/content/docs/issues.ja.mdx
+++ b/apps/docs/content/docs/issues.ja.mdx
@@ -1,79 +1,91 @@
---
-title: イシューとプロジェクト
-description: 人またはエージェントに割り当てられる、Multica の中心的な作業単位。
+title: イシュー
+description: イシューは 1 件の作業のコンテキスト、担当者、ステータス、実行履歴を 1 か所に保持します。
---
import { Callout } from "fumadocs-ui/components/callout";
-イシューは Multica における独立した作業単位です — バグ、新機能、対応が必要なことなら何でも構いません。すべてのイシューには **タイトル**、**説明**(Markdown 対応)、**ステータス**、**優先度**、**担当者** があり、任意で **プロジェクト** に属することもできます。Linear や Jira を使ったことがあれば、同じ形だと分かるはずです。
+イシューは Multica で作業を進める基本単位です。機能、バグ、調査など、メンバーまたはエージェントが責任を持って進める作業はすべてイシューになります。関連する議論、ステータスの変化、実行のたびの記録が同じ場所に残るため、チャット履歴やターミナルのログからコンテキストを組み立て直す必要はありません。
-**Multica の最大の特徴は、イシューの担当者が人でもエージェントでもよいという点です** — [エージェント](/agents) — ここから始めましょう。
+## イシューの構成
-## エージェントにイシューを割り当てる
+| 内容 | 役割 |
+|---|---|
+| **タイトルと説明** | 目的、背景、要件、受け入れ条件。 |
+| **ステータスと優先度** | 作業がどの段階にあり、何を先に進めるか。 |
+| **担当者** | ワークスペースのメンバー、エージェント、またはスクワッド。 |
+| **日付、ラベル、カスタムプロパティ** | 計画、分類、チーム独自のフィールド。 |
+| **プロジェクトと親子関係** | より大きな作業への所属、または子イシューへの分割。 |
+| **アクティビティと実行ログ** | コメント、ステータス変更、実行タスク、エージェントが返した結果。 |
-イシューをエージェントに[割り当てる](/assigning-issues)と、その作業をエージェントに引き渡すことになります。エージェントは **自動的に開始します** — 数秒以内に実行を始め、コメントで進捗を報告し、完了するとステータスを done に切り替えます。同僚に仕事を渡すのとの唯一の違いは、エージェントはオフラインにならず、リマインドも要らず、24時間365日いつでも対応できることです。
+![イシュー詳細: 説明、ディスカッション、右側のプロパティと実行ログ](/images/docs/quickstart-run-result.png)
-<Callout type="info">
-エージェントのアイデンティティ、設定、実行場所については [エージェント](/agents) を参照してください。
-</Callout>
+## イシューの作成
-非公開エージェントをイシューに割り当てられるのは、ワークスペースの owner と admin だけです。ロールの権限については [メンバーとロール](/members-roles) を参照してください。
+**イシュー** ページまたはプロジェクト内で作成します。タイトルだけで作成でき、ほかのプロパティは後からいつでも補えます。
-## ステータス
+各イシューには `MUL-123` のような番号が付きます。数字はワークスペース内で増えていき、管理者がワークスペースのイシュープレフィックスを変更すると、番号は新しいプレフィックスで表示されます。詳細は[ワークスペース](/workspaces#ワークスペースの作成)を参照してください。
-Multica には7つのステータスがあります。**どのステータスからでも、ほかのどのステータスへも直接移動できます** — Multica はワークフローを強制せず、`backlog` から `done` へ一気に飛んでも止めません。
+## 担当者の選択
-| ステータス | 意味 |
+| 担当者 | 効果 |
|---|---|
-| `backlog` | まだ予定に入っていない |
-| `todo` | 予定が決まり、着手できる |
-| `in_progress` | 作業中 |
-| `in_review` | レビュー待ち |
-| `done` | 完了 |
-| `blocked` | 外部要因で止まっている |
-| `cancelled` | キャンセル済み |
+| **メンバー** | そのメンバーが作業を進めます。実行タスクは作成されません。 |
+| **エージェント** | そのエージェントの実行タスクが 1 件作成されます。 |
+| **スクワッド** | スクワッドのリーダーが受け取り、誰に任せるかを決めます。 |
-イシューがエージェントに割り当てられると、エージェントは自動的にステータスを `backlog` / `todo` から `in_progress` に移し、完了すると `done` にします。いつでも手動で変更することもできます。
+エージェントまたはスクワッドに割り当てると、イシューが `backlog` にない限り即座にキューへ入ります。ランタイムがオフラインの場合、タスクはキューで待機します。アーカイブ済みのエージェントとスクワッドには割り当てられません。
-## 優先度
+割り当てはエージェントのアクセス範囲(Access)を回避しません。スクワッドに割り当てる場合は、リーダーの Access が検証されます。詳細は[イシューをエージェントに割り当てる](/assigning-issues)を参照してください。
-優先度には5段階があり、デフォルトのイシュー一覧の並び替えに使われます:
+## ステータス
-| 優先度 | 用途 |
+| ステータス | 意味 |
|---|---|
-| `No priority` | まだ決めていない(デフォルト) |
-| `Urgent` | 緊急 |
-| `High` | 高 |
-| `Medium` | 中 |
-| `Low` | 低 |
+| `backlog` | まだ着手しない。エージェントに割り当て済みのイシューは、`backlog` を離れて初めて実行タスクが作成されます。 |
+| `todo` | 内容が固まり、開始を待っている。 |
+| `in_progress` | 作業中。 |
+| `in_review` | 結果が出て、確認待ち。 |
+| `done` | 完了。 |
+| `blocked` | 今は先に進めない。 |
+| `cancelled` | 中止したが、記録は残す。 |
-## イシュー番号
+ステータス間に固定のフローはなく、メンバーもエージェントも直接変更できます。
-すべてのイシューには、ワークスペース内で一意の番号が `<prefix>-<digits>` 形式で付きます — 例えば `MUL-123` のように。番号は作成時にシステムが付与し、**決して変わりません**。[ワークスペース → イシュー番号](/workspaces#issue-numbers) を参照してください。
+<Callout type="info">
+次の 2 つの変更はシステムが行います。
-## コメント
+- 実行が失敗し、そのイシューにほかの実行がなく、リトライも起動しなかった場合、`in_progress` は `todo` に戻ります。
+- 紐づく GitHub PR がクローズ意図付きでマージされ、open または draft のまま残る紐づき PR がほかにない場合、イシューは `done` になります。
+</Callout>
-イシューの下のコメントスレッドは、協業が行われる場所です — コメントに返信し、人やエージェントを `@` でメンションし、リアクションを追加できます。
+## イシューと実行タスク
-コメントでエージェントを `@` でメンションすると **自動的にトリガーされます** — これは「割り当て」と並ぶ、エージェントを起動する2つ目の方法です。[コメントとメンション](/comments) と [コメントでエージェントをメンションする](/mentioning-agents) を参照してください。
+イシューは継続して存在する作業の記録であり、[実行タスク(task)](/tasks)はエージェントによる 1 回の具体的な実行です。1 つのイシューからは、最初の実装、追加の修正、再度の確認というように、複数の実行タスクが順に生まれることがあります。実行タスクの完了はその 1 回の実行が終わったことを意味するだけで、イシューが完了したかどうかはイシューのステータスで判断します。
-## イシューを削除する
+## プロジェクトと子イシュー
-<Callout type="warning">
-イシューを削除すると、その下のすべてのコメント、リアクション、添付ファイルと、キューに入っているエージェントのタスクが **即座に** 消えます(実行中のタスクはキャンセルされます)。**元に戻せません。**
+イシューは最大 1 つの[プロジェクト](/projects)に属し、プロジェクトはその中の実行に共有の説明とリソースを提供します。別のプロジェクトへ移してもコピーは作られません。
-単にイシューを見えないようにしたいだけなら、**ステータスを `cancelled` に変更するほうが削除より安全です** — データは残り、後から戻すことができます。
-</Callout>
+大きな作業は子イシューに分割できます。親イシューが全体の目標を保持し、子イシューはそれぞれ独立して進みます。親子のステータスは連動しません。
+
+子イシューには**ステージ**(stage)を設定でき、1、2、3 とバッチごとに進められます。未完了の最も早いステージのすべての子イシューが `done` または `cancelled` に到達すると、親イシューに子イシュー完了の通知が届きます。親イシューの担当者がエージェントの場合は、そのエージェントが起こされ、次のステージへ進むかどうかを判断します。ステージ未設定の子イシューは同じバッチとして扱われ、すべて終了したときに一度だけ通知されます。
-## プロジェクト
+## ビューの切り替え
-プロジェクトは、複数のイシューをまとめるコンテナです。イシューは最大1つのプロジェクトに属するか、どのプロジェクトにも属さないかのいずれかです。
+イシューページには、リスト、ボード、テーブル、ガント、スイムレーンの 5 つのビューがあります。ステータス、担当者、プロジェクトなどのプロパティで絞り込み・並べ替えでき、表示されるのはどれも同じイシューです。
-プロジェクトには独自の **リード** がいます — **イシューの担当者と同じように、リードも人でもエージェントでもかまいません**。
+## イシューの削除
-プロジェクトを削除しても **その中のイシューは削除されません**: それらのイシューはプロジェクトから切り離されるだけで、ワークスペースにそのまま残ります。
+ワークスペースのメンバーは誰でもイシューを削除できます。
+
+<Callout type="warning">
+削除は元に戻せません。イシューとそのコメント、添付ファイル、関連レコードは完全に削除され、終了していない実行タスクはキャンセルされます。作業を続けないだけであれば、ステータスを `cancelled` に変更してください。議論と結果は引き続き参照できます。
+</Callout>
-## 次に読む
+## 次のステップ
-- [コメントとメンション](/comments) — イシューの下で協業する
-- [エージェント](/agents) — 「エージェントに割り当てる」が実際にどう動くのかを理解する
+- [プロジェクト](/projects) — 複数のイシューで完了する作業を整理します。
+- [コメント](/comments) — イシューを中心に議論、返信、@メンションを行います。
+- [イシューをエージェントに割り当てる](/assigning-issues) — 作業をエージェントに渡して最初の実行を開始します。
+- [実行タスク](/tasks) — キュー、実行、リトライ、キャンセルの仕組みを理解します。
diff --git a/apps/docs/content/docs/issues.ko.mdx b/apps/docs/content/docs/issues.ko.mdx
index 84fca0bed7..16b2e4d3dd 100644
--- a/apps/docs/content/docs/issues.ko.mdx
+++ b/apps/docs/content/docs/issues.ko.mdx
@@ -1,79 +1,91 @@
---
-title: 이슈와 프로젝트
-description: 사람 또는 에이전트에게 할당할 수 있는 Multica의 핵심 작업 단위.
+title: 이슈
+description: 이슈는 한 작업의 컨텍스트, 담당자, 상태, 실행 기록을 보관합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-이슈는 Multica에서 독립적인 작업 단위입니다 — 버그, 새 기능, 처리해야 할 어떤 일이든 될 수 있습니다. 모든 이슈에는 **제목**, **설명**(Markdown 지원), **상태**, **우선순위**, **담당자**가 있으며, 선택적으로 **프로젝트**에 속할 수 있습니다. Linear나 Jira를 사용해 보셨다면 동일한 형태입니다.
+이슈는 Multica에서 작업을 계획하는 기본 단위입니다. 기능 하나, 버그 하나, 조사 하나처럼 멤버나 에이전트가 책임지고 진행해야 하는 모든 작업이 이슈가 될 수 있습니다. 관련 논의, 상태 변경, 모든 실행이 한곳에 남으므로 채팅 기록이나 터미널 로그에서 컨텍스트를 다시 조합할 필요가 없습니다.
-**Multica의 가장 큰 특징은 이슈의 담당자가 사람일 수도, [에이전트](/agents)일 수도 있다는 점입니다** — 여기서부터 시작하겠습니다.
+## 이슈의 구성
-## 에이전트에게 이슈 할당하기
+| 내용 | 용도 |
+|---|---|
+| **제목과 설명** | 목표, 배경, 요구 사항, 인수 조건입니다. |
+| **상태와 우선순위** | 작업이 어느 단계에 있고 무엇을 먼저 처리할지 나타냅니다. |
+| **담당자** | 워크스페이스 멤버, 에이전트 또는 스쿼드입니다. |
+| **날짜, 라벨, 사용자 지정 속성** | 계획, 분류, 팀 고유 필드입니다. |
+| **프로젝트와 상하위 관계** | 더 큰 작업 범위에 포함하거나 하위 이슈로 나눕니다. |
+| **활동과 실행 로그** | 댓글, 상태 변경, 실행 태스크, 에이전트가 반환한 결과입니다. |
-이슈를 에이전트에게 [할당](/assigning-issues)하면 그 작업을 에이전트에게 넘기는 것입니다. 에이전트는 **자동으로 시작합니다** — 몇 초 안에 실행을 시작하고, 댓글로 진행 상황을 보고하며, 완료되면 상태를 done으로 전환합니다. 동료에게 일을 넘기는 것과의 유일한 차이는 에이전트는 오프라인이 되지 않고, 알림이 필요 없으며, 연중무휴 24시간 사용할 수 있다는 점입니다.
+![이슈 상세: 설명, 논의, 오른쪽 속성, 실행 로그](/images/docs/quickstart-run-result.png)
-<Callout type="info">
-에이전트의 정체성, 구성, 실행 위치에 대해서는 [에이전트](/agents)를 참고하세요.
-</Callout>
+## 이슈 만들기
-비공개 에이전트는 워크스페이스 owner와 admin만 이슈에 할당할 수 있습니다. 역할 권한에 대해서는 [멤버와 역할](/members-roles)을 참고하세요.
+**이슈** 페이지나 프로젝트에서 새 이슈를 만들고 제목을 입력합니다. 다른 속성은 언제든 보충할 수 있습니다.
-## 상태
+각 이슈에는 `MUL-123` 같은 번호가 있습니다. 숫자는 워크스페이스 안에서 증가합니다. 관리자가 워크스페이스의 이슈 접두사를 바꾸면 번호가 새 접두사로 표시됩니다. 자세한 내용은 [워크스페이스](/workspaces#워크스페이스-만들기)를 참고하세요.
-Multica에는 일곱 가지 상태가 있습니다. **어떤 상태든 다른 어떤 상태로도 바로 이동할 수 있습니다** — Multica는 워크플로를 강제하지 않으며, `backlog`에서 곧바로 `done`으로 건너뛰어도 막지 않습니다.
+## 담당자 선택
-| 상태 | 의미 |
+| 담당자 | 결과 |
|---|---|
-| `backlog` | 아직 일정에 없음 |
-| `todo` | 일정이 잡혔고, 시작할 준비됨 |
-| `in_progress` | 작업 중 |
-| `in_review` | 리뷰 대기 중 |
-| `done` | 완료됨 |
-| `blocked` | 외부 요인으로 막힘 |
-| `cancelled` | 취소됨 |
+| **멤버** | 해당 멤버가 후속 작업을 책임지며 실행 태스크는 생성되지 않습니다. |
+| **에이전트** | 해당 에이전트의 실행 태스크가 생성됩니다. |
+| **스쿼드** | 스쿼드 리더가 먼저 받은 뒤 누구에게 맡길지 결정합니다. |
-이슈가 에이전트에게 할당되면, 에이전트는 자동으로 상태를 `backlog` / `todo`에서 `in_progress`로 옮기고, 완료 시 `done`으로 옮깁니다. 언제든지 직접 변경할 수도 있습니다.
+에이전트나 스쿼드에 할당할 때 이슈가 `backlog` 상태가 아니면 즉시 큐에 들어갑니다. 런타임이 오프라인이면 태스크는 큐에서 기다립니다. 보관된 에이전트와 스쿼드는 할당할 수 없습니다.
-## 우선순위
+할당은 에이전트의 접근 범위(Access)를 우회하지 않습니다. 스쿼드에 할당하면 리더의 Access를 확인합니다. 자세한 내용은 [이슈를 에이전트에게 할당하기](/assigning-issues)를 참고하세요.
-우선순위에는 다섯 단계가 있으며, 기본 이슈 목록의 정렬에 사용됩니다:
+## 상태
-| 우선순위 | 용도 |
+| 상태 | 의미 |
|---|---|
-| `No priority` | 아직 결정되지 않음 (기본값) |
-| `Urgent` | 긴급 |
-| `High` | 높음 |
-| `Medium` | 중간 |
-| `Low` | 낮음 |
+| `backlog` | 지금은 시작하지 않습니다. 에이전트에게 할당된 이슈도 `backlog`에서 벗어나야 실행 태스크가 생성됩니다. |
+| `todo` | 작업이 명확하며 시작을 기다립니다. |
+| `in_progress` | 처리 중입니다. |
+| `in_review` | 결과가 있으며 검토를 기다립니다. |
+| `done` | 완료되었습니다. |
+| `blocked` | 지금은 계속 진행할 수 없습니다. |
+| `cancelled` | 더 이상 진행하지 않으며 기록은 유지합니다. |
-## 이슈 번호
+상태 사이에는 고정된 전환 순서가 없으며 멤버와 에이전트 모두 상태를 직접 변경할 수 있습니다.
-모든 이슈에는 워크스페이스 내에서 고유한 번호가 `<prefix>-<digits>` 형식으로 부여됩니다 — 예를 들어 `MUL-123`처럼요. 번호는 생성 시점에 시스템이 부여하며 **절대 변하지 않습니다**. [워크스페이스 → 이슈 번호](/workspaces#issue-numbers)를 참고하세요.
+<Callout type="info">
+다음 두 가지 변경은 시스템이 수행합니다.
-## 댓글
+- 실행이 실패하고 해당 이슈에 다른 실행이 없으며 재시도도 트리거되지 않으면 `in_progress`가 `todo`로 돌아갑니다.
+- 연결된 GitHub PR이 종료 의도를 포함한 채 병합되고, 여전히 open 또는 draft 상태인 다른 연결 PR이 없으면 이슈가 `done`으로 바뀝니다.
+</Callout>
-이슈 아래의 댓글 스레드는 협업이 일어나는 곳입니다 — 댓글에 답글을 달고, 사람이나 에이전트를 `@`로 멘션하고, 반응을 추가할 수 있습니다.
+## 이슈와 실행 태스크
-댓글에서 에이전트를 `@`로 멘션하면 **자동으로 트리거됩니다** — 이것은 "할당"과 더불어 에이전트를 시작하는 두 번째 방법입니다. [댓글과 멘션](/comments)과 [댓글에서 에이전트 멘션하기](/mentioning-agents)를 참고하세요.
+이슈는 계속 유지되는 작업 기록이고 [실행 태스크(task)](/tasks)는 에이전트가 한 번 실행한 기록입니다. 하나의 이슈에서 첫 구현, 추가 수정, 재검토처럼 여러 실행 태스크가 차례로 생성될 수 있습니다. 실행 태스크가 "완료됨"인 것은 이번 실행이 끝났다는 뜻일 뿐이며, 이슈의 완료 여부는 이슈 상태를 기준으로 판단합니다.
-## 이슈 삭제하기
+## 프로젝트와 하위 이슈
-<Callout type="warning">
-이슈를 삭제하면 그 아래의 모든 댓글, 반응, 첨부 파일과 대기 중인 에이전트 작업이 **즉시** 삭제됩니다(실행 중인 작업은 취소됩니다). **되돌릴 수 없습니다.**
+하나의 이슈는 최대 하나의 [프로젝트](/projects)에 속할 수 있습니다. 프로젝트는 그 안의 실행에 공유 설명과 리소스를 제공합니다. 다른 프로젝트로 옮겨도 복사본이 만들어지지 않습니다.
-이슈를 단지 보이지 않게 하고 싶을 뿐이라면, **상태를 `cancelled`로 변경하는 것이 삭제보다 안전합니다** — 데이터가 남아 있어 나중에 다시 가져올 수 있습니다.
-</Callout>
+큰 작업은 하위 이슈로 나눌 수 있습니다. 상위 이슈에는 전체 목표를 남기고 하위 이슈는 각각 독립적으로 진행합니다. 상위와 하위 이슈의 상태는 서로 연동되지 않습니다.
+
+하위 이슈에는 **단계**(stage)를 지정해 1, 2, 3처럼 묶어서 진행할 수 있습니다. 현재 가장 이른 미완료 단계의 모든 하위 이슈가 `done` 또는 `cancelled`가 되면 상위 이슈에 "하위 태스크 완료" 알림이 전달됩니다. 상위 이슈 담당자가 에이전트이면 에이전트가 깨어나 다음 단계로 진행할지 결정합니다. 단계를 지정하지 않은 하위 이슈는 같은 묶음으로 간주하며 모두 끝났을 때 한 번 알립니다.
-## 프로젝트
+## 보기 전환
-프로젝트는 여러 이슈를 하나로 묶는 컨테이너입니다. 이슈는 최대 하나의 프로젝트에 속하거나, 아예 어떤 프로젝트에도 속하지 않을 수 있습니다.
+이슈 페이지에서는 목록, 보드, 표, 간트 차트, 스윔레인 다섯 가지 보기를 제공합니다. 상태, 담당자, 프로젝트, 기타 속성으로 필터링하고 정렬할 수 있으며 모두 같은 이슈 집합을 표시합니다.
-프로젝트에는 자체 **리더**가 있습니다 — **이슈의 담당자와 마찬가지로, 리더도 사람일 수도, 에이전트일 수도 있습니다**.
+## 이슈 삭제
-프로젝트를 삭제해도 **그 안의 이슈는 삭제되지 않습니다**: 해당 이슈들은 단지 프로젝트에서 분리되어 워크스페이스에 그대로 남습니다.
+모든 워크스페이스 멤버가 이슈를 삭제할 수 있습니다.
+
+<Callout type="warning">
+삭제는 복구할 수 없습니다. 이슈와 댓글, 첨부 파일, 관련 기록이 영구적으로 제거되고 끝나지 않은 실행 태스크도 취소됩니다. 더 이상 진행하지 않으려면 상태를 `cancelled`로 바꾸세요. 논의와 결과는 계속 확인할 수 있습니다.
+</Callout>
## 다음 단계
-- [댓글과 멘션](/comments) — 이슈 아래에서 협업하기
-- [에이전트](/agents) — "에이전트에게 할당"이 실제로 어떻게 작동하는지 이해하기
+- [프로젝트](/projects) — 여러 이슈를 함께 완료해야 하는 작업을 구성합니다.
+- [댓글](/comments) — 이슈를 중심으로 논의하고 답글과 @멘션을 사용합니다.
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 에이전트에게 작업을 맡기고 첫 실행을 시작합니다.
+- [실행 태스크](/tasks) — 큐 대기, 실행, 재시도, 취소를 알아봅니다.
diff --git a/apps/docs/content/docs/issues.mdx b/apps/docs/content/docs/issues.mdx
index 2eeca477d7..f10afe03af 100644
--- a/apps/docs/content/docs/issues.mdx
+++ b/apps/docs/content/docs/issues.mdx
@@ -1,79 +1,93 @@
---
-title: Issues and projects
-description: Multica's core unit of work — assignable to a person or to an agent.
+title: Issues
+description: An issue holds one piece of work's context, assignee, status, and execution history.
---
import { Callout } from "fumadocs-ui/components/callout";
-An issue is a self-contained unit of work in Multica — a bug, a new feature, a thing that needs doing. Every issue has a **title**, a **description** (Markdown supported), a **status**, a **priority**, an **assignee**, and optionally belongs to a **project**. If you've used Linear or Jira, this is the same shape.
+An issue is Multica's basic unit for organizing work: a feature, a bug, an investigation — anything a member or an agent should own and drive forward. The discussion around it, its status changes, and every run stay in one place, so there is no need to reassemble context from chat logs or terminal output.
-**Multica's defining trait is that an issue's assignee can be a person or an [agent](/agents)** — which is where we'll start.
+## Parts of an issue
-## Assigning an issue to an agent
+| Part | Purpose |
+|---|---|
+| **Title and description** | Goal, background, requirements, and acceptance criteria. |
+| **Status and priority** | Where the work stands and what to handle first. |
+| **Assignee** | A workspace member, an agent, or a squad. |
+| **Dates, labels, and custom properties** | Planning, categorization, and your team's own fields. |
+| **Project and parent-child relationships** | Fits into a larger body of work, or splits into sub-issues. |
+| **Activity and execution log** | Comments, status changes, tasks, and results returned by agents. |
-[Assigning](/assigning-issues) an issue to an agent hands that work over to it. The agent **starts automatically** — Multica enqueues a `task` within seconds, the agent reports progress in comments, and during the run it is expected to update the issue status (typically `todo` → `in_progress` → `in_review`). The only difference from handing work to a teammate is that an agent doesn't go offline, doesn't need reminders, and is available 24/7.
+![Issue detail: description, discussion, properties on the right, and the execution log](/images/docs/quickstart-run-result.png)
-<Callout type="info">
-For agent identity, configuration, and where they run, see [Agents](/agents).
-</Callout>
+## Create an issue
-Private agents can only be assigned to issues by workspace owners and admins. For role permissions, see [Members and roles](/members-roles).
+Create one from the **Issues** page or inside a project — a title is enough, and every other property can be filled in later.
-## Status
+Each issue has a number, such as `MUL-123`. The digits increment within the workspace; after an admin changes the workspace's issue prefix, numbers display with the new prefix. See [Workspaces](/workspaces#create-a-workspace).
-Multica has seven statuses. **Any status can move directly to any other** — Multica doesn't impose a workflow, and won't stop you from jumping from `backlog` straight to `done`.
+## Choose an assignee
-| Status | Meaning |
+| Assignee | Effect |
|---|---|
-| `backlog` | Not scheduled yet |
-| `todo` | Scheduled, ready to start |
-| `in_progress` | Being worked on |
-| `in_review` | Awaiting review |
-| `done` | Completed |
-| `blocked` | Stuck on an external factor |
-| `cancelled` | Cancelled |
+| **Member** | That member owns the follow-up; no task is created. |
+| **Agent** | A task is created for that agent. |
+| **Squad** | The squad leader receives it and decides who handles it. |
-Once an issue is assigned to an agent, the agent is expected to move the status from `backlog` / `todo` to `in_progress` when it starts, then to `in_review` when it has delivered the work. Status updates are made by the agent through the Multica CLI during the run — the server does **not** flip issue status when a `task` starts or completes. `done` is usually a human confirmation or an integration (for example a PR with close intent that merges). You can also change status manually at any time.
+When assigned to an agent or a squad, the issue enqueues immediately unless it is in `backlog`; if the runtime is offline, the task waits in the queue. Archived agents and squads cannot be assigned.
-## Priority
+Assignment does not bypass an agent's Access; when assigning to a squad, the leader's Access is what gets checked. See [Assign issues to agents](/assigning-issues).
-Priority has five levels, used to order the default issue list:
+## Status
-| Priority | Use |
+| Status | Meaning |
|---|---|
-| `No priority` | Not decided yet (default) |
-| `Urgent` | Urgent |
-| `High` | High |
-| `Medium` | Medium |
-| `Low` | Low |
+| `backlog` | Not starting yet. An issue assigned to an agent only creates a task after it leaves `backlog`. |
+| `todo` | Scoped and waiting to start. |
+| `in_progress` | Being worked on. |
+| `in_review` | Has a result waiting for review. |
+| `done` | Finished. |
+| `blocked` | Cannot continue for now. |
+| `cancelled` | No longer pursued; the record stays. |
+
+There is no fixed flow between statuses — members and agents can change them directly.
-## Issue numbers
+Once an issue is assigned to an agent, the agent is expected to move the status from `backlog` / `todo` to `in_progress` when it starts, then to `in_review` when it has delivered. These updates are written explicitly by the agent through the Multica CLI during the run — the server does not flip issue status when a task starts or completes (apart from the two system exceptions below). `done` is usually a human confirmation, or an integration such as a PR with close intent that merges.
-Every issue has a workspace-unique number in the format `<prefix>-<digits>` — for example `MUL-123`. The number is assigned by the system at creation time and **never changes**. See [Workspaces → Issue numbers](/workspaces#issue-numbers).
+<Callout type="info">
+Two changes are made by the system:
-## Comments
+- When a run fails, the issue has no other runs, and no retry is triggered, `in_progress` rolls back to `todo`.
+- When a linked GitHub PR merges with close intent and no other linked PR is still open or draft, the issue becomes `done`.
+</Callout>
-The comment thread under an issue is where collaboration happens — reply to a comment, `@` a person or agent, add a reaction.
+## Issues and tasks
-`@` an agent in a comment and **it triggers automatically** — this is the second way to start an agent, alongside "assign to." See [Comments and mentions](/comments) and [Mentioning agents in comments](/mentioning-agents).
+An issue is the persistent record of a piece of work; a [task](/tasks) is one concrete run by an agent. One issue can produce several tasks over time — a first implementation, follow-up changes, another check. A completed task only means that run ended; whether the issue is finished is determined by the issue's status.
-## Deleting an issue
+## Projects and sub-issues
-<Callout type="warning">
-Deleting an issue **immediately** clears every comment, reaction, and attachment under it, along with any queued agent tasks (running tasks are cancelled). **It cannot be undone.**
+An issue belongs to at most one [project](/projects); the project provides shared instructions and resources for runs inside it. Moving an issue to another project does not create a copy.
-If you just want the issue out of sight, **changing the status to `cancelled` is safer than deleting** — the data stays, and you can pull it back later.
-</Callout>
+Larger work can be split into sub-issues: the parent issue keeps the overall goal while sub-issues progress independently. Parent and child statuses do not affect each other.
-## Projects
+Sub-issues can be given a **stage** to advance in batches — 1, 2, 3. When every sub-issue in the earliest unfinished stage reaches `done` or `cancelled`, the parent issue receives a "sub-issues completed" notification; when the parent's assignee is an agent, it wakes up and decides whether to start the next stage. Sub-issues without a stage count as one batch and notify once when they all finish.
-A project is a container that groups multiple issues together. An issue belongs to at most one project, or to no project at all.
+## Switch views
-Projects have their own **lead** — **just like an issue's assignee, a lead can be a person or an agent**.
+The Issues page offers five views — list, board, table, Gantt, and swimlane — filterable and sortable by status, assignee, project, and other properties. They all show the same issues.
-Deleting a project **does not delete the issues inside it**: those issues simply detach from the project and remain in the workspace.
+## Delete an issue
+
+Any workspace member can delete an issue.
+
+<Callout type="warning">
+Deletion cannot be undone: the issue with its comments, attachments, and linked records is permanently removed, and unfinished tasks are cancelled. When the work is simply no longer pursued, set the status to `cancelled` instead — the discussion and results stay available.
+</Callout>
-## Next
+## Next steps
-- [Comments and mentions](/comments) — collaborating under an issue
-- [Agents](/agents) — understand how "assign to an agent" actually works
+- [Projects](/projects) — organize work that takes multiple issues to finish.
+- [Comments](/comments) — discuss, reply, and @mention around an issue.
+- [Assign issues to agents](/assigning-issues) — hand work to an agent and start the first run.
+- [Tasks](/tasks) — learn about queuing, running, retries, and cancellation.
diff --git a/apps/docs/content/docs/issues.zh.mdx b/apps/docs/content/docs/issues.zh.mdx
index 862d903df1..020da6636e 100644
--- a/apps/docs/content/docs/issues.zh.mdx
+++ b/apps/docs/content/docs/issues.zh.mdx
@@ -1,79 +1,93 @@
---
-title: Issue 与 project
-description: Multica 的核心工作单位——可以分配给人,也可以分配给智能体。
+title: Issues
+description: Issue 保存一项工作的上下文、负责人、状态和执行记录。
---
import { Callout } from "fumadocs-ui/components/callout";
-Issue(工作项)是 Multica 里一个独立工作的单位——一条 bug、一个新功能、一项要做的事。每个 issue 有**标题**、**描述**(支持 Markdown)、**状态**、**优先级**、**分配人(assignee)**,可选地还能归入某个 **project**。如果你用过 Linear 或 Jira,它们是同类东西。
+Issue 是 Multica 中安排工作的基本单位:一项功能、一个 bug、一次调研,任何需要成员或智能体负责推进的工作。围绕它的讨论、状态变化和每次执行都留在同一处,无需再从聊天记录或终端日志中拼接上下文。
-**Multica 最大的特色是:issue 的分配人可以是人,也可以是 [智能体](/agents)**——这是下面先讲的第一件事。
+## Issue 的组成
-## 把 issue 分配给智能体
+| 内容 | 用途 |
+|---|---|
+| **标题和描述** | 目标、背景、要求和验收条件。 |
+| **状态和优先级** | 工作处于哪个阶段,先处理什么。 |
+| **负责人** | 工作区成员、智能体或小队。 |
+| **日期、标签和自定义属性** | 计划、分类和团队自己的字段。 |
+| **项目和父子关系** | 归入更大的工作范围,或拆成子 issue。 |
+| **动态和执行日志** | 评论、状态变化、执行任务和智能体返回的结果。 |
-把 issue [分配](/assigning-issues) 给某个智能体等于把这项工作交给它。智能体会**自动开工**——Multica 在几秒内入队一个 `task`,智能体在评论里汇报进展,并在执行过程中按约定更新 issue 状态(通常是 `todo` → `in_progress` → `in_review`)。和给同事派活的区别只在于:它不下线、不需要你提醒、7×24 可用。
+![Issue 详情:描述、讨论、右侧属性与执行日志](/images/docs/quickstart-run-result.png)
-<Callout type="info">
-智能体的身份、配置、运行位置详见 [智能体](/agents)。
-</Callout>
+## 创建 issue
-私有智能体(private agent)只有工作区的 owner 和 admin 能分配到 issue 上。角色权限详见 [成员与权限](/members-roles)。
+在 **Issues** 页面或项目中新建,填写标题即可,其余属性随时补充。
-## 状态
+每个 issue 有一个编号,例如 `MUL-123`。数字在工作区内递增;管理员修改工作区的 issue 前缀后,编号会用新前缀显示。详见[工作区](/workspaces#创建工作区)。
-Multica 提供七种状态。**任何状态可以直接改到任何状态**——Multica 不强加工作流,不会因为你从 `backlog` 直接跳到 `done` 就拦你。
+## 选择负责人
-| 状态 | 含义 |
+| 负责人 | 效果 |
|---|---|
-| `backlog` | 还没排期 |
-| `todo` | 已排期、准备开工 |
-| `in_progress` | 正在做 |
-| `in_review` | 等待 review |
-| `done` | 已完成 |
-| `blocked` | 被外部因素卡住 |
-| `cancelled` | 已取消 |
+| **成员** | 由这位成员负责跟进,不创建执行任务。 |
+| **智能体** | 为该智能体创建一条执行任务。 |
+| **小队** | 由小队 leader 接收,再决定交给谁处理。 |
-把 issue 分配给智能体后,智能体开工时应把状态从 `backlog` / `todo` 推到 `in_progress`,交付工作后再推到 `in_review`。这些状态变更由智能体在运行中通过 Multica CLI 显式写入——`task` 开始或完成时,服务端**不会**自动改 issue 状态。`done` 通常留给人工确认,或由集成完成(例如带 close intent 的 PR merge)。你也可以随时手动改。
+分配给智能体或小队时,issue 不在 `backlog` 就会立即入队;运行时离线时,任务留在队列中等待。已归档的智能体和小队不能被分配。
-## 优先级
+分配不会绕过智能体的访问范围(Access);分配给小队时,校验的是 leader 的 Access。详见[分配 issue 给智能体](/assigning-issues)。
-优先级分五档,用来排列 issue 列表的默认顺序:
+## 状态
-| 优先级 | 用途 |
+| 状态 | 含义 |
|---|---|
-| `No priority` | 还没决定(默认值) |
-| `Urgent` | 紧急 |
-| `High` | 高 |
-| `Medium` | 中 |
-| `Low` | 低 |
+| `backlog` | 暂不启动。已分配给智能体的 issue 需离开 `backlog` 后才会创建执行任务。 |
+| `todo` | 已明确,等待开始。 |
+| `in_progress` | 正在处理。 |
+| `in_review` | 已有结果,等待检查。 |
+| `done` | 已完成。 |
+| `blocked` | 暂时无法继续。 |
+| `cancelled` | 不再继续,保留记录。 |
+
+状态之间没有固定流转,成员和智能体都可以直接修改。
+
+把 issue 分配给智能体后,智能体开工时应把状态从 `backlog` / `todo` 推到 `in_progress`,交付后再推到 `in_review`。这些状态变更由智能体在运行中通过 Multica CLI 显式写入——task 开始或完成时,服务端不会自动改 issue 状态(下面两个系统例外除外)。`done` 通常留给人工确认,或由集成完成(例如带关闭意图的 PR 合并)。
-## Issue 编号
+<Callout type="info">
+两个变化由系统执行:
-每个 issue 有一个工作区内唯一的编号,格式是 `<前缀>-<数字>`,比如 `MUL-123`。编号在创建时由系统自动分配、**永不改变**。详见 [工作区 → Issue 编号](/workspaces#issue-编号)。
+- 执行失败,且该 issue 没有其他执行、也没有触发重试时,`in_progress` 回到 `todo`。
+- 关联的 GitHub PR 带关闭意图合并,且没有其他仍处于 open 或 draft 的关联 PR 时,issue 变为 `done`。
+</Callout>
-## 评论
+## Issue 与执行任务
-Issue 下面的评论区是协作发生的地方——回复某条评论、`@` 点名人或智能体、加表情反应。
+Issue 是持续存在的工作记录;[执行任务(task)](/tasks)是智能体的一次具体执行。一个 issue 可以先后产生多条执行任务——第一次实现、补充修改、再次检查。执行任务"已完成"只表示这一次执行结束;issue 是否完成,以 issue 的状态为准。
-在评论里 `@` 一个智能体会**自动触发它开工**——这是除了"分配给"之外的第二种触发方式。详见 [评论与提及](/comments) 和 [在评论里召唤智能体](/mentioning-agents)。
+## 项目和子 issue
-## 删除 issue
+一个 issue 最多属于一个[项目](/projects),项目为其中的执行提供共享说明和资源;移到另一个项目不会产生副本。
-<Callout type="warning">
-删除一个 issue 会**立即**清除它下面的所有评论、表情反应、附件,以及它上面已排队的智能体任务(正在执行的任务会被取消)。**无法恢复**。
+较大的工作可以拆成子 issue:父 issue 保留整体目标,子 issue 各自独立推进。父子状态互不联动。
-如果只是想把 issue 移出视野,**把状态改成 `cancelled` 比删除更安全**——数据还在,以后想捞回来也能捞。
-</Callout>
+子 issue 可以设置**阶段**(stage),按 1、2、3 分批推进。当前最早未完成阶段的全部子 issue 到达 `done` 或 `cancelled` 时,父 issue 会收到"子任务完成"通知;父 issue 的负责人是智能体时,它会被唤醒并决定是否推进下一阶段。未设置阶段的子 issue 视为同一批,全部结束时通知一次。
-## Project
+## 切换视图
-Project(项目)是把多个 issue 组织在一起的容器。一个 issue 最多属于一个 project,也可以不属于任何 project。
+Issues 页面提供列表、看板、表格、甘特图和泳道五种视图,可按状态、负责人、项目和其他属性筛选、排序,展示的都是同一批 issue。
-Project 有自己的**负责人(lead)**——**和 issue 的 assignee 一样,lead 可以是人,也可以是智能体**。
+## 删除 issue
+
+任何工作区成员都可以删除 issue。
-删除 project **不会删除它下面的 issue**:这些 issue 只是从这个 project 里脱离,还留在工作区里。
+<Callout type="warning">
+删除不可恢复:issue 及其评论、附件和关联记录会被永久移除,尚未结束的执行任务会被取消。不再继续时把状态改为 `cancelled`,讨论和结果仍可查阅。
+</Callout>
-## 下一步
+## 接下来
-- [评论与提及](/comments) —— 在 issue 下协作
-- [智能体](/agents) —— 理解"分配给智能体"的工作原理
+- [项目](/projects) — 组织需要多条 issue 一起完成的工作。
+- [评论](/comments) — 围绕 issue 讨论、回复和 @提及。
+- [分配 issue 给智能体](/assigning-issues) — 把工作交给智能体并开始第一次执行。
+- [执行任务](/tasks) — 了解排队、运行、重试和取消。
diff --git a/apps/docs/content/docs/lark-bot-integration.ja.mdx b/apps/docs/content/docs/lark-bot-integration.ja.mdx
index 86497d693b..65ccaba2f8 100644
--- a/apps/docs/content/docs/lark-bot-integration.ja.mdx
+++ b/apps/docs/content/docs/lark-bot-integration.ja.mdx
@@ -1,95 +1,93 @@
---
-title: Lark Bot 連携
-description: Multica エージェントを Lark(飞书)Bot に紐づければ、Lark の DM やグループからそのまま対話できます——@ でメンションして自然に話しかけたり、/issue と入力して Lark を離れずに Multica イシューを起票したりできます。
+title: Feishu Bot
+description: エージェントを Feishu に接続し、DM やグループチャットから直接仕事を依頼します。
---
import { Callout } from "fumadocs-ui/components/callout";
-任意の[エージェント](/agents)を Lark(飞书)Bot に紐づければ、チームは Lark の中から直接それを使えます——Bot に DM したり、グループで @ メンションしたり、`/issue` と入力してアプリを開かずに [Multica イシュー](/issues)を起票したりできます。エージェントの返信は、作業の進行に合わせて更新されるライブカードとしてチャットに戻ってきます。
+Multica のエージェントを Feishu Bot として接続すると、チームメンバーは Feishu から DM を送る、グループで @メンションする、`/issue` でイシューを作成するといった操作ができます。会話と実行記録は引き続き Multica ワークスペースに保存されます。
-各 Bot は 1 つの Multica エージェントと **1 対 1** で紐づきます。2 つ目のエージェントを紐づけると 2 つ目の Bot が作られます。1 つのエージェントが 2 つの Bot を持つことはありません。
+各 Bot に接続できるエージェントは 1 つだけです。Feishu で複数のエージェントを使う場合は、エージェントごとに Bot を接続してください。
-## この連携でできること
+## Bot を接続する
-| 場所 | 動作 |
-|---|---|
-| **エージェント → 連携** | エージェント詳細ページには **連携(Integrations)** タブがあります(左サイドバーにも対応する区画があります)。owner と admin はそこに **Lark に紐づける** が表示され、紐づけると **Lark に接続済み** バッジと **Lark で管理** リンクに切り替わります。 |
-| **Bot に DM** | ワークスペースメンバーが Lark の中で Bot に直接メッセージを送ります。各会話はそのエージェントとの Multica [chat](/chat) セッションになり、エージェントはスレッド内で返信します。 |
-| **グループで @ メンション** | Bot を Lark グループに追加して @ メンションします。読み取られるのはメンションしたメッセージだけで、Bot はグループ全体を聞いているわけではありません。 |
-| **`/issue` コマンド** | `/issue <タイトル>`(本文を続けてもよい)と入力すると、ワークスペースに新しい Multica イシューが作られ、あなたの名義になります。 |
-| **ライブ返信カード** | Bot はインタラクティブなカードを投稿し、エージェントの実行に合わせて更新し続けます——進捗、最終的な回答、あるいはエラーが反映されます。 |
+エージェントの所有者、ワークスペースの owner、admin が接続を開始できます。
-## エージェントを紐づける(owner / admin)
+1. **エージェント**を開き、Feishu に接続するエージェントを選びます。
+2. **連携**を開き、**Feishu に接続**をクリックします。
+3. Feishu で QR コードをスキャンし、認証を承認します。
+4. Multica に戻ります。画面に **Feishu に接続済み**と表示されたら利用できます。
-紐づけはスキャンしてインストールするフローです——アプリのシークレットをコピーする必要も、開発者コンソールでの操作も不要です。
-
-1. **Agents → あなたのエージェント** からそのエージェントを開きます。
-2. **連携(Integrations)** タブ(または左サイドバーの **連携** 区画)を開き、**Lark に紐づける** をクリックします。
-3. QR コードが表示されます。スマートフォンで **Lark → スキャン** を開き、新しい PersonalAgent Bot を認可します。
-4. スキャンが完了するとダイアログが閉じ、エージェントに **Lark に接続済み** と表示されます。あなた自身の Lark アイデンティティは自動であなたの Multica アカウントに紐づくので、すぐに Bot と対話を始められます。
+QR コードは 1 回限りの認証情報です。期限が切れた場合は再生成してください。接続済みのエージェントにはスキャン画面は再表示されません。名前や権限を変更する場合は、**Feishu で管理**をクリックします。
<Callout type="info">
-QR は使い切りで、短い時間が過ぎると失効します。認可する前に失効してしまったら、**もう一度スキャン** をクリックして新しいコードを取得してください。
+現在、新規接続を利用できるのは中国本土版の Feishu だけです。既存の国際版 Lark 接続は、引き続き利用および管理できます。
</Callout>
-エージェントが接続されると、**Lark に紐づける** ボタンは **Lark で管理** リンクに置き換わります。スコープの調整、名前の変更、追加の権限の申請が必要なときは、これを使って Lark 内の Bot のアプリページを開いてください——再スキャンは意図的に無効化されており、既存の Bot を取り残してしまわないようにしています。
+## 初回利用
-## Bot を使う(メンバー)
+メンバーが初めて Bot にメッセージを送ると、アカウント連携用のリンクが届きます。
-### 最初のメッセージ:Lark アイデンティティを紐づける
+1. リンクを開き、Multica にログインします。
+2. 紐づけるワークスペースのアカウントを確認します。
+3. Feishu に戻り、もう一度メッセージを送ります。
-初めて Bot にメッセージを送ると、Bot は **Lark アイデンティティを紐づける** よう促すカードで返信します。リンクをタップして Multica にサインインすると、あなたの Lark アカウントがあなたの Multica メンバーシップに紐づきます。これによって、エージェントがあなたとして振る舞えるようになります——たとえば `/issue` はあなたの名義でイシューを起票します。
+連携が完了すると、Multica はメッセージを送ったワークスペースメンバーを特定できるようになります。ワークスペースのメンバーではないユーザーは Bot を利用できません。
-<Callout type="warning">
-Bot を使えるのは **ワークスペースのメンバー** だけです。メンバーでない場合や、アイデンティティの紐づけをスキップした場合、Bot は返信しません——あなたのメッセージは破棄されます(内容は保存せず、監査のために記録されます)。
-</Callout>
+## Feishu から仕事を依頼する
-### 対話と `/issue`
+### DM
-- **エージェントに何でも聞く** —— Bot に DM するか、グループで @ メンションします。会話は通常のエージェント chat セッションで、エージェントはカードの中で返信します。
-- **イシューを起票する** —— `/issue Fix the login redirect` と送れば、Multica は新しいイシューを作るのと同じやり方でそのイシューをワークスペースに作ります。タイトルの後ろに行を足せば、それが説明になります。
-- **作業を見守る** —— 返信カードはエージェントの実行に合わせて自身を更新するので、進捗と結果がその場で見えます。
+Bot にそのままメッセージを送ります。後続のメッセージは同じ Multica のチャットセッションに保持され、エージェントの返信も現在の DM に返されます。
-エージェントが **オフライン**(ランタイムが接続されていない)または **アーカイブ済み** の場合、Bot はメッセージを黙って破棄するのではなく、短いステータス通知で返信します。
+### グループチャット
-## 管理と切断
+Bot をグループへ追加し、`@Bot` に続けて依頼内容を入力します。Bot が応答するのは、明示的に @メンションされたメッセージだけです。実行時には、現在のセッションで読み取れる直近のコンテキストも利用します。
-ワークスペース全体の管理は **設定 → 連携** にあります。
+### イシューを作成する
-- **接続済みの Bot** は、ワークスペース内のすべての Bot と、それぞれが紐づくエージェントを一覧表示します。この一覧はすべてのメンバーから見えます。
-- **切断** は **owner / admin 専用** です。切断すると Bot は Lark メッセージの受信を停止し、その接続が破棄されます。インストール記録は監査のために保持され、あとで同じエージェントを再び紐づけられます。
+次のように送信します。
-## 権限
+```text
+/issue ログイン後のリダイレクトを修正する
+Safari ではログインに成功してもログイン画面に残ります。
+```
-- **紐づけ / 切断** にはワークスペースの **owner** または **admin** が必要です。member には接続済み Bot 一覧は見えますが、紐づけや切断の操作は見えません。
-- **Bot との対話** には、Lark アイデンティティを紐づけたワークスペースメンバーであることが必要です。それ以外の人のメッセージは一律に破棄されます。
-- この連携は破棄されたメッセージの本文を保存することはありません——監査のために破棄理由だけを記録します。
+1 行目がタイトルになり、残りの内容が説明になります。`/issue` だけを送信した場合、Multica は直前のメッセージをタイトルとして使おうとします。
-## セルフホストのセットアップ
+## 接続を管理する
-Multica Cloud では連携はすでに利用可能です——このセクションは飛ばしてください。
+**設定 → 連携**を開くと、ワークスペースに接続済みの Bot を確認できます。ワークスペースの owner と admin はここから接続を解除できます。エージェントの所有者は、そのエージェントの**連携**ページから自分の Bot を管理できます。
-セルフホストの場合、**保存時の暗号化キーを設定するまで Lark はオフ** です。このキーは、各 Bot の app secret がデータベースに触れる前にそれを暗号化します。
+接続を解除すると、Bot は新しいメッセージを受信しなくなります。既存の会話と監査記録は削除されません。
-1. 32 バイトのキーを生成し、API サーバーに設定します。
+## セルフホスト設定
- ```dotenv
- MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+Multica Cloud では追加設定は不要です。セルフホスト環境では、Bot の認証情報を暗号化するキーを先に設定してください。
-2. API を再起動します。キーを設定するまで、**設定 → 連携** には「Lark integration not enabled」という通知が表示され、**Lark に紐づける** のエントリポイントは非表示のままになります。
+```dotenv
+MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
+```
-<Callout type="info">
-**Feishu と Lark 国際版の両対応。** 各 Bot がどのクラウド(中国大陸の Feishu = `open.feishu.cn`、国際版 Lark = `open.larksuite.com`)に属するかは、QR コードをスキャンした時点で自動的に判定され、そのインストールに保存されて、その Bot へのすべての呼び出しに使われます。1 つのデプロイで両方を同時に提供できるため、どちらのテナントのチームも追加設定なしでバインドできます。
+次のコマンドで生成できます。
-`MULTICA_LARK_HTTP_BASE_URL` / `MULTICA_LARK_CALLBACK_BASE_URL` は、デプロイ全体を上書きする任意のオプション(プロキシやモック用)としてのみ残っています。通常運用では未設定のままにして、各インストールがそれぞれのクラウドに到達するようにしてください。
+```bash
+openssl rand -base64 32
+```
-**単一クラウド構成からのアップグレード?** これらを `https://open.larksuite.com` に設定して国際版 Lark を運用していた場合、アップグレード後の初回起動時にサーバーが既存のインストールを Lark リージョンへ付け替えるので、その後はこの上書きを外せます。中国大陸の Feishu デプロイでは操作は不要です。
-</Callout>
+API サービスを再起動した後、エージェントの**連携**ページから Bot を接続します。このキーは継続して保管してください。変更または紛失すると既存の認証情報を復号できなくなり、Bot の再接続が必要になります。
+
+`MULTICA_LARK_HTTP_BASE_URL` と `MULTICA_LARK_CALLBACK_BASE_URL` は、プロキシやテストなどの特殊な環境でのみ使用します。通常は設定する必要はありません。
+
+## よくある問題
+
+- **接続ボタンが表示されない**: 現在のアカウントがエージェントの所有者、ワークスペースの owner、admin のいずれかであることを確認します。セルフホストの場合は暗号化キーも確認してください。
+- **QR コードの期限が切れた**: ダイアログを閉じて、接続をもう一度開始します。
+- **Bot からアカウント連携を求められる**: 連携用リンクを開き、そのワークスペースで使う Multica アカウントにログインします。
+- **Bot が実行しない**: エージェントがアーカイブされていないことと、使用する[ランタイム](/daemon-runtimes)がオンラインであることを確認します。
-## 次に
+## 次のステップ
-- [エージェント](/agents) — 各 Bot はちょうど 1 つのエージェントに紐づきます
-- [Chat](/chat) — Bot の会話が Multica 内で対応するもの
-- [イシュー](/issues) — `/issue` が作るもの
-- [環境変数](/environment-variables) — セルフホスト構成の完全なリファレンス
+- [チャット連携](/channels) — プラットフォームの比較、セッションの分離、アカウント連携
+- [エージェントとチャットする](/chat) — Bot の会話と実行の仕組み
+- [イシュー](/issues) — `/issue` で作成される作業単位
diff --git a/apps/docs/content/docs/lark-bot-integration.ko.mdx b/apps/docs/content/docs/lark-bot-integration.ko.mdx
index f5e12a274b..e5ce12418d 100644
--- a/apps/docs/content/docs/lark-bot-integration.ko.mdx
+++ b/apps/docs/content/docs/lark-bot-integration.ko.mdx
@@ -1,95 +1,93 @@
---
-title: Lark Bot 연동
-description: Multica 에이전트를 Lark(飞书) 봇에 바인딩하면, Lark에서 직접 대화할 수 있습니다 — 개인 메시지나 그룹에서 @로 멘션하거나, 자연스럽게 대화하거나, /issue를 입력해 Lark를 벗어나지 않고 Multica 이슈를 생성하세요.
+title: Feishu Bot
+description: 에이전트를 Feishu에 연결해 DM이나 그룹 채팅에서 바로 작업을 요청합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-아무 [에이전트](/agents)나 Lark(飞书) 봇에 바인딩하면, 팀이 Lark 안에서 바로 그 에이전트를 사용할 수 있습니다 — 봇에게 개인 메시지를 보내거나, 그룹에서 `@`로 멘션하거나, `/issue`를 입력해 앱을 열지 않고도 [Multica 이슈](/issues)를 생성하세요. 에이전트의 답변은 실시간 카드로 채팅에 돌아오며, 작업이 진행되는 동안 계속 업데이트됩니다.
+Multica 에이전트를 Feishu Bot으로 연결하면 팀 멤버가 Feishu에서 에이전트와 DM을 나누고 그룹에서 @멘션하거나 `/issue`로 이슈를 만들 수 있습니다. 대화와 실행 기록은 계속 Multica 워크스페이스에 저장됩니다.
-각 봇은 하나의 Multica 에이전트와 **일대일**로 바인딩됩니다. 두 번째 에이전트를 바인딩하면 두 번째 봇이 생성되며, 하나의 에이전트가 두 개의 봇을 갖는 일은 없습니다.
+Bot 하나는 에이전트 하나에만 대응합니다. Feishu에서 여러 에이전트를 사용하려면 각 에이전트에 별도의 Bot을 연결하세요.
-## 연동이 하는 일
+## Bot 연결
-| 위치 | 동작 |
-|---|---|
-| **에이전트 → Integrations** | 에이전트 상세 페이지에 **Integrations** 탭이 있습니다(왼쪽 사이드바에도 대응하는 섹션이 있습니다). owner와 admin에게는 여기에 **Bind to Lark**가 보이며, 바인딩되면 **Connected to Lark** 배지와 **Manage in Lark** 링크로 바뀝니다. |
-| **봇에게 개인 메시지** | 워크스페이스 멤버가 Lark에서 봇에게 직접 메시지를 보냅니다. 각 대화는 그 에이전트와의 Multica [chat](/chat) 세션이 되며, 에이전트는 해당 스레드에서 답변합니다. |
-| **그룹에서 `@` 멘션** | 봇을 Lark 그룹에 추가하고 `@`로 멘션하세요. 멘션한 메시지만 읽으며, 봇이 그룹 전체를 듣지는 않습니다. |
-| **`/issue` 명령** | `/issue <제목>`(본문 추가 가능)을 입력하면 워크스페이스에 새 Multica 이슈가 생성되고, 당신 이름으로 귀속됩니다. |
-| **실시간 답변 카드** | 봇은 인터랙티브 카드를 게시하고 에이전트가 실행되는 동안 계속 갱신합니다 — 진행 상황, 최종 답변, 또는 오류. |
+에이전트 owner, 워크스페이스 owner, admin이 연결을 시작할 수 있습니다.
-## 에이전트 바인딩하기 (owner / admin)
+1. **에이전트**를 열고 Feishu에 연결할 에이전트를 선택합니다.
+2. **연동**으로 이동해 **Feishu에 연결**을 클릭합니다.
+3. Feishu로 QR 코드를 스캔하고 승인을 확인합니다.
+4. Multica로 돌아옵니다. 페이지에 **Feishu에 연결됨**이 표시되면 사용할 수 있습니다.
-바인딩은 스캔하여 설치하는 방식입니다 — 복사할 앱 시크릿도, 개발자 콘솔 작업도 없습니다.
-
-1. **Agents → _당신의 에이전트_**에서 에이전트를 엽니다.
-2. **Integrations** 탭으로 이동하거나(또는 왼쪽 사이드바의 **Integrations** 섹션 사용) **Bind to Lark**를 클릭합니다.
-3. QR 코드가 나타납니다. 휴대폰에서 **Lark → 스캔**을 열고, 새로 생긴 PersonalAgent 봇을 인증하세요.
-4. 스캔이 완료되면 대화상자가 닫히고 에이전트에 **Connected to Lark**가 표시됩니다. 당신의 Lark 신원이 자동으로 Multica 계정에 바인딩되므로, 곧바로 봇과 대화를 시작할 수 있습니다.
+QR 코드는 일회용 자격 증명이며 만료되면 다시 생성하면 됩니다. 이미 연결된 에이전트에는 스캔 메뉴가 다시 표시되지 않습니다. 이름이나 권한을 조정하려면 **Feishu에서 관리**를 클릭하세요.
<Callout type="info">
-QR 코드는 일회용이며 짧은 시간 후에 만료됩니다. 인증하기 전에 만료되면 **Scan again**을 클릭해 새 코드를 받으세요.
+현재 새 연결은 중국 본토 버전 Feishu에서만 만들 수 있습니다. 기존 국제 버전 Lark 연결은 계속 사용하고 관리할 수 있습니다.
</Callout>
-에이전트가 연결되면 **Bind to Lark** 버튼이 **Manage in Lark** 링크로 바뀝니다. 권한 범위를 조정하거나, 이름을 바꾸거나, 추가 권한을 요청해야 할 때 이 링크로 Lark에서 봇의 앱 페이지를 여세요 — 기존 봇이 고아가 되지 않도록 재스캔은 의도적으로 비활성화되어 있습니다.
+## 처음 사용
-## 봇 사용하기 (멤버)
+멤버가 Bot에 처음 메시지를 보내면 계정 연결 링크를 받습니다.
-### 첫 메시지: Lark 신원 바인딩하기
+1. 링크를 열고 Multica에 로그인합니다.
+2. 연결할 워크스페이스 계정을 확인합니다.
+3. Feishu로 돌아가 메시지를 다시 보냅니다.
-봇에게 처음 메시지를 보내면, **Lark 신원을 바인딩**하라는 카드로 답합니다. 링크를 탭하고 Multica에 로그인하면, 당신의 Lark 계정이 Multica 멤버십에 연결됩니다. 바로 이 단계가 에이전트로 하여금 당신을 대신해 행동하게 합니다 — 예를 들어 `/issue`는 이슈를 당신 이름으로 생성합니다.
+연결을 마쳐야 Multica가 메시지를 보낸 워크스페이스 멤버를 확인할 수 있습니다. 멤버가 아닌 사람은 Bot을 사용할 수 없습니다.
-<Callout type="warning">
-**워크스페이스 멤버**만 봇을 사용할 수 있습니다. 멤버가 아니거나 신원 바인딩을 건너뛰면 봇은 응답하지 않으며, 메시지는 폐기됩니다(감사 목적으로 기록되며, 내용은 저장하지 않습니다).
-</Callout>
+## Feishu에서 작업 요청
+
+### DM
+
+Bot에 바로 메시지를 보내면 됩니다. 연속된 메시지는 같은 Multica 대화에 유지되며 에이전트의 답변도 현재 대화로 돌아옵니다.
-### 대화와 `/issue`
+### 그룹 채팅
-- **무엇이든 에이전트에게 물어보기** — 봇에게 개인 메시지를 보내거나 그룹에서 `@`로 멘션하세요. 이 대화는 일반적인 에이전트 chat 세션이며, 에이전트는 카드에서 답변합니다.
-- **이슈 생성** — `/issue 로그인 리디렉션 수정`을 보내면 Multica가 워크스페이스에 그 이슈를 생성하며, 새 이슈가 으레 할당되는 방식 그대로 처리됩니다. 제목 뒤에 줄을 더 추가하면 설명이 됩니다.
-- **작업 지켜보기** — 답변 카드는 에이전트가 실행되는 동안 스스로 갱신되므로, 진행 상황과 결과를 그 자리에서 볼 수 있습니다.
+먼저 Bot을 그룹 채팅에 추가한 뒤 `@Bot`과 요구 사항을 함께 작성합니다. Bot은 자신을 명시적으로 @멘션한 메시지에만 응답합니다. 실행할 때는 현재 대화에서 읽을 수 있는 최근 컨텍스트를 함께 사용합니다.
-에이전트가 **오프라인**(런타임이 연결되지 않음)이거나 **보관됨** 상태라면, 봇은 메시지를 조용히 폐기하는 대신 짧은 상태 안내로 답합니다.
+### 이슈 만들기
-## 관리 및 연결 해제
+다음과 같이 보냅니다.
-워크스페이스 전체 관리는 **설정 → Integrations**에 있습니다.
+```text
+/issue 로그인 후 리디렉션 문제 수정
+Safari에서 로그인에 성공해도 로그인 페이지에 계속 머뭅니다.
+```
-- **Connected bots**는 워크스페이스 내 모든 봇과 각 봇이 바인딩된 에이전트를 나열합니다. 이 목록은 모든 멤버에게 보입니다.
-- **Disconnect**는 **owner / admin 전용**입니다. 연결을 해제하면 봇이 Lark 메시지 수신을 멈추고 연결이 해체됩니다. 설치 기록은 감사용으로 유지되며, 이후 같은 에이전트를 다시 바인딩할 수 있습니다.
+첫 줄이 제목이 되고 나머지 내용이 설명이 됩니다. `/issue`만 보내면 Multica가 이전 메시지를 제목으로 사용하려고 시도합니다.
-## 권한
+## 연결 관리
-- **바인딩 / 연결 해제**에는 워크스페이스 **owner** 또는 **admin**이 필요합니다. 멤버에게는 connected-bots 목록은 보이지만 바인딩이나 연결 해제 컨트롤은 보이지 않습니다.
-- **봇과 대화하기**에는 Lark 신원이 바인딩된 워크스페이스 멤버여야 합니다. 그 외의 사람은 모두 폐기됩니다.
-- 연동은 폐기된 메시지의 본문을 절대 저장하지 않으며 — 감사용 폐기 사유만 기록합니다.
+**설정 → 연동**에서 워크스페이스에 연결된 Bot을 확인할 수 있습니다. 워크스페이스 owner와 admin은 여기서 연결을 해제할 수 있고, 에이전트 owner도 해당 에이전트의 **연동** 페이지에서 자신의 Bot을 관리할 수 있습니다.
+
+연결을 해제하면 Bot이 새 메시지를 받지 않습니다. 기존 대화와 감사 기록은 함께 삭제되지 않습니다.
## 자체 호스팅 설정
-Multica Cloud에서는 연동이 이미 사용 가능합니다 — 이 섹션은 건너뛰세요.
+Multica Cloud에는 추가 설정이 필요 없습니다. 자체 호스팅 환경에서는 Bot 자격 증명 암호화에 사용할 키를 먼저 설정해야 합니다.
-자체 호스팅의 경우, **at-rest 암호화 키를 설정하기 전까지 Lark는 꺼져 있습니다**. 이 키는 각 봇의 앱 시크릿이 데이터베이스에 닿기 전에 암호화합니다.
+```dotenv
+MULTICA_LARK_SECRET_KEY=<base64로 인코딩한 32바이트 키>
+```
-1. 32바이트 키를 생성해 API 서버에 설정합니다.
+다음과 같이 생성할 수 있습니다.
- ```dotenv
- MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+```bash
+openssl rand -base64 32
+```
-2. API를 재시작하세요. 키가 설정되기 전까지 **설정 → Integrations**에는 "Lark integration not enabled" 안내가 표시되고, **Bind to Lark** 진입점은 숨겨진 채로 유지됩니다.
+API 서비스를 다시 시작한 뒤 에이전트의 **연동** 페이지에서 Bot을 연결하세요. 이 키는 장기간 보관해야 합니다. 키를 바꾸거나 잃어버리면 기존 자격 증명을 복호화할 수 없으므로 다시 연결해야 합니다.
-<Callout type="info">
-**Feishu와 Lark 국제판을 동시에 지원.** 각 Bot이 어느 클라우드(중국 본토 Feishu = `open.feishu.cn`, 국제판 Lark = `open.larksuite.com`)에 속하는지는 QR 코드를 스캔할 때 자동으로 감지되어 해당 설치에 저장되고, 그 Bot에 대한 모든 호출에 사용됩니다. 하나의 배포로 둘을 동시에 제공하므로, 어느 테넌트의 팀이든 추가 설정 없이 바인딩할 수 있습니다.
+`MULTICA_LARK_HTTP_BASE_URL`과 `MULTICA_LARK_CALLBACK_BASE_URL`은 프록시, 테스트 같은 특수한 배포에서만 사용하며 일반적으로 설정할 필요가 없습니다.
-`MULTICA_LARK_HTTP_BASE_URL` / `MULTICA_LARK_CALLBACK_BASE_URL`는 배포 전체를 덮어쓰는 선택적 오버라이드(프록시나 mock용)로만 남아 있습니다. 일반 운영에서는 설정하지 않은 채로 두어 각 설치가 자기 클라우드에 도달하도록 하세요.
+## 자주 묻는 문제
-**단일 클라우드 구성에서 업그레이드하나요?** 이 변수들을 `https://open.larksuite.com`으로 설정해 국제판 Lark를 운영했다면, 업그레이드 후 첫 부팅 시 서버가 기존 설치를 Lark 리전으로 다시 표시하므로 이후에는 오버라이드를 지울 수 있습니다. 중국 본토 Feishu 배포에서는 별도 작업이 필요 없습니다.
-</Callout>
+- **연결 버튼이 없음**: 현재 계정이 에이전트 owner, 워크스페이스 owner, admin인지 확인하고 자체 호스팅 키가 설정되었는지 확인합니다.
+- **QR 코드 만료**: 팝업을 닫고 연결을 다시 시작합니다.
+- **Bot이 계정 연결을 요구함**: 연결 링크를 열고 해당 워크스페이스의 Multica 계정으로 로그인합니다.
+- **Bot이 실행되지 않음**: 에이전트가 보관 처리되었는지, 사용하는 [런타임](/daemon-runtimes)이 온라인인지 확인합니다.
-## 다음
+## 다음 단계
-- [에이전트](/agents) — 각 봇은 정확히 하나의 에이전트에 바인딩됩니다
-- [Chat](/chat) — 봇 대화가 Multica 내부에서 무엇에 대응하는지
-- [이슈](/issues) — `/issue`가 생성하는 것
-- [환경 변수](/environment-variables) — 전체 자체 호스팅 구성 참조
+- [채팅 연동](/channels) — 플랫폼 비교, 대화 격리, 계정 연결 방식을 알아봅니다.
+- [에이전트와 대화](/chat) — Bot 뒤의 대화 및 실행 모델을 알아봅니다.
+- [이슈](/issues) — `/issue`가 만드는 작업 단위를 알아봅니다.
diff --git a/apps/docs/content/docs/lark-bot-integration.mdx b/apps/docs/content/docs/lark-bot-integration.mdx
index 87b6e5d46b..0200305723 100644
--- a/apps/docs/content/docs/lark-bot-integration.mdx
+++ b/apps/docs/content/docs/lark-bot-integration.mdx
@@ -1,95 +1,94 @@
---
-title: Lark Bot integration
-description: Bind a Multica agent to a Lark (飞书) Bot, then talk to it from a Lark DM or group — @-mention it, chat naturally, or type /issue to file a Multica issue without leaving Lark.
+title: Feishu Bot
+description: Connect an agent to Feishu and hand it work directly from a DM or a group chat.
---
import { Callout } from "fumadocs-ui/components/callout";
-Bind any [agent](/agents) to a Lark (飞书) Bot and your team can work with it from inside Lark — DM the Bot, @-mention it in a group, or type `/issue` to file a [Multica issue](/issues) without opening the app. The agent's replies stream back into the chat as a live card that updates while it works.
+Connect a Multica agent as a Feishu Bot and team members can DM it in Feishu, @-mention it in a group, or use `/issue` to create issues. Conversations and run records are still saved to the Multica workspace.
-Each Bot is bound **one-to-one** to a single Multica agent. Binding a second agent creates a second Bot; one agent never has two Bots.
+Each Bot maps to exactly one agent. To use several agents in Feishu, connect a Bot for each of them.
-## What the integration does
+## Connect a Bot
-| Surface | Behavior |
-|---|---|
-| **Agent → Integrations** | The agent detail page has an **Integrations** tab (and a matching section in the left sidebar). Owners and admins see **Bind to Lark** there; once bound it flips to a **Connected to Lark** badge with a **Manage in Lark** link. |
-| **DM the Bot** | A workspace member messages the Bot directly in Lark. Each conversation becomes a Multica [chat](/chat) session with the agent; the agent answers in-thread. |
-| **@-mention in a group** | Add the Bot to a Lark group and @-mention it. Only the mentioning message is read — the Bot does not listen to the whole group. |
-| **`/issue` command** | Typing `/issue <title>` (optionally with a body) creates a new Multica issue in the workspace, attributed to you. |
-| **Live reply card** | The Bot posts an interactive card and keeps patching it as the agent runs — progress, the final answer, or an error. |
+The agent's owner and workspace owners and admins can start a connection:
-## Bind an agent (owner / admin)
+1. Open **Agents** and select the agent to connect to Feishu.
+2. Go to **Integrations** and click **Bind to Feishu**.
+3. Scan the QR code with Feishu and confirm the authorization.
+4. Return to Multica. Once the page shows **Connected to Feishu**, the Bot is ready.
-Binding uses a scan-to-install flow — no app secrets to copy, no developer console steps.
-1. Open the agent in **Agents → _your agent_**.
-2. Go to the **Integrations** tab (or use the **Integrations** section in the left sidebar) and click **Bind to Lark**.
-3. A QR code appears. On your phone, open **Lark → Scan**, then authorize the new PersonalAgent Bot.
-4. When the scan completes the dialog closes and the agent shows **Connected to Lark**. Your own Lark identity is bound to your Multica account automatically, so you can start chatting with the Bot right away.
+The QR code is a one-time credential; if it expires, generate a new one. An agent that is already connected no longer shows the scan entry point; to rename the Bot or adjust its permissions, click **Manage in Feishu**.
<Callout type="info">
-The QR is single-use and expires after a short window. If it lapses before you authorize, click **Scan again** for a fresh code.
+New connections are currently open only for mainland-China Feishu. Existing international Lark connections keep working and can still be managed.
</Callout>
-Once an agent is connected, the **Bind to Lark** button is replaced by a **Manage in Lark** link. Use it to open the Bot's app page in Lark when you need to adjust scopes, rename it, or request additional permissions — re-scanning is intentionally disabled so you don't strand the existing Bot.
+## First use
-## Use the Bot (members)
+The first time a member messages the Bot, they receive an account binding link:
-### First message: bind your Lark identity
+1. Open the link and sign in to Multica.
+2. Confirm the workspace account to link.
+3. Return to Feishu and send the message again.
-The first time you message the Bot, it replies with a card asking you to **bind your Lark identity**. Tap the link, sign in to Multica, and your Lark account is linked to your Multica membership. This is what lets the agent act as you — for example, `/issue` files the issue under your name.
+Only after binding can Multica confirm which workspace member a message comes from. Non-members cannot use the Bot.
-<Callout type="warning">
-Only people who are **members of the workspace** can use the Bot. If you aren't a member, or you skip the identity bind, the Bot won't respond — your message is dropped (and recorded for audit, without its contents).
-</Callout>
+## Hand work to the agent in Feishu
-### Chat and `/issue`
+### Direct messages
-- **Ask the agent anything** — DM the Bot or @-mention it in a group. The conversation is a normal agent chat session; the agent replies in the card.
-- **File an issue** — send `/issue Fix the login redirect` and Multica creates that issue in the workspace, assigned the way any new issue would be. Add more lines after the title for a description.
-- **Watch it work** — the reply card patches itself while the agent runs, so you see progress and the result in place.
+Message the Bot directly. Consecutive messages stay in the same Multica conversation, and the agent's replies go back to that conversation.
-If the agent is **offline** (its runtime isn't connected) or **archived**, the Bot replies with a short status notice instead of silently dropping your message.
+### Group chats
-## Manage and disconnect
+Add the Bot to the group first, then `@Bot` and describe what you need. The Bot only responds to messages that explicitly @-mention it; when it runs, it draws on the recent context it can read in the current session.
-Workspace-wide management lives in **Settings → Integrations**:
+### Create an issue
-- **Connected bots** lists every Bot in the workspace and the agent each one is bound to. This list is visible to all members.
-- **Disconnect** is **owner / admin only**. Disconnecting stops the Bot from receiving Lark messages and tears down its connection; the installation record is kept for audit, and you can re-bind the same agent later.
+Send:
-## Permissions
+```text
+/issue Fix the redirect after login
+Safari stays on the login page after a successful sign-in.
+```
-- **Bind / disconnect** require workspace **owner** or **admin**. Members see the connected-bots list but no bind or disconnect controls.
-- **Talking to the Bot** requires being a workspace member with a bound Lark identity. Everyone else is dropped.
-- The integration never stores message bodies for dropped messages — only a drop reason, for audit.
+The first line becomes the title and the rest becomes the description. If you send `/issue` alone, Multica tries to use your previous message as the title.
-## Self-host setup
+## Manage connections
-On Multica Cloud the integration is already available — skip this section.
+Open **Settings → Integrations** to view the Bots connected in the workspace. Workspace owners and admins can disconnect them here; an agent's owner can also manage their own Bot from that agent's **Integrations** page.
-For self-host, Lark is **off until you set an at-rest encryption key**. The key encrypts each Bot's app secret before it touches the database.
+After disconnecting, the Bot stops receiving new messages. Existing conversations and audit records are not deleted.
-1. Generate a 32-byte key and set it on the API server:
+## Self-hosting setup
- ```dotenv
- MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+Multica Cloud needs no extra configuration. A self-hosted deployment must first set a key used to encrypt Bot credentials:
-2. Restart the API. Until the key is set, **Settings → Integrations** shows a "Lark integration not enabled" notice and the **Bind to Lark** entry points stay hidden.
+```dotenv
+MULTICA_LARK_SECRET_KEY=<base64-encoded 32-byte key>
+```
-<Callout type="info">
-**Feishu and Lark international, side by side.** The cloud each Bot belongs to — mainland Feishu (`open.feishu.cn`) or Lark international (`open.larksuite.com`) — is detected automatically when you scan the QR, stored on the installation, and used for every call to that Bot. A single deployment serves both at once, so teams on either tenant can bind without any extra configuration.
+Generate one like this:
-The `MULTICA_LARK_HTTP_BASE_URL` / `MULTICA_LARK_CALLBACK_BASE_URL` env vars remain only as an optional deployment-wide override (a proxy or a mock); leave them unset for normal operation so each installation keeps reaching its own cloud.
+```bash
+openssl rand -base64 32
+```
-**Upgrading from a single-cloud setup?** If you ran an international-Lark deployment by setting those vars to `https://open.larksuite.com`, the server relabels your existing installations to the Lark region on first boot after upgrade — you can then clear the override. Mainland deployments need no action.
-</Callout>
+Restart the API server, then connect the Bot from the agent's **Integrations** page. Keep this key long-term: if it is rotated or lost, existing credentials can no longer be decrypted and the Bot must be reconnected.
+
+`MULTICA_LARK_HTTP_BASE_URL` and `MULTICA_LARK_CALLBACK_BASE_URL` exist only for special deployments such as proxies and testing; leave them unset in normal operation.
+
+## Troubleshooting
+
+- **No bind button**: confirm the current account is the agent's owner or a workspace owner or admin, and check that the self-hosting key is configured.
+- **QR code expired**: close the dialog and start the connection again.
+- **The Bot asks for account binding**: open the binding link and sign in with the Multica account for that workspace.
+- **The Bot doesn't run**: check whether the agent is archived and whether the [runtime](/daemon-runtimes) it uses is online.
-## Next
+## Next steps
-- [Agents](/agents) — each Bot is bound to exactly one agent
-- [Chat](/chat) — what a Bot conversation maps to inside Multica
-- [Issues](/issues) — what `/issue` creates
-- [Environment variables](/environment-variables) — full self-host configuration reference
+- [Chat integrations](/channels) — platform comparison, session isolation, and account binding mechanics.
+- [Chat](/chat) — the conversation and execution model behind the Bot.
+- [Issues](/issues) — the unit of work `/issue` creates.
diff --git a/apps/docs/content/docs/lark-bot-integration.zh.mdx b/apps/docs/content/docs/lark-bot-integration.zh.mdx
index 82d1e60dac..65398da04d 100644
--- a/apps/docs/content/docs/lark-bot-integration.zh.mdx
+++ b/apps/docs/content/docs/lark-bot-integration.zh.mdx
@@ -1,95 +1,94 @@
---
-title: 飞书 Bot 接入
-description: 把 Multica 智能体绑定到飞书(Lark)Bot,就能直接在飞书里和它对话——私聊、群里 @ 它,或者输入 /issue 直接创建 Multica issue,全程不用离开飞书。
+title: 飞书 Bot
+description: 把智能体接入飞书,在私聊或群聊中直接交代工作。
---
import { Callout } from "fumadocs-ui/components/callout";
-把任意[智能体](/agents)绑定到飞书 Bot,团队就能在飞书里直接使用它——私聊 Bot、在群里 @ 它,或者输入 `/issue` 直接创建一个 [Multica issue](/issues),不用打开应用。智能体的回复会以一张实时卡片的形式回到聊天里,随着它干活不断更新。
+把一个 Multica 智能体连接成飞书 Bot 后,团队成员可以在飞书里私聊它、在群里 @ 它,也可以用 `/issue` 创建 issue。对话和执行记录仍会保存到 Multica 工作区。
-每个 Bot 与一个 Multica 智能体**一对一**绑定。再绑定一个智能体会创建另一个 Bot;一个智能体永远不会有两个 Bot。
+每个 Bot 只对应一个智能体。需要在飞书中使用多个智能体时,分别为它们连接 Bot。
-## 这个集成能做什么
+## 连接 Bot
-| 入口 | 行为 |
-|---|---|
-| **智能体 → 集成** | 智能体详情页有一个 **集成(Integrations)** tab(左侧栏也有对应的区块)。所有者和管理员能在这里看到 **绑定到飞书**;绑定后会变成 **已连接到飞书** 徽标,并带一个 **在飞书中管理** 链接。 |
-| **私聊 Bot** | 工作区成员在飞书里直接给 Bot 发消息。每段对话都会成为该智能体的一个 Multica [chat](/chat) 会话,智能体在会话里回复。 |
-| **群里 @ 它** | 把 Bot 加进飞书群再 @ 它。Bot 只读取 @ 它的那条消息,不会监听整个群。 |
-| **`/issue` 命令** | 输入 `/issue <标题>`(可附正文)会在工作区创建一个新的 Multica issue,记在你名下。 |
-| **实时回复卡片** | Bot 会发出一张可交互卡片,并随着智能体运行不断更新——进度、最终答复或报错。 |
+智能体的所有者、工作区 owner 和 admin 可以发起连接:
-## 绑定智能体(所有者 / 管理员)
+1. 打开 **智能体**,选择要接入飞书的智能体。
+2. 进入 **集成**,点击 **绑定到飞书**。
+3. 用飞书扫描二维码并确认授权。
+4. 回到 Multica。页面显示 **已连接到飞书** 后即可使用。
-绑定走的是扫码安装流程——不用复制任何应用密钥,也不用进开发者后台。
-1. 在 **Agents → 你的智能体** 打开该智能体。
-2. 进入 **集成(Integrations)** tab(或使用左侧栏的 **集成** 区块),点击 **绑定到飞书**。
-3. 弹出一个二维码。用手机打开 **飞书 → 扫一扫**,然后授权这个新的 PersonalAgent Bot。
-4. 扫码完成后弹窗关闭,智能体显示 **已连接到飞书**。你自己的飞书身份会自动绑定到你的 Multica 账号,绑完即可开始和 Bot 对话。
+二维码为一次性凭证,过期后重新生成即可。已经连接的智能体不会再次显示扫码入口;需要改名或调整权限时,点击 **在飞书中管理**。
<Callout type="info">
-二维码是一次性的,并且会在较短时间后过期。如果在授权前就过期了,点 **重新扫码** 获取新码即可。
+目前只开放中国大陆版飞书的新连接入口。已有的国际版 Lark 连接仍可继续使用和管理。
</Callout>
-智能体连接后,**绑定到飞书** 按钮会替换成 **在飞书中管理** 链接。需要调整权限范围、改名或申请更多权限时,用它打开 Bot 在飞书里的应用页面——重新扫码被刻意禁用,以免把已有的 Bot 弄成孤儿。
+## 第一次使用
-## 使用 Bot(成员)
+成员第一次给 Bot 发消息时,会收到一个账号绑定链接:
-### 第一条消息:绑定你的飞书身份
+1. 打开链接并登录 Multica。
+2. 确认要关联的工作区账号。
+3. 回到飞书,再发送一次消息。
-第一次给 Bot 发消息时,它会回一张卡片,让你 **绑定飞书身份**。点开链接、登录 Multica,你的飞书账号就会关联到你的 Multica 成员身份。正是这一步让智能体能以你的身份行事——比如 `/issue` 会把 issue 记在你名下。
+绑定后,Multica 才能确认消息来自哪位工作区成员。非成员无法使用 Bot。
-<Callout type="warning">
-只有**工作区成员**才能使用 Bot。如果你不是成员,或者跳过了身份绑定,Bot 不会回复——你的消息会被丢弃(仅出于审计目的记录,不保存消息内容)。
-</Callout>
+## 在飞书中交代工作
-### 对话与 `/issue`
+### 私聊
-- **随便问智能体** —— 私聊 Bot,或在群里 @ 它。对话就是一段普通的智能体 chat 会话,智能体在卡片里回复。
-- **创建 issue** —— 发送 `/issue 修复登录跳转`,Multica 会在工作区创建这个 issue,和新建任何 issue 一样。标题后面再加几行就是描述。
-- **看它干活** —— 回复卡片会随着智能体运行不断更新,进度和结果都在原处呈现。
+直接给 Bot 发消息即可。连续消息保留在同一段 Multica 对话中,智能体的回复也发回当前对话。
-如果智能体**离线**(运行时未连接)或**已归档**,Bot 会回一条简短的状态提示,而不是悄悄丢掉你的消息。
+### 群聊
-## 管理与断开
+先把 Bot 加入群聊,再 `@Bot` 并写下要求。Bot 只会响应明确 @ 它的消息;执行时会结合当前会话中可读取的近期上下文。
-工作区级别的管理在 **设置 → 集成**:
+### 创建 issue
-- **已连接的 Bot** 列出工作区里每个 Bot 以及它绑定的智能体。这个列表所有成员都能看到。
-- **断开连接** 仅限 **所有者 / 管理员**。断开后 Bot 停止接收飞书消息、连接被销毁;安装记录会保留以便审计,之后你可以重新绑定同一个智能体。
+发送:
-## 权限
+```text
+/issue 修复登录后的跳转问题
+Safari 登录成功后仍然停留在登录页。
+```
-- **绑定 / 断开** 需要工作区**所有者**或**管理员**。成员能看到已连接 Bot 列表,但看不到绑定或断开的操作。
-- **和 Bot 对话** 需要你是工作区成员且已绑定飞书身份。其余的人一律被丢弃。
-- 对于被丢弃的消息,集成不会保存消息内容——只记录一个丢弃原因,用于审计。
+第一行成为标题,后面的内容成为描述。只发送 `/issue` 时,Multica 会尝试使用上一条消息作为标题。
-## 自部署配置
+## 管理连接
-在 Multica Cloud 上这个集成已经可用——可跳过本节。
+打开 **设置 → 集成** 可以查看工作区内已连接的 Bot。工作区 owner 和 admin 可以在这里断开连接;智能体所有者也可以回到该智能体的 **集成** 页面管理自己的 Bot。
-自部署时,**在你设置好静态加密密钥之前,飞书集成是关闭的**。这个密钥会在每个 Bot 的 app secret 落库之前对其加密。
+断开后,Bot 不再接收新消息,已有的对话和审计记录不会随之删除。
-1. 生成一个 32 字节的密钥并设置到 API 服务器:
+## 自托管配置
- ```dotenv
- MULTICA_LARK_SECRET_KEY=<base64 编码的 32 字节密钥>
- ```
+Multica Cloud 无需额外配置。自托管部署需要先设置一个用于加密 Bot 凭据的密钥:
-2. 重启 API。在密钥设置好之前,**设置 → 集成** 会显示「未启用飞书集成」提示,**绑定到飞书** 入口也会保持隐藏。
+```dotenv
+MULTICA_LARK_SECRET_KEY=<base64 编码的 32 字节密钥>
+```
-<Callout type="info">
-**同时支持飞书与海外版 Lark。** 每个 Bot 属于哪个云——中国大陆飞书(`open.feishu.cn`)还是海外版 Lark(`open.larksuite.com`)——会在你扫码时自动识别、记录在该安装上,并用于对这个 Bot 的所有调用。同一个部署可以同时服务两者,因此两个租户的团队都能直接绑定,无需任何额外配置。
+可以这样生成:
-`MULTICA_LARK_HTTP_BASE_URL` / `MULTICA_LARK_CALLBACK_BASE_URL` 仅作为可选的部署级覆盖项保留(用于代理或 mock);正常运行时请保持不设置,让每个安装各自连到自己的云。
+```bash
+openssl rand -base64 32
+```
-**从单云部署升级?** 如果你之前是把这两个变量设为 `https://open.larksuite.com` 来跑海外版 Lark,升级后服务会在首次启动时自动把存量安装重标记为 Lark region,之后你就可以清掉这个覆盖项。国内飞书部署无需任何操作。
-</Callout>
+重启 API 服务后,再从智能体的 **集成** 页面连接 Bot。该密钥需要长期保存:更换或丢失后,已有凭据无法解密,需要重新连接。
+
+`MULTICA_LARK_HTTP_BASE_URL` 和 `MULTICA_LARK_CALLBACK_BASE_URL` 只用于代理、测试等特殊部署,正常情况下不需要设置。
+
+## 常见问题
+
+- **没有绑定按钮**:确认当前账号是智能体所有者、工作区 owner 或 admin,并检查自托管密钥是否已配置。
+- **二维码失效**:关闭弹窗后重新发起连接。
+- **Bot 要求绑定账号**:打开绑定链接并使用该工作区的 Multica 账号登录。
+- **Bot 不执行**:检查智能体是否已归档,以及它使用的[运行时](/daemon-runtimes)是否在线。
-## 下一步
+## 接下来
-- [智能体](/agents) —— 每个 Bot 都绑定到恰好一个智能体
-- [Chat](/chat) —— 一段 Bot 对话在 Multica 里对应什么
-- [Issues](/issues) —— `/issue` 创建的是什么
-- [环境变量](/environment-variables) —— 完整的自部署配置参考
+- [聊天集成](/channels) — 平台对比、会话隔离和账号绑定机制。
+- [与智能体对话](/chat) — Bot 背后的对话与执行模型。
+- [Issues](/issues) — `/issue` 创建的工作单位。
diff --git a/apps/docs/content/docs/members-roles.ja.mdx b/apps/docs/content/docs/members-roles.ja.mdx
index 058aa71668..9b7f0cf1d2 100644
--- a/apps/docs/content/docs/members-roles.ja.mdx
+++ b/apps/docs/content/docs/members-roles.ja.mdx
@@ -1,60 +1,55 @@
---
-title: メンバーと役割
-description: ワークスペースの3つの役割(owner、admin、member)がそれぞれ何をできるのか、そして人をどのように招待するのかを説明します。
+title: メンバーとロール
+description: メンバーを招待し、owner、admin、member の 3 つのロールでワークスペースの権限を管理します。
---
import { Callout } from "fumadocs-ui/components/callout";
-[ワークスペース](/workspaces)に属するすべての人は役割を持ち、その役割によって何ができるかが決まります。Multica には3つの役割があります。**owner**(ワークスペースのオーナー)、**admin**、**member** です。[イシュー](/issues)の作成、[コメント](/comments)の作成、[エージェント](/agents)の利用といった日常的な作業のほとんどは、3つの役割すべてで利用できます。**違いはチーム管理の領域に集中しています。**
+[ワークスペース](/workspaces)に参加した人は全員メンバーで、各メンバーは `owner`、`admin`、`member` のいずれか 1 つのロールを持ちます。ロールが制御するのはワークスペース設定とチーム管理だけです。イシューの作成やコメントの投稿といった日常のコラボレーションは、すべてのメンバーに開かれています。
-## 権限の一覧
+## 3 つのロール
-以下の表は、チーム管理アクションにおける最も重要な違いをまとめたものです。
+| 操作 | owner | admin | member |
+|---|:---:|:---:|:---:|
+| ワークスペースの閲覧と日常のコラボレーション | ✓ | ✓ | ✓ |
+| ワークスペース設定の変更 | ✓ | ✓ | — |
+| `admin` または `member` の招待 | ✓ | ✓ | — |
+| `admin`、`member` の変更・削除 | ✓ | ✓ | — |
+| `owner` の付与・剥奪・削除 | ✓ | — | — |
+| ワークスペースの削除 | ✓ | — | — |
-| アクション | owner | admin | member |
-|---|---|---|---|
-| 新しい admin または member を招待 | ✓ | ✓ | ✗ |
-| **新しい owner を招待** | ✓ | ✗ | ✗ |
-| admin または member を降格 / 削除 | ✓ | ✓ | ✗ |
-| **別の owner を降格 / 削除** | ✓ | ✗ | ✗ |
-| ワークスペースの削除 | ✓ | ✗ | ✗ |
-
-**member は誰も招待できません** — 招待は admin 層の権限です。**owner だけが他の人を owner に昇格できます** — admin は member や他の admin を昇格・降格できますが、新しい owner を作成することはできません。同様に、admin は member や他の admin を削除できますが、**既存の owner には手を出せません**。要点は、最上位の層をすでに保有している人だけがその層を付与できるようにすることです — 権限は上方向に漏れません。
+ワークスペースには常に最低 1 人の `owner` が必要です。最後の `owner` は降格も削除もできず、退出もできません。
<Callout type="info">
-エージェントの可視性には「workspace」と「private」の2種類があります。private エージェントは owner と admin だけがイシューに割り当てられます — これは特定の人だけが利用するように作られた構成を保護するためです。[エージェント](/agents)を参照してください。
+ロールは、誰がエージェントを実行できるかを決めません。各エージェントには独自のアクセス範囲(Access)があり、`owner` や `admin` もそれを迂回して、許可されていないエージェントを実行することはできません。詳しくは[エージェント](/agents#権限と-access)を参照してください。
</Callout>
-## 新しいメンバーを招待する
+## メンバーの招待
+
+`owner` と `admin` は、設定 → メンバーでメールアドレスを入力し、ロールを選んで招待を送信します。招待で付与できるのは `admin` または `member` だけです。`owner` にするには、先にワークスペースへ参加してもらい、既存の `owner` が昇格させます。
-Multica はメールで新しいメンバーを招待します。
+![メンバー管理:招待フォームとロール付きのメンバー一覧](/images/docs/members-roster.png)
-1. ワークスペース設定ページで **メンバーを招待** をクリックし、メールアドレスを入力して役割を選択します。
-2. Multica が一意のリンクを含む招待メールを送信します。
-3. 受信者がリンクをクリックしてログイン(または登録)し、**招待を承諾** するとワークスペースに参加します。
+招待された人はそのメールアドレスでログインすれば承諾でき、事前のサインアップは不要です。招待の有効期間は 7 日間で、期限切れ後は再送してください。サインアップを制限しているセルフホストのインスタンスでは、まだアカウントを持たない招待者のサインアップにも引き続きサインアップルールが適用されます。[ログインとサインアップ設定](/auth-setup#招待とサインアップ制限)を参照してください。
-招待されるメールアドレスは **あらかじめ Multica に登録されている必要はありません** — アカウントがなければ、招待を承諾した時点で自動的に作成されます。
+招待リンクはメールにのみ含まれ、プロダクトの画面にはそれを表示・コピーする場所がありません。メールの送信に失敗しても招待レコードは残るため、取り消してから送り直せます。
-招待メールの配信に失敗しても(誤ったアドレス、メールサービスの不具合など)、招待レコードはそのまま保持されます。ワークスペース設定からメールを再送するか、招待リンクを別の経路で共有できます。
+## ロールの変更
-招待は **7日間有効** です。それ以降にリンクをクリックすると「期限切れ」のメッセージが表示され、招待した人が新しく送り直す必要があります。
+`admin` は `admin` と `member` の間でロールを変更でき、この 2 つのロールのメンバーを削除することもできます。`owner` が関わる変更 — 昇格、変更、削除 — を実行できるのは `owner` だけです。
-## 常に最低1人の owner を維持する
+ロールの変更はただちに反映されます。
-すべてのワークスペースには **常に最低1人の owner が存在しなければなりません**。この制約により、2つの操作が自動的にブロックされます。
+## メンバーの削除
-- 最後の owner は自分自身を降格できません。
-- 他の owner や admin は、最後の owner を削除できません。
+削除されたメンバーは、ただちにワークスペースへのアクセス権を失います。そのメンバーが作成したイシュー、コメント、その他のコラボレーション記録はワークスペースに残ります。
<Callout type="warning">
-あなたが最後の owner でチームを離れようとしている場合は、**まず owner の役割を別のメンバーに譲渡してから**、ワークスペースを離れるか引き継いでください。そうしないと操作が拒否されます。
+メンバーを削除すると同時に、そのメンバーが所有するランタイムは無効化され、それに紐づくエージェントはアーカイブされ、未完了のタスクはキャンセルされます。そのメンバーがエージェントのアクセス範囲(Access)で得ていた許可も消去され、再参加しても自動では復元されません。
</Callout>
-## メンバーを削除する
-
-owner と admin は、ワークスペースから他のメンバーを削除できます。削除されたメンバーは即座にアクセス権を失います。そのメンバーが作成したイシュー、コメントなどのコンテンツは、ワークスペースにそのまま保持されます。
-
-## 次へ
+## 次のステップ
-- [イシューとプロジェクト](/issues) — メンバーが取り組む対象
-- [コメントとメンション](/comments) — イシューの下で協業する
+- [イシュー](/issues) — メンバーとエージェントが一緒に取り組む作業。
+- [エージェント](/agents) — ワークスペースのロールとエージェントの Access の違い。
+- [デーモンとランタイム](/daemon-runtimes) — ランタイムを誰が所有し、どこで実行されるか。
diff --git a/apps/docs/content/docs/members-roles.ko.mdx b/apps/docs/content/docs/members-roles.ko.mdx
index dd494557a3..6c689a26f2 100644
--- a/apps/docs/content/docs/members-roles.ko.mdx
+++ b/apps/docs/content/docs/members-roles.ko.mdx
@@ -1,60 +1,55 @@
---
-title: 멤버와 역할
-description: 워크스페이스의 세 가지 역할 — owner, admin, member — 가 각각 무엇을 할 수 있는지, 그리고 사람을 어떻게 초대하는지 설명합니다.
+title: 멤버와 권한
+description: 멤버를 초대하고 owner, admin, member 세 가지 역할로 워크스페이스 권한을 관리합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-[워크스페이스](/workspaces)에 속한 모든 사람은 역할을 가지며, 역할에 따라 무엇을 할 수 있는지가 결정됩니다. Multica에는 세 가지 역할이 있습니다. **owner**(워크스페이스의 소유자), **admin**, **member**입니다. [이슈](/issues) 생성, [댓글](/comments) 작성, [에이전트](/agents) 사용 같은 대부분의 일상 작업은 세 역할 모두 사용할 수 있습니다. **차이는 팀 관리 영역에 집중되어 있습니다.**
+[워크스페이스](/workspaces)에 참여한 사람은 모두 멤버이며, 각 멤버는 `owner`, `admin`, `member` 중 하나의 역할을 가집니다. 역할은 워크스페이스 설정과 팀 관리 권한만 제어합니다. 이슈 생성, 댓글 작성 같은 일상적인 협업은 모든 멤버에게 열려 있습니다.
-## 권한 한눈에 보기
-
-아래 표는 팀 관리 작업에서 나타나는 가장 중요한 차이를 정리한 것입니다.
+## 세 가지 역할
| 작업 | owner | admin | member |
-|---|---|---|---|
-| 새 admin 또는 member 초대 | ✓ | ✓ | ✗ |
-| **새 owner 초대** | ✓ | ✗ | ✗ |
-| admin 또는 member 강등 / 제거 | ✓ | ✓ | ✗ |
-| **다른 owner 강등 / 제거** | ✓ | ✗ | ✗ |
-| 워크스페이스 삭제 | ✓ | ✗ | ✗ |
+|---|:---:|:---:|:---:|
+| 워크스페이스를 보고 일상적인 협업에 참여 | ✓ | ✓ | ✓ |
+| 워크스페이스 설정 변경 | ✓ | ✓ | — |
+| `admin` 또는 `member` 초대 | ✓ | ✓ | — |
+| `admin`, `member`의 역할 변경 또는 제거 | ✓ | ✓ | — |
+| `owner` 부여, 회수 또는 제거 | ✓ | — | — |
+| 워크스페이스 삭제 | ✓ | — | — |
-**member는 누구도 초대할 수 없습니다** — 초대는 admin 등급의 권한입니다. **owner만 다른 사람을 owner로 승격할 수 있습니다** — admin은 member나 다른 admin을 승격하거나 강등할 수 있지만, 새 owner를 만들 수는 없습니다. 마찬가지로 admin은 member나 다른 admin을 제거할 수 있지만 **기존 owner는 건드릴 수 없습니다**. 핵심은 최고 등급을 이미 보유한 사람만이 그 등급을 부여할 수 있도록 하는 것입니다 — 권한은 위쪽으로 새어 나가지 않습니다.
+워크스페이스에는 항상 `owner`가 한 명 이상 있어야 합니다. 마지막 `owner`는 강등되거나 제거될 수 없으며 워크스페이스를 떠날 수도 없습니다.
<Callout type="info">
-에이전트 가시성에는 "workspace"와 "private" 두 가지가 있습니다. private 에이전트는 owner와 admin만 이슈에 할당할 수 있습니다 — 이는 특정 사람들만 사용하도록 만든 구성을 보호하기 위함입니다. [에이전트](/agents)를 참고하세요.
+역할은 에이전트를 실행할 수 있는 사람을 결정하지 않습니다. 각 에이전트에는 별도의 접근 범위(Access)가 있으며, `owner`와 `admin`도 권한이 없는 에이전트를 우회해서 실행할 수 없습니다. 자세한 내용은 [에이전트](/agents#권한과-access)를 참고하세요.
</Callout>
-## 새 멤버 초대하기
+## 멤버 초대
+
+`owner`와 `admin`은 설정 → 멤버에서 이메일을 입력하고 역할을 선택한 뒤 초대를 보낼 수 있습니다. 초대 시 부여할 수 있는 역할은 `admin`과 `member`뿐입니다. `owner`로 지정하려면 먼저 워크스페이스에 참여한 다음 기존 `owner`가 역할을 올려야 합니다.
-Multica는 이메일로 새 멤버를 초대합니다.
+![멤버 관리: 초대 양식과 역할이 표시된 멤버 명단](/images/docs/members-roster.png)
-1. 워크스페이스 설정 페이지에서 **멤버 초대**를 클릭하고, 이메일을 입력한 뒤 역할을 선택합니다.
-2. Multica가 고유 링크가 담긴 초대 이메일을 보냅니다.
-3. 수신자가 링크를 클릭하고 로그인(또는 가입)한 뒤 **초대를 수락**하면 워크스페이스에 합류합니다.
+초대받은 사람은 해당 이메일로 로그인해 초대를 수락할 수 있으며 미리 가입할 필요는 없습니다. 초대는 7일 동안 유효하고, 만료되면 다시 보내야 합니다. 가입이 제한된 자체 배포 인스턴스에서는 아직 계정이 없는 초대 대상도 가입 규칙의 적용을 받습니다. [로그인과 가입](/auth-setup#초대와-가입-제한)을 참고하세요.
-초대받는 이메일은 **미리 Multica에 등록되어 있을 필요가 없습니다** — 계정이 없으면 초대를 수락할 때 자동으로 생성됩니다.
+초대 링크는 이메일에만 표시되며 제품 화면에서 확인하거나 복사할 수 없습니다. 이메일 전송에 실패해도 초대 기록은 남으므로 취소한 뒤 다시 보낼 수 있습니다.
-초대 이메일 전송이 실패하더라도(잘못된 주소, 메일 서비스 장애 등) 초대 기록은 그대로 유지됩니다. 워크스페이스 설정에서 이메일을 다시 보내거나, 초대 링크를 다른 경로로 공유할 수 있습니다.
+## 역할 변경
-초대는 **7일간 유효합니다**. 그 이후에 링크를 클릭하면 "만료됨" 메시지가 표시되며, 초대한 사람이 새로 보내야 합니다.
+`admin`은 `admin`과 `member` 사이에서 역할을 변경할 수 있고 두 역할의 멤버를 제거할 수도 있습니다. `owner` 승격, 역할 변경, 제거처럼 `owner`와 관련된 변경은 `owner`만 수행할 수 있습니다.
-## 항상 최소 한 명의 owner 유지
+역할 변경은 즉시 적용됩니다.
-모든 워크스페이스에는 **항상 최소 한 명의 owner가 있어야 합니다**. 이 제약은 두 가지 작업을 자동으로 차단합니다.
+## 멤버 제거
-- 마지막 owner는 자신을 강등할 수 없습니다.
-- 다른 owner나 admin은 마지막 owner를 제거할 수 없습니다.
+제거된 멤버는 즉시 워크스페이스 접근 권한을 잃습니다. 해당 멤버가 만든 이슈, 댓글, 기타 협업 기록은 워크스페이스에 남습니다.
<Callout type="warning">
-당신이 마지막 owner이고 팀을 떠나려 한다면, **먼저 owner 역할을 다른 멤버에게 양도한 뒤** 워크스페이스를 떠나거나 넘기세요. 그렇지 않으면 작업이 거부됩니다.
+멤버를 제거하면 그 멤버가 소유한 런타임도 비활성화되고, 해당 런타임에 연결된 에이전트는 보관 처리되며, 끝나지 않은 실행 태스크는 취소됩니다. 에이전트 접근 범위(Access)를 통해 부여된 권한도 삭제되며, 다시 참여해도 자동으로 복구되지 않습니다.
</Callout>
-## 멤버 제거하기
-
-owner와 admin은 워크스페이스에서 다른 멤버를 제거할 수 있습니다. 제거된 멤버는 즉시 접근 권한을 잃습니다. 그 멤버가 만든 이슈, 댓글 등의 콘텐츠는 워크스페이스에 그대로 유지됩니다.
-
-## 다음
+## 다음 단계
-- [이슈와 프로젝트](/issues) — 멤버가 작업하는 대상
-- [댓글과 멘션](/comments) — 이슈 아래에서 협업하기
+- [이슈](/issues) — 멤버와 에이전트가 함께 처리하는 작업을 알아봅니다.
+- [에이전트](/agents) — 워크스페이스 역할과 에이전트 Access의 차이를 이해합니다.
+- [데몬과 런타임](/daemon-runtimes) — 런타임의 소유자와 실행 위치를 알아봅니다.
diff --git a/apps/docs/content/docs/members-roles.mdx b/apps/docs/content/docs/members-roles.mdx
index 57b8600079..e238da00fb 100644
--- a/apps/docs/content/docs/members-roles.mdx
+++ b/apps/docs/content/docs/members-roles.mdx
@@ -1,60 +1,55 @@
---
title: Members and roles
-description: What each of the three workspace roles — owner, admin, member — can do, and how to bring people in.
+description: Invite members and manage workspace permissions with the owner, admin, and member roles.
---
import { Callout } from "fumadocs-ui/components/callout";
-Everyone in a [workspace](/workspaces) has a role, and the role decides what they can do. Multica has three: **owner** (the workspace's owner), **admin**, and **member**. Most day-to-day work — creating [issues](/issues), writing [comments](/comments), using [agents](/agents) — is available to all three roles. **The differences cluster around team management.**
+Everyone who joins a [workspace](/workspaces) is a member, and each member has one role: `owner`, `admin`, or `member`. Roles only control workspace settings and team management; day-to-day collaboration — creating issues, writing comments — is open to all members.
-## Permissions at a glance
-
-The table below lists the most important differences across team-management actions:
+## The three roles
| Action | owner | admin | member |
-|---|---|---|---|
-| Invite a new admin or member | ✓ | ✓ | ✗ |
-| **Invite a new owner** | ✓ | ✗ | ✗ |
-| Demote / remove an admin or member | ✓ | ✓ | ✗ |
-| **Demote / remove another owner** | ✓ | ✗ | ✗ |
-| Delete the workspace | ✓ | ✗ | ✗ |
+|---|:---:|:---:|:---:|
+| View the workspace and collaborate day to day | ✓ | ✓ | ✓ |
+| Change workspace settings | ✓ | ✓ | — |
+| Invite an `admin` or `member` | ✓ | ✓ | — |
+| Change or remove an `admin` or `member` | ✓ | ✓ | — |
+| Grant, revoke, or remove `owner` | ✓ | — | — |
+| Delete the workspace | ✓ | — | — |
-**Members can't invite anyone** — inviting is an admin-tier permission. **Only owners can promote someone to owner** — admins can promote and demote members or other admins, but they can't create a new owner. Likewise, admins can remove members or other admins but **can't touch existing owners**. The point is to make sure the highest tier can only be granted by someone who already holds it — permissions don't leak upward.
+A workspace must always keep at least one `owner`: the last `owner` cannot be demoted, removed, or leave.
<Callout type="info">
-Agent visibility comes in two flavors: "workspace" and "private." Private agents can only be assigned to issues by owners and admins — this protects configurations meant for a specific set of people. See [Agents](/agents).
+Roles do not decide who can run an agent. Each agent has its own Access scope, and `owner` and `admin` cannot bypass it to run agents they were not granted. See [Agents](/agents#permissions-and-access).
</Callout>
-## Inviting a new member
+## Invite members
+
+`owner` and `admin` send invitations from Settings → Members by entering an email and picking a role. Invitations can only grant `admin` or `member`; an `owner` must join the workspace first and then be promoted by an existing `owner`.
-Multica invites new members by email:
+![Member management: the invite form and the roster with roles](/images/docs/members-roster.png)
-1. On the workspace settings page, click **Invite member**, enter the email, and pick a role.
-2. Multica sends an invitation email containing a unique link.
-3. The recipient clicks the link, logs in (or signs up), and **accepts the invitation** to join the workspace.
+The invitee accepts by logging in with that email — no prior signup is needed. Invitations are valid for 7 days; resend after they expire. On self-hosted instances that restrict signup, invitees who do not yet have an account are still subject to the signup rules when registering — see [Auth setup](/auth-setup#invitations-and-signup-restrictions).
-The invited email **does not need to be registered with Multica in advance** — if no account exists, one is created when the invitation is accepted.
+The invitation link appears only in the email; there is no place in the product to view or copy it. If the email fails to send, the invitation record still exists — revoke it and send a new one.
-If the invitation email fails to deliver (wrong address, mail service hiccup), the invitation record is still retained; you can resend the email from workspace settings, or share the invitation link through another channel.
+## Change roles
-Invitations are **valid for 7 days**. After that, clicking the link shows an "expired" message, and the inviter needs to send a new one.
+An `admin` can move roles between `admin` and `member`, and can remove members holding those two roles. Any change involving `owner` — promoting, changing, or removing — can only be performed by an `owner`.
-## Always at least one owner
+Role changes take effect immediately.
-Every workspace **must have at least one owner at all times**. This constraint automatically blocks two operations:
+## Remove a member
-- The last owner can't demote themselves.
-- Other owners or admins can't remove the last owner.
+A removed member loses workspace access immediately. Issues, comments, and other collaboration records they created stay in the workspace.
<Callout type="warning">
-If you're the last owner and about to leave the team, **transfer the owner role to another member first**, then try to leave or hand off the workspace. Otherwise the operation will be rejected.
+Removing a member also deactivates the runtimes they own, archives the agents bound to them, and cancels tasks that have not finished. Grants the member received in agent Access scopes are cleared as well and are not restored automatically if they rejoin.
</Callout>
-## Removing a member
-
-Owners and admins can remove other members from a workspace. A removed member loses access immediately; issues, comments, and other content they created are retained in the workspace.
-
-## Next
+## Next steps
-- [Issues and projects](/issues) — what members work on
-- [Comments and mentions](/comments) — collaborating under an issue
+- [Issues](/issues) — the work members and agents handle together.
+- [Agents](/agents) — how workspace roles differ from agent Access.
+- [Daemon and runtimes](/daemon-runtimes) — who owns runtimes and where they run.
diff --git a/apps/docs/content/docs/members-roles.zh.mdx b/apps/docs/content/docs/members-roles.zh.mdx
index c4e22409ba..0f04422e7c 100644
--- a/apps/docs/content/docs/members-roles.zh.mdx
+++ b/apps/docs/content/docs/members-roles.zh.mdx
@@ -1,60 +1,55 @@
---
title: 成员与权限
-description: 工作区的三种角色——owner、admin、member——各能做什么,以及怎么把人加进来。
+description: 邀请成员,并用 owner、admin 和 member 三种角色管理工作区权限。
---
import { Callout } from "fumadocs-ui/components/callout";
-[工作区](/workspaces) 里的每个人都有一个角色,角色决定这个人能做什么。Multica 提供三种:**owner**(工作区的所有者)、**admin**(管理员)、**member**(普通成员)。大多数日常工作——创建 [issue](/issues)、写 [评论](/comments)、使用 [智能体](/agents)——三种角色都能做,**区别集中在团队管理上**。
+加入[工作区](/workspaces)的人都是成员,每位成员有一个角色:`owner`、`admin` 或 `member`。角色只控制工作区设置和团队管理;创建 issue、发表评论等日常协作对所有成员开放。
-## 权限概览
+## 三种角色
-下表列了三种角色在团队管理操作上最关键的差别:
+| 操作 | owner | admin | member |
+|---|:---:|:---:|:---:|
+| 查看工作区并参与日常协作 | ✓ | ✓ | ✓ |
+| 修改工作区设置 | ✓ | ✓ | — |
+| 邀请 `admin` 或 `member` | ✓ | ✓ | — |
+| 调整或移除 `admin`、`member` | ✓ | ✓ | — |
+| 授予、收回或移除 `owner` | ✓ | — | — |
+| 删除工作区 | ✓ | — | — |
-| 动作 | owner | admin | member |
-|---|---|---|---|
-| 邀请新 admin 或 member | ✓ | ✓ | ✗ |
-| **邀请新 owner** | ✓ | ✗ | ✗ |
-| 降级 / 移除 admin 或 member | ✓ | ✓ | ✗ |
-| **降级 / 移除其他 owner** | ✓ | ✗ | ✗ |
-| 删除工作区 | ✓ | ✗ | ✗ |
-
-**member 不能邀请新人**——邀请能力是管理员层的权限。**只有 owner 能把别人提升为 owner**——admin 可以提升和降级 member 或其他 admin,但不能造出新 owner。同样,admin 可以移除 member 或其他 admin,但**不能动现有的 owner**。这是为了让"最高权限"只能由已有最高权限的人授予,避免权限扩散。
+工作区必须始终保留至少一名 `owner`:最后一名 `owner` 不能被降级、移除或离开。
<Callout type="info">
-智能体的可见性分"workspace"和"private"两种。私有智能体只有 owner 和 admin 能把它分配到 issue 上——这是为了保护只给特定人使用的配置。详见 [智能体](/agents)。
+角色不决定谁能运行智能体。每个智能体有独立的访问范围(Access),`owner` 和 `admin` 也不能绕过它运行未授权的智能体。详见[智能体](/agents#权限与-access)。
</Callout>
-## 邀请新成员
+## 邀请成员
+
+`owner` 和 `admin` 在设置 → 成员中输入邮箱、选择角色后发送邀请。邀请只能授予 `admin` 或 `member`;`owner` 需要先加入工作区,再由现有 `owner` 提升。
-Multica 通过邮箱邀请新成员:
+![成员管理:邀请表单与带角色的成员名册](/images/docs/members-roster.png)
-1. 在工作区设置页点 **邀请成员**,填对方邮箱并选一个角色。
-2. Multica 发送一封邀请邮件,里面包含一个专属链接。
-3. 对方点击链接,登录(或注册),然后**接受邀请**,正式成为工作区成员。
+受邀者用该邮箱登录即可接受,无需提前注册。邀请有效期 7 天,过期后重新发送。在限制注册的自部署实例中,还没有账号的受邀者注册时仍受注册规则约束,见[登录与注册](/auth-setup#邀请与注册限制)。
-被邀请的邮箱**不需要提前在 Multica 注册**——如果账号不存在,系统会在对方接受邀请时自动创建。
+邀请链接只出现在邮件里,产品界面中没有查看或复制它的入口。邮件发送失败时邀请记录仍然存在,可以撤销后重新发送。
-邀请邮件如果发送失败(比如邮箱地址写错了、或者邮件服务故障),邀请记录仍然保留;你可以在工作区设置页重新发送邀请邮件,或者直接把邀请链接通过其他渠道发给对方。
+## 调整角色
-邀请 **7 天内有效**。过期后对方点链接会看到"已失效"提示,需要由邀请人重新发送。
+`admin` 可以在 `admin` 和 `member` 之间调整角色,也可以移除这两类成员。涉及 `owner` 的变更——提升、更改或移除——只有 `owner` 能执行。
-## 至少保留一名 owner
+角色变化立即生效。
-每个工作区任何时候都**必须至少保留一名 owner**。这条约束会自动拦住两种操作:
+## 移除成员
-- 最后一个 owner 不能把自己降级。
-- 其他 owner 或 admin 不能移除最后一个 owner。
+被移除的成员立即失去工作区访问权限。该成员创建的 issue、评论和其他协作记录保留在工作区中。
<Callout type="warning">
-如果你是最后一个 owner 并准备离开团队,**先把 owner 角色转让给另一个成员**,再尝试退出或交出工作区。否则操作会被拒绝。
+移除成员会同时停用该成员拥有的运行时、归档绑定在其上的智能体,并取消尚未结束的执行任务。该成员在智能体访问范围(Access)中获得的授权也会被清除,重新加入后不会自动恢复。
</Callout>
-## 移除成员
-
-owner 和 admin 可以从工作区里移除其他成员。被移除的成员立即失去访问权限;TA 之前创建的 issue、评论等内容会保留在工作区里。
-
-## 下一步
+## 接下来
-- [Issue 与 project](/issues) —— 成员的工作对象
-- [评论与提及](/comments) —— 在 issue 下协作沟通
+- [Issues](/issues) — 了解成员和智能体共同处理的工作。
+- [智能体](/agents) — 区分工作区角色与智能体 Access。
+- [守护进程与运行时](/daemon-runtimes) — 了解运行时由谁拥有以及在哪里执行。
diff --git a/apps/docs/content/docs/mentioning-agents.ja.mdx b/apps/docs/content/docs/mentioning-agents.ja.mdx
index 3b45f5f6a4..d3f2081b9e 100644
--- a/apps/docs/content/docs/mentioning-agents.ja.mdx
+++ b/apps/docs/content/docs/mentioning-agents.ja.mdx
@@ -1,63 +1,79 @@
---
-title: "コメントでエージェントを @メンションする"
-description: コメントで @ を使ってエージェントをメンションし、ちょっと見てもらいましょう — 担当者の変更も、ステータスの変更もなく、割り当てより軽い操作です。
+title: コメントでエージェントを @メンション
+description: イシューのコメントでエージェントを @メンションするか返信を続けて、担当者を変えずに新しい情報を処理させます。
---
import { Callout } from "fumadocs-ui/components/callout";
-[コメント](/comments)で[エージェント](/agents)を `@`メンションするのは、より軽いトリガーです — **担当者の変更も、ステータスの変更もなく**、ただエージェントに現在の[イシュー](/issues)を見てもらうよう軽く促すだけです。[**割り当て**](/assigning-issues)(エージェントを担当者にしてイシューを渡すこと)と比べると、@メンションは「この部分をちょっと見て」「別の角度から分析して」「ちょっと呼び込んで一緒に議論しよう」といった場面に向いています。
+新しい情報を確認してほしい、質問に答えてほしい、現在の担当者を手伝ってほしい — そんなときはコメントでエージェントを @メンションします。そのコメントが今回の実行の起点となり、イシューの担当者もステータスも変わりません。
-## コメントでエージェントをメンションする
+## 割り当てと @メンションの使い分け
-メンバーをメンションするのと同じです — `@` を入力してピッカーを開き、エージェントを選んでください。コメントが投稿されると、Multica はメンションされた各エージェントに対して**そのコメント**をトリガーコンテキストとして、すぐに `task` をキューに入れます。エージェントがタスクを受け取ると、次のものを読めます。
+| | エージェントへの割り当て | コメントでの @メンション |
+|---|---|---|
+| 適した用途 | イシュー全体をエージェントに任せる | 当該コメントをエージェントに処理させる |
+| 担当者の変更 | あり | なし |
+| ステータスの変更 | なし | なし |
+| 一度に選べる対象 | 1 つのエージェントまたはスクワッド | 複数のエージェントやスクワッドを @メンション可能 |
+| 実行のフォーカス | イシュー全体 | トリガーしたコメントと、同じバッチに統合されたコメント |
-- イシュー全体(説明 + すべての過去のコメント)
-- トリガーコメント自体 — 今回の実行の起点として
+明確な担当者が必要なときは[割り当て](/assigning-issues)を、一時的に議論へ参加してほしいだけのときは @メンションを使います。
-`@mention` の Markdown 構文、ピッカー、そして `@all` のセマンティクスは [**コメント**](/comments)で扱います。
+## トリガープレビュー
-<Callout type="info">
-**コメントで[スクワッド](/squads)を `@`メンションすることもできます。** 同じピッカーがメンバーやエージェントと並べてスクワッドも表示します。スクワッドを選ぶと `[@SquadName](mention://squad/<uuid>)` が挿入され、スクワッドの**リーダーエージェント**が応答を調整するようトリガーされます — 担当者とステータスはそのまま維持されます。
-</Callout>
+コメントエディターでエージェントまたはスクワッドを選択すると、入力欄の下にトリガープレビューが表示されます。
-## 割り当てとどう違うか
+- 送信後にどのエージェントが作業を開始するか
+- 各対象が直接の @メンション、イシューの担当者、スクワッドのリーダーのどれに由来するか
+- 対象が利用できない、またはあなたに実行権限がないかどうか
-どちらもエージェントを働かせますが、仕組みはまったく異なります。
+エージェントのチェックを外すと、今回のトリガーだけがスキップされます。コメントから名前を削除する必要はなく、エージェントの Access も変更されません。
-| 観点 | 割り当て | @メンション |
-|---|---|---|
-| `assignee` の変更 | ✓ | ✗ |
-| `status` の変更 | ✗ | ✗ |
-| `task` のキュー追加 | すぐに(Backlog 以外) | すぐに |
-| トリガーコメント ID | 任意 | 常に現在のコメントを含む |
-| 1 回の操作あたりの対象エージェント | 1(担当者 1 名) | 複数(1 つのコメントで複数を @ 可能) |
-| 優先度 | イシューから継承 | イシューから継承 |
+![送信前のトリガープレビュー:送信後に作業を開始するエージェントを一覧表示](/images/docs/mention-trigger-preview.png)
-判断の目安は単純です。**エージェントに「これからこのイシューを所有してほしい」なら割り当てを、「現在のコンテキストをちょっと見てほしい」なら @メンションを使ってください。**
+コメントが投稿されると、オンラインのランタイムは通常すぐにタスクを受け取ります。ランタイムがオフラインの場合、タスクはキューで待機します。
-## 複数のエージェントを @ するとどうなるか
+## 返信の自動ルーティング
-1 つのコメントで複数のエージェントを @メンションすると、各エージェントは自分のランタイムで独立した `task` をキューに受け取ります — **互いをブロックすることなく並列に実行されます**。
+@ をまったく含まない通常のコメントは、議論の文脈に沿ってルーティングされます。
-同じイシューで、あるエージェントがすでに `queued` または `dispatched` 状態の `task` を持っている場合(たとえば、たった今メンションされてまだ開始していない場合)、今回のメンションは**重複排除**され、重複した `task` はキューに追加されません。重複排除は**単一のコメント単位で**適用されます — 数秒間隔で投稿された別々の 2 つのコメントが両方とも同じエージェントを @ すると、どちらも `task` をキューに入れます。
+1. エージェントのコメントへの返信は、そのエージェントに渡されます。
+2. すでにエージェントが参加しているスレッドでの返信は、そのスレッドのエージェントを引き継ぎます。
+3. どちらにも当てはまらない場合は、イシューの担当エージェントに渡されます。担当者がスクワッドのときはリーダーが処理します。
-<Callout type="warning">
-**コメントを編集して @ を追加しても、再トリガーされません。** 投稿した後で `@agent` を追加しなければと気づいた場合、編集で入れた `@` は表示される内容を変えるだけで、そのエージェントに新しい `task` を**届けません**。トリガーするには、新しいコメントを投稿するか、イシューをそのエージェントに割り当ててください。
-</Callout>
+コメントが他の対象(メンバーを含む)を明示的に @メンションしている場合、担当者へのフォールバックは適用されません。
+
+返信が担当者以外のエージェントをトリガーした場合、Multica は担当者のために遅延フォールバック実行を予約します。対象のエージェントが約 5 分以内に返信すればフォールバックは自動的にキャンセルされ、返信がなければ担当者も実行を開始します。
+
+## 連続コメントの統合
+
+同じエージェントに同じイシュー上で待機中のタスクがある場合、新しいコメントはそのタスクに統合されます。すでに実行中の場合、後続のコメントは現在の実行が終わるのを待ち、1 回のフォローアップ実行にまとめられます。エージェントの返信を待たずに、続けて情報を補足できます。
-## `@all` はどのエージェントもトリガーしない
+1 つのコメントで複数の異なるエージェントを @メンションすると、エージェントごとにタスクが作成されます。複数のメンションが同じエージェントに解決される場合は、1 回だけ残ります。
+
+## エージェントをトリガーしないコメント
+
+方法は 2 つあります。
+
+- コメントを `/note` で始める: メンバー間のメモとして投稿され、どのエージェントもトリガーしません。
+- `@all` を使う: すべてのワークスペースメンバーに通知し、このコメントによる担当者への自動トリガーを無効にします。
+
+トリガープレビューにまだエージェントが残っている場合は、送信前にチェックを外してください。
+
+<Callout type="info">
+`@all` にエージェントは含まれません。エージェントにはインボックスがなく、働かせるには明示的に @メンションする、該当するスレッドで返信する、またはイシューを割り当てる必要があります。
+</Callout>
-`@all` で全員を呼ぶとき、**ワークスペースのメンバーだけがインボックスに入り、エージェントは `@all` の展開に含まれません。** これは意図された設計です。エージェントはインボックス通知を受け取らないため、`@all` はエージェントにとって意味を持ちません。エージェントを働かせるには、名前で直接メンションしてください。
+## Access の制限
-## エージェントが自分自身を @メンションしてもループしない
+@メンションでエージェントの Access を回避することはできません。実行権限がない、対象がアーカイブ済み、利用可能なランタイムがない場合、トリガープレビューに開始されない旨が表示されます。コメント自体は通常どおり投稿されます。3 段階の Access の意味は[エージェント](/agents#権限と-access)を参照してください。
-エージェントは実行中にコメントを投稿でき、そのコメントには `@mention` が含まれることがあります。Multica にはハードコードされたガードがあります。**コメントの作成者が `@` メンションの対象エージェントと同じ場合、そのメンションはスキップされます** — 「エージェント A がエージェント A を @ → 新しい task → 再びエージェント A を @」のような無限ループは発生しません。
+## エージェント同士のメンション
-このガードは**直接的な自己参照だけをブロックします。** エージェント A がエージェント B を @メンションするのは正常に動作し、その後 B が応答で A を @メンションすると A が再びトリガーされます — つまり**間接的な再帰はブロックされません**。エージェントの指示を書くときは、複数のエージェントが互いを @メンションして循環を作らないよう注意してください。
+エージェントは自分の返信の中で他のエージェントを @メンションできます。A が B を、B が A をメンションし返す場合、同じタイミングの重複実行は統合されますが、この協働をいつ終えるべきかをシステムは判断しません。終了条件はエージェントの指示に書いてください。
-## 次へ
+## 次のステップ
-- [**スクワッド**](/squads) — スクワッドを `@`メンションすると、リーダーが質問を適切なメンバーにルーティングします
-- [**チャット**](/chat) — イシューと無関係な 1 対 1 の会話
-- [**オートパイロット**](/autopilots) — エージェントがスケジュールに沿って自動的に作業を開始するようにする
-- [**コメント**](/comments) — `@mention` の構文、ピッカー、そして `@all` のセマンティクス
+- [コメント](/comments) — 返信、スレッドの解決、通知と購読。
+- [エージェント](/agents) — アイデンティティ、Access、ランタイムの設定。
+- [スクワッド](/squads) — リーダーに複数のエージェントを調整させます。
diff --git a/apps/docs/content/docs/mentioning-agents.ko.mdx b/apps/docs/content/docs/mentioning-agents.ko.mdx
index dc8062157b..a0b2110a40 100644
--- a/apps/docs/content/docs/mentioning-agents.ko.mdx
+++ b/apps/docs/content/docs/mentioning-agents.ko.mdx
@@ -1,63 +1,79 @@
---
-title: "댓글에서 에이전트 @-멘션하기"
-description: 댓글에서 @로 에이전트를 멘션해 살펴보게 하세요 — 담당자 변경도, 상태 변경도 없이, 할당보다 가볍습니다.
+title: 댓글에서 에이전트 @멘션하기
+description: 이슈 댓글에서 에이전트를 @멘션하거나 답글을 이어서 담당자를 바꾸지 않고 새 정보를 처리하게 합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-[댓글](/comments)에서 [에이전트](/agents)를 `@`-멘션하는 것은 더 가벼운 트리거입니다 — **담당자 변경도, 상태 변경도 없이**, 그저 에이전트가 현재 [이슈](/issues)를 살펴보도록 살짝 알리는 것입니다. [**할당**](/assigning-issues)(에이전트를 담당자로 만들고 이슈를 넘기는 것)과 비교하면, @-멘션은 "이 부분 좀 봐줘", "다른 관점으로 분석해줘", "잠깐 끌어들여서 같이 논의하자" 같은 상황에 잘 맞습니다.
+댓글에서 에이전트를 @멘션하면 새 정보를 검토하거나 질문에 답하거나 현재 담당자를 돕게 할 수 있습니다. 해당 댓글이 이번 실행의 시작점이 되며 이슈의 담당자와 상태는 바뀌지 않습니다.
-## 댓글에서 에이전트 멘션하기
+## 할당과 @멘션 중 선택
-멤버를 멘션하는 것과 동일합니다 — `@`를 입력해 피커를 열고 에이전트를 선택하세요. 댓글이 게시되면 Multica는 멘션된 각 에이전트에게 **그 댓글**을 트리거 컨텍스트로 삼아 즉시 `task`를 대기열에 넣습니다. 에이전트가 작업을 받으면 다음을 읽을 수 있습니다.
+| | 에이전트에게 할당 | 댓글에서 에이전트 @멘션 |
+|---|---|---|
+| 적합한 경우 | 에이전트가 이슈 전체를 책임지게 할 때 | 현재 댓글을 에이전트가 처리하게 할 때 |
+| 담당자 변경 | 예 | 아니요 |
+| 상태 변경 | 아니요 | 아니요 |
+| 한 번에 선택 | 에이전트 또는 스쿼드 하나 | 여러 에이전트 또는 스쿼드를 @멘션 가능 |
+| 이번 실행의 초점 | 이슈 전체 | 트리거한 댓글과 같은 묶음으로 합쳐진 댓글 |
-- 이슈 전체(설명 + 모든 과거 댓글)
-- 트리거 댓글 자체 — 이번 실행의 시작점으로
+담당자를 명확히 정해야 한다면 [할당](/assigning-issues)을 사용하고, 논의에 잠시 참여시키기만 한다면 @멘션을 사용하세요.
-`@mention` Markdown 문법, 피커, 그리고 `@all` 의미는 [**댓글**](/comments)에서 다룹니다.
+## 트리거 미리보기
-<Callout type="info">
-**댓글에서 [스쿼드](/squads)도 `@`-멘션할 수 있습니다.** 동일한 피커가 멤버 및 에이전트와 함께 스쿼드도 보여줍니다. 스쿼드를 선택하면 `[@SquadName](mention://squad/<uuid>)`이 삽입되고, 스쿼드의 **리더 에이전트**가 응답을 조율하도록 트리거됩니다 — 담당자와 상태는 그대로 유지됩니다.
-</Callout>
+댓글 편집기에서 에이전트나 스쿼드를 선택하면 입력란 아래에 트리거 미리보기가 표시됩니다.
-## 할당과 어떻게 다른가
+- 전송 후 어떤 에이전트가 작업을 시작하는지
+- 대상이 직접 @멘션, 이슈 담당자, 스쿼드 리더 중 어디에서 정해졌는지
+- 대상을 사용할 수 없는지 또는 호출 권한이 부족한지
-둘 다 에이전트를 일하게 만들지만, 동작 방식은 완전히 다릅니다.
+특정 에이전트의 선택을 해제하면 이번 트리거만 건너뜁니다. 댓글에서 이름을 지울 필요가 없으며 에이전트의 Access도 바뀌지 않습니다.
-| 항목 | 할당 | @-멘션 |
-|---|---|---|
-| `assignee` 변경 | ✓ | ✗ |
-| `status` 변경 | ✗ | ✗ |
-| `task` 대기열 추가 | 즉시(백로그가 아닌 경우) | 즉시 |
-| 트리거 댓글 ID | 선택 사항 | 항상 현재 댓글을 포함 |
-| 한 번의 동작당 대상 에이전트 | 1명(담당자 한 명) | 다수(댓글 하나에서 여러 명을 @ 가능) |
-| 우선순위 | 이슈에서 상속 | 이슈에서 상속 |
+![전송 전 트리거 미리보기: 전송 후 작업을 시작할 에이전트 목록](/images/docs/mention-trigger-preview.png)
-판단 기준은 간단합니다. **에이전트가 "지금부터 이 이슈를 책임지길" 원하면 할당을, "현재 컨텍스트를 한번 살펴보길" 원하면 @-멘션을 사용하세요.**
+댓글을 게시하면 온라인 런타임이 보통 즉시 태스크를 가져갑니다. 런타임이 오프라인이면 실행 태스크가 큐에서 기다립니다.
-## 여러 에이전트를 @ 하면 어떻게 되는가
+## 답글 자동 라우팅
-댓글 하나에서 여러 에이전트를 @-멘션하면, 각 에이전트는 자신의 런타임에서 독립적인 `task`를 대기열에 받습니다 — **서로를 막지 않고 병렬로 실행됩니다**.
+@멘션이 없는 일반 댓글은 논의 컨텍스트에 따라 라우팅됩니다.
-같은 이슈에서 어떤 에이전트가 이미 `queued` 또는 `dispatched` 상태의 `task`를 가지고 있다면(예: 방금 멘션되었고 아직 시작하지 않은 경우), 이번 멘션은 **중복 제거**되어 중복 `task`가 대기열에 추가되지 않습니다. 중복 제거는 **단일 댓글 단위로** 적용됩니다 — 몇 초 간격으로 게시된 서로 다른 두 댓글이 모두 같은 에이전트를 @ 하면, 둘 다 `task`를 대기열에 넣습니다.
+1. 에이전트의 댓글에 답하면 해당 에이전트에게 전달됩니다.
+2. 이미 에이전트가 참여한 논의에 답하면 그 논의의 에이전트에게 전달됩니다.
+3. 둘 다 해당하지 않으면 이슈의 에이전트 담당자에게 전달됩니다. 담당자가 스쿼드이면 리더가 처리합니다.
-<Callout type="warning">
-**댓글을 편집해 @를 추가해도 다시 트리거되지 않습니다.** 게시한 뒤에야 `@agent`를 추가해야겠다고 떠올렸다면, 편집으로 넣은 `@`는 표시되는 내용만 바꿀 뿐 — 그 에이전트에게 새 `task`를 **전달하지 않습니다**. 트리거하려면 새 댓글을 게시하거나 이슈를 그 에이전트에게 할당하세요.
-</Callout>
+댓글에서 다른 대상(멤버 포함)을 명시적으로 @멘션하면 담당자 폴백을 사용하지 않습니다.
+
+답글이 담당자가 아닌 에이전트를 트리거하면 Multica가 담당자의 지연 폴백 실행을 예약합니다. 대상 에이전트가 약 5분 안에 답하면 폴백이 자동으로 취소되고, 그렇지 않으면 담당자도 실행을 시작합니다.
+
+## 연속 댓글 합치기
+
+같은 에이전트가 같은 이슈에서 대기 중인 실행 태스크를 이미 가지고 있다면 새 댓글이 그 태스크에 합쳐집니다. 이미 실행 중이라면 이후 댓글은 현재 태스크가 끝난 뒤 하나의 후속 실행으로 합쳐집니다. 에이전트의 답을 기다리지 않고 정보를 계속 보충할 수 있습니다.
-## `@all`은 어떤 에이전트도 트리거하지 않는다
+한 댓글에서 서로 다른 에이전트 여러 명을 @멘션하면 각 에이전트가 실행 태스크를 하나씩 받습니다. 여러 멘션이 같은 에이전트를 가리키면 한 번만 실행됩니다.
+
+## 에이전트를 트리거하지 않는 메모
+
+두 가지 방법이 있습니다.
+
+- `/note`로 시작: 댓글이 멤버 사이의 메모로만 남고 어떤 에이전트도 트리거하지 않습니다.
+- `@all` 사용: 모든 워크스페이스 멤버에게 알리고 해당 댓글이 담당자를 자동으로 트리거하지 않게 합니다.
+
+트리거 미리보기에 에이전트가 남아 있다면 보내기 전에 선택을 해제하면 됩니다.
+
+<Callout type="info">
+`@all`에는 에이전트가 포함되지 않습니다. 에이전트에는 인박스가 없습니다. 에이전트가 작업하게 하려면 명시적으로 @멘션하거나, 관련 논의에 답하거나, 이슈를 에이전트에게 할당해야 합니다.
+</Callout>
-`@all`로 전체를 호출할 때, **워크스페이스 멤버만 인박스에 들어가며 — 에이전트는 `@all` 확장에 포함되지 않습니다.** 이는 의도된 설계입니다. 에이전트는 인박스 알림을 받지 않으므로 `@all`은 에이전트에게 아무 의미가 없습니다. 에이전트를 일하게 하려면 이름으로 직접 멘션하세요.
+## Access 제한
-## 에이전트가 자기 자신을 @-멘션해도 루프에 빠지지 않는다
+@멘션으로 에이전트의 Access를 우회할 수 없습니다. 호출 권한이 없거나, 대상이 보관 처리되었거나, 사용할 수 있는 런타임이 없으면 트리거 미리보기에서 시작되지 않는 이유를 보여 줍니다. 댓글 자체는 정상적으로 게시할 수 있습니다. 세 가지 Access 설정의 의미는 [에이전트](/agents#권한과-access)를 참고하세요.
-에이전트는 실행 중에 댓글을 게시할 수 있으며, 그 댓글에는 `@mention`이 포함될 수 있습니다. Multica에는 하드코딩된 가드가 있습니다. **댓글 작성자가 `@` 멘션의 대상 에이전트와 동일하다면, 그 멘션은 건너뜁니다** — "에이전트 A가 에이전트 A를 @ → 새 task → 다시 에이전트 A를 @" 같은 무한 루프는 발생하지 않습니다.
+## 에이전트 간 @멘션
-이 가드는 **직접적인 자기 참조만 차단합니다.** 에이전트 A가 에이전트 B를 @-멘션하는 것은 정상적으로 동작하며, 그 후 B가 응답에서 A를 @-멘션하면 A가 다시 트리거됩니다 — 다시 말해 **간접 재귀는 차단되지 않습니다**. 에이전트 지침을 작성할 때 여러 에이전트가 서로를 @-멘션해 순환을 이루지 않도록 주의하세요.
+에이전트도 자신의 답변에서 다른 에이전트를 @멘션할 수 있습니다. A가 B를 @멘션하고 B가 다시 A를 @멘션하면 시스템은 같은 시점의 중복 실행을 합치지만 이 협업을 언제 끝내야 하는지는 판단하지 않습니다. 종료 조건은 에이전트 지시문에 작성해야 합니다.
-## 다음
+## 다음 단계
-- [**스쿼드**](/squads) — 스쿼드를 `@`-멘션하면 리더가 질문을 적절한 멤버에게 라우팅합니다
-- [**채팅**](/chat) — 이슈 밖에서의 일대일 대화
-- [**오토파일럿**](/autopilots) — 에이전트가 일정에 따라 자동으로 작업을 시작하게 하세요
-- [**댓글**](/comments) — `@mention` 문법, 피커, 그리고 `@all` 의미
+- [댓글](/comments) — 답글, 논의 해결, 알림, 구독을 알아봅니다.
+- [에이전트](/agents) — 정체성, Access, 런타임을 설정합니다.
+- [스쿼드](/squads) — 리더가 여러 에이전트를 조율하게 합니다.
diff --git a/apps/docs/content/docs/mentioning-agents.mdx b/apps/docs/content/docs/mentioning-agents.mdx
index cab718e784..032759cf61 100644
--- a/apps/docs/content/docs/mentioning-agents.mdx
+++ b/apps/docs/content/docs/mentioning-agents.mdx
@@ -1,63 +1,79 @@
---
title: "@-mention agents in comments"
-description: Mention an agent with @ to have it take a look from a comment — no assignee change, no status change, lighter than assigning.
+description: "@-mention an agent in an issue comment, or keep replying, to have it handle new information without changing the assignee."
---
import { Callout } from "fumadocs-ui/components/callout";
-`@`-mentioning an [agent](/agents) in a [comment](/comments) is the lighter trigger — **no assignee change, no status change**, just a nudge to have the agent take a look at the current [issue](/issues). Compared to [**assigning**](/assigning-issues) (turning the agent into the owner and handing over the issue), @-mention fits "take a look at this section," "give me another angle," or "pull them in for a quick discussion."
+@-mention an agent in a comment when you want it to look at a new piece of information, answer a question, or help the current assignee. The comment becomes the starting point for the run; the issue's assignee and status stay unchanged.
-## Mention an agent in a comment
+## Assigning vs. @-mentioning
-Same as mentioning a member — type `@` to open the picker and select an agent. Once the comment is posted, Multica immediately enqueues a `task` for each mentioned agent with **that comment** as its trigger context. When the agent receives the task it can read:
+| | Assign to an agent | @-mention in a comment |
+|---|---|---|
+| Best for | Making the agent own the whole issue | Having the agent handle the current comment |
+| Changes the assignee | Yes | No |
+| Changes the status | No | No |
+| Targets per action | One agent or squad | Multiple agents or squads |
+| Focus of the run | The whole issue | The triggering comment, plus comments merged in the same batch |
-- The full issue (description + every historical comment)
-- The trigger comment itself — as the starting point for this run
+Use [assignment](/assigning-issues) when the issue needs a clear owner; use an @-mention to bring an agent into the discussion temporarily.
-The `@mention` Markdown syntax, the picker, and `@all` semantics are covered in [**Comments**](/comments).
+## Trigger preview
-<Callout type="info">
-**You can also `@`-mention a [squad](/squads) in a comment.** The same picker surfaces squads alongside members and agents; selecting one inserts `[@SquadName](mention://squad/<uuid>)` and triggers the squad's **leader agent** to coordinate a response — assignee and status stay untouched.
-</Callout>
+After you pick an agent or squad in the comment editor, a trigger preview appears under the input:
-## How it differs from assignment
+- which agents will start working once you send;
+- whether each target comes from a direct @-mention, the issue assignee, or a squad leader;
+- whether a target is unavailable, or you lack permission to run it.
-Both put the agent to work, but the mechanics are entirely different:
+Unticking an agent skips this one trigger only — you don't need to delete its name from the comment, and the agent's Access is not changed.
-| Dimension | Assign | @-mention |
-|---|---|---|
-| Changes `assignee` | ✓ | ✗ |
-| Changes `status` | ✗ | ✗ |
-| Enqueues a `task` | Immediately (non-Backlog) | Immediately |
-| Trigger comment ID | Optional | Always carries the current comment |
-| Agents targeted per action | 1 (one assignee) | Many (a comment can @ multiple) |
-| Priority | Inherits from issue | Inherits from issue |
+![Trigger preview before sending: lists the agents that will start working once the comment is sent](/images/docs/mention-trigger-preview.png)
-The rule of thumb is simple: **use assignment when you want the agent to "own this issue from now on"; use @-mention when you want it to "take a look at the current context."**
+Once the comment is posted, an online runtime usually claims the task right away; if the runtime is offline, the task waits in the queue.
-## What happens when you @ multiple agents
+## Automatic routing of replies
-If one comment @-mentions several agents, each one is enqueued an independent `task` on its own runtime — **they run in parallel** without blocking each other.
+A plain comment (containing no @ at all) is routed by discussion context:
-If an agent already has a `queued` or `dispatched` `task` on the same issue (for example, it was just mentioned and has not started yet), the new mention is **deduplicated** and no duplicate `task` is enqueued. Deduplication is **scoped to a single comment** — two different comments seconds apart that both @ the same agent will both enqueue a `task`.
+1. Replying to an agent's comment hands it to that agent.
+2. Replying inside a discussion an agent already participates in keeps that discussion's agent.
+3. Otherwise it goes to the issue's agent assignee; when the assignee is a squad, the leader handles it.
-<Callout type="warning">
-**Adding an @ by editing a comment does not re-trigger.** If you remember to add `@agent` only after posting, editing in the `@` only changes what is displayed — it **does not** deliver a new `task` to that agent. To trigger it, post a new comment or assign the issue to it.
-</Callout>
+When a comment explicitly @-mentions other targets (including members), the assignee fallback no longer applies.
+
+When a reply triggers an agent other than the assignee, Multica schedules a delayed fallback run for the assignee: if the target agent replies within about 5 minutes, the fallback is cancelled automatically; otherwise the assignee starts a run too.
+
+## Coalescing consecutive comments
+
+When the same agent already has a waiting task on the issue, new consecutive comments merge into the pending task; if the agent is already running, later comments wait for the current run to finish and merge into a single follow-up run. You can keep adding information without waiting for the agent to reply.
-## `@all` does not trigger any agent
+When one comment @-mentions several different agents, each agent gets its own task; multiple mentions resolving to the same agent keep only one.
+
+## Comments that don't trigger agents
+
+Two ways:
+
+- Start the comment with `/note`: it's posted as a note between members and triggers no agent.
+- Use `@all`: it notifies every workspace member and switches off this comment's automatic trigger for the assignee.
+
+If the trigger preview still lists an agent, untick it before sending.
+
+<Callout type="info">
+`@all` does not include agents. Agents have no inbox; to put one to work, @-mention it explicitly, reply in its discussion, or assign the issue to it.
+</Callout>
-When you call everyone with `@all`, **only workspace members land in the inbox — agents are not included in the `@all` expansion.** This is by design: agents do not receive inbox notifications, so `@all` has no meaning for them. To put an agent to work, mention it by name.
+## Access restrictions
-## Agents @-mentioning themselves does not loop
+An @-mention cannot bypass an agent's Access. When you lack permission to run the target, the target is archived, or it has no available runtime, the trigger preview explains that it won't start; the comment itself still posts normally. See [Agents](/agents#permissions-and-access) for the three Access levels.
-Agents can post comments while executing, and those comments may contain `@mention`s. Multica has a hardcoded guard: **if the comment author is the same as the agent targeted by an `@` mention, that mention is skipped** — there is no "agent A @ agent A → new task → @ agent A again" infinite loop.
+## Agents mentioning each other
-This guard **only blocks direct self-references.** Agent A @-mentioning agent B works normally; if B then @-mentions A in its reply, A is triggered again — in other words, **indirect recursion is not blocked**. When writing agent instructions, be careful not to let a group of agents @-mention each other in a cycle.
+Agents can @-mention other agents in their replies. When A @-mentions B and B @-mentions A back, the system merges duplicate runs at the same moment, but it does not decide when the collaboration should end — write the stop condition into the agent instructions.
-## Next
+## Next steps
-- [**Squads**](/squads) — `@`-mention a squad to have the leader route the question to the right member
-- [**Chat**](/chat) — one-to-one conversation outside any issue
-- [**Autopilots**](/autopilots) — let agents start work automatically on a schedule
-- [**Comments**](/comments) — `@mention` syntax, the picker, and `@all` semantics
+- [Comments](/comments) — replies, resolving discussions, notifications, and subscriptions.
+- [Agents](/agents) — configure identity, Access, and runtimes.
+- [Squads](/squads) — have a leader coordinate multiple agents.
diff --git a/apps/docs/content/docs/mentioning-agents.zh.mdx b/apps/docs/content/docs/mentioning-agents.zh.mdx
index fea61bf2e2..6622dc4b7b 100644
--- a/apps/docs/content/docs/mentioning-agents.zh.mdx
+++ b/apps/docs/content/docs/mentioning-agents.zh.mdx
@@ -1,63 +1,79 @@
---
-title: 在评论里 @ 智能体
-description: 用 @ 提及一个智能体,让它在评论里看一眼——不改 assignee、不改 status,比分配轻。
+title: 在评论中 @智能体
+description: 在 issue 的评论中 @智能体或继续回复,让它处理新的信息而不改变负责人。
---
import { Callout } from "fumadocs-ui/components/callout";
-在 [评论](/comments) 里 `@` 一个 [智能体](/agents) 是更轻的触发方式——**不改 assignee、不改 status**,只是让智能体在当前 [issue](/issues) 上看一眼。和 [**分配**](/assigning-issues)(把智能体变成负责人、接管 issue)相比,@ 提及适合"帮我看看这段"、"换个角度分析一下"、"拉进来讨论两句"。
+在评论中 @智能体,适合让它查看一条新信息、回答问题或协助当前负责人。评论会成为这次执行的起点,issue 的负责人和状态都不会改变。
-## 在评论里 @ 一个智能体
+## 分配与 @提及的选择
-和 @ 成员一样——打 `@` 触发 picker,选一个智能体。发出评论后 Multica 会立刻给被 @ 的每个智能体入队一个 `task`,附带**这条评论**作为触发上下文。智能体收到任务时能读到:
+| | 分配给智能体 | 在评论中 @智能体 |
+|---|---|---|
+| 适合 | 让智能体负责整条 issue | 请智能体处理当前评论 |
+| 改变负责人 | 是 | 否 |
+| 改变状态 | 否 | 否 |
+| 一次选择 | 一个智能体或小队 | 可以 @多个智能体或小队 |
+| 本轮焦点 | 整条 issue | 触发它的评论,以及同批合并的评论 |
-- Issue 的完整信息(描述 + 所有历史评论)
-- 触发评论本身——作为它本次工作的起点
+需要明确负责人时使用[分配](/assigning-issues);只需要临时加入讨论时使用 @提及。
-`@mention` 的 Markdown 语法、picker 的用法、`@all` 的语义见 [**评论**](/comments)。
+## 触发预览
-<Callout type="info">
-**`@` 也可以指向 [小队(squad)](/squads)。** picker 里小队和成员、智能体并列;选中后会插入 `[@SquadName](mention://squad/<uuid>)`,触发小队的**队长智能体**来协调响应——assignee 和 status 都不会变。
-</Callout>
+在评论编辑器中选择智能体或小队后,输入框下方会显示触发预览:
-## 和分配的差别
+- 哪些智能体会在发送后开始工作;
+- 目标来自直接 @提及、issue 负责人还是小队 leader;
+- 目标是否不可用,或你是否缺少调用权限。
-同样是让智能体工作,但机制完全不同:
+取消选中某个智能体只跳过这一次触发,不需要删除评论中的名字,也不会修改智能体的 Access。
-| 维度 | 分配 | @ 提及 |
-|---|---|---|
-| 改 `assignee` | ✓ | ✗ |
-| 改 `status` | ✗ | ✗ |
-| 入队 `task` | 立刻(非 Backlog) | 立刻 |
-| 触发评论 ID | 可选 | 强制带当前评论 |
-| 一次指向几个智能体 | 1(一个 assignee)| 多(评论里可 @ 多个)|
-| 优先级 | 继承 issue | 继承 issue |
+![发送前的触发预览:列出发送后将开始工作的智能体](/images/docs/mention-trigger-preview.png)
-判据很简单:**想让智能体"从此负责这个 issue"用分配;只想让它"看一下当前上下文"用 @ 提及**。
+评论发布后,在线的运行时通常立即领取;运行时离线时,执行任务留在队列中等待。
-## @ 多个智能体会怎样
+## 回复的自动路由
-一条评论里 @ 多个智能体,每个都会独立入队一个 `task`,各走各的运行时——**并发执行**,互相不阻塞。
+普通评论(不含任何 @)按讨论上下文路由:
-如果同一个 issue 上某个智能体已经有 `queued` 或 `dispatched` 的 `task`(比如刚被 @ 过还没开始跑),这次 @ 会被**去重**,不重复入队。去重是**按单条评论**做的——两条不同的评论几秒内都 @ 同一个智能体,两个 `task` 都会入队。
+1. 回复智能体的评论时,交给该智能体。
+2. 在已有智能体参与的讨论中回复时,沿用这条讨论的智能体。
+3. 都不满足时,交给 issue 的智能体负责人;负责人是小队时,由 leader 处理。
-<Callout type="warning">
-**编辑评论后新加进去的 @ 不会重新触发**。如果你发完评论才想起要加 `@agent`,编辑加上的 `@` 只改显示——**不会**让那个智能体收到新 `task`。要触发它,发一条新评论或把 issue 分配给它。
-</Callout>
+评论明确 @了其他对象(包括成员)时,不再使用负责人兜底。
+
+回复触发了非负责人的智能体时,Multica 会为负责人安排一次延迟兜底:目标智能体在约 5 分钟内回复,兜底自动取消;否则负责人也会开始一次执行。
+
+## 连续评论的合并
+
+同一个智能体在同一条 issue 上已有等待中的执行任务时,新评论会合并进这条任务;它已经在执行时,后续评论等当前任务结束后合并为一次跟进执行。可以连续补充信息,不必等智能体回复。
-## @all 不会触发任何智能体
+一条评论 @多个不同智能体时,每个智能体各得一条执行任务;多个提及指向同一个智能体时,只保留一次。
+
+## 不触发智能体的留言
+
+两种方式:
+
+- 以 `/note` 开头:评论作为成员之间的备注,不触发任何智能体。
+- 使用 `@all`:通知全部工作区成员,同时关闭这条评论对负责人的自动触发。
+
+触发预览中仍有智能体时,发送前取消选中即可。
+
+<Callout type="info">
+`@all` 不包含智能体。智能体没有收件箱;让它工作需要明确 @它、回复相关讨论,或把 issue 分配给它。
+</Callout>
-用 `@all` 呼叫全体时,**只有工作区成员进 inbox——智能体不被包含在 `@all` 的展开里**。这是 by design:智能体不接收 inbox 通知,`@all` 对它们没意义。想让智能体干活还是要明确 @ 它的名字。
+## Access 限制
-## 智能体自己 @ 自己不会死循环
+@提及不能绕过智能体的 Access。无权调用、目标已归档或没有可用运行时时,触发预览会说明它不会启动;评论本身仍可正常发布。三档语义见[智能体](/agents#权限与-access)。
-智能体在执行中可以发评论,评论里也可能带 `@mention`。Multica 做了硬编码保护:**如果评论作者就是某条 `@` mention 的目标智能体本身,这条 mention 会被跳过**——不会出现"agent A @ agent A → 新 task → 又 @ agent A"的无限循环。
+## 智能体之间的互相提及
-这条保护**只防直接自引用**。智能体 @ 另一个智能体(A @ B)正常触发;如果 B 在回应里又 @ A,A 会被再次触发——也就是说**间接递归不防**。给智能体写指令时注意不要让几个智能体之间互相 `@` 形成循环。
+智能体可以在自己的回复中 @其他智能体。A @ B、B 又 @ A 时,系统会合并同一时刻的重复执行,但不会判断这段协作是否应该结束——协作的终止条件需要写进智能体指令。
-## 下一步
+## 接下来
-- [**小队**](/squads) —— `@` 一个小队,由队长把问题派给合适的成员
-- [**对话**](/chat) —— 脱离 issue 和智能体一对一聊
-- [**Autopilots**](/autopilots) —— 让智能体定时自动开工
-- [**评论**](/comments) —— `@mention` 的语法、picker、`@all` 的语义
+- [评论](/comments) — 回复、解决讨论、通知和订阅。
+- [智能体](/agents) — 配置身份、Access 和运行时。
+- [小队](/squads) — 由 leader 协调多个智能体。
diff --git a/apps/docs/content/docs/meta.ja.json b/apps/docs/content/docs/meta.ja.json
index 2a74493d28..515480ad0e 100644
--- a/apps/docs/content/docs/meta.ja.json
+++ b/apps/docs/content/docs/meta.ja.json
@@ -1,50 +1,55 @@
{
"title": "ドキュメント",
"pages": [
+ "---はじめに---",
"index",
- "how-multica-works",
"cloud-quickstart",
+ "concepts",
+ "how-multica-works",
"self-host-quickstart",
- "---ワークスペース & チーム---",
+ "---ワークスペース---",
"workspaces",
"members-roles",
+ "---イシューとプロジェクト---",
"issues",
"projects",
- "comments",
"project-resources",
"---エージェント---",
"agents",
"agents-create",
"skills",
"squads",
- "---エージェントの実行方法---",
- "daemon-runtimes",
- "install-agent-runtime",
- "tasks",
- "providers",
- "---エージェントとの協業---",
+ "---日常のコラボレーション---",
+ "triggering-agents",
"assigning-issues",
+ "comments",
"mentioning-agents",
"chat",
- "autopilots",
- "---インボックス---",
"inbox",
+ "---ランタイムと実行---",
+ "tasks",
+ "daemon-runtimes",
+ "install-agent-runtime",
+ "providers",
+ "---自動化---",
+ "autopilots",
"---連携---",
"channels",
- "github-integration",
- "vcs-integration",
"lark-bot-integration",
"slack-bot-integration",
- "---セルフホスト & 運用---",
+ "github-integration",
+ "vcs-integration",
+ "---アプリ---",
+ "desktop-app",
+ "mobile-app",
+ "---セルフホスティング---",
"environment-variables",
"auth-setup",
"troubleshooting",
"---リファレンス---",
"cli",
"auth-tokens",
- "desktop-app",
- "mobile-app",
- "---開発者---",
+ "---開発に参加---",
"developers"
]
}
diff --git a/apps/docs/content/docs/meta.json b/apps/docs/content/docs/meta.json
index 756d2c79b6..bcdabb8a16 100644
--- a/apps/docs/content/docs/meta.json
+++ b/apps/docs/content/docs/meta.json
@@ -1,50 +1,55 @@
{
"title": "Documentation",
"pages": [
+ "---Get started---",
"index",
- "how-multica-works",
"cloud-quickstart",
+ "concepts",
+ "how-multica-works",
"self-host-quickstart",
- "---Workspace & team---",
+ "---Workspace---",
"workspaces",
"members-roles",
+ "---Issues & projects---",
"issues",
"projects",
- "comments",
"project-resources",
"---Agents---",
"agents",
"agents-create",
"skills",
"squads",
- "---How agents run---",
- "daemon-runtimes",
- "install-agent-runtime",
- "tasks",
- "providers",
- "---Collaborating with agents---",
+ "---Everyday collaboration---",
+ "triggering-agents",
"assigning-issues",
+ "comments",
"mentioning-agents",
"chat",
- "autopilots",
- "---Inbox---",
"inbox",
+ "---Runtime & execution---",
+ "tasks",
+ "daemon-runtimes",
+ "install-agent-runtime",
+ "providers",
+ "---Automation---",
+ "autopilots",
"---Integrations---",
"channels",
- "github-integration",
- "vcs-integration",
"lark-bot-integration",
"slack-bot-integration",
- "---Self-hosting & ops---",
+ "github-integration",
+ "vcs-integration",
+ "---Apps---",
+ "desktop-app",
+ "mobile-app",
+ "---Self-hosting---",
"environment-variables",
"auth-setup",
"troubleshooting",
"---Reference---",
"cli",
"auth-tokens",
- "desktop-app",
- "mobile-app",
- "---Developers---",
+ "---Development---",
"developers"
]
}
diff --git a/apps/docs/content/docs/meta.ko.json b/apps/docs/content/docs/meta.ko.json
index 3c18dc47c9..ab1760b5f5 100644
--- a/apps/docs/content/docs/meta.ko.json
+++ b/apps/docs/content/docs/meta.ko.json
@@ -1,50 +1,55 @@
{
- "title": "Documentation",
+ "title": "문서",
"pages": [
+ "---시작하기---",
"index",
- "how-multica-works",
"cloud-quickstart",
+ "concepts",
+ "how-multica-works",
"self-host-quickstart",
- "---워크스페이스 & 팀---",
+ "---워크스페이스---",
"workspaces",
"members-roles",
+ "---이슈와 프로젝트---",
"issues",
"projects",
- "comments",
"project-resources",
"---에이전트---",
"agents",
"agents-create",
"skills",
"squads",
- "---에이전트 실행 방식---",
- "daemon-runtimes",
- "install-agent-runtime",
- "tasks",
- "providers",
- "---에이전트와 협업---",
+ "---일상 협업---",
+ "triggering-agents",
"assigning-issues",
+ "comments",
"mentioning-agents",
"chat",
- "autopilots",
- "---인박스---",
"inbox",
+ "---런타임과 실행---",
+ "tasks",
+ "daemon-runtimes",
+ "install-agent-runtime",
+ "providers",
+ "---자동화---",
+ "autopilots",
"---연동---",
"channels",
- "github-integration",
- "vcs-integration",
"lark-bot-integration",
"slack-bot-integration",
- "---자체 호스팅 & 운영---",
+ "github-integration",
+ "vcs-integration",
+ "---앱---",
+ "desktop-app",
+ "mobile-app",
+ "---자체 호스팅---",
"environment-variables",
"auth-setup",
"troubleshooting",
- "---참고---",
+ "---레퍼런스---",
"cli",
"auth-tokens",
- "desktop-app",
- "mobile-app",
- "---개발자---",
+ "---개발 참여---",
"developers"
]
}
diff --git a/apps/docs/content/docs/meta.zh.json b/apps/docs/content/docs/meta.zh.json
index 503726f7d6..7ef7e289fe 100644
--- a/apps/docs/content/docs/meta.zh.json
+++ b/apps/docs/content/docs/meta.zh.json
@@ -1,50 +1,55 @@
{
- "title": "Documentation",
+ "title": "Multica 文档",
"pages": [
+ "---开始使用---",
"index",
- "how-multica-works",
"cloud-quickstart",
+ "concepts",
+ "how-multica-works",
"self-host-quickstart",
- "---工作区与团队---",
+ "---工作区---",
"workspaces",
"members-roles",
+ "---Issue 与项目---",
"issues",
"projects",
- "comments",
"project-resources",
"---智能体---",
"agents",
"agents-create",
"skills",
"squads",
- "---智能体怎么运行---",
- "daemon-runtimes",
- "install-agent-runtime",
- "tasks",
- "providers",
- "---与智能体协作---",
+ "---日常协作---",
+ "triggering-agents",
"assigning-issues",
+ "comments",
"mentioning-agents",
"chat",
- "autopilots",
- "---收件箱---",
"inbox",
+ "---运行时与执行---",
+ "tasks",
+ "daemon-runtimes",
+ "install-agent-runtime",
+ "providers",
+ "---自动化---",
+ "autopilots",
"---集成---",
"channels",
- "github-integration",
- "vcs-integration",
"lark-bot-integration",
"slack-bot-integration",
- "---自部署运维---",
+ "github-integration",
+ "vcs-integration",
+ "---客户端---",
+ "desktop-app",
+ "mobile-app",
+ "---自托管---",
"environment-variables",
"auth-setup",
"troubleshooting",
"---参考---",
"cli",
"auth-tokens",
- "desktop-app",
- "mobile-app",
- "---开发者---",
+ "---参与开发---",
"developers"
]
}
diff --git a/apps/docs/content/docs/mobile-app.ja.mdx b/apps/docs/content/docs/mobile-app.ja.mdx
index 9adf2ddaab..7c0ba538cc 100644
--- a/apps/docs/content/docs/mobile-app.ja.mdx
+++ b/apps/docs/content/docs/mobile-app.ja.mdx
@@ -1,82 +1,94 @@
---
title: モバイルアプリ (iOS)
-description: まだ App Store にないオープンソースの Multica iOS アプリを、自分の iPhone に自分でビルドする方法。
+description: ソースコードから Multica を iPhone にインストールし、Cloud またはセルフホストインスタンスに接続します。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica の iOS クライアントはオープンソースで、web、desktop、バックエンドとともに[メインリポジトリ](https://github.com/multica-ai/multica)に含まれています。まだ App Store にはなく、その状況が変わるまでは、iPhone で使いたい人がソースから自分でビルドします。ビルドは初回は約 10〜20 分、それ以降は約 2 分かかり、[multica.ai](https://multica.ai) と同じバックエンドと通信するため、既存のアカウントがそのまま使えます。
+Multica の iOS クライアントはまだ App Store にありません。Mac でオープンソースリポジトリから Release 版をビルドし、自分の iPhone にインストールできます。Android クライアントはまだ提供されていません。
-<Callout type="info">
-このページは**個人利用**向けです。アプリ開発者はリポジトリの [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md) を読んでください — dev / staging のバリアントと全スクリプト一覧を扱っています。
-</Callout>
+インストールしたアプリはデフォルトで Multica Cloud に接続し、既存のアカウントでそのままサインインできます。ワークスペース、イシュー、コメント、実行履歴はすべてサーバー側に保存されるため、Web や Desktop から手動で同期する必要はありません。
-## 必要なもの
+## 事前準備
-- Xcode がインストールされた **Mac**(App Store から無料で入手できます)。
-- Xcode → Settings → Accounts に追加した無料の **Apple ID**。有料の Apple Developer Program アカウントは任意で、7 日間の署名期間を 1 年に延長するだけです — 下記の [7 日制限](#7-day-signing-limit)を参照してください。
-- USB ケーブルで接続され、[Developer Mode が有効になった](https://docs.expo.dev/guides/ios-developer-mode/) **iPhone**(設定 → プライバシーとセキュリティ → デベロッパモード)。
-- チェックアウトした Multica のソースコード:
+必要なもの:
- ```bash
- git clone https://github.com/multica-ai/multica.git
- cd multica
- pnpm install
- ```
+- Xcode をインストールした Mac。
+- **Xcode → Settings → Accounts** でサインイン済みの Apple ID。
+- USB で接続した iPhone。
+- iPhone の **設定 → プライバシーとセキュリティ** でデベロッパモードを有効にしておくこと。
+- Node.js、pnpm、Git。
-この一覧に欠けているものがあれば、Expo の [Set up your environment](https://docs.expo.dev/get-started/set-up-your-environment/) に沿って進めてください(**Development build → iOS Device** を選択)。リポジトリのチェックアウトを除くすべてに関する公式のセットアップガイドです。
+Xcode や実機の開発環境がまだ設定されていない場合は、先に Expo の [iOS デバイスの環境セットアップ](https://docs.expo.dev/get-started/set-up-your-environment/)を完了してください。
-## ビルドする
+## iPhone へのインストール
-コマンドは 1 つ:
+リポジトリをクローンして依存関係をインストールします:
```bash
-pnpm ios:mobile:device:prod:release
+git clone https://github.com/multica-ai/multica.git
+cd multica
+pnpm install
```
-Xcode は Apple ID が自動的に所有する "Personal Team" でビルドに署名します — この team はどの Apple ID であれ初めて Xcode にサインインしたときに静かに作成されるため、何かを設定した記憶がなくてもすでに存在しています。これは **Release ビルド**です。Metro への依存がなく、スプラッシュ画面 → アプリへとつながり、App Store からインストールしたものとまったく同じです。
+続いてリポジトリのルートから実行します:
-初回ビルドは CocoaPods をダウンロードし、React Native をソースからコンパイルします — 10〜20 分ほど見込んでください。以降のビルドは Xcode のキャッシュを再利用します。
+```bash
+pnpm ios:mobile:device:prod:release
+```
-一般的な手順はこれで終わりです。署名が失敗したら [トラブルシューティング](#troubleshooting)に進んでください。
+これは Metro に依存しない Release 版をビルドし、接続中の iPhone にインストールします。初回ビルドは iOS の依存関係をダウンロードして React Native をコンパイルするため時間がかかりますが、以降は Xcode のキャッシュを再利用します。
-## 7 日間の署名制限
+iPhone がアプリの起動をブロックする場合は、**設定 → 一般 → VPN とデバイス管理** で対応する開発者証明書を信頼してください。
-無料の Apple ID はビルドを **7 日間**署名します。それを過ぎると、アプリは iPhone での起動を拒否し、「untrusted developer」エラーを表示します。Mac に再び接続して同じコマンドを再実行し、再署名してください — データはアプリではなくバックエンドにあるため、そのまま保持されます。
+## 無料署名の 7 日制限
-これを延長する唯一の方法は **Apple Developer Program アカウント**です([developer.apple.com](https://developer.apple.com) で年間 $99)。すると署名は更新の間 1 年間有効になり、TestFlight を通じて他のデバイスに配布することもできます。
+無料の Apple ID で署名したアプリは 7 日間しか使えません。期限が切れたら、iPhone を Mac に接続し直し、同じビルドコマンドをもう一度実行すれば再署名できます。
-## 更新
+Apple Developer Program アカウントで署名すると有効期間が長くなり、TestFlight や正式な配布にも使えます。どちらの署名でも、再インストールや再署名によってサーバー側のデータが失われることはありません。
+
+## 署名の失敗
-まだ自動更新はありません。Multica のコードベースが進んだら、pull して再ビルドしてください。
+Xcode が `No matching provisioning profiles found` と報告する場合、デフォルトの bundle identifier があなたの Apple ID に属していない可能性があります。自分が管理する逆ドメイン名に切り替えて再ビルドしてください:
```bash
-git pull
-pnpm install
+export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
pnpm ios:mobile:device:prod:release
```
-Xcode がネイティブコンパイルをキャッシュするため、以降のビルドは高速です。
+この値はあなたの Apple Developer team で利用できれば十分で、Multica のアカウントやワークスペースには影響しません。
-## なぜまだ App Store にないのか
+## 更新
-iOS アプリはまだ速いペースで動いています — チームは今のところ App Store の審査サイクルよりも、リリースして反復改善することを好んでいます。正式な App Store リリースの前に TestFlight ベータが最も可能性の高い次のステップです。それまでは、上記の自前ビルドが iOS で Multica を使う唯一の方法です。
+自分でインストールした iOS ビルドは自動更新されません。最新のコードを取得し、依存関係を更新して再ビルドします:
-TestFlight が公開されたときに通知を受け取りたい場合は、[GitHub リポジトリ](https://github.com/multica-ai/multica)を watch してください。
+```bash
+git pull --ff-only
+pnpm install
+pnpm ios:mobile:device:prod:release
+```
-## トラブルシューティング
+## セルフホストインスタンスへの接続
-**「No matching provisioning profiles found」** — Xcode がデフォルトのバンドル id `ai.multica.mobile` をあなたの Apple ID で署名することを拒否しています。まれですが、誰かが Apple の開発者ポータルでそのプレフィックスを登録していると発生します。自分が管理する任意の逆引きドメイン(`com.yourname.multica` で十分です)を選んで export し、再実行してください。
+Release ビルドは API アドレスをアプリに埋め込みます。セルフホストインスタンスに接続するには、先に `apps/mobile/.env.production` を編集します:
-```bash
-export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
-pnpm ios:mobile:device:prod:release
+```dotenv
+EXPO_PUBLIC_API_URL=https://api.example.com
+EXPO_PUBLIC_WEB_URL=https://app.example.com
```
-id 自体に意味がある必要はありません — Apple は単に他の team に占有されていないことだけを求めています。
+`EXPO_PUBLIC_API_URL` は必須です。`EXPO_PUBLIC_WEB_URL` は任意で、"Copy link" や "Open on web" などの入口に使われます。未設定の場合、これらのメニュー項目は表示されません。
+
+編集後にビルドコマンドを再実行します。iPhone がこの API アドレスに到達できる必要があります。LAN のアドレスを使う場合、`localhost` と書かないでください — iPhone 上では iPhone 自身を指します。
+
+<Callout type="warning">
+`.env.production` を変更すると、現在のチェックアウトの本番設定が変わります。その変更をコミットすると、個人の API アドレスがリポジトリの本番設定に書き込まれます。
+</Callout>
-**「Could not launch &lt;app&gt;」/「Untrusted Developer」** — 7 日制限に達したか(ビルドを再実行してください)、iPhone で開発者プロファイルを手動で信頼する必要があります。設定 → 一般 → VPN とデバイス管理 → あなたの Apple ID をタップ → 信頼。
+モバイルの開発、Simulator の使用、staging への接続については、リポジトリの [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md) を参照してください。
-**`Pod install` でビルドが止まる、または延々とコンパイルが続く** — 初回ビルドは CocoaPods が依存関係をダウンロードし、Xcode が React Native をソースからコンパイルするため、実際に 10〜20 分かかります。以降のビルドははるかに高速です。
+## 次のステップ
-**アプリがバックエンドに接続できない** — `apps/mobile/.env.production` が変更されていないか確認してください(デフォルトでは `EXPO_PUBLIC_API_URL=https://api.multica.ai` が同梱されています)。変更した場合は `git checkout apps/mobile/.env.production` で復元してください。
+- [クイックスタート](/cloud-quickstart) — 初回の実行を完了する。
+- [デスクトップアプリ](/desktop-app) — デスクトップタブと内蔵デーモン。
+- [トラブルシューティング](/troubleshooting) — 接続と実行の問題の診断。
diff --git a/apps/docs/content/docs/mobile-app.ko.mdx b/apps/docs/content/docs/mobile-app.ko.mdx
index c4c0ccb7d3..0283af598f 100644
--- a/apps/docs/content/docs/mobile-app.ko.mdx
+++ b/apps/docs/content/docs/mobile-app.ko.mdx
@@ -1,82 +1,94 @@
---
-title: 모바일 앱 (iOS)
-description: 아직 App Store에 없는 오픈소스 Multica iOS 앱을 직접 본인 iPhone에 빌드하는 방법.
+title: 모바일 앱(iOS)
+description: 소스에서 Multica를 빌드해 iPhone에 설치하고 Cloud 또는 자체 호스팅 인스턴스에 연결합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica의 iOS 클라이언트는 오픈소스이며, web, desktop, 백엔드와 함께 [메인 저장소](https://github.com/multica-ai/multica)에 들어 있습니다. 아직 App Store에는 없으며, 그 상황이 바뀌기 전까지는 iPhone에서 사용하려는 사람이 직접 소스에서 빌드합니다. 빌드는 처음에는 약 10~20분, 그 이후에는 약 2분이 걸리며, [multica.ai](https://multica.ai)와 동일한 백엔드와 통신하므로 기존 계정이 그대로 동작합니다.
+Multica iOS 클라이언트는 아직 App Store에 출시되지 않았습니다. Mac에서 오픈 소스 저장소의 Release 버전을 빌드해 자신의 iPhone에 설치할 수 있습니다. Android 클라이언트는 아직 제공하지 않습니다.
-<Callout type="info">
-이 페이지는 **개인 사용자**를 위한 것입니다. 앱 개발자는 저장소의 [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md)를 읽어야 합니다 — dev / staging 변형과 전체 스크립트 목록을 다룹니다.
-</Callout>
+설치된 앱은 기본적으로 Multica Cloud에 연결되며 기존 계정으로 로그인하면 됩니다. 워크스페이스, 이슈, 댓글, 실행 기록은 모두 서버에 저장되므로 Web이나 Desktop에서 직접 동기화할 필요가 없습니다.
-## 필요한 것
+## 준비 사항
-- Xcode가 설치된 **Mac** (App Store에서 무료로 받을 수 있습니다).
-- Xcode → Settings → Accounts에 추가한 무료 **Apple ID**. 유료 Apple Developer Program 계정은 선택 사항이며, 7일 서명 기간을 1년으로 늘려줄 뿐입니다 — 아래 [7일 제한](#7-day-signing-limit)을 참고하세요.
-- USB 케이블로 연결되어 있고 [Developer Mode가 활성화된](https://docs.expo.dev/guides/ios-developer-mode/) **iPhone** (설정 → 개인 정보 보호 및 보안 → 개발자 모드).
-- 체크아웃한 Multica 소스 코드:
+다음 항목이 필요합니다.
- ```bash
- git clone https://github.com/multica-ai/multica.git
- cd multica
- pnpm install
- ```
+- Xcode가 설치된 Mac
+- **Xcode → Settings → Accounts**에서 로그인한 Apple ID
+- USB로 연결된 iPhone
+- iPhone의 **설정 → 개인정보 보호 및 보안**에서 활성화한 개발자 모드
+- Node.js, pnpm, Git
-이 목록에서 빠진 것이 있다면, Expo의 [Set up your environment](https://docs.expo.dev/get-started/set-up-your-environment/)를 따라 진행하세요 (**Development build → iOS Device**를 선택). 저장소 체크아웃을 제외한 모든 것에 대한 공식 설정 가이드입니다.
+Xcode 또는 실제 기기 개발 환경이 설정되지 않았다면 먼저 Expo의 [iOS Device 환경 설정](https://docs.expo.dev/get-started/set-up-your-environment/)을 완료하세요.
-## 빌드하기
+## iPhone에 설치
-명령어 하나:
+저장소를 clone하고 의존성을 설치합니다.
```bash
-pnpm ios:mobile:device:prod:release
+git clone https://github.com/multica-ai/multica.git
+cd multica
+pnpm install
```
-Xcode는 Apple ID가 자동으로 소유하는 "Personal Team"으로 빌드에 서명합니다 — 이 team은 어떤 Apple ID로든 처음 Xcode에 로그인할 때 조용히 생성되므로, 무언가를 설정한 기억이 없더라도 이미 존재합니다. 이것은 **Release 빌드**입니다: Metro 의존성이 없고, 스플래시 화면 → 앱으로 이어지며, App Store에서 설치한 것과 똑같습니다.
+그런 다음 저장소 루트에서 다음 명령을 실행합니다.
-첫 빌드는 CocoaPods를 다운로드하고 React Native를 소스에서 컴파일합니다 — 10~20분 정도 예상하세요. 이후 빌드는 Xcode의 캐시를 재사용합니다.
+```bash
+pnpm ios:mobile:device:prod:release
+```
-일반적인 경로는 이것으로 끝입니다. 서명이 실패하면 [문제 해결](#troubleshooting)로 이동하세요.
+Metro에 의존하지 않는 Release 버전을 빌드해 연결된 iPhone에 설치합니다. 처음 빌드할 때는 iOS 의존성을 내려받고 React Native를 컴파일하며 이후에는 Xcode 캐시를 재사용합니다.
-## 7일 서명 제한
+iPhone에서 앱 실행을 차단하면 **설정 → 일반 → VPN 및 기기 관리**에서 해당 개발자 인증서를 신뢰하도록 설정하세요.
-무료 Apple ID는 빌드를 **7일** 동안 서명합니다. 그 이후에는 앱이 iPhone에서 실행을 거부하고 "untrusted developer" 오류를 표시합니다. Mac에 다시 연결하고 동일한 명령어를 다시 실행하여 재서명하세요 — 데이터는 앱이 아니라 백엔드에 있으므로 그대로 유지됩니다.
+## 무료 서명의 7일 제한
-이를 연장하는 유일한 방법은 **Apple Developer Program 계정**입니다 ([developer.apple.com](https://developer.apple.com)에서 연 $99). 그러면 서명이 갱신 사이 1년 동안 유효하며, TestFlight를 통해 다른 기기에 배포할 수도 있습니다.
+무료 Apple ID로 서명한 앱은 7일 동안만 사용할 수 있습니다. 만료되면 iPhone을 Mac에 다시 연결하고 같은 빌드 명령을 실행해 서명을 갱신하세요.
-## 업데이트
+Apple Developer Program 계정으로 서명하면 유효 기간이 더 길고 TestFlight와 정식 배포에도 사용할 수 있습니다. 어떤 서명을 사용하더라도 재설치나 서명 갱신으로 서버 데이터가 사라지지 않습니다.
+
+## 서명 실패
-아직 자동 업데이트는 없습니다. Multica 코드베이스가 앞으로 나아가면, pull한 후 다시 빌드하세요:
+Xcode에 `No matching provisioning profiles found`가 표시되면 기본 bundle identifier가 Apple ID에 속하지 않을 수 있습니다. 자신이 제어하는 역방향 도메인으로 바꾼 뒤 다시 빌드하세요.
```bash
-git pull
-pnpm install
+export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
pnpm ios:mobile:device:prod:release
```
-Xcode가 네이티브 컴파일을 캐시하므로 이후 빌드는 빠릅니다.
+이 값은 자신의 Apple Developer team에서 사용할 수 있기만 하면 되며 Multica 계정이나 워크스페이스에는 영향을 주지 않습니다.
-## 아직 App Store에 없는 이유
+## 업데이트
-iOS 앱은 여전히 빠르게 움직이고 있습니다 — 팀은 지금 App Store 심사 주기보다 출시 후 반복 개선을 선호합니다. 정식 App Store 출시 전에 TestFlight 베타가 가장 유력한 다음 단계입니다. 그때까지는 위의 직접 빌드 방식이 iOS에서 Multica를 사용하는 유일한 방법입니다.
+직접 설치한 iOS 버전은 자동으로 업데이트되지 않습니다. 최신 코드를 pull하고 의존성을 업데이트한 뒤 다시 빌드하세요.
-TestFlight가 열릴 때 알림을 받고 싶다면 [GitHub 저장소](https://github.com/multica-ai/multica)를 watch하세요.
+```bash
+git pull --ff-only
+pnpm install
+pnpm ios:mobile:device:prod:release
+```
-## 문제 해결
+## 자체 호스팅 인스턴스 연결
-**"No matching provisioning profiles found"** — Xcode가 기본 번들 id `ai.multica.mobile`를 Apple ID로 서명하기를 거부합니다. 드물지만, 누군가 Apple 개발자 포털에서 해당 접두사를 등록했다면 발생합니다. 본인이 제어하는 아무 역방향 도메인(`com.yourname.multica`이면 충분합니다)을 골라 export한 후 다시 실행하세요:
+Release 빌드는 API 주소를 앱에 포함합니다. 자체 호스팅 인스턴스에 연결하려면 먼저 `apps/mobile/.env.production`을 수정합니다.
-```bash
-export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
-pnpm ios:mobile:device:prod:release
+```dotenv
+EXPO_PUBLIC_API_URL=https://api.example.com
+EXPO_PUBLIC_WEB_URL=https://app.example.com
```
-id 자체는 어떤 의미가 있을 필요가 없습니다 — Apple은 단지 다른 team이 점유하지 않았다는 것만 요구합니다.
+`EXPO_PUBLIC_API_URL`은 필수입니다. `EXPO_PUBLIC_WEB_URL`은 "Copy link", "Open on web" 같은 메뉴에 사용하는 선택 항목이며 설정하지 않으면 이 메뉴가 표시되지 않습니다.
+
+수정한 뒤 빌드 명령을 다시 실행합니다. iPhone에서 이 API 주소에 접근할 수 있어야 합니다. 로컬 네트워크 주소를 사용할 때는 `localhost`를 쓰지 마세요. iPhone에서는 휴대전화 자체를 가리킵니다.
+
+<Callout type="warning">
+`.env.production`을 수정하면 현재 checkout의 프로덕션 설정이 바뀝니다. 이 변경을 커밋하면 개인 API 주소가 저장소의 프로덕션 설정에 들어갑니다.
+</Callout>
-**"Could not launch &lt;app&gt;" / "Untrusted Developer"** — 7일 제한에 도달했거나(빌드를 다시 실행하세요), iPhone에서 개발자 프로필을 수동으로 신뢰해야 합니다: 설정 → 일반 → VPN 및 기기 관리 → Apple ID를 탭 → 신뢰.
+모바일 개발, Simulator 사용, staging 연결 방법은 저장소의 [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md)를 참고하세요.
-**`Pod install`에서 빌드가 멈추거나 끝없이 컴파일됨** — 첫 빌드는 CocoaPods가 의존성을 다운로드하고 Xcode가 React Native를 소스에서 컴파일하기 때문에 실제로 10~20분이 걸립니다. 이후 빌드는 훨씬 빠릅니다.
+## 다음 단계
-**앱이 백엔드에 연결할 수 없음** — `apps/mobile/.env.production`이 수정되지 않았는지 확인하세요(기본값은 `EXPO_PUBLIC_API_URL=https://api.multica.ai`입니다). 변경했다면 `git checkout apps/mobile/.env.production`으로 복원하세요.
+- [빠른 시작](/cloud-quickstart) — 첫 실행을 완료합니다.
+- [Desktop 앱](/desktop-app) — 데스크톱 탭과 내장 데몬을 알아봅니다.
+- [문제 해결](/troubleshooting) — 연결 및 실행 문제를 해결합니다.
diff --git a/apps/docs/content/docs/mobile-app.mdx b/apps/docs/content/docs/mobile-app.mdx
index b4a61584f8..06f1807cef 100644
--- a/apps/docs/content/docs/mobile-app.mdx
+++ b/apps/docs/content/docs/mobile-app.mdx
@@ -1,82 +1,94 @@
---
title: Mobile app (iOS)
-description: How to build the open-source Multica iOS app on your own iPhone — no App Store yet.
+description: Install Multica on your iPhone from source, and connect to Cloud or a self-hosted instance.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica's iOS client is open-source and lives in the [main repo](https://github.com/multica-ai/multica) alongside web, desktop, and backend. It isn't on the App Store yet — until that changes, anyone who wants it on their iPhone builds from source. The build takes about 10–20 minutes the first time and ~2 minutes after that, and it talks to the same backend as [multica.ai](https://multica.ai) so your existing account just works.
+The Multica iOS client is not on the App Store yet. You can build a Release version from the open-source repository on a Mac and install it on your own iPhone. There is no Android client yet.
-<Callout type="info">
-This page is for **personal use**. App developers should read [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md) in the repo — it covers the dev / staging variants and the full script matrix.
-</Callout>
+The installed app connects to Multica Cloud by default; sign in with your existing account. Workspaces, issues, comments, and run history all live on the server — nothing needs to be synced manually from web or Desktop.
-## What you need
+## Prerequisites
-- A **Mac** with Xcode installed (free from the App Store).
-- A free **Apple ID** added under Xcode → Settings → Accounts. A paid Apple Developer Program account is optional and only extends the 7-day signing window to 1 year — see [7-day limit](#7-day-signing-limit) below.
-- An **iPhone** connected via USB cable, with [Developer Mode enabled](https://docs.expo.dev/guides/ios-developer-mode/) (Settings → Privacy & Security → Developer Mode).
-- The Multica source code checked out:
+You need:
- ```bash
- git clone https://github.com/multica-ai/multica.git
- cd multica
- pnpm install
- ```
+- a Mac with Xcode installed;
+- an Apple ID signed in under **Xcode → Settings → Accounts**;
+- an iPhone connected via USB;
+- Developer Mode enabled on the iPhone under **Settings → Privacy & Security**;
+- Node.js, pnpm, and Git.
-If anything in that list is missing, walk through Expo's [Set up your environment](https://docs.expo.dev/get-started/set-up-your-environment/) (pick **Development build → iOS Device**) — it's the canonical setup guide for everything except the repo checkout.
+If Xcode or the on-device development environment isn't set up yet, complete Expo's [iOS device environment setup](https://docs.expo.dev/get-started/set-up-your-environment/) first.
-## Build it
+## Installing to your iPhone
-One command:
+Clone the repository and install dependencies:
```bash
-pnpm ios:mobile:device:prod:release
+git clone https://github.com/multica-ai/multica.git
+cd multica
+pnpm install
```
-Xcode signs the build with the "Personal Team" your Apple ID automatically owns — this team is created silently the first time you sign into Xcode with any Apple ID, so it's there even if you don't remember setting anything up. This is a **Release build**: no Metro dependency, splash → app, exactly like an App Store install.
+Then run from the repo root:
-The first build downloads CocoaPods + compiles React Native from source — expect 10–20 minutes. Subsequent builds reuse Xcode's cache.
+```bash
+pnpm ios:mobile:device:prod:release
+```
-That's it for the typical path. If signing fails, jump to [Troubleshooting](#troubleshooting).
+This builds a Release version with no Metro dependency and installs it on the connected iPhone. The first build downloads iOS dependencies and compiles React Native; later builds reuse Xcode's cache.
-## 7-day signing limit
+If the iPhone blocks the app from opening, trust the developer certificate under **Settings → General → VPN & Device Management**.
-A free Apple ID signs builds for **7 days**. After that, the app refuses to launch on your iPhone and shows an "untrusted developer" error. Plug back into your Mac and re-run the same command to re-sign — your data stays put because it lives on the backend, not in the app.
+## 7-day limit of free signing
-The only way to extend this is an **Apple Developer Program account** ($99/yr from [developer.apple.com](https://developer.apple.com)). Signing is then valid for 1 year between renewals, and you can also distribute to other devices via TestFlight.
+Apps signed with a free Apple ID only work for 7 days. When that expires, reconnect the iPhone to your Mac and re-run the same build command to re-sign.
-## Updating
+Builds signed with an Apple Developer Program account stay valid longer and can also be used for TestFlight and regular distribution. With either kind of signing, server-side data is never lost by reinstalling or re-signing.
+
+## Signing failures
-There is no auto-update yet. When the Multica codebase moves forward, pull and rebuild:
+If Xcode reports `No matching provisioning profiles found`, the default bundle identifier may not belong to your Apple ID. Switch to a reverse-domain name you control and rebuild:
```bash
-git pull
-pnpm install
+export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
pnpm ios:mobile:device:prod:release
```
-Subsequent builds are fast because Xcode caches the native compile.
+The value only needs to be available in your Apple Developer team; it does not affect your Multica account or workspaces.
-## Why no App Store yet
+## Updating
-The iOS app is still moving fast — the team prefers ship-and-iterate over App Store review cycles right now. A TestFlight beta is the most likely next step before a full App Store release. Until then, the self-build path above is the only way to use Multica on iOS.
+The self-installed iOS build does not auto-update. Pull the latest code, update dependencies, and rebuild:
-If you'd like to be notified when TestFlight opens, watch the [GitHub repo](https://github.com/multica-ai/multica).
+```bash
+git pull --ff-only
+pnpm install
+pnpm ios:mobile:device:prod:release
+```
-## Troubleshooting
+## Connecting to a self-hosted instance
-**"No matching provisioning profiles found"** — Xcode refuses to sign the default bundle id `ai.multica.mobile` with your Apple ID. Rare, but happens if someone has registered that prefix on Apple's developer portal. Pick any reverse-domain you control (`com.yourname.multica` is fine), export it, and re-run:
+Release builds bake the API address into the app. To connect to a self-hosted instance, edit `apps/mobile/.env.production` first:
-```bash
-export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
-pnpm ios:mobile:device:prod:release
+```dotenv
+EXPO_PUBLIC_API_URL=https://api.example.com
+EXPO_PUBLIC_WEB_URL=https://app.example.com
```
-The id doesn't have to mean anything — Apple just needs it to be unclaimed by other teams.
+`EXPO_PUBLIC_API_URL` is required. `EXPO_PUBLIC_WEB_URL` is optional and powers entries like "Copy link" and "Open on web"; when it's unset, those menu items are hidden.
+
+Re-run the build command after editing. The iPhone must be able to reach the API address; when using a LAN address, don't write `localhost` — on the iPhone it points at the phone itself.
+
+<Callout type="warning">
+Editing `.env.production` changes the production configuration of the current checkout. Committing the change writes your personal API address into the repository's production configuration.
+</Callout>
-**"Could not launch &lt;app&gt;" / "Untrusted Developer"** — either you've hit the 7-day limit (re-run the build) or you need to manually trust the developer profile on your iPhone: Settings → General → VPN & Device Management → tap your Apple ID → Trust.
+For mobile development, using the Simulator, or connecting to staging, see [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md) in the repository.
-**Build hangs on `Pod install` or compiles forever** — first build is genuinely 10–20 minutes because CocoaPods downloads dependencies and Xcode compiles React Native from source. Subsequent builds are much faster.
+## Next steps
-**App can't reach the backend** — confirm `apps/mobile/.env.production` hasn't been modified (it ships with `EXPO_PUBLIC_API_URL=https://api.multica.ai`). If you changed it, restore with `git checkout apps/mobile/.env.production`.
+- [Quickstart](/cloud-quickstart) — complete your first run.
+- [Desktop app](/desktop-app) — desktop tabs and the built-in daemon.
+- [Troubleshooting](/troubleshooting) — diagnosing connection and run issues.
diff --git a/apps/docs/content/docs/mobile-app.zh.mdx b/apps/docs/content/docs/mobile-app.zh.mdx
index 71c8d13fe3..ea04d132cc 100644
--- a/apps/docs/content/docs/mobile-app.zh.mdx
+++ b/apps/docs/content/docs/mobile-app.zh.mdx
@@ -1,82 +1,94 @@
---
title: 移动 App(iOS)
-description: 在自己的 iPhone 上自助 build 开源版 Multica iOS app —— 暂未上 App Store。
+description: 从源码把 Multica 安装到 iPhone,并连接 Cloud 或自托管实例。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica iOS 客户端开源,跟 web、desktop、后端一起放在[主仓库](https://github.com/multica-ai/multica)里。目前没上 App Store —— 在那之前,想用的人自己从源码 build 一份。首次 build 约 10–20 分钟,之后每次约 2 分钟,连接的是 [multica.ai](https://multica.ai) 同一个后端,所以你现有账号直接能登。
+Multica iOS 客户端目前还没有上架 App Store。你可以在 Mac 上从开源仓库构建 Release 版本,再安装到自己的 iPhone。Android 客户端暂未提供。
-<Callout type="info">
-本页是给**个人使用者**看的。如果你是要开发这个 app,请看仓库里的 [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md) —— 那里覆盖 dev / staging 变体和完整脚本表。
-</Callout>
+安装后的 App 默认连接 Multica Cloud,使用已有账号即可登录。工作区、issue、评论和执行记录都保存在服务端,不需要从 Web 或 Desktop 手动同步。
-## 你需要
+## 准备工作
-- 一台装了 Xcode 的 **Mac**(Xcode 在 App Store 免费下载)。
-- 一个免费的 **Apple ID**,在 Xcode → Settings → Accounts 里加进去。付费的 Apple Developer Program 账号是可选的 —— 只把 7 天签名期延到 1 年,见下方[7 天签名限制](#7-天签名限制)。
-- 一台通过 USB 线连接的 **iPhone**,并打开 [Developer Mode](https://docs.expo.dev/guides/ios-developer-mode/)(设置 → 隐私与安全性 → 开发者模式)。
-- Multica 源码已 clone:
+你需要:
- ```bash
- git clone https://github.com/multica-ai/multica.git
- cd multica
- pnpm install
- ```
+- 一台安装了 Xcode 的 Mac;
+- 已在 **Xcode → Settings → Accounts** 中登录的 Apple ID;
+- 一台通过 USB 连接的 iPhone;
+- 在 iPhone 的**设置 → 隐私与安全性**中打开开发者模式;
+- Node.js、pnpm 和 Git。
-上面任何一项缺失,先走 Expo 的 [Set up your environment](https://docs.expo.dev/get-started/set-up-your-environment/)(选 **Development build → iOS Device**)—— 它是除仓库拉取外所有环境准备的官方指引。
+Xcode 或真机开发环境未配置时,先完成 Expo 的 [iOS Device 环境配置](https://docs.expo.dev/get-started/set-up-your-environment/)。
-## Build
+## 安装到 iPhone
-一条命令:
+克隆仓库并安装依赖:
```bash
-pnpm ios:mobile:device:prod:release
+git clone https://github.com/multica-ai/multica.git
+cd multica
+pnpm install
```
-Xcode 会用你 Apple ID 自动持有的"Personal Team"来签名 —— 这个 team 是你第一次用任何 Apple ID 登 Xcode 时静默建的,所以即使你不记得"什么时候弄过",它都已经在那里了。这是个 **Release build**:不依赖 Metro,启动屏 → app,跟从 App Store 装的体验一样。
+然后从仓库根目录运行:
-首次 build 会下载 CocoaPods + 从源码编译 React Native —— 大约 10–20 分钟。之后 build 会快很多,Xcode 缓存了原生编译产物。
+```bash
+pnpm ios:mobile:device:prod:release
+```
-典型路径就这样。签名失败的话见下方[排错](#排错)。
+这会构建一个不依赖 Metro 的 Release 版本,并安装到已连接的 iPhone。第一次构建需要下载 iOS 依赖并编译 React Native,之后会复用 Xcode 缓存。
-## 7 天签名限制
+如果 iPhone 阻止打开应用,到**设置 → 通用 → VPN 与设备管理**中信任对应的开发者证书。
-免费 Apple ID 签的 build 只有 **7 天**有效期。过期后 app 在 iPhone 上拒绝启动,提示 "untrusted developer"。插回 Mac 重跑同一条命令重签即可 —— 数据不会丢,因为数据在后端,不在 app 里。
+## 免费签名的 7 天限制
-唯一的延期方式是 **Apple Developer Program 账号**($99/年,在 [developer.apple.com](https://developer.apple.com) 注册)。有了它签名一次有效 1 年(直到续费),还能通过 TestFlight 分发给其他设备。
+免费 Apple ID 签名的 App 只能使用 7 天。到期后,把 iPhone 重新连接到 Mac,并再次运行同一条构建命令即可续签。
-## 更新
+Apple Developer Program 账号签名的有效期更长,也可以用于 TestFlight 和正式分发。无论使用哪种签名,服务端数据都不会因为重新安装或续签而丢失。
+
+## 签名失败
-暂时没有自动更新。Multica 代码库前进时,你 pull 然后重 build:
+如果 Xcode 提示 `No matching provisioning profiles found`,默认 bundle identifier 可能不属于你的 Apple ID。换成自己控制的反向域名后重新构建:
```bash
-git pull
-pnpm install
+export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
pnpm ios:mobile:device:prod:release
```
-后续 build 很快,因为 Xcode 缓存了原生编译产物。
+这个值只需要在你的 Apple Developer team 中可用,不影响 Multica 账号或工作区。
-## 为什么还没上 App Store
+## 更新
-iOS app 还在快速迭代 —— 团队目前更倾向于"先发再改",而不是 App Store 审核周期。下一步比较可能是 TestFlight 内测,然后才是正式上架。在那之前,上面的自助 build 是 iOS 上用 Multica 的唯一方式。
+iOS 自助安装版不会自动更新。拉取最新代码、更新依赖并重新构建:
-想第一时间知道 TestFlight 开放的话,watch 一下 [GitHub 仓库](https://github.com/multica-ai/multica)。
+```bash
+git pull --ff-only
+pnpm install
+pnpm ios:mobile:device:prod:release
+```
-## 排错
+## 连接自托管实例
-**"No matching provisioning profiles found"** —— Xcode 拒绝用你的 Apple ID 签默认的 `ai.multica.mobile`。比较罕见,如果有人在 Apple Developer Portal 抢注了这个前缀就会出现。换一个你控制的反向域名(`com.yourname.multica` 就够),export 后重跑:
+Release 构建会把 API 地址写入 App。要连接自托管实例,先修改 `apps/mobile/.env.production`:
-```bash
-export EXPO_BUNDLE_IDENTIFIER_PROD=com.yourname.multica
-pnpm ios:mobile:device:prod:release
+```dotenv
+EXPO_PUBLIC_API_URL=https://api.example.com
+EXPO_PUBLIC_WEB_URL=https://app.example.com
```
-id 本身没意义,Apple 只要求它没被别的 team 抢注就行。
+`EXPO_PUBLIC_API_URL` 必填;`EXPO_PUBLIC_WEB_URL` 可选,用于 "Copy link"、"Open on web" 等入口,不设置时这些菜单项不会显示。
+
+修改后重新运行构建命令。iPhone 必须能访问这个 API 地址;使用局域网地址时,不要写 `localhost`,因为它在 iPhone 上指向手机本身。
+
+<Callout type="warning">
+修改 `.env.production` 会改变当前 checkout 的生产配置。提交该修改会把个人 API 地址写进仓库的生产配置。
+</Callout>
-**"无法启动 &lt;app&gt;" / "未受信任的开发者"** —— 要么过了 7 天有效期(重跑 build),要么需要在 iPhone 上手动信任开发者证书:设置 → 通用 → VPN 与设备管理 → 点你的 Apple ID → 信任。
+开发移动端、使用 Simulator 或连接 staging 的说明见仓库中的 [`apps/mobile/README.md`](https://github.com/multica-ai/multica/blob/main/apps/mobile/README.md)。
-**Build 卡在 `Pod install` 或者编译很久不动** —— 首次 build 就是 10–20 分钟,CocoaPods 要下载依赖、Xcode 要从源码编译 React Native。后续会快很多。
+## 接下来
-**App 连不上后端** —— 确认 `apps/mobile/.env.production` 没动过(默认值 `EXPO_PUBLIC_API_URL=https://api.multica.ai`)。如果你改过,用 `git checkout apps/mobile/.env.production` 还原。
+- [快速上手](/cloud-quickstart) — 完成第一次执行。
+- [Desktop 应用](/desktop-app) — 桌面端的标签页与内置守护进程。
+- [故障排查](/troubleshooting) — 连接与执行问题排查。
diff --git a/apps/docs/content/docs/project-resources.ja.mdx b/apps/docs/content/docs/project-resources.ja.mdx
index cfaf6d0a4b..51ce45cbb8 100644
--- a/apps/docs/content/docs/project-resources.ja.mdx
+++ b/apps/docs/content/docs/project-resources.ja.mdx
@@ -1,45 +1,40 @@
---
title: プロジェクトリソース
-description: 型付きのポインター(Git リポジトリ、ローカルディレクトリ、今後さらに増える種類)をプロジェクトに添付し、エージェントが範囲を限定したコンテキストとして取り込めるようにします。
+description: プロジェクトに GitHub リポジトリまたはローカルディレクトリを紐づけ、以後の実行に安定した作業コンテキストを与えます。
---
import { Callout } from "fumadocs-ui/components/callout";
-**プロジェクトリソース(Project Resource)** は型付きのポインターです — Git リポジトリの URL、自分のマシン上のパス、いずれは Notion ページまで — これを[プロジェクト](/workspaces)に添付します。[エージェント](/agents)がそのプロジェクト内のイシューに対して実行されると、デーモンはプロジェクトのリソース一覧をエージェントの作業ディレクトリと[メタスキル](/skills)プロンプトに自動的に書き込みます。
+[プロジェクト](/projects)のリソースは、この一連の作業がどのコードを使い、どこで実行するかをエージェントに伝えます。リソースはプロジェクトに紐づいたまま保たれるため、リポジトリの URL やローカルパスをイシューごとに貼り直す必要はありません。
-その結果、エージェントは、どのリポジトリをチェックアウトすべきか(またはどのローカルディレクトリで作業すべきか)、そしてこのプロジェクトの「主要な参照資料」が何かを、誰もコンテキストをイシュー本文にコピー&ペーストしなくても把握できます。
+現在サポートされているリソースは 2 種類です。
-## メンタルモデル
+| リソース | 適した場面 | 実行場所 |
+|---|---|---|
+| **GitHub リポジトリ** | チームで共有するコードベースで、checkout をランタイムに管理させたい場合 | ランタイムが管理する作業ディレクトリ |
+| **ローカルディレクトリ** | 既存の checkout、非常に大きなリポジトリ、またはローカルの変更を直接確認したい場合 | 特定のコンピュータ上の元のディレクトリ |
-プロジェクトはもはや単なるラベルではありません。小さな **リソースコンテナ** です。
+## リソースが実行に入る仕組み
-- プロジェクトは 0..N 個の **リソース** を持ちます。
-- リソースは `resource_type`(例: `github_repo`、`local_directory`)と `resource_ref`(`resource_type` によって型が定まる JSON ペイロード)を持ちます。
-- 新しいリソースタイプを追加するには、文字列1つ + ハンドラー1つを追加するだけです。**スキーマのマイグレーションも、フロントエンドの書き直しも不要です。**
+エージェントがプロジェクト内のイシューを処理するとき、Multica はプロジェクト名、プロジェクトの説明、リソース一覧を実行コンテキストに追加し、作業ディレクトリに `.multica/project/resources.json` を書き込みます。
-この形は意図的なものです — Multica がエージェントプロバイダーですでに使っているのと同じパターンです: `type` の判別子1つと型付きのペイロード。スキーマを安定させるため、後で「Notion ページ」「Google Doc」「アップロードされたファイル」「外部 URL」を追加するのは、小さく追加的な変更で済みます。
+ワークスペースに紐づくリポジトリ一覧は、常に実行コンテキストに含まれます。プロジェクトに紐づくリポジトリは、それに加えて、この一連の作業で使うコードとデフォルトの ref を指定します。
-現在、2つのリソースタイプが提供されています: [`github_repo`](#resource-type-github_repo)(タスクごとに隔離されたワークツリーへクローン)と [`local_directory`](#resource-type-local_directory)(特定のデーモンのマシン上のフォルダ内で直接実行)です。
+ローカルディレクトリは、それを紐づけたデーモンに対してのみ有効です。実行を担当するデーモンに一致するローカルディレクトリがある場合、エージェントはそのディレクトリに直接入って作業します。ほかのコンピュータは引き続き、プロジェクトの GitHub リポジトリまたはワークスペースのリポジトリを使います。
-## リソースタイプ: `github_repo`
+## GitHub リポジトリの追加
-デフォルトのリソースタイプです — タスクごとに隔離されたワークツリーへチェックアウトされます。
+プロジェクトを開き、**リソース** で「リソースを追加」を選択します。ワークスペースに紐づけ済みのリポジトリを選ぶことも、Git URL を貼り付けることもできます。ワークスペースのリポジトリは **設定 → リポジトリ** で管理します。GitHub を接続すると、同じページの **GitHub から選択** で、App が認可済みのリポジトリをインポートできます。
-```json
-{
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/owner/repo",
- "default_branch_hint": "main"
- }
-}
-```
+リポジトリは GitHub に限定されません。ランタイムがアクセスできる Git URL であれば、どれでもリポジトリリソースとして使えます。セルフホストの Multica では、**設定 → 連携 → Git ホスティング** でセルフホストの Forgejo、Gitea、GitLab も接続できます。詳細は[セルフホスト Git ホスティング](/vcs-integration)を参照してください。
+
+プロジェクトの作成時に、**リポジトリ** で直接リポジトリを選ぶこともできます。1 つのプロジェクトには複数の GitHub リポジトリを紐づけられます。
-`default_branch_hint` は任意です — 指定すると、デーモンがこれをメタスキルに出すため、エージェントはどのブランチを基準に作業すべきかを把握できます。
+リソースの `ref` には、以後の checkout がデフォルトで使うブランチ、タグ、またはコミットを指定できます。`default_branch_hint` はエージェントにデフォルトブランチのヒントを与えるだけで、ブランチの切り替えを強制しません。
-## リソースタイプ: `local_directory`
+## ローカルディレクトリの追加
-タスクごとに再クローンするのが現実的でないリポジトリ — 数ギガバイトのゲームのチェックアウト、大規模な monorepo、またはタスクごとのワークツリーモデルが煩わしいあらゆるプロジェクト — の場合、プロジェクトは代わりに **特定の[デーモン](/daemon-runtimes)のマシン上にある既存のディレクトリ** を指すことができます。エージェントは、クローンもコピーもワークツリーもなしに **そのフォルダ内で直接** 実行されます。
+ローカルディレクトリを追加する UI は Desktop でのみ提供されます。ブラウザからはコンピュータ上のフォルダを選択できないためです。
<Callout type="warning">
**これは非常口であって、より便利なデフォルトではありません。** `local_directory` は他に選択肢がない人のために存在します — 典型例は、チェックアウトが数十ギガバイトになるゲームプロジェクトで、タスクごとの再クローンが現実的に不可能なケースです。
@@ -47,235 +42,62 @@ import { Callout } from "fumadocs-ui/components/callout";
対象のディレクトリが普通にクローンできる通常の git リポジトリなら、**代わりに `github_repo` を使ってください**。既定でワークツリーモードで動作するため、同じリポジトリに対するタスクを無制限に並行実行できます。`local_directory` を選ぶということは、そのフォルダ上のタスクが以降 **常に一度に1つずつ直列で** 実行されるということです。決める前に下の「選ぶとき」を読んでください。
</Callout>
-```json
-{
- "resource_type": "local_directory",
- "resource_ref": {
- "local_path": "/Users/me/code/big-game",
- "daemon_id": "0001234e-…",
- "label": "main checkout"
- }
-}
-```
-
-`github_repo` と比べたトレードオフは意図的です。バインドされたデーモンだけがそのディレクトリに対するタスクを取得でき、同じディレクトリに対するタスクは並列ではなく **直列で** 実行されます。その代わり、既存のチェックアウト、既存のブランチ、既存のダーティな状態をそのまま保てます — Multica は決して再クローンしません。
-
-### `github_repo` より `local_directory` を選ぶとき
-
-| 検討事項 | `github_repo`(ワークツリー) | `local_directory` |
-| --- | --- | --- |
-| タスクごとのチェックアウトコスト | 新規クローン + ワークツリー | なし — エージェントがその場で実行 |
-| 同じリポジトリでの並行性 | 複数タスクを並列に | ディレクトリごとに一度に1つ |
-| ブランチ / ダーティな状態 | タスクごとにデフォルトから新しいブランチを取得 | ディレクトリが現在持っているそのまま |
-| 実行できる場所 | 任意のデーモン | ちょうど1つのデーモン(バインドされたもの) |
-| ディスク使用量 | タスクごとにワークツリー1つ | オーバーヘッド0 — 既存のフォルダ |
-
-**既定の答えは `github_repo` です。** `local_directory` に切り替える価値があるのは、次のケースだけです。
-
-1. **再クローンのコストが法外に大きい場合** — 数ギガバイトのゲームのチェックアウト、重い LFS アセットを持つ monorepo、またはタスクごとの `git clone` が実際の作業を圧倒するあらゆる場合。このモードが存在する最大の理由です。
-2. **そのディレクトリがそもそも git リポジトリでない場合** — アートアセットのライブラリ、ドキュメントのフォルダ、書き出したデータセットなど。クローン元のリモートが存在しないため、その場で作業するしかありません。
-3. **作業がそのマシン固有のローカル状態に依存する場合** — ローカルのデータベース、数十ギガバイトのデータセット、そのマシンにインストールされたエンジン / SDK / ライセンス付きツールチェーン、接続されたハードウェア。いずれも新しいワークツリーの中には存在しません。
-
-一方、次のものは選ぶ理由に **なりません**。
-- **「エージェントの編集を自分のエディターで見たい」** — ワークツリーも同じくローカルディスク上(`~/multica_workspaces/` 配下)にあり、どのエディターでも開けます。ディレクトリを一段たどる手間を省くために並行性を捨てるのは割に合いません。
-- **「クローンが少し遅い」** — クローンがタスク本体を上回るときに初めてコストと言えます。数百メガバイトのリポジトリは該当しません。
-- **「エージェントのブランチが増えるのが嫌だ」** — ブランチの方針は `default_branch_hint` とタスク側の取り決めで解決すべきで、実行モードの選択で解決するものではありません。
+1. Desktop のローカルデーモンがオンラインであることを確認します。
+2. プロジェクトの **リソース** を開きます。
+3. 「ローカルディレクトリを追加」を選び、使用するフォルダを選択します。
-**直列実行はこのモードの前提であり、いずれ修正される制限ではありません。** このバージョンはファイル単位の書き込みロックを提供しないため、ディレクトリごとの直列ゲート(同じフォルダで一度に1つのタスク)が、別々の2つのイシューのエージェントが同時に同じファイルへ書き込むのを防ぐ唯一の手段です。だからこそ「`local_directory` にワークツリーを導入して並列実行できるようにする」は自己矛盾です — ワークツリーとは作業ツリーの *もう一つのコピー* であり、コピーのコストが高すぎるからこそこのモードを選んだはずだからです。**同じコードベースで本物の並列性が必要なら、答えは `github_repo` です。**
+ディレクトリは絶対パスで、すでに存在し、現在のデーモンが読み書きできる必要があります。次のパスは拒否されます: システムのルートとドライブのルート(`/`、`C:\`)、ホームディレクトリ自体と各ホームディレクトリの親(`/Users`、`/home`、`/root` など)、および `/etc`、`/var`、`/tmp`、`/usr`、`/opt` などのシステムディレクトリ。選択したパスがシンボリックリンクの場合は、まず実体のパスに解決してから同じルールでもう一度検証されます。直列ロックも実体のパスに対して働きます。
-### ローカルディレクトリを添付する
+同じデーモンに紐づけられるローカルディレクトリは、プロジェクトごとに最大 1 つです。チーム内の別々のコンピュータは、同じプロジェクトにそれぞれ自分のディレクトリを紐づけられます。
-<Callout type="info">
-作業を始める前に、本当にこれが必要かを確認してください(上のセクション参照)。対象のフォルダが普通にクローンできる git リポジトリなら、`github_repo` の方が適しています — 並行性に制限がありません。`local_directory` が想定しているのは、数十ギガバイトのゲームプロジェクトのように、一度クローンするだけでもコストが高すぎるケースです。
+<Callout type="warning">
+ローカルディレクトリは隔離された環境ではありません。エージェントは現在のブランチと未コミットのファイルをそのまま参照・変更します。Multica がブランチの切り替え、stash、commit、push、PR の作成を自動で行うことはありません。
</Callout>
-フォルダピッカーは **Desktop アプリ** にのみあります — Web アプリは OS のパスを読み取る方法がないため、「ローカルディレクトリを追加」ボタンはそこでは非表示になっています。Desktop では:
-
-1. プロジェクトを開く → **Resources** パネル。
-2. **ローカルディレクトリを追加** をクリックします。ネイティブのフォルダピッカーが開きます。
-3. フォルダを選択します。そのパスは **この Desktop インストールが現在登録しているデーモン** にバインドされます — リソースレコードにはパスとそのデーモンの ID が一緒に保存されます。
-
-Desktop では、このマシンのデーモンがオフラインのとき、またはプロジェクトにすでにこのデーモンへバインドされた `local_directory` があるとき、ボタンは表示されたまま **ヒントとともに無効化** されます — そのため *なぜ* 使えないのかが分かります。(Web アプリではそもそもフォルダピッカーが一切ないため、ボタンは完全に非表示になります。)別のマシンのディレクトリをバインドするには、そのマシンに Desktop をインストールし、そこからリソースを追加してください。
-
-CLI からも可能です(デーモン ID を自分で指定すれば、Web 専用環境でも動作します)。
-
-```bash
-multica project resource add <project-id> \
- --type local_directory \
- --local-path /Users/me/code/big-game \
- --daemon-id <daemon-uuid> \
- --ref-label "main checkout" # optional
-
-multica project resource update <project-id> <resource-id> \
- --local-path /Users/me/code/big-game-new
-```
-
-`--daemon-id` は `multica daemon list` から取得できます。CLI は、ペイロードを直接渡したい場合のための汎用的な `--ref '<json>'` の脱出口も受け付けます。
-
-### パスのルール
-
-添付するパスは、添付時の検証とタスクごとの検証の両方を通過しなければなりません。どちらもリソースを所有するデーモンが強制します — サーバーは JSON を保存するだけです。いずれかのルールに違反するパスは、型付きのエラーとともにタスクを失敗させ、あなたのディレクトリには手を付けずに残します。
-
-- 必ず **絶対パス** でなければなりません。
-- 必ず **存在** し、**ディレクトリ** でなければなりません(ファイル、ファイルへの symlink、デバイスノードではなく)。
-- デーモンプロセスが **読み書き可能** でなければなりません。
-- システムルートやユーザープロファイル全体であってはいけません — `/`、`/Users`、`/home`、`/root`、`/etc`、`/tmp`、`/var`、`/usr`、`/opt`、`/Users/Shared`、自分の `$HOME`、任意の Windows ドライブルート(`C:\`、`D:\`、…)、または `C:\Users` / `C:\ProgramData` / `C:\Program Files` / `C:\Program Files (x86)` / `C:\Windows`。
-- 上記のいずれかに解決される symlink は拒否され、OS がエイリアス処理するパスの正規形(canonical form)も同様です(例: macOS で `/private/tmp` を入力するのは `/tmp` と同じように拒否されます)。
-
-このブラックリストは意図的に攻撃的です — ホームディレクトリを選ぶと Multica のランタイムファイルがアカウントのルートに置かれることになりますが、これは決して望ましい結果ではありません。代わりにサブフォルダ(通常は実際のプロジェクトのチェックアウト)を選んでください。
-
-### (プロジェクト、デーモン)ごとに1つ
-
-プロジェクトは **デーモンごとに最大1つの `local_directory`** しか持てません。同じデーモンに2つ目を追加しようとすると、API は `409` を返します。Desktop のボタンは上限にすでに達すると自動的に非表示になり、理由を説明するツールチップを表示します。
-
-異なるデーモンは独立しています — 共有プロジェクトはチームメイトのマシンごとに1つずつ `local_directory` を持つことができ、それぞれが同じプロジェクトを別々のホストの別々のフォルダにバインドします。デーモンがタスクを取得するときは、自分の ID に一致する行を選び、残りは無視します。
-
-### リソースタイプの混在、および複数の `local_directory` リソース
-
-実際に登場する2つの横断的なリソース構成があります。
-
-- **同じプロジェクトに `github_repo` + `local_directory`。** 一致する `local_directory` バインディングを持つデーモンでは、ローカルディレクトリが **優先** されます。エージェントはあなたのフォルダで実行され、デーモンはそのタスクのために `github_repo` ワークツリーを作成も使用もしません。(ワークスペースごとのリポジトリキャッシュは平常どおり同期される場合がありますが、これはこのタスクの作業ツリーとは無関係なバックグラウンドの動作です。)`github_repo` の URL は参照用として `.multica/project/resources.json` とエージェントの `## Repositories` セクションに依然として表示されますが、エージェントが編集する作業ツリーはワークツリーではなく、あなたのローカルなものです。このプロジェクトに対する `local_directory` 行を **持たない** デーモン(別のマシン、またはそのチームメイトが1つを添付する前)では、タスクは通常の `github_repo` ワークツリーのフローにフォールバックします。実質的に、ローカルディレクトリはワークツリーパスに対するデーモンごとのオーバーライドです。
-- **同じプロジェクトに2つの `local_directory` リソース。** 各 `local_directory` はちょうど1つのデーモンにバインドされるため、これは別々の2つのマシンの間でのみ発生します(API は添付時に同じデーモンへの2つを拒否します。上記参照)。タスクは、どのデーモンがローカルディレクトリを持っているかではなく、エージェントのランタイム割り当てによってルーティングされます。タスクは受信するエージェントのランタイムを所有するデーモンに届き、そのデーモンは自分の ID に一致する `local_directory` 行を選び、残りは無視します。ロードバランシングはありません — 特定のマシンにタスクを実行させたい場合は、そのマシンのランタイムにバインドされたエージェントをディスパッチしてください。
-
-別の場所に1つがバインドされているプロジェクトに対して `local_directory` 行を持たないデーモンは **ブロックされません** — そのタスクは単に、プロジェクトの他のリソース(通常は `github_repo` のフォールバック)を通じて進みます。`local_directory` は、それがバインドされたデーモンに対してのみ意味があります。
-
-### ローカルディレクトリに対してタスクを実行する
-
-プロジェクトが受信デーモンにバインドされた `local_directory` を持つイシューでタスクがディスパッチされると、デーモンは次のことを行います。
-
-1. パスを再検証します(上記のルール)。
-2. symlink を解決した実際のパスをキーとして、ディレクトリごとのロックを取得します — そのため、同じフォルダに向かう2つの経路(1つは symlink 経由、1つは直接)も依然として直列化されます。
-3. エージェントの `CLAUDE.md` / `AGENTS.md`(および `.multica/project/resources.json`)を **ユーザーのディレクトリ内に** 書き込みます。エージェントは、あなたが自分でそのフォルダを開いたのとまったく同じように、そこで作業します。
-4. Multica のランタイム成果物(`output/`、`logs/`、`.gc_meta.json`)は、ユーザーのディレクトリの **外側** の別の envRoot に置きます。
-
-同じディレクトリに対する2つ目のタスクが、1つ目のタスクの実行中に届くと、ステータス **ローカルディレクトリ待ち(Waiting for local directory)** で待機します。このステータスは、タスクがあるあらゆる場所で見えます — チャットのタスクピル、エージェントのバナー、実行ログ、アクティビティインジケーター — そして待機中のタスクはエージェントの「キュー済み」のプレゼンスにカウントされます。待機中のタスクをキャンセルすると、そのスロットが即座に解放されます。実行中のタスクをキャンセルすると、次のタスクが昇格します。
-
-この待機はタイムアウトではありません — 待機中のタスクは、ロックが解放されるか、ユーザー / エージェントがキャンセルするまで待機し続けます。
+## ローカルディレクトリの直列実行
-### Multica があなたのディレクトリで触れるものと触れないもの
+2 つのタスクが同じ実体のディレクトリを使う場合、後から来たタスクは `waiting_local_directory` に入り、先のタスクがディレクトリを解放してから続行します。異なるシンボリックリンク経由で同じディレクトリに到達する 2 つのパスも、同じように直列化されます。
-- **書き込みます**: `CLAUDE.md` / `AGENTS.md`(またはエージェントのプロバイダーに対応する同等物)と `.multica/project/resources.json` をディレクトリのルートに。そのためエージェントはメタスキルとリソース一覧を持ちます。コミットされたくない場合は、これらを `.gitignore` に追加してください。
-- **書き込みます**: エージェントが行うと判断したあらゆるコード編集を — あなたが自分でローカルでエージェントを実行したのとまったく同じ方法で。
-- **物理的に削除することは決してありません**: ディレクトリやその中の何も。ガベージコレクションはパスを認識します: `local_directory` の envRoot の場合、`workspacesRoot` の下にある自身の `output/` と `logs/` だけをクリーンアップし、ユーザーのディレクトリは立ち入り禁止として扱います。
+待機中にディレクトリが変更されることはありません。待機中のタスクはキャンセルできます。キャンセルしなければ、ディレクトリが使えるようになるまで待ち続けます。
-### v1 の制限事項(後続作業で狭まる予定)
+複数の変更を同時に進めたい場合は、GitHub リポジトリリソースを使い、作業ごとの作業ディレクトリをランタイムに用意させてください。
-最初のリリースは意図的に `github_repo` より鋭い角を持って出荷されます。この一覧は時間とともに縮小していくと考えてください — ここに記載されているのは今日時点で事実の内容です。
+## 実行中に書き込まれるもの
-- **自動ブランチ切り替えなし。** エージェントは、あなたがチェックアウトしているブランチで実行されます。重要なら、ディスパッチ前にブランチを切り替えてください。
-- **ダーティツリーの保護や自動コミットなし。** コミットされていない変更はエージェントから見え、その場で変更される可能性があり、stash されません。ディレクトリを実際の作業ツリーとして扱い、危険な実行の前にコミットしてください。
-- **自動 PR なし。** タスクが終わると、変更は作られたブランチのまま残ります — 何も push されず、PR も開かれません。準備ができたら、自分で push して PR を開いてください。
-- **`waiting_local_directory` はステータスを示しますが、保有者は示しません。** バッジはタスクが待機していることを伝えます。どのタスクやどのファイルパスが現在ディレクトリを保有しているかは表示しません。
+エージェントによるコードの変更のほかに、ランタイムは、現在の AI コーディングツールが必要とする指示ファイルと `.multica/project/resources.json` をディレクトリに書き込むことがあります。バージョン管理に含めたくない場合は `.gitignore` に追加してください。
-これらはローカルディレクトリ作業のエージェントタスクライフサイクルの後続項目として追跡されています。それが出荷されるまでは、`local_directory` を「エージェントがあなたのフォルダで、あなたがするのと同じ方法で実行する」ものとして扱ってください。
+Multica が実行環境をクリーンアップするとき、紐づけたローカルディレクトリを削除することはありません。エージェントによるこのディレクトリへの変更は、あなたがターミナルで AI コーディングツールを直接実行したときの変更と同じ性質のものであり、同じようにレビューが必要です。
-## プロジェクト作成時にリポジトリを添付する
-
-**Web** または **Desktop** アプリで *新規プロジェクト* を開くと、ステータス / 優先度 / リードの横に **Repos** ピルが表示されるようになりました。ワークスペースにバインドされたリポジトリを選択する(またはアドホックな URL を貼り付ける)と、プロジェクトが作成される瞬間にそれらが `github_repo` リソースとして添付されます。
-
-**CLI** から:
+## CLI でリソースを管理する
```bash
-# Create + attach in one shot. The server attaches resources in the same
-# transaction as the project create — invalid resources roll back the whole
-# operation, so you never end up with a project that has half its resources.
+# プロジェクト作成時にリポジトリを紐づける
multica project create \
- --title "Agent UX 2026" \
+ --title "Agent UX" \
--repo https://github.com/multica-ai/multica
-# Manage resources later
+# リソースの一覧表示と追加
multica project resource list <project-id>
-multica project resource add <project-id> --type github_repo --url <url>
-multica project resource remove <project-id> <resource-id>
-
-# Generic escape hatch for any resource_type the server understands —
-# no CLI change needed when a new type ships:
multica project resource add <project-id> \
- --type notion_page \
- --ref '{"page_id":"…","title":"…"}'
-```
-
-`--repo` は繰り返し指定できます。各値は別々の `github_repo` リソースとして添付されます。
-
-## ランタイムにエージェントが見るもの
-
-デーモンがプロジェクト内のイシューのためにエージェントを生成すると、2つのことが起こります。
-
-### 1. `.multica/project/resources.json`
-
-API レスポンスの構造化されたパススルー(pass-through)で、エージェントの作業ディレクトリに書き込まれます。
-
-```json
-{
- "project_id": "…",
- "project_title": "Agent UX 2026",
- "resources": [
- {
- "id": "…",
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/multica-ai/multica",
- "default_branch_hint": "main"
- }
- }
- ]
-}
-```
-
-スキル、ヘルパースクリプト、またはエージェント自身が、この実行のための *正確な* リソースの集合が必要なときに、このファイルをパースできます。
-
-### 2. メタスキルプロンプトの「Project Context」セクション
-
-エージェントの `CLAUDE.md` / `AGENTS.md`(プロバイダーによって異なる)には、人間が読める要約が含まれるようになりました。
-
-```
-## Project Context
-
-This issue belongs to **Agent UX 2026**.
+ --type github_repo \
+ --url https://github.com/multica-ai/multica \
+ --ref main
-Project resources (also written to `.multica/project/resources.json`):
-
-- **GitHub repo**: https://github.com/multica-ai/multica (default branch: `main`)
+# 特定のデーモン上のローカルディレクトリを紐づける
+multica project resource add <project-id> \
+ --type local_directory \
+ --local-path /absolute/path/to/repo \
+ --daemon-id <daemon-id>
-Resources are pointers — open them only when relevant to the task. For
-`github_repo` resources, use `multica repo checkout <url>` to fetch the code.
+# リソースを削除する
+multica project resource remove <project-id> <resource-id>
```
-このテキストは意図的に最小限です。完全なペイロードはディスク上にあり、プロンプトはエージェントがプロジェクトが存在することと何が添付されているかを把握できるように方向付けるだけです。
-
-### 失敗モード
-
-リソースの取得は **best-effort** です。API 呼び出しが失敗すると、プロンプトからプロジェクトセクションが省略され、ファイルも書き込まれませんが、タスクは依然として開始されます。エージェントは、欠落したプロジェクトコンテキストのために止まることは決してありません。
-
-## 新しいリソースタイプを追加する
-
-この抽象化の要点は、新しいタイプが安価だということです。完全な経路は:
-
-1. **サーバーの検証器**(`server/internal/handler/project_resource.go`)— `validateAndNormalizeResourceRef` に、新しいペイロードをパースして正規化する case を追加します。
-2. **デーモンのメタスキルフォーマッター**(`server/internal/daemon/execenv/runtime_config.go`)— `formatProjectResource` に case を追加し、エージェントのプロンプトが新しいタイプを読みやすい箇条書きとしてレンダリングするようにします。
-3. **TypeScript の型**(`packages/core/types/project.ts`)— `ProjectResourceType` を拡張し、ペイロードのインターフェースを追加します。
-4. **UI レンダラー**(`packages/views/projects/components/project-resources-section.tsx`)— `ResourceRow` に新しいタイプのための case を追加します。
-
-**スキーマのマイグレーションも、新しい sqlc クエリも、新しいエンドポイントも、そして CLI の変更もありません** — CLI の汎用的な `--ref '<json>'` フラグが、検証器が理解するあらゆるペイロードを受け付けるため、新しいタイプの初日サポートは純粋に上記の4ステップだけです。(後でタイプごとの CLI ショートカットを *任意で* 追加できますが、必須ではありません。)
-
-同じ `project_resource` テーブルと同じ3つの CRUD 呼び出しが、すべてのタイプを処理します。
-
-## ワークスペースのリポジトリ vs. プロジェクトのリポジトリ
-
-エージェントに表示されるリポジトリ一覧(`CLAUDE.md` / `AGENTS.md` の `## Repositories` ブロック)は、デーモンのクレームハンドラーが次の優先順位で選びます。
-
-- **プロジェクトが最低1つの `github_repo` リソースを持つ** → そのリポジトリだけがエージェントに出されます。ワークスペースにバインドされたリポジトリは、エージェントがこのイシューにどれが属するかを推測しなくて済むように、意図的に隠されます。
-- **プロジェクトが `github_repo` リソースを持たない(またはイシューがプロジェクトに属さない)** → 従来どおりワークスペースのリポジトリ一覧にフォールバックします。
-
-これによりエージェントの作業セットが引き締まります: プロジェクトがリポジトリについて明示的であれば、それが権威ある答えです。`.multica/project/resources.json` の構造化されたリソース一覧は常に完全な集合を運ぶため、すべてを検査したいスキルは依然としてそうできます。
-
-デーモンはチェックアウト側でもこれを反映します: プロジェクト範囲の `github_repo` URL を持つタスクが届くと、それらの URL はエージェントが生成される前に、ワークスペースごとの許可リストにマージされ *同時に* ローカルのリポジトリキャッシュに同期されます。そのため、ワークスペースレベルでバインドされていないプロジェクトのリポジトリ URL も、依然として `multica repo checkout` の有効な引数になります — デーモンはそれを「構成されていない」として拒否しません。許可リストの分割は内部的なものです: ワークスペースにバインドされた URL とタスク範囲の URL は別々に追跡されるため、ワークスペースリポジトリの再読み込みが実行の途中でプロジェクト URL を誤って取り消すことはありません。
-
-## ここで意図的に範囲に **含めなかった** もの
+リソースの変更は、その後に作成されるタスクに反映されます。すでに終了した実行の記録が書き換えられることはありません。
-- **プロジェクト間の共有。** 今日時点で、各リソースはちょうど1つのプロジェクトにのみ存在します。
-- **スキルごとのリソース範囲指定。** すべてのリソースは、エージェント実行のすべてのスキルから見えます。タイプを認識したフィルタリングは後続作業です。
-- **キャッシュ / 同期。** `github_repo` は単なるメタデータです — チェックアウトは依然として必要に応じて `multica repo checkout` を通じて行われます。Notion / Google Docs のキャッシュされた文書テキストは、それらのタイプとともに提供される予定です。
+## 次のステップ
-これらは意図的な省略です — 最初のカットの目標は、可動部分を最小限にしてこの抽象化を検証することです。
+- [プロジェクト](/projects) — プロジェクトのコンテキスト、進捗、リードを理解します。
+- [デーモンとランタイム](/daemon-runtimes) — タスクをどのコンピュータが受け取るかを理解します。
+- [タスク](/tasks) — `waiting_local_directory` などの実行ステートを確認します。
diff --git a/apps/docs/content/docs/project-resources.ko.mdx b/apps/docs/content/docs/project-resources.ko.mdx
index fbf46c34b6..41386f48a9 100644
--- a/apps/docs/content/docs/project-resources.ko.mdx
+++ b/apps/docs/content/docs/project-resources.ko.mdx
@@ -1,281 +1,103 @@
---
title: 프로젝트 리소스
-description: 타입이 지정된 포인터(Git 저장소, 로컬 디렉터리, 그리고 추후 더 많은 종류)를 프로젝트에 연결해, 에이전트가 범위가 한정된 컨텍스트로 가져갈 수 있게 합니다.
+description: 프로젝트에 GitHub 저장소나 로컬 디렉터리를 연결해 이후 실행에 안정적인 작업 컨텍스트를 제공합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-**프로젝트 리소스(Project Resource)** 는 타입이 지정된 포인터입니다 — Git 저장소 URL, 본인 기기의 경로, 내일이면 Notion 페이지까지 — 이것을 [프로젝트](/workspaces)에 연결합니다. [에이전트](/agents)가 해당 프로젝트 안의 이슈에 대해 실행될 때, 데몬은 프로젝트의 리소스 목록을 에이전트의 작업 디렉터리와 [메타 스킬](/skills) 프롬프트에 자동으로 기록합니다.
+[프로젝트](/projects) 리소스는 이 작업 묶음에 어떤 코드가 필요하며 어디에서 실행할지 에이전트에게 알려 줍니다. 리소스는 프로젝트에 계속 연결되어 있으므로 각 이슈에 저장소 주소나 로컬 경로를 반복해서 붙여 넣을 필요가 없습니다.
-그 결과: 에이전트는 어떤 저장소를 체크아웃해야 하는지(또는 어떤 로컬 디렉터리에서 작업해야 하는지), 그리고 이 프로젝트의 "주요 참고 자료"가 무엇인지를, 아무도 컨텍스트를 이슈 본문에 복사해 붙여 넣지 않아도 알게 됩니다.
+현재 두 가지 리소스를 지원합니다.
-## 멘탈 모델
+| 리소스 | 적합한 경우 | 실행 위치 |
+|---|---|---|
+| **GitHub 저장소** | 팀이 공유하는 코드베이스이며 런타임이 checkout을 관리해야 할 때 | 런타임이 관리하는 작업 디렉터리 |
+| **로컬 디렉터리** | 이미 존재하는 checkout, 매우 큰 저장소, 로컬 변경 내용을 직접 확인해야 할 때 | 지정한 컴퓨터의 원본 디렉터리 |
-프로젝트는 더 이상 단순한 라벨이 아닙니다. 작은 **리소스 컨테이너**입니다:
+## 리소스가 실행에 들어가는 방식
-- 프로젝트는 0..N개의 **리소스**를 가집니다.
-- 리소스는 `resource_type`(예: `github_repo`, `local_directory`)과 `resource_ref`(`resource_type`에 따라 타입이 정해지는 JSON 페이로드)를 가집니다.
-- 새 리소스 타입을 추가하려면 문자열 하나 + 핸들러 하나만 추가하면 됩니다. **스키마 마이그레이션도, 프런트엔드 재작성도 필요 없습니다.**
+에이전트가 프로젝트 안의 이슈를 처리하면 Multica가 프로젝트 이름, 프로젝트 설명, 리소스 목록을 실행 컨텍스트에 추가하고 작업 디렉터리에 `.multica/project/resources.json`을 기록합니다.
-이 형태는 의도적인 것입니다 — Multica가 에이전트 제공자에 이미 사용하는 것과 동일한 패턴입니다: `type` 판별자 하나와 타입이 지정된 페이로드. 스키마를 안정적으로 유지하므로, 추후 "Notion 페이지", "Google Doc", "업로드된 파일", "외부 URL"을 추가하는 것은 작고 점진적인 변경이 됩니다.
+워크스페이스에 연결된 저장소 목록은 항상 실행 컨텍스트에 포함됩니다. 프로젝트에 연결된 저장소는 그중 이 작업 묶음에서 사용할 코드와 기본 ref를 지정합니다.
-오늘날 두 가지 리소스 타입이 제공됩니다: [`github_repo`](#resource-type-github_repo)(작업마다 격리된 워크트리로 클론)와 [`local_directory`](#resource-type-local_directory)(특정 데몬 기기의 폴더 안에서 직접 실행).
+로컬 디렉터리는 연결된 데몬에서만 유효합니다. 이번 실행을 담당한 데몬에 일치하는 로컬 디렉터리가 있으면 에이전트가 해당 디렉터리로 바로 들어가 작업합니다. 다른 컴퓨터에서는 프로젝트의 GitHub 저장소 또는 워크스페이스 저장소를 계속 사용합니다.
-## 리소스 타입: `github_repo`
+## GitHub 저장소 추가
-기본 리소스 타입입니다 — 작업마다 격리된 워크트리로 체크아웃됩니다:
+프로젝트를 열고 **리소스**에서 "리소스 추가"를 선택합니다. 워크스페이스에 이미 연결된 저장소를 고르거나 Git URL을 붙여 넣을 수 있습니다. 워크스페이스 저장소는 **설정 → 코드 저장소**에서 관리합니다. GitHub를 연결한 뒤 같은 페이지에서 **GitHub에서 선택**을 통해 App에 승인된 저장소를 가져올 수 있습니다.
-```json
-{
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/owner/repo",
- "default_branch_hint": "main"
- }
-}
-```
+저장소는 GitHub로 제한되지 않습니다. 런타임이 접근할 수 있는 Git URL이라면 모두 저장소 리소스로 사용할 수 있습니다. 자체 배포한 Multica에서는 **설정 → 연동 → Git 코드 호스팅**에서 자체 호스팅 Forgejo, Gitea, GitLab을 연결할 수도 있습니다. [자체 호스팅 Git 코드 호스팅](/vcs-integration)을 참고하세요.
+
+프로젝트를 만들 때 **Repos**에서 바로 저장소를 선택할 수도 있습니다. 하나의 프로젝트에 여러 GitHub 저장소를 연결할 수 있습니다.
-`default_branch_hint`는 선택 사항입니다 — 지정하면 데몬이 이를 메타 스킬에 노출하므로, 에이전트가 어떤 브랜치를 기준으로 작업할지 알게 됩니다.
+리소스의 `ref`에는 이후 checkout에서 기본으로 사용할 브랜치, tag, commit을 지정할 수 있습니다. `default_branch_hint`는 에이전트에게 기본 브랜치 힌트만 제공하며 강제로 브랜치를 전환하지 않습니다.
-## 리소스 타입: `local_directory`
+## 로컬 디렉터리 추가
-작업마다 다시 클론하기 곤란한 저장소 — 수 기가바이트짜리 게임 체크아웃, 대형 monorepo, 또는 작업마다 워크트리를 만드는 모델이 번거로운 모든 프로젝트 — 의 경우, 프로젝트는 대신 **특정 [데몬](/daemon-runtimes) 기기에 있는 기존 디렉터리**를 가리킬 수 있습니다. 에이전트는 클론도, 복사도, 워크트리도 없이 **그 폴더 안에서 직접** 실행됩니다.
+브라우저는 컴퓨터의 폴더를 선택할 수 없으므로 로컬 디렉터리 추가 화면은 Desktop에서만 제공됩니다.
<Callout type="warning">
**이것은 비상구이지, 더 편리한 기본값이 아닙니다.** `local_directory`는 다른 선택지가 없는 사람들을 위해 존재합니다 — 대표적인 사례는 체크아웃 하나가 수십 기가바이트인 게임 프로젝트로, 작업마다 다시 클론하는 것이 현실적으로 불가능한 경우입니다.
-대상 디렉터리가 평범하게 클론할 수 있는 일반 git 저장소라면 **대신 `github_repo`를 사용하세요**: 기본적으로 워크트리 모드로 동작하므로 같은 저장소에 대한 작업을 무제한으로 동시에 실행할 수 있습니다. `local_directory`를 선택한다는 것은 그 폴더의 작업이 이후로 **항상 한 번에 하나씩 직렬로** 실행된다는 뜻입니다. 결정하기 전에 아래 "선택할 때"를 읽어보세요.
+대상 디렉터리가 평범하게 클론할 수 있는 일반 git 저장소라면 **대신 `github_repo`를 사용하세요**: 기본적으로 워크트리 모드로 동작하므로 같은 저장소에 대한 작업을 무제한으로 동시에 실행할 수 있습니다. `local_directory`를 선택한다는 것은 그 폴더의 작업이 이후로 **항상 한 번에 하나씩 직렬로** 실행된다는 뜻입니다. 결정하기 전에 위의 리소스 비교를 확인하세요.
</Callout>
-```json
-{
- "resource_type": "local_directory",
- "resource_ref": {
- "local_path": "/Users/me/code/big-game",
- "daemon_id": "0001234e-…",
- "label": "main checkout"
- }
-}
-```
-
-`github_repo`와 비교한 트레이드오프는 의도적입니다: 바인딩된 데몬만 해당 디렉터리에 대한 작업을 가져갈 수 있고, 같은 디렉터리에 대한 작업은 병렬이 아니라 **직렬로** 실행됩니다. 그 대가로 기존 체크아웃, 기존 브랜치, 기존 더티 상태를 그대로 유지합니다 — Multica는 절대 다시 클론하지 않습니다.
-
-### `github_repo` 대신 `local_directory`를 선택할 때
-
-| 고려 사항 | `github_repo`(워크트리) | `local_directory` |
-| --- | --- | --- |
-| 작업당 체크아웃 비용 | 새 클론 + 워크트리 | 없음 — 에이전트가 제자리에서 실행 |
-| 같은 저장소의 동시성 | 여러 작업 병렬 | 디렉터리당 한 번에 하나 |
-| 브랜치 / 더티 상태 | 작업마다 기본 브랜치에서 새 브랜치를 받음 | 디렉터리가 현재 가진 그대로 |
-| 실행 가능한 위치 | 모든 데몬 | 정확히 하나의 데몬(바인딩된 것) |
-| 디스크 사용량 | 작업당 워크트리 하나 | 오버헤드 0 — 기존 폴더 사용 |
-
-**기본 답은 `github_repo`입니다.** `local_directory`로 전환할 만한 경우는 다음뿐입니다:
-
-1. **다시 클론하는 비용이 지나치게 큰 경우** — 수 기가바이트짜리 게임 체크아웃, 무거운 LFS 자산을 가진 monorepo, 또는 작업당 `git clone`이 실제 작업을 압도하는 모든 경우. 이 모드가 존재하는 가장 큰 이유입니다.
-2. **그 디렉터리가 애초에 git 저장소가 아닌 경우** — 아트 에셋 라이브러리, 문서 폴더, 내보낸 데이터셋 등. 클론할 원격이 없으므로 제자리에서 작업하는 수밖에 없습니다.
-3. **작업이 그 기기의 로컬 상태에 의존하는 경우** — 로컬 데이터베이스, 수십 기가바이트짜리 데이터셋, 그 기기에 설치된 엔진 / SDK / 라이선스가 필요한 툴체인, 연결된 하드웨어. 새로 만든 워크트리 안에는 어느 것도 존재하지 않습니다.
-
-반대로, 다음은 이 모드를 선택할 이유가 **되지 않습니다**:
-- **"에이전트가 무엇을 고쳤는지 내 에디터에서 보고 싶다."** 워크트리도 똑같이 로컬 디스크(`~/multica_workspaces/` 아래)에 있고 어떤 에디터로든 열 수 있습니다. 디렉터리 한 단계를 덜 거치려고 동시성을 포기하는 것은 남는 장사가 아닙니다.
-- **"클론이 조금 느리다."** 클론이 작업 자체를 압도할 때에야 비용이라고 할 수 있습니다. 수백 메가바이트짜리 저장소는 여기 해당하지 않습니다.
-- **"에이전트 브랜치가 쌓이는 게 싫다."** 브랜치 정책은 `default_branch_hint`와 작업 차원의 합의로 풀어야지, 실행 모드 선택으로 풀 문제가 아닙니다.
+1. Desktop의 로컬 데몬이 온라인인지 확인합니다.
+2. 프로젝트의 **리소스**를 엽니다.
+3. "로컬 디렉터리 추가"를 선택한 뒤 사용할 폴더를 고릅니다.
-**직렬 실행은 이 모드의 전제이지, 언젠가 고쳐질 제한이 아닙니다.** 이 버전은 파일 단위 쓰기 잠금을 제공하지 않으므로, 디렉터리당 직렬 게이트(같은 폴더에서 한 번에 하나의 작업)가 서로 다른 두 이슈의 에이전트가 동시에 같은 파일에 쓰는 것을 막는 유일한 장치입니다. 그래서 "`local_directory`에 워크트리를 도입해 병렬 실행을 지원한다"는 말은 그 자체로 모순입니다 — 워크트리란 작업 트리를 *한 벌 더 복사하는 것*이고, 복사 비용을 감당할 수 없어서 이 모드를 선택한 것이기 때문입니다. **같은 코드베이스에서 진짜 병렬성이 필요하다면, 답은 `github_repo`입니다.**
+디렉터리는 절대 경로여야 하고 이미 존재해야 하며 현재 데몬이 읽고 쓸 수 있어야 합니다. 시스템 루트와 드라이브 루트(`/`, `C:\`), 사용자 홈 디렉터리 자체 및 각 홈 디렉터리의 상위 경로(`/Users`, `/home`, `/root`), 그리고 `/etc`, `/var`, `/tmp`, `/usr`, `/opt` 같은 시스템 디렉터리는 거부됩니다. 선택한 경로가 심볼릭 링크이면 실제 경로를 먼저 해석한 뒤 같은 규칙으로 다시 확인하며 직렬 잠금도 실제 경로를 기준으로 적용됩니다.
-### 로컬 디렉터리 연결하기
+프로젝트 하나에는 같은 데몬에서 로컬 디렉터리를 최대 하나만 연결할 수 있습니다. 팀의 서로 다른 컴퓨터에서는 같은 프로젝트에 각자의 디렉터리를 연결할 수 있습니다.
-<Callout type="info">
-시작하기 전에 정말로 이 모드가 필요한지 확인하세요(위 섹션 참고). 해당 폴더가 평범하게 클론할 수 있는 git 저장소라면 `github_repo`가 더 나은 선택입니다 — 동시성에 제한이 없습니다. `local_directory`가 겨냥하는 것은 수십 기가바이트짜리 게임 프로젝트처럼 한 번 클론하는 것조차 비용이 너무 큰 경우입니다.
+<Callout type="warning">
+로컬 디렉터리는 격리된 환경이 아닙니다. 에이전트가 현재 브랜치와 커밋하지 않은 파일을 직접 보고 수정합니다. Multica는 브랜치 전환, stash, commit, push, PR 생성을 자동으로 수행하지 않습니다.
</Callout>
-폴더 선택기는 **Desktop 앱**에만 있습니다 — 웹 앱은 OS 경로를 읽을 방법이 없으므로 "로컬 디렉터리 추가" 버튼이 거기서는 숨겨져 있습니다. Desktop에서는:
-
-1. 프로젝트를 엽니다 → **Resources** 패널.
-2. **로컬 디렉터리 추가**를 클릭합니다. 네이티브 폴더 선택기가 열립니다.
-3. 폴더를 선택합니다. 그 경로는 **이 Desktop 설치가 현재 등록한 데몬**에 바인딩됩니다 — 리소스 레코드에는 경로와 해당 데몬의 ID가 함께 저장됩니다.
-
-Desktop에서는 이 기기의 데몬이 오프라인이거나, 프로젝트에 이미 이 데몬에 바인딩된 `local_directory`가 있을 때, 버튼은 계속 보이되 **힌트와 함께 비활성화**됩니다 — 그래서 *왜* 사용할 수 없는지 알 수 있습니다. (웹 앱에서는 애초에 폴더 선택기가 전혀 없으므로 버튼이 완전히 숨겨집니다.) 다른 기기의 디렉터리를 바인딩하려면, 그 기기에 Desktop을 설치하고 거기서 리소스를 추가하세요.
-
-CLI에서도 가능합니다(데몬 ID를 직접 제공하기만 하면 웹 전용 환경에서도 동작합니다):
-
-```bash
-multica project resource add <project-id> \
- --type local_directory \
- --local-path /Users/me/code/big-game \
- --daemon-id <daemon-uuid> \
- --ref-label "main checkout" # optional
-
-multica project resource update <project-id> <resource-id> \
- --local-path /Users/me/code/big-game-new
-```
-
-`--daemon-id`는 `multica daemon list`에서 얻을 수 있습니다. CLI는 페이로드를 직접 전달하고 싶을 때를 위한 범용 `--ref '<json>'` 탈출구도 받습니다.
-
-### 경로 규칙
-
-연결하는 경로는 연결 시점 검증과 작업별 검증을 모두 통과해야 합니다. 둘 다 리소스를 소유한 데몬이 강제합니다 — 서버는 JSON만 저장합니다. 어떤 규칙이라도 위반하는 경로는 타입이 지정된 오류와 함께 작업을 실패시키고, 디렉터리는 손대지 않은 채로 남겨 둡니다:
-
-- 반드시 **절대 경로**여야 합니다.
-- 반드시 **존재**해야 하고 **디렉터리**여야 합니다(파일, 파일을 가리키는 symlink, 또는 디바이스 노드가 아니어야 합니다).
-- 데몬 프로세스가 **읽기와 쓰기**가 가능해야 합니다.
-- 시스템 루트나 사용자 프로필 전체일 수 없습니다 — `/`, `/Users`, `/home`, `/root`, `/etc`, `/tmp`, `/var`, `/usr`, `/opt`, `/Users/Shared`, 본인의 `$HOME`, 임의의 Windows 드라이브 루트(`C:\`, `D:\`, …), 또는 `C:\Users` / `C:\ProgramData` / `C:\Program Files` / `C:\Program Files (x86)` / `C:\Windows`.
-- 위 중 어느 것으로든 해석되는 symlink는 거부되며, OS가 별칭 처리하는 경로의 정규형(canonical form)도 마찬가지입니다(예: macOS에서 `/private/tmp`를 입력하는 것은 `/tmp`와 동일하게 거부됩니다).
-
-블랙리스트는 의도적으로 공격적입니다 — 홈 디렉터리를 선택하면 Multica의 런타임 파일이 계정의 루트에 놓이게 되는데, 이는 절대 원하는 결과가 아닙니다. 대신 하위 폴더(보통은 실제 프로젝트 체크아웃)를 선택하세요.
-
-### (프로젝트, 데몬)당 하나
-
-프로젝트는 **데몬당 최대 하나의 `local_directory`**만 가질 수 있습니다. 같은 데몬에 두 번째를 추가하려 하면 API가 `409`를 반환합니다. Desktop 버튼은 한도에 이미 도달하면 스스로 숨겨지고, 이유를 설명하는 툴팁을 표시합니다.
-
-서로 다른 데몬은 독립적입니다 — 공유 프로젝트는 팀원의 기기마다 하나씩 `local_directory`를 가질 수 있으며, 각각은 같은 프로젝트를 서로 다른 호스트의 서로 다른 폴더에 바인딩합니다. 데몬이 작업을 가져갈 때는 자신의 ID와 일치하는 행을 고르고 나머지는 무시합니다.
-
-### 리소스 타입 혼용, 그리고 여러 개의 `local_directory` 리소스
-
-실제로 등장하는 두 가지 교차 리소스 구성이 있습니다:
-
-- **같은 프로젝트에 `github_repo` + `local_directory`.** 일치하는 `local_directory` 바인딩을 가진 데몬에서는 로컬 디렉터리가 **우선**합니다: 에이전트는 당신의 폴더에서 실행되며, 데몬은 그 작업을 위해 `github_repo` 워크트리를 생성하거나 사용하지 않습니다. (워크스페이스별 저장소 캐시는 평소처럼 동기화될 수 있는데, 이는 이 작업의 작업 트리와는 무관한 백그라운드 동작입니다.) `github_repo` URL은 참고용으로 `.multica/project/resources.json`과 에이전트의 `## Repositories` 섹션에 여전히 나타나지만, 에이전트가 편집하는 작업 트리는 워크트리가 아니라 당신의 로컬 디렉터리입니다. 이 프로젝트에 대한 `local_directory` 행이 **없는** 데몬(다른 기기이거나, 그 팀원이 하나를 연결하기 전)에서는, 작업이 평소의 `github_repo` 워크트리 흐름으로 폴백합니다. 사실상 로컬 디렉터리는 워크트리 경로에 대한 데몬별 재정의입니다.
-- **같은 프로젝트에 두 개의 `local_directory` 리소스.** 각 `local_directory`는 정확히 하나의 데몬에 바인딩되므로, 이는 서로 다른 두 기기 사이에서만 발생합니다(API는 연결 시점에 같은 데몬에 두 개를 거부합니다, 위 참조). 작업은 어느 데몬이 로컬 디렉터리를 가졌는지가 아니라 에이전트의 런타임 할당에 따라 라우팅됩니다: 작업은 수신 에이전트의 런타임을 소유한 데몬에 도착하고, 그 데몬은 자신의 ID와 일치하는 `local_directory` 행을 고르고 나머지는 무시합니다. 로드 밸런싱은 없습니다 — 특정 기기가 작업을 실행하게 하려면, 그 기기의 런타임에 바인딩된 에이전트를 디스패치하세요.
-
-다른 곳에 하나가 바인딩된 프로젝트에 대해 `local_directory` 행이 없는 데몬은 **차단되지 않습니다** — 그 작업들은 단순히 프로젝트의 다른 리소스(보통 `github_repo` 폴백)를 통해 진행됩니다. `local_directory`는 바인딩된 데몬에 대해서만 의미가 있습니다.
-
-### 로컬 디렉터리에 대해 작업 실행하기
-
-프로젝트가 수신 데몬에 바인딩된 `local_directory`를 가진 이슈에서 작업이 디스패치되면, 데몬은:
-
-1. 경로를 다시 검증합니다(위의 규칙).
-2. symlink로 해석된 실제 경로를 키로 하여 디렉터리당 잠금을 획득합니다 — 그래서 같은 폴더로 향하는 두 경로(하나는 symlink 경유, 하나는 직접)도 여전히 직렬화됩니다.
-3. 에이전트의 `CLAUDE.md` / `AGENTS.md`(그리고 `.multica/project/resources.json`)를 **사용자의 디렉터리 안에** 기록합니다. 에이전트는 당신이 직접 그 폴더를 연 것과 똑같이 그곳에서 작업합니다.
-4. Multica의 런타임 산출물(`output/`, `logs/`, `.gc_meta.json`)은 사용자의 디렉터리 **바깥**의 별도 envRoot에 둡니다.
-
-같은 디렉터리에 대한 두 번째 작업이 첫 번째 작업이 실행 중일 때 도착하면, **로컬 디렉터리 대기 중(Waiting for local directory)** 상태로 멈춥니다. 이 상태는 작업이 있는 모든 곳에서 보입니다 — 채팅 작업 알약(pill), 에이전트 배너, 실행 로그, 활동 표시기 — 그리고 멈춘 작업은 에이전트의 "대기 중" 존재로 집계됩니다. 멈춘 작업을 취소하면 그 슬롯이 즉시 해제됩니다. 실행 중인 작업을 취소하면 다음 작업이 승격됩니다.
-
-이 대기는 타임아웃이 아닙니다 — 멈춘 작업은 잠금이 해제되거나 사용자 / 에이전트가 취소할 때까지 멈춰 있습니다.
+## 로컬 디렉터리 직렬 실행
-### Multica가 당신의 디렉터리에서 건드리는 것과 건드리지 않는 것
+두 실행 태스크가 같은 실제 디렉터리를 사용하면 나중에 도착한 태스크가 `waiting_local_directory` 상태로 들어가 앞선 태스크가 디렉터리를 해제할 때까지 기다립니다. 서로 다른 심볼릭 링크 경로가 같은 디렉터리를 가리켜도 직렬로 실행됩니다.
-- **기록합니다**: `CLAUDE.md` / `AGENTS.md`(또는 에이전트 제공자에 해당하는 등가물)와 `.multica/project/resources.json`을 디렉터리 루트에, 그래서 에이전트가 메타 스킬과 리소스 목록을 갖게 합니다. 커밋되기를 원하지 않으면 이것들을 `.gitignore`에 추가하세요.
-- **기록합니다**: 에이전트가 결정하는 모든 코드 편집을 — 당신이 직접 로컬에서 에이전트를 실행한 것과 정확히 같은 방식으로.
-- **절대 물리적으로 삭제하지 않습니다**: 디렉터리나 그 안의 어떤 것도. 가비지 컬렉션은 경로를 인식합니다: `local_directory` envRoot의 경우 `workspacesRoot` 아래의 자체 `output/`과 `logs/`만 정리하며, 사용자의 디렉터리는 출입 금지로 취급합니다.
+기다리는 동안 디렉터리는 변경되지 않습니다. 대기 중인 태스크는 취소할 수 있으며 취소하지 않으면 디렉터리를 사용할 수 있을 때까지 계속 기다립니다.
-### v1 제한 사항(후속 작업에서 좁혀질 예정)
+여러 변경 작업을 동시에 처리해야 한다면 GitHub 저장소 리소스를 사용하세요. 런타임이 작업마다 별도 작업 디렉터리를 준비합니다.
-첫 릴리스는 의도적으로 `github_repo`보다 더 날카로운 모서리를 가지고 출시됩니다. 이 목록은 시간이 지나며 줄어들 것으로 예상하세요 — 여기 문서화된 것은 오늘 사실인 내용입니다:
+## 실행 중 기록되는 내용
-- **자동 브랜치 전환 없음.** 에이전트는 당신이 체크아웃해 둔 브랜치에서 실행됩니다. 중요하다면 디스패치 전에 브랜치를 전환하세요.
-- **더티 트리 보호나 자동 커밋 없음.** 커밋되지 않은 변경은 에이전트에게 보이고, 제자리에서 수정될 수 있으며, stash되지 않습니다. 디렉터리를 실제 작업 트리로 취급하고 위험한 실행 전에 커밋하세요.
-- **자동 PR 없음.** 작업이 끝나면 변경은 만들어진 브랜치 그대로 남아 있습니다 — 아무것도 push되지 않고 PR도 열리지 않습니다. 준비되면 직접 push하고 PR을 여세요.
-- **`waiting_local_directory`는 상태를 보여 주지만 보유자는 보여 주지 않습니다.** 배지는 작업이 멈췄다고 알려 줍니다. 어떤 작업이나 어떤 파일 경로가 현재 디렉터리를 보유하고 있는지는 드러내지 않습니다.
+에이전트가 만든 코드 변경 외에도 런타임이 현재 AI 코딩 도구에 필요한 지시 파일과 `.multica/project/resources.json`을 디렉터리에 기록할 수 있습니다. 버전 관리에 포함하고 싶지 않다면 `.gitignore`에 추가하세요.
-이것들은 로컬 디렉터리 작업의 에이전트 작업 수명 주기 후속 항목으로 추적됩니다. 그것이 출시되기 전까지는 `local_directory`를 "에이전트가 당신의 폴더에서, 당신이 하는 것과 같은 방식으로 실행된다"로 취급하세요.
+Multica가 실행 환경을 정리할 때 연결된 로컬 디렉터리는 삭제하지 않습니다. 에이전트가 이 디렉터리에 만든 변경은 터미널에서 AI 코딩 도구를 직접 실행해 만든 변경과 성격이 같으므로 동일하게 검토해야 합니다.
-## 프로젝트 생성 시 저장소 연결하기
-
-**Web** 또는 **Desktop** 앱에서 *새 프로젝트*를 열면, 이제 상태 / 우선순위 / 리드 옆에 **Repos** 알약(pill)이 표시됩니다. 워크스페이스에 바인딩된 저장소를 선택하면(또는 임시 URL을 붙여 넣으면), 프로젝트가 생성되는 순간 그것들이 `github_repo` 리소스로 연결됩니다.
-
-**CLI**에서는:
+## CLI로 리소스 관리
```bash
-# Create + attach in one shot. The server attaches resources in the same
-# transaction as the project create — invalid resources roll back the whole
-# operation, so you never end up with a project that has half its resources.
+# 프로젝트를 만들면서 저장소 연결
multica project create \
- --title "Agent UX 2026" \
+ --title "Agent UX" \
--repo https://github.com/multica-ai/multica
-# Manage resources later
+# 리소스 확인 및 추가
multica project resource list <project-id>
-multica project resource add <project-id> --type github_repo --url <url>
-multica project resource remove <project-id> <resource-id>
-
-# Generic escape hatch for any resource_type the server understands —
-# no CLI change needed when a new type ships:
multica project resource add <project-id> \
- --type notion_page \
- --ref '{"page_id":"…","title":"…"}'
-```
-
-`--repo`는 반복할 수 있습니다. 각 값은 별도의 `github_repo` 리소스로 연결됩니다.
-
-## 런타임에 에이전트가 보는 것
-
-데몬이 프로젝트 안의 이슈를 위해 에이전트를 생성하면, 두 가지 일이 일어납니다:
-
-### 1. `.multica/project/resources.json`
-
-API 응답의 구조화된 패스스루(pass-through)로, 에이전트의 작업 디렉터리에 기록됩니다:
-
-```json
-{
- "project_id": "…",
- "project_title": "Agent UX 2026",
- "resources": [
- {
- "id": "…",
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/multica-ai/multica",
- "default_branch_hint": "main"
- }
- }
- ]
-}
-```
-
-스킬, 헬퍼 스크립트, 또는 에이전트 자신이 이번 실행의 *정확한* 리소스 집합이 필요할 때 이 파일을 파싱할 수 있습니다.
-
-### 2. 메타 스킬 프롬프트의 "Project Context" 섹션
-
-에이전트의 `CLAUDE.md` / `AGENTS.md`(제공자에 따라 다름)에는 이제 사람이 읽을 수 있는 요약이 포함됩니다:
-
-```
-## Project Context
-
-This issue belongs to **Agent UX 2026**.
+ --type github_repo \
+ --url https://github.com/multica-ai/multica \
+ --ref main
-Project resources (also written to `.multica/project/resources.json`):
-
-- **GitHub repo**: https://github.com/multica-ai/multica (default branch: `main`)
+# 지정한 데몬의 로컬 디렉터리 연결
+multica project resource add <project-id> \
+ --type local_directory \
+ --local-path /absolute/path/to/repo \
+ --daemon-id <daemon-id>
-Resources are pointers — open them only when relevant to the task. For
-`github_repo` resources, use `multica repo checkout <url>` to fetch the code.
+# 리소스 제거
+multica project resource remove <project-id> <resource-id>
```
-이 텍스트는 의도적으로 최소한입니다. 전체 페이로드는 디스크에 있고, 프롬프트는 에이전트가 프로젝트가 존재한다는 것과 무엇이 연결되었는지를 알도록 방향만 잡아 줍니다.
-
-### 실패 모드
-
-리소스 가져오기는 **best-effort**입니다. API 호출이 실패하면 프롬프트에서 프로젝트 섹션이 생략되고 파일도 기록되지 않지만, 작업은 여전히 시작됩니다. 에이전트는 누락된 프로젝트 컨텍스트 때문에 멈추는 일이 절대 없습니다.
-
-## 새 리소스 타입 추가하기
-
-이 추상화의 핵심은 새 타입이 저렴하다는 것입니다. 전체 경로는:
-
-1. **서버 검증기**(`server/internal/handler/project_resource.go`) — `validateAndNormalizeResourceRef`에 새 페이로드를 파싱하고 정규화하는 case를 추가합니다.
-2. **데몬 메타 스킬 포매터**(`server/internal/daemon/execenv/runtime_config.go`) — `formatProjectResource`에 case를 추가해, 에이전트 프롬프트가 새 타입을 읽기 좋은 글머리 기호로 렌더링하게 합니다.
-3. **TypeScript 타입**(`packages/core/types/project.ts`) — `ProjectResourceType`를 확장하고 페이로드 인터페이스를 추가합니다.
-4. **UI 렌더러**(`packages/views/projects/components/project-resources-section.tsx`) — `ResourceRow`에 새 타입에 대한 case를 추가합니다.
-
-**스키마 마이그레이션도, 새 sqlc 쿼리도, 새 엔드포인트도, 그리고 CLI 변경도 없습니다** — CLI의 범용 `--ref '<json>'` 플래그가 검증기가 이해하는 모든 페이로드를 받으므로, 새 타입에 대한 첫날 지원은 순전히 위 네 단계입니다. (나중에 타입별 CLI 단축 명령을 *선택적으로* 추가할 수 있지만, 필수는 아닙니다.)
-
-같은 `project_resource` 테이블과 같은 세 개의 CRUD 호출이 모든 타입을 처리합니다.
-
-## 워크스페이스 저장소 vs. 프로젝트 저장소
-
-에이전트에게 보이는 저장소 목록(`CLAUDE.md` / `AGENTS.md`의 `## Repositories` 블록)은 데몬의 클레임 핸들러가 다음 우선순위로 선택합니다:
-
-- **프로젝트가 최소한 하나의 `github_repo` 리소스를 가짐** → 그 저장소만 에이전트에게 노출됩니다. 워크스페이스에 바인딩된 저장소는 의도적으로 숨겨, 에이전트가 이 이슈에 어느 것이 속하는지 추측하지 않아도 되게 합니다.
-- **프로젝트가 `github_repo` 리소스를 갖지 않음(또는 이슈가 프로젝트에 속하지 않음)** → 이전처럼 워크스페이스의 저장소 목록으로 폴백합니다.
-
-이는 에이전트의 작업 집합을 좁게 유지합니다: 프로젝트가 저장소를 명확히 밝히면 그것이 권위 있는 답입니다. `.multica/project/resources.json`의 구조화된 리소스 목록은 항상 전체 집합을 담으므로, 모든 것을 검사하려는 스킬은 여전히 그렇게 할 수 있습니다.
-
-데몬은 체크아웃 측에서도 이를 반영합니다: 프로젝트 범위의 `github_repo` URL을 가진 작업이 도착하면, 그 URL들은 에이전트가 생성되기 전에 워크스페이스별 허용 목록에 병합되고 *동시에* 로컬 저장소 캐시에 동기화됩니다. 그래서 워크스페이스 수준에서 바인딩되지 않은 프로젝트 저장소 URL도 여전히 `multica repo checkout`의 유효한 인자가 됩니다 — 데몬은 그것을 "구성되지 않음"으로 거부하지 않습니다. 허용 목록 분리는 내부적입니다: 워크스페이스에 바인딩된 URL과 작업 범위의 URL은 별도로 추적되므로, 워크스페이스 저장소 새로 고침이 실행 도중에 프로젝트 URL을 실수로 취소하는 일이 없습니다.
-
-## 여기서 의도적으로 범위에 **포함하지 않은** 것
+리소스 변경은 이후 생성되는 실행 태스크에 적용되며 이미 끝난 실행 기록은 바꾸지 않습니다.
-- **프로젝트 간 공유.** 오늘날 각 리소스는 정확히 하나의 프로젝트에만 존재합니다.
-- **스킬별 리소스 범위 지정.** 모든 리소스는 에이전트 실행의 모든 스킬에 보입니다. 타입 인식 필터링은 후속 작업입니다.
-- **캐싱 / 동기화.** `github_repo`는 그냥 메타데이터입니다 — 체크아웃은 여전히 필요할 때 `multica repo checkout`을 통해 일어납니다. Notion / Google Docs의 캐시된 문서 텍스트는 해당 타입과 함께 제공될 것입니다.
+## 다음 단계
-이것들은 의도적인 누락입니다 — 첫 번째 컷의 목표는 가장 적은 수의 움직이는 부품으로 이 추상화를 검증하는 것입니다.
+- [프로젝트](/projects) — 프로젝트 컨텍스트, 진행률, 담당자를 알아봅니다.
+- [데몬과 런타임](/daemon-runtimes) — 어떤 컴퓨터가 태스크를 가져가는지 알아봅니다.
+- [실행 태스크](/tasks) — `waiting_local_directory` 같은 실행 상태를 확인합니다.
diff --git a/apps/docs/content/docs/project-resources.mdx b/apps/docs/content/docs/project-resources.mdx
index cbf63d31b0..08c0a1d3c6 100644
--- a/apps/docs/content/docs/project-resources.mdx
+++ b/apps/docs/content/docs/project-resources.mdx
@@ -1,48 +1,40 @@
---
-title: Project Resources
-description: Attach typed pointers (Git repos, local directories, more later) to a project so agents can pick them up as scoped context.
+title: Project resources
+description: Link GitHub repositories or local directories to a project so later runs get a stable working context.
---
import { Callout } from "fumadocs-ui/components/callout";
-A **Project Resource** is a typed pointer — a Git repo URL, a path on your own machine, a Notion page tomorrow — attached to a [project](/workspaces). When an [agent](/agents) runs against an issue inside that project, the daemon automatically writes the project's resource list into the agent's working directory and into its [meta-skill](/skills) prompt.
+[Project](/projects) resources tell agents which code this body of work uses and where to run. Resources stay linked to the project, so there is no need to re-paste repository URLs or local paths into every issue.
-The result: the agent knows which repo to check out (or which local directory to work in), and which docs are the "primary references" for this project, without anyone copy-pasting context into the issue body.
+Two resource types are supported today:
-## Mental model
+| Resource | Best for | Where runs happen |
+|---|---|---|
+| **GitHub repository** | Code shared by the team, with checkouts managed by the runtime | A runtime-managed working directory |
+| **Local directory** | An existing checkout, a very large repository, or when you want to inspect local changes directly | The original directory on a specific computer |
-A project is no longer just a label. It is a small **resource container**:
+## How resources enter a run
-- A project has 0..N **resources**.
-- A resource has a `resource_type` (e.g. `github_repo`, `local_directory`) and a `resource_ref` (a JSON payload typed by `resource_type`).
-- New resource types add a string + a handler. **No schema migration. No frontend rewrite.**
+When an agent works an issue inside the project, Multica adds the project name, project description, and resource list to the run's context, and writes `.multica/project/resources.json` into the working directory.
-This shape is intentional — it's the same pattern Multica already uses for agent providers: a `type` discriminator and a typed payload. It keeps the schema stable so adding "Notion page", "Google Doc", "uploaded file", or "external URL" later is a small, additive change.
+The workspace's linked repository list is always included in the run context. Repositories linked to the project additionally specify the code and default ref this body of work uses.
-Today two resource types ship: [`github_repo`](#resource-type-github_repo) (clone-per-task into an isolated worktree) and [`local_directory`](#resource-type-local_directory) (run directly inside a folder on a specific daemon's machine).
+A local directory only applies to the daemon it is bound to. When the daemon running a task has a matching local directory, the agent works directly in that directory; other computers keep using the project's GitHub repositories or the workspace repositories.
-## Resource type: `github_repo`
+## Add a GitHub repository
-The default resource type — checked out per task into an isolated worktree:
+Open the project and choose "Add resource" under **Resources**. Pick a repository already linked to the workspace, or paste a Git URL. Workspace repositories are managed in **Settings → Repositories**; once GitHub is connected, the same page offers **Pick from GitHub** to import repositories the App is authorized for.
-```json
-{
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/owner/repo",
- "ref": "release/v2",
- "default_branch_hint": "main"
- }
-}
-```
+Repositories are not limited to GitHub: any Git URL the runtime can reach works as a repository resource. Self-hosted Multica can also connect self-hosted Forgejo, Gitea, or GitLab under **Settings → Integrations → Git hosting**; see [Self-hosted Git hosting](/vcs-integration).
-`ref` is optional — if present, `multica repo checkout <url>` uses it as the default branch, tag, or commit for tasks in this project. An explicit `multica repo checkout <url> --ref <other-ref>` still wins for that one checkout.
+When creating a project, you can also pick repositories directly under **Repos**. One project can link multiple GitHub repositories.
-`default_branch_hint` is optional prompt context. It is not used for checkout; use `ref` when the project should pin a branch, tag, or SHA.
+A resource's `ref` sets the branch, tag, or commit that later checkouts use by default. `default_branch_hint` only gives the agent a default-branch hint and does not force a branch switch.
-## Resource type: `local_directory`
+## Add a local directory
-For repos that can't reasonably be re-cloned per task — multi-gigabyte game checkouts, large monorepos, or any project where the worktree-per-task model is painful — a project can instead point at an **existing directory on a specific [daemon](/daemon-runtimes)'s machine**. The agent runs **directly inside that folder**, with no clone, no copy, and no worktree.
+The UI for adding a local directory is Desktop-only, because browsers cannot pick folders on your computer.
<Callout type="warning">
**This is an escape hatch, not a more convenient default.** `local_directory` exists for people who have no other option — the canonical case is a game project whose checkout is tens of gigabytes, where re-cloning per task is simply not viable.
@@ -50,236 +42,62 @@ For repos that can't reasonably be re-cloned per task — multi-gigabyte game ch
If your directory is an ordinary git repo you can clone, **use `github_repo` instead**: it runs in worktree mode by default, so tasks on the same repo run with unlimited concurrency. Choosing `local_directory` means every task on that folder runs **strictly one at a time, forever**. Read "When to pick" below before you commit to it.
</Callout>
-```json
-{
- "resource_type": "local_directory",
- "resource_ref": {
- "local_path": "/Users/me/code/big-game",
- "daemon_id": "0001234e-…",
- "label": "main checkout"
- }
-}
-```
-
-The trade-off vs. `github_repo` is intentional: only the bound daemon can pick up tasks against the directory, and tasks on the same directory run **serially** instead of in parallel. In exchange you keep your existing checkout, your existing branch, your existing dirty state — Multica never re-clones it.
-
-### When to pick `local_directory` over `github_repo`
-
-| Concern | `github_repo` (worktree) | `local_directory` |
-| --- | --- | --- |
-| Checkout cost per task | Fresh clone + worktree | None — agent runs in place |
-| Concurrency on the same repo | Many tasks in parallel | One at a time per directory |
-| Branch / dirty state | Each task gets a fresh branch from the default | Whatever the directory currently has |
-| Where it can run | Any daemon | Exactly one daemon (the one bound) |
-| Disk footprint | One worktree per task | Zero overhead — your existing folder |
-**The default answer is `github_repo`.** Only these cases justify switching to `local_directory`:
+1. Make sure Desktop's local daemon is online.
+2. Open the project's **Resources**.
+3. Choose "Add local directory", then pick the folder to use.
-1. **Re-cloning is prohibitively expensive** — a multi-gigabyte game checkout, a monorepo with heavy LFS assets, or anything where the per-task `git clone` would dominate the actual work. This is the mode's primary reason to exist.
-2. **The directory isn't a git repo at all** — an art asset library, a docs folder, an exported dataset. There's no remote to clone from, so working in place is the only option.
-3. **The work depends on machine-local state** — a local database, a multi-gigabyte dataset, an engine / SDK / licensed toolchain installed on that machine, attached hardware. None of it exists inside a fresh worktree.
+The directory must be an absolute path, must already exist, and must be readable and writable by the current daemon. These paths are rejected: system roots and drive roots (`/`, `C:\`), home directories themselves and the parents of home directories (such as `/Users`, `/home`, `/root`), and system directories such as `/etc`, `/var`, `/tmp`, `/usr`, and `/opt`. If the chosen path is a symlink, it is resolved to its real path first and validated again by the same rules; the serial lock also applies to the real path.
-These, on the other hand, are **not** reasons to pick it:
+Each project can link at most one local directory per daemon. Different computers on a team can each link their own directory for the same project.
-- **"I want to see the agent's edits in my own editor."** Worktrees are on your local disk too (under `~/multica_workspaces/`) and open in any editor. Giving up concurrency to save one directory hop isn't a good trade.
-- **"Cloning is a bit slow."** It only counts as a cost when the clone outweighs the task itself. A few-hundred-megabyte repo doesn't qualify.
-- **"I don't want agent branches piling up."** Branch policy belongs in `default_branch_hint` and task conventions, not in your choice of execution mode.
-
-**Serial execution is a premise of this mode, not a limitation waiting to be fixed.** This version ships no file-level write lock, so the per-directory serial gate (one task at a time on the same folder) is the only thing stopping agents in two different issues from writing the same files at once. That's also why "add worktrees to `local_directory` so tasks can run in parallel" is self-contradictory — a worktree *is* another copy of the working tree, and you chose this mode precisely because copies are too expensive. **If you need real parallelism on the same codebase, the answer is `github_repo`.**
-
-### Attaching a local directory
-
-<Callout type="info">
-Before you do this, make sure you actually need it (see the section above). If the folder is an ordinary git repo you can clone, `github_repo` is the better choice — its concurrency is unbounded. `local_directory` targets cases like a tens-of-gigabytes game project, where re-cloning once is already too expensive.
+<Callout type="warning">
+A local directory is not an isolated environment. The agent directly sees and modifies your current branch and uncommitted files; Multica does not automatically switch branches, stash, commit, push, or open PRs.
</Callout>
-The folder picker lives in the **Desktop app** only — the web app has no way to read OS paths, so the "Add local directory" button is hidden there. On Desktop:
-
-1. Open the project → **Resources** panel.
-2. Click **Add local directory**. A native folder picker opens.
-3. Pick the folder. The path is bound to **the daemon currently registered by this Desktop install** — the resource record stores both the path and that daemon's ID.
-
-On Desktop the button stays visible but is **disabled with a hint** when the daemon on this machine is offline, or when the project already has a `local_directory` bound to this daemon — so you can see *why* it's unavailable. (On the web app the button is hidden outright, since there's no folder picker available there at all.) To bind another machine's directory, install Desktop on that machine and add the resource from there.
-
-From the CLI (works on web-only environments too, as long as you supply the daemon ID yourself):
-
-```bash
-multica project resource add <project-id> \
- --type local_directory \
- --local-path /Users/me/code/big-game \
- --daemon-id <daemon-uuid> \
- --ref-label "main checkout" # optional
-
-multica project resource update <project-id> <resource-id> \
- --local-path /Users/me/code/big-game-new
-```
-
-`--daemon-id` comes from `multica daemon list`. The CLI also accepts the generic `--ref '<json>'` escape hatch if you'd rather pass the payload directly.
-
-### Path rules
-
-The path you attach must clear both an attach-time and a per-task validation. Both are enforced by the daemon that owns the resource — the server only stores the JSON. A path that breaks any rule fails the task with a typed error and leaves your directory untouched:
-
-- Must be **absolute**.
-- Must **exist** and be a **directory** (not a file, symlink to a file, or device node).
-- Must be **readable and writable** by the daemon process.
-- Cannot be a system root or an entire user profile — `/`, `/Users`, `/home`, `/root`, `/etc`, `/tmp`, `/var`, `/usr`, `/opt`, `/Users/Shared`, your own `$HOME`, any Windows drive root (`C:\`, `D:\`, …), or `C:\Users` / `C:\ProgramData` / `C:\Program Files` / `C:\Program Files (x86)` / `C:\Windows`.
-- A symlink that resolves to any of the above is rejected, and so is the canonical form of an OS-aliased path (e.g. on macOS, typing `/private/tmp` is rejected the same way as `/tmp`).
-
-The blacklist is intentionally aggressive — picking your home directory would put Multica's runtime files at the root of your account, which is never what you want. Pick a sub-folder (typically your actual project checkout) instead.
-
-### One per (project, daemon)
-
-A project may hold **at most one `local_directory` per daemon**. Attempting to add a second one on the same daemon returns a `409` from the API; the Desktop button hides itself when the limit is already reached and surfaces a tooltip explaining why.
-
-Different daemons are independent — a shared project can have one `local_directory` per teammate's machine, each binding the same project to a different folder on a different host. When the daemon claims a task, it picks the row that matches its own ID and ignores the rest.
-
-### Mixing resource types, and multiple `local_directory` resources
-
-Two cross-resource configurations show up in practice:
-
-- **`github_repo` + `local_directory` on the same project.** On the daemon that has a matching `local_directory` binding, the local directory **takes precedence**: the agent runs in your folder, and the daemon does not create or use a `github_repo` worktree for that task. (The per-workspace repo cache may still sync as usual — that's a background behaviour unrelated to this task's working tree.) The `github_repo` URL still appears in `.multica/project/resources.json` and in the agent's `## Repositories` section for reference — but the working tree the agent edits is your local one, not a worktree. On a daemon that has **no** `local_directory` row for this project (different machine, or before that teammate attached one), the task falls back to the usual `github_repo` worktree flow. Effectively the local directory is a per-daemon override of the worktree path.
-- **Two `local_directory` resources on the same project.** Because each `local_directory` is bound to exactly one daemon, this only happens across two different machines (the API rejects two on the same daemon at attach time, see above). Tasks are routed by the agent's runtime assignment, not by which daemon has a local directory: a task lands on the daemon that owns the receiving agent's runtime, that daemon picks the `local_directory` row matching its own ID, and ignores the rest. There is no load-balancing — if you want a specific machine to run a task, dispatch the agent that's bound to that machine's runtime.
-
-A daemon that has no `local_directory` row for a project that has one bound elsewhere is **not** blocked — its tasks simply proceed via the project's other resources (typically the `github_repo` fallback). The `local_directory` only matters for the daemon it's bound to.
-
-### Running tasks against a local directory
-
-When a task is dispatched on an issue whose project has a `local_directory` bound to the receiving daemon, the daemon:
-
-1. Re-validates the path (rules above).
-2. Acquires a per-directory lock keyed on the symlink-resolved real path — so two routes to the same folder (one via a symlink, one direct) still serialise.
-3. Writes the agent's `CLAUDE.md` / `AGENTS.md` (and `.multica/project/resources.json`) **into the user's directory**. The agent works there, just as if you'd opened the folder yourself.
-4. Keeps Multica's runtime artefacts (`output/`, `logs/`, `.gc_meta.json`) in a separate envRoot **outside** the user's directory.
-
-If a second task for the same directory arrives while the first is running, it parks with status **Waiting for local directory** (等待本地目录释放). The status is visible everywhere the task is — the chat task pill, the agent banner, the execution log, and the activity indicator — and the parked task counts toward the agent's "queued" presence. Cancelling the parked task releases its slot immediately; cancelling the running task lets the next one promote.
-
-The wait is not a timeout — a parked task stays parked until either the lock releases or the user / agent cancels it.
+## Local directories run serially
-### What Multica will and won't touch in your directory
+When two tasks use the same real directory, the later one enters `waiting_local_directory` and continues after the earlier one releases the directory. Two paths that reach the same directory through different symlinks serialize the same way.
-- **Will write** `CLAUDE.md` / `AGENTS.md` (or the equivalent for your agent's provider) and `.multica/project/resources.json` at the directory root, so the agent has its meta-skill and resource list. Add these to your `.gitignore` if you don't want them committed.
-- **Will write** whatever code edits the agent decides to make — exactly the same way as if you'd run the agent locally yourself.
-- **Will never physically delete** the directory or anything inside it. Garbage collection is path-aware: for `local_directory` envRoots it cleans only its own `output/` and `logs/` under `workspacesRoot`, and treats the user's directory as off-limits.
+Waiting does not modify the directory. A waiting task can be cancelled; otherwise it waits until the directory becomes available.
-### v1 limits (will tighten in follow-ups)
+To work on several changes at once, use a GitHub repository resource so the runtime prepares a separate working directory for each piece of work.
-The first release deliberately ships with sharper edges than `github_repo`. Expect this list to shrink over time — what's documented here is what's true today:
+## What gets written during a run
-- **No automatic branch switching.** The agent runs in whatever branch you have checked out. Switch branches before dispatching if it matters.
-- **No dirty-tree protection or auto-commit.** Uncommitted changes are visible to the agent, may be modified in place, and won't be stashed. Treat the directory as a real working tree and commit before risky runs.
-- **No automatic PR.** When the task ends, the changes sit on whatever branch they were made on — nothing is pushed and no PR is opened. Push and open the PR yourself when you're ready.
-- **`waiting_local_directory` shows status, not the holder.** The badge tells you the task is parked; it doesn't surface which task or which file path is currently holding the directory.
+Beyond the code changes the agent makes, the runtime may also write into the directory the instruction files the current AI coding tool needs, plus `.multica/project/resources.json`. Add them to `.gitignore` if you do not want them under version control.
-These are tracked as the agent-task-lifecycle follow-up to the local-directory work; until that ships, treat `local_directory` as "the agent runs in your folder, the same way you would."
+Multica never deletes a linked local directory when cleaning up run environments. The agent's changes to the directory are the same kind of changes as running an AI coding tool in your terminal yourself, and need the same review.
-## Attaching repos at project creation
-
-In the **Web** or **Desktop** app, opening *New project* now shows a **Repos** pill alongside Status / Priority / Lead. Selecting workspace-bound repos (or pasting an ad-hoc URL) attaches them as `github_repo` resources the moment the project is created.
-
-From the **CLI**:
+## Manage resources with the CLI
```bash
-# Create + attach in one shot. The server attaches resources in the same
-# transaction as the project create — invalid resources roll back the whole
-# operation, so you never end up with a project that has half its resources.
+# Link a repository when creating a project
multica project create \
- --title "Agent UX 2026" \
+ --title "Agent UX" \
--repo https://github.com/multica-ai/multica
-# Manage resources later
+# List and add resources
multica project resource list <project-id>
-multica project resource add <project-id> --type github_repo --url <url>
-multica project resource add <project-id> --type github_repo --url <url> --ref <branch-or-sha>
-multica project resource remove <project-id> <resource-id>
-
-# Generic escape hatch for any resource_type the server understands —
-# no CLI change needed when a new type ships:
multica project resource add <project-id> \
- --type notion_page \
- --ref '{"page_id":"…","title":"…"}'
-```
-
-`--repo` may be repeated; each value is attached as a separate `github_repo` resource.
-
-## What the agent sees at runtime
-
-When the daemon spawns an agent for an issue inside a project, two things happen:
-
-### 1. `.multica/project/resources.json`
-
-A structured pass-through of the API response, written into the agent's working directory:
-
-```json
-{
- "project_id": "…",
- "project_title": "Agent UX 2026",
- "resources": [
- {
- "id": "…",
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/multica-ai/multica",
- "default_branch_hint": "main"
- }
- }
- ]
-}
-```
-
-Skills, helper scripts, or the agent itself can parse this file when they need the *exact* set of resources for the run.
-
-### 2. A "Project Context" section in the meta-skill prompt
-
-The agent's `CLAUDE.md` / `AGENTS.md` (depending on provider) now includes a human-readable summary:
-
-```
-## Project Context
-
-This issue belongs to **Agent UX 2026**.
+ --type github_repo \
+ --url https://github.com/multica-ai/multica \
+ --ref main
-Project resources (also written to `.multica/project/resources.json`):
-
-- **GitHub repo**: https://github.com/multica-ai/multica (default branch: `main`)
+# Link a local directory on a specific daemon
+multica project resource add <project-id> \
+ --type local_directory \
+ --local-path /absolute/path/to/repo \
+ --daemon-id <daemon-id>
-Resources are pointers — open them only when relevant to the task. For
-`github_repo` resources, use `multica repo checkout <url>` to fetch the code.
+# Remove a resource
+multica project resource remove <project-id> <resource-id>
```
-The text is intentionally minimal. The full payload is on disk; the prompt only orients the agent so it knows the project exists and what's attached.
-
-### Failure mode
-
-Resource fetch is **best-effort**. If the API call fails, the project section is omitted from the prompt and the file is not written, but the task still starts. Agents never block on missing project context.
-
-## Adding a new resource type
-
-The whole point of the abstraction is that new types are cheap. The full path:
-
-1. **Server validator** (`server/internal/handler/project_resource.go`) — add a case in `validateAndNormalizeResourceRef` that parses and normalizes the new payload.
-2. **Daemon meta-skill formatter** (`server/internal/daemon/execenv/runtime_config.go`) — add a case in `formatProjectResource` so the agent prompt renders the new type as a readable bullet.
-3. **TypeScript types** (`packages/core/types/project.ts`) — extend `ProjectResourceType` and add the payload interface.
-4. **UI renderer** (`packages/views/projects/components/project-resources-section.tsx`) — add a case in `ResourceRow` for the new type.
-
-There is **no schema migration**, no new sqlc query, no new endpoint, **and no CLI change** — the CLI's generic `--ref '<json>'` flag accepts any payload the validator understands, so day-one support for a new type is purely the four steps above. (You may *optionally* add a per-type CLI shortcut later; not required.)
-
-The same `project_resource` table and the same three CRUD calls handle every type.
-
-## Workspace repos vs. project repos
-
-The repo list shown to the agent (`## Repositories` block in `CLAUDE.md` / `AGENTS.md`) is chosen by the daemon claim handler with this precedence:
-
-- **Project has at least one `github_repo` resource** → only those repos are surfaced to the agent. Workspace-bound repos are intentionally hidden so the agent doesn't have to guess which one belongs to this issue.
-- **Project has no `github_repo` resources (or the issue isn't in a project)** → fall back to the workspace's repo list as before.
-
-This keeps the agent's working set tight: when a project is explicit about its repos, that's the authoritative answer. The structured resource list at `.multica/project/resources.json` always carries the full set, so a skill that wants to inspect everything still can.
-
-The daemon mirrors this on the checkout side: when a task arrives with project-scoped `github_repo` URLs, those URLs are merged into the per-workspace allowlist *and* synced into the local repo cache before the agent spawns. So a project repo URL that isn't bound at the workspace level is still a valid argument to `multica repo checkout` — the daemon won't reject it as "not configured." If the project resource includes `ref`, that ref becomes the default for `multica repo checkout <url>` during that task; passing `--ref` to the checkout command overrides it. The allowlist split is internal: workspace-bound URLs and task-scoped URLs are tracked separately, so a workspace-repos refresh doesn't accidentally revoke a project URL mid-run.
-
-## What's intentionally **not** in scope here
+Resource changes affect tasks created afterwards; they do not rewrite records of runs that already ended.
-- **Cross-project sharing.** Each resource lives on exactly one project today.
-- **Per-skill resource scoping.** All resources are visible to every skill on the agent's run; type-aware filtering is a follow-up.
-- **Caching / sync.** `github_repo` is just metadata — checkout still happens via `multica repo checkout` on demand. Cached document text for Notion / Google Docs will arrive with those types.
+## Next steps
-These are deliberate omissions — the goal of the first cut is to validate the abstraction with the smallest set of moving parts.
+- [Projects](/projects) — learn about project context, progress, and the lead.
+- [Daemons and runtimes](/daemon-runtimes) — learn which computer picks up a task.
+- [Tasks](/tasks) — see run states such as `waiting_local_directory`.
diff --git a/apps/docs/content/docs/project-resources.zh.mdx b/apps/docs/content/docs/project-resources.zh.mdx
index aac306510d..357a8f266d 100644
--- a/apps/docs/content/docs/project-resources.zh.mdx
+++ b/apps/docs/content/docs/project-resources.zh.mdx
@@ -1,281 +1,103 @@
---
title: 项目资源
-description: 给项目挂上有类型的指针(GitHub 仓库、本地目录,未来更多),让智能体执行任务时自动拿到对应上下文。
+description: 为项目关联 GitHub 仓库或本地目录,让后续执行获得稳定的工作上下文。
---
import { Callout } from "fumadocs-ui/components/callout";
-**项目资源(Project Resource)** 是挂在 [项目](/workspaces) 上的有类型的指针 —— 今天可以挂 GitHub 仓库 URL 或者本机的一个目录,未来还会有 Notion 页面、文档链接等等。当 [智能体](/agents) 在这个项目的 issue 上跑任务时,守护进程会自动把项目的资源列表写进智能体的工作目录,并塞进它的 [元 skill](/skills) prompt 里。
+[项目](/projects)资源告诉智能体这组工作会用到哪些代码,以及在哪里执行。资源会持续关联在项目上,不必在每条 issue 中重复粘贴仓库地址或本地路径。
-带来的结果:智能体知道应该 checkout 哪个仓库(或者在哪个本地目录里工作),知道项目"主要参考资料"是哪些 —— 没人需要把上下文复制粘贴进 issue 描述里。
+目前支持两种资源:
-## 心智模型
+| 资源 | 适用场景 | 执行位置 |
+|---|---|---|
+| **GitHub 仓库** | 团队共享的代码库,希望由运行时管理 checkout | 运行时管理的工作目录 |
+| **本地目录** | 已经存在的 checkout、很大的仓库,或需要直接查看本地改动 | 指定电脑上的原目录 |
-项目不再只是一个标签,而是一个小的 **资源容器**:
+## 资源进入执行的方式
-- 一个项目可以挂 0..N 个 **资源**。
-- 每个资源有一个 `resource_type`(比如 `github_repo`、`local_directory`),以及一个 `resource_ref`(按 `resource_type` 定型的 JSON 负载)。
-- 加新资源类型只需要加一个字符串 + 一个 handler。**不需要 schema 迁移,不需要重写前端。**
+当智能体处理项目内的 issue 时,Multica 会把项目名称、项目描述和资源列表加入执行上下文,并在工作目录中写入 `.multica/project/resources.json`。
-这个形状是有意的 —— 跟 Multica 里 agent provider 的设计完全一致:一个 `type` 判别字段 + 一个有类型的 payload。schema 保持稳定,未来加"Notion 页面"、"Google Doc"、"上传文件"、"外部 URL"都是小型的、增量的改动。
+工作区关联的仓库列表始终包含在执行上下文中。项目关联的仓库在此基础上指明这组工作使用的代码和默认 ref。
-目前内置两种资源类型:[`github_repo`](#resource-type-github_repo)(每次任务克隆出独立 worktree)和 [`local_directory`](#resource-type-local_directory)(直接在某台守护进程所在机器的目录里运行)。
+本地目录只对绑定它的守护进程有效。本次执行所在的守护进程有匹配的本地目录时,智能体直接进入该目录工作;其他电脑仍使用项目中的 GitHub 仓库或工作区仓库。
-## 资源类型:`github_repo`
+## 添加 GitHub 仓库
-默认的资源类型 —— 每次任务都在隔离的 worktree 里 checkout:
+打开项目,在 **资源** 中选择"添加资源"。可以选择已关联到工作区的仓库,也可以粘贴 Git URL。工作区仓库在 **设置 → 代码仓库** 中维护;连接 GitHub 后,可在同一页面通过 **从 GitHub 选择** 导入 App 已授权的仓库。
-```json
-{
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/owner/repo",
- "default_branch_hint": "main"
- }
-}
-```
+仓库不限于 GitHub:任何运行时能访问的 Git URL 都可以作为仓库资源。自部署的 Multica 还可以在 **设置 → 集成 → Git 代码托管** 连接自托管的 Forgejo、Gitea 或 GitLab,见[自托管 Git 代码托管](/vcs-integration)。
+
+创建项目时,也可以直接在 **Repos** 中选择仓库。一个项目可以关联多个 GitHub 仓库。
-`default_branch_hint` 可选 —— 填了之后,守护进程会把它写进元 skill,告诉智能体该基于哪个分支干活。
+资源中的 `ref` 可以指定后续 checkout 默认使用的分支、tag 或 commit。`default_branch_hint` 只向智能体提供默认分支提示,不会强制切换分支。
-## 资源类型:`local_directory`
+## 添加本地目录
-对于那些不适合每次任务重新 clone 的仓库 —— 几十 GB 的游戏项目、超大 monorepo、或者本身就不想被多次复制的目录 —— 项目可以改为指向 **某台 [守护进程](/daemon-runtimes) 机器上的一个已有目录**。智能体会 **直接在这个目录里运行**,不 clone、不复制、不创建 worktree。
+添加本地目录的界面只在 Desktop 中提供,因为浏览器不能选择电脑上的文件夹。
<Callout type="warning">
**这是逃生舱,不是更方便的默认项。** `local_directory` 是给那些"不得不这么开发"的人准备的 —— 典型是一个 checkout 就几十 GB 的游戏项目,不可能每来一条任务就重新 clone 一份。
-如果你的目录只是一个能正常 clone 的普通 git 仓库,**请用 `github_repo`**:它默认走 worktree 模式,同一个仓库上的任务可以无限并发。选 `local_directory` 意味着这个目录上的任务从此**只能一条一条串行跑**。先读下面的「什么时候选」再决定。
+如果你的目录只是一个能正常 clone 的普通 git 仓库,**请用 `github_repo`**:它默认走 worktree 模式,同一个仓库上的任务可以无限并发。选 `local_directory` 意味着这个目录上的任务从此**只能一条一条串行跑**。先看上面的两种资源对照再决定。
</Callout>
-```json
-{
- "resource_type": "local_directory",
- "resource_ref": {
- "local_path": "/Users/me/code/big-game",
- "daemon_id": "0001234e-…",
- "label": "主开发目录"
- }
-}
-```
-
-跟 `github_repo` 相比的取舍是有意的:只有绑定的那台守护进程会使用这个本地目录执行任务,而且 **同一个目录上的任务串行执行**,不再并行。换来的是:你的现有 checkout、当前分支、未提交的脏改动一切照旧 —— Multica 不会重新 clone。
-
-### 什么时候选 `local_directory`、什么时候继续用 `github_repo`
-
-| 关注点 | `github_repo`(worktree 模式) | `local_directory` |
-| --- | --- | --- |
-| 每次任务的 checkout 成本 | 重新 clone + worktree | 0 —— 智能体原地干活 |
-| 同一仓库的并发 | 任意条任务并行 | 同一目录每次一条 |
-| 分支 / 脏改动 | 每条任务从默认分支拉一个干净分支 | 用目录当前的状态 |
-| 可在哪台机器跑 | 任意守护进程 | 仅绑定的那一台 |
-| 磁盘占用 | 每条任务一个 worktree | 0 —— 用你已有的目录 |
-
-**默认答案是 `github_repo`。** 只有下面这些情况才值得切到 `local_directory`:
-
-1. **重新 clone 的成本高到不可接受** —— 几十 GB 的游戏 checkout、带大量 LFS 资源的 monorepo、或者任何 `git clone` 的耗时会盖过实际工作量的场景。这是这个模式最主要的存在理由。
-2. **这个目录根本不是 git 仓库** —— 美术资源库、文档目录、导出的数据集。没有远端可以 clone,只能原地干活。
-3. **工作依赖这台机器上的本地状态** —— 本地数据库、几十 GB 的数据集、装在本机的引擎 / SDK / 需要授权的工具链、连着的硬件设备。这些东西在一个全新的 worktree 里都不存在。
-
-反过来,下面这些**不构成**选它的理由:
-- **"我想在自己的编辑器里看智能体改了什么。"** worktree 同样在你本机磁盘上(`~/multica_workspaces/` 下),编辑器一样能打开。为了少翻一层目录而放弃并发不划算。
-- **"每次 clone 有点慢。"** 只有当 clone 的耗时能盖过任务本身时才算成本。几百 MB 的仓库不属于这一类。
-- **"我不想让智能体的分支到处飞。"** 分支策略用 `default_branch_hint` 和任务本身的约定解决,不该用运行模式来解决。
+1. 确认 Desktop 的本地守护进程在线。
+2. 打开项目的 **资源**。
+3. 选择"添加本地目录",再选择要使用的文件夹。
-**串行是这个模式的前提,不是待修的限制。** 当前版本没有任何文件级的写入锁,"同一目录上的任务串行执行"这一道闸是唯一防止两个 issue 的智能体同时改同一份文件的保护。所以"给 `local_directory` 加 worktree 来支持并行"是自相矛盾的 —— worktree 的本质就是再复制一份工作树,而你选这个模式恰恰是因为复制不起。**需要在同一份代码上真正并行,答案就是 `github_repo`。**
+目录必须是绝对路径,已经存在,并且当前守护进程可以读取和写入。以下路径会被拒绝:系统根目录和盘符根(`/`、`C:\`)、用户主目录本身及各主目录的上级(如 `/Users`、`/home`、`/root`),以及 `/etc`、`/var`、`/tmp`、`/usr`、`/opt` 等系统目录。如果所选路径是符号链接,会先解析为真实路径再按同样的规则校验一次,串行锁也按真实路径生效。
-### 添加本地目录
+每个项目在同一台守护进程上最多关联一个本地目录。团队中的不同电脑可以分别为同一个项目关联各自的目录。
-<Callout type="info">
-动手之前先确认你真的需要它(见上一节):目录只是一个能正常 clone 的 git 仓库的话,`github_repo` 是更好的选择 —— 并发不受限。`local_directory` 面向的是几十 GB 的游戏项目这类"重新 clone 一次代价太大"的场景。
+<Callout type="warning">
+本地目录不是隔离环境。智能体会直接看到并修改当前分支和未提交的文件;Multica 不会自动切换分支、stash、commit、push 或创建 PR。
</Callout>
-文件夹选择器 **只在桌面端** 提供 —— 浏览器没法读 OS 路径,所以网页端不显示"添加本地目录"按钮。桌面端的流程是:
-
-1. 打开项目 → **Resources(资源)** 面板。
-2. 点击 **Add local directory(添加本地目录)**,系统会弹出原生文件夹选择器。
-3. 选一个文件夹。这个路径会被绑定到 **当前这台桌面端注册的守护进程** —— 资源记录里同时保存路径和该守护进程的 ID。
-
-在桌面端,当本机的守护进程离线、或者这个项目已经在本机绑定了一个 `local_directory` 时,按钮 **会保留显示但置灰**,并在下方给出一行说明 —— 让你看得到为什么暂时不能用。(网页端则是直接隐藏整个按钮,因为网页端本来就没有文件夹选择器。)要把另一台机器上的目录绑过来,需要在那台机器装上桌面端、并在那边添加资源。
-
-也可以用 CLI(即便环境是纯网页端也行,只要你自己提供守护进程 ID):
-
-```bash
-multica project resource add <project-id> \
- --type local_directory \
- --local-path /Users/me/code/big-game \
- --daemon-id <daemon-uuid> \
- --ref-label "主开发目录" # 可选
-
-multica project resource update <project-id> <resource-id> \
- --local-path /Users/me/code/big-game-new
-```
-
-`--daemon-id` 可以通过 `multica daemon list` 拿到。CLI 也接受 `--ref '<json>'` 这种通用形式,直接传 payload。
-
-### 路径规则
-
-挂资源时和每次任务启动时,守护进程都会校验一次路径(服务器只负责存 JSON,不做校验)。任何一条不满足的,任务会以一个有类型的错误失败,**不会动你的目录**:
-
-- 必须是 **绝对路径**。
-- 必须 **存在**,并且是 **目录**(不能是普通文件、设备节点、或者指向文件的 symlink)。
-- 守护进程进程必须能 **读 + 写**。
-- 不能是系统根目录或整个用户配置区 —— `/`、`/Users`、`/home`、`/root`、`/etc`、`/tmp`、`/var`、`/usr`、`/opt`、`/Users/Shared`、你自己的 `$HOME`、任意 Windows 盘根(`C:\`、`D:\`…),以及 `C:\Users` / `C:\ProgramData` / `C:\Program Files` / `C:\Program Files (x86)` / `C:\Windows`。
-- 指向上述任何路径的 symlink 也会被拒;macOS 的 canonical 别名(比如手动输入 `/private/tmp`)和 `/tmp` 受同样的限制。
-
-黑名单故意做得激进 —— 选你自己的 home 目录就意味着 Multica 的运行时文件会出现在你账号的根下,这不会是任何人想要的结果。请选一个子目录(一般就是你具体的项目 checkout)。
-
-### 每台守护进程每个项目最多一条
-
-同一项目上 **每台守护进程最多只能绑一个 `local_directory`**。在同一台机器上想再加一条会被 API 用 `409` 拒绝;桌面端的按钮在达到上限时会自动隐藏,并在 tooltip 里说明原因。
-
-不同的守护进程互不影响 —— 一个共享的项目可以为每个队友的机器各绑一个 `local_directory`,把同一个项目挂到不同主机上的不同目录。守护进程领任务时会挑跟自己 ID 匹配的那一行,其它的忽略。
-
-### 混用资源类型,以及多个 `local_directory` 资源
-
-实际会碰到两种跨资源的组合:
-
-- **同一个项目同时挂 `github_repo` 和 `local_directory`。** 在拥有匹配 `local_directory` 绑定的那台守护进程上,本地目录 **优先**:智能体跑在你的目录里,这次任务不会为项目的 `github_repo` 创建或使用 worktree。(每工作区的仓库缓存可能仍会照常 sync,这层是和具体任务无关的后台行为。)`github_repo` 的 URL 仍然会出现在 `.multica/project/resources.json` 和智能体的 `## Repositories` 段里供参考,但智能体真正在编辑的工作树是你的本地目录,不是 worktree。在 **没有** 匹配 `local_directory` 行的其他守护进程上(不同机器、或者那位队友还没挂本地目录),任务按原本的 `github_repo` worktree 流程走。本质上 `local_directory` 是某台守护进程对 worktree 路径的一个覆盖。
-- **同一个项目挂两个 `local_directory`。** 每个 `local_directory` 只能绑一台守护进程,所以这只会发生在两台不同机器之间(同一台机器上想加第二条会被 API 当场拒掉,见上一节)。任务的去向由智能体 runtime 绑定决定,不是由"哪台守护进程有本地目录"决定 —— 任务会落到承载这条智能体 runtime 的那台守护进程上,由它挑出匹配自己 ID 的那一行、忽略其他行。这里没有负载均衡:如果你想让某台机器跑某条任务,请把任务派给绑在那台机器 runtime 上的智能体。
-
-如果某台守护进程没有匹配这个项目的 `local_directory` 行,**不会**因为别处有人绑了就被拦下 —— 它的任务会照常走项目里的其他资源(一般就是 `github_repo` 那条 fallback 路径)。`local_directory` 只对它绑定的那台守护进程生效。
-
-### 任务在本地目录里如何运行
-
-当一条任务被分发到某个 issue、并且该项目在领任务的守护进程上绑了 `local_directory` 时,守护进程会:
-
-1. 再次校验路径(按上面那套规则)。
-2. 以 symlink 解析后的真实路径为 key 取一把"目录锁" —— 即便两条路径走不同路由(一条经过 symlink,一条直接)指向同一个文件夹,也会被串行化。
-3. 把智能体的 `CLAUDE.md` / `AGENTS.md`(以及 `.multica/project/resources.json`)**写进你的目录**。智能体就在那里工作,跟你自己打开这个文件夹后启动它是一样的体验。
-4. Multica 自己的运行时产物(`output/`、`logs/`、`.gc_meta.json`)放在 **你目录之外** 的一个独立 envRoot 里。
-
-如果第一条任务还在跑、第二条针对同一目录的任务又来了,第二条会停在 **Waiting for local directory(等待本地目录释放)** 状态。这个状态在所有相关 UI 都看得见 —— 聊天里的任务状态条、智能体横幅、执行记录、活动指示器;等待中的任务会被计入该智能体的"排队"占用。取消等待中的任务会立即释放它的槽位;取消正在跑的那条会让下一条立即顶上。
-
-等待没有超时 —— 一条等待中的任务会一直等到锁释放、或者被用户/智能体取消为止。
+## 本地目录串行执行
-### Multica 会写、不会动什么
+两条执行任务使用同一个真实目录时,后到的任务进入 `waiting_local_directory`,等前一条释放目录后继续。两个路径经不同符号链接指向同一目录时,同样串行。
-- **会写入** `CLAUDE.md` / `AGENTS.md`(或对应 provider 的等价文件)以及 `.multica/project/resources.json` 到目录根 —— 这样智能体才有自己的元 skill 和资源清单。如果不想把这些提交到 git,请加进 `.gitignore`。
-- **会写入** 智能体决定做出的所有代码改动 —— 跟你自己在本地跑这个智能体没有区别。
-- **永远不会物理删除** 你的目录或里面任何内容。垃圾回收对路径是有判断的:对 `local_directory` 的 envRoot,它只会清自己挂在 `workspacesRoot` 下的 `output/` 与 `logs/`,**完全不碰** 你的目录。
+等待不会修改目录。等待中的任务可以取消,否则会一直等到目录可用。
-### v1 阶段的限制(后续会逐步收敛)
+需要同时处理多项改动时,使用 GitHub 仓库资源,让运行时为不同工作准备各自的工作目录。
-第一版有意比 `github_repo` 留了更多锋利的边。下面这份清单会随着后续工作逐步缩短;这里列出的是 **今天**的真实行为:
+## 执行期间写入的内容
-- **不会自动切分支。** 智能体跑在你当前 checkout 的分支上。如果分支选择重要,请在分发任务前自己切换好。
-- **不会保护脏工作区,也不会自动 commit。** 未提交的改动智能体看得到、可能就地修改,不会被 stash。请把这个目录当作真实的工作区来对待,重要的运行前自己先 commit。
-- **不会自动开 PR。** 任务结束后,改动就停在它实际做出来的分支上 —— Multica 不会 push、不会开 PR。需要 push、需要 PR 的话请自己来。
-- **`waiting_local_directory` 只显示状态,不显示是谁占着。** 这个徽标只告诉你"任务在等",不会告诉你具体是哪条任务、哪个路径正在持有目录。
+除了智能体产生的代码改动,运行时还可能在目录中写入当前 AI 编程工具所需的说明文件,以及 `.multica/project/resources.json`。不希望它们进入版本控制时,加入 `.gitignore` 即可。
-这些都列在 local-directory 工作的"智能体任务生命周期"后续项里;在那之前,请把 `local_directory` 当作"智能体在你的目录里跑,跟你自己跑没区别"来用。
+Multica 清理执行环境时不会删除关联的本地目录。智能体对该目录的改动,与你在终端中直接运行 AI 编程工具的改动性质相同,需要同样的审查。
-## 在创建项目时挂仓库
-
-在 **网页端** 或 **桌面端**,打开 *新建项目* 时,Status / Priority / Lead 旁边多了一个 **Repos** 标签。选已绑到工作区的仓库(或者粘贴一个临时 URL),项目创建的瞬间它们就以 `github_repo` 资源的形式挂上去。
-
-通过 **CLI**:
+## 使用 CLI 管理资源
```bash
-# 创建 + 挂资源一步到位。资源是在同一个事务里挂上的 ——
-# 任何一个资源不合法都会让整个 create 回滚,绝不会出现
-# "项目建好了但资源只挂了一半"的状态。
+# 创建项目时关联仓库
multica project create \
- --title "Agent UX 2026" \
+ --title "Agent UX" \
--repo https://github.com/multica-ai/multica
-# 后续管理资源
+# 查看和添加资源
multica project resource list <project-id>
-multica project resource add <project-id> --type github_repo --url <url>
-multica project resource remove <project-id> <resource-id>
-
-# 任何服务器认识的 resource_type 都可以用这个通用入口 ——
-# 加新类型时不需要改 CLI:
multica project resource add <project-id> \
- --type notion_page \
- --ref '{"page_id":"…","title":"…"}'
-```
-
-`--repo` 可以重复指定;每个值会被当作一条单独的 `github_repo` 资源挂上去。
-
-## 运行时智能体看到什么
-
-当守护进程为一个项目内的 issue 启动智能体时,会发生两件事:
-
-### 1. `.multica/project/resources.json`
-
-API 响应的结构化透传,写进智能体的工作目录里:
-
-```json
-{
- "project_id": "…",
- "project_title": "Agent UX 2026",
- "resources": [
- {
- "id": "…",
- "resource_type": "github_repo",
- "resource_ref": {
- "url": "https://github.com/multica-ai/multica",
- "default_branch_hint": "main"
- }
- }
- ]
-}
-```
-
-Skill、辅助脚本、或者智能体自己想拿到本次运行**精确的**资源列表时,解析这个文件即可。
-
-### 2. 元 skill prompt 里的 "Project Context" 段
-
-智能体的 `CLAUDE.md` / `AGENTS.md`(按 provider 不同)里多出一段人类可读的摘要:
-
-```
-## Project Context
-
-This issue belongs to **Agent UX 2026**.
+ --type github_repo \
+ --url https://github.com/multica-ai/multica \
+ --ref main
-Project resources (also written to `.multica/project/resources.json`):
-
-- **GitHub repo**: https://github.com/multica-ai/multica (default branch: `main`)
+# 关联指定守护进程上的本地目录
+multica project resource add <project-id> \
+ --type local_directory \
+ --local-path /absolute/path/to/repo \
+ --daemon-id <daemon-id>
-Resources are pointers — open them only when relevant to the task. For
-`github_repo` resources, use `multica repo checkout <url>` to fetch the code.
+# 移除资源
+multica project resource remove <project-id> <resource-id>
```
-这段文字故意做得很精简:完整 payload 已经写到磁盘上了,prompt 只是给智能体一个定位 —— 让它知道项目存在、知道挂了什么。
-
-### 失败时
-
-资源拉取是 **best-effort**。如果 API 调失败了,prompt 里的项目段会省掉、文件也不写,但任务照常启动 —— 智能体永远不会因为缺少项目上下文而卡住。
-
-## 加一种新资源类型
-
-抽象的全部目的就是让加新类型变便宜。完整流程:
-
-1. **服务端校验器**(`server/internal/handler/project_resource.go`)—— 在 `validateAndNormalizeResourceRef` 里加一个 case,解析并标准化新的 payload。
-2. **守护进程元 skill 格式化器**(`server/internal/daemon/execenv/runtime_config.go`)—— 在 `formatProjectResource` 里加一个 case,让智能体 prompt 把新类型渲染成一条可读的列表项。
-3. **TypeScript 类型**(`packages/core/types/project.ts`)—— 给 `ProjectResourceType` 加值,并加上对应的 payload 接口。
-4. **UI 渲染**(`packages/views/projects/components/project-resources-section.tsx`)—— 在 `ResourceRow` 里加一个 case 渲染新类型。
-
-**不需要 schema 迁移、不需要新的 sqlc query、不需要新的 endpoint、也不需要改 CLI** —— CLI 的通用 `--ref '<json>'` 选项接受校验器认识的任何 payload,第 0 天就能用。(之后如果想加按类型的 CLI 快捷参数,可以加,但不是必须。)
-
-同一张 `project_resource` 表、同一套 CRUD 调用,处理所有类型。
-
-## 工作区仓库 vs. 项目仓库
-
-智能体看到的仓库列表(`CLAUDE.md` / `AGENTS.md` 里的 `## Repositories` 段)由守护进程的领任务逻辑按以下优先级决定:
-
-- **项目挂了至少一条 `github_repo` 资源** → 仅显示项目挂的仓库。工作区绑定的仓库会被隐藏,避免智能体猜哪一个属于这个 issue。
-- **项目没挂 `github_repo` 资源(或 issue 根本不在项目里)** → 回落到工作区的仓库列表,跟以前一样。
-
-这样可以把智能体的工作集压紧:项目把仓库说清楚了,那就是权威答案。而 `.multica/project/resources.json` 里始终带着完整列表,需要查看全部资源的 skill 仍然能拿到。
-
-守护进程在 checkout 这一侧也是配套的:当任务带着项目级别的 `github_repo` URL 进来时,这些 URL 会被合并进每工作区的白名单,并在智能体启动前同步进本地仓库缓存。所以即便某个项目仓库 URL 没被绑到工作区,`multica repo checkout` 也能正常处理它,不会以"未配置"为由拒绝。白名单的划分只是内部实现:工作区绑定的 URL 和任务级别的 URL 分开记录,工作区仓库列表的刷新不会顺手吊销某条项目 URL。
-
-## 当前**不**做的事
+资源变更会影响之后创建的执行任务,不会改写已经结束的执行记录。
-- **跨项目共享**。每条资源现在只能挂在一个项目上。
-- **按 skill 划定资源可见性**。所有资源对智能体本次运行里的每个 skill 都可见;按类型过滤是后续工作。
-- **缓存 / 同步**。`github_repo` 目前只是元数据 —— checkout 仍然按需走 `multica repo checkout`。Notion / Google Docs 之类的文档文本缓存会随对应类型一起到位。
+## 接下来
-这些是有意的留白 —— 第一版的目标是用最小的活动部件去验证这个抽象。
+- [项目](/projects) — 了解项目上下文、进度和负责人。
+- [守护进程与运行时](/daemon-runtimes) — 了解任务由哪台电脑领取。
+- [执行任务](/tasks) — 查看 `waiting_local_directory` 等执行状态。
diff --git a/apps/docs/content/docs/projects.ja.mdx b/apps/docs/content/docs/projects.ja.mdx
index 4983606f31..8f548ff4fe 100644
--- a/apps/docs/content/docs/projects.ja.mdx
+++ b/apps/docs/content/docs/projects.ja.mdx
@@ -1,49 +1,71 @@
---
title: プロジェクト
-description: 関連するイシューをまとめて1つの単位として追跡します — 優先度、ステータス、進捗、担当者とともに。
+description: 関連するイシューをプロジェクトで整理し、共通の目標、計画、実行コンテキストを与えます。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica の **プロジェクト** は、関連する[イシュー](/issues)をまとめるコンテナです。作業の分量がイシュー1つよりは大きいが、ワークスペース全体よりは小さいときに使ってください — リリース、マイグレーション、複数の部分に分かれる機能、いくつもの枝に分岐する調査などです。
+プロジェクトは、複数の[イシュー](/issues)で完了する作業を整理するための単位です。プロダクトのリリース、移行、段階的に進める機能などが該当します。
-各プロジェクトには、名前、アイコン、説明、**リード**(メンバーまたは[エージェント](/agents))、**ステータス**(`planned` / `in_progress` / `paused` / `completed` / `cancelled`)、**優先度**(`urgent` / `high` / `medium` / `low` / `none`)、そして紐づくイシューのステータスから自動的に算出される **進捗** の百分率があります。
+1 件のイシューで説明できる作業にプロジェクトは不要です。プロジェクトが適しているのは、共通の目標を持ち、進捗をまとめて追跡したい、あるいはリポジトリや作業ディレクトリを共有したい一連の作業です。
-## プロジェクトとイシューの関係
+## プロジェクトの構成
-プロジェクトとイシューは独立したオブジェクトで、多対一の関係です。1つのイシューは **最大1つの** プロジェクトに属することができ、1つのプロジェクトは **任意の数の** イシューを保持できます。紐づけと紐づけ解除はいつでも元に戻せます — ボードビューでドラッグするか、イシュー右側のプロパティパネルにあるプロジェクトピッカーを使ってください。
+| 内容 | 役割 |
+|---|---|
+| **名前、アイコン、説明** | 目標、範囲、長期にわたって有効な要件。説明はプロジェクト内で作業するエージェントの実行コンテキストに入ります。 |
+| **ステータス** | `planned`、`in_progress`、`paused`、`completed`、`cancelled`。 |
+| **優先度** | `urgent`、`high`、`medium`、`low`、`none`。 |
+| **リード(lead)** | メンバーまたはエージェント。プロジェクトの調整役を示します。 |
+| **開始日と目標日** | プロジェクトの計画期間。 |
+| **イシューと進捗** | プロジェクト内の作業と、その完了割合。 |
+| **リソース** | 紐づけた GitHub リポジトリ、または特定のコンピュータ上のローカルディレクトリ。 |
-プロジェクトの進捗バーは、紐づくイシューから計算されます — `done` に到達したイシューが多いほど、バーがより満たされます。`cancelled` のイシューは集計から除外されます。`backlog` のイシューは分母にはカウントされますが、分子にはカウントされません。
+![プロジェクト詳細: ステータス別のイシュー、進捗、プロジェクトの説明](/images/docs/project-detail.png)
-## サイドバーにピン留めする
+## プロジェクトとイシューの関係
-プロジェクト右上のピンアイコンをクリックすると、サイドバーのピン留めリストに追加されます。ピン留めされたプロジェクトは、ワークスペースのどこにいてもワンクリックでアクセスできます。チームの全員がそれぞれ独立してピン留めできます — ピン留めは個人ごとの設定です。
+1 つのプロジェクトは任意の数のイシューを含むことができ、1 つのイシューは最大 1 つのプロジェクトに属します。イシューはプロジェクト内で直接作成することも、イシューのプロパティでプロジェクトを選択・変更することもできます。
-サイドバーの **ワークスペース → プロジェクト** リンクは、常にワークスペースのすべてのプロジェクトを表示します。ピン留めはその上に重ねる個人用のショートカットにすぎません。
+プロジェクトの進捗は、紐づくイシューから自動的に計算されます。
-## リソースを添付する
+```text
+進捗 = ステータスが done または cancelled のイシュー数 ÷ プロジェクト内の全イシュー数
+```
-各プロジェクトには、GitHub リポジトリを添付する **Resources** セクションがあります。添付すると、このプロジェクトのイシューに割り当てられた[エージェント](/agents)は、タスクを実行する際にそれらのリポジトリを読み書きできます — Multica がリポジトリ URL をコンテキストとして[デーモン](/daemon-runtimes)に渡します。
+`cancelled` はその作業がプロジェクトの範囲から終了したことを意味するため、進捗に数えられます。プロジェクトのステータスとイシューのステータスは互いに独立しています。すべてのイシューが完了してもプロジェクトは自動的に `completed` にならず、プロジェクトのステータスを変更しても中のイシューが一括変更されることはありません。
-リソースはプロジェクト単位です。複数のプロジェクトが同じリポジトリを共有する場合は、それぞれに添付してください。
+## プロジェクトの説明と実行コンテキスト
-## プロジェクトを削除する
+エージェントがプロジェクト内のイシューを実行するとき、プロジェクトの名前と説明がその実行のコンテキストに追加されます。説明には、関連するすべての実行タスクに必要な情報 — 目標、技術的な境界、成果物の取り決め — を書きます。1 件のイシューにだけ関係する要件は、そのイシューに書いてください。
-プロジェクトを削除しても **イシューは削除されません**。紐づくイシューは単に紐づけが解除され、ワークスペースのフラットなイシュー一覧に戻ります。これは意図された動作です — プロジェクトの枠組みが変わっても、プロジェクトの範囲として定められた作業が使い捨てになることはまれだからです。
+## リソースの追加
-<Callout type="info">
-作業も一緒に削除したい場合は、まずイシューをアーカイブまたは削除してから、プロジェクトを削除してください。
-</Callout>
+プロジェクトリソースは、どのコードとどの作業ディレクトリを使うかをエージェントに伝えます。
+
+- **GitHub リポジトリ**: ランタイムが checkout できるリポジトリと、任意の ref を指定します。
+- **ローカルディレクトリ**: 特定のコンピュータ上のランタイムを既存のディレクトリで作業させます。ディレクトリの内容はエージェントが直接変更します。
+
+選び方と安全上の境界は[プロジェクトリソース](/project-resources)を参照してください。
## プロジェクトリード
-リードは、プロジェクトに対して責任を負う人 — またはエージェント — です。これはアクセス制御ではなく、弱いシグナルです。誰がリードであるかに関わらず、ワークスペースのすべてのメンバーがプロジェクトを編集できます。プロジェクトのリードには次のものを設定できます。
+リードはメンバーまたはエージェントで、プロジェクトの調整役を示します。権限設定ではないため、プロジェクト内のイシューが自動的に割り当てられることはなく、エージェントをリードにしても自動的に実行されることはありません。実行を開始するには、これまでどおりイシューの割り当て、@メンション、またはオートパイロットのトリガーが必要です。
-- ワークスペースのメンバー(人間のチームメイト)
-- [エージェント](/agents) — プロジェクトの作業の大半をエージェントに委任する場合に便利です(例: 「週次のバグトリアージ」をトリアージ用エージェントがリードする)
+## サイドバーへのピン留め
+
+ピン留めすると、プロジェクトが自分のサイドバーに表示されます。ピン留めは個人の設定で、ほかのメンバーには影響しません。
+
+## 作成、編集、削除
+
+プロジェクトの作成と編集はワークスペースのメンバーなら誰でもできます。削除できるのは `owner` と `admin` だけです。
+
+<Callout type="warning">
+プロジェクトを削除しても中のイシューは削除されません。イシューは紐づけが解除され、ワークスペースにそのまま残ります。プロジェクトの説明、ステータス、リソースは完全に削除されます。
+</Callout>
-## 次へ
+## 次のステップ
-- [イシュー](/issues) — プロジェクトの中に存在する作業の単位
-- [プロジェクトリードとしてのエージェント](/agents) — エージェントが適切な担当者となる場合
-- [Multica の仕組み](/how-multica-works) — より広い全体像
+- [プロジェクトリソース](/project-resources) — GitHub リポジトリまたはローカルディレクトリを紐づけます。
+- [イシュー](/issues) — プロジェクト内の具体的な作業を作成・整理します。
+- [エージェント](/agents) — エージェントのアイデンティティ、設定、Access を理解します。
diff --git a/apps/docs/content/docs/projects.ko.mdx b/apps/docs/content/docs/projects.ko.mdx
index b0a5cf3415..a532f72abe 100644
--- a/apps/docs/content/docs/projects.ko.mdx
+++ b/apps/docs/content/docs/projects.ko.mdx
@@ -1,49 +1,71 @@
---
title: 프로젝트
-description: 관련 이슈를 하나로 묶어 하나의 단위로 추적하세요 — 우선순위, 상태, 진행률, 담당자와 함께.
+description: 관련 이슈를 프로젝트로 구성하고 공동 목표, 계획, 실행 컨텍스트를 제공합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica의 **프로젝트**는 관련 [이슈](/issues)를 담는 컨테이너입니다. 작업의 분량이 이슈 하나보다는 크지만 워크스페이스 전체보다는 작을 때 사용하세요 — 출시, 마이그레이션, 여러 부분으로 나뉘는 기능, 여러 갈래로 분기되는 조사 같은 경우입니다.
+프로젝트는 제품 출시, 마이그레이션, 단계적으로 진행하는 기능처럼 여러 [이슈](/issues)를 함께 완료해야 하는 작업을 구성할 때 사용합니다.
-각 프로젝트에는 이름, 아이콘, 설명, **리더**(멤버 또는 [에이전트](/agents)), **상태**(`planned` / `in_progress` / `paused` / `completed` / `cancelled`), **우선순위**(`urgent` / `high` / `medium` / `low` / `none`), 그리고 연결된 이슈의 상태로부터 자동으로 산출되는 **진행률** 백분율이 있습니다.
+하나의 이슈로 충분히 설명할 수 있는 작업에는 프로젝트가 필요하지 않습니다. 프로젝트는 공동 목표가 있고 진행 상황을 한곳에서 추적해야 하거나 저장소와 작업 디렉터리를 공유해야 하는 작업 묶음에 적합합니다.
+
+## 프로젝트의 구성
+
+| 내용 | 용도 |
+|---|---|
+| **이름, 아이콘, 설명** | 목표, 범위, 장기적으로 적용되는 요구 사항입니다. 설명은 프로젝트 안에서 실행되는 에이전트의 컨텍스트에 포함됩니다. |
+| **상태** | `planned`, `in_progress`, `paused`, `completed`, `cancelled` 중 하나입니다. |
+| **우선순위** | `urgent`, `high`, `medium`, `low`, `none` 중 하나입니다. |
+| **담당자(lead)** | 프로젝트 조율 책임자를 나타내는 멤버 또는 에이전트입니다. |
+| **시작일과 마감일** | 프로젝트의 계획 기간입니다. |
+| **이슈와 진행률** | 프로젝트에 속한 작업과 완료 비율입니다. |
+| **리소스** | 연결된 GitHub 저장소 또는 지정한 컴퓨터의 로컬 디렉터리입니다. |
+
+![프로젝트 상세: 상태별로 나뉜 이슈, 진행률, 프로젝트 설명](/images/docs/project-detail.png)
## 프로젝트와 이슈의 관계
-프로젝트와 이슈는 독립적인 객체이며 다대일 관계입니다. 하나의 이슈는 **최대 하나의** 프로젝트에 속할 수 있고, 하나의 프로젝트는 **임의 개수의** 이슈를 담을 수 있습니다. 연결과 연결 해제는 언제든지 되돌릴 수 있습니다 — 보드 뷰에서 드래그하거나, 이슈 우측 속성 패널의 프로젝트 선택기를 사용하세요.
+하나의 프로젝트에는 여러 이슈가 포함될 수 있고, 하나의 이슈는 최대 하나의 프로젝트에만 속할 수 있습니다. 프로젝트에서 바로 이슈를 만들거나 이슈 속성에서 프로젝트를 선택하거나 변경할 수 있습니다.
-프로젝트의 진행률 막대는 연결된 이슈로부터 계산됩니다 — `done`에 도달한 이슈가 많을수록 더 많이 채워집니다. `cancelled` 상태인 이슈는 집계에서 제외됩니다. `backlog` 상태인 이슈는 분모에는 포함되지만 분자에는 포함되지 않습니다.
+프로젝트 진행률은 연결된 이슈를 기준으로 자동 계산됩니다.
-## 사이드바에 고정하기
+```text
+진행률 = 상태가 done 또는 cancelled인 이슈 수 ÷ 프로젝트의 전체 이슈 수
+```
-프로젝트 우측 상단의 핀 아이콘을 클릭하면 사이드바의 고정 목록에 추가됩니다. 고정된 프로젝트는 워크스페이스의 어디에 있든 한 번의 클릭으로 접근할 수 있습니다. 팀의 모든 구성원이 각자 독립적으로 고정할 수 있습니다 — 고정은 개인 설정입니다.
+`cancelled`는 해당 작업이 프로젝트 범위에서 종료되었다는 뜻이므로 진행률에 포함됩니다. 프로젝트 상태와 이슈 상태는 서로 독립적입니다. 모든 이슈가 완료되어도 프로젝트가 자동으로 `completed`가 되지 않으며, 프로젝트 상태를 바꿔도 그 안의 이슈 상태가 일괄 변경되지 않습니다.
-사이드바의 **워크스페이스 → 프로젝트** 링크는 워크스페이스의 모든 프로젝트를 항상 보여줍니다. 고정은 그 위에 얹는 개인 단축키일 뿐입니다.
+## 프로젝트 설명과 실행 컨텍스트
-## 리소스 연결하기
+에이전트가 프로젝트 안의 이슈를 실행할 때 프로젝트 이름과 설명이 해당 실행의 컨텍스트에 포함됩니다. 모든 관련 태스크에 필요한 목표, 기술적 경계, 납품 규칙을 설명에 저장하세요. 하나의 이슈에만 관련된 요구 사항은 해당 이슈에 작성합니다.
-각 프로젝트에는 GitHub 저장소를 연결하는 **Resources** 섹션이 있습니다. 연결되고 나면, 이 프로젝트의 이슈에 할당된 [에이전트](/agents)는 작업을 실행할 때 해당 저장소를 읽고 쓸 수 있습니다 — Multica가 저장소 URL을 컨텍스트로 [데몬](/daemon-runtimes)에 전달합니다.
+## 리소스 추가
-리소스는 프로젝트 단위입니다. 여러 프로젝트가 같은 저장소를 공유하려면 각각에 연결하세요.
+프로젝트 리소스는 에이전트가 사용할 코드와 작업 디렉터리를 지정합니다.
-## 프로젝트 삭제하기
+- **GitHub 저장소**: checkout할 수 있는 저장소와 선택적 ref를 제공합니다.
+- **로컬 디렉터리**: 지정한 컴퓨터의 런타임이 기존 디렉터리에서 작업하게 하며, 에이전트가 디렉터리 내용을 직접 수정합니다.
-프로젝트를 삭제해도 **이슈는 삭제되지 않습니다**. 연결된 이슈는 단지 연결이 해제되어 워크스페이스의 평면 이슈 목록으로 되돌아갑니다. 이는 의도된 동작입니다 — 프로젝트의 틀이 바뀌더라도, 프로젝트 범위로 정해졌던 작업은 일회성으로 버려지는 경우가 드뭅니다.
+선택 방법과 안전 경계는 [프로젝트 리소스](/project-resources)를 참고하세요.
-<Callout type="info">
-작업도 함께 삭제하고 싶다면, 먼저 이슈를 보관하거나 삭제한 다음 프로젝트를 삭제하세요.
-</Callout>
+## 프로젝트 담당자
-## 프로젝트 리더
+Lead는 프로젝트 조율 책임자를 나타내는 멤버 또는 에이전트입니다. 권한 설정이 아니며 프로젝트의 이슈를 자동으로 할당하지 않습니다. 에이전트를 lead로 지정해도 자동 실행되지 않습니다. 실행을 시작하려면 여전히 이슈 할당, @멘션, 자동화 트리거 중 하나가 필요합니다.
-리더는 프로젝트에 대해 책임을 지는 사람 — 또는 에이전트 — 입니다. 이는 접근 제어가 아니라 약한 신호입니다. 누가 리더든 상관없이 워크스페이스의 모든 멤버가 프로젝트를 편집할 수 있습니다. 프로젝트 리더는 다음이 될 수 있습니다:
+## 사이드바에 고정
-- 워크스페이스 멤버(사람 팀원)
-- [에이전트](/agents) — 프로젝트의 작업 대부분을 에이전트에게 위임할 때 유용합니다(예: "주간 버그 분류"를 분류 에이전트가 리드하는 경우).
+고정한 프로젝트는 내 사이드바에 표시됩니다. 고정은 개인 설정이며 다른 멤버에게 영향을 주지 않습니다.
+
+## 생성, 수정, 삭제
+
+모든 워크스페이스 멤버가 프로젝트를 만들고 수정할 수 있습니다. 삭제는 `owner`와 `admin`만 할 수 있습니다.
+
+<Callout type="warning">
+프로젝트를 삭제해도 그 안의 이슈는 삭제되지 않습니다. 이슈는 프로젝트와 연결이 해제된 뒤 워크스페이스에 계속 남습니다. 프로젝트의 설명, 상태, 리소스는 영구적으로 삭제됩니다.
+</Callout>
-## 다음
+## 다음 단계
-- [이슈](/issues) — 프로젝트 안에 들어 있는 작업 단위
-- [프로젝트 리더로서의 에이전트](/agents) — 에이전트가 담당자로 적합한 경우
-- [Multica 작동 방식](/how-multica-works) — 더 넓은 그림
+- [프로젝트 리소스](/project-resources) — GitHub 저장소나 로컬 디렉터리를 연결합니다.
+- [이슈](/issues) — 프로젝트 안의 구체적인 작업을 만들고 구성합니다.
+- [에이전트](/agents) — 에이전트의 정체성, 설정, Access를 알아봅니다.
diff --git a/apps/docs/content/docs/projects.mdx b/apps/docs/content/docs/projects.mdx
index fd5813f67f..8c96fff928 100644
--- a/apps/docs/content/docs/projects.mdx
+++ b/apps/docs/content/docs/projects.mdx
@@ -1,49 +1,71 @@
---
title: Projects
-description: Group related issues and track them as one unit — with priority, status, progress, and an owner.
+description: Organize related issues with projects and give them a shared goal, plan, and execution context.
---
import { Callout } from "fumadocs-ui/components/callout";
-A **project** in Multica is a container for related [issues](/issues). Use it when a body of work is bigger than one issue but smaller than a full workspace — a launch, a migration, a feature with multiple parts, an investigation that branches into several threads.
+Projects organize work that takes multiple [issues](/issues) to finish — a product launch, a migration, or a feature delivered in stages.
-Each project has a name, an icon, a description, a **lead** (a member or an [agent](/agents)), a **status** (`planned` / `in_progress` / `paused` / `completed` / `cancelled`), a **priority** (`urgent` / `high` / `medium` / `low` / `none`), and a **progress** percentage that's auto-derived from the status of its linked issues.
+Work that a single issue can describe does not need a project. Projects fit a group of work that shares a goal, needs its progress tracked together, or needs shared repositories and working directories.
-## How projects relate to issues
+## Parts of a project
-Projects and issues are independent objects with a many-to-one relationship: an issue can belong to **at most one** project; a project holds **any number of** issues. Linking and unlinking is reversible at any time — drag in the board view, or use the project picker on the issue's right-side properties panel.
+| Part | Purpose |
+|---|---|
+| **Name, icon, and description** | Goal, scope, and long-lived requirements; the description enters the execution context of agents working inside the project. |
+| **Status** | `planned`, `in_progress`, `paused`, `completed`, or `cancelled`. |
+| **Priority** | `urgent`, `high`, `medium`, `low`, or `none`. |
+| **Lead** | A member or an agent — who coordinates the project. |
+| **Start and target dates** | The project's planned time range. |
+| **Issues and progress** | The work in the project and how much of it is finished. |
+| **Resources** | Linked GitHub repositories or local directories on specific computers. |
-The progress bar on a project is computed from its linked issues — the more issues hit `done`, the further it fills. Issues that are `cancelled` are excluded from the count; issues in `backlog` count toward the denominator but not the numerator.
+![Project detail: issues grouped by status, progress, and the project description](/images/docs/project-detail.png)
-## Pinning to the sidebar
+## Projects and issues
-Click the pin icon in a project's top-right corner to add it to your sidebar's pinned list. Pinned projects stay one click away no matter where you are in the workspace; everyone on the team can pin independently — pins are personal.
+A project can contain any number of issues; an issue belongs to at most one project. Create issues directly inside the project, or pick or change the project from the issue's properties.
-The sidebar **Workspace → Projects** link always shows every project in the workspace; pinning is a personal shortcut on top of that.
+Project progress is computed automatically from linked issues:
-## Attaching resources
+```text
+progress = issues in done or cancelled ÷ all issues in the project
+```
-Each project has a **Resources** section where you attach GitHub repositories. Once attached, any [agent](/agents) assigned to issues in this project can read and write to those repos when executing tasks — Multica passes the repo URLs as context to the [daemon](/daemon-runtimes).
+`cancelled` means that work has been closed out of the project's scope, so it counts toward progress. Project status and issue status are independent: finishing every issue does not automatically set the project to `completed`, and changing the project's status does not bulk-change its issues.
-Resources are per-project; if multiple projects share a repo, attach it to each one.
+## Project description and execution context
-## Deleting a project
+When an agent runs an issue inside a project, the project's name and description are added to that run's context. The description is the place for information every related task needs: the goal, technical boundaries, delivery conventions. Requirements that apply to only one issue belong in that issue.
-Deleting a project **does not delete its issues**. The linked issues are simply unlinked and revert to the workspace's flat issue list. This is intentional — work that was scoped to a project is rarely throwaway, even when the framing of the project changes.
+## Add resources
-<Callout type="info">
-If you want to delete the work too, archive or delete the issues first, then delete the project.
-</Callout>
+Project resources tell agents which code and working directories to use:
+
+- **GitHub repositories**: provide a repo the runtime can check out, with an optional ref.
+- **Local directories**: let the runtime on a specific computer work in an existing directory, whose contents the agent modifies directly.
+
+See [Project resources](/project-resources) for how to choose and for the safety boundaries.
## Project lead
-The lead is the person — or agent — accountable for the project. It's a soft signal, not an access control: any workspace member can edit a project regardless of who's lead. A project's lead can be:
+The lead can be a member or an agent, and marks who coordinates the project. It is not a permission setting: it does not auto-assign the project's issues, and making an agent the lead does not automatically run it. Starting a run still takes an issue assignment, an @mention, or an automation trigger.
+
+## Pin to the sidebar
-- A workspace member (human teammate)
-- An [agent](/agents) — useful when the project's work is mostly delegated to an agent (e.g., "Weekly bug triage" led by a triage agent)
+A pinned project appears in your sidebar. Pinning is a personal preference and does not affect other members.
+
+## Create, edit, and delete
+
+Any workspace member can create and edit projects; only `owner` and `admin` can delete them.
+
+<Callout type="warning">
+Deleting a project does not delete its issues: they detach and stay in the workspace. The project's description, status, and resources are permanently deleted.
+</Callout>
-## Next
+## Next steps
-- [Issues](/issues) — the unit of work that lives inside projects
-- [Agents as project lead](/agents) — when an agent is the right owner
-- [How Multica works](/how-multica-works) — the broader picture
+- [Project resources](/project-resources) — link GitHub repositories or local directories.
+- [Issues](/issues) — create and organize the concrete work in a project.
+- [Agents](/agents) — learn about agent identity, configuration, and Access.
diff --git a/apps/docs/content/docs/projects.zh.mdx b/apps/docs/content/docs/projects.zh.mdx
index 68ce1aac6c..47365fb626 100644
--- a/apps/docs/content/docs/projects.zh.mdx
+++ b/apps/docs/content/docs/projects.zh.mdx
@@ -1,49 +1,71 @@
---
title: 项目
-description: 把相关的 issue 归为一组当成一个单元来跟进 —— 有优先级、状态、进度和负责人。
+description: 用项目组织相关 issue,并为它们提供共同的目标、计划和执行上下文。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica 里的**项目**(project)是相关 [issue](/issues) 的容器。当一摊工作比单个 issue 大、又比整个工作区小的时候用它 —— 一次发布、一次迁移、一个分多块做的功能、一个会拆出多个线索的调研。
+项目用来组织需要多条 [issue](/issues) 一起完成的工作,例如一次产品发布、一次迁移,或一个分阶段推进的功能。
-每个项目有名字、图标、描述、**负责人**(lead,可以是成员,也可以是 [智能体](/agents))、**状态**(`planned` / `in_progress` / `paused` / `completed` / `cancelled`)、**优先级**(`urgent` / `high` / `medium` / `low` / `none`),以及一个根据关联 issue 状态自动算出来的**进度**百分比。
+一条 issue 能说清的工作不需要项目。项目适合有共同目标、需要统一跟进进度,或需要共享仓库和工作目录的一组工作。
-## 项目和 issue 的关系
+## 项目的组成
-项目和 issue 是独立对象,多对一关系:一个 issue **最多属于一个**项目;一个项目可以容纳**任意多个** issue。关联和解除关联随时可逆 —— 在看板视图里拖动,或者在 issue 右侧 properties 面板用项目选择器。
+| 内容 | 用途 |
+|---|---|
+| **名称、图标和描述** | 目标、范围和长期有效的要求;描述会进入项目内智能体的执行上下文。 |
+| **状态** | `planned`、`in_progress`、`paused`、`completed` 或 `cancelled`。 |
+| **优先级** | `urgent`、`high`、`medium`、`low` 或 `none`。 |
+| **负责人(lead)** | 成员或智能体,表示谁负责协调项目。 |
+| **开始和截止日期** | 项目计划的时间范围。 |
+| **Issue 和进度** | 项目中的工作及其完成比例。 |
+| **资源** | 关联的 GitHub 仓库或指定电脑上的本地目录。 |
-项目的进度条是按关联 issue 状态自动算出来的 —— 越多 issue 到 `done`,进度条越满。`cancelled` 的 issue 不计入分母;`backlog` 的 issue 计入分母但不计入分子。
+![项目详情:按状态分列的 issue、进度与项目描述](/images/docs/project-detail.png)
-## pin 到侧边栏
+## 项目和 issue 的关系
-点项目右上角的 pin 图标,可以把这个项目加到侧边栏的固定区。pin 过的项目无论你在工作区哪里都一键可达;每个人独立 pin —— pin 是个人偏好。
+一个项目可以包含多条 issue,一条 issue 最多属于一个项目。可以在项目中直接创建 issue,也可以在 issue 属性中选择或更换项目。
-侧边栏 **Workspace → Projects** 链接始终展示工作区里所有项目;pin 只是在这之上的个人快捷方式。
+项目进度按关联 issue 自动计算:
-## 关联 resources
+```text
+进度 = 状态为 done 或 cancelled 的 issue 数 ÷ 项目中的全部 issue 数
+```
-每个项目有一个 **Resources** 区,可以挂 GitHub 仓库。挂上之后,被分配到这个项目里 issue 的 [智能体](/agents) 在执行 task 时可以读写这些仓库 —— Multica 会把仓库 URL 作为上下文传给 [守护进程](/daemon-runtimes)。
+`cancelled` 表示这项工作已从项目范围中结束,因此计入进度。项目状态与 issue 状态彼此独立:所有 issue 完成后项目不会自动变为 `completed`,修改项目状态也不会批量修改其中的 issue。
-Resources 是项目级别的;多个项目要共享同一个仓库,要分别挂上。
+## 项目描述与执行上下文
-## 删除项目
+智能体执行项目内的 issue 时,项目名称和描述会加入本次执行的上下文。描述适合保存所有相关任务都需要的信息:目标、技术边界、交付约定。只与单条 issue 相关的要求写在该 issue 中。
-删除项目**不会**删除它的 issue。关联的 issue 只是解除关联,回到工作区的扁平 issue 列表。这是刻意的 —— 即使项目本身的框架变了,里面的工作通常也不会是一次性的。
+## 添加资源
-<Callout type="info">
-如果你确实想把工作也删掉,先归档或删除 issue,再删除项目。
-</Callout>
+项目资源告诉智能体使用哪些代码和工作目录:
+
+- **GitHub 仓库**:提供可 checkout 的仓库和可选 ref。
+- **本地目录**:让指定电脑上的运行时在已有目录中工作,目录内容会被智能体直接修改。
+
+具体选择和安全边界见[项目资源](/project-resources)。
## 项目负责人
-负责人是为这个项目负总责的人 —— 或者智能体。这是一个软信号,不是权限控制:工作区任何成员都可以编辑项目,不管谁是负责人。项目负责人可以是:
+Lead 可以是成员或智能体,表示谁负责协调项目。它不是权限设置,不会自动分配项目中的 issue;把智能体设为 lead 也不会自动运行它。启动执行仍需分配 issue、@提及或自动化触发。
-- 工作区里的成员(人)
-- [智能体](/agents) —— 当项目里的工作大部分要交给智能体时合适(例如"每周 bug 巡检"由一个巡检智能体担任 lead)
+## 固定到侧边栏
+
+固定后,项目出现在你的侧边栏中。固定是个人偏好,不影响其他成员。
+
+## 创建、编辑和删除
+
+工作区成员都可以创建和编辑项目;只有 `owner` 和 `admin` 可以删除。
+
+<Callout type="warning">
+删除项目不会删除其中的 issue:它们解除关联后继续保留在工作区;项目的描述、状态和资源会被永久删除。
+</Callout>
-## 下一步
+## 接下来
-- [Issues](/issues) —— 项目里装的工作单元
-- [智能体担任项目负责人](/agents) —— 什么时候由智能体当 lead 合适
-- [Multica 怎么运转](/how-multica-works) —— 整体视图
+- [项目资源](/project-resources) — 关联 GitHub 仓库或本地目录。
+- [Issues](/issues) — 创建和组织项目中的具体工作。
+- [智能体](/agents) — 了解智能体身份、配置和 Access。
diff --git a/apps/docs/content/docs/providers.ja.mdx b/apps/docs/content/docs/providers.ja.mdx
index 320e1c0c7c..a90187d0e5 100644
--- a/apps/docs/content/docs/providers.ja.mdx
+++ b/apps/docs/content/docs/providers.ja.mdx
@@ -1,155 +1,87 @@
---
-title: AI コーディングツール対応表
-description: Multica は 16 個の AI コーディングツールをサポートしています。すべて同じインターフェースを実装していますが、機能の詳細は大きく異なります。
+title: AI コーディングツール比較
+description: Multica が対応する AI コーディングツールと、モデル、MCP、セッション、スキルの違いを比較します。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica は **16 個の AI コーディングツール**を標準でサポートしています。これらはすべて同じインターフェース(キューへの投入、ディスパッチ、実行、結果の返却)を実装しているため、同じ Multica ボードからどれでも動かすことができます。**しかし機能の詳細は大きく異なります**: セッション再開が実際に動作するか、MCP をサポートするか、スキルファイルがどこに置かれるか、モデルをどう選択するか。このページがその完全な対応表です。
+Multica は、普段使っている AI コーディングツールの代わりになるものではありません。ランタイムがコンピューターにインストール済みでログイン済みのツールを呼び出し、実行の進捗と結果をイシューに書き戻します。
-エージェントを作成するときにツールを選ぶ際のガイダンスは、[エージェントの作成と構成](/agents-create)を参照してください。
+すでにいずれかのツールを使っている場合は、通常そのまま使い続けられます。ツールを選ぶときは、次の 4 点を確認してください。
-## 機能対応マトリクス
+- コンピューターにすでにインストールされているか
+- アカウントでどのモデルを利用できるか
+- Multica から MCP を設定する必要があるか
+- チームでどのスキルを再利用したいか
-| ツール | ベンダー | セッション再開 | MCP | スキル注入パス | モデル選択 |
-|---|---|---|---|---|---|
-| **Antigravity** | Google | ✅ (`--conversation <id>`) | ❌ | `.agents/skills/` | 動的探索(`agy models`) |
-| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | 静的 + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | 動的探索 |
-| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | 静的 |
-| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | 静的(アカウントの権限で決定) |
-| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | 動的探索 |
-| **Hermes** | Nous Research | ✅ | ✅ | `HERMES_HOME/skills/`(タスクごとのホーム) | 動的探索 |
-| **Kimi** | Moonshot | ✅ | ✅ | `.kimi/skills/` | 動的探索 |
-| **Kiro CLI** | Amazon | ✅ | ✅ | `.kiro/skills/` | 動的探索 |
-| **OpenCode** | SST | ✅ | ✅ | `.opencode/skills/` | 動的探索 + variant |
-| **DevEco Code** | Huawei(ファーウェイ) | ✅ | ❌ | `.deveco/skills/` | 動的探索(`deveco models`) |
-| **OpenClaw** | オープンソース | ✅ | ✅ | `.agent_context/skills/`(フォールバック) | エージェントにバインドされ、タスクごとに切り替え不可 |
-| **Pi** | Inflection AI | ✅(セッションがファイルパス) | ❌ | `.pi/skills/` | 動的探索 |
-| **Qoder** | Alibaba | ✅ | ✅ | `.qoder/skills/` | 動的探索 |
-| **Trae CLI** | ByteDance | ✅(ACP `session/load`) | ✅ | `.traecli/skills/` | 動的探索 |
-| **Grok** | xAI | ✅(ACP `session/load`) | ✅ | `.grok/skills/` | 動的探索(ACP `session/new`) |
+インストール方法は [AI コーディングツールをインストールする](/install-agent-runtime)を参照してください。
-## 各ツールの用途
+## 対応ツール
-### Antigravity
+| ツール | 検出コマンド | セッション再開 | Multica による MCP 管理 | スキルの注入先 |
+|---|---|---:|---:|---|
+| Antigravity | `agy` | ✓ | — | `.agents/skills/` |
+| Claude Code | `claude` | ✓ | ✓ | `.claude/skills/` |
+| CodeBuddy | `codebuddy` | ✓ | ✓ | `.codebuddy/skills/` |
+| Codex | `codex` | ✓ | ✓ | `$CODEX_HOME/skills/` |
+| GitHub Copilot CLI | `copilot` | ✓ | — | `.github/skills/` |
+| Cursor Agent | `cursor-agent` | ✓ | ✓ | `.cursor/skills/` |
+| DevEco Code | `deveco` | ✓ | — | `.deveco/skills/` |
+| Grok | `grok` | ✓ | ✓ | `.grok/skills/` |
+| Hermes | `hermes` | ✓ | ✓ | 1 回の実行専用の `HERMES_HOME/skills/` |
+| Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` |
+| Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |
+| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
+| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
+| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
+| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
+| Trae CLI | `traecli` | ✓ | ✓ | `.traecli/skills/` |
-Google が提供します。CLI バイナリ名は `agy` です。Google の Antigravity サービスと連携し、Gemini ベースのデフォルトモデルが付属しています。**セッション再開が動作します** — `--conversation <id>` を通じて行われ、stdout が構造化されたイベントストリームではなくプレーンテキストであるため、デーモンが CLI のログファイルから conversation UUID をキャプチャします。**モデル選択が動作します** — `--model` flag(agy 1.0.6 で追加)を通じて行われ、デーモンが `agy models` でカタログを列挙し、選択された値をそのまま渡します。これらは `provider/model` slug ではなく `Claude Opus 4.6 (Thinking)` のような人間が読める表示名である点に注意してください。また agy は認識できない値を渡すと黙って空実行するため、手入力ではなく検出されたリストから選ぶことをおすすめします。スキルは `.agents/skills/` に配置されます(CLI が Gemini CLI のワークスペーススキルレイアウトをそのまま継承します — [Antigravity 移行ドキュメント](https://antigravity.google/docs/gcli-migration)を参照)。
+「Multica による MCP 管理」とは、エージェント設定に MCP server を入力し、Multica が実行前にその設定を対応ツールへ渡せることを意味します。そのツールにほかの MCP 設定方法がない、という意味ではありません。
-### Claude Code
+## モデルの取得元
-Anthropic が提供します。**新規ユーザーにとって第一の選択肢**であり、最も完成度の高い機能セットを備えています: セッション再開が実際に動作し、MCP 構成を読み取り、`--max-turns` や `--append-system-prompt` のような細かな調整 flag をサポートします。Anthropic API キーが必要です。
+エージェントを作成するとき、モデル一覧は対応するランタイムから取得されます。固定されたモデル名を提供するツールもあれば、ローカル設定、ログイン中のアカウント、サブスクリプションに応じて利用可能なモデルを返すツールもあります。
-### CodeBuddy
+モデルを選択しない場合、Multica はそのツールのデフォルト設定を使用します。一覧が空の場合は、ランタイムがオンラインでツールにログイン済みであることを確認してから、モデル一覧を更新してください。
-Tencent が提供します。Claude Code 互換の CLI エージェントです — Multica は Claude Code と同じ stream-json プロトコルで駆動するため、セッション再開が動作し(`--resume` 経由)、MCP 構成は `--mcp-config` で渡されます。CodeBuddy は Claude のディレクトリを再利用せず独自の設定ディレクトリを使うため、スキルは `.codebuddy/skills/` に配置され、ランタイムのブリーフは `CODEBUDDY.md` に書き込まれます。モデルは動的に探索されます。
-
-### Codex
-
-OpenAI が提供します。JSON-RPC 2.0 を使用し、ステートフルな能力がより強く、よりきめ細かい承認メカニズム(`exec_command` および `patch_apply` に対する手動承認)を備えています。MCP 構成はタスクごとの `$CODEX_HOME/config.toml` に書き込まれます。**セッション再開は動作します** — Multica は Codex app-server の `thread/resume` で再開します。保存済み thread が見つからない、または古い場合は、新しい thread にフォールバックしてタスクを続行します。
-
-### Copilot
-
-GitHub が提供します。モデルルーティングは GitHub アカウントの権限を経由します — ツールが直接モデルを選択するのではなく、GitHub がどのモデルを提供するかを決定します。`.github/skills/` にスキルを置くのは GitHub CLI のネイティブな探索メカニズムです。
-
-### Cursor
-
-Anysphere が提供し、Cursor エディターに対応する CLI です。**セッション再開は動作します** — 現在の Cursor Agent の stream-json イベントには `session_id` が含まれ、Multica は次回実行時に `--resume <id>` でそれを渡します。MCP 構成はタスクワークスペースの `.cursor/mcp.json` に書き込まれ、Cursor のプロジェクト approval ファイルはタスクごとの `CURSOR_DATA_DIR` 配下に置かれるため、管理対象 MCP server はユーザーのグローバル Cursor approvals に依存しません。
-
-### Hermes
-
-Nous Research が提供します。ACP プロトコルを使用します(Kimi とトランスポート層を共有します)。セッション再開が動作し、MCP 構成は ACP `mcpServers` として渡されます。Hermes はスキルを自身のホームディレクトリ(`~/.hermes/skills/`)と設定済みの `skills.external_dirs` からのみ探索し、ワークスペース相対の探索は行いません。そのため、**エージェントにスキルが割り当てられている場合のみ**、Multica は `HERMES_HOME` をユーザーの `~/.hermes/` のタスクごとオーバーレイに向けます。実ホームはシンボリックリンクでミラーされ(auth/シークレットも含むためトークン更新が伝播します)、派生した `config.yaml` が既存スキルを読み取り専用の external root として参照し、割り当てられたスキルだけがその `skills/` ディレクトリに書き込まれて優先されます。グローバルスキルはそのまま機能します。Multica は共有の `~/.hermes/` を直接書き換えず、読み取ってリンクするだけですが、Hermes 自身がミラーされたシンボリックリンク経由で書き込む場合(トークン更新など)は伝播します。`custom_args` の `-p`/`--profile` 指定は尊重されます。オーバーレイはその profile のホームからシードされ、フラグは起動コマンドから消費されるため、オーバーレイを迂回できません。タスクの記憶はタスクごとに隔離されます。新しい `memories/` ディレクトリに加え、派生設定で外部 `memory.provider` バックエンドを無効化するので、ディスク上のメモも共有の Supermemory/Hindsight 的バンクもタスク間で共有されません(マネージドで agent スコープの記憶バックエンドは今後の別課題です)。SQLite の `state.db` セッションストアとジャーナルファイルもタスクローカルで、Hermes がオーバーレイ内に作成します。ホストの会話履歴はリンクもコピーもされず、Windows で稼働中の WAL ロックがセットアップを妨げることもありません。スキルが割り当てられていない Hermes タスクは実ホームのまま変わりません。なお home のプラットフォーム既定はネイティブ Windows では `%LOCALAPPDATA%\hermes` です。
-
-**Hermes profile を選択する。** 特定の profile で Hermes を起動するには、エージェントの `custom_args` に profile フラグと profile 名を 2 つの独立したエントリとして設定します。たとえば `research` という profile を使う場合:
-
-```json
-["-p", "research"]
-```
-
-`"-p research"` のように 1 つの文字列へまとめないでください。Multica は配列の各要素を 1 つの argv エントリとしてツールへ渡します。`custom_args` はエージェントごとに設定します — [エージェントの作成と構成](/agents-create)を参照してください。
-
-### Kimi
-
-Moonshot が提供し、中国市場を対象としています。Hermes と ACP プロトコルを共有し、MCP 構成も ACP `mcpServers` として渡されますが、スキルパス `.kimi/skills/` は Kimi CLI のネイティブな探索メカニズムであり、Hermes のフォールバックとは異なります。
-
-### Kiro CLI
-
-Amazon が提供します。`kiro-cli acp` を通じて stdio 上で ACP を使用します。セッション再開は ACP `session/load` で動作し、MCP 構成は ACP `mcpServers` として渡され、モデル選択は `session/set_model` で動作し、スキルはプロジェクトレベルのネイティブ探索のために `.kiro/skills/` にコピーされます。
-
-### OpenCode
-
-SST が提供するオープンソースです。利用可能なモデルと model variant を動的に探索します(CLI の構成ファイルをスキャン)。セッション再開が動作し、エージェントの `mcp_config` フィールドを消費します。Multica は `OPENCODE_CONFIG_CONTENT` 環境変数でインライン注入するため、エージェントの MCP server はタスク workdir の `opencode.json`(エージェントまたはユーザーが所有するファイル)を書き換えずに OpenCode に届きます。モデルが variant を公開している場合、Multica はそれをエージェントの thinking selector として表示し、選択値を `opencode run --variant` で OpenCode に渡します。**自分のモデルカタログをカスタマイズしたい、いじるのが好きなユーザーに適しています。**
-
-### DevEco Code
-
-**DevEco Code** は Huawei(ファーウェイ)の HarmonyOS 開発向け独立コーディングエージェント(`deveco` CLI、[gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code))です。OpenCode エンジンをベースにしつつ、単体で完成した成熟製品として提供され、独自のモデルカタログと provider(内蔵 `deveco/GLM-5.1`)、Huawei アカウント認証、専用の設定・スキル体系(`~/.config/deveco/` と `.deveco/skills/`)を備えます。Multica は `deveco run --format json` で駆動し、NDJSON イベントストリームをパースします。**セッション再開が動作します**(`--session <id>` 経由)。モデルは `deveco models` から動的に探索され、システムコンテキストはタスクごとの `AGENTS.md` で渡されます。MCP サーバーは DevEco ネイティブの `DEVECO_CONFIG_CONTENT` チャネルで設定します。Multica 側の `mcp_config` 連携は開発中のため、現時点では DevEco エージェントの MCP タブは非表示になります。認証は `deveco auth login`(Huawei アカウント)で行います。
-
-### OpenClaw
-
-オープンソースプロジェクトであり、CLI エージェントオーケストレーターです。MCP 構成は Multica のタスクごとの config wrapper 経由で書き込まれます。**モデルはエージェント層にバインドされます**(`openclaw agents add --model`) — タスクごとに上書きできません。構成は厳格に制御されます: ユーザーは `--model` や `--system-prompt` を渡せず、エージェント登録時の構成が決定します。
+<Callout type="info">
+ツールによってモデル名が異なることがあります。AI コーディングツールを変更すると、以前のモデル値は新しいツールで使えないため、選び直す必要があります。
+</Callout>
-### Pi
+## セッション再開
-Inflection AI が提供し、ミニマルです。**セッション再開の方式が独特です** — セッション ID が文字列 ID ではなく、ディスク上のファイルパス(`~/.pi/...`)です。他のツールでは再開 id は CLI が返す文字列ですが、Pi では再開 id はセッションファイルそのものです。
+上記のツールはすべて、後続の実行で既存のセッションを続行できます。ただし、元のセッションが残っており、そのセッションへアクセスできるランタイムでタスクが実行される必要があります。
-### Qoder
+Multica はツールから返されたセッション識別子を保存します。次に同じイシューで作業を続けるとき、ランタイムはそのセッションの再開を試みます。再開できない場合は、新しいセッションを作成して実行を続けます。Pi はローカルのセッションファイルパスを保存するため、元のコンピューターとファイルへの依存度が高くなります。
-Alibaba が提供します。エージェント型のコーディング CLI です。stdio 上で ACP プロトコルを使用します(Hermes、Kimi、Kiro CLI とトランスポートを共有します)。セッション再開は ACP `session/resume` を通じて動作し、MCP 構成は ACP `mcpServers` として渡され、モデル選択は動的に探索され、スキルはネイティブ探索のために `.qoder/skills/` にコピーされます。
+再試行とセッション再開のルールは、[タスク](/tasks#手動リトライ)を参照してください。
-### Trae
+## MCP 設定
-ByteDance 公式の TRAE CLI(`traecli`、Trae IDE と組み合わせて使う製品で、オープンソースの `bytedance/trae-agent` ではありません)です。ACP ネイティブのため、Multica は `traecli acp serve --yolo` で stdio 経由で駆動します。Kiro や Qoder と同じトランスポートです。セッション再開は ACP `session/load` で動作し、MCP 構成は ACP `mcpServers` として渡され、モデルは動的に探索されて `session/set_model` でタスクごとに切り替えられます。スキルは `.traecli/skills/` にコピーされます。
+Antigravity、GitHub Copilot CLI、DevEco Code、Pi は、現時点ではエージェントの MCP 設定を読み取りません。そのため、これらのツールを選んだ場合、エージェント作成画面にこの項目は表示されません。
-### Grok
+<Callout type="warning">
+MCP server のコマンド、引数、環境変数は、エージェント設定の一部としてサーバーに保存されます。共有する必要がないローカルの認証情報を設定へ直接入力しないでください。
+</Callout>
-xAI の Grok Build CLI(`grok`)です。Multica は `grok --no-auto-update agent --always-approve stdio` で ACP 接続します。`initialize` の応答後、CLI が提示した方式から `xai.api_key`(`XAI_API_KEY` 設定時に優先)または `cached_token` を選び、`authenticate` の成功を待ってからセッションを作成または読み込みます。利用可能な方式がなければ明示的に失敗します。セッション再開は ACP `session/load`、モデルは `session/new` から動的に探索して `session/set_model` で切り替えます。`grok-4.5` の reasoning effort は公式対応の `low`、`medium`、`high` のみです。MCP 構成は ACP `mcpServers` で渡されます。スキルは `.grok/skills/` に書き込まれ、ユーザースキルは `$GROK_HOME/skills/`(既定 `~/.grok/skills/`)と共通の `~/.agents/skills/` から探索されます。
+## スキルの注入方法
-## セッション再開: 実際にサポートするツール
+実行を開始する前に、Multica はエージェントに紐づいたスキルを上表の場所へ書き込み、各ツールが標準の仕組みで検出できるようにします。
-セッション再開のメカニズムは[タスク](/tasks#can-a-task-continue-from-the-previous-context)で扱います。**サポートされているすべてのツールがセッションを再開できます** — 再開 id を渡すと、タスクは以前のコンテキストから続行します。唯一の例外は Pi で、再開 id が文字列 ID ではなくディスク上のセッションファイルへのパスです(上記の [Pi](#pi) を参照)。
+リポジトリにすでにあるスキルは上書きしません。同名のスキルがある場合、Multica は注入するコピーに別のディレクトリ名を使い、実行後には自分で作成したファイルだけを削除します。
-## MCP 構成: ツールごとの対応
+Codex、Hermes、OpenClaw の動作は少し異なります。
-**16 個のツールのうち、`mcp_config` を実際に消費するのは 12 個です: Claude Code、CodeBuddy、Codex、Cursor、Hermes、Kimi、Kiro CLI、OpenCode、OpenClaw、Qoder、Trae CLI、Grok**。残りの 4 個(Antigravity、Copilot、DevEco Code、Pi)はこのフィールドを受け取りますが、**無視します** — エラーも警告もなく、構成はただ効果を発揮しません。
+- Codex は実行ごとに専用の `CODEX_HOME` を使い、システム全体の Codex ディレクトリにはスキルを書き込みません。
+- Hermes は実行ごとに専用の `HERMES_HOME` を使います。既存のローカル設定は読み取れますが、紐づけたスキルとセッションデータはタスクごとに分離されます。この分離はエージェントにスキルが紐づいている場合だけ有効になり、スキルがないタスクでは既存の Hermes ホームディレクトリを使います。
+- OpenClaw は現在のタスクの作業ディレクトリにある `skills/` を使い、実行専用の設定でそのディレクトリをワークスペースとして指定します。
-接続方式はツールごとに異なります: Claude Code と CodeBuddy は `--mcp-config` と `--strict-mcp-config` で受け取り、Codex は daemon 管理の `mcp_servers` ブロックをタスクごとの `$CODEX_HOME/config.toml` に書き込み、Cursor は `.cursor/mcp.json` とタスクごとの `CURSOR_DATA_DIR` 配下のプロジェクト approval を書き込みます。Hermes、Kimi、Kiro CLI、Qoder、Trae CLI、Grok は ACP `mcpServers` で受け取ります。OpenCode は `OPENCODE_CONFIG_CONTENT` 環境変数でインライン構成を受け取り、OpenClaw は Multica のタスクごとの config wrapper 経由で `mcp.servers` を受け取ります。OpenCode の経路はプロジェクトの `opencode.json` を書き換えません。
+スキルの作成と紐づけについては、[スキル](/skills)を参照してください。
-<Callout type="warning">
-エージェント構成で `mcp_config` を設定しても、MCP 列に ✅ がないツールを選んだ場合、MCP サーバーはそのエージェントに**何の効果**も及ぼしません。MCP 連携はツールごとに実装されています。
-</Callout>
+## 次のステップ
-## スキルファイルが置かれる場所
-
-各ツールは**それぞれ独自の**スキル探索パスを使用します。タスクが実行される前に、Multica デーモンがワークスペースのスキルファイルを対応するパスにコピーします。
-
-| ツール | パス | ネイティブ探索か |
-|---|---|---|
-| Claude Code | `.claude/skills/` | ✅ ネイティブ |
-| CodeBuddy | `.codebuddy/skills/` | ✅ ネイティブ |
-| Codex | `$CODEX_HOME/skills/` | ✅ ネイティブ |
-| Copilot | `.github/skills/` | ✅ ネイティブ |
-| Cursor | `.cursor/skills/` | ✅ ネイティブ |
-| Kimi | `.kimi/skills/` | ✅ ネイティブ |
-| Kiro CLI | `.kiro/skills/` | ✅ ネイティブ |
-| OpenCode | `.opencode/skills/` | ✅ ネイティブ |
-| DevEco Code | `.deveco/skills/` | ✅ ネイティブ |
-| Pi | `.pi/skills/` | ✅ ネイティブ |
-| Qoder | `.qoder/skills/` | ✅ ネイティブ |
-| Trae CLI | `.traecli/skills/` | ✅ ネイティブ |
-| Grok | `.grok/skills/` | ✅ ネイティブ |
-| Antigravity | `.agents/skills/` | ✅ ネイティブ(Gemini CLI のワークスペースレイアウトを継承 — [Antigravity ドキュメント](https://antigravity.google/docs/gcli-migration)を参照) |
-| Hermes | `HERMES_HOME/skills/`(タスクごとのホーム) | ✅ ネイティブ(タスクごとに `~/.hermes/` からシード) |
-| OpenClaw | `.agent_context/skills/` | ⚠️ 汎用フォールバック |
-
-フォールバックパスを使うツールが実際にこのディレクトリを読み取るかどうかは、そのツール自体のドキュメントによって異なり、保証されません。OpenClaw でスキルが適用されない場合は、まずこの点を確認してください。
-
-ネイティブなプロジェクトレベルのパスでは、リポジトリスコープの探索は想定された挙動です。チェックアウトされたリポジトリが対応するディレクトリをすでに含んでいる場合、基盤となるツールはそのコミット済みスキルを自分で検出できます。そのリポジトリで使うためだけに、これらの repo skills を Multica へインポートする必要はありません。Multica はそれらのリポジトリファイルをそのまま保持します。ワークスペーススキルの自然なディレクトリ名が同じ場合、デーモンは `review-helper-multica` のような衝突しない兄弟ディレクトリへワークスペースコピーを書き込みます。
-
-スキルの作成と使用については、[スキル](/skills)を参照してください。
-
-## 次へ
-
-- [エージェントの作成と構成](/agents-create) — エージェントに使うツールを選ぶ
-- [タスク](/tasks) — タスクのライフサイクルとセッション再開のメカニズム
-- [デーモンとランタイム](/daemon-runtimes) — ツールが実行される場所と Multica への接続方法
-- [エージェントランタイムのインストール](/install-agent-runtime) — サポートされる 16 個のツールそれぞれのインストールと認証
+- [エージェントを作成・設定する](/agents-create) — モデルと thinking level の設定
+- [AI コーディングツールをインストールする](/install-agent-runtime) — インストールと検出の手順
+- [デーモンとランタイム](/daemon-runtimes) — ランタイムの登録と同時実行
diff --git a/apps/docs/content/docs/providers.ko.mdx b/apps/docs/content/docs/providers.ko.mdx
index 782128f4d8..cf2000c237 100644
--- a/apps/docs/content/docs/providers.ko.mdx
+++ b/apps/docs/content/docs/providers.ko.mdx
@@ -1,155 +1,87 @@
---
-title: AI 코딩 도구 대조표
-description: Multica는 16개의 AI 코딩 도구를 지원합니다. 모두 동일한 인터페이스를 구현하지만, 기능 세부사항은 크게 다릅니다.
+title: AI 코딩 도구 비교
+description: Multica가 지원하는 AI 코딩 도구와 모델, MCP, 세션, 스킬의 차이를 비교합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica는 **16개의 AI 코딩 도구**를 기본 지원합니다. 이들은 모두 동일한 인터페이스(대기열 적재, 디스패치, 실행, 결과 반환)를 구현하므로, 같은 Multica 보드에서 어느 것이든 구동할 수 있습니다. **하지만 기능 세부사항은 크게 다릅니다**: 세션 재개가 실제로 동작하는지, MCP를 지원하는지, 스킬 파일이 어디에 위치하는지, 모델을 어떻게 선택하는지. 이 페이지가 전체 대조표입니다.
+Multica는 사용 중인 AI 코딩 도구를 대체하지 않습니다. 런타임이 컴퓨터에 이미 설치되어 로그인된 도구를 호출하고 실행 진행 상황과 결과를 이슈에 기록합니다.
-에이전트를 생성할 때 도구를 고르는 방법은 [에이전트 생성 및 구성](/agents-create)을 참고하세요.
+이미 사용 중인 도구가 있다면 보통 그대로 사용할 수 있습니다. 도구를 선택할 때는 다음 네 가지를 판단하세요.
-## 기능 대조 매트릭스
+- 컴퓨터에 이미 설치되어 있는가
+- 계정에서 어떤 모델을 사용할 수 있는가
+- Multica가 MCP를 설정해야 하는가
+- 팀에서 어떤 스킬을 재사용해야 하는가
-| 도구 | 공급사 | 세션 재개 | MCP | 스킬 주입 경로 | 모델 선택 |
-|---|---|---|---|---|---|
-| **Antigravity** | Google | ✅ (`--conversation <id>`) | ❌ | `.agents/skills/` | 동적 탐색(`agy models`) |
-| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | 정적 + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | 동적 탐색 |
-| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | 정적 |
-| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | 정적 (계정 권한으로 결정) |
-| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | 동적 탐색 |
-| **Hermes** | Nous Research | ✅ | ✅ | `HERMES_HOME/skills/` (작업별 홈) | 동적 탐색 |
-| **Kimi** | Moonshot | ✅ | ✅ | `.kimi/skills/` | 동적 탐색 |
-| **Kiro CLI** | Amazon | ✅ | ✅ | `.kiro/skills/` | 동적 탐색 |
-| **OpenCode** | SST | ✅ | ✅ | `.opencode/skills/` | 동적 탐색 + variant |
-| **DevEco Code** | Huawei(화웨이) | ✅ | ❌ | `.deveco/skills/` | 동적 탐색(`deveco models`) |
-| **OpenClaw** | 오픈소스 | ✅ | ✅ | `.agent_context/skills/` (fallback) | 에이전트에 바인딩되어 작업마다 전환 불가 |
-| **Pi** | Inflection AI | ✅ (세션이 파일 경로) | ❌ | `.pi/skills/` | 동적 탐색 |
-| **Qoder** | Alibaba | ✅ | ✅ | `.qoder/skills/` | 동적 탐색 |
-| **Trae CLI** | ByteDance | ✅ (ACP `session/load`) | ✅ | `.traecli/skills/` | 동적 탐색 |
-| **Grok** | xAI | ✅ (ACP `session/load`) | ✅ | `.grok/skills/` | 동적 탐색(ACP `session/new`) |
+설치 방법은 [AI 코딩 도구 설치](/install-agent-runtime)를 참고하세요.
-## 각 도구의 용도
+## 지원 도구
-### Antigravity
+| 도구 | 감지 명령 | 세션 복원 | Multica의 MCP 관리 | 스킬 주입 위치 |
+|---|---|---:|---:|---|
+| Antigravity | `agy` | ✓ | — | `.agents/skills/` |
+| Claude Code | `claude` | ✓ | ✓ | `.claude/skills/` |
+| CodeBuddy | `codebuddy` | ✓ | ✓ | `.codebuddy/skills/` |
+| Codex | `codex` | ✓ | ✓ | `$CODEX_HOME/skills/` |
+| GitHub Copilot CLI | `copilot` | ✓ | — | `.github/skills/` |
+| Cursor Agent | `cursor-agent` | ✓ | ✓ | `.cursor/skills/` |
+| DevEco Code | `deveco` | ✓ | — | `.deveco/skills/` |
+| Grok | `grok` | ✓ | ✓ | `.grok/skills/` |
+| Hermes | `hermes` | ✓ | ✓ | 실행별 `HERMES_HOME/skills/` |
+| Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` |
+| Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |
+| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
+| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
+| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
+| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
+| Trae CLI | `traecli` | ✓ | ✓ | `.traecli/skills/` |
-Google에서 제공합니다. CLI 바이너리 이름은 `agy`입니다. Google의 Antigravity 서비스와 연동되며 Gemini 기반의 기본 모델을 함께 제공합니다. **세션 재개가 동작합니다** — `--conversation <id>`를 통해서이며, stdout이 구조화된 이벤트 스트림이 아니라 일반 텍스트이기 때문에 데몬이 CLI의 로그 파일에서 conversation UUID를 캡처합니다. **모델 선택이 동작합니다** — `--model` flag(agy 1.0.6에서 추가)를 통해서이며, 데몬이 `agy models`로 카탈로그를 열거하고 선택된 값을 그대로 전달합니다. 이 값들은 `provider/model` slug가 아니라 `Claude Opus 4.6 (Thinking)` 같은 사람이 읽는 표시 이름이라는 점에 유의하세요. 또한 agy는 인식할 수 없는 값을 받으면 조용히 빈 실행을 하므로, 직접 입력하기보다 발견된 목록에서 선택하는 것을 권장합니다. 스킬은 `.agents/skills/`에 들어갑니다(CLI가 Gemini CLI의 워크스페이스 스킬 레이아웃을 그대로 따릅니다 — [Antigravity 마이그레이션 문서](https://antigravity.google/docs/gcli-migration) 참고).
+"Multica의 MCP 관리"는 에이전트 설정에 MCP server를 입력하면 Multica가 실행 전에 해당 도구로 전달할 수 있다는 뜻입니다. 도구 자체에 다른 MCP 설정 방법이 없다는 뜻은 아닙니다.
-### Claude Code
+## 모델 출처
-Anthropic에서 제공합니다. **신규 사용자에게 첫 번째 선택지**이며, 가장 완전한 기능 세트를 갖추고 있습니다: 세션 재개가 실제로 동작하고, MCP 구성을 읽으며, `--max-turns`와 `--append-system-prompt` 같은 세부 조정 flag를 지원합니다. Anthropic API 키가 필요합니다.
+에이전트를 만들 때 모델 목록은 해당 런타임에서 가져옵니다. 일부 도구는 고정된 모델 이름을 제공하고, 일부는 로컬 설정, 로그인 계정, 구독 권한에 따라 사용 가능한 모델을 반환합니다.
-### CodeBuddy
+모델을 선택하지 않으면 Multica가 해당 도구의 기본 설정을 사용합니다. 목록이 비어 있다면 런타임이 온라인이고 도구에 로그인되어 있는지 확인한 뒤 모델 목록을 새로 고치세요.
-Tencent에서 제공합니다. Claude Code 호환 CLI 에이전트입니다 — Multica는 Claude Code와 동일한 stream-json 프로토콜로 구동하므로 세션 재개가 동작하고(`--resume` 경유), MCP 구성은 `--mcp-config`로 전달됩니다. CodeBuddy는 Claude의 디렉터리를 재사용하지 않고 자체 설정 디렉터리를 사용하므로, 스킬은 `.codebuddy/skills/`에 배치되고 런타임 브리핑은 `CODEBUDDY.md`에 기록됩니다. 모델은 동적으로 탐색됩니다.
-
-### Codex
-
-OpenAI에서 제공합니다. JSON-RPC 2.0을 사용하고, 상태 유지 능력이 더 강하며, 더 세밀한 승인 메커니즘(`exec_command` 및 `patch_apply`에 대한 수동 승인)을 갖추고 있습니다. MCP 구성은 작업별 `$CODEX_HOME/config.toml`에 기록됩니다. **세션 재개가 동작합니다** — Multica는 Codex app-server의 `thread/resume`으로 재개합니다. 저장된 thread가 없거나 오래된 경우에는 새 thread로 폴백해 작업을 계속 실행합니다.
-
-### Copilot
-
-GitHub에서 제공합니다. 모델 라우팅은 GitHub 계정 권한을 거칩니다 — 도구가 직접 모델을 선택하지 않고, GitHub가 어떤 모델을 제공할지 결정합니다. `.github/skills/`에 스킬을 두는 것은 GitHub CLI의 기본 탐색 메커니즘입니다.
-
-### Cursor
-
-Anysphere에서 제공하며, Cursor 에디터에 대응하는 CLI입니다. **세션 재개가 동작합니다** — 현재 Cursor Agent의 stream-json 이벤트에는 `session_id`가 포함되며, Multica는 다음 실행 때 이를 `--resume <id>`로 다시 전달합니다. MCP 구성은 작업 워크스페이스의 `.cursor/mcp.json`에 기록되고, Cursor의 프로젝트 approval 파일은 작업별 `CURSOR_DATA_DIR` 아래에 기록되므로, 관리되는 MCP 서버는 사용자의 전역 Cursor approval에 의존하지 않습니다.
-
-### Hermes
-
-Nous Research에서 제공합니다. ACP 프로토콜을 사용합니다(Kimi와 전송 계층을 공유합니다). 세션 재개가 동작하고, MCP 구성은 ACP `mcpServers`로 전달됩니다. Hermes는 스킬을 자신의 홈 디렉터리(`~/.hermes/skills/`)와 설정된 `skills.external_dirs`에서만 탐색하며, 워크스페이스 상대 탐색은 하지 않습니다. 그래서 **에이전트에 스킬이 할당된 경우에만** Multica는 `HERMES_HOME`을 사용자 `~/.hermes/`의 작업별 오버레이로 향하게 합니다. 실제 홈은 심링크로 미러되고(auth/시크릿 포함, 토큰 갱신이 전파됨), 파생된 `config.yaml`이 기존 스킬을 읽기 전용 external root로 참조하며, 할당된 스킬만 그 `skills/` 디렉터리에 기록되어 우선합니다. 전역 스킬은 그대로 동작합니다. Multica는 공유 `~/.hermes/`를 직접 수정하지 않고 읽어서 링크만 하지만, Hermes가 미러된 심링크를 통해 쓰는 경우(토큰 갱신 등)는 전파됩니다. `custom_args`의 `-p`/`--profile` 선택은 존중됩니다. 오버레이는 그 profile의 홈에서 시드되고, 플래그는 실행 명령에서 소비되어 오버레이를 우회할 수 없습니다. 작업 메모리는 작업별로 격리됩니다. 새 `memories/` 디렉터리에 더해 파생 설정에서 외부 `memory.provider` 백엔드를 비활성화하므로, 디스크상의 메모도 공유 Supermemory/Hindsight 류의 뱅크도 작업 간에 공유되지 않습니다(관리형 agent 범위 메모리 백엔드는 향후 별도 과제입니다). `state.db` SQLite 세션 저장소와 저널 파일도 작업 로컬이며 Hermes가 오버레이 안에서 생성합니다. 호스트 대화 기록은 링크되거나 복사되지 않고, Windows에서 활성 WAL 잠금이 환경 준비를 막지 않습니다. 스킬이 할당되지 않은 Hermes 작업은 실제 홈 그대로 실행됩니다. 참고로 홈의 플랫폼 기본값은 네이티브 Windows에서 `%LOCALAPPDATA%\hermes`입니다.
-
-**Hermes profile 선택.** 특정 profile로 Hermes를 실행하려면 에이전트의 `custom_args`에 profile 플래그와 profile 이름을 두 개의 독립된 항목으로 설정하세요. 예를 들어 `research`라는 profile을 사용하려면:
-
-```json
-["-p", "research"]
-```
-
-`"-p research"`처럼 하나의 문자열로 합치지 마세요. Multica는 배열의 각 항목을 하나의 argv 항목으로 도구에 전달합니다. `custom_args`는 에이전트별로 설정합니다 — [에이전트 생성 및 구성](/agents-create)을 참고하세요.
-
-### Kimi
-
-Moonshot에서 제공하며, 중국 시장을 겨냥합니다. Hermes와 ACP 프로토콜을 공유하고 MCP 구성도 ACP `mcpServers`로 전달되지만, 스킬 경로 `.kimi/skills/`는 Kimi CLI의 기본 탐색 메커니즘으로 Hermes의 fallback과는 다릅니다.
-
-### Kiro CLI
-
-Amazon에서 제공합니다. `kiro-cli acp`를 통해 stdio 위에서 ACP를 사용합니다. 세션 재개는 ACP `session/load`로 동작하고, MCP 구성은 ACP `mcpServers`로 전달되며, 모델 선택은 `session/set_model`로 동작하고, 스킬은 프로젝트 수준 기본 탐색을 위해 `.kiro/skills/`로 복사됩니다.
-
-### OpenCode
-
-SST에서 제공하는 오픈소스입니다. 사용 가능한 모델과 모델 variant를 동적으로 탐색합니다(CLI의 구성 파일을 스캔). 세션 재개가 동작하고, 에이전트의 `mcp_config` 필드를 소비합니다. Multica는 `OPENCODE_CONFIG_CONTENT` 환경 변수를 통해 이를 인라인으로 주입하므로, 에이전트의 MCP 서버가 작업 디렉터리의 `opencode.json`(에이전트 또는 사용자가 소유하는 파일)을 건드리지 않고 OpenCode에 전달됩니다. 모델이 variant를 노출하면 Multica는 이를 에이전트 thinking selector로 표시하고 선택한 값을 `opencode run --variant`로 전달합니다. **자신의 모델 카탈로그를 커스터마이징하고 싶은, 만지작거리기 좋아하는 사용자에게 적합합니다.**
-
-### DevEco Code
-
-**DevEco Code**는 Huawei(화웨이)의 HarmonyOS 개발용 독립 코딩 에이전트(`deveco` CLI, [gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code))입니다. OpenCode 엔진을 기반으로 하면서도 자체적으로 완성된 성숙한 제품으로, 자체 모델 카탈로그와 provider(내장 `deveco/GLM-5.1`), Huawei 계정 인증, 전용 설정·스킬 체계(`~/.config/deveco/` 및 `.deveco/skills/`)를 갖추고 있습니다. Multica는 `deveco run --format json`으로 구동하며 NDJSON 이벤트 스트림을 파싱합니다. **세션 재개가 동작합니다**(`--session <id>` 경유). 모델은 `deveco models`에서 동적으로 탐색되고, 시스템 컨텍스트는 작업별 `AGENTS.md`로 전달됩니다. MCP 서버는 DevEco 네이티브 `DEVECO_CONFIG_CONTENT` 채널로 설정합니다. Multica 측 `mcp_config` 연동은 개발 중이며, 현재 DevEco 에이전트의 MCP 탭은 숨겨집니다. 인증은 `deveco auth login`(Huawei 계정)으로 수행합니다.
-
-### OpenClaw
-
-오픈소스 프로젝트이며, CLI 에이전트 오케스트레이터입니다. MCP 구성은 Multica의 작업별 config wrapper를 통해 기록됩니다. **모델이 에이전트 계층에 바인딩됩니다**(`openclaw agents add --model`) — 작업마다 재정의할 수 없습니다. 구성이 엄격하게 통제됩니다: 사용자는 `--model`이나 `--system-prompt`를 전달할 수 없으며, 에이전트 등록 구성이 결정합니다.
+<Callout type="info">
+도구마다 모델 이름이 다를 수 있습니다. AI 코딩 도구를 바꾸면 기존 모델 값은 새 도구에서 유효하지 않으므로 다시 선택해야 합니다.
+</Callout>
-### Pi
+## 세션 복원
-Inflection AI에서 제공하며, 미니멀합니다. **세션 재개 방식이 특이합니다** — 세션 ID가 문자열 ID가 아니라 디스크상의 파일 경로(`~/.pi/...`)입니다. 다른 도구에서는 재개 id가 CLI가 반환하는 문자열이지만, Pi에서는 재개 id가 세션 파일 그 자체입니다.
+위 도구는 모두 이후 실행에서 기존 세션을 이어갈 수 있습니다. 원래 세션이 여전히 존재하고 해당 세션에 접근할 수 있는 런타임이 태스크를 실행해야 합니다.
-### Qoder
+Multica는 도구가 반환한 세션 식별자를 저장합니다. 다음에 같은 이슈에서 작업을 이어갈 때 런타임이 이 세션의 복원을 시도합니다. 복원할 수 없으면 새 세션을 만들어 계속 실행합니다. Pi는 로컬 세션 파일 경로를 저장하므로 원래 컴퓨터와 파일에 더 많이 의존합니다.
-Alibaba에서 제공합니다. 에이전트형 코딩 CLI입니다. stdio 위에서 ACP 프로토콜을 사용합니다(Hermes, Kimi, Kiro CLI와 전송 계층을 공유합니다). 세션 재개는 ACP `session/resume`를 통해 동작하고, MCP 구성은 ACP `mcpServers`로 전달되며, 모델 선택은 동적으로 탐색되고, 스킬은 네이티브 탐색을 위해 `.qoder/skills/`로 복사됩니다.
+재시도와 세션 복원 규칙은 [실행 태스크](/tasks#수동-재시도)를 참고하세요.
-### Trae
+## MCP 설정
-ByteDance의 공식 TRAE CLI(`traecli`, Trae IDE와 함께 쓰는 제품이며 오픈소스 `bytedance/trae-agent`가 아닙니다)입니다. ACP 네이티브라서 Multica는 `traecli acp serve --yolo`로 stdio 위에서 구동하며, Kiro 및 Qoder와 같은 전송 계층을 사용합니다. 세션 재개는 ACP `session/load`로 동작하고, MCP 구성은 ACP `mcpServers`로 전달되며, 모델은 동적으로 탐색되어 작업별로 `session/set_model`로 전환됩니다. 스킬은 `.traecli/skills/`로 복사됩니다.
+Antigravity, GitHub Copilot CLI, DevEco Code, Pi는 현재 에이전트의 MCP 설정을 읽지 않으므로 에이전트를 만들 때 이 항목이 표시되지 않습니다.
-### Grok
+<Callout type="warning">
+MCP server의 명령, 인수, 환경 변수는 에이전트 설정과 함께 서버에 저장됩니다. 공유할 필요가 없는 로컬 자격 증명을 설정에 직접 넣지 마세요.
+</Callout>
-xAI의 Grok Build CLI(`grok`)입니다. Multica는 `grok --no-auto-update agent --always-approve stdio`로 ACP에 연결합니다. `initialize` 응답 후 CLI가 광고한 방식 중 `xai.api_key`(`XAI_API_KEY`가 설정된 경우 우선) 또는 `cached_token`을 선택하고, `authenticate`가 성공한 뒤에만 세션을 만들거나 불러옵니다. 사용할 수 있는 방식이 없으면 명시적으로 실패합니다. 세션 재개는 ACP `session/load`, 모델은 `session/new`에서 동적으로 탐색하고 `session/set_model`로 전환합니다. `grok-4.5`의 reasoning effort는 공식 지원 값인 `low`, `medium`, `high`만 제공합니다. MCP 구성은 ACP `mcpServers`로 전달됩니다. 스킬은 `.grok/skills/`에 기록되며, 사용자 스킬은 `$GROK_HOME/skills/`(기본값 `~/.grok/skills/`)과 공용 `~/.agents/skills/`에서 탐색됩니다.
+## 스킬 주입 방식
-## 세션 재개: 실제로 지원하는 도구
+실행을 시작하기 전에 Multica가 에이전트에 연결된 스킬을 위 표의 해당 위치에 기록해 도구가 자체 기본 메커니즘으로 발견할 수 있게 합니다.
-세션 재개 메커니즘은 [작업](/tasks#can-a-task-continue-from-the-previous-context)에서 다룹니다. **지원되는 모든 도구가 세션을 재개합니다** — 재개 id를 전달하면 작업이 이전 컨텍스트에서 이어집니다. 유일한 예외는 Pi로, 재개 id가 문자열 ID가 아니라 디스크상의 세션 파일 경로입니다(위의 [Pi](#pi) 참고).
+저장소에 원래 있던 스킬은 덮어쓰지 않습니다. 이름이 충돌하면 Multica가 주입하는 복사본에 다른 디렉터리 이름을 사용하며 실행이 끝나면 자신이 만든 파일만 정리합니다.
-## MCP 구성: 도구별 지원
+Codex, Hermes, OpenClaw의 처리는 조금 다릅니다.
-**16개 도구 중 `mcp_config`를 실제로 소비하는 것은 12개입니다: Claude Code, CodeBuddy, Codex, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Qoder, Trae CLI, Grok**. 나머지 4개(Antigravity, Copilot, DevEco Code, Pi)는 이 필드를 받아들이지만 **무시합니다** — 오류도, 경고도 없으며, 구성이 그저 효과를 내지 못합니다.
+- Codex는 실행별 `CODEX_HOME`을 사용하며 시스템 수준 Codex 디렉터리에 스킬을 기록하지 않습니다.
+- Hermes는 실행별 `HERMES_HOME`을 사용합니다. 기존 로컬 설정은 계속 읽을 수 있지만 연결된 스킬과 세션 데이터는 태스크별로 격리됩니다. 이 격리는 에이전트에 스킬이 연결된 경우에만 사용되며, 연결된 스킬이 없는 태스크는 컴퓨터의 기존 Hermes 홈 디렉터리를 사용합니다.
+- OpenClaw는 현재 태스크 작업 디렉터리의 `skills/`를 사용하고 실행별 설정을 통해 이 디렉터리를 워크스페이스로 지정합니다.
-각 도구의 연결 방식은 다릅니다: Claude Code와 CodeBuddy는 `--mcp-config`와 `--strict-mcp-config`로 받고, Codex는 데몬이 관리하는 `mcp_servers` 블록을 작업별 `$CODEX_HOME/config.toml`에 기록하며, Cursor는 `.cursor/mcp.json`과 작업별 `CURSOR_DATA_DIR` 아래의 프로젝트 approval을 기록합니다. Hermes/Kimi/Kiro CLI/Qoder/Trae CLI/Grok은 ACP `mcpServers`로 받습니다. OpenCode는 `OPENCODE_CONFIG_CONTENT` 환경 변수로 인라인 구성을 받고, OpenClaw는 Multica의 작업별 config wrapper를 통해 `mcp.servers`를 받습니다. OpenCode 경로는 프로젝트의 `opencode.json`을 다시 쓰지 않습니다.
+스킬 생성 및 연결 방법은 [스킬](/skills)을 참고하세요.
-<Callout type="warning">
-에이전트 구성에서 `mcp_config`를 설정했더라도 MCP 열에 ✅가 없는 도구를 선택하면, MCP 서버가 해당 에이전트에 **아무런 효과**도 미치지 않습니다. MCP 연동은 도구별로 구현됩니다.
-</Callout>
+## 다음 단계
-## 스킬 파일이 위치하는 곳
-
-각 도구는 **자체** 스킬 탐색 경로를 사용합니다. 작업이 실행되기 전에 Multica 데몬이 워크스페이스의 스킬 파일을 해당 경로로 복사합니다:
-
-| 도구 | 경로 | 기본 탐색 여부 |
-|---|---|---|
-| Claude Code | `.claude/skills/` | ✅ 기본 |
-| CodeBuddy | `.codebuddy/skills/` | ✅ 기본 |
-| Codex | `$CODEX_HOME/skills/` | ✅ 기본 |
-| Copilot | `.github/skills/` | ✅ 기본 |
-| Cursor | `.cursor/skills/` | ✅ 기본 |
-| Kimi | `.kimi/skills/` | ✅ 기본 |
-| Kiro CLI | `.kiro/skills/` | ✅ 기본 |
-| OpenCode | `.opencode/skills/` | ✅ 기본 |
-| DevEco Code | `.deveco/skills/` | ✅ 기본 |
-| Pi | `.pi/skills/` | ✅ 기본 |
-| Qoder | `.qoder/skills/` | ✅ 기본 |
-| Trae CLI | `.traecli/skills/` | ✅ 기본 |
-| Grok | `.grok/skills/` | ✅ 기본 |
-| Antigravity | `.agents/skills/` | ✅ 기본 (Gemini CLI의 워크스페이스 레이아웃을 따름 — [Antigravity 문서](https://antigravity.google/docs/gcli-migration) 참고) |
-| Hermes | `HERMES_HOME/skills/` (작업별 홈) | ✅ 기본 (작업별로 `~/.hermes/`에서 시드) |
-| OpenClaw | `.agent_context/skills/` | ⚠️ 범용 fallback |
-
-fallback 경로를 쓰는 도구가 실제로 이 디렉터리를 읽는지는 해당 도구 자체의 문서에 따라 달라지며 — 보장되지 않습니다. OpenClaw에서 스킬이 적용되지 않는다면, 먼저 이 점을 확인하세요.
-
-기본 프로젝트 수준 경로에서는 저장소 범위 탐색이 의도된 동작입니다. 체크아웃된 저장소가 이미 해당 디렉터리를 포함하고 있으면, 기반 도구가 커밋된 스킬을 자체적으로 탐색할 수 있습니다. 해당 저장소에서 사용하기 위해 이러한 repo skills를 Multica로 먼저 가져올 필요는 없습니다. Multica는 이러한 저장소 파일을 그대로 둡니다. 워크스페이스 스킬의 자연 디렉터리 이름이 같으면 데몬은 `review-helper-multica` 같은 충돌 없는 형제 디렉터리에 워크스페이스 사본을 씁니다.
-
-스킬의 생성과 사용은 [스킬](/skills)을 참고하세요.
-
-## 다음
-
-- [에이전트 생성 및 구성](/agents-create) — 에이전트에 사용할 도구를 선택하세요
-- [작업](/tasks) — 작업 생명주기와 세션 재개 메커니즘
-- [데몬과 런타임](/daemon-runtimes) — 도구가 실행되는 곳과 Multica에 연결되는 방식
-- [에이전트 런타임 설치](/install-agent-runtime) — 지원되는 16개 도구 각각의 설치 및 인증
+- [에이전트 생성 및 설정](/agents-create) — 모델과 사고 강도를 설정합니다.
+- [AI 코딩 도구 설치](/install-agent-runtime) — 설치와 감지 단계를 확인합니다.
+- [데몬과 런타임](/daemon-runtimes) — 런타임 등록과 동시 실행을 알아봅니다.
diff --git a/apps/docs/content/docs/providers.mdx b/apps/docs/content/docs/providers.mdx
index cd4df58ba8..0255660ea1 100644
--- a/apps/docs/content/docs/providers.mdx
+++ b/apps/docs/content/docs/providers.mdx
@@ -1,170 +1,87 @@
---
-title: AI coding tools matrix
-description: Multica supports 17 AI coding tools; they implement the same interface, but the capability details diverge significantly.
+title: AI coding tools comparison
+description: Compare the AI coding tools Multica supports, and how models, MCP, sessions, and skills differ.
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica ships with built-in support for **17 AI coding tools**. They all implement the same interface — queue, dispatch, execute, return results — so you can drive any of them from the same Multica board. **But the capability details diverge significantly**: whether session resumption actually works, whether MCP is supported, where skill files live, how models are selected. This page is the full matrix.
+Multica does not replace the AI coding tool you use. A runtime invokes the tool already installed and signed in on the computer, then writes progress and results back to the issue.
-For guidance on picking a tool when creating an agent, see [Creating and configuring agents](/agents-create).
+If you already use one of these tools, you can usually keep it as-is. Four things to weigh when choosing:
-## Capability matrix
+- whether it is already installed on the computer;
+- which models your account can use;
+- whether Multica needs to configure MCP for it;
+- which skills the team wants to reuse.
-| Tool | Vendor | Session resumption | MCP | Skill injection path | Model selection |
-|---|---|---|---|---|---|
-| **Antigravity** | Google | ✅ (`--conversation <id>`) | ❌ | `.agents/skills/` | Dynamic discovery (`agy models`) |
-| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | Static + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | Dynamic discovery |
-| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | Static |
-| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | Static (determined by account entitlement) |
-| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | Dynamic discovery |
-| **Hermes** | Nous Research | ✅ | ✅ | `HERMES_HOME/skills/` (per-task home) | Dynamic discovery |
-| **Kimi** | Moonshot | ✅ | ✅ | `.kimi/skills/` | Dynamic discovery |
-| **Kiro CLI** | Amazon | ✅ | ✅ | `.kiro/skills/` | Dynamic discovery |
-| **OpenCode** | SST | ✅ | ✅ | `.opencode/skills/` | Dynamic discovery + variants |
-| **DevEco Code** | Huawei | ✅ | ❌ | `.deveco/skills/` | Dynamic discovery (`deveco models`) |
-| **OpenClaw** | Open source | ✅ | ✅ | `.agent_context/skills/` (fallback) | Bound to the agent, can't be switched per task |
-| **Pi** | Inflection AI | ✅ (session is a file path) | ❌ | `.pi/skills/` | Dynamic discovery |
-| **Qoder** | Alibaba | ✅ | ✅ | `.qoder/skills/` | Dynamic discovery |
-| **Qwen Code** | Alibaba | ✅ (`--resume <id>`) | ✅ | `.qwen/skills/` | Runtime default or manual `--model` |
-| **Trae** | ByteDance | ✅ (ACP `session/load`) | ✅ | `.traecli/skills/` | Dynamic discovery |
-| **Grok** | xAI | ✅ (ACP `session/load`) | ✅ | `.grok/skills/` | Dynamic discovery (ACP `session/new`) |
+Install steps are in [Install AI coding tools](/install-agent-runtime).
-## What each tool is for
+## Supported tools
-### Antigravity
+| Tool | Detected command | Session resumption | Multica-managed MCP | Skill injection path |
+|---|---|---:|---:|---|
+| Antigravity | `agy` | ✓ | — | `.agents/skills/` |
+| Claude Code | `claude` | ✓ | ✓ | `.claude/skills/` |
+| CodeBuddy | `codebuddy` | ✓ | ✓ | `.codebuddy/skills/` |
+| Codex | `codex` | ✓ | ✓ | `$CODEX_HOME/skills/` |
+| GitHub Copilot CLI | `copilot` | ✓ | — | `.github/skills/` |
+| Cursor Agent | `cursor-agent` | ✓ | ✓ | `.cursor/skills/` |
+| DevEco Code | `deveco` | ✓ | — | `.deveco/skills/` |
+| Grok | `grok` | ✓ | ✓ | `.grok/skills/` |
+| Hermes | `hermes` | ✓ | ✓ | per-task `HERMES_HOME/skills/` |
+| Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` |
+| Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |
+| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
+| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
+| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
+| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
+| Trae CLI | `traecli` | ✓ | ✓ | `.traecli/skills/` |
-From Google. CLI binary name is `agy`. Pairs with Google's Antigravity service and ships with a Gemini-backed default model. Multica launches Antigravity with `agy -p` because that is the daemon-compatible non-interactive mode; `agy -i` needs an attached TTY and is not suitable for background task execution. Current Antigravity CLI releases can still execute tools from this mode, but stdout is plain assistant text rather than a structured event stream, so Multica relays the transcript as text and cannot show per-tool telemetry for Antigravity today. **Session resumption works** via `--conversation <id>`; the daemon captures the conversation UUID from the CLI's log file. **Model selection works** via the `--model` flag (added in agy 1.0.6): the daemon enumerates the catalog with `agy models` and ships the chosen value verbatim. Note these are human display strings such as `Claude Opus 4.6 (Thinking)`, not `provider/model` slugs — and agy silently no-ops on a value it doesn't recognise, so prefer picking from the discovered list over typing a custom one. Skills land in `.agents/skills/` (the CLI inherits Gemini CLI's workspace skill layout — see [Antigravity migration docs](https://antigravity.google/docs/gcli-migration)).
+"Multica-managed MCP" means you can define MCP servers in the agent configuration and Multica passes them to the tool before a run. It does not mean the tool has no other way to configure MCP.
-### Claude Code
+## Model sources
-From Anthropic. **First choice for new users** — the most complete feature set: session resumption actually works, it reads MCP configuration, and it supports fine-tuning flags like `--max-turns` and `--append-system-prompt`. Requires an Anthropic API key.
+When you create an agent, the model list comes from the corresponding runtime. Some tools expose a fixed set of model names; others return available models based on local configuration, the signed-in account, and subscription entitlements.
-### CodeBuddy
+If you do not pick a model, Multica uses the tool's own default. If the list is empty, confirm the runtime is online and the tool is signed in, then refresh the model list.
-From Tencent. A Claude Code–compatible CLI agent — Multica drives it with the same stream-json protocol as Claude Code, so session resumption works (via `--resume`) and MCP config is passed through `--mcp-config`. CodeBuddy ships its own native config directory rather than reusing Claude's, so skills land in `.codebuddy/skills/` and the runtime brief is written to `CODEBUDDY.md`. Models are discovered dynamically.
-
-### Codex
-
-From OpenAI. Uses JSON-RPC 2.0, has stronger statefulness, and a finer-grained approve mechanism (manual approval for `exec_command` and `patch_apply`). MCP config is materialized into the per-task `$CODEX_HOME/config.toml`. **Session resumption works** through Codex app-server `thread/resume`; if the saved thread is missing or stale, Multica falls back to a fresh thread so the task can still run.
-
-### Copilot
-
-From GitHub. Model routing goes through your GitHub account entitlement — the tool doesn't select a model itself; GitHub decides which model you get. Placing skills in `.github/skills/` is GitHub CLI's native discovery mechanism.
-
-### Cursor
-
-From Anysphere, the CLI counterpart to the Cursor editor. **Session resumption works** with current Cursor Agent releases: the stream-json event includes a `session_id`, and Multica passes it back with `--resume <id>` on the next run. MCP config is materialized into the task workspace's `.cursor/mcp.json`, with Cursor's project approval file written under a per-task `CURSOR_DATA_DIR` so managed MCP servers do not depend on the user's global Cursor approvals.
-
-### Hermes
-
-From Nous Research. Uses the ACP protocol (shares a transport with Kimi). Session resumption works, and MCP config is passed through ACP `mcpServers`. Hermes discovers skills only from its home directory (`~/.hermes/skills/`, or `%LOCALAPPDATA%\hermes\skills\` on native Windows) and configured `skills.external_dirs` — it has no workspace-relative discovery. So **when an agent has skills assigned**, Multica points `HERMES_HOME` at a per-task overlay of your Hermes home: your real home is mirrored by symlink (auth/secrets included, so token refreshes propagate), a derived `config.yaml` references your existing skills as read-only external roots, and only the assigned skills are written into its `skills/` directory — where they take precedence, so your global skills keep working. A `-p`/`--profile` selection in `custom_args` is honored: the overlay is seeded from that profile's home, and the flag is consumed from the launch command so it can't slip past the overlay. Multica never writes to your shared home directly (it only reads it and links into it), though writes Hermes itself makes through a mirrored symlink — a token refresh, say — do propagate. Task memory is isolated per task: a fresh `memories/` directory, plus the external `memory.provider` backend is disabled in the derived config, so neither on-disk notes nor a shared Supermemory/Hindsight-style bank crosses between tasks (a managed, agent-scoped memory backend is a separate future decision). The SQLite `state.db` session store and its journal files are task-local too: Hermes creates them inside the overlay, so host conversation history is neither linked nor copied and a live Windows WAL lock cannot block setup. A Hermes task with no assigned skills runs against your real home unchanged.
-
-**Selecting a Hermes profile.** To launch Hermes under a specific profile, set the agent's `custom_args` to the profile flag and the profile name as two separate entries — for example, for a profile named `research`:
-
-```json
-["-p", "research"]
-```
-
-Don't combine them into one string like `"-p research"`; Multica passes each array item as a separate argv entry. `custom_args` is configured per agent — see [Creating and configuring agents](/agents-create).
-
-### Kimi
-
-From Moonshot, aimed at the Chinese market. Shares the ACP protocol with Hermes, including MCP config through ACP `mcpServers`, but the skill path `.kimi/skills/` is Kimi CLI's native discovery mechanism — different from Hermes's fallback.
-
-### Kiro CLI
-
-From Amazon. Uses ACP over stdio via `kiro-cli acp`. Session resumption works through ACP `session/load`, MCP config is passed through ACP `mcpServers`, model selection works through `session/set_model`, and skills are copied into `.kiro/skills/` for native project-level discovery.
-
-### OpenCode
-
-From SST, open source. Dynamically discovers available models and model variants (scans the CLI's configuration file). Session resumption works, and it consumes the agent's `mcp_config` field — Multica injects it inline through the `OPENCODE_CONFIG_CONTENT` environment variable, so the agent's MCP servers reach OpenCode without writing anything into the task workdir's `opencode.json` (the agent or the user keep ownership of that file). When a model exposes variants, Multica shows them as the agent thinking selector and passes the selected value through `opencode run --variant`. **Suitable for tinkerers who want to customize their model catalog.**
-
-### DevEco Code
-
-**DevEco Code** is Huawei's independent coding agent for HarmonyOS development (`deveco` CLI, [gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code)). Built on the OpenCode engine, it ships as a complete product in its own right — its own model catalog and provider (the built-in `deveco/GLM-5.1`), Huawei-account auth, and its own config and skill layout under `~/.config/deveco/` and `.deveco/skills/`. Multica drives it over `deveco run --format json`, parsing the NDJSON event stream. **Session resumption works** (`--session <id>`), models are discovered dynamically (`deveco models`), and system context is delivered through the per-task `AGENTS.md`. MCP servers are configured through DevEco's native `DEVECO_CONFIG_CONTENT` channel; Multica-side `mcp_config` wiring is in progress, so the MCP tab is hidden for DevEco agents for now. Authenticate with `deveco auth login` (Huawei account).
-
-### OpenClaw
-
-Open-source project, a CLI agent orchestrator. MCP config is materialized through Multica's per-task OpenClaw config wrapper. **Model is bound at the agent layer** (`openclaw agents add --model`) — it can't be overridden per task. Configuration is strictly controlled: users can't pass `--model` or `--system-prompt`; the agent-registration config decides.
-
-### Pi
-
-From Inflection AI, minimalist. **Session resumption is unusual** — the session ID is a file path on disk (`~/.pi/...`) rather than a string ID. In other tools, the resume id is a string returned by the CLI; in Pi, the resume id is the session file itself.
-
-### Qoder
-
-From Alibaba. An agentic coding CLI. Uses the ACP protocol over stdio (shares a transport with Hermes, Kimi, and Kiro CLI). Session resumption works through ACP `session/resume`, MCP config is passed through ACP `mcpServers`, model selection is discovered dynamically, and skills are copied into `.qoder/skills/` for native discovery.
+<Callout type="info">
+Different tools may use different model names. After switching AI coding tools, the previous model value is invalid in the new tool and needs to be selected again.
+</Callout>
-### Qwen Code
+## Session resumption
-From Alibaba. Multica drives Qwen Code with its native non-interactive JSONL protocol, `qwen -p <prompt> --output-format stream-json --yolo`, and maps text, thinking, tool calls, tool results, session IDs, status, errors, and token usage into the normal task stream. Multica owns `--yolo` for unattended runs so shell, edit, and write tools remain available without an approval UI. This does not enable Qwen's sandbox: unless the deployment explicitly enables `--sandbox` or `QWEN_SANDBOX`, tools run with the daemon OS user's permissions and credential scope. Use `--exclude-tools` in custom arguments to hard-deny specific tools. **Session resumption works** through `--resume <id>`. The per-task runtime brief is written to `QWEN.md`; assigned skills are copied to `.qwen/skills/`; user skills are read from `$QWEN_HOME/skills/` (default `~/.qwen/skills/`). Select a default model with `MULTICA_QWEN_MODEL` or set a manual per-task value through Qwen's `--model` flag; Multica does not advertise an account-specific static catalog. A managed `mcp_config` is materialized into a 0600 temporary JSON file and passed as `--mcp-config <path>`, which Qwen gives highest precedence for that run; the file is removed when the process exits. Leave the field null to inherit native Qwen Code MCP settings.
+All of these tools support continuing an existing session in a later run. The prerequisites are that the original session still exists and the task is executed by a runtime that can reach it.
-### Trae
+Multica stores the session identifier the tool returns. The next time work continues on the same issue, the runtime tries to resume that session; when it cannot, it creates a new session and keeps going. Pi stores a local session file path, so it depends more on the original computer and file.
-From ByteDance — the official **TRAE CLI** (`traecli`, documented at [docs.trae.cn/cli](https://docs.trae.cn/cli); this is the product paired with the Trae IDE, **not** the open-source `bytedance/trae-agent`). traecli is ACP-native, so Multica drives it over the standard ACP JSON-RPC transport via `traecli acp serve --yolo`, exactly like Kiro and Qoder — `--yolo` puts it in bypass-permissions mode so headless runs don't block on tool-approval prompts.
+Retry and session-resumption rules are in [Tasks](/tasks#manual-retry).
-- **Session resumption works** through ACP `session/load` (traecli advertises `loadSession: true` from `initialize`).
-- **Model selection is dynamic**: the model catalog is discovered from `session/new` (`models.availableModels`) and switched per task via `session/set_model`. Set the daemon-wide default with `MULTICA_TRAECLI_MODEL`.
-- **MCP is supported** — config is passed through ACP `mcpServers`; traecli advertises `mcpCapabilities: {http, sse}`, and unsupported transports are filtered out before `session/new`.
-- **Authentication** is traecli's own enterprise login: run `traecli` once interactively to complete the browser login (the token persists in `~/.trae` + the OS keyring). The IDE login is separate — logging into the Trae IDE does **not** log in the CLI.
-- **Skills** are written to `.traecli/skills/` (project) for native discovery; global skills live in `~/.traecli/skills`.
-- The Multica runtime brief is also inlined into the prompt (traecli has no `--system-prompt` flag and reads project rules from `.trae/rules/`, not `AGENTS.md`), so the workflow instructions reach the agent regardless.
+## MCP configuration
-> The capabilities above were captured from the real `traecli` v0.120.42 binary: `initialize` → `loadSession:true` + `mcpCapabilities{http,sse}`; `session/new` → `result.sessionId` + `models.availableModels`; `session/prompt` streams `session/update` notifications with `sessionUpdate: agent_message_chunk`.
+Antigravity, GitHub Copilot CLI, DevEco Code, and Pi do not read the MCP configuration on an agent yet, so the field is not shown when creating agents for them.
-### Grok
+<Callout type="warning">
+MCP server commands, arguments, and environment variables are saved server-side with the agent configuration. Do not write local credentials you have no need to share into the configuration.
+</Callout>
-From xAI. CLI binary name is `grok` (Grok Build CLI, often installed to `~/.grok/bin/grok`). Multica drives it over **ACP** via `grok --no-auto-update agent --always-approve stdio`, reusing the same transport as Trae / Kimi / Kiro / Qoder. After `initialize`, Multica chooses only an auth method the CLI advertised (`xai.api_key` when `XAI_API_KEY` is set and offered, otherwise `cached_token`) and waits for `authenticate` to succeed before any session operation; an empty or unsupported method list fails explicitly. **Session resumption works** through ACP `session/load`. **Model selection works** via the catalog returned from `session/new` and `session/set_model`. For `grok-4.5`, **reasoning effort** exposes only xAI's documented `low`, `medium`, and `high` values; unverified models hide the picker. **MCP is supported** — config is passed through ACP `mcpServers` (filtered to transports advertised by `initialize`). Skills land in `.grok/skills/` (project). User skills live under `$GROK_HOME/skills/` (default `~/.grok/skills/`) or the universal user root `~/.agents/skills/`. Tool calls stream as ACP `tool_call` / `tool_call_update` events.
+## Skill injection
-## Session resumption: who really supports it
+Before a run starts, Multica writes the skills bound to the agent into the paths in the table above, so each tool discovers them through its own native mechanism.
-The session resumption mechanism is covered in [Tasks](/tasks#can-a-task-continue-from-the-previous-context). **Every supported tool resumes sessions** — pass the resume id and the task continues from the previous context. The one quirk is Pi, whose resume id is a session file path on disk rather than a string id (see [Pi](#pi) above).
+Skills that already exist in the repository are never overwritten. On a name collision, Multica uses a different directory name for the injected copy; after the run, it cleans up only the files it created.
-## MCP configuration: provider-specific support
+Codex, Hermes, and OpenClaw are handled slightly differently:
-**Of the 17 tools, thirteen consume `mcp_config`: Claude Code, CodeBuddy, Codex, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Qoder, Qwen Code, Trae, and Grok**. The other four (Antigravity, Copilot, DevEco Code, Pi) accept the field but **ignore it** — no error, no warning, the config just has no effect.
+- Codex uses a per-task `CODEX_HOME`, so skills are never written into the system-level Codex directory.
+- Hermes uses a per-task `HERMES_HOME`. Existing local configuration is still readable, but bound skills and session data are isolated per task. This isolation kicks in only when the agent has skills bound; tasks without bound skills use the machine's original Hermes home.
+- OpenClaw uses `skills/` under the current task's working directory, and the per-run configuration sets that directory as the workspace.
-The runtime paths are provider-specific: Claude Code, CodeBuddy, and Qwen Code receive it through daemon-owned temporary JSON files passed with `--mcp-config` (mode `0600` on POSIX systems because MCP configs may embed API tokens); Claude Code and CodeBuddy additionally use `--strict-mcp-config`; Codex writes a daemon-managed `mcp_servers` block into the per-task `$CODEX_HOME/config.toml`; Cursor writes `.cursor/mcp.json` plus per-task project approvals under `CURSOR_DATA_DIR`; Hermes, Kimi, Kiro CLI, Qoder, Trae, and Grok receive ACP `mcpServers`; OpenCode receives inline config through `OPENCODE_CONFIG_CONTENT`; OpenClaw receives `mcp.servers` through Multica's per-task config wrapper. OpenCode's path does **not** rewrite the project's `opencode.json`.
+For creating and binding skills, see [Skills](/skills).
-<Callout type="warning">
-If you set `mcp_config` in an agent configuration but pick a tool not marked ✅ in the MCP column, your MCP servers have no effect on Antigravity, Copilot, DevEco Code, or Pi.
-</Callout>
+## Next steps
-## Where skill files go
-
-Each tool uses **its own** skill discovery path. Before a task runs, the Multica daemon copies the workspace's skill files into the corresponding path:
-
-| Tool | Path | Native discovery? |
-|---|---|---|
-| Claude Code | `.claude/skills/` | ✅ Native |
-| CodeBuddy | `.codebuddy/skills/` | ✅ Native |
-| Codex | `$CODEX_HOME/skills/` | ✅ Native |
-| Copilot | `.github/skills/` | ✅ Native |
-| Cursor | `.cursor/skills/` | ✅ Native |
-| Kimi | `.kimi/skills/` | ✅ Native |
-| Kiro CLI | `.kiro/skills/` | ✅ Native |
-| OpenCode | `.opencode/skills/` | ✅ Native |
-| DevEco Code | `.deveco/skills/` | ✅ Native |
-| Pi | `.pi/skills/` | ✅ Native |
-| Qoder | `.qoder/skills/` | ✅ Native |
-| Qwen Code | `.qwen/skills/` | ✅ Native |
-| Trae | `.traecli/skills/` | ✅ Native |
-| Grok | `.grok/skills/` | ✅ Native |
-| Antigravity | `.agents/skills/` | ✅ Native (inherits Gemini CLI's workspace layout — see [Antigravity docs](https://antigravity.google/docs/gcli-migration)) |
-| Hermes | `HERMES_HOME/skills/` (per-task home) | ✅ Native (seeded per task from `~/.hermes/`) |
-| OpenClaw | `.agent_context/skills/` | ⚠️ Generic fallback |
-
-Whether a fallback-path tool actually reads this directory depends on the tool's own documentation — no guarantees. If your skills aren't taking effect for OpenClaw, check this first.
-
-For native project-level paths, repo-scoped discovery is expected: if the checked-out repository already contains a matching directory, the underlying tool can discover those committed skills on its own. You do not need to import those repo skills into Multica just to use them in that repo. Multica keeps the repo files intact. If a workspace skill has the same natural directory name, the daemon writes the workspace copy to a collision-free sibling such as `review-helper-multica`.
-
-For creating and using skills, see [Skills](/skills).
-
-## Next
-
-- [Creating and configuring agents](/agents-create) — pick a tool for your agent
-- [Tasks](/tasks) — task lifecycle and session-resumption mechanics
-- [Daemon and runtimes](/daemon-runtimes) — where the tools run and how they connect to Multica
-- [Install an agent runtime](/install-agent-runtime) — installation and authentication for each of the 17 supported tools
+- [Create and configure an agent](/agents-create) — model and thinking-effort settings.
+- [Install AI coding tools](/install-agent-runtime) — install and detection steps.
+- [Daemon and runtimes](/daemon-runtimes) — runtime registration and concurrency.
diff --git a/apps/docs/content/docs/providers.zh.mdx b/apps/docs/content/docs/providers.zh.mdx
index 2b1fcb1f2c..a1ae53f42a 100644
--- a/apps/docs/content/docs/providers.zh.mdx
+++ b/apps/docs/content/docs/providers.zh.mdx
@@ -1,154 +1,87 @@
---
title: AI 编程工具对照
-description: Multica 支持 16 款 AI 编程工具;它们实现同一套接口,但能力细节差异很大。
+description: 比较 Multica 支持的 AI 编程工具,以及模型、MCP、会话和 Skill 的差异。
---
import { Callout } from "fumadocs-ui/components/callout";
-Multica 内置支持 **16 款 AI 编程工具**。它们都实现了同一套接口——排队、派发、执行、结果回传,所以你可以从 Multica 的同一个看板上指挥任意一款。**但它们在能力细节上差异很大**:会话恢复是否真用、是否支持 MCP、skill 文件该放在哪里、模型怎么选。这一页是完整对照。
+Multica 不会替代你使用的 AI 编程工具。运行时会调用电脑上已经安装并登录的工具,再把执行进度和结果写回 issue。
-创建智能体时挑选工具的指引见 [创建和配置智能体](/agents-create)。
+如果你已经在使用其中一款,通常可以直接沿用。选择工具时的四个判断维度:
-## 能力对照矩阵
+- 电脑上是否已经安装;
+- 账号可以使用哪些模型;
+- 是否需要由 Multica 配置 MCP;
+- 团队要复用哪些 skill。
-| 工具 | 厂商 | 会话恢复 | MCP | Skill 注入路径 | 模型选择 |
-|---|---|---|---|---|---|
-| **Antigravity** | Google | ✅(`--conversation <id>`)| ❌ | `.agents/skills/` | 动态发现(`agy models`)|
-| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | 静态 + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | 动态发现 |
-| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | 静态 |
-| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | 静态(账号权益决定)|
-| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | 动态发现 |
-| **Hermes** | Nous Research | ✅ | ✅ | `HERMES_HOME/skills/` (单次任务 home)| 动态发现 |
-| **Kimi** | Moonshot | ✅ | ✅ | `.kimi/skills/` | 动态发现 |
-| **Kiro CLI** | Amazon | ✅ | ✅ | `.kiro/skills/` | 动态发现 |
-| **OpenCode** | SST | ✅ | ✅ | `.opencode/skills/` | 动态发现 + variant |
-| **DevEco Code** | 华为 | ✅ | ❌ | `.deveco/skills/` | 动态发现(`deveco models`)|
-| **OpenClaw** | 开源项目 | ✅ | ✅ | `.agent_context/skills/` (fallback)| 绑定在智能体上,不能在任务里切换 |
-| **Pi** | Inflection AI | ✅(session 为文件路径)| ❌ | `.pi/skills/` | 动态发现 |
-| **Qoder** | Alibaba | ✅ | ✅ | `.qoder/skills/` | 动态发现 |
-| **Trae CLI** | ByteDance | ✅(ACP `session/load`)| ✅ | `.traecli/skills/` | 动态发现 |
-| **Grok** | xAI | ✅(ACP `session/load`)| ✅ | `.grok/skills/` | 动态发现(ACP `session/new`)|
+安装方法见 [安装 AI 编程工具](/install-agent-runtime)。
-## 每款工具的定位
+## 支持的工具
-### Antigravity
+| 工具 | 检测命令 | 会话恢复 | Multica 管理 MCP | Skill 注入位置 |
+|---|---|---:|---:|---|
+| Antigravity | `agy` | ✓ | — | `.agents/skills/` |
+| Claude Code | `claude` | ✓ | ✓ | `.claude/skills/` |
+| CodeBuddy | `codebuddy` | ✓ | ✓ | `.codebuddy/skills/` |
+| Codex | `codex` | ✓ | ✓ | `$CODEX_HOME/skills/` |
+| GitHub Copilot CLI | `copilot` | ✓ | — | `.github/skills/` |
+| Cursor Agent | `cursor-agent` | ✓ | ✓ | `.cursor/skills/` |
+| DevEco Code | `deveco` | ✓ | — | `.deveco/skills/` |
+| Grok | `grok` | ✓ | ✓ | `.grok/skills/` |
+| Hermes | `hermes` | ✓ | ✓ | 单次执行的 `HERMES_HOME/skills/` |
+| Kimi CLI | `kimi` | ✓ | ✓ | `.kimi/skills/` |
+| Kiro CLI | `kiro-cli` | ✓ | ✓ | `.kiro/skills/` |
+| OpenClaw | `openclaw` | ✓ | ✓ | `skills/` |
+| OpenCode | `opencode` | ✓ | ✓ | `.opencode/skills/` |
+| Pi | `pi` | ✓ | — | `.pi/skills/` |
+| Qoder CLI | `qodercli` | ✓ | ✓ | `.qoder/skills/` |
+| Qwen Code | `qwen` | ✓ | ✓ | `.qwen/skills/` |
+| Trae CLI | `traecli` | ✓ | ✓ | `.traecli/skills/` |
-Google 出品。CLI 二进制名为 `agy`,搭配 Google Antigravity 服务,默认走 Gemini 系列模型。Multica 使用 `agy -p` 启动 Antigravity,因为这是适合 daemon 后台任务的一次性非交互模式;`agy -i` 需要连接 TTY,不适合后台执行。当前 Antigravity CLI 在 `agy -p` 下仍可执行工具,但 stdout 是纯文本而非结构化事件流,所以 Multica 会把 transcript 作为 text 转发,暂时无法展示逐工具 telemetry。**会话恢复真用**——通过 `--conversation <id>`,守护进程从 CLI 的日志文件里抓取 conversation UUID。**模型选择真用**——通过 `--model` flag(agy 1.0.6 新增):守护进程用 `agy models` 枚举可选项,并把选中的值原样传入。注意这些是 `Claude Opus 4.6 (Thinking)` 这样的人类可读显示名,而非 `provider/model` slug;而且 agy 遇到无法识别的值会静默空跑,所以优先从发现列表里挑选,不要手填。Skill 文件写入 `.agents/skills/`(CLI 沿用 Gemini CLI 的 workspace 布局——见 [Antigravity 迁移文档](https://antigravity.google/docs/gcli-migration))。
+"Multica 管理 MCP" 表示你可以在智能体配置中填写 MCP server,由 Multica 在执行前传给对应工具。它不代表该工具本身没有其他 MCP 配置方式。
-### Claude Code
+## 模型来源
-Anthropic 出品。**新用户首选**——功能最完整:会话恢复真用,会读 MCP 配置,支持 `--max-turns`、`--append-system-prompt` 等细调参数。需要一个 Anthropic API 密钥。
+创建智能体时,模型列表来自对应的运行时。有些工具提供固定的模型名称,有些会根据本机配置、登录账号和订阅权益返回可用模型。
-### CodeBuddy
+不选择模型时,Multica 使用该工具的默认设置。列表为空时,先确认运行时在线并且工具已经登录,再刷新模型列表。
-Tencent 出品。一款兼容 Claude Code 的 CLI agent——Multica 用和 Claude Code 一样的 stream-json 协议驱动它,所以会话恢复可用(通过 `--resume`),MCP 配置通过 `--mcp-config` 传入。CodeBuddy 使用自己原生的配置目录,而不是复用 Claude 的,所以 skill 放在 `.codebuddy/skills/`,运行时说明写入 `CODEBUDDY.md`。模型为动态发现。
-
-### Codex
-
-OpenAI 出品。使用 JSON-RPC 2.0 协议,状态化更强,approve 机制更细(手动批准 `exec_command` 和 `patch_apply`)。MCP 配置会写入单次任务的 `$CODEX_HOME/config.toml`。**会话恢复可用**——Multica 通过 Codex app-server 的 `thread/resume` 续接;如果已保存的 thread 不存在或过期,会回退到新 thread,让任务继续执行。
-
-### Copilot
-
-GitHub 出品。模型路由走你的 GitHub 账号权益——工具自己不做模型选择,由 GitHub 决定给你用哪个模型。skill 放 `.github/skills/` 是 GitHub CLI 的原生发现机制。
-
-### Cursor
-
-Anysphere 出品,Cursor 编辑器的 CLI 对应物。**会话恢复可用**——当前 Cursor Agent 的 stream-json 事件会返回 `session_id`,Multica 会在下一次运行时通过 `--resume <id>` 传回去。MCP 配置会写入任务工作区的 `.cursor/mcp.json`,Cursor 的项目 approval 文件写在单次任务的 `CURSOR_DATA_DIR` 下,因此托管的 MCP server 不依赖用户全局 Cursor approvals。
-
-### Hermes
-
-Nous Research 出品。使用 ACP 协议(和 Kimi 共享传输层)。会话恢复真用,MCP 配置通过 ACP `mcpServers` 传入。Hermes 只从自己的 home 目录(`~/.hermes/skills/`)和配置的 `skills.external_dirs` 发现 skill,没有工作区相对发现。因此,**只有当智能体分配了 skill 时**,Multica 才会把 `HERMES_HOME` 指向你 `~/.hermes/` 的单次任务 overlay:真实 home 用软链镜像(含 auth/密钥,令牌刷新可传播),派生的 `config.yaml` 把你已有的 skill 作为只读 external root 引用,只有被分配的 skill 写入它的 `skills/` 目录并具更高优先级。你的全局 skill 照常可用。Multica 不会直接写你的共享 `~/.hermes/`(只读取并链接进去),但 Hermes 自己通过被镜像的软链写入时(如刷新令牌)会传播。`custom_args` 里的 `-p`/`--profile` 选择会被尊重:overlay 从该 profile 的 home 播种,且该标志会从启动命令里消费掉,无法绕过 overlay。任务记忆按任务隔离:一个全新的 `memories/` 目录,外加在派生配置里禁用外部 `memory.provider` 后端,所以磁盘上的笔记和共享的 Supermemory/Hindsight 之类记忆库都不会在任务间串用(受管、按 agent 隔离的记忆后端是后续单独决策)。`state.db` SQLite 会话库及其日志文件也按任务隔离,由 Hermes 在 overlay 内创建;宿主会话历史不会被链接或复制,Windows 上运行中的 WAL 锁也不会阻塞环境准备。没有分配 skill 的 Hermes 任务按真实 home 原样运行。另外,home 的平台默认值在原生 Windows 上是 `%LOCALAPPDATA%\hermes`。
-
-**指定 Hermes profile。** 要让 Hermes 使用某个 profile 启动,把智能体的 `custom_args` 设成 profile flag 和 profile 名两个独立条目。例如使用名为 `research` 的 profile:
-
-```json
-["-p", "research"]
-```
-
-不要合成一个字符串 `"-p research"`;Multica 会把数组里的每一项作为一个独立 argv 参数传给工具。`custom_args` 是按智能体配置的——见 [创建和配置智能体](/agents-create)。
-
-### Kimi
-
-Moonshot 出品,中国市场向。和 Hermes 共享 ACP 协议,MCP 配置同样通过 ACP `mcpServers` 传入;但 skill 路径 `.kimi/skills/` 是 Kimi CLI 的原生发现机制——和 Hermes 的 fallback 不一样。
-
-### Kiro CLI
-
-Amazon 出品。通过 `kiro-cli acp` 使用 ACP stdio 协议。会话恢复走 ACP `session/load`,MCP 配置通过 ACP `mcpServers` 传入,模型选择走 `session/set_model`,skill 会复制到 `.kiro/skills/` 让 Kiro 做项目级原生发现。
-
-### OpenCode
-
-SST 出品,开源。动态发现可用模型和模型 variant(扫 CLI 的配置文件)。会话恢复真用,会消费智能体的 `mcp_config` 字段——Multica 通过 `OPENCODE_CONFIG_CONTENT` 环境变量内联注入,让智能体的 MCP server 直接到达 OpenCode,**不会去碰任务工作目录里的 `opencode.json`**(那个文件归智能体或用户所有)。当模型暴露 variant 时,Multica 会把它显示成智能体的思考强度选择,并通过 `opencode run --variant` 传给 OpenCode。**适合爱折腾、想自定义模型目录**的开发者。
-
-### DevEco Code
-
-**DevEco Code** 是华为面向鸿蒙开发的独立编程智能体(`deveco` CLI,[gitcode.com/openharmony-sig/deveco-code](https://gitcode.com/openharmony-sig/deveco-code))。它基于 OpenCode 引擎构建,自身已是一款完整成熟的产品——自带模型目录与 provider(内置 `deveco/GLM-5.1`)、自带华为账号认证、自有配置与 skill 体系(`~/.config/deveco/` 与 `.deveco/skills/`)。Multica 通过 `deveco run --format json` 驱动它,解析其 NDJSON 事件流。**会话恢复可用**(`--session <id>`),模型通过 `deveco models` 动态发现,系统上下文通过单次任务的 `AGENTS.md` 投递。MCP server 通过 DevEco 原生的 `DEVECO_CONFIG_CONTENT` 通道配置;Multica 侧的 `mcp_config` 透传正在开发中,因此目前 DevEco 智能体的 MCP 标签页暂先隐藏。认证用 `deveco auth login`(华为账号)。
-
-### OpenClaw
-
-开源项目,CLI agent 编排器。MCP 配置通过 Multica 的单次任务配置 wrapper 写入。**模型绑定在智能体层**(`openclaw agents add --model`)——不能在单次任务里覆盖。配置严格受控:用户不能传 `--model` 或 `--system-prompt`,由智能体注册时的配置决定。
-
-### Pi
-
-Inflection AI 出品,极简主义。**会话恢复机制特殊**——session ID 是磁盘上的文件路径(`~/.pi/...`),而不是字符串 ID。其他工具里,resume id 是 CLI 返回的字符串;Pi 里,resume id 就是会话文件本身。
-
-### Qoder
-
-Alibaba 出品。一款 agentic 编程 CLI。使用 ACP 协议(和 Hermes、Kimi、Kiro CLI 共享传输层)。会话恢复通过 ACP `session/resume` 工作,MCP 配置通过 ACP `mcpServers` 传入,模型为动态发现,skill 复制到 `.qoder/skills/` 做原生发现。
-
-### Trae
-
-ByteDance 官方 TRAE CLI(`traecli`,搭配 Trae IDE,**不是**开源的 `bytedance/trae-agent`)。它是 ACP 原生工具,Multica 通过 `traecli acp serve --yolo` 在 stdio 上驱动它,传输层和 Kiro、Qoder 相同。会话恢复通过 ACP `session/load` 工作,MCP 配置通过 ACP `mcpServers` 传入,模型为动态发现并可通过 `session/set_model` 在任务中切换,skill 复制到 `.traecli/skills/`。
-
-### Grok
+<Callout type="info">
+不同工具可能使用不同的模型名称。更换 AI 编程工具后,原有的模型值在新工具中无效,需要重新选择。
+</Callout>
-xAI 的 Grok Build CLI(`grok`)。Multica 通过 `grok --no-auto-update agent --always-approve stdio` 接入 ACP。`initialize` 返回后,Multica 从 CLI 公布的认证方式中选择 `xai.api_key`(已设置 `XAI_API_KEY` 时优先)或 `cached_token`,等待 `authenticate` 成功后才创建或加载会话;没有可用方式时会明确失败。会话续接走 ACP `session/load`,模型从 `session/new` 动态发现并通过 `session/set_model` 切换。`grok-4.5` 的 reasoning effort 只提供官方支持的 `low`、`medium`、`high`。MCP 配置通过 ACP `mcpServers` 传入。Skill 文件写入 `.grok/skills/`;用户 skill 从 `$GROK_HOME/skills/`(默认 `~/.grok/skills/`)和通用目录 `~/.agents/skills/` 发现。
+## 会话恢复
-## 会话恢复:谁真的支持
+这些工具都支持在后续执行中继续已有会话。前提是原来的会话仍然存在,并且任务由能够访问它的运行时执行。
-会话恢复的机制在 [执行任务](/tasks#任务能接着上次的上下文继续吗) 里讲过。**所有支持的工具都能恢复会话**——传 resume id,任务就会从上次的上下文接着继续。唯一的特例是 Pi:它的 resume id 是磁盘上的会话文件路径,而不是字符串 ID(见上文 [Pi](#pi))。
+Multica 会保存工具返回的会话标识。下一次在同一 issue 中继续工作时,运行时会尝试恢复这段会话;无法恢复时,会创建一个新会话继续执行。Pi 保存的是本地会话文件路径,因此更依赖原来的电脑和文件。
-## MCP 配置:按工具不同
+有关重试和会话恢复的规则,见 [执行任务](/tasks#手动重试)。
-**16 款工具里有 12 款实际消费 `mcp_config`:Claude Code、CodeBuddy、Codex、Cursor、Hermes、Kimi、Kiro CLI、OpenCode、OpenClaw、Qoder、Trae CLI、Grok**。其他 4 款(Antigravity、Copilot、DevEco Code、Pi)会接收这个字段但**忽略**——不报错、不警告,只是配置不生效。
+## MCP 配置
-各工具的接入方式不同:Claude Code 和 CodeBuddy 通过 `--mcp-config` 加 `--strict-mcp-config` 接收;Codex 会把 daemon 管理的 `mcp_servers` block 写入单次任务的 `$CODEX_HOME/config.toml`;Cursor 会写入 `.cursor/mcp.json`,并把项目 approval 写到单次任务的 `CURSOR_DATA_DIR`;Hermes、Kimi、Kiro CLI、Qoder、Trae CLI、Grok 通过 ACP `mcpServers` 接收;OpenCode 通过 `OPENCODE_CONFIG_CONTENT` 环境变量内联接收;OpenClaw 通过 Multica 的单次任务配置 wrapper 接收 `mcp.servers`。OpenCode 这条路径**不会**改写项目里的 `opencode.json`。
+Antigravity、GitHub Copilot CLI、DevEco Code 和 Pi 暂不读取智能体中的 MCP 配置,因此创建智能体时不会显示这一项。
<Callout type="warning">
-如果你在智能体配置里设置了 `mcp_config`,但选了矩阵 MCP 列没有标 ✅ 的工具,你的 MCP server 对这个智能体**没有效果**。MCP 集成是按工具实现的。
+MCP server 的命令、参数和环境变量会随智能体配置保存在服务器端。不要把不需要共享的本地凭据直接写入配置。
</Callout>
-## skill 文件该放哪儿
+## Skill 注入方式
-每款工具用**自己**的 skill 发现路径。Multica 的守护进程在执行任务前把 workspace 的 skill 文件复制到对应路径下:
+执行开始前,Multica 会把智能体绑定的 skill 写入上表对应的位置,让工具通过自己的原生机制发现它们。
-| 工具 | 路径 | 是否原生发现 |
-|---|---|---|
-| Claude Code | `.claude/skills/` | ✅ 原生 |
-| CodeBuddy | `.codebuddy/skills/` | ✅ 原生 |
-| Codex | `$CODEX_HOME/skills/` | ✅ 原生 |
-| Copilot | `.github/skills/` | ✅ 原生 |
-| Cursor | `.cursor/skills/` | ✅ 原生 |
-| Kimi | `.kimi/skills/` | ✅ 原生 |
-| Kiro CLI | `.kiro/skills/` | ✅ 原生 |
-| OpenCode | `.opencode/skills/` | ✅ 原生 |
-| DevEco Code | `.deveco/skills/` | ✅ 原生 |
-| Pi | `.pi/skills/` | ✅ 原生 |
-| Qoder | `.qoder/skills/` | ✅ 原生 |
-| Trae CLI | `.traecli/skills/` | ✅ 原生 |
-| Grok | `.grok/skills/` | ✅ 原生 |
-| Antigravity | `.agents/skills/` | ✅ 原生(沿用 Gemini CLI 的 workspace 布局——见 [Antigravity 文档](https://antigravity.google/docs/gcli-migration))|
-| Hermes | `HERMES_HOME/skills/` (单次任务 home)| ✅ 原生(每个任务从 `~/.hermes/` 播种)|
-| OpenClaw | `.agent_context/skills/` | ⚠️ 通用 fallback |
+仓库里原本存在的 skill 不会被覆盖。如果名称冲突,Multica 会为注入的副本使用另一个目录名;执行结束后,只清理自己创建的文件。
-fallback 路径对应的工具是否真的读取这个目录,取决于工具本身的文档——没保证。如果你的 skill 对 OpenClaw 没起效,先查这个问题。
+Codex、Hermes 和 OpenClaw 的处理稍有不同:
-对原生项目级路径来说,repo-scoped discovery 是预期行为:如果检出的仓库已经包含对应目录,底层工具可以自己发现这些提交在仓库里的 Skill。你不需要为了在这个仓库里使用这些 repo skills 而先把它们导入 Multica。Multica 会保持这些仓库文件不变。如果某个工作区 Skill 的自然目录名相同,守护进程会把工作区副本写到类似 `review-helper-multica` 的无冲突 sibling 目录。
+- Codex 使用单次执行的 `CODEX_HOME`,不会把 skill 写进系统级 Codex 目录。
+- Hermes 使用单次执行的 `HERMES_HOME`。已有的本地配置仍然可以被读取,但绑定的 skill 与会话数据按任务隔离。这套隔离只在智能体绑定了 skill 时启用,没有绑定 skill 的任务使用本机原有的 Hermes 主目录。
+- OpenClaw 使用当前任务工作目录下的 `skills/`,并由单次执行配置把该目录设为工作区。
-skill 的创建和使用详见 [技能](/skills)。
+如何创建和绑定 skill,见 [Skills](/skills)。
-## 下一步
+## 接下来
-- [创建和配置智能体](/agents-create) —— 给你的智能体挑一款工具
-- [执行任务](/tasks) —— 任务的生命周期和会话恢复机制
-- [守护进程与运行时](/daemon-runtimes) —— 工具跑在哪里、怎么连进 Multica
+- [创建和配置智能体](/agents-create) — 模型与思考强度设置。
+- [安装 AI 编程工具](/install-agent-runtime) — 安装与检测步骤。
+- [守护进程与运行时](/daemon-runtimes) — 运行时注册与并发。
diff --git a/apps/docs/content/docs/self-host-quickstart.ja.mdx b/apps/docs/content/docs/self-host-quickstart.ja.mdx
index 06ce08d22b..7f3799206e 100644
--- a/apps/docs/content/docs/self-host-quickstart.ja.mdx
+++ b/apps/docs/content/docs/self-host-quickstart.ja.mdx
@@ -1,223 +1,248 @@
---
-title: セルフホスティングのクイックスタート
-description: Docker で自分のサーバーやマシン上に Multica を実行します(Kubernetes では Helm が利用できます)。所要時間は約10分です。
+title: セルフホストクイックスタート
+description: Docker Compose で Multica を起動し、ログインして、最初の実行用コンピュータを接続します。
---
import { Callout } from "fumadocs-ui/components/callout";
-このページでは、Docker を使って Multica **サーバー**(バックエンド + フロントエンド + PostgreSQL)を自分のマシンやサーバー上で実行する手順を案内します。完了すると、[ワークスペース](/workspaces)、[イシュー](/issues)、[コメント](/comments)、[エージェント](/agents)の構成を含むデータが、完全にあなたの管理下に置かれます。
+Multica のセルフホストは 2 つの部分に分かれます。
-エージェントの **実行** は、依然としてローカルで動かす[デーモン](/daemon-runtimes)と、そのマシンにインストールされた [AI コーディングツール](/providers)に依存します — Cloud とまったく同じです。セルフホスティングはサーバー層を置き換えるだけで、実行層を置き換えるわけではありません。
+| 構成要素 | 実行するもの | 置く場所 |
+|---|---|---|
+| **Multica サービス** | Web、API、PostgreSQL | Docker をインストールした 1 台のマシン |
+| **実行用コンピュータ** | Multica デーモンと AI コーディングツール | 開発者が実際に作業するコンピュータ |
-## 前提条件
+両者は同じマシンでも、別々のマシンでも構いません。セルフホストで置き換えるのは Multica Cloud の部分だけです。
-- **Docker** がインストールされ、`docker compose` を実行できること
-- **Git**(任意ですが、ソースを取得できるので推奨)
-- 常時稼働させられるマシン(ローカル / 内部ネットワーク / クラウドホストのいずれでも可)
-- **デーモンを実行するマシン** に AI コーディングツールが最低1つインストールされていること(サーバーを実行するマシンである必要はなく、開発用ノートパソコンでも構いません)
+このページでは Docker Compose を使います。Kubernetes でのデプロイは、リポジトリの [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative) を参照してください。
-## 1. プロジェクトを取得してバックエンドを起動する
+## 始める前に
-<Callout type="info">
-**すでに Kubernetes を使っていますか?** Docker をスキップして代わりに Helm チャートを使ってください — 下記の [Kubernetes デプロイ](#kubernetes-deployment-alternative)へ移動し、初回ログインのために [ステップ4](#4-first-login--create-a-workspace)に戻ってきてください。
-</Callout>
+Multica サービスを実行するマシンには次が必要です。
+
+- Docker Engine または Docker Desktop(`docker compose` が実行できること)
+- Git、Make、curl、OpenSSL
+- ポート `3000` と `8080` が空いていること
+
+まず Docker と Compose が使えることを確認します。
```bash
-git clone https://github.com/multica-ai/multica.git
+docker info
+docker compose version
+```
+
+Multica は Compose v2(`docker compose`)を使います。旧版の `docker-compose` v1 はサポートされません。
+
+実行用コンピュータには、Claude Code、Codex、Cursor などの [AI コーディングツール](/providers)を最低 1 つインストールし、ログインしておく必要があります。Multica CLI はステップ 5 でインストールします。
+
+## 1. Multica を起動する
+
+サービスを実行するマシンで次を実行します。
+
+```bash
+git clone --depth 1 https://github.com/multica-ai/multica.git
cd multica
make selfhost
```
-`make selfhost` は次のことを行います。
-
-1. `.env` がなければ `.env.example` から生成し、**ランダムな JWT_SECRET と Postgres パスワード** を併せて作成します
-2. 公式の Docker イメージ(PostgreSQL、Multica backend、Multica frontend)を取得します
-3. `docker-compose.selfhost.yml` を使ってすべてのサービスを起動します
-4. バックエンドの `/health` エンドポイントが準備できるまで待機します
+初回実行時、`make selfhost` は次を行います。
-起動後の継続的なプロダクションプローブには、データベースや migration の問題でチェックが失敗するようにしたい場合は `/readyz` を使ってください。
+1. `.env.example` から `.env` を作成する
+2. `JWT_SECRET`、PostgreSQL パスワード、`MULTICA_VCS_SECRET_KEY`(セルフホストの Git 連携用の暗号化キー)をランダム生成する
+3. PostgreSQL、Multica backend、Multica frontend のイメージを取得する
+4. 永続化ボリュームを作成し、3 つのコンテナを起動する
+5. backend がヘルスチェックに応答し始めるまで待機する
-バックエンドのコンテナは起動時に **データベースの migration を自動で実行します**(`docker/entrypoint.sh` がサーバー起動前に `./migrate up` を実行)— バックエンドのログで migration の出力を確認できます。バージョンアップグレードも同じ方法で処理されます。
+2 回目以降の `make selfhost` は既存の `.env` とボリュームをそのまま使い、シークレットを再生成しません。
<Callout type="info">
-**イメージがまだ公開されていませんか?** `make selfhost` がイメージを取得できない場合、まだリリースされていないバージョンタグにいる可能性があります。安定リリースに切り替えるか、ソースからビルドしてください: `make selfhost-build`。
+`make selfhost` は公開済みのイメージを取得し、checkout 中のコードをビルドしません。ローカルのソースを試すには `make selfhost-build` を使ってください。
</Callout>
-起動すると次のようになります。
+## 2. サービスの準備完了を確認する
-- **フロントエンド**: [http://localhost:3000](http://localhost:3000)
-- **バックエンド**: [http://localhost:8080](http://localhost:8080)
+コンテナの状態を確認します。
-<Callout type="info">
-**ポートは `127.0.0.1` でのみ待ち受けます。** `docker-compose.selfhost.yml` は公開されるすべてのポートを loopback にバインドします — `ss -tlnp` には `0.0.0.0:8080` は表示されず、設計上、他のマシンからはサービスにアクセスできません。サーバーのシークレットと Postgres の認証情報は、公開インターネット上に置いては絶対にいけません。マシン間アクセスが必要な場合は、TLS を終端するリバースプロキシをスタックの前に置いてください — [ステップ5b — マシン間: リバースプロキシを前に置く](#5b-cross-machine-front-with-a-reverse-proxy)を参照してください。
-</Callout>
+```bash
+docker compose -f docker-compose.selfhost.yml ps
+```
-## 2. 重要: プロダクションの安全設定を維持する
+`postgres` が `healthy`、`backend` と `frontend` が実行中であることを確認します。続いて backend、データベース、migration をチェックします。
-<Callout type="warning">
-**`docker-compose.selfhost.yml` はデフォルトで `APP_ENV` を `production` に設定し**、`MULTICA_DEV_VERIFICATION_CODE` を空のままにするため、公開インスタンスには固定コードがありません。
+```bash
+curl -fsS http://localhost:8080/readyz
+```
-`MULTICA_DEV_VERIFICATION_CODE` はローカルまたは非公開のテスト自動化でのみ設定してください。`APP_ENV` が non-production のときに固定コードが有効になっていると、コードをリクエストできる誰もがその固定値でサインインできてしまいます。[認証設定 → 固定のローカルテストコード](/auth-setup#fixed-local-testing-codes)を参照してください。
+期待されるレスポンスは次のとおりです。
-公開デプロイの前には、`.env` に `APP_ENV=production` が設定され、`MULTICA_DEV_VERIFICATION_CODE` が空であることを必ず確認してください。
-</Callout>
+```json
+{"status":"ok","checks":{"db":"ok","migrations":"ok"}}
+```
-## 3. メールサービスを構成する(任意ですが推奨)
+backend コンテナは起動のたびにデータベースの migration を実行してからサービスを開始するため、migration コマンドを手動で実行する必要はありません。
-メールを構成しないと、ユーザーはメールで認証コードを受け取れず、サーバーは生成したコードを代わりに stdout に出力します。
+## 3. アクセス方法を選ぶ
-2種類の配信バックエンドがサポートされています — ネットワークに合うものを選んでください。
+### ローカルアクセス
-**オプション A — Resend(クラウド / 公開インターネットのデプロイ):**
+[http://localhost:3000](http://localhost:3000) をそのまま開きます。後で `multica setup self-host` を実行するときも、URL を渡す必要はありません。
-1. [Resend](https://resend.com/) にサインアップして API key を取得します
-2. 自分が管理する送信用ドメインを認証します
-3. `.env` に次を設定します。
+### リモートアクセス
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxx
- ```
+Docker Compose はデフォルトで `3000` と `8080` を `127.0.0.1` だけにバインドします。`0.0.0.0` に変えて公開インターネットへ直接さらさず、HTTPS 付きのリバースプロキシを使ってください。
-**オプション B — SMTP relay(内部ネットワーク / オンプレミス):**
+以下では 2 つのドメインを例にします。
-デプロイ環境が `api.resend.com` に到達できない場合や、すでに内部メールリレー(Microsoft Exchange、Postfix、オンプレミスの SendGrid など)がある場合に使ってください。両方が設定されている場合は `SMTP_HOST` が Resend より優先されるため、認証メールと招待メールは内部リレーにとどまります。STARTTLS は広告されると自動的にアップグレードされます。ポート `465`(SMTPS / 暗黙的 TLS)は接続直後の TLS ハンドシェイクを自動的に有効化し、`SMTP_TLS=implicit`(別名: `smtps`、`ssl`)は非標準の SMTPS ポートで強制的に有効化します。
+- `app.example.com`: Multica Web
+- `api.example.com`: API、ヘルスチェック、デーモン接続
-**匿名 Exchange 内部リレー(ポート 25)** — ホストが IP で信頼され、認証情報なしで送信する場合:
+まず `.env` に公開 URL を設定します。
```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # reused as the From: header
+FRONTEND_ORIGIN=https://app.example.com
+MULTICA_APP_URL=https://app.example.com
+MULTICA_PUBLIC_URL=https://api.example.com
```
-**認証付き送信(ポート 587、STARTTLS)** — リレーがサービスアカウントを必要とし、STARTTLS が広告されると自動的にアップグレードされる場合:
+この構成ではブラウザのトラフィックがすべて app ドメインを経由し、cookie がドメインをまたがないため、`COOKIE_DOMAIN` の設定は不要です。ブラウザに api ドメインへ直接アクセスさせる場合は設定が必須です。[環境変数](/environment-variables)を参照してください。
-```bash
-SMTP_HOST=smtp.internal.example.com
-SMTP_PORT=587
-SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # set true only for private CA / self-signed
+次に DNS を設定し、Caddy でローカルポートをプロキシします。
+
+```text
+app.example.com {
+ # ブラウザの WebSocket は backend へ直接渡す
+ @ws path /ws /ws/*
+ handle @ws {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+ }
+
+ # 残りのパスは frontend へ。API とログインのリクエストを転送する
+ handle {
+ reverse_proxy 127.0.0.1:3000
+ }
+}
+
+api.example.com {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+}
```
-**暗黙的 TLS / SMTPS(ポート 465)** — STARTTLS を広告しないアリババクラウド / テンセントの法人メールなどのプロバイダー向け。ポート `465` は暗黙的 TLS を自動的に有効化するため、ここでは `SMTP_TLS` は省略可能です:
+Caddy が TLS 証明書を取得し、WebSocket を転送します。`.env` を変更したら、`up -d` でコンテナを作り直して新しい設定を反映します。
```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # optional on 465; required on a non-standard SMTPS port
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS https://api.example.com/readyz
```
-**厳格な公開 relay(例: Google Workspace `smtp-relay.gmail.com`)** が公開 IP からのデフォルトの `localhost` 挨拶を拒否する場合は、`SMTP_EHLO_NAME` を relay が期待する FQDN に設定してください — そうしないと接続が切断され、後続のコマンドで不明瞭な `EOF` として表面化します。デフォルトはコンテナのホスト名で、これは通常は有効な FQDN ではありません。
+<Callout type="warning">
+`docker compose restart` は既存のコンテナを再起動するだけで、`.env` を読み直しません。設定を変更した後に `.env` を読み直すには、`docker compose -f docker-compose.selfhost.yml up -d` を実行してください。
+</Callout>
+
+## 4. ログインしてワークスペースを作成する
+
+ローカルの `http://localhost:3000`、または先ほど設定した `https://app.example.com` を開き、メールアドレスを入力して認証コードをリクエストします。
+
+デフォルトではメールサービスは設定されていません。コードをリクエストしたら、backend のログから読み取ります。
```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # FQDN the relay accepts; defaults to the (non-FQDN) container hostname
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "Verification code"
```
-その後、再起動します: `docker compose -f docker-compose.selfhost.yml restart backend`。再起動時、バックエンドはどのプロバイダーを選んだかを出力します(`EmailService: SMTP relay …` / `Resend API` / `DEV mode`)— 認証情報は決してログに残らないため、この行はヘルプを求めるときに共有しても安全です。
-
-追加の認証構成(OAuth、サインアップの許可リスト)と SMTP 変数の完全なリファレンスは、[認証設定](/auth-setup)と[環境変数 → メール](/environment-variables#email-configuration)を参照してください。
+ログには次のような行が出力されます。
-## 4. 初回ログイン + ワークスペースの作成
+```text
+[DEV] Verification code for [email protected]: 123456
+```
-[http://localhost:3000](http://localhost:3000) を開きます。
+コードを入力して、最初のワークスペースを作成します。Resend または SMTP を設定すると認証コードはメールで送信され、メンバーがコンテナログを読む必要はなくなります。詳しくは[ログインとサインアップ設定](/auth-setup)を参照してください。
-- メールアドレスを入力します
-- 構成したメールバックエンド(Resend または SMTP relay)から認証コードを受け取ります。どちらも構成していない場合は、サーバーコンテナの stdout からコピーしてください — `[DEV] Verification code` の行を探します
-- non-production の非公開インスタンスで `MULTICA_DEV_VERIFICATION_CODE=888888` を明示的に設定した場合を除き、`888888` を使わないでください
-- ログインして最初のワークスペースを作成します
+<Callout type="warning">
+セルフホストのデプロイはデフォルトで `APP_ENV=production` を使い、固定の認証コードは有効になりません。公開インスタンスで `MULTICA_DEV_VERIFICATION_CODE` を設定しないでください。
+</Callout>
-## 5. CLI を自分のサーバーに向ける
+## 5. 実行用コンピュータを接続する
-CLI のインストールは [Cloud クイックスタート → 2. CLI をインストールする](/cloud-quickstart#2-install-the-multica-cli) と同じです — Homebrew / スクリプト / PowerShell のいずれかを選んでください。
+以下のコマンドは **AI コーディングツールを実行するコンピュータ**で実行します。Docker を実行しているサーバーとは限りません。
-### 5a. 同じマシン
+まず Multica CLI をインストールします。
-CLI とサーバーが同じホストで動作している場合、デフォルト値ですでに動作します。
+**macOS / Linux**
```bash
-multica setup self-host
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-これにより CLI が `http://localhost:8080`(バックエンド)と `http://localhost:3000`(フロントエンド)を指すようになり、ブラウザログインを案内し、PAT をローカルに保存して、**デーモンを自動的に起動します**。
+**Windows PowerShell**
-### 5b. マシン間: リバースプロキシを前に置く
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-compose スタックは `127.0.0.1` でのみ待ち受けるため、別のマシンにあるデーモンは `http://<server-ip>:8080` に直接接続できません — そして、そうなることを望むべきでもありません。さもなければサーバーのシークレットが公開インターネットから到達可能になってしまうからです。TLS を終端し、`127.0.0.1:8080`(バックエンド)と `127.0.0.1:3000`(フロントエンド)へ転送するリバースプロキシをサーバーに置き、CLI を公開 HTTPS URL に向けてください。
+Multica サービスがこのコンピュータでも動いている場合は、次を実行します。
```bash
-multica setup self-host \
- --server-url https://<your-domain> \
- --app-url https://<your-domain>
+multica setup self-host
```
-<Callout type="info">
-フラグより環境変数を使いたい場合は、対応するフラグを省略すると `setup self-host` が `MULTICA_SERVER_URL` と `MULTICA_APP_URL` を読み取ります(両方設定した場合はフラグが優先されます)。`MULTICA_SERVER_URL` は[環境変数](/environment-variables)で示される `ws://…/ws` というデーモン形式も受け付け、HTTP ベース URL に正規化します。
-</Callout>
+Multica サービスが別のマシンで動いている場合は、先ほど設定した 2 つの URL を渡します。
-単一のホスト名でフロントエンドとバックエンドの両方を前段に置く(デーモンと Web アプリの両方に必要な WebSocket サポートを含む)最小限の Caddyfile は次のとおりです。
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-```nginx
-multica.example.com {
- # WebSocket route — must come before the catch-all
- @ws path /ws /ws/*
- handle @ws {
- reverse_proxy 127.0.0.1:8080 {
- flush_interval -1
- }
- }
+このコマンドはまず `<server-url>/health` を確認し、次にブラウザを開いてログインを完了します。ログイン後はローカルに認証情報を保存し、デーモンを起動します。
- # Backend API
- handle /api/* {
- reverse_proxy 127.0.0.1:8080
- }
+接続状態を確認します。
- # Everything else → frontend
- reverse_proxy 127.0.0.1:3000
-}
+```bash
+multica daemon status
```
-プロキシを立ち上げたら、サーバーの `.env` に `FRONTEND_ORIGIN=https://multica.example.com` を設定してバックエンドを再起動してください — そうしないと WebSocket の origin チェックがブラウザを拒否します([トラブルシューティング → WebSocket が接続できない](/troubleshooting#websocket-cant-connect))。
+正常であれば、出力に次が表示されます。
-[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) も堅実な選択肢です — ホストにポートを一切公開せずに TLS と公開ホスト名を提供してくれます。Nginx で同等に構成する方法(`app.` / `api.` を別々のホスト名に分離、WebSocket 用の `proxy_set_header Upgrade`)も同じくらいうまく動作します。重要な要件は、TLS の終端と `/ws` での `Upgrade` ヘッダーの転送です。
+- `Daemon: running`
+- `Agents` にこのマシンにインストール済みの AI コーディングツールが並ぶ
+- `Workspaces` が `0` より大きい
-## 6. エージェントの作成 + 最初のタスクの割り当て
+## 6. 最初の実行を完了する
-Cloud と同じ流れです — [Cloud クイックスタート → ステップ5-6](/cloud-quickstart#5-create-an-agent)を参照してください。
+Multica に戻ります。ランタイム一覧にオンラインのランタイムが表示されたら、エージェントを作成し、最初のイシューを割り当てます。
-<span id="7-usage-rollup-no-operator-action-required" />
+実行ログが完了になり、タイムラインにエージェントの返信が現れれば、セルフホストのサービス、実行用コンピュータ、AI コーディングツールがつながっています。詳しい手順は[クイックスタート](/cloud-quickstart)のステップ 3〜5 を参照してください。
-## 7. 使用量ロールアップ(オペレーターの操作は不要)
+## よく使う管理コマンド
-<Callout type="info">
-使用量 / ランタイムのダッシュボードは、`rollup_task_usage_hourly()` が埋める派生テーブル `task_usage_hourly` からデータを読み取ります。MUL-2957 以降、バックエンドは DB バックドのスケジューラー経由でこのロールアップをインプロセスで実行するようになり、`pg_cron` は不要になりました。外部 cron / systemd タイマーも推奨セットアップではなくなっています。バンドルされた `pgvector/pgvector:pg17` イメージは変更なしで動作します。
-</Callout>
+以下のコマンドはすべて `multica` リポジトリのディレクトリで実行します。
+
+```bash
+# 状態を確認する
+docker compose -f docker-compose.selfhost.yml ps
-インプロセススケジューラーは 30 秒おきにティックし、`sys_cron_executions` テーブルを介して 5 分ごとの UTC プランをクレームします。複数のバックエンドレプリカでも安全です — 一意キー `(job_name, scope_kind, scope_id, plan_time)` により、各プランで勝者は 1 つだけです。新規デプロイでは何の設定も不要です。
+# backend のログを追う
+docker compose -f docker-compose.selfhost.yml logs -f backend
-**互換性 — 既存の `pg_cron` 登録。** 以前 rollup を `pg_cron` ジョブとして登録していた(`SELECT cron.schedule('rollup_task_usage_hourly', '*/5 * * * *', …)`)場合でも、削除する必要はありません — SQL 関数が内部で advisory lock 4246 を保持するため、アプリのスケジューラーと `pg_cron` が二重書き込みすることはありません。冗長なエントリを削除するには:
+# .env の変更を反映する
+docker compose -f docker-compose.selfhost.yml up -d
-```sql
-SELECT cron.unschedule('rollup_task_usage_hourly')
- FROM cron.job WHERE jobname = 'rollup_task_usage_hourly';
+# サービスを停止する(ボリュームは保持)
+docker compose -f docker-compose.selfhost.yml down
```
-**`v0.3.4 → v0.3.5+` からのアップグレード。** 以前のリリースでは、migration 103 を適用する前にオペレーターが手動で `cmd/backfill_task_usage_hourly` を実行する必要があり、そうしないと migration の fail-closed ガードが `migrate up` を中断していました。MUL-2957 以降、これは自動化されました — migrate コマンドが migration 103 を適用する直前に冪等な月単位スライスのバックフィル(advisory lock 4246 の下)を実行してから処理を続行します。忙しい DB では `--sleep-between-slices=2s` で読み取り負荷を絞るためにスタンドアロンの backfill を実行することもできますが、もはや必須ではありません。
-
-完全なリファレンス(運用ノートと Kubernetes デプロイ形態を含む)は、リポジトリの [`SELF_HOSTING_ADVANCED.md → Usage Dashboard Rollup`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING_ADVANCED.md#usage-dashboard-rollup) にあります。
+公開済みの最新イメージへアップグレードします。
-## アップグレード
+```bash
+git pull --ff-only
+docker compose -f docker-compose.selfhost.yml pull
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS http://localhost:8080/readyz
+```
Docker Compose 構成のアップグレード方法は2通りあります。既存の構成では**同じ結果**になります — `Makefile` の `selfhost` ターゲットは同じ `docker compose pull` + `up -d` を実行し、加えて `.env` が無ければ生成し、`/health` を待ってからステータスの要約を表示します。好きな方を使ってください。
@@ -276,6 +301,8 @@ docker compose -f docker-compose.selfhost.yml exec -T postgres \
docker compose -f docker-compose.selfhost.yml logs -f backend
```
+migration は backend の起動時に自動で実行されます。過去データのバックフィルが必要な migration(103 など)も、バックフィルまで自動で完了します。ごくまれに自動バックフィルが `refusing to drop legacy daily rollups` で失敗することがあります。対処は[トラブルシューティング](/troubleshooting#migration-103-の失敗)を参照してください。
+
### `/health` ではなく `/readyz` で検証する
`/health` は **liveness** プローブで、プロセスが生きている限り `{"status":"ok"}` を返します — migration が失敗していても同じです。`/readyz`(`server/cmd/server/router.go:680`、`/healthz` はそのエイリアス)はデータベースと適用済み migration の集合をチェックするため、失敗したアップグレードを捕捉できるのはこちらです。
@@ -291,67 +318,27 @@ HTTP 200 かつ両方のチェックが `ok` でない場合、新しいバー
Helm には独自のアップグレード経路があります。values ファイルで `images.backend.tag` / `images.frontend.tag` に目的のリリースを設定し、`helm upgrade` を実行してください。タグを変えると Pod スペックが変わるため、Kubernetes が新しいイメージを取得して Deployment をロールします — これが確実な経路です。
-`kubectl -n multica rollout restart` はそれ単体ではアップグレードになりません。チャートは `pullPolicy: IfNotPresent` を同梱しているため(`deploy/helm/multica/values.yaml`)、そのタグをすでにキャッシュしているノードでは古いイメージが再利用され、restart しても何も変わりません — `MULTICA_IMAGE_TAG` の固定と同種の落とし穴です。浮動タグでこの方法を使いたい場合は、先に `images.backend.pullPolicy` / `images.frontend.pullPolicy` を `Always` に設定してください。下記の [Kubernetes デプロイ(代替手段)](#kubernetes-デプロイ代替手段)を参照してください。
-
-## Kubernetes デプロイ(代替手段)
+`kubectl -n multica rollout restart` はそれ単体ではアップグレードになりません。チャートは `pullPolicy: IfNotPresent` を同梱しているため(`deploy/helm/multica/values.yaml`)、そのタグをすでにキャッシュしているノードでは古いイメージが再利用され、restart しても何も変わりません — `MULTICA_IMAGE_TAG` の固定と同種の落とし穴です。浮動タグでこの方法を使いたい場合は、先に `images.backend.pullPolicy` / `images.frontend.pullPolicy` を `Always` に設定してください。リポジトリの [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative) を参照してください。
-すでに Kubernetes クラスターを運用している場合、リポジトリには `deploy/helm/multica/` に Helm チャートも同梱されています。k8s 用の `make selfhost` に相当します — 同じバックエンドイメージ、フロントエンドイメージ、`pgvector/pgvector:pg17` の Postgres を Deployment / Service / Ingress としてパッケージングし、`values.yaml` からレンダリングされた1つの `ConfigMap` を併せて提供します。k3s + Traefik + `local-path` を基準に作成されており、Ingress コントローラーとデフォルトの `ReadWriteOnce` StorageClass があるあらゆるクラスターで動作するはずです。
-
-このチャートは **シークレット値をテンプレート化しません**。`multica-secrets` という名前の Secret を名前で参照するため、実際の JWT / DB / Resend / Google キーが git や `values.yaml` に置かれる必要はまったくありません。ネームスペースと Secret を kubectl で一度作成してください。
-
-```bash
-kubectl create namespace multica
-
-kubectl -n multica create secret generic multica-secrets \
- --from-literal=JWT_SECRET="$(openssl rand -hex 32)" \
- --from-literal=POSTGRES_PASSWORD="$(openssl rand -hex 16)" \
- --from-literal=RESEND_API_KEY="" \
- --from-literal=GOOGLE_CLIENT_SECRET="" \
- --from-literal=CLOUDFRONT_PRIVATE_KEY="" \
- --from-literal=MULTICA_DEV_VERIFICATION_CODE=""
-```
-
-その後、チャートをインストールします。
-
-```bash
-git clone https://github.com/multica-ai/multica.git
-cd multica
-helm install multica deploy/helm/multica -n multica
-```
-
-デフォルト値はホスト名 `multica.dev.lan`(web)と `api.multica.dev.lan`(バックエンド)を想定しています。これらを `/etc/hosts`(またはローカル DNS)に追加し、Ingress に到達可能な任意のノード IP を指すようにしてください。別のホスト名を使うには、`deploy/helm/multica/values.yaml` をコピーして `ingress.frontend.host` / `ingress.backend.host` と、それに対応する `backend.config.appUrl` / `frontendOrigin` / `localUploadBaseUrl` / `googleRedirectUri` を編集し、`-f my-values.yaml` でインストールしてください。
-
-コールドクラスターでは、バックエンドが Postgres を待ち、migration を実行する間、数分間 `Running` 状態だが `Ready` ではないことがあります — startupProbe がこれを吸収するため、ポッドは再起動されないはずです。`Ready` になったら:
-
-```bash
-curl -H "Host: api.multica.dev.lan" http://<ingress-ip>/healthz
-# {"status":"ok","checks":{"db":"ok","migrations":"ok"}}
-```
-
-その後 `http://multica.dev.lan` を開き、上記の [ステップ4 — 初回ログイン](#4-first-login--create-a-workspace)から続けてください。CLI を Ingress のホスト名に向けます。
-
-```bash
-multica setup self-host \
- --server-url http://api.multica.dev.lan \
- --app-url http://multica.dev.lan
-```
-
-特定の Multica リリースに移行するには、values ファイルで `images.backend.tag` / `images.frontend.tag` を設定して `helm upgrade` を実行してください — タグが変わることで再取得とロールアウトが強制されるため、アップグレードもこの経路を使います。`kubectl -n multica rollout restart deploy/multica-backend deploy/multica-frontend` が浮動タグを取り直すのは、`images.backend.pullPolicy` / `images.frontend.pullPolicy` を `Always` に設定している場合だけです。チャートのデフォルトは `IfNotPresent` で、ノードがすでにキャッシュしているイメージを再利用します。`helm -n multica uninstall multica` はワークロードを削除しますが、PVC と Secret は保持します。`kubectl delete namespace multica` はすべてを消去します。
-
-完全なリファレンス — 3つのログインモード、web イメージにビルド時に焼き込まれた `REMOTE_API_URL` に対する `backend` ExternalName の回避策、リソース制限、TLS — は、リポジトリの [`SELF_HOSTING.md`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative) にあります。
+<Callout type="warning">
+`docker compose down` は `pgdata` と `backend_uploads` を保持します。`-v` を付けると、データベースを含むこれらのボリュームが削除されます。インスタンスを消去するつもりがない限り、`docker compose down -v` を実行しないでください。
+</Callout>
## よくある問題
-- **バックエンドが起動しない**: `docker compose -f docker-compose.selfhost.yml logs backend` でコンテナのログを確認してください。たいていは `.env` の不正な `DATABASE_URL` または `JWT_SECRET` が原因です
-- **認証コードが届かない**: メールバックエンドが構成されていない場合(Resend も SMTP もない)→ `docker compose logs backend` で `[DEV] Verification code` を探してください
-- **WebSocket が接続できない**: 公開デプロイでは、`FRONTEND_ORIGIN` を実際のフロントエンドのドメインに必ず設定する必要があります。[トラブルシューティング → WebSocket が接続できない](/troubleshooting#websocket-wont-connect)を参照してください
-- **使用量 / ランタイムのダッシュボードがゼロのまま**: `rollup_task_usage_hourly()` がスケジューリングされていません — 上記の [ステップ7](#7-usage-rollup-no-operator-action-required)と[トラブルシューティング → 使用量ダッシュボードがゼロと表示される](/troubleshooting#usage-dashboard-stays-at-zero)を参照してください
-- **`migrate up` が `refusing to drop legacy daily rollups` で失敗する**: `v0.3.4 → v0.3.5+` のアップグレード経路ガードです。MUL-2957 以降、migrate コマンドは migration 103 を適用する前に自動でバックフィルを実行します — [ステップ7](#7-usage-rollup-no-operator-action-required)を参照してください
+| 症状 | まず確認すること |
+|---|---|
+| `/readyz` が `ok` を返さない | `docker compose -f docker-compose.selfhost.yml logs backend postgres` を実行する。 |
+| 認証コードが届かない | コードを一度リクエストし、backend のログで `Verification code` を探す。 |
+| `setup self-host` が server に到達できないと報告する | 実行用コンピュータから `https://api.example.com/health` をリクエストし、DNS、TLS、リバースプロキシがすべて到達可能か確認する。 |
+| デーモンが `Agents` を表示しない | AI コーディングツールが `PATH` にありログイン済みであることを確認し、`multica daemon restart` を実行する。 |
+| イシューがキューにとどまり続ける | `multica daemon status` を実行し、デーモンが起動していてワークスペースに接続していることを確認する。 |
+
+その他のケースは[トラブルシューティング](/troubleshooting)を参照してください。
## 次のステップ
-- [環境変数](/environment-variables) — 完全な env リファレンス
-- [認証設定](/auth-setup) — Resend / OAuth / サインアップ許可リストの詳細
-- [GitHub 連携](/github-integration) — GitHub App を接続して、PR がイシューに自動でリンクされ、マージするとイシューが閉じられるように設定する
-- [トラブルシューティング](/troubleshooting) — うまくいかないときはここから始めてください
-- [デスクトップアプリ](/desktop-app) — `~/.multica/desktop.json` を通じた任意のデスクトップ設定。Web フロントエンド + CLI が依然として最速のセルフホスティング経路です
+- [ログインとサインアップ設定](/auth-setup) — メール、Google ログイン、サインアップ範囲を設定する。
+- [環境変数](/environment-variables) — サーバー設定の完全なリファレンス。
+- [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md) — Kubernetes、アップグレード、手動デプロイ。
+- [デスクトップアプリ](/desktop-app) — デスクトップアプリをセルフホストのサービスに接続する。
diff --git a/apps/docs/content/docs/self-host-quickstart.ko.mdx b/apps/docs/content/docs/self-host-quickstart.ko.mdx
index 8a2144c031..334528150e 100644
--- a/apps/docs/content/docs/self-host-quickstart.ko.mdx
+++ b/apps/docs/content/docs/self-host-quickstart.ko.mdx
@@ -1,223 +1,248 @@
---
title: 자체 호스팅 빠른 시작
-description: Docker로 자체 서버나 기기에서 Multica를 실행합니다(Kubernetes에서는 Helm 사용 가능). 약 10분 소요됩니다.
+description: Docker Compose로 Multica를 시작하고 로그인한 뒤 첫 실행 컴퓨터를 연결합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-이 페이지는 Docker로 Multica **서버**(백엔드 + 프런트엔드 + PostgreSQL)를 자체 기기나 서버에서 실행하는 과정을 안내합니다. 완료하면 [워크스페이스](/workspaces), [이슈](/issues), [댓글](/comments), [에이전트](/agents) 구성을 비롯한 데이터가 완전히 본인의 통제하에 놓입니다.
+자체 호스팅 Multica는 두 부분으로 나뉩니다.
-에이전트 **실행**은 여전히 로컬에서 실행하는 [데몬](/daemon-runtimes)과 그 기기에 설치된 [AI 코딩 도구](/providers)에 의존합니다 — Cloud와 완전히 동일합니다. 자체 호스팅은 서버 계층을 교체할 뿐, 실행 계층을 교체하지는 않습니다.
+| 부분 | 실행하는 항목 | 설치 위치 |
+|---|---|---|
+| **Multica 서비스** | Web, API, PostgreSQL | Docker가 설치된 컴퓨터 |
+| **실행 컴퓨터** | Multica 데몬과 AI 코딩 도구 | 개발자가 실제로 작업하는 컴퓨터 |
-## 사전 요구 사항
+두 부분을 같은 컴퓨터에 둘 수도 있고 분리할 수도 있습니다. 자체 호스팅으로 대체하는 것은 Multica Cloud 부분뿐입니다.
-- **Docker**가 설치되어 있고 `docker compose`를 실행할 수 있어야 함
-- **Git**(선택 사항이지만 소스를 받아올 수 있으므로 권장)
-- 계속 켜둘 수 있는 기기(로컬 / 내부 네트워크 / 클라우드 호스트 모두 가능)
-- **데몬을 실행하는 기기**에 AI 코딩 도구가 최소 한 개 설치되어 있어야 함(서버를 실행하는 기기일 필요는 없으며, 개발용 노트북도 됩니다)
+이 문서에서는 Docker Compose를 사용합니다. Kubernetes 배포는 저장소의 [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative)를 참고하세요.
-## 1. 프로젝트 받아오기 및 백엔드 시작하기
+## 시작하기 전에
-<Callout type="info">
-**이미 Kubernetes를 쓰고 계신가요?** Docker를 건너뛰고 Helm 차트를 사용하세요 — 아래 [Kubernetes 배포](#kubernetes-deployment-alternative)로 이동한 다음, 첫 로그인을 위해 [4단계](#4-first-login--create-a-workspace)로 돌아오세요.
-</Callout>
+Multica 서비스를 실행할 컴퓨터에는 다음 항목이 필요합니다.
+
+- Docker Engine 또는 Docker Desktop, 실행 가능한 `docker compose`
+- Git, Make, curl, OpenSSL
+- 로컬 `3000`, `8080` port가 사용 중이지 않음
+
+먼저 Docker와 Compose를 사용할 수 있는지 확인합니다.
```bash
-git clone https://github.com/multica-ai/multica.git
+docker info
+docker compose version
+```
+
+Multica는 Compose v2인 `docker compose`를 사용합니다. 이전 `docker-compose` v1은 지원하지 않습니다.
+
+실행 컴퓨터에는 Claude Code, Codex, Cursor 같은 [AI 코딩 도구](/providers)가 하나 이상 설치되어 로그인된 상태여야 합니다. Multica CLI는 5단계에서 설치합니다.
+
+## 1. Multica 시작
+
+서비스를 실행할 컴퓨터에서 다음을 실행합니다.
+
+```bash
+git clone --depth 1 https://github.com/multica-ai/multica.git
cd multica
make selfhost
```
-`make selfhost`는 다음을 수행합니다.
-
-1. `.env`가 없으면 `.env.example`로부터 생성하며 **무작위 JWT_SECRET과 Postgres 비밀번호**를 함께 만듭니다
-2. 공식 Docker 이미지(PostgreSQL, Multica backend, Multica frontend)를 받아옵니다
-3. `docker-compose.selfhost.yml`을 사용해 모든 서비스를 시작합니다
-4. 백엔드의 `/health` 엔드포인트가 준비될 때까지 기다립니다
+처음 실행할 때 `make selfhost`가 다음 작업을 수행합니다.
-시작 이후 프로덕션 프로브에는, 데이터베이스나 migration 문제 시 검사가 실패하도록 하려면 `/readyz`를 사용하세요.
+1. `.env.example`에서 `.env` 생성
+2. `JWT_SECRET`, PostgreSQL 비밀번호, `MULTICA_VCS_SECRET_KEY`(자체 호스팅 Git 연동 암호화 키)를 임의 생성
+3. PostgreSQL, Multica backend, Multica frontend 이미지 pull
+4. persistent data volume 생성 및 세 컨테이너 시작
+5. backend가 health check에 응답할 때까지 대기
-백엔드 컨테이너는 시작 시 **데이터베이스 migration을 자동으로 실행합니다**(`docker/entrypoint.sh`가 서버 시작 전에 `./migrate up`을 실행) — 백엔드 로그에서 migration 출력을 확인할 수 있습니다. 버전 업그레이드도 같은 방식으로 처리됩니다.
+이후 `make selfhost`를 다시 실행하면 기존 `.env`와 data volume을 계속 사용하며 키를 새로 만들지 않습니다.
<Callout type="info">
-**이미지가 아직 공개되지 않았나요?** `make selfhost`가 이미지를 받아오지 못한다면 아직 릴리스되지 않은 버전 태그에 있을 수 있습니다. 안정 릴리스로 전환하거나 소스에서 빌드하세요: `make selfhost-build`.
+`make selfhost`는 공개된 이미지를 pull하며 현재 checkout의 코드를 컴파일하지 않습니다. 로컬 소스 코드를 테스트하려면 `make selfhost-build`를 사용하세요.
</Callout>
-시작되면 다음과 같습니다.
+## 2. 서비스 준비 상태 확인
-- **프런트엔드**: [http://localhost:3000](http://localhost:3000)
-- **백엔드**: [http://localhost:8080](http://localhost:8080)
+컨테이너 상태를 확인합니다.
-<Callout type="info">
-**포트는 `127.0.0.1`에서만 수신합니다.** `docker-compose.selfhost.yml`은 공개된 모든 포트를 loopback에 바인딩합니다 — `ss -tlnp`에서는 `0.0.0.0:8080`이 보이지 않으며, 설계상 다른 기기에서는 서비스에 접근할 수 없습니다. 서버 시크릿과 Postgres 자격 증명이 공개 인터넷에 노출되어서는 절대 안 됩니다. 기기 간 접근이 필요하면 TLS를 종료하는 리버스 프록시를 스택 앞에 두세요 — [5b단계 — 기기 간: 리버스 프록시를 앞에 두기](#5b-cross-machine-front-with-a-reverse-proxy)를 참고하세요.
-</Callout>
+```bash
+docker compose -f docker-compose.selfhost.yml ps
+```
-## 2. 중요: 프로덕션 안전 설정 유지하기
+`postgres`는 `healthy`, `backend`와 `frontend`는 실행 중으로 표시되어야 합니다. 그런 다음 backend, 데이터베이스, migration을 확인합니다.
-<Callout type="warning">
-**`docker-compose.selfhost.yml`은 기본적으로 `APP_ENV`를 `production`으로 설정하고** `MULTICA_DEV_VERIFICATION_CODE`를 비워 두므로, 공개 인스턴스에는 고정 코드가 없습니다.
+```bash
+curl -fsS http://localhost:8080/readyz
+```
-`MULTICA_DEV_VERIFICATION_CODE`는 로컬 또는 비공개 테스트 자동화에서만 설정하세요. `APP_ENV`가 non-production일 때 고정 코드가 활성화되어 있으면, 코드를 요청할 수 있는 누구나 그 고정 값으로 로그인할 수 있습니다. [인증 설정 → 고정 로컬 테스트 코드](/auth-setup#fixed-local-testing-codes)를 참고하세요.
+정상 응답:
-공개 배포 전에는 `.env`에 `APP_ENV=production`이 설정되어 있고 `MULTICA_DEV_VERIFICATION_CODE`가 비어 있는지 반드시 확인하세요.
-</Callout>
+```json
+{"status":"ok","checks":{"db":"ok","migrations":"ok"}}
+```
-## 3. 이메일 서비스 구성하기(선택 사항이지만 권장)
+Backend 컨테이너는 시작할 때마다 데이터베이스 migration을 먼저 실행하고 서비스를 시작하므로 migration 명령을 직접 실행할 필요가 없습니다.
-이메일을 구성하지 않으면 사용자가 이메일로 인증 코드를 받을 수 없으며, 서버가 생성된 코드를 대신 stdout에 출력합니다.
+## 3. 접근 방식 선택
-두 가지 전송 백엔드를 지원합니다 — 네트워크에 맞는 것을 고르세요.
+### 로컬에서 접근
-**옵션 A — Resend(클라우드 / 공개 인터넷 배포):**
+[http://localhost:3000](http://localhost:3000)을 바로 엽니다. 이후 `multica setup self-host`를 실행할 때도 URL을 전달할 필요가 없습니다.
-1. [Resend](https://resend.com/)에 가입하고 API key를 받습니다
-2. 본인이 관리하는 발송 도메인을 인증합니다
-3. `.env`에 다음을 설정합니다.
+### 원격에서 접근
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxx
- ```
+Docker Compose는 기본적으로 `3000`과 `8080`을 `127.0.0.1`에만 bind합니다. `0.0.0.0`으로 바꿔 공개 인터넷에 직접 노출하지 말고 HTTPS reverse proxy를 사용하세요.
-**옵션 B — SMTP relay(내부 네트워크 / 온프레미스):**
+다음 두 도메인을 예로 사용합니다.
-배포 환경이 `api.resend.com`에 접근할 수 없거나, 이미 내부 메일 릴레이(Microsoft Exchange, Postfix, 온프레미스 SendGrid 등)가 있는 경우에 사용하세요. 둘 다 설정된 경우 `SMTP_HOST`가 Resend보다 우선하므로, 인증 및 초대 메일이 내부 릴레이에 머무릅니다. STARTTLS는 광고될 때 자동으로 업그레이드됩니다. `465` 포트(SMTPS / 암묵적 TLS)는 연결 직후의 TLS 핸드셰이크를 자동으로 활성화하며, `SMTP_TLS=implicit`(별칭: `smtps`, `ssl`)는 비표준 SMTPS 포트에서 강제로 활성화합니다.
+- `app.example.com`: Multica Web
+- `api.example.com`: API, health check, 데몬 연결
-**익명 Exchange 내부 릴레이(포트 25)** — 호스트가 IP로 신뢰되며 자격 증명 없이 제출하는 경우:
+먼저 `.env`에 공개 주소를 설정합니다.
```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # From: 헤더로도 재사용됨
+FRONTEND_ORIGIN=https://app.example.com
+MULTICA_APP_URL=https://app.example.com
+MULTICA_PUBLIC_URL=https://api.example.com
```
-**인증 제출(포트 587, STARTTLS)** — 릴레이에 서비스 계정이 필요하며, STARTTLS가 광고될 때 자동으로 업그레이드되는 경우:
+이 설정에서는 모든 브라우저 트래픽이 app 도메인을 거치고 cookie가 도메인을 넘지 않으므로 `COOKIE_DOMAIN`을 설정할 필요가 없습니다. 브라우저에서 api 도메인에 직접 접근하게 바꾼다면 반드시 설정해야 합니다. [환경 변수](/environment-variables)를 참고하세요.
-```bash
-SMTP_HOST=smtp.internal.example.com
-SMTP_PORT=587
-SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # 비공개 CA / 자체 서명 인증서일 때만 true로 설정
+그런 다음 DNS를 설정하고 Caddy로 로컬 port를 proxy합니다.
+
+```text
+app.example.com {
+ # 브라우저 WebSocket을 backend로 직접 전달
+ @ws path /ws /ws/*
+ handle @ws {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+ }
+
+ # 나머지 경로는 frontend로 전달하며 frontend가 API와 로그인 요청을 proxy
+ handle {
+ reverse_proxy 127.0.0.1:3000
+ }
+}
+
+api.example.com {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+}
```
-**암묵적 TLS / SMTPS(포트 465)** — STARTTLS를 광고하지 않는 알리바바 클라우드 / 텐센트 기업 메일 같은 제공자용. 포트 `465`는 암묵적 TLS를 자동으로 활성화하므로, 여기서 `SMTP_TLS`는 생략할 수 있습니다:
+Caddy가 TLS 인증서를 발급하고 WebSocket을 전달합니다. `.env`를 수정한 뒤 `up -d`로 컨테이너를 다시 만들어 새 설정을 적용합니다.
```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # optional on 465; required on a non-standard SMTPS port
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS https://api.example.com/readyz
```
-공개 IP에서 보내는 기본 `localhost` greeting을 거부하는 **엄격한 공개 relay(예: Google Workspace `smtp-relay.gmail.com`)** 의 경우, relay가 기대하는 FQDN으로 `SMTP_EHLO_NAME`을 설정하세요 — 그렇지 않으면 연결이 끊기고, 이는 이후 명령에서 불투명한 `EOF`로 나타납니다. 기본값은 컨테이너 호스트명이며, 보통 유효한 FQDN이 아닙니다:
+<Callout type="warning">
+`docker compose restart`는 기존 컨테이너만 다시 시작하며 `.env`를 다시 읽지 않습니다. 설정을 수정한 뒤 `.env`를 다시 읽게 하려면 `docker compose -f docker-compose.selfhost.yml up -d`를 실행하세요.
+</Callout>
+
+## 4. 로그인 및 워크스페이스 만들기
+
+로컬 `http://localhost:3000` 또는 앞에서 설정한 `https://app.example.com`을 열고 이메일을 입력해 인증 코드를 받습니다.
+
+기본 설정에는 이메일 서비스가 없습니다. 인증 코드를 요청한 뒤 backend 로그에서 확인할 수 있습니다.
```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # relay가 받아들이는 FQDN; 기본값은 (FQDN이 아닌) 컨테이너 호스트명
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "Verification code"
```
-그런 다음 재시작합니다: `docker compose -f docker-compose.selfhost.yml restart backend`. 재시작 시 백엔드는 어떤 제공자를 선택했는지 출력합니다(`EmailService: SMTP relay …` / `Resend API` / `DEV mode`) — 자격 증명은 절대 로그에 남지 않으므로, 이 줄은 도움을 요청할 때 공유해도 안전합니다.
+로그에는 다음과 비슷한 내용이 나타납니다.
-추가 인증 구성(OAuth, 가입 허용 목록)과 전체 SMTP 변수 레퍼런스는 [인증 설정](/auth-setup)과 [환경 변수 → 이메일](/environment-variables#email-configuration)을 참고하세요.
-
-## 4. 첫 로그인 + 워크스페이스 생성
+```text
+[DEV] Verification code for [email protected]: 123456
+```
-[http://localhost:3000](http://localhost:3000)을 엽니다.
+인증 코드를 입력하고 첫 워크스페이스를 만듭니다. Resend 또는 SMTP를 설정하면 이메일로 인증 코드가 전달되므로 멤버가 컨테이너 로그를 읽을 필요가 없습니다. 자세한 내용은 [로그인 및 가입 설정](/auth-setup)을 참고하세요.
-- 이메일을 입력합니다
-- 구성한 이메일 백엔드(Resend 또는 SMTP relay)에서 인증 코드를 받습니다. 둘 다 구성하지 않았다면 서버 컨테이너 stdout에서 복사하세요 — `[DEV] Verification code` 줄을 찾으면 됩니다
-- non-production 비공개 인스턴스에서 `MULTICA_DEV_VERIFICATION_CODE=888888`을 명시적으로 설정한 경우가 아니라면 `888888`을 사용하지 마세요
-- 로그인하고 첫 워크스페이스를 생성합니다
+<Callout type="warning">
+자체 호스팅 환경은 기본적으로 `APP_ENV=production`을 사용하므로 고정 인증 코드가 활성화되지 않습니다. 공개 인터넷 인스턴스에 `MULTICA_DEV_VERIFICATION_CODE`를 설정하지 마세요.
+</Callout>
-## 5. CLI를 자체 서버로 연결하기
+## 5. 실행 컴퓨터 연결
-CLI 설치는 [Cloud 빠른 시작 → 2. CLI 설치](/cloud-quickstart#2-install-the-multica-cli)와 동일합니다 — Homebrew / 스크립트 / PowerShell 중 하나를 고르세요.
+다음 명령은 Docker 서버가 아니라 **AI 코딩 도구를 실행할 컴퓨터**에서 실행합니다. 두 컴퓨터가 같을 수도 있습니다.
-### 5a. 같은 기기
+먼저 Multica CLI를 설치합니다.
-CLI와 서버가 같은 호스트에서 실행된다면 기본값으로 이미 동작합니다.
+**macOS / Linux**
```bash
-multica setup self-host
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-이렇게 하면 CLI가 `http://localhost:8080`(백엔드)과 `http://localhost:3000`(프런트엔드)을 가리키고, 브라우저 로그인을 안내하며, PAT를 로컬에 저장하고, **데몬을 자동으로 시작합니다**.
+**Windows PowerShell**
-### 5b. 기기 간: 리버스 프록시를 앞에 두기
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-compose 스택은 `127.0.0.1`에서만 수신하므로, 다른 기기에 있는 데몬은 `http://<server-ip>:8080`에 직접 연결할 수 없습니다 — 그리고 그렇게 되기를 원해서도 안 됩니다. 그렇지 않으면 서버 시크릿이 공개 인터넷에서 접근 가능해지기 때문입니다. 서버에 TLS를 종료하고 `127.0.0.1:8080`(백엔드)과 `127.0.0.1:3000`(프런트엔드)으로 전달하는 리버스 프록시를 두고, CLI를 공개 HTTPS URL로 연결하세요.
+Multica 서비스가 같은 컴퓨터에 있다면 다음을 실행합니다.
```bash
-multica setup self-host \
- --server-url https://<your-domain> \
- --app-url https://<your-domain>
+multica setup self-host
```
-<Callout type="info">
-플래그 대신 환경 변수를 선호한다면, 해당 플래그를 생략할 때 `setup self-host`가 `MULTICA_SERVER_URL`과 `MULTICA_APP_URL`을 읽습니다(둘 다 설정하면 플래그가 우선합니다). `MULTICA_SERVER_URL`은 [환경 변수](/environment-variables)에 나오는 `ws://…/ws` 데몬 형식도 허용하며 HTTP 기본 URL로 정규화합니다.
-</Callout>
+Multica 서비스가 다른 컴퓨터에 있다면 앞에서 설정한 두 주소를 전달합니다.
-단일 호스트네임에서 프런트엔드와 백엔드를 모두 앞단에 두는(데몬과 웹 앱 모두에 필요한 WebSocket 지원 포함) 최소 Caddyfile은 다음과 같습니다.
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-```nginx
-multica.example.com {
- # WebSocket route — must come before the catch-all
- @ws path /ws /ws/*
- handle @ws {
- reverse_proxy 127.0.0.1:8080 {
- flush_interval -1
- }
- }
+이 명령은 먼저 `<server-url>/health`를 확인한 뒤 브라우저를 열어 로그인을 완료합니다. 로그인 후 로컬 자격 증명을 저장하고 데몬을 시작합니다.
- # Backend API
- handle /api/* {
- reverse_proxy 127.0.0.1:8080
- }
+연결 상태를 확인합니다.
- # Everything else → frontend
- reverse_proxy 127.0.0.1:3000
-}
+```bash
+multica daemon status
```
-프록시를 올린 후에는 서버의 `.env`에 `FRONTEND_ORIGIN=https://multica.example.com`을 설정하고 백엔드를 재시작하세요 — 그렇지 않으면 WebSocket origin 검사가 브라우저를 거부합니다([문제 해결 → WebSocket이 연결되지 않음](/troubleshooting#websocket-cant-connect)).
+정상적인 출력에는 다음 내용이 표시됩니다.
-[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/)도 견고한 선택지입니다 — 호스트에 어떤 포트도 노출하지 않고도 TLS와 공개 호스트네임을 제공합니다. Nginx로 동등하게 구성하는 방법(`app.` / `api.`을 별도 호스트네임으로 분리, WebSocket용 `proxy_set_header Upgrade`)도 똑같이 잘 동작합니다. 핵심 요구 사항은 TLS 종료와 `/ws`에서의 `Upgrade` 헤더 전달입니다.
+- `Daemon: running`
+- `Agents`에 로컬에 설치된 AI 코딩 도구 포함
+- `Workspaces`가 `0`보다 큼
-## 6. 에이전트 생성 + 첫 작업 할당
+## 6. 첫 실행 완료
-Cloud와 동일한 흐름입니다 — [Cloud 빠른 시작 → 5-6단계](/cloud-quickstart#5-create-an-agent)를 참고하세요.
+Multica로 돌아옵니다. 런타임 목록에 온라인 런타임이 나타나면 에이전트를 만들고 첫 이슈를 할당합니다.
-<span id="7-usage-rollup-no-operator-action-required" />
+실행 로그가 "완료됨"으로 바뀌고 타임라인에 에이전트의 답변이 나타나면 자체 호스팅 서비스, 실행 컴퓨터, AI 코딩 도구가 연결된 것입니다. 자세한 단계는 [빠른 시작](/cloud-quickstart)의 3~5단계를 참고하세요.
-## 7. 사용량 롤업(운영자 작업 불필요)
+## 자주 사용하는 관리 명령
-<Callout type="info">
-사용량 / 런타임 대시보드는 `rollup_task_usage_hourly()`가 채우는 파생 테이블 `task_usage_hourly`에서 데이터를 읽습니다. MUL-2957부터 백엔드는 DB 기반 스케줄러를 통해 인프로세스로 이 롤업을 실행하므로 더 이상 `pg_cron`이 필요하지 않으며, 외부 cron / systemd 타이머도 권장 설정이 아닙니다. 번들된 `pgvector/pgvector:pg17` 이미지가 변경 없이 동작합니다.
-</Callout>
+다음 명령은 모두 `multica` 저장소 디렉터리에서 실행합니다.
-인프로세스 스케줄러는 30초마다 틱하면서 `sys_cron_executions` 테이블을 통해 5분 단위 UTC 플랜을 클레임합니다. 백엔드 레플리카가 여러 개여도 안전합니다 — 고유 키 `(job_name, scope_kind, scope_id, plan_time)` 덕분에 각 플랜에서 단 하나만이 승자가 됩니다. 신규 배포에는 어떤 설정도 필요 없습니다.
+```bash
+# 상태 확인
+docker compose -f docker-compose.selfhost.yml ps
-**호환성 — 기존 `pg_cron` 등록.** 이전에 rollup을 `pg_cron` 잡으로 등록했었다면(`SELECT cron.schedule('rollup_task_usage_hourly', '*/5 * * * *', …)`) 굳이 제거할 필요는 없습니다 — SQL 함수가 내부적으로 advisory lock 4246을 잡기 때문에 앱 스케줄러와 `pg_cron`이 이중 쓰기를 할 수 없습니다. 중복 항목을 제거하려면:
+# backend 로그 확인
+docker compose -f docker-compose.selfhost.yml logs -f backend
-```sql
-SELECT cron.unschedule('rollup_task_usage_hourly')
- FROM cron.job WHERE jobname = 'rollup_task_usage_hourly';
-```
+# .env 변경 적용
+docker compose -f docker-compose.selfhost.yml up -d
-**`v0.3.4 → v0.3.5+` 업그레이드.** 이전 릴리스에서는 migration 103을 적용하기 전에 운영자가 직접 `cmd/backfill_task_usage_hourly`를 실행해야 했고, 그러지 않으면 fail-closed 가드가 `migrate up`을 중단했습니다. MUL-2957부터 이 작업은 자동입니다 — migrate 명령이 migration 103을 적용하기 직전에(advisory lock 4246 보호 아래에서) 멱등한 월별 슬라이스 백필을 실행한 뒤 계속 진행합니다. 바쁜 DB에서는 여전히 `--sleep-between-slices=2s`로 읽기 부하를 조절하기 위해 스탠드얼론 backfill을 실행할 수 있지만 더 이상 필수는 아닙니다.
+# 서비스를 중지하고 data volume 유지
+docker compose -f docker-compose.selfhost.yml down
+```
-전체 레퍼런스(운영 노트와 Kubernetes 배포 형태 포함)는 저장소의 [`SELF_HOSTING_ADVANCED.md → Usage Dashboard Rollup`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING_ADVANCED.md#usage-dashboard-rollup)에 있습니다.
+공개된 이미지 업그레이드:
-## 업그레이드
+```bash
+git pull --ff-only
+docker compose -f docker-compose.selfhost.yml pull
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS http://localhost:8080/readyz
+```
Docker Compose 설치를 업그레이드하는 방법은 두 가지이며, 기존 설치에서는 **결과가 같습니다** — `Makefile`의 `selfhost` 타깃이 동일한 `docker compose pull` + `up -d`를 실행하고, 여기에 더해 `.env`가 없으면 생성하고 `/health`를 기다린 뒤 상태 요약을 출력합니다. 편한 쪽을 쓰세요.
@@ -276,6 +301,8 @@ docker compose -f docker-compose.selfhost.yml exec -T postgres \
docker compose -f docker-compose.selfhost.yml logs -f backend
```
+Migration은 backend 시작 시 자동으로 실행됩니다. migration 103처럼 이전 데이터 backfill이 필요한 migration도 자동으로 backfill을 완료합니다. 드물게 자동 backfill이 실패하고 `refusing to drop legacy daily rollups` 오류가 나타나면 [문제 해결](/troubleshooting#업그레이드할-때-migration-103이-실행을-거부함)을 참고하세요.
+
### `/health` 말고 `/readyz`로 검증하세요
`/health`는 **liveness** 프로브라서 프로세스가 살아 있기만 하면 `{"status":"ok"}`를 반환합니다 — migration이 실패했더라도 마찬가지입니다. `/readyz`(`server/cmd/server/router.go:680`, `/healthz`는 별칭)는 데이터베이스와 적용된 migration 집합을 확인하므로, 잘못된 업그레이드를 잡아내는 것은 이쪽입니다.
@@ -291,67 +318,27 @@ HTTP 200이면서 두 검사가 모두 `ok`가 아니라면 새 버전이 migrat
Helm은 자체 업그레이드 경로가 있습니다. values 파일에서 `images.backend.tag` / `images.frontend.tag`를 원하는 릴리스로 설정한 뒤 `helm upgrade`를 실행하세요. 태그가 바뀌면 파드 스펙이 바뀌므로 Kubernetes가 새 이미지를 받아 Deployment를 롤아웃합니다 — 이것이 확실한 경로입니다.
-`kubectl -n multica rollout restart`는 그 자체로는 업그레이드가 **아닙니다**. 차트는 `pullPolicy: IfNotPresent`로 배포되므로(`deploy/helm/multica/values.yaml`), 해당 태그를 이미 캐시한 노드는 예전 이미지를 재사용하고 restart를 해도 아무것도 바뀌지 않습니다 — `MULTICA_IMAGE_TAG` 고정과 같은 부류의 함정입니다. 부동 태그로 이 방식을 쓰려면 먼저 `images.backend.pullPolicy` / `images.frontend.pullPolicy`를 `Always`로 설정하세요. 아래 [Kubernetes 배포(대체 방안)](#kubernetes-배포대체-방안)를 참고하세요.
+`kubectl -n multica rollout restart`는 그 자체로는 업그레이드가 **아닙니다**. 차트는 `pullPolicy: IfNotPresent`로 배포되므로(`deploy/helm/multica/values.yaml`), 해당 태그를 이미 캐시한 노드는 예전 이미지를 재사용하고 restart를 해도 아무것도 바뀌지 않습니다 — `MULTICA_IMAGE_TAG` 고정과 같은 부류의 함정입니다. 부동 태그로 이 방식을 쓰려면 먼저 `images.backend.pullPolicy` / `images.frontend.pullPolicy`를 `Always`로 설정하세요. 저장소의 [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative)를 참고하세요.
-## Kubernetes 배포(대체 방안)
-
-이미 Kubernetes 클러스터를 운영 중이라면, 저장소에는 `deploy/helm/multica/`에 Helm 차트도 포함되어 있습니다. k8s용 `make selfhost`에 해당합니다 — 동일한 백엔드 이미지, 프런트엔드 이미지, `pgvector/pgvector:pg17` Postgres를 Deployment / Service / Ingress로 패키징하고, `values.yaml`로 렌더링한 하나의 `ConfigMap`을 함께 제공합니다. k3s + Traefik + `local-path`를 기준으로 작성되었으며, Ingress 컨트롤러와 기본 `ReadWriteOnce` StorageClass가 있는 모든 클러스터에서 동작합니다.
-
-이 차트는 **시크릿 값을 템플릿화하지 않습니다**. `multica-secrets`라는 이름의 Secret을 이름으로 참조하므로, 실제 JWT / DB / Resend / Google 키가 git이나 `values.yaml`에 들어갈 필요가 전혀 없습니다. 네임스페이스와 Secret을 kubectl로 한 번 생성하세요.
-
-```bash
-kubectl create namespace multica
-
-kubectl -n multica create secret generic multica-secrets \
- --from-literal=JWT_SECRET="$(openssl rand -hex 32)" \
- --from-literal=POSTGRES_PASSWORD="$(openssl rand -hex 16)" \
- --from-literal=RESEND_API_KEY="" \
- --from-literal=GOOGLE_CLIENT_SECRET="" \
- --from-literal=CLOUDFRONT_PRIVATE_KEY="" \
- --from-literal=MULTICA_DEV_VERIFICATION_CODE=""
-```
-
-그런 다음 차트를 설치합니다.
-
-```bash
-git clone https://github.com/multica-ai/multica.git
-cd multica
-helm install multica deploy/helm/multica -n multica
-```
-
-기본값은 호스트네임 `multica.dev.lan`(web)과 `api.multica.dev.lan`(백엔드)을 가정합니다. 이것들을 `/etc/hosts`(또는 로컬 DNS)에 추가해, Ingress에 도달 가능한 임의의 노드 IP를 가리키도록 하세요. 다른 호스트네임을 사용하려면 `deploy/helm/multica/values.yaml`을 복사한 뒤 `ingress.frontend.host` / `ingress.backend.host`와 그에 대응하는 `backend.config.appUrl` / `frontendOrigin` / `localUploadBaseUrl` / `googleRedirectUri`를 편집하고, `-f my-values.yaml`로 설치하세요.
-
-콜드 클러스터에서는 백엔드가 Postgres를 기다리고 migration을 실행하는 동안 몇 분간 `Running` 상태이지만 `Ready`는 아닐 수 있습니다 — startupProbe가 이를 흡수하므로 파드는 재시작되지 않습니다. `Ready`가 되면:
-
-```bash
-curl -H "Host: api.multica.dev.lan" http://<ingress-ip>/healthz
-# {"status":"ok","checks":{"db":"ok","migrations":"ok"}}
-```
-
-그런 다음 `http://multica.dev.lan`을 열고 위의 [4단계 — 첫 로그인](#4-first-login--create-a-workspace)에서 이어서 진행하세요. CLI를 Ingress 호스트네임으로 연결합니다.
-
-```bash
-multica setup self-host \
- --server-url http://api.multica.dev.lan \
- --app-url http://multica.dev.lan
-```
-
-특정 Multica 릴리스로 옮기려면 values 파일에서 `images.backend.tag` / `images.frontend.tag`를 설정하고 `helm upgrade`를 실행하세요 — 태그가 바뀌어야 재다운로드와 롤아웃이 강제되므로 업그레이드도 이 경로를 씁니다. `kubectl -n multica rollout restart deploy/multica-backend deploy/multica-frontend`가 부동 태그를 다시 받아오는 것은 `images.backend.pullPolicy` / `images.frontend.pullPolicy`를 `Always`로 설정한 경우뿐입니다. 차트 기본값은 `IfNotPresent`라서 노드에 이미 캐시된 이미지를 재사용합니다. `helm -n multica uninstall multica`는 워크로드를 제거하지만 PVC와 Secret은 유지합니다. `kubectl delete namespace multica`는 모든 것을 삭제합니다.
+<Callout type="warning">
+`docker compose down`은 `pgdata`와 `backend_uploads`를 유지합니다. `-v`를 추가하면 데이터베이스를 포함한 이 data volume이 삭제됩니다. 인스턴스를 비우려는 것이 확실하지 않다면 `docker compose down -v`를 실행하지 마세요.
+</Callout>
-전체 레퍼런스 — 세 가지 로그인 모드, web 이미지에 빌드 타임에 굳혀진 `REMOTE_API_URL`에 대한 `backend` ExternalName 우회책, 리소스 제한, TLS — 는 저장소의 [`SELF_HOSTING.md`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative)에 있습니다.
+## 자주 묻는 문제
-## 자주 발생하는 문제
+| 증상 | 먼저 확인할 사항 |
+|---|---|
+| `/readyz`가 `ok`를 반환하지 않음 | `docker compose -f docker-compose.selfhost.yml logs backend postgres`를 실행합니다. |
+| 인증 코드를 받지 못함 | 인증 코드를 한 번 요청한 뒤 backend 로그에서 `Verification code`를 찾습니다. |
+| `setup self-host`에 server 접근 불가가 표시됨 | 실행 컴퓨터에서 `https://api.example.com/health`를 요청해 DNS, TLS, reverse proxy에 모두 접근할 수 있는지 확인합니다. |
+| 데몬의 `Agents`가 비어 있음 | AI 코딩 도구가 `PATH`에 있고 로그인되어 있는지 확인한 뒤 `multica daemon restart`를 실행합니다. |
+| 이슈가 계속 큐에서 기다림 | `multica daemon status`를 실행해 데몬이 실행 중이며 워크스페이스에 연결되었는지 확인합니다. |
-- **백엔드가 시작되지 않음**: `docker compose -f docker-compose.selfhost.yml logs backend`로 컨테이너 로그를 확인하세요. 보통 `.env`의 잘못된 `DATABASE_URL` 또는 `JWT_SECRET`이 원인입니다
-- **인증 코드를 받지 못함**: 이메일 백엔드가 구성되지 않은 경우(Resend도 SMTP도 없음) → `docker compose logs backend`에서 `[DEV] Verification code`를 찾으세요
-- **WebSocket이 연결되지 않음**: 공개 배포에서는 반드시 `FRONTEND_ORIGIN`을 실제 프런트엔드 도메인으로 설정해야 합니다. [문제 해결 → WebSocket이 연결되지 않음](/troubleshooting#websocket-wont-connect)을 참고하세요
-- **사용량 / 런타임 대시보드가 0에 머무름**: `rollup_task_usage_hourly()`가 스케줄링되지 않고 있습니다 — 위의 [7단계](#7-usage-rollup-no-operator-action-required)와 [문제 해결 → 사용량 대시보드가 0으로 표시됨](/troubleshooting#usage-dashboard-stays-at-zero)을 참고하세요
-- **`migrate up`이 `refusing to drop legacy daily rollups`로 실패함**: `v0.3.4 → v0.3.5+` 업그레이드 경로 가드입니다. MUL-2957부터 migrate 명령이 migration 103을 적용하기 전에 백필을 자동으로 실행합니다 — [7단계](#7-usage-rollup-no-operator-action-required)를 참고하세요
+더 많은 경우는 [문제 해결](/troubleshooting)을 참고하세요.
## 다음 단계
-- [환경 변수](/environment-variables) — 전체 env 레퍼런스
-- [인증 설정](/auth-setup) — Resend / OAuth / 가입 허용 목록 상세
-- [GitHub 연동](/github-integration) — GitHub App을 연결해 PR이 이슈에 자동 연결되고 머지 시 이슈가 닫히도록 설정
-- [문제 해결](/troubleshooting) — 문제가 생기면 여기서 시작하세요
-- [데스크톱 앱](/desktop-app) — `~/.multica/desktop.json`을 통한 선택적 데스크톱 설정. 웹 프런트엔드 + CLI가 여전히 가장 빠른 자체 호스팅 경로입니다
+- [로그인 및 가입 설정](/auth-setup) — 이메일, Google 로그인, 가입 범위를 설정합니다.
+- [환경 변수](/environment-variables) — 전체 서버 설정을 확인합니다.
+- [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md) — Kubernetes, 업그레이드, 수동 배포를 알아봅니다.
+- [데스크톱 앱](/desktop-app) — Desktop을 자체 호스팅 서비스에 연결합니다.
diff --git a/apps/docs/content/docs/self-host-quickstart.mdx b/apps/docs/content/docs/self-host-quickstart.mdx
index 6501980852..675e23d014 100644
--- a/apps/docs/content/docs/self-host-quickstart.mdx
+++ b/apps/docs/content/docs/self-host-quickstart.mdx
@@ -1,222 +1,248 @@
---
title: Self-host quickstart
-description: Run Multica on your own server or machine with Docker (or Helm on Kubernetes). Takes about 10 minutes.
+description: Start Multica with Docker Compose, log in, and connect your first computer.
---
import { Callout } from "fumadocs-ui/components/callout";
-This page walks you through running the Multica **server** (backend + frontend + PostgreSQL) on your own machine or server with Docker. When you're done, your data is fully under your control — including [workspaces](/workspaces), [issues](/issues), [comments](/comments), and [agent](/agents) configuration.
+Self-hosting Multica has two parts:
-Agent **execution** still relies on the [daemon](/daemon-runtimes) you run locally plus the [AI coding tools](/providers) installed on that machine — exactly like Cloud. Self-host swaps out the server layer, not the execution layer.
+| Part | What it runs | Where it lives |
+|---|---|---|
+| **Multica service** | Web, API, and PostgreSQL | One machine with Docker installed |
+| **Computer** | The Multica daemon and AI coding tools | The computer developers actually work on |
-## Prerequisites
+They can be the same machine or separate ones. Self-hosting replaces only the Multica Cloud part.
-- **Docker** installed and able to run `docker compose`
-- **Git** (optional, but recommended so you can pull the source)
-- A machine that can stay up (local / internal network / cloud host all work)
-- At least one AI coding tool installed on **the machine running the daemon** (not necessarily the one running the server — your dev laptop works)
+This guide uses Docker Compose. For Kubernetes deployments, see the [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative) in the repository.
-## 1. Pull the project and start the backend
+## Before you start
-<Callout type="info">
-**Already on Kubernetes?** Skip Docker and use the Helm chart instead — jump to [Kubernetes deployment](#kubernetes-deployment-alternative) below, then come back to [Step 4](#4-first-login--create-a-workspace) for first login.
-</Callout>
+The machine running the Multica service needs:
+
+- Docker Engine or Docker Desktop, with `docker compose` working
+- Git, Make, curl, and OpenSSL
+- Ports `3000` and `8080` free on the machine
+
+Confirm Docker and Compose are available first:
```bash
-git clone https://github.com/multica-ai/multica.git
+docker info
+docker compose version
+```
+
+Multica uses Compose v2, invoked as `docker compose`. The legacy `docker-compose` v1 is not supported.
+
+The computer also needs at least one [AI coding tool](/providers) installed and logged in, such as Claude Code, Codex, or Cursor. The Multica CLI is installed in step 5.
+
+## 1. Start Multica
+
+On the machine that will run the service:
+
+```bash
+git clone --depth 1 https://github.com/multica-ai/multica.git
cd multica
make selfhost
```
-`make selfhost` will:
-
-1. Generate a `.env` from `.env.example` if missing, with a **random JWT_SECRET and Postgres password**
-2. Pull the official Docker images (PostgreSQL, Multica backend, Multica frontend)
-3. Bring up every service using `docker-compose.selfhost.yml`
-4. Wait until the backend's `/health` endpoint is ready
+On first run, `make selfhost` will:
-For ongoing production probes after startup, use `/readyz` when you want the
-check to fail on database or migration problems.
+1. Create `.env` from `.env.example`
+2. Generate a random `JWT_SECRET`, PostgreSQL password, and `MULTICA_VCS_SECRET_KEY` (the encryption key for self-hosted Git integrations)
+3. Pull the PostgreSQL, Multica backend, and Multica frontend images
+4. Create persistent volumes and start the three containers
+5. Wait until the backend starts answering health checks
-The backend container **runs database migrations automatically** on startup (`docker/entrypoint.sh` runs `./migrate up` before the server starts) — you'll see the migration output in the backend logs. Version upgrades are handled the same way.
+Running `make selfhost` again reuses the existing `.env` and volumes; it does not regenerate secrets.
<Callout type="info">
-**Image not published yet?** If `make selfhost` fails to pull images, you may be on an unreleased version tag. Switch to a stable release, or build from source: `make selfhost-build`.
+`make selfhost` pulls published images and does not build the code in your checkout. To test local source, use `make selfhost-build`.
</Callout>
-Once it's up:
+## 2. Confirm the services are ready
-- **Frontend**: [http://localhost:3000](http://localhost:3000)
-- **Backend**: [http://localhost:8080](http://localhost:8080)
+Check container status:
-<Callout type="info">
-**Ports listen on `127.0.0.1` only.** `docker-compose.selfhost.yml` binds every published port to loopback — `ss -tlnp` will not show `0.0.0.0:8080`, and the services are unreachable from other machines by design. Secrets and Postgres credentials must never sit on the open internet. For cross-machine access, front the stack with a reverse proxy that terminates TLS — see [Step 5b — Cross-machine: front with a reverse proxy](#5b-cross-machine-front-with-a-reverse-proxy).
-</Callout>
+```bash
+docker compose -f docker-compose.selfhost.yml ps
+```
-## 2. Important: keep production safety on
+`postgres` should show `healthy`, and `backend` and `frontend` should be running. Then check the backend, the database, and migrations:
-<Callout type="warning">
-**`docker-compose.selfhost.yml` sets `APP_ENV` to `production` by default** and leaves `MULTICA_DEV_VERIFICATION_CODE` empty, so there is no fixed code on public instances.
+```bash
+curl -fsS http://localhost:8080/readyz
+```
-Only set `MULTICA_DEV_VERIFICATION_CODE` for local or private test automation. If a fixed code is enabled while `APP_ENV` is non-production, anyone who can request a code can sign in with that fixed value. See [Auth setup → Fixed local testing codes](/auth-setup#fixed-local-testing-codes).
+The expected response is:
-Before any public deployment, make sure `.env` has `APP_ENV=production` and `MULTICA_DEV_VERIFICATION_CODE` is empty.
-</Callout>
+```json
+{"status":"ok","checks":{"db":"ok","migrations":"ok"}}
+```
-## 3. Configure the email service (optional but recommended)
+The backend container runs database migrations on every startup before serving; there is no manual migration command to run.
-Without email configured, your users can't receive verification codes by email; the server prints generated codes to stdout instead.
+## 3. Choose how to access
-Two delivery backends are supported — pick whichever fits your network:
+### Local access
-**Option A — Resend (cloud / public-internet deployments):**
+Open [http://localhost:3000](http://localhost:3000) directly. You also won't need to pass any URLs when running `multica setup self-host` later.
-1. Sign up at [Resend](https://resend.com/) and get an API key
-2. Verify a sending domain you control
-3. Set these in `.env`:
+### Remote access
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxx
- ```
+Docker Compose binds `3000` and `8080` to `127.0.0.1` only. Do not switch this to `0.0.0.0` to expose the ports to the public internet; use a reverse proxy with HTTPS instead.
-**Option B — SMTP relay (internal networks / on-premise):**
+The example below uses two domains:
-Use this when the deployment can't reach `api.resend.com`, or you already have an internal mail relay (Microsoft Exchange, Postfix, on-prem SendGrid, etc.). `SMTP_HOST` takes priority over Resend when both are set, so verification and invite mail stays on the internal relay. STARTTLS is upgraded automatically when advertised; port `465` (SMTPS / implicit TLS) auto-enables an immediate TLS handshake, and `SMTP_TLS=implicit` (aliases: `smtps`, `ssl`) forces it on a non-standard SMTPS port.
+- `app.example.com`: the Multica web app
+- `api.example.com`: the API, health checks, and daemon connections
-For **anonymous Exchange internal relay (port 25)** — the host is trusted by IP and submits without credentials:
+First set the public URLs in `.env`:
```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # reused as the From: header
+FRONTEND_ORIGIN=https://app.example.com
+MULTICA_APP_URL=https://app.example.com
+MULTICA_PUBLIC_URL=https://api.example.com
```
-For **authenticated submission (port 587, STARTTLS)** — the relay requires a service account; STARTTLS is upgraded automatically when advertised:
+With this configuration all browser traffic stays on the app domain, so cookies never cross domains and `COOKIE_DOMAIN` is not needed. If the browser talks to the api domain directly instead, you must set it — see [Environment variables](/environment-variables).
-```bash
-SMTP_HOST=smtp.internal.example.com
-SMTP_PORT=587
-SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # set true only for private CA / self-signed
+Then set up DNS and proxy the local ports with Caddy:
+
+```text
+app.example.com {
+ # Hand browser WebSockets straight to the backend
+ @ws path /ws /ws/*
+ handle @ws {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+ }
+
+ # Everything else goes to the frontend, which forwards API and login requests
+ handle {
+ reverse_proxy 127.0.0.1:3000
+ }
+}
+
+api.example.com {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+}
```
-For **implicit TLS / SMTPS (port 465)** — providers like Aliyun / Tencent enterprise mail that don't advertise STARTTLS. Port `465` auto-enables implicit TLS, so `SMTP_TLS` is optional here:
+Caddy obtains TLS certificates and forwards WebSockets. After editing `.env`, recreate the containers with `up -d` so the new configuration takes effect:
```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # optional on 465; required on a non-standard SMTPS port
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS https://api.example.com/readyz
```
-For **strict public relays (e.g. Google Workspace `smtp-relay.gmail.com`)** that reject the default `localhost` greeting from a public IP, set `SMTP_EHLO_NAME` to the FQDN the relay expects — otherwise the connection is dropped and surfaces as an opaque `EOF` on a later command. It defaults to the container hostname, which is usually not a valid FQDN:
+<Callout type="warning">
+`docker compose restart` only restarts existing containers and does not re-read `.env`. After changing configuration, run `docker compose -f docker-compose.selfhost.yml up -d` to re-read `.env`.
+</Callout>
+
+## 4. Log in and create a workspace
+
+Open `http://localhost:3000` locally, or the `https://app.example.com` you just configured, and enter your email to request a verification code.
+
+No email service is configured by default. After requesting a code, read it from the backend logs:
```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # FQDN the relay accepts; defaults to the (non-FQDN) container hostname
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "Verification code"
```
-Then restart: `docker compose -f docker-compose.selfhost.yml restart backend`. On restart, the backend prints which provider it picked and the negotiated TLS mode (`EmailService: SMTP relay <host>:<port> (starttls|implicit-tls) from=…` / `Resend API` / `DEV mode`) — credentials are never logged, so this line is safe to share when asking for help.
-
-For more auth configuration (OAuth, signup allowlist) and the full SMTP variable reference, see [Auth setup](/auth-setup) and [Environment variables → Email](/environment-variables#email-configuration).
+The logs contain a line like:
-## 4. First login + create a workspace
+```text
+[DEV] Verification code for [email protected]: 123456
+```
-Open [http://localhost:3000](http://localhost:3000):
+Enter the code and create your first workspace. Once Resend or SMTP is configured, codes are sent by email and members no longer need to read container logs — see [Auth setup](/auth-setup).
-- Enter your email
-- Grab the verification code from your configured email backend (Resend or SMTP relay); if neither is configured, copy it from the server container stdout — look for the `[DEV] Verification code` line
-- Do not use `888888` unless you explicitly set `MULTICA_DEV_VERIFICATION_CODE=888888` on a non-production private instance
-- Log in and create your first workspace
+<Callout type="warning">
+Self-hosted deployments default to `APP_ENV=production`, which disables fixed verification codes. Do not set `MULTICA_DEV_VERIFICATION_CODE` on a public instance.
+</Callout>
-## 5. Point the CLI at your own server
+## 5. Connect a computer
-The CLI install is the same as in [Cloud quickstart → 2. Install the CLI](/cloud-quickstart#2-install-the-multica-cli) — Homebrew / script / PowerShell, pick one.
+Run the commands below on **the computer that runs your AI coding tools**, which is not necessarily the server running Docker.
-### 5a. Same machine
+Install the Multica CLI first:
-If the CLI and the server run on the same host, the defaults already work:
+**macOS / Linux**
```bash
-multica setup self-host
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-That points the CLI at `http://localhost:8080` (backend) and `http://localhost:3000` (frontend), takes you through browser login, stores the PAT locally, and **starts the daemon automatically**.
+**Windows PowerShell**
-### 5b. Cross-machine: front with a reverse proxy
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-Because the compose stack only listens on `127.0.0.1`, a daemon on a different machine cannot reach `http://<server-ip>:8080` directly — and you do not want it to, since server secrets would otherwise be reachable from the open internet. Put a reverse proxy on the server that terminates TLS and forwards to `127.0.0.1:8080` (backend) and `127.0.0.1:3000` (frontend), then point the CLI at the public HTTPS URL:
+If the Multica service runs on this same computer:
```bash
-multica setup self-host \
- --server-url https://<your-domain> \
- --app-url https://<your-domain>
+multica setup self-host
```
-<Callout type="info">
-Prefer environment variables over flags? `setup self-host` reads `MULTICA_SERVER_URL` and `MULTICA_APP_URL` when the matching flag is omitted — a flag still takes precedence over the env var. `MULTICA_SERVER_URL` also accepts the `ws://…/ws` daemon form from [Environment variables](/environment-variables) and normalizes it to the HTTP base.
-</Callout>
+If the Multica service runs on another machine, pass the two URLs you configured earlier:
-A minimal Caddyfile that fronts both the frontend and the backend (with WebSocket support, which the daemon and the web app both need) on a single hostname:
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-```nginx
-multica.example.com {
- # WebSocket route — must come before the catch-all
- @ws path /ws /ws/*
- handle @ws {
- reverse_proxy 127.0.0.1:8080 {
- flush_interval -1
- }
- }
+The command first checks `<server-url>/health`, then opens a browser to complete login. After login it stores local credentials and starts the daemon.
- # Backend API
- handle /api/* {
- reverse_proxy 127.0.0.1:8080
- }
+Confirm the connection:
- # Everything else → frontend
- reverse_proxy 127.0.0.1:3000
-}
+```bash
+multica daemon status
```
-After bringing the proxy up, set `FRONTEND_ORIGIN=https://multica.example.com` in the server's `.env` and restart the backend — otherwise the WebSocket origin check will reject the browser ([Troubleshooting → WebSocket can't connect](/troubleshooting#websocket-cant-connect)).
+The output should show:
-[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) is another solid option — it gives you TLS and a public hostname without exposing any port on the host at all. An Nginx equivalent (separate `app.` / `api.` hostnames, `proxy_set_header Upgrade` for WebSockets) works just as well; the key requirements are TLS termination and forwarding the `Upgrade` header on `/ws`.
+- `Daemon: running`
+- `Agents` listing the AI coding tools installed on this machine
+- `Workspaces` greater than `0`
-## 6. Create an agent + assign your first task
+## 6. Complete the first run
-Same flow as Cloud — see [Cloud quickstart → Steps 5-6](/cloud-quickstart#5-create-an-agent).
+Back in Multica, once an online runtime appears in the runtime list, create an agent and assign it your first issue.
-## 7. Usage rollup (no operator action required)
+When the run shows as completed and the agent's reply appears in the timeline, the self-hosted service, the computer, and the AI coding tool are all connected. For detailed steps, see steps 3-5 of the [quickstart](/cloud-quickstart).
-<Callout type="info">
-The Usage / Runtime dashboards read from a derived `task_usage_hourly` table populated by `rollup_task_usage_hourly()`. As of MUL-2957 the backend runs this rollup in-process via the DB-backed scheduler — `pg_cron` is no longer required, and external cron / systemd timers are no longer the recommended setup. The bundled `pgvector/pgvector:pg17` image works without changes.
-</Callout>
+## Common admin commands
-The in-process scheduler ticks every 30 seconds and claims a 5-minute UTC plan via the `sys_cron_executions` table. Multiple backend replicas are safe — the unique key `(job_name, scope_kind, scope_id, plan_time)` means only one wins each plan. No setup is needed for new deployments.
+Run all of these from the `multica` repository directory:
-**Compatibility — existing `pg_cron` registrations.** If you previously registered the rollup as a `pg_cron` job (`SELECT cron.schedule('rollup_task_usage_hourly', '*/5 * * * *', …)`), you do not need to remove it — the SQL function holds advisory lock 4246 internally, so the app scheduler and `pg_cron` cannot double-write. To drop the redundant entry:
+```bash
+# Check status
+docker compose -f docker-compose.selfhost.yml ps
-```sql
-SELECT cron.unschedule('rollup_task_usage_hourly')
- FROM cron.job WHERE jobname = 'rollup_task_usage_hourly';
-```
+# Tail backend logs
+docker compose -f docker-compose.selfhost.yml logs -f backend
-**Upgrade from `v0.3.4 → v0.3.5+`.** The previous release asked operators to run `cmd/backfill_task_usage_hourly` manually before applying migration 103, otherwise the migration's fail-closed guard would abort `migrate up`. As of MUL-2957 this is automatic: the migrate command runs an idempotent monthly-slice backfill (under advisory lock 4246) immediately before applying migration 103, then continues. You may still run the standalone backfill on a busy DB to throttle read pressure with `--sleep-between-slices=2s`, but it is no longer required.
+# Apply .env changes
+docker compose -f docker-compose.selfhost.yml up -d
-Full reference — including operations notes and the Kubernetes deployment shape — lives in the repo's [`SELF_HOSTING_ADVANCED.md → Usage Dashboard Rollup`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING_ADVANCED.md#usage-dashboard-rollup).
+# Stop the services, keeping the volumes
+docker compose -f docker-compose.selfhost.yml down
+```
-## Upgrading
+To upgrade to the latest published images:
+
+```bash
+git pull --ff-only
+docker compose -f docker-compose.selfhost.yml pull
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS http://localhost:8080/readyz
+```
Two ways to upgrade a Docker Compose install. On an existing install they produce the **same result** — the `selfhost` target in the `Makefile` runs the same `docker compose pull` + `up -d`, and additionally creates `.env` when it is missing and waits on `/health` before printing a status summary. Pick whichever you prefer:
@@ -275,6 +301,8 @@ As in [Step 1](#1-pull-the-project-and-start-the-backend), the backend container
docker compose -f docker-compose.selfhost.yml logs -f backend
```
+Migrations run automatically when the backend starts; migrations that backfill historical data (such as 103) complete the backfill automatically too. In rare cases the automatic backfill fails with `refusing to drop legacy daily rollups` — see [Troubleshooting](/troubleshooting#migration-103-blocks-an-upgrade).
+
### Verify with `/readyz`, not `/health`
`/health` is a **liveness** probe — it returns `{"status":"ok"}` as long as the process is up, including when migrations failed. `/readyz` (`server/cmd/server/router.go:680`; `/healthz` is an alias) checks the database and the applied migration set, so it is the one that catches a bad upgrade:
@@ -290,67 +318,27 @@ Anything other than HTTP 200 with both checks `ok` means the new version did not
Helm has its own upgrade path: set `images.backend.tag` / `images.frontend.tag` to the release you want in your values file, then `helm upgrade`. Changing the tag changes the pod spec, so Kubernetes pulls the new image and rolls the Deployments — this is the reliable route.
-`kubectl -n multica rollout restart` is **not** an upgrade on its own. The chart ships `pullPolicy: IfNotPresent` (`deploy/helm/multica/values.yaml`), so a node that already has that tag cached reuses the old image and the restart silently changes nothing — the same class of trap as a pinned `MULTICA_IMAGE_TAG`. If you want to track a floating tag that way, set `images.backend.pullPolicy` / `images.frontend.pullPolicy` to `Always` first. See [Kubernetes deployment](#kubernetes-deployment-alternative) below.
-
-## Kubernetes deployment (alternative)
+`kubectl -n multica rollout restart` is **not** an upgrade on its own. The chart ships `pullPolicy: IfNotPresent` (`deploy/helm/multica/values.yaml`), so a node that already has that tag cached reuses the old image and the restart silently changes nothing — the same class of trap as a pinned `MULTICA_IMAGE_TAG`. If you want to track a floating tag that way, set `images.backend.pullPolicy` / `images.frontend.pullPolicy` to `Always` first. See the [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative).
-If you already run a Kubernetes cluster, the repo also ships a Helm chart at `deploy/helm/multica/`. It's the equivalent of `make selfhost` for k8s — same backend image, frontend image, and `pgvector/pgvector:pg17` Postgres, packaged as Deployments / Services / Ingresses with one `ConfigMap` rendered from `values.yaml`. Authored against k3s + Traefik + `local-path` and should work on any cluster with an Ingress controller and a default `ReadWriteOnce` StorageClass.
-
-The chart **does not template secret values**. It references a Secret named `multica-secrets` by name, so real JWT / DB / Resend / Google keys never need to live in git or in `values.yaml`. Create the namespace + Secret once with kubectl:
-
-```bash
-kubectl create namespace multica
-
-kubectl -n multica create secret generic multica-secrets \
- --from-literal=JWT_SECRET="$(openssl rand -hex 32)" \
- --from-literal=POSTGRES_PASSWORD="$(openssl rand -hex 16)" \
- --from-literal=RESEND_API_KEY="" \
- --from-literal=GOOGLE_CLIENT_SECRET="" \
- --from-literal=CLOUDFRONT_PRIVATE_KEY="" \
- --from-literal=MULTICA_DEV_VERIFICATION_CODE=""
-```
-
-Then install the chart:
-
-```bash
-git clone https://github.com/multica-ai/multica.git
-cd multica
-helm install multica deploy/helm/multica -n multica
-```
-
-Defaults assume the hostnames `multica.dev.lan` (web) and `api.multica.dev.lan` (backend). Add them to `/etc/hosts` (or local DNS) pointing at any node IP where your Ingress is reachable. To use different hostnames, copy `deploy/helm/multica/values.yaml`, edit `ingress.frontend.host` / `ingress.backend.host` and the matching `backend.config.appUrl` / `frontendOrigin` / `localUploadBaseUrl` / `googleRedirectUri`, then install with `-f my-values.yaml`.
-
-On a cold cluster the backend can stay `Running` but not `Ready` for a few minutes while it waits on Postgres and runs migrations — a startupProbe absorbs this, so the pod should not restart. Once it's `Ready`:
-
-```bash
-curl -H "Host: api.multica.dev.lan" http://<ingress-ip>/healthz
-# {"status":"ok","checks":{"db":"ok","migrations":"ok"}}
-```
-
-Then open `http://multica.dev.lan` and continue at [Step 4 — First login](#4-first-login--create-a-workspace) above. Point the CLI at your Ingress hostnames:
-
-```bash
-multica setup self-host \
- --server-url http://api.multica.dev.lan \
- --app-url http://multica.dev.lan
-```
-
-To move to a specific Multica release, set `images.backend.tag` / `images.frontend.tag` in your values file and `helm upgrade` — that is also how you upgrade, since a changed tag forces a new pull and rollout. `kubectl -n multica rollout restart deploy/multica-backend deploy/multica-frontend` only re-pulls a floating tag if you also set `images.backend.pullPolicy` / `images.frontend.pullPolicy` to `Always`; the chart default is `IfNotPresent`, which reuses whatever the node already cached. `helm -n multica uninstall multica` removes the workloads but keeps the PVCs and Secret; `kubectl delete namespace multica` wipes everything.
-
-The full reference — three login modes, runtime frontend API/docs upstreams, legacy `backend` ExternalName compatibility, resource limits, and TLS — lives in the repo's [`SELF_HOSTING.md`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative).
+<Callout type="warning">
+`docker compose down` keeps `pgdata` and `backend_uploads`. Adding `-v` deletes these volumes, including the database; do not run `docker compose down -v` unless you intend to wipe the instance.
+</Callout>
## Common issues
-- **Backend won't start**: check container logs with `docker compose -f docker-compose.selfhost.yml logs backend`; usually it's a bad `DATABASE_URL` or `JWT_SECRET` in `.env`
-- **Verification code not received**: no email backend is configured (neither Resend nor SMTP) → look for `[DEV] Verification code` in `docker compose logs backend`
-- **WebSocket won't connect**: for public deployments you must set `FRONTEND_ORIGIN` to your real frontend domain; see [Troubleshooting → WebSocket won't connect](/troubleshooting#websocket-wont-connect)
-- **Usage / Runtime dashboard stays at zero**: `rollup_task_usage_hourly()` isn't being scheduled — see [Step 7](#7-usage-rollup-no-operator-action-required) above and [Troubleshooting → Usage dashboard shows zero](/troubleshooting#usage-dashboard-stays-at-zero)
-- **`migrate up` fails with `refusing to drop legacy daily rollups`**: upgrade-path guard from `v0.3.4 → v0.3.5+`. As of MUL-2957 the migrate command runs the backfill automatically before applying migration 103 — see [Step 7](#7-usage-rollup-no-operator-action-required)
+| Symptom | Check first |
+|---|---|
+| `/readyz` does not return `ok` | Run `docker compose -f docker-compose.selfhost.yml logs backend postgres`. |
+| No verification code arrives | Request a code, then search the backend logs for `Verification code`. |
+| `setup self-host` reports the server is unreachable | From the computer, request `https://api.example.com/health` to confirm DNS, TLS, and the reverse proxy are all reachable. |
+| The daemon lists no `Agents` | Confirm the AI coding tools are on `PATH` and logged in, then run `multica daemon restart`. |
+| Issues stay queued | Run `multica daemon status` to confirm the daemon is running and connected to the workspace. |
+
+For more scenarios, see [Troubleshooting](/troubleshooting).
## Next steps
-- [Environment variables](/environment-variables) — full env reference
-- [Auth setup](/auth-setup) — Resend / OAuth / signup allowlist in detail
-- [GitHub integration](/github-integration) — connect a GitHub App so PRs auto-link to issues and merging closes them
-- [Troubleshooting](/troubleshooting) — start here when things go wrong
-- [Desktop app](/desktop-app) — optional Desktop setup via `~/.multica/desktop.json`; the web frontend + CLI remains the quickest self-host path
+- [Auth setup](/auth-setup) — configure email, Google login, and signup scope.
+- [Environment variables](/environment-variables) — the full server configuration reference.
+- [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md) — Kubernetes, upgrades, and manual deployment.
+- [Desktop app](/desktop-app) — connect Desktop to a self-hosted service.
diff --git a/apps/docs/content/docs/self-host-quickstart.zh.mdx b/apps/docs/content/docs/self-host-quickstart.zh.mdx
index 60449753b6..fa32a78f8e 100644
--- a/apps/docs/content/docs/self-host-quickstart.zh.mdx
+++ b/apps/docs/content/docs/self-host-quickstart.zh.mdx
@@ -1,223 +1,248 @@
---
-title: Self-Host 快速上手
-description: 在自己的服务器或本机用 Docker 把 Multica 跑起来(也可以在 Kubernetes 上用 Helm)。约 10 分钟。
+title: 自托管快速上手
+description: 用 Docker Compose 启动 Multica,完成登录,并连接第一台执行电脑。
---
import { Callout } from "fumadocs-ui/components/callout";
-这一页带你用 Docker 把 Multica 的**服务器**(后端 + 前端 + PostgreSQL)跑在自己的机器或服务器上。走完这一篇你的数据就完全在自己手里——包括 [工作区](/workspaces)、[issue](/issues)、[评论](/comments)、[智能体](/agents) 配置。
+自托管 Multica 分成两部分:
-智能体**执行**还是靠你本地跑的 [守护进程](/daemon-runtimes) + 本地装好的 [AI 编程工具](/providers)——这点和 Cloud 完全一样。Self-host 换掉的是服务器那一层,不是执行那一层。
+| 部分 | 运行什么 | 放在哪里 |
+|---|---|---|
+| **Multica 服务** | Web、API 和 PostgreSQL | 一台安装了 Docker 的机器 |
+| **执行电脑** | Multica 守护进程和 AI 编程工具 | 开发者实际工作的电脑 |
-## 前置要求
+它们可以是同一台机器,也可以分开。自托管替换的只是 Multica Cloud 部分。
-- **Docker** 安装好并且能跑 `docker compose`
-- **Git** 可选(推荐——可以拉源码)
-- 一台能长期开机的机器(本地 / 内网 / 云主机都行)
-- 至少一款 AI 编程工具装在**运行守护进程的机器上**(不一定是跑服务器的机器——可以是你开发用的笔记本)
+这篇文档使用 Docker Compose。Kubernetes 部署见仓库中的 [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative)。
-## 1. 拉取项目 + 一键启动后端
+## 开始前
-<Callout type="info">
-**已经有 Kubernetes 集群?** 不用走 Docker,直接用 Helm chart——跳到下面的 [Kubernetes 部署(替代方案)](#kubernetes-部署替代方案),装完再回到 [第 4 步](#4-首次登录--创建工作区) 完成登录。
-</Callout>
+运行 Multica 服务的机器需要:
+
+- Docker Engine 或 Docker Desktop,并且 `docker compose` 可以运行
+- Git、Make、curl 和 OpenSSL
+- 本机的 `3000`、`8080` 端口未被占用
+
+先确认 Docker 和 Compose 可用:
```bash
-git clone https://github.com/multica-ai/multica.git
+docker info
+docker compose version
+```
+
+Multica 使用 Compose v2,也就是 `docker compose`。旧版的 `docker-compose` v1 不受支持。
+
+执行电脑还需要至少一款已经安装并登录的 [AI 编程工具](/providers),例如 Claude Code、Codex 或 Cursor。第 5 步再安装 Multica CLI。
+
+## 1. 启动 Multica
+
+在准备运行服务的机器上执行:
+
+```bash
+git clone --depth 1 https://github.com/multica-ai/multica.git
cd multica
make selfhost
```
-`make selfhost` 会:
-
-1. 如果没有 `.env` 文件,从 `.env.example` 自动生成一份,并**生成随机 JWT_SECRET 和 Postgres 密码**
-2. 拉取官方 Docker 镜像(PostgreSQL、Multica backend、Multica frontend)
-3. 用 `docker-compose.selfhost.yml` 启动全部服务
-4. 等后端 `/health` 端点准备就绪
+第一次运行时,`make selfhost` 会:
-如果是启动完成后的生产探针,想让数据库或 migration 异常也体现为失败,请改用 `/readyz`。
+1. 从 `.env.example` 创建 `.env`
+2. 随机生成 `JWT_SECRET`、PostgreSQL 密码和 `MULTICA_VCS_SECRET_KEY`(自托管 Git 集成的加密密钥)
+3. 拉取 PostgreSQL、Multica backend 和 Multica frontend 镜像
+4. 创建持久化数据卷并启动三个容器
+5. 等待 backend 开始响应健康检查
-后端容器启动时会**自动跑数据库 migration**(`docker/entrypoint.sh` 在启动 server 前执行 `./migrate up`)——你会在 backend 日志里看到 migration 输出。升级版本时同样自动处理。
+之后再次运行 `make selfhost` 会继续使用现有的 `.env` 和数据卷,不会重新生成密钥。
<Callout type="info">
-**镜像还没发布?** 如果 `make selfhost` 报拉不到镜像,可能是你在某个未发布的版本标签上。切到稳定版本或直接从源码构建:`make selfhost-build`。
+`make selfhost` 拉取已发布的镜像,不会编译当前 checkout 中的代码。需要测试本地源码时,使用 `make selfhost-build`。
</Callout>
-启动完成后:
+## 2. 确认服务已经就绪
-- **前端**:[http://localhost:3000](http://localhost:3000)
-- **后端**:[http://localhost:8080](http://localhost:8080)
+查看容器状态:
-<Callout type="info">
-**所有端口只监听 `127.0.0.1`。** `docker-compose.selfhost.yml` 把每个 publish 出来的端口都绑到 loopback —— `ss -tlnp` 不会看到 `0.0.0.0:8080`,外网/其它机器默认根本连不上。这是为了避免服务密钥和 Postgres 凭据被直接暴露到公网。要做跨机访问,请用反向代理在前面终结 TLS,详见下方 [Step 5b —— 跨机访问:用反向代理把服务挡在前面](#5b-跨机访问用反向代理把服务挡在前面)。
-</Callout>
+```bash
+docker compose -f docker-compose.selfhost.yml ps
+```
-## 2. 重要:保持生产安全配置
+`postgres` 显示为 `healthy`,`backend` 和 `frontend` 应处于运行状态。然后检查 backend、数据库和 migration:
-<Callout type="warning">
-**`docker-compose.selfhost.yml` 默认把 `APP_ENV` 设成 `production`**,并让 `MULTICA_DEV_VERIFICATION_CODE` 为空,所以公网实例默认没有固定验证码。
+```bash
+curl -fsS http://localhost:8080/readyz
+```
-只在本地或私有测试自动化里设置 `MULTICA_DEV_VERIFICATION_CODE`。如果在 `APP_ENV` 非 production 时启用了固定验证码,任何能请求验证码的人都能用这个固定值登录。详见 [登录与注册配置 → 固定本地测试验证码](/auth-setup#固定本地测试验证码)。
+正常响应是:
-公网部署前一定检查 `.env` 里 `APP_ENV=production`,且 `MULTICA_DEV_VERIFICATION_CODE` 为空。
-</Callout>
+```json
+{"status":"ok","checks":{"db":"ok","migrations":"ok"}}
+```
-## 3. 配置邮件服务(可选但推荐)
+Backend 容器每次启动时都会先运行数据库 migration,再启动服务,不需要手动执行 migration 命令。
-如果不配邮件,用户无法通过邮件收到验证码;server 会把生成的验证码打印到 stdout。
+## 3. 选择访问方式
-支持两种发送通道,按部署环境二选一:
+### 本机访问
-**Option A — Resend(公网/云端部署):**
+直接打开 [http://localhost:3000](http://localhost:3000)。后面运行 `multica setup self-host` 时也不需要传 URL。
-1. 在 [Resend](https://resend.com/) 注册并拿一个 API key
-2. 验证一个你控制的发件域名
-3. 在 `.env` 里设:
+### 远程访问
- ```bash
- RESEND_API_KEY=re_xxxxxxxxxxxx
- ```
+Docker Compose 默认只把 `3000` 和 `8080` 绑定到 `127.0.0.1`。不要直接改成 `0.0.0.0` 暴露到公网;使用带 HTTPS 的反向代理。
-**Option B — SMTP relay(内网/自部署):**
+下面以两个域名为例:
-适合内网无法访问 `api.resend.com`,或已经有内部邮件中继(Microsoft Exchange、Postfix、自部署 SendGrid 等)的场景。同时设置时 `SMTP_HOST` 优先级高于 Resend,验证码和邀请邮件不会走外部 provider。服务端 advertise STARTTLS 时会自动升级;端口 `465`(SMTPS / 隐式 TLS)会自动启用连接即握手的 TLS 模式,非标准 SMTPS 端口用 `SMTP_TLS=implicit`(别名:`smtps`、`ssl`)强制开启。
+- `app.example.com`:Multica Web
+- `api.example.com`:API、健康检查和守护进程连接
-**匿名 Exchange 内部 relay(端口 25)** —— 主机按 IP 被信任,不需要凭据:
+先在 `.env` 中设置公开地址:
```bash
-SMTP_HOST=exchange.internal.example.com
-SMTP_PORT=25
-SMTP_USERNAME=
-SMTP_PASSWORD=
-SMTP_TLS_INSECURE=false
[email protected] # 同时作为 SMTP From: 头
+FRONTEND_ORIGIN=https://app.example.com
+MULTICA_APP_URL=https://app.example.com
+MULTICA_PUBLIC_URL=https://api.example.com
```
-**认证提交(端口 587,STARTTLS)** —— relay 需要 service account;服务端 advertise STARTTLS 时自动升级:
+以上配置让浏览器流量全部走 app 域,cookie 不跨域,因此不需要配置 `COOKIE_DOMAIN`。如果改为让浏览器直接访问 api 域,则必须配置它,见[环境变量](/environment-variables)。
-```bash
-SMTP_HOST=smtp.internal.example.com
-SMTP_PORT=587
-SMTP_USERNAME=multica
-SMTP_PASSWORD=...
-SMTP_TLS_INSECURE=false # 仅在私有 CA / 自签证书时改成 true
+然后配置 DNS,并用 Caddy 代理本机端口:
+
+```text
+app.example.com {
+ # 浏览器的 WebSocket 直接交给 backend
+ @ws path /ws /ws/*
+ handle @ws {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+ }
+
+ # 其余路径交给 frontend;它会转发 API 和登录请求
+ handle {
+ reverse_proxy 127.0.0.1:3000
+ }
+}
+
+api.example.com {
+ reverse_proxy 127.0.0.1:8080 {
+ flush_interval -1
+ }
+}
```
-**隐式 TLS / SMTPS(端口 465)** —— 适用于阿里云 / 腾讯企业邮箱等不广告 STARTTLS 的服务商。端口 `465` 自动启用隐式 TLS,因此这里 `SMTP_TLS` 可省略:
+Caddy 会申请 TLS 证书并转发 WebSocket。修改 `.env` 后,用 `up -d` 重新创建容器,让新配置生效:
```bash
-SMTP_HOST=smtp.qiye.aliyun.com
-SMTP_PORT=465
-SMTP_PASSWORD=...
-SMTP_TLS=implicit # 465 上可省略;非标准 SMTPS 端口上必填
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS https://api.example.com/readyz
```
-对于**拒绝来自公网 IP 的默认 `localhost` 问候的严格公网 relay(例如 Google Workspace `smtp-relay.gmail.com`)**,把 `SMTP_EHLO_NAME` 设成 relay 期望的 FQDN——否则连接会被直接断开,并在后续某条命令上表现为一个不知所云的 `EOF`。它默认取容器主机名,而后者通常不是合法的 FQDN:
+<Callout type="warning">
+`docker compose restart` 只重启现有容器,不会重新读取 `.env`。修改配置后,重新读取 `.env` 需要运行 `docker compose -f docker-compose.selfhost.yml up -d`。
+</Callout>
+
+## 4. 登录并创建工作区
+
+打开本机的 `http://localhost:3000`,或刚才配置的 `https://app.example.com`,输入邮箱获取验证码。
+
+默认没有配置邮件服务。请求验证码后,可以从 backend 日志中读取:
```bash
-SMTP_HOST=smtp-relay.gmail.com
-SMTP_PORT=587
-SMTP_EHLO_NAME=mail.yourdomain.com # relay 接受的 FQDN;默认取(非 FQDN 的)容器主机名
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "Verification code"
```
-之后重启:`docker compose -f docker-compose.selfhost.yml restart backend`。重启时 backend 会打印当前选择的 provider 和协商出的 TLS 模式(`EmailService: SMTP relay <host>:<port> (starttls|implicit-tls) from=…` / `Resend API` / `DEV mode`),密码不会被记录,所以这行截图给同事是安全的。
-
-更多 auth 配置(OAuth、注册白名单)以及完整的 SMTP 变量说明见 [登录与注册配置](/auth-setup) 和 [环境变量](/environment-variables)。
+日志中会出现类似内容:
-## 4. 首次登录 + 创建工作区
+```text
+[DEV] Verification code for [email protected]: 123456
+```
-打开 [http://localhost:3000](http://localhost:3000):
+输入验证码并创建第一个工作区。配置 Resend 或 SMTP 后,验证码通过邮件发送,成员无需读取容器日志,具体见[登录与注册配置](/auth-setup)。
-- 输入你的邮箱
-- 从你配置的邮件后端(Resend 或 SMTP relay)收到的邮件里拿验证码;两者都没配的话,从 server 容器的 stdout 里抄 `[DEV] Verification code` 这行
-- 不要直接使用 `888888`;只有在非 production 私有实例上显式设置 `MULTICA_DEV_VERIFICATION_CODE=888888` 后它才会生效
-- 登录后创建第一个工作区
+<Callout type="warning">
+自托管部署默认使用 `APP_ENV=production`,不会启用固定验证码。不要在公网实例上设置 `MULTICA_DEV_VERIFICATION_CODE`。
+</Callout>
-## 5. 连接命令行工具到你自己的 server
+## 5. 连接执行电脑
-命令行装法和 [Cloud 快速上手 → 2. 装命令行工具](/cloud-quickstart#2-装-multica-命令行工具) 一样——Homebrew / 脚本 / PowerShell 任选。
+下面的命令在**运行 AI 编程工具的电脑**上执行,不一定是运行 Docker 的服务器。
-### 5a. 同一台机器
+先安装 Multica CLI:
-CLI 和 server 在同一台机器上时,默认参数就够用:
+**macOS / Linux**
```bash
-multica setup self-host
+curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash
```
-会自动连 `http://localhost:8080`(backend)+ `http://localhost:3000`(frontend),引导你在浏览器里登录、把 PAT 存到本地、**自动启动守护进程**。
+**Windows PowerShell**
-### 5b. 跨机访问:用反向代理把服务挡在前面
+```powershell
+irm https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.ps1 | iex
+```
-因为 compose 默认只监听 `127.0.0.1`,从别的机器跑的 daemon 是连不上 `http://<server-ip>:8080` 的——这也是有意为之,否则服务密钥会直接暴露在公网。正确做法是在 server 上跑一个反向代理(Caddy / nginx / Cloudflare Tunnel),由它终结 TLS,再反代到 `127.0.0.1:8080`(backend)和 `127.0.0.1:3000`(frontend)。然后把 CLI 指到公开的 HTTPS 域名:
+如果 Multica 服务也在这台电脑上,运行:
```bash
-multica setup self-host \
- --server-url https://<你的域名> \
- --app-url https://<你的域名>
+multica setup self-host
```
-<Callout type="info">
-更习惯用环境变量?省略对应 flag 时,`setup self-host` 会读取 `MULTICA_SERVER_URL` 和 `MULTICA_APP_URL`(同时设置时 flag 优先)。`MULTICA_SERVER_URL` 也接受[环境变量](/environment-variables)里那种 `ws://…/ws` 的 daemon 写法,并自动归一化为 HTTP 地址。
-</Callout>
+如果 Multica 服务在另一台机器上,传入刚才配置的两个地址:
-最小可用的 Caddyfile,单域名同时挂前后端(带 WebSocket 转发,daemon 和网页端都依赖):
+```bash
+multica setup self-host \
+ --server-url https://api.example.com \
+ --app-url https://app.example.com
+```
-```nginx
-multica.example.com {
- # WebSocket 路由——必须在 catch-all 之前
- @ws path /ws /ws/*
- handle @ws {
- reverse_proxy 127.0.0.1:8080 {
- flush_interval -1
- }
- }
+这条命令会先检查 `<server-url>/health`,再打开浏览器完成登录。登录完成后,它会保存本机凭据并启动守护进程。
- # Backend API
- handle /api/* {
- reverse_proxy 127.0.0.1:8080
- }
+确认连接状态:
- # 其它请求 → 前端
- reverse_proxy 127.0.0.1:3000
-}
+```bash
+multica daemon status
```
-代理起好之后,记得在 server 的 `.env` 里把 `FRONTEND_ORIGIN` 设成 `https://multica.example.com` 并重启后端,否则 WebSocket 的 origin 校验会把浏览器拒掉(见 [故障排查 → WebSocket 连不上](/troubleshooting#websocket-连不上))。
+正常情况下,输出中会显示:
-[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) 也是不错的选择——它直接给一个公开域名 + TLS,host 上不用对外暴露任何端口。Nginx 也能做(分 `app.` / `api.` 两个域名 + `proxy_set_header Upgrade` 转 WebSocket),关键就是终结 TLS、并在 `/ws` 上转发 `Upgrade` 头。
+- `Daemon: running`
+- `Agents` 中包含本机已安装的 AI 编程工具
+- `Workspaces` 大于 `0`
-## 6. 创建智能体 + 分配第一个任务
+## 6. 完成第一次执行
-流程和 Cloud 一样——见 [Cloud 快速上手 → 5-6 步](/cloud-quickstart#5-创建智能体)。
+回到 Multica。运行时列表中出现在线的运行时后,创建一个智能体,并把第一个 issue 分配给它。
-<span id="7-usage-rollup-no-operator-action-required" />
+执行日志变为"已完成"、时间线中出现智能体的回复,说明自托管服务、执行电脑和 AI 编程工具已经连通。详细步骤见[快速上手](/cloud-quickstart)第 3-5 步。
-## 7. 用量汇总(无需运维操作)
+## 常用管理命令
-<Callout type="info">
-Usage / Runtime 看板读的是派生表 `task_usage_hourly`,由 `rollup_task_usage_hourly()` 周期性填充。从 MUL-2957 起,后端通过 DB 后端的调度器在进程内运行该 rollup —— 不再需要 `pg_cron`,外部 cron / systemd timer 也不再是推荐方案。默认的 `pgvector/pgvector:pg17` 镜像无需改动即可工作。
-</Callout>
+以下命令都在 `multica` 仓库目录中运行:
+
+```bash
+# 查看状态
+docker compose -f docker-compose.selfhost.yml ps
-进程内调度器每 30 秒 tick 一次,通过 `sys_cron_executions` 表认领 5 分钟一档的 UTC plan。多 backend 副本同时跑也安全 —— 唯一键 `(job_name, scope_kind, scope_id, plan_time)` 保证每个 plan 只有一个赢家。新部署不需要任何额外配置。
+# 查看 backend 日志
+docker compose -f docker-compose.selfhost.yml logs -f backend
-**兼容性 —— 已注册的 `pg_cron` 任务。** 如果你之前用 `pg_cron` 注册过 rollup(`SELECT cron.schedule('rollup_task_usage_hourly', '*/5 * * * *', …)`),不删也行 —— SQL 函数内部持有 advisory lock 4246,应用调度器和 `pg_cron` 不会并发双写。要清掉冗余项可以执行:
+# 应用 .env 变化
+docker compose -f docker-compose.selfhost.yml up -d
-```sql
-SELECT cron.unschedule('rollup_task_usage_hourly')
- FROM cron.job WHERE jobname = 'rollup_task_usage_hourly';
+# 停止服务,保留数据卷
+docker compose -f docker-compose.selfhost.yml down
```
-**从 `v0.3.4 → v0.3.5+` 升级。** 上一版要求运维在应用 migration 103 之前手动跑 `cmd/backfill_task_usage_hourly`,否则 fail-closed 守卫会中止 `migrate up`。从 MUL-2957 起这一步是自动的:migrate 命令会在应用 migration 103 之前(advisory lock 4246 保护下)运行幂等的按月切片 backfill,然后继续。在繁忙的数据库上你仍可以用 `--sleep-between-slices=2s` 跑独立 backfill 来限制读压力,但已不是必需。
-
-完整参考(含运维注意事项和 Kubernetes 部署形态)见仓库的 [`SELF_HOSTING_ADVANCED.md → Usage Dashboard Rollup`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING_ADVANCED.md#usage-dashboard-rollup)。
+升级已发布的镜像:
-## 升级
+```bash
+git pull --ff-only
+docker compose -f docker-compose.selfhost.yml pull
+docker compose -f docker-compose.selfhost.yml up -d
+curl -fsS http://localhost:8080/readyz
+```
Docker Compose 部署有两种升级写法。在已有部署上两者**结果相同**——`Makefile` 里的 `selfhost` target 跑的就是同一套 `docker compose pull` + `up -d`,只是额外多做了两件事:`.env` 缺失时生成一份,以及等 `/health` 就绪后打印一段状态汇总。用哪个都行:
@@ -276,6 +301,8 @@ docker compose -f docker-compose.selfhost.yml exec -T postgres \
docker compose -f docker-compose.selfhost.yml logs -f backend
```
+Migration 在 backend 启动时自动运行;需要回填历史数据的 migration(如 103)也会自动完成回填。自动回填极少数情况下失败,报 `refusing to drop legacy daily rollups`,处理见[故障排查](/troubleshooting#升级时-migration-103-拒绝执行)。
+
### 用 `/readyz` 验证,不要用 `/health`
`/health` 是 **liveness** 探针,只要进程还活着就返回 `{"status":"ok"}`,migration 失败了它照样是 ok。`/readyz`(`server/cmd/server/router.go:680`,`/healthz` 是它的别名)会真正检查数据库和已应用的 migration 集合,升级出问题能被它拦下来:
@@ -291,67 +318,27 @@ curl -s localhost:8080/readyz
Helm 有自己的升级路径:在 values 文件里把 `images.backend.tag` / `images.frontend.tag` 设成你要的版本,然后 `helm upgrade`。改 tag 就改了 pod spec,Kubernetes 会拉新镜像并滚动更新——这是可靠的路径。
-`kubectl -n multica rollout restart` 本身**不是**升级。chart 默认 `pullPolicy: IfNotPresent`(`deploy/helm/multica/values.yaml`),节点上已经缓存过这个 tag 的话,restart 只会用回旧镜像,什么都没变——和钉死 `MULTICA_IMAGE_TAG` 是同一类坑。真要靠浮动 tag 走这条路,得先把 `images.backend.pullPolicy` / `images.frontend.pullPolicy` 设成 `Always`。见下面的 [Kubernetes 部署(替代方案)](#kubernetes-部署替代方案)。
-
-## Kubernetes 部署(替代方案)
+`kubectl -n multica rollout restart` 本身**不是**升级。chart 默认 `pullPolicy: IfNotPresent`(`deploy/helm/multica/values.yaml`),节点上已经缓存过这个 tag 的话,restart 只会用回旧镜像,什么都没变——和钉死 `MULTICA_IMAGE_TAG` 是同一类坑。真要靠浮动 tag 走这条路,得先把 `images.backend.pullPolicy` / `images.frontend.pullPolicy` 设成 `Always`。详见仓库的 [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative)。
-如果你已经在跑 Kubernetes 集群,仓库里也带了一个 Helm chart,路径 `deploy/helm/multica/`。它就是 k8s 版的 `make selfhost`——一样的 backend 镜像、frontend 镜像、`pgvector/pgvector:pg17` Postgres,封装成 Deployment / Service / Ingress,再加上一个由 `values.yaml` 渲染出来的 `ConfigMap`。这套 chart 是按照 k3s + Traefik + `local-path` 写的,集群里只要有 Ingress controller 和默认的 `ReadWriteOnce` StorageClass 就能跑,其他类型的集群稍微改一改也能用。
-
-这个 chart **不会模板化任何敏感值**。它通过 name 引用一个叫 `multica-secrets` 的 Secret,所以真实的 JWT / DB / Resend / Google 密钥永远不用进 git,也不用进 `values.yaml`。先用 kubectl 一次性把命名空间和 Secret 建好:
-
-```bash
-kubectl create namespace multica
-
-kubectl -n multica create secret generic multica-secrets \
- --from-literal=JWT_SECRET="$(openssl rand -hex 32)" \
- --from-literal=POSTGRES_PASSWORD="$(openssl rand -hex 16)" \
- --from-literal=RESEND_API_KEY="" \
- --from-literal=GOOGLE_CLIENT_SECRET="" \
- --from-literal=CLOUDFRONT_PRIVATE_KEY="" \
- --from-literal=MULTICA_DEV_VERIFICATION_CODE=""
-```
-
-再装 chart:
-
-```bash
-git clone https://github.com/multica-ai/multica.git
-cd multica
-helm install multica deploy/helm/multica -n multica
-```
-
-默认主机名是 `multica.dev.lan`(web)和 `api.multica.dev.lan`(backend)。把它们加进 `/etc/hosts`(或者本地 DNS),指向任意一个 Ingress 可达的节点 IP 就行。要换主机名,就把 `deploy/helm/multica/values.yaml` 复制一份,改掉 `ingress.frontend.host` / `ingress.backend.host`,再把 `backend.config.appUrl` / `frontendOrigin` / `localUploadBaseUrl` / `googleRedirectUri` 改成相应的地址,然后 `helm install ... -f my-values.yaml`。
-
-冷集群上 backend 可能会 `Running` 但 `Not Ready` 持续几分钟,等 Postgres 起来并跑完 migration——startupProbe 会兜住这一段,pod 不会被 liveness 重启。等它 `Ready` 之后:
-
-```bash
-curl -H "Host: api.multica.dev.lan" http://<ingress-ip>/healthz
-# {"status":"ok","checks":{"db":"ok","migrations":"ok"}}
-```
-
-然后浏览器打开 `http://multica.dev.lan`,回到上面的 [第 4 步——首次登录](#4-首次登录--创建工作区) 继续。命令行连到你的 Ingress 主机:
-
-```bash
-multica setup self-host \
- --server-url http://api.multica.dev.lan \
- --app-url http://multica.dev.lan
-```
-
-要换到某个 Multica 版本,就在 values 文件里设 `images.backend.tag` / `images.frontend.tag`,再 `helm upgrade`——升级也走这条路,因为 tag 变了才会强制重新拉取并滚动更新。`kubectl -n multica rollout restart deploy/multica-backend deploy/multica-frontend` 只有在你同时把 `images.backend.pullPolicy` / `images.frontend.pullPolicy` 设成 `Always` 时才会重新拉浮动 tag;chart 默认是 `IfNotPresent`,会直接复用节点上已缓存的镜像。`helm -n multica uninstall multica` 只删工作负载,PVC 和 Secret 都保留;`kubectl delete namespace multica` 才会全清。
-
-完整参考——三种登录方式、为了绕过 web 镜像 build-time 写死的 `REMOTE_API_URL` 而加的 `backend` ExternalName 别名、资源限制、TLS——都在仓库的 [`SELF_HOSTING.md`](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md#kubernetes-deployment-alternative)。
+<Callout type="warning">
+`docker compose down` 会保留 `pgdata` 和 `backend_uploads`。加上 `-v` 会删除这些数据卷,包括数据库;除非确定要清空实例,否则不要运行 `docker compose down -v`。
+</Callout>
## 常见问题
-- **后端起不来**:看容器日志 `docker compose -f docker-compose.selfhost.yml logs backend`;常见是 `.env` 里 `DATABASE_URL` 或 `JWT_SECRET` 有问题
-- **验证码收不到**:没配任何邮件后端(Resend 和 SMTP 都没设) → 从 `docker compose logs backend` 里找 `[DEV] Verification code`
-- **WebSocket 连不上**:公网部署必须设 `FRONTEND_ORIGIN` 成你真实的前端域名;见 [故障排查 → WebSocket 连不上](/troubleshooting#websocket-连不上)
-- **Usage / Runtime 看板一直是 0**:没人调度 `rollup_task_usage_hourly()` —— 见上面的 [第 7 步](#7-usage-rollup-no-operator-action-required) 和 [故障排查 → Usage 看板一直是 0](/troubleshooting#usage-看板一直是-0)
-- **`migrate up` 报 `refusing to drop legacy daily rollups`**:`v0.3.4 → v0.3.5+` 升级路径的 fail-closed guard。从 MUL-2957 起 migrate 命令在应用 migration 103 之前会自动跑 backfill —— 见 [第 7 步](#7-usage-rollup-no-operator-action-required)
+| 现象 | 先检查什么 |
+|---|---|
+| `/readyz` 没有返回 `ok` | 运行 `docker compose -f docker-compose.selfhost.yml logs backend postgres`。 |
+| 收不到验证码 | 请求一次验证码,再从 backend 日志中查找 `Verification code`。 |
+| `setup self-host` 提示 server 不可达 | 在执行电脑上请求 `https://api.example.com/health`,确认 DNS、TLS 和反向代理都可达。 |
+| 守护进程没有列出 `Agents` | 确认 AI 编程工具在 `PATH` 中并已登录,然后运行 `multica daemon restart`。 |
+| issue 一直排队 | 运行 `multica daemon status`,确认守护进程正在运行并连接了工作区。 |
+
+更多情况见[故障排查](/troubleshooting)。
-## 下一步
+## 接下来
-- [环境变量](/environment-variables) —— 完整 env 清单
-- [登录与注册配置](/auth-setup) —— Resend / OAuth / 注册白名单详细配置
-- [GitHub 集成](/github-integration) —— 连一个 GitHub App,让 PR 自动关联 issue、merge 时自动转 Done
-- [故障排查](/troubleshooting) —— 遇到问题先来这里
-- [桌面应用](/desktop-app) —— 可以通过 `~/.multica/desktop.json` 连接 Desktop;Web 前端 + CLI 仍然是最快的自部署路径
+- [登录与注册配置](/auth-setup) — 配置邮件、Google 登录和注册范围。
+- [环境变量](/environment-variables) — 查看完整的服务端配置。
+- [Self-hosting guide](https://github.com/multica-ai/multica/blob/main/SELF_HOSTING.md) — Kubernetes、升级和手动部署。
+- [桌面应用](/desktop-app) — 让 Desktop 连接自托管服务。
diff --git a/apps/docs/content/docs/skills.ja.mdx b/apps/docs/content/docs/skills.ja.mdx
index e128237040..1c48f5b387 100644
--- a/apps/docs/content/docs/skills.ja.mdx
+++ b/apps/docs/content/docs/skills.ja.mdx
@@ -1,73 +1,94 @@
---
title: スキル
-description: エージェントに「ナレッジパック」を取り付けましょう — Anthropic Agent Skills オープン標準と互換性があります。
+description: よく使う指示、手順、資料をまとめ、複数のエージェントで再利用できるスキルにします。
---
import { Callout } from "fumadocs-ui/components/callout";
-スキルは[エージェント](/agents)のための**ナレッジパック**です — `SKILL.md` 1 つと、任意の補助ファイル(スクリプト、設定、参照テンプレート)で構成され、エージェントに「この種のタスクに出くわしたら、こう考えてこう動け」と伝えます。Multica は [Anthropic Agent Skills](https://agentskills.io) オープン標準を採用しているため、Anthropic 公式リポジトリ、ClawHub、skills.sh などから取得した、標準に準拠したどのスキルでも直接インポートできます。
+スキルは、ワークスペースで再利用できる仕事の進め方のセットです。`SKILL.md` を主ファイルとし、スクリプト、テンプレート、参考資料を添付できます。
-## ワークスペーススキルとローカルスキル
+スキルを[エージェント](/agents)に追加すると、エージェントは関連するタスクの実行時にその内容を使います。同じ手法を各エージェントの指示へ複製する必要がなくなり、修正も 1 か所で済みます。
-Multica は 2 つのスキルソースに対応しています。
+## スキルとエージェントの指示
-- **ワークスペーススキル** — Multica のクラウドに保存されます。エージェントに取り付けると、タスク実行時にあなたのデーモンへ同期されます。これが**チーム全体でスキルを共有する標準的な方法**です。
-- **ローカルスキル** — あなたのマシン上のディレクトリに存在します。あなたが要求すると、[デーモン](/daemon-runtimes)がマシンをスキャンし、どれをワークスペースに取り込むかを手動で選びます。デーモンは**2 つのルートを優先順位順に**確認します。まずランタイム自身のスキルディレクトリ(各 AI コーディングツールには慣例的なデフォルトパスがあります。例: Claude Code の `~/.claude/skills/`)、次にツール横断の汎用ディレクトリ `~/.agents/skills/`(Codex や Gemini CLI などのエコシステムが共有する場所)です。同じスキル名が両方に存在する場合は**プロバイダー専用ディレクトリが優先**されるため、汎用ルートは*追加の*スキルを表示するだけで、既存スキルの解決結果を変えることはありません。
+| | エージェントの指示 | スキル |
+|---|---|---|
+| **向いている内容** | このエージェントの長期的な職責、境界、成果物の要件 | ある種類の仕事で再利用できる手順、資料、ツール |
+| **適用範囲** | 1 つのエージェントに属し、毎回の実行で提供される | 複数のエージェントに追加でき、個別に有効化・無効化できる |
+| **例** | 「フロントエンドコードのレビューだけを行い、直接修正しない」 | アクセシビリティのチェックリストと報告テンプレート |
-ほとんどの場合は**ワークスペーススキル**が望ましいでしょう。一度インポートすれば、すべてのチームメイトのエージェントが使えるからです。ローカルスキルは、まずローカルでテストしたい場合や、内容に機密性の高いローカル資料が含まれる場合に適しています。
+## スキルの作成とインポート
-## リポジトリスコープのスキル
+ワークスペースの **スキル** ページで「新規スキル」を選ぶと、3 つの方法が使えます。
-リポジトリスコープのスキルは想定された挙動です。一部の AI コーディングツールは、`.claude/skills/`、`.cursor/skills/`、`.opencode/skills/`、`.agents/skills/` など、**リポジトリにコミットされたプロジェクトレベルのスキル**を検出します。Multica のタスクがそのリポジトリをチェックアウトすると、それらのファイルは作業ディレクトリに残り、基盤となるツールが自身のネイティブ探索ルールで読み込めます。そのリポジトリで使うためだけに、これらの repo skills を Multica へインポートする必要はありません。また Multica は、それらをワークスペーススキルレジストリへ自動インポートしません。
+| 方法 | 向いている場合 |
+|---|---|
+| **手動で作成** | 空白の `SKILL.md` から書き始める。 |
+| **URL からインポート** | GitHub、ClawHub、Skills.sh で公開済みのスキルをインポートする。 |
+| **ランタイムからコピー** | 接続中のコンピュータにあるスキルをスキャンし、選んだものをワークスペースへコピーする。 |
-プロジェクトレベルの探索に対応するツールでは、ワークスペーススキルも同じプロバイダー固有の場所へ同期されます。ワークスペーススキルが既存のリポジトリスキルディレクトリと衝突する場合、Multica はリポジトリのファイルを上書きせず、`review-helper-multica` のような兄弟名でワークスペースコピーを書き込みます。そのためツールには、調整後の名前を持つワークスペースコピーを含めて両方のスキルが見えることがあります。
+ランタイムからのコピーは、その時点のファイルのスナップショットです。後からローカルファイルが変わっても、ワークスペース側のバージョンは自動更新されません。再インポートするか、Multica 上で編集してください。
-## スキルをインポートする
+CLI では、`.skill` や `.zip` ファイルからもインポートできます。
-ワークスペーススキルは 4 つのソースから取得します。
+```bash
+multica skill import --file ./review-helper.skill
+```
-- **新規作成** — UI で `SKILL.md` と関連ファイルを直接作成します
-- **GitHub から** — リポジトリ URL を貼り付けると(例: `https://github.com/owner/repo/tree/main/skills/my-skill`)、Multica がそのディレクトリの `SKILL.md` とすべてのファイルを取得します
-- **ClawHub から** — [ClawHub](https://clawhub.io) 公開マーケットプレイスで検索し、バージョンを選択してインポートします
-- **ローカルから** — デーモンがあなたのマシンのスキルディレクトリをスキャンし、ワークスペースに取り込むものを選びます
+インポート時にワークスペースへ同名のスキルがすでにある場合は、インポートの中止、既存内容の上書き、新しい名前での保存、スキップのいずれかを選べます。インポートによる上書きができるのは、そのスキルの作成者本人だけです。ワークスペースの `admin` は、アプリ内でスキルを編集できても、インポートで上書きすることはできません。
-個々のファイルもスキルパック全体も容量の上限があります(GitHub からインポートする際の単一ファイルの上限は約 1 MB)。正確なルールはインポートダイアログに表示され、上限を超えるとエラーが返されます。
+## スキルの内容
-## エージェントに取り付ける
+すべてのスキルには、主ファイル `SKILL.md` があります。ここに次の内容を書きます。
-インポートしたスキルは、**特定のエージェントに取り付けて**初めて効果を発揮します。1 つのエージェントに複数のスキルを取り付けられ、1 つのスキルを複数のエージェントに取り付けることもできます。
+- このスキルが適用される場面
+- 開始前に確認すること
+- 実行手順
+- 結果をどんな形で提出するか
+- どんな場合に停止してメンバーへ確認するか
-取り付けた後は、エージェントが次にタスクを開始するときにスキルを取り込みます — 各 AI コーディングツールには固有のスキル探索パスがあり(Claude Code は `.claude/skills/`、Cursor は `.cursor/skills/`、Antigravity は `.agents/skills/` などを使用)、Multica が正しい場所にファイルを自動的に配置します。**ただし、3 つのツール(Gemini、Hermes、OpenClaw)は現在、汎用のフォールバックパス `.agent_context/skills/` を使用しており、これらのツールが実際にそのパスからスキルを読み込むかどうかはツール自体に依存します。** 完全なパスマッピングと、ネイティブ探索とフォールバックの区別は [AI コーディングツール比較 → スキルファイルが置かれる場所](/providers#where-skill-files-go)にあります。
+補助ファイルも追加できます。例:
-スキルの内容を編集した後は、**新しく作成されたタスクだけが新しいバージョンを取り込みます** — すでに実行中のタスクは以前のスキルをそのまま使い続けます。
+```text
+SKILL.md
+references/api-conventions.md
+templates/review-report.md
+scripts/check.sh
+```
-## サードパーティスキルの安全性
+`SKILL.md` は予約されたパスで、同名の補助ファイルは作成できません。補助ファイルは、主ファイルと一緒にエージェントへ提供されます。
-GitHub や ClawHub からインポートしたスキルには、スクリプトや実行可能なコンテンツが含まれることがあります。Multica 自体はそれらを**署名も、監査も、サンドボックス化もしません** — スキルの内容はそのまま対応する AI コーディングツールに渡され、ツールがそれを実行可能なものとして扱うかどうかはツール次第です。
+## エージェントへの追加
-<Callout type="warning">
-**サードパーティスキルをインポートする前に、`SKILL.md` と同梱されるすべてのファイルを確認してください。**
+スキルを作成またはインポートしたら、さらに具体的なエージェントへ追加する必要があります。スキルのページでエージェントを選ぶことも、エージェントの **スキル** タブから管理することもできます。
-2026 年 2 月に発生した「ClawHavoc」事件では、人気のスキルパックに仕込まれた悪意ある指示が、影響を受けたユーザーの API キーを盗み出しました。ClawHub はその後 VirusTotal スキャンを追加しましたが、**自動スキャンはあなた自身の確認の代わりにはなりません。**
+- 1 つのエージェントは複数のスキルを使えます。
+- 同じスキルを複数のエージェントで使えます。
+- しばらく使わないときは、スキルを削除せず紐づけを無効化できます。
+- 編集した内容は以降の実行から有効になり、すでに実行中のタスクは変わりません。
-**信頼できるソースからのみインポートしてください。** 機密データが関わるプロジェクトでは、自分で書いたローカルスキルだけを使うことを検討してください。
-</Callout>
+エージェントへのスキルの追加、削除、無効化ができるのは、そのエージェントを変更する権限を持つメンバーだけです。
-## スキルと MCP
+## ワークスペーススキルとリポジトリ内のスキル
-どちらもエージェントができることを拡張しますが、方向が異なります。
+ワークスペーススキルは Multica に保存されます。チームで共同でメンテナンスし、さまざまなエージェントに追加する使い方に向いています。
-- **スキル** = 構造化された**ナレッジパック**(静的なコンテンツ + 指示)。エージェントはスキルを読んで「問題 X を見たら、こう考えてこう行動する」を学びます。
-- **MCP**(Model Context Protocol)= **ツールチャネル**。エージェントは MCP を使って外部サービス(データベース、ファイルシステム、サードパーティ API)に接続し、それらを**呼び出します**。
+一部の AI コーディングツールは、`.claude/skills/` や `.agents/skills/` など、コードリポジトリ内のプロジェクトレベルのスキルも直接読み込みます。これらのファイルはリポジトリの管理下のままで、Multica が自動的にワークスペーススキルとして登録することはありません。具体的な対応方法は使用するツールによります。[AI コーディングツール対応表](/providers)を参照してください。
-この 2 つは相互補完的です。現在の Multica では、MCP サポートは**ツールごとに実装されています**: Claude Code、Codex、Cursor、Hermes、Kimi、Kiro CLI、OpenCode、OpenClaw は `mcp_config` を使用し、他のツールはこのフィールドを受け取っても実際には使いません。MCP 専用のセクションは今後のリリースで追加される予定です。
+接続中のコンピュータにインストール済みのランタイムローカルのスキル(Claude Code と Codex)は、エージェントの **スキル** タブに表示され、エージェントごとに個別に無効化できます。無効化にも、そのエージェントを変更する権限が必要です。
----
+## 変更権限
+
+どのワークスペースメンバーでもスキルを作成・インポートできます。作成者とワークスペースの `owner`・`admin` は変更と削除ができます。ほかのメンバーは閲覧と利用はできますが、内容の上書きはできません。
-これで、エージェントとは何か、どう作るか、スキルをどう取り付けるかが分かりました。次の問いはこれです。**エージェントは実際にどこで実行され、なぜ自分のエージェントはときどき止まってしまうのか?** 次の章では実行アーキテクチャ — デーモン、ランタイム、そしてタスクがどう連携するか — を扱います。
+削除は永久的な操作で、すべてのエージェントから同時にそのスキルが取り外されます。
+
+<Callout type="warning">
+外部からインポートしたスキルには、スクリプト、コマンド、安全でない指示が含まれることがあります。Multica が代わりに審査、署名、サンドボックス化することはありません。インポートした内容はそのままエージェントに渡されて実行されるため、信頼できるソースからインポートしてください。
+</Callout>
## 次のステップ
-- [デーモンとランタイム](/daemon-runtimes) — エージェントが実際に実行される場所、そしてオンラインとオフラインの見分け方
-- [タスクの実行](/tasks) — 1 回の「エージェント作業セッション」の全ライフサイクル
-- [AI コーディングツール比較](/providers) — 16 ツール全体の比較(各ツールのスキル注入パスを含む)
+- [スクワッド](/squads) — リーダーに仕事の内容に合ったメンバーを選ばせる。
+- [デーモンとランタイム](/daemon-runtimes) — スキルが実際の実行環境に届く仕組み。
+- [AI コーディングツール対応表](/providers) — ツールごとのスキル対応の違い。
diff --git a/apps/docs/content/docs/skills.ko.mdx b/apps/docs/content/docs/skills.ko.mdx
index 3e79f9439d..4dcdd162bb 100644
--- a/apps/docs/content/docs/skills.ko.mdx
+++ b/apps/docs/content/docs/skills.ko.mdx
@@ -1,73 +1,94 @@
---
title: 스킬
-description: 에이전트에 "지식 팩"을 연결하세요 — Anthropic Agent Skills 개방 표준과 호환됩니다.
+description: 자주 사용하는 지시문, 단계, 자료를 여러 에이전트가 재사용할 수 있는 스킬로 정리합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-스킬은 [에이전트](/agents)를 위한 **지식 팩**입니다 — `SKILL.md` 한 개와 선택적인 보조 파일(스크립트, 설정, 참조 템플릿)로 구성되며, 에이전트에게 "이런 종류의 작업을 만나면 이렇게 생각하고 행동하라"고 알려줍니다. Multica는 [Anthropic Agent Skills](https://agentskills.io) 개방 표준을 채택하고 있으므로, Anthropic 공식 저장소, ClawHub, skills.sh 등에서 가져온 표준을 준수하는 어떤 스킬이든 곧바로 가져올 수 있습니다.
+스킬은 워크스페이스에서 재사용할 수 있는 작업 방법의 묶음입니다. `SKILL.md`가 기본 파일이며 스크립트, 템플릿, 참고 자료를 함께 넣을 수도 있습니다.
-## 워크스페이스 스킬과 로컬 스킬
+스킬을 [에이전트](/agents)에 추가하면 에이전트가 관련 태스크를 실행할 때 그 안의 설명을 사용합니다. 같은 방법을 각 에이전트 지시문에 따로 복사할 필요가 없고, 수정할 때도 한 곳만 관리하면 됩니다.
-Multica는 두 가지 스킬 소스를 지원합니다.
+## 스킬과 에이전트 지시문
-- **워크스페이스 스킬** — Multica 클라우드에 저장됩니다. 에이전트에 연결되면 작업 실행 시점에 여러분의 데몬으로 동기화됩니다. 이것이 **팀 전체에서 스킬을 공유하는 표준 방식**입니다.
-- **로컬 스킬** — 여러분의 기기에 있는 디렉터리에 존재합니다. 여러분이 요청하면 [데몬](/daemon-runtimes)이 기기를 스캔하고, 어떤 스킬을 워크스페이스로 가져올지 직접 고릅니다. 데몬은 **두 개의 루트를 우선순위 순서로** 확인합니다. 먼저 런타임 자체의 스킬 디렉터리(각 AI 코딩 도구마다 관례적인 기본 경로가 있습니다. 예: Claude Code의 `~/.claude/skills/`), 그다음 도구 간 공용 디렉터리 `~/.agents/skills/`(Codex, Gemini CLI 등 생태계가 공유하는 위치)입니다. 동일한 스킬 이름이 양쪽에 모두 있으면 **프로바이더 전용 디렉터리가 우선**하므로, 공용 루트는 *추가* 스킬만 노출할 뿐 기존 스킬의 해석 결과를 절대 바꾸지 않습니다.
+| | 에이전트 지시문 | 스킬 |
+|---|---|---|
+| **저장하기 적합한 내용** | 해당 에이전트의 장기적인 역할, 경계, 결과물 요구 사항 | 특정 작업 유형에서 재사용할 수 있는 단계, 자료, 도구 |
+| **사용 범위** | 에이전트 한 명에게만 속하며 모든 실행에 제공 | 여러 에이전트에 추가하고 개별적으로 활성화하거나 비활성화 가능 |
+| **예시** | "프런트엔드 코드만 검토하고 직접 수정하지 않기" | 접근성 점검 체크리스트와 보고서 템플릿 |
-대부분의 경우 **워크스페이스 스킬**을 원하게 됩니다. 한 번만 가져오면 모든 팀원의 에이전트가 사용할 수 있기 때문입니다. 로컬 스킬은 먼저 로컬에서 테스트하고 싶거나, 콘텐츠에 민감한 로컬 자료가 포함된 경우에 적합합니다.
+## 스킬 생성 또는 가져오기
-## 저장소 범위 스킬
+워크스페이스의 **스킬** 페이지에서 "새 스킬"을 선택하면 세 가지 방법을 사용할 수 있습니다.
-저장소 범위 스킬은 의도된 동작입니다. 일부 AI 코딩 도구는 `.claude/skills/`, `.cursor/skills/`, `.opencode/skills/`, `.agents/skills/`처럼 **저장소에 커밋된 프로젝트 수준 스킬**을 탐색합니다. Multica 작업이 해당 저장소를 체크아웃하면 이 파일들은 작업 디렉터리에 남아 있고, 기반 도구가 자체 기본 탐색 규칙에 따라 읽어 들일 수 있습니다. 해당 저장소에서 사용하기 위해 이러한 repo skills를 Multica로 먼저 가져올 필요는 없습니다. Multica도 이를 워크스페이스 스킬 레지스트리로 자동 가져오지 않습니다.
+| 방법 | 적합한 경우 |
+|---|---|
+| **직접 만들기** | 빈 `SKILL.md`에서 작성합니다. |
+| **URL에서 가져오기** | GitHub, ClawHub, Skills.sh에 게시된 스킬을 가져옵니다. |
+| **런타임에서 복사** | 연결된 컴퓨터의 스킬을 스캔하고 선택한 내용을 워크스페이스로 복사합니다. |
-프로젝트 수준 탐색을 지원하는 도구에서는 워크스페이스 스킬도 같은 프로바이더 기본 위치로 동기화됩니다. 워크스페이스 스킬이 기존 저장소 스킬 디렉터리와 충돌하면, Multica는 저장소 파일을 덮어쓰지 않고 `review-helper-multica` 같은 형제 이름으로 워크스페이스 사본을 씁니다. 그러면 도구에는 조정된 이름을 가진 워크스페이스 사본을 포함해 두 스킬이 모두 보일 수 있습니다.
+런타임에서 복사되는 내용은 그 시점의 파일 스냅샷입니다. 이후 로컬 파일이 바뀌어도 워크스페이스 버전은 자동으로 업데이트되지 않습니다. 다시 가져오거나 Multica에서 수정해야 합니다.
-## 스킬 가져오기
+CLI에서는 `.skill` 또는 `.zip` 파일에서도 가져올 수 있습니다.
-워크스페이스 스킬은 네 가지 소스에서 가져옵니다.
+```bash
+multica skill import --file ./review-helper.skill
+```
-- **새로 만들기** — UI에서 `SKILL.md`와 관련 파일을 직접 작성합니다
-- **GitHub에서** — 저장소 URL을 붙여 넣으면(예: `https://github.com/owner/repo/tree/main/skills/my-skill`) Multica가 해당 디렉터리의 `SKILL.md`와 모든 파일을 가져옵니다
-- **ClawHub에서** — [ClawHub](https://clawhub.io) 공개 마켓플레이스에서 검색하고 버전을 선택하여 가져옵니다
-- **로컬에서** — 데몬이 여러분 기기의 스킬 디렉터리를 스캔하고, 워크스페이스로 가져올 스킬을 직접 고릅니다
+가져올 때 워크스페이스에 같은 이름의 스킬이 이미 있으면 가져오기를 중단하거나, 기존 내용을 덮어쓰거나, 새 이름으로 저장하거나, 건너뛸 수 있습니다. 가져오기를 통한 덮어쓰기는 해당 스킬의 생성자만 할 수 있습니다. 워크스페이스 `admin`이 앱 안에서 수정할 수 있더라도 가져오기로는 덮어쓸 수 없습니다.
-개별 파일과 스킬 팩 전체 모두 용량 제한이 있습니다(GitHub에서 가져올 때 단일 파일 제한은 약 1 MB). 정확한 규칙은 가져오기 대화 상자에 표시되며, 제한을 초과하면 오류가 반환됩니다.
+## 스킬 내용
-## 에이전트에 연결하기
+모든 스킬에는 기본 파일 `SKILL.md`가 있습니다. 이 파일에 다음 내용을 명확히 작성하세요.
-가져온 스킬은 **특정 에이전트에 연결**되어야 효과를 발휘합니다. 한 에이전트에 여러 스킬을 연결할 수 있고, 한 스킬을 여러 에이전트에 연결할 수도 있습니다.
+- 스킬이 적합한 상황
+- 시작 전에 확인할 사항
+- 실행 단계
+- 결과를 제출할 형식
+- 중지하고 멤버에게 확인해야 할 경우
-연결한 뒤에는 에이전트가 다음번 작업을 시작할 때 스킬을 가져옵니다 — 각 AI 코딩 도구는 고유한 스킬 탐색 경로를 가지며(Claude Code는 `.claude/skills/`, Cursor는 `.cursor/skills/`, Antigravity는 `.agents/skills/` 등을 사용), Multica가 올바른 위치에 파일을 자동으로 배치합니다. **다만 세 가지 도구(Gemini, Hermes, OpenClaw)는 현재 범용 폴백 경로인 `.agent_context/skills/`를 사용하며, 이 도구들이 실제로 해당 경로에서 스킬을 읽어 들이는지는 도구 자체에 달려 있습니다.** 전체 경로 매핑과 네이티브 탐색 대 폴백의 구분은 [AI 코딩 도구 비교 → 스킬 파일이 놓이는 위치](/providers#where-skill-files-go)에 있습니다.
+다음과 같은 지원 파일도 추가할 수 있습니다.
-스킬의 내용을 편집한 뒤에는 **새로 생성된 작업만 새 버전을 가져옵니다** — 이미 실행 중인 작업은 이전 스킬을 그대로 사용합니다.
+```text
+SKILL.md
+references/api-conventions.md
+templates/review-report.md
+scripts/check.sh
+```
-## 서드파티 스킬의 안전성
+`SKILL.md`는 예약된 경로이므로 같은 이름의 지원 파일을 다시 만들 수 없습니다. 지원 파일은 기본 파일과 함께 에이전트에 제공됩니다.
-GitHub나 ClawHub에서 가져온 스킬에는 스크립트와 실행 가능한 콘텐츠가 포함될 수 있습니다. Multica 자체는 이를 **서명하거나, 감사하거나, 샌드박스화하지 않습니다** — 스킬 콘텐츠는 해당 AI 코딩 도구에 있는 그대로 전달되며, 도구가 이를 실행 가능한 것으로 취급할지는 도구에 달려 있습니다.
+## 에이전트에 추가
-<Callout type="warning">
-**서드파티 스킬을 가져오기 전에, `SKILL.md`와 함께 제공되는 모든 파일을 검토하세요.**
+스킬을 만들거나 가져온 뒤에는 구체적인 에이전트에 추가해야 합니다. 스킬 페이지에서 에이전트를 선택하거나 에이전트의 **스킬** 탭을 열어 관리할 수 있습니다.
-2026년 2월에 발생한 "ClawHavoc" 사건에서는 인기 있는 스킬 팩에 심어진 악성 지침이 영향을 받은 사용자들의 API 키를 탈취했습니다. ClawHub는 이후 VirusTotal 스캔을 추가했지만, **자동 스캔이 여러분 자신의 검토를 대신할 수는 없습니다.**
+- 한 에이전트가 여러 스킬을 사용할 수 있습니다.
+- 하나의 스킬을 여러 에이전트가 사용할 수 있습니다.
+- 잠시 필요하지 않다면 스킬을 삭제하지 않고 연결을 비활성화할 수 있습니다.
+- 수정한 내용은 이후 실행부터 적용되며 이미 실행 중인 태스크에는 영향을 주지 않습니다.
-**신뢰하는 소스에서만 가져오세요.** 민감한 데이터가 관련된 프로젝트라면, 여러분이 직접 작성한 로컬 스킬만 사용하는 것을 고려하세요.
-</Callout>
+해당 에이전트를 수정할 권한이 있는 멤버만 스킬을 추가, 제거, 비활성화할 수 있습니다.
-## 스킬과 MCP
+## 워크스페이스 스킬과 저장소의 스킬
-둘 다 에이전트가 할 수 있는 일을 보강하지만, 방향이 다릅니다.
+워크스페이스 스킬은 Multica에 저장되며 팀이 함께 관리하고 여러 에이전트에 추가하기에 적합합니다.
-- **스킬** = 구조화된 **지식 팩**(정적 콘텐츠 + 지침). 에이전트는 스킬을 읽어 "문제 X를 만나면 이렇게 생각하고 이렇게 처리하라"를 학습합니다.
-- **MCP**(Model Context Protocol) = **도구 채널**. 에이전트는 MCP를 사용해 외부 서비스(데이터베이스, 파일 시스템, 서드파티 API)에 연결하고 이를 **호출**합니다.
+일부 AI 코딩 도구는 `.claude/skills/` 또는 `.agents/skills/` 같은 코드 저장소의 프로젝트 수준 스킬을 직접 읽습니다. 이 파일들은 계속 저장소에서 관리되며 Multica가 자동으로 워크스페이스 스킬로 등록하지 않습니다. 구체적인 지원 방식은 사용하는 도구에 따라 다릅니다. [AI 코딩 도구 비교](/providers)를 참고하세요.
-이 둘은 상호 보완적입니다. 현재 Multica에서 MCP 지원은 **도구별로 구현됩니다**: Claude Code, Codex, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw는 `mcp_config`를 사용하고, 다른 도구들은 이 필드를 받더라도 실제로 사용하지 않습니다. MCP 전용 섹션은 추후 릴리스에서 추가될 예정입니다.
+연결된 컴퓨터에 설치된 런타임의 로컬 스킬(Claude Code와 Codex)은 에이전트의 **스킬** 탭에 표시되며 에이전트별로 비활성화할 수 있습니다. 비활성화 역시 해당 에이전트를 수정할 권한이 있어야 합니다.
----
+## 수정 권한
+
+모든 워크스페이스 멤버가 스킬을 만들거나 가져올 수 있습니다. 생성자와 워크스페이스 `owner`, `admin`은 스킬을 수정하거나 삭제할 수 있습니다. 다른 멤버는 보고 사용할 수 있지만 내용을 덮어쓸 수 없습니다.
-이제 에이전트가 무엇인지, 어떻게 만드는지, 스킬을 어떻게 연결하는지 알게 되었습니다. 다음 질문은 이것입니다. **에이전트는 실제로 어디에서 실행되며, 왜 가끔 멈춰버리는가?** 다음 장에서는 실행 아키텍처 — 데몬, 런타임, 그리고 작업이 어떻게 함께 동작하는지 — 를 다룹니다.
+삭제는 영구적이며 해당 스킬이 모든 에이전트에서 동시에 제거됩니다.
+
+<Callout type="warning">
+외부에서 가져온 스킬에는 스크립트, 명령, 안전하지 않은 지시가 포함될 수 있습니다. Multica는 이를 대신 검토하거나 서명하거나 격리하지 않습니다. 가져온 내용은 그대로 에이전트의 실행에 제공되므로 출처를 신뢰할 수 있어야 합니다.
+</Callout>
## 다음 단계
-- [데몬과 런타임](/daemon-runtimes) — 에이전트가 실제로 실행되는 곳, 그리고 온라인과 오프라인을 구분하는 방법
-- [작업 실행하기](/tasks) — 한 번의 "에이전트 작업 세션"의 전체 수명 주기
-- [AI 코딩 도구 비교](/providers) — 16개 도구 전체 비교(각 도구의 스킬 주입 경로 포함)
+- [스쿼드](/squads) — 리더가 작업 내용에 따라 적합한 멤버를 선택하게 합니다.
+- [데몬과 런타임](/daemon-runtimes) — 스킬이 실제 실행 환경에 들어가는 방식을 알아봅니다.
+- [AI 코딩 도구 비교](/providers) — 도구별 스킬 지원 방식을 확인합니다.
diff --git a/apps/docs/content/docs/skills.mdx b/apps/docs/content/docs/skills.mdx
index 39bd8aa27b..5ad9a0d999 100644
--- a/apps/docs/content/docs/skills.mdx
+++ b/apps/docs/content/docs/skills.mdx
@@ -1,73 +1,94 @@
---
title: Skills
-description: Attach "knowledge packs" to an agent — compatible with the Anthropic Agent Skills open standard.
+description: Package recurring instructions, steps, and reference material into skills that multiple agents can reuse.
---
import { Callout } from "fumadocs-ui/components/callout";
-A Skill is a **knowledge pack** for an [agent](/agents) — a `SKILL.md` plus optional supporting files (scripts, configs, reference templates) that tell the agent "when you hit this kind of task, think and act like this." Multica adopts the [Anthropic Agent Skills](https://agentskills.io) open standard, so any compliant Skill — from Anthropic's official repository, ClawHub, or skills.sh — can be imported directly.
+A skill is a reusable set of working methods in a workspace. Its main file is `SKILL.md`, optionally accompanied by scripts, templates, and reference material.
-## Workspace skills vs. local skills
+Add a skill to an [agent](/agents) and the agent uses its guidance when executing related tasks. The same method no longer has to be copied into each agent's instructions, and updates are maintained in one place.
-Multica supports two skill sources:
+## Skills and agent instructions
-- **Workspace skill** — stored in Multica's cloud. Once attached to an agent, it's synced down to your daemon at task execution time. This is the **standard way to share skills across a team**.
-- **Local skill** — lives in a directory on your machine. On your request, the [daemon](/daemon-runtimes) scans your machine, and you manually pick which ones to bring into the workspace. The daemon checks **two roots, in priority order**: first the runtime's own skill directory (each AI coding tool has a conventional default path, e.g. Claude Code's `~/.claude/skills/`), then the cross-tool universal directory `~/.agents/skills/` — a shared location used by ecosystems like Codex and Gemini CLI. When the same skill name exists in both, the **provider-specific directory wins**, so the universal root only ever surfaces *additional* skills and never changes what an existing skill resolves to.
+| | Agent instructions | Skill |
+|---|---|---|
+| **Best for** | This agent's long-lived responsibilities, boundaries, and delivery requirements | Reusable steps, material, and tools for one kind of work |
+| **Scope** | Belongs to one agent and is provided on every run | Can be added to multiple agents and enabled or disabled individually |
+| **Example** | "Only review frontend code, never modify it directly" | An accessibility checklist and report template |
-Most of the time you want **workspace skills**: import once, every teammate's agent can use it. Local skills are a fit when you want to test locally first, or when the content involves sensitive local material.
+## Creating or importing a skill
-## Repository-scoped skills
+On the workspace **Skills** page, choose "New skill". Three options are available:
-Repo-scoped skills are expected behavior. Some AI coding tools discover **project-level skills committed inside a repository**, such as `.claude/skills/`, `.cursor/skills/`, `.opencode/skills/`, or `.agents/skills/`. When a Multica task checks out that repository, those files remain in the workdir and the underlying tool can load them through its native discovery rules. You do **not** need to import those repo skills into Multica just to use them in that repo; Multica does **not** import them into the workspace skill registry automatically.
+| Option | When it fits |
+|---|---|
+| **Create manually** | Start writing from a blank `SKILL.md`. |
+| **Import from URL** | Import a published skill from GitHub, ClawHub, or Skills.sh. |
+| **Copy from a runtime** | Scan skills on a connected computer and copy the selected ones into the workspace. |
-Workspace skills still sync into the same provider-native location for tools that support project-level discovery. If a workspace skill would collide with an existing repo skill directory, Multica writes the workspace copy to a sibling name such as `review-helper-multica` instead of overwriting the repo's files. The tool may then see both skills, with the workspace copy carrying the adjusted name.
+Copying from a runtime takes a snapshot of the files at that moment. Later changes to the local files do not update the workspace version automatically; re-import or edit in Multica.
-## Importing a skill
+With the CLI, you can also import from a `.skill` or `.zip` file:
-Workspace skills come from four sources:
+```bash
+multica skill import --file ./review-helper.skill
+```
-- **New** — write the `SKILL.md` and related files directly in the UI
-- **From GitHub** — paste a repo URL (e.g. `https://github.com/owner/repo/tree/main/skills/my-skill`) and Multica pulls the `SKILL.md` and every file in that directory
-- **From ClawHub** — search and import from the [ClawHub](https://clawhub.io) public marketplace, with version selection
-- **From local** — the daemon scans skill directories on your machine, and you pick which to bring into the workspace
+If a skill with the same name already exists in the workspace, the import can stop, overwrite the existing content, save under a new name, or skip. Overwriting through import is limited to the skill's creator; a workspace `admin` who can edit the skill in the app still cannot overwrite it via import.
-Both individual files and whole skill packs have size caps (single-file cap around 1 MB when importing from GitHub). The exact rules appear in the import dialog — exceeding them returns an error.
+## Skill contents
-## Attaching to an agent
+Every skill contains a main file, `SKILL.md`. Spell out:
-Once imported, a skill has to be **attached to a specific agent** to take effect. One agent can have multiple skills attached, and one skill can be attached to multiple agents.
+- when the skill applies;
+- what to check before starting;
+- the steps to execute;
+- what form the result should take;
+- when to stop and check with a member.
-After attaching, the agent picks up its skills the next time it starts a task — each AI coding tool has its own skill discovery path (Claude Code uses `.claude/skills/`, Cursor uses `.cursor/skills/`, Antigravity uses `.agents/skills/`, etc.), and Multica drops files in the right place automatically. **However, three tools (Gemini, Hermes, OpenClaw) currently use the generic fallback path `.agent_context/skills/` — whether these tools actually read skills from that path depends on the tool itself.** Full path mapping and the native-discovery vs. fallback distinction is in [AI coding tools comparison → Where skill files go](/providers#where-skill-files-go).
+You can also add supporting files, for example:
-After you edit a skill's contents, **only newly created tasks pick up the new version** — tasks already running continue with the old skill.
+```text
+SKILL.md
+references/api-conventions.md
+templates/review-report.md
+scripts/check.sh
+```
-## Safety of third-party skills
+`SKILL.md` is a reserved path; a supporting file cannot use that name. Supporting files are delivered to the agent together with the main file.
-Skills imported from GitHub or ClawHub may include scripts and executable content. Multica itself **does not sign, audit, or sandbox them** — skill contents are handed to the corresponding AI coding tool as-is, and whether the tool treats them as executable is up to the tool.
+## Attaching to an agent
-<Callout type="warning">
-**Before importing a third-party skill, review the `SKILL.md` and every file that ships with it.**
+After creating or importing a skill, it still needs to be added to specific agents. Pick agents on the skill page, or manage bindings from the agent's **Skills** tab.
-In February 2026 the "ClawHavoc" incident — malicious instructions planted in a popular skill pack stole API keys from affected users. ClawHub has since added VirusTotal scanning, but **automated scans are not a substitute for your own review**.
+- One agent can use multiple skills;
+- one skill can serve multiple agents;
+- when a skill isn't needed for now, disable the binding instead of deleting the skill;
+- edits take effect from subsequent runs and don't change tasks already running.
-**Only import from sources you trust.** For projects involving sensitive data, consider using only local skills you wrote yourself.
-</Callout>
+Only members who can modify the agent can add, remove, or disable its skills.
-## Skills vs. MCP
+## Workspace skills and repository skills
-Both augment what an agent can do, but in different directions:
+Workspace skills are stored in Multica — a fit for skills the team maintains together and adds to different agents.
-- **Skill** = a structured **knowledge pack** (static content + instructions). The agent reads a skill to learn "when I see problem X, here's how to think and what to do."
-- **MCP** (Model Context Protocol) = a **tool channel**. The agent uses MCP to connect to external services (databases, filesystems, third-party APIs) and **invoke** them.
+Some AI coding tools also read project-level skills directly from the code repository, such as `.claude/skills/` or `.agents/skills/`. Those files stay managed by the repository; Multica does not automatically register them as workspace skills. Support depends on the tool in use — see [AI coding tools comparison](/providers).
-The two are complementary. In Multica today, MCP support is **provider-specific**: Claude Code, Codex, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, and OpenClaw consume `mcp_config`; other tools receive the field but don't actually use it. A dedicated MCP section will come in a later release.
+Runtime-local skills already installed on a connected computer (Claude Code and Codex) show up in the agent's **Skills** tab and can be disabled per agent. Disabling likewise requires permission to modify the agent.
----
+## Edit permissions
-By now you know what an agent is, how to create one, and how to attach skills. The next question: **where does it actually run, and why does my agent sometimes get stuck?** The next chapter covers the execution architecture — daemons, runtimes, and how tasks work together.
+Any workspace member can create or import a skill. The creator and workspace `owner`s and `admin`s can modify or delete it; other members can view and use it, but cannot overwrite its content.
+
+Deletion is permanent and removes the skill from all agents at the same time.
+
+<Callout type="warning">
+Skills imported from external sources may contain scripts, commands, or unsafe instructions. Multica does not review, sign, or sandbox them for you. Imported content is handed to agents as-is, so the source needs to be trusted.
+</Callout>
## Next steps
-- [Daemon and runtimes](/daemon-runtimes) — where agents actually run, and how to tell online from offline
-- [Executing tasks](/tasks) — the full lifecycle of one "agent work session"
-- [AI coding tools comparison](/providers) — full comparison of all 16 tools (including each one's skill injection path)
+- [Squads](/squads) — let a leader pick the right member for the work.
+- [Daemon and runtimes](/daemon-runtimes) — how skills reach the actual execution environment.
+- [AI coding tools comparison](/providers) — how different tools support skills.
diff --git a/apps/docs/content/docs/skills.zh.mdx b/apps/docs/content/docs/skills.zh.mdx
index 3ba569b5e9..86554b0b91 100644
--- a/apps/docs/content/docs/skills.zh.mdx
+++ b/apps/docs/content/docs/skills.zh.mdx
@@ -1,73 +1,94 @@
---
title: Skills
-description: 给智能体挂上"专业知识包"——兼容 Anthropic Agent Skills 开放标准。
+description: 把常用的指令、步骤和资料整理成可供多个智能体复用的 skill。
---
import { Callout } from "fumadocs-ui/components/callout";
-Skill 是给 [智能体](/agents) 的**专业知识包**——一个 `SKILL.md` 加上可选的支持文件(脚本、配置、参考模板等),告诉智能体"遇到某类任务时该怎么想、怎么做"。Multica 采用 [Anthropic Agent Skills](https://agentskills.io) 开放标准,所有符合规范的 Skill(Anthropic 官方仓库、ClawHub、skills.sh 上的包)都能直接导入。
+Skill 是工作区中可以复用的一组工作方法。它以 `SKILL.md` 为主文件,也可以附带脚本、模板和参考资料。
-## 工作区 Skill 和本机 Skill
+把 skill 添加到[智能体](/agents)后,智能体会在执行相关任务时使用其中的说明。相同的方法不必分别复制到每个智能体的指令中,修改时也只需要维护一份。
-Multica 支持两种 Skill 来源:
+## Skill 与智能体指令
-- **工作区 Skill(workspace skill)** —— 存在 Multica 云端。挂到智能体后,任务执行时自动同步到你本机的守护进程。这是**团队共享 Skill 的标准方式**。
-- **本机 Skill(local skill)** —— 直接存在你本机的某个目录里。[守护进程](/daemon-runtimes) 按你的请求扫描本机,发现后由你手动选入工作区。守护进程会**按优先级扫描两个根目录**:先扫该运行时自己的 skill 目录(每款 AI 编程工具有约定的默认路径,比如 Claude Code 的 `~/.claude/skills/`),再扫跨工具通用目录 `~/.agents/skills/`——这是 Codex、Gemini CLI 等生态共用的位置。当同名 skill 在两处都存在时,**provider 专用目录优先**,所以通用根目录只会*额外*带出新的 skill,绝不会改变已有 skill 的解析结果。
+| | 智能体指令 | Skill |
+|---|---|---|
+| **适合保存** | 这名智能体长期不变的职责、边界和交付要求 | 某类工作可复用的步骤、资料和工具 |
+| **使用范围** | 只属于一名智能体,每次执行都会提供 | 可以添加给多名智能体,并单独启用或停用 |
+| **例子** | "只审查前端代码,不直接修改" | 一套无障碍检查清单和报告模板 |
-大多数情况用**工作区 Skill**:导入一次,团队所有成员的智能体都能用。本机 Skill 适合先在本地测试、或涉及敏感本地内容的场景。
+## 创建或导入 skill
-## 仓库级 Skill
+在工作区的 **Skills** 页面选择"新建 skill",可以使用三种方式:
-仓库级 Skill 是预期行为。有些 AI 编程工具会发现**提交在仓库里的项目级 Skill**,例如 `.claude/skills/`、`.cursor/skills/`、`.opencode/skills/` 或 `.agents/skills/`。当 Multica 任务检出这个仓库时,这些文件会留在工作目录里,底层工具可以按自己的原生发现规则加载它们。你不需要为了在这个仓库里使用这些 repo skills 而先把它们导入 Multica;Multica 也不会自动把它们导入工作区 Skill 注册表。
+| 方式 | 适合什么情况 |
+|---|---|
+| **手动创建** | 从空白的 `SKILL.md` 开始编写。 |
+| **从 URL 导入** | 从 GitHub、ClawHub 或 Skills.sh 导入已经发布的 skill。 |
+| **从运行时复制** | 扫描连接电脑上的 skill,并把选中的内容复制到工作区。 |
-对支持项目级发现的工具,工作区 Skill 也会同步到同一个 provider 原生位置。如果某个工作区 Skill 会和已有的仓库 Skill 目录冲突,Multica 会把工作区副本写到类似 `review-helper-multica` 的 sibling 名称下,而不是覆盖仓库文件。工具随后可能会同时看到两个 Skill,其中工作区副本使用调整后的名称。
+从运行时复制的是当时的文件快照。之后本地文件发生变化,不会自动更新工作区中的版本;需要重新导入或在 Multica 中编辑。
-## 导入 Skill
+使用 CLI 时,也可以从 `.skill` 或 `.zip` 文件导入:
-工作区 Skill 有四种来源:
+```bash
+multica skill import --file ./review-helper.skill
+```
-- **新建** —— 在 UI 里直接写 `SKILL.md` 和相关文件
-- **从 GitHub** —— 贴一个仓库 URL(例如 `https://github.com/owner/repo/tree/main/skills/my-skill`),Multica 自动拉取目录下的 `SKILL.md` 和所有文件
-- **从 ClawHub** —— 从 [ClawHub](https://clawhub.io) 公开市场搜索并导入,支持选版本
-- **从本机** —— 守护进程扫描你本机的 skill 目录,你选要用的导入到工作区
+导入时如果工作区已经存在同名 skill,可以停止导入、覆盖原内容、使用新名称保存,或跳过。通过导入覆盖仅限该 skill 的创建者本人;工作区 `admin` 即使可以在应用内编辑它,也不能用导入的方式覆盖。
-单个文件和整个 Skill 包都有容量上限(从 GitHub 导入时单文件上限约 1 MB)。精确规则会在导入界面里提示——超过时会报错。
+## Skill 的内容
-## 挂到智能体
+每个 skill 都包含一个主文件 `SKILL.md`。在这里写清:
-Skill 导入后需要**挂载到具体的智能体**才会生效。一个智能体能挂多个 Skill,一个 Skill 也能挂到多个智能体。
+- 这个 skill 的适用场景;
+- 开始前需要检查什么;
+- 执行步骤;
+- 结果应以什么形式提交;
+- 哪些情况需要停止并向成员确认。
-挂上之后,智能体下次开工时会自动拿到挂着的 Skill——不同 AI 编程工具有各自的 Skill 发现路径(Claude Code 是 `.claude/skills/`、Cursor 是 `.cursor/skills/`、Antigravity 是 `.agents/skills/` 等),Multica 会自动放到对的位置。**但有 3 款工具(Gemini / Hermes / OpenClaw)当前走的是通用 fallback 路径 `.agent_context/skills/`——这些工具能否真的从这里读到 skill,取决于工具本身是否支持**。完整路径对照和原生发现 vs fallback 的区分见 [AI 编程工具对照 → skill 文件该放哪儿](/providers#skill-文件该放哪儿)。
+还可以添加支持文件,例如:
-修改 Skill 的内容后,**只有之后新创建的任务会拿到新版本**——正在跑的任务继续用旧版 Skill。
+```text
+SKILL.md
+references/api-conventions.md
+templates/review-report.md
+scripts/check.sh
+```
-## 第三方 Skill 的安全
+`SKILL.md` 是保留路径,不能再创建同名支持文件。支持文件会和主文件一起提供给智能体。
-从 GitHub 或 ClawHub 导入的 Skill 可能包含脚本和可执行内容。Multica 本身**不做签名验证、不做代码审查、不做沙盒隔离**——Skill 里的内容原封不动交给对应的 AI 编程工具,工具怎么用这些文件(是否当脚本执行)由工具本身决定。
+## 添加到智能体
-<Callout type="warning">
-**导入第三方 Skill 前,审查 `SKILL.md` 和它附带的所有文件。**
+创建或导入 skill 后,还需要把它添加到具体的智能体。你可以在 skill 页面选择智能体,也可以打开智能体的 **Skills** 标签页进行管理。
-2026 年 2 月发生过 "ClawHavoc" 事件——有人在热门 Skill 包里植入恶意指令,受害用户的 API key 被窃取。ClawHub 之后加了 VirusTotal 扫描,但**自动扫描不能替代你自己的审查**。
+- 一名智能体可以使用多个 skill;
+- 同一个 skill 可以供多名智能体使用;
+- 暂时不需要时,可以停用绑定,而不必删除 skill;
+- 修改后的内容从后续执行开始生效,不会改变已经运行中的任务。
-**只从你信任的来源导入**。涉及敏感数据的项目,考虑只用你自己写的本机 Skill。
-</Callout>
+只有有权修改该智能体的成员,才能为它添加、移除或停用 skill。
-## Skill 和 MCP 的区别
+## 工作区 skill 和仓库中的 skill
-两者都是给智能体"增强能力"的机制,方向不同:
+工作区 skill 保存在 Multica 中,适合由团队共同维护,并添加给不同智能体。
-- **Skill** = 结构化的**知识包**(静态内容 + 指令)。智能体读 Skill 来学"遇到 X 类问题该怎么想、怎么做"。
-- **MCP**(Model Context Protocol)= **工具通道**。智能体通过 MCP 连外部服务(数据库、文件系统、第三方 API)并**调用**它们。
+部分 AI 编程工具也会直接读取代码仓库中的项目级 skill,例如 `.claude/skills/` 或 `.agents/skills/`。这些文件仍由仓库管理,Multica 不会自动把它们登记为工作区 skill。具体支持方式取决于使用的工具,见 [AI 编程工具对照](/providers)。
-两者可以同时用。目前 Multica 的 MCP 支持是**按工具实现**的:Claude Code、Codex、Cursor、Hermes、Kimi、Kiro CLI、OpenCode、OpenClaw 会消费 `mcp_config`;其他工具会接收到这个字段但不会实际用。MCP 的专题会在后续版本展开。
+连接电脑上已安装的运行时本地 skill(Claude Code 和 Codex)会显示在智能体的 **Skills** 标签页中,可以按智能体单独停用。停用同样需要有权修改该智能体。
----
+## 修改权限
+
+任何工作区成员都可以创建或导入 skill。创建者和工作区 `owner`、`admin` 可以修改或删除它;其他成员可以查看和使用,但不能覆盖内容。
-到这里你已经知道智能体是什么、怎么创建、怎么挂 Skill。下一个问题:**它具体在哪跑?为什么我的智能体有时候会卡住不动?** 下一章讲执行架构——守护进程、运行时、任务怎么协作。
+删除是永久操作,同时会从所有智能体上移除该 skill。
+
+<Callout type="warning">
+从外部导入的 skill 可能包含脚本、命令或不安全的指令。Multica 不会替你审查、签名或隔离这些内容。导入的内容会原样提供给智能体执行,来源需要可信。
+</Callout>
-## 下一步
+## 接下来
-- [守护进程与运行时](/daemon-runtimes) —— 智能体到底跑在哪、怎么判断在线 / 离线
-- [执行任务](/tasks) —— 一次"智能体工作"的完整生命周期
-- [AI 编程工具对照](/providers) —— 16 款工具的完整对比(含每款的 Skill 注入路径)
+- [小队](/squads) — 让 leader 根据工作内容选择合适的成员。
+- [守护进程与运行时](/daemon-runtimes) — 了解 skill 如何进入实际执行环境。
+- [AI 编程工具对照](/providers) — 查看不同工具对 skill 的支持方式。
diff --git a/apps/docs/content/docs/slack-bot-integration.ja.mdx b/apps/docs/content/docs/slack-bot-integration.ja.mdx
index 4ce2ec5fd7..b98ec890a0 100644
--- a/apps/docs/content/docs/slack-bot-integration.ja.mdx
+++ b/apps/docs/content/docs/slack-bot-integration.ja.mdx
@@ -1,27 +1,24 @@
---
-title: Slack Bot 連携
-description: Multica エージェントをあなた自身の Slack アプリに接続します——マニフェストからアプリを作成し、インストールして、bot トークンと app-level トークンを貼り付ければ、Slack の中から @ メンションしたり、DM したり、/issue と入力したりできます。
+title: Slack Bot
+description: エージェント用の Slack Bot を作成し、DM、チャンネル、/issue コマンドから利用します。
---
import { Callout } from "fumadocs-ui/components/callout";
-任意の[エージェント](/agents)を Slack Bot に接続すれば、チームは Slack の中から直接それを使えます——Bot に DM したり、チャンネルで @ メンションしたり、`/issue` と入力してアプリを開かずに [Multica イシュー](/issues)を起票したりできます。
+Multica では、自分で作成した Slack app を使います。接続すると、チームメンバーは Bot へ DM を送る、チャンネルで @メンションする、`/issue` でイシューを作成するといった操作ができます。
-Slack は**自分のアプリを持ち込む(BYO: bring-your-own-app)**モデルを採用しています。ワークスペースの admin が Slack アプリを作成し、自分の Slack ワークスペースにインストールして、そのトークンを Multica に貼り付けます。エージェントごとに**専用の** Slack アプリを持つため、同じ Slack ワークスペース内で複数のエージェントがそれぞれ別個に @ メンションできる異なる Bot を持てます。(これは紐づけがスキャンしてインストールするフローである [Lark](/lark-bot-integration) とは異なります。)
+1 つの Slack app に接続できる Multica エージェントは 1 つです。複数のエージェントを接続する場合は、エージェントごとに app を作成してください。
-セットアップ全体は以下のとおりで、所要時間は約 5 分です。最終的に、Multica に貼り付ける 2 つのトークンが得られます。
+## 始める前に
-- **Bot トークン** —— `xoxb-` で始まります
-- **App-level トークン** —— `xapp-` で始まります
+接続はワークスペースの owner または admin が行います。最終的に次の 2 つの認証情報を Multica へ入力します。
-## Slack アプリをセットアップする
+- `xoxb-` で始まる Bot User OAuth Token
+- `xapp-` で始まる App-level Token
-### 1. マニフェストからアプリを作成する
+## 1. manifest から Slack app を作成する
-1. [https://api.slack.com/apps](https://api.slack.com/apps) を開き、**Create New App** をクリックします。
-2. **From a manifest** を選びます。
-3. アプリをインストールする Slack ワークスペースを選びます。
-4. **YAML** タブに切り替え、下記のマニフェストを貼り付けて、内容を確認しアプリを作成します。
+[Slack API Apps](https://api.slack.com/apps) を開き、**Create New App → From a manifest** をクリックして Slack workspace を選びます。次の内容を **YAML** に貼り付けてください。
```yaml
display_information:
@@ -37,7 +34,7 @@ features:
slash_commands:
- command: /issue
description: Create a Multica issue
- usage_hint: "[title]"
+ usage_hint: "[description]"
oauth_config:
scopes:
bot:
@@ -65,122 +62,103 @@ settings:
token_rotation_enabled: false
```
-このマニフェストは Multica が必要とするものをすべて設定するので、手作業で何かを設定する必要はありません。
-
-| セクション | なぜそこにあるか |
-|---|---|
-| `app_home.messages_tab_enabled: true` | メンバーが Bot を開いて **DM** できるようにします。これがないと、Bot に直接メッセージを送れません。 |
-| `bot_user` | @ メンションされ、返信を投稿する Bot のアイデンティティを作成します。 |
-| `chat:write` | エージェントの返信を Slack に投稿し返します。 |
-| `reactions:write` | エージェントの処理中、あなたのメッセージに 👀 リアクションを付け、返信時に外します。このスコープがないとインジケーターは黙ってスキップされます——他の機能はすべて動作します。 |
-| `app_mentions:read` + `app_mention` イベント | チャンネルでの @ メンションを受け取ります。 |
-| `im:history` + `message.im` | Bot への **DM** を受け取ります(すべての DM メッセージが読み取られます)。 |
-| `channels:history` / `groups:history` / `mpim:history` + 対応する `message.*` イベント | パブリックチャンネル、プライベートチャンネル、グループ DM のメッセージを受け取ります。これらの中では、Bot は自分を **@ メンション**したメッセージにのみ反応します。 |
-| `users:read` | Multica が(`bots.info` を介して)あなたの 2 つのトークンが同じアプリのものであることを検証するために必要です。 |
-| `commands` | `/issue` スラッシュコマンドを有効にする bot スコープです(`features.slash_commands` と対になります)。これがないと、マニフェストを更新して再インストールしてもコマンドが付与されません。 |
-| `socket_mode_enabled: true` | Bot は Socket Mode 経由で外向きに接続します——**公開 URL/リクエスト URL は不要**です。 |
-| `interactivity.is_enabled: false` | Multica のプロンプトはボタンではなくプレーンなリンクなので、インタラクティビティは不要です。 |
-| `slash_commands`(`/issue`) | `/issue` スラッシュコマンドを登録し、誰でもメッセージ入力欄から Multica イシューを起票できるようにします。Socket Mode 経由で配信され、リクエスト URL は不要です。 |
-
-**OAuth リダイレクト URL はありません**。BYO は OAuth を使わないからです。
-
-<Callout type="info">
-Slack で特定の名前を表示したいですか? 作成前に `display_information.name` と `features.bot_user.display_name`(たとえばエージェントの名前に)を変更するか、あとで **App Home** で編集してください。Slack は Bot をその **bot display name** で表示しますが、これはアプリ名と異なる場合があります。
-</Callout>
+作成前に、2 か所の `Multica` をエージェント名に変更してもかまいません。manifest の権限やイベントは削除しないでください。削除すると、DM、チャンネルでのメンション、返信、`/issue` が動作しないことがあります。
+
+Bot は Socket Mode で Slack へ接続するため、公開 Request URL や OAuth Redirect URL の設定は不要です。
-### 2. アプリをインストールして Bot トークンをコピーする
+## 2. 2 つの token を取得する
-1. アプリの左ナビで **Install App**(または **OAuth & Permissions**)を開きます。
-2. **Install to Workspace** をクリックして承認します。
-3. **Bot User OAuth Token** をコピーします——`xoxb-` で始まります。これがあなたの **Bot トークン**です。
+### Bot token
-### 3. App-level トークンを作成する
+1. Slack app で **Install App** を開きます。
+2. **Install to Workspace** をクリックし、権限を承認します。
+3. `xoxb-` で始まる **Bot User OAuth Token** をコピーします。
-app-level トークンは Socket Mode 接続を認可します。これはコンソールでしか作成できません(OAuth の一部ではありません)。
+### App-level token
-1. **Basic Information → App-Level Tokens** を開き、**Generate Token and Scopes** をクリックします。
-2. 任意の名前を付けます。
-3. **Add Scope** をクリックし、リストから **`connections:write`** を選びます(これはピッカーなので、入力せずに選択してください)。
-4. **Generate** をクリックし、トークンをコピーします——`xapp-` で始まります。これがあなたの **App-level トークン**です。
+1. **Basic Information → App-Level Tokens** を開きます。
+2. **Generate Token and Scopes** をクリックします。
+3. `connections:write` scope を追加します。
+4. token を生成し、`xapp-` で始まる値をコピーします。
-### 4. Multica で接続する
+## 3. エージェントへ接続する
-1. **Agents → _あなたのエージェント_** からそのエージェントを開き、**Integrations** タブ(または左サイドバーの **Integrations** 区画)を開きます。
-2. **Connect Slack** をクリックします。
-3. **Bot トークン**(`xoxb-`)と **App-level トークン**(`xapp-`)を貼り付け、**Connect** をクリックします。
-4. エージェントに **Connected to Slack** と表示されます。Bot はこれで、自身の Socket Mode 接続を通じて待ち受けています。
+1. Multica で**エージェント**を開き、Slack に接続するエージェントを選びます。
+2. **連携**を開き、**Slack に接続**をクリックします。
+3. Bot token と App-level token を入力します。
+4. **接続**をクリックします。
+
+Multica は 2 つの token が同じ app のものか確認します。接続に成功すると、画面に **Slack に接続済み**と表示されます。
<Callout type="warning">
-2 つのトークンは**同じ** Slack アプリのものでなければならず、そのアプリはちょうど **1 つ**のエージェントに対応します。すでに別のエージェントやワークスペースに接続されているアプリを接続しようとすると拒否されます。アプリを別のエージェントへ移すには、まず切断してください。**新しい**アプリでエージェントを再接続すると、そのエージェントの Bot がその場で更新されます。
+2 つの token は暗号化して Multica サーバーに保存されます。Token は認証情報です。イシュー、コメント、コードリポジトリには書き込まないでください。ほかのエージェントやワークスペースに接続済みの app をそのまま再利用することはできません。先に元の接続を解除してください。
</Callout>
-<Callout type="info">
-**複数のエージェント**でこれを設定しますか? フロー全体をエージェントごとに 1 回ずつ繰り返してください——各エージェントが専用の Slack アプリと専用のトークンのペアを持ち、Slack ワークスペース内で別々の Bot として表示されます。
-</Callout>
+## 初回利用
-## この連携でできること
+メンバーが初めて Bot に DM を送るか @メンションすると、アカウント連携用のリンクが届きます。そのワークスペースで使う Multica アカウントにログインしてから、Slack に戻ってもう一度メッセージを送ってください。
-| 場所 | 動作 |
-|---|---|
-| **エージェント → Integrations** | owner と admin には **Connect Slack** が表示され、接続すると **Connected to Slack** バッジと **Disconnect** コントロールに切り替わります。 |
-| **Bot に DM** | ワークスペースメンバーが Bot に直接メッセージを送ります。会話はそのエージェントとの Multica [chat](/chat) セッションになり、すべての DM メッセージが読み取られます。 |
-| **チャンネルで @ メンション** | Bot を招待し(`/invite @your-bot`)、@ メンションします。読み取られるのはメンションしたメッセージだけで、Bot はチャンネル全体を聞いているわけではありません。各 @bot **スレッド**がそれぞれ独立したセッションになります。 |
-| **`/issue` スラッシュコマンド** | `/issue <説明>`(チャンネルでも DM でも)と入力すると、エージェントがあなたの自然言語の説明を整った Multica イシューに仕立て、あなたの名義で起票します。まず本人にだけ受付の返信をし、イシューが用意できたら Multica の通知が届きます——@ メンションは不要です。 |
-| **返信** | エージェントの回答は、同じ DM またはスレッドに投稿し返されます。 |
+リンクは 1 回だけ使用でき、15 分後に期限切れになります。期限が切れた場合は、Bot にもう一度メッセージを送ると新しいリンクが届きます。同じ Multica ワークスペースにある複数の Bot が同じ Slack workspace のものなら、通常は既存のアカウント連携を再利用できます。
-## Bot を使う(メンバー)
+Bot を利用できるのは、現在の Multica ワークスペースのメンバーだけです。
-### 最初のメッセージ:アカウントを紐づける
+## Slack から仕事を依頼する
-初めて Bot を @ メンションするか DM すると、Bot は **アカウントを紐づける** プロンプトで返信します。リンクをタップして Multica にサインインすると、あなたの Slack アイデンティティがあなたの Multica メンバーシップに紐づきます——これによって、エージェントがあなたとして振る舞えるようになります(たとえば `/issue` はあなたの名義でイシューを起票します)。このリンクは使い切りで、約 15 分で失効します。新しいものが必要なら、もう一度 Bot にメッセージを送るだけです。
+### DM
-**紐づけは Slack ワークスペースごとに一度だけです。** 同じ Multica ワークスペースが 1 つの Slack ワークスペースで複数の Bot を運用している場合(エージェントごとに 1 つのアプリ)、最初の Bot で紐づけを済ませれば、残りはその紐づけを自動的に再利用し、再びプロンプトは出ません。(再度の紐づけが必要なのは、*別の* Slack ワークスペースにある Bot、または *別の* Multica ワークスペースに接続された Bot だけです。)
+Slack サイドバーの **Apps** から Bot を開き、そのままメッセージを送ります。@メンションは不要です。
-<Callout type="warning">
-Bot を使えるのは **ワークスペースのメンバー** だけです。メンバーでない場合や、アイデンティティの紐づけをスキップした場合、Bot は実行されません——あなたのメッセージは破棄されます(内容は保存せず、監査のために記録されます)。
-</Callout>
+### チャンネルとグループ
-### 対話と `/issue`
+まず `/invite @your-bot` を実行して Bot をチャンネルに追加し、`@your-bot 依頼内容` を送ります。スレッドごとに独立したセッションが作られます。追加の依頼も、同じスレッドで Bot を @メンションしてください。
-- **チャンネルで** —— Bot は自動では参加しません。一度 `/invite @your-bot` を実行してから、`@your-bot <あなたのメッセージ>` とします。フォローアップのたびに再度メンションしてください(Bot は自分をメンションしたメッセージだけを読みます)。
-- **DM で** —— Slack サイドバーの **Apps** 区画から Bot を開いて直接メッセージを送ります。メンションは不要です。
-- **イシューを起票する** —— `/issue` スラッシュコマンドを使います(例: `/issue ログインのリダイレクトが Safari で壊れている`)。自然言語で説明すれば、エージェントがタイトルと構造化された説明を書いて起票してくれます。チャンネルでも DM でも使え(@ メンション不要)、まず本人にだけ受付の返信をし、イシューが作成されたら Multica の通知が届きます。初回のユーザーには、まずアカウント連携の使い切りリンクが届きます。
+Bot が応答するのは、明示的に @メンションされたチャンネルメッセージだけです。実行時には、権限の範囲内でそのスレッドの直近のコンテキストを読み取ります。
-## 管理と切断
+### `/issue` でイシューを作成する
-ワークスペース全体の管理は **Settings → Integrations** にあります。
+チャンネルまたは DM で、次のように入力します。
-- **Connected bots** は、ワークスペース内のすべての Bot と、それぞれが紐づくエージェントを一覧表示します(すべてのメンバーから見えます)。
-- **Disconnect** は **owner / admin 専用** です。切断すると Bot は Slack メッセージの受信を停止し、その接続が破棄されます。インストール記録は監査のために保持され、あとで再接続できます。
+```text
+/issue Safari ではログインに成功してもログイン画面に残る
+```
-## 権限
+このコマンドでは Bot の @メンションは不要です。Multica は説明を現在の Bot に対応するエージェントへ渡し、エージェントがタイトルと本文を整理してイシューを作成します。Slack には最初に自分だけが見える受付メッセージが表示されます。作成が完了すると、Multica のインボックスに通知が届きます。
-- **接続 / 切断** にはワークスペースの **owner** または **admin** が必要です。
-- **Bot との対話** には、Slack アイデンティティを紐づけたワークスペースメンバーであることが必要です。それ以外の人は一律に破棄されます。
-- 破棄されたメッセージの本文が保存されることはありません——監査のために破棄理由だけが記録されます。
+## 接続を管理する
-## セルフホストのセットアップ
+**設定 → 連携**を開くと、接続済みの Slack Bot をすべて確認できます。ワークスペースの owner と admin は接続を解除できます。
-Multica Cloud では連携はすでに利用可能です——このセクションは飛ばしてください。
+接続を解除すると Socket Mode の接続が停止し、Bot は新しいメッセージを受信しなくなります。既存の会話と監査記録は削除されません。
-セルフホストの場合、Slack は**保存時の暗号化キーを設定するまでオフ**です。このキーは、各アプリの bot トークン + app-level トークンがデータベースに触れる前にそれを暗号化します。BYO には OAuth の client id/secret は**不要**で、デプロイレベルの app トークンも**不要**です——各インストールは admin が貼り付けたトークンを使います。
+## セルフホスト設定
-1. 32 バイトのキーを生成し、API サーバーに設定します。
+Multica Cloud では追加設定は不要です。セルフホスト環境では、Slack token を暗号化するキーを先に設定してください。
- ```dotenv
- MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+```dotenv
+MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
+```
- たとえば: `openssl rand -base64 32`。
+次のコマンドで生成できます。
-2. API を再起動します。キーを設定するまで、**Settings → Integrations** には「Slack integration not enabled」という通知が表示され、**Connect Slack** のエントリポイントは非表示のままになります。
+```bash
+openssl rand -base64 32
+```
-<Callout type="info">
-キーはちょうど 32 バイトにデコードされなければなりません——`openssl rand -base64 32` はそれを満たします。これは長く使い続けるシークレットとして扱ってください。ローテーションしたり紛失したりすると、すでに保存済みのトークンが復号できなくなり、すべての Bot を再接続せざるを得なくなります。「アカウントを紐づける」リンクは、Web アプリの URL(`MULTICA_APP_URL`、未設定時は `FRONTEND_ORIGIN` にフォールバック)から生成されます。通常のデプロイではこれは既に設定されているため、追加で設定するものはありません。
-</Callout>
+API サービスを再起動してから Slack app を接続します。このキーは継続して保管してください。変更または紛失すると既存の token を復号できなくなり、app の再接続が必要になります。
+
+アカウント連携用リンクには `MULTICA_APP_URL` が使われ、未設定の場合は `FRONTEND_ORIGIN` にフォールバックします。メンバーがアクセスできる Multica のアドレスを指定してください。
+
+## よくある問題
+
+- **接続時に token が無効と表示される**: 接頭辞を確認し、2 つの token が同じ app のものか確認します。
+- **app を検証できない**: manifest に `users:read` が含まれていることを確認します。権限を更新した後は app を再インストールしてください。
+- **DM の入口がない**: `app_home.messages_tab_enabled` が `true` であることを確認します。
+- **チャンネルで返信がない**: Bot がチャンネルに招待されており、メッセージで @メンションされていることを確認します。
+- **`/issue` がない**: manifest に slash command と `commands` scope が含まれていることを確認し、app を再インストールします。
+- **Bot が実行しない**: エージェントがアーカイブされていないことと、使用する[ランタイム](/daemon-runtimes)がオンラインであることを確認します。
-## 次に
+## 次のステップ
-- [Chat 連携](/channels) — チャンネルエンジン、セッション、認可の仕組み
-- [エージェント](/agents) · [Chat](/chat) · [イシュー](/issues)
-- [環境変数](/environment-variables) — セルフホスト構成の完全なリファレンス
+- [チャット連携](/channels) — プラットフォームの比較、セッションの分離、アカウント連携
+- [エージェントとチャットする](/chat) — Bot の会話と実行の仕組み
+- [イシュー](/issues) — `/issue` で作成される作業単位
diff --git a/apps/docs/content/docs/slack-bot-integration.ko.mdx b/apps/docs/content/docs/slack-bot-integration.ko.mdx
index 7b73ed0f89..3195ca002d 100644
--- a/apps/docs/content/docs/slack-bot-integration.ko.mdx
+++ b/apps/docs/content/docs/slack-bot-integration.ko.mdx
@@ -1,27 +1,24 @@
---
-title: Slack Bot 연동
-description: Multica 에이전트를 자체 Slack 앱에 연결하세요 — 매니페스트로 앱을 만들고, 설치한 다음, bot + app-level 토큰을 붙여넣고, Slack 안에서 @로 멘션하거나 DM하거나 /issue를 입력하세요.
+title: Slack Bot
+description: 에이전트용 Slack Bot을 만들어 DM, 채널, /issue 명령에서 사용합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-아무 [에이전트](/agents)나 Slack 봇에 연결하면, 팀이 Slack 안에서 바로 그 에이전트와 함께 일할 수 있습니다 — 봇에게 DM을 보내거나, 채널에서 `@`로 멘션하거나, `/issue`를 입력해 앱을 열지 않고도 [Multica 이슈](/issues)를 생성하세요.
+Multica는 사용자가 직접 만든 Slack app을 사용합니다. 연결하면 팀 멤버가 Bot과 DM을 나누고 채널에서 @멘션하거나 `/issue`로 이슈를 만들 수 있습니다.
-Slack은 **자체 앱 사용(BYO)** 모델을 따릅니다: 워크스페이스 admin이 Slack 앱을 만들고, 자신의 Slack 워크스페이스에 설치한 다음, 토큰을 Multica에 붙여넣습니다. 각 에이전트가 **자체** Slack 앱을 갖습니다 — 그래서 하나의 Slack 워크스페이스 안에서 여러 에이전트가 각각 별개로 `@`로 멘션할 수 있는 봇을 가질 수 있습니다. (바인딩이 스캔하여 설치하는 방식인 [Lark](/lark-bot-integration)와는 다릅니다.)
+Slack app 하나는 Multica 에이전트 하나에 대응합니다. 여러 에이전트를 연결하려면 에이전트마다 별도의 app을 만드세요.
-전체 설정은 아래에 있으며 약 5분이 걸립니다. 마지막에는 Multica에 붙여넣을 두 개의 토큰을 얻게 됩니다:
+## 시작하기 전에
-- **Bot token** — `xoxb-`로 시작
-- **App-level token** — `xapp-`로 시작
+연결은 워크스페이스 owner 또는 admin이 완료해야 하며 마지막에 두 자격 증명을 Multica에 입력합니다.
-## Slack 앱 설정하기
+- `xoxb-`로 시작하는 Bot User OAuth Token
+- `xapp-`로 시작하는 App-level Token
-### 1. 매니페스트로 앱 만들기
+## 1. manifest에서 Slack app 만들기
-1. [https://api.slack.com/apps](https://api.slack.com/apps)로 이동해 **Create New App**을 클릭합니다.
-2. **From a manifest**를 선택합니다.
-3. 앱을 설치할 Slack 워크스페이스를 고릅니다.
-4. **YAML** 탭으로 전환해 아래 매니페스트를 붙여넣고, 검토한 뒤 앱을 생성합니다.
+[Slack API Apps](https://api.slack.com/apps)를 열고 **Create New App → From a manifest**를 클릭한 뒤 Slack workspace를 선택하고 **YAML**에 다음 내용을 붙여 넣습니다.
```yaml
display_information:
@@ -37,7 +34,7 @@ features:
slash_commands:
- command: /issue
description: Create a Multica issue
- usage_hint: "[title]"
+ usage_hint: "[description]"
oauth_config:
scopes:
bot:
@@ -65,122 +62,103 @@ settings:
token_rotation_enabled: false
```
-이 매니페스트는 Multica에 필요한 모든 것을 구성하므로, 직접 손으로 설정할 것이 없습니다:
-
-| 섹션 | 이유 |
-|---|---|
-| `app_home.messages_tab_enabled: true` | 멤버가 봇을 열어 **DM**할 수 있게 합니다. 이것이 없으면 봇에게 직접 메시지를 보낼 수 없습니다. |
-| `bot_user` | `@`로 멘션되고 답변을 게시하는 봇 신원을 생성합니다. |
-| `chat:write` | 에이전트의 답변을 Slack으로 다시 게시합니다. |
-| `reactions:write` | 에이전트가 처리하는 동안 메시지에 👀 반응을 추가하고, 답변하면 제거합니다. 이 스코프가 없으면 표시가 조용히 건너뛰어집니다 — 나머지 기능은 모두 정상 동작합니다. |
-| `app_mentions:read` + `app_mention` 이벤트 | 채널에서 `@`-멘션을 받습니다. |
-| `im:history` + `message.im` | 봇에게 보내는 **DM**을 받습니다(모든 DM 메시지를 읽습니다). |
-| `channels:history` / `groups:history` / `mpim:history` + 대응하는 `message.*` 이벤트 | 공개 채널, 비공개 채널, 그룹 DM의 메시지를 받습니다. 이런 곳에서 봇은 자신을 **@로 멘션한** 메시지에만 반응합니다. |
-| `users:read` | Multica가 두 토큰이 같은 앱에 속하는지 (`bots.info`를 통해) 확인하는 데 필요합니다. |
-| `commands` | `/issue` 슬래시 명령을 활성화하는 bot 스코프입니다(`features.slash_commands`와 짝을 이룹니다). 이것이 없으면 매니페스트를 업데이트하고 재설치해도 명령이 부여되지 않습니다. |
-| `socket_mode_enabled: true` | 봇이 Socket Mode로 밖으로 연결합니다 — **공개 URL / request URL이 필요 없습니다**. |
-| `interactivity.is_enabled: false` | Multica의 안내는 버튼이 아니라 일반 링크라서, interactivity가 필요 없습니다. |
-| `slash_commands`(`/issue`) | `/issue` 슬래시 명령을 등록해, 누구나 메시지 입력창에서 Multica 이슈를 생성할 수 있게 합니다. Socket Mode로 전달되며 요청 URL이 필요 없습니다. |
-
-**OAuth redirect URL은 없습니다.** BYO는 OAuth를 사용하지 않기 때문입니다.
-
-<Callout type="info">
-Slack에서 특정 이름을 쓰고 싶나요? 생성하기 전에 `display_information.name`과 `features.bot_user.display_name`을 (예: 에이전트 이름으로) 변경하거나, 나중에 **App Home**에서 편집하세요. Slack은 봇을 **bot display name**으로 표시하며, 이는 앱 이름과 다를 수 있습니다.
-</Callout>
+만들기 전에 두 `Multica` 값을 에이전트 이름으로 바꿀 수 있습니다. manifest의 권한이나 이벤트를 삭제하지 마세요. 삭제하면 DM, 채널 멘션, 답글, `/issue`가 작동하지 않을 수 있습니다.
+
+Bot은 Socket Mode로 Slack에 능동적으로 연결하므로 공개 Request URL이나 OAuth Redirect URL을 설정할 필요가 없습니다.
-### 2. 앱 설치하고 Bot token 복사하기
+## 2. 두 token 받기
-1. 앱의 왼쪽 내비게이션에서 **Install App**(또는 **OAuth & Permissions**)을 엽니다.
-2. **Install to Workspace**를 클릭하고 승인합니다.
-3. **Bot User OAuth Token**을 복사합니다 — `xoxb-`로 시작합니다. 이것이 당신의 **Bot token**입니다.
+### Bot token
-### 3. App-level token 생성하기
+1. Slack app에서 **Install App**을 엽니다.
+2. **Install to Workspace**를 클릭하고 권한을 승인합니다.
+3. `xoxb-`로 시작하는 **Bot User OAuth Token**을 복사합니다.
-app-level token은 Socket Mode 연결을 인가합니다. 콘솔에서만 생성할 수 있습니다(OAuth의 일부가 아닙니다).
+### App-level token
-1. **Basic Information → App-Level Tokens**를 열고 **Generate Token and Scopes**를 클릭합니다.
-2. 아무 이름이나 지정합니다.
-3. **Add Scope**를 클릭하고 목록에서 **`connections:write`**를 고릅니다(선택기이므로 — 입력하지 말고 선택하세요).
-4. **Generate**를 클릭한 다음 토큰을 복사합니다 — `xapp-`로 시작합니다. 이것이 당신의 **App-level token**입니다.
+1. **Basic Information → App-Level Tokens**를 엽니다.
+2. **Generate Token and Scopes**를 클릭합니다.
+3. `connections:write` scope를 추가합니다.
+4. `xapp-`로 시작하는 token을 생성하고 복사합니다.
-### 4. Multica에서 연결하기
+## 3. 에이전트에 연결
-1. **Agents → _당신의 에이전트_** → **Integrations** 탭(또는 왼쪽 사이드바의 **Integrations** 섹션)에서 에이전트를 엽니다.
-2. **Connect Slack**을 클릭합니다.
-3. **Bot token**(`xoxb-`)과 **App-level token**(`xapp-`)을 붙여넣은 다음 **Connect**를 클릭합니다.
-4. 에이전트에 **Connected to Slack**이 표시됩니다. 봇은 이제 자체 Socket Mode 연결로 수신 대기합니다.
+1. Multica에서 **에이전트**를 열고 Slack에 연결할 에이전트를 선택합니다.
+2. **연동**으로 이동해 **Slack 연결**을 클릭합니다.
+3. Bot token과 App-level token을 입력합니다.
+4. **연결**을 클릭합니다.
+
+Multica가 두 token이 같은 app에서 발급되었는지 확인합니다. 연결에 성공하면 페이지에 **Slack에 연결됨**이 표시됩니다.
<Callout type="warning">
-두 토큰은 **같은** Slack 앱에서 와야 하며, 그 앱은 정확히 **하나의** 에이전트에 매핑됩니다. 이미 다른 에이전트나 워크스페이스에 연결된 앱을 연결하는 것은 거부됩니다. 앱을 다른 에이전트로 옮기려면 먼저 연결을 해제하세요. **새** 앱으로 에이전트를 다시 연결하면 그 에이전트의 봇이 그 자리에서 갱신됩니다.
+두 token은 Multica 서버에 암호화되어 저장됩니다. Token은 자격 증명이므로 이슈, 댓글, 코드 저장소에 넣지 마세요. 이미 다른 에이전트나 워크스페이스에 연결된 app은 바로 재사용할 수 없으며 기존 연결을 먼저 해제해야 합니다.
</Callout>
-<Callout type="info">
-**여러 에이전트**에 설정하나요? 에이전트당 전체 과정을 한 번씩 반복하세요 — 각 에이전트가 자체 Slack 앱과 자체 토큰 한 쌍을 가지며, Slack 워크스페이스에 별개의 봇으로 나타납니다.
-</Callout>
+## 처음 사용
-## 연동이 하는 일
+멤버가 처음으로 Bot과 DM을 나누거나 @멘션하면 계정 연결 링크를 받습니다. 해당 워크스페이스의 Multica 계정으로 로그인한 뒤 Slack으로 돌아가 메시지를 다시 보내세요.
-| 위치 | 동작 |
-|---|---|
-| **Agent → Integrations** | owner와 admin에게는 **Connect Slack**이 보이며, 연결되면 **Connected to Slack** 배지와 **Disconnect** 컨트롤로 바뀝니다. |
-| **봇에게 DM** | 워크스페이스 멤버가 봇에게 직접 메시지를 보냅니다. 그 대화는 에이전트와의 Multica [chat](/chat) 세션이 되며, 모든 DM 메시지를 읽습니다. |
-| **채널에서 `@`-멘션** | 봇을 초대(`/invite @your-bot`)하고 `@`로 멘션하세요. 멘션한 메시지만 읽으며, 봇이 채널 전체를 듣지는 않습니다. 각 @bot **스레드**가 자체 세션입니다. |
-| **`/issue` 슬래시 명령** | `/issue <설명>`을(채널이나 DM에서) 입력하면 에이전트가 당신의 자연어 설명을 잘 정리된 Multica 이슈로 만들어 당신 이름으로 등록합니다. 먼저 본인에게만 접수 확인을 비공개로 답하고, 이슈가 준비되면 Multica 알림을 받습니다 — @ 멘션이 필요 없습니다. |
-| **답변** | 에이전트의 답변은 같은 DM 또는 스레드로 다시 게시됩니다. |
+링크는 한 번만 사용할 수 있고 15분 뒤 만료됩니다. 만료되면 Bot에 메시지를 하나 더 보내 새 링크를 받으면 됩니다. 같은 Multica 워크스페이스의 여러 Bot이 같은 Slack workspace에서 만들어졌다면 기존 연결을 보통 재사용할 수 있습니다.
-## 봇 사용하기 (멤버)
+현재 Multica 워크스페이스의 멤버만 Bot을 사용할 수 있습니다.
-### 첫 메시지: 계정 연결하기
+## Slack에서 작업 요청
-봇을 처음 `@`로 멘션하거나 DM하면, **계정을 연결하라**는 안내로 답합니다. 링크를 탭하고 Multica에 로그인하면, 당신의 Slack 신원이 Multica 멤버십에 바인딩됩니다 — 바로 이 단계가 에이전트로 하여금 당신을 대신해 행동하게 합니다(예: `/issue`는 당신 이름으로 이슈를 생성합니다). 이 링크는 일회용이며 약 15분 후에 만료됩니다. 새 링크가 필요하면 봇에게 다시 메시지를 보내세요.
+### DM
-**연결은 Slack 워크스페이스당 한 번만 하면 됩니다.** 같은 Multica 워크스페이스가 하나의 Slack 워크스페이스에서 여러 봇을 운영하는 경우(에이전트마다 앱 하나), 첫 봇에서 연결을 마치면 나머지는 그 연결을 자동으로 재사용하므로 다시 안내가 뜨지 않습니다. (다시 연결해야 하는 경우는 *다른* Slack 워크스페이스에 있는 봇이거나, *다른* Multica 워크스페이스에 연결된 봇일 때뿐입니다.)
+Slack 사이드바의 **Apps**에서 Bot을 열고 바로 메시지를 보냅니다. @멘션은 필요 없습니다.
-<Callout type="warning">
-**워크스페이스 멤버**만 봇을 사용할 수 있습니다. 멤버가 아니거나 신원 연결을 건너뛰면 봇은 실행되지 않으며, 메시지는 폐기됩니다(감사 목적으로 기록되며, 내용은 저장하지 않습니다).
-</Callout>
+### 채널과 그룹 채팅
-### 대화와 `/issue`
+먼저 `/invite @your-bot`을 실행해 Bot을 채널에 추가하고 `@your-bot 요청 내용`을 보냅니다. 각 thread는 독립된 대화가 됩니다. 후속 질문은 원래 thread에서 Bot을 계속 @멘션하세요.
-- **채널에서** — 봇은 자동으로 참여하지 않습니다. `/invite @your-bot`을 한 번 실행한 다음 `@your-bot <당신의 메시지>`로 보내세요. 후속 메시지마다 다시 멘션하세요(봇은 자신을 멘션한 메시지만 읽습니다).
-- **DM에서** — Slack 사이드바의 **Apps** 섹션에서 봇을 열고 직접 메시지를 보내세요. 멘션이 필요 없습니다.
-- **이슈 생성** — `/issue` 슬래시 명령을 사용하세요(예: `/issue 로그인 리디렉트가 Safari에서 깨져요`). 자연어로 설명하면 에이전트가 제목과 구조화된 설명을 작성해 이슈를 등록해 줍니다. 채널이나 DM에서 모두 쓸 수 있고(@ 멘션 불필요), 먼저 본인에게만 접수 확인을 비공개로 답하고, 이슈가 생성되면 Multica 알림을 받습니다. 처음 사용하는 사람은 먼저 일회용 계정 연결 링크를 받습니다.
+Bot은 자신을 명시적으로 @멘션한 채널 메시지에만 응답합니다. 실행할 때 권한 범위 안에서 해당 thread의 최근 컨텍스트를 읽습니다.
-## 관리 및 연결 해제
+### `/issue`로 이슈 만들기
-워크스페이스 전체 관리는 **Settings → Integrations**에 있습니다:
+채널이나 DM에서 다음을 입력합니다.
-- **Connected bots**는 워크스페이스 내 모든 봇과 각 봇이 바인딩된 에이전트를 나열합니다(모든 멤버에게 보입니다).
-- **Disconnect**는 **owner / admin 전용**입니다. 봇이 Slack 메시지 수신을 멈추고 연결이 해체됩니다. 설치 기록은 감사용으로 유지되며, 이후 다시 연결할 수 있습니다.
+```text
+/issue Safari에서 로그인에 성공해도 로그인 페이지에 계속 머뭅니다.
+```
-## 권한
+이 명령에는 Bot @멘션이 필요 없습니다. Multica가 설명을 현재 Bot에 연결된 에이전트로 보내고 에이전트가 제목과 본문을 정리해 이슈를 만듭니다. Slack에는 먼저 나에게만 보이는 접수 메시지가 표시되며 생성이 끝나면 Multica 인박스에 알림이 도착합니다.
-- **연결 / 연결 해제**에는 워크스페이스 **owner** 또는 **admin**이 필요합니다.
-- **봇과 대화하기**에는 Slack 신원이 연결된 워크스페이스 멤버여야 합니다. 그 외의 사람은 모두 폐기됩니다.
-- 폐기된 메시지의 본문은 절대 저장되지 않으며 — 감사용 폐기 사유만 기록됩니다.
+## 연결 관리
+
+**설정 → 연동**에서 연결된 모든 Slack Bot을 확인할 수 있습니다. 워크스페이스 owner와 admin이 연결을 해제할 수 있습니다.
+
+연결을 해제하면 Socket Mode 연결이 중지되고 Bot이 새 메시지를 받지 않습니다. 기존 대화와 감사 기록은 함께 삭제되지 않습니다.
## 자체 호스팅 설정
-Multica Cloud에서는 연동이 이미 사용 가능합니다 — 이 섹션은 건너뛰세요.
+Multica Cloud에는 추가 설정이 필요 없습니다. 자체 호스팅 환경에서는 Slack token 암호화에 사용할 키를 먼저 설정해야 합니다.
+
+```dotenv
+MULTICA_SLACK_SECRET_KEY=<base64로 인코딩한 32바이트 키>
+```
-자체 호스팅의 경우, Slack은 **at-rest 암호화 키를 설정하기 전까지 꺼져 있습니다**. 이 키는 각 앱의 bot + app-level 토큰이 데이터베이스에 닿기 전에 암호화합니다. BYO에는 OAuth client id/secret이 **필요 없고**, 배포 수준의 app token도 **필요 없습니다** — 각 installation은 admin이 붙여넣은 토큰을 사용합니다.
+다음과 같이 생성할 수 있습니다.
-1. 32바이트 키를 생성해 API 서버에 설정합니다:
+```bash
+openssl rand -base64 32
+```
- ```dotenv
- MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+API 서비스를 다시 시작한 뒤 Slack app을 연결하세요. 이 키는 장기간 보관해야 합니다. 키를 바꾸거나 잃어버리면 기존 token을 복호화할 수 없으므로 다시 연결해야 합니다.
- 예를 들면: `openssl rand -base64 32`.
+계정 연결 링크는 `MULTICA_APP_URL`을 사용하고, 설정되지 않으면 `FRONTEND_ORIGIN`을 사용합니다. 멤버가 접근할 수 있는 Multica 주소를 지정해야 합니다.
-2. API를 재시작하세요. 키가 설정되기 전까지 **Settings → Integrations**에는 "Slack integration not enabled" 안내가 표시되고, **Connect Slack** 진입점은 숨겨진 채로 유지됩니다.
+## 자주 묻는 문제
-<Callout type="info">
-키는 정확히 32바이트로 디코딩되어야 하며 — `openssl rand -base64 32`가 이를 충족합니다. 오래 유지되는 시크릿으로 다루세요: 키를 회전하거나 잃으면 이미 저장된 토큰을 복호화할 수 없게 되어, 모든 봇이 다시 연결해야 합니다. "계정을 연결하세요" 링크는 웹 앱 URL(`MULTICA_APP_URL`, 없으면 `FRONTEND_ORIGIN`으로 폴백)에서 만들어집니다. 일반적인 배포에서는 이미 설정되어 있으므로 추가로 구성할 것은 없습니다.
-</Callout>
+- **연결할 때 token이 유효하지 않다고 표시됨**: 접두사를 확인하고 두 token이 같은 app에서 발급되었는지 확인합니다.
+- **app을 확인할 수 없음**: manifest에 `users:read`가 포함되어 있는지 확인하고 권한을 업데이트한 뒤 app을 다시 설치합니다.
+- **DM 메뉴가 없음**: `app_home.messages_tab_enabled`가 `true`인지 확인합니다.
+- **채널에서 답변이 없음**: Bot이 채널에 초대되었고 메시지에서 @멘션했는지 확인합니다.
+- **`/issue`가 없음**: manifest에 slash command와 `commands` scope가 포함되어 있는지 확인하고 app을 다시 설치합니다.
+- **Bot이 실행되지 않음**: 에이전트가 보관 처리되었는지, 사용하는 [런타임](/daemon-runtimes)이 온라인인지 확인합니다.
-## 다음
+## 다음 단계
-- [Chat 연동](/channels) — channel 엔진, 세션, 권한이 어떻게 동작하는지
-- [에이전트](/agents) · [Chat](/chat) · [이슈](/issues)
-- [환경 변수](/environment-variables) — 전체 자체 호스팅 구성 참조
+- [채팅 연동](/channels) — 플랫폼 비교, 대화 격리, 계정 연결 방식을 알아봅니다.
+- [에이전트와 대화](/chat) — Bot 뒤의 대화 및 실행 모델을 알아봅니다.
+- [이슈](/issues) — `/issue`가 만드는 작업 단위를 알아봅니다.
diff --git a/apps/docs/content/docs/slack-bot-integration.mdx b/apps/docs/content/docs/slack-bot-integration.mdx
index ed91ebdd66..3b4399c5fd 100644
--- a/apps/docs/content/docs/slack-bot-integration.mdx
+++ b/apps/docs/content/docs/slack-bot-integration.mdx
@@ -1,27 +1,24 @@
---
-title: Slack Bot integration
-description: Connect a Multica agent to your own Slack app — create the app from a manifest, install it, paste the bot + app-level tokens, then @-mention it, DM it, or type /issue from inside Slack.
+title: Slack Bot
+description: Create a Slack Bot for an agent and use it in DMs, channels, and the /issue command.
---
import { Callout } from "fumadocs-ui/components/callout";
-Connect any [agent](/agents) to a Slack bot and your team can work with it from inside Slack — DM the bot, @-mention it in a channel, or type `/issue` to file a [Multica issue](/issues) without opening the app.
+Multica uses your own Slack app. Once connected, team members can DM the Bot, @-mention it in a channel, or use `/issue` to create issues.
-Slack uses a **bring-your-own-app (BYO)** model: a workspace admin creates a Slack app, installs it to their Slack workspace, and pastes its tokens into Multica. Each agent gets **its own** Slack app — so several agents can each have a distinct, separately @-mentionable bot in the same Slack workspace. (This differs from [Lark](/lark-bot-integration), where binding is a scan-to-install flow.)
+One Slack app maps to one Multica agent. To connect several agents, create a separate app for each.
-The whole setup is below and takes about five minutes. You'll end up with two tokens to paste into Multica:
+## Before you start
-- a **Bot token** — starts with `xoxb-`
-- an **App-level token** — starts with `xapp-`
+The connection must be completed by a workspace owner or admin, and ends with two credentials pasted into Multica:
-## Set up your Slack app
+- a Bot User OAuth Token, starting with `xoxb-`;
+- an App-level Token, starting with `xapp-`.
-### 1. Create the app from a manifest
+## 1. Create the Slack app from a manifest
-1. Go to [https://api.slack.com/apps](https://api.slack.com/apps) and click **Create New App**.
-2. Choose **From a manifest**.
-3. Pick the Slack workspace to install the app into.
-4. Switch to the **YAML** tab, paste the manifest below, review, and create the app.
+Open [Slack API Apps](https://api.slack.com/apps), click **Create New App → From a manifest**, pick the Slack workspace, then paste the following under **YAML**:
```yaml
display_information:
@@ -37,7 +34,7 @@ features:
slash_commands:
- command: /issue
description: Create a Multica issue
- usage_hint: "[title]"
+ usage_hint: "[description]"
oauth_config:
scopes:
bot:
@@ -65,122 +62,105 @@ settings:
token_rotation_enabled: false
```
-This manifest configures everything Multica needs, so you don't set anything by hand:
-
-| Section | Why it's there |
-|---|---|
-| `app_home.messages_tab_enabled: true` | Lets members open the bot and **DM** it. Without it, the bot can't be messaged directly. |
-| `bot_user` | Creates the bot identity that gets @-mentioned and posts replies. |
-| `chat:write` | Post the agent's replies back into Slack. |
-| `reactions:write` | Add a 👀 reaction to your message while the agent is working, removed when it replies. Without this scope the indicator is silently skipped — everything else still works. |
-| `app_mentions:read` + `app_mention` event | Receive @-mentions in channels. |
-| `im:history` + `message.im` | Receive **DMs** to the bot (every DM message is read). |
-| `channels:history` / `groups:history` / `mpim:history` + the matching `message.*` events | Receive messages in public channels, private channels, and group DMs. In these, the bot only acts on messages that **@-mention** it. |
-| `users:read` | Required so Multica can verify (via `bots.info`) that your two tokens belong to the same app. |
-| `commands` | The bot scope that enables the `/issue` slash command (pairs with `features.slash_commands`). Without it, updating the manifest and reinstalling won't grant the command. |
-| `socket_mode_enabled: true` | The bot connects out over Socket Mode — **no public URL / request URL needed**. |
-| `interactivity.is_enabled: false` | Multica's prompts are plain links, not buttons, so interactivity isn't needed. |
-| `slash_commands` (`/issue`) | Registers the `/issue` slash command so anyone can file a Multica issue from the message box. Delivered over Socket Mode — no request URL. |
-
-There is **no OAuth redirect URL**, because BYO doesn't use OAuth.
-
-<Callout type="info">
-Want a specific name in Slack? Change `display_information.name` and `features.bot_user.display_name` (e.g. to your agent's name) before creating, or edit it later under **App Home**. Slack shows the bot by its **bot display name**, which can differ from the app name.
-</Callout>
+Before creating, you can replace both occurrences of `Multica` with the agent's name. Do not remove scopes or events from the manifest, or DMs, channel mentions, replies, or `/issue` may stop working.
+
+The Bot connects out to Slack over Socket Mode, so no public Request URL or OAuth Redirect URL is needed.
+
+## 2. Get the two tokens
+
+### Bot token
-### 2. Install the app and copy the Bot token
+1. In the Slack app, open **Install App**.
+2. Click **Install to Workspace** and approve the permissions.
+3. Copy the **Bot User OAuth Token** — it starts with `xoxb-`.
-1. In the app's left nav, open **Install App** (or **OAuth & Permissions**).
-2. Click **Install to Workspace** and approve.
-3. Copy the **Bot User OAuth Token** — it starts with `xoxb-`. This is your **Bot token**.
-### 3. Create the App-level token
+### App-level token
-The app-level token authorizes the Socket Mode connection. It can only be created in the console (it isn't part of OAuth).
+1. Open **Basic Information → App-Level Tokens**.
+2. Click **Generate Token and Scopes**.
+3. Add the `connections:write` scope.
+4. Generate and copy the token starting with `xapp-`.
-1. Open **Basic Information → App-Level Tokens** and click **Generate Token and Scopes**.
-2. Give it any name.
-3. Click **Add Scope** and pick **`connections:write`** from the list (it's a picker — select it, don't type it).
-4. Click **Generate**, then copy the token — it starts with `xapp-`. This is your **App-level token**.
-### 4. Connect it in Multica
+## 3. Connect it to an agent
-1. Open the agent in **Agents → _your agent_** → the **Integrations** tab (or the **Integrations** section in the left sidebar).
-2. Click **Connect Slack**.
-3. Paste the **Bot token** (`xoxb-`) and the **App-level token** (`xapp-`), then click **Connect**.
-4. The agent shows **Connected to Slack**. The bot is now listening over its own Socket Mode connection.
+1. In Multica, open **Agents** and select the agent to connect to Slack.
+2. Go to **Integrations** and click **Connect Slack**.
+3. Paste the Bot token and the App-level token.
+4. Click **Connect**.
+
+Multica verifies that the two tokens come from the same app. Once connected, the page shows **Connected to Slack**.
<Callout type="warning">
-The two tokens must be from the **same** Slack app, and that app maps to exactly **one** agent. Connecting an app that's already connected to a different agent or workspace is refused. To move an app to another agent, disconnect it first; re-connecting an agent with a **new** app updates that agent's bot in place.
+Both tokens are stored encrypted on the Multica server. Tokens are credentials — don't put them in issues, comments, or code repositories. An app already connected to another agent or workspace can't be reused directly; disconnect the original connection first.
</Callout>
-<Callout type="info">
-Setting this up for **multiple agents**? Repeat the whole flow once per agent — each agent gets its own Slack app and its own pair of tokens, and they show up as separate bots in your Slack workspace.
-</Callout>
+## First use
-## What the integration does
+The first time a member DMs or @-mentions the Bot, they receive an account binding link. Sign in with the Multica account for that workspace, then return to Slack and send the message again.
-| Surface | Behavior |
-|---|---|
-| **Agent → Integrations** | Owners and admins see **Connect Slack**; once connected it flips to a **Connected to Slack** badge with a **Disconnect** control. |
-| **DM the bot** | A workspace member messages the bot directly. The conversation becomes a Multica [chat](/chat) session with the agent; every DM message is read. |
-| **@-mention in a channel** | Invite the bot (`/invite @your-bot`) and @-mention it. Only the mentioning message is read — the bot does not listen to the whole channel. Each @bot **thread** is its own session. |
-| **`/issue` slash command** | Type `/issue <description>` (in a channel or a DM) and the agent turns your plain-language description into a well-formed Multica issue, attributed to you. It replies privately to acknowledge — you get a Multica notification when the issue is ready. No @-mention needed. |
-| **Reply** | The agent's answer is posted back into the same DM or thread. |
+The link is single-use and expires after 15 minutes. Once it expires, message the Bot again for a new one. Multiple Bots in the same Multica workspace can usually reuse an existing binding if they come from the same Slack workspace.
-## Use the bot (members)
+Only members of the current Multica workspace can use the Bot.
-### First message: link your account
+## Hand work to the agent in Slack
-The first time you @-mention or DM the bot, it replies with a **link your account** prompt. Tap the link, sign in to Multica, and your Slack identity is bound to your Multica membership — this is what lets the agent act as you (e.g. `/issue` files under your name). The link is single-use and expires in about 15 minutes; just message the bot again for a fresh one.
+### Direct messages
-You only link **once per Slack workspace**. If the same Multica workspace runs several bots in one Slack workspace (one app per agent), the first bot you link teaches the rest: messaging a second bot reuses that link automatically, no re-prompt. (Linking again is only needed for a bot in a *different* Slack workspace, or a bot connected to a *different* Multica workspace.)
+Open the Bot from **Apps** in the Slack sidebar and message it directly — no @-mention needed.
-<Callout type="warning">
-Only **members of the workspace** can use the bot. If you aren't a member, or you skip the identity link, the bot won't run — your message is dropped (recorded for audit, without its contents).
-</Callout>
+### Channels and group chats
-### Chat and `/issue`
+Run `/invite @your-bot` to add the Bot to the channel first, then send `@your-bot your request`. Each thread forms its own session; for follow-ups, keep @-mentioning the Bot in the original thread.
-- **In a channel** — the bot isn't auto-joined. Run `/invite @your-bot` once, then `@your-bot <your message>`. Re-mention it for each follow-up (the bot only reads messages that mention it).
-- **In a DM** — open the bot from the Slack sidebar's **Apps** section and message it directly; no mention needed.
-- **File an issue** — use the `/issue` slash command, e.g. `/issue the login redirect is broken on Safari`. Describe it in plain language; the agent writes a proper title and structured description for you and files the issue. It works in a channel or a DM (no @-mention needed) and replies privately to acknowledge — you'll get a Multica notification when the issue is created. First-time users get a one-time link to connect their account.
+The Bot only responds to channel messages that explicitly @-mention it. When it runs, it reads the thread's recent context within the scopes its permissions allow.
-## Manage and disconnect
+### Create issues with `/issue`
-Workspace-wide management lives in **Settings → Integrations**:
+In a channel or DM, type:
-- **Connected bots** lists every bot in the workspace and the agent each is bound to (visible to all members).
-- **Disconnect** is **owner / admin only**. It stops the bot from receiving Slack messages and tears down its connection; the installation record is kept for audit, and you can re-connect later.
+```text
+/issue Safari stays on the login page after a successful sign-in
+```
-## Permissions
+This command needs no @-mention. Multica hands the description to the agent behind the current Bot, which writes up the title and body and creates the issue. Slack first shows an acknowledgment visible only to you; when the issue is created, you get a notification in your Multica inbox.
-- **Connect / disconnect** require workspace **owner** or **admin**.
-- **Talking to the bot** requires being a workspace member with a linked Slack identity. Everyone else is dropped.
-- Message bodies for dropped messages are never stored — only a drop reason, for audit.
+## Manage connections
-## Self-host setup
+Open **Settings → Integrations** to view all connected Slack Bots. Workspace owners and admins can disconnect them.
-On Multica Cloud the integration is already available — skip this section.
+After disconnecting, the Socket Mode connection stops and the Bot no longer receives new messages. Existing conversations and audit records are not deleted.
-For self-host, Slack is **off until you set an at-rest encryption key**. The key encrypts each app's bot + app-level tokens before they touch the database. BYO needs **no** OAuth client id/secret and **no** deployment-level app token — each installation uses the tokens the admin pastes.
+## Self-hosting setup
-1. Generate a 32-byte key and set it on the API server:
+Multica Cloud needs no extra configuration. A self-hosted deployment must first set a key used to encrypt Slack tokens:
- ```dotenv
- MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+```dotenv
+MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
+```
- For example: `openssl rand -base64 32`.
+Generate one like this:
-2. Restart the API. Until the key is set, **Settings → Integrations** shows a "Slack integration not enabled" notice and the **Connect Slack** entry points stay hidden.
+```bash
+openssl rand -base64 32
+```
-<Callout type="info">
-The key must decode to exactly 32 bytes — `openssl rand -base64 32` does this. Treat it as a long-lived secret: rotating or losing it makes already-stored tokens undecryptable, forcing every bot to reconnect. The "link your account" link is built from your web app URL (`MULTICA_APP_URL`, falling back to `FRONTEND_ORIGIN`) — a normal deployment already sets this, so there's nothing extra to configure.
-</Callout>
+Restart the API server, then connect the Slack app. Keep this key long-term: if it is rotated or lost, existing tokens can no longer be decrypted and the Bot must be reconnected.
+
+Account binding links use `MULTICA_APP_URL`, falling back to `FRONTEND_ORIGIN` when unset; it must point to a Multica address members can reach.
+
+## Troubleshooting
+
+- **Invalid token when connecting**: check the prefixes and confirm both tokens come from the same app.
+- **App can't be verified**: confirm the manifest includes `users:read`, then reinstall the app after updating permissions.
+- **No DM entry point**: confirm `app_home.messages_tab_enabled` is `true`.
+- **No reply in a channel**: confirm the Bot has been invited to the channel and the message @-mentions it.
+- **`/issue` doesn't exist**: confirm the manifest includes the slash command and the `commands` scope, then reinstall the app.
+- **The Bot doesn't run**: check whether the agent is archived and whether the [runtime](/daemon-runtimes) it uses is online.
-## Next
+## Next steps
-- [Chat integrations](/channels) — how the channel engine, sessions, and authorization work
-- [Agents](/agents) · [Chat](/chat) · [Issues](/issues)
-- [Environment variables](/environment-variables) — full self-host configuration reference
+- [Chat integrations](/channels) — platform comparison, session isolation, and account binding mechanics.
+- [Chat](/chat) — the conversation and execution model behind the Bot.
+- [Issues](/issues) — the unit of work `/issue` creates.
diff --git a/apps/docs/content/docs/slack-bot-integration.zh.mdx b/apps/docs/content/docs/slack-bot-integration.zh.mdx
index 659bf7229d..536cc7487f 100644
--- a/apps/docs/content/docs/slack-bot-integration.zh.mdx
+++ b/apps/docs/content/docs/slack-bot-integration.zh.mdx
@@ -1,27 +1,24 @@
---
-title: Slack Bot 接入
-description: 把 Multica 智能体接入你自己的 Slack app——用 manifest 创建 app、安装它、粘贴 bot token 与 app-level token,然后就能在 Slack 里 @ 它、私聊它,或输入 /issue。
+title: Slack Bot
+description: 为智能体创建一个 Slack Bot,在私聊、频道和 /issue 命令中使用它。
---
import { Callout } from "fumadocs-ui/components/callout";
-把任意[智能体](/agents)接入一个 Slack Bot,团队就能在 Slack 里直接使用它——私聊 Bot、在频道里 @ 它,或者输入 `/issue` 直接创建一个 [Multica issue](/issues),不用打开应用。
+Multica 使用你自己的 Slack app。连接后,团队成员可以私聊 Bot、在频道里 @ 它,或用 `/issue` 创建 issue。
-Slack 走的是**自带应用(bring-your-own-app,BYO)**模式:workspace 管理员创建一个 Slack app,把它安装到自己的 Slack workspace,再把它的 token 粘贴进 Multica。每个智能体都有**它自己的** Slack app——所以多个智能体可以在同一个 Slack workspace 里各自拥有一个独立、可单独 @ 的 Bot。(这一点和 [Lark](/lark-bot-integration) 不同,Lark 的绑定是扫码安装流程。)
+一个 Slack app 对应一个 Multica 智能体。需要接入多个智能体时,为每个智能体分别创建 app。
-整个设置流程在下面,大约五分钟。最后你会得到两个 token 粘贴进 Multica:
+## 开始前
-- 一个 **Bot token** —— 以 `xoxb-` 开头
-- 一个 **App-level token** —— 以 `xapp-` 开头
+连接需要工作区 owner 或 admin 完成,最终把两个凭据填入 Multica:
-## 设置你的 Slack app
+- Bot User OAuth Token,以 `xoxb-` 开头;
+- App-level Token,以 `xapp-` 开头。
-### 1. 用 manifest 创建 app
+## 1. 从 manifest 创建 Slack app
-1. 打开 [https://api.slack.com/apps](https://api.slack.com/apps),点击 **Create New App**。
-2. 选择 **From a manifest**。
-3. 选定要把 app 安装进去的那个 Slack workspace。
-4. 切到 **YAML** tab,粘贴下面的 manifest,检查一遍,然后创建这个 app。
+打开 [Slack API Apps](https://api.slack.com/apps),点击 **Create New App → From a manifest**,选择 Slack workspace,然后在 **YAML** 中粘贴以下内容:
```yaml
display_information:
@@ -37,7 +34,7 @@ features:
slash_commands:
- command: /issue
description: Create a Multica issue
- usage_hint: "[title]"
+ usage_hint: "[description]"
oauth_config:
scopes:
bot:
@@ -65,122 +62,105 @@ settings:
token_rotation_enabled: false
```
-这个 manifest 已经把 Multica 所需的一切都配好了,所以你不用手动设置任何东西:
-
-| 配置项 | 为什么需要它 |
-|---|---|
-| `app_home.messages_tab_enabled: true` | 让成员能打开 Bot 并**私聊**它。没有它,Bot 就无法被直接发消息。 |
-| `bot_user` | 创建被 @ 和发回复用的那个 Bot 身份。 |
-| `chat:write` | 把智能体的回复发回 Slack。 |
-| `reactions:write` | 智能体处理期间在你的消息上加一个 👀 表情,回复后再移除。没有这个权限时,该提示会被静默跳过——其他功能都不受影响。 |
-| `app_mentions:read` + `app_mention` 事件 | 接收频道里的 @ 提及。 |
-| `im:history` + `message.im` | 接收发给 Bot 的**私聊**(每一条私聊消息都会被读取)。 |
-| `channels:history` / `groups:history` / `mpim:history` + 对应的 `message.*` 事件 | 接收公开频道、私有频道和群组私聊里的消息。在这些场景里,Bot 只对 **@ 了**它的消息做出响应。 |
-| `users:read` | 必需,这样 Multica 才能(通过 `bots.info`)核实你的两个 token 属于同一个 app。 |
-| `commands` | 启用 `/issue` 斜杠命令所需的 bot 权限(和 `features.slash_commands` 搭配)。少了它,即使更新 manifest 并重装,也拿不到这个命令。 |
-| `socket_mode_enabled: true` | Bot 通过 Socket Mode 向外连接——**无需任何公网 URL / request URL**。 |
-| `interactivity.is_enabled: false` | Multica 的提示是纯链接,不是按钮,所以不需要交互性。 |
-| `slash_commands`(`/issue`) | 注册 `/issue` 斜杠命令,让任何人都能从消息框直接创建一个 Multica issue。通过 Socket Mode 下发——无需 request URL。 |
-
-这里**没有 OAuth 重定向 URL**,因为 BYO 不使用 OAuth。
-
-<Callout type="info">
-想在 Slack 里用一个特定的名字?在创建之前改 `display_information.name` 和 `features.bot_user.display_name`(比如改成你智能体的名字),或者之后在 **App Home** 里编辑。Slack 是按 Bot 的**显示名(bot display name)**来展示它的,这个名字可以和 app 名不一样。
-</Callout>
+创建前可以把两个 `Multica` 改成智能体的名字。不要删除 manifest 中的权限或事件,否则私聊、频道提及、回复或 `/issue` 可能无法工作。
+
+Bot 使用 Socket Mode 主动连接 Slack,不需要配置公网 Request URL 或 OAuth Redirect URL。
+
+## 2. 获取两个 token
+
+### Bot token
-### 2. 安装 app 并复制 Bot token
+1. 在 Slack app 中打开 **Install App**。
+2. 点击 **Install to Workspace** 并批准权限。
+3. 复制 **Bot User OAuth Token**,它以 `xoxb-` 开头。
-1. 在 app 的左侧导航里,打开 **Install App**(或 **OAuth & Permissions**)。
-2. 点击 **Install to Workspace** 并批准。
-3. 复制 **Bot User OAuth Token**——它以 `xoxb-` 开头。这就是你的 **Bot token**。
-### 3. 创建 App-level token
+### App-level token
-App-level token 用来授权 Socket Mode 连接。它只能在控制台里创建(它不属于 OAuth)。
+1. 打开 **Basic Information → App-Level Tokens**。
+2. 点击 **Generate Token and Scopes**。
+3. 添加 `connections:write` scope。
+4. 生成并复制以 `xapp-` 开头的 token。
-1. 打开 **Basic Information → App-Level Tokens**,点击 **Generate Token and Scopes**。
-2. 随便起个名字。
-3. 点击 **Add Scope**,从列表里选 **`connections:write`**(这是一个选择器——选中它,不要手打)。
-4. 点击 **Generate**,然后复制这个 token——它以 `xapp-` 开头。这就是你的 **App-level token**。
-### 4. 在 Multica 里连接它
+## 3. 连接到智能体
-1. 在 **Agents → _你的智能体_** 打开该智能体 → **Integrations** tab(或左侧栏的 **Integrations** 区块)。
-2. 点击 **Connect Slack**。
-3. 粘贴 **Bot token**(`xoxb-`)和 **App-level token**(`xapp-`),然后点击 **Connect**。
-4. 智能体显示 **Connected to Slack**。Bot 现在通过它自己的 Socket Mode 连接在监听了。
+1. 在 Multica 中打开 **智能体**,选择要接入 Slack 的智能体。
+2. 进入 **集成**,点击 **连接 Slack**。
+3. 填入 Bot token 和 App-level token。
+4. 点击 **连接**。
+
+Multica 会验证两个 token 是否来自同一个 app。连接成功后,页面会显示 **已连接到 Slack**。
<Callout type="warning">
-这两个 token 必须来自**同一个** Slack app,而那个 app 恰好对应**一个**智能体。连接一个已经连到别的智能体或 workspace 的 app 会被拒绝。要把一个 app 挪到另一个智能体,先断开它;用一个**新的** app 重新连接某个智能体,会就地更新那个智能体的 Bot。
+两个 token 会加密保存在 Multica 服务器上。Token 即凭据,不要写进 issue、评论或代码仓库。已连接到其他智能体或工作区的 app 不能直接重复使用,需先断开原连接。
</Callout>
-<Callout type="info">
-要给**多个智能体**做这套设置?每个智能体都把整套流程走一遍——每个智能体都有自己的 Slack app 和自己的一对 token,它们会在你的 Slack workspace 里显示成各自独立的 Bot。
-</Callout>
+## 第一次使用
-## 这个集成能做什么
+成员第一次私聊或 @ Bot 时,会收到一个账号绑定链接。用该工作区的 Multica 账号登录后,再回到 Slack 发送消息。
-| 入口 | 行为 |
-|---|---|
-| **智能体 → Integrations** | 所有者和管理员能看到 **Connect Slack**;连接后它会变成一个 **Connected to Slack** 徽标,并带一个 **Disconnect** 操作。 |
-| **私聊 Bot** | 工作区成员直接给 Bot 发消息。这段对话会成为该智能体的一个 Multica [chat](/chat) 会话;每一条私聊消息都会被读取。 |
-| **频道里 @ 它** | 把 Bot 邀请进来(`/invite @your-bot`)再 @ 它。只有 @ 它的那条消息会被读取——Bot 不会监听整个频道。每个 @bot 的 **thread** 都是它自己的会话。 |
-| **`/issue` 斜杠命令** | 输入 `/issue <描述>`(在频道或私聊里),智能体会把你的自然语言描述整理成一个规整的 Multica issue,记在你名下。它会私下先回一条「收到」——issue 创建好后你会收到一条 Multica 通知。不需要 @ Bot。 |
-| **回复** | 智能体的答复会被发回同一段私聊或 thread 里。 |
+链接只能使用一次,并会在 15 分钟后过期。过期后再给 Bot 发一条消息即可获得新链接。同一 Multica 工作区中的多个 Bot 如果来自同一个 Slack workspace,通常可以复用已有绑定。
-## 使用 Bot(成员)
+只有当前 Multica 工作区的成员可以使用 Bot。
-### 第一条消息:绑定你的账号
+## 在 Slack 中交代工作
-第一次 @ 或私聊 Bot 时,它会回一条 **绑定你的账号** 提示。点开链接、登录 Multica,你的 Slack 身份就会绑定到你的 Multica 成员身份——正是这一步让智能体能以你的身份行事(比如 `/issue` 会把 issue 记在你名下)。这个链接是一次性的,大约 15 分钟后过期;再给 Bot 发条消息就能拿到一个新的。
+### 私聊
-**每个 Slack workspace 只需绑定一次。** 如果同一个 Multica 工作区在同一个 Slack workspace 里跑了多个 Bot(每个智能体一个 App),你在第一个 Bot 上完成绑定后,其余的会自动复用这次绑定,不会再次弹出提示。(只有在*另一个* Slack workspace 里的 Bot、或连到*另一个* Multica 工作区的 Bot,才需要重新绑定。)
+从 Slack 侧栏的 **Apps** 打开 Bot,直接发送消息,不需要 @。
-<Callout type="warning">
-只有**工作区成员**才能使用 Bot。如果你不是成员,或者跳过了身份绑定,Bot 不会运行——你的消息会被丢弃(仅出于审计目的记录,不保存消息内容)。
-</Callout>
+### 频道和群聊
-### 对话与 `/issue`
+先运行 `/invite @your-bot` 把 Bot 加入频道,再发送 `@your-bot 你的要求`。每个 thread 会形成独立会话;追问时继续在原 thread 中 @ Bot。
-- **在频道里** —— Bot 不会自动加入。先运行一次 `/invite @your-bot`,然后 `@your-bot <你的消息>`。每次追问都要重新 @ 它一下(Bot 只读取 @ 了它的消息)。
-- **在私聊里** —— 从 Slack 侧栏的 **Apps** 区块打开 Bot 并直接给它发消息;不用 @。
-- **创建 issue** —— 使用 `/issue` 斜杠命令,比如 `/issue 登录跳转在 Safari 上坏了`。用自然语言描述就行,智能体会替你写好标题和结构化描述再建 issue。在频道或私聊里都能用(不用 @ Bot),会私下先回一条「收到」——issue 创建好后你会收到一条 Multica 通知。第一次使用的人会先收到一个一次性的账号绑定链接。
+Bot 只会响应明确 @ 它的频道消息。执行时,它会在权限允许的范围内读取该 thread 的近期上下文。
-## 管理与断开
+### 用 `/issue` 创建 issue
-工作区级别的管理在 **Settings → Integrations**:
+在频道或私聊中输入:
-- **Connected bots** 列出工作区里每个 Bot 以及它各自绑定的智能体(所有成员都能看到)。
-- **Disconnect** 仅限 **所有者 / 管理员**。它会让 Bot 停止接收 Slack 消息并拆掉它的连接;安装记录会保留以便审计,之后你可以重新连接。
+```text
+/issue Safari 登录成功后仍然停留在登录页
+```
-## 权限
+这条命令不需要 @ Bot。Multica 会把描述交给当前 Bot 对应的智能体,由它整理标题和正文并创建 issue。Slack 会先显示一条仅你可见的接收提示;创建完成后,你会在 Multica 收件箱中收到通知。
-- **连接 / 断开** 需要工作区**所有者**或**管理员**。
-- **和 Bot 对话** 需要你是工作区成员且已绑定 Slack 身份。其余的人一律被丢弃。
-- 对于被丢弃的消息,绝不保存消息内容——只记录一个丢弃原因,用于审计。
+## 管理连接
-## 自部署配置
+打开 **设置 → 集成** 可以查看所有已连接的 Slack Bot。工作区 owner 和 admin 可以断开连接。
-在 Multica Cloud 上这个集成已经可用——可跳过本节。
+断开后,Socket Mode 连接会停止,Bot 不再接收新消息。已有的对话和审计记录不会随之删除。
-自部署时,**在你设置好静态加密密钥之前,Slack 是关闭的**。这个密钥会在每个 app 的 bot token + app-level token 落库之前对其加密。BYO **不需要** OAuth client id/secret,也**不需要**部署级的 app token——每个安装用的都是管理员粘贴进来的那对 token。
+## 自托管配置
-1. 生成一个 32 字节的密钥并设置到 API 服务器:
+Multica Cloud 无需额外配置。自托管部署需要先设置一个用于加密 Slack token 的密钥:
- ```dotenv
- MULTICA_SLACK_SECRET_KEY=<base64-encoded 32-byte key>
- ```
+```dotenv
+MULTICA_SLACK_SECRET_KEY=<base64 编码的 32 字节密钥>
+```
- 例如:`openssl rand -base64 32`。
+可以这样生成:
-2. 重启 API。在密钥设置好之前,**Settings → Integrations** 会显示一条「Slack integration not enabled」提示,**Connect Slack** 入口也会保持隐藏。
+```bash
+openssl rand -base64 32
+```
-<Callout type="info">
-这个密钥必须正好解码出 32 字节——`openssl rand -base64 32` 就能做到。把它当成一个长期有效的密钥:轮换或丢失它会让已存储的 token 无法解密,迫使每个 Bot 重新连接。「绑定你的账号」链接是用你的 Web 应用地址(`MULTICA_APP_URL`,未设置时回退到 `FRONTEND_ORIGIN`)拼出来的——正常部署里这个值本来就有,不需要额外配置。
-</Callout>
+重启 API 服务后,再连接 Slack app。该密钥需要长期保存:更换或丢失后,已有 token 无法解密,需要重新连接。
+
+账号绑定链接使用 `MULTICA_APP_URL`,未设置时回退到 `FRONTEND_ORIGIN`;它需要指向成员可以访问的 Multica 地址。
+
+## 常见问题
+
+- **连接时提示 token 无效**:检查前缀,并确认两个 token 来自同一个 app。
+- **无法验证 app**:确认 manifest 包含 `users:read`,更新权限后重新安装 app。
+- **私聊没有入口**:确认 `app_home.messages_tab_enabled` 为 `true`。
+- **频道里没有回复**:确认 Bot 已被邀请进频道,并在消息中 @ 了它。
+- **`/issue` 不存在**:确认 manifest 包含 slash command 和 `commands` scope,随后重新安装 app。
+- **Bot 不执行**:检查智能体是否已归档,以及它使用的[运行时](/daemon-runtimes)是否在线。
-## 下一步
+## 接下来
-- [聊天集成](/channels) —— channel 引擎、会话与授权是怎么运作的
-- [智能体](/agents) · [Chat](/chat) · [Issues](/issues)
-- [环境变量](/environment-variables) —— 完整的自部署配置参考
+- [聊天集成](/channels) — 平台对比、会话隔离和账号绑定机制。
+- [与智能体对话](/chat) — Bot 背后的对话与执行模型。
+- [Issues](/issues) — `/issue` 创建的工作单位。
diff --git a/apps/docs/content/docs/squads.ja.mdx b/apps/docs/content/docs/squads.ja.mdx
index 2889e070d4..e54fafe09e 100644
--- a/apps/docs/content/docs/squads.ja.mdx
+++ b/apps/docs/content/docs/squads.ja.mdx
@@ -1,136 +1,89 @@
---
title: スクワッド
-description: "スクワッドは、1 人の指定されたリーダーエージェントが率いるエージェント(そして任意で人間のメンバー)のグループです。スクワッドにイシューを割り当てると、リーダーが誰が引き受けるかを決定します。"
+description: 1 体のリーダーが複数のエージェントやメンバーを調整し、仕事を適切な相手に渡します。
---
import { Callout } from "fumadocs-ui/components/callout";
-スクワッドは、1 人の指定された**リーダーエージェント**を擁する、**[エージェント](/agents)と人間の[メンバー](/members-roles)の名前付きグループ**です。スクワッド自体が一級の担当者です。どの **Assignee** ピッカーからでもスクワッドを選ぶと、リーダーがトリガーを受け取り、イシューを読んだ上で、その作業に最も適したスクワッドメンバーを `@` でメンションします。スクワッドを使えば、専門家を一度組み立てておいて、**名前ではなくトピックで**作業を割り振れます — チームが大きくなっても、ルーティングはそのまま維持されます。
+スクワッドは、1 体のリーダーエージェントと複数のメンバーで構成されます。イシューをスクワッドに割り当てても、すべてのエージェントが一斉に動くわけではありません。Multica はまずリーダーを起こし、リーダーがコンテキストを読んで、次のステップを誰に任せるかを決めます。
-## スクワッドの動作原理
+スクワッドが解決するのは「仕事を誰に渡すか」という問題です。複数のエージェントを 1 つの新しいエージェントに統合することも、同時実行数を自動的に増やすこともありません。
-- **リーダー 1 人、メンバー多数。** リーダーは必ずエージェントでなければならず、メンバーはエージェントでも人間のメンバーでも構いません。リーダーだけのスクワッドも許可されます(リーダーブリーフィングに「no other members」と表示されます)。同じエージェントが複数のスクワッドに所属することもできます。
-- **人を選べるあらゆる場所で割り当て可能。** スクワッドは Assignee ピッカー、@メンションピッカー、クイック作成モーダルに表示されます — エージェントやメンバーを選べる場所ならどこでも、スクワッドを選べます。
-- **アーカイブによるソフト削除。** スクワッドをアーカイブすると、ピッカーや一覧から消えます。現在そのスクワッドに割り当てられているイシューはすべて**リーダーエージェントに移管され**、作業が途切れないようにします。アーカイブされたスクワッドに新しいイシューを割り当てることはできません。
+## 適した場面
-## スクワッドと単一エージェントのどちらを使うか
+仕事に複数の能力が必要で、イシュー作成の時点では具体的な担当者を決められない場合に、スクワッドを使います。たとえば、プロダクト提供のスクワッドにフロントエンド、バックエンド、テストのエージェントを入れておき、リーダーが各イシューの内容に応じて割り振る、といった形です。
-| スクワッドを選ぶ場合… | 単一エージェントを選ぶ場合… |
-|---|---|
-| 複数の専門家がいるが、このイシューに誰が合うか事前にわからないとき | 作業の範囲が 1 つの専門分野に明確で、誰がやるべきかわかっているとき |
-| 実際の応答者はイシューごとに変わっても、担当者(スクワッド)は安定して保ちたいとき | イシューにエージェントの名前を残し、明確な個人の説明責任を持たせたいとき |
-| コメントで `@FrontendTeam` のようなルーティング先がほしいとき | 一対一の `@agent-name` だけで十分なとき |
-
-スクワッドは能力を加えません。**ルーティング**を加えます。メンバーは依然として普通のエージェントであり、リーダーの唯一の役割は適切な人を選ぶことです。
+仕事の範囲が明確なら、対応する[エージェント](/agents)に直接割り当ててください。
-## 権限
+## スクワッドの構成
-| 操作 | 実行できる人 |
+| 設定 | 役割 |
|---|---|
-| スクワッドの作成 / 更新 / アーカイブ | ワークスペースの **owner** または **admin** |
-| メンバーの追加・削除、ロールの変更 | ワークスペースの **owner** または **admin** |
-| スクワッドにイシューを割り当て | すべてのワークスペースメンバー(エージェントへの割り当てと同じ) |
-| コメントでスクワッドを `@` でメンション | すべてのワークスペースメンバー |
-| スクワッドリーダーの評価を記録 | スクワッドリーダーエージェントのみ(CLI 経由) |
-
-完全なロールマトリクスは[メンバーとロール](/members-roles)にあります。
+| **リーダー** | 必ずエージェントです。スクワッドに割り当てられた仕事を受け取り、どう処理するかを決めます。 |
+| **メンバー** | エージェントでも人間のメンバーでもかまいません。同じメンバーが複数のスクワッドに参加できます。 |
+| **ロールの説明** | 各メンバーがどんな仕事に向いているかをリーダーに伝えます。あくまでコンテキストであり、権限を付与したりメンバーを自動的にトリガーしたりはしません。 |
+| **スクワッドの指示** | ルーティングのルール、協働の進め方、スクワッド全体で共有すべき背景を保存します。リーダーにだけ提供されます。 |
-## スクワッドを作成する
+スクワッドの作成には、名前の入力とリーダーの選択が必要です。スクワッドのリーダーは自動的にメンバーになります。その後、メンバーの追加、ロールの説明、スクワッドの指示を続けて設定できます。
-サイドバーで **スクワッド → 新しいスクワッド** を開き、次を入力してください。
+## 割り当て後の実行フロー
-- **名前(Name)** — 例: `Frontend Team`、`Bug Triage`。ワークスペース内で一意である必要はありません。
-- **説明(Description、任意)** — スクワッドカードと詳細ページに表示される短い紹介文。
-- **リーダー(Leader)** — 既存のエージェントを選びます。リーダーは `leader` ロールで自動的にスクワッドに追加されます。
+1. イシューが `backlog` 以外のステータスでスクワッドに割り当てられると、Multica はリーダーのためにタスクを作成します。
+2. リーダーは、イシューのコンテキスト、スクワッドの指示、そしてメンバーのロールとスキルを含む名簿を見ます。
+3. リーダーがコメントで適切なメンバーを @メンションします。エージェントへの @メンションは新しい実行をトリガーし、人間のメンバーへの @メンションはその人に通知を送ります。
+4. メンバーの進捗と結果は元のイシューに書き戻され、リーダーは後続の情報に応じて再び調整できます。
-作成後、スクワッドの詳細ページを開いて次を行えます。
+イシューがまだ `backlog` にある間は、割り当てだけではリーダーはトリガーされません。`backlog` を出た時点で実行が始まります。
-- **メンバーを追加** — エージェントや人間のメンバーを選び、任意で各自に短いロールの説明(例: 「owns the migrations」、「reviewer of last resort」)を付けます。リーダーは誰に委任するかを決めるときにこれらのロールを使います。
-- **指示を書く** — リーダーが実行のたびに見るスクワッドレベルのガイダンスです(詳しくは後述)。
-- **アバターを設定** — エージェントに使うのと同じピッカーから選びます。
-
-CLI での同等のコマンド:
+<Callout type="info">
+リーダーの職責は調整であり、実装を自分で仕上げることではありません。振り分けを終えると今回の実行を停止し、メンバーが進捗を更新してから改めて判断します。適切なメンバーがいない場合、リーダーは自分で引き受けず、イシューにギャップを書き残します。
+</Callout>
-```bash
-multica squad create --name "Frontend Team" --leader frontend-lead-agent
-multica squad member add <squad-id> --member-id <agent-or-user-uuid> --type agent --role "Owns Tailwind / shadcn surface"
-```
+## スクワッドへの割り当てと @メンション
-## スクワッドに割り当てられたイシューの実行方法
+| 操作 | 担当者が変わるか | 結果 |
+|---|---|---|
+| **イシューをスクワッドに割り当てる** | はい | スクワッドが担当者になり、リーダーがトリガーされます。 |
+| **コメントでスクワッドを @メンションする** | いいえ | リーダーがそのコメントだけを処理し、元の担当者は変わりません。 |
-Backlog でないイシューがスクワッドに割り当てられると、Multica はただちに**リーダーエージェント**のための `task` をキューに入れます(すべてのメンバーのためではありません)。その後のフローは次のようになります。
+特定のメンバーを直接 @メンションすると、仕事はそのメンバーに渡ります。Multica は重複したトリガーをまとめ、リーダーのコメントがリーダー自身を再びトリガーすることも防いで、実行ループを回避します。
-1. **リーダーがタスクを引き受けます。** エージェントランタイムが次のポーリングでタスクを引き受けます。これは他のエージェント割り当てと同じです。
-2. **リーダーがブリーフィングを受けます。** 引き受けた時点で、Multica はリーダーのシステムプロンプトに 3 つのセクションを追記します — 下記の[リーダーが毎ターン見る内容](#what-the-leader-sees-on-every-turn)を参照してください。
-3. **リーダーが 1 つの委任コメントを投稿します。** そのコメントは、名簿(roster)にある正確なメンションマークダウンを使って、選んだメンバーを `@` でメンションします。このメンションが、メンションされた各エージェントのための新しい `task` をトリガーします。
-4. **リーダーが評価を記録します** — `multica squad activity <issue-id> action --reason "..."` を通じて記録します。これはイシューのアクティビティタイムラインにエントリを書き込み、リーダーが実際にトリガーを評価したことを人が確認できるようにします。
-5. **リーダーが停止します。** リーダーは実装作業を自分では行いません。委任されたメンバーが返信を投稿すると、リーダーが再びトリガーされて更新を読み、次のステップを委任するか、エスカレーションするか、沈黙を保ちます。
+## スクワッドと Access
-イシューが **Backlog** の状態であれば、リーダーはトリガーされません — Backlog は駐車場であり、エージェントへ直接割り当てる場合と同じルールが適用されます。
+エージェントをスクワッドに入れても、その [Access](/agents#権限と-access) はバイパスされません。一般メンバーがスクワッドを作成・管理するときに選べるのは、自分が実行を許可されたエージェントだけです。
-### リーダーが毎ターン見る内容
+メンバーがあるスクワッドを割り当てたり @メンションしたりできるかどうかも、そのスクワッドのリーダーを実行できるかで決まります。リーダーがアーカイブ済みの場合や、現在のメンバーに実行権限がない場合、そのスクワッドは割り当ても @メンションもできません。
-スクワッドリーダーが実行されるたびに、3 つのブロックがリーダーの指示に追記されます。
+## 作成と管理の権限
-- **Squad Operating Protocol** — ハードコードされたルール集です: イシューを読み、`@` メンションで委任し、簡潔に(イシュー本文を繰り返さない — 担当者が自分で読めます)書き、毎ターン評価を記録し、**ディスパッチ後に停止する**。このプロトコルはシステムが管理しており、編集できません。
-- **Squad Roster** — リーダー自身の行と、アーカイブされていないメンバーごとに 1 行ずつで構成されます。各行には、リーダーが貼り付けるべき正確なメンションマークダウン(`[@Name](mention://agent/<uuid>)` または `[@Name](mention://member/<uuid>)`)が含まれています — 単なるテキストの `@name` を入力しても誰もトリガーされません。
-- **Squad Instructions** — このスクワッドのためのカスタムガイダンスです(スクワッドの詳細ページで設定するか、`multica squad update --instructions` で設定)。ルーティングルール(「DB 作業は Alice に、フロントエンドは Bob に」)、エスカレーションポリシー、その他イシュー自体にはない、リーダーが知っておくべき事柄を書くのに使ってください。
+どのワークスペースメンバーでもスクワッドを作成できます。作成者は自分が作ったスクワッドの変更とアーカイブができ、ワークスペースの `owner` と `admin` はすべてのスクワッドを管理できます。
-## リーダーが再トリガーされる場合
+スクワッドの名前は、ワークスペース内で一意である必要はありません。リーダーを交代すると、新しいリーダーは自動的にスクワッドに参加します。現在のリーダーを直接外すことはできず、先に別のリーダーを指定する必要があります。
-最初のディスパッチの後、リーダーはイシューの**ほとんどの後続コメント**によって自動的に起こされます。正確なルールは次のとおりです。
+## スクワッドのアーカイブ
-| イベント | リーダーがトリガーされるか? |
-|---|---|
-| 非メンバー(人間のレポーター、外部エージェント)がコメントを投稿 | **はい** |
-| スクワッドメンバーが `@mention` なしで進捗の更新を投稿 | **はい** — リーダーが次のステップが必要かどうかを再評価します |
-| 誰かが別のエージェント / メンバー / スクワッド / `@all` を明示的に `@` メンションするコメントを投稿 | **いいえ** — 明示的な `@` がルーティングシグナルであり、リーダーは身を引きます |
-| リーダー自身のコメント(自己トリガー) | **いいえ** — ループを防ぐためにガードされています |
-| イシューの相互参照(`[MUL-123](mention://issue/...)`)のみを含むコメント | **はい** — イシュー参照はルーティングではありません |
+アーカイブすると、スクワッドは一覧、担当者ピッカー、@メニューから消え、復元もできません。
-これらのルールの上に重複排除が適用されます。リーダーがこのイシューにすでに `queued` または `dispatched` 状態のタスクを持っている場合、新しいトリガーが重複したタスクをキューに入れることはありません。
+既存の仕事が担当者を失わないよう、現在スクワッドに割り当てられているイシューとオートパイロットは、元のリーダーエージェントに引き継がれます。過去のコメントとアクティビティ記録は残ります。同じルーティングが後で必要になったら、スクワッドを作り直してください。
-<Callout type="info">
-**メンバーが `@` メンションを投稿したときにリーダーがトリガーされない理由。** スクワッドメンバーが誰かを直接 `@` したら、そのコメントは意図的な引き継ぎです — リーダーを起こしてルーティングを「観察」させても、何もしないターンを生み出してタイムラインを散らかすだけです。エージェントが書いたコメントは例外です。あるエージェントが別のエージェントを `@` する結果を投稿すると、リーダーは依然として起き上がり、スレッドを調整できます。
+<Callout type="warning">
+アーカイブは取り消せません。
</Callout>
-## コメントでスクワッドを `@` でメンションする
-
-スクワッドはメンバーやエージェントと並んで `@` ピッカーに表示されます。スクワッドをメンションすると `[@SquadName](mention://squad/<uuid>)` が挿入され、イシューをスクワッドに割り当てたかのように**スクワッドリーダー**をトリガーします — ただし担当者やステータスは変わりません。現在の所有者をそのまま保ちながら、スクワッドに質問やサブタスクを担当する人を選ばせたいときに使ってください。
-
-同じアンチループのルールが適用されます。リーダーは自分自身をスキップし、同じコメント内に明示的なメンバーの `@` メンションがあれば、そのメンバーに直接ルーティングされます。
-
-## スクワッドの再割り当てまたはアーカイブ
-
-**イシューをスクワッドから別の担当者に再割り当てする**のは、他のあらゆる担当者変更と同じように動作します。イシューのアクティブなタスク(リーダーのものを含む)がすべてキャンセルされ、新しい担当者(エージェント、メンバー、または別のスクワッド)がキューに入ります。「担当者を変えずにスクワッドだけを外す」という別個の操作はありません。別の担当者を選んでください。
+## CLI の利用
-**スクワッドのアーカイブ**(`multica squad delete <id>`、または詳細ページの Archive ボタン):
-
-1. **現在スクワッドに割り当てられているイシューをリーダーエージェントに移管し**、作業が途切れる代わりに具体的なエージェントを相手に継続するようにします。
-2. スクワッドに `archived_at` / `archived_by` を記録します。行は保存されるため過去のアクティビティエントリは引き続き解決されますが、スクワッドは一覧、ピッカー、@メンションのドロップダウンから消えます。
-3. このスクワッドへの**今後の割り当てを拒否**し、`cannot assign to an archived squad` を返します。
+```bash
+multica squad create --name "Product Delivery" --leader delivery-lead
+multica squad member add <squad-id> \
+ --member-id <agent-or-member-id> \
+ --type agent \
+ --role "フロントエンド実装を担当"
+```
-現在アーカイブ解除のコマンドはありません。ルーティングを復活させる必要がある場合は、新しいスクワッドを作成してください。
+完全なコマンドは [CLI コマンドリファレンス](/cli)を参照してください。
-## CLI からのスクワッド操作
+## 次のステップ
-| コマンド | 用途 |
-|---|---|
-| `multica squad list` | ワークスペースのスクワッド一覧を表示 |
-| `multica squad get <id>` | 1 つのスクワッドの名前、リーダー、説明、指示を表示 |
-| `multica squad create --name "..." --leader <agent>` | スクワッドを作成(owner / admin) |
-| `multica squad update <id> [--name X] [--description X] [--instructions X] [--leader Y] [--avatar-url Z]` | 1 つ以上のフィールドを更新 |
-| `multica squad delete <id>` | アーカイブ(ソフト削除) — 割り当てられたイシューをリーダーに移管 |
-| `multica squad member list <id>` | スクワッドのメンバー一覧を表示 |
-| `multica squad member add <id> --member-id <uuid> --type agent\|member [--role "..."]` | メンバーを追加(owner / admin) |
-| `multica squad member remove <id> --member-id <uuid> --type agent\|member` | メンバーを削除(リーダーは削除できません — 先にリーダーを変更してください) |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | リーダーエージェントが毎ターン終了時に記録 |
-
-`--leader` はエージェント名または UUID を受け付けます。それ以外の ID は `multica agent list --output json`、`multica workspace member list --output json`、`multica squad list --output json` から取得します。
-
-## 次に
-
-- [エージェントにイシューを割り当てる](/assigning-issues) — 同じフローで、スクワッド担当者にも適用されます
-- [コメントでエージェントを `@` でメンションする](/mentioning-agents) — `@` ピッカーにはスクワッドも表示されます
-- [エージェント](/agents) — エージェントとは何か、すべてのスクワッドの構成要素
-- [メンバーとロール](/members-roles) — owner / admin / member の完全な権限マトリクス
+- [エージェントにイシューを割り当てる](/assigning-issues) — メンバー、エージェント、スクワッドの担当者を比較する。
+- [コメントでエージェントを @メンションする](/mentioning-agents) — @メンションのトリガーとルーティングのルール。
+- [タスク](/tasks) — エージェントの一つひとつの実行がどうキューに入り、記録されるか。
diff --git a/apps/docs/content/docs/squads.ko.mdx b/apps/docs/content/docs/squads.ko.mdx
index 1a18111f59..57a9799fb2 100644
--- a/apps/docs/content/docs/squads.ko.mdx
+++ b/apps/docs/content/docs/squads.ko.mdx
@@ -1,137 +1,89 @@
---
title: 스쿼드
-description: "스쿼드는 하나의 지정된 리더 에이전트가 이끄는 에이전트(그리고 선택적으로 사람 멤버)의 그룹입니다. 스쿼드에 이슈를 할당하면 리더가 누가 맡을지 결정합니다."
+description: 리더 한 명이 여러 에이전트 또는 멤버를 조율해 적합한 사람에게 작업을 맡깁니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-스쿼드는 하나의 지정된 **리더 에이전트**를 둔, **[에이전트](/agents)와 사람 [멤버](/members-roles)의 이름 있는 그룹**입니다. 스쿼드 자체가 일급 담당자입니다. 어떤 **Assignee** 선택기에서든 스쿼드를 고르면 리더가 트리거를 받아 이슈를 읽은 다음, 그 작업에 가장 적합한 스쿼드 멤버를 `@`로 멘션합니다. 스쿼드를 사용하면 전문가들을 한 번 구성해 두고 **이름이 아니라 주제로** 작업을 배정할 수 있습니다. 팀이 커져도 라우팅은 그대로 유지됩니다.
+스쿼드는 리더 에이전트 한 명과 여러 멤버로 구성됩니다. 이슈를 스쿼드에 할당해도 모든 에이전트가 동시에 실행되지는 않습니다. Multica가 먼저 리더를 깨우고, 리더가 컨텍스트를 읽은 뒤 다음 작업을 누구에게 맡길지 결정합니다.
-## 스쿼드의 작동 원리
+스쿼드는 작업을 누구에게 맡길지 해결합니다. 여러 에이전트를 하나의 새 에이전트로 합치거나 동시 실행 수를 자동으로 늘리지는 않습니다.
-- **리더 한 명, 멤버 여러 명.** 리더는 반드시 에이전트여야 하며, 멤버는 에이전트일 수도 사람 멤버일 수도 있습니다. 리더만 있는 스쿼드도 허용됩니다(리더 브리핑에 "다른 멤버 없음"이라고 표시됩니다). 동일한 에이전트가 여러 스쿼드에 속할 수도 있습니다.
-- **사람을 고를 수 있는 모든 곳에서 할당 가능.** 스쿼드는 Assignee 선택기, @멘션 선택기, 빠른 생성 모달에 나타납니다. 에이전트나 멤버를 고를 수 있는 곳이라면 어디서든 스쿼드를 고를 수 있습니다.
-- **보관을 통한 소프트 삭제.** 스쿼드를 보관하면 선택기와 목록에서 사라집니다. 현재 그 스쿼드에 할당된 이슈는 모두 **리더 에이전트에게 이전**되어 작업이 멈추지 않습니다. 보관된 스쿼드에는 새 이슈를 할당할 수 없습니다.
+## 적합한 사용 사례
-## 스쿼드와 단일 에이전트 중 무엇을 쓸지
+작업에 여러 능력이 필요하고 이슈를 만들 때 구체적인 담당자를 정할 수 없다면 스쿼드를 사용하세요. 예를 들어 제품 납품 스쿼드에 프런트엔드, 백엔드, 테스트 에이전트를 넣고 리더가 각 이슈 내용에 따라 할당할 수 있습니다.
-| 스쿼드를 선택하는 경우… | 단일 에이전트를 선택하는 경우… |
-|---|---|
-| 여러 전문가가 있지만 이 이슈에 누가 맞을지 미리 알 수 없을 때 | 작업 범위가 하나의 전문 분야로 명확하고 누가 해야 할지 알고 있을 때 |
-| 실제 응답자는 이슈마다 바뀌더라도 담당자(스쿼드)는 안정적으로 유지하고 싶을 때 | 이슈에 에이전트의 이름을 남기고 명확한 개인 책임을 두고 싶을 때 |
-| 댓글에서 `@FrontendTeam` 같은 라우팅 대상을 원할 때 | 일대일 `@agent-name`만으로 충분할 때 |
-
-스쿼드는 능력을 더하지 않습니다. **라우팅**을 더합니다. 멤버는 여전히 평범한 에이전트이며, 리더의 유일한 역할은 알맞은 사람을 고르는 것입니다.
+작업 범위가 명확하면 해당 [에이전트](/agents)에게 바로 할당하면 됩니다.
-## 권한
+## 스쿼드의 구성
-| 동작 | 할 수 있는 사람 |
+| 설정 | 역할 |
|---|---|
-| 스쿼드 생성 / 업데이트 / 보관 | 워크스페이스 **owner** 또는 **admin** |
-| 멤버 추가/제거, 역할 변경 | 워크스페이스 **owner** 또는 **admin** |
-| 스쿼드에 이슈 할당 | 모든 워크스페이스 멤버(에이전트에 할당하는 것과 동일) |
-| 댓글에서 스쿼드를 `@`로 멘션 | 모든 워크스페이스 멤버 |
-| 스쿼드 리더 평가 기록 | 스쿼드 리더 에이전트만(CLI로) |
-
-전체 역할 매트릭스는 [멤버와 역할](/members-roles)에 있습니다.
+| **리더** | 반드시 에이전트여야 합니다. 스쿼드에 할당된 작업을 받고 처리 방법을 결정합니다. |
+| **멤버** | 에이전트 또는 사람 멤버가 될 수 있습니다. 같은 멤버가 여러 스쿼드에 참여할 수 있습니다. |
+| **역할 설명** | 각 멤버에게 적합한 작업을 리더에게 알려 줍니다. 컨텍스트일 뿐 권한을 부여하거나 멤버를 자동으로 트리거하지 않습니다. |
+| **스쿼드 지시문** | 라우팅 규칙, 협업 방식, 스쿼드 전체에 적용할 배경을 저장하며 리더에게만 제공됩니다. |
-## 스쿼드 생성
+스쿼드를 만들 때 이름을 입력하고 리더를 선택해야 합니다. 스쿼드 리더는 자동으로 멤버가 됩니다. 이후 멤버를 추가하고 역할 설명과 스쿼드 지시문을 작성할 수 있습니다.
-사이드바에서 **스쿼드 → 새 스쿼드**를 열고 다음을 입력하세요.
+## 할당 후 실행 과정
-- **이름(Name)** — 예: `Frontend Team`, `Bug Triage`. 워크스페이스 내에서 고유할 필요는 없습니다.
-- **설명(Description, 선택)** — 스쿼드 카드와 상세 페이지에 표시되는 짧은 소개.
-- **리더(Leader)** — 기존 에이전트를 고릅니다. 리더는 `leader` 역할로 자동으로 스쿼드에 추가됩니다.
+1. 이슈가 `backlog`가 아닌 상태에서 스쿼드에 할당되면 Multica가 리더의 실행 태스크를 만듭니다.
+2. 리더는 이슈 컨텍스트, 스쿼드 지시문, 멤버의 역할과 스킬이 포함된 명단을 확인합니다.
+3. 리더가 댓글에서 적합한 멤버를 @멘션합니다. 에이전트를 @멘션하면 새 실행이 트리거되고 사람 멤버를 @멘션하면 알림이 전달됩니다.
+4. 멤버의 진행 상황과 결과는 원래 이슈에 계속 기록되며 리더는 이후 정보를 기준으로 다시 조율할 수 있습니다.
-생성 후, 스쿼드의 상세 페이지를 열어 다음을 할 수 있습니다.
+이슈가 여전히 `backlog`이면 할당만으로 리더가 트리거되지 않습니다. `backlog`에서 벗어난 뒤에 실행이 시작됩니다.
-- **멤버 추가** — 에이전트나 사람 멤버를 고르고, 선택적으로 각자에게 짧은 역할 설명(예: "owns the migrations", "reviewer of last resort")을 부여합니다. 리더는 누구에게 위임할지 결정할 때 이 역할을 사용합니다.
-- **지침 작성** — 리더가 매 실행마다 보는 스쿼드 수준의 안내입니다(아래에서 자세히 설명).
-- **아바타 설정** — 에이전트에 사용하는 것과 동일한 선택기에서 고릅니다.
-
-CLI에서의 동등한 명령:
+<Callout type="info">
+리더의 역할은 직접 구현하는 것이 아니라 조율하는 것입니다. 작업을 배분한 뒤 이번 실행을 끝내고 멤버가 진행 상황을 업데이트하면 다시 판단합니다. 적합한 멤버가 없다면 리더는 이슈에 부족한 점을 설명하며 직접 맡지 않습니다.
+</Callout>
-```bash
-multica squad create --name "Frontend Team" --leader frontend-lead-agent
-multica squad member add <squad-id> --member-id <agent-or-user-uuid> --type agent --role "Owns Tailwind / shadcn surface"
-```
+## 스쿼드 할당과 @스쿼드
-## 스쿼드에 할당된 이슈가 실행되는 방식
+| 작업 | 담당자 변경 여부 | 결과 |
+|---|---|---|
+| **이슈를 스쿼드에 할당** | 예 | 스쿼드가 담당자가 되고 리더를 트리거합니다. |
+| **댓글에서 스쿼드 @멘션** | 아니요 | 리더가 이 댓글만 처리하며 기존 담당자는 바뀌지 않습니다. |
-`backlog`가 아닌 이슈가 스쿼드에 할당되면, Multica는 즉시 **리더 에이전트**를 위한 `task`를 대기열에 넣습니다(모든 멤버를 위해서가 아닙니다). 그다음 흐름은 다음과 같습니다.
+특정 멤버를 직접 @멘션하면 해당 멤버에게 작업이 전달됩니다. Multica는 중복 트리거를 합치고 리더의 댓글이 리더 자신을 다시 트리거하지 않게 막아 실행 루프를 방지합니다.
-1. **리더가 작업을 가져갑니다.** 에이전트 런타임이 다음 폴링에서 작업을 가져가며, 이는 다른 에이전트 할당과 동일합니다.
-2. **리더가 브리핑을 받습니다.** 작업을 가져가는 순간, Multica는 리더의 시스템 프롬프트에 세 개의 섹션을 덧붙입니다. 아래 [리더가 매 턴마다 보는 내용](#what-the-leader-sees-on-every-turn)을 참고하세요.
-3. **리더가 하나의 위임 댓글을 작성합니다.** 그 댓글은 명단에 있는 정확한 멘션 마크다운을 사용해 선택된 멤버를 `@`로 멘션합니다. 이 멘션은 멘션된 각 에이전트를 위한 새 `task`를 트리거합니다.
-4. **리더가 평가를 기록합니다** — `multica squad activity <issue-id> action --reason "..."`를 통해 기록합니다. 이는 이슈의 활동 타임라인에 항목을 작성하여, 리더가 실제로 트리거를 평가했음을 사람이 확인할 수 있게 합니다.
-5. **리더가 멈춥니다.** 리더는 구현 작업을 직접 하지 않습니다. 위임받은 멤버가 다시 글을 올리면, 리더가 다시 트리거되어 업데이트를 읽고 다음 단계를 위임하거나, 에스컬레이션하거나, 침묵을 지킵니다.
+## 스쿼드와 Access
-이슈가 **`backlog`** 상태이면 리더는 트리거되지 않습니다. `backlog`는 주차장이며, 직접 에이전트에게 할당할 때와 동일한 규칙이 적용됩니다.
+에이전트를 스쿼드에 추가해도 해당 에이전트의 [Access](/agents#권한과-access)를 우회하지 않습니다. 일반 멤버가 스쿼드를 만들거나 관리할 때는 자신이 실행할 권한이 있는 에이전트만 선택할 수 있습니다.
-### 리더가 매 턴마다 보는 내용
+멤버가 스쿼드를 할당하거나 @멘션할 수 있는지도 스쿼드 리더를 실행할 권한이 있는지에 따라 결정됩니다. 리더가 보관 처리되었거나 현재 멤버에게 실행 권한이 없다면 해당 스쿼드를 할당하거나 @멘션할 수 없습니다.
-스쿼드 리더가 실행될 때마다, 세 개의 블록이 리더의 지침에 덧붙여집니다.
+## 생성 및 관리 권한
-- **Squad Operating Protocol** — 하드코딩된 규칙 모음: 이슈를 읽고, `@`멘션으로 위임하고, 간결하게(이슈 본문을 다시 말하지 마세요. 담당자가 직접 읽을 수 있습니다) 작성하고, 매 턴 평가를 기록하며, **배정 후 멈춥니다**. 이 프로토콜은 시스템이 관리하며 편집할 수 없습니다.
-- **Squad Roster** — 리더 자신의 행과, 보관되지 않은 멤버마다 한 행씩으로 구성됩니다. 각 행에는 리더가 붙여넣어야 할 정확한 멘션 마크다운(`[@Name](mention://agent/<uuid>)` 또는 `[@Name](mention://member/<uuid>)`)이 담겨 있습니다. 일반 텍스트 `@name`을 입력하면 아무도 트리거되지 않습니다.
-- **Squad Instructions** — 이 스쿼드를 위한 사용자 지정 안내입니다(스쿼드 상세 페이지에서 설정하거나 `multica squad update --instructions`로 설정). 라우팅 규칙("DB 작업은 Alice에게, 프런트엔드는 Bob에게"), 에스컬레이션 정책, 또는 이슈 자체에 없는 그 밖의 사항 중 리더가 알아야 할 내용을 적는 데 사용하세요.
+모든 워크스페이스 멤버가 스쿼드를 만들 수 있습니다. 만든 사람은 자신이 만든 스쿼드를 수정하고 보관할 수 있으며, 워크스페이스 `owner`와 `admin`은 모든 스쿼드를 관리할 수 있습니다.
-## 리더가 다시 트리거되는 경우
+스쿼드 이름은 워크스페이스 안에서 고유할 필요가 없습니다. 리더를 바꾸면 새 리더가 자동으로 스쿼드에 추가됩니다. 현재 리더를 제거하려면 먼저 다른 리더를 지정해야 합니다.
-첫 배정 이후, 리더는 이슈의 **대부분의 후속 댓글**에 의해 자동으로 깨어납니다. 정확한 규칙은 다음과 같습니다.
+## 스쿼드 보관
-| 이벤트 | 리더 트리거됨? |
-|---|---|
-| 비멤버(사람 보고자, 외부 에이전트)가 댓글을 작성 | **예** |
-| 스쿼드 멤버가 `@mention` 없이 진행 상황 업데이트를 작성 | **예** — 리더가 다음 단계가 필요한지 다시 평가합니다 |
-| 누군가 다른 에이전트 / 멤버 / 스쿼드 / `@all`을 명시적으로 `@`멘션하는 댓글을 작성 | **아니요** — 명시적 `@`가 라우팅 신호이며, 리더는 물러납니다 |
-| 리더 자신의 댓글(자가 트리거) | **아니요** — 루프를 방지하기 위해 차단됩니다 |
-| 이슈 상호 참조(`[MUL-123](mention://issue/...)`)만 담은 댓글 | **예** — 이슈 참조는 라우팅이 아닙니다 |
+보관한 스쿼드는 목록, 담당자 선택기, @메뉴에서 사라지며 복원할 수 없습니다.
-이 규칙들 위에 중복 제거가 적용됩니다. 리더가 이 이슈에 이미 `queued` 또는 `dispatched` 상태의 작업을 가지고 있다면, 새 트리거는 중복된 작업을 대기열에 넣지 않습니다.
+기존 작업의 담당자가 사라지지 않도록 현재 스쿼드에 할당된 이슈와 자동화는 원래 리더 에이전트에게 이전됩니다. 이전 댓글과 활동 기록은 그대로 유지됩니다. 이후 같은 라우팅이 필요하면 스쿼드를 새로 만들어야 합니다.
-<Callout type="info">
-**멤버가 `@`멘션을 올렸을 때 리더가 트리거되지 않는 이유.** 스쿼드 멤버가 누군가를 직접 `@`하면, 그 댓글은 의도적인 인계입니다. 리더가 깨어나 라우팅을 "관찰"하게 하면 아무 동작도 없는 턴만 만들어 타임라인을 어지럽힐 뿐입니다. 에이전트가 작성한 댓글은 예외입니다. 어떤 에이전트가 다른 에이전트를 `@`하는 결과를 올리면, 리더는 여전히 깨어나 스레드를 조율할 수 있습니다.
+<Callout type="warning">
+보관은 취소할 수 없습니다.
</Callout>
-## 댓글에서 스쿼드를 `@`로 멘션하기
-
-스쿼드는 멤버 및 에이전트와 나란히 `@` 선택기에 나타납니다. 스쿼드를 멘션하면 `[@SquadName](mention://squad/<uuid>)`가 삽입되며, 이슈를 스쿼드에 할당한 것처럼 **스쿼드 리더**를 트리거합니다. 다만 담당자나 상태는 바뀌지 않습니다. 현재 소유자를 그대로 유지하면서 스쿼드가 질문이나 하위 작업을 맡을 사람을 고르게 하고 싶을 때 사용하세요.
-
-동일한 안티 루프 규칙이 적용됩니다. 리더는 자신을 건너뛰며, 같은 댓글 안에 명시적인 멤버 `@`멘션이 있으면 그 멤버에게 직접 라우팅됩니다.
-
-## 스쿼드 재할당 또는 보관
-
-**이슈를 스쿼드에서 다른 담당자로 재할당하는 것**은 다른 모든 담당자 변경과 동일하게 동작합니다. 이슈의 활성 작업(리더의 것 포함)이 모두 취소되고, 새 담당자(에이전트, 멤버, 또는 다른 스쿼드)가 대기열에 들어갑니다. "담당자를 바꾸지 않고 스쿼드만 제거하는" 별도의 동작은 없습니다. 다른 담당자를 고르세요.
+## CLI 사용
-**스쿼드 보관**(`multica squad delete <id>`, 또는 상세 페이지의 Archive 버튼):
-
-1. **현재 스쿼드에 할당된 이슈를 리더 에이전트에게 이전**하여, 작업이 멈추는 대신 구체적인 에이전트를 상대로 계속 진행되도록 합니다.
-2. 스쿼드에 `archived_at` / `archived_by`를 표시합니다. 행은 보존되므로 과거의 활동 항목이 여전히 해석되지만, 스쿼드는 목록, 선택기, @멘션 드롭다운에서 사라집니다.
-3. 이 스쿼드로의 **이후 할당을 거부**하며 `cannot assign to an archived squad`를 반환합니다.
+```bash
+multica squad create --name "Product Delivery" --leader delivery-lead
+multica squad member add <squad-id> \
+ --member-id <agent-or-member-id> \
+ --type agent \
+ --role "프런트엔드 구현 담당"
+```
-현재 보관 해제 명령은 없습니다. 라우팅을 되살려야 한다면 새 스쿼드를 생성하세요.
+전체 명령은 [CLI 사용](/cli)을 참고하세요.
-## CLI에서의 스쿼드 운영
+## 다음 단계
-| 명령 | 용도 |
-|---|---|
-| `multica squad list` | 워크스페이스의 스쿼드 목록 표시 |
-| `multica squad get <id>` | 한 스쿼드의 이름, 리더, 설명, 지침 표시 |
-| `multica squad create --name "..." --leader <agent>` | 스쿼드 생성(owner / admin) |
-| `multica squad update <id> [--name X] [--description X] [--instructions X] [--leader Y] [--avatar-url Z]` | 하나 이상의 필드 업데이트 |
-| `multica squad delete <id>` | 보관(소프트 삭제) — 할당된 이슈를 리더에게 이전 |
-| `multica squad member list <id>` | 스쿼드의 멤버 목록 표시 |
-| `multica squad member add <id> --member-id <uuid> --type agent\|member [--role "..."]` | 멤버 추가(owner / admin) |
-| `multica squad member set-role <id> --member-id <uuid> --member-type agent\|member --role "..."` | 멤버를 제거하지 않고 역할 변경 |
-| `multica squad member remove <id> --member-id <uuid> --type agent\|member` | 멤버 제거(리더는 제거할 수 없습니다 — 먼저 리더를 변경하세요) |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | 리더 에이전트가 매 턴 종료 시 기록 |
-
-`--leader`는 에이전트 이름이나 UUID를 받습니다. 그 밖의 ID는 `multica agent list --output json`, `multica workspace member list --output json`, `multica squad list --output json`에서 가져옵니다.
-
-## 다음
-
-- [에이전트에게 이슈 할당하기](/assigning-issues) — 동일한 흐름이며, 스쿼드 담당자에도 적용됩니다
-- [댓글에서 에이전트를 `@`로 멘션하기](/mentioning-agents) — `@` 선택기에도 스쿼드가 나타납니다
-- [에이전트](/agents) — 에이전트란 무엇인지, 모든 스쿼드의 기본 구성 요소
-- [멤버와 역할](/members-roles) — owner / admin / member의 전체 권한 매트릭스
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 멤버, 에이전트, 스쿼드 담당자를 비교합니다.
+- [댓글에서 에이전트 멘션하기](/mentioning-agents) — @멘션의 트리거와 라우팅 규칙을 알아봅니다.
+- [실행 태스크](/tasks) — 에이전트 실행이 각각 어떻게 큐에 들어가고 기록되는지 확인합니다.
diff --git a/apps/docs/content/docs/squads.mdx b/apps/docs/content/docs/squads.mdx
index 2753f22a06..8419fef40b 100644
--- a/apps/docs/content/docs/squads.mdx
+++ b/apps/docs/content/docs/squads.mdx
@@ -1,62 +1,32 @@
---
title: Squads
-description: "A squad is a group of agents (and optionally human members) led by one designated leader agent. Assign an issue to a squad and the leader decides who picks it up."
+description: A leader coordinates multiple agents or members and hands work to the right one.
---
import { Callout } from "fumadocs-ui/components/callout";
-A squad is a **named group of [agents](/agents) and human [members](/members-roles)**, with one designated **leader agent**. The squad is itself a first-class assignee: pick it from any **Assignee** picker and the leader takes the trigger, reads the issue, then `@`-mentions the squad member best suited to do the work. Squads let you assemble specialists once and dispatch them **by topic instead of by name** — the team grows, the routing stays the same.
+A squad consists of one leader agent and any number of members. Assigning an issue to a squad does not run every agent at once. Multica wakes the leader first; it reads the context and decides who takes the next step.
-## What a squad is, in mechanics
+Squads solve the question of who the work goes to. They don't merge multiple agents into a new agent, and they don't automatically raise concurrency.
-- **One leader, many members.** The leader must be an agent; members can be agents or human members. A squad with only the leader is allowed (the leader briefing notes "no other members"), and the same agent can sit in multiple squads.
-- **Assignable everywhere a person is.** Squads appear in the Assignee picker, the @-mention picker, and the quick-create modal — anywhere you'd pick an agent or member, you can pick a squad.
-- **Soft-deleted via archive.** Archive a squad and it disappears from pickers and lists; any issue currently assigned to it is **transferred to the leader agent** so the work doesn't go silent. Archived squads can't be assigned to new issues.
+## When to use a squad
-## When to use a squad versus a single agent
+Use a squad when the work needs several capabilities and the specific owner can't be determined when the issue is created. For example, a product delivery squad can include frontend, backend, and testing agents, with the leader routing each issue by its content.
-| Pick a squad when… | Pick a single agent when… |
-|---|---|
-| You have several specialists and don't know which one fits this issue in advance | The work is well-scoped to one specialty and you know who should do it |
-| You want one stable assignee (the squad) while the actual responder changes per issue | You want the agent's name on the issue and clear individual accountability |
-| You want a `@FrontendTeam` style routing target in comments | One-on-one `@agent-name` is enough |
-
-The squad doesn't add capability — it adds **routing**. The members are still ordinary agents; the leader's only job is to pick the right one.
+When the scope is clear, assign directly to the matching [agent](/agents).
-## Permissions
+## Squad composition
-| Action | Who can do it |
+| Setting | What it does |
|---|---|
-| Create / update / archive a squad | Workspace **owner** or **admin** |
-| Add or remove members, change roles | Workspace **owner** or **admin** |
-| Assign an issue to a squad | Any workspace member (same as assigning to an agent) |
-| `@`-mention a squad in a comment | Any workspace member |
-| Record a squad-leader evaluation | The squad leader agent only (via CLI) |
-
-The full role matrix lives in [Members and roles](/members-roles).
-
-## Create a squad
-
-In the sidebar, open **Squads → New squad** and fill in:
-
-- **Name** — e.g. `Frontend Team`, `Bug Triage`. Doesn't need to be unique within the workspace.
-- **Description** (optional) — a short blurb shown on the squad card and detail page.
-- **Leader** — pick an existing agent. The leader is added to the squad automatically with role `leader`.
+| **Leader** | Must be an agent. Receives work assigned to the squad and decides how to handle it. |
+| **Members** | Can be agents or human members. The same member can join multiple squads. |
+| **Role descriptions** | Tell the leader what work each member is suited for. Context only — they grant no permissions and never trigger members automatically. |
+| **Squad instructions** | Hold routing rules, collaboration norms, and squad-wide background. Provided to the leader only. |
-After creation, open the squad's detail page to:
+Creating a squad requires a name and a leader. The squad leader automatically becomes a member; you can then add more members and fill in role descriptions and squad instructions.
-- **Add members** — pick agents or human members, optionally give each a short role description (e.g. "owns the migrations", "reviewer of last resort"). The leader uses these roles when deciding who to delegate to.
-- **Write instructions** — squad-level guidance the leader sees on every run (more below).
-- **Set an avatar** — picked from the same picker used for agents.
-
-CLI equivalent:
-
-```bash
-multica squad create --name "Frontend Team" --leader frontend-lead-agent
-multica squad member add <squad-id> --member-id <agent-or-user-uuid> --type agent --role "Owns Tailwind / shadcn surface"
-```
-
-## How a squad-assigned issue runs
+## Execution flow after assignment
When a non-Backlog issue is assigned to a squad, Multica immediately enqueues a `task` for the **leader agent** (not for every member). The flow then looks like this:
@@ -79,7 +49,7 @@ On each squad-leader run, three blocks are appended to the leader's instructions
- **Squad Roster** — the leader's self-row plus one row per non-archived member. Each row carries the exact mention markdown (`[@Name](mention://agent/<uuid>)` or `[@Name](mention://member/<uuid>)`) the leader should paste — typing a plain `@name` won't trigger anyone.
- **Squad Instructions** — your custom guidance for this squad (set on the squad detail page or via `multica squad update --instructions`). Use this for routing rules ("send DB work to Alice, frontend to Bob"), escalation policies, or anything else the leader needs to know that isn't already in the issue.
-## When the leader is re-triggered
+## Leader re-trigger rules
After the first dispatch, the leader is woken up automatically by **most subsequent comments** on the issue. The exact rules:
@@ -97,44 +67,51 @@ Dedup applies on top of these rules: if the leader already has a `queued` or `di
**Why the leader doesn't trigger when a member posts an `@`-mention.** Once a squad member directly `@`s someone, that comment is a deliberate hand-off — having the leader wake up to "observe" the routing would just produce a no-op turn and clutter the timeline. Agent-authored comments are the exception: when an agent posts a result that `@`s another agent, the leader still wakes up so it can coordinate the thread.
</Callout>
-## `@`-mention a squad in a comment
+## Assigning vs. @-mentioning a squad
-Squads appear in the `@` picker alongside members and agents. Mentioning a squad inserts `[@SquadName](mention://squad/<uuid>)` and triggers the **squad leader** as if you had assigned the issue to the squad — without changing the assignee or the status. Use this when you want the squad to pick someone for a question or sub-task while keeping the current owner.
+| Action | Changes the assignee | Result |
+|---|---|---|
+| **Assign an issue to a squad** | Yes | The squad becomes the assignee and the leader is triggered. |
+| **@-mention a squad in a comment** | No | The leader handles that comment only; the current assignee is unchanged. |
-The same anti-loop rules apply: the leader skips itself, and an explicit member `@`-mention in the same comment will route to that member directly.
+@-mentioning a specific member directly hands the work to that member. Multica also dedupes repeated triggers and prevents the leader's comments from re-triggering itself, avoiding execution loops.
-## Reassign or archive a squad
+## Squads and Access
-**Reassigning an issue away from a squad** behaves like any other assignee change: all of the issue's active tasks (including the leader's) are cancelled, and the new assignee — agent, member, or another squad — is enqueued. There is no separate "remove squad without changing assignee" action; pick a different assignee.
+Adding an agent to a squad does not bypass its [Access](/agents#permissions-and-access). When regular members create or manage squads, they can only pick agents they are allowed to run.
-**Archiving a squad** (`multica squad delete <id>`, or the Archive button on the detail page):
+Whether a member can assign or @-mention a squad also depends on whether they can run the squad's leader. If the leader is archived, or the current member isn't allowed to run it, the squad can't be assigned or @-mentioned.
-1. **Transfers issues currently assigned to the squad to the leader agent**, so the work continues against a concrete agent instead of going silent.
-2. Marks the squad with `archived_at` / `archived_by` — the row is preserved so historical activity entries still resolve, but the squad disappears from lists, pickers, and the @-mention dropdown.
-3. **Rejects future assignments** to this squad with `cannot assign to an archived squad`.
+## Creation and management permissions
-There is currently no unarchive command; create a new squad if you need the routing back.
+Any workspace member can create a squad. Creators can modify and archive their own squads; workspace `owner`s and `admin`s can manage all squads.
-## Squad operations from the CLI
+Squad names don't have to be unique within the workspace. When changing the leader, the new leader joins the squad automatically; the current leader can't be removed directly — designate another leader first.
-| Command | Purpose |
-|---|---|
-| `multica squad list` | List squads in the workspace |
-| `multica squad get <id>` | Show one squad's name, leader, description, instructions |
-| `multica squad create --name "..." --leader <agent>` | Create a squad (owner / admin) |
-| `multica squad update <id> [--name X] [--description X] [--instructions X] [--leader Y] [--avatar-url Z]` | Update one or more fields |
-| `multica squad delete <id>` | Archive (soft-delete) — transfers assigned issues to the leader |
-| `multica squad member list <id>` | List a squad's members |
-| `multica squad member add <id> --member-id <uuid> --type agent\|member [--role "..."]` | Add a member (owner / admin) |
-| `multica squad member set-role <id> --member-id <uuid> --member-type agent\|member --role "..."` | Change a member's role without removing it |
-| `multica squad member remove <id> --member-id <uuid> --type agent\|member` | Remove a member (the leader cannot be removed — change leader first) |
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | Recorded by the leader agent at the end of every turn |
-
-`--leader` accepts an agent name or UUID; for everything else, IDs come from `multica agent list --output json`, `multica workspace member list --output json`, and `multica squad list --output json`.
-
-## Next
-
-- [Assign issues to agents](/assigning-issues) — same flow, applies to squad assignees too
-- [`@`-mention agents in comments](/mentioning-agents) — the `@` picker also surfaces squads
-- [Agents](/agents) — what an agent is, the building block of every squad
-- [Members and roles](/members-roles) — the full owner / admin / member permission matrix
+## Archiving a squad
+
+Once archived, a squad disappears from lists, assignee pickers, and the @-menu, and cannot be restored.
+
+To keep existing work owned, issues and automations currently assigned to the squad transfer to the former leader agent. Historical comments and activity records remain. If you need the same routing later, create a new squad.
+
+<Callout type="warning">
+Archiving cannot be undone.
+</Callout>
+
+## Using the CLI
+
+```bash
+multica squad create --name "Product Delivery" --leader delivery-lead
+multica squad member add <squad-id> \
+ --member-id <agent-or-member-id> \
+ --type agent \
+ --role "Owns frontend implementation"
+```
+
+Full commands in [Using the CLI](/cli).
+
+## Next steps
+
+- [Assign issues to agents](/assigning-issues) — compare member, agent, and squad assignees.
+- [@-mention agents in comments](/mentioning-agents) — trigger and routing rules for @-mentions.
+- [Tasks](/tasks) — how each agent run is queued and recorded.
diff --git a/apps/docs/content/docs/squads.zh.mdx b/apps/docs/content/docs/squads.zh.mdx
index b378cd78c2..eb479517c0 100644
--- a/apps/docs/content/docs/squads.zh.mdx
+++ b/apps/docs/content/docs/squads.zh.mdx
@@ -1,140 +1,117 @@
---
title: 小队
-description: 小队(squad)是一组智能体(可选附带成员),由一名指定的"队长"智能体(leader)领导。把 issue 分配给小队,队长来决定谁接手。
+description: 由一名 leader 协调多名智能体或成员,把工作交给合适的人。
---
import { Callout } from "fumadocs-ui/components/callout";
-小队(squad)是一组 [智能体](/agents) 和 [人类成员](/members-roles) 的**命名集合**,其中有一名指定的**队长(leader),必须是智能体**。小队本身是一等可分配对象——在任意 **Assignee** 选择器里直接挑它,触发会落到队长身上:队长读 issue、判断谁最合适,然后用 `@` 提及把活派给那个成员。小队让你把一组专家**一次性编好队**,之后**按主题派活,而不是按名字派活**——队伍扩展,路由不变。
+小队由一名 leader 智能体和若干成员组成。把 issue 分配给小队后,不会同时运行所有智能体。Multica 会先唤醒 leader,由它阅读上下文并决定下一步交给谁。
-## 小队的运转机制
+小队解决的是把工作交给谁的问题。它不会把多个智能体合并成一个新的智能体,也不会自动提高并发。
-- **一个队长,多名成员。** 队长必须是智能体;成员可以是智能体或人类成员。只有队长一个人的小队也是允许的(队长 briefing 会注明"没有其他成员"),同一个智能体也能加入多个小队。
-- **任何能选人的地方都能选小队。** Assignee picker、@ 提及 picker、快速创建 modal——只要能选智能体或成员的位置,小队都会出现。
-- **删除走"归档"软删除。** 归档一个小队后,它会从 picker 和列表里消失;当前分配给它的 issue 会被**自动转给队长智能体**,让工作不至于卡住。归档的小队不能再被分配新 issue。
+## 适用场景
-## 什么时候用小队,什么时候用单个智能体
+当工作需要多种能力,而且不能在创建 issue 时就确定具体负责人,可以使用小队。例如,一个产品交付小队可以包含前端、后端和测试智能体,由 leader 根据每条 issue 的内容进行分配。
-| 用小队的场景 | 用单个智能体的场景 |
-|---|---|
-| 有几个专家,但事先不知道这条 issue 该归谁 | 工作范围很明确,明确知道该谁干 |
-| 想让 assignee(小队)稳定,实际响应人按 issue 变 | 希望 issue 上挂的是这个智能体的名字,责任清晰 |
-| 想要一个 `@FrontendTeam` 那样的路由目标 | 一对一 `@agent-name` 就够用 |
-
-小队不增加能力——它增加**路由**。成员还是那些智能体,队长唯一的工作是**挑对人**。
+工作范围明确时,直接分配给对应的[智能体](/agents)即可。
-## 权限
+## 小队的组成
-| 操作 | 谁能做 |
+| 配置 | 作用 |
|---|---|
-| 创建 / 更新 / 归档小队 | 工作区 **owner** 或 **admin** |
-| 增删成员、改成员角色 | 工作区 **owner** 或 **admin** |
-| 把 issue 分配给小队 | 任何工作区成员(和分配给智能体一样)|
-| 在评论里 `@` 小队 | 任何工作区成员 |
-| 记录小队队长的 evaluation | 只有队长智能体本人(通过 CLI)|
+| **leader** | 必须是一名智能体。接收分配给小队的工作,并决定如何处理。 |
+| **成员** | 可以是智能体,也可以是人类成员。同一成员可以加入多个小队。 |
+| **角色说明** | 告诉 leader 每个成员适合处理什么工作。它只是上下文,不会授予权限或自动触发成员。 |
+| **小队指令** | 保存路由规则、协作方式和需要贯穿全队的背景,只会提供给 leader。 |
-完整角色权限对照见 [成员与权限](/members-roles)。
+创建小队时需要填写名称并选择 leader。小队 leader 会自动成为成员;之后可以继续添加成员、填写角色说明和小队指令。
-## 创建小队
+## 分配后的执行流程
-在侧边栏打开 **Squads → New squad**,填几个字段:
+非 backlog 状态的 issue 分配给小队后,Multica 会立刻给**队长智能体**入队一个 task(不是给每个成员都入一个):
-- **名字(Name)** —— 例如 `Frontend Team`、`Bug Triage`。在工作区里**不要求唯一**。
-- **描述(Description,可选)** —— 一句话简介,展示在小队卡片和详情页上。
-- **队长(Leader)** —— 选一个已有的智能体。创建后队长会自动以 `leader` 角色加入小队。
+1. **队长的运行时领走 task**,和普通智能体的分配流程一样。
+2. **队长拿到 briefing。** 领走的瞬间,Multica 会在队长的指令后面追加三段内容,见下文[队长每次执行看到的内容](#队长每次执行看到的内容)。
+3. **队长把父 issue 推到 `in_progress`。** 和直接分配给智能体同一套状态约定:首次接单应离开 `todo`,进入 `in_progress`。分发成员不等于完成——小队干活期间父 issue 保持 `in_progress`。
+4. **队长发一条派活评论。** 评论里用花名册给好的 mention markdown `@` 选中的成员——这个 `@` 会触发被派的成员入队新 task。
+5. **队长记录 evaluation**:`multica squad activity <issue-id> <outcome> --reason "..."`。这一行会写进 issue 的 activity 时间线,方便人类回溯队长的每次评估。
+6. **队长停下。** 派完活,队长不亲自动手。被派成员有回复时,队长会被自动唤醒,决定下一步:继续派活、上抛给人类、在整体目标达成后把父 issue 推到 `in_review`,或保持沉默。`done` 留给人工确认或既有集成(例如带 close intent 的 PR merge)。
-创建完打开小队详情页可以:
+如果 issue 仍在 `backlog`,分配本身不会触发队长。移出 `backlog` 后才会开始执行。
-- **加成员** —— 选智能体或人类成员;可以给每个成员加一句"角色描述"(例如 "owns the migrations"、"reviewer of last resort")。队长派活时会参考这些角色。
-- **写 instructions** —— 小队级别的指令,队长每次执行都能看到(见下文)。
-- **设头像** —— 用和智能体一样的头像选择器。
+### 队长每次执行看到的内容
-CLI 等价命令:
+每次队长被触发,三段内容会附加到它的指令上:
-```bash
-multica squad create --name "Frontend Team" --leader frontend-lead-agent
-multica squad member add <squad-id> --member-id <agent-or-user-uuid> --type agent --role "Owns Tailwind / shadcn surface"
-```
+- **Squad Operating Protocol(小队工作规范)**——一段硬编码的规则集:读 issue → 首次接单把父 issue 推到 `in_progress` → 用 `@` 派活 → 保持简洁(不复述 issue 内容,被派的成员自己能读)→ 每次记 evaluation → 派完就停 → 整体目标达成后才推 `in_review`。这段由系统管理,不可编辑。
-## 分配给小队的 issue 是怎么跑的
+ 其中状态相关的规则只对"确实分配给本小队"的 issue 生效。队长被别人 issue 里的 `@小队` 唤醒时,同样拿到花名册和派活规则,但会被明确告知不要改动那条 issue 的状态——状态仍归它自己的负责人。
+- **Squad Roster(小队花名册)**——队长一行 + 每个未归档成员一行,每行带可直接复制的 mention markdown(`[@Name](mention://agent/<uuid>)`)。纯文本 `@name` 不会触发任何人。
+- **Squad Instructions(小队指令)**——你为这个小队写的自定义内容:路由规则("数据库相关派给 Alice,前端派给 Bob")、上报策略,或 issue 本身不会有的背景。
-非 Backlog 状态的 issue 一旦分配给小队,Multica 会立刻给**队长智能体**入队一个 `task`(不是给每个成员都入一个)。整个流程是这样的:
+## 队长的再次触发时机
-1. **队长领走 task。** 队长所在的 daemon 在下次轮询时把 task 领走,和普通智能体的分配流程一样。
-2. **队长拿到 briefing。** 领走的瞬间,Multica 会在队长的系统提示后面追加三段内容——详见下文 [队长每次执行看到的内容](#队长每次执行看到的内容)。
-3. **队长把父 issue 推到 `in_progress`。** 和直接分配给智能体同一套 Agent-managed 状态约定:首次接单应离开 `todo`(或从 backlog 提升后的状态),进入 `in_progress`。分发成员不等于完成——小队干活期间父 issue 保持 `in_progress`。
-4. **队长发一条"派活"评论。** 评论里用 roster 里给好的 mention markdown `@` 选中的成员——这个 `@` 会触发被派的成员入队新 `task`。
-5. **队长记录 evaluation:** `multica squad activity <issue-id> action --reason "..."`。这一行会写进 issue 的 activity 时间线,方便人类回溯队长确实评估过这一次触发。
-6. **队长停下。** 派完活,队长**不动手干活**。当被派的成员有回复——或子 issue / stage 屏障关闭——时,队长会被自动唤醒,决定下一步:继续派活、上抛给人类、在整体目标达成后把父 issue 推到 `in_review`、还是保持沉默。`done` 留给人工确认或既有集成(例如带 close intent 的 PR merge)。
+第一次派活之后,大多数后续评论会自动唤醒队长:
-如果 issue 是 **Backlog** 状态,队长不会被触发——Backlog 是停泊场,规则和直接分配给智能体一样。
+| 事件 | 触发队长 |
+|---|---|
+| 非小队成员(人类、外部智能体)发评论 | 会 |
+| 小队成员发进展更新,不带任何 `@` | 会——队长重新评估下一步 |
+| 任何评论里显式 `@` 了智能体、成员、小队或 `@all` | 不会——显式 `@` 就是路由信号,队长让位 |
+| 队长自己发的评论 | 不会——防自触发 |
+| 评论里只有 issue 互链 | 会——issue 引用不算路由 |
-### 队长每次执行看到的内容
+在这些规则之上还有去重:队长在这条 issue 上已有排队或已领取的 task 时,新触发不会重复入队。
-每次队长被触发,三段内容会被附加到它的 instructions 上:
+<Callout type="info">
+成员发的 `@` 评论不唤醒队长,是因为直接 `@` 已经是明确的交接,再唤醒队长只会多一轮空转。例外:智能体发结果时顺手 `@` 了另一个智能体,队长仍会被唤醒,以便协调整条线程。
+</Callout>
-- **Squad Operating Protocol(小队工作规范)** —— 一段硬编码的规则集:读 issue → 首次接单把父 issue 推到 `in_progress` → 用 `@` 派活 → 简洁(**不要**复述 issue 内容,被派的成员自己能读)→ 每次都记 evaluation → **派完就停** → 只有整体目标达成后才把父 issue 推到 `in_review`。这段是系统管理的,不可编辑。
+## 分配小队和 @小队
- 其中**状态那一半只对「确实分配给本小队」的 issue 生效**。如果队长是被别人 issue 里的 `@squad` 喊醒的,他照样拿到花名册和派活规则,但会被明确告知**不要碰那个 issue 的状态**——状态仍归该 issue 自己的 assignee。
-- **Squad Roster(小队花名册)** —— 队长自己一行 + 每个未归档成员一行。每一行带上**确切可用**的 mention markdown(`[@Name](mention://agent/<uuid>)` 或 `[@Name](mention://member/<uuid>)`)让队长直接复制——纯文本 `@name` 是**不会**触发任何人的。
-- **Squad Instructions(小队自定义指令)** —— 你为这个小队写的私货(在详情页里编辑,或用 `multica squad update --instructions`)。用来写路由规则("DB 相关派给 Alice,前端派给 Bob")、上报策略,或者任何 issue 本身不会有的背景。
+| 操作 | 是否改变负责人 | 结果 |
+|---|---|---|
+| **把 issue 分配给小队** | 是 | 小队成为负责人,并触发 leader。 |
+| **在评论中 @小队** | 否 | 只让 leader 处理这条评论,原负责人不变。 |
-## 队长什么时候会被再次触发
+直接 @某名成员时,工作会交给该成员处理。Multica 也会合并重复触发并阻止 leader 的评论再次触发自己,避免形成执行循环。
-第一次派活完之后,**大多数后续评论**都会自动唤醒队长。具体规则:
+## 小队与 Access
-| 事件 | 触发队长?|
-|---|---|
-| 非小队成员(人类 reporter、外部智能体)发评论 | **会** |
-| 小队成员发"进展更新",**不带任何** `@mention` | **会**——队长重新评估是否需要下一步 |
-| 任何人发的评论里**显式 `@`** 智能体 / 成员 / 小队 / `@all` | **不会**——显式 `@` 就是路由信号,队长让位 |
-| 队长自己发的评论 | **不会**——硬编码防自触发 |
-| 评论里只有 issue 互链 `[MUL-123](mention://issue/...)` | **会**——issue 引用不算路由 |
+把智能体加入小队不会绕过它的 [Access](/agents#权限与-access)。普通成员创建或管理小队时,只能选择自己有权运行的智能体。
-以上规则之上还有去重:如果队长在这个 issue 上已经有 `queued` 或 `dispatched` 的 task,新一次触发不会重复入队。
+成员能否分配或 @某个小队,也取决于其是否有权运行小队的 leader。若 leader 已归档,或当前成员无权运行它,这个小队就无法被分配或 @提及。
-<Callout type="info">
-**为什么成员发的 `@` 评论不会唤醒队长。** 小队成员一旦直接 `@` 谁,那条评论就是**有意识的交接**——再让队长唤醒一次"观察"路由,只会产出一次空回合、把时间线搞乱。智能体作者的评论是个例外:当某个智能体发出一条结果还顺手 `@` 了另一个智能体时,队长仍然会被唤醒,以便协调整条线程。
-</Callout>
+## 创建与管理权限
+
+任何工作区成员都可以创建小队。创建者可以修改和归档自己创建的小队;工作区 `owner` 和 `admin` 可以管理所有小队。
-## 在评论里 `@` 一个小队
+小队名称不要求在工作区中唯一。更换 leader 时,新 leader 会自动加入小队;当前 leader 不能直接移除,需要先指定另一名 leader。
-小队会出现在 `@` picker 里,和成员、智能体并列。点选小队会插入 `[@SquadName](mention://squad/<uuid>)`,效果等同于把这个 issue 分配给小队触发的**队长**——但**不改 assignee、不改 status**。适合"我想让小队挑个人回答一下/做一小步,但 issue 还归原来的人"这种场景。
+## 归档小队
-防循环规则同样适用:队长跳过自己;同一条评论里如果还显式 `@` 了某个成员,路由会直接落到那个成员。
+归档后,小队会从列表、负责人选择器和 @菜单中消失,也不能恢复。
-## 重新分配或归档一个小队
+为避免现有工作失去负责人,当前分配给小队的 issue 和自动化会转给原 leader 智能体。历史评论和活动记录仍然保留。如果之后还需要相同的路由,需要重新创建小队。
-**把分配人从小队改成别的**,行为和换 assignee 完全一致:当前 issue 上所有活跃 task(包括队长的)会被取消,新的 assignee(智能体、成员、或另一个小队)被入队。没有"不改 assignee 只移除小队"的单独操作;要换就选新的 assignee。
+<Callout type="warning">
+归档操作无法撤销。
+</Callout>
-**归档小队**(`multica squad delete <id>`,或详情页的 Archive 按钮):
+## 使用 CLI
-1. **当前分配给这个小队的 issue 会被自动转给队长智能体**,让工作落到一个具体智能体上,避免无人接手。
-2. 在 squad 表上写入 `archived_at` / `archived_by`——记录被保留下来,历史的 activity 还能解析;但从列表、picker、`@` 下拉里它都消失。
-3. **拒绝后续分配**——`cannot assign to an archived squad`。
+```bash
+multica squad create --name "Product Delivery" --leader delivery-lead
+multica squad member add <squad-id> \
+ --member-id <agent-or-member-id> \
+ --type agent \
+ --role "负责前端实现"
+```
-目前没有"反归档"命令;要恢复路由,重新建一个小队即可。
+完整命令见 [使用 CLI](/cli)。
-## CLI 命令
+## 接下来
-| 命令 | 用途 |
-|---|---|
-| `multica squad list` | 列出工作区里的小队 |
-| `multica squad get <id>` | 查看小队的名字、队长、描述、instructions |
-| `multica squad create --name "..." --leader <agent>` | 创建小队(owner / admin)|
-| `multica squad update <id> [--name X] [--description X] [--instructions X] [--leader Y] [--avatar-url Z]` | 修改一个或多个字段 |
-| `multica squad delete <id>` | 归档(软删除)——同时把当前分配给小队的 issue 转给队长 |
-| `multica squad member list <id>` | 列出小队成员 |
-| `multica squad member add <id> --member-id <uuid> --type agent\|member [--role "..."]` | 加成员(owner / admin)|
-| `multica squad member set-role <id> --member-id <uuid> --member-type agent\|member --role "..."` | 不移除成员,直接修改 role |
-| `multica squad member remove <id> --member-id <uuid> --type agent\|member` | 移除成员(**不能移除队长**——先换队长)|
-| `multica squad activity <issue-id> <action\|no_action\|failed> --reason "..."` | 队长每次结束前由它自己调用 |
-
-`--leader` 接受智能体名字或 UUID;其它 ID 从 `multica agent list --output json`、`multica workspace member list --output json`、`multica squad list --output json` 拿。
-
-## 下一步
-
-- [分配 issue 给智能体](/assigning-issues) —— 流程相同,对小队 assignee 也适用
-- [在评论里 `@` 智能体](/mentioning-agents) —— `@` picker 同样能选到小队
-- [智能体](/agents) —— 小队的"零件"
-- [成员与权限](/members-roles) —— owner / admin / member 的完整权限对照
+- [分配 issue 给智能体](/assigning-issues) — 比较成员、智能体和小队负责人。
+- [在评论中提及智能体](/mentioning-agents) — 了解 @提及的触发与路由规则。
+- [执行任务](/tasks) — 查看每一次智能体执行如何排队和记录。
diff --git a/apps/docs/content/docs/tasks.ja.mdx b/apps/docs/content/docs/tasks.ja.mdx
index f166ee1f05..4f7d5b5ec5 100644
--- a/apps/docs/content/docs/tasks.ja.mdx
+++ b/apps/docs/content/docs/tasks.ja.mdx
@@ -1,119 +1,168 @@
---
-title: タスク
-description: すべてのエージェント実行の作業単位であり、明確なステートマシン、タイムアウト、リトライルールを備えています。
+title: 実行タスク
+description: エージェントの 1 回の実行がどのようにキューに入り、実行され、停止・リトライされるかを説明します。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-**タスク**はすべての[エージェント](/agents)実行の単位です — [エージェントへのイシューの割り当て](/assigning-issues)、[コメントでのエージェントの @-メンション](/mentioning-agents)、[チャット](/chat)でのメッセージ送信、または[オートパイロット](/autopilots)が予定時刻に発火することは、いずれもタスクを生成します。Multica はそれをキューに入れ、[デーモン](/daemon-runtimes)が取得して対応する [AI コーディングツール](/providers)に引き渡し、完了するとその結果をサーバーに書き戻します。
+エージェントが作業を始めるたびに、Multica は**実行タスク**(task)を 1 件作成します。実行タスクには、この実行が何によってトリガーされ、どのエージェントに渡され、いまどこまで進んでいて、最終的に成功したかどうかが記録されます。
-タスクと[イシュー](/issues)は異なる 2 つのオブジェクトです。1 つのイシューは何度も割り当てられたり、@-メンションされたり、手動で再実行されたりでき — そのたびに**新しい**タスクが生成されます。
+## イシューと実行タスク
-## タスクが経るステート
+イシューは 1 つの作業の目標、議論、担当者、最終ステータスを保持します。実行タスクは、その作業に対するエージェントの 1 回の実行を記録します。
-<Mermaid chart={`
-graph LR
- Q["Queued<br/>queued"] -->|daemon picks up| D["Dispatched<br/>dispatched"]
- D -->|agent starts| R["Running<br/>running"]
- R -->|success| C["Completed<br/>completed"]
- R -->|error or timeout| F["Failed<br/>failed"]
- Q -->|user cancels| X["Cancelled<br/>cancelled"]
- D -->|user cancels| X
- R -->|user cancels| X
- F -.retryable reason.-> Q
-`} />
+| | イシュー | 実行タスク |
+| --- | --- | --- |
+| 記録する内容 | 継続的に進む 1 つの作業 | エージェントの 1 回の実行 |
+| 続く期間 | 何度でも議論・追記・再割り当てできる | トリガーから、完了・失敗・キャンセルまで |
+| 数の関係 | 1 つのイシューに複数の実行が積み重なる | 実行ごとに独立した記録が残る |
-- **Queued(キュー待ち)** — タスクが作成されたばかりで、デーモンが取得するのを待っている状態
-- **Dispatched(ディスパッチ済み)** — デーモンがタスクを占有し、AI コーディングツールを起動中
-- **Running(実行中)** — AI コーディングツールが実際に作業を実行中
-- **Completed(完了)** — 正常に終了し、成果物(コメント、コードコミット、ステータス変更)がサーバーに書き戻されます
-- **Failed(失敗)** — エラーまたはタイムアウトで中断。失敗理由がリトライ可能な場合、タスクは自動的に `queued` 状態に戻り、再試行されます
-- **Cancelled(キャンセル済み)** — ユーザーがキャンセルした場合
+そのため、同じイシューを順番に別のエージェントへ渡すことも、失敗のあとにもう一度実行することもできます。実行のたびに新しいタスクが作成され、以前の記録が上書きされることはありません。
-## タスクがタイムアウトしたときに起きること
+## トリガー元
-Multica サーバーは 30 秒ごとにスキャンします。2 種類のタイムアウトが失敗を引き起こします。
+次の操作はいずれも実行をトリガーできます。
-| 状況 | タイムアウト |
-|---|---|
-| ディスパッチされたが開始されない(デーモンが取得したが AI ツールを起動しなかった) | **5 分** |
-| 実行が長すぎる | **2.5 時間** |
+- イシューをエージェントまたはスクワッドに割り当てる。
+- コメントでエージェントをメンションする。
+- チャットでエージェントにメッセージを送る。
+- オートパイロットがスケジュールまたは外部イベントで発火する。
-どちらのタイムアウトも失敗理由として `timeout` を使用し、**自動的にリトライされます**(次のセクション)。関連するランタイム欠落チェックについては、[デーモンとランタイム → ランタイムがオフラインとマークされるタイミング](/daemon-runtimes#when-a-runtime-is-marked-offline)を参照してください。
+入口によって渡されるコンテキストは異なりますが、実行の仕組みは同じです。Multica がタスクを作成し、ランタイムがそれを取得して、エージェントに設定された AI コーディングツールを呼び出します。
-## どの失敗が自動的にリトライされ、どの失敗がされないか
+## 実行の流れ
-失敗は 2 つのカテゴリに分かれます: **リトライ可能**と**リトライ不可**です。
+タスクは通常、次の状態を経ます。
-**リトライ可能**(Multica が自動的に再キューイング):
+| 状態 | 意味 |
+| --- | --- |
+| `deferred` | 後で発火するようスケジュール済み。指定時刻になるとキューに入る |
+| `queued` | ランタイムによる取得を待っている |
+| `dispatched` | ランタイムが取得し、AI コーディングツールを起動中 |
+| `waiting_local_directory` | 対象のローカルディレクトリを別の実行が使用中で、ディレクトリロックの解放を待っている |
+| `running` | AI コーディングツールが実行中 |
+| `completed` | この実行は正常に終了した |
+| `failed` | 実行がエラーになったか中断された |
+| `cancelled` | 実行が手動で停止された |
-- `runtime_offline` — タスクがディスパッチされた後にデーモンがいなくなった
-- `runtime_recovery` — デーモンがクラッシュして再起動し、終わらせなかったタスクを回収した
-- `timeout` — ランタイムまたはディスパッチのタイムアウト
+ランタイムがオンラインなら、新しいタスクは通常すぐに始まります。キューに入ったあとでランタイムがオフラインになった場合、タスクは復帰までキューで待機します。2 時間を超えて取得されないタスクは失敗として終了します。
-**リトライ不可**(タスクは失敗状態のまま):
+<Callout type="info">
+トリガーの前の時点で対象ランタイムのオフラインが分かっている場合、一部の即時操作は、誰も取得できないタスクを作成する代わりに、いまは実行できない旨をその場で表示します。
+</Callout>
-- `agent_error` — AI コーディングツール自体がエラーを報告した(API エラー、クォータ超過、内部バグ)。根本的な問題はリトライされません — 無限ループになってしまうためです。
+ハートビートが正常なランタイムは長時間のタスクを実行できます。実行時間が長いという理由だけで、サーバーが実行を強制終了することはありません。プロセスが停滞しているかどうかは、ランタイムが実際のアクティビティに基づいて判断します。関連する設定は[環境変数](/environment-variables#デーモン設定)を参照してください。
-自動リトライにはさらに 2 つの追加条件もあります。
+## 実行履歴の確認
-1. **最大 2 回の試行** — オリジナル 1 回 + リトライ 1 回。リトライも失敗した場合は、理由がリトライ可能であってもそれ以上リトライしません。
-2. **イシューおよびチャットでトリガーされたタスクのみ** — オートパイロットでトリガーされたタスクは自動的にリトライ**されません**。
+イシューを開くと、**実行ログ**でそのイシューが生んだすべてのタスクを確認できます。各行にはトリガー元、実行したエージェント、状態、時間が表示されます。
-<Callout type="warning">
-**オートパイロットのタスクは自動的にリトライされません** — 意図された設計です。オートパイロットは独自の発火サイクル(例: 毎日)を持っており、失敗時に自動リトライが起きると次の予定実行と重なってしまいます。失敗後すぐに再実行が必要なら、手動の再実行を使用してください(次のセクション)。
+ここでは次の操作ができます。
+
+- 実行記録を開き、エージェントのメッセージ、ツール呼び出し、エラー出力を確認する。
+- 後で発火する予定・キュー待ち・起動中・ローカルディレクトリ待ち・実行中のタスクを停止する。
+- 失敗またはキャンセルされたタスクをリトライする。
-**オートパイロットのタスクが失敗したことを知る方法**: [インボックス](/inbox)に通知が届き、関連するイシューのステータスが `in_progress` から `todo` に戻ります。[オートパイロット](/autopilots)ページでも、オートパイロットごとの最新の実行結果を確認できます。
+![実行記録: 状態のタイムライン、エージェントの要約、個々のツール呼び出し](/images/docs/task-transcript.png)
+
+<Callout type="warning">
+イシューの担当者やステータスを変更しても、すでに始まった実行は止まりません。中断したいときは、実行ログで該当する実行タスクを停止してください。アクティブなタスクがイシューと一緒にキャンセルされるのは、イシューを削除したときだけです。
</Callout>
-## 手動の再実行 vs. 自動リトライ
+## 失敗と自動リトライ
+
+ランタイムの一時的なオフライン、デーモンの再起動、実行タイムアウト、AI コーディングツールのネットワーク中断といった一時的な障害は、自動リトライをトリガーできます。通常のタスクはデフォルトで最大 2 回まで、ツールのネットワーク中断は最大 3 回まで実行されます。
+
+エージェント自身が返したエラーは、通常は自動リトライされません。認証の失効、クォータ不足、設定ミス、モデルがリクエストを完了できない場合などは、まず原因を解消してから手動でリトライしてください。
+
+オートパイロットの**実行のみ**モードは、次のスケジュール実行と重ならないよう自動リトライしません。**イシューを作成**モードが生成するのは通常のイシュータスクなので、インフラ障害は上記のルールどおりリトライされます。どちらのモードも、最終結果はオートパイロットの実行履歴で確認できます。
+
+イシュー上に他のアクティブなタスクがなく、実行を待つ新しいリトライもない場合、失敗によって `in_progress` のイシューは `todo` に戻ります。
+
+## 失敗理由リファレンス
-**手動の再実行**は、CLI または API(`POST /api/issues/{id}/rerun`)から自分でトリガーするものです。
+実行ログと使用量統計に表示される失敗理由は 2 つに分かれます。接頭辞のない理由コードはプラットフォームが記録するもの、`agent_error.*` は AI コーディングツール自身のエラーから分類されたものです。
+
+**プラットフォーム側**
+
+| 原因 | 意味 | 対処 |
+| --- | --- | --- |
+| `runtime_offline` | 実行中にランタイムがオフラインになった | ランタイムを復旧してからリトライ。[デーモンとランタイム](/daemon-runtimes)を参照 |
+| `queued_expired` | ランタイムに取得されないまま 2 時間を超えてキューで待機した | ランタイムがオンラインであることを確認してからリトライ |
+| `runtime_recovery` | デーモンが再起動後、中断された実行を回収した | そのままリトライ |
+| `cancelled` | 手動で停止されたか、アーカイブ・削除に伴ってキャンセルされた | 対処不要 |
+| `timeout` | デーモンに設定された実行時間の上限を超えた | イシューの範囲を狭めるか、デーモンの `agent_timeout` を調整する |
+| `iteration_limit` | 実行の反復回数の上限に達した | イシューの範囲を狭める |
+| `agent_blocked` | エージェントが続行できないと自ら報告した | エージェントがコメントで求めた情報を補う |
+| `api_invalid_request` | プラットフォーム API が不正なリクエストを拒否した | リトライし、繰り返し発生する場合は問題を報告する |
+| `codex_semantic_inactivity` | Codex が長時間有効な出力を出さず、停滞と判定された | リトライするか、Codex の停滞タイムアウトを調整する |
+
+**ツール側(`agent_error.*`、接頭辞は省略)**
+
+| 原因 | 意味 | 対処 |
+| --- | --- | --- |
+| `provider_auth_or_access` | モデルプロバイダーの認証に失敗したか、アクセス権がない(401/403) | その AI コーディングツールで再ログインするか、API キーを確認する |
+| `provider_quota_limit` | クォータまたは残高を使い切った(402) | チャージするか、アカウントを切り替える |
+| `provider_capacity_or_rate_limit` | レート制限または容量不足(429/529) | 時間をおいてリトライ |
+| `provider_server_error` | モデルプロバイダー側のサーバーエラー(5xx) | 時間をおいてリトライ |
+| `provider_network` | モデルプロバイダーへのネットワーク障害 | 自動でリトライされる。続く場合は実行マシンのネットワークを確認する |
+| `model_not_found_or_unavailable` | モデルが存在しないか、現在利用できない | エージェント設定で利用可能なモデルを選び直す |
+| `context_overflow` | コンテキストがモデルのウィンドウを超えた | イシューの範囲を狭めるか、入力を減らす |
+| `missing_config` | API キーなどの必須設定が不足している | エージェントの環境変数またはツールの設定を補う |
+| `runtime_missing_executable` | AI コーディングツールの実行ファイルが見つからない | ツールを再インストールする。[AI コーディングツールのインストール](/install-agent-runtime)を参照 |
+| `runtime_version_unsupported` | AI コーディングツールのバージョンが古すぎる | ツールをアップグレードする |
+| `process_failure` | ツールのプロセスが異常終了した | 実行記録で原因を特定してからリトライ |
+| `empty_or_unparseable_output` | ツールが出力を返さなかったか、出力を解析できなかった | リトライし、繰り返す場合はツールのインストールを確認する |
+| `agent_timeout` | ツールが長時間応答せず終了された | リトライするか、イシューの範囲を狭める |
+| `unknown` | 分類できなかった失敗 | 実行記録の元のエラーを確認する |
+
+## 手動リトライ
+
+実行ログで行の再試行ボタンをクリックすると、**当時そのタスクを実行したエージェント**が再び呼び出されます。その後イシューの担当者が変わっていても、新しい担当者には切り替わりません。
+
+リトライは、前回の実行がローカルディレクトリに書き込んだファイルをできる限り保持します。元のセッションがまだ安全で、同じランタイムが取得した場合は、前回のセッションも引き継ぎます。コンテキスト超過や不正なリクエストなど、セッションを汚染するエラーの場合は、元の作業ディレクトリの上で新しいセッションを開始します。元のディレクトリがすでに存在しない場合は、新しい作業ディレクトリを使います。
+
+CLI から現在のイシューを再実行することもできます。
```bash
multica issue rerun <issue-id>
```
-動作:
-
-- デフォルトでは、イシューの**現在のエージェント担当者**を対象とします — 以前のタスクを誰が実行したかに関わらず、再実行が現在の割り当てに従うようにしたいときに便利です。
-- 実行ログの特定の行にあるリトライボタンは、その行のタスク ID も一緒に送信するため、再実行は**現在の担当者ではなく、まさにそのタスクを実行したエージェント**を対象とします。これにより、スクワッドワーカー、並列の @-メンションエージェント、または再割り当てによってエージェントが入れ替わった行に対しても、行単位のリトライが意味を持つようになります。
-- このイシューに対する対象エージェントのキュー待ちまたは実行中のタスクを**キャンセルします**(ある場合)。同じイシューで他のエージェントが所有するタスク(例: 並列の @-メンション実行)はそのまま残します。
-- **まったく新しい**タスクを作成します — オリジナルのタスクが試行回数の上限に達していても、試行回数は 1 にリセットされます。
-- **作業ディレクトリを再利用します。セッションを再開するかどうかは、どこからトリガーしたかによって変わります:**
- - **実行ログの行単位リトライ**(task ID を伴う): その実行の作業ディレクトリを再利用するため、ディスクに書き込み済みのファイルは保持されます。その実行のセッションも再開します — ただし失敗が会話を汚染した場合(コンテキストオーバーフロー、反復上限、invalid request、Codex セマンティック無活動、エージェントフォールバック)は、再利用した作業ディレクトリの上で新しいセッションを開始します。元のディレクトリが失われている場合(GC 済み、別のランタイム上、または記録される前に失敗)は、新しい作業ディレクトリにフォールバックします。これにより、ネットワークの一時的な不調、provider の 5xx / レート制限、一時的にオフラインになったランタイム、すでに修正した auth/クォータ/設定エラーなどの**一時的な失敗**は、最初からやり直すのではなく中断したところから続行します。
- - **task ID を伴わない CLI / API 再実行**: 続行すべき特定の実行がないため、**新しいセッション + 新しい作業ディレクトリ**で開始します。
-
-比較:
+この方法は過去の特定のタスクを指さないため、イシューの現在のエージェント担当者を使い、新しいセッションと作業ディレクトリから開始します。
-| 項目 | 自動リトライ | 手動の再実行 |
-|---|---|---|
-| トリガー | システム、失敗理由に基づく | ユーザー、手動 |
-| 上限 | 2 回の試行 | 制限なし |
-| 適用できるソース | イシュー、チャット | エージェント担当者があるイシュー |
-| 選択されるエージェント | 失敗したタスクと同じエージェント | ソースタスクのエージェント(UI 行単位リトライ)またはイシューの現在の担当者(CLI / task_id なし) |
-| 作業ディレクトリ | 再利用(以前のファイルから続行) | 行単位リトライ: まだ存在すれば再利用; CLI / task_id なし: 新規 |
-| セッション継承 | あり(以前のセッションを再開) | 行単位リトライ: 失敗が会話を汚染しない限り再開; CLI / task_id なし: 新規 |
+## 実行の完了とイシューの完了
-## 失敗したタスクがイシューのステータスに与える影響
+`completed` は、この 1 回の実行が正常に終了したことだけを表し、イシューの目標が達成されたことを保証するものではありません。結果を確認し、議論を続け、要件を追加し、もう一度エージェントをトリガーできます。
-イシューがエージェントに割り当てられていてトリガーされたタスクが失敗すると(そして自動リトライが成功しないと)、**イシューのステータスが `in_progress` から `todo` に自動的に戻ります** — そのため、ボードを開くと「これはもう一度見る必要がある」とすぐに分かります。[イシューとプロジェクト](/issues)を参照してください。
+イシューが完了したかどうかは、実際の作業の進み具合とイシューのステータスで判断してください。
-## タスクが以前のコンテキストから続行できるか
+## 状態とタイムアウトの早見表
-できます — AI コーディングツールがセッション再開をサポートしている限りは。
+以下の数値はサーバーのデフォルト設定に対応しており、トラブルシューティング時の照合に使えます。
-Multica はタスク中にセッション ID を**2 回**固定します: 開始時に 1 回(AI ツールが最初のシステムメッセージを返したとき)、終了時に 1 回(完了または失敗時)。1 回目はデーモンが実行の途中でクラッシュしても復旧できるようにし、2 回目は次の**自動リトライ**と**実行ログの行単位リトライ**で再利用され、その ID を渡し返すことでエージェントが以前の会話とファイル状態を引き継げるようにします — ただし失敗が会話を汚染した場合は、作業ディレクトリのみを再利用して新しいセッションを開始します。**task ID を伴わない CLI / API 再実行**は、新しいセッション + 新しい作業ディレクトリで開始します — [手動の再実行 vs. 自動リトライ](#manual-rerun-vs-automatic-retry)を参照してください。
+| 状態 | 意味 | タイムアウトと結果 |
+| --- | --- | --- |
+| `deferred` | 後で発火するようスケジュール済み | 予定時刻になると `queued` に入り、以降は下のルールに従う |
+| `queued` | ランタイムによる取得待ち | **2 時間**取得されないと失敗として終了し、自動リトライされない |
+| `dispatched` | ランタイムが取得し、ツールを起動中 | **5 分**を超えてこの状態に留まると失敗として扱われる |
+| `waiting_local_directory` | ローカルディレクトリロックの解放待ち | 独自のタイムアウトはなし。ディレクトリが解放されると起動フローに戻る |
+| `running` | AI コーディングツールが実行中 | 固定の時間上限はなし。生存はランタイムのハートビート(15 秒ごと)で判定し、ハートビートを失ったランタイムは遅くとも約 3 分でオフラインと判定され、その上のタスクも失敗する |
-ただし、**実際にどの AI コーディングツールがこれをサポートするか**は大きく異なります。
+自動リトライは以下の一時的な障害のみを対象とし、イシューまたはチャットに紐づくタスクにのみ適用されます(オートパイロットの**実行のみ**モードを除く):
-- ✅ **実際にサポート** — Antigravity, Claude Code, Codex, Copilot, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Pi
-- ❌ **サポートなし** — Gemini
+| 自動リトライされる失敗原因 | 実行回数の上限 |
+| --- | --- |
+| ランタイムのオフライン | デフォルト 2 回(初回実行 + リトライ 1 回) |
+| デーモン再起動後の回収 | デフォルト 2 回 |
+| プラットフォームが判定した実行タイムアウト | デフォルト 2 回 |
+| Codex が長時間有効な出力を出さない | デフォルト 2 回 |
+| スキルバンドルのダウンロード失敗 | デフォルト 2 回(この時点でエージェントのプロセスは未起動。ダウンロード済みのバンドルはローカルキャッシュから使われる) |
+| ツールのネットワーク中断 | 最大 3 回。最後の 1 回は約 5 秒遅らせて開始 |
-[プロバイダー対応表 → セッション再開](/providers#session-resumption-who-really-supports-it)を参照してください。
+その他の失敗原因(認証、クォータ、設定、モデルなど)は自動リトライされません。先に原因を解消してから手動でリトライしてください。
-## 次へ
+## 次のステップ
-- [プロバイダー対応表](/providers) — 16 個の AI コーディングツール間の機能差(正確なセッション再開の状態を含む)
-- [エージェントへのイシューの割り当て](/assigning-issues) / [コメントでのエージェントの @-メンション](/mentioning-agents) / [チャット](/chat) / [オートパイロット](/autopilots) — タスクをトリガーする 4 つの方法
+- [デーモンとランタイム](/daemon-runtimes) — タスクがどのコンピュータで実行されるかを知る。
+- [イシューをエージェントに割り当てる](/assigning-issues) — イシューから実行をトリガーする。
+- [エージェントのメンション](/mentioning-agents) — コメントで要件を補足し、他のエージェントを参加させる。
diff --git a/apps/docs/content/docs/tasks.ko.mdx b/apps/docs/content/docs/tasks.ko.mdx
index 388a108295..74107941c0 100644
--- a/apps/docs/content/docs/tasks.ko.mdx
+++ b/apps/docs/content/docs/tasks.ko.mdx
@@ -1,119 +1,168 @@
---
-title: 작업
-description: 모든 에이전트 실행의 작업 단위로, 명확한 상태 머신, 타임아웃, 재시도 규칙을 갖추고 있습니다.
+title: 실행 태스크
+description: 에이전트의 한 번의 실행이 큐에 들어가고, 실행되고, 중지되고, 재시도되는 방식을 알아봅니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-**작업**은 모든 [에이전트](/agents) 실행의 단위입니다 — [에이전트에게 이슈를 할당](/assigning-issues)하거나, [댓글에서 에이전트를 @-멘션](/mentioning-agents)하거나, [채팅](/chat)에서 메시지를 보내거나, [오토파일럿](/autopilots)이 예약된 시각에 실행되면 모두 작업이 생성됩니다. Multica는 이를 대기열에 넣고, [데몬](/daemon-runtimes)이 가져가 해당 [AI 코딩 도구](/providers)에 넘긴 다음, 완료되면 결과를 서버에 다시 기록합니다.
+에이전트가 작업을 시작할 때마다 Multica가 **실행 태스크**(task)를 만듭니다. 이 기록에는 무엇이 실행을 트리거했는지, 어느 에이전트에게 전달되었는지, 현재 어디까지 진행되었는지, 최종적으로 성공했는지가 담깁니다.
-작업과 [이슈](/issues)는 서로 다른 두 객체입니다. 하나의 이슈는 여러 번 할당되거나 @-멘션되거나 수동으로 재실행될 수 있으며 — 그때마다 **새로운** 작업이 생성됩니다.
+## 이슈와 실행 태스크
-## 작업이 거치는 상태
+이슈에는 한 작업의 목표, 논의, 담당자, 최종 상태가 저장되고, 실행 태스크에는 에이전트가 이 작업을 한 번 실행한 기록이 저장됩니다.
-<Mermaid chart={`
-graph LR
- Q["Queued<br/>queued"] -->|daemon picks up| D["Dispatched<br/>dispatched"]
- D -->|agent starts| R["Running<br/>running"]
- R -->|success| C["Completed<br/>completed"]
- R -->|error or timeout| F["Failed<br/>failed"]
- Q -->|user cancels| X["Cancelled<br/>cancelled"]
- D -->|user cancels| X
- R -->|user cancels| X
- F -.retryable reason.-> Q
-`} />
+| | 이슈 | 실행 태스크 |
+| --- | --- | --- |
+| 기록하는 내용 | 계속 진행되는 작업 하나 | 에이전트의 실행 한 번 |
+| 유지 기간 | 반복해서 논의하고 보충하고 다시 할당할 수 있음 | 트리거된 시점부터 완료, 실패, 취소될 때까지 |
+| 수량 관계 | 이슈 하나에 여러 실행이 포함될 수 있음 | 실행마다 독립된 기록이 있음 |
-- **Queued(대기 중)** — 작업이 막 생성되어 데몬이 가져가기를 기다리는 상태
-- **Dispatched(파견됨)** — 데몬이 작업을 점유하고 AI 코딩 도구를 시작하는 중
-- **Running(실행 중)** — AI 코딩 도구가 실제로 작업을 수행하는 중
-- **Completed(완료)** — 성공적으로 끝났으며, 산출물(댓글, 코드 커밋, 상태 변경)이 서버에 다시 기록됩니다
-- **Failed(실패)** — 오류 또는 타임아웃으로 중단됨; 실패 사유가 재시도 가능한 경우 작업은 자동으로 `queued` 상태로 돌아가 다시 시도됩니다
-- **Cancelled(취소됨)** — 사용자가 취소한 경우
+따라서 같은 이슈를 여러 에이전트에게 차례로 맡기거나 실패 후 다시 실행할 수 있습니다. 매번 새 태스크가 생성되며 이전 기록은 덮어쓰지 않습니다.
-## 작업이 타임아웃되면 일어나는 일
+## 트리거 출처
-Multica 서버는 30초마다 스캔합니다. 두 종류의 타임아웃이 실패를 유발합니다:
+다음 작업은 모두 실행을 트리거할 수 있습니다.
-| 상황 | 타임아웃 |
-|---|---|
-| 파견되었으나 시작되지 않음(데몬이 가져갔지만 AI 도구를 실행하지 않음) | **5분** |
-| 너무 오래 실행됨 | **2.5시간** |
+- 이슈를 에이전트 또는 스쿼드에 할당
+- 댓글에서 에이전트 멘션
+- 대화에서 에이전트에게 메시지 전송
+- 일정 또는 외부 이벤트로 자동화 트리거
-두 타임아웃 모두 실패 사유로 `timeout`을 사용하며 **자동으로 재시도됩니다**(다음 섹션). 관련된 런타임 누락 검사는 [데몬과 런타임 → 런타임이 오프라인으로 표시되는 시점](/daemon-runtimes#when-a-runtime-is-marked-offline)을 참고하세요.
+각 진입점이 제공하는 컨텍스트는 다르지만 실행 방식은 같습니다. Multica가 태스크를 만들고 런타임이 가져간 뒤 에이전트에 설정된 AI 코딩 도구를 호출합니다.
-## 어떤 실패가 자동으로 재시도되고 어떤 실패는 그렇지 않은지
+## 실행 과정
-실패는 두 가지 범주로 나뉩니다: **재시도 가능**과 **재시도 불가**.
+태스크는 일반적으로 다음 상태를 거칩니다.
-**재시도 가능**(Multica가 자동으로 다시 대기열에 넣음):
+| 상태 | 의미 |
+| --- | --- |
+| `deferred` | 나중에 트리거되도록 예약되었으며 지정 시간이 되면 큐에 들어갑니다. |
+| `queued` | 런타임이 가져가기를 기다립니다. |
+| `dispatched` | 런타임이 가져갔고 AI 코딩 도구를 시작하고 있습니다. |
+| `waiting_local_directory` | 대상 로컬 디렉터리를 다른 실행이 사용 중이어서 디렉터리 잠금 해제를 기다립니다. |
+| `running` | AI 코딩 도구가 실행 중입니다. |
+| `completed` | 이번 실행이 정상적으로 끝났습니다. |
+| `failed` | 실행 중 오류가 발생했거나 중단되었습니다. |
+| `cancelled` | 실행을 수동으로 중지했습니다. |
-- `runtime_offline` — 작업이 파견된 후 데몬이 사라짐
-- `runtime_recovery` — 데몬이 충돌 후 재시작되어 끝내지 못한 작업을 회수함
-- `timeout` — 런타임 또는 파견 타임아웃
+런타임이 온라인이면 새 태스크가 보통 빠르게 시작됩니다. 태스크가 큐에 들어간 뒤 런타임이 오프라인이 되면 복구될 때까지 큐에서 기다립니다. 2시간 넘게 수령되지 않으면 태스크가 실패로 끝납니다.
-**재시도 불가**(작업이 실패 상태로 유지됨):
+<Callout type="info">
+트리거하기 전에 대상 런타임이 오프라인임을 시스템이 이미 아는 경우 일부 즉시 실행 작업은 수령할 수 없는 태스크를 만들지 않고 현재 실행할 수 없다고 바로 알립니다.
+</Callout>
-- `agent_error` — AI 코딩 도구 자체가 오류를 보고함(API 오류, 할당량 초과, 내부 버그). 근본적인 문제는 재시도하지 않습니다 — 무한 반복될 수 있기 때문입니다.
+heartbeat가 정상인 런타임은 장시간 태스크도 실행할 수 있으며 서버는 실행 시간이 길다는 이유만으로 강제 종료하지 않습니다. 런타임은 실제 활동을 기준으로 프로세스가 멈췄는지 판단합니다. 관련 설정은 [환경 변수](/environment-variables#데몬-설정)를 참고하세요.
-자동 재시도에는 두 가지 추가 조건도 있습니다:
+## 실행 기록 확인
-1. **최대 2회 시도** — 원본 1회 + 재시도 1회. 재시도도 실패하면 사유가 재시도 가능하더라도 더 이상 재시도하지 않습니다.
-2. **이슈 및 채팅으로 트리거된 작업에만 해당** — 오토파일럿으로 트리거된 작업은 자동으로 재시도되지 **않습니다**.
+이슈를 열면 **실행 로그**에서 해당 이슈가 만든 모든 태스크를 볼 수 있습니다. 각 줄에는 트리거 출처, 실행 에이전트, 상태, 시간이 표시됩니다.
-<Callout type="warning">
-**오토파일럿 작업은 자동으로 재시도되지 않습니다** — 의도된 설계입니다. 오토파일럿은 자체적인 실행 주기(예: 매일)를 갖고 있으며, 실패 시 자동 재시도가 일어나면 다음 예약 실행과 겹치게 됩니다. 실패 후 즉시 재실행이 필요하다면 수동 재실행을 사용하세요(다음 섹션).
+여기에서 다음 작업을 할 수 있습니다.
+
+- 실행 기록을 열어 에이전트 메시지, 도구 호출, 오류 정보 확인
+- 나중에 실행하도록 예약된 태스크, 큐 대기 중인 태스크, 시작 중인 태스크, 로컬 디렉터리를 기다리는 태스크, 실행 중인 태스크 중지
+- 실패하거나 취소된 태스크 재시도
-**오토파일럿 작업이 실패했음을 알 수 있는 방법**: [인박스](/inbox)에 알림이 도착하고, 연관된 이슈의 상태가 `in_progress`에서 다시 `todo`로 되돌아갑니다. [오토파일럿](/autopilots) 페이지에서도 오토파일럿별 최근 실행 결과를 확인할 수 있습니다.
+![실행 기록: 상태 타임라인, 에이전트 요약, 개별 도구 호출](/images/docs/task-transcript.png)
+
+<Callout type="warning">
+이슈의 담당자나 상태를 바꿔도 이미 시작된 실행은 중지되지 않습니다. 중단하려면 실행 로그에서 해당 실행 태스크를 중지하세요. 이슈를 삭제할 때만 연결된 활성 태스크가 함께 취소됩니다.
</Callout>
-## 수동 재실행 vs. 자동 재시도
+## 실패와 자동 재시도
+
+런타임의 일시적인 오프라인, 데몬 재시작, 실행 timeout, AI 코딩 도구의 네트워크 중단 같은 일시적 장애는 자동 재시도를 트리거할 수 있습니다. 일반 태스크는 기본적으로 최대 두 번 실행되고 도구 네트워크 중단은 최대 세 번 실행됩니다.
+
+에이전트 자체가 반환한 오류는 보통 자동으로 재시도되지 않습니다. 인증 만료, 사용량 부족, 설정 오류, 모델이 요청을 완료하지 못한 경우에는 먼저 원인을 해결한 뒤 수동으로 재시도해야 합니다.
+
+자동화의 **실행만** 모드는 다음 예약 실행과 겹치지 않도록 자동 재시도하지 않습니다. **이슈 만들기** 모드는 일반 이슈 태스크를 생성하므로 인프라 장애에 위 규칙을 적용해 재시도합니다. 두 모드 모두 자동화 실행 기록에서 최종 결과를 확인할 수 있습니다.
+
+이슈에 다른 활성 태스크가 없고 실행을 기다리는 새 재시도도 없다면 실패 시 `in_progress` 상태의 이슈가 `todo`로 돌아갑니다.
+
+## 실패 원인 참조
-**수동 재실행**은 CLI 또는 API(`POST /api/issues/{id}/rerun`)에서 직접 트리거하는 것입니다:
+실행 로그와 사용량 통계의 일반적인 실패 원인은 두 종류입니다. 접두사가 없는 이유 코드는 플랫폼이 기록하고, `agent_error.*`는 AI 코딩 도구의 오류를 분류한 값입니다.
+
+**플랫폼 측**
+
+| 원인 | 의미 | 처리 방법 |
+| --- | --- | --- |
+| `runtime_offline` | 실행 중 런타임이 오프라인이 됨 | 런타임을 복구한 뒤 재시도합니다. [데몬과 런타임](/daemon-runtimes) 참고 |
+| `queued_expired` | 2시간 넘게 큐에서 기다렸지만 런타임이 가져가지 않음 | 런타임이 온라인인지 확인한 뒤 재시도 |
+| `runtime_recovery` | 데몬 재시작 후 중단된 실행을 회수함 | 바로 재시도 |
+| `cancelled` | 수동으로 중지되었거나 보관 또는 삭제와 함께 취소됨 | 별도 처리 불필요 |
+| `timeout` | 데몬에 설정된 실행 시간 상한을 초과함 | 이슈 범위를 줄이거나 데몬의 `agent_timeout` 조정 |
+| `iteration_limit` | 실행 반복 횟수 상한에 도달함 | 이슈 범위 축소 |
+| `agent_blocked` | 에이전트가 계속 진행할 수 없다고 직접 보고함 | 댓글의 설명에 따라 정보 보충 |
+| `api_invalid_request` | 플랫폼 API가 잘못된 요청을 거부함 | 재시도하고 반복되면 문제 신고 |
+| `codex_semantic_inactivity` | Codex가 오랫동안 유효한 출력을 내지 않아 멈춘 것으로 판단됨 | 재시도하거나 Codex 정체 timeout 조정 |
+
+**도구 측(`agent_error.*`, 접두사 생략)**
+
+| 원인 | 의미 | 처리 방법 |
+| --- | --- | --- |
+| `provider_auth_or_access` | 모델 서비스 인증 실패 또는 접근 권한 없음(401/403) | 해당 AI 코딩 도구에 다시 로그인하거나 API key 확인 |
+| `provider_quota_limit` | 사용량 또는 잔액 소진(402) | 충전하거나 계정 변경 |
+| `provider_capacity_or_rate_limit` | rate limit 또는 용량 부족(429/529) | 나중에 재시도 |
+| `provider_server_error` | 모델 서비스 오류(5xx) | 나중에 재시도 |
+| `provider_network` | 모델 서비스와의 네트워크 오류 | 자동 재시도됩니다. 계속 발생하면 실행 컴퓨터의 네트워크 확인 |
+| `model_not_found_or_unavailable` | 모델이 없거나 현재 사용할 수 없음 | 에이전트 설정에서 사용 가능한 모델 선택 |
+| `context_overflow` | 컨텍스트가 모델 window를 초과함 | 이슈 범위를 줄이거나 입력 내용 축소 |
+| `missing_config` | API key 등 필수 설정이 없음 | 에이전트 환경 변수 또는 도구 설정 보완 |
+| `runtime_missing_executable` | AI 코딩 도구 실행 파일을 찾을 수 없음 | 도구를 다시 설치합니다. [AI 코딩 도구 설치](/install-agent-runtime) 참고 |
+| `runtime_version_unsupported` | AI 코딩 도구 버전이 너무 오래됨 | 도구 업그레이드 |
+| `process_failure` | 도구 프로세스가 비정상 종료됨 | 실행 로그에서 원인을 확인한 뒤 재시도 |
+| `empty_or_unparseable_output` | 도구 출력이 없거나 해석할 수 없음 | 재시도하고 반복되면 도구 설치 확인 |
+| `agent_timeout` | 도구가 오랫동안 응답하지 않아 종료됨 | 재시도하거나 이슈 범위 축소 |
+| `unknown` | 분류하지 못한 실패 | 실행 로그의 원본 오류 확인 |
+
+## 수동 재시도
+
+실행 로그에서 특정 줄의 재시도 버튼을 클릭하면 **당시 이 태스크를 실행한 에이전트**가 다시 호출됩니다. 이후 이슈 담당자가 바뀌었더라도 새 담당자를 사용하지 않습니다.
+
+재시도할 때 이전 실행이 로컬 디렉터리에 이미 기록한 파일을 가능한 한 유지합니다. 원래 세션이 계속 안전하고 같은 런타임이 태스크를 가져가면 이전 세션도 이어갑니다. 컨텍스트 overflow나 유효하지 않은 요청처럼 세션을 오염시키는 오류가 있었다면 원래 작업 디렉터리에서 새 세션을 시작합니다. 원래 디렉터리가 없으면 새 작업 디렉터리를 사용합니다.
+
+CLI로 현재 이슈를 다시 실행할 수도 있습니다.
```bash
multica issue rerun <issue-id>
```
-동작:
-
-- 기본적으로 이슈의 **현재 에이전트 담당자**를 대상으로 합니다 — 이전 작업을 누가 실행했는지와 무관하게 재실행이 현재 할당을 따르도록 하고 싶을 때 유용합니다.
-- 실행 로그의 특정 행에 있는 재시도 버튼은 해당 행의 작업 ID를 함께 전송하므로, 재실행은 **현재 담당자가 아니라 바로 그 작업을 실행했던 에이전트**를 대상으로 합니다. 덕분에 스쿼드 워커, 병렬 @-멘션 에이전트, 또는 재할당으로 인해 에이전트가 교체된 행에 대해서도 행 단위 재시도가 의미를 갖게 됩니다.
-- 이 이슈에 대한 대상 에이전트의 대기 중이거나 실행 중인 작업을 **취소합니다**(있는 경우). 같은 이슈에서 다른 에이전트가 소유한 작업(예: 병렬 @-멘션 실행)은 그대로 둡니다.
-- **완전히 새로운** 작업을 생성합니다 — 원본 작업이 시도 횟수 상한에 도달했더라도 시도 횟수가 1로 재설정됩니다.
-- **작업 디렉터리를 재사용하며, 세션 재개 여부는 어디에서 트리거했는지에 따라 달라집니다:**
- - **실행 로그의 행 단위 재시도**(task ID 포함): 해당 실행의 작업 디렉터리를 재사용하므로 디스크에 이미 기록된 파일이 보존됩니다. 그 실행의 세션도 재개합니다 — 단, 실패가 대화를 오염시킨 경우(컨텍스트 오버플로, 반복 한도, invalid request, Codex 시맨틱 무활동, 에이전트 폴백)에는 재사용한 작업 디렉터리 위에서 새 세션을 시작합니다. 원본 디렉터리가 사라진 경우(GC됨, 다른 런타임에 있음, 또는 기록되기 전에 실패)에는 새 작업 디렉터리로 폴백합니다. 따라서 네트워크 순간 장애, provider의 5xx / 속도 제한, 잠시 오프라인이 된 런타임, 이미 수정한 auth/할당량/설정 오류 같은 **일시적 실패**는 처음부터 다시 시작하지 않고 중단된 지점부터 이어집니다.
- - **task ID 없는 CLI / API 재실행**: 이어갈 특정 실행이 없으므로 **새 세션 + 새 작업 디렉터리**로 시작합니다.
-
-비교:
+이 방법은 특정 과거 태스크를 지정하지 않으므로 이슈의 현재 에이전트 담당자를 사용하고 새 세션과 작업 디렉터리에서 시작합니다.
-| 항목 | 자동 재시도 | 수동 재실행 |
-|---|---|---|
-| 트리거 | 시스템, 실패 사유 기반 | 사용자, 수동 |
-| 상한 | 2회 시도 | 제한 없음 |
-| 적용 가능한 소스 | 이슈, 채팅 | 에이전트 담당자가 있는 이슈 |
-| 선택되는 에이전트 | 실패한 작업과 동일한 에이전트 | 소스 작업의 에이전트(UI 행 단위 재시도) 또는 이슈의 현재 담당자(CLI / task_id 없음) |
-| 작업 디렉터리 | 재사용(이전 파일에서 이어감) | 행 단위 재시도: 아직 남아 있으면 재사용; CLI / task_id 없음: 새로 시작 |
-| 세션 상속 | 예(이전 세션 재개) | 행 단위 재시도: 실패가 대화를 오염시키지 않는 한 재개; CLI / task_id 없음: 새로 시작 |
+## 실행 완료와 이슈 완료
-## 실패한 작업이 이슈 상태에 미치는 영향
+`completed`는 이번 실행이 정상적으로 끝났다는 뜻일 뿐 이슈 목표가 확인되었다는 뜻은 아닙니다. 결과를 확인하고, 논의를 이어가고, 요구 사항을 보충하거나 에이전트를 다시 트리거할 수 있습니다.
-이슈가 에이전트에게 할당되어 트리거된 작업이 실패하면(그리고 자동 재시도가 성공하지 못하면), **이슈의 상태가 `in_progress`에서 `todo`로 자동으로 되돌아갑니다** — 그래서 보드를 열면 "이건 다시 봐야겠다"는 것을 즉시 알 수 있습니다. [이슈와 프로젝트](/issues)를 참고하세요.
+이슈의 완료 여부는 실제 작업 진행 상황과 이슈 상태를 기준으로 판단합니다.
-## 작업이 이전 컨텍스트에서 이어질 수 있는지
+## 상태와 timeout 빠른 참조
-가능합니다 — AI 코딩 도구가 세션 재개를 지원하는 한 그렇습니다.
+다음 수치는 서버 기본 설정이며 문제를 확인할 때 빠르게 비교할 수 있습니다.
-Multica는 작업 중에 세션 ID를 **두 번** 고정합니다: 시작 시 한 번(AI 도구가 첫 번째 시스템 메시지를 반환할 때), 종료 시 한 번(완료 또는 실패 시). 첫 번째는 데몬이 실행 도중 충돌하더라도 복구할 수 있게 해주고, 두 번째는 다음 **자동 재시도**와 **실행 로그의 행 단위 재시도**에서 재사용되어, 그 ID를 다시 전달함으로써 에이전트가 이전 대화와 파일 상태를 이어받게 합니다 — 단, 실패가 대화를 오염시킨 경우에는 작업 디렉터리만 재사용하고 새 세션을 시작합니다. **task ID 없는 CLI / API 재실행**은 새 세션 + 새 작업 디렉터리로 시작합니다 — [수동 재실행 vs. 자동 재시도](#manual-rerun-vs-automatic-retry)를 참고하세요.
+| 상태 | 의미 | timeout과 결과 |
+| --- | --- | --- |
+| `deferred` | 나중에 트리거되도록 예약됨 | 예정 시간이 되면 `queued`로 들어가고 이후 아래 규칙에 따라 시간을 계산합니다. |
+| `queued` | 런타임이 가져가기를 기다림 | **2시간** 넘게 수령되지 않으면 실패로 끝나며 자동 재시도하지 않습니다. |
+| `dispatched` | 런타임이 가져갔고 도구를 시작 중 | **5분** 넘게 머물면 실패로 처리합니다. |
+| `waiting_local_directory` | 로컬 디렉터리 잠금 해제를 기다림 | 별도 timeout이 없으며 디렉터리가 해제되면 시작 과정으로 돌아갑니다. |
+| `running` | AI 코딩 도구 실행 중 | 고정 시간 상한이 없습니다. 런타임 heartbeat로 생존을 판단하며 15초마다 heartbeat를 보냅니다. heartbeat를 잃은 런타임은 늦어도 약 3분 뒤 오프라인으로 판단되고 그 위의 태스크도 실패합니다. |
-하지만 **실제로 어떤 AI 코딩 도구가 이를 지원하는지**는 크게 다릅니다:
+자동 재시도는 아래의 일시적 장애만 포함하며 이슈 또는 대화에 연결된 태스크에만 적용됩니다. 자동화의 **실행만** 모드는 제외됩니다.
-- ✅ **실제 지원** — Antigravity, Claude Code, Codex, Copilot, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Pi
-- ❌ **지원 안 함** — Gemini
+| 자동 재시도 가능한 실패 원인 | 실행 횟수 상한 |
+| --- | --- |
+| 런타임 오프라인 | 기본 2회(첫 실행 + 재시도 1회) |
+| 데몬 재시작 후 회수 | 기본 2회 |
+| 플랫폼의 실행 timeout 판단 | 기본 2회 |
+| Codex가 오랫동안 유효한 출력을 내지 않음 | 기본 2회 |
+| 스킬 패키지 다운로드 실패 | 기본 2회(이때 에이전트 프로세스는 아직 시작하지 않았으며 내려받은 패키지는 로컬 캐시 사용) |
+| 도구 네트워크 중단 | 최대 3회, 마지막 실행은 약 5초 뒤 시작 |
-[제공자 매트릭스 → 세션 재개](/providers#session-resumption-who-really-supports-it)를 참고하세요.
+그 밖의 실패 원인(인증, 사용량, 설정, 모델 등)은 자동 재시도하지 않습니다. 원인을 해결한 뒤 수동으로 재시도해야 합니다.
-## 다음
+## 다음 단계
-- [제공자 매트릭스](/providers) — 16개 AI 코딩 도구 간의 기능 차이(정확한 세션 재개 상태 포함)
-- [에이전트에게 이슈 할당하기](/assigning-issues) / [댓글에서 에이전트 @-멘션하기](/mentioning-agents) / [채팅](/chat) / [오토파일럿](/autopilots) — 작업을 트리거하는 네 가지 방법
+- [데몬과 런타임](/daemon-runtimes) — 태스크가 어느 컴퓨터에서 실행되는지 알아봅니다.
+- [이슈를 에이전트에게 할당하기](/assigning-issues) — 이슈에서 실행을 시작합니다.
+- [에이전트 멘션하기](/mentioning-agents) — 댓글에서 요구 사항을 보충하거나 다른 에이전트를 참여시킵니다.
diff --git a/apps/docs/content/docs/tasks.mdx b/apps/docs/content/docs/tasks.mdx
index 38dec7d4b5..ab5383754d 100644
--- a/apps/docs/content/docs/tasks.mdx
+++ b/apps/docs/content/docs/tasks.mdx
@@ -1,119 +1,168 @@
---
title: Tasks
-description: The unit of work for every agent run, with a clear state machine, timeouts, and retry rules.
+description: How a single agent run is queued, runs, stops, and retries.
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-A **task** is the unit of every [agent](/agents) run — [assigning an issue to an agent](/assigning-issues), [@-mentioning an agent in a comment](/mentioning-agents), sending a message in [chat](/chat), or an [Autopilot](/autopilots) firing on schedule all produce a task. Multica puts it in a queue; a [daemon](/daemon-runtimes) picks it up and hands it off to the corresponding [AI coding tool](/providers), then writes the result back to the server when it finishes.
+Every time an agent starts working, Multica creates a **task**. It records what triggered the run, which agent it went to, how far it has progressed, and whether it ultimately succeeded.
-Tasks and [issues](/issues) are two different objects. A single issue can be assigned, @-mentioned, and manually rerun many times — each produces a **new** task.
+## Issues and tasks
-## The states a task goes through
+An issue holds the goal, discussion, assignee, and final status of a piece of work; a task records one agent run against that work.
-<Mermaid chart={`
-graph LR
- Q["Queued<br/>queued"] -->|daemon picks up| D["Dispatched<br/>dispatched"]
- D -->|agent starts| R["Running<br/>running"]
- R -->|success| C["Completed<br/>completed"]
- R -->|error or timeout| F["Failed<br/>failed"]
- Q -->|user cancels| X["Cancelled<br/>cancelled"]
- D -->|user cancels| X
- R -->|user cancels| X
- F -.retryable reason.-> Q
-`} />
+| | Issue | Task |
+| --- | --- | --- |
+| What it records | A piece of work moving forward | One agent run |
+| How long it lasts | Can be discussed, amended, and reassigned repeatedly | From trigger until completion, failure, or cancellation |
+| Cardinality | One issue can span many runs | Every run gets its own record |
-- **Queued** — the task was just created and is waiting for a daemon to pick it up
-- **Dispatched** — a daemon has claimed it and is starting the AI coding tool
-- **Running** — the AI coding tool is actually doing the work
-- **Completed** — finished successfully; the output (comments, code commits, status changes) is written back to the server
-- **Failed** — aborted with an error or timeout; if the failure reason is retryable, the task automatically returns to `queued` for another attempt
-- **Cancelled** — the user cancelled it
+So the same issue can be handed to different agents in turn, or run again after a failure. Each run produces a new task; earlier records are never overwritten.
-## What happens when a task times out
+## Trigger sources
-The Multica server scans every 30 seconds. Two kinds of timeout trigger a failure:
+Any of the following can trigger a run:
-| Situation | Timeout |
-|---|---|
-| Dispatched but never started (daemon picked it up but didn't launch the AI tool) | **5 minutes** |
-| Running too long | **2.5 hours** |
+- Assigning an issue to an agent or a squad.
+- Mentioning an agent in a comment.
+- Sending a message to an agent in chat.
+- An Autopilot firing on a schedule or from an external event.
-Both timeouts use failure reason `timeout` and **retry automatically** (next section). For the related runtime-missing check, see [Daemon and runtimes → When a runtime is marked offline](/daemon-runtimes#when-a-runtime-is-marked-offline).
+Different entry points provide different context, but execution works the same way: Multica creates a task, a runtime claims it, and the runtime invokes the AI coding tool the agent is configured with.
-## Which failures retry automatically, which don't
+## Execution lifecycle
-Failures fall into two categories: **retryable** and **non-retryable**.
+A task typically moves through these states:
-**Retryable** (Multica automatically requeues):
+| State | Meaning |
+| --- | --- |
+| `deferred` | Scheduled to fire later; enters the queue at the appointed time |
+| `queued` | Waiting for a runtime to claim it |
+| `dispatched` | A runtime has claimed it and is starting the AI coding tool |
+| `waiting_local_directory` | The target local directory is held by another run; waiting for the directory lock to release |
+| `running` | The AI coding tool is executing |
+| `completed` | The run finished normally |
+| `failed` | The run errored or was interrupted |
+| `cancelled` | The run was stopped manually |
-- `runtime_offline` — the daemon went missing after the task was dispatched
-- `runtime_recovery` — the daemon crashed and restarted, reclaiming tasks it didn't finish
-- `timeout` — runtime or dispatch timeout
+When the runtime is online, a new task usually starts quickly; if the runtime goes offline after the task enters the queue, the task stays queued until it recovers. A task left unclaimed for more than 2 hours ends as failed.
-**Non-retryable** (the task stays in failed):
+<Callout type="info">
+If the system already knows the target runtime is offline before triggering, some immediate actions report that the run cannot start right now instead of creating a task nothing can claim.
+</Callout>
-- `agent_error` — the AI coding tool itself reported an error (API error, quota exceeded, internal bug). Underlying problems aren't retried — that would loop forever.
+A runtime with a healthy heartbeat can execute long tasks; the server never force-ends a run just because it has been running for a while. The runtime decides whether the process has stalled based on actual activity; see [Environment variables](/environment-variables#daemon-configuration) for the relevant settings.
-Automatic retry also has two extra conditions:
+## Viewing run history
-1. **At most 2 attempts** — 1 original + 1 retry. If the retry also fails, no further retries, even if the reason is retryable.
-2. **Only for issue- and chat-triggered tasks** — Autopilot-triggered tasks do **not** retry automatically.
+Open an issue and go to the **Execution log** to see every task it has produced. Each row shows the trigger source, the executing agent, the state, and timing.
-<Callout type="warning">
-**Autopilot tasks don't retry automatically** by design. An Autopilot has its own firing cadence (e.g. daily); automatic retries on failure would overlap with the next scheduled run. If you need an immediate re-run after failure, use a manual rerun (next section).
+From here you can:
+
+- Open a run record to see the agent's messages, tool calls, and error output.
+- Stop tasks that are deferred, queued, starting, waiting for a local directory, or running.
+- Retry a failed or cancelled task.
-**How you'll know an Autopilot task failed**: a notification lands in your [Inbox](/inbox), and the associated issue's status reverts from `in_progress` back to `todo`. The [Autopilots](/autopilots) page also shows the latest run result per autopilot.
+![Run record: status timeline, agent summary, and individual tool calls](/images/docs/task-transcript.png)
+
+<Callout type="warning">
+Changing an issue's assignee or status does not stop a run that has already started. To interrupt one, stop the corresponding task in the execution log. Active tasks are cancelled along with an issue only when the issue is deleted.
</Callout>
-## Manual rerun vs. automatic retry
+## Failures and automatic retries
+
+Transient faults — a runtime going briefly offline, a daemon restart, an execution timeout, or a network interruption in the AI coding tool — can trigger an automatic retry. A regular task runs at most twice by default; tool network interruptions get up to three attempts.
+
+Errors returned by the agent itself are usually not retried automatically. Expired credentials, exhausted quota, misconfiguration, or a model unable to complete the request all need the cause fixed first, followed by a manual retry.
+
+An Autopilot's **run only** mode does not retry automatically, to avoid overlapping with the next scheduled run. The **create issue** mode produces regular issue tasks, so infrastructure failures still retry under the rules above. Both modes show their final result in the Autopilot run history.
+
+When an issue has no other active task and no new retry waiting to run, a failure moves an `in_progress` issue back to `todo`.
+
+## Failure reason reference
-A **manual rerun** is one you trigger from the CLI or the API (`POST /api/issues/{id}/rerun`):
+The failure reasons shown in the execution log and usage stats fall into two groups: unprefixed reason codes are recorded by the platform; `agent_error.*` codes are classified from the AI coding tool's own errors.
+
+**Platform side**
+
+| Reason | Meaning | What to do |
+| --- | --- | --- |
+| `runtime_offline` | The runtime went offline during the run | Restore the runtime and retry; see [Daemon and runtimes](/daemon-runtimes) |
+| `queued_expired` | Queued for over 2 hours with no runtime claiming it | Confirm the runtime is online, then retry |
+| `runtime_recovery` | The daemon reclaimed an interrupted run after restarting | Retry directly |
+| `cancelled` | Stopped manually, or cancelled along with an archive or delete | Nothing to do |
+| `timeout` | Exceeded the daemon's configured execution time limit | Narrow the issue scope, or adjust the daemon's `agent_timeout` |
+| `iteration_limit` | Hit the iteration cap for a run | Narrow the issue scope |
+| `agent_blocked` | The agent reported it cannot proceed | Provide what its comment asked for |
+| `api_invalid_request` | The platform API rejected an invalid request | Retry; report the problem if it recurs |
+| `codex_semantic_inactivity` | Codex produced no meaningful output for too long and was judged stalled | Retry, or adjust the Codex inactivity timeout |
+
+**Tool side (`agent_error.*`, prefix omitted)**
+
+| Reason | Meaning | What to do |
+| --- | --- | --- |
+| `provider_auth_or_access` | Model provider authentication failed or access denied (401/403) | Sign in again in that AI coding tool, or check the API key |
+| `provider_quota_limit` | Quota or balance exhausted (402) | Top up or switch accounts |
+| `provider_capacity_or_rate_limit` | Rate limited or out of capacity (429/529) | Retry later |
+| `provider_server_error` | Model provider server error (5xx) | Retry later |
+| `provider_network` | Network failure reaching the model provider | Retries automatically; check the executing machine's network if it persists |
+| `model_not_found_or_unavailable` | The model does not exist or is currently unavailable | Pick an available model in the agent settings |
+| `context_overflow` | Context exceeded the model window | Narrow the issue scope or reduce the input |
+| `missing_config` | Required configuration such as an API key is missing | Fill in the agent's environment variables or the tool configuration |
+| `runtime_missing_executable` | The AI coding tool's executable was not found | Reinstall the tool; see [Install AI coding tools](/install-agent-runtime) |
+| `runtime_version_unsupported` | The AI coding tool version is too old | Upgrade the tool |
+| `process_failure` | The tool process exited abnormally | Check the run record to locate the cause, then retry |
+| `empty_or_unparseable_output` | The tool produced no output, or output that could not be parsed | Retry; check the tool installation if it recurs |
+| `agent_timeout` | The tool was terminated after going unresponsive for too long | Retry or narrow the issue scope |
+| `unknown` | Unclassified failure | Check the raw error in the run record |
+
+## Manual retry
+
+Clicking the retry button on a row in the execution log invokes **the agent that ran that task at the time**. Even if the issue has since been reassigned, the retry does not switch to the new assignee.
+
+A retry keeps the files the previous run already wrote to the local directory whenever possible. If the original session is still safe and the same runtime claims the retry, it also continues the previous session. Errors that poison the session, such as context overflow or invalid requests, start a new session on top of the original working directory instead. When the original directory no longer exists, a fresh working directory is used.
+
+You can also rerun the current issue from the CLI:
```bash
multica issue rerun <issue-id>
```
-Behavior:
-
-- By default, targets the issue's **current agent assignee** — useful when you want the rerun to follow the current assignment regardless of who ran the prior task.
-- The execution-log retry button on a specific row sends that row's task ID alongside, so the rerun targets **the agent that ran that exact task** — not the current assignee. This makes per-row retry meaningful for squad workers, parallel @-mention agents, or rows whose agent has since been displaced by a reassignment.
-- **Cancels** the target agent's queued or running task on this issue (if any). Tasks owned by other agents on the same issue (e.g. parallel @-mention runs) are left alone.
-- Creates a **brand-new** task — attempt count resets to 1, even if the original task hit the attempt ceiling.
-- **Reuses the workdir; the session is resumed conditionally — and this depends on how you triggered the rerun:**
- - **Execution-log per-row retry** (carries a task ID): reuses that exact run's working directory, so files already written to disk are preserved. It resumes that run's agent session too — *unless* the failure poisoned the conversation (context overflow, iteration limit, invalid request, Codex semantic inactivity, agent fallback), in which case it starts a fresh session on top of the reused workdir. If the original directory is gone (garbage-collected, on a different runtime, or never recorded before the failure), it falls back to a fresh workdir. So a transient failure — a network blip, a provider 5xx / rate-limit, a runtime that briefly went offline, or an auth/quota/config error you've since fixed — continues from where it left off instead of starting over.
- - **CLI / API rerun without a task ID**: there is no specific run to continue, so it starts a **fresh agent session in a fresh workdir**.
-
-Comparison:
+This form does not point at a specific past task, so it uses the issue's current agent assignee and starts with a fresh session and working directory.
-| Dimension | Automatic retry | Manual rerun |
-|---|---|---|
-| Trigger | System, based on failure reason | You, manually |
-| Ceiling | 2 attempts | No limit |
-| Applicable sources | Issues, chat | Issues with an agent assignee |
-| Agent picked | Same agent as the failed task | Source task's agent (UI per-row retry) or issue's current assignee (CLI / no task_id) |
-| Workdir | Reused (continues from prior files) | Per-row retry: reused when it still exists; CLI / no task_id: fresh |
-| Session inheritance | Yes (resumes prior session) | Per-row retry: resumes unless the failure poisoned the conversation; CLI / no task_id: fresh |
+## Task completion and issue completion
-## How a failed task affects issue status
+`completed` only means this particular run ended normally — it does not confirm the issue's goal has been met. You can still review the result, keep discussing, add requirements, or trigger the agent again.
-If an issue-triggered task fails (and no automatic retry succeeds) because the issue was assigned to an agent, **the issue's status automatically rolls back from `in_progress` to `todo`** — so when you open the board you immediately see "this one needs another look." See [Issues and projects](/issues).
+Whether an issue is done is judged by the actual progress of the work and the issue's status.
-## Can a task continue from the previous context
+## State and timeout quick reference
-Yes — as long as the AI coding tool supports session resumption.
+The numbers below reflect the server's default configuration, for quick cross-checking while troubleshooting.
-Multica pins the session ID **twice** during a task: once at the start (when the AI tool returns its first system message), and once at the end (on completion or failure). The first lets the daemon recover if it crashes mid-run; the second is passed back to the next **automatic retry** and to an **execution-log per-row retry**, so the agent picks up the previous conversation and file state — unless the failure poisoned the conversation, in which case only the workdir is reused and a fresh session starts. A **CLI / API rerun without a task ID** starts a fresh session in a fresh workdir — see [Manual rerun vs. automatic retry](#manual-rerun-vs-automatic-retry).
+| State | Meaning | Timeout and consequence |
+| --- | --- | --- |
+| `deferred` | Scheduled to fire later | Enters `queued` at the scheduled time, then the rules below apply |
+| `queued` | Waiting for a runtime to claim it | Fails after **2 hours** unclaimed; not retried automatically |
+| `dispatched` | Claimed; the tool is starting | Treated as failed after more than **5 minutes** in this state |
+| `waiting_local_directory` | Waiting for the local directory lock to release | No timeout of its own; returns to the startup flow once the directory is released |
+| `running` | The AI coding tool is executing | No fixed duration cap; liveness follows the runtime heartbeat — one every 15 seconds; a runtime that loses its heartbeat is marked offline within about 3 minutes at the latest, and its tasks fail with it |
-But **which AI coding tools actually support this** varies a lot:
+Automatic retry covers only the transient faults below, and only applies to tasks attached to an issue or a chat (excluding the Autopilot **run only** mode):
-- ✅ **Real support** — Antigravity, Claude Code, Codex, Copilot, Cursor, Hermes, Kimi, Kiro CLI, OpenCode, OpenClaw, Pi
-- ❌ **No support** — Gemini
+| Auto-retryable failure reason | Attempt ceiling |
+| --- | --- |
+| Runtime offline | 2 by default (first run + 1 retry) |
+| Reclaimed after a daemon restart | 2 by default |
+| Platform-judged execution timeout | 2 by default |
+| Codex stalled with no meaningful output | 2 by default |
+| Skill bundle download failure | 2 by default (the agent process has not started at this point; already-downloaded bundles come from the local cache) |
+| Tool network interruption | Up to 3; the final attempt starts after a delay of about 5 seconds |
-See [Providers Matrix → Session resumption](/providers#session-resumption-who-really-supports-it).
+All other failure reasons (auth, quota, configuration, model, and so on) never retry automatically; fix the cause first, then retry manually.
-## Next
+## Next steps
-- [Providers Matrix](/providers) — capability differences across the 16 AI coding tools (including the exact session-resumption status)
-- [Assigning issues to agents](/assigning-issues) / [@-mentioning agents in comments](/mentioning-agents) / [Chat](/chat) / [Autopilots](/autopilots) — the four ways to trigger a task
+- [Daemon and runtimes](/daemon-runtimes) — which computer a task executes on.
+- [Assigning issues to agents](/assigning-issues) — trigger a run from an issue.
+- [Mentioning agents](/mentioning-agents) — add requirements in comments or bring in other agents.
diff --git a/apps/docs/content/docs/tasks.zh.mdx b/apps/docs/content/docs/tasks.zh.mdx
index 833b099528..7488dc5cbc 100644
--- a/apps/docs/content/docs/tasks.zh.mdx
+++ b/apps/docs/content/docs/tasks.zh.mdx
@@ -1,121 +1,168 @@
---
title: 执行任务
-description: 智能体每一次工作的单位,有明确的状态机、超时和重试规则。
+description: 了解智能体的一次执行如何排队、运行、停止和重试。
---
import { Callout } from "fumadocs-ui/components/callout";
-import { Mermaid } from "@/components/mermaid";
-**执行任务**(task)是 [智能体](/agents) 每一次工作的单位——把一个 [issue 分给智能体](/assigning-issues)、[在评论里 @提及智能体](/mentioning-agents)、在 [聊天](/chat) 里发一条消息、或者 [Autopilot](/autopilots) 到点触发,都会产生一个执行任务。Multica 把它放进队列,由 [守护进程](/daemon-runtimes) 领走后交给对应的 [AI 编程工具](/providers) 执行,结束时把结果写回服务器。
+每次智能体开始工作,Multica 都会创建一条**执行任务**(task)。它记录这次执行由什么触发、交给了哪个智能体、当前进行到哪里,以及最后是否成功。
-执行任务和 [issue](/issues) 是两层不同对象:一个 issue 可以反复分配、反复 @提及、手动重跑——每次都产生一个**新的**执行任务。
+## Issue 与执行任务
-## 一个任务会经过哪些状态
+Issue 保存一项工作的目标、讨论、负责人和最终状态;执行任务记录智能体对这项工作的一次执行。
-<Mermaid chart={`
-graph LR
- Q["排队中<br/>queued"] -->|daemon 领取| D["已派发<br/>dispatched"]
- D -->|agent 开始| R["运行中<br/>running"]
- R -->|成功| C["完成<br/>completed"]
- R -->|出错或超时| F["失败<br/>failed"]
- Q -->|用户取消| X["取消<br/>cancelled"]
- D -->|用户取消| X
- R -->|用户取消| X
- F -.可重试原因.-> Q
-`} />
+| | Issue | 执行任务 |
+| --- | --- | --- |
+| 记录什么 | 一项持续推进的工作 | 智能体的一次执行 |
+| 持续多久 | 可以反复讨论、补充和重新分配 | 从触发开始,到完成、失败或取消为止 |
+| 数量关系 | 一个 issue 可以包含多次执行 | 每次执行都有独立记录 |
-- **排队中(queued)**——任务刚创建,等待某个守护进程来领
-- **已派发(dispatched)**——守护进程领走了,正在启动对应的 AI 编程工具
-- **运行中(running)**——AI 编程工具在真正干活
-- **完成(completed)**——成功结束,产出(评论、代码提交、状态变化等)写回服务器
-- **失败(failed)**——出错或超时终止;如果失败原因可重试,会自动回到 `queued` 再来一次
-- **取消(cancelled)**——用户主动取消
+因此,同一个 issue 可以先后交给不同的智能体,也可以在一次失败后重新执行。每次都会产生新的 task,之前的记录不会被覆盖。
-## 任务超时会怎样
+## 触发来源
-Multica 服务器每 30 秒扫描一次,有两种超时会触发失败:
+以下操作都可能触发一次执行:
-| 什么情况 | 超时阈值 |
-|---|---|
-| 派发后迟迟不开始(守护进程领走但没启动 AI 工具)| **5 分钟** |
-| 正在运行但跑得太久 | **2.5 小时** |
+- 把 issue 分配给智能体或小队。
+- 在评论中提及智能体。
+- 在对话中向智能体发送消息。
+- 由自动化按计划或外部事件触发。
-两种超时的失败原因都是 `timeout`,**会自动重试**(下一节)。关联的运行时失联判定见 [守护进程与运行时 → 运行时什么时候被判定为离线](/daemon-runtimes#运行时什么时候被判定为离线)。
+不同入口提供的上下文不同,但执行方式相同:Multica 创建 task,运行时领取它,再调用智能体配置的 AI 编程工具。
-上面这层是**服务端的粗粒度兜底**——按任务启动时间算,不看任务是否还在活动。真正区分「卡死」和「正常的长任务」的是**本地守护进程**:它不再用固定墙钟时长砍任务(`MULTICA_AGENT_TIMEOUT` 默认 `0` = 不设上限),而是看活动——只要 agent 还在持续产出事件(消息、工具调用),守护进程就不会因为跑得久判它超时(服务端那条 2.5h 仍是外层上限)。只有真正静默卡死时才会被**空闲看门狗**(`MULTICA_AGENT_IDLE_WATCHDOG`,默认 30 分钟)终止;OpenCode 还会用更短的 `MULTICA_OPENCODE_IDLE_WATCHDOG`(默认 10 分钟)识别首 token 未到或流式回复中断。如果是某个工具调用发出后长时间无任何输出(疑似卡死的子进程),则由更大的**工具看门狗**预算(`MULTICA_AGENT_TOOL_WATCHDOG`,默认 2 小时)兜底。这类被看门狗终止的任务失败原因是 `idle_watchdog`,和墙钟 `timeout` 区分开。各参数见 [环境变量 → 守护进程的调节参数](/environment-variables#守护进程的调节参数)。
+## 执行过程
-## 哪些失败会自动重试,哪些不会
+一条 task 通常会经过以下状态:
-失败分两类:**可重试**和**不可重试**。
+| 状态 | 表示什么 |
+| --- | --- |
+| `deferred` | 已安排稍后触发,到达指定时间后进入队列 |
+| `queued` | 正在等待运行时领取 |
+| `dispatched` | 运行时已经领取,正在启动 AI 编程工具 |
+| `waiting_local_directory` | 目标本地目录正被另一条执行占用,等待目录锁释放 |
+| `running` | AI 编程工具正在执行 |
+| `completed` | 这次执行已正常结束 |
+| `failed` | 执行出错或中断 |
+| `cancelled` | 执行被手动停止 |
-**可重试**(Multica 自动重排队):
+运行时在线时,新 task 通常会很快开始;如果 task 入队后运行时离线,它会留在队列中等待恢复。排队超过 2 小时仍未被领取时,task 会以失败结束。
-- `runtime_offline`——任务派发后,守护进程失联了
-- `runtime_recovery`——守护进程崩溃重启,回收上次没跑完的任务
-- `timeout`——运行超时或派发超时
+<Callout type="info">
+如果系统在触发前已经知道目标运行时离线,部分即时操作会直接提示当前无法运行,而不是继续创建一条无法领取的 task。
+</Callout>
-**不可重试**(任务停在失败状态):
+心跳正常的运行时可以执行长时间任务,服务器不会仅因为运行时间较长就强制结束它。运行时会根据实际活动判断进程是否已经卡住;相关设置见[环境变量](/environment-variables#守护进程配置)。
-- `agent_error`——AI 编程工具自己报错(API 错误、超额度、内部 bug)。底层问题不重试,避免无限循环。
+## 查看执行记录
-自动重试有两个额外条件:
+打开 issue,在 **执行日志**中可以看到它产生的所有 task。每一行会显示触发来源、执行智能体、状态和时间。
-1. **最多 2 次**——1 次原任务 + 1 次重试。重试也失败就不再重试,即使原因可重试。
-2. **只对 issue 和聊天触发的任务生效**——Autopilots 触发的任务**不自动重试**。
+你可以在这里:
-<Callout type="warning">
-**Autopilots 任务不自动重试**是刻意设计。Autopilot 有自己的触发周期(例如每天一次);如果失败又自动重试,会和下一个周期的任务重叠。需要失败后立即重跑,用手动重跑(下一节)。
+- 打开执行记录,查看智能体的消息、工具调用和错误信息。
+- 停止已安排稍后触发、排队、启动、等待本地目录或运行中的 task。
+- 对失败或已取消的 task 发起重试。
+
+![执行记录:状态时间轴、智能体总结与逐条工具调用](/images/docs/task-transcript.png)
-**怎么知道 Autopilot 失败了**:失败的 Autopilot 任务会在你的 [收件箱](/inbox) 里出现一条通知,关联的 issue 状态也会从 `in_progress` 退回 `todo`。直接打开 [Autopilots](/autopilots) 页面也能看到每条 autopilot 的最近运行结果。
+<Callout type="warning">
+修改 issue 的负责人或状态不会停止已经开始的执行。需要中断时,在执行日志中停止对应的执行任务。删除 issue 时,关联的活动 task 才会一并取消。
</Callout>
-## 手动重跑和自动重试的区别
+## 失败与自动重试
+
+运行时短暂离线、守护进程重启、执行超时或 AI 编程工具网络中断等临时故障,可以触发自动重试。普通 task 默认最多执行两次;工具网络中断最多执行三次。
+
+智能体自身返回的错误通常不会自动重试。例如鉴权失效、额度不足、配置错误或模型无法完成请求,都需要先处理原因,再手动重试。
+
+自动化的**仅运行**模式不会自动重试,以免和下一次计划执行重叠。**创建 issue**模式产生的是普通 issue task,基础设施故障仍按上面的规则重试。两种模式都可以在自动化运行历史中查看最终结果。
+
+当一条 issue 上没有其他活动 task,也没有新的重试等待执行时,失败会让处于 `in_progress` 的 issue 回到 `todo`。
+
+## 失败原因参考
+
+执行日志和用量统计中常见的失败原因分两类:不带前缀的原因码由平台记录;`agent_error.*` 由 AI 编程工具的报错归类而来。
-**手动重跑**(rerun)是你通过命令行或 API(`POST /api/issues/{id}/rerun`)主动发起的:
+**平台侧**
+
+| 原因 | 含义 | 处理 |
+| --- | --- | --- |
+| `runtime_offline` | 执行期间运行时离线 | 恢复运行时后重试,见[守护进程与运行时](/daemon-runtimes) |
+| `queued_expired` | 排队超过 2 小时无运行时领取 | 确认运行时在线后重试 |
+| `runtime_recovery` | 守护进程重启后回收了中断的执行 | 直接重试 |
+| `cancelled` | 被手动停止,或随归档、删除一并取消 | 无需处理 |
+| `timeout` | 超过守护进程配置的执行时长上限 | 缩小 issue 范围,或调整守护进程的 `agent_timeout` |
+| `iteration_limit` | 达到执行轮次上限 | 缩小 issue 范围 |
+| `agent_blocked` | 智能体主动报告无法继续 | 按它在评论中的说明补充信息 |
+| `api_invalid_request` | 平台 API 拒绝了非法请求 | 重试;反复出现时报告问题 |
+| `codex_semantic_inactivity` | Codex 长时间无有效输出被判停滞 | 重试,或调整 Codex 停滞超时 |
+
+**工具侧(`agent_error.*`,前缀省略)**
+
+| 原因 | 含义 | 处理 |
+| --- | --- | --- |
+| `provider_auth_or_access` | 模型服务认证失败或无访问权限(401/403) | 在该 AI 编程工具中重新登录,或检查 API key |
+| `provider_quota_limit` | 配额或余额用尽(402) | 充值或更换账号 |
+| `provider_capacity_or_rate_limit` | 限流或容量不足(429/529) | 稍后重试 |
+| `provider_server_error` | 模型服务端错误(5xx) | 稍后重试 |
+| `provider_network` | 到模型服务的网络故障 | 会自动重试;持续出现时检查执行电脑的网络 |
+| `model_not_found_or_unavailable` | 模型不存在或当前不可用 | 在智能体设置中改选可用模型 |
+| `context_overflow` | 上下文超出模型窗口 | 缩小 issue 范围或减少输入内容 |
+| `missing_config` | 缺少 API key 等必需配置 | 补齐智能体环境变量或工具配置 |
+| `runtime_missing_executable` | 找不到 AI 编程工具的可执行文件 | 重新安装该工具,见[安装 AI 编程工具](/install-agent-runtime) |
+| `runtime_version_unsupported` | AI 编程工具版本过旧 | 升级该工具 |
+| `process_failure` | 工具进程异常退出 | 查看执行日志定位后重试 |
+| `empty_or_unparseable_output` | 工具无输出或输出无法解析 | 重试;反复出现时检查工具安装 |
+| `agent_timeout` | 工具长时间无响应被终止 | 重试或缩小 issue 范围 |
+| `unknown` | 未能归类的失败 | 查看执行日志中的原始报错 |
+
+## 手动重试
+
+在执行日志中点击某一行的重试按钮,会再次调用**当时执行这条 task 的智能体**。即使 issue 后来换了负责人,也不会改用新负责人。
+
+重试会尽量保留上一次已经写入本地目录的文件。如果原会话仍然安全,并且由同一个运行时领取,也会继续之前的会话。上下文溢出或无效请求等会污染会话的错误,则会在原工作目录上开启新会话。原目录已经不存在时,会改用新的工作目录。
+
+也可以通过 CLI 重新运行当前 issue:
```bash
multica issue rerun <issue-id>
```
-行为:
-
-- 默认跑的是 issue **当前的智能体分配人**——适用于希望 rerun 跟随当前分配人的场景。
-- 执行日志里某一行的 retry 按钮会把这一行的 task ID 一并发出,rerun 会**针对那一行原本的 agent**,而不是当前分配人。这让 squad worker、并行的 @-mention agent、或者已经被新分配人替代的旧任务行的 retry 按钮都能符合直觉地工作。
-- **取消**目标 agent 在这条 issue 上 queued / running 的任务(如果有)。同 issue 上其它 agent 的任务(例如 @-mention 触发的并行任务)不会被一起取消。
-- 创建一个**全新**的执行任务——尝试次数重置为 1,即使原任务已达最大尝试。
-- **复用工作目录;是否续接会话取决于你从哪里触发:**
- - **执行日志里某一行的 retry**(带 task ID):复用那一次执行的工作目录,磁盘上已经写好的文件会被保留;同时也会续接那次执行的会话——**除非**这次失败污染了对话(context 溢出、迭代上限、invalid request、Codex 语义无活动、agent fallback),这种情况下会在复用的工作目录上开一个全新会话。如果原目录已经不在了(被 GC、在另一台 runtime 上、或失败太早还没记录),则回退到全新目录。这样一来,网络抖动、provider 5xx / 限流、runtime 短暂离线、或你已经修好的 auth/额度/配置错误等**临时故障**就能从中断处继续,而不用从头再来。
- - **不带 task ID 的 CLI / API rerun**:没有具体某一次执行可续,因此**开一个全新会话 + 全新工作目录**。
-
-对比:
+这种方式没有指定某一条历史 task,因此会使用 issue 当前的智能体负责人,并从新的会话和工作目录开始。
-| 维度 | 自动重试 | 手动重跑 |
-|---|---|---|
-| 触发 | 系统基于失败原因自动执行 | 你主动发起 |
-| 上限 | 2 次 | 无上限 |
-| 适用来源 | issue、聊天 | 有智能体分配人的 issue |
-| 跑哪个 agent | 失败任务原本的 agent | UI 单行 retry:那一行任务的 agent;CLI / 不带 task_id:issue 当前的分配人 |
-| 工作目录 | 复用(接着上次的文件继续) | 单行 retry:原目录还在就复用;CLI / 不带 task_id:全新 |
-| 会话继承 | 是(接着上次会话) | 单行 retry:除非失败污染了对话,否则续接;CLI / 不带 task_id:全新 |
+## 执行完成与 issue 完成
-## 失败的任务对 issue 状态有什么影响
+`completed` 只表示这一次执行正常结束,不代表 issue 的目标已经得到确认。你仍然可以检查结果、继续讨论、补充要求或再次触发智能体。
-如果一个 issue 因为分配给智能体而触发的任务失败了(且没有自动重试成功),**issue 的状态会自动从 `in_progress` 退回 `todo`**——这样你打开看板时能立刻看到「这条需要再看看」。详见 [Issue 与 project](/issues)。
+Issue 是否完成,以实际工作进展和它的状态为准。
-## 任务能接着上次的上下文继续吗
+## 状态与超时速查
-可以——前提是对应的 AI 编程工具支持会话恢复。
+以下数字对应服务器的默认配置,供排查时快速对照。
-Multica 在任务过程中**两次**保存会话 ID——任务一开始(AI 工具返回第一条系统消息时)pin 一次,任务结束(完成或失败)时再 pin 一次。前者让守护进程中途崩溃时也能恢复,后者会被下一次**自动重试**以及**执行日志里的单行 retry**复用——把这个 ID 传回去,智能体就能接着上次的对话和文件状态继续;只有当这次失败污染了对话时,才只复用工作目录、另开全新会话。**不带 task ID 的 CLI / API rerun** 则从全新会话 + 全新工作目录开始——见 [手动重跑和自动重试的区别](#手动重跑和自动重试的区别)。
+| 状态 | 含义 | 超时与后果 |
+| --- | --- | --- |
+| `deferred` | 已安排稍后触发 | 到达预定时间后进入 `queued`,再按下面的规则计时 |
+| `queued` | 等待运行时领取 | 超过 **2 小时**未被领取即以失败结束,不会自动重试 |
+| `dispatched` | 运行时已领取,正在启动工具 | 停留超过 **5 分钟**按失败处理 |
+| `waiting_local_directory` | 等待本地目录锁释放 | 没有独立超时;目录释放后回到启动流程 |
+| `running` | AI 编程工具正在执行 | 不设固定时长上限;以运行时心跳判定存活,心跳每 15 秒一次,失去心跳的运行时最迟约 3 分钟被判为离线,其上的 task 随之失败 |
-但**哪些 AI 编程工具真的支持**差别很大:
+自动重试只覆盖以下临时故障,且仅适用于挂在 issue 或对话上的 task(自动化**仅运行**模式除外):
-- ✅ **真支持**——Antigravity、Claude Code、Codex、Copilot、Cursor、Hermes、Kimi、Kiro CLI、OpenCode、OpenClaw、Pi
-- ❌ **不支持**——Gemini
+| 可自动重试的失败原因 | 执行次数上限 |
+| --- | --- |
+| 运行时离线 | 默认 2 次(首次执行 + 1 次重试) |
+| 守护进程重启后回收 | 默认 2 次 |
+| 平台判定执行超时 | 默认 2 次 |
+| Codex 长时间无有效输出 | 默认 2 次 |
+| Skill 包下载失败 | 默认 2 次(此时智能体进程尚未启动,已下载的包走本地缓存) |
+| 工具网络中断 | 最多 3 次,最后一次延迟约 5 秒发起 |
-详见 [Providers Matrix → 会话恢复](/providers#会话恢复谁真的支持)。
+其余失败原因(鉴权、额度、配置、模型等)都不会自动重试,需要先处理原因再手动重试。
-## 下一步
+## 接下来
-- [Providers Matrix](/providers) —— 16 款 AI 编程工具的能力差异对照(包括会话恢复的精确状态)
-- [分配 issue 给智能体](/assigning-issues) / [在评论里 @智能体](/mentioning-agents) / [聊天](/chat) / [Autopilots](/autopilots) —— 触发执行任务的四种方式
+- [守护进程与运行时](/daemon-runtimes) — 了解 task 在哪台电脑上执行。
+- [分配 issue 给智能体](/assigning-issues) — 从 issue 发起一次执行。
+- [提及智能体](/mentioning-agents) — 在评论中补充要求或邀请其他智能体参与。
diff --git a/apps/docs/content/docs/triggering-agents.ja.mdx b/apps/docs/content/docs/triggering-agents.ja.mdx
new file mode 100644
index 0000000000..2e65ec7ab7
--- /dev/null
+++ b/apps/docs/content/docs/triggering-agents.ja.mdx
@@ -0,0 +1,25 @@
+---
+title: エージェントに仕事を任せる
+description: エージェントをトリガーする 4 つの方法と、トリガー後に進捗を確認する場所。
+---
+
+Multica では、エージェントが自分から作業を始めることはありません。すべての実行は、明示的なアクションによってトリガーされます。方法は 4 つあります。
+
+| 方法 | 適した場面 | 操作 |
+| --- | --- | --- |
+| **イシューの割り当て** | この作業をエージェントに最初から最後まで任せたい | [イシューをエージェントに割り当てます](/assigning-issues)。イシューが `todo` 以降のステータスにあれば即座に開始します |
+| **コメントでの @メンション** | イシューの担当者を変えずに、具体的な依頼を 1 件処理してもらいたい | [コメントで @メンションします](/mentioning-agents)。エージェントのコメントに返信して会話を続けることもできます |
+| **直接チャット** | イシューを作るまでもない質問や試行 | [エージェントとチャットを開始します](/chat)。メッセージ 1 件ごとに 1 回の実行がトリガーされます |
+| **オートパイロット** | 時刻や外部イベントに応じて自動で進めたい繰り返し作業 | [オートパイロットを作成します](/autopilots)。スケジュール、webhook、または手動でトリガーされます |
+
+4 つの方法には共通のルールがあります。
+
+- トリガーできるのは、自分に**実行権限がある**エージェントだけです。これはエージェントの Access 設定で決まり、ワークスペースのロールとは無関係です。
+- イシューからトリガーする前に、入力欄の下に**トリガープレビュー**が表示され、この内容が誰を起こすかが明示されます。どのエージェントもトリガーしたくないときは、`/note` でメモを残してください。
+- `backlog` にあるイシューは実行をトリガーしません。イシューを `todo` に移すと、割り当て済みのエージェントが開始します。
+
+## 進捗の確認
+
+トリガーのたびに 1 件の[タスク](/tasks)が作成されます。進捗は、トリガーした場所 — イシューのタイムラインまたはチャットウィンドウ — にリアルタイムで書き戻されます。実行ログでは、実行の全過程の確認、停止、リトライができます。
+
+実行がなかなか始まらない場合は、ランタイムがオフラインであることがほとんどです。[トラブルシューティング](/troubleshooting)のイシューが実行を開始しない場合のセクションに沿って確認してください。
diff --git a/apps/docs/content/docs/triggering-agents.ko.mdx b/apps/docs/content/docs/triggering-agents.ko.mdx
new file mode 100644
index 0000000000..db0854982f
--- /dev/null
+++ b/apps/docs/content/docs/triggering-agents.ko.mdx
@@ -0,0 +1,25 @@
+---
+title: 에이전트에게 작업 맡기기
+description: 에이전트를 트리거하는 네 가지 방법과 트리거한 뒤 진행 상황을 확인하는 방법을 설명합니다.
+---
+
+Multica의 에이전트는 스스로 작업을 시작하지 않습니다. 모든 실행은 명확한 동작으로 트리거되며, 다음 네 가지 방법을 사용할 수 있습니다.
+
+| 방법 | 적합한 상황 | 사용 방법 |
+| --- | --- | --- |
+| **이슈 할당** | 작업을 처음부터 끝까지 에이전트가 맡아야 할 때 | [이슈를 에이전트에게 할당](/assigning-issues)합니다. 이슈가 `todo` 이상의 상태이면 즉시 시작합니다. |
+| **댓글에서 @멘션** | 이슈의 담당자를 바꾸지 않고 구체적인 요청 하나를 처리하게 할 때 | [댓글에서 에이전트를 @멘션](/mentioning-agents)합니다. 에이전트의 댓글에 답글을 달아 대화를 이어갈 수도 있습니다. |
+| **직접 대화** | 이슈를 만들 필요가 없는 질문이나 간단한 시도 | [에이전트와 대화를 시작](/chat)합니다. 메시지를 보낼 때마다 한 번의 실행이 트리거됩니다. |
+| **오토파일럿** | 일정이나 외부 이벤트에 따라 반복해서 실행해야 하는 작업 | [오토파일럿을 만듭니다](/autopilots). 일정, webhook 또는 수동 실행으로 트리거할 수 있습니다. |
+
+네 가지 방법에는 다음 규칙이 공통으로 적용됩니다.
+
+- 워크스페이스 역할과 관계없이, 에이전트의 Access 설정에 따라 **실행 권한이 있는** 에이전트만 트리거할 수 있습니다.
+- 이슈에서 트리거하기 전에는 입력란 아래의 **트리거 미리 보기**에 이 내용으로 실행될 에이전트가 정확히 표시됩니다. 어떤 에이전트도 트리거하지 않고 메시지만 남기려면 `/note`를 사용하세요.
+- `backlog` 상태의 이슈는 실행을 트리거하지 않습니다. 이슈를 `todo`로 옮기면 할당된 에이전트가 작업을 시작합니다.
+
+## 진행 상황 확인
+
+트리거할 때마다 [태스크](/tasks)가 하나 만들어집니다. 진행 상황은 이슈의 타임라인이나 대화 창처럼 트리거가 시작된 곳에 실시간으로 표시됩니다. 실행 로그에서는 전체 실행 과정을 확인하고, 실행을 중지하거나 다시 시도할 수 있습니다.
+
+실행이 오래도록 시작되지 않는다면 대부분 런타임이 오프라인 상태입니다. [문제 해결](/troubleshooting)의 "태스크가 시작되지 않을 때" 절을 따라 확인하세요.
diff --git a/apps/docs/content/docs/triggering-agents.mdx b/apps/docs/content/docs/triggering-agents.mdx
new file mode 100644
index 0000000000..6e5e8598f9
--- /dev/null
+++ b/apps/docs/content/docs/triggering-agents.mdx
@@ -0,0 +1,25 @@
+---
+title: Put agents to work
+description: The four ways to trigger an agent, and where to check progress afterwards.
+---
+
+In Multica, agents do not start work on their own. Every run is triggered by an explicit action. There are four ways:
+
+| Method | Best for | How |
+| --- | --- | --- |
+| **Assign an issue** | The agent owns this work end to end | [Assign the issue to an agent](/assigning-issues); it starts immediately when the issue is in `todo` or a later status |
+| **@mention in a comment** | Ask an agent to handle one specific request without changing the issue's assignee | [@mention it in a comment](/mentioning-agents), or reply to the agent's comment to continue the conversation |
+| **Direct chat** | A question or a quick attempt that does not need an issue | [Start a chat with the agent](/chat); each message triggers one run |
+| **Autopilot** | Recurring work that should run on a schedule or on external events | [Create an autopilot](/autopilots), triggered by a schedule, a webhook, or manually |
+
+All four methods share these rules:
+
+- You can only trigger agents you **have permission to run**, determined by the agent's Access setting — not by your workspace role.
+- Before you trigger from an issue, a **trigger preview** under the input shows exactly who this content will wake; use `/note` to leave a message without triggering any agent.
+- Issues in `backlog` do not trigger runs; move the issue to `todo` and the assigned agent starts.
+
+## Watch progress
+
+Every trigger creates a [task](/tasks). Progress streams back to where you triggered it — the issue's timeline or the chat window; the execution log shows the full run and lets you stop or retry it.
+
+When a run takes long to start, the runtime is usually offline — check the section on tasks that do not start in [Troubleshooting](/troubleshooting).
diff --git a/apps/docs/content/docs/triggering-agents.zh.mdx b/apps/docs/content/docs/triggering-agents.zh.mdx
new file mode 100644
index 0000000000..6fe3fb99f7
--- /dev/null
+++ b/apps/docs/content/docs/triggering-agents.zh.mdx
@@ -0,0 +1,25 @@
+---
+title: 让智能体开始工作
+description: 触发智能体的四种方式,以及触发之后去哪里查看进展。
+---
+
+在 Multica 中,智能体不会自己开始工作。每一次执行都由一个明确的动作触发。共有四种方式:
+
+| 方式 | 适用场景 | 操作 |
+| --- | --- | --- |
+| **分配 issue** | 这项工作由智能体全程负责 | [分配 issue 给智能体](/assigning-issues),issue 处于 `todo` 或更靠后的状态时立即开始 |
+| **在评论中 @智能体** | 请智能体处理一条具体请求,不改变 issue 的负责人 | [在评论中 @它](/mentioning-agents),也可以直接回复智能体的评论继续对话 |
+| **直接对话** | 一个问题或一次尝试,不需要建 issue | [和智能体开始对话](/chat),每条消息触发一轮执行 |
+| **自动化** | 重复性工作,希望按时间或外部事件自动进行 | [创建自动化](/autopilots),由时间表、webhook 或手动触发 |
+
+四种方式共用以下规则:
+
+- 你只能触发自己**有权限运行**的智能体,由智能体的 Access 设置决定,与你的工作区角色无关。
+- 在 issue 中触发前,输入框下方会显示**触发预览**,明确列出这条内容会唤醒谁;不想触发任何智能体时,用 `/note` 留言。
+- 处于 `backlog` 的 issue 不会触发执行;把它移到 `todo` 后,已分配的智能体才会开始。
+
+## 查看进展
+
+每次触发都会创建一次[执行任务](/tasks)。进展会实时写回触发它的地方——issue 的时间线或对话窗口;在执行日志里可以查看完整过程、停止执行或重试。
+
+执行迟迟未开始时,多数是运行时不在线,按[故障排查](/troubleshooting)中"任务不开始"一节检查。
diff --git a/apps/docs/content/docs/troubleshooting.ja.mdx b/apps/docs/content/docs/troubleshooting.ja.mdx
index 2abb6a822c..78b851ea01 100644
--- a/apps/docs/content/docs/troubleshooting.ja.mdx
+++ b/apps/docs/content/docs/troubleshooting.ja.mdx
@@ -1,290 +1,219 @@
---
title: トラブルシューティング
-description: Multica をセルフホストする際によく遭遇する問題 — 症状、原因、診断方法、解決方法。
+description: 接続、実行、リアルタイム更新、メール、セルフホストサービスのよくある問題を診断します。
---
import { Callout } from "fumadocs-ui/components/callout";
-症状から問題を探してください。各項目では**症状 / 考えられる原因 / 診断方法 / 解決方法**を提供します。お使いの状況が一覧にない場合は、[GitHub](https://github.com/multica-ai/multica/issues) にイシューを登録してください。
-
-## デーモンがサーバーに接続できない
-
-**症状**: [`multica daemon`](/cli) の `status` コマンドが `offline` または `connection refused` を表示します。サーバーログに `/api/daemon/register` や `/api/daemon/heartbeat` のリクエストが見当たりません。デーモンの仕組みについては[デーモンとランタイム](/daemon-runtimes)を参照してください。
-
-**考えられる原因**:
-
-1. **`MULTICA_SERVER_URL` が誤ったアドレスを指している** — デフォルト値は `ws://localhost:8080/ws` で、セルフホスト時は自分のサーバーアドレスに変更する必要があります
-2. **ネットワーク / ファイアウォールによるブロック** — デーモンとサーバーが同じネットワークにいない、またはアウトバウンドトラフィックがブロックされている
-3. **トークンが期限切れまたは無効** — `multica login` を一度も実行していない、または PAT が取り消された
-4. **サーバーが登録を拒否した** — ログインしたアカウントが対象のワークスペースに所属していない(register が 403 を返す)
-5. **DNS 解決の失敗** — デーモンのマシンでホスト名が解決されない
-
-**診断方法**:
+まず、問題がどの層で起きているかを切り分けます。Multica サービス、デーモン、ランタイム、AI コーディングツールのどれかです。多くの場合、次のコマンドだけで最初の有効なエラーが見つかります:
```bash
-multica daemon logs --lines 100 # look for daemon-side errors
-echo $MULTICA_SERVER_URL # confirm the address is set
-curl -i http://<server-host>:8080/health # hit the server directly
-curl -i http://<server-host>:8080/readyz # include DB + migration readiness
-cat ~/.multica/config.json # verify api_token exists
-multica workspace list # confirm you're a member of the target workspace
+multica version
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-**解決方法**: 上記の各原因を 1 つずつ対処してください。最もよくある 2 つの解決策は、**`MULTICA_SERVER_URL` を変更してデーモンを再起動する**こと(`multica daemon restart`)と、**ログインし直す**こと(`multica logout && multica login`)です。
+セルフホストインスタンスでは、サービスを直接確認することもできます:
-## タスクが `queued` で止まる
-
-**症状**: エージェントにイシューを割り当てた後、イシューの状態はすぐに `in_progress` に変わりますが、長時間経ってもページにエージェント実行の兆候が見えません。`multica daemon status` はデーモンを `online` と表示しています。
+```bash
+curl -i https://api.example.com/health
+curl -i https://api.example.com/readyz
+```
-**考えられる原因**(頻度順):
+`/health` は API プロセスが応答していることだけを示します。`/readyz` はデータベースと migration も確認します。問題を報告するときは、エラー、関連ログ、CLI バージョン、OS を含め、トークンやメールアドレスなどの機微情報は提出前に取り除いてください。
-1. **エージェントの同時実行上限に到達** — このエージェントの `max_concurrent_tasks`(デフォルト 6)が、他の実行中タスクですでに埋まっている
-2. **同じイシューで同じエージェントの別タスクがまだ実行中** — 同じエージェント × 同じイシューは順次実行が強制されます(重複実行の防止)
-3. **エージェントがアーカイブされている** — アーカイブ後も新しいタスクはキューに入りますが、クレームできず、5 分後にタイムアウトします(code-issue G-01)
-4. **デーモンが現在のワークスペースにこのランタイムを登録していない** — デーモンを再起動するか、UI でランタイムを選択し直してください
-5. **デーモンの接続が切れた** — 直近 45 秒間ハートビートがありません。`daemon status` が `online` と表示されるのは、ごく最近切断された状態を反映している可能性があります
+## デーモンが接続できない
-**診断方法**:
+まず次を実行します:
```bash
-multica daemon status --output json # runtime list + last_seen_at
-multica agent list # check agent archived state
-multica issue show <issue-id> # inspect task history
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-サーバー側(セルフホスト)では、`"no_tasks"` / `"no_capacity"` を grep してクレームの結果を確認できます。
-
-**解決方法**:
+よくある原因:
-- 同時実行が満杯 → 実行中のタスクが終わるのを待つか、`multica agent update <id> --max-concurrent-tasks 10` で上限を引き上げてください
-- 同一イシューの順次実行 → 前のタスクが終わるのを待つか、別のエージェントに割り当て直してください
-- エージェントがアーカイブされている → `multica agent restore <id>`
-- ランタイム未登録 → `multica daemon restart` するとデーモンが再登録します
+- CLI がまだログインしていない、またはローカルに保存されたトークンが失効している。
+- デーモンが誤った Multica サービスに接続している。
+- 実行用コンピューターが API に到達できない、または DNS、TLS、ファイアウォールが接続を遮っている。
+- 現在のアカウントが対象ワークスペースのメンバーではなくなっている。
+- サポートされている AI コーディングツールがこのマシンに 1 つもインストールされておらず、デーモンが起動できない。
-## WebSocket が接続できない
+再ログインしてデーモンを再起動します:
-**症状**: ブラウザのコンソールに `WebSocket is closed` が記録されます。ページにリアルタイム更新(タスクの進捗、コメント、インボックス)が表示されず、再読み込みしないと見えません。バックエンドのタスクは引き続き実行されます。
-
-**考えられる原因**:
-
-1. **Origin チェックの失敗** — フロントエンドのドメインがサーバーの CORS 許可リストにありません。デフォルトの許可リストには `localhost:3000/5173/5174` のみが含まれ、公開インターネットでセルフホストするには `FRONTEND_ORIGIN` が必要です
-2. **プロトコルの不一致** — `https://` のフロントエンドには `wss://` が必要で、HTTP は `ws://` を使います
-3. **リバースプロキシが WebSocket アップグレードを有効にしていない** — Nginx / Envoy / HAProxy はデフォルトでは `Upgrade` ヘッダーを転送しません
-4. **JWT クッキーの期限切れまたは欠落** — 30 日の有効期限後にログインし直していない
+```bash
+multica login
+multica daemon restart
+```
-**診断方法**:
+セルフホストのデプロイでは、さらに**実行用コンピューター**から API の `/health` をリクエストしてください。サーバー本体でのテストでは、実行用コンピューター側の DNS、TLS、ファイアウォールの問題は見えません。アドレスを変更する場合は `multica setup self-host` を再実行するか、現在のプロファイルの `server_url` を確認します:
-- ブラウザの DevTools → Network → 「WS」でフィルタリングし、接続状態とステータスコードを確認してください
-- サーバーログで `"rejected origin"` / `"websocket"` を grep してください — origin の問題であれば明示的に表示されます
-- `curl -i http://<server-host>:8080/ws` は(`Upgrade` ヘッダー付きで)`101 Switching Protocols` を返すはずです
+```bash
+multica config show
+```
-**解決方法**:
+## イシューの実行が始まらない
-- Origin エラー → サーバーの `.env` に `FRONTEND_ORIGIN=https://multica.yourdomain.com` を設定(またはカンマ区切りの `CORS_ALLOWED_ORIGINS`)し、サーバーを再起動してください
-- プロトコルの不一致 → `FRONTEND_ORIGIN` のプロトコルがフロントエンドと一致しているか確認してください
-- リバースプロキシ → Nginx に `proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";` を追加してください
-- クッキーの期限切れ → ページを再読み込みしてログインし直してください
+イシューの**実行ログ**を開き、まずタスクの現在のステータスと待機理由を確認します。
-## メールが届かない
+### `queued` ステータス
-**症状**: ログインまたは招待の受諾中にメールアドレスを送信したのに、インボックスにもスパムフォルダにも認証コードがありません。
+`queued` は、タスクがまだランタイムに引き受けられるのを待っている状態です。順に確認します:
-**まず、サーバーがどのプロバイダーをアクティブと認識しているかを確認してください。** 起動時にバックエンドは次のいずれかを出力します。
+1. エージェントに紐付いたランタイムはオンラインか。
+2. ランタイムは、そのエージェントに設定された AI コーディングツールを検出しているか。
+3. エージェントに利用可能な同時実行枠が残っているか。
+4. デーモンに全体の実行キャパシティが残っているか。
-- `EmailService: SMTP relay <host>:<port> from=<addr>` — SMTP を使用(`SMTP_HOST` が空でなければ Resend より優先)
-- `EmailService: Resend API from=<addr>` — Resend を使用
-- `EmailService: DEV mode — codes printed to stdout …` — プロバイダーが構成されていない
+エージェントはデフォルトで最大 6 件、1 つのデーモンはデフォルトで最大 20 件のタスクを同時に実行します。上限に達すると、新しいタスクは実行中のものが終わるまでキューに残ります。ランタイムがオフラインの間もタスクはキューに残り続け、2 時間を超えて引き受けられなかった場合にのみ失敗します。
```bash
-docker compose -f docker-compose.selfhost.yml logs backend | grep "EmailService:"
+multica daemon status --output json
+multica agent get <agent-id>
+multica issue runs <issue-id>
```
-期待していた行が見当たらない場合は、環境変数がプロセスに届いていません。`.env` と `docker compose -f docker-compose.selfhost.yml exec backend env | grep -E 'RESEND_|SMTP_'` を確認してください。この起動ログの行には認証情報は一切記録されません。
-
-### Resend がアクティブなプロバイダーの場合
-
-**考えられる原因**:
-
-1. **`RESEND_API_KEY` が設定されていない** — サーバーは静かにフォールバックし、エラーを出さずに**コードを自身の stdout に書き込みます**。プロダクションで陥りやすい落とし穴です
-2. **Resend API キーが無効、またはクォータ超過** — サーバーログに `"failed to send verification code"` が表示されます
-3. **`RESEND_FROM_EMAIL` のドメインが Resend で検証されていない** — Resend が送信を拒否します
-4. **メールは送信されたが受信者の ISP にスパムと判定された** — Resend ダッシュボードとスパムフォルダを確認してください
+ランタイム一覧に期待するツールが表示されない場合は、まず同じシステムアカウントと `PATH` でツールが実行でき、ログイン済みであることを確認してから、`multica daemon restart` を実行してください。
-**診断方法**:
+### `waiting_local_directory` ステータス
-- サーバーログで `"[DEV] Verification code for"` を grep してください — これがある場合、Resend が構成されておらず、コードが stdout に書き込まれたことを意味します
-- [Resend ダッシュボード](https://resend.com/) → Emails で送信履歴を確認してください
-- `RESEND_FROM_EMAIL` のドメインが Resend コンソールの「Verified Domains」リストに表示されるか確認してください
+これは、進行中の別のタスクが同じローカルディレクトリを使っていることを意味します。2 つのエージェントが同じファイルを同時に変更しないよう、Multica はディレクトリロックの解放を待ちます。
-**解決方法**:
+通常は前のタスクが終わるのを待つだけで十分です。前のタスクが固まっている場合は、その実行ログから停止するか、現在のエージェントに別のローカルディレクトリを選んでください。このディレクトリの排他はデーモンがメモリ内で管理しており、ディスクにロックファイルは書き込まれません。ロック状態が異常だと疑われる場合は `multica daemon restart` で解放されます。手動で削除すべきファイルはありません。
-- API キーの欠落 → [サインインとサインアップの構成 → メールの仕組み](/auth-setup#how-email--verification-code-sign-in-works)に従って構成し、サーバーを再起動してください
-- ドメイン未検証 → Resend コンソールで DNS 検証フローを実行してください(SPF / DKIM レコードを追加)
-- 緊急時(内部テスト)→ サーバーログの `[DEV]` の下に出力されたコードをコピーしてください
+## AI コーディングツールが起動しない
-### SMTP がアクティブなプロバイダーの場合
+デーモンがオンラインでも、ツール自体が使えるとは限りません。その実行の詳細記録を開き、次を重点的に確認します:
-SMTP の経路はすべての失敗を失敗した段階とともにラップするため、サーバーログがすでにどの段階で relay がセッションを拒否したかを教えてくれます。`"failed to send verification email"` / `"failed to send invitation email"` を grep し、ラップされたエラーを確認してください。
+- ツールのログインが完了しているか。
+- API key、クォータ、モデルの権限が利用可能か。
+- エージェントが選択したモデルと思考レベルを、そのツールがサポートしているか。
+- ローカルの作業ディレクトリが存在し、書き込み可能か。
+- エージェントのカスタム引数や環境変数が有効か。
-| 記録されたエラー | 意味 | 解決方法 |
-|---|---|---|
-| `smtp dial <host>:<port>: dial tcp …: connect: connection refused` / `i/o timeout` | バックエンドコンテナが relay に到達できない — host が誤っている、port が誤っている、ファイアウォール、または relay が待ち受けていない | コンテナ内部から `SMTP_HOST` / `SMTP_PORT` が解決されるか確認してください(`docker compose -f docker-compose.selfhost.yml exec backend nslookup <host>` および `nc -vz <host> <port>`)。Multica を実行するホストから relay へのファイアウォールを開放してください |
-| `smtp starttls: x509: certificate signed by unknown authority`(または `certificate is not valid for any names`) | relay がプライベート CA / 自己署名証明書を使用しており、コンテナの信頼ストアがそれを拒否している | CA をコンテナにインストールするか、relay が信頼できるネットワークセグメント上で到達可能であることを確認したうえでのみ `SMTP_TLS_INSECURE=true` を設定してください |
-| `smtp auth: 535 5.7.8 Authentication credentials invalid`(または `534`/`530`) | `SMTP_USERNAME` / `SMTP_PASSWORD` が誤っている、または relay が `PLAIN` 以外の認証方式を要求している | メール管理者にサービスアカウントの認証情報を再確認してください。Exchange の匿名内部 relay の場合は両方を空のままにします(`SMTP_USERNAME=`、`SMTP_PASSWORD=`) |
-| `smtp MAIL FROM: 550 5.7.1 Client does not have permissions to send as this sender` | relay が `RESEND_FROM_EMAIL` をエンベロープ送信者として受け入れない — 典型的な Exchange の「anonymous users not allowed」または DMARC アラインメントの問題 | `RESEND_FROM_EMAIL` を relay が受け入れるドメインに設定してください。Exchange では receive connector で送信元 IP に `ms-Exch-SMTP-Accept-Any-Sender` を付与してください |
-| `smtp RCPT TO <addr>: 550 5.7.1 Unable to relay` | relay の receive connector が、あなたのサブネットから外部の受信者への中継を許可していない(外部ドメインと通信する匿名内部 relay で最も多い) | 招待を内部の受信者に制限するか、Multica ホストのサブネットを Exchange の「Anonymous Users → Relay」権限リストに追加してください |
-| `smtp DATA` / `smtp write body` / `smtp end data` | セッションは受け入れられたが relay が本文を破棄した — 通常はメッセージサイズ制限、コンテンツフィルタリング、または送信途中の接続リセットが原因 | relay のログで同じ `Message-ID`(ログには `<unixnano>@<host>` 形式)を確認してください。必要であればメッセージサイズの上限を引き上げてください |
+まず実行用コンピューターのターミナルで、同じツールを直接実行してください。ツール単体でも起動できない場合は、先にツールのログインや設定を修復してから、実行ログからタスクを再試行します。
-`MAIL FROM`、`RCPT TO`、`DATA` のエラーは常に relay の応答コードとともに記録されるため、反対側の Exchange / Postfix のログと突き合わせることができます。認証コードと招待トークンは、ラップされたエラーに**決して**含まれません。
+## リアルタイム更新が届かない
-**診断方法**:
+タスクは実行されるのに、コメントやステータスがリアルタイムに反映されない場合は、たいてい WebSocket がつながっていません。
-- 起動時に `"EmailService: SMTP relay"` を一度 grep し、ランタイムの失敗については `"failed to send"` を grep してください
-- バックエンドコンテナ内部から接続性を点検してください: `docker compose -f docker-compose.selfhost.yml exec backend sh -c 'nc -vz $SMTP_HOST $SMTP_PORT'`
-- 環境変数がプロセスに届いたか確認してください: `docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP_`(出力にパスワードが含まれるため、信頼できるシェルでのみ実行してください)
+ブラウザ開発者ツールの **Network → WS** で `/ws` 接続を確認します。セルフホストのデプロイでは、次を重点的に確認します:
-**解決方法**:
+- `FRONTEND_ORIGIN` が、ブラウザで実際に開いているアドレスと一致しているか。
+- HTTPS のページが `wss://` で接続しているか。
+- リバースプロキシが WebSocket の Upgrade リクエストを転送しているか。
+- ブラウザのログインが期限切れになっていないか。
-- host / port の誤り → `SMTP_HOST` / `SMTP_PORT` を調整してバックエンドを再起動してください。サポートされる relay モードは[認証設定 → Option B: SMTP relay](/auth-setup)を参照してください
-- 証明書の不一致 → relay の CA をコンテナにインストールするか、信頼できるネットワークセグメントで一時的に `SMTP_TLS_INSECURE=true` を設定してください
-- 認証の失敗 → 認証情報を再確認してください。匿名内部 relay の場合は `SMTP_USERNAME` と `SMTP_PASSWORD` を空のままにしてください
-- `Unable to relay` → 内部の受信者に制限するか、Exchange の receive connector で Multica ホストの IP に中継権限を付与してください
+コンテナは作成時にしか `.env` を読み込みません。変更後は再作成してください:
-## 固定のローカルテストコードが動作しない
-
-**症状**: セルフホストのインスタンスで `888888` のような固定のローカルテストコードでログインしようとしたところ、`invalid or expired code` で拒否されます。
+```bash
+docker compose -f docker-compose.selfhost.yml up -d
+```
-**考えられる原因**(相互に排他的):
+完全なリバースプロキシの例は[セルフホストクイックスタート](/self-host-quickstart#3-アクセス方法を選ぶ)を参照してください。
-1. **`MULTICA_DEV_VERIFICATION_CODE` が空** — 固定コードはデフォルトで無効です
-2. **`APP_ENV=production`** — これは**正しい**プロダクション構成です。固定のローカルテストコードはプロダクションでは無視されます
-3. **構成されたコードが 6 桁でない** — このショートカットは 6 桁の値のみを受け付けます
+## 認証コードや招待メールが届かない
-**診断方法**:
+まず backend の起動ログを確認します。ログには、現在使っているのが `SMTP relay`、`Resend API`、`DEV mode` のどれかが表示されます:
```bash
-cat .env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
-docker exec <container> env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "EmailService:"
```
-インボックス(スパムを含む)で実際の認証コードを確認してください。
+- **DEV mode**: メールは送信されず、認証コードと招待リンクは backend ログに書き込まれるだけです。
+- **Resend**: API key が有効で、送信元アドレスのドメインが検証済みであることを確認します。
+- **SMTP**: ホスト、ポート、資格情報、送信元アドレスを確認し、エラーログから失敗が接続、TLS、認証、配送のどの段階で起きたかを判断します。
-**解決方法**:
+`SMTP_HOST` と Resend が両方設定されている場合、Multica は SMTP を優先します。設定方法は[ログインとサインアップ](/auth-setup#メール認証コード)を参照してください。
-- プロダクションでは `MULTICA_DEV_VERIFICATION_CODE` を空のままにし、Resend を構成して実際のコードを使用してください
-- ローカル開発や内部テストの場合は、サーバーログから生成されたコードをコピーするか、`APP_ENV=development` と `MULTICA_DEV_VERIFICATION_CODE=888888` を設定してください — 公開インスタンスでは固定コードを絶対に有効にしないでください(詳細は[サインインとサインアップの構成 → 固定のローカルテストコード](/auth-setup#fixed-local-testing-codes)を参照)
+<Callout type="warning">
+プロダクションではログ内の認証コードに依存せず、固定のローカルテスト認証コードも有効にしないでください。
+</Callout>
-## 使用量ダッシュボードが 0 のままになる
+## 添付ファイルのアップロードやダウンロードが失敗する
-**症状**: エージェントはタスクを完了し、生のトークン使用量はデータベースに記録されていますが、**設定 → 使用量**と**設定 → ランタイム**で入力 / 出力 / コストがすべて 0 と表示されます。これは静かに発生する現象で、バックエンドログにエラーはありません。
+まず backend ログとレスポンスのステータスコードを確認します。よくある原因:
-**考えられる原因**:
+- リバースプロキシがリクエストボディのサイズを制限している。
+- ローカルのアップロードディレクトリが書き込み不可、または永続ボリュームがマウントされていない。
+- S3 の bucket、region、endpoint、資格情報が一致していない。
+- ダウンロード URL がプロキシを経由した後、誤った公開ドメインやプロトコルを使っている。
-1. **`rollup_task_usage_hourly()` がクレームされていない** — 使用量 / ランタイムのダッシュボードは派生テーブル `task_usage_hourly` から読み取り、このテーブルはその関数によって埋められます。MUL-2957 以降、バックエンドは DB バックドのスケジューラー(`sys_cron_executions`)を介してこの rollup をインプロセスで実行します。古いビルド、未適用の migration `113`、またはレプリカが残っていない長時間のバックエンド停止があると、最近の SUCCESS 行のないテーブルが残ることがあります。
-2. **`pg_cron` は互換性のために構成されているが誤ったデータベースを指している** — `pg_cron.database_name` のデフォルトは `postgres` です。Multica データベース名が異なる場合、スケジュールされたジョブは `rollup_task_usage_hourly()` を一切見つけられません。インプロセススケジューラーはこれに依存しませんが、もしインプロセススケジューラーを除去して `pg_cron` に依存している場合、DB 名は一致しなければなりません。
-3. **ハンドラーがクレームされているが静かにエラーを出している** — マイグレーションが部分的にしか適用されていないために SQL 関数が欠落している、あるいは DB ロール / search_path が誤って構成されている、など。`sys_cron_executions` の FAILED 監査行を確認してください。
+Docker Compose では、デフォルトの `backend_uploads` volume がローカル添付ファイルを保存します。コンテナの再作成では削除されませんが、`docker compose down -v` はデータボリュームを削除します。S3 関連の設定は[環境変数](/environment-variables#添付ファイルストレージ)を参照してください。
-**診断方法**:
+## 使用量(Usage)が 0 のまま
+
+Usage ページは 1 時間ごとのロールアップを読み取り、各タスクの生の使用量を直接読みません。まず生データとロールアップテーブルを確認します:
```sql
--- Confirm raw events exist but the hourly table is empty.
-SELECT count(*) AS raw_rows FROM task_usage;
-SELECT count(*) AS hourly_rows FROM task_usage_hourly;
-
--- Inspect the in-process scheduler's audit log.
-SELECT plan_time, status, attempt, runner_id,
- error_code, error_msg, started_at, finished_at
- FROM sys_cron_executions
- WHERE job_name = 'rollup_task_usage_hourly'
- ORDER BY plan_time DESC
- LIMIT 20;
-
--- Watermark — if this is 1970-01-01, the rollup has never run.
-SELECT watermark_at FROM task_usage_hourly_rollup_state;
-
--- Compatibility path: if you previously registered pg_cron, confirm
--- it is (or isn't) available and pointing at the right database.
-SELECT * FROM pg_available_extensions WHERE name = 'pg_cron';
-SHOW shared_preload_libraries;
-SELECT jobname, schedule, database, active FROM cron.job;
+SELECT count(*) FROM task_usage;
+SELECT count(*) FROM task_usage_hourly;
+
+SELECT plan_time, status, error_code, error_msg
+FROM sys_cron_executions
+WHERE job_name = 'rollup_task_usage_hourly'
+ORDER BY plan_time DESC
+LIMIT 20;
```
-**解決方法**:
-
-- 少なくとも 1 つのバックエンドレプリカでスケジューラーが実際に動作していることを確認してください — 30 秒ごとに `sys_cron_executions` の `rollup_task_usage_hourly` に SUCCESS 行が追加されているはずです。
-- SQL パスを検証するため、rollup を手動で一度呼び出してください: `SELECT rollup_task_usage_hourly();` — ダッシュボードを再読み込みしてください。数値が表示されれば SQL 関数は問題なく、スケジューラーのクレーム経路に問題があります。
-- migration `113_sys_cron_executions` がまだ適用されていない場合は、バックエンドを再起動してマイグレーションを実行するか、手動で `migrate up` を呼び出してください。
-- インプロセススケジューラー以前のレガシー `pg_cron` 履歴がある場合でも、SQL 関数は内部で advisory lock 4246 を保持するため二重書き込みは発生しません — オプションの `cron.unschedule` クリーンアップについては [セルフホストクイックスタート → 使用量ロールアップ](/self-host-quickstart#7-usage-rollup-no-operator-action-required) を参照してください。
+`task_usage` にデータがあり、ロールアップテーブルが空で、スケジューラーの記録が失敗を示している場合は、まず migration がすべて適用されていることを確認してください。migration 103 に拒否されてアップグレードできない場合は、次のセクションを参照してください。SQL の問題とスケジューリングの問題を切り分けるため、手動でロールアップを 1 回実行することもできます:
-## マイグレーション `103` が `refusing to drop legacy daily rollups` で失敗する
-
-**症状**: `v0.3.4` から `v0.3.5+` にアップグレードする際、バックエンドコンテナが起動しない(または `migrate up` が中断する)とともに、次のエラーが発生します。
-
-```text
-ERROR: refusing to drop legacy daily rollups:
- task_usage_hourly_rollup_state.watermark_at (1970-01-01 ...) trails
- task_usage latest event (...) by more than 01:00:00 — backfill is
- incomplete or pg_cron is not running. Run cmd/backfill_task_usage_hourly
- (and let pg_cron catch up) before re-running migrate
+```sql
+SELECT rollup_task_usage_hourly();
```
-**考えられる原因**: これはマイグレーション `103` の fail-closed ガードです。`task_usage_hourly` が生の `task_usage` に追いつくまで、レガシーの daily rollup の削除を拒否します。既存の行が存在し、rollup のウォーターマークがまだ epoch に留まっているとき — つまり、まだどの履歴も hourly テーブルに rollup されていないとき — にこのガードが発動します。
+手動実行後に数値が正しければ、ロールアップ関数は動作しており、問題は backend の定期スケジューリング側にあります。手動 SQL は 1 回分のロールアップを補うだけで、スケジューリングを復旧させません。1 時間ごとのロールアップは backend 内蔵のスケジューラーが実行するため、pg_cron を自分で設定する必要はありません。
-MUL-2957 以降、migrate コマンドは migration `103` を適用する直前に冪等な月別スライス backfill(advisory lock 4246 の下)を自動で実行するため、v0.3.4 → v0.3.5+ への直接アップグレードは単一の `migrate up` 呼び出しで完了します。それでもこのエラーが表示される場合は、MUL-2957 以前のバイナリを使用しているか、フック自体が失敗しています — 直前の `task_usage hourly rollup hook` 行で migrate ログを確認してください。
+## Migration 103 の失敗
-**解決方法**:
+通常のアップグレードでは、103 のために何かをする必要はありません。`migrate up` は適用前に過去の使用量データを自動でバックフィルします。空のデータベースはそのまま通過し、履歴のあるインスタンスは月ごとに補完されてから続行します。
-1. MUL-2957 以前のバイナリを使用しており、まずバイナリをアップグレードできない場合は、同じデータベースに対してスタンドアロンの backfill を実行してください(冪等であり、中断しても安全で、再実行しても安全です):
+それでも backend の起動が `refusing to drop legacy daily rollups` で失敗する場合は、自動バックフィルが完了していません(途中で失敗した、または `migrate up` を通さず SQL を直接適用した、など)。その場合はバックフィルコマンドを手動で実行し、完了後に backend を再起動します:
- ```bash
- # Docker Compose
- docker compose -f docker-compose.selfhost.yml exec backend \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
+```bash
+cd server
+DATABASE_URL='postgres://...' go run ./cmd/backfill_task_usage_hourly
+```
- # Kubernetes
- kubectl -n multica exec deploy/multica-backend -- \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
- ```
+よく使うフラグ: `--dry-run` は書き込まずプレビューのみ、`--sleep-between-slices` はスライスの間に間隔を挟み、負荷の高いインスタンスへの読み取り圧力を下げます。コマンドは月単位のスライスで動作し、冪等なので、中断してもそのまま再実行できます。advisory lock を保持してサーバー側の定期ロールアップと相互排他になるため、重複や不整合なロールアップデータは生じません。完了後は backend を再起動し、`/readyz` で `migrations` が `ok` になっていることを確認してください。
-2. アップグレードを再実行してください — バックエンドコンテナを再起動するだけで十分で、マイグレーションは起動時に実行されます。これでガードが最新のウォーターマークを確認し、`103` の適用を許可します。
-3. インプロセススケジューラーがウォーターマークを進め続けます — [セルフホストクイックスタート → 使用量ロールアップ](/self-host-quickstart#7-usage-rollup-no-operator-action-required) を参照してください。
+## ポートが使用中
-`--sleep-between-slices=2s` は、数年分の履歴を持つプロダクションデータベースにとって控えめなデフォルト値です。直近 N か月のみを保持し、それより古いバケットを永久に放棄してもかまわない場合は `--months-back N --force-partial` を使用してください。
+ローカルでよく使うポートは、API の `8080`、Web の `3000`、デーモンのヘルスチェックポートです。まず占有しているプロセスを特定します:
-## ポートの競合
+```bash
+lsof -nP -iTCP:8080 -sTCP:LISTEN # macOS / Linux
+netstat -ano | findstr :8080 # Windows
+```
-**症状**: `multica server` や `multica daemon start` が `address already in use` で失敗します。
+それが別の Multica チェックアウトであれば、まずそのディレクトリで `make stop` を実行してください。そうでなければ、占有しているプログラムを通常の方法で停止するか、現在のサービスのポートを変更します。公開ポートの 80/443 は、Caddy や Nginx などのリバースプロキシがリッスンします。
-**考えられる原因**:
+## ログの場所
-1. **サーバーポートが使用中**(デフォルト `8080`)
-2. **デーモンの health ポートが使用中**(デフォルト `19514`、プロファイルごとにハッシュでオフセット)
-3. **Web 開発サーバーのポート競合**(`3000` / `5173`)
-4. **ポートに対する権限不足**(`< 1024` の特権ポートのバインドには sudo が必要)
+| コンポーネント | 確認方法 |
+| --- | --- |
+| バックグラウンドのデーモン | `multica daemon logs --lines 100` |
+| デーモンログのリアルタイム追跡 | `multica daemon logs --follow` |
+| デフォルトプロファイルのログファイル | `~/.multica/daemon.log` |
+| デフォルトプロファイルの起動・クラッシュログ | `~/.multica/daemon.err.log` |
+| 名前付きプロファイル | `~/.multica/profiles/<name>/` 配下の対応するログ |
+| Docker backend | `docker compose -f docker-compose.selfhost.yml logs -f backend` |
+| ブラウザ | 開発者ツールの Console と Network |
-**診断方法**:
+デーモンの起動過程を直接観察したい場合は、フォアグラウンドで実行します:
```bash
-lsof -i :8080 # macOS / Linux
-netstat -ano | findstr :8080 # Windows
+multica daemon stop
+multica daemon start --foreground
```
-**解決方法**:
-
-- 競合しているプロセスを終了する(`kill -9 <PID>`)か、`PORT=9000` でポートを変更してください
-- 80 / 443 を使うには → 直接バインドせず、前段にリバースプロキシ(Nginx / Caddy)を置いて高位ポートへ転送してください
-
-## ログの場所
-
-| 構成要素 | 場所 | コマンド |
-|---|---|---|
-| **デーモン** | `~/.multica/daemon.log`(バックグラウンドモード)またはフォアグラウンドの stdout | `multica daemon logs -f --lines 100` |
-| **デーモン(クラッシュ)** | `~/.multica/daemon.err.log` | 直接開く——パニックや起動初期のエラーはここに記録されます |
-| **サーバー(Docker)** | コンテナの stdout | `docker logs -f <container>` |
-| **サーバー(systemd)** | journal | `journalctl -u multica-server -f` |
-| **フロントエンド(dev)** | `pnpm dev` を実行中のターミナル | 直接確認 |
-| **フロントエンド(ブラウザ)** | DevTools → Console | `F12` を押す |
+それでも特定できない場合は、[GitHub Issues](https://github.com/multica-ai/multica/issues) で既存の問題を検索するか、新しい issue を提出してください。
-バックグラウンドモードでは `daemon.log` はサイズでローテーションされ(デフォルトは 20MB × gzip バックアップ 5 世代。`MULTICA_DAEMON_LOG_MAX_SIZE_MB` / `_MAX_BACKUPS` / `_MAX_AGE_DAYS` で調整可能)、開けないほど大きくなることはありません。Go ランタイムのパニックや logger 初期化前のエラーは、独立した上限付きの `daemon.err.log` に出力されます。
+## 次のステップ
-より詳細なデーモンログが必要な場合は、デーモンをバックグラウンドからフォアグラウンドに移してください: `multica daemon stop && multica daemon start --foreground`。フォアグラウンドで実行すると、ログはローテーションファイルではなくターミナルにリアルタイムで出力されます。
+- [デーモンとランタイム](/daemon-runtimes) — ランタイムの登録とオンライン状態の仕組み。
+- [タスク](/tasks) — ステータス、タイムアウト、失敗理由のリファレンス。
+- [環境変数](/environment-variables) — セルフホスト設定の完全なリファレンス。
diff --git a/apps/docs/content/docs/troubleshooting.ko.mdx b/apps/docs/content/docs/troubleshooting.ko.mdx
index dbd20d77eb..ec6643501e 100644
--- a/apps/docs/content/docs/troubleshooting.ko.mdx
+++ b/apps/docs/content/docs/troubleshooting.ko.mdx
@@ -1,290 +1,219 @@
---
title: 문제 해결
-description: Multica를 자체 호스팅할 때 흔히 겪는 문제 — 증상, 원인, 진단 방법, 해결 방법.
+description: 연결, 실행, 실시간 업데이트, 이메일, 자체 호스팅 서비스의 일반적인 문제를 해결합니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-증상으로 문제를 찾아보세요. 각 항목은 **증상 / 가능한 원인 / 진단 방법 / 해결 방법**을 제공합니다. 여러분의 상황이 목록에 없다면 [GitHub](https://github.com/multica-ai/multica/issues)에 이슈를 등록하세요.
-
-## 데몬이 서버에 연결되지 않음
-
-**증상**: [`multica daemon`](/cli)의 `status` 명령이 `offline` 또는 `connection refused`를 표시합니다. 서버 로그에 `/api/daemon/register`나 `/api/daemon/heartbeat` 요청이 보이지 않습니다. 데몬 메커니즘이 어떻게 동작하는지는 [데몬과 런타임](/daemon-runtimes)을 참고하세요.
-
-**가능한 원인**:
-
-1. **`MULTICA_SERVER_URL`이 잘못된 주소를 가리킴** — 기본값은 `ws://localhost:8080/ws`이며, 자체 호스팅 시 여러분의 서버 주소로 변경해야 합니다
-2. **네트워크 / 방화벽 차단** — 데몬과 서버가 같은 네트워크에 있지 않거나, 아웃바운드 트래픽이 차단됨
-3. **토큰이 만료되었거나 유효하지 않음** — `multica login`을 한 번도 실행하지 않았거나, PAT이 취소됨
-4. **서버가 등록을 거부함** — 로그인한 계정이 대상 워크스페이스에 속해 있지 않음(register가 403을 반환)
-5. **DNS 해석 실패** — 데몬 기기에서 호스트명이 해석되지 않음
-
-**진단 방법**:
+먼저 문제가 Multica 서비스, 데몬, 런타임, AI 코딩 도구 중 어느 계층에서 발생하는지 확인하세요. 다음 명령만으로도 첫 번째 유효한 오류를 찾을 수 있는 경우가 많습니다.
```bash
-multica daemon logs --lines 100 # look for daemon-side errors
-echo $MULTICA_SERVER_URL # confirm the address is set
-curl -i http://<server-host>:8080/health # hit the server directly
-curl -i http://<server-host>:8080/readyz # include DB + migration readiness
-cat ~/.multica/config.json # verify api_token exists
-multica workspace list # confirm you're a member of the target workspace
+multica version
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-**해결 방법**: 위의 각 원인을 하나씩 처리하세요. 가장 흔한 두 가지 해결책은 **`MULTICA_SERVER_URL`을 변경하고 데몬을 재시작**하는 것(`multica daemon restart`)과 **다시 로그인**하는 것(`multica logout && multica login`)입니다.
+자체 호스팅 인스턴스에서는 서비스를 직접 확인할 수도 있습니다.
-## 작업이 `queued`에서 멈춤
-
-**증상**: 에이전트에게 이슈를 할당한 뒤 이슈 상태가 곧바로 `in_progress`로 바뀌지만, 오랜 시간이 지나도 페이지에 에이전트 실행의 흔적이 보이지 않습니다. `multica daemon status`는 데몬을 `online`으로 표시합니다.
+```bash
+curl -i https://api.example.com/health
+curl -i https://api.example.com/readyz
+```
-**가능한 원인**(빈도순):
+`/health`는 API 프로세스가 응답한다는 것만 확인하고, `/readyz`는 데이터베이스와 migration도 확인합니다. 문제를 신고할 때는 오류, 관련 로그, CLI 버전, 운영체제를 포함하고 token과 이메일 같은 민감 정보는 제출 전에 제거하세요.
-1. **에이전트 동시 실행 상한 도달** — 이 에이전트의 `max_concurrent_tasks`(기본값 6)가 이미 다른 실행 중인 작업들로 가득 참
-2. **같은 이슈에서 같은 에이전트의 다른 작업이 아직 실행 중** — 같은 에이전트 × 같은 이슈는 순차 실행이 강제됩니다(중복 실행 방지)
-3. **에이전트가 보관됨** — 보관 후에도 새 작업은 여전히 대기열에 들어가지만 클레임될 수 없으며, 5분 뒤 타임아웃됩니다(code-issue G-01)
-4. **데몬이 현재 워크스페이스에 이 런타임을 등록하지 않음** — 데몬을 재시작하거나 UI에서 런타임을 다시 선택하세요
-5. **데몬 연결 끊김** — 최근 45초 동안 하트비트가 없었습니다. `daemon status`가 `online`으로 보이는 것은 방금 끊긴 상태를 반영한 것일 수 있습니다
+## 데몬 연결 실패
-**진단 방법**:
+먼저 다음을 실행합니다.
```bash
-multica daemon status --output json # runtime list + last_seen_at
-multica agent list # check agent archived state
-multica issue show <issue-id> # inspect task history
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-서버 측(자체 호스팅)에서는 `"no_tasks"` / `"no_capacity"`를 grep하여 클레임 결과를 확인할 수 있습니다.
-
-**해결 방법**:
+일반적인 원인은 다음과 같습니다.
-- 동시 실행 가득 참 → 실행 중인 작업이 끝나기를 기다리거나, `multica agent update <id> --max-concurrent-tasks 10`으로 상한을 올리세요
-- 같은 이슈 순차 실행 → 이전 작업이 끝나기를 기다리거나, 다른 에이전트에게 다시 할당하세요
-- 에이전트 보관됨 → `multica agent restore <id>`
-- 런타임 미등록 → `multica daemon restart`하면 데몬이 다시 등록합니다
+- CLI에 아직 로그인하지 않았거나 로컬에 저장된 token이 만료됨
+- 데몬이 잘못된 Multica 서비스에 연결됨
+- 실행 컴퓨터에서 API에 접근할 수 없거나 DNS, TLS, 방화벽이 연결을 차단함
+- 현재 계정이 대상 워크스페이스에서 나감
+- 로컬에 지원되는 AI 코딩 도구가 하나도 설치되지 않아 데몬을 시작할 수 없음
-## WebSocket이 연결되지 않음
+다시 로그인하고 데몬을 다시 시작합니다.
-**증상**: 브라우저 콘솔에 `WebSocket is closed`가 기록됩니다. 페이지에 실시간 업데이트(작업 진행 상황, 댓글, 인박스)가 표시되지 않아 새로고침해야 보입니다. 백엔드 작업은 여전히 실행됩니다.
-
-**가능한 원인**:
-
-1. **Origin 검사 실패** — 여러분의 프런트엔드 도메인이 서버의 CORS 허용 목록에 없습니다. 기본 허용 목록에는 `localhost:3000/5173/5174`만 포함되며, 공개 인터넷에서 자체 호스팅하려면 `FRONTEND_ORIGIN`이 필요합니다
-2. **프로토콜 불일치** — `https://` 프런트엔드에는 `wss://`가 필요하고, HTTP는 `ws://`를 사용합니다
-3. **리버스 프록시가 WebSocket 업그레이드를 활성화하지 않음** — Nginx / Envoy / HAProxy는 기본적으로 `Upgrade` 헤더를 전달하지 않습니다
-4. **JWT 쿠키 만료 또는 누락** — 30일 만료 후 다시 로그인하지 않음
+```bash
+multica login
+multica daemon restart
+```
-**진단 방법**:
+자체 호스팅 환경에서는 **실행 컴퓨터**에서 API의 `/health`도 요청해야 합니다. 서버 컴퓨터에서의 테스트만으로는 실행 컴퓨터 측 DNS, TLS, 방화벽 문제를 찾을 수 없습니다. 주소를 바꿔야 하면 `multica setup self-host`를 다시 실행하거나 현재 profile의 `server_url`을 확인하세요.
-- 브라우저 DevTools → Network → "WS"로 필터링하여 연결 상태와 상태 코드를 확인하세요
-- 서버 로그에서 `"rejected origin"` / `"websocket"`을 grep하세요 — origin 문제라면 명시적으로 표기됩니다
-- `curl -i http://<server-host>:8080/ws`는 `101 Switching Protocols`를 반환해야 합니다(`Upgrade` 헤더 포함)
+```bash
+multica config show
+```
-**해결 방법**:
+## 이슈 실행이 시작되지 않음
-- Origin 오류 → 서버의 `.env`에 `FRONTEND_ORIGIN=https://multica.yourdomain.com`을 설정(또는 쉼표로 구분한 `CORS_ALLOWED_ORIGINS`)하고 서버를 재시작하세요
-- 프로토콜 불일치 → `FRONTEND_ORIGIN`의 프로토콜이 프런트엔드와 일치하는지 확인하세요
-- 리버스 프록시 → Nginx에 `proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";`를 추가하세요
-- 쿠키 만료 → 페이지를 새로고침하고 다시 로그인하세요
+이슈의 **실행 로그**를 열고 실행 태스크의 현재 상태와 대기 이유를 먼저 확인합니다.
-## 이메일이 수신되지 않음
+### `queued` 상태
-**증상**: 로그인 또는 초대 수락 중 이메일을 제출했는데, 인박스에도 스팸 폴더에도 인증 코드가 없습니다.
+`queued`는 실행 태스크가 런타임에 수령되기를 기다리고 있다는 뜻입니다. 다음 순서로 확인하세요.
-**먼저 서버가 어떤 제공자를 활성 상태로 인식하는지 확인하세요.** 시작 시 백엔드는 다음 중 하나를 출력합니다:
+1. 에이전트에 연결된 런타임이 온라인인지
+2. 런타임이 에이전트에 설정된 AI 코딩 도구를 감지했는지
+3. 에이전트에 사용 가능한 동시 실행 용량이 남아 있는지
+4. 데몬에 전체 실행 용량이 남아 있는지
-- `EmailService: SMTP relay <host>:<port> from=<addr>` — SMTP 사용(`SMTP_HOST`가 비어 있지 않으면 Resend보다 우선)
-- `EmailService: Resend API from=<addr>` — Resend 사용
-- `EmailService: DEV mode — codes printed to stdout …` — 제공자가 구성되지 않음
+에이전트 한 명은 기본적으로 실행 태스크를 최대 6개까지 동시에 실행하고 데몬 하나는 최대 20개까지 실행합니다. 상한에 도달하면 새 실행 태스크는 큐에 남아 기존 실행이 끝난 뒤 시작됩니다. 런타임이 오프라인이어도 실행 태스크는 계속 대기하며 2시간 넘게 수령되지 않을 때만 실패합니다.
```bash
-docker compose -f docker-compose.selfhost.yml logs backend | grep "EmailService:"
+multica daemon status --output json
+multica agent get <agent-id>
+multica issue runs <issue-id>
```
-기대했던 줄이 보이지 않는다면 환경 변수가 프로세스에 도달하지 않은 것입니다 — `.env`와 `docker compose -f docker-compose.selfhost.yml exec backend env | grep -E 'RESEND_|SMTP_'`를 확인하세요. 이 시작 로그 줄에는 자격 증명이 절대 기록되지 않습니다.
-
-### Resend가 활성 제공자일 때
-
-**가능한 원인**:
+런타임 목록에 예상한 도구가 없다면 같은 시스템 계정과 `PATH`에서 도구가 실행되고 로그인되어 있는지 확인한 뒤 `multica daemon restart`를 실행합니다.
-1. **`RESEND_API_KEY`가 설정되지 않음** — 서버는 조용히 폴백하여 **코드를 자체 stdout에 기록**하며 오류를 내지 않습니다. 프로덕션에서 쉽게 빠질 수 있는 함정입니다
-2. **Resend API 키가 유효하지 않거나 할당량 소진** — 서버 로그에 `"failed to send verification code"`가 표시됩니다
-3. **`RESEND_FROM_EMAIL`의 도메인이 Resend에서 검증되지 않음** — Resend가 발송을 거부합니다
-4. **이메일은 발송되었으나 수신자 ISP가 스팸으로 표시** — Resend 대시보드와 스팸 폴더를 확인하세요
+### `waiting_local_directory` 상태
-**진단 방법**:
+다른 실행 중 태스크가 같은 로컬 디렉터리를 사용하고 있다는 뜻입니다. Multica는 두 에이전트가 같은 파일을 동시에 수정하지 않도록 디렉터리 잠금이 해제되기를 기다립니다.
-- 서버 로그에서 `"[DEV] Verification code for"`를 grep하세요 — 있다면 Resend가 구성되지 않았고 코드가 stdout에 기록된 것입니다
-- [Resend 대시보드](https://resend.com/) → Emails에서 발송 이력을 확인하세요
-- `RESEND_FROM_EMAIL`의 도메인이 Resend 콘솔의 "Verified Domains" 목록에 나타나는지 확인하세요
+일반적으로 앞선 실행 태스크가 끝날 때까지 기다리면 됩니다. 앞선 태스크가 멈췄다면 해당 실행 로그에서 중지할 수 있고, 현재 에이전트에 다른 로컬 디렉터리를 선택할 수도 있습니다. 이 디렉터리 상호 배제는 데몬이 메모리에서 관리하며 디스크에 lock 파일을 쓰지 않습니다. 잠금 상태가 비정상이라고 의심되면 `multica daemon restart`를 실행해 해제하세요. 직접 삭제해야 할 파일은 없습니다.
-**해결 방법**:
+## AI 코딩 도구 시작 실패
-- API 키 누락 → [로그인 및 회원가입 구성 → 이메일 동작 방식](/auth-setup#how-email--verification-code-sign-in-works)을 따라 구성한 뒤 서버를 재시작하세요
-- 도메인 미검증 → Resend 콘솔에서 DNS 검증 절차를 진행하세요(SPF / DKIM 레코드 추가)
-- 긴급 상황(내부 테스트) → 서버 로그에서 `[DEV]` 아래에 출력된 코드를 복사하세요
+데몬이 온라인이어도 도구 자체를 사용할 수 있다는 뜻은 아닙니다. 이번 실행의 상세 기록을 열고 다음 항목을 중점적으로 확인하세요.
-### SMTP가 활성 제공자일 때
+- 도구 로그인이 완료되었는지
+- API key, 사용량, 모델 권한을 사용할 수 있는지
+- 에이전트가 선택한 모델과 사고 단계가 해당 도구에서 지원되는지
+- 로컬 작업 디렉터리가 존재하고 쓰기 가능한지
+- 에이전트의 사용자 지정 인수와 환경 변수가 유효한지
-SMTP 경로는 모든 실패를 실패한 단계와 함께 감싸므로, 서버 로그가 이미 relay가 어느 단계에서 세션을 거부했는지 알려줍니다. `"failed to send verification email"` / `"failed to send invitation email"`을 grep하고 감싸진 오류를 확인하세요:
+먼저 실행 컴퓨터의 터미널에서 같은 도구를 직접 실행하세요. 도구 자체도 시작할 수 없다면 도구 로그인 또는 설정을 먼저 수정하고 실행 로그에서 실행 태스크를 재시도합니다.
-| 기록된 오류 | 의미 | 해결 방법 |
-|---|---|---|
-| `smtp dial <host>:<port>: dial tcp …: connect: connection refused` / `i/o timeout` | 백엔드 컨테이너가 relay에 도달할 수 없음 — 잘못된 host, 잘못된 port, 방화벽, 또는 relay가 수신 대기 중이 아님 | 컨테이너 내부에서 `SMTP_HOST` / `SMTP_PORT`가 해석되는지 확인하세요(`docker compose -f docker-compose.selfhost.yml exec backend nslookup <host>` 및 `nc -vz <host> <port>`). Multica를 실행하는 호스트에서 relay로 향하는 방화벽을 여세요 |
-| `smtp starttls: x509: certificate signed by unknown authority`(또는 `certificate is not valid for any names`) | relay가 사설 CA / 자체 서명 인증서를 사용하며, 컨테이너의 신뢰 저장소가 이를 거부함 | CA를 컨테이너에 설치하거나, relay가 신뢰할 수 있는 네트워크 구간에서 도달 가능함을 확인한 후에만 `SMTP_TLS_INSECURE=true`를 설정하세요 |
-| `smtp auth: 535 5.7.8 Authentication credentials invalid`(또는 `534`/`530`) | `SMTP_USERNAME` / `SMTP_PASSWORD`가 잘못되었거나, relay가 `PLAIN`이 아닌 다른 인증 방식을 요구함 | 메일 관리자에게 서비스 계정 자격 증명을 다시 확인하세요. Exchange 익명 내부 relay의 경우 둘 다 비워 두세요(`SMTP_USERNAME=`, `SMTP_PASSWORD=`) |
-| `smtp MAIL FROM: 550 5.7.1 Client does not have permissions to send as this sender` | relay가 `RESEND_FROM_EMAIL`을 봉투 발신자로 수락하지 않음 — 전형적인 Exchange "anonymous users not allowed" 또는 DMARC 정렬 문제 | `RESEND_FROM_EMAIL`을 relay가 수락하는 도메인으로 설정하세요. Exchange에서는 receive connector에서 원본 IP에 `ms-Exch-SMTP-Accept-Any-Sender`를 부여하세요 |
-| `smtp RCPT TO <addr>: 550 5.7.1 Unable to relay` | relay의 receive connector가 여러분의 서브넷이 외부 수신자에게 중계하는 것을 허용하지 않음(외부 도메인과 통신하는 익명 내부 relay에서 가장 흔함) | 초대를 내부 수신자로 제한하거나, Multica 호스트의 서브넷을 Exchange "Anonymous Users → Relay" 권한 목록에 추가하세요 |
-| `smtp DATA` / `smtp write body` / `smtp end data` | 세션은 수락되었으나 relay가 본문을 폐기함 — 보통 메시지 크기 제한, 콘텐츠 필터링, 또는 전송 중 연결 재설정 때문 | relay 로그에서 동일한 `Message-ID`(로그에는 `<unixnano>@<host>` 형식)를 확인하세요. 필요하면 메시지 크기 제한을 높이세요 |
+## 실시간 업데이트가 작동하지 않음
-`MAIL FROM`, `RCPT TO`, `DATA` 오류는 항상 relay의 응답 코드와 함께 기록되므로 반대편의 Exchange / Postfix 로그와 대조할 수 있습니다. 인증 코드와 초대 토큰은 감싸진 오류에 **절대** 포함되지 않습니다.
+태스크는 실행되지만 댓글과 상태가 실시간으로 나타나지 않는다면 일반적으로 WebSocket이 연결되지 않은 것입니다.
-**진단 방법**:
+브라우저 개발자 도구의 **Network → WS**에서 `/ws` 연결을 확인합니다. 자체 호스팅 환경에서는 특히 다음 항목을 확인하세요.
-- 시작 시 `"EmailService: SMTP relay"`를 한 번 grep하고, 런타임 실패에 대해서는 `"failed to send"`를 grep하세요
-- 백엔드 컨테이너 내부에서 연결성을 점검하세요: `docker compose -f docker-compose.selfhost.yml exec backend sh -c 'nc -vz $SMTP_HOST $SMTP_PORT'`
-- 환경 변수가 프로세스에 도달했는지 확인하세요: `docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP_`(출력에 비밀번호가 포함되므로 신뢰할 수 있는 셸에서만 실행하세요)
+- `FRONTEND_ORIGIN`이 브라우저에서 실제로 연 주소와 같은지
+- HTTPS 페이지가 `wss://`로 연결되는지
+- reverse proxy가 WebSocket Upgrade 요청을 전달하는지
+- 브라우저 로그인이 만료되었는지
-**해결 방법**:
+컨테이너는 생성될 때만 `.env`를 읽으므로 수정 후 다시 생성해야 합니다.
-- 잘못된 host / port → `SMTP_HOST` / `SMTP_PORT`를 조정하고 백엔드를 재시작하세요. 지원되는 relay 모드는 [인증 설정 → Option B: SMTP relay](/auth-setup)를 참고하세요
-- 인증서 불일치 → relay의 CA를 컨테이너에 설치하거나, 신뢰할 수 있는 네트워크 구간에서 임시로 `SMTP_TLS_INSECURE=true`를 설정하세요
-- 인증 실패 → 자격 증명을 다시 확인하세요. 익명 내부 relay의 경우 `SMTP_USERNAME`과 `SMTP_PASSWORD`를 비워 두세요
-- `Unable to relay` → 내부 수신자로 제한하거나, Exchange receive connector에서 Multica 호스트의 IP에 중계 권한을 부여하세요
-
-## 고정 로컬 테스트 코드가 동작하지 않음
-
-**증상**: 자체 호스팅 인스턴스에서 `888888` 같은 고정 로컬 테스트 코드로 로그인하려 했지만 `invalid or expired code`로 거부됩니다.
+```bash
+docker compose -f docker-compose.selfhost.yml up -d
+```
-**가능한 원인**(상호 배타적):
+전체 reverse proxy 예시는 [자체 호스팅 빠른 시작](/self-host-quickstart#3-접근-방식-선택)을 참고하세요.
-1. **`MULTICA_DEV_VERIFICATION_CODE`가 비어 있음** — 고정 코드는 기본적으로 비활성화되어 있습니다
-2. **`APP_ENV=production`** — 이것은 **올바른** 프로덕션 구성입니다. 고정 로컬 테스트 코드는 프로덕션에서 무시됩니다
-3. **구성된 코드가 6자리가 아님** — 이 단축 코드는 6자리 값만 허용합니다
+## 인증 코드 및 초대 이메일이 도착하지 않음
-**진단 방법**:
+먼저 backend 시작 로그를 확인합니다. 로그에는 현재 `SMTP relay`, `Resend API`, `DEV mode` 중 무엇을 사용하는지 표시됩니다.
```bash
-cat .env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
-docker exec <container> env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "EmailService:"
```
-인박스(스팸 포함)에서 실제 인증 코드를 확인하세요.
+- **DEV mode**: 이메일을 보내지 않고 인증 코드와 초대 링크를 backend 로그에만 기록합니다.
+- **Resend**: API key가 유효하고 발신 주소의 도메인이 인증되었는지 확인합니다.
+- **SMTP**: host, port, 자격 증명, 발신 주소를 확인하고 오류 로그에서 연결, TLS, 인증, 전달 중 어느 단계에서 실패했는지 판단합니다.
-**해결 방법**:
+`SMTP_HOST`와 Resend를 함께 설정하면 Multica가 SMTP를 우선 사용합니다. 설정 방법은 [로그인과 가입](/auth-setup#이메일-인증-코드)을 참고하세요.
-- 프로덕션에서는 `MULTICA_DEV_VERIFICATION_CODE`를 비워 두고, Resend를 구성하여 실제 코드를 사용하세요
-- 로컬 개발이나 내부 테스트의 경우 서버 로그에서 생성된 코드를 복사하거나, `APP_ENV=development`와 `MULTICA_DEV_VERIFICATION_CODE=888888`을 설정하세요 — 공개 인스턴스에서는 고정 코드를 절대 활성화하지 마세요(자세한 내용은 [로그인 및 회원가입 구성 → 고정 로컬 테스트 코드](/auth-setup#fixed-local-testing-codes) 참고)
+<Callout type="warning">
+프로덕션 환경에서는 로그의 인증 코드에 의존하거나 고정된 로컬 테스트 인증 코드를 활성화하지 마세요.
+</Callout>
-## 사용량 대시보드가 0으로 유지됨
+## 첨부 파일 업로드 또는 다운로드 실패
-**증상**: 에이전트가 작업을 완료하고 원시 토큰 사용량이 데이터베이스에 기록되지만, **설정 → 사용량**과 **설정 → 런타임**에서 입력 / 출력 / 비용이 전부 0으로 표시됩니다. 이것은 조용히 발생하는 현상으로 — 백엔드 로그에 오류가 없습니다.
+먼저 backend 로그와 응답 status code를 확인합니다. 일반적인 원인은 다음과 같습니다.
-**가능한 원인**:
+- reverse proxy의 요청 body 크기 제한
+- 로컬 업로드 디렉터리에 쓸 수 없거나 persistent volume을 mount하지 않음
+- S3 bucket, region, endpoint, 자격 증명이 일치하지 않음
+- 다운로드 주소가 proxy를 통과한 뒤 잘못된 공개 도메인 또는 프로토콜을 사용함
-1. **`rollup_task_usage_hourly()`가 클레임되지 않음** — 사용량 / 런타임 대시보드는 파생 테이블 `task_usage_hourly`에서 읽으며, 이 테이블은 해당 함수로 채워집니다. MUL-2957부터 백엔드는 DB 기반 스케줄러(`sys_cron_executions`)를 통해 인프로세스로 rollup을 실행합니다. 오래된 빌드, 적용되지 않은 migration `113`, 또는 레플리카가 남아있지 않은 장기간의 백엔드 중단이 있으면 최근 SUCCESS 행이 없는 테이블이 남을 수 있습니다.
-2. **`pg_cron`이 호환성 용도로 구성되었지만 잘못된 데이터베이스를 가리킴** — `pg_cron.database_name`의 기본값은 `postgres`입니다. Multica 데이터베이스 이름이 다르면 스케줄된 작업이 `rollup_task_usage_hourly()`를 전혀 보지 못합니다. 인프로세스 스케줄러는 이에 의존하지 않지만, 인프로세스 스케줄러를 제거하고 `pg_cron`에 의존한다면 DB 이름이 일치해야 합니다.
-3. **핸들러가 클레임되지만 조용히 오류를 냄** — 예: 마이그레이션이 일부만 적용되어 SQL 함수가 누락되었거나, DB 역할 / search_path가 잘못 구성됨. `sys_cron_executions`의 FAILED 감사 행을 확인하세요.
+Docker Compose를 사용하면 기본 `backend_uploads` volume에 로컬 첨부 파일이 저장됩니다. 컨테이너를 다시 만들어도 삭제되지 않지만 `docker compose down -v`는 data volume을 삭제합니다. S3 설정은 [환경 변수](/environment-variables#첨부-파일-저장소)를 참고하세요.
-**진단 방법**:
+## 사용량(Usage)이 0으로 표시됨
+
+Usage 페이지는 각 실행 태스크의 원본 사용량을 직접 읽지 않고 시간별 집계 데이터를 읽습니다. 먼저 원본 데이터와 집계 테이블을 확인합니다.
```sql
--- Confirm raw events exist but the hourly table is empty.
-SELECT count(*) AS raw_rows FROM task_usage;
-SELECT count(*) AS hourly_rows FROM task_usage_hourly;
-
--- Inspect the in-process scheduler's audit log.
-SELECT plan_time, status, attempt, runner_id,
- error_code, error_msg, started_at, finished_at
- FROM sys_cron_executions
- WHERE job_name = 'rollup_task_usage_hourly'
- ORDER BY plan_time DESC
- LIMIT 20;
-
--- Watermark — if this is 1970-01-01, the rollup has never run.
-SELECT watermark_at FROM task_usage_hourly_rollup_state;
-
--- Compatibility path: if you previously registered pg_cron, confirm
--- it is (or isn't) available and pointing at the right database.
-SELECT * FROM pg_available_extensions WHERE name = 'pg_cron';
-SHOW shared_preload_libraries;
-SELECT jobname, schedule, database, active FROM cron.job;
+SELECT count(*) FROM task_usage;
+SELECT count(*) FROM task_usage_hourly;
+
+SELECT plan_time, status, error_code, error_msg
+FROM sys_cron_executions
+WHERE job_name = 'rollup_task_usage_hourly'
+ORDER BY plan_time DESC
+LIMIT 20;
```
-**해결 방법**:
-
-- 적어도 하나의 백엔드 레플리카에서 스케줄러가 실제로 실행 중인지 확인하세요 — 30초마다 `sys_cron_executions`의 `rollup_task_usage_hourly`에 SUCCESS 행이 추가되어야 합니다.
-- SQL 경로를 검증하기 위해 rollup을 수동으로 한 번 호출하세요: `SELECT rollup_task_usage_hourly();` — 대시보드를 새로고침하세요. 숫자가 나타나면 SQL 함수는 정상이며, 문제는 스케줄러 클레임 경로에 있습니다.
-- migration `113_sys_cron_executions`가 아직 적용되지 않았다면 백엔드를 재시작해 마이그레이션을 실행하거나 수동으로 `migrate up`을 호출하세요.
-- 인프로세스 스케줄러 이전의 레거시 `pg_cron` 이력이 있어도 SQL 함수가 내부적으로 advisory lock 4246을 잡고 있어 두 경로가 이중 쓰기할 수 없습니다 — 선택적 `cron.unschedule` 정리는 [자체 호스팅 빠른 시작 → 사용량 롤업](/self-host-quickstart#7-usage-rollup-no-operator-action-required)을 참고하세요.
-
-## 마이그레이션 `103`이 `refusing to drop legacy daily rollups`로 실패함
-
-**증상**: `v0.3.4`에서 `v0.3.5+`로 업그레이드할 때 백엔드 컨테이너가 시작되지 않거나(또는 `migrate up`이 중단됨) 다음과 같은 오류가 발생합니다:
+`task_usage`에 데이터가 있지만 집계 테이블이 비어 있고 스케줄 기록에 실패가 표시된다면 migration이 모두 적용되었는지 먼저 확인하세요. 업그레이드가 migration 103에서 거부되는 경우는 다음 절을 참고하세요. 집계 함수를 직접 한 번 실행해 SQL 문제인지 스케줄 문제인지 구분할 수도 있습니다.
-```text
-ERROR: refusing to drop legacy daily rollups:
- task_usage_hourly_rollup_state.watermark_at (1970-01-01 ...) trails
- task_usage latest event (...) by more than 01:00:00 — backfill is
- incomplete or pg_cron is not running. Run cmd/backfill_task_usage_hourly
- (and let pg_cron catch up) before re-running migrate
+```sql
+SELECT rollup_task_usage_hourly();
```
-**가능한 원인**: 이것은 마이그레이션 `103`의 fail-closed 가드입니다. `task_usage_hourly`가 원시 `task_usage`를 따라잡을 때까지 레거시 daily rollup 삭제를 거부합니다. 기존 행이 존재하고 rollup 워터마크가 여전히 epoch에 머물러 있을 때 — 즉 아직 어떤 이력도 hourly 테이블로 rollup되지 않았을 때 — 이 가드가 발동합니다.
+수동 실행 후 숫자가 정상이라면 집계 함수는 사용할 수 있고 backend 정기 스케줄에 문제가 있는 것입니다. 수동 SQL은 집계를 한 번만 보충하며 스케줄을 복구하지 않습니다. 시간별 집계는 backend 내장 스케줄러가 실행하므로 pg_cron을 직접 설정할 필요가 없습니다.
-MUL-2957부터 migrate 명령은 migration `103`을 적용하기 직전에 멱등한 월별 슬라이스 backfill(advisory lock 4246 보호)을 자동으로 실행하므로, v0.3.4 → v0.3.5+ 직접 업그레이드는 단일 `migrate up` 호출로 완료됩니다. 그래도 이 오류가 보인다면, MUL-2957 이전 바이너리를 사용 중이거나 훅 자체가 실패한 것입니다 — migrate 로그에서 `task_usage hourly rollup hook` 로그를 확인하세요.
+## 업그레이드할 때 migration 103이 실행을 거부함
-**해결 방법**:
+정상 업그레이드에서는 migration 103을 위해 따로 할 일이 없습니다. `migrate up`은 migration을 적용하기 전에 이전 사용량 데이터를 자동으로 backfill합니다. 빈 데이터베이스는 바로 통과하고 이전 데이터가 있는 인스턴스는 월별로 자동 보충한 뒤 계속 진행합니다.
-1. MUL-2957 이전 바이너리를 사용 중이고 바이너리를 먼저 업그레이드할 수 없다면, 같은 데이터베이스에 대해 스탠드얼론 backfill을 실행하세요(멱등하며, 중단해도 안전하고, 다시 실행해도 안전합니다):
+backend 시작 중 `refusing to drop legacy daily rollups` 오류가 계속 발생하면 자동 backfill이 완료되지 않은 것입니다. 예를 들어 도중에 실패했거나 `migrate up`을 사용하지 않고 SQL을 직접 적용했을 수 있습니다. 이때는 backfill 명령을 직접 실행하고 완료된 뒤 backend를 다시 시작하세요.
- ```bash
- # Docker Compose
- docker compose -f docker-compose.selfhost.yml exec backend \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
+```bash
+cd server
+DATABASE_URL='postgres://...' go run ./cmd/backfill_task_usage_hourly
+```
- # Kubernetes
- kubectl -n multica exec deploy/multica-backend -- \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
- ```
+자주 쓰는 flag: `--dry-run`은 쓰지 않고 미리 보기만 하며, `--sleep-between-slices`는 slice 사이에 간격을 두어 사용량이 많은 인스턴스의 읽기 부하를 낮춥니다. 명령은 월별 slice로 실행되고 멱등성을 가지므로 중단 후 바로 다시 실행할 수 있습니다. advisory lock을 보유해 서버의 정기 집계와 상호 배제되므로 중복되거나 일관되지 않은 집계 데이터가 생기지 않습니다. 완료 후 backend를 다시 시작하고 `/readyz`에서 `migrations`가 `ok`인지 확인하세요.
-2. 업그레이드를 다시 실행하세요 — 백엔드 컨테이너를 재시작하는 것으로 충분하며, 마이그레이션은 시작 시 실행됩니다. 이제 가드가 최신 워터마크를 확인하고 `103`을 적용하도록 허용합니다.
-3. 인프로세스 스케줄러가 이후 워터마크를 계속 진행시킵니다 — [자체 호스팅 빠른 시작 → 사용량 롤업](/self-host-quickstart#7-usage-rollup-no-operator-action-required)을 참고하세요.
+## 포트 사용 중
-`--sleep-between-slices=2s`는 수년 치 이력이 있는 프로덕션 데이터베이스에서 적절한 기본값입니다. 최근 N개월만 보관하고 더 오래된 버킷을 영구히 포기해도 괜찮다면 `--months-back N --force-partial`을 사용하세요.
+로컬에서 자주 사용하는 port는 API의 `8080`, Web의 `3000`, 데몬 health check port입니다. 먼저 사용 중인 프로세스를 찾습니다.
-## 포트 충돌
+```bash
+lsof -nP -iTCP:8080 -sTCP:LISTEN # macOS / Linux
+netstat -ano | findstr :8080 # Windows
+```
-**증상**: `multica server`나 `multica daemon start`가 `address already in use`로 실패합니다.
+다른 Multica checkout이 사용 중이라면 해당 디렉터리에서 `make stop`을 먼저 실행합니다. 그렇지 않다면 port를 사용 중인 프로그램을 정상적으로 중지하거나 현재 서비스 port를 변경합니다. 공개 인터넷의 80/443은 Caddy, Nginx 같은 reverse proxy가 사용합니다.
-**가능한 원인**:
+## 로그 위치
-1. **서버 포트 점유됨**(기본값 `8080`)
-2. **데몬 health 포트 점유됨**(기본값 `19514`, 프로필마다 해시로 오프셋됨)
-3. **Web dev 서버 포트 충돌**(`3000` / `5173`)
-4. **포트에 대한 권한 부족**(`< 1024` 특권 포트 바인딩에는 sudo 필요)
+| 컴포넌트 | 확인 방법 |
+| --- | --- |
+| 백그라운드 데몬 | `multica daemon logs --lines 100` |
+| 데몬 로그 실시간 확인 | `multica daemon logs --follow` |
+| 기본 profile 로그 파일 | `~/.multica/daemon.log` |
+| 기본 profile 시작 또는 crash 로그 | `~/.multica/daemon.err.log` |
+| 이름 있는 profile | `~/.multica/profiles/<name>/` 아래의 해당 로그 |
+| Docker backend | `docker compose -f docker-compose.selfhost.yml logs -f backend` |
+| 브라우저 | 개발자 도구의 Console과 Network |
-**진단 방법**:
+데몬 시작 과정을 직접 확인해야 한다면 foreground에서 실행합니다.
```bash
-lsof -i :8080 # macOS / Linux
-netstat -ano | findstr :8080 # Windows
+multica daemon stop
+multica daemon start --foreground
```
-**해결 방법**:
-
-- 충돌하는 프로세스를 종료하거나(`kill -9 <PID>`), `PORT=9000`으로 포트를 변경하세요
-- 80 / 443을 사용하려면 → 직접 바인딩하지 말고, 앞에 리버스 프록시(Nginx / Caddy)를 두어 높은 포트로 전달하세요
-
-## 로그를 찾는 위치
-
-| 구성 요소 | 위치 | 명령 |
-|---|---|---|
-| **데몬** | `~/.multica/daemon.log`(백그라운드 모드) 또는 포그라운드 stdout | `multica daemon logs -f --lines 100` |
-| **데몬(크래시)** | `~/.multica/daemon.err.log` | 직접 열기 — 패닉/초기 시작 오류가 여기에 기록됩니다 |
-| **서버(Docker)** | 컨테이너 stdout | `docker logs -f <container>` |
-| **서버(systemd)** | journal | `journalctl -u multica-server -f` |
-| **프런트엔드(dev)** | `pnpm dev`를 실행 중인 터미널 | 직접 확인 |
-| **프런트엔드(브라우저)** | DevTools → Console | `F12`를 누르세요 |
+그래도 원인을 찾지 못하면 [GitHub Issues](https://github.com/multica-ai/multica/issues)에서 기존 문제를 검색하거나 새 이슈를 제출하세요.
-백그라운드 모드에서 `daemon.log`는 크기 기준으로 로테이션되므로(기본값 20MB × gzip 백업 5개; `MULTICA_DAEMON_LOG_MAX_SIZE_MB` / `_MAX_BACKUPS` / `_MAX_AGE_DAYS`로 조정 가능) 열 수 없을 만큼 커지지 않습니다. Go 런타임 패닉과 logger 초기화 이전 오류는 별도의 상한이 있는 `daemon.err.log`에 기록됩니다.
+## 다음 단계
-더 자세한 데몬 로그가 필요하면, 데몬을 백그라운드에서 포그라운드로 옮기세요: `multica daemon stop && multica daemon start --foreground`. 포그라운드로 실행하면 로그가 로테이션 파일이 아니라 터미널에 실시간으로 출력됩니다.
+- [데몬과 런타임](/daemon-runtimes) — 런타임 등록과 온라인 상태 메커니즘을 알아봅니다.
+- [실행 태스크](/tasks) — 상태, timeout, 실패 원인을 확인합니다.
+- [환경 변수](/environment-variables) — 자체 호스팅 설정 전체를 참고합니다.
diff --git a/apps/docs/content/docs/troubleshooting.mdx b/apps/docs/content/docs/troubleshooting.mdx
index f7f76111a3..bfe8d28fb0 100644
--- a/apps/docs/content/docs/troubleshooting.mdx
+++ b/apps/docs/content/docs/troubleshooting.mdx
@@ -1,290 +1,219 @@
---
title: Troubleshooting
-description: Common issues when self-hosting Multica — symptoms, causes, how to diagnose, how to fix.
+description: Diagnose common problems with connections, execution, realtime updates, email, and self-hosted services.
---
import { Callout } from "fumadocs-ui/components/callout";
-Look up issues by symptom. Each entry gives you **symptom / likely causes / how to diagnose / how to fix**. If your situation isn't listed, open an issue on [GitHub](https://github.com/multica-ai/multica/issues).
-
-## Daemon can't connect to the server
-
-**Symptom**: [`multica daemon`](/cli)'s `status` command shows `offline` or `connection refused`; the server logs show no `/api/daemon/register` or `/api/daemon/heartbeat` requests. For how the daemon mechanism works, see [Daemon and runtimes](/daemon-runtimes).
-
-**Likely causes**:
-
-1. **`MULTICA_SERVER_URL` points at the wrong address** — default is `ws://localhost:8080/ws`; self-host must change it to your server address
-2. **Network / firewall blocking** — the daemon and server aren't on the same network, or outbound traffic is blocked
-3. **Token expired or invalid** — you never ran `multica login`, or the PAT was revoked
-4. **Server rejected registration** — the account you signed in with isn't in the target workspace (register returns 403)
-5. **DNS resolution failure** — the hostname doesn't resolve on the daemon machine
-
-**How to diagnose**:
+First work out which layer the problem lives in: the Multica service, the daemon, the runtime, or the AI coding tool. These commands are usually enough to surface the first meaningful error:
```bash
-multica daemon logs --lines 100 # look for daemon-side errors
-echo $MULTICA_SERVER_URL # confirm the address is set
-curl -i http://<server-host>:8080/health # hit the server directly
-curl -i http://<server-host>:8080/readyz # include DB + migration readiness
-cat ~/.multica/config.json # verify api_token exists
-multica workspace list # confirm you're a member of the target workspace
+multica version
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-**How to fix**: address each cause above. The two most common fixes are **changing `MULTICA_SERVER_URL` and restarting the daemon** (`multica daemon restart`) and **signing in again** (`multica logout && multica login`).
+Self-hosted instances can also check the service directly:
-## Tasks stuck in `queued`
-
-**Symptom**: after assigning an issue to an agent, the issue status flips to `in_progress` immediately, but a long time passes with no sign of agent execution on the page; `multica daemon status` shows the daemon `online`.
+```bash
+curl -i https://api.example.com/health
+curl -i https://api.example.com/readyz
+```
-**Likely causes** (ordered by frequency):
+`/health` only says the API process is responding; `/readyz` also checks the database and migrations. Include the error, relevant logs, CLI version, and operating system when reporting a problem; remove tokens, email addresses, and other sensitive details before submitting.
-1. **Agent concurrency limit reached** — this agent's `max_concurrent_tasks` (default 6) is fully occupied by other running tasks
-2. **Another task from the same agent is still running on the same issue** — same agent × same issue is forced to run sequentially (prevents duplicate execution)
-3. **Agent has been archived** — after archival, new tasks still enqueue but can't be claimed, and they time out after 5 minutes (code-issue G-01)
-4. **Daemon hasn't registered this runtime in the current workspace** — restart the daemon or reselect the runtime in the UI
-5. **Daemon disconnected** — no heartbeat in the last 45 seconds. `daemon status` reporting `online` may reflect a very recent disconnect
+## Daemon fails to connect
-**How to diagnose**:
+Run these first:
```bash
-multica daemon status --output json # runtime list + last_seen_at
-multica agent list # check agent archived state
-multica issue show <issue-id> # inspect task history
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-On the server side (self-host), grep for `"no_tasks"` / `"no_capacity"` to see the claim outcome.
-
-**How to fix**:
+Common causes include:
-- Concurrency full → wait for running tasks to finish, or `multica agent update <id> --max-concurrent-tasks 10` to raise the ceiling
-- Same-issue serialization → wait for the previous task to finish, or reassign to a different agent
-- Agent archived → `multica agent restore <id>`
-- Runtime not registered → `multica daemon restart`, and the daemon will re-register
+- The CLI has not signed in, or the token stored on this machine has expired.
+- The daemon is connected to the wrong Multica service.
+- The executing computer cannot reach the API, or DNS, TLS, or a firewall blocks the connection.
+- The current account is no longer a member of the target workspace.
+- No supported AI coding tool is installed on this machine, so the daemon cannot start.
-## WebSocket can't connect
+Sign in again and restart the daemon:
-**Symptom**: the browser console logs `WebSocket is closed`; the page doesn't show real-time updates (task progress, comments, inbox), and a refresh is needed to see them; backend tasks still execute.
-
-**Likely causes**:
-
-1. **Origin check failure** — your frontend domain isn't in the server's CORS allowlist. The default allowlist only includes `localhost:3000/5173/5174`; self-hosting on the public internet requires `FRONTEND_ORIGIN`
-2. **Protocol mismatch** — frontend on `https://` needs `wss://`; HTTP uses `ws://`
-3. **Reverse proxy doesn't enable WebSocket upgrade** — Nginx / Envoy / HAProxy don't forward the `Upgrade` header by default
-4. **JWT cookie expired or missing** — no re-sign-in after the 30-day expiry
+```bash
+multica login
+multica daemon restart
+```
-**How to diagnose**:
+Self-hosted deployments should also request the API's `/health` from the **executing computer** — testing on the server itself cannot expose DNS, TLS, or firewall problems on the executing computer's side. To change the address, rerun `multica setup self-host`, or check the current profile's `server_url`:
-- Browser DevTools → Network → filter by "WS" and check connection state and status code
-- Grep server logs for `"rejected origin"` / `"websocket"` — an origin issue spells itself out
-- `curl -i http://<server-host>:8080/ws` should return `101 Switching Protocols` (with the `Upgrade` header)
+```bash
+multica config show
+```
-**How to fix**:
+## Issue does not start executing
-- Wrong origin → set `FRONTEND_ORIGIN=https://multica.yourdomain.com` in the server's `.env` (or comma-separated `CORS_ALLOWED_ORIGINS`) and restart the server
-- Protocol mismatch → make sure `FRONTEND_ORIGIN`'s protocol matches the frontend's
-- Reverse proxy → in Nginx, add `proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";`
-- Cookie expired → refresh the page and sign in again
+Open the issue's **execution log** and check the task's current status and what it is waiting for.
-## Emails not received
+### `queued` status
-**Symptom**: after submitting an email during sign-in or invite acceptance, neither the inbox nor the spam folder has the verification code.
+`queued` means the task is still waiting for a runtime to claim it. Check in order:
-**First, confirm which provider the server thinks is active.** At startup the backend prints one of:
+1. Is the runtime the agent is bound to online?
+2. Did the runtime detect the AI coding tool the agent is configured with?
+3. Does the agent still have concurrency headroom?
+4. Does the daemon still have global execution capacity?
-- `EmailService: SMTP relay <host>:<port> from=<addr>` — using SMTP (`SMTP_HOST` non-empty wins over Resend)
-- `EmailService: Resend API from=<addr>` — using Resend
-- `EmailService: DEV mode — codes printed to stdout …` — no provider configured
+An agent runs at most 6 tasks concurrently by default; a single daemon runs at most 20. At the limit, new tasks stay in the queue until a running one finishes. Tasks also keep queueing while the runtime is offline; they only fail after going unclaimed for more than 2 hours.
```bash
-docker compose -f docker-compose.selfhost.yml logs backend | grep "EmailService:"
+multica daemon status --output json
+multica agent get <agent-id>
+multica issue runs <issue-id>
```
-If the line you expected isn't there, the environment didn't reach the process — check `.env` and `docker compose -f docker-compose.selfhost.yml exec backend env | grep -E 'RESEND_|SMTP_'`. Credentials are never logged on this startup line.
-
-### When Resend is the active provider
-
-**Likely causes**:
+If the runtime list is missing an expected tool, first confirm the tool runs and is signed in under the same system account and `PATH`, then run `multica daemon restart`.
-1. **`RESEND_API_KEY` not set** — the server silently falls back and **writes the code to its own stdout** without error. Easy to trip over in production
-2. **Resend API key invalid / out of quota** — server logs show `"failed to send verification code"`
-3. **`RESEND_FROM_EMAIL`'s domain not verified in Resend** — Resend refuses to send
-4. **Email was sent but flagged as spam by the recipient's ISP** — check the Resend dashboard and the spam folder
+### `waiting_local_directory` status
-**How to diagnose**:
+This means another in-flight task is using the same local directory. Multica waits for the directory lock to be released so two agents never modify the same files at once.
-- Grep server logs for `"[DEV] Verification code for"` — if present, Resend isn't configured and the code was written to stdout
-- [Resend dashboard](https://resend.com/) → Emails for send history
-- Confirm `RESEND_FROM_EMAIL`'s domain appears in the Resend console's "Verified Domains" list
+Usually you just wait for the earlier task to finish. If it is stuck, stop it from its execution log, or pick a different local directory for the current agent. This directory mutex lives in the daemon's memory — no lock file is written to disk. If you suspect stale lock state, `multica daemon restart` releases it; there is nothing to delete manually.
-**How to fix**:
+## AI coding tool fails to start
-- Missing API key → follow [Sign-in and signup configuration → How email works](/auth-setup#how-email--verification-code-sign-in-works) to configure and restart the server
-- Domain not verified → run the DNS verification flow in the Resend console (add SPF / DKIM records)
-- In an emergency (internal testing) → copy the code printed under `[DEV]` from the server logs
+An online daemon does not mean the tool itself works. Open the run's detailed record and focus on:
-### When SMTP is the active provider
+- Whether the tool has completed sign-in.
+- Whether the API key, quota, or model permissions are available.
+- Whether the model and thinking level the agent selected are supported by the tool.
+- Whether the local working directory exists and is writable.
+- Whether the agent's custom arguments or environment variables are valid.
-The SMTP path wraps every failure with the stage it failed at, so the server logs already tell you where the relay rejected the session. Grep for `"failed to send verification email"` / `"failed to send invitation email"` and check the wrapped error:
+Run the same tool directly in a terminal on the executing computer first. If the tool cannot start on its own, fix its sign-in or configuration, then retry the task from the execution log.
-| Logged error | What it means | How to fix |
-|---|---|---|
-| `smtp dial <host>:<port>: dial tcp …: connect: connection refused` / `i/o timeout` | The backend container can't reach the relay — wrong host, wrong port, firewall, or the relay isn't listening | Verify `SMTP_HOST` / `SMTP_PORT` resolve from inside the container (`docker compose -f docker-compose.selfhost.yml exec backend nslookup <host>` and `nc -vz <host> <port>`); open the firewall from the host running Multica to the relay |
-| `smtp starttls: x509: certificate signed by unknown authority` (or `certificate is not valid for any names`) | The relay uses a private CA / self-signed cert and the container's trust store rejects it | Either install the CA into the container, or set `SMTP_TLS_INSECURE=true` only after confirming the relay is reachable on a trusted segment |
-| `smtp auth: 535 5.7.8 Authentication credentials invalid` (or `534`/`530`) | `SMTP_USERNAME` / `SMTP_PASSWORD` are wrong, or the relay requires a different auth mechanism than `PLAIN` | Re-confirm the service-account credentials with your mail admin; for Exchange anonymous internal relay leave both empty (`SMTP_USERNAME=`, `SMTP_PASSWORD=`) |
-| `smtp MAIL FROM: 550 5.7.1 Client does not have permissions to send as this sender` | The relay won't accept `RESEND_FROM_EMAIL` as the envelope sender — typical Exchange "anonymous users not allowed" or DMARC alignment issue | Set `RESEND_FROM_EMAIL` to a domain the relay accepts; on Exchange, grant the source IP `ms-Exch-SMTP-Accept-Any-Sender` on the receive connector |
-| `smtp RCPT TO <addr>: 550 5.7.1 Unable to relay` | The relay's receive connector doesn't allow your subnet to relay to external recipients (most common for anonymous internal relays talking to outside domains) | Either restrict invites to internal recipients, or add the Multica host's subnet to the Exchange "Anonymous Users → Relay" permission list |
-| `smtp DATA` / `smtp write body` / `smtp end data` | Session was accepted but the relay dropped the body — usually message-size limits, content filtering, or a connection reset mid-stream | Check the relay's logs for the same `Message-ID` (logged as `<unixnano>@<host>`); raise the message size limit if needed |
+## Realtime updates stop working
-`MAIL FROM`, `RCPT TO`, and `DATA` errors are always logged with the relay's response code so you can match them against Exchange / Postfix logs on the other side. Verification codes and invite tokens are **never** included in the wrapped error.
+If tasks still execute but comments and status changes no longer appear live, the WebSocket is usually not connected.
-**How to diagnose**:
+Check the `/ws` connection under **Network → WS** in the browser's developer tools. For self-hosted deployments, focus on:
-- Grep `"EmailService: SMTP relay"` once at startup, then `"failed to send"` for runtime failures
-- From inside the backend container, sanity-check connectivity: `docker compose -f docker-compose.selfhost.yml exec backend sh -c 'nc -vz $SMTP_HOST $SMTP_PORT'`
-- Confirm the env reached the process: `docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP_` (password will be in the output — only run on a trusted shell)
+- Whether `FRONTEND_ORIGIN` matches the address the browser actually opens.
+- Whether an HTTPS page connects over `wss://`.
+- Whether the reverse proxy forwards the WebSocket Upgrade request.
+- Whether the browser sign-in has expired.
-**How to fix**:
+Containers read `.env` only at creation time; recreate them after changes:
-- Wrong host / port → adjust `SMTP_HOST` / `SMTP_PORT` and restart the backend; for the supported relay modes see [Auth setup → Option B: SMTP relay](/auth-setup)
-- Cert mismatch → install the relay's CA into the container, or temporarily `SMTP_TLS_INSECURE=true` on a trusted segment
-- Auth failure → re-check credentials; for anonymous internal relay leave `SMTP_USERNAME` and `SMTP_PASSWORD` empty
-- `Unable to relay` → either restrict to internal recipients or grant the Multica host's IP relay permission on the Exchange receive connector
-
-## Fixed local test code doesn't work
-
-**Symptom**: on a self-hosted instance, you try to sign in with a fixed local test code such as `888888` and it's rejected with `invalid or expired code`.
+```bash
+docker compose -f docker-compose.selfhost.yml up -d
+```
-**Likely causes** (mutually exclusive):
+For a complete reverse-proxy example, see the [self-host quickstart](/self-host-quickstart#3-choose-how-to-access).
-1. **`MULTICA_DEV_VERIFICATION_CODE` is empty** — fixed codes are disabled by default
-2. **`APP_ENV=production`** — this is the **correct** production configuration; fixed local test codes are ignored in production
-3. **The configured code is not 6 digits** — the shortcut only accepts a 6-digit value
+## Verification code and invitation emails not delivered
-**How to diagnose**:
+Check the backend startup log first. It states whether the server is using `SMTP relay`, `Resend API`, or `DEV mode`:
```bash
-cat .env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
-docker exec <container> env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "EmailService:"
```
-Check your inbox (including spam) for the real verification code.
+- **DEV mode**: no email is sent; verification codes and invitation links are only written to the backend log.
+- **Resend**: confirm the API key is valid and the sender address's domain is verified.
+- **SMTP**: confirm the host, port, credentials, and sender address, and use the error log to tell whether the failure happened at the connection, TLS, authentication, or delivery stage.
-**How to fix**:
+When `SMTP_HOST` and Resend are both configured, Multica prefers SMTP. For configuration, see [Sign-in and signup](/auth-setup#email-verification-codes).
-- In production, leave `MULTICA_DEV_VERIFICATION_CODE` empty — configure Resend and use real codes
-- For local development or internal testing, either copy the generated code from server logs or set `APP_ENV=development` plus `MULTICA_DEV_VERIFICATION_CODE=888888` — never enable a fixed code on a public instance (see [Sign-in and signup configuration → Fixed local testing codes](/auth-setup#fixed-local-testing-codes))
+<Callout type="warning">
+Do not rely on codes in the log in production, and do not enable the fixed local test code.
+</Callout>
-## Usage dashboard stays at zero
+## Attachment uploads or downloads fail
-**Symptom**: agents complete tasks, raw token usage is written to the database, but **Settings → Usage** and **Settings → Runtime** show 0 input / output / cost across the board. This is silent — there is no error in the backend logs.
+Check the backend log and the response status code first. Common causes:
-**Likely causes**:
+- The reverse proxy limits request body size.
+- The local upload directory is not writable or has no persistent volume mounted.
+- The S3 bucket, region, endpoint, or credentials do not match.
+- The download URL uses the wrong public domain or protocol after passing through a proxy.
-1. **`rollup_task_usage_hourly()` is never being claimed** — the Usage / Runtime dashboards read from the derived `task_usage_hourly` table, populated by that function. Since MUL-2957 the backend runs the rollup in-process via the DB-backed scheduler (`sys_cron_executions`); a stale build, a missing migration `113`, or a sustained backend outage with no replicas left running can leave the table without a recent SUCCESS row.
-2. **`pg_cron` is configured for compatibility but pointing at the wrong database** — `pg_cron.database_name` defaults to `postgres`; if your Multica database has a different name, the scheduled job never sees `rollup_task_usage_hourly()`. The in-process scheduler does not depend on this, but if you removed the in-process scheduler and rely on `pg_cron`, the DB name must match.
-3. **The handler is being claimed but silently erroring** — e.g. the SQL function is missing because migrations were partially applied, or DB role / search_path is misconfigured. Check the FAILED audit rows in `sys_cron_executions`.
+With Docker Compose, the default `backend_uploads` volume stores local attachments. Recreating containers does not delete it, but `docker compose down -v` deletes the data volume. For S3 configuration, see [Environment variables](/environment-variables#attachment-storage).
-**How to diagnose**:
+## Usage shows zero
+
+The Usage page reads hourly rollups, not each task's raw usage. Check the raw data and the rollup table first:
```sql
--- Confirm raw events exist but the hourly table is empty.
-SELECT count(*) AS raw_rows FROM task_usage;
-SELECT count(*) AS hourly_rows FROM task_usage_hourly;
-
--- Inspect the in-process scheduler's audit log.
-SELECT plan_time, status, attempt, runner_id,
- error_code, error_msg, started_at, finished_at
- FROM sys_cron_executions
- WHERE job_name = 'rollup_task_usage_hourly'
- ORDER BY plan_time DESC
- LIMIT 20;
-
--- Watermark — if this is 1970-01-01, the rollup has never run.
-SELECT watermark_at FROM task_usage_hourly_rollup_state;
-
--- Compatibility path: if you previously registered pg_cron, confirm
--- it is (or isn't) available and pointing at the right database.
-SELECT * FROM pg_available_extensions WHERE name = 'pg_cron';
-SHOW shared_preload_libraries;
-SELECT jobname, schedule, database, active FROM cron.job;
+SELECT count(*) FROM task_usage;
+SELECT count(*) FROM task_usage_hourly;
+
+SELECT plan_time, status, error_code, error_msg
+FROM sys_cron_executions
+WHERE job_name = 'rollup_task_usage_hourly'
+ORDER BY plan_time DESC
+LIMIT 20;
```
-**How to fix**:
-
-- Confirm the scheduler is actually running on at least one backend replica — every 30 seconds it should add a SUCCESS row to `sys_cron_executions` for `rollup_task_usage_hourly`.
-- Call the rollup once by hand to verify the SQL path: `SELECT rollup_task_usage_hourly();` — refresh the dashboard; if numbers appear, the SQL function is fine and the issue is on the scheduler claim path.
-- If migration `113_sys_cron_executions` has not applied yet, restart the backend so migrations run, or invoke `migrate up` manually.
-- If you have legacy `pg_cron` history that pre-dates the in-process scheduler, the SQL function still holds advisory lock 4246 internally and the two paths cannot double-write — see [Self-host quickstart → Usage rollup](/self-host-quickstart#7-usage-rollup-no-operator-action-required) for the optional `cron.unschedule` cleanup.
-
-## Migration `103` fails with `refusing to drop legacy daily rollups`
-
-**Symptom**: upgrading from `v0.3.4` to `v0.3.5+`, the backend container fails to start (or `migrate up` aborts) with:
+If `task_usage` has rows, the rollup table is empty, and the scheduler records show failures, first confirm all migrations have been applied; if migration 103 rejected the upgrade, see the next section. You can also run one rollup by hand to separate SQL problems from scheduling problems:
-```text
-ERROR: refusing to drop legacy daily rollups:
- task_usage_hourly_rollup_state.watermark_at (1970-01-01 ...) trails
- task_usage latest event (...) by more than 01:00:00 — backfill is
- incomplete or pg_cron is not running. Run cmd/backfill_task_usage_hourly
- (and let pg_cron catch up) before re-running migrate
+```sql
+SELECT rollup_task_usage_hourly();
```
-**Likely cause**: this is migration `103`'s fail-closed guard. It refuses to drop the legacy daily rollups until `task_usage_hourly` has caught up with raw `task_usage`. The guard fires whenever existing rows are present and the rollup watermark still sits at the epoch — i.e. nothing has rolled history into the hourly table yet.
+If the numbers look right after a manual run, the rollup function works and the problem is the backend's built-in scheduling; manual SQL only fills in one rollup and does not restore scheduling. Hourly rollups are executed by the backend's built-in scheduler — you do not need to configure pg_cron yourself.
-Since MUL-2957 the migrate command runs an idempotent monthly-slice backfill (under advisory lock 4246) automatically immediately before applying migration `103`, so v0.3.4 → v0.3.5+ direct upgrades complete in a single `migrate up` invocation. If you are still seeing this error you are either on a pre-MUL-2957 binary or the hook itself failed — check the migrate logs for an earlier `task_usage hourly rollup hook` line.
+## Migration 103 blocks an upgrade
-**How to fix**:
+A normal upgrade needs no action for 103: `migrate up` automatically backfills historical usage data before applying it — an empty database passes straight through, and instances with history are backfilled month by month before continuing.
-1. If you are on a pre-MUL-2957 binary and cannot upgrade the binary first, run the standalone backfill against the same database (idempotent, safe to interrupt, safe to re-run):
+If the backend still fails to start with `refusing to drop legacy daily rollups`, the automatic backfill did not complete (for example, it failed partway, or the SQL was applied directly instead of through `migrate up`). Run the backfill command manually, then restart the backend:
- ```bash
- # Docker Compose
- docker compose -f docker-compose.selfhost.yml exec backend \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
+```bash
+cd server
+DATABASE_URL='postgres://...' go run ./cmd/backfill_task_usage_hourly
+```
- # Kubernetes
- kubectl -n multica exec deploy/multica-backend -- \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
- ```
+Useful flags: `--dry-run` previews without writing; `--sleep-between-slices` adds a pause between slices to reduce read pressure on a busy instance. The command works in monthly slices and is idempotent — rerun it directly after an interruption. It holds an advisory lock and is mutually exclusive with the server's scheduled rollup, so it cannot produce duplicate or inconsistent rollup data. When it finishes, restart the backend and confirm `migrations` is `ok` on `/readyz`.
-2. Re-run the upgrade — restarting the backend container is enough, migrations run on startup. The guard now sees a current watermark and lets `103` apply.
-3. The in-process scheduler then keeps the watermark advancing — see [Self-host quickstart → Usage rollup](/self-host-quickstart#7-usage-rollup-no-operator-action-required).
+## Port already in use
-`--sleep-between-slices=2s` is a polite default on production databases with years of history. Use `--months-back N --force-partial` if you only want to keep the last N months and are willing to permanently abandon older buckets.
+Common local ports are `8080` for the API, `3000` for the web app, and the daemon health-check port. Find the process holding the port first:
-## Port conflicts
+```bash
+lsof -nP -iTCP:8080 -sTCP:LISTEN # macOS / Linux
+netstat -ano | findstr :8080 # Windows
+```
-**Symptom**: `multica server` or `multica daemon start` fails with `address already in use`.
+If it is another Multica checkout, run `make stop` in that directory first. Otherwise stop the offending program normally, or change the current service's port. Public ports 80/443 are listened on by a reverse proxy such as Caddy or Nginx.
-**Likely causes**:
+## Log locations
-1. **Server port taken** (default `8080`)
-2. **Daemon health port taken** (default `19514`, offset by a hash per profile)
-3. **Web dev server port conflict** (`3000` / `5173`)
-4. **Insufficient privileges for the port** (binding a privileged port `< 1024` requires sudo)
+| Component | How to view |
+| --- | --- |
+| Background daemon | `multica daemon logs --lines 100` |
+| Follow daemon logs live | `multica daemon logs --follow` |
+| Default profile's log file | `~/.multica/daemon.log` |
+| Default profile's startup or crash log | `~/.multica/daemon.err.log` |
+| Named profiles | the matching logs under `~/.multica/profiles/<name>/` |
+| Docker backend | `docker compose -f docker-compose.selfhost.yml logs -f backend` |
+| Browser | Console and Network in the developer tools |
-**How to diagnose**:
+To observe the daemon's startup directly, run it in the foreground instead:
```bash
-lsof -i :8080 # macOS / Linux
-netstat -ano | findstr :8080 # Windows
+multica daemon stop
+multica daemon start --foreground
```
-**How to fix**:
-
-- Kill the conflicting process (`kill -9 <PID>`), or change ports via `PORT=9000`
-- To use 80 / 443 → don't bind directly; put a reverse proxy (Nginx / Caddy) in front, forwarding to a high port
-
-## Where to find logs
-
-| Component | Location | Command |
-|---|---|---|
-| **Daemon** | `~/.multica/daemon.log` (background mode) or foreground stdout | `multica daemon logs -f --lines 100` |
-| **Daemon (crashes)** | `~/.multica/daemon.err.log` | Open directly — panics / early-startup errors land here |
-| **Server (Docker)** | Container stdout | `docker logs -f <container>` |
-| **Server (systemd)** | journal | `journalctl -u multica-server -f` |
-| **Frontend (dev)** | Terminal running `pnpm dev` | Read directly |
-| **Frontend (browser)** | DevTools → Console | Press `F12` |
+If you still cannot pin it down, search existing issues or file a new one on [GitHub Issues](https://github.com/multica-ai/multica/issues).
-In background mode `daemon.log` is size-rotated (20MB × 5 gzip backups by default; tune with `MULTICA_DAEMON_LOG_MAX_SIZE_MB` / `_MAX_BACKUPS` / `_MAX_AGE_DAYS`), so it stays small enough to open. Go runtime panics and pre-logger errors go to the separate, bounded `daemon.err.log`.
+## Next steps
-For more detailed daemon logs, move it from background to foreground: `multica daemon stop && multica daemon start --foreground`. Running in the foreground streams logs live to your terminal instead of the rotated file.
+- [Daemon and runtimes](/daemon-runtimes) — how runtimes register and report online status.
+- [Tasks](/tasks) — status, timeout, and failure reference.
+- [Environment variables](/environment-variables) — the full self-hosting configuration reference.
diff --git a/apps/docs/content/docs/troubleshooting.zh.mdx b/apps/docs/content/docs/troubleshooting.zh.mdx
index 423f5d6b40..31d9d05970 100644
--- a/apps/docs/content/docs/troubleshooting.zh.mdx
+++ b/apps/docs/content/docs/troubleshooting.zh.mdx
@@ -1,289 +1,219 @@
---
title: 故障排查
-description: self-host Multica 常见问题——症状、原因、怎么查、怎么修。
+description: 排查连接、执行、实时更新、邮件和自托管服务中的常见问题。
---
import { Callout } from "fumadocs-ui/components/callout";
-按症状查问题。每条问题都给**症状 / 可能原因 / 怎么查 / 怎么修**四段。如果你的情况不在下面,到 [GitHub](https://github.com/multica-ai/multica/issues) 提 issue。
-
-## 守护进程连不上服务器
-
-**症状**:[`multica daemon`](/cli) 的 `status` 命令显示 `offline` 或 `connection refused`;服务器日志里没有 `/api/daemon/register` 或 `/api/daemon/heartbeat` 的请求。守护进程机制详见 [守护进程与运行时](/daemon-runtimes)。
-
-**可能原因**:
-
-1. **`MULTICA_SERVER_URL` 指错地址** —— 默认是 `ws://localhost:8080/ws`,self-host 要改成你自己的 server 地址
-2. **网络 / 防火墙阻挡** —— daemon 和 server 不在同一网络,或出站被 block
-3. **Token 过期或无效** —— 你从来没跑过 `multica login`,或 PAT 被撤销
-4. **服务器拒绝注册** —— 你登录的账号不在目标工作区(register 返 403)
-5. **DNS 解析失败** —— hostname 在 daemon 机器上解不出来
-
-**怎么查**:
+先确认问题发生在哪一层:Multica 服务、守护进程、运行时,还是 AI 编程工具。下面几条命令通常足以找到第一条有效错误:
```bash
-multica daemon logs --lines 100 # 看 daemon 侧错误
-echo $MULTICA_SERVER_URL # 确认地址配对
-curl -i http://<server-host>:8080/health # 直接戳 server
-curl -i http://<server-host>:8080/readyz # 连同 DB + migration readiness 一起检查
-cat ~/.multica/config.json # 看 api_token 是否存在
-multica workspace list # 确认你是目标工作区成员
+multica version
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-**怎么修**:按上面原因对症处理。最常见的两个是**改 `MULTICA_SERVER_URL` 重启 daemon**(`multica daemon restart`)和**重新登录**(`multica logout && multica login`)。
+自托管实例还可以直接检查服务:
-## 任务一直卡在 queued
-
-**症状**:把 issue 分给 agent 后,issue 状态立刻变 `in_progress`,但过了很久页面没有 agent 执行的迹象;`multica daemon status` 显示 daemon `online`。
+```bash
+curl -i https://api.example.com/health
+curl -i https://api.example.com/readyz
+```
-**可能原因**(按触发概率排):
+`/health` 只说明 API 进程正在响应;`/readyz` 还会检查数据库和 migration。问题反馈包含报错、相关日志、CLI 版本和操作系统;令牌、邮箱等敏感信息在提交前移除。
-1. **智能体并发上限已满** —— 该 agent 的 `max_concurrent_tasks`(默认 6)已经被其他正在跑的任务占满
-2. **同一 issue 上有另一个同 agent 的任务还没结束** —— 同 agent × 同 issue 强制串行(防止重复执行)
-3. **智能体已经被 archive** —— 被归档后新任务仍能入队,但无法被 claim,会卡到 5 分钟超时(code-issue G-01)
-4. **Daemon 没在当前工作区注册该 runtime** —— 重启 daemon 或在 UI 重新选一次 runtime
-5. **守护进程失联** —— 最近 45 秒没心跳。`daemon status` 看起来 `online` 也可能是刚失联
+## 守护进程连接失败
-**怎么查**:
+先运行:
```bash
-multica daemon status --output json # runtime 列表 + last_seen_at
-multica agent list # 查 agent 的 archived 状态
-multica issue show <issue-id> # 看 task 历史
+multica auth status
+multica daemon status --output json
+multica daemon logs --lines 100
```
-服务器侧(self-host)可以 grep `"no_tasks"` / `"no_capacity"` 看 claim 的结果。
-
-**怎么修**:
+常见原因包括:
-- 并发打满 → 等现有任务跑完,或 `multica agent update <id> --max-concurrent-tasks 10` 提升上限
-- 同 issue 串行 → 等前一个任务结束,或改分给不同 agent
-- Agent 被 archive → `multica agent restore <id>`
-- Runtime 未注册 → `multica daemon restart`,daemon 会重新注册
+- CLI 尚未登录,或本机保存的令牌已经失效;
+- 守护进程连接了错误的 Multica 服务;
+- 执行电脑无法访问 API,或 DNS、TLS、防火墙拦截了连接;
+- 当前账号已经不在目标工作区中;
+- 本机没有安装任何受支持的 AI 编程工具,守护进程因此无法启动。
-## WebSocket 连不上
+重新登录并重启守护进程:
-**症状**:浏览器控制台报 `WebSocket is closed`;页面不显示实时更新(任务进度、评论、inbox),刷新才能看到;但后台任务仍在执行。
-
-**可能原因**:
-
-1. **Origin 校验失败** —— 你的前端域名不在 server 的 CORS 白名单里。默认白名单只包含 `localhost:3000/5173/5174`,self-host 到公网必须配 `FRONTEND_ORIGIN`
-2. **协议不匹配** —— 前端用 `https://` 需要 `wss://`,HTTP 用 `ws://`
-3. **反向代理没开 WebSocket upgrade** —— Nginx / Envoy / HAProxy 默认不转发 `Upgrade` header
-4. **JWT cookie 过期或丢失** —— 30 天过期后没重登
+```bash
+multica login
+multica daemon restart
+```
-**怎么查**:
+自托管部署还需要从**执行电脑**请求 API 的 `/health`——服务器本机测试无法暴露执行电脑侧的 DNS、TLS 或防火墙问题。需要修改地址时,重新运行 `multica setup self-host`,或检查当前 profile 的 `server_url`:
-- 浏览器 DevTools → Network → 筛选 "WS",看连接状态和状态码
-- Server 日志里 grep `"rejected origin"` / `"websocket"` —— 如果是 origin 问题会明确写出来
-- `curl -i http://<server-host>:8080/ws` 应该返回 `101 Switching Protocols`(需要带 `Upgrade` header)
+```bash
+multica config show
+```
-**怎么修**:
+## Issue 未开始执行
-- Origin 错 → 在 server 的 `.env` 设 `FRONTEND_ORIGIN=https://multica.yourdomain.com`(或逗号分隔的 `CORS_ALLOWED_ORIGINS`),重启 server
-- 协议不匹配 → 确保 `FRONTEND_ORIGIN` 的协议和前端一致
-- 反向代理 → 在 Nginx 加 `proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";`
-- Cookie 过期 → 刷新页面重新登录
+打开 issue 的**执行日志**,先看执行任务的当前状态和等待原因。
-## 邮件没收到
+### `queued` 状态
-**症状**:登录或邀请时提交邮箱后,收件箱(和垃圾邮件)里都没有验证码邮件。
+`queued` 表示执行任务还在等待运行时领取。依次检查:
-**先确认 server 自己认为在用哪个 provider。** 启动时 backend 会打印这三种之一:
+1. 智能体绑定的运行时是否在线;
+2. 运行时是否检测到了该智能体配置的 AI 编程工具;
+3. 智能体是否还有可用并发额度;
+4. 守护进程是否还有全局执行容量。
-- `EmailService: SMTP relay <host>:<port> from=<addr>` —— 走 SMTP(`SMTP_HOST` 非空时优先级高于 Resend)
-- `EmailService: Resend API from=<addr>` —— 走 Resend
-- `EmailService: DEV mode — codes printed to stdout …` —— 没配任何 provider
+智能体默认最多同时执行 6 条执行任务;单个守护进程默认最多同时执行 20 条。达到上限时,新执行任务会留在队列中,等已有执行结束后再开始。运行时离线时,执行任务也会继续排队;超过 2 小时仍未领取才会失败。
```bash
-docker compose -f docker-compose.selfhost.yml logs backend | grep "EmailService:"
+multica daemon status --output json
+multica agent get <agent-id>
+multica issue runs <issue-id>
```
-如果应该出现的那行没出现,说明环境变量没进到进程 —— 检查 `.env` 和 `docker compose -f docker-compose.selfhost.yml exec backend env | grep -E 'RESEND_|SMTP_'`。这行启动日志里**不会**打印任何密码。
-
-### Resend 是当前 provider
-
-**可能原因**:
+如果运行时列表缺少预期工具,先在同一个系统账号和 `PATH` 中确认工具可以运行并且已经登录,再执行 `multica daemon restart`。
-1. **`RESEND_API_KEY` 没配** —— server 会静默回落,**把验证码打到自己的 stdout 里**,不报错。生产部署很容易踩
-2. **Resend API key 无效 / 余额不足** —— server 日志会有 `"failed to send verification code"`
-3. **`RESEND_FROM_EMAIL` 的域名没在 Resend 验证** —— Resend 会拒发
-4. **邮件发出去了但被收件人 ISP 判垃圾** —— 查 Resend dashboard 和 spam 目录
+### `waiting_local_directory` 状态
-**怎么查**:
+这表示另一条在途执行任务正在使用同一个本地目录。Multica 会等待目录锁释放,避免两个智能体同时修改同一份文件。
-- Server 日志里搜 `"[DEV] Verification code for"` —— 如果有,说明 Resend 没配,验证码被打到 stdout
-- [Resend dashboard](https://resend.com/) → Emails 看发送记录
-- 确认 `RESEND_FROM_EMAIL` 的域名在 Resend console 的 "Verified Domains" 列表里
+通常只需等前一条执行任务结束。若前一条已经卡住,可以从它的执行日志中停止;也可以为当前智能体选择其他本地目录。这个目录互斥由守护进程在内存中维护,不写磁盘锁文件;怀疑锁状态异常时运行 `multica daemon restart` 即可释放,没有需要手动删除的文件。
-**怎么修**:
+## AI 编程工具启动失败
-- 没配 API key → 照 [登录与注册配置 → 怎么配 Email](/auth-setup#email--验证码登录怎么工作) 的步骤配完重启 server
-- 域名没验证 → Resend console 里走 DNS 验证流程(加 SPF / DKIM 记录)
-- 紧急情况下(如内部测试)→ 从 server 日志里抄 `[DEV]` 打印出的验证码
+守护进程在线不代表工具本身可用。打开这次执行的详细记录,重点检查:
-### SMTP 是当前 provider
+- 工具是否已经完成登录;
+- API key、额度或模型权限是否可用;
+- 智能体选择的模型和思考级别是否被该工具支持;
+- 本地工作目录是否存在并且可写;
+- 智能体的自定义参数或环境变量是否有效。
-SMTP 路径把每个失败都按阶段包装好,所以 server 日志已经告诉你 relay 在哪一步拒绝了会话。搜 `"failed to send verification email"` / `"failed to send invitation email"`,看里面包的具体错误:
+先在执行电脑的终端中直接运行同一款工具。工具自身也无法开始时,先修复工具登录或配置,再从执行日志重试执行任务。
-| 错误日志 | 含义 | 怎么修 |
-|---|---|---|
-| `smtp dial <host>:<port>: dial tcp …: connect: connection refused` / `i/o timeout` | backend 容器连不上 relay —— host / port 错、防火墙挡了、或者 relay 没开 | 在容器里确认能解析和连通:`docker compose -f docker-compose.selfhost.yml exec backend nslookup <host>` 以及 `nc -vz <host> <port>`;放行从 Multica 主机到 relay 的网络 |
-| `smtp starttls: x509: certificate signed by unknown authority`(或 `certificate is not valid for any names`) | relay 用了私有 CA / 自签证书,容器的信任库不接受 | 要么把 CA 装进容器,要么在确认 relay 走的是可信网段后设 `SMTP_TLS_INSECURE=true` |
-| `smtp auth: 535 5.7.8 Authentication credentials invalid`(或 `534`/`530`) | `SMTP_USERNAME` / `SMTP_PASSWORD` 不对,或 relay 不接受 `PLAIN` 认证 | 找邮件管理员复核 service account 凭据;Exchange 匿名内部 relay 应当把两者都留空 |
-| `smtp MAIL FROM: 550 5.7.1 Client does not have permissions to send as this sender` | relay 不接受 `RESEND_FROM_EMAIL` 作为信封发件人 —— Exchange 常见 "anonymous users not allowed" 或 DMARC 对齐问题 | 把 `RESEND_FROM_EMAIL` 改成 relay 接受的域名;Exchange 上给来源 IP 授 `ms-Exch-SMTP-Accept-Any-Sender` |
-| `smtp RCPT TO <addr>: 550 5.7.1 Unable to relay` | relay 的 receive connector 不允许这个子网把邮件中继到外部收件人(匿名内部 relay 发给外部域时常见) | 邀请仅限内部域,或者把 Multica 主机的子网加进 Exchange "Anonymous Users → Relay" 权限列表 |
-| `smtp DATA` / `smtp write body` / `smtp end data` | 会话被接受但 body 被丢 —— 通常是消息大小限制、内容过滤、或中途断连 | 在 relay 端按同一个 `Message-ID`(日志里是 `<unixnano>@<host>`)找上下文;必要时调大消息大小限制 |
+## 实时更新失效
-`MAIL FROM` / `RCPT TO` / `DATA` 的错误日志里都带着 relay 返回的状态码,可以和 Exchange / Postfix 那边的日志对齐。验证码和邀请 token **不会**出现在这些包装的错误里。
+任务仍能执行、但评论和状态不能实时出现,通常是 WebSocket 没有连通。
-**怎么查**:
+在浏览器开发者工具的 **Network → WS** 中查看 `/ws` 连接。自托管部署重点检查:
-- 启动时搜 `"EmailService: SMTP relay"` 一次,运行时搜 `"failed to send"` 看具体阶段
-- 在 backend 容器里测连通:`docker compose -f docker-compose.selfhost.yml exec backend sh -c 'nc -vz $SMTP_HOST $SMTP_PORT'`
-- 确认环境变量真进到了进程:`docker compose -f docker-compose.selfhost.yml exec backend env | grep SMTP_`(这条会带出密码,仅在可信终端运行)
+- `FRONTEND_ORIGIN` 是否和浏览器实际打开的地址一致;
+- HTTPS 页面是否通过 `wss://` 连接;
+- 反向代理是否转发 WebSocket 的 Upgrade 请求;
+- 浏览器登录是否已经过期。
-**怎么修**:
+容器只在创建时读取 `.env`,修改后需要重新创建:
-- host / port 不对 → 改 `SMTP_HOST` / `SMTP_PORT` 后重启 backend;支持的 relay 模式见 [登录与注册配置 → Option B:SMTP relay](/auth-setup)
-- 证书校验失败 → 把 relay 的 CA 装进容器,或在可信网段上临时 `SMTP_TLS_INSECURE=true`
-- 认证失败 → 复核凭据;匿名内部 relay 应把 `SMTP_USERNAME` 和 `SMTP_PASSWORD` 都留空
-- `Unable to relay` → 邀请仅限内部域,或在 Exchange receive connector 上给 Multica 主机授中继权限
-
-## 固定本地测试验证码登不进去
-
-**症状**:自部署实例,想用 `888888` 这类固定本地测试验证码登录,但被拒 `invalid or expired code`。
+```bash
+docker compose -f docker-compose.selfhost.yml up -d
+```
-**可能原因**(互斥):
+完整的反向代理示例见[自托管快速上手](/self-host-quickstart#3-选择访问方式)。
-1. **`MULTICA_DEV_VERIFICATION_CODE` 为空** —— 固定验证码默认关闭
-2. **`APP_ENV=production`** —— 这是正确的生产配置;固定本地测试验证码在 production 中会被忽略
-3. **配置的验证码不是 6 位数字** —— 这个快捷码只接受 6 位数字
+## 验证码与邀请邮件未送达
-**怎么查**:
+先查看 backend 启动日志。日志会说明当前使用 `SMTP relay`、`Resend API` 还是 `DEV mode`:
```bash
-cat .env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
-docker exec <container> env | grep -E 'APP_ENV|MULTICA_DEV_VERIFICATION_CODE'
+docker compose -f docker-compose.selfhost.yml logs backend \
+ | grep "EmailService:"
```
-检查邮箱(含 spam)看有没有收到真实验证码。
+- **DEV mode**:邮件不会发出,验证码和邀请链接只写入 backend 日志;
+- **Resend**:确认 API key 有效,且发件地址的域名已经验证;
+- **SMTP**:确认主机、端口、凭据和发件地址,并从错误日志判断失败发生在连接、TLS、认证还是投递阶段。
-**怎么修**:
+`SMTP_HOST` 和 Resend 同时配置时,Multica 会优先使用 SMTP。配置方式见[登录与注册](/auth-setup#邮箱验证码)。
-- 生产环境保持 `MULTICA_DEV_VERIFICATION_CODE` 为空,配好 Resend 后使用真实验证码
-- 本地开发或内网测试可以从 server 日志抄生成的验证码;如果需要 `888888`,设置 `APP_ENV=development` 和 `MULTICA_DEV_VERIFICATION_CODE=888888`。不要在公网实例启用固定验证码(详见 [登录与注册配置 → 固定本地测试验证码](/auth-setup#固定本地测试验证码))
+<Callout type="warning">
+生产环境不要依赖日志中的验证码,也不要启用固定本地测试验证码。
+</Callout>
-## Usage 看板一直是 0
+## 附件上传或下载失败
-**症状**:agent 执行完任务、原始的 token 用量已经写入数据库,但 **Settings → Usage** 和 **Settings → Runtime** 上输入 / 输出 / 成本全部显示 0。**没有任何报错**——这是静默故障。
+先检查 backend 日志和响应状态码。常见原因是:
-**可能原因**:
+- 反向代理限制了请求体大小;
+- 本地上传目录不可写或没有挂载持久化卷;
+- S3 bucket、region、endpoint 或凭据不匹配;
+- 下载地址经过代理后使用了错误的公开域名或协议。
-1. **`rollup_task_usage_hourly()` 没被认领** —— Usage / Runtime 看板读的是派生表 `task_usage_hourly`,这张表必须靠 `rollup_task_usage_hourly()` 周期性填充。从 MUL-2957 起后端通过 DB 后端调度器(`sys_cron_executions`)在进程内跑 rollup;旧版本 binary、未应用 migration `113`、或者所有副本长时间下线,都可能让这张表里没有最近的 SUCCESS 行。
-2. **`pg_cron` 作为兼容路径配着、但指向了错的库** —— `pg_cron.database_name` 默认是 `postgres`;如果你的 Multica 数据库名不是 `postgres`,调度任务根本看不到 `rollup_task_usage_hourly()`。进程内调度器不依赖这一项,但如果你刻意拿掉了进程内调度而靠 `pg_cron`,DB 名就必须对得上。
-3. **handler 被认领了、但静默报错** —— 比如 migration 没全部应用导致 SQL 函数缺失、或 DB role / search_path 配错了。看 `sys_cron_executions` 里的 FAILED 审计行。
+使用 Docker Compose 时,默认的 `backend_uploads` volume 保存本地附件。重建容器不会删除它,但 `docker compose down -v` 会删除数据卷。S3 相关配置见[环境变量](/environment-variables#附件存储)。
-**怎么查**:
+## 用量(Usage)为 0
+
+Usage 页面读取按小时汇总的数据,不直接读取每条执行任务的原始用量。先确认原始数据和汇总表:
```sql
--- 确认原始数据有、hourly 表是空的
-SELECT count(*) AS raw_rows FROM task_usage;
-SELECT count(*) AS hourly_rows FROM task_usage_hourly;
-
--- 看进程内调度器的审计日志
-SELECT plan_time, status, attempt, runner_id,
- error_code, error_msg, started_at, finished_at
- FROM sys_cron_executions
- WHERE job_name = 'rollup_task_usage_hourly'
- ORDER BY plan_time DESC
- LIMIT 20;
-
--- watermark —— 如果还是 1970-01-01,说明 rollup 从来没跑过
-SELECT watermark_at FROM task_usage_hourly_rollup_state;
-
--- 兼容路径:以前注册过 pg_cron,确认装没装、指对了库没
-SELECT * FROM pg_available_extensions WHERE name = 'pg_cron';
-SHOW shared_preload_libraries;
-SELECT jobname, schedule, database, active FROM cron.job;
+SELECT count(*) FROM task_usage;
+SELECT count(*) FROM task_usage_hourly;
+
+SELECT plan_time, status, error_code, error_msg
+FROM sys_cron_executions
+WHERE job_name = 'rollup_task_usage_hourly'
+ORDER BY plan_time DESC
+LIMIT 20;
```
-**怎么修**:
-
-- 确认至少一个后端副本里调度器真的在跑 —— 每 30 秒应该往 `sys_cron_executions` 的 `rollup_task_usage_hourly` 加一条 SUCCESS 行。
-- 手动跑一次 SQL 验证函数本身没问题:`SELECT rollup_task_usage_hourly();` —— 刷新看板;如果数字出来了,SQL 这层 OK,问题在调度器认领路径上。
-- 如果 migration `113_sys_cron_executions` 还没应用,重启后端让 migration 跑一遍,或手动 `migrate up`。
-- 历史里有遗留的 `pg_cron` 入口也没事 —— SQL 函数里还持有 advisory lock 4246,应用调度器和 `pg_cron` 不会双写;要清掉冗余项见 [Self-host 快速上手 → 用量汇总](/self-host-quickstart#7-usage-rollup-no-operator-action-required) 里的 `cron.unschedule`。
-
-## migration `103` 报 `refusing to drop legacy daily rollups`
-
-**症状**:从 `v0.3.4` 升级到 `v0.3.5+` 时,后端容器起不来(或 `migrate up` 中止),错误信息:
+如果 `task_usage` 有数据、汇总表为空,并且调度记录显示失败,先确认 migration 已经全部应用;升级被 migration 103 拒绝执行的情况见下一节。也可以手动执行一次汇总来区分 SQL 和调度问题:
-```text
-ERROR: refusing to drop legacy daily rollups:
- task_usage_hourly_rollup_state.watermark_at (1970-01-01 ...) trails
- task_usage latest event (...) by more than 01:00:00 — backfill is
- incomplete or pg_cron is not running. Run cmd/backfill_task_usage_hourly
- (and let pg_cron catch up) before re-running migrate
+```sql
+SELECT rollup_task_usage_hourly();
```
-**可能原因**:这是 migration `103` 的 fail-closed guard。它要求 `task_usage_hourly` 已经追平了原始的 `task_usage` 之后,才允许丢掉旧的 daily rollup。只要数据库里有历史数据、且 rollup watermark 还停在 epoch(说明还没把历史回填进 hourly 表),这条 guard 就会拦住。
+手动执行后数字正常,说明汇总函数可用,问题在 backend 的定时调度;手动 SQL 只补一次汇总,不会恢复调度。按小时汇总由 backend 内置调度执行,不需要自行配置 pg_cron。
-从 MUL-2957 起,migrate 命令在应用 migration `103` 之前会自动跑一次幂等的按月切片 backfill(advisory lock 4246 保护),所以 v0.3.4 → v0.3.5+ 直升一次 `migrate up` 就能搞定。如果你还看到这个错,要么用的是 MUL-2957 之前的二进制,要么 hook 自己也失败了 —— 看 migrate 日志里更早一行的 `task_usage hourly rollup hook` 看具体原因。
+## 升级时 migration 103 拒绝执行
-**怎么修**:
+正常升级不需要为 103 做任何事:`migrate up` 在应用它之前会自动回填历史用量数据——空库直接通过,有历史数据的实例自动按月补齐后继续。
-1. 如果你跑的是 MUL-2957 之前的 binary,又没办法先升级 binary,就对同一个数据库手动跑一次独立 backfill(幂等,可以打断,可以重试):
+如果 backend 启动仍报 `refusing to drop legacy daily rollups`,说明自动回填没有完成(例如回填中途失败,或没有通过 `migrate up` 而是直接应用了 SQL)。此时手动运行回填命令,完成后重启 backend:
- ```bash
- # Docker Compose
- docker compose -f docker-compose.selfhost.yml exec backend \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
+```bash
+cd server
+DATABASE_URL='postgres://...' go run ./cmd/backfill_task_usage_hourly
+```
- # Kubernetes
- kubectl -n multica exec deploy/multica-backend -- \
- ./backfill_task_usage_hourly --sleep-between-slices=2s
- ```
+常用 flag:`--dry-run` 只预览不写入;`--sleep-between-slices` 在切片之间加间隔,降低对繁忙实例的读压。命令按月切片、幂等,中断后可以直接重跑;它持有 advisory lock,与服务端的定时汇总互斥,不会产生重复或不一致的汇总数据。完成后重启 backend,用 `/readyz` 确认 `migrations` 为 `ok`。
-2. 重新跑升级 —— 重启 backend 容器即可,启动时会自动跑 migration。Guard 看到新的 watermark,`103` 就会通过。
-3. 之后由进程内调度器持续推 watermark —— 见 [Self-host 快速上手 → 用量汇总](/self-host-quickstart#7-usage-rollup-no-operator-action-required)。
+## 端口占用
-`--sleep-between-slices=2s` 在有多年历史的生产库上是个比较克制的默认值。如果你只想保留最近 N 个月、可以接受永久丢掉更老的桶,用 `--months-back N --force-partial`。
+本地常用端口包括 API 的 `8080`、Web 的 `3000` 和守护进程健康检查端口。先找出占用者:
-## 端口冲突
+```bash
+lsof -nP -iTCP:8080 -sTCP:LISTEN # macOS / Linux
+netstat -ano | findstr :8080 # Windows
+```
-**症状**:`multica server` 或 `multica daemon start` 启动失败,报 `address already in use`。
+如果它是另一个 Multica checkout,先在那个目录运行 `make stop`。否则正常停止占用端口的程序,或修改当前服务端口。公网 80/443 由 Caddy、Nginx 等反向代理监听。
-**可能原因**:
+## 日志位置
-1. **Server 端口被占用**(默认 `8080`)
-2. **Daemon health 端口被占用**(默认 `19514`,每个 profile 偏移一个 hash 值)
-3. **Web dev server 端口冲突**(`3000` / `5173`)
-4. **端口权限不足**(绑 `< 1024` 的 privileged port 需要 sudo)
+| 组件 | 查看方式 |
+| --- | --- |
+| 后台守护进程 | `multica daemon logs --lines 100` |
+| 实时跟随守护进程日志 | `multica daemon logs --follow` |
+| 默认 profile 的日志文件 | `~/.multica/daemon.log` |
+| 默认 profile 的启动或崩溃日志 | `~/.multica/daemon.err.log` |
+| 命名 profile | `~/.multica/profiles/<name>/` 下的对应日志 |
+| Docker backend | `docker compose -f docker-compose.selfhost.yml logs -f backend` |
+| 浏览器 | 开发者工具中的 Console 和 Network |
-**怎么查**:
+需要直接观察守护进程启动过程时,可以改为前台运行:
```bash
-lsof -i :8080 # macOS / Linux
-netstat -ano | findstr :8080 # Windows
+multica daemon stop
+multica daemon start --foreground
```
-**怎么修**:
-
-- 杀占用进程(`kill -9 <PID>`),或改环境变量 `PORT=9000` 换端口
-- 要用 80 / 443 → 别直接绑,用反向代理(Nginx / Caddy)转发到高位端口
-
-## 在哪看日志
-
-| 组件 | 位置 | 命令 |
-|---|---|---|
-| **守护进程** | `~/.multica/daemon.log`(后台模式)或前台 stdout | `multica daemon logs -f --lines 100` |
-| **守护进程(崩溃)** | `~/.multica/daemon.err.log` | 直接打开——panic / 启动早期错误会写到这里 |
-| **服务器(Docker)** | container stdout | `docker logs -f <container>` |
-| **服务器(systemd)** | journal | `journalctl -u multica-server -f` |
-| **前端(dev)** | `pnpm dev` 所在终端 | 直接看 |
-| **前端(browser)** | DevTools → Console | 按 `F12` |
+仍然无法定位时,到 [GitHub Issues](https://github.com/multica-ai/multica/issues) 搜索已有问题或提交新的 issue。
-后台模式下 `daemon.log` 会按大小轮转(默认 20MB × 5 份 gzip 备份;可用 `MULTICA_DAEMON_LOG_MAX_SIZE_MB` / `_MAX_BACKUPS` / `_MAX_AGE_DAYS` 调整),所以文件不会大到打不开。Go 运行时 panic 和 logger 建立前的错误会写到独立且有上限的 `daemon.err.log`。
+## 接下来
-需要更详细的 daemon 日志,把它从后台挪到前台跑:`multica daemon stop && multica daemon start --foreground`。前台运行会把日志实时打到终端,而不是写入轮转文件。
+- [守护进程与运行时](/daemon-runtimes) — 运行时注册与在线状态机制。
+- [执行任务](/tasks) — 状态、超时与失败原因参考。
+- [环境变量](/environment-variables) — 自托管配置的完整参考。
diff --git a/apps/docs/content/docs/vcs-integration.ja.mdx b/apps/docs/content/docs/vcs-integration.ja.mdx
new file mode 100644
index 0000000000..079751e8a4
--- /dev/null
+++ b/apps/docs/content/docs/vcs-integration.ja.mdx
@@ -0,0 +1,84 @@
+---
+title: セルフホスト Git ホスティング
+description: ワークスペースごとにセルフホストの Forgejo、Gitea、GitLab インスタンスを接続し、イシュー番号を参照する Pull Request / Merge Request を対応するイシューへ自動的に紐づけ、マージ時に「完了」へ移動して CI ステータスを表示します。
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+<Callout type="warn">
+**セルフホスト版 Multica 専用です。** この連携は Multica を**自分でデプロイしている**場合のみ利用でき、Multica Cloud では提供されません。ここでの「セルフホスト」は **Multica 自体**のセルフホストを意味します。通常は独自ネットワーク内の Git インスタンスへアクセスするために使用します。サーバー運用者が `MULTICA_VCS_INTEGRATION_ENABLED=true` を設定して機能を有効にし、`MULTICA_VCS_SECRET_KEY` も設定する必要があります。それまでは、設定 → 連携にこのセクションは表示されません。
+</Callout>
+
+Multica はワークスペースごとにセルフホストの Git ホスティング、**Forgejo**、**Gitea**、**GitLab** のいずれかへ接続します。接続後、ブランチ名、タイトル、本文にイシュー番号(例: `MUL-123`)を含む Pull Request(GitLab では Merge Request)は、対応する[イシュー](/issues)へ**自動的に紐づけられ**、イシューサイドバーの **Pull requests** に表示されます。終了キーワードを含む PR がマージされると、イシューは「完了」へ移動します。head commit の CI はカード上のチェックバーとして表示されます。
+
+これらの Git ホスティングは GitHub と並行して利用でき、1 つのワークスペースで任意に組み合わせられます。
+
+<Callout type="info">
+GitHub と異なり、これらの Git ホスティングには「App」モデルがありません。各ワークスペースが独自のインスタンス URL とアクセストークンを保存し、リポジトリまたは組織へ Webhook を登録します。トークンと Webhook secret はどちらも暗号化して保存されます。
+</Callout>
+
+## 前提条件(サーバー)
+
+まず、このデプロイで連携を有効にします。デフォルトでは無効であり、有効にするまでセクションは表示されません。
+
+```sh
+MULTICA_VCS_INTEGRATION_ENABLED=true
+```
+
+公式のセルフホスト用 `docker compose` ファイル(`docker-compose.selfhost.yml`)では設定済みです。
+
+次に、保存する認証情報をサーバーが暗号化するための、base64 でエンコードした 32 バイトの鍵を設定します。設定しない場合、接続フォームは利用できません。
+
+```sh
+openssl rand -base64 32
+```
+
+```sh
+MULTICA_VCS_SECRET_KEY=<base64 32 バイト鍵>
+```
+
+両方が必要です。スイッチは機能を提供するかどうかを決め、鍵は保存するトークンと Webhook secret を暗号化します。接続、Webhook、ローテーションはいずれも両方の設定を必要とします。
+
+`MULTICA_PUBLIC_URL` にサーバーの公開ベース URL を設定すると、Multica がそのまま貼り付けられる Webhook URL を表示できます。設定しない場合、画面には Webhook のパスだけが表示されるため、origin を自分で補います。
+
+## ワークスペースを接続
+
+1. Git ホスティング側で、リポジトリの読み取り権限を持つアクセストークンを作成します。
+ - **Forgejo / Gitea**: 設定 → アプリケーション。
+ - **GitLab**: `read_api` 権限を持つ個人(またはグループ/プロジェクト)アクセストークン。
+2. Multica で **設定 → 連携 → Git ホスティング**を開きます。
+3. **プロバイダー**を選択し、インスタンス URL(例: `https://forgejo.example.com`)とアクセストークンを入力して **接続**をクリックします。Multica は保存前に、そのトークンでインスタンスへアクセスして検証します。
+4. 接続後に表示される **Webhook URL** と **Webhook secret** をコピーします。
+
+<Callout type="warn">
+Webhook secret は一度しか表示されません。ページを離れる前にコピーしてください。同じインスタンスへ再接続すると、トークンと secret がローテーションされます。
+</Callout>
+
+## Webhook を登録
+
+リポジトリ(または全リポジトリを対象にする組織/グループ)で設定します。
+
+**Forgejo / Gitea** — 設定 → Webhook → Webhook を追加 → Forgejo/Gitea:
+
+- **送信先 URL**: 前の手順で取得した Webhook URL。
+- **HTTP メソッド** `POST`、**コンテンツタイプ** `application/json`。
+- **secret**: Webhook secret(`X-Gitea-Signature` HMAC の検証に使用)。
+- **トリガーイベント**: **Pull Request** を選び、CI をミラーするには **Commit Status** も選択。
+
+**GitLab** — 設定 → Webhooks:
+
+- **URL**: Webhook URL。
+- **Secret token**: Webhook secret(`X-Gitlab-Token` として送信され、文字列をそのまま比較)。
+- **トリガー**: **Merge request events** を有効にし、CI をミラーするには **Pipeline events** も有効化。
+
+Multica は保存済みの secret で各 delivery を検証するため、一致する secret がない Webhook は拒否されます。
+
+## ミラーされる内容
+
+- **Pull / Merge Request** — open、closed、merged、draft の状態、作成者、ブランチ、および Git ホスティングが提供する場合は diff 統計。
+- **イシューの紐づけ** — タイトル、本文、ブランチの番号で PR をイシューへ紐づけます。マージ済み PR に終了キーワード(`Closes`/`Fixes`/`Resolves MUL-123`)があり、open の関連 PR が残っていなければ、イシューを「完了」へ移動します。
+- **CI** — Forgejo/Gitea の commit status と GitLab pipeline を、head commit の成功/失敗/進行中チェックバーへ集約します。
+
+## エージェントによる Pull Request の作成
+
+PR の作成には Multica 側の Git ホスティング設定は不要です。エージェントはランタイムでリポジトリを checkout し、ランタイムホスト自身の Git 認証情報を使ってブランチを push し、PR を作成します。エージェントを特定の Git ホスティングで動かすには、SSH deploy key やホストの Git credential helper に保存したトークンなどを使って、デーモンホストがその Git ホスティングへ認証できるようにし、通常どおりリポジトリ URL を追加してください。任意の Git URL を checkout できるため、プロバイダー固有の設定は必要ありません。
diff --git a/apps/docs/content/docs/vcs-integration.ko.mdx b/apps/docs/content/docs/vcs-integration.ko.mdx
new file mode 100644
index 0000000000..2317acd666
--- /dev/null
+++ b/apps/docs/content/docs/vcs-integration.ko.mdx
@@ -0,0 +1,84 @@
+---
+title: 자체 호스팅 Git 코드 호스팅
+description: 워크스페이스마다 자체 호스팅 Forgejo, Gitea, GitLab 인스턴스를 연결해 이슈 번호를 참조한 Pull Request / Merge Request를 해당 이슈에 자동 연결하고, merge 시 완료로 옮기며 CI 상태를 표시합니다.
+---
+
+import { Callout } from "fumadocs-ui/components/callout";
+
+<Callout type="warn">
+**자체 배포한 Multica에서만 사용할 수 있습니다.** 이 연동은 Multica를 **직접 배포해 운영할 때만** 제공되며 Multica Cloud에서는 사용할 수 없습니다. 여기서 "자체 호스팅"은 **Multica 자체를 배포하는 것**을 뜻합니다. 일반적으로 자체 네트워크의 Git 인스턴스에 접근하기 위해 사용합니다. 서버 운영자가 `MULTICA_VCS_INTEGRATION_ENABLED=true`로 기능을 켜고 `MULTICA_VCS_SECRET_KEY`도 설정해야 합니다. 그전에는 설정 → 연동에 이 영역이 표시되지 않습니다.
+</Callout>
+
+Multica는 워크스페이스별로 자체 호스팅 Git 코드 호스팅인 **Forgejo**, **Gitea**, **GitLab** 중 하나에 연결합니다. 연결하면 브랜치 이름, 제목, 본문에 이슈 번호(예: `MUL-123`)가 포함된 Pull Request(GitLab에서는 Merge Request)가 해당 [이슈](/issues)에 **자동으로 연결**되고 이슈 사이드바의 **Pull requests**에 표시됩니다. 종료 키워드가 있는 PR이 merge되면 이슈가 완료로 이동합니다. head commit의 CI는 카드에 check bar로 표시됩니다.
+
+이 코드 호스팅은 GitHub와 동시에 사용할 수 있으며 워크스페이스 하나에서 원하는 대로 조합할 수 있습니다.
+
+<Callout type="info">
+GitHub와 달리 이 코드 호스팅에는 "App" 모델이 없습니다. 워크스페이스마다 인스턴스 URL과 액세스 token을 저장하고 저장소 또는 조직에 Webhook을 등록합니다. Token과 Webhook secret은 모두 암호화되어 저장됩니다.
+</Callout>
+
+## 사전 조건(서버)
+
+먼저 이 배포에서 연동을 켭니다. 기본값은 꺼짐이며 활성화하기 전에는 해당 영역이 표시되지 않습니다.
+
+```sh
+MULTICA_VCS_INTEGRATION_ENABLED=true
+```
+
+공식 자체 호스팅 `docker compose` 파일(`docker-compose.selfhost.yml`)에는 이미 설정되어 있습니다.
+
+그런 다음 서버가 저장된 자격 증명을 암호화할 수 있도록 base64로 인코딩한 32바이트 키를 설정합니다. 설정하지 않으면 연결 양식을 사용할 수 없습니다.
+
+```sh
+openssl rand -base64 32
+```
+
+```sh
+MULTICA_VCS_SECRET_KEY=<base64 32바이트 키>
+```
+
+두 값이 모두 필요합니다. 스위치는 기능을 제공할지 결정하고 키는 저장된 token과 Webhook secret을 암호화합니다. 연결, Webhook, 교체 모두 두 설정을 함께 요구합니다.
+
+`MULTICA_PUBLIC_URL`을 서버의 공개 base URL로 설정하면 Multica가 바로 붙여 넣을 수 있는 Webhook URL을 표시합니다. 설정하지 않으면 화면에 Webhook 경로만 표시되므로 origin을 직접 앞에 붙여야 합니다.
+
+## 워크스페이스 연결
+
+1. Git 코드 호스팅에서 저장소 읽기 권한이 있는 액세스 token을 만듭니다.
+ - **Forgejo / Gitea**: 설정 → 애플리케이션.
+ - **GitLab**: `read_api` 권한이 있는 개인(또는 그룹/프로젝트) 액세스 token.
+2. Multica에서 **설정 → 연동 → Git 코드 호스팅**을 엽니다.
+3. **제공자**를 선택하고 인스턴스 URL(예: `https://forgejo.example.com`)과 액세스 token을 입력한 뒤 **연결**을 클릭합니다. Multica는 저장하기 전에 해당 token으로 인스턴스에 접근해 검증합니다.
+4. 연결 후 표시되는 **Webhook URL**과 **Webhook secret**을 복사합니다.
+
+<Callout type="warn">
+Webhook secret은 한 번만 표시됩니다. 페이지를 떠나기 전에 복사하세요. 같은 인스턴스에 다시 연결하면 token과 secret이 교체됩니다.
+</Callout>
+
+## Webhook 등록
+
+저장소에서 설정합니다. 모든 저장소를 포함하려면 조직 또는 그룹에서 설정할 수도 있습니다.
+
+**Forgejo / Gitea** — 설정 → Webhook → Webhook 추가 → Forgejo/Gitea:
+
+- **대상 URL**: 이전 단계의 Webhook URL.
+- **HTTP 메서드** `POST`, **콘텐츠 유형** `application/json`.
+- **secret**: Webhook secret(`X-Gitea-Signature` HMAC 검증에 사용).
+- **트리거 이벤트**: **Pull Request**를 선택하고 CI를 미러링하려면 **Commit Status**도 선택합니다.
+
+**GitLab** — 설정 → Webhooks:
+
+- **URL**: Webhook URL.
+- **Secret token**: Webhook secret(`X-Gitlab-Token`으로 전송되고 문자열 그대로 비교).
+- **트리거**: **Merge request events**를 활성화하고 CI를 미러링하려면 **Pipeline events**도 활성화합니다.
+
+Multica는 저장된 secret으로 모든 delivery를 검증하므로 일치하는 secret이 없는 Webhook은 거부됩니다.
+
+## 미러링되는 내용
+
+- **Pull / Merge Request** — open, closed, merged, draft 상태와 작성자, 브랜치, 그리고 코드 호스팅이 제공하는 경우 diff 통계.
+- **이슈 연결** — 제목, 본문, 브랜치의 번호가 PR을 이슈에 연결합니다. merge된 PR에 종료 키워드(`Closes`/`Fixes`/`Resolves MUL-123`)가 있고 open 상태인 연결 PR이 더 없으면 이슈를 완료로 옮깁니다.
+- **CI** — Forgejo/Gitea commit status와 GitLab pipeline을 head commit의 통과/실패/진행 중 check bar로 집계합니다.
+
+## 에이전트의 Pull Request 생성
+
+PR을 만드는 데 Multica의 Git 코드 호스팅 설정은 필요하지 않습니다. 에이전트는 런타임에서 저장소를 checkout하고 런타임 host 자체의 Git 자격 증명으로 브랜치를 push하고 PR을 만듭니다. 에이전트가 특정 코드 호스팅에서 작업하게 하려면 SSH deploy key 또는 host의 Git credential helper에 저장된 token 등을 사용해 데몬 host가 해당 서비스에 인증할 수 있게 하고 평소처럼 저장소 URL을 추가하세요. 저장소 checkout은 모든 Git URL을 지원하므로 제공자별 설정이 필요하지 않습니다.
diff --git a/apps/docs/content/docs/workspaces.ja.mdx b/apps/docs/content/docs/workspaces.ja.mdx
index b7ea12db59..4250715079 100644
--- a/apps/docs/content/docs/workspaces.ja.mdx
+++ b/apps/docs/content/docs/workspaces.ja.mdx
@@ -1,56 +1,56 @@
---
title: ワークスペース
-description: ワークスペースはグループが協働する独立した空間で、すべてのイシュー、メンバー、コメント、エージェントが 1 つのワークスペースに属します。
+description: ワークスペースは、チーム、作業、エージェント設定を互いに分離する境界です。
---
import { Callout } from "fumadocs-ui/components/callout";
-ワークスペースは **Multica でグループが協働する独立した空間**で、すべての[イシュー](/issues)、[メンバー](/members-roles)、[コメント](/comments)、[エージェント](/agents)が 1 つのワークスペースに属します。ログイン後に表示されるイシュー一覧、メンバー名簿、エージェント設定はすべて現在のワークスペースに限定されており、**ワークスペースを切り替えると画面全体が入れ替わります**。
+ワークスペースは Multica の最上位の境界です。メンバー、イシュー、プロジェクト、エージェント、スキル、タスク履歴はすべていずれか 1 つのワークスペースに属し、互いに完全に分離されています。
-## ワークスペースの作成
-
-ワークスペースを作成するとき、3 つのことが決まります。
+## ワークスペースの構成
-- **ワークスペース名** — メンバーに表示される表示名です。空白や非 ASCII 文字を使用できます。後から変更できます。
-- **Slug** — ワークスペース URL に使われる文字列です。小文字と数字のみが使用でき(`-` で連結)、**作成後は変更できないため**、慎重に選んでください。slug がすでに使用中だったり、システム予約語と重なったりする場合、作成画面で別の値を選ぶよう求められます。
-- **イシュー接頭辞** — ワークスペース内のすべてのイシュー番号の接頭辞です(`MUL-123` の `MUL`)。大文字と数字のみが使用でき、最大 10 文字です。
+| 分類 | 内容 |
+|---|---|
+| **作業** | イシュー、プロジェクト、コメント、添付ファイル、タスク履歴 |
+| **チーム** | メンバー、ロール、招待 |
+| **エージェント** | エージェント設定、スキル、ランタイム、自動化 |
+| **共有設定** | コンテキスト、ラベル、カスタムプロパティ、連携 |
-<Callout type="warning">
-**イシュー接頭辞は変更しないでください。** イシュー番号は現在の接頭辞でレンダリングされるため、接頭辞を変更すると `MUL-5` がただちに `NEW-5` になります。すべての外部リンク、Slack のメンション、コメント内の過去の参照が古い番号と合わなくなります。イシュー接頭辞は「作成時に決め、決して触らない」値として扱ってください。
-</Callout>
+**コンテキスト**はワークスペース内のすべてのエージェントに渡されます。チームの背景、プロダクトの約束事、長期的に有効な要件を書く場所です。一回限りのタスク要件は、対応するイシューに書いてください。
-ワークスペースは Web UI から作成することも、コマンドラインから作成することもできます。`--name` と `--slug` はどちらも必須で、作成しても現在のワークスペースは**切り替わりません**。作成したワークスペースで作業したい場合は、続けて `multica workspace switch <slug>` を実行してください。
+## ワークスペースの作成
-```bash
-multica workspace create --name "Support Team" --slug support-team --issue-prefix SUP
-```
+作成時に入力するのは 2 つです。
-## イシュー番号
+- **名前**: メンバーに表示されます。後から変更できます。
+- **ワークスペース URL**: アドレスに使われる slug です。`multica.ai/my-team` の `my-team` にあたります。小文字、数字、ハイフンのみが使え、既存のワークスペースや予約済みアドレスとは重複できず、作成後は変更できません。
-ワークスペースで作成されるすべてのイシューには、`<接頭辞>-<数字>` 形式の番号が自動的に割り当てられます — `MUL-1`、`MUL-2`、`MUL-3`。いくつかの特性は次のとおりです。
+作成者は自動的に `owner` になります。イシュー接頭辞はワークスペース名から自動生成され、接頭辞が `MUL` の場合、イシュー番号は `MUL-1`、`MUL-2` と表示され、ワークスペース内で独立して増えていきます。
-- **ワークスペース内で連番かつ一意** — 各ワークスペースは独自のカウンターを保持し、ワークスペース同士は互いに干渉しません。
-- **手動で指定できない** — イシューを作成するときはタイトルのみを入力し、番号はシステムが割り当てます。
-- **削除しても再利用されない** — `MUL-5` を削除しても、次の新しいイシューは `MUL-5` ではなく `MUL-6` です。
+## 設定の変更
-## ワークスペースの削除
+`owner` と `admin` は名前、アイコン、説明、コンテキスト、イシュー接頭辞を変更できます。`member` は閲覧のみです。
-ワークスペースの owner のみが、ワークスペース全体を削除できます。削除は**取り消せません**。
+![ワークスペース設定:名前、コンテキスト、slug、イシュー接頭辞と危険区域](/images/docs/workspace-settings.png)
<Callout type="warning">
-ワークスペースを削除すると、次の項目が一度にすべて消去されます。
+イシュー接頭辞を変更すると、すべてのイシューがただちに新しい番号に切り替わります(`MUL-5` が `NEW-5` になります)。ただし、PR、ブランチ名、チャット履歴にある古い番号は更新されません。
+</Callout>
-- すべてのイシュー、プロジェクト、コメント、リアクション
-- すべての添付ファイル
-- すべてのメンバーシップと保留中の招待
-- すべてのエージェント設定とそのタスク履歴
+## 切り替えと退出
-**データは復旧できません。** 削除する前に、保管しておきたい項目をエクスポートしてください。
-</Callout>
+1 つのアカウントで複数のワークスペースに参加できます。切り替えは現在表示している範囲を変えるだけで、データは一切移動しません。
+
+ワークスペースを退出した後に戻るには、あらためて招待を受ける必要があります。退出すると同時に、自分が所有するランタイムは無効化され、それに紐づくエージェントはアーカイブされ、未完了のタスクはキャンセルされます。
+
+最後の `owner` は退出できません。先に別のメンバーを `owner` に昇格してください。
+
+## ワークスペースの削除
-ワークスペースの最後の owner であり、そのワークスペースから手を引きたい場合は、まず owner の役割を別のメンバーに移譲したうえで、新しい owner(または本人)が削除するかどうかを決定するようにしてください。[メンバーと役割](/members-roles)を参照してください。
+ワークスペースを削除できるのは `owner` だけです。削除すると、その中の作業、メンバー、エージェント設定、タスク履歴のすべてが完全に削除され、復元できません。しばらく離れるだけなら、削除ではなく退出を選んでください。
-## 次へ
+## 次のステップ
-- [メンバーと役割](/members-roles) — ワークスペースに人を追加する方法と、3 つの役割がそれぞれ何をできるか
-- [イシューとプロジェクト](/issues) — ワークスペース内部の中核となる作業オブジェクト
+- [メンバーとロール](/members-roles) — メンバーを招待し、ロールを管理する。
+- [イシュー](/issues) — ワークスペースにおける基本の作業単位。
+- [エージェント](/agents) — エージェントのアイデンティティと設定。
diff --git a/apps/docs/content/docs/workspaces.ko.mdx b/apps/docs/content/docs/workspaces.ko.mdx
index f844efb1dc..e4ff4666c3 100644
--- a/apps/docs/content/docs/workspaces.ko.mdx
+++ b/apps/docs/content/docs/workspaces.ko.mdx
@@ -1,56 +1,56 @@
---
title: 워크스페이스
-description: 워크스페이스는 그룹이 협업하는 독립된 공간으로, 모든 이슈, 멤버, 댓글, 에이전트가 하나의 워크스페이스에 속합니다.
+description: 워크스페이스는 팀, 작업, 에이전트 설정이 서로 격리되는 경계입니다.
---
import { Callout } from "fumadocs-ui/components/callout";
-워크스페이스는 **Multica에서 그룹이 협업하는 독립된 공간**으로, 모든 [이슈](/issues), [멤버](/members-roles), [댓글](/comments), [에이전트](/agents)가 하나의 워크스페이스에 속합니다. 로그인 후 보이는 이슈 목록, 멤버 명단, 에이전트 설정은 모두 현재 워크스페이스로 한정되며, **워크스페이스를 전환하면 전체 화면이 교체됩니다**.
+워크스페이스는 Multica의 최상위 경계입니다. 멤버, 이슈, 프로젝트, 에이전트, 스킬, 실행 기록은 모두 특정 워크스페이스에 속하며 서로 완전히 격리됩니다.
-## 워크스페이스 생성
+## 워크스페이스의 구성
-워크스페이스를 생성할 때 세 가지가 결정됩니다.
+| 범주 | 내용 |
+|---|---|
+| **작업** | 이슈, 프로젝트, 댓글, 첨부 파일, 실행 기록 |
+| **팀** | 멤버, 역할, 초대 |
+| **에이전트** | 에이전트 설정, 스킬, 런타임, 자동화 |
+| **공유 설정** | 컨텍스트, 라벨, 사용자 지정 속성, 연동 |
-- **워크스페이스 이름** — 멤버에게 보이는 표시 이름입니다. 공백과 비ASCII 문자를 사용할 수 있습니다. 나중에 변경할 수 있습니다.
-- **Slug** — 워크스페이스 URL에 사용되는 문자열입니다. 소문자와 숫자만 사용할 수 있으며(`-`로 연결), **생성 후에는 변경할 수 없으므로** 신중하게 선택하세요. slug가 이미 사용 중이거나 시스템 예약어와 겹치면, 생성 화면에서 다른 값을 선택하도록 요청합니다.
-- **이슈 접두사** — 워크스페이스 내 모든 이슈 번호의 접두사입니다(`MUL-123`의 `MUL`). 대문자와 숫자만 사용할 수 있으며, 최대 10자입니다.
+**컨텍스트**는 워크스페이스의 모든 에이전트에게 제공됩니다. 팀 배경, 제품 규칙, 장기적으로 적용되는 요구 사항을 작성하기에 적합합니다. 일회성 태스크 요구 사항은 해당 이슈에 작성하세요.
-<Callout type="warning">
-**이슈 접두사는 변경하지 마세요.** 이슈 번호는 현재 접두사로 렌더링되므로, 접두사를 변경하면 `MUL-5`가 즉시 `NEW-5`가 됩니다. 모든 외부 링크, Slack 멘션, 댓글 속 과거 참조가 기존 번호와 맞지 않게 됩니다. 이슈 접두사는 "생성 시 정하고 절대 건드리지 않는" 값으로 다루세요.
-</Callout>
+## 워크스페이스 만들기
-워크스페이스는 웹 UI에서 생성할 수도 있고, 커맨드 라인에서 생성할 수도 있습니다. `--name`과 `--slug`는 모두 필수이며, 생성해도 현재 워크스페이스는 **전환되지 않습니다**. 생성한 워크스페이스에서 작업하려면 이어서 `multica workspace switch <slug>`를 실행하세요.
+만들 때 두 항목을 입력합니다.
-```bash
-multica workspace create --name "Support Team" --slug support-team --issue-prefix SUP
-```
+- **이름**: 멤버에게 표시되며 나중에 변경할 수 있습니다.
+- **워크스페이스 URL**: 주소에 들어가는 slug입니다. 예를 들어 `multica.ai/my-team`의 `my-team`입니다. 소문자, 숫자, 하이픈만 사용할 수 있고 기존 워크스페이스 또는 예약된 주소와 중복될 수 없으며 만든 뒤에는 변경할 수 없습니다.
-## 이슈 번호
+만든 사람은 자동으로 `owner`가 됩니다. 이슈 접두사는 워크스페이스 이름에서 자동으로 생성됩니다. 예를 들어 접두사가 `MUL`이면 이슈 번호는 `MUL-1`, `MUL-2`처럼 표시되며 워크스페이스 안에서 독립적으로 증가합니다.
-워크스페이스에서 생성되는 모든 이슈에는 `<접두사>-<숫자>` 형식의 번호가 자동으로 할당됩니다 — `MUL-1`, `MUL-2`, `MUL-3`. 몇 가지 특성은 다음과 같습니다.
+## 설정 변경
-- **워크스페이스 내에서 순차적이며 고유함** — 각 워크스페이스는 자체 카운터를 유지하며, 워크스페이스끼리 서로 간섭하지 않습니다.
-- **수동으로 지정할 수 없음** — 이슈를 생성할 때는 제목만 입력하며, 번호는 시스템이 할당합니다.
-- **삭제해도 회수되지 않음** — `MUL-5`를 삭제해도 다음 새 이슈는 `MUL-5`가 아니라 `MUL-6`입니다.
+`owner`와 `admin`은 이름, 아이콘, 설명, 컨텍스트, 이슈 접두사를 변경할 수 있습니다. `member`는 보기만 할 수 있습니다.
-## 워크스페이스 삭제
-
-워크스페이스 owner만 전체 워크스페이스를 삭제할 수 있습니다. 삭제는 **되돌릴 수 없습니다**.
+![워크스페이스 설정: 이름, 컨텍스트, slug, 이슈 접두사, 위험 구역](/images/docs/workspace-settings.png)
<Callout type="warning">
-워크스페이스를 삭제하면 다음 항목이 한꺼번에 모두 지워집니다.
+이슈 접두사를 변경하면 모든 이슈가 즉시 새 번호를 사용합니다(`MUL-5`가 `NEW-5`로 변경). 하지만 PR, 브랜치 이름, 채팅 기록의 이전 번호는 업데이트되지 않습니다.
+</Callout>
-- 모든 이슈, 프로젝트, 댓글, 반응
-- 모든 첨부 파일
-- 모든 멤버십과 대기 중인 초대
-- 모든 에이전트 설정과 그 작업 기록
+## 전환 및 나가기
-**데이터는 복구할 수 없습니다.** 삭제하기 전에 보관해야 할 항목을 내보내세요.
-</Callout>
+하나의 계정으로 여러 워크스페이스에 참여할 수 있습니다. 전환하면 현재 보는 범위만 바뀌며 데이터는 이동하지 않습니다.
+
+워크스페이스를 나가면 다시 참여하려면 초대를 새로 수락해야 합니다. 나갈 때는 본인이 소유한 런타임도 비활성화되고, 해당 런타임에 연결된 에이전트는 보관 처리되며, 완료되지 않은 실행 태스크는 취소됩니다.
+
+마지막 `owner`는 워크스페이스를 나갈 수 없습니다. 먼저 다른 멤버를 `owner`로 승격해야 합니다.
+
+## 워크스페이스 삭제
-워크스페이스의 마지막 owner인데 워크스페이스에서 손을 떼고 싶다면, 먼저 owner 역할을 다른 멤버에게 이전한 다음, 새 owner(또는 본인)가 삭제 여부를 결정하도록 하세요. [멤버와 역할](/members-roles)을 참고하세요.
+워크스페이스는 `owner`만 삭제할 수 있습니다. 삭제하면 그 안의 모든 작업, 멤버, 에이전트 설정, 실행 기록이 영구적으로 제거되며 복구할 수 없습니다. 잠시 참여하지 않으려는 경우에는 삭제하지 말고 워크스페이스를 나가세요.
-## 다음
+## 다음 단계
-- [멤버와 역할](/members-roles) — 워크스페이스에 사람을 추가하는 방법과, 세 가지 역할이 각각 할 수 있는 일
-- [이슈와 프로젝트](/issues) — 워크스페이스 내부의 핵심 작업 객체
+- [멤버와 권한](/members-roles) — 멤버를 초대하고 역할을 관리합니다.
+- [이슈](/issues) — 워크스페이스의 기본 작업 단위를 알아봅니다.
+- [에이전트](/agents) — 에이전트의 정체성과 설정을 알아봅니다.
diff --git a/apps/docs/content/docs/workspaces.mdx b/apps/docs/content/docs/workspaces.mdx
index ab53e21e62..442cc3bcf0 100644
--- a/apps/docs/content/docs/workspaces.mdx
+++ b/apps/docs/content/docs/workspaces.mdx
@@ -1,56 +1,56 @@
---
title: Workspaces
-description: A workspace is the self-contained space where a group collaborates — every issue, member, comment, and agent belongs to one.
+description: A workspace is the boundary that keeps teams, work, and agent configuration isolated from each other.
---
import { Callout } from "fumadocs-ui/components/callout";
-A workspace is **the self-contained space where a group collaborates in Multica** — every [issue](/issues), [member](/members-roles), [comment](/comments), and [agent](/agents) belongs to one. The issue list, member roster, and agent configuration you see after logging in are all scoped to the current workspace; **switching workspaces replaces the entire view**.
+A workspace is Multica's top-level boundary. Members, issues, projects, agents, skills, and task history all belong to one workspace and are fully isolated from every other.
-## Creating a workspace
+## What a workspace contains
-Three things get decided when you create a workspace:
+| Category | Contents |
+|---|---|
+| **Work** | Issues, projects, comments, attachments, task history |
+| **Team** | Members, roles, invitations |
+| **Agents** | Agent configuration, skills, runtimes, automations |
+| **Shared settings** | Context, labels, custom properties, integrations |
-- **Workspace name** — the display name members see. Spaces and non-ASCII characters are allowed. You can change it later.
-- **Slug** — the string used in the workspace URL. Lowercase letters and digits only (joined with `-`). **It cannot be changed after creation**, so pick carefully. If the slug is taken or hits a system-reserved word, the create screen will ask you to choose another.
-- **Issue prefix** — the prefix for every issue number in the workspace (the `MUL` in `MUL-123`). Uppercase letters and digits, up to 10 characters.
+**Context** is provided to every agent in the workspace — the place for team background, product conventions, and long-lived requirements. One-off task requirements belong in the corresponding issue.
-<Callout type="warning">
-**Avoid changing the issue prefix.** Issue numbers are rendered with the current prefix — change it and `MUL-5` instantly becomes `NEW-5`. Every external link, Slack mention, and historical reference in comments breaks against the old number. Treat the issue prefix as "set at creation, never touched."
-</Callout>
+## Create a workspace
-You can create a workspace from the web UI, or from the command line. Both `--name` and `--slug` are required, and creating a workspace does **not** switch your current one — run `multica workspace switch <slug>` afterward if you want to work in it:
+Creating a workspace asks for two things:
-```bash
-multica workspace create --name "Support Team" --slug support-team --issue-prefix SUP
-```
+- **Name**: shown to members; can be changed later.
+- **Workspace URL**: the slug in the address — the `my-team` in `multica.ai/my-team`. Lowercase letters, digits, and hyphens only; it cannot collide with an existing workspace or a reserved address, and it cannot be changed after creation.
-## Issue numbers
+The creator automatically becomes an `owner`. The issue prefix is generated from the workspace name — with the prefix `MUL`, issue numbers appear as `MUL-1`, `MUL-2`, counting up independently within the workspace.
-Every issue created in a workspace is automatically assigned a number in the format `<prefix>-<digits>` — `MUL-1`, `MUL-2`, `MUL-3`. A few properties:
+## Change settings
-- **Sequential and unique within a workspace** — each workspace keeps its own counter; workspaces don't interfere with each other.
-- **Not manually assignable** — when you create an issue you only supply a title; the number is assigned by the system.
-- **Never reclaimed on delete** — delete `MUL-5` and the next new issue is `MUL-6`, not `MUL-5`.
+`owner` and `admin` can change the name, icon, description, context, and issue prefix; `member` can only view them.
-## Deleting a workspace
-
-Only a workspace owner can delete the entire workspace. Deletion is **irreversible**.
+![Workspace settings: name, context, slug, issue prefix, and the danger zone](/images/docs/workspace-settings.png)
<Callout type="warning">
-Deleting a workspace wipes the following all at once:
+After the issue prefix changes, every issue immediately switches to the new number (`MUL-5` becomes `NEW-5`), but the old numbers in PRs, branch names, and chat history do not update.
+</Callout>
-- Every issue, project, comment, and reaction
-- Every attachment
-- Every membership and pending invitation
-- Every agent configuration along with its task history
+## Switch and leave
-**Data cannot be recovered.** Export anything you need to keep before deleting.
-</Callout>
+One account can join multiple workspaces. Switching only changes what you are currently viewing; it moves no data.
+
+After leaving a workspace, you need a new invitation to return. Leaving also deactivates the runtimes you own, archives the agents bound to them, and cancels their unfinished tasks.
+
+The last `owner` cannot leave; promote another member to `owner` first.
+
+## Delete a workspace
-If you're the last owner of a workspace and want to walk away from it, transfer the owner role to another member first, then have the new owner (or you) decide whether to delete. See [Members and roles](/members-roles).
+Only an `owner` can delete a workspace. Deletion permanently removes all of its work, members, agent configuration, and task history, and cannot be undone. If you are only stepping away for a while, leave instead of deleting.
-## Next
+## Next steps
-- [Members and roles](/members-roles) — how to add people to a workspace, and what each of the three roles can do
-- [Issues and projects](/issues) — the core work objects inside a workspace
+- [Members and roles](/members-roles) — invite members and manage roles.
+- [Issues](/issues) — the basic unit of work in a workspace.
+- [Agents](/agents) — agent identity and configuration.
diff --git a/apps/docs/content/docs/workspaces.zh.mdx b/apps/docs/content/docs/workspaces.zh.mdx
index 8c73fa0d83..162118b804 100644
--- a/apps/docs/content/docs/workspaces.zh.mdx
+++ b/apps/docs/content/docs/workspaces.zh.mdx
@@ -1,56 +1,56 @@
---
title: 工作区
-description: 工作区(workspace)是一群人一起协作的独立空间——所有 issue、成员、评论、智能体都属于它。
+description: 工作区是团队、工作和智能体配置彼此隔离的边界。
---
import { Callout } from "fumadocs-ui/components/callout";
-工作区(workspace)是 Multica 里**一群人一起协作的独立空间**——所有 [issue](/issues)、[成员](/members-roles)、[评论](/comments)、[智能体](/agents) 都属于它。你登录进来看到的任务列表、成员名单、智能体配置都限定在当前工作区;**切换工作区,看到的内容会完全替换**。
+工作区是 Multica 的最上层边界。成员、issue、项目、智能体、skill 和执行记录都属于某一个工作区,彼此完全隔离。
-## 创建工作区
-
-创建工作区时要定下三件事:
+## 工作区的组成
-- **工作区名字** — 给成员看的显示名称,可以包含空格和中文。后续随时能改。
-- **Slug(短链标识符)** — 工作区 URL 中使用的字符串,只能是小写字母和数字(用 `-` 连接)。**创建后不能改**,提前想好。如果 slug 已被占用或命中系统保留词,创建界面会让你换一个。
-- **Issue 前缀** — 工作区里所有 issue 编号的前缀(比如 `MUL-123` 里的 `MUL`)。只能是大写字母和数字,最长 10 个字符。
+| 类别 | 内容 |
+|---|---|
+| **工作** | Issue、项目、评论、附件、执行记录 |
+| **团队** | 成员、角色、邀请 |
+| **智能体** | 智能体配置、skill、运行时、自动化 |
+| **共享设置** | 上下文、标签、自定义属性、集成 |
-<Callout type="warning">
-**尽量不要修改 issue 前缀。** 系统在展示 issue 编号时会用当前的前缀——改了之后,`MUL-5` 会立刻变成 `NEW-5`。所有外部链接、Slack 提及、评论里的历史引用都会对不上旧编号。把 issue 前缀当成"创建后不改"的设计来对待。
-</Callout>
+**上下文**会提供给工作区中的每个智能体,适合写团队背景、产品约定和长期有效的要求。一次性的任务要求写在对应的 issue 里。
-你可以通过 Web 界面创建工作区,也可以用命令行。`--name` 和 `--slug` 都是必填项,创建后**不会**切换你当前的工作区——如果想进去操作,创建后再执行 `multica workspace switch <slug>`:
+## 创建工作区
-```bash
-multica workspace create --name "Support Team" --slug support-team --issue-prefix SUP
-```
+创建时填两项:
-## Issue 编号
+- **名称**:展示给成员,之后可以修改。
+- **工作区 URL**:地址中的 slug,例如 `multica.ai/my-team` 里的 `my-team`。只能用小写字母、数字和连字符,不能与已有工作区或保留地址重复,创建后不可修改。
-工作区每创建一个 issue,系统都会自动分配一个编号,格式是 `<前缀>-<数字>`,比如 `MUL-1`、`MUL-2`、`MUL-3`。有几个特点:
+创建者自动成为 `owner`。issue 前缀由工作区名称自动生成,例如前缀为 `MUL` 时,issue 编号显示为 `MUL-1`、`MUL-2`,在工作区内独立递增。
-- **工作区内连号不重复** — 每个工作区单独维护自己的计数器,互不干扰。
-- **不能手动指定** — 创建 issue 时你只填标题,编号由系统分配。
-- **删除后不回收** — 删掉 `MUL-5` 之后,下一个新 issue 是 `MUL-6` 不是 `MUL-5`。
+## 修改设置
-## 删除工作区
+`owner` 和 `admin` 可以修改名称、图标、描述、上下文和 issue 前缀;`member` 只能查看。
-只有工作区的 owner 能删除整个工作区。删除是**不可恢复**的操作。
+![工作区设置:名称、上下文、slug、issue 前缀与危险区](/images/docs/workspace-settings.png)
<Callout type="warning">
-删除工作区会一次性清除以下所有数据:
+修改 issue 前缀后,所有 issue 立即换用新编号(`MUL-5` 变为 `NEW-5`),但 PR、分支名和聊天记录里的旧编号不会更新。
+</Callout>
-- 所有 issue、project、评论、表情反应
-- 所有附件
-- 所有成员关系和待处理的邀请
-- 所有智能体配置和它们的任务历史
+## 切换和离开
-**数据无法恢复**。在删除前导出需要保留的数据。
-</Callout>
+一个账号可以加入多个工作区。切换只改变当前查看的范围,不移动任何数据。
+
+离开工作区后,需要重新接受邀请才能回来。离开会同时停用你拥有的运行时、归档绑定在其上的智能体,并取消它们未结束的执行任务。
+
+最后一名 `owner` 不能离开,需要先把另一位成员提升为 `owner`。
+
+## 删除工作区
-如果你是工作区里的最后一个 owner 并打算放弃这个工作区,先把 owner 角色转让给另一个成员,再由新 owner 或你自己决定删除。详见 [成员与权限](/members-roles)。
+只有 `owner` 可以删除工作区。删除会永久移除其中的全部工作、成员、智能体配置和执行记录,无法恢复。暂时不参与时选择离开,而不是删除。
-## 下一步
+## 接下来
-- [成员与权限](/members-roles) —— 怎么把人加进工作区、三种角色各能做什么
-- [Issue 与 project](/issues) —— 工作区里的核心工作对象
+- [成员与权限](/members-roles) — 邀请成员并管理角色。
+- [Issues](/issues) — 了解工作区中的基本工作单位。
+- [智能体](/agents) — 了解智能体的身份和配置。
diff --git a/apps/docs/lib/translations.ts b/apps/docs/lib/translations.ts
index fe8b067d57..9805072539 100644
--- a/apps/docs/lib/translations.ts
+++ b/apps/docs/lib/translations.ts
@@ -57,24 +57,24 @@ export const homeCopy = {
eyebrow: "Multica Docs",
titleLead: "Humans and agents,",
titleAccent: "in one place.",
- byline: ["Getting started", "Updated April 2026", "6 min read"],
+ byline: ["Getting started", "Updated July 2026", "2 min read"],
},
zh: {
eyebrow: "Multica 文档",
- titleLead: "人与智能体,",
- titleAccent: "共处一方。",
- byline: ["开始使用", "2026 年 4 月更新", "阅读约 6 分钟"],
+ titleLead: "Multica 是人类与 AI 智能体",
+ titleAccent: "共同工作的地方。",
+ byline: ["开始使用", "2026 年 7 月更新", "阅读约 2 分钟"],
},
ko: {
eyebrow: "Multica 문서",
titleLead: "사람과 에이전트,",
titleAccent: "한곳에서.",
- byline: ["시작하기", "2026년 4월 업데이트", "약 6분 읽기"],
+ byline: ["시작하기", "2026년 7월 업데이트", "약 2분 분량"],
},
ja: {
eyebrow: "Multica ドキュメント",
titleLead: "人とエージェントが、",
titleAccent: "一つの場所に。",
- byline: ["はじめに", "2026年4月更新", "約6分で読めます"],
+ byline: ["はじめに", "2026年7月更新", "約2分で読めます"],
},
} as const satisfies Record<Lang, unknown>;
diff --git a/apps/docs/middleware.ts b/apps/docs/middleware.ts
index 446ad9da19..97d97a580b 100644
--- a/apps/docs/middleware.ts
+++ b/apps/docs/middleware.ts
@@ -50,7 +50,7 @@ export const config = {
// routing them through the locale rewrite would 404 the sitemap that
// robots.txt advertises to crawlers.
matcher: [
- "/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)",
+ "/((?!api|_next/static|_next/image|images|favicon.ico|sitemap.xml|robots.txt).*)",
"/",
],
};
diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs
index c9579ea240..84b148b96d 100644
--- a/apps/docs/next.config.mjs
+++ b/apps/docs/next.config.mjs
@@ -18,6 +18,36 @@ const config = {
basePath: false,
permanent: false,
},
+ {
+ source: "/zh/getting-started/cloud-quickstart",
+ destination: "/zh/cloud-quickstart",
+ permanent: true,
+ },
+ {
+ source: "/zh/getting-started/self-hosting",
+ destination: "/zh/self-host-quickstart",
+ permanent: true,
+ },
+ {
+ source: "/zh/guides/quickstart",
+ destination: "/zh/cloud-quickstart",
+ permanent: true,
+ },
+ {
+ source: "/zh/guides/agents",
+ destination: "/zh/agents",
+ permanent: true,
+ },
+ {
+ source: "/zh/cli/installation",
+ destination: "/zh/cli",
+ permanent: true,
+ },
+ {
+ source: "/zh/cli/reference",
+ destination: "/zh/cli",
+ permanent: true,
+ },
];
},
};
diff --git a/apps/docs/public/images/docs/agent-access-settings.png b/apps/docs/public/images/docs/agent-access-settings.png
new file mode 100644
index 0000000000..d43aba6618
Binary files /dev/null and b/apps/docs/public/images/docs/agent-access-settings.png differ
diff --git a/apps/docs/public/images/docs/assign-confirm-dialog.png b/apps/docs/public/images/docs/assign-confirm-dialog.png
new file mode 100644
index 0000000000..93a3d03049
Binary files /dev/null and b/apps/docs/public/images/docs/assign-confirm-dialog.png differ
diff --git a/apps/docs/public/images/docs/autopilot-schedule.png b/apps/docs/public/images/docs/autopilot-schedule.png
new file mode 100644
index 0000000000..7c8041e112
Binary files /dev/null and b/apps/docs/public/images/docs/autopilot-schedule.png differ
diff --git a/apps/docs/public/images/docs/chat-conversation.png b/apps/docs/public/images/docs/chat-conversation.png
new file mode 100644
index 0000000000..44f025a808
Binary files /dev/null and b/apps/docs/public/images/docs/chat-conversation.png differ
diff --git a/apps/docs/public/images/docs/concepts-core-objects.png b/apps/docs/public/images/docs/concepts-core-objects.png
new file mode 100644
index 0000000000..eb68c1fe1d
Binary files /dev/null and b/apps/docs/public/images/docs/concepts-core-objects.png differ
diff --git a/apps/docs/public/images/docs/how-a-run-works.png b/apps/docs/public/images/docs/how-a-run-works.png
new file mode 100644
index 0000000000..8181eb2ce9
Binary files /dev/null and b/apps/docs/public/images/docs/how-a-run-works.png differ
diff --git a/apps/docs/public/images/docs/members-roster.png b/apps/docs/public/images/docs/members-roster.png
new file mode 100644
index 0000000000..6a3156f971
Binary files /dev/null and b/apps/docs/public/images/docs/members-roster.png differ
diff --git a/apps/docs/public/images/docs/mention-trigger-preview.png b/apps/docs/public/images/docs/mention-trigger-preview.png
new file mode 100644
index 0000000000..e659dd5fda
Binary files /dev/null and b/apps/docs/public/images/docs/mention-trigger-preview.png differ
diff --git a/apps/docs/public/images/docs/project-detail.png b/apps/docs/public/images/docs/project-detail.png
new file mode 100644
index 0000000000..25070bee36
Binary files /dev/null and b/apps/docs/public/images/docs/project-detail.png differ
diff --git a/apps/docs/public/images/docs/quickstart-add-computer.png b/apps/docs/public/images/docs/quickstart-add-computer.png
new file mode 100644
index 0000000000..09a418c8c8
Binary files /dev/null and b/apps/docs/public/images/docs/quickstart-add-computer.png differ
diff --git a/apps/docs/public/images/docs/quickstart-new-agent.png b/apps/docs/public/images/docs/quickstart-new-agent.png
new file mode 100644
index 0000000000..65e4bed42c
Binary files /dev/null and b/apps/docs/public/images/docs/quickstart-new-agent.png differ
diff --git a/apps/docs/public/images/docs/quickstart-new-issue.png b/apps/docs/public/images/docs/quickstart-new-issue.png
new file mode 100644
index 0000000000..e733626f25
Binary files /dev/null and b/apps/docs/public/images/docs/quickstart-new-issue.png differ
diff --git a/apps/docs/public/images/docs/quickstart-run-result.png b/apps/docs/public/images/docs/quickstart-run-result.png
new file mode 100644
index 0000000000..1436083e44
Binary files /dev/null and b/apps/docs/public/images/docs/quickstart-run-result.png differ
diff --git a/apps/docs/public/images/docs/runtime-machine-detail.png b/apps/docs/public/images/docs/runtime-machine-detail.png
new file mode 100644
index 0000000000..a28226d61c
Binary files /dev/null and b/apps/docs/public/images/docs/runtime-machine-detail.png differ
diff --git a/apps/docs/public/images/docs/task-transcript.png b/apps/docs/public/images/docs/task-transcript.png
new file mode 100644
index 0000000000..29327cae0c
Binary files /dev/null and b/apps/docs/public/images/docs/task-transcript.png differ
diff --git a/apps/docs/public/images/docs/workspace-overview.png b/apps/docs/public/images/docs/workspace-overview.png
new file mode 100644
index 0000000000..8c024c60bf
Binary files /dev/null and b/apps/docs/public/images/docs/workspace-overview.png differ
diff --git a/apps/docs/public/images/docs/workspace-settings.png b/apps/docs/public/images/docs/workspace-settings.png
new file mode 100644
index 0000000000..ef16f4328e
Binary files /dev/null and b/apps/docs/public/images/docs/workspace-settings.png differ
diff --git a/docs/docs-onboarding-optimization-plan.md b/docs/docs-onboarding-optimization-plan.md
new file mode 100644
index 0000000000..f9e1a529fc
--- /dev/null
+++ b/docs/docs-onboarding-optimization-plan.md
@@ -0,0 +1,117 @@
+# Multica 中文文档优化计划
+
+> 状态:中文正文与目录已完成,产品截图待逐步补充。
+>
+> 工作目录:`/Users/qingnaiyuan/Desktop/work/multica-pr-5714`
+
+## 目标
+
+让第一次接触 Multica 的用户能够:
+
+1. 直接理解 Multica 是什么,以及人和智能体如何共同工作。
+2. 按一条明确路径完成第一次智能体执行。
+3. 明白 Multica、连接电脑、运行时和 AI 编程工具之间的关系。
+4. 根据产品中的真实概念找到后续功能、集成和运维说明。
+
+中文版本先完成并评审。英文、日文和韩文在中文结构稳定后再同步,避免四种语言反复返工。
+
+## 当前信息架构
+
+```text
+开始使用
+├─ 欢迎
+├─ 快速上手
+├─ Multica 是怎么工作的
+└─ 自托管快速上手
+
+工作区与团队
+├─ 工作区
+└─ 成员与权限
+
+Issue 与项目
+├─ Issues
+├─ 项目
+└─ 项目资源
+
+智能体
+├─ 智能体
+├─ 创建和配置智能体
+├─ Skills
+└─ 小队
+
+日常协作
+├─ 把 Issue 分配给智能体
+├─ 评论
+├─ 通过评论调用智能体
+├─ 与智能体对话
+└─ 收件箱与订阅
+
+自动化与集成
+├─ 自动化
+├─ 聊天集成
+├─ GitHub 集成
+├─ 飞书 Bot
+└─ Slack Bot
+
+运行时与执行
+├─ 执行任务
+├─ 守护进程与运行时
+├─ 安装 AI 编程工具
+└─ AI 编程工具对照
+
+自托管与管理
+├─ 环境变量
+├─ 登录与注册
+└─ 故障排查
+
+客户端与 CLI
+├─ 桌面应用
+├─ 移动 App(iOS)
+├─ 使用 CLI
+└─ 认证与令牌
+
+开发者
+├─ 参与开发
+├─ 项目架构
+└─ 开发规范
+```
+
+目前共有 37 篇中文页面,全部进入 sidebar。旧版重复页面已经移除,并通过永久重定向保留旧链接。
+
+## 写作原则
+
+1. 一篇页面只解决一个主要问题。
+2. 先说明用户要做什么,再补充原理和边界。
+3. 使用产品中的真实概念,避免宣传性排比和抽象口号。
+4. `issue`、`skill` 和 `task` 按中文术语规范使用;工作区、智能体、项目、自动化、守护进程和运行时使用中文。
+5. 涉及权限、安全、失败和重试时,写清具体边界,不做绝对承诺。
+6. 操作教程给出成功标志和排查入口;参考页面保留可查阅的参数、命令和状态。
+
+## 图片计划
+
+图片不阻塞中文正文定稿,后续按页面逐张确认。
+
+优先补充:
+
+1. Welcome:人和多个智能体在同一工作区协作的真实产品画面。
+2. Quickstart:运行时选择、Multica Helper 入门选项、issue 执行结果。
+3. 其余操作页:只有当截图能明显减少文字说明时才添加。
+
+产品操作使用真实 UI 截图;架构和对象关系使用 React/CSS 或 SVG。图片不承担正文中没有出现的关键信息,并提供准确的 alt text。
+
+## 已完成的验证
+
+- 37/37 篇中文页面均在 sidebar 中。
+- 所有中文站内链接和标题锚点均可解析。
+- 旧版中文 URL 会重定向到对应的新页面。
+- 37 个中文路由在本地开发站均返回 `200`。
+- `pnpm --filter @multica/docs typecheck` 通过。
+- `pnpm --filter @multica/docs test` 通过,17 个测试全部成功。
+- `pnpm --filter @multica/docs build` 通过,147 个静态页面生成成功。
+
+## 后续顺序
+
+1. 在 `http://localhost:4000/docs/zh` 逐页评审中文文案和页面节奏。
+2. 按教学价值逐张替换截图占位。
+3. 检查截图的移动端、深浅色和 alt text。
+4. 中文内容完全确认后,同步英文、日文和韩文。