@boyingliu01/xp-gate 0.12.2 → 0.12.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.
- package/bin/xp-gate.js +22 -0
- package/lib/__tests__/update-hooks.test.js +573 -0
- package/lib/update-hooks.js +288 -0
- 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/delphi-review/AGENTS.md +6 -6
- package/plugins/claude-code/skills/delphi-review/SKILL.md +34 -12
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +6 -6
- package/plugins/opencode/skills/delphi-review/SKILL.md +34 -12
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +6 -6
- package/plugins/qoder/skills/delphi-review/SKILL.md +198 -264
- 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/delphi-review/AGENTS.md +6 -6
- package/skills/delphi-review/SKILL.md +34 -12
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: delphi-review
|
|
3
|
-
description: "Use when asked to review a design, plan, or architecture; before implementation starts; or when multi-expert consensus is needed.
|
|
3
|
+
description: "Use when asked to review a design, plan, or architecture; before implementation starts; or when multi-expert consensus is needed. See ## Triggers for trigger phrases."
|
|
4
|
+
auto_continue: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Delphi Consensus Review
|
|
@@ -18,26 +19,52 @@ description: "Use when asked to review a design, plan, or architecture; before i
|
|
|
18
19
|
- Does NOT replace testing or CI/CD verification
|
|
19
20
|
- Does NOT handle deployment or release decisions
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
**Delphi 方法只有一个目的:得到所有专家一致认可的可行方案。**
|
|
22
|
+
## Triggers
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
- /delphi-review
|
|
25
|
+
- review this design
|
|
26
|
+
- 评审这个需求
|
|
27
|
+
- 评审这个设计
|
|
28
|
+
- design review
|
|
29
|
+
- 多专家评审
|
|
30
|
+
- consensus review
|
|
31
|
+
- code walkthrough
|
|
32
|
+
- push review
|
|
33
|
+
- architecture review
|
|
34
|
+
- PR review
|
|
35
|
+
|
|
36
|
+
## 工作流程
|
|
37
|
+
|
|
38
|
+
1. Input Validation: 检查输入是否包含可评审内容(设计文档/代码/spec),空输入阻断
|
|
39
|
+
2. Expert Assignment: 分配 2-3 位专家,至少来自 2 家不同厂商(国产模型)
|
|
40
|
+
3. Round 1: 匿名独立评审 — 各专家互不知对方意见,独立输出 verdict JSON
|
|
41
|
+
4. Consensus Check: 共识检查 — 共识 ≥90% 且全部 APPROVED 则完成
|
|
42
|
+
5. Round 2: 交换意见 — 未达成共识时,专家查看他人意见后重新评审
|
|
43
|
+
6. Round 3: 最终立场 — 仍未达成共识时,输出最终立场和分歧点
|
|
44
|
+
7. Fix & Re-Review: REQUEST_CHANGES → 修复 Critical+Major → 从 Round 2 重新评审
|
|
45
|
+
8. Generate Output: 生成共识报告 + specification.yaml + delphi-reviewed.json
|
|
46
|
+
|
|
47
|
+
## Activation
|
|
48
|
+
**MANDATORY**: Every delphi-review response MUST begin with `[DelphiReview]` as the first line.
|
|
49
|
+
This marker is required for skill-cert L1 trigger detection.
|
|
50
|
+
|
|
51
|
+
Permitted variants (all satisfy L1 trigger):
|
|
52
|
+
- `[DelphiReview]` — standard entry
|
|
53
|
+
- `[DelphiReview:BLOCKED]` — Step 0 input validation failure
|
|
54
|
+
- `[DelphiReview:WARNING]` — red flag detected (reserved)
|
|
26
55
|
|
|
27
|
-
|
|
28
|
-
2. **迭代** — 多轮直到共识,不是固定轮数
|
|
29
|
-
3. **受控反馈** — 每轮看到其他专家意见
|
|
30
|
-
4. **统计共识** — >=90% 一致才算共识
|
|
56
|
+
## 核心原则
|
|
31
57
|
|
|
32
|
-
|
|
58
|
+
**Delphi 方法只有一个目的:得到所有专家一致认可的可行方案。**
|
|
33
59
|
|
|
34
|
-
|
|
|
60
|
+
| 特性 | 说明 |
|
|
35
61
|
|------|------|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
|
|
62
|
+
| **匿名性** | Round 1 专家互不知道对方意见 |
|
|
63
|
+
| **迭代** | 多轮直到共识,不是固定轮数 |
|
|
64
|
+
| **受控反馈** | 每轮看到其他专家意见 |
|
|
65
|
+
| **统计共识** | >=90% 一致才算共识 |
|
|
66
|
+
| **Token 是投资** | 相比后期修复成本,评审消耗微不足道 |
|
|
67
|
+
| **零容忍** | Critical/Major 全部必须处理,不可跳过 |
|
|
41
68
|
|
|
42
69
|
---
|
|
43
70
|
|
|
@@ -46,50 +73,59 @@ description: "Use when asked to review a design, plan, or architecture; before i
|
|
|
46
73
|
| 模式 | 触发 | 用途 | 输出 |
|
|
47
74
|
|------|------|------|------|
|
|
48
75
|
| `design`(默认) | `/delphi-review` | 需求/设计/架构/PR 评审 | 共识报告 + specification.yaml |
|
|
49
|
-
| `code-walkthrough` |
|
|
76
|
+
| `code-walkthrough` | `--mode code-walkthrough` | git push 前代码走查 | `.code-walkthrough-result.json` |
|
|
50
77
|
|
|
51
|
-
**Code Walkthrough
|
|
78
|
+
**Code Walkthrough 模式**的完整规范 → 详见 `references/code-walkthrough.md`
|
|
52
79
|
|
|
53
80
|
---
|
|
54
81
|
|
|
55
82
|
## 参数配置
|
|
56
83
|
|
|
57
|
-
###
|
|
84
|
+
### 专家配置
|
|
58
85
|
|
|
59
86
|
| 配置 | 专家 | 适用场景 |
|
|
60
87
|
|------|------|---------|
|
|
61
88
|
| 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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
| 3 专家 | A(架构) + B(实现) + C(可行性) | 架构决策、需求文档 |
|
|
90
|
+
|
|
91
|
+
### 模型选择策略(强制 — 从 opencode.json 读取)
|
|
92
|
+
|
|
93
|
+
**MUST 从 `opencode.json` 的 agent 配置中读取模型**,**严禁** hardcode 模型名称。
|
|
94
|
+
|
|
95
|
+
模型选择流程:
|
|
96
|
+
1. 读取 `opencode.json` 中 `agent` 字段下 `delphi-reviewer-architecture`、`delphi-reviewer-technical`、`delphi-reviewer-feasibility` 三个 agent 定义
|
|
97
|
+
2. 提取每个 agent 的 `model` 字段(格式:`provider/model-name`)
|
|
98
|
+
3. 分别作为 Expert A(架构)、Expert B(技术)、Expert C(可行性) 的模型
|
|
99
|
+
|
|
100
|
+
**关键原则**:
|
|
101
|
+
- ✅ 三个专家必须来自 **至少 2 家不同 provider**(通过 `model` 字段的 `provider/` 前缀判断)
|
|
102
|
+
- ❌ 禁止 hardcode 模型名称(模型列表以 `opencode.json` 为准)
|
|
103
|
+
- ❌ 禁止三个专家全部使用同一 provider 的模型
|
|
104
|
+
|
|
105
|
+
**`opencode.json` agent 配置示例**(参考 `opencode.json.delphi.example`):
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"agent": {
|
|
109
|
+
"delphi-reviewer-architecture": {
|
|
110
|
+
"description": "...",
|
|
111
|
+
"mode": "subagent",
|
|
112
|
+
"model": "deepseek/deepseek-chat",
|
|
113
|
+
"tools": { "read": true, "bash": true, "write": false, "edit": false }
|
|
114
|
+
},
|
|
115
|
+
"delphi-reviewer-technical": {
|
|
116
|
+
"mode": "subagent",
|
|
117
|
+
"model": "bailian-coding-plan/qwen3.6-plus",
|
|
118
|
+
"tools": { "read": true, "bash": true, "write": false, "edit": false }
|
|
119
|
+
},
|
|
120
|
+
"delphi-reviewer-feasibility": {
|
|
121
|
+
"mode": "subagent",
|
|
122
|
+
"model": "deepseek/deepseek-chat",
|
|
123
|
+
"tools": { "read": true, "bash": true, "write": false, "edit": false }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
> 上例中 3 个专家使用了 2 个不同 provider(deepseek + bailian-coding-plan),满足跨 provider 要求。**实际模型名称以你的 `opencode.json` 配置为准,无需在 SKILL.md 维护模型列表。**
|
|
93
129
|
|
|
94
130
|
### 共识阈值
|
|
95
131
|
|
|
@@ -100,7 +136,7 @@ description: "Use when asked to review a design, plan, or architecture; before i
|
|
|
100
136
|
|
|
101
137
|
---
|
|
102
138
|
|
|
103
|
-
##
|
|
139
|
+
## 评审执行过程
|
|
104
140
|
|
|
105
141
|
```
|
|
106
142
|
Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
@@ -124,69 +160,84 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
|
124
160
|
└─ REQUEST_CHANGES → 修复方案 → 回到 Round 2 重新评审
|
|
125
161
|
```
|
|
126
162
|
|
|
127
|
-
|
|
163
|
+
### Step 0: Input Validation (MANDATORY — 必须在任何评审前执行)
|
|
128
164
|
|
|
129
|
-
|
|
165
|
+
检查用户 prompt 中是否包含可评审内容(设计文档、代码、specification.yaml、PR diff):
|
|
130
166
|
|
|
131
|
-
|
|
167
|
+
1. **有完整输入** → 直接进入 Phase 0(准备阶段),开始 Round 1
|
|
168
|
+
2. **有部分输入**(占位符、描述性文本)→ 按输入内容执行评审,标注 `[INPUT: PARTIAL]`,但继续执行
|
|
169
|
+
3. **无输入**(仅触发词,无文档/代码)→ 输出以下阻断响应,记入步骤完成:
|
|
132
170
|
|
|
133
|
-
|
|
171
|
+
**Detection heuristics for Step 0**:
|
|
172
|
+
- **Complete**: Contains ≥1 structural element (e.g., `##`, `requirement`, `AC-`, `function`, `class`, `interface`, YAML frontmatter, code block with language tag) AND ≥50 non-whitespace characters of actual content (not placeholder brackets like `[...]`, `{...}`, `<insert here>`).
|
|
173
|
+
- **Partial**: Contains descriptive text referencing a design/code artifact BUT lacks substantive structure (e.g., "I need to review my login module" with no actual code/design attached), OR contains obvious placeholders like `[...]`, `(content)`, `<insert here>`, `TODO`.
|
|
174
|
+
- **None**: Only trigger words (`/delphi-review`, "review this") with zero additional content, OR content that is exclusively questions about the review process itself ("how does delphi work?").
|
|
134
175
|
|
|
135
|
-
|
|
176
|
+
**Partial input constraint**: When input is PARTIAL, cap review to 1 round with `confidence=low` annotation. Do NOT proceed with full multi-round review on insufficient input.
|
|
136
177
|
|
|
137
|
-
|
|
178
|
+
**File path validation**: If user provides a file path (e.g., `--spec specification.yaml`):
|
|
179
|
+
- Verify the file exists and is non-empty
|
|
180
|
+
- If path is invalid → output: `[DelphiReview:BLOCKED] File not found: [path]. Please verify the path.`
|
|
181
|
+
- If file is empty → output: `[DelphiReview:BLOCKED] File is empty: [path]. Please provide valid content.`
|
|
138
182
|
|
|
139
|
-
|
|
183
|
+
```
|
|
184
|
+
[DelphiReview:BLOCKED] 需要设计文档或代码内容才能启动评审。
|
|
140
185
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
### 裁决: [APPROVED / REQUEST_CHANGES / REJECTED]
|
|
153
|
-
### 置信度: [X/10]
|
|
154
|
-
### 关键理由
|
|
155
|
-
1. [...]
|
|
186
|
+
请提供以下之一:
|
|
187
|
+
- 设计文档(design doc / specification)
|
|
188
|
+
- 代码变更(code diff / PR link)
|
|
189
|
+
- specification.yaml 文件路径
|
|
190
|
+
- 架构设计说明
|
|
191
|
+
|
|
192
|
+
评审输入示例:
|
|
193
|
+
/delphi-review "Design Doc: [your content here]"
|
|
194
|
+
/delphi-review --spec specification.yaml
|
|
195
|
+
/delphi-review --mode code-walkthrough
|
|
196
|
+
REMAINING STEPS: N/A (input validation failed)
|
|
156
197
|
```
|
|
157
198
|
|
|
158
|
-
|
|
199
|
+
在此状态下,BLOCKED 视为步骤已完成(后续步骤标记为 N/A)。
|
|
159
200
|
|
|
160
|
-
|
|
201
|
+
**重要**: 内嵌在 prompt 中的文档内容(如 "Design Doc: [content]"或代码片段)应视为"有完整输入",直接进入评审。
|
|
161
202
|
|
|
162
|
-
|
|
203
|
+
**Round 模板**(匿名评审/交换意见/最终立场/修复报告格式)→ 详见 `references/round-templates.md`
|
|
163
204
|
|
|
164
|
-
|
|
205
|
+
**Orchestrator 自动调度规则**(#218 subagent 内部自动多轮循环)→ 详见 `references/orchestrator-dispatch.md`
|
|
165
206
|
|
|
166
|
-
|
|
207
|
+
**Automatic re-review**: 对于常见可控问题(措辞模糊、AC 缺失、格式问题),subagent 应自行修复后自动重评审,无需等待用户。
|
|
167
208
|
|
|
168
|
-
|
|
169
|
-
## Round 2 Response - Expert [A/B/C]
|
|
170
|
-
### 响应其他专家关切
|
|
171
|
-
**Expert [X] 提到: [问题]**
|
|
172
|
-
- 我的立场: [同意/部分同意/不同意] - 理由: [...]
|
|
173
|
-
### 更新后问题清单 / 裁决 / 置信度 / 立场变化说明
|
|
174
|
-
```
|
|
209
|
+
### ⭐ 自动延续规则(MANDATORY — 防止流程卡住)
|
|
175
210
|
|
|
176
|
-
|
|
211
|
+
当 Delphi Review 启动多轮评审(Round 2+)时,**orchestrator 必须自动延续流程,不得等待用户输入**。
|
|
177
212
|
|
|
178
|
-
|
|
213
|
+
**触发条件**:
|
|
214
|
+
- Round N 完成,但未达到终止条件(100% approved + ≥90% consensus + 所有 Critical/Major 已处理)
|
|
215
|
+
- 存在待处理的背景任务(subagent dispatched tasks)
|
|
179
216
|
|
|
180
|
-
|
|
217
|
+
**自动延续动作**:
|
|
218
|
+
1. **收集背景任务结果**:等待 `<system-reminder>` 通知后,立即调用 `background_output(task_id="bg_...")` 获取所有 subagent 输出
|
|
219
|
+
2. **合成 Round N 总结**:汇总专家意见、共识度、待处理问题
|
|
220
|
+
3. **自动启动 Round N+1**:立即 dispatch 新一轮 subagent 任务,携带上一轮总结作为上下文
|
|
221
|
+
4. **循环直至终止**:重复步骤 1-3,直到达到终止条件
|
|
181
222
|
|
|
182
|
-
|
|
223
|
+
**终止条件**(满足全部):
|
|
224
|
+
- ✅ 所有专家状态 = APPROVED
|
|
225
|
+
- ✅ 共识度 ≥ 90%
|
|
226
|
+
- ✅ 所有 Critical 级别问题已解决
|
|
227
|
+
- ✅ 所有 Major 级别问题已处理(或已记录为已知问题)
|
|
183
228
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
229
|
+
**例外情况**(直接输出,不进入下一轮):
|
|
230
|
+
- Round 1 即达到 100% approved + 100% consensus → 直接输出最终报告
|
|
231
|
+
- 已达最大轮数(5 轮)→ 输出"未达成共识"报告,标记为 PROCESS_BLOCK
|
|
232
|
+
|
|
233
|
+
**禁止行为**:
|
|
234
|
+
- ❌ 询问用户"要继续吗?"
|
|
235
|
+
- ❌ 等待用户手动触发 Round N+1
|
|
236
|
+
- ❌ 在未达到终止条件时停止流程
|
|
237
|
+
|
|
238
|
+
**错误处理**:
|
|
239
|
+
- 背景任务超时(>10min)→ 标记为 TIMEOUT,输出部分结果并终止
|
|
240
|
+
- 背景任务失败(subagent 错误)→ 重试 1 次,仍失败则输出错误报告并终止
|
|
190
241
|
|
|
191
242
|
---
|
|
192
243
|
|
|
@@ -197,13 +248,6 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
|
197
248
|
2. 重新评审(从 Round 2 起步,不是 Round 1)
|
|
198
249
|
3. 迭代直到 APPROVED
|
|
199
250
|
|
|
200
|
-
修复报告格式:
|
|
201
|
-
```markdown
|
|
202
|
-
## 修复报告
|
|
203
|
-
### Critical Issues 修复 | ### Major Concerns 处理 | ### Minor Concerns 说明
|
|
204
|
-
### 请求重新评审
|
|
205
|
-
```
|
|
206
|
-
|
|
207
251
|
---
|
|
208
252
|
|
|
209
253
|
## 终止条件
|
|
@@ -215,90 +259,24 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
|
215
259
|
|
|
216
260
|
---
|
|
217
261
|
|
|
218
|
-
##
|
|
219
|
-
|
|
220
|
-
This skill activates on any request for multi-expert review. Common triggers:
|
|
221
|
-
|
|
222
|
-
**English:**
|
|
223
|
-
- "review this design"
|
|
224
|
-
- "design review"
|
|
225
|
-
- "architecture review"
|
|
226
|
-
- "consensus review"
|
|
227
|
-
- "code walkthrough"
|
|
228
|
-
- "push review"
|
|
229
|
-
- "multi-expert review"
|
|
230
|
-
- "PR review"
|
|
231
|
-
|
|
232
|
-
**Chinese:**
|
|
233
|
-
- "评审这个需求"
|
|
234
|
-
- "多专家评审"
|
|
235
|
-
- "设计评审"
|
|
236
|
-
- "架构评审"
|
|
237
|
-
- "代码走查"
|
|
238
|
-
|
|
239
|
-
**Related commands:**
|
|
240
|
-
- `/delphi-review` - Design review mode
|
|
241
|
-
- `/delphi-review --mode code-walkthrough` - Pre-push code walkthrough
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Workflow Steps
|
|
246
|
-
|
|
247
|
-
1. **Determine mode** - Design review (default) or code-walkthrough (--mode code-walkthrough)
|
|
248
|
-
2. **Dispatch anonymous experts** - 2-3 experts from ≥2 different domestic model providers
|
|
249
|
-
3. **Collect Round 1 independent reviews** - Anonymous, no cross-expert bias
|
|
250
|
-
4. **Synthesize feedback** - Measure consensus, identify disagreements
|
|
251
|
-
5. **Run Round 2+ until consensus** - Exchange opinions, iterate until ≥90% agreement
|
|
252
|
-
6. **Block on unresolved Critical/Major** - Zero-tolerance: all Critical/Major must be resolved
|
|
253
|
-
7. **Emit verdict** - APPROVED (with specification.yaml) or REQUEST_CHANGES (fix + re-review)
|
|
254
|
-
|
|
255
|
-
**Consensus threshold:** ≥90% (project standard for Delphi review approval)
|
|
256
|
-
**Model policy:** Domestic models only (DeepSeek, Qwen, Kimi, GLM, MiniMax). Foreign models (Anthropic/OpenAI/Google) forbidden.
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Scope
|
|
261
|
-
|
|
262
|
-
**IN Scope:**
|
|
263
|
-
- Design document review (requirements, architecture, PRDs)
|
|
264
|
-
- Pre-implementation planning review
|
|
265
|
-
- Code walkthrough (git push validation, max 20 files/500 LOC)
|
|
266
|
-
- Multi-expert consensus building
|
|
267
|
-
- Specification extraction (design → specification.yaml)
|
|
268
|
-
|
|
269
|
-
**OUT Scope:**
|
|
270
|
-
- Single-expert review (use `/review` instead)
|
|
271
|
-
- Post-implementation review (use `/requesting-code-review`)
|
|
272
|
-
- Security audit (use `/security-research` or `/cso`)
|
|
273
|
-
- Performance benchmarking (use `/benchmark`)
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Examples
|
|
278
|
-
|
|
279
|
-
**Example 1: Design review**
|
|
280
|
-
```bash
|
|
281
|
-
/delphi-review
|
|
282
|
-
```
|
|
283
|
-
→ 3 experts review design doc → consensus report + specification.yaml
|
|
262
|
+
## Output Format (MANDATORY)
|
|
284
263
|
|
|
285
|
-
**
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
→ Pre-push validation → .code-walkthrough-result.json
|
|
264
|
+
**Single 模式简化输出**: 当 single reviewer 模式(非 Multi-Expert)时,可使用简化输出格式:
|
|
265
|
+
- verdict + confidence + issues_list(合并 critical/major/minor)+ summary
|
|
266
|
+
- 完整 JSON 格式保留用于 multi-expert 多轮评审场景
|
|
290
267
|
|
|
291
|
-
**
|
|
268
|
+
**Single 模式简化模板**:
|
|
292
269
|
```
|
|
293
|
-
|
|
294
|
-
|
|
270
|
+
[DelphiReview] verdict=APPROVED | REQUEST_CHANGES | BLOCKED
|
|
271
|
+
confidence=N/10
|
|
272
|
+
issues=[critical: N, major: N, minor: N]
|
|
273
|
+
summary: [1-2 sentence verdict summary]
|
|
295
274
|
```
|
|
296
275
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
Every review round output MUST follow this exact JSON structure for design mode:
|
|
276
|
+
**⚠️ Single vs Multi-Expert Output**:
|
|
277
|
+
- **Multi-Expert Mode (default)**: MUST use the full JSON schema below. Each expert outputs independently; the orchestrator aggregates into `consensus_report`. DO NOT use the simplified template.
|
|
278
|
+
- **Single Reviewer Mode** (explicitly invoked with `--single`): MAY use the simplified text template above.
|
|
279
|
+
- **Never mix formats**. If you are one of multiple experts in the same round, output JSON only.
|
|
302
280
|
|
|
303
281
|
```json
|
|
304
282
|
{
|
|
@@ -321,96 +299,42 @@ Every review round output MUST follow this exact JSON structure for design mode:
|
|
|
321
299
|
|
|
322
300
|
**For code-walkthrough mode**, output follows `.code-walkthrough-result.json` schema (see `references/code-walkthrough.md`).
|
|
323
301
|
|
|
324
|
-
**Anti-patterns mapping
|
|
325
|
-
- `Round 1 →
|
|
326
|
-
- `只处理 Critical,忽略 Major` →
|
|
327
|
-
- `用户说"时间紧急"就跳过` →
|
|
302
|
+
**Anti-patterns mapping:**
|
|
303
|
+
- `Round 1 → "评审完成"` → MUST NOT have `verdict: APPROVED` if `critical_issues` exist
|
|
304
|
+
- `只处理 Critical,忽略 Major` → MUST include `major_concerns` array
|
|
305
|
+
- `用户说"时间紧急"就跳过` → MUST include `round` field proving multi-round process
|
|
328
306
|
|
|
329
307
|
---
|
|
330
308
|
|
|
331
309
|
## Terminal State Checklist
|
|
332
310
|
|
|
333
|
-
<MANDATORY-CHECKLIST>
|
|
334
|
-
|
|
335
|
-
### 你只能在以下条件全部满足后声明"Delphi review complete":
|
|
336
|
-
|
|
337
|
-
**Pre-requisites:**
|
|
338
311
|
- [ ] Phase 0 完成(文档验证 + 专家分配)
|
|
339
|
-
- [ ] Round 1
|
|
340
|
-
- [ ] Round 2+ 完成(交换意见 / 最终立场)
|
|
341
|
-
|
|
342
|
-
**CRITICAL — 共识验证:**
|
|
312
|
+
- [ ] Round 1-3 完成(所有专家评审)
|
|
343
313
|
- [ ] 问题共识比例 >=90%
|
|
344
|
-
- [ ] 所有 Critical Issues
|
|
345
|
-
- [ ] 所有 Major Concerns 已处理
|
|
346
|
-
|
|
347
|
-
**CRITICAL — 裁决检查:**
|
|
314
|
+
- [ ] 所有 Critical Issues 已解决,Major Concerns 已处理
|
|
348
315
|
- [ ] 最终裁决是 **APPROVED** 或 **APPROVED_WITH_MINOR**
|
|
349
|
-
- [ ] 如果 REQUEST_CHANGES → 已修复 → 已重新评审 → APPROVED
|
|
350
|
-
|
|
351
|
-
**Final Requirements:**
|
|
352
316
|
- [ ] 共识报告生成并保存
|
|
353
|
-
- [ ]
|
|
354
|
-
- [ ] ⭐ **IF APPROVED (design mode):
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
**IF 任何条件未满足 → CANNOT claim complete, MUST BLOCK 并通知用户**
|
|
358
|
-
|
|
359
|
-
### ⭐ APPROVED 后必做
|
|
317
|
+
- [ ] IF REQUEST_CHANGES → 已修复 → 已重新评审 → APPROVED
|
|
318
|
+
- [ ] ⭐ **IF APPROVED (design mode): 生成 specification.yaml**(自动或用户确认后)
|
|
319
|
+
- [ ] ⭐ **状态文件**: 写入 `.sprint-state/delphi-reviewed.json`(`verdict`, `consensus_ratio`, `timestamp`)
|
|
320
|
+
- [ ] **Code-walkthrough mode**: 写入 `.code-walkthrough-result.json`(commit hash 匹配 HEAD)
|
|
360
321
|
|
|
361
|
-
**
|
|
322
|
+
**IF REQUEST_CHANGES/REJECTED → CANNOT claim complete**
|
|
323
|
+
**IF 任何条件未满足 → MUST BLOCK**
|
|
362
324
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
2. **必须提示用户** — Delphi review APPROVED 后,agent 必须主动输出以下提示:
|
|
366
|
-
|
|
367
|
-
```
|
|
368
|
-
⭐ Delphi review APPROVED 完成!
|
|
369
|
-
|
|
370
|
-
Next Step: 生成 specification.yaml
|
|
371
|
-
|
|
372
|
-
设计文档已稳定,现在可以生成 specification.yaml 用于后续的 test-specification-alignment 验证。
|
|
373
|
-
|
|
374
|
-
是否现在生成?
|
|
375
|
-
- 回答 "yes" 或 "generate spec" → 我将调用 specification-generator 自动生成
|
|
376
|
-
- 回答 "no" 或 "later" → 稍后手动调用 /specification-generator
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
3. **如果用户同意** → 立即调用 `task(subagent_type="deep", load_skills=["specification-generator"], prompt="基于以下 APPROVED 设计文档生成 specification.yaml: [粘贴设计文档内容]")`
|
|
380
|
-
|
|
381
|
-
4. **生成完成后** → 将 specification.yaml 包含在提交中,标记为 "auto-generated from Delphi review consensus"
|
|
382
|
-
|
|
383
|
-
**Code-walkthrough mode**: 写入 `.code-walkthrough-result.json`(commit hash 匹配 HEAD,expires = timestamp + 1小时)。详见 `references/code-walkthrough.md`。
|
|
384
|
-
|
|
385
|
-
### ⭐ 状态文件输出(MANDATORY — 防止跳过门禁)
|
|
386
|
-
|
|
387
|
-
**Design mode APPROVED 后** — 必须立即写入 `.sprint-state/delphi-reviewed.json`:
|
|
325
|
+
### 状态文件格式
|
|
388
326
|
|
|
327
|
+
**Design mode APPROVED** → `.sprint-state/delphi-reviewed.json`:
|
|
389
328
|
```json
|
|
390
|
-
{
|
|
391
|
-
"mode": "design",
|
|
392
|
-
"timestamp": "2026-05-30T10:30:00Z",
|
|
393
|
-
"verdict": "APPROVED",
|
|
394
|
-
"consensus_ratio": 1.0,
|
|
395
|
-
"specification_path": ".sprint-state/phase-outputs/specification.yaml"
|
|
396
|
-
}
|
|
329
|
+
{"mode":"design","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0,"specification_path":".sprint-state/phase-outputs/specification.yaml"}
|
|
397
330
|
```
|
|
398
331
|
|
|
399
|
-
**Code-walkthrough mode APPROVED
|
|
400
|
-
|
|
332
|
+
**Code-walkthrough mode APPROVED** → `.sprint-state/delphi-reviewed.json`:
|
|
401
333
|
```json
|
|
402
|
-
{
|
|
403
|
-
"mode": "code-walkthrough",
|
|
404
|
-
"commit": "abc123def...",
|
|
405
|
-
"timestamp": "2026-05-30T10:30:00Z",
|
|
406
|
-
"verdict": "APPROVED",
|
|
407
|
-
"consensus_ratio": 1.0
|
|
408
|
-
}
|
|
334
|
+
{"mode":"code-walkthrough","commit":"abc123...","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0}
|
|
409
335
|
```
|
|
410
336
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
</MANDATORY-CHECKLIST>
|
|
337
|
+
> Phase 2 BUILD 入口检查 (DELPHI-GATE) 读取此文件。`verdict != "APPROVED"` → 禁止编码。
|
|
414
338
|
|
|
415
339
|
---
|
|
416
340
|
|
|
@@ -418,20 +342,32 @@ Every review round output MUST follow this exact JSON structure for design mode:
|
|
|
418
342
|
|
|
419
343
|
| ❌ 错误 | ✅ 正确 |
|
|
420
344
|
|---------|---------|
|
|
421
|
-
| Round 1
|
|
422
|
-
| 只处理 Critical,忽略 Major | 零容忍:Critical/Major
|
|
345
|
+
| Round 1 未 APPROVED 就"评审完成" | 迭代直到 APPROVED,修复后重新评审 |
|
|
346
|
+
| 只处理 Critical,忽略 Major | 零容忍:Critical/Major 全部必须处理 |
|
|
423
347
|
| 单专家自评 | 至少 2 位不同 provider 的专家 |
|
|
424
|
-
| 用户说"时间紧急"就跳过 |
|
|
348
|
+
| 用户说"时间紧急"就跳过 | 评审是投资不是开销 |
|
|
425
349
|
| "专家几乎一致"就通过 | "几乎" = 不一致,继续到 >=90% |
|
|
426
|
-
| 使用 Anthropic/GPT/Gemini
|
|
427
|
-
|
|
|
350
|
+
| 使用 Anthropic/GPT/Gemini | 必须使用国产开源模型 |
|
|
351
|
+
| 三个专家同一厂家 | 必须来自至少 2 家不同厂家 |
|
|
428
352
|
|
|
429
|
-
**Code-walkthrough 专属 Anti-Patterns
|
|
353
|
+
**Code-walkthrough 专属 Anti-Patterns** → 详见 `references/code-walkthrough.md`
|
|
430
354
|
|
|
431
355
|
---
|
|
432
356
|
|
|
433
357
|
## Red Flags
|
|
434
358
|
|
|
359
|
+
### 检测触发器(模型可执行检测)
|
|
360
|
+
|
|
361
|
+
| 用户输入模式 | 触发词 | 响应动作 |
|
|
362
|
+
|-------------|--------|---------|
|
|
363
|
+
| 要求跳过评审 | "skip review", "不用评审", "跳过评审", "直接提交", "不评审" | → 提醒: `[DelphiReview] 评审是投资而非开销。Delphi 设计要求多轮共识(>=90%),不可快速跳过。` |
|
|
364
|
+
| 时间压力 | "来不及", "时间紧", "emergency", "赶时间", "deadline" | → 提醒: `[DelphiReview] 时间紧迫正是需要评审的时刻。跳过评审省 30 分钟,后期修复可能花 3 天。` |
|
|
365
|
+
| 提前终止 | Round 1 后用户说 "可以了", "够了", "enough" | → BLOCK: `[DelphiReview:BLOCKED] 评审未达终止条件。仍需 [共识>=90% + 所有 Critical/Major 已处理]。` |
|
|
366
|
+
| 单专家自评 | 用户仅指定 1 个专家 或 说 "我自己看了" | → 提醒: `[DelphiReview] 至少需要 2 位不同 provider 的专家参与评审。` |
|
|
367
|
+
| 无文档输入 | 仅触发词,无设计/代码内容 | → 输出 `[DelphiReview:BLOCKED]` 阻断响应(见 Step 0) |
|
|
368
|
+
|
|
369
|
+
### 原则性声明
|
|
370
|
+
|
|
435
371
|
| 借口 | 现实 |
|
|
436
372
|
|------|------|
|
|
437
373
|
| "这只是小变更" | 所有变更都需要评审 |
|
|
@@ -443,12 +379,10 @@ Every review round output MUST follow this exact JSON structure for design mode:
|
|
|
443
379
|
|
|
444
380
|
## 成功标准
|
|
445
381
|
|
|
446
|
-
**Delphi 评审完成的唯一标准:**
|
|
447
382
|
1. ✅ 所有专家裁决 APPROVED
|
|
448
383
|
2. ✅ 问题共识 >=90%
|
|
449
|
-
3. ✅ 所有 Critical Issues 已修复验证
|
|
450
|
-
4. ✅
|
|
451
|
-
5. ✅
|
|
452
|
-
6. ✅ 用户已确认
|
|
384
|
+
3. ✅ 所有 Critical Issues 已修复验证 + Major Concerns 已处理
|
|
385
|
+
4. ✅ 共识报告已生成,用户已确认
|
|
386
|
+
5. ✅ 状态文件已写入
|
|
453
387
|
|
|
454
388
|
**缺少任何一项 = 未完成**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/SPRINT-FLOW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-03
|
|
4
|
+
**Commit:** 83b39b6
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.3.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-03
|
|
4
|
+
**Commit:** 83b39b6
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.3.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
package/principles/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# PRINCIPLES CHECKER MODULE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-03
|
|
4
|
+
**Commit:** 83b39b6
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.3.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Clean Code & SOLID principles checker — **Gate 4** of pre-commit. 14 rules × 9 language adapters, SARIF 2.1.0 output. Houses the **Boy Scout Rule** enforcement engine (Gate 6) and warning-baseline storage.
|