@boyingliu01/xp-gate 0.18.5 → 0.19.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/adapter-common.sh +27 -0
- package/adapters/gate-3.sh +0 -0
- package/adapters/gate-4.sh +0 -0
- package/adapters/gate-7.sh +0 -0
- package/adapters/gate-8.sh +0 -0
- package/adapters/gate-9.sh +0 -0
- package/adapters/powershell.sh +85 -33
- package/adapters/typescript.sh +8 -8
- package/build-integrity/__tests__/import-resolver.test.ts +22 -0
- package/build-integrity/__tests__/orchestrator.test.ts +1 -2
- package/build-integrity/gate-10.ts +7 -0
- package/gate-12-file-hygiene.sh +230 -0
- package/hooks/adapter-common.sh +27 -0
- package/hooks/gate-10.sh +105 -0
- package/hooks/gate-12-file-hygiene.sh +0 -0
- package/hooks/lib/validate-code-walkthrough.cjs +125 -0
- package/hooks/pre-commit +130 -33
- package/hooks/pre-push +15 -91
- package/lib/__tests__/check-version.test.js +67 -46
- package/lib/__tests__/doctor.test.js +7 -6
- package/lib/__tests__/gate-runner.test.js +267 -0
- package/lib/__tests__/init.test.js +32 -0
- package/lib/__tests__/npm-package.test.js +13 -0
- package/lib/__tests__/phase-transition.test.js +604 -12
- package/lib/__tests__/sprint-discovery.test.ts +0 -1
- package/lib/__tests__/sprint-status-rework.test.js +100 -1
- package/lib/__tests__/update-hooks.test.js +143 -10
- package/lib/__tests__/upgrade-exec.test.js +73 -45
- package/lib/__tests__/upgrade-skill-sync.test.js +1 -1
- package/lib/__tests__/upgrade.test.js +12 -11
- package/lib/doctor.js +2 -1
- package/lib/gate-runner.js +68 -23
- package/lib/init.js +34 -5
- package/lib/install-skill.js +1 -0
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/phase-transition.js +203 -23
- package/lib/shared-paths.js +2 -0
- package/lib/sprint-status.js +15 -4
- package/lib/test-alignment.ts +3 -13
- package/lib/update-hooks.js +129 -15
- package/mock-policy/AGENTS.md +5 -5
- package/mock-policy/__tests__/gate-m3.test.ts +0 -5
- package/mock-policy/__tests__/scope-scanner.test.ts +8 -2
- package/mutation/AGENTS.md +4 -4
- package/mutation/__tests__/mutmut-runner.test.ts +443 -2
- package/mutation/__tests__/update-baseline.test.ts +0 -2
- package/mutation/runners/mutmut-runner.ts +67 -17
- package/package.json +9 -3
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +24 -27
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +13 -12
- package/plugins/claude-code/skills/delphi-review/INSTALL.md +15 -17
- package/plugins/claude-code/skills/delphi-review/SKILL.md +30 -29
- package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/plugins/claude-code/skills/delphi-review/references/requirements.md +66 -54
- package/plugins/claude-code/skills/delphi-review/references/round-templates.md +7 -7
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +5 -5
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +4 -4
- package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +2 -2
- package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +37 -35
- package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +24 -14
- package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +6 -6
- package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +2 -2
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/dsh/README.md +25 -0
- package/plugins/dsh/cordis.patch.yml +7 -0
- package/plugins/dsh/package.json +70 -0
- package/plugins/dsh/scripts/prepack.cjs +82 -0
- package/plugins/dsh/skills/admin-template-guidelines/SKILL.md +113 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-1.md +91 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-2.md +155 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-3.md +70 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-4.md +154 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-5.md +126 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-6.md +180 -0
- package/plugins/dsh/skills/batch-grill-me/SKILL.md +15 -0
- package/plugins/dsh/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/dsh/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/dsh/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/dsh/skills/delphi-review/.delphi-config.json.example +70 -0
- package/plugins/dsh/skills/delphi-review/AGENTS.md +67 -0
- package/plugins/dsh/skills/delphi-review/INSTALL.md +150 -0
- package/plugins/dsh/skills/delphi-review/SKILL.md +559 -0
- package/plugins/dsh/skills/delphi-review/hooks.md +19 -0
- package/plugins/dsh/skills/delphi-review/opencode.json.delphi.example +52 -0
- package/plugins/dsh/skills/delphi-review/references/code-walkthrough.md +470 -0
- package/plugins/dsh/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
- package/plugins/dsh/skills/delphi-review/references/requirements.md +402 -0
- package/plugins/dsh/skills/delphi-review/references/round-templates.md +134 -0
- package/plugins/dsh/skills/delphi-review/scripts/verify-consensus.sh +43 -0
- package/plugins/dsh/skills/delphi-review/tools.md +29 -0
- package/plugins/dsh/skills/domain-modeling/ADR-FORMAT.md +64 -0
- package/plugins/dsh/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/plugins/dsh/skills/domain-modeling/SKILL.md +74 -0
- package/plugins/dsh/skills/grill-with-docs/SKILL.md +7 -0
- package/plugins/dsh/skills/grilling/SKILL.md +12 -0
- package/plugins/dsh/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/dsh/skills/ralph-loop/SKILL.md +198 -0
- package/plugins/dsh/skills/ralph-loop/references/components.md +113 -0
- package/plugins/dsh/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/dsh/skills/ralph-loop/references/workflow-details.md +99 -0
- package/plugins/dsh/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +103 -0
- package/plugins/dsh/skills/sprint-flow/SKILL.md +411 -0
- package/plugins/dsh/skills/sprint-flow/__tests__/sprint-flow.test.cjs +457 -0
- package/plugins/dsh/skills/sprint-flow/hooks.md +18 -0
- package/plugins/dsh/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/dsh/skills/sprint-flow/references/components/middleware.md +75 -0
- package/plugins/dsh/skills/sprint-flow/references/components/skill-invocations.md +105 -0
- package/plugins/dsh/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/dsh/skills/sprint-flow/references/components/tool-descriptions.md +95 -0
- package/plugins/dsh/skills/sprint-flow/references/force-levels.md +204 -0
- package/plugins/dsh/skills/sprint-flow/references/orchestration-rules.md +236 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-1-prep.md +294 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-2-design.md +273 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-3-build.md +348 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-4-verify.md +225 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-5-ship.md +222 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-6-close.md +266 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-overview.md +486 -0
- package/plugins/dsh/skills/sprint-flow/scripts/verify-sprint-state.sh +38 -0
- package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-output-template.md +110 -0
- package/plugins/dsh/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/dsh/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/dsh/skills/sprint-flow/templates/sprint-progress-template.md +140 -0
- package/plugins/dsh/skills/sprint-flow/templates/sprint-summary-template.md +121 -0
- package/plugins/dsh/skills/sprint-flow/tools.md +29 -0
- package/plugins/dsh/skills/test-driven-development/SKILL.md +371 -0
- package/plugins/dsh/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/dsh/skills/test-specification-alignment/SKILL.md +205 -0
- package/plugins/dsh/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/dsh/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/dsh/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/dsh/skills/to-issues/SKILL.md +277 -0
- package/plugins/dsh/src/command.test.ts +102 -0
- package/plugins/dsh/src/command.ts +75 -0
- package/plugins/dsh/src/contract.test.ts +62 -0
- package/plugins/dsh/src/gate-runner.test.ts +100 -0
- package/plugins/dsh/src/gate-runner.ts +58 -0
- package/plugins/dsh/src/index.test.ts +97 -0
- package/plugins/dsh/src/index.ts +94 -0
- package/plugins/dsh/src/skills.test.ts +58 -0
- package/plugins/dsh/tsconfig.build.json +13 -0
- package/plugins/dsh/tsconfig.json +19 -0
- package/plugins/dsh/vitest.config.ts +8 -0
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/scripts/prepack.cjs +1 -0
- package/plugins/opencode/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/opencode/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/opencode/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +24 -27
- package/plugins/opencode/skills/delphi-review/AGENTS.md +13 -12
- package/plugins/opencode/skills/delphi-review/INSTALL.md +15 -17
- package/plugins/opencode/skills/delphi-review/SKILL.md +30 -29
- package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/plugins/opencode/skills/delphi-review/references/requirements.md +66 -54
- package/plugins/opencode/skills/delphi-review/references/round-templates.md +7 -7
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +5 -5
- package/plugins/opencode/skills/sprint-flow/SKILL.md +4 -4
- package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +2 -2
- package/plugins/opencode/skills/sprint-flow/references/force-levels.md +37 -35
- package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +1 -1
- package/plugins/opencode/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +24 -14
- package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +6 -6
- package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +2 -2
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/SKILL.md +47 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +3 -11
- package/plugins/qoder/skills/delphi-review/AGENTS.md +15 -17
- package/plugins/qoder/skills/delphi-review/INSTALL.md +12 -12
- package/plugins/qoder/skills/delphi-review/SKILL.md +58 -25
- package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +1 -1
- package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +5 -5
- package/plugins/qoder/skills/sprint-flow/SKILL.md +2 -2
- package/plugins/qoder/skills/sprint-flow/references/force-levels.md +38 -35
- package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +48 -6
- package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +5 -6
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
- package/principles/AGENTS.md +4 -4
- package/scripts/__tests__/sync-package-content.test.js +30 -0
- package/scripts/delphi-external-review.cjs +194 -63
- package/scripts/sync-package-content.js +9 -2
- package/skills/clipboard-vision/SKILL.md +47 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/skills/delphi-review/.delphi-config.json.example +24 -27
- package/skills/delphi-review/AGENTS.md +13 -12
- package/skills/delphi-review/INSTALL.md +15 -17
- package/skills/delphi-review/SKILL.md +30 -29
- package/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/skills/delphi-review/references/requirements.md +66 -54
- package/skills/delphi-review/references/round-templates.md +7 -7
- package/skills/sprint-flow/AGENTS.md +5 -5
- package/skills/sprint-flow/SKILL.md +4 -4
- package/skills/sprint-flow/references/components/skill-invocations.md +2 -2
- package/skills/sprint-flow/references/force-levels.md +37 -35
- package/skills/sprint-flow/references/orchestration-rules.md +1 -1
- package/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/skills/sprint-flow/references/phase-2-design.md +24 -14
- package/skills/sprint-flow/references/phase-4-verify.md +6 -6
- package/skills/sprint-flow/references/phase-overview.md +2 -2
- package/skills/test-specification-alignment/AGENTS.md +4 -4
- package/sprint-gate.sh +291 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
# Requirements Mode Reference
|
|
2
|
+
|
|
3
|
+
> Extracted from `SKILL.md`. This file contains ALL content specific to the `requirements` mode of Delphi Review.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
需求评审模式,用于 grill-with-docs 完成共享理解后、设计文档生成前,对需求完整性进行轻量级多专家 Delphi 评审。
|
|
10
|
+
|
|
11
|
+
**触发命令**: `/delphi-review --mode requirements`
|
|
12
|
+
|
|
13
|
+
**设计背景**: Issue #368 识别出原始意图中"需求评审一次 + 设计评审一次"的第一次评审被完全丢弃。本模式恢复该评审点,在需求探索(grill-with-docs)与设计文档生成之间插入一道轻量质量门禁。
|
|
14
|
+
|
|
15
|
+
**定位**:
|
|
16
|
+
- **固定三专家**: architecture + technical + feasibility,最多 5 轮
|
|
17
|
+
- **需求焦点**: 评审对象是需求陈述 + CONTEXT.md,不是设计文档或代码
|
|
18
|
+
- **程序化阻塞**: 输出 `requirements-reviewed.json`,由 `phase-transition 2 completed` 校验
|
|
19
|
+
- **防陈旧绑定**: `requirements_hash`(SHA-256)绑定需求内容,防止旧证据复用
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Five Core Properties
|
|
24
|
+
|
|
25
|
+
1. **匿名性** — Expert A/B/C 互不知道对方意见(Round 1)
|
|
26
|
+
2. **迭代共识** — GAPS_FOUND 时回到 grill-with-docs 补充,最多 5 轮循环
|
|
27
|
+
3. **关键缺口零容忍** — Critical requirement gaps 必须在进入设计前解决
|
|
28
|
+
4. **防陈旧绑定** — requirements_hash 绑定需求内容 + CONTEXT.md,旧证据不可复用
|
|
29
|
+
5. **执行可验证** — 三个专家都必须成功返回结构化结果,且 requested_model 三个 distinct
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 触发条件
|
|
34
|
+
|
|
35
|
+
- **自动触发**: sprint-flow Phase 2 THINK 链中,grill-with-docs 完成后、设计文档生成前(参见 `skills/sprint-flow/references/phase-2-design.md` Step 2)
|
|
36
|
+
- **手动触发**: `/delphi-review --mode requirements`
|
|
37
|
+
|
|
38
|
+
**⚠️ 重要调用方式说明**:
|
|
39
|
+
|
|
40
|
+
- ✅ **正确**: sprint-flow 编排层在 Phase 2 Step 2 自动调用
|
|
41
|
+
- ✅ **正确**: 在 Agent session 中执行 `/delphi-review --mode requirements`
|
|
42
|
+
- ❌ **错误**: 在设计文档已生成后调用(应在设计前)
|
|
43
|
+
- ❌ **错误**: 用 requirements 模式评审设计文档或代码(那是 design / code-walkthrough 模式的职责)
|
|
44
|
+
|
|
45
|
+
**与 sprint-flow 的集成**:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
sprint-flow Phase 2 THINK:
|
|
49
|
+
Step 0: CONTEXT.md 预检
|
|
50
|
+
Step 1: grill-with-docs(需求访谈)
|
|
51
|
+
Step 2: delphi-review --mode requirements ← 本模式
|
|
52
|
+
Step 3: 原生设计文档生成
|
|
53
|
+
Step 4: HARD-GATE(用户审批设计文档)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
所有 Sprint 路径都执行 R1。Force level 只调整上下文深度和后续迭代预算,不跳过需求评审,也不减少三位专家执行。
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 流程概览
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
grill-with-docs (completed)
|
|
64
|
+
│
|
|
65
|
+
▼
|
|
66
|
+
delphi-review --mode requirements
|
|
67
|
+
│
|
|
68
|
+
├─→ Context gather: CONTEXT.md + grill session summary + user requirements statement
|
|
69
|
+
│
|
|
70
|
+
├─→ Expert A (architecture) anonymous review — focus: requirements completeness,
|
|
71
|
+
│ requirement→AC coverage, scenario coverage
|
|
72
|
+
│
|
|
73
|
+
├─→ Expert B (technical) anonymous review — focus: technical clarity and edge cases
|
|
74
|
+
│
|
|
75
|
+
├─→ Expert C (feasibility) anonymous review — focus: testability of acceptance criteria,
|
|
76
|
+
│ user persona clarity, scope boundaries
|
|
77
|
+
│
|
|
78
|
+
├─→ Consensus check
|
|
79
|
+
│ │
|
|
80
|
+
│ ├─→ All three APPROVED → write requirements-reviewed.json verdict=APPROVED
|
|
81
|
+
│ │
|
|
82
|
+
│ └─→ Any GAPS_FOUND → record gaps, set verdict=GAPS_FOUND
|
|
83
|
+
│
|
|
84
|
+
└─→ Return to sprint-flow orchestrator
|
|
85
|
+
│
|
|
86
|
+
├─→ APPROVED → proceed to design doc generation
|
|
87
|
+
└─→ GAPS_FOUND → loop back to grill-with-docs (up to 5 total rounds)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 专家角色
|
|
93
|
+
|
|
94
|
+
| 专家 | 视角 | 配置 |
|
|
95
|
+
|------|------|------|
|
|
96
|
+
| Expert A (architecture) | 需求完整性 + 需求→AC 映射 + 场景覆盖 | `.delphi-config.json` → `experts.architecture` |
|
|
97
|
+
| Expert B (technical) | 技术清晰度 + 边界条件 + 实现约束 | `.delphi-config.json` → `experts.technical` |
|
|
98
|
+
| Expert C (feasibility) | AC 可测试性 + 用户画像 + 范围边界 | `.delphi-config.json` → `experts.feasibility` |
|
|
99
|
+
|
|
100
|
+
> 三个角色必须使用三个 distinct trimmed executable model IDs。Provider、vendor、gateway 和模型国籍均不受限制;一个 provider 和 token plan 可以服务全部三个角色。
|
|
101
|
+
|
|
102
|
+
**专家选择理由**:
|
|
103
|
+
- **architecture 专家**: 天然映射范围/覆盖到需求层面——需求完整性、需求→AC 映射、场景覆盖、领域术语一致性
|
|
104
|
+
- **feasibility 专家**: 天然映射可测试性/假设到验收标准——AC 可测试性、用户画像清晰度、范围边界、隐含假设
|
|
105
|
+
- **technical 专家**: 检查需求中的技术清晰度、边界条件和实现约束
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 评审焦点(模式切换指令)
|
|
110
|
+
|
|
111
|
+
### Expert A (architecture) — 需求模式焦点
|
|
112
|
+
|
|
113
|
+
| 维度 | 检查内容 |
|
|
114
|
+
|------|---------|
|
|
115
|
+
| **需求完整性** | 所有用户场景是否已覆盖,是否有遗漏的用例路径 |
|
|
116
|
+
| **需求→AC 映射** | 每个需求是否有对应的验收标准,映射是否完整 |
|
|
117
|
+
| **场景覆盖** | 正常流、异常流、边界场景是否均已识别 |
|
|
118
|
+
| **领域术语一致性** | 需求陈述中的术语是否与 CONTEXT.md 领域模型一致(交叉引用) |
|
|
119
|
+
| **AC 精确度** | 验收标准是否具体、可度量、无歧义 |
|
|
120
|
+
|
|
121
|
+
### Expert C (feasibility) — 需求模式焦点
|
|
122
|
+
|
|
123
|
+
| 维度 | 检查内容 |
|
|
124
|
+
|------|---------|
|
|
125
|
+
| **AC 可测试性** | 每个验收标准是否可被自动化或手动测试验证 |
|
|
126
|
+
| **用户画像清晰度** | 目标用户/角色是否明确定义,场景是否贴合真实使用 |
|
|
127
|
+
| **范围边界清晰度** | 需求边界(in-scope vs out-of-scope)是否明确划定 |
|
|
128
|
+
| **需求间依赖** | 需求之间是否存在隐含依赖或冲突 |
|
|
129
|
+
| **隐含假设** | 是否存在未明确声明的假设(技术、业务、环境) |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 共识标准
|
|
134
|
+
|
|
135
|
+
| 条件 | 结果 |
|
|
136
|
+
|------|------|
|
|
137
|
+
| 3/3 successful APPROVED + 无 Critical gaps | ✅ verdict=APPROVED,进入设计文档生成 |
|
|
138
|
+
| 3/3 successful APPROVED + 有 Minor gaps | ✅ verdict=APPROVED(记录 gaps 供参考) |
|
|
139
|
+
| 任一专家失败或缺失 | ❌ BLOCK,不能聚合或降级 |
|
|
140
|
+
| 任一专家 GAPS_FOUND | ❌ verdict=GAPS_FOUND,记录 gaps |
|
|
141
|
+
| 有 Critical requirement gaps | ❌ verdict=GAPS_FOUND |
|
|
142
|
+
|
|
143
|
+
**共识要求**: 三个成功结果全部参与聚合,达到 >=90% 且最终 APPROVED。单个专家结果不能代表全局批准。
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 循环控制(Loop Semantics)
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
Round 1: delphi-review --mode requirements
|
|
151
|
+
│
|
|
152
|
+
├─→ APPROVED → 完成,进入设计文档生成
|
|
153
|
+
│
|
|
154
|
+
└─→ GAPS_FOUND
|
|
155
|
+
│
|
|
156
|
+
├─→ gaps 记录到 requirements-reviewed.json
|
|
157
|
+
├─→ 返回 sprint-flow → grill-with-docs 补充访谈
|
|
158
|
+
│
|
|
159
|
+
▼
|
|
160
|
+
Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
|
|
161
|
+
│
|
|
162
|
+
├─→ APPROVED → 完成,进入设计文档生成
|
|
163
|
+
│
|
|
164
|
+
└─→ GAPS_FOUND
|
|
165
|
+
│
|
|
166
|
+
└─→ escalation_needed: true
|
|
167
|
+
→ sprint-flow Phase 2 处理升级 UX(交用户决策)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**硬性限制**:
|
|
171
|
+
- **最多 5 轮**(Round 1 + 可选后续轮次)
|
|
172
|
+
- **禁止无界循环** — Round 5 后仍 GAPS_FOUND 必须升级
|
|
173
|
+
- **Round 2 上下文**: 专家看到 Round 1 的 gaps 列表,评估是否已修复
|
|
174
|
+
- **升级语义**: `escalation_needed: true` 写入 requirements-reviewed.json,sprint-flow 负责 UX
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 输出格式
|
|
179
|
+
|
|
180
|
+
### 证据文件: `.sprint-state/phase-outputs/requirements-reviewed.json`
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mode": "requirements",
|
|
185
|
+
"verdict": "APPROVED",
|
|
186
|
+
"timestamp": "2026-07-25T10:30:00Z",
|
|
187
|
+
"consensus_ratio": 1.0,
|
|
188
|
+
"requirements_hash": "7f650ddf715ebe75ca0317efa1e8618ae39d2c0bafea7a6f85aacfdbf3735a5f",
|
|
189
|
+
"head_commit": "abc123def456789...",
|
|
190
|
+
"context_file_used": null,
|
|
191
|
+
"round": 1,
|
|
192
|
+
"expert_verdicts": [
|
|
193
|
+
{ "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/qwen-plus" },
|
|
194
|
+
{ "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/deepseek-v3" },
|
|
195
|
+
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/glm-4.5" }
|
|
196
|
+
],
|
|
197
|
+
"requirements_statement": "实现用户注册流程,支持邮箱验证和密码重置",
|
|
198
|
+
"gaps_found": [],
|
|
199
|
+
"rounds_used": 1,
|
|
200
|
+
"escalation_needed": false
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### GAPS_FOUND 示例
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"mode": "requirements",
|
|
209
|
+
"verdict": "GAPS_FOUND",
|
|
210
|
+
"timestamp": "2026-07-25T10:30:00Z",
|
|
211
|
+
"consensus_ratio": 0.67,
|
|
212
|
+
"requirements_hash": "7f650ddf715ebe75ca0317efa1e8618ae39d2c0bafea7a6f85aacfdbf3735a5f",
|
|
213
|
+
"head_commit": "abc123def456789...",
|
|
214
|
+
"context_file_used": null,
|
|
215
|
+
"round": 1,
|
|
216
|
+
"expert_verdicts": [
|
|
217
|
+
{ "role": "architecture", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-a" },
|
|
218
|
+
{ "role": "technical", "verdict": "GAPS_FOUND", "confidence": 7, "result_type": "delphi_expert_result", "requested_model": "provider/model-b" },
|
|
219
|
+
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c" }
|
|
220
|
+
],
|
|
221
|
+
"requirements_statement": "实现用户注册流程,支持邮箱验证和密码重置",
|
|
222
|
+
"gaps_found": [
|
|
223
|
+
"密码重置的过期时间未定义",
|
|
224
|
+
"邮箱验证失败的重试策略缺失",
|
|
225
|
+
"AC-003 不可测试:'系统应快速响应' 无量化指标"
|
|
226
|
+
],
|
|
227
|
+
"rounds_used": 1,
|
|
228
|
+
"escalation_needed": false
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 字段说明
|
|
233
|
+
|
|
234
|
+
| 字段 | 类型 | 说明 |
|
|
235
|
+
|------|------|------|
|
|
236
|
+
| `mode` | string | 固定值 `"requirements"` |
|
|
237
|
+
| `verdict` | string | `APPROVED` 或 `GAPS_FOUND` |
|
|
238
|
+
| `timestamp` | string | 评审完成时间 (ISO 8601 UTC) |
|
|
239
|
+
| `consensus_ratio` | number | 三位专家的共识比例;APPROVED 必须为 `0.90` 至 `1.0` |
|
|
240
|
+
| `requirements_hash` | string | SHA-256 hex digest(防陈旧绑定,见下文) |
|
|
241
|
+
| `head_commit` | string | 当前 `git rev-parse HEAD` |
|
|
242
|
+
| `context_file_used` | string \| null | 项目根目录内引用的 context 文件相对路径;未使用时为 `null` 或空字符串 |
|
|
243
|
+
| `round` | number | 当前轮次(1 至 5) |
|
|
244
|
+
| `expert_verdicts` | array | 三位专家的成功结构化结果,包含 `result_type` 和 `requested_model` |
|
|
245
|
+
| `requirements_statement` | string | 被评审需求的简短摘要 |
|
|
246
|
+
| `gaps_found` | array | GAPS_FOUND 时的缺口列表(APPROVED 时为空数组) |
|
|
247
|
+
| `rounds_used` | number | 实际使用的轮次数 |
|
|
248
|
+
| `escalation_needed` | boolean | Round 5 后仍 GAPS_FOUND 时为 `true` |
|
|
249
|
+
|
|
250
|
+
### 状态文件: `.sprint-state/delphi-reviewed.json`
|
|
251
|
+
|
|
252
|
+
APPROVED 时同步写入状态文件(与 design / code-walkthrough 模式一致):
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"mode": "requirements",
|
|
257
|
+
"timestamp": "2026-07-25T10:30:00Z",
|
|
258
|
+
"verdict": "APPROVED",
|
|
259
|
+
"consensus_ratio": 1.0
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
> 此文件供 `verify-consensus.sh` 校验。GAPS_FOUND 时**不写入**此文件(评审未完成)。
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Hash 绑定(防陈旧绑定 — §8.4)
|
|
268
|
+
|
|
269
|
+
`requirements_hash` = SHA-256 of:
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**计算规则**:
|
|
276
|
+
1. 从 evidence `timestamp` 解析严格有效的 ISO 8601 UTC 时间,并取其 `YYYY-MM-DD` 前缀
|
|
277
|
+
2. 若 `context_file_used` 非空,只允许项目根目录内的相对路径;拒绝绝对路径、`..` 穿越、缺失/非普通文件,以及 realpath 逃出项目根目录的符号链接
|
|
278
|
+
3. 按 UTF-8 原样读取 context 文件,不添加分隔符或换行;拼接精确字符串 `requirements_statement + context content + YYYY-MM-DD`
|
|
279
|
+
4. 对拼接结果计算 SHA-256;生成值使用 64 位小写 hex,校验时大小写不敏感
|
|
280
|
+
5. 未使用 context 时,精确拼接 `requirements_statement + YYYY-MM-DD`
|
|
281
|
+
|
|
282
|
+
**目的**: 防止旧证据复用。`phase-transition 2 completed` 校验时:
|
|
283
|
+
- 文件必须存在
|
|
284
|
+
- `verdict` 必须为 `APPROVED`
|
|
285
|
+
- `requirements_hash` 必须为 64 位 hex,并与运行时重新计算值匹配
|
|
286
|
+
- 若 hash 与当前需求内容不匹配 → BLOCK(防陈旧绑定)
|
|
287
|
+
|
|
288
|
+
**与 phase-transition.js 的集成**:
|
|
289
|
+
|
|
290
|
+
```javascript
|
|
291
|
+
// EVIDENCE_FILES[2] — 已存在于 phase-transition.js
|
|
292
|
+
{
|
|
293
|
+
path: '.sprint-state/phase-outputs/requirements-reviewed.json',
|
|
294
|
+
requiredFields: [
|
|
295
|
+
'verdict', 'requirements_statement', 'timestamp', 'consensus_ratio',
|
|
296
|
+
'expert_verdicts', 'head_commit', 'requirements_hash'
|
|
297
|
+
],
|
|
298
|
+
blockingCheck: (data) => data.verdict === 'APPROVED',
|
|
299
|
+
blockingMessage: 'Requirements review verdict is not APPROVED',
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## 证据文件路径
|
|
306
|
+
|
|
307
|
+
| 文件 | 路径 | 校验时机 | 校验方 |
|
|
308
|
+
|------|------|----------|--------|
|
|
309
|
+
| requirements-reviewed.json | `.sprint-state/phase-outputs/` | `phase-transition 2 completed` | phase-transition.js Layer 2 |
|
|
310
|
+
| delphi-reviewed.json | `.sprint-state/` | verify-consensus.sh | verify-consensus.sh |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Anti-Patterns
|
|
315
|
+
|
|
316
|
+
**只在 `--mode requirements` 时适用:**
|
|
317
|
+
|
|
318
|
+
| ❌ Don't | ✅ Do | Why |
|
|
319
|
+
|----------|------|-----|
|
|
320
|
+
| 使用少于 3 个专家 | 必须使用 architecture + technical + feasibility | 三个角色共同构成全局证据 |
|
|
321
|
+
| 无界循环评审 | 最多 5 轮,之后升级 | 防止无限循环 |
|
|
322
|
+
| 跳过 CONTEXT.md 交叉引用 | 始终交叉引用领域术语 | 需求应使用 CONTEXT.md 中的规范术语 |
|
|
323
|
+
| 输出泛化批准 | 输出 hash 绑定的需求陈述 | 防陈旧绑定(§8.4,Round 1 设计反馈 #14) |
|
|
324
|
+
| 接受单个专家批准 | 要求三份成功结果参与聚合,并达到 >=90% 共识 | 单个结果不能代表全局批准 |
|
|
325
|
+
| Round 2 中复用 Round 1 gaps 作为新发现 | Round 2 专家获得 Round 1 gaps 上下文 | 迭代改进,避免重复劳动 |
|
|
326
|
+
| 评审设计文档或代码 | 仅评审需求陈述 + CONTEXT.md | 设计/代码评审是 design / code-walkthrough 模式的职责 |
|
|
327
|
+
| GAPS_FOUND 时写入 delphi-reviewed.json | 仅 APPROVED 时写入状态文件 | GAPS_FOUND 表示评审未完成 |
|
|
328
|
+
| 在 lightweight sprint 中减少或跳过 R1 | 所有路径都执行三专家 R1,仅缩短上下文 | Force level 不改变专家数或批准证据 |
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Security Notes
|
|
333
|
+
|
|
334
|
+
- **只读评审**: requirements 模式不修改任何源文件,仅写入证据文件到 `.sprint-state/`
|
|
335
|
+
- **Hash 完整性**: `requirements_hash` 使用 SHA-256,防止需求内容被篡改后复用旧证据
|
|
336
|
+
- **Commit 绑定**: `head_commit` 记录评审时的 git HEAD,提供时间线追溯
|
|
337
|
+
- **调用边界**: 评审内容只传递给用户配置的 callable provider;provider、vendor、gateway 和模型国籍不作额外限制
|
|
338
|
+
- **证据不可伪造**: phase-transition.js 程序化校验证据文件,LLM 无法绕过
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Triggers / Negative Triggers
|
|
343
|
+
|
|
344
|
+
**触发(requirements 模式特有)**:
|
|
345
|
+
- `/delphi-review --mode requirements`
|
|
346
|
+
- "review the requirements"
|
|
347
|
+
- "评审需求"
|
|
348
|
+
- "requirements review"
|
|
349
|
+
- "/requirements-review"
|
|
350
|
+
|
|
351
|
+
**不触发**:
|
|
352
|
+
- "review my requirements document"(教育性讨论,非执行评审)
|
|
353
|
+
- "requirements template"(询问模板格式)
|
|
354
|
+
- "how to write requirements"(教育性)
|
|
355
|
+
- "check my requirements"(模糊,可能是 Casual 检查)
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## Terminal State Checklist (requirements mode)
|
|
360
|
+
|
|
361
|
+
**Pre-requisites (MANDATORY - BLOCK if missing):**
|
|
362
|
+
- [ ] grill-with-docs 已完成(或 CONTEXT.md 快速路径)
|
|
363
|
+
- [ ] 需求陈述可用(非空)
|
|
364
|
+
- [ ] Expert A (architecture)、Expert B (technical)、Expert C (feasibility) 均成功执行
|
|
365
|
+
- [ ] 三个 `requested_model` trimmed 后 distinct
|
|
366
|
+
- [ ] 三份结果均为 `result_type=delphi_expert_result`
|
|
367
|
+
|
|
368
|
+
**CRITICAL - 共识验证 (requirements):**
|
|
369
|
+
- [ ] 聚合共识 >=90%,且所有 Critical gaps 已处理
|
|
370
|
+
- [ ] 无 Critical requirement gaps 未解决
|
|
371
|
+
- [ ] requirements_hash 已计算并写入
|
|
372
|
+
|
|
373
|
+
**Final Requirements (requirements):**
|
|
374
|
+
- [ ] `.sprint-state/phase-outputs/requirements-reviewed.json` 已写入
|
|
375
|
+
- [ ] JSON 格式有效,包含所有必需字段
|
|
376
|
+
- [ ] verdict 为 APPROVED 或 GAPS_FOUND
|
|
377
|
+
- [ ] IF APPROVED: `.sprint-state/delphi-reviewed.json` 已写入(mode=requirements)
|
|
378
|
+
- [ ] IF GAPS_FOUND: gaps_found 数组非空,escalation_needed 正确设置
|
|
379
|
+
- [ ] IF Round 5 后仍 GAPS_FOUND: escalation_needed = true
|
|
380
|
+
|
|
381
|
+
**IF 任何 Pre-requisite 缺失:**
|
|
382
|
+
- **CANNOT 完成评审**
|
|
383
|
+
- **MUST BLOCK 并通知用户**
|
|
384
|
+
|
|
385
|
+
**IF GAPS_FOUND (Round 1):**
|
|
386
|
+
- 返回 sprint-flow → grill-with-docs 补充
|
|
387
|
+
- 重新执行 requirements 评审(Round 2)
|
|
388
|
+
|
|
389
|
+
**IF GAPS_FOUND (Round 5):**
|
|
390
|
+
- **escalation_needed = true**
|
|
391
|
+
- **MUST 升级给用户决策**
|
|
392
|
+
- **CANNOT 自动继续**
|
|
393
|
+
|
|
394
|
+
**⭐ APPROVED 后必做 (requirements mode):写入证据文件**
|
|
395
|
+
|
|
396
|
+
IF mode == `requirements` AND 最终裁决是 APPROVED,评审完成后必须:
|
|
397
|
+
|
|
398
|
+
1. 写入 `.sprint-state/phase-outputs/requirements-reviewed.json`
|
|
399
|
+
2. 写入 `.sprint-state/delphi-reviewed.json`(状态文件)
|
|
400
|
+
3. 验证 JSON 格式有效
|
|
401
|
+
4. 验证 requirements_hash 为 64 位 hex 且运行时重新计算匹配
|
|
402
|
+
5. 验证 head_commit 匹配当前 HEAD
|
|
@@ -0,0 +1,134 @@
|
|
|
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 后仍无共识。所有专家提交最终绑定立场。必须基于三份成功结果聚合达到 ≥90% 共识,不能以多数票或单个专家结果替代全局批准。
|
|
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
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Requirements Mode: Round 1(匿名独立需求评审)
|
|
72
|
+
|
|
73
|
+
### 执行方式
|
|
74
|
+
|
|
75
|
+
architecture、technical、feasibility 三位专家分别独立收到:需求陈述 + CONTEXT.md + grill session 摘要 + "独立评审需求完整性,不知道其他专家意见"。三次执行必须全部成功,且每份结果都记录 `result_type=delphi_expert_result` 和实际请求的 `requested_model`;模型 ID、provider、vendor、gateway 和国籍不受限制。
|
|
76
|
+
|
|
77
|
+
### 输出格式
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
## Requirements Review - Expert [A(architecture)/B(technical)/C(feasibility)]
|
|
81
|
+
|
|
82
|
+
### 需求摘要
|
|
83
|
+
[被评审需求的简短概括]
|
|
84
|
+
|
|
85
|
+
### 评审焦点
|
|
86
|
+
- 需求完整性: [评估]
|
|
87
|
+
- 需求→AC 映射: [评估]
|
|
88
|
+
- 场景覆盖: [评估]
|
|
89
|
+
- AC 可测试性: [评估]
|
|
90
|
+
- 用户画像清晰度: [评估]
|
|
91
|
+
- 范围边界: [评估]
|
|
92
|
+
|
|
93
|
+
### 缺口清单 (Gaps)
|
|
94
|
+
#### Critical Gaps (必须解决才能进入设计)
|
|
95
|
+
1. [缺口描述] - 影响: [...] - 补充建议: [...]
|
|
96
|
+
#### Minor Gaps (建议补充但不阻塞)
|
|
97
|
+
1. [...]
|
|
98
|
+
|
|
99
|
+
### 裁决: [APPROVED / GAPS_FOUND]
|
|
100
|
+
### 置信度: [X/10]
|
|
101
|
+
### 关键理由
|
|
102
|
+
1. [...]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Requirements Mode: Round 2(带上下文的补充评审,如需要)
|
|
106
|
+
|
|
107
|
+
### 触发条件
|
|
108
|
+
|
|
109
|
+
前一轮裁决为 GAPS_FOUND,grill-with-docs 补充访谈后重新评审。最多执行 5 轮。
|
|
110
|
+
|
|
111
|
+
### 执行方式
|
|
112
|
+
|
|
113
|
+
三位专家分别收到:更新后的需求陈述 + CONTEXT.md + **前一轮 gaps 列表** + "评估已有缺口是否已修复,是否有新缺口"。每轮仍需三份成功、可验证的独立结果,不得减少专家数。
|
|
114
|
+
|
|
115
|
+
### 输出格式
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
## Requirements Review Round [2-5] - Expert [A(architecture)/B(technical)/C(feasibility)]
|
|
119
|
+
|
|
120
|
+
### Round 1 缺口修复验证
|
|
121
|
+
| Round 1 Gap | 状态 | 说明 |
|
|
122
|
+
|-------------|------|------|
|
|
123
|
+
| [gap 描述] | ✅ 已修复 / ❌ 仍存在 | [验证说明] |
|
|
124
|
+
|
|
125
|
+
### 新发现缺口(如有)
|
|
126
|
+
1. [新缺口描述]
|
|
127
|
+
|
|
128
|
+
### 裁决: [APPROVED / GAPS_FOUND]
|
|
129
|
+
### 置信度: [X/10]
|
|
130
|
+
### 立场变化说明
|
|
131
|
+
[与 Round 1 相比的立场变化]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> ⚠️ Round 5 后仍 GAPS_FOUND → `escalation_needed: true`,升级给用户决策。任何较早轮次都不能以两位专家、多数票或单个结果产生 APPROVED 证据。
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# delphi-review: Verify consensus report integrity
|
|
3
|
+
# Checks that delphi-reviewed.json is valid JSON and contains expected verdict field.
|
|
4
|
+
#
|
|
5
|
+
# Usage: bash verify-consensus.sh [state-dir]
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
STATE_DIR="${1:-.sprint-state}"
|
|
10
|
+
STATE_FILE="$STATE_DIR/delphi-reviewed.json"
|
|
11
|
+
|
|
12
|
+
if [ ! -f "$STATE_FILE" ]; then
|
|
13
|
+
echo "SKIP: No delphi-reviewed.json found at $STATE_FILE"
|
|
14
|
+
exit 0
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Validate JSON
|
|
18
|
+
if ! command -v node &>/dev/null; then
|
|
19
|
+
echo "WARN: node not available, skipping JSON validation"
|
|
20
|
+
exit 0
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
node -e "
|
|
24
|
+
const fs = require('fs');
|
|
25
|
+
try {
|
|
26
|
+
const data = JSON.parse(fs.readFileSync('$STATE_FILE', 'utf8'));
|
|
27
|
+
const requiredKeys = ['mode', 'timestamp', 'verdict', 'consensus_ratio'];
|
|
28
|
+
const missing = requiredKeys.filter(k => !(k in data));
|
|
29
|
+
if (missing.length > 0) {
|
|
30
|
+
console.error('ERROR: Missing required keys in delphi-reviewed.json:', missing.join(', '));
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const validVerdicts = ['APPROVED', 'PASS_WITH_CAVEATS', 'REQUEST_CHANGES', 'BLOCKED'];
|
|
34
|
+
if (!validVerdicts.includes(data.verdict)) {
|
|
35
|
+
console.error('ERROR: Invalid verdict:', data.verdict, '(expected one of:', validVerdicts.join(', '), ')');
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
console.log('OK: delphi-reviewed.json is valid with verdict:', data.verdict);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
console.error('ERROR: delphi-reviewed.json is not valid JSON:', e.message);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Tools Whitelist — Delphi Review
|
|
2
|
+
|
|
3
|
+
Delphi Review is a **read-only review skill** that dispatches expert subagents
|
|
4
|
+
and synthesizes their verdicts. It does NOT implement code changes.
|
|
5
|
+
|
|
6
|
+
## Allowed Tools
|
|
7
|
+
|
|
8
|
+
| Tool | Usage | Rationale |
|
|
9
|
+
|------|-------|-----------|
|
|
10
|
+
| `Read` | Read design docs, code, configs, specification.yaml | Required for review input analysis |
|
|
11
|
+
| `Glob` | Find files by pattern | Required for context discovery |
|
|
12
|
+
| `Grep` | Search code content | Required for codebase understanding |
|
|
13
|
+
| `Bash` | Read-only: git diff, git log, file stats | Required for change analysis |
|
|
14
|
+
| `Task(subagent_type=oracle)` | Dispatch oracle for deep analysis | Required for complex review questions |
|
|
15
|
+
| `Task(subagent_type=delphi-reviewer-architecture)` | Dispatch architecture expert | Core Delphi expert dispatch |
|
|
16
|
+
| `Task(subagent_type=delphi-reviewer-technical)` | Dispatch technical expert | Core Delphi expert dispatch |
|
|
17
|
+
| `Task(subagent_type=delphi-reviewer-feasibility)` | Dispatch feasibility expert | Core Delphi expert dispatch |
|
|
18
|
+
| `Write(specification.yaml, .code-walkthrough-result.json, delphi-reviewed.json)` | Write output artifacts only | Required for review output persistence |
|
|
19
|
+
| `Skill` | Invoke related skills for context | Required for cross-skill integration |
|
|
20
|
+
| `Question` | Ask user at decision points | Required for user interaction |
|
|
21
|
+
|
|
22
|
+
## Denied Tools
|
|
23
|
+
|
|
24
|
+
| Tool | Rationale |
|
|
25
|
+
|------|-----------|
|
|
26
|
+
| `Edit(source code)` | Delphi review NEVER edits implementation code during review |
|
|
27
|
+
| `Write(source code)` | Delphi review NEVER writes implementation code |
|
|
28
|
+
| `Bash(git commit, git push)` | Delphi review NEVER commits or pushes during review |
|
|
29
|
+
| `Task(category=*, subagent_type=build)` | Delphi review NEVER delegates build/implementation tasks |
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# ADR Format
|
|
2
|
+
|
|
3
|
+
## Filename convention
|
|
4
|
+
|
|
5
|
+
`docs/adr/{NNNN}-{kebab-case-title}.md`
|
|
6
|
+
|
|
7
|
+
Where `{NNNN}` is a zero-padded incrementing number (e.g., `0001`, `0002`).
|
|
8
|
+
|
|
9
|
+
## Structure
|
|
10
|
+
|
|
11
|
+
```md
|
|
12
|
+
# {NNNN}. {Title}
|
|
13
|
+
|
|
14
|
+
## Status
|
|
15
|
+
|
|
16
|
+
Proposed | Accepted | Deprecated | Superseded by ADR-XXXX
|
|
17
|
+
|
|
18
|
+
## Context
|
|
19
|
+
|
|
20
|
+
{The issue(s) or situation(s) motivating this decision. What forces are at play? What is the problem?}
|
|
21
|
+
|
|
22
|
+
## Decision
|
|
23
|
+
|
|
24
|
+
{The decision made. Stated in full sentences, in the present tense. What did we decide to do?}
|
|
25
|
+
|
|
26
|
+
## Consequences
|
|
27
|
+
|
|
28
|
+
### Positive
|
|
29
|
+
- {Benefit 1}
|
|
30
|
+
- {Benefit 2}
|
|
31
|
+
|
|
32
|
+
### Negative
|
|
33
|
+
- {Trade-off 1}
|
|
34
|
+
- {Trade-off 2}
|
|
35
|
+
|
|
36
|
+
### Neutral
|
|
37
|
+
- {Neutral observation 1}
|
|
38
|
+
|
|
39
|
+
## Alternatives Considered
|
|
40
|
+
|
|
41
|
+
### {Alternative 1 title}
|
|
42
|
+
{Brief description and why it was rejected.}
|
|
43
|
+
|
|
44
|
+
### {Alternative 2 title}
|
|
45
|
+
{Brief description and why it was rejected.}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
|
|
50
|
+
- **Write for future readers, not present participants.** Future readers won't have the conversation context.
|
|
51
|
+
- **Be honest about trade-offs.** Every decision has costs. Name them.
|
|
52
|
+
- **One decision per ADR.** If you're writing "we decided X AND Y", split them.
|
|
53
|
+
- **Keep the decision short.** 1-3 sentences. The context section is where the complexity lives.
|
|
54
|
+
- **Superseded decisions are not deleted.** When a decision is overturned, create a new ADR that supersedes it. Update the old one's status to "Superseded by ADR-XXXX". This preserves history.
|
|
55
|
+
- **Don't document trivial choices.** If the answer is obvious or easily reversible, skip the ADR.
|
|
56
|
+
|
|
57
|
+
## When NOT to write an ADR
|
|
58
|
+
|
|
59
|
+
- The decision is easily reversible.
|
|
60
|
+
- The decision is a personal preference with no team impact.
|
|
61
|
+
- The decision is well-documented elsewhere (e.g., in the project's CONTRIBUTING.md).
|
|
62
|
+
- The decision follows an obvious path with no real alternatives.
|
|
63
|
+
|
|
64
|
+
When in doubt, skip it. An ADR that shouldn't exist creates more noise than value.
|