agestra 4.3.5 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.zh.md ADDED
@@ -0,0 +1,328 @@
1
+ # Agestra
2
+
3
+ [![npm version](https://img.shields.io/npm/v/agestra.svg)](https://www.npmjs.com/package/agestra)
4
+ [![license](https://img.shields.io/npm/l/agestra.svg)](LICENSE)
5
+
6
+ **Agent + Orchestra** — 一个在 Claude Code 中编排多个 AI 提供方的插件。
7
+
8
+ [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [中文](README.zh.md)
9
+
10
+ Agestra 将 Ollama(本地)、Gemini CLI 和 Codex CLI 作为可插拔提供方接入 Claude Code,通过 42 个 MCP 工具提供多 AI 编排、独立汇总、共识辩论、自主 CLI Worker、并行任务分发、交叉验证、基于质量的提供方路由,以及持久化 GraphRAG 记忆系统。
11
+
12
+ ## 快速开始
13
+
14
+ 在 Claude Code 中运行:
15
+
16
+ ```
17
+ /plugin marketplace add mua-vtuber/Agestra
18
+ /plugin install agestra@agestra
19
+ ```
20
+
21
+ 就这些。Agestra 会在首次使用时通过 `environment_check` 自动检测可用的提供方(Ollama、Gemini CLI、Codex CLI)。
22
+
23
+ ### 前置条件
24
+
25
+ 至少需要安装一个 AI 提供方:
26
+
27
+ | 提供方 | 安装 | 类型 |
28
+ |--------|------|------|
29
+ | [Ollama](https://ollama.com/) | `curl -fsSL https://ollama.com/install.sh \| sh` | Local LLM |
30
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm install -g @google/gemini-cli` | Cloud |
31
+ | [Codex CLI](https://github.com/openai/codex) | `npm install -g @openai/codex` | Cloud |
32
+
33
+ 可选但推荐:
34
+ - **tmux** — 让你在自主执行期间可视化查看 CLI Worker 面板
35
+
36
+ ---
37
+
38
+ ## 理念
39
+
40
+ **Multi-AI 的目标是验证,而不是节省 token。** 代码审查、设计探索和想法生成工作流都被设计成验证流程,核心不是为了更快并行,而是让多个 AI 提供方独立给出意见,从而发现盲点。
41
+
42
+ ## 命令
43
+
44
+ | 命令 | 说明 |
45
+ |------|------|
46
+ | `/agestra review [target]` | 审查代码质量、安全性和集成完成度 |
47
+ | `/agestra idea [topic]` | 通过与相似项目对比发掘改进点 |
48
+ | `/agestra design [subject]` | 在实现前探索架构与设计取舍 |
49
+ | `/agestra implement [task]` | 以 Claude only 或 Multi-AI 模式执行实现 |
50
+
51
+ 每个命令都会提供模式选择:
52
+
53
+ | 模式 | 说明 |
54
+ |------|------|
55
+ | **Claude only** | 由插件专用代理独立完成 |
56
+ | **각자 독립** (Independent) | 每个 AI 独立完成,随后由主持者汇总成统一文档 |
57
+ | **끝장토론** (Debate) | 独立产出 + 文档审阅轮次,直到所有 AI 达成一致 |
58
+
59
+ ## 代理
60
+
61
+ | 代理 | 模型 | 角色 |
62
+ |------|------|------|
63
+ | `agestra-team-lead` | Sonnet | 全局编排者:环境检查、按质量路由提供方、选择工作模式、监督 CLI Worker、驱动 QA 循环 |
64
+ | `agestra-reviewer` | Opus | 严格质量审查者:关注安全、孤立实现、规格漂移、测试缺口 |
65
+ | `agestra-designer` | Opus | 架构探索者:苏格拉底式提问、权衡分析 |
66
+ | `agestra-ideator` | Sonnet | 改进点发现者:Web 调研、竞品分析 |
67
+ | `agestra-moderator` | Sonnet | 多模式主持者:带共识检测的辩论、独立汇总、文档审查、冲突解决 |
68
+ | `agestra-qa` | Opus | QA 验证者:检查设计符合性并给出 PASS/FAIL 判断 |
69
+
70
+ ## 技能
71
+
72
+ | 技能 | 说明 |
73
+ |------|------|
74
+ | `provider-guide` | 提供方路由、模式参考、编排流水线 |
75
+ | `worker-manage` | 列出、检查、收集和停止 CLI Worker |
76
+ | `cancel` | 安全停止 worker、辩论、链路和任务 |
77
+ | `build-fix` | 自动诊断并修复 build/typecheck/lint 错误 |
78
+ | `trace` | 查看代理执行时间线与流程图 |
79
+ | `design` | 包含 Multi-AI 模式选择的架构探索工作流 |
80
+ | `idea` | 包含 Multi-AI 模式选择的改进发现工作流 |
81
+
82
+ ---
83
+
84
+ ## 架构
85
+
86
+ 这是一个包含 8 个包的 Turborepo monorepo:
87
+
88
+ | 包 | 说明 |
89
+ |----|------|
90
+ | `@agestra/core` | `AIProvider` 接口、基于难度的路由注册表、配置加载、CLI runner、原子写入、任务队列、密钥扫描、worktree 管理、任务清单、CLI Worker 管理器 |
91
+ | `@agestra/provider-ollama` | 带模型检测的 Ollama HTTP 适配器 |
92
+ | `@agestra/provider-gemini` | Google Gemini CLI 适配器 |
93
+ | `@agestra/provider-codex` | OpenAI Codex CLI 适配器 |
94
+ | `@agestra/agents` | 带共识检测的辩论引擎、轮次质量评估、任务分发、交叉验证、任务链、自动 QA、文件变更跟踪、会话管理 |
95
+ | `@agestra/workspace` | 用于评审、分析笔记和汇总报告的工作区文档管理器 |
96
+ | `@agestra/memory` | GraphRAG:FTS5 + 向量 + 知识图谱混合检索,以及死路追踪 |
97
+ | `@agestra/mcp-server` | MCP 协议层,42 个工具,按环境过滤工具并动态分发 |
98
+
99
+ ### 设计原则
100
+
101
+ - **Provider abstraction** — 所有后端都实现 `AIProvider`(`chat`、`healthCheck`、`getCapabilities`)。新增提供方只需新增一个 provider 包并注册工厂。
102
+ - **Zero-config** — 启动时自动检测提供方,无需手动配置。
103
+ - **Plugin-native** — 以 Claude Code 插件形式安装,Skills、hooks 和 MCP server 一起打包。
104
+ - **Modular dispatch** — 每类工具都是独立模块,对外提供 `getTools()` 和 `handleTool()`。服务端负责动态收集与分发。
105
+ - **Atomic writes** — 所有文件操作都采用“写临时文件再重命名”的方式,避免损坏。
106
+ - **Dead-end tracking** — 失败方案会记录到 GraphRAG 中,并注入后续提示词。
107
+ - **Preflight security** — 启动 CLI Worker 前会进行密钥扫描,并使用数组参数启动进程以防注入。
108
+
109
+ ### 工作模式
110
+
111
+ **文本工作**(review、design、idea):Claude only → 각자 독립 → 끝장토론
112
+
113
+ **实现工作**(team-lead orchestration):
114
+ - **Claude만으로** — Claude 直接结合项目/全局代理完成实现。
115
+ - **다른 AI도 함께** — CLI Worker(Codex/Gemini)在隔离的 git worktree 中自主编码,Ollama 处理简单任务,Claude 负责监督与合并。
116
+
117
+ ---
118
+
119
+ ## 工具(42)
120
+
121
+ ### AI Chat(3)
122
+
123
+ | 工具 | 说明 |
124
+ |------|------|
125
+ | `ai_chat` | 与指定提供方对话(使用 `"auto"` 可启用基于质量的路由);如有需要,可通过 `save_as_document` 将回复保存为文档 |
126
+ | `ai_analyze_files` | 从磁盘读取文件并连同问题一起发送给提供方 |
127
+ | `ai_compare` | 将同一提示发送给多个提供方并比较结果 |
128
+
129
+ ### Agent Orchestration(11)
130
+
131
+ | 工具 | 说明 |
132
+ |------|------|
133
+ | `agent_debate_start` | 启动多提供方辩论(非阻塞,可选质量循环 + 验证者) |
134
+ | `agent_debate_status` | 查看辩论状态与转录 |
135
+ | `agent_debate_create` | 创建回合制辩论会话(返回 debate ID) |
136
+ | `agent_debate_turn` | 执行某个提供方的一回合;支持 `provider: "claude"` 让 Claude 独立参与 |
137
+ | `agent_debate_conclude` | 结束辩论并生成最终转录 |
138
+ | `agent_debate_moderate` | 运行全自动辩论:创建会话、执行专家代理轮次、检测共识,仅返回摘要 |
139
+ | `agent_debate_review` | 将文档发送给多个提供方进行独立审查 |
140
+ | `agent_cross_validate` | 对输出进行交叉验证(仅限 agent-tier validators) |
141
+ | `agent_changes_review` | 审查隔离任务中的文件变更 |
142
+ | `agent_changes_accept` | 接受并合并隔离任务中的变更 |
143
+ | `agent_changes_reject` | 拒绝变更并清理隔离 worktree |
144
+
145
+ ### CLI Workers(4)
146
+
147
+ | 工具 | 说明 |
148
+ |------|------|
149
+ | `cli_worker_spawn` | 以自主模式启动 CLI AI(Codex/Gemini),带 git worktree 隔离与预检安全机制 |
150
+ | `cli_worker_status` | 查看 worker 的 FSM 状态、heartbeat 和输出尾部 |
151
+ | `cli_worker_collect` | 收集已完成 worker 的结果(git diff、输出、退出码) |
152
+ | `cli_worker_stop` | 停止运行中的 worker(SIGTERM → SIGKILL)并清理 worktree |
153
+
154
+ ### Environment(1)
155
+
156
+ | 工具 | 说明 |
157
+ |------|------|
158
+ | `environment_check` | 检测 CLI 工具、带分层信息的 Ollama 模型、tmux、git worktree 支持与可用模式 |
159
+
160
+ ### Workspace(7)
161
+
162
+ | 工具 | 说明 |
163
+ |------|------|
164
+ | `workspace_create_review` | 创建包含文件与规则的代码审查文档 |
165
+ | `workspace_request_review` | 请求提供方审查某个文档 |
166
+ | `workspace_review_status` | 查看审查完成状态 |
167
+ | `workspace_add_comment` | 为审查添加评论 |
168
+ | `workspace_create_document` | 创建带标题、Markdown 正文和可选元数据的通用工作区文档 |
169
+ | `workspace_read` | 读取文档内容 |
170
+ | `workspace_list` | 列出工作区中的全部文档 |
171
+
172
+ ### Provider Management(2)
173
+
174
+ | 工具 | 说明 |
175
+ |------|------|
176
+ | `provider_list` | 列出提供方及其状态和能力 |
177
+ | `provider_health` | 对一个或全部提供方进行健康检查 |
178
+
179
+ ### Ollama(2)
180
+
181
+ | 工具 | 说明 |
182
+ |------|------|
183
+ | `ollama_models` | 列出已安装模型及其大小和分层 |
184
+ | `ollama_pull` | 下载模型 |
185
+
186
+ ### Memory(6)
187
+
188
+ | 工具 | 说明 |
189
+ |------|------|
190
+ | `memory_search` | 混合检索(FTS5 + 向量 + 图) |
191
+ | `memory_index` | 将文件/目录索引进记忆系统 |
192
+ | `memory_store` | 存储知识节点(fact、decision、dead_end、finding) |
193
+ | `memory_dead_ends` | 搜索过去失败的方法,避免重复踩坑 |
194
+ | `memory_context` | 在 token 预算内组装相关上下文 |
195
+ | `memory_add_edge` | 为知识节点之间创建关系边 |
196
+
197
+ ### Jobs(2)
198
+
199
+ | 工具 | 说明 |
200
+ |------|------|
201
+ | `cli_job_submit` | 将长时间运行的 CLI 任务提交到后台 |
202
+ | `cli_job_status` | 查看任务状态与输出 |
203
+
204
+ ### QA(1)
205
+
206
+ | Tool | Description |
207
+ |------|-------------|
208
+ | `qa_run` | 自动检测 build/test 命令并运行 QA,输出 PASS/FAIL 摘要 |
209
+
210
+ ### Trace / Observability(3)
211
+
212
+ | Tool | Description |
213
+ |------|-------------|
214
+ | `trace_query` | 按条件查询 trace 记录(提供方、任务、时间范围) |
215
+ | `trace_summary` | 获取各提供方的质量统计、性能指标和难度资格 |
216
+ | `trace_visualize` | 生成某次追踪操作流程的 Mermaid 图 |
217
+
218
+ ---
219
+
220
+ ## 配置
221
+
222
+ ### providers.config.json(可选)
223
+
224
+ Agestra 会在启动时自动检测提供方。如果需要手动控制,可在项目根目录创建 `providers.config.json`:
225
+
226
+ | 字段 | 说明 |
227
+ |------|------|
228
+ | `defaultProvider` | 未指定时使用的提供方 ID |
229
+ | `providers[].id` | 唯一标识符 |
230
+ | `providers[].type` | `ollama`、`gemini-cli` 或 `codex-cli` |
231
+ | `providers[].enabled` | 是否在启动时加载 |
232
+ | `providers[].config` | 类型相关配置(host、timeout 等) |
233
+
234
+ ### 运行时数据
235
+
236
+ 保存在 `.agestra/` 下(已加入 gitignore):
237
+
238
+ | 路径 | 用途 |
239
+ |------|------|
240
+ | `.agestra/sessions/` | 辩论与任务会话状态 |
241
+ | `.agestra/workspace/` | 工作区文档(评审、笔记、报告) |
242
+ | `.agestra/memory.db` | GraphRAG SQLite 数据库 |
243
+ | `.agestra/.jobs/` | 后台任务队列 |
244
+ | `.agestra/.workers/` | CLI Worker 状态、清单和输出日志 |
245
+ | `.agestra/worktrees/` | 用于隔离 CLI Worker 执行的 git worktree |
246
+ | `.agestra/traces/` | 提供方 trace JSONL(30 天后自动清理) |
247
+
248
+ ---
249
+
250
+ ## 开发
251
+
252
+ ```bash
253
+ npm install # 安装依赖
254
+ npm run build # 构建所有包(Turborepo)
255
+ npm test # 运行全部测试(Vitest)
256
+ npm run bundle # 构建单文件插件包(esbuild)
257
+ npm run dev # 监听模式
258
+ npm run lint # Lint(ESLint)
259
+ npm run clean # 删除 dist/
260
+ ```
261
+
262
+ ### 项目结构
263
+
264
+ ```
265
+ agestra/
266
+ ├── .claude-plugin/
267
+ │ ├── plugin.json # Claude Code 插件清单
268
+ │ └── marketplace.json # 插件市场元数据
269
+ ├── commands/
270
+ │ ├── review.md # /agestra review — 质量验证
271
+ │ ├── idea.md # /agestra idea — 改进点发现
272
+ │ ├── design.md # /agestra design — 架构探索
273
+ │ └── implement.md # /agestra implement — 实现工作流
274
+ ├── agents/
275
+ │ ├── agestra-reviewer.md # 严格质量审查者(Opus)
276
+ │ ├── agestra-designer.md # 架构探索者(Opus)
277
+ │ ├── agestra-ideator.md # 改进点发现者(Sonnet)
278
+ │ ├── agestra-moderator.md # 多模式主持者(Sonnet)
279
+ │ ├── agestra-qa.md # QA 验证者(Opus,不写代码)
280
+ │ └── agestra-team-lead.md # 全局编排者(Sonnet,不写代码)
281
+ ├── skills/
282
+ │ ├── provider-guide.md # 提供方路由与模式说明
283
+ │ ├── worker-manage.md # CLI Worker 管理
284
+ │ ├── cancel.md # 安全取消操作
285
+ │ ├── build-fix.md # 构建错误自动修复
286
+ │ └── trace.md # 执行时间线查看器
287
+ ├── hooks/
288
+ │ └── user-prompt-submit.md # 工具推荐 hook
289
+ ├── dist/
290
+ │ └── bundle.js # 单文件 MCP Server bundle
291
+ ├── scripts/
292
+ │ └── bundle.mjs # esbuild bundle 脚本
293
+ ├── packages/
294
+ │ ├── core/ # AIProvider 接口、注册表、安全、worker
295
+ │ ├── provider-ollama/ # Ollama HTTP 适配器
296
+ │ ├── provider-gemini/ # Gemini CLI 适配器
297
+ │ ├── provider-codex/ # Codex CLI 适配器
298
+ │ ├── agents/ # 辩论引擎、分发器、交叉验证器
299
+ │ ├── workspace/ # 工作区文档管理器
300
+ │ ├── memory/ # GraphRAG:混合检索、死路追踪
301
+ │ └── mcp-server/ # MCP Server,42 个工具,按环境过滤并分发
302
+ ├── package.json # 工作区根目录
303
+ └── turbo.json # Turborepo pipeline
304
+ ```
305
+
306
+ ### 添加新提供方
307
+
308
+ 1. 创建 `packages/provider-<name>/` 并实现 `AIProvider`。
309
+ 2. 在 `packages/mcp-server/src/index.ts` 中注册工厂。
310
+ 3. `npm run build && npm test`
311
+
312
+ ---
313
+
314
+ ## 卸载
315
+
316
+ 在 Claude Code 中:
317
+
318
+ ```
319
+ /plugin uninstall agestra@agestra
320
+ ```
321
+
322
+ 插件本身会被干净移除。如果还想删除生成的项目数据,请手动删除 `.agestra/` 目录。
323
+
324
+ ---
325
+
326
+ ## 许可证
327
+
328
+ [GPL-3.0](LICENSE)
@@ -30,14 +30,14 @@ You operate in one of four modes depending on how you are invoked:
30
30
 
31
31
  ### Mode: Debate (Traditional)
32
32
 
33
- ### Phase 1: Setup
34
- **Preferred:** Call `agent_debate_moderate` with the topic, providers, and optional goal. This handles the full lifecycle — creating the debate, running rounds, checking consensus, and concluding — and returns only the final summary without consuming main context.
35
-
36
- **Manual mode (when fine-grained control is needed):**
37
- 1. Receive the debate topic and specialist context from the invoking command.
38
- 2. Call `provider_list` to check which external providers are available.
39
- 3. Call `agent_debate_create` with the topic and available providers.
40
- 4. Note the debate ID for subsequent turns.
33
+ ### Phase 1: Setup
34
+ **Preferred:** Call `agent_debate_moderate` with the topic, providers, and optional goal. This handles the full lifecycle — creating the debate, running rounds, checking consensus, and concluding — and returns only the final summary without consuming main context.
35
+
36
+ **Manual mode (when fine-grained control is needed):**
37
+ 1. Receive the debate topic and specialist context from the invoking command.
38
+ 2. Call `provider_list` to check which external providers are available.
39
+ 3. Call `agent_debate_create` with the topic and available providers.
40
+ 4. Note the debate ID for subsequent turns.
41
41
 
42
42
  ### Phase 2: Rounds
43
43
  For each round (up to 5 maximum):
@@ -62,13 +62,13 @@ For each available provider (e.g., gemini, ollama):
62
62
 
63
63
  3. The moderator remains neutral — it relays the specialist's work without modifying or editorializing.
64
64
 
65
- **Round summary:**
66
- After all turns in a round:
67
- - The system automatically checks for consensus after each turn
68
- - Consensus is detected when ALL participants explicitly express agreement (e.g., "I agree", "동의합니다", "同意します")
69
- - If consensus is reached, the system recommends concluding the debate
70
- - If partial consensus is detected, the system reports which participants have agreed and which are still pending
71
- - If no consensus, frame the next round's focus based on remaining disagreements
65
+ **Round summary:**
66
+ After all turns in a round:
67
+ - The system automatically checks for consensus after each turn
68
+ - Consensus is detected when ALL participants explicitly express agreement (e.g., "I agree", "동의합니다", "同意します")
69
+ - If consensus is reached, the system recommends concluding the debate
70
+ - If partial consensus is detected, the system reports which participants have agreed and which are still pending
71
+ - If no consensus, frame the next round's focus based on remaining disagreements
72
72
 
73
73
  ### Phase 3: Conclude
74
74
  - Call `agent_debate_conclude` with a comprehensive summary including:
@@ -87,15 +87,18 @@ After all turns in a round:
87
87
 
88
88
  Invoked when multiple AIs have independently analyzed the same target and their results need to be merged into a unified document.
89
89
 
90
- **Input:** Array of results from all AIs, including Claude's specialist agent output. Each result is tagged with its source provider.
90
+ **Input:** Document ID list of per-provider analysis documents + results tagged by source provider.
91
91
 
92
92
  **Process:**
93
93
 
94
- 1. Read all results carefully.
94
+ 1. **Read all individual documents** via `workspace_read` using each document ID.
95
95
  2. **Identify common findings** — mentioned by 2+ AIs. These form the consensus core.
96
96
  3. **Identify unique findings** — mentioned by only 1 AI. These are notable perspectives.
97
97
  4. **Identify contradictions** — AIs that disagree on the same point.
98
- 5. Generate integrated document in this structure:
98
+ 5. **Create aggregated document** via `workspace_create_document`:
99
+ - **title:** `Integrated Analysis — {task summary}`
100
+ - **metadata:** `{ "Mode": "Independent Aggregation", "Sources": "{comma-separated provider names}", "Source Documents": "{comma-separated document IDs}" }`
101
+ - **content:** The integrated analysis in this structure:
99
102
 
100
103
  ```markdown
101
104
  ## Integrated Analysis
@@ -115,9 +118,20 @@ Invoked when multiple AIs have independently analyzed the same target and their
115
118
 
116
119
  ### Summary
117
120
  [unified recommendation considering all perspectives]
121
+
122
+ ### Source Documents
123
+ - {provider}: {document ID}
124
+ - {provider}: {document ID}
118
125
  ```
119
126
 
120
- 6. Present the integrated document. Do NOT favor any provider's findings over others.
127
+ 6. Do NOT favor any provider's findings over others.
128
+
129
+ 7. **Report to user** with a concise summary:
130
+ - Key consensus findings (1-3 lines)
131
+ - Notable unique findings (if any)
132
+ - Disputed points (if any)
133
+ - List of individual document IDs for reference
134
+ - Aggregated document ID for the full integrated analysis
121
135
 
122
136
  </Workflow_Independent_Aggregation>
123
137
 
@@ -125,11 +139,11 @@ Invoked when multiple AIs have independently analyzed the same target and their
125
139
 
126
140
  ### Mode: Document Review Round (Debate Phase 2)
127
141
 
128
- Invoked after Independent Aggregation has produced an initial document. The document is iteratively reviewed by all AIs until consensus or max rounds.
142
+ Invoked after Independent Aggregation has produced an initial document. The document is iteratively reviewed by all AIs until consensus.
129
143
 
130
144
  **Input:** Current document + list of participating providers.
131
145
 
132
- **Process (per round, max 5 rounds):**
146
+ **Process (per round, no maximum — until all agree):**
133
147
 
134
148
  1. Send the current document to each AI for review:
135
149
  - **Claude:** Spawn the appropriate specialist agent → analyze document → produce feedback.
@@ -155,7 +169,7 @@ Invoked after Independent Aggregation has produced an initial document. The docu
155
169
  6. **Consensus check:**
156
170
  - All AIs agree on all sections → consensus reached. Proceed to final document.
157
171
  - Disagreements remain → next round with the revised document.
158
- - After 5 rounds with no full consensus conclude with split positions documented.
172
+ - **Every 10 rounds:** Ask the user via AskUserQuestion whether to continue or stop with the current state. If the user stops, conclude with split positions documented.
159
173
 
160
174
  7. Return: revised document + consensus map.
161
175
 
@@ -233,7 +247,7 @@ If after 5 rounds no consensus:
233
247
  </Consensus_Criteria>
234
248
 
235
249
  <Constraints>
236
- - Maximum 5 rounds. If consensus is not reached by round 5, conclude with disagreements documented.
250
+ - No maximum rounds continue until all participants agree. Every 10 rounds, ask the user whether to continue or stop with the current state.
237
251
  - Do NOT express your own opinion on the debate topic. You are a facilitator, not a participant.
238
252
  - Do NOT skip Claude's turn. Claude's independent participation (via the specialist agent's perspective) is a core feature.
239
253
  - Summarize neutrally. Do not favor any provider's position.
@@ -242,12 +256,15 @@ If after 5 rounds no consensus:
242
256
  - Communicate in the user's language.
243
257
  </Constraints>
244
258
 
245
- <Tool_Usage>
246
- - `provider_list` — check available providers at the start
247
- - `agent_debate_moderate` — **recommended entry point**: run a fully moderated debate with automatic consensus detection and specialist selection. Handles full lifecycle and returns only the final summary.
248
- - `agent_debate_create` — create a debate session manually (use when you need fine-grained turn control)
249
- - `agent_debate_turn` — execute each provider's turn (manual mode only)
250
- - `agent_debate_conclude` — end the debate with summary (manual mode only)
251
- - `agent_debate_review` — send a document to providers for structured review (Document Review mode)
252
- - `ai_chat` — query individual providers for feedback (Independent Aggregation mode)
253
- </Tool_Usage>
259
+ <Tool_Usage>
260
+ - `provider_list` — check available providers at the start
261
+ - `agent_debate_moderate` — **recommended entry point**: run a fully moderated debate with automatic consensus detection and specialist selection. Handles full lifecycle and returns only the final summary.
262
+ - `agent_debate_create` — create a debate session manually (use when you need fine-grained turn control)
263
+ - `agent_debate_turn` — execute each provider's turn (manual mode only)
264
+ - `agent_debate_conclude` — end the debate with summary (manual mode only)
265
+ - `agent_debate_review` — send a document to providers for structured review (Document Review mode)
266
+ - `ai_chat` — query individual providers for feedback (Independent Aggregation mode)
267
+ - `workspace_create_document` — create analysis or aggregated documents (Independent Aggregation mode)
268
+ - `workspace_read` — read individual provider documents by ID (Independent Aggregation mode)
269
+ - `workspace_add_comment` — append feedback or updates to existing documents
270
+ </Tool_Usage>
@@ -36,8 +36,8 @@ Use AskUserQuestion to present these options (in the user's language):
36
36
  | Option | Condition | Description |
37
37
  |--------|-----------|-------------|
38
38
  | **Claude only** | Always | 플러그인 전문 에이전트가 소크라테스식 질문으로 아키텍처 탐색 |
39
- | **각자 독립** | 1+ provider available | AI 독립적으로 아키텍처 제안 진행자가 취합하여 문서 작성 |
40
- | **끝장토론** | 1+ provider available | 각자 독립 + 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
39
+ | **각자 독립** | 1+ provider available | 에이전트 팀(moderator + designer + 외부 AI)이 각자 독립 설계 취합 문서 작성 |
40
+ | **끝장토론** | 1+ provider available | 각자 독립 설계 후 취합 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
41
41
 
42
42
  Only show options whose conditions are met. If no providers are available, skip and run Claude only.
43
43
 
@@ -47,26 +47,47 @@ Only show options whose conditions are met. If no providers are available, skip
47
47
  Spawn the `agestra-designer` agent with the subject as context. The designer will ask questions to understand intent, explore the codebase for existing patterns, propose 2-3 approaches with trade-offs, refine based on feedback, and produce a design document in `docs/plans/`.
48
48
 
49
49
  ### If "각자 독립":
50
+
51
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-designer` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
52
+
50
53
  1. In parallel:
51
54
  - Spawn the `agestra-designer` agent for Claude's independent architecture exploration.
52
- - For each available provider, call `ai_chat` with this prompt:
55
+ After the agent completes, save Claude's result as a document via `workspace_create_document`:
56
+ - **title:** `Architecture Design — claude/designer`
57
+ - **metadata:** `{ "Provider": "claude/designer", "Task": "{subject}", "Mode": "Independent" }`
58
+ - **content:** The designer agent's full output.
59
+ - For each available provider, call `ai_chat` with `save_as_document` to let each AI produce its own document directly:
60
+ - **save_as_document.title:** `Architecture Design — {provider}`
61
+ - **save_as_document.metadata:** `{ "Task": "{subject}", "Mode": "Independent" }`
62
+ - **prompt:**
63
+
64
+ > Propose an architecture approach for [subject]. Consider existing patterns in the codebase, trade-offs (complexity, performance, maintainability), and implementation steps. Present 2-3 distinct approaches with pros/cons for each.
65
+ >
66
+ > Subject: [the design subject]
53
67
 
54
- > Propose an architecture approach for [subject]. Consider existing patterns in the codebase, trade-offs (complexity, performance, maintainability), and implementation steps. Present 2-3 distinct approaches with pros/cons for each.
55
- >
56
- > Subject: [the design subject]
68
+ 2. Collect all document IDs from step 1.
57
69
 
58
- 2. Collect all results (Claude's designer output + each provider's response).
59
70
  3. Spawn the `agestra-moderator` agent in **Independent Aggregation** mode:
60
- - Pass ALL results as input, tagged by source provider.
71
+ - Pass the **document ID list**.
72
+ - Moderator reads each document via `workspace_read`.
61
73
  - Moderator classifies: consensus approaches, unique ideas, disputed trade-offs.
62
- - Moderator generates an integrated architecture document.
63
- 4. Present the integrated document to the user.
74
+ - Moderator creates an **aggregated document** via `workspace_create_document`.
75
+
76
+ 4. Present a **summary report** to the user:
77
+ - Key consensus approaches (1-3 lines).
78
+ - Notable unique design ideas (if any).
79
+ - Trade-off disagreements (if any).
80
+ - Individual document IDs for reference.
81
+ - Aggregated document ID for the full integrated analysis.
64
82
 
65
83
  ### If "끝장토론":
84
+
85
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-designer` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
86
+
66
87
  1. Execute "각자 독립" steps 1-3 above (independent work + initial aggregation).
67
88
  - The moderator's integrated document becomes the starting document.
68
89
 
69
- 2. Document review rounds (max 5):
90
+ 2. Document review rounds (no max — until all agree):
70
91
  a. Moderator sends the current document to each AI for review:
71
92
  - Claude: spawn `agestra-designer` → analyze document → write section-by-section feedback
72
93
  - Other providers: `agent_debate_turn` with the document as prompt, requesting agree/disagree per section
@@ -75,6 +96,7 @@ Spawn the `agestra-designer` agent with the subject as context. The designer wil
75
96
  d. Revise document incorporating disagreement feedback.
76
97
  e. If all providers agree on all sections → consensus reached.
77
98
  f. If not → next round with revised document.
99
+ g. **Every 10 rounds:** Ask the user via AskUserQuestion whether to continue or stop with current state.
78
100
 
79
101
  3. Present the final document:
80
102
  - Consensus sections: marked as agreed
package/commands/idea.md CHANGED
@@ -25,8 +25,8 @@ Use AskUserQuestion to present these options (in the user's language):
25
25
  | Option | Condition | Description |
26
26
  |--------|-----------|-------------|
27
27
  | **Claude only** | Always | 플러그인 전문 에이전트가 단독으로 개선점 탐색 |
28
- | **각자 독립** | 1+ provider available | AI 독립적으로 개선점 탐색 진행자가 취합하여 문서 작성 |
29
- | **끝장토론** | 1+ provider available | 각자 독립 + 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
28
+ | **각자 독립** | 1+ provider available | 에이전트 팀(moderator + ideator + 외부 AI)이 각자 독립 탐색 취합 문서 작성 |
29
+ | **끝장토론** | 1+ provider available | 각자 독립 탐색 후 취합 문서를 돌아가며 분석/피드백, 모두 동의할 때까지 |
30
30
 
31
31
  Only show options whose conditions are met. If no providers are available, skip and run Claude only.
32
32
 
@@ -36,26 +36,47 @@ Only show options whose conditions are met. If no providers are available, skip
36
36
  Spawn the `agestra-ideator` agent with the topic as context. The ideator will research similar projects, collect user complaints, build feature comparisons, and generate prioritized recommendations.
37
37
 
38
38
  ### If "각자 독립":
39
+
40
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-ideator` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
41
+
39
42
  1. In parallel:
40
43
  - Spawn the `agestra-ideator` agent for Claude's independent improvement research.
41
- - For each available provider, call `ai_chat` with this prompt:
44
+ After the agent completes, save Claude's result as a document via `workspace_create_document`:
45
+ - **title:** `Idea Exploration — claude/ideator`
46
+ - **metadata:** `{ "Provider": "claude/ideator", "Task": "{topic}", "Mode": "Independent" }`
47
+ - **content:** The ideator agent's full output.
48
+ - For each available provider, call `ai_chat` with `save_as_document` to let each AI produce its own document directly:
49
+ - **save_as_document.title:** `Idea Exploration — {provider}`
50
+ - **save_as_document.metadata:** `{ "Task": "{topic}", "Mode": "Independent" }`
51
+ - **prompt:**
52
+
53
+ > Research improvements for [topic]. Look at similar projects, common user complaints, missing features, and opportunities. For each suggestion, provide: title, category (UX/Performance/Feature/Integration/DX), source of the idea, priority (HIGH/MEDIUM/LOW), and a brief description.
54
+ >
55
+ > Topic: [the topic]
42
56
 
43
- > Research improvements for [topic]. Look at similar projects, common user complaints, missing features, and opportunities. For each suggestion, provide: title, category (UX/Performance/Feature/Integration/DX), source of the idea, priority (HIGH/MEDIUM/LOW), and a brief description.
44
- >
45
- > Topic: [the topic]
57
+ 2. Collect all document IDs from step 1.
46
58
 
47
- 2. Collect all results (Claude's ideator output + each provider's response).
48
59
  3. Spawn the `agestra-moderator` agent in **Independent Aggregation** mode:
49
- - Pass ALL results as input, tagged by source provider.
60
+ - Pass the **document ID list**.
61
+ - Moderator reads each document via `workspace_read`.
50
62
  - Moderator classifies: consensus suggestions, unique ideas, disputed priorities.
51
- - Moderator generates an integrated improvement document.
52
- 4. Present the integrated document to the user.
63
+ - Moderator creates an **aggregated document** via `workspace_create_document`.
64
+
65
+ 4. Present a **summary report** to the user:
66
+ - Key consensus suggestions (1-3 lines).
67
+ - Notable unique ideas (if any).
68
+ - Priority disagreements (if any).
69
+ - Individual document IDs for reference.
70
+ - Aggregated document ID for the full integrated analysis.
53
71
 
54
72
  ### If "끝장토론":
73
+
74
+ **팀 구성:** `agestra-moderator` (리더) + `agestra-ideator` (Claude) + 사용 가능한 외부 AI (gemini, codex, ollama 등)
75
+
55
76
  1. Execute "각자 독립" steps 1-3 above (independent work + initial aggregation).
56
77
  - The moderator's integrated document becomes the starting document.
57
78
 
58
- 2. Document review rounds (max 5):
79
+ 2. Document review rounds (no max — until all agree):
59
80
  a. Moderator sends the current document to each AI for review:
60
81
  - Claude: spawn `agestra-ideator` → analyze document → write section-by-section feedback
61
82
  - Other providers: `agent_debate_turn` with the document as prompt, requesting agree/disagree per section
@@ -64,6 +85,7 @@ Spawn the `agestra-ideator` agent with the topic as context. The ideator will re
64
85
  d. Revise document incorporating disagreement feedback.
65
86
  e. If all providers agree on all sections → consensus reached.
66
87
  f. If not → next round with revised document.
88
+ g. **Every 10 rounds:** Ask the user via AskUserQuestion whether to continue or stop with current state.
67
89
 
68
90
  3. Present the final document:
69
91
  - Consensus sections: marked as agreed