opencode-magi 0.9.0 → 0.11.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.ja.md +254 -0
- package/README.md +37 -34
- package/dist/commands.js +11 -9
- package/dist/config/index.js +2 -0
- package/dist/config/resolve.js +120 -248
- package/dist/config/validate.js +103 -1100
- package/dist/constant.js +135 -0
- package/dist/graphql/index.generated.js +125 -0
- package/dist/graphql/index.js +49 -0
- package/dist/index.js +12 -800
- package/dist/magi.js +357 -0
- package/dist/permissions/common.json +22 -22
- package/dist/permissions/editor.json +12 -12
- package/dist/prompts/index.js +98 -0
- package/dist/prompts/merge/ci-classification/output-contract.md +22 -0
- package/dist/prompts/merge/ci-classification/task.md +10 -0
- package/dist/prompts/merge/ci-classification/validate.json +20 -0
- package/dist/prompts/merge/conflict/output-contract.md +12 -0
- package/dist/prompts/merge/conflict/task.md +9 -0
- package/dist/prompts/merge/conflict/validate.json +4 -0
- package/dist/prompts/merge/edit/output-contract.md +26 -0
- package/dist/prompts/merge/edit/task.md +10 -0
- package/dist/prompts/merge/edit/validate.json +60 -0
- package/dist/prompts/review/ci-classification/output-contract.md +21 -0
- package/dist/prompts/review/ci-classification/task.md +7 -0
- package/dist/prompts/review/ci-classification/validate.json +20 -0
- package/dist/prompts/review/close-reconsideration/output-contract.md +21 -0
- package/dist/prompts/review/close-reconsideration/task.md +6 -0
- package/dist/prompts/review/close-reconsideration/validate.json +44 -0
- package/dist/prompts/review/comment/output-contract.md +11 -0
- package/dist/prompts/review/comment/task.md +3 -0
- package/dist/prompts/review/comment/validate.json +8 -0
- package/dist/prompts/review/finding-validation/output-contract.md +25 -0
- package/dist/prompts/{templates/review/finding-validation.md → review/finding-validation/task.md} +2 -3
- package/dist/prompts/review/finding-validation/validate.json +21 -0
- package/dist/prompts/review/rereview/output-contract.md +30 -0
- package/dist/prompts/{templates/review/rereview.md → review/rereview/task.md} +8 -11
- package/dist/prompts/review/rereview/validate.json +87 -0
- package/dist/prompts/review/review/output-contract.md +25 -0
- package/dist/prompts/{templates/review/review.md → review/review/task.md} +2 -5
- package/dist/prompts/review/review/validate.json +54 -0
- package/dist/prompts/triage/acceptance/output-contract.md +16 -0
- package/dist/prompts/triage/acceptance/validate.json +23 -0
- package/dist/prompts/triage/category/output-contract.md +16 -0
- package/dist/prompts/triage/category/validate.json +23 -0
- package/dist/prompts/triage/comment-classification/output-contract.md +15 -0
- package/dist/prompts/triage/comment-classification/validate.json +28 -0
- package/dist/prompts/triage/create/output-contract.md +28 -0
- package/dist/prompts/triage/create/validate.json +73 -0
- package/dist/prompts/triage/deplicate/output-contract.md +16 -0
- package/dist/prompts/triage/deplicate/validate.json +20 -0
- package/dist/prompts/triage/existing/output-contract.md +16 -0
- package/dist/prompts/triage/existing/validate.json +13 -0
- package/dist/prompts/triage/reconsider/output-contract.md +16 -0
- package/dist/prompts/triage/reconsider/validate.json +23 -0
- package/dist/prompts/triage/signal/output-contract.md +19 -0
- package/dist/prompts/triage/signal/validate.json +18 -0
- package/dist/tools/clear/index.js +21 -0
- package/dist/tools/index.js +12 -0
- package/dist/tools/merge/action.js +47 -0
- package/dist/tools/merge/context.js +118 -0
- package/dist/tools/merge/editor.js +264 -0
- package/dist/tools/merge/index.js +151 -0
- package/dist/tools/merge/index.type.js +1 -0
- package/dist/tools/merge/merge.js +42 -0
- package/dist/tools/merge/report.js +73 -0
- package/dist/tools/review/action.js +429 -0
- package/dist/tools/review/check.js +295 -0
- package/dist/tools/review/context.js +258 -0
- package/dist/tools/review/index.js +104 -0
- package/dist/tools/review/index.type.js +1 -0
- package/dist/tools/review/report.js +143 -0
- package/dist/tools/review/review.js +145 -0
- package/dist/tools/review/reviewer.js +409 -0
- package/dist/tools/triage/index.js +16 -0
- package/dist/tools/validate/index.js +28 -0
- package/dist/utils/array.js +6 -0
- package/dist/utils/assertion.js +38 -0
- package/dist/utils/exec.js +14 -0
- package/dist/utils/fs.js +24 -0
- package/dist/utils/function.js +37 -0
- package/dist/utils/github.js +63 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.type.js +1 -0
- package/dist/utils/object.js +21 -0
- package/dist/utils/opencode.js +25 -0
- package/dist/utils/string.js +38 -0
- package/dist/utils/worker.js +30 -0
- package/package.json +20 -8
- package/schema.json +9 -7
- package/dist/config/load.js +0 -62
- package/dist/config/output.js +0 -25
- package/dist/config/worktree.js +0 -25
- package/dist/github/commands.js +0 -905
- package/dist/github/retry.js +0 -44
- package/dist/orchestrator/abort.js +0 -9
- package/dist/orchestrator/ci.js +0 -579
- package/dist/orchestrator/findings.js +0 -88
- package/dist/orchestrator/inline-comments.js +0 -73
- package/dist/orchestrator/majority.js +0 -62
- package/dist/orchestrator/merge.js +0 -1260
- package/dist/orchestrator/model.js +0 -216
- package/dist/orchestrator/pool.js +0 -15
- package/dist/orchestrator/report.js +0 -175
- package/dist/orchestrator/review-context.js +0 -342
- package/dist/orchestrator/review.js +0 -1478
- package/dist/orchestrator/run-manager.js +0 -2132
- package/dist/orchestrator/safety.js +0 -44
- package/dist/orchestrator/triage.js +0 -1370
- package/dist/prompts/compose.js +0 -473
- package/dist/prompts/contracts.js +0 -300
- package/dist/prompts/output.js +0 -401
- package/dist/prompts/templates/merge/ci-classification.md +0 -16
- package/dist/prompts/templates/merge/conflict.md +0 -10
- package/dist/prompts/templates/merge/edit.md +0 -15
- package/dist/prompts/templates/review/ci-classification.md +0 -9
- package/dist/prompts/templates/review/close-reconsideration.md +0 -6
- /package/dist/{types.js → config/index.type.js} +0 -0
- /package/dist/prompts/{templates/triage/acceptance.md → triage/acceptance/task.md} +0 -0
- /package/dist/prompts/{templates/triage/category.md → triage/category/task.md} +0 -0
- /package/dist/prompts/{templates/triage/comment-classification.md → triage/comment-classification/task.md} +0 -0
- /package/dist/prompts/{templates/triage/create.md → triage/create/task.md} +0 -0
- /package/dist/prompts/{templates/triage/duplicate.md → triage/deplicate/task.md} +0 -0
- /package/dist/prompts/{templates/triage/existing-pr.md → triage/existing/task.md} +0 -0
- /package/dist/prompts/{templates/triage/reconsider.md → triage/reconsider/task.md} +0 -0
- /package/dist/prompts/{templates/triage/signal.md → triage/signal/task.md} +0 -0
package/README.ja.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<p align='center'>
|
|
2
|
+
<a href='./README.md'>English</a> | 日本語
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# OpenCode Magi
|
|
6
|
+
|
|
7
|
+
OpenCodeのマルチエージェントによるGitHubプルリクエストレビューとマージのオーケストレーション。
|
|
8
|
+
|
|
9
|
+
## なぜ、Magiなのか?
|
|
10
|
+
|
|
11
|
+
Magiは、三賢者に着想を得ています。独立した視点が集まり、共に意思決定する仕組みです。
|
|
12
|
+
|
|
13
|
+
1つのAIモデルだけを盲目的に信頼するには、まだ十分ではありません。OpenCode Magiは、複数のモデルに同じプルリクエストを異なる視点から検査させ、過半数を必須にすることで信頼性を高めます。
|
|
14
|
+
|
|
15
|
+
一つのAIの回答を最終判断として扱うことせず、多様な観点、明示的な意見の不一致、そして合意に裏付けられた最終判断によって、AIレビューを実際のチームに近づけることです。
|
|
16
|
+
|
|
17
|
+
## 機能
|
|
18
|
+
|
|
19
|
+
OpenCode Magiは、人間がGitHub上で行っているレビューサイクルを再現します。複数のレビュアーがプルリクエストを確認し、変更を要求し、修正を検証し、スレッドを解決し、準備ができたら承認します。
|
|
20
|
+
|
|
21
|
+
- 3人以上のレビュアーによる、多数決制のマルチエージェントレビュー。
|
|
22
|
+
- 変更リクエストを投稿する前に多数決を行い、過半数に承認された指摘だけをリクエストします。
|
|
23
|
+
- デフォルトのシングルモードに加え、複数のGitHubアカウントを使用するマルチモードも用意しています。マルチモードでは、まるでチームでレビューを行っているかのように、各レビュアーが異なるGitHubアカウントでレビューを行うことができます。
|
|
24
|
+
- 編集やスレッドの返信があるPRの再レビューに対応。修正済みのスレッドを解決し、修正に応じてレビュアーは承認し、まだ修正が必要な指摘は追加のコメントとして投稿します。
|
|
25
|
+
- 任意のマージおよびクローズ自動化。エディターエージェントが作者の代わりに応答し、変更リクエストされた指摘を修正し、必要に応じてコミットをプッシュし、PRがマージ、またはクローズできるまでレビュアーとエディターのサイクルを繰り返します。
|
|
26
|
+
- レビュアーやエディターごとに権限の割り振り、フェーズごとのプロンプト、ペルソナを設定できます。
|
|
27
|
+
|
|
28
|
+
## クイックスタート
|
|
29
|
+
|
|
30
|
+
### インストール
|
|
31
|
+
|
|
32
|
+
`opencode.json`にプラグインを追加します。
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"$schema": "https://opencode.ai/config.json",
|
|
37
|
+
"plugin": ["opencode-magi"]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
OpenCodeを再起動します。これで完了です。
|
|
42
|
+
|
|
43
|
+
### 設定
|
|
44
|
+
|
|
45
|
+
グローバルのデフォルトは `~/.config/opencode/magi.json`に、プロジェクトごとの上書きは、`<project>/.opencode/magi.json`に設定します。
|
|
46
|
+
|
|
47
|
+
Magiの設定ファイルは、OpenCodeではなくOpenCode Magiによってマージされます。プロジェクトの設定ファイルは、グローバルの設定ファイルをオーバーライドします。
|
|
48
|
+
|
|
49
|
+
1. `~/.config/opencode/magi.json`
|
|
50
|
+
2. `<project>/.opencode/magi.json`
|
|
51
|
+
|
|
52
|
+
#### グローバル設定を作成する
|
|
53
|
+
|
|
54
|
+
プロジェクト設定に値が存在する場合、グローバル設定値を設定する必要はありません。ただし、複数のプロジェクトで共通の値を適用したい場合は、グローバル設定が便利です。
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mkdir -p ~/.config/opencode
|
|
58
|
+
touch ~/.config/opencode/magi.json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
設定ファイルに次の内容を追加します。
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"$schema": "https://raw.githubusercontent.com/magi-ai/opencode-magi/main/schema.json",
|
|
66
|
+
"account": "your-account",
|
|
67
|
+
"agents": {
|
|
68
|
+
"refs": {
|
|
69
|
+
"account-1": {
|
|
70
|
+
"model": "openai/gpt-5.5"
|
|
71
|
+
},
|
|
72
|
+
"account-2": {
|
|
73
|
+
"model": "anthropic/claude-opus-4-7"
|
|
74
|
+
},
|
|
75
|
+
"account-3": {
|
|
76
|
+
"model": "opencode/kimi-k2-6"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"review": {
|
|
81
|
+
"reviewers": [
|
|
82
|
+
{
|
|
83
|
+
"ref": "account-1"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"ref": "account-2"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"ref": "account-3"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
デフォルトでは、シングルモード(`mode: "single"`)です。複数のアカウントを使用するマルチモードにする場合は、`mode: "multi"`を設定し、各エージェントごとにアカウントを設定します。
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mode": "multi",
|
|
101
|
+
"review": {
|
|
102
|
+
"reviewers": [
|
|
103
|
+
{
|
|
104
|
+
"id": "general",
|
|
105
|
+
"model": "openai/gpt-5.5",
|
|
106
|
+
"account": "account-1"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "security",
|
|
110
|
+
"model": "anthropic/claude-opus-4-7",
|
|
111
|
+
"account": "account-2"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "compat",
|
|
115
|
+
"model": "opencode/kimi-k2-6",
|
|
116
|
+
"account": "account-3"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### プロジェクト設定を作成する
|
|
124
|
+
|
|
125
|
+
Magiの設定ファイルは少なくとも1つ必要です。プロジェクト固有の設定には、プロジェクト設定を使用します。
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cd <project>
|
|
129
|
+
mkdir -p .opencode
|
|
130
|
+
touch .opencode/magi.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
設定ファイルに次の内容を追加します。
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"$schema": "https://raw.githubusercontent.com/magi-ai/opencode-magi/main/schema.json",
|
|
138
|
+
"account": "your-account",
|
|
139
|
+
"github": {
|
|
140
|
+
"owner": "your-owner",
|
|
141
|
+
"repo": "your-repo"
|
|
142
|
+
},
|
|
143
|
+
"agents": {
|
|
144
|
+
"refs": {
|
|
145
|
+
"account-1": {
|
|
146
|
+
"model": "openai/gpt-5.5"
|
|
147
|
+
},
|
|
148
|
+
"account-2": {
|
|
149
|
+
"model": "anthropic/claude-opus-4-7"
|
|
150
|
+
},
|
|
151
|
+
"account-3": {
|
|
152
|
+
"model": "opencode/kimi-k2-6"
|
|
153
|
+
},
|
|
154
|
+
"account-4": {
|
|
155
|
+
"model": "openai/gpt-5.5",
|
|
156
|
+
"author": {
|
|
157
|
+
"name": "account-4",
|
|
158
|
+
"email": "your-email@example.com"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"review": {
|
|
164
|
+
"reviewers": [
|
|
165
|
+
{
|
|
166
|
+
"ref": "account-1"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"ref": "account-2"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"ref": "account-3"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
"merge": {
|
|
177
|
+
"editor": {
|
|
178
|
+
"ref": "account-4"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"triage": {
|
|
182
|
+
"voters": [
|
|
183
|
+
{
|
|
184
|
+
"ref": "account-1"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"ref": "account-2"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"ref": "account-3"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`agents.refs`のキーを`ref`に設定すると、そのエージェントの設定が展開されます。`ref`以外でフィールドを設定した場合は、そのエージェントの設定をオーバーライドします。
|
|
198
|
+
|
|
199
|
+
`model`には、文字列(`provider/model`)、`id`と`variant`のオブジェクト、または配列を指定できます。配列は、先頭から順々に利用可能なモデルかどうかを検証し、利用可能なモデルが見つかったら、そのモデルを採用します。
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"model": {
|
|
204
|
+
"id": "openai/gpt-5.1",
|
|
205
|
+
"variant": "high"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"model": [
|
|
213
|
+
{
|
|
214
|
+
"id": "anthropic/claude-opus-4-7",
|
|
215
|
+
"variant": "high"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "openai/gpt-5.5",
|
|
219
|
+
"variant": "medium"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### 設定を検証する
|
|
226
|
+
|
|
227
|
+
グローバル設定またはプロジェクト設定を作成または更新した後、検証します。
|
|
228
|
+
|
|
229
|
+
```txt
|
|
230
|
+
/magi:validate
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### コマンド
|
|
234
|
+
|
|
235
|
+
OpenCodeからコマンドを実行します。
|
|
236
|
+
|
|
237
|
+
```txt
|
|
238
|
+
/magi:review 123 124
|
|
239
|
+
/magi:review 123 --dry-run
|
|
240
|
+
/magi:merge 123
|
|
241
|
+
/magi:merge 123 --dry-run
|
|
242
|
+
/magi:triage 47 48
|
|
243
|
+
/magi:triage 47 --dry-run
|
|
244
|
+
/magi:clear
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## ドキュメント
|
|
248
|
+
|
|
249
|
+
- [コマンド](docs/commands/index.ja.md)
|
|
250
|
+
- [設定](docs/config.ja.md)
|
|
251
|
+
|
|
252
|
+
## コントリビュート
|
|
253
|
+
|
|
254
|
+
貢献してみませんか?素晴らしいです!貢献を支援するための [コントリビューションガイド](CONTRIBUTING.ja.md) を用意しています。
|
package/README.md
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
+
<p align='center'>
|
|
2
|
+
English | <a href='./README.ja.md'>日本語</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# OpenCode Magi
|
|
2
6
|
|
|
3
7
|
Multi-agent GitHub pull request review and merge orchestration for OpenCode.
|
|
4
8
|
|
|
5
9
|
## Why Magi?
|
|
6
10
|
|
|
7
|
-
Magi is inspired by the three wise men: independent perspectives that
|
|
11
|
+
Magi is inspired by the three wise men: independent perspectives that gather and make decisions together.
|
|
8
12
|
|
|
9
|
-
One AI model is still not enough to trust blindly. OpenCode Magi improves confidence by asking multiple models to inspect the same pull request from different perspectives, then requiring
|
|
13
|
+
One AI model is still not enough to trust blindly. OpenCode Magi improves confidence by asking multiple models to inspect the same pull request from different perspectives, then requiring a majority decision.
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
Instead of treating one AI answer as the final judgment, the goal is to make AI review closer to a real team through diverse viewpoints, explicit disagreement, and final decisions backed by consensus.
|
|
12
16
|
|
|
13
17
|
## Features
|
|
14
18
|
|
|
15
|
-
OpenCode Magi recreates the review cycle humans already run on GitHub
|
|
19
|
+
OpenCode Magi recreates the review cycle humans already run on GitHub. Multiple reviewers inspect a pull request, request changes, verify fixes, resolve threads, and approve when the work is ready.
|
|
16
20
|
|
|
17
|
-
- Multi-agent reviews with
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- Per-agent OpenCode permissions for reviewer, CI classifier, and editor child sessions.
|
|
24
|
-
- Prompt customization that adds repository-specific guidance without replacing the fixed output contracts.
|
|
21
|
+
- Multi-agent reviews with majority voting by 3 or more reviewers.
|
|
22
|
+
- Majority voting before posting change requests, so only findings accepted by the majority are requested.
|
|
23
|
+
- Single mode by default, plus multi mode for using multiple GitHub accounts. In multi mode, each reviewer can review from a different GitHub account, as if a team were reviewing together.
|
|
24
|
+
- Re-review support for PRs with edits or thread replies. Fixed threads are resolved, reviewers approve based on fixes, and findings that still need changes are posted as additional comments.
|
|
25
|
+
- Optional merge and close automation. An editor agent responds on behalf of the author, fixes requested findings, pushes commits when needed, and repeats the reviewer/editor cycle until the PR can be merged or closed.
|
|
26
|
+
- Configure permissions, phase-specific prompts, and personas for each reviewer and editor.
|
|
25
27
|
|
|
26
28
|
## Quick Start
|
|
27
29
|
|
|
@@ -42,7 +44,7 @@ Restart OpenCode. Done.
|
|
|
42
44
|
|
|
43
45
|
Configure global defaults in `~/.config/opencode/magi.json` and project overrides in `<project>/.opencode/magi.json`.
|
|
44
46
|
|
|
45
|
-
Magi config files are merged by OpenCode Magi, not by OpenCode.
|
|
47
|
+
Magi config files are merged by OpenCode Magi, not by OpenCode. The project config file overrides the global config file.
|
|
46
48
|
|
|
47
49
|
1. `~/.config/opencode/magi.json`
|
|
48
50
|
2. `<project>/.opencode/magi.json`
|
|
@@ -61,6 +63,7 @@ Add the following content to the configuration file.
|
|
|
61
63
|
```json
|
|
62
64
|
{
|
|
63
65
|
"$schema": "https://raw.githubusercontent.com/magi-ai/opencode-magi/main/schema.json",
|
|
66
|
+
"account": "your-account",
|
|
64
67
|
"agents": {
|
|
65
68
|
"refs": {
|
|
66
69
|
"account-1": {
|
|
@@ -75,7 +78,6 @@ Add the following content to the configuration file.
|
|
|
75
78
|
}
|
|
76
79
|
},
|
|
77
80
|
"review": {
|
|
78
|
-
"account": "your-account",
|
|
79
81
|
"reviewers": [
|
|
80
82
|
{ "ref": "account-1" },
|
|
81
83
|
{ "ref": "account-2" },
|
|
@@ -85,14 +87,12 @@ Add the following content to the configuration file.
|
|
|
85
87
|
}
|
|
86
88
|
```
|
|
87
89
|
|
|
88
|
-
By default, `
|
|
89
|
-
|
|
90
|
-
For team setups that need separate GitHub review identities, set `review.mode: "multi"` and configure a unique account for each reviewer.
|
|
90
|
+
By default, Magi uses single mode (`mode: "single"`). To use multi mode with multiple accounts, set `mode: "multi"` and configure an account for each reviewer.
|
|
91
91
|
|
|
92
92
|
```json
|
|
93
93
|
{
|
|
94
|
+
"mode": "multi",
|
|
94
95
|
"review": {
|
|
95
|
-
"mode": "multi",
|
|
96
96
|
"reviewers": [
|
|
97
97
|
{ "id": "general", "model": "openai/gpt-5.5", "account": "account-1" },
|
|
98
98
|
{
|
|
@@ -108,7 +108,7 @@ For team setups that need separate GitHub review identities, set `review.mode: "
|
|
|
108
108
|
|
|
109
109
|
#### Set project config
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
At least one Magi config file is required. Use project config for project-specific settings.
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
114
|
cd <project>
|
|
@@ -121,6 +121,7 @@ Add the following content to the configuration file.
|
|
|
121
121
|
```json
|
|
122
122
|
{
|
|
123
123
|
"$schema": "https://raw.githubusercontent.com/magi-ai/opencode-magi/main/schema.json",
|
|
124
|
+
"account": "your-account",
|
|
124
125
|
"github": {
|
|
125
126
|
"owner": "your-owner",
|
|
126
127
|
"repo": "your-repo"
|
|
@@ -128,20 +129,16 @@ Add the following content to the configuration file.
|
|
|
128
129
|
"agents": {
|
|
129
130
|
"refs": {
|
|
130
131
|
"account-1": {
|
|
131
|
-
"model": "openai/gpt-5.5"
|
|
132
|
-
"account": "account-1"
|
|
132
|
+
"model": "openai/gpt-5.5"
|
|
133
133
|
},
|
|
134
134
|
"account-2": {
|
|
135
|
-
"model": "anthropic/claude-opus-4-7"
|
|
136
|
-
"account": "account-2"
|
|
135
|
+
"model": "anthropic/claude-opus-4-7"
|
|
137
136
|
},
|
|
138
137
|
"account-3": {
|
|
139
|
-
"model": "opencode/kimi-k2-6"
|
|
140
|
-
"account": "account-3"
|
|
138
|
+
"model": "opencode/kimi-k2-6"
|
|
141
139
|
},
|
|
142
140
|
"account-4": {
|
|
143
141
|
"model": "openai/gpt-5.5",
|
|
144
|
-
"account": "account-4",
|
|
145
142
|
"author": {
|
|
146
143
|
"name": "account-4",
|
|
147
144
|
"email": "your-email@example.com"
|
|
@@ -169,20 +166,27 @@ Add the following content to the configuration file.
|
|
|
169
166
|
}
|
|
170
167
|
```
|
|
171
168
|
|
|
172
|
-
|
|
169
|
+
Set an `agents.refs` key as `ref` to expand that agent's configuration. Fields set outside `ref` override that agent's configuration.
|
|
173
170
|
|
|
174
|
-
`model` can be a
|
|
171
|
+
`model` can be a string (`provider/model`), an object with `id` and `variant`, or an array. Arrays are checked in order to find an available model, and the first available model is selected.
|
|
175
172
|
|
|
176
173
|
```json
|
|
177
174
|
{
|
|
178
175
|
"model": {
|
|
179
176
|
"id": "openai/gpt-5.1",
|
|
180
|
-
"
|
|
177
|
+
"variant": "high"
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
180
|
```
|
|
184
181
|
|
|
185
|
-
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"model": [
|
|
185
|
+
{ "id": "anthropic/claude-opus-4-7", "variant": "high" },
|
|
186
|
+
{ "id": "openai/gpt-5.5", "variant": "medium" }
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
```
|
|
186
190
|
|
|
187
191
|
#### Validate config
|
|
188
192
|
|
|
@@ -198,11 +202,11 @@ Run commands from OpenCode.
|
|
|
198
202
|
|
|
199
203
|
```txt
|
|
200
204
|
/magi:review 123 124
|
|
201
|
-
/magi:review --dry-run
|
|
205
|
+
/magi:review 123 --dry-run
|
|
202
206
|
/magi:merge 123
|
|
203
|
-
/magi:merge --dry-run
|
|
207
|
+
/magi:merge 123 --dry-run
|
|
204
208
|
/magi:triage 47 48
|
|
205
|
-
/magi:triage --dry-run
|
|
209
|
+
/magi:triage 47 --dry-run
|
|
206
210
|
/magi:clear
|
|
207
211
|
```
|
|
208
212
|
|
|
@@ -210,7 +214,6 @@ Run commands from OpenCode.
|
|
|
210
214
|
|
|
211
215
|
- [Commands](docs/commands/index.md)
|
|
212
216
|
- [Config](docs/config.md)
|
|
213
|
-
- [Prompts](docs/prompts/index.md)
|
|
214
217
|
|
|
215
218
|
## Contributing
|
|
216
219
|
|
package/dist/commands.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const commands = {
|
|
2
2
|
"magi:clear": {
|
|
3
|
-
description:
|
|
3
|
+
description: [
|
|
4
|
+
"Clear inactive Magi runs, sessions, worktrees, and outputs",
|
|
5
|
+
].join("\n"),
|
|
4
6
|
template: "Call the `magi_clear` tool.",
|
|
5
7
|
},
|
|
6
8
|
"magi:merge": {
|
|
7
9
|
description: "Review and merge pull requests with Magi",
|
|
8
|
-
template: [
|
|
9
|
-
},
|
|
10
|
-
"magi:triage": {
|
|
11
|
-
description: "Triage GitHub issues with Magi",
|
|
12
|
-
template: [`Call the \`magi_triage\` tool.`, "Issue: $ARGUMENTS"].join("\n"),
|
|
10
|
+
template: ["Call the `magi_merge` tool.", "PR: $ARGUMENTS"].join("\n"),
|
|
13
11
|
},
|
|
14
12
|
"magi:review": {
|
|
15
13
|
description: "Review pull requests with Magi",
|
|
16
|
-
template: [
|
|
14
|
+
template: ["Call the `magi_review` tool.", "PR: $ARGUMENTS"].join("\n"),
|
|
15
|
+
},
|
|
16
|
+
"magi:triage": {
|
|
17
|
+
description: "Triage issues with Magi",
|
|
18
|
+
template: ["Call the `magi_triage` tool.", "Issue: $ARGUMENTS"].join("\n"),
|
|
17
19
|
},
|
|
18
20
|
"magi:validate": {
|
|
19
21
|
description: "Validate Magi config",
|
|
20
|
-
template: "Call the `magi_validate` tool.",
|
|
22
|
+
template: ["Call the `magi_validate` tool."].join("\n"),
|
|
21
23
|
},
|
|
22
24
|
};
|