@boyingliu01/xp-gate 0.15.5 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapter-common.sh +0 -0
- package/adapters/cpp.sh +0 -0
- package/adapters/dart.sh +0 -0
- package/adapters/flutter.sh +0 -0
- package/adapters/go.sh +0 -0
- package/adapters/iac.sh +0 -0
- package/adapters/java.sh +0 -0
- package/adapters/kotlin.sh +0 -0
- package/adapters/objectivec.sh +0 -0
- package/adapters/plugins/book299-20132-python/scripts/install-gradle.sh +0 -0
- package/adapters/plugins/book299-20132-python/scripts/install-maven.sh +0 -0
- package/adapters/plugins/book299-4081-c/scripts/install-gradle.sh +0 -0
- package/adapters/plugins/book299-4081-c/scripts/install-maven.sh +0 -0
- package/adapters/plugins/book299-4083-javascriptes5/scripts/install-gradle.sh +0 -0
- package/adapters/plugins/book299-4083-javascriptes5/scripts/install-maven.sh +0 -0
- package/adapters/powershell.sh +0 -0
- package/adapters/python.sh +0 -0
- package/adapters/shell.sh +0 -0
- package/adapters/swift.sh +0 -0
- package/adapters/typescript.sh +0 -0
- package/bin/xp-gate.js +29 -1
- package/gate-3.sh +0 -0
- package/gate-4.sh +0 -0
- package/gate-7.sh +0 -0
- package/gate-8.sh +0 -0
- package/gate-9.sh +0 -0
- package/hooks/adapter-common.sh +0 -0
- package/hooks/gate-3.sh +0 -0
- package/hooks/gate-4.sh +0 -0
- package/hooks/gate-7.sh +0 -0
- package/hooks/gate-8.sh +0 -0
- package/hooks/gate-9.sh +0 -0
- package/hooks/lib/now-ms.sh +33 -0
- package/hooks/pre-commit +63 -47
- package/hooks/pre-push +0 -0
- package/hooks/sprint-gate.sh +291 -0
- package/lib/__tests__/check-version.test.js +122 -0
- package/lib/__tests__/doctor.test.js +13 -15
- package/lib/__tests__/gate-audit.test.ts +38 -0
- package/lib/__tests__/phase-transition.test.js +512 -272
- package/lib/__tests__/retro.test.js +131 -0
- package/lib/__tests__/sprint-audit.test.js +207 -207
- package/lib/__tests__/sprint-status-rework.test.js +184 -0
- package/lib/check-version.js +9 -0
- package/lib/doctor-tui.js +268 -198
- package/lib/doctor.js +15 -3
- package/lib/gate-audit.ts +18 -7
- package/lib/gate-runner.js +77 -30
- package/lib/init.js +10 -0
- package/lib/language-tools.js +833 -833
- package/lib/mattpocock-license-verdict.json +7 -0
- package/lib/phase-transition.js +499 -249
- package/lib/retro.js +222 -0
- package/lib/shared-utils.js +7 -0
- package/lib/sprint-audit.js +235 -235
- package/lib/sprint-init.js +207 -0
- package/lib/sprint-state-migrator.js +1 -0
- package/lib/sprint-status.js +111 -0
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +3 -2
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/bin/delphi-review-guard.sh +0 -0
- package/plugins/claude-code/bin/xp-gate-check +0 -0
- package/plugins/claude-code/skills/batch-grill-me/SKILL.md +15 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/delphi-review/SKILL.md +59 -4
- package/plugins/claude-code/skills/delphi-review/references/requirements.md +390 -0
- package/plugins/claude-code/skills/delphi-review/references/round-templates.md +67 -0
- package/plugins/claude-code/skills/domain-modeling/ADR-FORMAT.md +64 -0
- package/plugins/claude-code/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/plugins/claude-code/skills/domain-modeling/SKILL.md +74 -0
- package/plugins/claude-code/skills/grill-with-docs/SKILL.md +7 -0
- package/plugins/claude-code/skills/grilling/SKILL.md +12 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +168 -43
- package/plugins/claude-code/skills/sprint-flow/references/components/memory.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +21 -20
- package/plugins/claude-code/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
- package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +14 -12
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +145 -133
- package/plugins/claude-code/skills/sprint-flow/references/phase-3-build.md +69 -2
- package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +93 -31
- package/plugins/claude-code/skills/sprint-flow/references/phase-5-ship.md +99 -14
- package/plugins/claude-code/skills/sprint-flow/references/phase-6-close.md +37 -5
- package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +58 -53
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +8 -3
- package/plugins/claude-code/skills/to-issues/SKILL.md +1 -1
- package/plugins/opencode/index.ts +1 -0
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/batch-grill-me/SKILL.md +15 -0
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/delphi-review/SKILL.md +59 -4
- package/plugins/opencode/skills/delphi-review/references/requirements.md +390 -0
- package/plugins/opencode/skills/delphi-review/references/round-templates.md +67 -0
- package/plugins/opencode/skills/domain-modeling/ADR-FORMAT.md +64 -0
- package/plugins/opencode/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/plugins/opencode/skills/domain-modeling/SKILL.md +74 -0
- package/plugins/opencode/skills/grill-with-docs/SKILL.md +7 -0
- package/plugins/opencode/skills/grilling/SKILL.md +12 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/SKILL.md +168 -43
- package/plugins/opencode/skills/sprint-flow/references/components/memory.md +1 -1
- package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +1 -1
- package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +21 -20
- package/plugins/opencode/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
- package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +14 -12
- package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +145 -133
- package/plugins/opencode/skills/sprint-flow/references/phase-3-build.md +69 -2
- package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +93 -31
- package/plugins/opencode/skills/sprint-flow/references/phase-5-ship.md +99 -14
- package/plugins/opencode/skills/sprint-flow/references/phase-6-close.md +37 -5
- package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +58 -53
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/SKILL.md +8 -3
- package/plugins/opencode/skills/to-issues/SKILL.md +1 -1
- package/plugins/qoder/agents/delphi-architecture.md +48 -48
- package/plugins/qoder/agents/delphi-feasibility.md +48 -48
- package/plugins/qoder/agents/delphi-technical.md +48 -48
- package/plugins/qoder/bin/sprint-flow-guard.sh +0 -0
- package/plugins/qoder/bin/xp-gate-check +0 -0
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/scripts/__tests__/check-mattpocock-license.test.js +229 -0
- package/scripts/__tests__/sync-package-content.test.js +50 -0
- package/scripts/check-mattpocock-license.cjs +302 -0
- package/scripts/delphi-external-review.cjs +432 -432
- package/scripts/migrate-audit-anomalies.mjs +78 -0
- package/scripts/sync-package-content.js +52 -5
- package/skills/batch-grill-me/SKILL.md +15 -0
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/delphi-review/SKILL.md +59 -4
- package/skills/delphi-review/references/requirements.md +390 -0
- package/skills/delphi-review/references/round-templates.md +67 -0
- package/skills/domain-modeling/ADR-FORMAT.md +64 -0
- package/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/skills/domain-modeling/SKILL.md +74 -0
- package/skills/grill-with-docs/SKILL.md +7 -0
- package/skills/grilling/SKILL.md +12 -0
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/sprint-flow/SKILL.md +168 -43
- package/skills/sprint-flow/references/components/memory.md +1 -1
- package/skills/sprint-flow/references/components/middleware.md +1 -1
- package/skills/sprint-flow/references/components/skill-invocations.md +21 -20
- package/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
- package/skills/sprint-flow/references/orchestration-rules.md +14 -12
- package/skills/sprint-flow/references/phase-2-design.md +145 -133
- package/skills/sprint-flow/references/phase-3-build.md +69 -2
- package/skills/sprint-flow/references/phase-4-verify.md +93 -31
- package/skills/sprint-flow/references/phase-5-ship.md +99 -14
- package/skills/sprint-flow/references/phase-6-close.md +37 -5
- package/skills/sprint-flow/references/phase-overview.md +58 -53
- package/skills/test-specification-alignment/AGENTS.md +3 -3
- package/skills/test-specification-alignment/SKILL.md +8 -3
- package/skills/to-issues/SKILL.md +1 -1
- package/adapters/gate-3.sh +0 -68
- package/adapters/gate-4.sh +0 -80
- package/adapters/gate-7.sh +0 -45
- package/adapters/gate-8.sh +0 -56
- package/adapters/gate-9.sh +0 -104
|
@@ -1,212 +1,212 @@
|
|
|
1
|
-
# Phase 2/6: DESIGN(设计 — 需求探索 +
|
|
1
|
+
# Phase 2/6: DESIGN(设计 — 需求探索 + 双点评审)
|
|
2
2
|
|
|
3
3
|
**执行时机**: Phase 1/6 PREP 完成后、Phase 3/6 BUILD 之前。
|
|
4
4
|
**对应旧模型**: Phase 0 THINK + Phase 1 PLAN
|
|
5
5
|
|
|
6
6
|
## 目标
|
|
7
7
|
|
|
8
|
-
使用
|
|
8
|
+
使用 grill-with-docs 进行结构化需求探索(含 CONTEXT.md/ADR 沉淀),经 R1 需求评审验证需求完整性,输出经用户批准的设计文档。然后通过 batch-grill-me 批量前置决策 + R2 delphi-review 达成 ≥90% 共识,生成 specification.yaml。
|
|
9
|
+
|
|
10
|
+
**新链(v0.18.0+,零外部依赖,双点评审)**:
|
|
11
|
+
```
|
|
12
|
+
grill-with-docs → R1 需求评审(轻量) → 原生设计文档+APPROVAL门 → batch-grill-me → R2 delphi-review(设计维度) → to-issues
|
|
13
|
+
↓ ↓ #368 ↓ HARD-GATE ↓ ↓ HARD-GATE
|
|
14
|
+
CONTEXT.md+ADR 需求完整性/AC覆盖 用户审批设计文档 批量前置决策 ≥90% 共识
|
|
15
|
+
```
|
|
9
16
|
|
|
10
17
|
---
|
|
11
18
|
|
|
12
|
-
## Part A: THINK
|
|
19
|
+
## Part A: THINK(需求探索 + 需求评审)
|
|
13
20
|
|
|
14
21
|
### Step 0: CONTEXT.md 预检(v0.14.9+ — Issue #322)
|
|
15
22
|
|
|
16
|
-
在进入
|
|
23
|
+
在进入 grill 访谈前,检查 `CONTEXT.md` 是否已存在:
|
|
17
24
|
|
|
18
25
|
```
|
|
19
26
|
IF CONTEXT.md 存在于项目根目录:
|
|
20
27
|
→ 读取已有设计上下文
|
|
21
|
-
→ SKIP
|
|
22
|
-
→
|
|
23
|
-
→
|
|
28
|
+
→ SKIP grill-with-docs 访谈(设计上下文已存在,避免重复探索)
|
|
29
|
+
→ ⚠️ R1 需求评审仍执行(Round 1 修订:CONTEXT.md 可能陈旧,快速路径同样需要需求评审)
|
|
30
|
+
→ 评审对象为 CONTEXT.md + 本次需求陈述
|
|
31
|
+
→ 输出: "[sprint-flow] CONTEXT.md 已存在,跳过需求访谈,进入 R1 需求评审"
|
|
24
32
|
ELSE:
|
|
25
33
|
→ 继续执行 Step 1(结构化需求探索)
|
|
26
34
|
```
|
|
27
35
|
|
|
28
36
|
**CONTEXT.md 预检路由表**:
|
|
29
37
|
|
|
30
|
-
| CONTEXT.md 状态 |
|
|
31
|
-
|
|
32
|
-
| 不存在 | ✅ 执行 |
|
|
33
|
-
| 存在 | ❌ SKIP | 已有 CONTEXT.md +
|
|
38
|
+
| CONTEXT.md 状态 | grill-with-docs | R1 需求评审 | 输入到 Part B | 说明 |
|
|
39
|
+
|----------------|-----------------|-------------|---------------|------|
|
|
40
|
+
| 不存在 | ✅ 执行 | ✅ 执行 | grill 输出 + R1 结论 | 标准路径 |
|
|
41
|
+
| 存在 | ❌ SKIP | ✅ 执行 | 已有 CONTEXT.md + R1 结论 | 快速路径 (Issue #322) |
|
|
42
|
+
|
|
43
|
+
### Step 1: 调用 grill-with-docs(需求访谈)
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
**仅当 CONTEXT.md 不存在时执行。**
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
skill(name="grill-with-docs", user_message="[需求描述]")
|
|
49
|
+
```
|
|
36
50
|
|
|
37
|
-
-
|
|
38
|
-
|
|
51
|
+
grill-with-docs 执行:
|
|
52
|
+
1. **逐个追问决策树** — 每题附推荐答案;事实自行探查,决策留给用户
|
|
53
|
+
2. **同步维护 CONTEXT.md** — 项目上下文沉淀(`domain-modeling` 内置)
|
|
54
|
+
3. **同步维护 ADR** — `docs/adr/ADR-NNNN-*.md` 架构决策记录
|
|
55
|
+
4. **达成共享理解** — 需求边界、用户场景、验收标准清晰化
|
|
39
56
|
|
|
40
|
-
|
|
41
|
-
- brainstorming 有 **HARD-GATE**(设计未批准 → 不可进入实现),防止 "觉得已经理解了就直接开始写代码"
|
|
42
|
-
- brainstorming 输出结构化设计文档,可直接作为 Phase 2/6 Part B PLAN 的输入
|
|
43
|
-
- office-hours 的 YC 六问适合新产品方向验证,brainstorming 更适合"具体功能实现前设计"的场景
|
|
57
|
+
### Step 2: R1 需求评审(#368 恢复的第一点评审)
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
grill 访谈达成共享理解后(或 CONTEXT.md 快速路径下读取已有上下文后)、设计文档生成前,调用需求评审:
|
|
46
60
|
|
|
47
61
|
```
|
|
48
|
-
|
|
49
|
-
until the brainstorming design has been APPROVED by the user.
|
|
62
|
+
npx xp-gate delphi-review --mode requirements
|
|
50
63
|
```
|
|
51
64
|
|
|
52
|
-
|
|
65
|
+
**评审配置**(轻量):
|
|
66
|
+
- 复用现有 3 专家(architecture/feasibility/technical),`--mode requirements` 切换评审焦点提示词
|
|
67
|
+
- 轻量配置:2 专家、1 轮
|
|
68
|
+
- lightweight sprint(`change_type == "修改已存在代码"`):跳过 R1,需求评审合并入 R2
|
|
69
|
+
|
|
70
|
+
**评审焦点**:
|
|
71
|
+
- 用户场景遗漏
|
|
72
|
+
- 验收标准覆盖度与可测试性
|
|
73
|
+
- 用户画像清晰度
|
|
74
|
+
- 需求边界
|
|
75
|
+
|
|
76
|
+
**阻塞语义(程序化)**:
|
|
77
|
+
|
|
78
|
+
输出 `.sprint-state/phase-outputs/requirements-reviewed.json`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"verdict": "APPROVED | GAPS_FOUND",
|
|
83
|
+
"timestamp": "<ISO 8601>",
|
|
84
|
+
"requirements_hash": "<SHA-256 of 需求陈述 + CONTEXT.md 内容>",
|
|
85
|
+
"experts": 2,
|
|
86
|
+
"rounds": 1,
|
|
87
|
+
"gaps": []
|
|
88
|
+
}
|
|
89
|
+
```
|
|
53
90
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
4. **Present design** — 分节展示,每节获得用户批准
|
|
58
|
-
5. **Write design doc** — 保存到 `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
59
|
-
6. **Transition to implementation** — brainstorming 自动调用 writing-plans
|
|
91
|
+
**GAPS_FOUND 处理**:
|
|
92
|
+
- 回到 Step 1 补充访谈(或补充 CONTEXT.md 内容)
|
|
93
|
+
- 最多 2 轮循环后升级给用户决策
|
|
60
94
|
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
95
|
+
**程序化校验**:
|
|
96
|
+
- `phase-transition 2 completed` 校验该文件存在、`verdict=APPROVED` 且 `requirements_hash` 匹配当前需求内容
|
|
97
|
+
- 不匹配 → BLOCK(防陈旧绑定)
|
|
64
98
|
|
|
65
|
-
###
|
|
99
|
+
### Step 3: 原生设计文档生成
|
|
66
100
|
|
|
67
|
-
|
|
101
|
+
orchestrator 基于访谈记录 + CONTEXT.md + R1 评审结论生成设计文档:
|
|
68
102
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
103
|
+
**路径**: `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
104
|
+
|
|
105
|
+
**内容结构**:
|
|
106
|
+
1. 需求摘要(来自 grill 访谈 + R1 评审结论)
|
|
107
|
+
2. 2–3 候选方案与 trade-offs
|
|
108
|
+
3. 推荐方案
|
|
109
|
+
4. 成功标准
|
|
72
110
|
|
|
73
|
-
|
|
111
|
+
### Step 4: HARD-GATE — 用户审批设计文档
|
|
74
112
|
|
|
75
113
|
```
|
|
76
114
|
⚠️ HARD-GATE: 设计未 APPROVED → 不可进入 Part B
|
|
77
115
|
|
|
78
|
-
|
|
116
|
+
等待用户审批设计文档。
|
|
117
|
+
用户 APPROVE 前,禁止进入 Part B (PLAN) 或任何实现。
|
|
79
118
|
```
|
|
80
119
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### 可选补充: office-hours(方向验证)
|
|
86
|
-
|
|
87
|
-
当用户输入非常模糊时(如 "我想做一个 AI 工具" 而不是 "开发用户登录功能"),可以先调用 `office-hours` 验证产品方向,再进入 brainstorming 详细设计。
|
|
120
|
+
**sprint-flow 编排层行为**:
|
|
121
|
+
- 收到用户 APPROVED 后,自动进入 Part B
|
|
122
|
+
- 如果用户未 APPROVED,BLOCK 并等待
|
|
88
123
|
|
|
89
124
|
### 暂停点
|
|
90
125
|
|
|
91
126
|
| 暂停点 | 触发条件 | 用户操作 | 自动恢复条件 |
|
|
92
127
|
|--------|---------|---------|-------------|
|
|
93
|
-
|
|
|
128
|
+
| R1 GAPS_FOUND | 需求评审发现缺口 | 补充访谈/上下文 | 重新 R1 评审(最多 2 轮) |
|
|
129
|
+
| **HARD-GATE** | 设计文档未 APPROVED | 用户审批设计文档 | 设计 APPROVED 后自动进入 Part B |
|
|
94
130
|
|
|
95
131
|
### 输出
|
|
96
132
|
|
|
97
|
-
-
|
|
98
|
-
-
|
|
133
|
+
- CONTEXT.md(项目上下文沉淀)
|
|
134
|
+
- ADR 文件(`docs/adr/ADR-NNNN-*.md`)
|
|
135
|
+
- requirements-reviewed.json(`.sprint-state/phase-outputs/`)
|
|
136
|
+
- Design Document(`docs/plans/YYYY-MM-DD-<topic>-design.md`)
|
|
99
137
|
- 进入 Part B 自动执行(使用设计文档作为输入)
|
|
100
138
|
|
|
101
139
|
---
|
|
102
140
|
|
|
103
141
|
## Part B: PLAN(共识评审)
|
|
104
142
|
|
|
105
|
-
###
|
|
106
|
-
|
|
107
|
-
- `autoplan` (gstack) — CEO → Design → Eng 自动流水线
|
|
108
|
-
- `delphi-review` — 多轮匿名评审直到共识
|
|
109
|
-
- specification.yaml 从 APPROVED 设计文档自动生成(无需独立 skill)
|
|
110
|
-
|
|
111
|
-
**Web 前端项目额外注入**:
|
|
112
|
-
- `design-shotgun` (gstack) — 生成多版 UI 设计变体
|
|
113
|
-
|
|
114
|
-
**Mobile 项目额外注入** (`--type mobile-flutter` / `mobile-react-native`):
|
|
115
|
-
- `design-shotgun` (gstack) — 移动端 UI 设计探索
|
|
116
|
-
|
|
117
|
-
### 执行步骤
|
|
118
|
-
|
|
119
|
-
#### Step 0: Web 前端项目 — 调用 design-shotgun(如适用)
|
|
120
|
-
|
|
121
|
-
**IF project_type is web-nextjs / web-react / web-vue / mobile-flutter / mobile-react-native:**
|
|
122
|
-
```
|
|
123
|
-
skill(name="design-shotgun", user_message="[Pain Document 内容 + 需求描述]")
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
#### Step 0.5: DESIGN 路由分叉(v0.14.0+ — Issue #306, #322)
|
|
143
|
+
### Step 5: 路由分叉(v0.14.0+ — Issue #306, #322)
|
|
127
144
|
|
|
128
|
-
根据 Phase 1/6 PREP (AUTO-ESTIMATE) 的 `change_type`
|
|
145
|
+
根据 Phase 1/6 PREP (AUTO-ESTIMATE) 的 `change_type` 决定路径:
|
|
129
146
|
|
|
130
147
|
```
|
|
131
148
|
读取 .sprint-state/sprint-state.json → auto_estimate.change_type
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
→
|
|
136
|
-
→ 直接进入 autoplan (标准) 或 delphi-review (增量)
|
|
137
|
-
ELSE IF change_type == "修改已存在代码":
|
|
138
|
-
→ 增量优化路径: SKIP autoplan
|
|
139
|
-
→ 直接进入 Step 2b: delphi-review (lightweight: 2 专家, 1 轮)
|
|
149
|
+
|
|
150
|
+
IF change_type == "修改已存在代码":
|
|
151
|
+
→ 增量优化路径: SKIP batch-grill-me
|
|
152
|
+
→ 直接进入 Step 7: lightweight R2 delphi-review (2 专家, 1 轮)
|
|
140
153
|
ELSE (change_type == "新增功能" 或 未定义):
|
|
141
|
-
→ 标准路径: 继续 Step
|
|
154
|
+
→ 标准路径: 继续 Step 6 (batch-grill-me) → Step 7
|
|
142
155
|
```
|
|
143
156
|
|
|
144
157
|
**路由决策表**:
|
|
145
158
|
|
|
146
|
-
|
|
|
147
|
-
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
| 不存在 | `undefined` / 缺失 | ✅ 执行 | ✅ 执行 | 标准 (3 专家) |
|
|
159
|
+
| change_type | batch-grill-me | R2 delphi-review |
|
|
160
|
+
|------------|----------------|------------------|
|
|
161
|
+
| `修改已存在代码` | ❌ SKIP | lightweight (2 专家, 1 轮) |
|
|
162
|
+
| `新增功能` | ✅ 执行 | 标准 (3 专家) |
|
|
163
|
+
| `undefined` / 缺失 | ✅ 执行 | 标准 (3 专家) |
|
|
152
164
|
|
|
153
165
|
**HARD-GATE 不变**: 两条路径最终都必须产出 APPROVED 的 delphi-reviewed.json。
|
|
154
166
|
|
|
155
|
-
|
|
167
|
+
### Step 6: 调用 batch-grill-me(仅标准路径)
|
|
156
168
|
|
|
157
169
|
**仅当 change_type != "修改已存在代码" 时执行。**
|
|
158
170
|
|
|
159
171
|
```
|
|
160
|
-
skill(name="
|
|
172
|
+
skill(name="batch-grill-me", user_message="[设计文档 + 待确认决策列表]")
|
|
161
173
|
```
|
|
162
174
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
taste_decisions: [] | [decision1, decision2, ...]
|
|
168
|
-
verdict: "AUTO_APPROVED" | "NEEDS_REVIEW"
|
|
169
|
-
```
|
|
175
|
+
batch-grill-me 替代 autoplan 的 taste_decisions 功能:
|
|
176
|
+
- 前置已确定决策整批提出
|
|
177
|
+
- 用户一轮确认
|
|
178
|
+
- 输出批量决策结果
|
|
170
179
|
|
|
171
|
-
|
|
180
|
+
### Step 7: R2 设计评审(delphi-review,原生 HARD-GATE)
|
|
172
181
|
|
|
173
182
|
```
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
│ → 调用 lightweight delphi-review(2 专家、1 轮、2/2 APPROVED) │
|
|
180
|
-
│ │
|
|
181
|
-
│ IF autoplan_result.verdict == "NEEDS_REVIEW" │
|
|
182
|
-
│ OR autoplan_result.taste_decisions.length > 0 │
|
|
183
|
-
│ → ⚠️ 暂停等待用户确认 taste_decisions │
|
|
184
|
-
│ → 用户确认后,调用标准 delphi-review(3 专家) │
|
|
185
|
-
└───────────────────────────────────────────────────────────────────┘
|
|
183
|
+
# 标准路径(3 专家)
|
|
184
|
+
skill(name="delphi-review", user_message="[设计文档 + batch-grill-me 决策结果]")
|
|
185
|
+
|
|
186
|
+
# 增量优化路径(2 专家, 1 轮 — 来自 Step 5 路由)
|
|
187
|
+
skill(name="delphi-review", user_message="[设计文档]", experts=2, max_rounds=1)
|
|
186
188
|
```
|
|
187
189
|
|
|
188
|
-
|
|
190
|
+
- **标准路径**: Round 1: 3 专家匿名独立评审 → Round 2+: 交换意见直到共识
|
|
191
|
+
- **增量优化路径**: 2 专家, 1 轮
|
|
192
|
+
- ≥90% 共识 + APPROVED 才通过
|
|
193
|
+
- 输出: APPROVED / REQUEST_CHANGES
|
|
189
194
|
|
|
190
|
-
|
|
195
|
+
**如果 REQUEST_CHANGES**: 暂停等待用户处理 → 修复后重新评审 → 直到 APPROVED
|
|
191
196
|
|
|
192
|
-
|
|
197
|
+
### Step 8: 调用 to-issues(原生保留)
|
|
193
198
|
|
|
194
199
|
```
|
|
195
|
-
|
|
196
|
-
skill(name="delphi-review", user_message="[设计文档 + taste_decisions 确认结果]")
|
|
197
|
-
|
|
198
|
-
# 增量优化路径(2 专家, 1 轮 — 来自 Step 0.5 路由)
|
|
199
|
-
skill(name="delphi-review", user_message="[设计文档]", experts=2, max_rounds=1)
|
|
200
|
+
skill(name="to-issues")
|
|
200
201
|
```
|
|
201
202
|
|
|
202
|
-
|
|
203
|
-
- **增量优化路径**: 2 专家, 1 轮 (来自 Step 0.5 DESIGN 路由分叉)
|
|
204
|
-
- Round 2+: 交换意见直到共识
|
|
205
|
-
- 输出: APPROVED / REQUEST_CHANGES
|
|
203
|
+
垂直切片 Issue 拆分 → `slices-manifest.json`(格式不变,ralph-loop 零改动)
|
|
206
204
|
|
|
207
|
-
|
|
205
|
+
to-issues 原生能力:blocked_by/dependency_graph/DAG 循环检测/拓扑排序 → Phase 3/6 BUILD 按 execution_order 执行
|
|
206
|
+
|
|
207
|
+
### Step 9: 生成 specification.yaml
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
从 APPROVED 设计文档提取:
|
|
210
210
|
|
|
211
211
|
```yaml
|
|
212
212
|
specification:
|
|
@@ -217,7 +217,7 @@ specification:
|
|
|
217
217
|
acceptance_criteria:
|
|
218
218
|
- id: AC-001
|
|
219
219
|
requirement: REQ-001
|
|
220
|
-
criteria: [验收标准]
|
|
220
|
+
criteria: [验收标准] # #368: 每个 REQ 必须含清晰验收标准
|
|
221
221
|
test_type: [unit/integration/e2e]
|
|
222
222
|
design_decisions:
|
|
223
223
|
- id: DD-001
|
|
@@ -226,26 +226,38 @@ specification:
|
|
|
226
226
|
alternatives_considered: [备选方案]
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
### Step 10: 保存产出物
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
垂直切片 Issue 拆分 → `slices-manifest.json` → Phase 3/6 BUILD 按 execution_order 执行
|
|
231
|
+
保存到 `<project-root>/.sprint-state/phase-outputs/`:
|
|
232
|
+
- `specification.yaml`
|
|
233
|
+
- `slices-manifest.json`(to-issues 输出)
|
|
235
234
|
|
|
236
|
-
|
|
235
|
+
### Web 前端项目额外注入
|
|
237
236
|
|
|
238
|
-
|
|
237
|
+
**IF project_type is web-nextjs / web-react / web-vue / mobile-flutter / mobile-react-native:**
|
|
238
|
+
|
|
239
|
+
OPTIONAL: 若检测到 `design-shotgun` skill 已安装,可生成多版 UI 设计变体辅助设计评审。未安装则 SKIP。
|
|
239
240
|
|
|
240
241
|
### 暂停点
|
|
241
242
|
|
|
242
243
|
| 暂停点 | 触发条件 | 用户操作 |
|
|
243
244
|
|--------|---------|---------|
|
|
244
|
-
|
|
|
245
|
-
| delphi-review APPROVED | Round 结果 REQUEST_CHANGES | 用户修复并重新评审 |
|
|
245
|
+
| batch-grill-me 决策确认 | 批量决策需要用户确认 | 用户一轮确认所有决策 |
|
|
246
|
+
| R2 delphi-review APPROVED | Round 结果 REQUEST_CHANGES | 用户修复并重新评审 |
|
|
246
247
|
|
|
247
248
|
### 输出
|
|
248
249
|
|
|
249
|
-
- specification.yaml
|
|
250
|
+
- specification.yaml(每 REQ 含验收标准 — #368)
|
|
250
251
|
- slices-manifest.json
|
|
251
252
|
- 进入 Phase 3/6 BUILD(除非 `--stop-at design`)
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 证据文件汇总
|
|
257
|
+
|
|
258
|
+
| 证据文件 | 路径 | 校验时机 | 防陈旧绑定 |
|
|
259
|
+
|----------|------|----------|-----------|
|
|
260
|
+
| requirements-reviewed.json | `.sprint-state/phase-outputs/` | `phase-transition 2 completed` | `requirements_hash`(SHA-256) |
|
|
261
|
+
| delphi-reviewed.json | `.sprint-state/` | DELPHI-GATE (Phase 2→3) | verdict + timestamp |
|
|
262
|
+
| specification.yaml | `.sprint-state/phase-outputs/` | `phase-transition 3 in_progress` | slice↔REQ 一致性 |
|
|
263
|
+
| slices-manifest.json | `.sprint-state/phase-outputs/` | `phase-transition 3 in_progress` | schema + REQ 引用校验 |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**摘要**: TDD 执行, 多 Agent 并行加速, 盲评验证, Gate 1 验证通过。
|
|
8
8
|
|
|
9
|
-
**关键链路**: DELPHI-GATE → parallel-dispatch/ralph-loop → TDD →
|
|
9
|
+
**关键链路**: BUILD-ENTRY-CONTRACT → DELPHI-GATE → parallel-dispatch/ralph-loop → TDD → blind-review (read-only subagent) → verification → cost monitor
|
|
10
10
|
|
|
11
11
|
**输出**: MVP v1
|
|
12
12
|
|
|
@@ -22,6 +22,27 @@
|
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
+
## BUILD Entry Contract Check (MANDATORY — v0.18.0+, 程序化)
|
|
26
|
+
|
|
27
|
+
**Purpose**: Validate `slices-manifest.json` schema and slice↔REQ cross-artifact consistency before entering BUILD.
|
|
28
|
+
|
|
29
|
+
**Execution**: `phase-transition 3 in_progress` 时程序化校验:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
1. slices-manifest.json 存在且 schema 合法
|
|
33
|
+
2. manifest 每个 slice 引用的 REQ 必须存在于 specification.yaml
|
|
34
|
+
3. 不合法 → BLOCK
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**GATE CHECK**:
|
|
38
|
+
```
|
|
39
|
+
[BUILD-ENTRY] slices-manifest.json exists ✓
|
|
40
|
+
[BUILD-ENTRY] manifest schema valid ✓
|
|
41
|
+
[BUILD-ENTRY] slice↔REQ consistency ✓ # 每个 slice 的 REQ 引用在 specification.yaml 中存在
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**IF GATE FAILS**: BLOCK — 返回 Phase 2/6 修复 manifest 或 specification.yaml。
|
|
45
|
+
|
|
25
46
|
---
|
|
26
47
|
|
|
27
48
|
## Uncommitted Changes Gate
|
|
@@ -215,6 +236,52 @@ Without these events, the Harness can only infer changes from file diffs and has
|
|
|
215
236
|
|
|
216
237
|
---
|
|
217
238
|
|
|
239
|
+
## Blind Review — Read-Only Subagent Convention (v0.18.0+, 证据型标准步骤)
|
|
240
|
+
|
|
241
|
+
**Purpose**: Code review by an isolated subagent with read-only tool access. Replaces the former `freeze/unfreeze` mechanism.
|
|
242
|
+
|
|
243
|
+
**Convention**: The blind-review reviewer runs as a Task subagent with restricted tools:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
tools: [Read, Grep, Glob] # 只读 — 禁止 Write/Edit/Bash 写操作
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Execution**:
|
|
250
|
+
1. Orchestrator dispatches a Task subagent with `tools: [Read, Grep, Glob]`
|
|
251
|
+
2. Subagent reviews all changed files (from `git diff` or slices-manifest scope)
|
|
252
|
+
3. Subagent outputs review findings (issues, suggestions, risks)
|
|
253
|
+
4. Orchestrator records findings to `.sprint-state/phase-outputs/blind-review-report.md`
|
|
254
|
+
|
|
255
|
+
**Classification**: 证据型标准步骤(非 HARD-GATE)— 执行并留存评审记录,不设程序化阻断。Worktree 本身已是隔离边界。
|
|
256
|
+
|
|
257
|
+
**Anti-Pattern**: Reviewer subagent MUST NOT have Write, Edit, or Bash permissions. This ensures the review is truly read-only and cannot accidentally modify code under review.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Learnings Capture (v0.18.0+, 原生)
|
|
262
|
+
|
|
263
|
+
**Purpose**: Record patterns and lessons learned during BUILD for future sprints.
|
|
264
|
+
|
|
265
|
+
**Execution**: ralph-loop 迭代中或 BUILD 完成后,将有价值的模式/教训写入:
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
.sprint-history/learnings.md
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Format**:
|
|
272
|
+
```markdown
|
|
273
|
+
## [YYYY-MM-DD] Sprint <id> — BUILD Learnings
|
|
274
|
+
|
|
275
|
+
### Pattern: <title>
|
|
276
|
+
- **Context**: <when this applies>
|
|
277
|
+
- **Insight**: <what was learned>
|
|
278
|
+
- **Action**: <how to apply in future>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Note**: 替代原 `gstack/learn` 调用,纯原生文件写入,零外部依赖。
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
218
285
|
## TDD 强制执行
|
|
219
286
|
|
|
220
287
|
### Gate 5a-BLOCK: 新增文件测试强制
|
|
@@ -249,7 +316,7 @@ SKIP_GATE_5A_BLOCK=1 git commit -m "message"
|
|
|
249
316
|
| ralph-loop (per REQ) | TDD + verification per requirement | 5-15 min | 30 min/REQ | Mark REQ as `timeout`, continue next REQ |
|
|
250
317
|
| parallel dispatch | Multi-agent parallel build | 10-30 min | 45 min | Collect partial results, continue |
|
|
251
318
|
| TDD cycle (per unit) | RED → GREEN → REFACTOR | 2-5 min | 10 min | Skip unit, log failure |
|
|
252
|
-
|
|
|
319
|
+
| blind-review (read-only subagent) | Code review via read-only subagent | 5-10 min | 20 min | WARNING, continue |
|
|
253
320
|
| verification | Test suite + coverage check | 2-5 min | 15 min | Retry once, then BLOCK |
|
|
254
321
|
| cost monitor | Token cost accounting | <1s | 5s | Skip, log warning |
|
|
255
322
|
| Phase 3/6 total (lightweight) | ≤3 REQs | 15-30 min | 45 min | — |
|