@boyingliu01/xp-gate 0.8.21 → 0.9.1
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/lib/__tests__/check-version.test.js +4 -4
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/admin-template-guidelines/SKILL.md +6 -797
- package/plugins/claude-code/skills/admin-template-guidelines/references/rule-1.md +91 -0
- package/plugins/claude-code/skills/admin-template-guidelines/references/rule-2.md +155 -0
- package/plugins/claude-code/skills/admin-template-guidelines/references/rule-3.md +70 -0
- package/plugins/claude-code/skills/admin-template-guidelines/references/rule-4.md +154 -0
- package/plugins/claude-code/skills/admin-template-guidelines/references/rule-5.md +126 -0
- package/plugins/claude-code/skills/admin-template-guidelines/references/rule-6.md +180 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/delphi-review/SKILL.md +59 -361
- package/plugins/claude-code/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
- package/plugins/claude-code/skills/delphi-review/references/round-templates.md +67 -0
- package/plugins/claude-code/skills/ralph-loop/SKILL.md +87 -428
- package/plugins/claude-code/skills/ralph-loop/references/components.md +113 -0
- package/plugins/claude-code/skills/ralph-loop/references/workflow-details.md +99 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +34 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +97 -599
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/admin-template-guidelines/SKILL.md +6 -797
- package/plugins/opencode/skills/admin-template-guidelines/references/rule-1.md +91 -0
- package/plugins/opencode/skills/admin-template-guidelines/references/rule-2.md +155 -0
- package/plugins/opencode/skills/admin-template-guidelines/references/rule-3.md +70 -0
- package/plugins/opencode/skills/admin-template-guidelines/references/rule-4.md +154 -0
- package/plugins/opencode/skills/admin-template-guidelines/references/rule-5.md +126 -0
- package/plugins/opencode/skills/admin-template-guidelines/references/rule-6.md +180 -0
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/delphi-review/SKILL.md +59 -361
- package/plugins/opencode/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
- package/plugins/opencode/skills/delphi-review/references/round-templates.md +67 -0
- package/plugins/opencode/skills/ralph-loop/SKILL.md +87 -428
- package/plugins/opencode/skills/ralph-loop/references/components.md +113 -0
- package/plugins/opencode/skills/ralph-loop/references/workflow-details.md +99 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +34 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/SKILL.md +97 -599
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/skills/admin-template-guidelines/SKILL.md +6 -797
- package/skills/admin-template-guidelines/references/rule-1.md +91 -0
- package/skills/admin-template-guidelines/references/rule-2.md +155 -0
- package/skills/admin-template-guidelines/references/rule-3.md +70 -0
- package/skills/admin-template-guidelines/references/rule-4.md +154 -0
- package/skills/admin-template-guidelines/references/rule-5.md +126 -0
- package/skills/admin-template-guidelines/references/rule-6.md +180 -0
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/delphi-review/SKILL.md +59 -361
- package/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
- package/skills/delphi-review/references/round-templates.md +67 -0
- package/skills/ralph-loop/SKILL.md +87 -428
- package/skills/ralph-loop/references/components.md +113 -0
- package/skills/ralph-loop/references/workflow-details.md +99 -0
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/sprint-flow/references/phase-2-build.md +34 -0
- package/skills/test-specification-alignment/AGENTS.md +3 -3
- package/skills/test-specification-alignment/SKILL.md +97 -599
- package/plugins/claude-code/skills/ralph-loop/references/components/memory.md +0 -55
- package/plugins/claude-code/skills/ralph-loop/references/components/middleware.md +0 -54
- package/plugins/claude-code/skills/ralph-loop/references/components/skill-invocations.md +0 -39
- package/plugins/claude-code/skills/ralph-loop/references/components/system-prompt.md +0 -24
- package/plugins/claude-code/skills/ralph-loop/references/components/tool-descriptions.md +0 -32
- package/plugins/opencode/skills/ralph-loop/references/components/memory.md +0 -55
- package/plugins/opencode/skills/ralph-loop/references/components/middleware.md +0 -54
- package/plugins/opencode/skills/ralph-loop/references/components/skill-invocations.md +0 -39
- package/plugins/opencode/skills/ralph-loop/references/components/system-prompt.md +0 -24
- package/plugins/opencode/skills/ralph-loop/references/components/tool-descriptions.md +0 -32
- package/skills/ralph-loop/references/components/memory.md +0 -55
- package/skills/ralph-loop/references/components/middleware.md +0 -54
- package/skills/ralph-loop/references/components/skill-invocations.md +0 -39
- package/skills/ralph-loop/references/components/system-prompt.md +0 -24
- package/skills/ralph-loop/references/components/tool-descriptions.md +0 -32
|
@@ -22,22 +22,14 @@ description: "Use when asked to review a design, plan, or architecture; before i
|
|
|
22
22
|
|
|
23
23
|
**Delphi 方法只有一个目的:得到所有专家一致认可的可行方案。**
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
1. **匿名性** — Round 1 专家互不知道对方意见
|
|
28
|
-
2. **迭代** — 多轮直到共识,不是固定轮数
|
|
29
|
-
3. **受控反馈** — 每轮看到其他专家意见
|
|
30
|
-
4. **统计共识** — >=90% 一致才算共识
|
|
31
|
-
|
|
32
|
-
### 质量优先
|
|
33
|
-
|
|
34
|
-
| 原则 | 说明 |
|
|
25
|
+
| 特性 | 说明 |
|
|
35
26
|
|------|------|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
| **匿名性** | Round 1 专家互不知道对方意见 |
|
|
28
|
+
| **迭代** | 多轮直到共识,不是固定轮数 |
|
|
29
|
+
| **受控反馈** | 每轮看到其他专家意见 |
|
|
30
|
+
| **统计共识** | >=90% 一致才算共识 |
|
|
31
|
+
| **Token 是投资** | 相比后期修复成本,评审消耗微不足道 |
|
|
32
|
+
| **零容忍** | Critical/Major 全部必须处理,不可跳过 |
|
|
41
33
|
|
|
42
34
|
---
|
|
43
35
|
|
|
@@ -46,50 +38,37 @@ description: "Use when asked to review a design, plan, or architecture; before i
|
|
|
46
38
|
| 模式 | 触发 | 用途 | 输出 |
|
|
47
39
|
|------|------|------|------|
|
|
48
40
|
| `design`(默认) | `/delphi-review` | 需求/设计/架构/PR 评审 | 共识报告 + specification.yaml |
|
|
49
|
-
| `code-walkthrough` |
|
|
41
|
+
| `code-walkthrough` | `--mode code-walkthrough` | git push 前代码走查 | `.code-walkthrough-result.json` |
|
|
50
42
|
|
|
51
|
-
**Code Walkthrough
|
|
43
|
+
**Code Walkthrough 模式**的完整规范 → 详见 `references/code-walkthrough.md`
|
|
52
44
|
|
|
53
45
|
---
|
|
54
46
|
|
|
55
47
|
## 参数配置
|
|
56
48
|
|
|
57
|
-
###
|
|
49
|
+
### 专家配置
|
|
58
50
|
|
|
59
51
|
| 配置 | 专家 | 适用场景 |
|
|
60
52
|
|------|------|---------|
|
|
61
53
|
| 2 专家(默认) | A(架构) + B(实现) | 代码变更、小型设计 |
|
|
62
|
-
| 3 专家 | A(架构) + B(实现) + C(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
> **专家分配建议**:
|
|
81
|
-
>
|
|
82
|
-
> | Expert | 推荐模型 | 备选 |
|
|
83
|
-
> |--------|---------|------|
|
|
84
|
-
> | Expert A (架构) | `deepseek-v4-pro` | `qwen3.6-plus`, `glm-5.1` |
|
|
85
|
-
> | Expert B (技术) | `kimi-k2.6` | `deepseek-v4-pro`, `minimax-m2.7` |
|
|
86
|
-
> | Expert C (可行性) | `qwen3.6-plus` | `kimi-k2.6`, `glm-5.1` |
|
|
87
|
-
>
|
|
88
|
-
> **关键原则**:
|
|
89
|
-
> - ✅ 三个专家必须来自 **至少 2 家不同厂家**(如 DeepSeek + Kimi + Qwen)
|
|
90
|
-
> - ❌ 禁止使用 Anthropic、OpenAI、Google 等国外模型
|
|
91
|
-
> - ❌ 禁止三个专家全部使用同一厂家模型
|
|
92
|
-
> - ⚠️ 成本控制:`deepseek-v4-lite`、`kimi-k2.5`、`qwen3.5-plus` 作为轻量备选
|
|
54
|
+
| 3 专家 | A(架构) + B(实现) + C(可行性) | 架构决策、需求文档 |
|
|
55
|
+
|
|
56
|
+
### 模型选择策略(强制)
|
|
57
|
+
|
|
58
|
+
**MUST 使用国产开源模型**,**严禁** Anthropic/GPT/Gemini 等国外模型。
|
|
59
|
+
|
|
60
|
+
| 厂家 | 可用模型 |
|
|
61
|
+
|------|---------|
|
|
62
|
+
| 深度求索 DeepSeek | `deepseek-v4-pro`, `deepseek-v4-lite` |
|
|
63
|
+
| 月之暗面 Kimi | `kimi-k2.6`, `kimi-k2.5` |
|
|
64
|
+
| 阿里 Qwen | `qwen3.6-plus`, `qwen3.5-plus` |
|
|
65
|
+
| 智谱 GLM | `glm-5.1`, `glm-5.0` |
|
|
66
|
+
| MiniMax | `minimax-m2.7`, `minimax-m2.5` |
|
|
67
|
+
|
|
68
|
+
**关键原则**:
|
|
69
|
+
- ✅ 三个专家必须来自 **至少 2 家不同厂家**
|
|
70
|
+
- ❌ 禁止使用 Anthropic、OpenAI、Google 等国外模型
|
|
71
|
+
- ❌ 禁止三个专家全部使用同一厂家模型
|
|
93
72
|
|
|
94
73
|
### 共识阈值
|
|
95
74
|
|
|
@@ -100,7 +79,7 @@ description: "Use when asked to review a design, plan, or architecture; before i
|
|
|
100
79
|
|
|
101
80
|
---
|
|
102
81
|
|
|
103
|
-
##
|
|
82
|
+
## 评审执行过程
|
|
104
83
|
|
|
105
84
|
```
|
|
106
85
|
Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
@@ -124,143 +103,11 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
|
124
103
|
└─ REQUEST_CHANGES → 修复方案 → 回到 Round 2 重新评审
|
|
125
104
|
```
|
|
126
105
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
## Round 1: 匿名独立评审
|
|
130
|
-
|
|
131
|
-
### 为什么必须匿名
|
|
132
|
-
|
|
133
|
-
匿名防止 anchoring bias(锚定偏差)—— 知道其他专家意见后倾向于同意"权威",不敢提出相反观点。
|
|
134
|
-
|
|
135
|
-
### 执行方式
|
|
136
|
-
|
|
137
|
-
每位专家独立收到:原始文档 + 评审模板 + "独立评审,不知道其他专家意见"。
|
|
138
|
-
|
|
139
|
-
### 输出格式
|
|
140
|
-
|
|
141
|
-
```markdown
|
|
142
|
-
## 独立评审 - Expert [A/B/C]
|
|
143
|
-
### 优点
|
|
144
|
-
1. [具体优点 + 文档位置]
|
|
145
|
-
### 问题清单
|
|
146
|
-
#### Critical Issues (必须修复才能批准)
|
|
147
|
-
1. [问题] - 位置: [...] - 修复建议: [...]
|
|
148
|
-
#### Major Concerns (必须处理)
|
|
149
|
-
1. [...]
|
|
150
|
-
#### Minor Concerns (需要说明)
|
|
151
|
-
1. [...]
|
|
152
|
-
### 裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
|
|
153
|
-
### 置信度: [X/10]
|
|
154
|
-
### 关键理由
|
|
155
|
-
1. [...]
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## Round 2: 交换意见
|
|
161
|
-
|
|
162
|
-
### 执行方式
|
|
163
|
-
|
|
164
|
-
每位专家看到:原始文档 + 其他专家的评审 + "响应其他专家的关切,是否调整立场?"
|
|
165
|
-
|
|
166
|
-
### 输出格式
|
|
167
|
-
|
|
168
|
-
```markdown
|
|
169
|
-
## Round 2 Response - Expert [A/B/C]
|
|
170
|
-
### 响应其他专家关切
|
|
171
|
-
**Expert [X] 提到: [问题]**
|
|
172
|
-
- 我的立场: [同意/部分同意/不同意] - 理由: [...]
|
|
173
|
-
### 更新后问题清单 / 裁决 / 置信度 / 立场变化说明
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## Round 3: 最终立场(如需要)
|
|
179
|
-
|
|
180
|
-
触发条件:Round 2 后仍无共识。所有专家提交最终绑定立场。3 专家模式下若仍无完全一致,2/3 或 3/3 多数裁决生效,记录少数派意见。
|
|
181
|
-
|
|
182
|
-
### 输出格式
|
|
183
|
-
|
|
184
|
-
```markdown
|
|
185
|
-
## Round 3 Final Position - Expert [A/B/C]
|
|
186
|
-
### 最终裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
|
|
187
|
-
### 最终置信度: [X/10]
|
|
188
|
-
### 关键理由 + 与其他专家的差异
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Orchestrator Dispatch Rules(#218 自动多轮调度)
|
|
194
|
-
|
|
195
|
-
### 背景
|
|
196
|
-
|
|
197
|
-
Delphi review 在 sprint-flow 中通过 subagent 调用时,Round 1→Round 2→Round 3 的调度**必须在 subagent 内部自动完成**,不能每轮暂停等待 orchestrator 或用户干预。只有在以下情况才需要 orchestrator 暂停:
|
|
198
|
-
|
|
199
|
-
### 自动调度规则
|
|
200
|
-
|
|
201
|
-
| 场景 | 自动处理 | 需暂停 |
|
|
202
|
-
|------|---------|--------|
|
|
203
|
-
| Round 1 完成,需 Round 2 | ✅ subagent 自动继续 | ❌ |
|
|
204
|
-
| Round 2 完成,需 Round 3 | ✅ subagent 自动继续 | ❌ |
|
|
205
|
-
| Round 3+ 完成,仍需更多轮 | ✅ subagent 自动继续,直到 max_rounds | ❌ |
|
|
206
|
-
| 最终 APPROVED (>=90%) | ✅ subagent 输出结果后退出 | ❌ |
|
|
207
|
-
| 最终 REQUEST_CHANGES(可自动修复) | ✅ subagent 尝试修复措辞、AC 缺失等常见问题后自动重评审 | ❌ |
|
|
208
|
-
| 最终 REQUEST_CHANGES(无法自动修复) | ✅ subagent 输出详细失败报告 | **✅ orchestrator 暂停等用户** |
|
|
209
|
-
| 超过 max_rounds (5) 仍无共识 | ✅ subagent 输出"未达成共识报告" | **✅ orchestrator 暂停等用户决策** |
|
|
210
|
-
|
|
211
|
-
### Subagent 内部 Round 循环
|
|
212
|
-
|
|
213
|
-
当 delphi-review 以 subagent 启动时(非交互式),应执行以下自动循环:
|
|
214
|
-
|
|
215
|
-
```python
|
|
216
|
-
round = 1
|
|
217
|
-
while round <= max_review_rounds:
|
|
218
|
-
# 执行当前 round(所有专家匿名/半匿名评审)
|
|
219
|
-
results = execute_round(round)
|
|
220
|
-
|
|
221
|
-
# 检查共识
|
|
222
|
-
consensus = check_consensus(results)
|
|
223
|
-
|
|
224
|
-
if consensus.verdict == "APPROVED" and consensus.ratio >= 0.9:
|
|
225
|
-
emit_verdict("APPROVED", consensus)
|
|
226
|
-
break
|
|
227
|
-
|
|
228
|
-
if round == max_review_rounds:
|
|
229
|
-
# 已达最大轮数仍无共识
|
|
230
|
-
emit_verdict("NO_CONSENSUS", consensus)
|
|
231
|
-
break
|
|
232
|
-
|
|
233
|
-
round += 1
|
|
234
|
-
|
|
235
|
-
if verdict == "REQUEST_CHANGES":
|
|
236
|
-
# 尝试自动修复常见问题
|
|
237
|
-
auto_fix_result = attempt_auto_fix(issues)
|
|
238
|
-
if auto_fix_result.success:
|
|
239
|
-
# 自动修复后,从 Round 2 起步重新评审
|
|
240
|
-
round = 2
|
|
241
|
-
continue # 重新进入循环
|
|
242
|
-
else:
|
|
243
|
-
# 无法自动修复,交给 orchestrator
|
|
244
|
-
emit_verdict("REQUEST_CHANGES", auto_fix_result.failed_issues)
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### 终止结果输出
|
|
248
|
-
|
|
249
|
-
当 subagent 因终态退出时,必须输出清晰的裁决:
|
|
250
|
-
|
|
251
|
-
- **APPROVED**: 共识报告 + specification.yaml
|
|
252
|
-
- **REQUEST_CHANGES(可自动修复)**: 自动修复后再次评审
|
|
253
|
-
- **REQUEST_CHANGES(不可自动修复)**: 失败报告 + 建议修复方向
|
|
254
|
-
- **NO_CONSENSUS**: 分歧详情报告
|
|
106
|
+
**Round 模板**(匿名评审/交换意见/最终立场/修复报告格式)→ 详见 `references/round-templates.md`
|
|
255
107
|
|
|
256
|
-
|
|
108
|
+
**Orchestrator 自动调度规则**(#218 subagent 内部自动多轮循环)→ 详见 `references/orchestrator-dispatch.md`
|
|
257
109
|
|
|
258
|
-
|
|
259
|
-
|------|--------------|------------------|
|
|
260
|
-
| APPROVED | `{verdict:"APPROVED", consensus_ratio: N, ...}` | 自动进入下一 Phase |
|
|
261
|
-
| REQUEST_CHANGES (auto-fixed) | `{verdict:"APPROVED", auto_fixed: ["..."]}` | 自动进入下一 Phase |
|
|
262
|
-
| REQUEST_CHANGES (unfixable) | `{verdict:"REQUEST_CHANGES", failed_issues: [...]}` | ⚠️ 暂停等用户修复后,通过 task_id 重新 dispatch |
|
|
263
|
-
| NO_CONSENSUS | `{verdict:"NO_CONSENSUS", disagreements: [...]}` | ⚠️ 暂停等用户决策(可继续/中止/强制通过) |
|
|
110
|
+
**Automatic re-review**: 对于常见可控问题(措辞模糊、AC 缺失、格式问题),subagent 应自行修复后自动重评审,无需等待用户。
|
|
264
111
|
|
|
265
112
|
---
|
|
266
113
|
|
|
@@ -271,15 +118,6 @@ if verdict == "REQUEST_CHANGES":
|
|
|
271
118
|
2. 重新评审(从 Round 2 起步,不是 Round 1)
|
|
272
119
|
3. 迭代直到 APPROVED
|
|
273
120
|
|
|
274
|
-
**Automatic re-review(#218)**: 当 delphi-review 以 subagent 运行时,对于常见的自动可控问题(措辞模糊、AC 缺失、格式问题等),subagent 应自行修复后自动重评审,无需等待用户。
|
|
275
|
-
|
|
276
|
-
修复报告格式:
|
|
277
|
-
```markdown
|
|
278
|
-
## 修复报告
|
|
279
|
-
### Critical Issues 修复 | ### Major Concerns 处理 | ### Minor Concerns 说明
|
|
280
|
-
### 请求重新评审
|
|
281
|
-
```
|
|
282
|
-
|
|
283
121
|
---
|
|
284
122
|
|
|
285
123
|
## 终止条件
|
|
@@ -291,91 +129,8 @@ if verdict == "REQUEST_CHANGES":
|
|
|
291
129
|
|
|
292
130
|
---
|
|
293
131
|
|
|
294
|
-
## Triggers
|
|
295
|
-
|
|
296
|
-
This skill activates on any request for multi-expert review. Common triggers:
|
|
297
|
-
|
|
298
|
-
**English:**
|
|
299
|
-
- "review this design"
|
|
300
|
-
- "design review"
|
|
301
|
-
- "architecture review"
|
|
302
|
-
- "consensus review"
|
|
303
|
-
- "code walkthrough"
|
|
304
|
-
- "push review"
|
|
305
|
-
- "multi-expert review"
|
|
306
|
-
- "PR review"
|
|
307
|
-
|
|
308
|
-
**Chinese:**
|
|
309
|
-
- "评审这个需求"
|
|
310
|
-
- "多专家评审"
|
|
311
|
-
- "设计评审"
|
|
312
|
-
- "架构评审"
|
|
313
|
-
- "代码走查"
|
|
314
|
-
|
|
315
|
-
**Related commands:**
|
|
316
|
-
- `/delphi-review` - Design review mode
|
|
317
|
-
- `/delphi-review --mode code-walkthrough` - Pre-push code walkthrough
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## Workflow Steps
|
|
322
|
-
|
|
323
|
-
1. **Determine mode** - Design review (default) or code-walkthrough (--mode code-walkthrough)
|
|
324
|
-
2. **Dispatch anonymous experts** - 2-3 experts from ≥2 different domestic model providers
|
|
325
|
-
3. **Collect Round 1 independent reviews** - Anonymous, no cross-expert bias
|
|
326
|
-
4. **Synthesize feedback** - Measure consensus, identify disagreements
|
|
327
|
-
5. **Run Round 2+ until consensus** - Exchange opinions, iterate until ≥90% agreement
|
|
328
|
-
6. **Block on unresolved Critical/Major** - Zero-tolerance: all Critical/Major must be resolved
|
|
329
|
-
7. **Emit verdict** - APPROVED (with specification.yaml) or REQUEST_CHANGES (fix + re-review)
|
|
330
|
-
|
|
331
|
-
**Consensus threshold:** ≥90% (project standard for Delphi review approval)
|
|
332
|
-
**Model policy:** Domestic models only (DeepSeek, Qwen, Kimi, GLM, MiniMax). Foreign models (Anthropic/OpenAI/Google) forbidden.
|
|
333
|
-
|
|
334
|
-
---
|
|
335
|
-
|
|
336
|
-
## Scope
|
|
337
|
-
|
|
338
|
-
**IN Scope:**
|
|
339
|
-
- Design document review (requirements, architecture, PRDs)
|
|
340
|
-
- Pre-implementation planning review
|
|
341
|
-
- Code walkthrough (git push validation, max 20 files/500 LOC)
|
|
342
|
-
- Multi-expert consensus building
|
|
343
|
-
- Specification extraction (design → specification.yaml)
|
|
344
|
-
|
|
345
|
-
**OUT Scope:**
|
|
346
|
-
- Single-expert review (use `/review` instead)
|
|
347
|
-
- Post-implementation review (use `/requesting-code-review`)
|
|
348
|
-
- Security audit (use `/security-research` or `/cso`)
|
|
349
|
-
- Performance benchmarking (use `/benchmark`)
|
|
350
|
-
|
|
351
|
-
---
|
|
352
|
-
|
|
353
|
-
## Examples
|
|
354
|
-
|
|
355
|
-
**Example 1: Design review**
|
|
356
|
-
```bash
|
|
357
|
-
/delphi-review
|
|
358
|
-
```
|
|
359
|
-
→ 3 experts review design doc → consensus report + specification.yaml
|
|
360
|
-
|
|
361
|
-
**Example 2: Code walkthrough**
|
|
362
|
-
```bash
|
|
363
|
-
/delphi-review --mode code-walkthrough
|
|
364
|
-
```
|
|
365
|
-
→ Pre-push validation → .code-walkthrough-result.json
|
|
366
|
-
|
|
367
|
-
**Example 3: Chinese trigger**
|
|
368
|
-
```
|
|
369
|
-
User: 评审这个需求文档
|
|
370
|
-
→ Auto-detects delphi-review trigger → dispatches experts
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
132
|
## Output Format (MANDATORY)
|
|
376
133
|
|
|
377
|
-
Every review round output MUST follow this exact JSON structure for design mode:
|
|
378
|
-
|
|
379
134
|
```json
|
|
380
135
|
{
|
|
381
136
|
"expert_id": "A|B|C",
|
|
@@ -397,96 +152,42 @@ Every review round output MUST follow this exact JSON structure for design mode:
|
|
|
397
152
|
|
|
398
153
|
**For code-walkthrough mode**, output follows `.code-walkthrough-result.json` schema (see `references/code-walkthrough.md`).
|
|
399
154
|
|
|
400
|
-
**Anti-patterns mapping
|
|
401
|
-
- `Round 1 →
|
|
402
|
-
- `只处理 Critical,忽略 Major` →
|
|
403
|
-
- `用户说"时间紧急"就跳过` →
|
|
155
|
+
**Anti-patterns mapping:**
|
|
156
|
+
- `Round 1 → "评审完成"` → MUST NOT have `verdict: APPROVED` if `critical_issues` exist
|
|
157
|
+
- `只处理 Critical,忽略 Major` → MUST include `major_concerns` array
|
|
158
|
+
- `用户说"时间紧急"就跳过` → MUST include `round` field proving multi-round process
|
|
404
159
|
|
|
405
160
|
---
|
|
406
161
|
|
|
407
162
|
## Terminal State Checklist
|
|
408
163
|
|
|
409
|
-
<MANDATORY-CHECKLIST>
|
|
410
|
-
|
|
411
|
-
### 你只能在以下条件全部满足后声明"Delphi review complete":
|
|
412
|
-
|
|
413
|
-
**Pre-requisites:**
|
|
414
164
|
- [ ] Phase 0 完成(文档验证 + 专家分配)
|
|
415
|
-
- [ ] Round 1
|
|
416
|
-
- [ ] Round 2+ 完成(交换意见 / 最终立场)
|
|
417
|
-
|
|
418
|
-
**CRITICAL — 共识验证:**
|
|
165
|
+
- [ ] Round 1-3 完成(所有专家评审)
|
|
419
166
|
- [ ] 问题共识比例 >=90%
|
|
420
|
-
- [ ] 所有 Critical Issues
|
|
421
|
-
- [ ] 所有 Major Concerns 已处理
|
|
422
|
-
|
|
423
|
-
**CRITICAL — 裁决检查:**
|
|
167
|
+
- [ ] 所有 Critical Issues 已解决,Major Concerns 已处理
|
|
424
168
|
- [ ] 最终裁决是 **APPROVED** 或 **APPROVED_WITH_MINOR**
|
|
425
|
-
- [ ] 如果 REQUEST_CHANGES → 已修复 → 已重新评审 → APPROVED
|
|
426
|
-
|
|
427
|
-
**Final Requirements:**
|
|
428
169
|
- [ ] 共识报告生成并保存
|
|
429
|
-
- [ ]
|
|
430
|
-
- [ ] ⭐ **IF APPROVED (design mode):
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
**IF 任何条件未满足 → CANNOT claim complete, MUST BLOCK 并通知用户**
|
|
434
|
-
|
|
435
|
-
### ⭐ APPROVED 后必做
|
|
436
|
-
|
|
437
|
-
**Design mode**:
|
|
438
|
-
|
|
439
|
-
1. **Automatic: 生成 specification.yaml** — 从设计文档提取需求到 specification.yaml。这是 test-specification-alignment 的输入,没有它 test-spec 会进入不推荐的 legacy mode。
|
|
440
|
-
|
|
441
|
-
2. **必须提示用户** — Delphi review APPROVED 后,agent 必须主动输出以下提示:
|
|
442
|
-
|
|
443
|
-
```
|
|
444
|
-
⭐ Delphi review APPROVED 完成!
|
|
445
|
-
|
|
446
|
-
Next Step: 生成 specification.yaml
|
|
447
|
-
|
|
448
|
-
设计文档已稳定,现在可以生成 specification.yaml 用于后续的 test-specification-alignment 验证。
|
|
170
|
+
- [ ] IF REQUEST_CHANGES → 已修复 → 已重新评审 → APPROVED
|
|
171
|
+
- [ ] ⭐ **IF APPROVED (design mode): 生成 specification.yaml**(自动或用户确认后)
|
|
172
|
+
- [ ] ⭐ **状态文件**: 写入 `.sprint-state/delphi-reviewed.json`(`verdict`, `consensus_ratio`, `timestamp`)
|
|
173
|
+
- [ ] **Code-walkthrough mode**: 写入 `.code-walkthrough-result.json`(commit hash 匹配 HEAD)
|
|
449
174
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
- 回答 "no" 或 "later" → 稍后手动调用 /specification-generator
|
|
453
|
-
```
|
|
175
|
+
**IF REQUEST_CHANGES/REJECTED → CANNOT claim complete**
|
|
176
|
+
**IF 任何条件未满足 → MUST BLOCK**
|
|
454
177
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
4. **生成完成后** → 将 specification.yaml 包含在提交中,标记为 "auto-generated from Delphi review consensus"
|
|
458
|
-
|
|
459
|
-
**Code-walkthrough mode**: 写入 `.code-walkthrough-result.json`(commit hash 匹配 HEAD,expires = timestamp + 1小时)。详见 `references/code-walkthrough.md`。
|
|
460
|
-
|
|
461
|
-
### ⭐ 状态文件输出(MANDATORY — 防止跳过门禁)
|
|
462
|
-
|
|
463
|
-
**Design mode APPROVED 后** — 必须立即写入 `.sprint-state/delphi-reviewed.json`:
|
|
178
|
+
### 状态文件格式
|
|
464
179
|
|
|
180
|
+
**Design mode APPROVED** → `.sprint-state/delphi-reviewed.json`:
|
|
465
181
|
```json
|
|
466
|
-
{
|
|
467
|
-
"mode": "design",
|
|
468
|
-
"timestamp": "2026-05-30T10:30:00Z",
|
|
469
|
-
"verdict": "APPROVED",
|
|
470
|
-
"consensus_ratio": 1.0,
|
|
471
|
-
"specification_path": ".sprint-state/phase-outputs/specification.yaml"
|
|
472
|
-
}
|
|
182
|
+
{"mode":"design","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0,"specification_path":".sprint-state/phase-outputs/specification.yaml"}
|
|
473
183
|
```
|
|
474
184
|
|
|
475
|
-
**Code-walkthrough mode APPROVED
|
|
476
|
-
|
|
185
|
+
**Code-walkthrough mode APPROVED** → `.sprint-state/delphi-reviewed.json`:
|
|
477
186
|
```json
|
|
478
|
-
{
|
|
479
|
-
"mode": "code-walkthrough",
|
|
480
|
-
"commit": "abc123def...",
|
|
481
|
-
"timestamp": "2026-05-30T10:30:00Z",
|
|
482
|
-
"verdict": "APPROVED",
|
|
483
|
-
"consensus_ratio": 1.0
|
|
484
|
-
}
|
|
187
|
+
{"mode":"code-walkthrough","commit":"abc123...","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0}
|
|
485
188
|
```
|
|
486
189
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
</MANDATORY-CHECKLIST>
|
|
190
|
+
> Phase 2 BUILD 入口检查 (DELPHI-GATE) 读取此文件。`verdict != "APPROVED"` → 禁止编码。
|
|
490
191
|
|
|
491
192
|
---
|
|
492
193
|
|
|
@@ -494,15 +195,15 @@ Every review round output MUST follow this exact JSON structure for design mode:
|
|
|
494
195
|
|
|
495
196
|
| ❌ 错误 | ✅ 正确 |
|
|
496
197
|
|---------|---------|
|
|
497
|
-
| Round 1
|
|
498
|
-
| 只处理 Critical,忽略 Major | 零容忍:Critical/Major
|
|
198
|
+
| Round 1 未 APPROVED 就"评审完成" | 迭代直到 APPROVED,修复后重新评审 |
|
|
199
|
+
| 只处理 Critical,忽略 Major | 零容忍:Critical/Major 全部必须处理 |
|
|
499
200
|
| 单专家自评 | 至少 2 位不同 provider 的专家 |
|
|
500
|
-
| 用户说"时间紧急"就跳过 |
|
|
201
|
+
| 用户说"时间紧急"就跳过 | 评审是投资不是开销 |
|
|
501
202
|
| "专家几乎一致"就通过 | "几乎" = 不一致,继续到 >=90% |
|
|
502
|
-
| 使用 Anthropic/GPT/Gemini
|
|
503
|
-
|
|
|
203
|
+
| 使用 Anthropic/GPT/Gemini | 必须使用国产开源模型 |
|
|
204
|
+
| 三个专家同一厂家 | 必须来自至少 2 家不同厂家 |
|
|
504
205
|
|
|
505
|
-
**Code-walkthrough 专属 Anti-Patterns
|
|
206
|
+
**Code-walkthrough 专属 Anti-Patterns** → 详见 `references/code-walkthrough.md`
|
|
506
207
|
|
|
507
208
|
---
|
|
508
209
|
|
|
@@ -512,19 +213,16 @@ Every review round output MUST follow this exact JSON structure for design mode:
|
|
|
512
213
|
|------|------|
|
|
513
214
|
| "这只是小变更" | 所有变更都需要评审 |
|
|
514
215
|
| "Round 1 就够了" | 不够,必须多轮直到共识 |
|
|
515
|
-
| "生成报告就完成了" | APPROVED 才算完成 |
|
|
516
216
|
| "2/3 同意就是共识" | 还要检查问题共识比例 >=90% |
|
|
517
217
|
|
|
518
218
|
---
|
|
519
219
|
|
|
520
220
|
## 成功标准
|
|
521
221
|
|
|
522
|
-
**Delphi 评审完成的唯一标准:**
|
|
523
222
|
1. ✅ 所有专家裁决 APPROVED
|
|
524
223
|
2. ✅ 问题共识 >=90%
|
|
525
|
-
3. ✅ 所有 Critical Issues 已修复验证
|
|
526
|
-
4. ✅
|
|
527
|
-
5. ✅
|
|
528
|
-
6. ✅ 用户已确认
|
|
224
|
+
3. ✅ 所有 Critical Issues 已修复验证 + Major Concerns 已处理
|
|
225
|
+
4. ✅ 共识报告已生成,用户已确认
|
|
226
|
+
5. ✅ 状态文件已写入
|
|
529
227
|
|
|
530
228
|
**缺少任何一项 = 未完成**
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Orchestrator Dispatch Rules(#218 自动多轮调度)
|
|
2
|
+
|
|
3
|
+
## 背景
|
|
4
|
+
|
|
5
|
+
Delphi review 在 sprint-flow 中通过 subagent 调用时,Round 1→Round 2→Round 3 的调度**必须在 subagent 内部自动完成**,不能每轮暂停等待 orchestrator 或用户干预。只有在以下情况才需要 orchestrator 暂停:
|
|
6
|
+
|
|
7
|
+
## 自动调度规则
|
|
8
|
+
|
|
9
|
+
| 场景 | 自动处理 | 需暂停 |
|
|
10
|
+
|------|---------|--------|
|
|
11
|
+
| Round 1 完成,需 Round 2 | ✅ subagent 自动继续 | ❌ |
|
|
12
|
+
| Round 2 完成,需 Round 3 | ✅ subagent 自动继续 | ❌ |
|
|
13
|
+
| Round 3+ 完成,仍需更多轮 | ✅ subagent 自动继续,直到 max_rounds | ❌ |
|
|
14
|
+
| 最终 APPROVED (>=90%) | ✅ subagent 输出结果后退出 | ❌ |
|
|
15
|
+
| 最终 REQUEST_CHANGES(可自动修复) | ✅ subagent 尝试修复措辞、AC 缺失等常见问题后自动重评审 | ❌ |
|
|
16
|
+
| 最终 REQUEST_CHANGES(无法自动修复) | ✅ subagent 输出详细失败报告 | **✅ orchestrator 暂停等用户** |
|
|
17
|
+
| 超过 max_rounds (5) 仍无共识 | ✅ subagent 输出"未达成共识报告" | **✅ orchestrator 暂停等用户决策** |
|
|
18
|
+
|
|
19
|
+
## Subagent 内部 Round 循环
|
|
20
|
+
|
|
21
|
+
当 delphi-review 以 subagent 启动时(非交互式),应执行以下自动循环:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
round = 1
|
|
25
|
+
while round <= max_review_rounds:
|
|
26
|
+
results = execute_round(round)
|
|
27
|
+
consensus = check_consensus(results)
|
|
28
|
+
|
|
29
|
+
if consensus.verdict == "APPROVED" and consensus.ratio >= 0.9:
|
|
30
|
+
emit_verdict("APPROVED", consensus)
|
|
31
|
+
break
|
|
32
|
+
|
|
33
|
+
if round == max_review_rounds:
|
|
34
|
+
emit_verdict("NO_CONSENSUS", consensus)
|
|
35
|
+
break
|
|
36
|
+
|
|
37
|
+
round += 1
|
|
38
|
+
|
|
39
|
+
if verdict == "REQUEST_CHANGES":
|
|
40
|
+
auto_fix_result = attempt_auto_fix(issues)
|
|
41
|
+
if auto_fix_result.success:
|
|
42
|
+
round = 2
|
|
43
|
+
continue
|
|
44
|
+
else:
|
|
45
|
+
emit_verdict("REQUEST_CHANGES", auto_fix_result.failed_issues)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 终止结果输出
|
|
49
|
+
|
|
50
|
+
当 subagent 因终态退出时,必须输出清晰的裁决:
|
|
51
|
+
|
|
52
|
+
- **APPROVED**: 共识报告 + specification.yaml
|
|
53
|
+
- **REQUEST_CHANGES(可自动修复)**: 自动修复后再次评审
|
|
54
|
+
- **REQUEST_CHANGES(不可自动修复)**: 失败报告 + 建议修复方向
|
|
55
|
+
- **NO_CONSENSUS**: 分歧详情报告
|
|
56
|
+
|
|
57
|
+
## 与 orchestrator 的交互约定
|
|
58
|
+
|
|
59
|
+
| 状态 | Subagent 输出 | Orchestrator 动作 |
|
|
60
|
+
|------|--------------|------------------|
|
|
61
|
+
| APPROVED | `{verdict:"APPROVED", consensus_ratio: N, ...}` | 自动进入下一 Phase |
|
|
62
|
+
| REQUEST_CHANGES (auto-fixed) | `{verdict:"APPROVED", auto_fixed: ["..."]}` | 自动进入下一 Phase |
|
|
63
|
+
| REQUEST_CHANGES (unfixable) | `{verdict:"REQUEST_CHANGES", failed_issues: [...]}` | ⚠️ 暂停等用户修复后,通过 task_id 重新 dispatch |
|
|
64
|
+
| NO_CONSENSUS | `{verdict:"NO_CONSENSUS", disagreements: [...]}` | ⚠️ 暂停等用户决策(可继续/中止/强制通过) |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Delphi Round Templates
|
|
2
|
+
|
|
3
|
+
## Round 1: 匿名独立评审
|
|
4
|
+
|
|
5
|
+
### 为什么必须匿名
|
|
6
|
+
|
|
7
|
+
匿名防止 anchoring bias(锚定偏差)—— 知道其他专家意见后倾向于同意"权威",不敢提出相反观点。
|
|
8
|
+
|
|
9
|
+
### 执行方式
|
|
10
|
+
|
|
11
|
+
每位专家独立收到:原始文档 + 评审模板 + "独立评审,不知道其他专家意见"。
|
|
12
|
+
|
|
13
|
+
### 输出格式
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
## 独立评审 - Expert [A/B/C]
|
|
17
|
+
### 优点
|
|
18
|
+
1. [具体优点 + 文档位置]
|
|
19
|
+
### 问题清单
|
|
20
|
+
#### Critical Issues (必须修复才能批准)
|
|
21
|
+
1. [问题] - 位置: [...] - 修复建议: [...]
|
|
22
|
+
#### Major Concerns (必须处理)
|
|
23
|
+
1. [...]
|
|
24
|
+
#### Minor Concerns (需要说明)
|
|
25
|
+
1. [...]
|
|
26
|
+
### 裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
|
|
27
|
+
### 置信度: [X/10]
|
|
28
|
+
### 关键理由
|
|
29
|
+
1. [...]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Round 2: 交换意见
|
|
33
|
+
|
|
34
|
+
### 执行方式
|
|
35
|
+
|
|
36
|
+
每位专家看到:原始文档 + 其他专家的评审 + "响应其他专家的关切,是否调整立场?"
|
|
37
|
+
|
|
38
|
+
### 输出格式
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
## Round 2 Response - Expert [A/B/C]
|
|
42
|
+
### 响应其他专家关切
|
|
43
|
+
**Expert [X] 提到: [问题]**
|
|
44
|
+
- 我的立场: [同意/部分同意/不同意] - 理由: [...]
|
|
45
|
+
### 更新后问题清单 / 裁决 / 置信度 / 立场变化说明
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Round 3: 最终立场(如需要)
|
|
49
|
+
|
|
50
|
+
触发条件:Round 2 后仍无共识。所有专家提交最终绑定立场。3 专家模式下若仍无完全一致,2/3 或 3/3 多数裁决生效,记录少数派意见。
|
|
51
|
+
|
|
52
|
+
### 输出格式
|
|
53
|
+
|
|
54
|
+
```markdown
|
|
55
|
+
## Round 3 Final Position - Expert [A/B/C]
|
|
56
|
+
### 最终裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
|
|
57
|
+
### 最终置信度: [X/10]
|
|
58
|
+
### 关键理由 + 与其他专家的差异
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 修复报告格式
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
## 修复报告
|
|
65
|
+
### Critical Issues 修复 | ### Major Concerns 处理 | ### Minor Concerns 说明
|
|
66
|
+
### 请求重新评审
|
|
67
|
+
```
|