@boyingliu01/xp-gate 0.7.0 → 0.8.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/bin/xp-gate.js +4 -9
- package/lib/__tests__/audit-log.test.ts +107 -0
- package/lib/__tests__/detect-deps.test.js +212 -42
- package/lib/__tests__/doctor.test.js +1 -0
- package/lib/__tests__/gate-audit.test.ts +59 -0
- package/lib/__tests__/init.test.js +47 -1
- package/lib/__tests__/install-skill.test.js +1 -45
- package/lib/__tests__/ui-detector.test.ts +186 -26
- package/lib/__tests__/ui-review.test.ts +119 -0
- package/lib/__tests__/uninstall.test.js +1 -0
- package/lib/detect-deps.js +180 -37
- package/lib/doctor.js +7 -9
- package/lib/gate-audit.ts +26 -42
- package/lib/init.js +42 -13
- package/lib/install-skill.js +20 -48
- package/lib/rollback.js +1 -16
- package/lib/shared-paths.js +30 -0
- package/lib/shared-utils.js +25 -0
- package/lib/ui-detector.ts +20 -14
- package/lib/ui-review.ts +58 -53
- package/lib/uninstall.js +8 -9
- 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 +904 -0
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/claude-code/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/claude-code/skills/delphi-review/SKILL.md +454 -0
- package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/claude-code/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/claude-code/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/claude-code/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/claude-code/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/claude-code/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/claude-code/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/claude-code/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/claude-code/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/claude-code/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/claude-code/skills/to-issues/SKILL.md +277 -0
- package/plugins/opencode/README.md +38 -0
- package/plugins/opencode/index.ts +85 -0
- package/plugins/opencode/package.json +18 -0
- package/plugins/opencode/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/opencode/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/opencode/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/opencode/skills/delphi-review/SKILL.md +454 -0
- package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/opencode/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/opencode/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/opencode/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/opencode/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/opencode/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/opencode/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/opencode/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/opencode/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/opencode/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/opencode/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/opencode/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/opencode/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/opencode/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/opencode/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/opencode/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/opencode/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/opencode/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/opencode/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/opencode/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/opencode/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/opencode/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/opencode/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/opencode/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/opencode/skills/to-issues/SKILL.md +277 -0
- package/plugins/opencode/tsconfig.json +15 -0
- package/plugins/qoder/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/qoder/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/qoder/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/qoder/skills/delphi-review/SKILL.md +454 -0
- package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/qoder/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/qoder/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/qoder/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/qoder/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/qoder/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/qoder/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/qoder/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/qoder/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/qoder/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/qoder/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/qoder/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/qoder/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/qoder/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/qoder/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/qoder/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/qoder/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/qoder/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/qoder/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/qoder/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/qoder/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/qoder/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/qoder/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/qoder/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/qoder/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/qoder/skills/to-issues/SKILL.md +277 -0
- package/skills/admin-template-guidelines/SKILL.md +904 -0
- package/skills/delphi-review/SKILL.md +112 -77
- package/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/skills/ralph-loop/SKILL.md +165 -34
- package/skills/sprint-flow/SKILL.md +448 -107
- package/skills/sprint-flow/references/components/skill-invocations.md +1 -1
- package/skills/sprint-flow/references/components/tool-descriptions.md +1 -1
- package/skills/sprint-flow/references/force-levels.md +203 -0
- package/skills/sprint-flow/references/phase-1-plan.md +4 -4
- package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +20 -1
- package/skills/sprint-flow/templates/auto-estimate-output-template.md +7 -5
- package/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/skills/test-driven-development/SKILL.md +71 -0
- package/skills/test-specification-alignment/SKILL.md +98 -24
- package/skills/to-issues/SKILL.md +277 -0
- package/plugins/qoder/AGENTS.md +0 -93
- package/plugins/qoder/README.md +0 -87
- package/plugins/qoder/widgets/quality-report.html +0 -163
- package/plugins/qoder/widgets/sprint-dashboard.html +0 -172
- package/skills/delphi-review/evals/evals.json +0 -82
- package/skills/delphi-review/references/qoder-multi-model.md +0 -191
- package/skills/ralph-loop/evals/evals.json +0 -311
- package/skills/ralph-loop/evolution-history.json +0 -59
- package/skills/ralph-loop/evolution-log.md +0 -16
- package/skills/sprint-flow/evals/evals.json +0 -130
- package/skills/sprint-flow/evolution-history.json +0 -39
- package/skills/sprint-flow/evolution-log.md +0 -23
- package/skills/sprint-flow/references/qoder-adaptation.md +0 -173
- package/skills/test-specification-alignment/evals/evals.json +0 -75
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
---
|
|
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. Triggers: 'review this design', '评审这个需求', 'design review', '多专家评审', 'consensus review', 'code walkthrough', 'push review', 'architecture review', 'PR review', or any request for multi-expert evaluation of requirements, design docs, or PRs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Delphi Consensus Review
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
|
|
10
|
+
**In Scope:**
|
|
11
|
+
- Multi-round anonymous expert consensus review (design + code-walkthrough modes)
|
|
12
|
+
- 2-3 experts from different providers with statistical consensus (>= 91%)
|
|
13
|
+
- Structured verdict: APPROVED / PASS_WITH_CAVEATS / REQUEST_CHANGES
|
|
14
|
+
- Domestic models only (no Anthropic/OpenAI/Google)
|
|
15
|
+
|
|
16
|
+
**Out of Scope:**
|
|
17
|
+
- Does NOT implement code changes (review only, implementation is separate)
|
|
18
|
+
- Does NOT replace testing or CI/CD verification
|
|
19
|
+
- Does NOT handle deployment or release decisions
|
|
20
|
+
|
|
21
|
+
## 核心原则
|
|
22
|
+
|
|
23
|
+
**Delphi 方法只有一个目的:得到所有专家一致认可的可行方案。**
|
|
24
|
+
|
|
25
|
+
### 四大核心特性(RAND 方法论)
|
|
26
|
+
|
|
27
|
+
1. **匿名性** — Round 1 专家互不知道对方意见
|
|
28
|
+
2. **迭代** — 多轮直到共识,不是固定轮数
|
|
29
|
+
3. **受控反馈** — 每轮看到其他专家意见
|
|
30
|
+
4. **统计共识** — >=91% 一致才算共识
|
|
31
|
+
|
|
32
|
+
### 质量优先
|
|
33
|
+
|
|
34
|
+
| 原则 | 说明 |
|
|
35
|
+
|------|------|
|
|
36
|
+
| Token 是投资 | 相比后期修复成本,评审消耗微不足道 |
|
|
37
|
+
| APPROVED 才是终点 | REQUEST_CHANGES 必须修复并重新评审 |
|
|
38
|
+
| 零容忍 | Critical/Major 问题全部必须处理,不可跳过或降级 |
|
|
39
|
+
|
|
40
|
+
详见:Anti-Patterns 章节。
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 评审模式
|
|
45
|
+
|
|
46
|
+
| 模式 | 触发 | 用途 | 输出 |
|
|
47
|
+
|------|------|------|------|
|
|
48
|
+
| `design`(默认) | `/delphi-review` | 需求/设计/架构/PR 评审 | 共识报告 + specification.yaml |
|
|
49
|
+
| `code-walkthrough` | `/delphi-review --mode code-walkthrough` | git push 前代码走查 | `.code-walkthrough-result.json` |
|
|
50
|
+
|
|
51
|
+
**Code Walkthrough 模式**的完整规范已移至 `references/code-walkthrough.md`。当用户使用 `--mode code-walkthrough` 时,读取该文件并执行其中定义的全部流程。
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 参数配置
|
|
56
|
+
|
|
57
|
+
### 专家数量与角色
|
|
58
|
+
|
|
59
|
+
| 配置 | 专家 | 适用场景 |
|
|
60
|
+
|------|------|---------|
|
|
61
|
+
| 2 专家(默认) | A(架构) + B(实现) | 代码变更、小型设计 |
|
|
62
|
+
| 3 专家 | A(架构) + B(实现) + C(可行性仲裁) | 架构决策、需求文档 |
|
|
63
|
+
|
|
64
|
+
> ⚠️ 至少选择 **两家不同 provider** 的模型,避免同源盲点。模型映射见 `INSTALL.md`。
|
|
65
|
+
>
|
|
66
|
+
> ### 模型选择策略(强制)
|
|
67
|
+
>
|
|
68
|
+
> **MUST 使用国产开源模型**,严禁使用国外昂贵模型(Anthropic Claude、OpenAI GPT、Google Gemini 等)。
|
|
69
|
+
>
|
|
70
|
+
> **允许的模型列表**(从以下国产开源模型厂家中选择):
|
|
71
|
+
>
|
|
72
|
+
> | 厂家 | 可选模型 |
|
|
73
|
+
> |------|---------|
|
|
74
|
+
> | 智谱 GLM | `glm-5.1`, `glm-5.0` |
|
|
75
|
+
> | 月之暗面 Kimi | `kimi-k2.6`, `kimi-k2.5` |
|
|
76
|
+
> | MiniMax | `minimax-m2.7`, `minimax-m2.5` |
|
|
77
|
+
> | 阿里 Qwen | `qwen3.6-plus`, `qwen3.5-plus` |
|
|
78
|
+
> | 深度求索 DeepSeek | `deepseek-v4-pro`, `deepseek-v4-lite` |
|
|
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` 作为轻量备选
|
|
93
|
+
|
|
94
|
+
### 共识阈值
|
|
95
|
+
|
|
96
|
+
| 阈值 | 说明 |
|
|
97
|
+
|------|------|
|
|
98
|
+
| **>=91%** | 推荐默认 |
|
|
99
|
+
| 100% | 完全一致(更严格) |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Delphi 评审执行过程
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
107
|
+
│
|
|
108
|
+
├─ 一致 + >=91% + APPROVED → ✅ 完成
|
|
109
|
+
│
|
|
110
|
+
└─ 不一致 或 <91% 或 REQUEST_CHANGES
|
|
111
|
+
│
|
|
112
|
+
▼
|
|
113
|
+
Round 2: 交换意见 → 共识检查
|
|
114
|
+
│
|
|
115
|
+
├─ 一致 + >=91% + APPROVED → ✅ 完成
|
|
116
|
+
│
|
|
117
|
+
└─ 仍分歧 或 REQUEST_CHANGES
|
|
118
|
+
│
|
|
119
|
+
▼
|
|
120
|
+
Round 3: 最终立场 → 共识检查
|
|
121
|
+
│
|
|
122
|
+
├─ APPROVED → ✅ 完成
|
|
123
|
+
│
|
|
124
|
+
└─ REQUEST_CHANGES → 修复方案 → 回到 Round 2 重新评审
|
|
125
|
+
```
|
|
126
|
+
|
|
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
|
+
## 修复与重新评审
|
|
194
|
+
|
|
195
|
+
如果最终裁决是 REQUEST_CHANGES 或 REJECTED:
|
|
196
|
+
1. 修复所有 Critical Issues + 处理所有 Major Concerns
|
|
197
|
+
2. 重新评审(从 Round 2 起步,不是 Round 1)
|
|
198
|
+
3. 迭代直到 APPROVED
|
|
199
|
+
|
|
200
|
+
修复报告格式:
|
|
201
|
+
```markdown
|
|
202
|
+
## 修复报告
|
|
203
|
+
### Critical Issues 修复 | ### Major Concerns 处理 | ### Minor Concerns 说明
|
|
204
|
+
### 请求重新评审
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 终止条件
|
|
210
|
+
|
|
211
|
+
| 参数 | 默认值 | 说明 |
|
|
212
|
+
|------|--------|------|
|
|
213
|
+
| `max_review_rounds` | 5 | 超过后生成"未达成共识报告",交人决策 |
|
|
214
|
+
| `timeout` | 60min | 单次评审超时 |
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Triggers
|
|
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 ≥91% 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:** ≥91% (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
|
|
284
|
+
|
|
285
|
+
**Example 2: Code walkthrough**
|
|
286
|
+
```bash
|
|
287
|
+
/delphi-review --mode code-walkthrough
|
|
288
|
+
```
|
|
289
|
+
→ Pre-push validation → .code-walkthrough-result.json
|
|
290
|
+
|
|
291
|
+
**Example 3: Chinese trigger**
|
|
292
|
+
```
|
|
293
|
+
User: 评审这个需求文档
|
|
294
|
+
→ Auto-detects delphi-review trigger → dispatches experts
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Output Format (MANDATORY)
|
|
300
|
+
|
|
301
|
+
Every review round output MUST follow this exact JSON structure for design mode:
|
|
302
|
+
|
|
303
|
+
```json
|
|
304
|
+
{
|
|
305
|
+
"expert_id": "A|B|C",
|
|
306
|
+
"round": 1,
|
|
307
|
+
"mode": "design",
|
|
308
|
+
"verdict": "APPROVED|REQUEST_CHANGES|REJECTED",
|
|
309
|
+
"confidence": 9,
|
|
310
|
+
"critical_issues": ["..."],
|
|
311
|
+
"major_concerns": ["..."],
|
|
312
|
+
"minor_concerns": ["..."],
|
|
313
|
+
"consensus_report": {
|
|
314
|
+
"agreed_items": ["..."],
|
|
315
|
+
"disagreed_items": ["..."],
|
|
316
|
+
"final_verdict": "APPROVED|REQUEST_CHANGES",
|
|
317
|
+
"consensus_ratio": 0.95
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**For code-walkthrough mode**, output follows `.code-walkthrough-result.json` schema (see `references/code-walkthrough.md`).
|
|
323
|
+
|
|
324
|
+
**Anti-patterns mapping to assertions:**
|
|
325
|
+
- `Round 1 → 生成报告 → "评审完成"` → Output MUST NOT have `verdict: APPROVED` if `critical_issues` exist.
|
|
326
|
+
- `只处理 Critical,忽略 Major` → Output MUST include `major_concerns` array, even if empty.
|
|
327
|
+
- `用户说"时间紧急"就跳过` → Output MUST include `round` field, proving multi-round process.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Terminal State Checklist
|
|
332
|
+
|
|
333
|
+
<MANDATORY-CHECKLIST>
|
|
334
|
+
|
|
335
|
+
### 你只能在以下条件全部满足后声明"Delphi review complete":
|
|
336
|
+
|
|
337
|
+
**Pre-requisites:**
|
|
338
|
+
- [ ] Phase 0 完成(文档验证 + 专家分配)
|
|
339
|
+
- [ ] Round 1 完成(所有专家匿名独立评审)
|
|
340
|
+
- [ ] Round 2+ 完成(交换意见 / 最终立场)
|
|
341
|
+
|
|
342
|
+
**CRITICAL — 共识验证:**
|
|
343
|
+
- [ ] 问题共识比例 >=91%
|
|
344
|
+
- [ ] 所有 Critical Issues 已解决
|
|
345
|
+
- [ ] 所有 Major Concerns 已处理
|
|
346
|
+
|
|
347
|
+
**CRITICAL — 裁决检查:**
|
|
348
|
+
- [ ] 最终裁决是 **APPROVED** 或 **APPROVED_WITH_MINOR**
|
|
349
|
+
- [ ] 如果 REQUEST_CHANGES → 已修复 → 已重新评审 → APPROVED
|
|
350
|
+
|
|
351
|
+
**Final Requirements:**
|
|
352
|
+
- [ ] 共识报告生成并保存
|
|
353
|
+
- [ ] 用户已确认报告
|
|
354
|
+
- [ ] ⭐ **IF APPROVED (design mode): 提示用户生成 specification.yaml,如用户同意则调用 specification-generator**
|
|
355
|
+
|
|
356
|
+
**IF 裁决是 REQUEST_CHANGES 或 REJECTED → CANNOT claim complete, MUST 修复并重新评审**
|
|
357
|
+
**IF 任何条件未满足 → CANNOT claim complete, MUST BLOCK 并通知用户**
|
|
358
|
+
|
|
359
|
+
### ⭐ APPROVED 后必做
|
|
360
|
+
|
|
361
|
+
**Design mode**:
|
|
362
|
+
|
|
363
|
+
1. **Automatic: 生成 specification.yaml** — 从设计文档提取需求到 specification.yaml。这是 test-specification-alignment 的输入,没有它 test-spec 会进入不推荐的 legacy mode。
|
|
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`:
|
|
388
|
+
|
|
389
|
+
```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
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
**Code-walkthrough mode APPROVED 后** — 必须立即写入 `.sprint-state/delphi-reviewed.json`:
|
|
400
|
+
|
|
401
|
+
```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
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**用途**: Phase 2 BUILD 入口检查 (DELPHI-GATE) 读取此文件。`verdict != "APPROVED"` → 禁止编码。
|
|
412
|
+
|
|
413
|
+
</MANDATORY-CHECKLIST>
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## Anti-Patterns
|
|
418
|
+
|
|
419
|
+
| ❌ 错误 | ✅ 正确 |
|
|
420
|
+
|---------|---------|
|
|
421
|
+
| Round 1 → 生成报告 → "评审完成"(未 APPROVED) | 迭代直到 APPROVED,修复后重新评审 |
|
|
422
|
+
| 只处理 Critical,忽略 Major | 零容忍:Critical/Major 全部必须处理,不可跳过或降级 |
|
|
423
|
+
| 单专家自评 | 至少 2 位不同 provider 的专家 |
|
|
424
|
+
| 用户说"时间紧急"就跳过 | 评审是投资不是开销,跳过后期返工成本更高 |
|
|
425
|
+
| "专家几乎一致"就通过 | "几乎" = 不一致,继续到 >=91% |
|
|
426
|
+
| 使用 Anthropic/GPT/Gemini 等国外昂贵模型 | 必须使用国产开源模型(DeepSeek, Qwen, Kimi, GLM, MiniMax) |
|
|
427
|
+
| 三个专家使用同一厂家模型 | 必须来自至少 2 家不同厂家 |
|
|
428
|
+
|
|
429
|
+
**Code-walkthrough 专属 Anti-Patterns**: 详见 `references/code-walkthrough.md`。
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Red Flags
|
|
434
|
+
|
|
435
|
+
| 借口 | 现实 |
|
|
436
|
+
|------|------|
|
|
437
|
+
| "这只是小变更" | 所有变更都需要评审 |
|
|
438
|
+
| "Round 1 就够了" | 不够,必须多轮直到共识 |
|
|
439
|
+
| "生成报告就完成了" | APPROVED 才算完成 |
|
|
440
|
+
| "2/3 同意就是共识" | 还要检查问题共识比例 >=91% |
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## 成功标准
|
|
445
|
+
|
|
446
|
+
**Delphi 评审完成的唯一标准:**
|
|
447
|
+
1. ✅ 所有专家裁决 APPROVED
|
|
448
|
+
2. ✅ 问题共识 >=91%
|
|
449
|
+
3. ✅ 所有 Critical Issues 已修复验证
|
|
450
|
+
4. ✅ 所有 Major Concerns 已处理
|
|
451
|
+
5. ✅ 共识报告已生成
|
|
452
|
+
6. ✅ 用户已确认
|
|
453
|
+
|
|
454
|
+
**缺少任何一项 = 未完成**
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": [
|
|
3
|
+
"Delphi Review Agent Configuration Template",
|
|
4
|
+
"===========================================",
|
|
5
|
+
"Copy the relevant 'agent' block below into your opencode.json.",
|
|
6
|
+
"Replace YOUR_PROVIDER/YOUR_MODEL with your actual provider and model names.",
|
|
7
|
+
"At least 2 of the 3 agents should use different providers for cross-bias protection."
|
|
8
|
+
],
|
|
9
|
+
|
|
10
|
+
"$example_providers": {
|
|
11
|
+
"OpenAI": "openai/gpt-4o",
|
|
12
|
+
"Anthropic": "anthropic/claude-sonnet-4-20250514",
|
|
13
|
+
"Ali_Bailian": "bailian-coding-plan/qwen3.6-plus",
|
|
14
|
+
"Google_Gemini": "google/gemini-2.5-pro",
|
|
15
|
+
"DeepSeek": "deepseek/deepseek-chat"
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"agent": {
|
|
19
|
+
"delphi-reviewer-architecture": {
|
|
20
|
+
"description": "Delphi expert reviewer for architecture perspective. Focuses on requirements alignment, system design, and high-level coherence.",
|
|
21
|
+
"mode": "subagent",
|
|
22
|
+
"model": "YOUR_PROVIDER/YOUR_MODEL_A",
|
|
23
|
+
"prompt": "You are a Delphi expert reviewer specializing in architecture and requirements alignment. Review the input for: 1) Alignment with stated goals 2) Architectural coherence 3) System-level implications 4) Trade-offs and alternatives. Output structured review with verdict (APPROVED/REQUEST_CHANGES/REJECTED) and confidence level.",
|
|
24
|
+
"tools": {
|
|
25
|
+
"read": true,
|
|
26
|
+
"bash": true,
|
|
27
|
+
"write": false,
|
|
28
|
+
"edit": false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"delphi-reviewer-technical": {
|
|
32
|
+
"description": "Delphi expert reviewer for technical depth. Focuses on implementation details, code correctness, and edge cases. Used in delphi-review.",
|
|
33
|
+
"mode": "subagent",
|
|
34
|
+
"model": "YOUR_PROVIDER/YOUR_MODEL_B",
|
|
35
|
+
"prompt": "You are a Delphi expert reviewer specializing in technical implementation. Review the input for: 1) Implementation correctness 2) Code quality and patterns 3) Edge cases and error handling 4) Performance implications. Output structured review with verdict (APPROVED/REQUEST_CHANGES/REJECTED) and confidence level.",
|
|
36
|
+
"tools": {
|
|
37
|
+
"read": true,
|
|
38
|
+
"bash": true,
|
|
39
|
+
"write": false,
|
|
40
|
+
"edit": false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"delphi-reviewer-feasibility": {
|
|
44
|
+
"description": "Delphi expert reviewer for feasibility analysis. Focuses on practical constraints, risks, and execution viability. Used in delphi-review.",
|
|
45
|
+
"mode": "subagent",
|
|
46
|
+
"model": "YOUR_PROVIDER/YOUR_MODEL_C",
|
|
47
|
+
"prompt": "You are a Delphi expert reviewer specializing in feasibility and risk analysis. Review the input for: 1) Practical constraints (time, resources, dependencies) 2) Risk identification and mitigation 3) Execution complexity 4) Alternative approaches. Output structured review with verdict (APPROVED/REQUEST_CHANGES/REJECTED) and confidence level.",
|
|
48
|
+
"tools": {
|
|
49
|
+
"read": true,
|
|
50
|
+
"bash": true,
|
|
51
|
+
"write": false,
|
|
52
|
+
"edit": false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|