agestra 4.13.2 → 4.13.3

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.
@@ -12,7 +12,7 @@
12
12
  "name": "agestra",
13
13
  "source": "./",
14
14
  "description": "Orchestrate Ollama, Gemini, and Codex for multi-AI debates, code review, and cross-validation",
15
- "version": "4.13.2",
15
+ "version": "4.13.3",
16
16
  "author": {
17
17
  "name": "mua-vtuber"
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agestra",
3
- "version": "4.13.2",
3
+ "version": "4.13.3",
4
4
  "description": "Claude Code plugin — orchestrate Ollama, Gemini, and Codex for multi-AI debates, code review, and cross-validation",
5
5
  "mcpServers": {
6
6
  "agestra": {
package/README.ja.md CHANGED
@@ -72,6 +72,8 @@ Gemini ではリポジトリ直下の [GEMINI.md](GEMINI.md)、[`.gemini/command
72
72
  | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm install -g @google/gemini-cli` | Cloud |
73
73
  | [Codex CLI](https://github.com/openai/codex) | `npm install -g @openai/codex` | Cloud |
74
74
 
75
+ 各 CLI は自分自身の認証を管理します。使用予定の CLI は、その CLI 固有のログイン手順で事前に認証を済ませてください — Agestra は各 CLI を子プロセスとして起動するだけで、認証情報には関与しません。
76
+
75
77
  任意ですが推奨:
76
78
  - **tmux** — 自律実行中の CLI ワーカーペインを可視化できます
77
79
 
@@ -81,6 +83,52 @@ Gemini ではリポジトリ直下の [GEMINI.md](GEMINI.md)、[`.gemini/command
81
83
 
82
84
  **Multi-AI はトークン節約のためではなく、検証のために使います。** レビュー、設計探索、アイデア創出のワークフローは、速度のための並列化ではなく、複数の AI プロバイダーから独立した視点を集めて見落としを防ぐ検証プロセスとして設計されています。
83
85
 
86
+ ## 動作の仕組み
87
+
88
+ ```mermaid
89
+ flowchart TD
90
+ Start([ユーザーが /agestra コマンドを実行]) --> Preflight[セットアップ状態 / 環境 / プロバイダー確認]
91
+ Preflight --> Domain{ワークフロー種別}
92
+
93
+ Domain -->|アイデア / 設計 / レビュー / セキュリティ| TextLead[リーダーが専門エージェントと外部 AI を編成]
94
+ Domain -->|QA| QaLead[リーダーが QA Brigade を編成]
95
+ Domain -->|実装| ImplLead[リーダーが実装作業を分解]
96
+
97
+ ImplLead --> ImplRoute{作業の性質}
98
+ ImplRoute -->|明確に並列化できる実装| CliWorkers[Codex / Gemini CLI ワーカー<br/>分離 worktree で実装]
99
+ ImplRoute -->|単純または反復的な補助作業| Ollama[Ollama などのローカル AI<br/>草案 / パッチ候補 / 反復提案]
100
+ ImplRoute -->|リスクが高い中核変更| HostImpl[ホスト実装エージェント<br/>リーダーが近くで監督]
101
+ CliWorkers --> ReviewDiff[リーダーが状態 / 使用量 / diff を確認]
102
+ Ollama --> ReviewDiff
103
+ HostImpl --> ReviewDiff
104
+ ReviewDiff --> Merge{受け入れ可能?}
105
+ Merge -->|いいえ| Reassign[修正指示または再割り当て]
106
+ Reassign --> ImplRoute
107
+ Merge -->|はい| QaEvidence
108
+
109
+ QaLead --> QaEvidence[ホスト QA が実行証拠を収集<br/>ビルド / テスト / E2E / スクリーンショット]
110
+ TextLead --> Providers{外部 AI がある?}
111
+ QaEvidence --> Providers
112
+
113
+ Providers -->|なし| LocalOut[ホスト専門エージェントが<br/>ドメイン別レポートや文書を作成]
114
+ Providers -->|あり| Individual[各 AI が独立した意見を作成]
115
+ LocalOut --> Final([ユーザーへ結果を報告])
116
+
117
+ Individual --> Ledger[ITEM-* JSON 合意台帳]
118
+ Ledger --> Round[順次ラウンド<br/>同意 / 反対 / 修正 / 意見]
119
+ Round --> Gate{台帳の状態}
120
+ Gate -->|さらに議論| Round
121
+ Gate -->|リーダー判断が必要| LeaderDecision[リーダーが継続 / 承認 / 却下を選択]
122
+ Gate -->|整理済み| LeaderDecision
123
+ LeaderDecision -->|継続| Round
124
+ LeaderDecision -->|承認| Approved[承認済み統合文書]
125
+ LeaderDecision -->|却下| Rejected[却下 / 未解決の統合文書]
126
+ Approved --> Final
127
+ Rejected --> Final
128
+ ```
129
+
130
+ 外部プロバイダーが構成されていない場合、Agestra は合意ラウンドをスキップし、ホスト専門エージェントがレビュー/QA レポート、設計文書、アイデア記録などのドメイン別成果物を作成します。構造化ディベートが実行された場合は、リーダーが承認しても却下しても統合文書を残します。却下時の文書には、合意済み、除外済み、未解決/意見待ちの項目が整理されます。
131
+
84
132
  ## ホストごとの入口
85
133
 
86
134
  | ホスト | 自然な入口 |
@@ -165,11 +213,13 @@ Turborepo モノレポで、8 パッケージ構成です:
165
213
 
166
214
  ### 作業モード
167
215
 
168
- **Text work**(レビュー、QA、セキュリティ、設計、アイデア): プロバイダーあり → 徹底討論モード; なし → Claude only
216
+ マルチプロバイダーモード(徹底討論、クロス検証、レビューラウンド)では、あるプロバイダーの出力が次のプロバイダーが受け取るプロンプトの一部となる場合があります。
217
+
218
+ **テキスト作業**(レビュー、QA、セキュリティ、設計、アイデア): プロバイダーあり → 構造化ディベート; なし → リーダーホストの専門エージェント
169
219
 
170
- **Implementation work**(team-lead orchestration):
171
- - **Claude のみ** Claude がプロジェクト/グローバルエージェントを使って直接実装します。
172
- - **他の AI と併用**CLI ワーカー(Codex/Gemini)が分離された git worktree で自律的にコーディングし、Ollama が簡単なタスクを担当し、Claude が監督・統合します。
220
+ **実装作業**(team-lead orchestration):
221
+ - **リーダーホストのみ**現在のホストの `agestra-implementer` がスコープ付きのコード変更を行います。QA は明示的な host-only 指定がない限り、設定済みプロバイダーに応じて QA Brigade を使えます。
222
+ - **提案型 AI 分散**リーダーが作業表を提案して承認を得た後、Codex/Gemini CLI ワーカーが分離 worktree で明確な実装作業を担当し、Ollama は単純・反復作業の草案やパッチ候補を出します。リーダーが状態、使用量、diff を監督して統合します。
173
223
 
174
224
  ---
175
225
 
@@ -192,10 +242,10 @@ Turborepo モノレポで、8 パッケージ構成です:
192
242
  | `agent_debate_create` | ターン制ディベートセッションを作成(debate ID を返す) |
193
243
  | `agent_debate_turn` | 1 プロバイダー分のターンを実行。`provider: "claude"` で Claude の独立参加も可能 |
194
244
  | `agent_debate_conclude` | ディベートを終了し、最終トランスクリプトを生成 |
195
- | `agent_debate_structured` | 承認ゲート付きの構造化ディベートを開始。個別レビュー、必要に応じた別名整理、投票集計ラウンドを行い、承認されるまで合成は書かれず `ready-for-approval` で待機 |
196
- | `agent_debate_approve` | リーダーが `ready-for-approval` セッションを承認。合成ドキュメントを書き出してセッションを終了 |
245
+ | `agent_debate_structured` | 承認ゲート付きの構造化ディベートを開始。個別レビュー、必要に応じた別名整理、JSON 合意ラウンドを行い、リーダーが承認または却下するまで統合文書は書かれません |
246
+ | `agent_debate_approve` | リーダーが `ready-for-approval` セッションを承認。承認済み統合文書を書き出してセッションを終了 |
197
247
  | `agent_debate_continue` | `ready-for-approval`(または `escalated`)セッションに追加ラウンド(3/5/10)を実行 |
198
- | `agent_debate_reject` | 合成を書かずに構造化ディベートセッションを却下 |
248
+ | `agent_debate_reject` | 構造化ディベートセッションを却下し、却下版の統合文書を書き出します。必要に応じて issue 文書も作成 |
199
249
  | `agent_debate_review` | 文書を複数プロバイダーへ送り、独立したレビューを依頼 |
200
250
  | `agent_cross_validate` | 出力をクロスバリデーション(agent-tier validators のみ) |
201
251
  | `agent_changes_review` | 分離タスクでのファイル変更をレビュー |
package/README.ko.md CHANGED
@@ -50,6 +50,8 @@ Assets 설치 후 Gemini에서 사용할 수 있는 명령:
50
50
  | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm install -g @google/gemini-cli` | 클라우드 |
51
51
  | [Codex CLI](https://github.com/openai/codex) | `npm install -g @openai/codex` | 클라우드 |
52
52
 
53
+ 각 CLI는 자체 인증을 관리합니다. 사용하려는 CLI는 미리 해당 CLI의 로그인 절차로 인증해 두세요 — Agestra는 각 CLI를 자식 프로세스로 띄울 뿐 인증 정보에 관여하지 않습니다.
54
+
53
55
  선택 사항이지만 권장:
54
56
  - **tmux** — 자율 실행 중 CLI 워커 패인을 시각적으로 확인 가능
55
57
  - **Windows의 ripgrep (`rg`)** — Codex가 Store 앱 번들 경로의 `rg`를 잡아서 `Access is denied` 오류가 나면, 별도 ripgrep를 설치해 정상 `rg.exe`가 `PATH`에서 먼저 잡히게 하세요:
@@ -70,6 +72,52 @@ winget install BurntSushi.ripgrep.MSVC
70
72
 
71
73
  **멀티 AI는 검증을 위한 것이지, 토큰 절약을 위한 것이 아닙니다.** 리뷰, 설계 탐색, 아이디어 발굴 워크플로우는 검증 프로세스로 설계되었습니다 — 속도를 위한 병렬화가 아니라, 사각지대를 잡기 위해 여러 AI 공급자로부터 독립적인 의견을 얻는 것입니다.
72
74
 
75
+ ## 동작 방식
76
+
77
+ ```mermaid
78
+ flowchart TD
79
+ Start([사용자가 /agestra 명령 실행]) --> Preflight[설정 상태 / 환경 / 프로바이더 확인]
80
+ Preflight --> Domain{작업 종류}
81
+
82
+ Domain -->|아이디어 / 설계 / 리뷰 / 보안| TextLead[리더가 전문 에이전트와 외부 AI 구성]
83
+ Domain -->|QA| QaLead[리더가 QA Brigade 구성]
84
+ Domain -->|구현| ImplLead[리더가 구현 작업 분해]
85
+
86
+ ImplLead --> ImplRoute{작업 성격}
87
+ ImplRoute -->|명확한 병렬 구현| CliWorkers[Codex / Gemini CLI 작업자<br/>격리 worktree에서 구현]
88
+ ImplRoute -->|쉽고 반복적인 보조 작업| Ollama[Ollama 등 로컬 AI<br/>초안 / 패치 후보 / 반복 제안]
89
+ ImplRoute -->|위험하거나 핵심 변경| HostImpl[호스트 구현 에이전트<br/>가까운 감독 아래 수정]
90
+ CliWorkers --> ReviewDiff[리더가 상태 / 사용량 / diff 검토]
91
+ Ollama --> ReviewDiff
92
+ HostImpl --> ReviewDiff
93
+ ReviewDiff --> Merge{수용 가능?}
94
+ Merge -->|아니오| Reassign[수정 지시 또는 재배정]
95
+ Reassign --> ImplRoute
96
+ Merge -->|예| QaEvidence
97
+
98
+ QaLead --> QaEvidence[호스트 QA가 실행 증거 수집<br/>빌드 / 테스트 / E2E / 스크린샷]
99
+ TextLead --> Providers{외부 AI 있음?}
100
+ QaEvidence --> Providers
101
+
102
+ Providers -->|없음| LocalOut[호스트 전문 에이전트가<br/>보고서 / 설계 / 아이디어 문서 작성]
103
+ Providers -->|있음| Individual[각 AI가 독립 의견 작성]
104
+ LocalOut --> Final([사용자에게 결과 보고])
105
+
106
+ Individual --> Ledger[ITEM-* JSON 합의 장부]
107
+ Ledger --> Round[순차 라운드<br/>동의 / 반대 / 수정 / 의견]
108
+ Round --> Gate{정리 상태}
109
+ Gate -->|더 논의| Round
110
+ Gate -->|리더 판단 필요| LeaderDecision[리더가 계속 / 승인 / 거절 선택]
111
+ Gate -->|합의 정리됨| LeaderDecision
112
+ LeaderDecision -->|계속| Round
113
+ LeaderDecision -->|승인| Approved[승인 종합 문서 생성]
114
+ LeaderDecision -->|거절| Rejected[거절 / 불합의 종합 문서 생성]
115
+ Approved --> Final
116
+ Rejected --> Final
117
+ ```
118
+
119
+ 외부 프로바이더가 구성되어 있지 않으면 합의 라운드는 건너뛰고 호스트 전문 에이전트가 도메인별 산출물(리뷰/QA 보고서, 설계 문서, 아이디어 문서 등)을 만듭니다. 구조화 토론이 열린 경우에는 리더가 승인하든 거절하든 최종 종합 문서를 남기며, 거절 문서에는 합의된 항목과 제외된 항목, 미합의/의견 필요 항목이 함께 정리됩니다.
120
+
73
121
  ## 호스트별 진입 방식
74
122
 
75
123
  | 호스트 | 자연스러운 진입 방식 |
@@ -154,11 +202,13 @@ Turborepo 모노레포, 8개 패키지:
154
202
 
155
203
  ### 작업 모드
156
204
 
157
- **텍스트 작업** (리뷰, QA, 보안, 설계, 아이디어): 공급자 있으면 끝장토론; 없으면 Claude only
205
+ 멀티 프로바이더 모드(끝장토론, 교차 검증, 리뷰 라운드)에서는 프로바이더의 출력이 다음 프로바이더가 받는 프롬프트의 일부가 될 수 있습니다.
206
+
207
+ **텍스트 작업** (리뷰, QA, 보안, 설계, 아이디어): 공급자 있으면 → 구조화 토론; 없으면 → 리더-호스트 전문 에이전트
158
208
 
159
209
  **구현 작업** (team-lead 오케스트레이션):
160
- - **Claude만으로**Claude가 프로젝트/전역 에이전트를 활용해 직접 구현.
161
- - **다른 AI 함께**CLI 워커(Codex/Gemini)가 격리된 git worktree에서 자율 코딩, Ollama 단순 작업 처리, Claude가 감독 병합.
210
+ - **리더-호스트 전용** 현재 호스트의 `agestra-implementer`가 제한된 코드 변경을 수행합니다. QA는 요청이 없으면 설정된 프로바이더 기준으로 QA Brigade를 사용할 수 있습니다.
211
+ - **제안된 AI 분산**리더가 작업표를 제안하고 승인받은 뒤, Codex/Gemini CLI 워커가 격리된 git worktree에서 명확한 구현 작업을 맡고 Ollama 단순·반복 작업의 초안/패치 후보를 냅니다. 리더가 상태, 사용량, diff를 감독하고 병합합니다.
162
212
 
163
213
  ---
164
214
 
@@ -181,10 +231,10 @@ Turborepo 모노레포, 8개 패키지:
181
231
  | `agent_debate_create` | 턴 기반 토론 세션 생성 (토론 ID 반환) |
182
232
  | `agent_debate_turn` | 공급자 1턴 실행; `provider: "claude"`로 Claude 독립 참여 지원 |
183
233
  | `agent_debate_conclude` | 토론 종료 및 최종 트랜스크립트 생성 |
184
- | `agent_debate_structured` | 승인 게이트 구조화 토론 시작 — 개별 리뷰, 선택적 별칭 정리, 투표 집계 라운드, 합성은 승인 전까지 작성되지 않음 (`ready-for-approval` 상태로 대기) |
185
- | `agent_debate_approve` | 리더가 `ready-for-approval` 세션을 승인하여 합성 문서를 작성하고 세션을 종료 |
234
+ | `agent_debate_structured` | 승인 게이트 구조화 토론 시작 — 개별 리뷰, 선택적 별칭 정리, JSON 합의 라운드, 리더가 승인하거나 거절하기 전까지 종합 문서는 작성되지 않음 |
235
+ | `agent_debate_approve` | 리더가 `ready-for-approval` 세션을 승인하여 승인 종합 문서를 작성하고 세션을 종료 |
186
236
  | `agent_debate_continue` | `ready-for-approval`(또는 `escalated`) 세션에 추가 라운드(3/5/10) 실행 |
187
- | `agent_debate_reject` | 합성 없이 구조화 토론 세션 거부 |
237
+ | `agent_debate_reject` | 구조화 토론 세션을 거절하고 거절 종합 문서를 작성하며, 필요하면 별도 issue 문서도 작성 |
188
238
  | `agent_debate_review` | 문서를 여러 공급자에게 독립적으로 리뷰 요청 |
189
239
  | `agent_cross_validate` | 출력 교차 검증 (에이전트 등급 검증자만 가능) |
190
240
  | `agent_changes_review` | 격리된 작업의 파일 변경 리뷰 |
package/README.md CHANGED
@@ -50,6 +50,8 @@ At least one AI provider must be installed:
50
50
  | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm install -g @google/gemini-cli` | Cloud |
51
51
  | [Codex CLI](https://github.com/openai/codex) | `npm install -g @openai/codex` | Cloud |
52
52
 
53
+ Each CLI manages its own authentication. Sign in through each CLI's own login flow before using Agestra — Agestra spawns these CLIs as child processes and does not handle their credentials.
54
+
53
55
  Optional but recommended:
54
56
  - **tmux** — enables visible CLI worker panes during autonomous execution
55
57
  - **ripgrep (`rg`)** on Windows — if Codex resolves `rg` to its bundled Store-app path and fails with an "Access is denied" error, install ripgrep separately so a normal `rg.exe` is found first in `PATH`:
@@ -70,6 +72,52 @@ winget install BurntSushi.ripgrep.MSVC
70
72
 
71
73
  **Multi-AI is for verification, not token savings.** The review, design exploration, and idea generation workflows are structured as validation processes — getting independent opinions from multiple AI providers to catch blind spots, not to parallelize for speed.
72
74
 
75
+ ## How It Works
76
+
77
+ ```mermaid
78
+ flowchart TD
79
+ Start([User invokes /agestra command]) --> Preflight[Setup status / environment / provider check]
80
+ Preflight --> Domain{Workflow type}
81
+
82
+ Domain -->|Idea / design / review / security| TextLead[Leader assembles specialist and external AIs]
83
+ Domain -->|QA| QaLead[Leader forms QA Brigade]
84
+ Domain -->|Implementation| ImplLead[Leader decomposes implementation work]
85
+
86
+ ImplLead --> ImplRoute{Task shape}
87
+ ImplRoute -->|Clear parallel implementation| CliWorkers[Codex / Gemini CLI workers<br/>isolated worktrees]
88
+ ImplRoute -->|Simple or repetitive support| Ollama[Ollama or local AI<br/>drafts / patch candidates / repeated suggestions]
89
+ ImplRoute -->|Risky or core change| HostImpl[Host implementer<br/>close leader supervision]
90
+ CliWorkers --> ReviewDiff[Leader monitors status / quota / diff]
91
+ Ollama --> ReviewDiff
92
+ HostImpl --> ReviewDiff
93
+ ReviewDiff --> Merge{Acceptable?}
94
+ Merge -->|No| Reassign[Correction prompt or reassignment]
95
+ Reassign --> ImplRoute
96
+ Merge -->|Yes| QaEvidence
97
+
98
+ QaLead --> QaEvidence[Host QA collects executable evidence<br/>build / tests / E2E / screenshots]
99
+ TextLead --> Providers{External AIs available?}
100
+ QaEvidence --> Providers
101
+
102
+ Providers -->|No| LocalOut[Host specialist writes<br/>domain report or document]
103
+ Providers -->|Yes| Individual[Each AI writes independent source material]
104
+ LocalOut --> Final([Report back to user])
105
+
106
+ Individual --> Ledger[ITEM-* JSON consensus ledger]
107
+ Ledger --> Round[Sequential rounds<br/>agree / disagree / revise / opinion]
108
+ Round --> Gate{Ledger state}
109
+ Gate -->|Needs more discussion| Round
110
+ Gate -->|Leader judgment needed| LeaderDecision[Leader chooses continue / approve / reject]
111
+ Gate -->|Resolved| LeaderDecision
112
+ LeaderDecision -->|Continue| Round
113
+ LeaderDecision -->|Approve| Approved[Approved synthesis document]
114
+ LeaderDecision -->|Reject| Rejected[Rejected / unresolved synthesis document]
115
+ Approved --> Final
116
+ Rejected --> Final
117
+ ```
118
+
119
+ When no external provider is configured, Agestra skips consensus rounds and the host specialist writes the domain artifact: review or QA report, design plan, idea record, and so on. When a structured debate runs, leader finalization always leaves a synthesis document: approval produces an approved synthesis, while rejection produces a rejected/unresolved synthesis that lists accepted, excluded, and still-open items.
120
+
73
121
  ## Host Workflows
74
122
 
75
123
  | Host | Natural entrypoint |
@@ -154,6 +202,8 @@ Turborepo monorepo with 8 packages:
154
202
 
155
203
  ### Work Modes
156
204
 
205
+ In multi-provider modes (consensus debate, cross-validation, review rounds), one provider's output may become part of the prompt the next provider receives.
206
+
157
207
  **Text work** (review, QA, security, design, idea): providers available → consensus debate mode; no providers → Leader-host only. For QA, the team lead runs a QA Brigade by default while E2E/runtime checks stay host-owned.
158
208
 
159
209
  **Implementation work** (team-lead orchestration):
@@ -181,10 +231,10 @@ Turborepo monorepo with 8 packages:
181
231
  | `agent_debate_create` | Create a turn-based debate session (returns debate ID) |
182
232
  | `agent_debate_turn` | Execute one provider's turn; supports `provider: "claude"` for Claude's independent participation |
183
233
  | `agent_debate_conclude` | End a debate and generate final transcript |
184
- | `agent_debate_structured` | Start an approval-gated structured debate in the background — individual reviews, optional alias clarification, JSON consensus rounds, status polling, and no synthesis until approved |
185
- | `agent_debate_approve` | Leader-approve a ready-for-approval structured debate; writes the synthesis document and closes the session |
234
+ | `agent_debate_structured` | Start an approval-gated structured debate in the background — individual reviews, optional alias clarification, JSON consensus rounds, status polling, and no synthesis until the leader approves or rejects |
235
+ | `agent_debate_approve` | Leader-approve a ready-for-approval structured debate; writes the approved synthesis document and closes the session |
186
236
  | `agent_debate_continue` | Start additional background rounds on a ready-for-approval or escalated structured-debate session (3/5/10), then poll status |
187
- | `agent_debate_reject` | Reject a structured-debate session without writing synthesis |
237
+ | `agent_debate_reject` | Reject a structured-debate session; writes a rejected synthesis document and optionally an issue document |
188
238
  | `agent_debate_review` | Send a document to multiple providers for independent review |
189
239
  | `agent_cross_validate` | Cross-validate outputs (agent-tier validators only) |
190
240
  | `agent_changes_review` | Review file changes from an isolated task |
package/README.zh.md CHANGED
@@ -72,6 +72,8 @@ Gemini 会结合仓库根目录下的 [GEMINI.md](GEMINI.md)、[`.gemini/command
72
72
  | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm install -g @google/gemini-cli` | Cloud |
73
73
  | [Codex CLI](https://github.com/openai/codex) | `npm install -g @openai/codex` | Cloud |
74
74
 
75
+ 每个 CLI 都自行管理其认证。请在使用前通过对应 CLI 自身的登录流程完成认证 — Agestra 仅作为子进程启动这些 CLI,不会处理其认证信息。
76
+
75
77
  可选但推荐:
76
78
  - **tmux** — 让你在自主执行期间可视化查看 CLI Worker 面板
77
79
 
@@ -81,6 +83,52 @@ Gemini 会结合仓库根目录下的 [GEMINI.md](GEMINI.md)、[`.gemini/command
81
83
 
82
84
  **Multi-AI 的目标是验证,而不是节省 token。** 代码审查、设计探索和想法生成工作流都被设计成验证流程,核心不是为了更快并行,而是让多个 AI 提供方独立给出意见,从而发现盲点。
83
85
 
86
+ ## 工作方式
87
+
88
+ ```mermaid
89
+ flowchart TD
90
+ Start([用户调用 /agestra 命令]) --> Preflight[设置状态 / 环境 / 提供方检查]
91
+ Preflight --> Domain{工作流类型}
92
+
93
+ Domain -->|想法 / 设计 / 审查 / 安全| TextLead[负责人组建专家代理和外部 AI]
94
+ Domain -->|QA| QaLead[负责人组建 QA Brigade]
95
+ Domain -->|实现| ImplLead[负责人拆分实现任务]
96
+
97
+ ImplLead --> ImplRoute{任务形态}
98
+ ImplRoute -->|清晰可并行的实现| CliWorkers[Codex / Gemini CLI Worker<br/>隔离 worktree 中实现]
99
+ ImplRoute -->|简单或重复的辅助任务| Ollama[Ollama 等本地 AI<br/>草稿 / 补丁候选 / 重复建议]
100
+ ImplRoute -->|高风险或核心改动| HostImpl[宿主实现代理<br/>负责人近距离监督]
101
+ CliWorkers --> ReviewDiff[负责人监控状态 / 用量 / diff]
102
+ Ollama --> ReviewDiff
103
+ HostImpl --> ReviewDiff
104
+ ReviewDiff --> Merge{可接受?}
105
+ Merge -->|否| Reassign[修正指令或重新分配]
106
+ Reassign --> ImplRoute
107
+ Merge -->|是| QaEvidence
108
+
109
+ QaLead --> QaEvidence[宿主 QA 收集可执行证据<br/>构建 / 测试 / E2E / 截图]
110
+ TextLead --> Providers{有外部 AI?}
111
+ QaEvidence --> Providers
112
+
113
+ Providers -->|无| LocalOut[宿主专家代理生成<br/>领域报告或文档]
114
+ Providers -->|有| Individual[各 AI 编写独立意见]
115
+ LocalOut --> Final([向用户报告结果])
116
+
117
+ Individual --> Ledger[ITEM-* JSON 共识台账]
118
+ Ledger --> Round[顺序轮次<br/>同意 / 反对 / 修订 / 意见]
119
+ Round --> Gate{台账状态}
120
+ Gate -->|需要继续讨论| Round
121
+ Gate -->|需要负责人判断| LeaderDecision[负责人选择继续 / 批准 / 拒绝]
122
+ Gate -->|已整理| LeaderDecision
123
+ LeaderDecision -->|继续| Round
124
+ LeaderDecision -->|批准| Approved[批准版综合文档]
125
+ LeaderDecision -->|拒绝| Rejected[拒绝 / 未解决综合文档]
126
+ Approved --> Final
127
+ Rejected --> Final
128
+ ```
129
+
130
+ 当未配置任何外部提供方时,Agestra 会跳过共识轮次,由宿主专家代理生成对应领域产物,例如 review/QA 报告、设计文档或想法记录。只要进入结构化辩论,负责人无论批准还是拒绝都会留下综合文档;拒绝文档会整理已接受、已排除以及仍未解决/需要意见的项目。
131
+
84
132
  ## 各宿主的自然入口
85
133
 
86
134
  | 宿主 | 自然入口 |
@@ -165,11 +213,13 @@ Gemini 会结合仓库根目录下的 [GEMINI.md](GEMINI.md)、[`.gemini/command
165
213
 
166
214
  ### 工作模式
167
215
 
168
- **文本工作**(review、QA、security、design、idea):有提供方 → 终极辩论模式;无提供方 → Claude only
216
+ 在多提供方模式(终极辩论、交叉验证、复审轮次)中,一个提供方的输出可能成为下一个提供方所收到提示词的一部分。
217
+
218
+ **文本工作**(review、QA、security、design、idea):有提供方 → 结构化辩论;无提供方 → 负责人宿主的专家代理
169
219
 
170
220
  **实现工作**(team-lead orchestration):
171
- - **仅 Claude** Claude 直接结合项目/全局代理完成实现。
172
- - **与其他 AI 一起**CLI Worker(Codex/Gemini)在隔离的 git worktree 中自主编码,Ollama 处理简单任务,Claude 负责监督与合并。
221
+ - **仅负责人宿主**当前宿主的 `agestra-implementer` 执行有范围的代码修改。除非明确要求 host-only,QA 仍可根据已配置提供方使用 QA Brigade。
222
+ - **建议式 AI 分工**负责人先提出任务分配表并取得批准,然后让 Codex/Gemini CLI Worker 在隔离 worktree 中处理清晰的实现任务;Ollama 用于简单、重复任务的草稿或补丁候选。负责人持续监督状态、用量和 diff,并负责合并。
173
223
 
174
224
  ---
175
225
 
@@ -192,10 +242,10 @@ Gemini 会结合仓库根目录下的 [GEMINI.md](GEMINI.md)、[`.gemini/command
192
242
  | `agent_debate_create` | 创建回合制辩论会话(返回 debate ID) |
193
243
  | `agent_debate_turn` | 执行某个提供方的一回合;支持 `provider: "claude"` 让 Claude 独立参与 |
194
244
  | `agent_debate_conclude` | 结束辩论并生成最终转录 |
195
- | `agent_debate_structured` | 启动带审批闸门的结构化辩论:进行独立审查、可选别名整理、带投票聚合的多轮推进,合成在批准前不写入,会话停留在 `ready-for-approval` |
196
- | `agent_debate_approve` | 领导者批准 `ready-for-approval` 会话;写入合成文档并结束会话 |
245
+ | `agent_debate_structured` | 启动带审批闸门的结构化辩论:进行独立审查、可选别名整理和 JSON 共识轮次;负责人批准或拒绝前不会写入综合文档 |
246
+ | `agent_debate_approve` | 负责人批准 `ready-for-approval` 会话;写入批准版综合文档并结束会话 |
197
247
  | `agent_debate_continue` | 对 `ready-for-approval`(或 `escalated`)会话追加轮次(3/5/10) |
198
- | `agent_debate_reject` | 拒绝结构化辩论会话,不写入合成 |
248
+ | `agent_debate_reject` | 拒绝结构化辩论会话;写入拒绝版综合文档,并可按需写入 issue 文档 |
199
249
  | `agent_debate_review` | 将文档发送给多个提供方进行独立审查 |
200
250
  | `agent_cross_validate` | 对输出进行交叉验证(仅限 agent-tier validators) |
201
251
  | `agent_changes_review` | 审查隔离任务中的文件变更 |
@@ -97,7 +97,7 @@ Do not ask `agestra-e2e-writer` to change product behavior. Product fixes belong
97
97
 
98
98
  ### Mode: Structured Debate
99
99
 
100
- **Preferred entry point:** Call `agent_debate_structured` with `mode`, topic, scope, participants, optional `source_documents`, and leader. Use `mode: "review"` for code/document review and `mode: "idea"` for idea/design option discovery. `source_documents` is optional and must use `{ "document_id": "...", "provider": "..." }` entries when independent documents already exist. The tool creates a structured session record immediately and returns `status: running`; use `agent_debate_status` to monitor phase, provider progress, item summary, and document paths. The moderator engine owns the full lifecycle: individual/source material loading, JSON consensus ledger creation, optional alias clarification, sequential provider turns, strict JSON response validation, generated debate markdown, structured session record, and final synthesis after leader approval.
100
+ **Preferred entry point:** Call `agent_debate_structured` with `mode`, topic, scope, participants, optional `source_documents`, and leader. Use `mode: "review"` for code/document review and `mode: "idea"` for idea/design option discovery. `source_documents` is optional and must use `{ "document_id": "...", "provider": "..." }` entries when independent documents already exist. The tool creates a structured session record immediately and returns `status: running`; use `agent_debate_status` to monitor phase, provider progress, item summary, and document paths. The moderator engine owns the full lifecycle: individual/source material loading, JSON consensus ledger creation, optional alias clarification, sequential provider turns, strict JSON response validation, generated debate markdown, structured session record, and final synthesis after leader approval or rejection.
101
101
 
102
102
  The JSON consensus ledger is the source of truth. Debate markdown and synthesis markdown are generated human-readable artifacts. The moderator may inspect and report their paths, but must not edit markdown to change item status, provider stance, or consensus state.
103
103
 
@@ -161,9 +161,9 @@ The engine persists the JSON ledger atomically, then regenerates:
161
161
 
162
162
  The moderator does not write the final synthesis file on its own. Three dedicated MCP tools close out the flow:
163
163
 
164
- - `agent_debate_approve`: writes the synthesis markdown, updates ledger document paths, and transitions to `approved`.
164
+ - `agent_debate_approve`: writes the approved synthesis markdown, updates ledger document paths, and transitions to `approved`.
165
165
  - `agent_debate_continue`: loads the persisted ledger/session record, starts additional consensus rounds in the background, and returns `running`.
166
- - `agent_debate_reject`: closes without synthesis. With `spawn_issue = true`, an issue document can be written under `individual/` listing non-accepted items.
166
+ - `agent_debate_reject`: writes the rejected synthesis markdown, updates ledger document paths, and transitions to `rejected`. With `spawn_issue = true`, an additional issue document can be written under `individual/` listing non-accepted items.
167
167
 
168
168
  Idempotency: a second call on a terminal state (`approved`, `rejected`, `leader-timeout`) returns the cached outcome. Calling approval-gate tools on a `running` or `error` session returns `isError: true` with a descriptive state message.
169
169
 
@@ -206,7 +206,7 @@ All paths relative to `workspaceBaseDir` (`.agestra/workspace/` under the projec
206
206
  .agestra/workspace/
207
207
  individual/ — each participant's initial independent review (pre-debate; no votes)
208
208
  debates/ — generated debate markdown + {sessionId}.consensus.json + {sessionId}.session.json
209
- synthesis/ — leader-approved final synthesis document (written only on _approve)
209
+ synthesis/ — leader-finalized synthesis document (written on _approve or _reject)
210
210
  reviews/ — legacy, read-only; no new writes
211
211
  ```
212
212
 
@@ -224,7 +224,7 @@ The moderator's terminal report and the synthesis document are derived from the
224
224
  - **Excluded items** - items where all active participants disagreed.
225
225
  - **Open items** - items that need opinion, have no response, or remain unresolved.
226
226
  - **AI Contribution Summary** - per participant: proposed items, accepted items, revisions, opinions, and non-responses.
227
- - **Footer** - debate markdown path, consensus JSON path, and synthesis path when approved.
227
+ - **Footer** - debate markdown path, consensus JSON path, and synthesis path when finalized.
228
228
 
229
229
  Severity labels are lifted from the proposer's individual review verbatim. The moderator does **not** translate participant-authored item titles, comments, or individual-review bodies.
230
230
 
@@ -503,10 +503,10 @@ If `max_rounds` is hit with open proposals, the moderator surfaces the choice to
503
503
 
504
504
  <Tool_Usage>
505
505
  - `provider_list` — check available providers at the start.
506
- - `agent_debate_structured` — **recommended entry point for Structured Debate**: accepts `mode: "review" | "idea"` and optional `source_documents`, starts or loads individual source material, runs optional alias clarification, JSON consensus turns, ledger persistence, generated debate markdown, and the approval gate in the background. Returns `running`; poll `agent_debate_status`. Does NOT write synthesis.
507
- - `agent_debate_approve` — write synthesis markdown, mark the snapshot `approved`, close the session.
506
+ - `agent_debate_structured` — **recommended entry point for Structured Debate**: accepts `mode: "review" | "idea"` and optional `source_documents`, starts or loads individual source material, runs optional alias clarification, JSON consensus turns, ledger persistence, generated debate markdown, and the approval gate in the background. Returns `running`; poll `agent_debate_status`. Does NOT write synthesis until the leader approves or rejects.
507
+ - `agent_debate_approve` — write approved synthesis markdown, mark the snapshot `approved`, close the session.
508
508
  - `agent_debate_continue` — force additional rounds on a `ready-for-approval` or `escalated` session; returns `running`, then poll status.
509
- - `agent_debate_reject` — close without synthesis; optionally spawn an issue branch listing non-accepted proposals.
509
+ - `agent_debate_reject` — write rejected synthesis markdown, mark the snapshot `rejected`, close the session; optionally spawn an issue branch listing non-accepted proposals.
510
510
  - Legacy manual debate primitives — diagnostic use only; do not use them for review, idea, or design consensus workflows.
511
511
  - `agent_debate_review` — send a document to providers for structured review (Document Review mode).
512
512
  - `ai_chat` — query individual providers for feedback (Independent Aggregation mode).
@@ -379,7 +379,7 @@ Ledger interpretation:
379
379
  - The moderator handles duplicate/merge/superseded state in the ledger. Participants may point out duplication in comments or propose a `revise`, but they do not manually merge markdown.
380
380
  - The leader does not decide item inclusion by hand. The leader inspects the JSON ledger and chooses approve / continue / reject at the approval gate.
381
381
 
382
- Run the structured-debate MCP flow. This is a **background lifecycle**: `agent_debate_structured` creates a durable session record immediately and returns `status: running`; the leader polls `agent_debate_status` until the moderator parks the session in `ready-for-approval`, `escalated`, or `error`. The moderator does NOT write the synthesis file on its own — approval must be explicit.
382
+ Run the structured-debate MCP flow. This is a **background lifecycle**: `agent_debate_structured` creates a durable session record immediately and returns `status: running`; the leader polls `agent_debate_status` until the moderator parks the session in `ready-for-approval`, `escalated`, or `error`. The moderator does NOT write the synthesis file on its own — leader finalization must be explicit.
383
383
 
384
384
  #### 5M.1 Start the debate
385
385
 
@@ -417,7 +417,7 @@ Before deciding, read the on-disk outputs — the debate writes three folders un
417
417
 
418
418
  - `.agestra/workspace/individual/` — per-participant individual reviews (`individual_{participant}_{topic}_{date}_{seq}.md`). Includes auto-injected host specialists like `claude-reviewer` / `claude-qa` / `claude-security` when present.
419
419
  - `.agestra/workspace/debates/` — debate transcript (`debate_{topic}_{date}_{seq}.md`), consensus ledger (`{sessionId}.consensus.json`), and structured session record (`{sessionId}.session.json`). The session record remains after `approve` / `reject` for idempotent replays and audit.
420
- - `.agestra/workspace/synthesis/` — the final synthesis document, written only after `agent_debate_approve` succeeds.
420
+ - `.agestra/workspace/synthesis/` — the final synthesis document, written after `agent_debate_approve` or `agent_debate_reject` succeeds.
421
421
 
422
422
  Use `Read` / `Grep` against these paths plus the in-result snapshot to judge whether the debate outcome matches the design.
423
423
 
@@ -436,7 +436,7 @@ Pick exactly one of the three follow-up tools, based on inspection:
436
436
 
437
437
  1. **Accept the outcome** → call `agent_debate_approve` with `session_id` and an optional `leader_note` (appended to the synthesis footer under "Leader approval notes"). The moderator writes the synthesis markdown, updates the session record to `approved`, and returns `synthesisDocPath`. If this is QA-only, proceed to Phase 7. If this is an implementation flow and the QA verdict is PASS or CONDITIONAL PASS, proceed to Phase 6 unless the debate explicitly included the post-implementation review lens. If this is an implementation flow and the QA verdict is FAIL, return to Phase 3 with targeted fixes or escalate to the user instead of claiming completion.
438
438
  2. **Need more deliberation** → call `agent_debate_continue` with `session_id` and `additional_rounds` (`3`, `5`, or `10` only). The handler returns `status: running`; poll `agent_debate_status` again until it reaches the approval gate. Use this when the debate was close but unresolved, or when `escalated` came too early.
439
- 3. **Reject the outcome** → call `agent_debate_reject` with `session_id` and a `reason` (captured in the transcript footer). Optionally set `spawn_issue: true` to write a lightweight issue branch document into `individual/` listing non-accepted proposals for later handling. No synthesis is produced. The debate is closed.
439
+ 3. **Reject the outcome** → call `agent_debate_reject` with `session_id` and a `reason` (captured in the transcript footer and rejected synthesis). Optionally set `spawn_issue: true` to write a lightweight issue branch document into `individual/` listing non-accepted proposals for later handling. The moderator writes a rejected synthesis that summarizes accepted, excluded, and unresolved items, then closes the debate.
440
440
 
441
441
  All three tools are idempotent on terminal states — re-calling returns the cached outcome.
442
442
 
@@ -469,7 +469,7 @@ Provide a clear summary to the user:
469
469
  - What changed (files modified, features added)
470
470
  - Verification summary:
471
471
  - Host-only QA/review: QA depth, E2E status, QA report path, QA cycle count + what was auto-fixed, review report path, review verdict
472
- - QA Brigade / configured-provider QA: host QA report path, E2E host-only status, participant list, assigned lenses, accepted ledger items, excluded ledger items, open/opinion items, consensus verdict, dissenting findings, structured debate outcome (`approved` / `rejected`, with round count), `auto_inject_specialists` state, final synthesis path (if approved) from `.agestra/workspace/synthesis/`, and links to the individual reviews under `.agestra/workspace/individual/` and the transcript under `.agestra/workspace/debates/`
472
+ - QA Brigade / configured-provider QA: host QA report path, E2E host-only status, participant list, assigned lenses, accepted ledger items, excluded ledger items, open/opinion items, consensus verdict, dissenting findings, structured debate outcome (`approved` / `rejected`, with round count), `auto_inject_specialists` state, final synthesis path from `.agestra/workspace/synthesis/`, and links to the individual reviews under `.agestra/workspace/individual/` and the transcript under `.agestra/workspace/debates/`
473
473
  - Any issues found and how they were resolved
474
474
 
475
475
  </Workflow>
@@ -559,7 +559,7 @@ The design document is the authority. If an AI's output conflicts with the desig
559
559
  - `trace_query` / `trace_summary` / `trace_visualize` — provider quality tracking and inspection
560
560
  - `ai_chat` / `ai_analyze_files` / `ai_compare` — query external AI
561
561
  - `agent_debate_structured` — start a structured multi-AI debate in the background (individual/source material → clarification → JSON consensus rounds → aggregation → approval gate). It returns `status: running`; poll `agent_debate_status`. Supports `mode: "review" | "idea"`, optional `source_documents`, `auto_inject_specialists` (default `true`) to auto-add host reviewer/QA/security specialists (compatibility IDs: `claude-reviewer` / `claude-qa` / `claude-security`) based on topic, and `exclude_participants` as the escape hatch (also the way to keep Ollama or any other provider out — there is no automatic Ollama filter).
562
- - `agent_debate_approve` / `agent_debate_continue` / `agent_debate_reject` — leader-only finalization tools for a structured session at the approval gate. `approve` writes the synthesis under `.agestra/workspace/synthesis/`; `continue(additional_rounds=N)` accepts only `3`, `5`, or `10` and returns `running`; `reject(reason=..., spawn_issue?=true)` closes the session with no synthesis.
562
+ - `agent_debate_approve` / `agent_debate_continue` / `agent_debate_reject` — leader-only finalization tools for a structured session at the approval gate. `approve` writes an approved synthesis under `.agestra/workspace/synthesis/`; `continue(additional_rounds=N)` accepts only `3`, `5`, or `10` and returns `running`; `reject(reason=..., spawn_issue?=true)` writes a rejected synthesis and can also write a follow-up issue document.
563
563
  - Low-level debate primitives — legacy / diagnostic use only; prefer the structured debate tools for review, idea, and design workflows.
564
564
  - `agent_cross_validate` — cross-validate outputs between providers
565
565
  - `cli_worker_spawn` / `cli_worker_status` / `cli_worker_collect` / `cli_worker_stop` — manage Codex/Gemini CLI workers
package/commands/idea.md CHANGED
@@ -92,7 +92,7 @@ Direct execution bypasses team-lead's quality-based routing and consistency enfo
92
92
  ## Step 3: Present to the user
93
93
 
94
94
  When team-lead (or the host specialist in Branch A) returns:
95
- - Name the debate document, consensus JSON ledger, and final synthesis document if approved
95
+ - Name the debate document, consensus JSON ledger, and final synthesis document when the structured session is finalized
96
96
  - Name the idea decision document under `docs/ideas/` after the user chooses or approves ideas
97
97
  - Show ideas grouped as Make Soon, Explore Next, and Inspiration Bank when available
98
98
  - Explain accepted, excluded, and still-open ideas in plain language
package/commands/qa.md CHANGED
@@ -76,7 +76,7 @@ Hand off to `agestra:agestra-team-lead` with:
76
76
  - **Locale:** from `setup_status`
77
77
  - **Original user request:** preserve verbatim
78
78
 
79
- Team-lead owns the QA Brigade handoff and leader approval gate. The moderator engine owns provider fan-out, `ITEM-*` creation, JSON stance turns, consensus ledger aggregation, minority/open items, and synthesis after approval. This command must not call `agent_debate_structured` directly. Do not ask for a separate multi-AI confirmation in Branch B; provider selection already came from setup. Honor explicit host-only wording.
79
+ Team-lead owns the QA Brigade handoff and leader finalization gate. The moderator engine owns provider fan-out, `ITEM-*` creation, JSON stance turns, consensus ledger aggregation, minority/open items, and final synthesis after approval or rejection. This command must not call `agent_debate_structured` directly. Do not ask for a separate multi-AI confirmation in Branch B; provider selection already came from setup. Honor explicit host-only wording.
80
80
 
81
81
  ## Step 4: Present the final result
82
82