@boyingliu01/xp-gate 0.15.5 → 0.18.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.
Files changed (165) hide show
  1. package/adapter-common.sh +0 -0
  2. package/adapters/cpp.sh +0 -0
  3. package/adapters/dart.sh +0 -0
  4. package/adapters/flutter.sh +0 -0
  5. package/adapters/go.sh +0 -0
  6. package/adapters/iac.sh +0 -0
  7. package/adapters/java.sh +0 -0
  8. package/adapters/kotlin.sh +0 -0
  9. package/adapters/objectivec.sh +0 -0
  10. package/adapters/plugins/book299-20132-python/scripts/install-gradle.sh +0 -0
  11. package/adapters/plugins/book299-20132-python/scripts/install-maven.sh +0 -0
  12. package/adapters/plugins/book299-4081-c/scripts/install-gradle.sh +0 -0
  13. package/adapters/plugins/book299-4081-c/scripts/install-maven.sh +0 -0
  14. package/adapters/plugins/book299-4083-javascriptes5/scripts/install-gradle.sh +0 -0
  15. package/adapters/plugins/book299-4083-javascriptes5/scripts/install-maven.sh +0 -0
  16. package/adapters/powershell.sh +0 -0
  17. package/adapters/python.sh +0 -0
  18. package/adapters/shell.sh +0 -0
  19. package/adapters/swift.sh +0 -0
  20. package/adapters/typescript.sh +0 -0
  21. package/bin/xp-gate.js +29 -1
  22. package/gate-3.sh +0 -0
  23. package/gate-4.sh +0 -0
  24. package/gate-7.sh +0 -0
  25. package/gate-8.sh +0 -0
  26. package/gate-9.sh +0 -0
  27. package/hooks/adapter-common.sh +0 -0
  28. package/hooks/gate-3.sh +0 -0
  29. package/hooks/gate-4.sh +0 -0
  30. package/hooks/gate-7.sh +0 -0
  31. package/hooks/gate-8.sh +0 -0
  32. package/hooks/gate-9.sh +0 -0
  33. package/hooks/lib/now-ms.sh +33 -0
  34. package/hooks/pre-commit +63 -47
  35. package/hooks/pre-push +0 -0
  36. package/hooks/sprint-gate.sh +291 -0
  37. package/lib/__tests__/check-version.test.js +122 -0
  38. package/lib/__tests__/doctor.test.js +13 -15
  39. package/lib/__tests__/gate-audit.test.ts +38 -0
  40. package/lib/__tests__/phase-transition.test.js +512 -272
  41. package/lib/__tests__/retro.test.js +131 -0
  42. package/lib/__tests__/sprint-audit.test.js +207 -207
  43. package/lib/__tests__/sprint-status-rework.test.js +184 -0
  44. package/lib/check-version.js +9 -0
  45. package/lib/doctor-tui.js +268 -198
  46. package/lib/doctor.js +15 -3
  47. package/lib/gate-audit.ts +18 -7
  48. package/lib/gate-runner.js +77 -30
  49. package/lib/init.js +10 -0
  50. package/lib/language-tools.js +833 -833
  51. package/lib/mattpocock-license-verdict.json +7 -0
  52. package/lib/phase-transition.js +499 -249
  53. package/lib/retro.js +222 -0
  54. package/lib/shared-utils.js +7 -0
  55. package/lib/sprint-audit.js +235 -235
  56. package/lib/sprint-init.js +207 -0
  57. package/lib/sprint-state-migrator.js +1 -0
  58. package/lib/sprint-status.js +111 -0
  59. package/mock-policy/AGENTS.md +3 -3
  60. package/mutation/AGENTS.md +3 -3
  61. package/package.json +3 -2
  62. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  63. package/plugins/claude-code/bin/delphi-review-guard.sh +0 -0
  64. package/plugins/claude-code/bin/xp-gate-check +0 -0
  65. package/plugins/claude-code/skills/batch-grill-me/SKILL.md +15 -0
  66. package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
  67. package/plugins/claude-code/skills/delphi-review/SKILL.md +59 -4
  68. package/plugins/claude-code/skills/delphi-review/references/requirements.md +390 -0
  69. package/plugins/claude-code/skills/delphi-review/references/round-templates.md +67 -0
  70. package/plugins/claude-code/skills/domain-modeling/ADR-FORMAT.md +64 -0
  71. package/plugins/claude-code/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  72. package/plugins/claude-code/skills/domain-modeling/SKILL.md +74 -0
  73. package/plugins/claude-code/skills/grill-with-docs/SKILL.md +7 -0
  74. package/plugins/claude-code/skills/grilling/SKILL.md +12 -0
  75. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
  76. package/plugins/claude-code/skills/sprint-flow/SKILL.md +168 -43
  77. package/plugins/claude-code/skills/sprint-flow/references/components/memory.md +1 -1
  78. package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +1 -1
  79. package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +21 -20
  80. package/plugins/claude-code/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
  81. package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +14 -12
  82. package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +145 -133
  83. package/plugins/claude-code/skills/sprint-flow/references/phase-3-build.md +69 -2
  84. package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +93 -31
  85. package/plugins/claude-code/skills/sprint-flow/references/phase-5-ship.md +99 -14
  86. package/plugins/claude-code/skills/sprint-flow/references/phase-6-close.md +37 -5
  87. package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +58 -53
  88. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
  89. package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +8 -3
  90. package/plugins/claude-code/skills/to-issues/SKILL.md +1 -1
  91. package/plugins/opencode/index.ts +1 -0
  92. package/plugins/opencode/package.json +1 -1
  93. package/plugins/opencode/skills/batch-grill-me/SKILL.md +15 -0
  94. package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
  95. package/plugins/opencode/skills/delphi-review/SKILL.md +59 -4
  96. package/plugins/opencode/skills/delphi-review/references/requirements.md +390 -0
  97. package/plugins/opencode/skills/delphi-review/references/round-templates.md +67 -0
  98. package/plugins/opencode/skills/domain-modeling/ADR-FORMAT.md +64 -0
  99. package/plugins/opencode/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  100. package/plugins/opencode/skills/domain-modeling/SKILL.md +74 -0
  101. package/plugins/opencode/skills/grill-with-docs/SKILL.md +7 -0
  102. package/plugins/opencode/skills/grilling/SKILL.md +12 -0
  103. package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
  104. package/plugins/opencode/skills/sprint-flow/SKILL.md +168 -43
  105. package/plugins/opencode/skills/sprint-flow/references/components/memory.md +1 -1
  106. package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +1 -1
  107. package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +21 -20
  108. package/plugins/opencode/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
  109. package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +14 -12
  110. package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +145 -133
  111. package/plugins/opencode/skills/sprint-flow/references/phase-3-build.md +69 -2
  112. package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +93 -31
  113. package/plugins/opencode/skills/sprint-flow/references/phase-5-ship.md +99 -14
  114. package/plugins/opencode/skills/sprint-flow/references/phase-6-close.md +37 -5
  115. package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +58 -53
  116. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
  117. package/plugins/opencode/skills/test-specification-alignment/SKILL.md +8 -3
  118. package/plugins/opencode/skills/to-issues/SKILL.md +1 -1
  119. package/plugins/qoder/agents/delphi-architecture.md +48 -48
  120. package/plugins/qoder/agents/delphi-feasibility.md +48 -48
  121. package/plugins/qoder/agents/delphi-technical.md +48 -48
  122. package/plugins/qoder/bin/sprint-flow-guard.sh +0 -0
  123. package/plugins/qoder/bin/xp-gate-check +0 -0
  124. package/plugins/qoder/plugin.json +1 -1
  125. package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
  126. package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
  127. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
  128. package/principles/AGENTS.md +3 -3
  129. package/scripts/__tests__/check-mattpocock-license.test.js +229 -0
  130. package/scripts/__tests__/sync-package-content.test.js +50 -0
  131. package/scripts/check-mattpocock-license.cjs +302 -0
  132. package/scripts/delphi-external-review.cjs +432 -432
  133. package/scripts/migrate-audit-anomalies.mjs +78 -0
  134. package/scripts/sync-package-content.js +52 -5
  135. package/skills/batch-grill-me/SKILL.md +15 -0
  136. package/skills/delphi-review/AGENTS.md +3 -3
  137. package/skills/delphi-review/SKILL.md +59 -4
  138. package/skills/delphi-review/references/requirements.md +390 -0
  139. package/skills/delphi-review/references/round-templates.md +67 -0
  140. package/skills/domain-modeling/ADR-FORMAT.md +64 -0
  141. package/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  142. package/skills/domain-modeling/SKILL.md +74 -0
  143. package/skills/grill-with-docs/SKILL.md +7 -0
  144. package/skills/grilling/SKILL.md +12 -0
  145. package/skills/sprint-flow/AGENTS.md +3 -3
  146. package/skills/sprint-flow/SKILL.md +168 -43
  147. package/skills/sprint-flow/references/components/memory.md +1 -1
  148. package/skills/sprint-flow/references/components/middleware.md +1 -1
  149. package/skills/sprint-flow/references/components/skill-invocations.md +21 -20
  150. package/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
  151. package/skills/sprint-flow/references/orchestration-rules.md +14 -12
  152. package/skills/sprint-flow/references/phase-2-design.md +145 -133
  153. package/skills/sprint-flow/references/phase-3-build.md +69 -2
  154. package/skills/sprint-flow/references/phase-4-verify.md +93 -31
  155. package/skills/sprint-flow/references/phase-5-ship.md +99 -14
  156. package/skills/sprint-flow/references/phase-6-close.md +37 -5
  157. package/skills/sprint-flow/references/phase-overview.md +58 -53
  158. package/skills/test-specification-alignment/AGENTS.md +3 -3
  159. package/skills/test-specification-alignment/SKILL.md +8 -3
  160. package/skills/to-issues/SKILL.md +1 -1
  161. package/adapters/gate-3.sh +0 -68
  162. package/adapters/gate-4.sh +0 -80
  163. package/adapters/gate-7.sh +0 -45
  164. package/adapters/gate-8.sh +0 -56
  165. package/adapters/gate-9.sh +0 -104
@@ -10,7 +10,7 @@
10
10
  | 原则 | 说明 |
11
11
  |------|------|
12
12
  | **单一入口** | 用户只需调用 `/sprint-flow`,自动串联全流程 |
13
- | **自动流水线** | 类似 autoplan,自动执行多个阶段 |
13
+ | **自动流水线** | 自动执行多个阶段,原生步骤 + 内置 Matt Pocock skill |
14
14
  | **关键节点暂停** | APPROVED 确认、DELPHI-GATE 通过、Ship 确认、⚠️ Phase 6 CLOSE 必须人工 |
15
15
  | **承认 Emergent** | 用户验收环节必须人工,无法自动化(78% 失败不可见) |
16
16
  | **复用现有 Skills** | 不重新发明,整合调用现有体系 |
@@ -52,11 +52,11 @@ Sprint Flow is NOT just a sequential launcher of existing skills. Here's what ma
52
52
 
53
53
  ```
54
54
  Phase 1/6: PREP → worktree隔离 + 规模评估 + 流程路由
55
- Phase 2/6: DESIGN → brainstorming → autoplan → delphi-review → specification.yaml
56
- Phase 3/6: BUILD → GITHOOKS-GATE → DELPHI-GATE → ralph-loop/TDD → freeze/盲评 → verification
57
- Phase 4/6: VERIFY → delphi-review --mode code-walkthrough → test-alignment → browse → learn + retro
58
- Phase 5/6: SHIP → finishing-a-development-branch → ship → land-and-deploy → canary
59
- Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cleanup
55
+ Phase 2/6: DESIGN → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL → batch-grill-me → R2 delphi-review → to-issues → specification.yaml
56
+ Phase 3/6: BUILD → BUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop/TDD → blind-review (read-only subagent) → verification
57
+ Phase 4/6: VERIFY → delphi-review --mode code-walkthrough → test-alignment (#367 HARD-GATE) → xp-gate check --all → browser (Layer 4) → learnings + retro
58
+ Phase 5/6: SHIP → VERSION-GATE → 分支完成决策(4选项) → native ship (PR) → native land (merge+CI+canary)
59
+ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → #369 返工指标 → emergent issues → cleanup
60
60
  ```
61
61
 
62
62
  **v2.0 Compact Redesign** (Issue #290): Merged from 11 phases to 6. PREP = old ISOLATE + AUTO-ESTIMATE. DESIGN = old THINK + PLAN. BUILD = old BUILD (unchanged). VERIFY = old REVIEW + FEEDBACK. SHIP = old SHIP + LAND. CLOSE = old USER ACCEPTANCE + CLEANUP.
@@ -66,11 +66,11 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
66
66
  ## 暂停点设计(不是随时停,而是设计明确的暂停点)
67
67
 
68
68
  - **Phase 1/6 PREP**: 保护分支强制隔离 → 输出警告或自动创建 worktree → 自动恢复;AUTO-ESTIMATE 结果展示 → 用户确认 → 按路由继续
69
- - **Phase 2/6 DESIGN**: brainstorming 设计未 APPROVED (HARD-GATE) → 用户修改 → APPROVED 后继续;autoplan taste_decisions → 用户确认;delphi-review 未 APPROVED → 修复 → APPROVED → specification.yaml
70
- - **Phase 3/6 BUILD**: DELPHI-GATE 未通过 → BLOCK;验证失败 > max3 → 用户决策修复/放弃;成本超阈值 → 用户确认
71
- - **Phase 4/6 VERIFY**: delphi code-walkthrough REQUEST_CHANGES → 用户处理 → 重新评审;browse 发现问题 → 回退 Phase 3(不暂停)
72
- - **Phase 5/6 SHIP**: finishing-a-development-branch (4选项) → 确认;ship PR → 用户确认合并;land-and-deploy 完成/失败 → 用户确认;⚠️ SHIP must complete merge to main + release before Phase 6
73
- - **Phase 6/6 CLOSE**: SHIP→CLOSE GATE (校验 merge 已完成 + git status clean + 当前在 main) → Backup sprint-state → USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
69
+ - **Phase 2/6 DESIGN**: grill-with-docs 访谈 → R1 需求评审 GAPS_FOUND → 补充访谈(最多 2 轮);设计文档未 APPROVED (HARD-GATE) → 用户修改 → APPROVED 后继续;batch-grill-me 批量决策 → 用户确认;R2 delphi-review 未 APPROVED → 修复 → APPROVED → specification.yaml
70
+ - **Phase 3/6 BUILD**: BUILD-ENTRY-CONTRACT 未通过 → BLOCK;DELPHI-GATE 未通过 → BLOCK;验证失败 > max3 → 用户决策修复/放弃;成本超阈值 → 用户确认
71
+ - **Phase 4/6 VERIFY**: delphi code-walkthrough REQUEST_CHANGES → 用户处理 → 重新评审;test-alignment 失败 (#367) → 回退 Phase 3(不暂停);浏览器验证发现问题 → 回退 Phase 3(不暂停)
72
+ - **Phase 5/6 SHIP**: 分支完成决策 (4选项) → 确认;native ship PR → 用户确认合并;native land 完成/失败 → 用户确认;⚠️ SHIP must complete merge to main + release before Phase 6
73
+ - **Phase 6/6 CLOSE**: SHIP→CLOSE GATE (校验 merge 已完成 + git status clean + 当前在 main) → Backup sprint-state → #369 返工指标写入 → USER ACCEPTANCE ⚠️ 必须人工验收 → 用户确认后继续;cleanup 完成/失败 → 用户确认 → 结束流程
74
74
 
75
75
  ---
76
76
 
@@ -79,11 +79,11 @@ Phase 6/6: CLOSE → USER ACCEPTANCE (⚠️ 人工) → emergent issues → cle
79
79
  | Step | Phase | Name | Key Actions | Output |
80
80
  |------|-------|------|-------------|--------|
81
81
  | 1 | **1/6** | **PREP** | Detect protected branch → Create git worktree → AUTO-ESTIMATE sizing → Classify (lightweight/standard/complex) | Worktree path + impact assessment |
82
- | 2 | **2/6** | **DESIGN** | brainstorming → autoplan → delphi-review (HARD-GATE ≥90% consensus) → to-issues → specification.yaml | specification.yaml + slices-manifest.json |
83
- | 3 | **3/6** | **BUILD** | GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → freeze → blind review → verification | MVP code |
84
- | 4 | **4/6** | **VERIFY** | delphi-review --mode code-walkthrough → test-specification-alignment → browse QA → benchmark (optional) → learn + retro | Review report + feedback-log.md |
85
- | 5 | **5/6** | **SHIP** | VERSION-GATE → finishing-a-development-branch → ship (create PR) → land-and-deploy → merge to main + CI + canary → release | PR URL + deploy status + merge confirmation |
86
- | 6 | **6/6** | **CLOSE** | SHIP→CLOSE GATE (merge + release verified) → Backup sprint-state → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report |
82
+ | 2 | **2/6** | **DESIGN** | grill-with-docs → R1 需求评审 → 设计文档+APPROVAL (HARD-GATE) → batch-grill-me → R2 delphi-review (≥90% consensus) → to-issues → specification.yaml | specification.yaml + slices-manifest.json + requirements-reviewed.json |
83
+ | 3 | **3/6** | **BUILD** | BUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → blind-review (read-only subagent) → verification | MVP code |
84
+ | 4 | **4/6** | **VERIFY** | delphi-review --mode code-walkthrough → test-specification-alignment (#367 HARD-GATE) → xp-gate check --all → browser (Layer 4 optional) → learnings + xp-gate retro | Review report + feedback-log.md + test-alignment-report.json |
85
+ | 5 | **5/6** | **SHIP** | VERSION-GATE → 分支完成决策 (4选项) → native ship (create PR) → native land (merge + CI + canary) → release | PR URL + deploy status + merge confirmation |
86
+ | 6 | **6/6** | **CLOSE** | SHIP→CLOSE GATE (merge + release verified) → Backup sprint-state → #369 返工指标 → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch → Sprint summary | Emergent issues list + cleanup report + metrics |
87
87
 
88
88
  **Phase Flow**:
89
89
  ```
@@ -94,8 +94,8 @@ PREP → DESIGN → BUILD → VERIFY → SHIP (merge to main + release) → CLOS
94
94
  ```
95
95
 
96
96
  **Hard Gates**:
97
- - **Phase 2/6 → 3/6 (DESIGN → BUILD)**: Design must be APPROVED by delphi-review (≥90% consensus) + GITHOOKS-GATE (hooks installed) + DELPHI-GATE (spec APPROVED)
98
- - **Phase 4/6 → 5/6 (VERIFY → SHIP)**: feedback-log.md must exist (HARD-GATE)
97
+ - **Phase 2/6 → 3/6 (DESIGN → BUILD)**: R1 需求评审 APPROVED + 设计文档用户 APPROVED + R2 delphi-review APPROVED (≥90% consensus) + GITHOOKS-GATE (hooks installed) + DELPHI-GATE (spec APPROVED) + BUILD-ENTRY-CONTRACT (manifest schema + slice↔REQ 一致性)
98
+ - **Phase 4/6 → 5/6 (VERIFY → SHIP)**: feedback-log.md must exist + test-alignment-report.json PASS (#367 程序化 HARD-GATE)
99
99
  - **Phase 5/6 → 6/6 (SHIP → CLOSE)**: PR must be merged to main + release completed (HARD-GATE). See `references/phase-6-close.md#ship--close-gate`.
100
100
 
101
101
  ---
@@ -144,7 +144,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
144
144
  6. 输出评估结果 → 用户确认后按路由继续
145
145
  7. **参数**: `--no-isolate` (跳过), `--branch-name <name>`, `--force` (绕过保护分支)
146
146
 
147
- ### Phase 2/6: DESIGN (设计 — 需求探索 + 共识评审)
147
+ ### Phase 2/6: DESIGN (设计 — 需求探索 + 双点评审)
148
148
 
149
149
  **对应旧模型**: Phase 0 THINK + Phase 1 PLAN
150
150
 
@@ -153,14 +153,17 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
153
153
  **详细指令**: 参见 `references/phase-2-design.md` — 完整流程、条件分支、HARD-GATE。
154
154
 
155
155
  **快速参考**:
156
- - **Step 0.5: DESIGN 路由分叉 (v0.14.0+)**: 根据 PREP 的 `change_type` 决定路径。`修改已存在代码` → SKIP autoplan, 直接 lightweight delphi-review (2 专家, 1 轮)。`新增功能` 或 undefined → 标准 autoplan 路径。详见 `references/phase-2-design.md#step-05-design-路由分叉`。
157
- - **Step 1: brainstorming** — `skill(name="brainstorming")` — 输出设计文档 + CONTEXT.md + ADR。**HARD-GATE**: 设计未批准 → 不可进入实现
158
- - **Step 2: autoplan** — `skill(name="autoplan")` — CEO/设计/工程自动评审 → 用户确认 taste_decisions(仅标准路径)
159
- - **Step 3: delphi-review** — `skill(name="delphi-review")` — 等待 APPROVED(非 APPROVED 暂停等待用户确认)
160
- - **Step 4: to-issues** — `skill(name="to-issues")` — 垂直切片 Issue 拆分 → slices-manifest.json
161
- - **Step 5: specification.yaml** — 从 APPROVED 设计文档自动提取
162
- - **Web 前端额外注入**: `design-shotgun`
163
- - **条件分支**: IF autoplan AUTO_APPROVED → lightweight delphi-review (2 专家、1 轮); ELSE → 标准 delphi-review (3 专家)
156
+ - **Step 0: CONTEXT.md 预检 (#322)**: 存在则 SKIP grill 访谈,但 R1 需求评审仍执行(CONTEXT.md 可能陈旧)
157
+ - **Step 1: grill-with-docs** — `skill(name="grill-with-docs")` — 逐个追问 + CONTEXT.md/ADR 沉淀。**HARD-GATE**: 设计未批准 → 不可进入实现
158
+ - **Step 2: R1 需求评审 (#368)** — `npx xp-gate delphi-review --mode requirements` — 轻量 2 专家 1 轮,输出 requirements-reviewed.json(含 requirements_hash 防陈旧绑定)。lightweight sprint 跳过 R1 合并入 R2
159
+ - **Step 3: 原生设计文档生成** — `docs/plans/YYYY-MM-DD-<topic>-design.md`(需求摘要、2-3 方案、推荐、成功标准)
160
+ - **Step 4: HARD-GATE APPROVAL** — 用户审批设计文档
161
+ - **Step 5: 路由分叉** — `change_type == "修改已存在代码"` → SKIP batch-grill-me, lightweight R2
162
+ - **Step 6: batch-grill-me** — `skill(name="batch-grill-me")` — 批量前置决策(替代 autoplan taste_decisions)
163
+ - **Step 7: R2 delphi-review** — `skill(name="delphi-review")` — 等待 APPROVED(≥90% 共识)
164
+ - **Step 8: to-issues** — `skill(name="to-issues")` — 垂直切片 Issue 拆分 → slices-manifest.json
165
+ - **Step 9: specification.yaml** — 从 APPROVED 设计文档自动提取(每 REQ 含验收标准 — #368)
166
+ - **Web 前端额外注入**: OPTIONAL design-shotgun(如已安装)
164
167
 
165
168
  ### Phase 2/6→3/6: GITHOOKS-GATE(质量门禁安装检查)
166
169
 
@@ -183,12 +186,13 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
183
186
  **详细指令**: 参见 `references/phase-3-build.md`。
184
187
 
185
188
  **快速参考**:
186
- 1. **DELPHI-GATE**: 验证 `.sprint-state/delphi-reviewed.json` 存在且 `verdict = "APPROVED"` → 否则 BLOCK
187
- 2. **TDD-GATE (MANDATORY — v0.14.0+)**: 在 delegation 前验证每个 REQ 存在 failing test。无 test → mark `[TDD-RED]`(ralph-loop 创建)。有 test 且 GREEN 且无实现 → BLOCK(TDD bypass)。详见 `references/phase-3-build.md#tdd-gate-pre-implementation-tdd-check-mandatory`。
188
- 3. **输入**: `slices-manifest.json`(Phase 2/6 生成),按 `execution_order` 逐个执行
189
- 4. **模式**: 默认 `ralph-loop`(逐 REQ 迭代,token 节约 40-67%),可选 `--mode parallel`
190
- 5. **Skill 步骤**: hooks-install → TDD-GATE → dispatching-parallel-agents → TDD (RED/GREEN/REFACTOR) → freeze → blind-review → unfreeze → verification-before-completion → 成本监控
191
- 6. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
189
+ 1. **BUILD-ENTRY-CONTRACT (MANDATORY — v0.18.0+)**: `phase-transition 3 in_progress` 校验 slices-manifest.json schema + slice↔REQ 一致性 → 不合法 BLOCK
190
+ 2. **DELPHI-GATE**: 验证 `.sprint-state/delphi-reviewed.json` 存在且 `verdict = "APPROVED"` → 否则 BLOCK
191
+ 3. **TDD-GATE (MANDATORY — v0.14.0+)**: 在 delegation 前验证每个 REQ 存在 failing test。无 test → mark `[TDD-RED]`(ralph-loop 创建)。有 test 且 GREEN 且无实现 → BLOCK(TDD bypass)。详见 `references/phase-3-build.md#tdd-gate-pre-implementation-tdd-check-mandatory`。
192
+ 4. **输入**: `slices-manifest.json`(Phase 2/6 生成),按 `execution_order` 逐个执行
193
+ 5. **模式**: 默认 `ralph-loop`(逐 REQ 迭代,token 节约 40-67%),可选 `--mode parallel`
194
+ 6. **Skill 步骤**: BUILD-ENTRY-CONTRACT → hooks-install → TDD-GATE → TDD (RED/GREEN/REFACTOR) → blind-review (read-only subagent, tools: [Read, Grep, Glob]) → verification-before-completion → 成本监控 → learnings.md 写入
195
+ 7. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
192
196
 
193
197
  ### Phase 4/6: VERIFY (验证 — 代码走查 + QA + 反馈获取)
194
198
 
@@ -198,11 +202,11 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
198
202
 
199
203
  **快速参考**:
200
204
  - **Orchestrator 直接执行**: delphi-review code-walkthrough 需要用户确认 verdict(Issue #249),**必须由 orchestrator 直接调用** `skill(name="delphi-review")`
201
- - **执行顺序**: `delphi-review --mode code-walkthrough` → 等待 APPROVED → `test-specification-alignment` → `browse` (gstack) → 可选 `qa`/`design-review`/`benchmark` (gstack)
202
- - **Feedback 子阶段**: `learn` (Sprint 级复盘) + `retro` (工程回顾) + 可选 `systematic-debugging` (根因调试)
203
- - **Subagent**: `task(category="quick", load_skills=["learn", "retro", "systematic-debugging"])`
204
- - 输出: 评审报告 + feedback-log.md
205
- - **HARD-GATE**: feedback-log.md must exist before Phase 5/6
205
+ - **执行顺序**: `delphi-review --mode code-walkthrough` → 等待 APPROVED → `test-specification-alignment` (#367 程序化 HARD-GATE: test-alignment-report.json + head_commit + spec_hash) → `xp-gate check --all` → 浏览器验证 (Layer 4: gstack browse > browser-use MCP > SKIP)
206
+ - **Web 前端**: `xp-gate ui-review`(原生)+ OPTIONAL gstack qa/design-review/benchmark(如已安装)
207
+ - **Feedback 子阶段**: learnings.md 写入(原生)+ `xp-gate retro`(原生,含 #369 返工率区块)+ OPTIONAL systematic-debugging(Layer 4,保留"无根因不修复"纪律)
208
+ - 输出: 评审报告 + feedback-log.md + test-alignment-report.json
209
+ - **HARD-GATE**: feedback-log.md must exist + test-alignment-report.json PASS before Phase 5/6
206
210
 
207
211
  ### 负载/压力测试(可选)
208
212
 
@@ -220,17 +224,17 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
220
224
  **详细指令**: 参见 `references/phase-5-ship.md` — VERSION-GATE (MANDATORY) / finishing-a-development-branch / VERSION CHANGESET (Issue #142) / changeset schema。
221
225
 
222
226
  **快速参考**:
223
- - **Step 0: VERSION-GATE (MANDATORY — 必须在 finishing-a-development-branch 之前)**: bump VERSION → update CHANGELOG.md → run sync-version.sh → commit + push → verify PR updated。详见 `references/phase-5-ship.md#step-0-version-gate`
224
- - **Step 1: finishing-a-development-branch**: 4 选项菜单,选择 "Push and create a Pull Request"
225
- - **Orchestrator 直接执行**: `finishing-a-development-branch` 和 `ship` 均为交互式 skill,**必须由 orchestrator 直接调用** `skill(name="finishing-a-development-branch")` 和 `skill(name="ship")`
227
+ - **Step 0: VERSION-GATE (MANDATORY — 必须在分支完成决策之前)**: bump VERSION → update CHANGELOG.md → run sync-version.sh → commit + push → verify PR updated。详见 `references/phase-5-ship.md#step-0-version-gate`
228
+ - **Step 1: 分支完成决策(原生 4 选项)**: AskUserQuestion 菜单 (merge/PR/keep/discard),默认推荐 Option 2 (Push and create a Pull Request)
229
+ - **Step 2: 原生 Ship 步骤**: test → VERSION-GATE → commit → push → `gh pr create`
226
230
  - 输入: phase-4-summary.md + feedback-log.md → 输出: PR URL (含版本变更 commit)
227
- - **HARD-GATE**: Phase 4/6 未完成 → BLOCK。验证 `feedback-log.md` 存在。
231
+ - **HARD-GATE**: Phase 4/6 未完成 → BLOCK。验证 `feedback-log.md` 存在 + test-alignment-report.json PASS。
228
232
  - **GITHOOKS-GATE**: 验证 hooks 完整性,缺失则 `githooks/install.sh`
229
- - **LAND**: `land-and-deploy` — merge PR → 等待 CI (10min) → 等待 Deploy (10min) → Canary Health Check (5min)
233
+ - **LAND(原生步骤)**: merge 确认 → `gh run list` 等 CI (10min) → 等 Deploy (10min) → Canary Health Check (5min)
230
234
  - **回滚**: `git revert` 最后一次 merge commit
231
235
  - ⚠️ **SHIP COMPLETION**: Phase 5/6 结束前必须确认 PR 已 merge 到 main + release 已创建。未完成 merge 不得进入 Phase 6/6。详见 `references/phase-5-ship.md#ship-completion-gate`。
232
236
 
233
- **⚠️ VERSION-GATE 必须在 finishing-a-development-branch 之前执行。顺序反了会导致 PR 不含版本变更 → CI release workflow 不触发 → 无新版本发布。**
237
+ **⚠️ VERSION-GATE 必须在分支完成决策之前执行。顺序反了会导致 PR 不含版本变更 → CI release workflow 不触发 → 无新版本发布。**
234
238
 
235
239
  ### Phase 6/6: CLOSE (收尾 — ⚠️ 人工验收 + 清理)
236
240
 
@@ -241,8 +245,9 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
241
245
  **快速参考**:
242
246
  - **SHIP→CLOSE GATE (MANDATORY — v0.14.3+)**: 校验 PR 已 merge、当前在 main 分支、`git status --porcelain` 为空。详见 `references/phase-6-close.md#ship--close-gate`。
243
247
  - **Backup sprint-state**(MANDATORY): Phase 6 开始前将 `.sprint-state/` 备份到 repo 追踪路径,防止 worktree 清理后状态丢失。详见 `references/phase-6-close.md#backup-sprint-state`。
248
+ - **#369 返工追踪 (v0.18.0+)**: CLOSE 写入 `metrics.completed_at` + `metrics.total_sprint_commits`(merge-base 到合并点提交数)+ `metrics.merge_base_sha`。`xp-gate sprint-status --rework-check [--window-days N]` 仓库范围扫描 fix 提交,`rework_rate > 30%` 告警。"重新打开的 issue 数"指标已删除。
244
249
  - **USER ACCEPTANCE**: ⚠️ **MUST NOT be automated, skipped, or bypassed.** 即使用户说"赶时间"、"跳过验收"、"直接发布",也必须暂停等待用户确认。使用 `@templates/emergent-issues-template.md` 检查清单
245
- - **CLEANUP**: 保存分支信息 → `git worktree remove <worktree_path>`(精确路径,禁止通配符)→ 删除本地分支 + 远程分支 → 关闭遗留 OPEN PR → 更新 sprint-state.json → 释放 Sprint Lock
250
+ - **CLEANUP**: 保存分支信息 → `git worktree remove <worktree_path>`(精确路径,禁止通配符)→ 删除本地分支 + 远程分支 → 关闭遗留 OPEN PR → 更新 sprint-state.json(含 #369 metrics)→ learnings.md 写入 → 释放 Sprint Lock
246
251
  - 输出 Cleanup Report + Sprint Summary
247
252
  - **IF emergent issues → Sprint 2**
248
253
 
@@ -312,13 +317,13 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
312
317
 
313
318
  | Phase | Backend (default) | Web Frontend | Mobile | Load Test |
314
319
  |-------|------------------|-------------|--------|-----------|
315
- | 2/6 DESIGN | `brainstorming` + `autoplan` + `delphi-review` | + `design-shotgun` | (同 web) | (通用) |
316
- | 3/6 BUILD | TDD + blind-review | (同 backend) | + `vercel-react-native-skills` / `flutter-review` | (同) |
317
- | 4/6 VERIFY | `delphi-review --mode code-walkthrough` + `test-specification-alignment` + k6/locust/gatling | + `qa` + `design-review` + `benchmark` | Flutter: `flutter-test` / RN: `detox E2E` | k6/locust/gatling |
318
- | 4/6 VERIFY (Feedback) | `learn` + `retro` | (同) | (同) | (同) |
319
- | 5/6 SHIP | `finishing-a-development-branch` + `ship` + `land-and-deploy` | (同) | + platform deploy | (同) |
320
- | 6/6 CLOSE | — 人工验收 → cleanup | (同) | (同) | (同) |
321
- | Browse | `localhost:3000` | 部署 URL + 表单/交互 | Flutter Web / RN Web | (专用) |
320
+ | 2/6 DESIGN | `grill-with-docs` + R1 `delphi-review --mode requirements` + `batch-grill-me` + R2 `delphi-review` | + OPTIONAL `design-shotgun` | (同 web) | (通用) |
321
+ | 3/6 BUILD | TDD + blind-review (read-only subagent) | (同 backend) | + `vercel-react-native-skills` / `flutter-review` | (同) |
322
+ | 4/6 VERIFY | `delphi-review --mode code-walkthrough` + `test-specification-alignment` + `xp-gate check --all` + k6/locust/gatling | + `xp-gate ui-review` + OPTIONAL qa/design-review/benchmark | Flutter: `flutter-test` / RN: `detox E2E` | k6/locust/gatling |
323
+ | 4/6 VERIFY (Feedback) | learnings.md + `xp-gate retro` | (同) | (同) | (同) |
324
+ | 5/6 SHIP | VERSION-GATE + 原生 4 选项 + native ship + native land | (同) | + platform deploy | (同) |
325
+ | 6/6 CLOSE | — 人工验收 → #369 返工指标 → cleanup | (同) | (同) | (同) |
326
+ | Browse | Layer 4 可选链 (gstack browse > browser-use MCP > SKIP) | 部署 URL + 表单/交互 | Flutter Web / RN Web | (专用) |
322
327
 
323
328
  **Mobile 工具链**: Flutter — `flutter analyze/test/build/pub publish`; RN — `metro/detox/jest/react-native run-ios/android`
324
329
 
@@ -451,7 +456,7 @@ Additional reference files:
451
456
  | Verification improves 2-3x | Boris #1 tip | Phase 4/6 VERIFY 设计 |
452
457
  | Emergent requirements 无法消除 | Mike Cohn, Rafael Santos | Phase 6/6 CLOSE 人工设计 |
453
458
  | 78% failures invisible | arXiv research | Phase 6/6 必要性证明 |
454
- | Think → Plan → Build → Ship | gstack ETHOS | 整体流程设计 |
459
+ | Think → Plan → Build → Ship | 行业通用流程 | 整体流程设计 |
455
460
 
456
461
  ---
457
462
 
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-23
4
- **Commit:** 766602e
3
+ **Generated:** 2026-07-25
4
+ **Commit:** 3150b22
5
5
  **Branch:** main
6
- **Version:** 0.15.5.0
6
+ **Version:** 0.18.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -10,7 +10,7 @@ description: "Use when asked to run tests, verify tests, align tests with specif
10
10
  1. **Load Phase 0** — Verify `specification.yaml` and `tests/` directory exist; BLOCK if missing with guidance to complete brainstorming → delphi-review → specification-generator flow first
11
11
  2. **Phase 1 Alignment (Modify Allowed)** — Parse specification.yaml + test files (AST); validate alignment rules; generate alignment report; optionally fix tests to align with requirements; require score ≥80% to proceed
12
12
  3. **Coverage Mapping** — Map each REQ-* to at least one test with `@test` annotation; map each AC-* to at least one assertion; verify `@test`, `@intent`, `@covers` tags
13
- 4. **Pre-Phase 2 Freeze** — Invoke `/freeze` skill to lock test directories; return confirmation before proceeding
13
+ 4. **Pre-Phase 2 Freeze** — Lock test directories via read-only subagent convention (reviewer tools restricted to `[Read, Grep, Glob]`, no Write/Edit/Bash); return confirmation before proceeding
14
14
  5. **Phase 2 Execution (Frozen)** — Run all tests; Agent BLOCKED from modifying/deleting/skipping tests; analyze failures into 4 categories
15
15
  6. **Failure Classification** — For each failing test, output with Type, Test, Root Cause, Action fields; SPECIFICATION_ERROR requires ESCALATE_TO_HUMAN with user options (A: fix spec → re-Phase 1, B: confirm spec → modify code, C: clarify ambiguity)
16
16
  7. **JSON Report Output** — Generate alignment report as valid JSON
@@ -31,11 +31,16 @@ description: "Use when asked to run tests, verify tests, align tests with specif
31
31
 
32
32
  ## Output Format (MANDATORY)
33
33
 
34
+ > **MANDATORY FILE OUTPUT**: When invoked, you MUST write this report as valid JSON to the file `.sprint-state/phase-outputs/test-alignment-report.json` in the project root. Stdout output alone is not sufficient — `xp-gate phase-transition 4 completed` validates the file, not the stdout.
35
+
34
36
  ```json
35
37
  {
36
38
  "alignment_status": "PASS|FAIL|BLOCKED",
37
39
  "phase": "1|2",
38
40
  "score": 85.5,
41
+ "head_commit": "<git rev-parse HEAD output>",
42
+ "spec_hash": "<SHA-256 of specification.yaml if exists, else null>",
43
+ "timestamp": "<ISO 8601>",
39
44
  "misaligned_tests": [
40
45
  {"test_name": "test_checkout", "spec_requirement": "REQ-003", "gap": "Missing @test annotation"}
41
46
  ],
@@ -44,7 +49,7 @@ description: "Use when asked to run tests, verify tests, align tests with specif
44
49
  }
45
50
  ```
46
51
 
47
- **Eval assertions check for:** `alignment_status`, `phase`, `score`, `anti_pattern_detected`.
52
+ **Eval assertions check for:** `alignment_status`, `phase`, `score`, `head_commit`, `spec_hash`, `anti_pattern_detected`.
48
53
 
49
54
  ---
50
55
 
@@ -53,7 +58,7 @@ description: "Use when asked to run tests, verify tests, align tests with specif
53
58
  ### Automatic
54
59
  - BUILD (TDD + review) Round 1 after Driver outputs tests
55
60
  - Gate 1 verification before proceeding
56
- - gstack-ship release before deployment
61
+ - Phase 5 SHIP release before deployment (native phase-5 steps)
57
62
 
58
63
  ### Manual
59
64
  - `/test-specification-alignment`, `/verify-tests`, "run tests", "verify tests"
@@ -242,7 +242,7 @@ Phase 1: PLAN → autoplan → delphi-review → specification.yaml
242
242
  → **/to-issues** → slices-manifest.json + Issue 列表
243
243
  Phase 2: BUILD → 按 execution_order 逐个切片执行
244
244
  → 每个切片 = 一个 REQ(ralph-loop 模式)
245
- → 或通过 dispatching-parallel-agents 并行(无依赖的 AFK 切片)
245
+ → 或通过原生 Task 并行派发(无依赖的 AFK 切片)
246
246
  Phase 3: REVIEW → **整体 review**(全部切片完成后统一 code-walkthrough)
247
247
  → browse / QA 验证端到端行为
248
248
  Phase 4: USER ACC → 人工验收(全部切片集成后的完整功能)
@@ -132,6 +132,7 @@ async function checkXpGateUpdate(): Promise<UpgradeResult> {
132
132
  const exitCode = await new Promise<number | null>((resolve, reject) => {
133
133
  const child = spawn("npm", ["install", "-g", `${XP_GATE_NPM_PKG}@${remoteVersion}`], {
134
134
  stdio: "pipe",
135
+ shell: true, // Required on Windows: npm is a .cmd file
135
136
  timeout: 120_000,
136
137
  })
137
138
  child.on("close", (code) => resolve(code))
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/opencode-plugin",
3
- "version": "0.15.5",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills + Sprint Flow TUI sidebar for OpenCode",
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: batch-grill-me
3
+ description: A relentless interview that asks every frontier question at once, round by round.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
8
+
9
+ Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled — the questions you can ask *now* without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
10
+
11
+ Each round the user answers reshapes the tree — settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a *later* round, not this one.
12
+
13
+ Finding *facts* is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), dispatch a sub-agent to find it — don't ask the user for anything you could look up yourself. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report — ask the rest of the frontier now. The *decisions* are the user's — put each to them and wait.
14
+
15
+ The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Do not act on it until the user confirms you have reached a shared understanding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-23
4
- **Commit:** 766602e
3
+ **Generated:** 2026-07-25
4
+ **Commit:** 3150b22
5
5
  **Branch:** main
6
- **Version:** 0.15.5.0
6
+ **Version:** 0.18.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -3,8 +3,9 @@ name: delphi-review
3
3
  version: 1.1.0
4
4
  description: >
5
5
  Performs multi-round anonymous expert consensus review using the Delphi method. Supports
6
- design review (default) and code-walkthrough (--mode code-walkthrough) modes. Uses 2-3 experts
7
- from at least 2 different domestic model providers with a >=90% statistical consensus threshold.
6
+ design review (default), code-walkthrough (--mode code-walkthrough), and requirements
7
+ (lightweight, --mode requirements) modes. Uses 2-3 experts from at least 2 different domestic
8
+ model providers with a >=90% statistical consensus threshold.
8
9
  Outputs structured verdict (APPROVED/PASS_WITH_CAVEATS/REQUEST_CHANGES/BLOCKED).
9
10
 
10
11
  WHAT: Anonymous multi-expert review with iterative consensus building for designs, plans,
@@ -20,12 +21,13 @@ description: >
20
21
  "多专家评审", "consensus review", "code walkthrough", "push review", "architecture review",
21
22
  "delphi review", "run delphi", "start delphi", "评审这个架构", "review this architecture",
22
23
  "评审PR", "review this PR with delphi", "delphi评审", "delphi 评审", "run delphi review",
23
- "执行delphi", "启动delphi评审".
24
+ "执行delphi", "启动delphi评审", "review the requirements", "评审需求", "requirements review",
25
+ "/requirements-review".
24
26
  NEGATIVE TRIGGERS: "how does delphi work", "what is delphi review", "code review checklist",
25
27
  "review my code quickly", "can you review this", "peer review", "I need a review",
26
28
  "explain the review process", "review guidelines", "how to review a design",
27
29
  "code review template", "review format", "PR review", "帮我review一下",
28
- "just review this", "quick review", "review steps".
30
+ "just review this", "quick review", "review steps", "review my requirements document".
29
31
  maturity: beta
30
32
  auto_continue: true
31
33
  triggers:
@@ -51,6 +53,10 @@ triggers:
51
53
  - "run delphi review"
52
54
  - "执行delphi"
53
55
  - "启动delphi评审"
56
+ - "review the requirements"
57
+ - "评审需求"
58
+ - "requirements review"
59
+ - "/requirements-review"
54
60
  triggers_negative_examples:
55
61
  - "how does delphi work" # educational question about the process
56
62
  - "what is delphi review" # asking for explanation, not execution
@@ -72,6 +78,7 @@ triggers_negative_examples:
72
78
  - "review format" # asking about format, not executing
73
79
  - "show me how to review" # educational request about reviewing
74
80
  - "review checklist example" # asking for examples, not running review
81
+ - "review my requirements document" # educational discussion about requirements, not executing review
75
82
  triggers_negative_test_cases:
76
83
  - input: "how does delphi work"
77
84
  expect: "NOT triggered"
@@ -129,6 +136,16 @@ triggers_negative_test_cases:
129
136
  expect: "NOT triggered"
130
137
  - input: "run delphi"
131
138
  expect: "triggered"
139
+ - input: "review the requirements"
140
+ expect: "triggered"
141
+ - input: "评审需求"
142
+ expect: "triggered"
143
+ - input: "requirements review"
144
+ expect: "triggered"
145
+ - input: "/requirements-review"
146
+ expect: "triggered"
147
+ - input: "review my requirements document"
148
+ expect: "NOT triggered"
132
149
  workflow_steps:
133
150
  - "Step 0: Input Validation → Output: [DelphiReview] or [DelphiReview:BLOCKED]"
134
151
  - "Round 1: Anonymous Independent Review → Output: [DelphiReview Round 1] expert JSON verdicts"
@@ -203,6 +220,10 @@ tools_denied:
203
220
  - run delphi review
204
221
  - 执行delphi
205
222
  - 启动delphi评审
223
+ - review the requirements
224
+ - 评审需求
225
+ - requirements review
226
+ - /requirements-review
206
227
 
207
228
  **NOT triggered by:**
208
229
  - "how does delphi work" (educational)
@@ -222,6 +243,7 @@ tools_denied:
222
243
  - "code review template" (asking for template)
223
244
  - "review format" (asking about format)
224
245
  - "show me how to review" (educational)
246
+ - "review my requirements document" (educational discussion, not execution)
225
247
 
226
248
  ## Workflow
227
249
 
@@ -280,9 +302,12 @@ Each round MUST output a structured round marker:
280
302
  |------|------|------|------|
281
303
  | `design`(默认) | `/delphi-review` | 需求/设计/架构/PR 评审 | 共识报告 + specification.yaml |
282
304
  | `code-walkthrough` | `--mode code-walkthrough` | git push 前代码走查 | `.code-walkthrough-result.json` |
305
+ | `requirements` | `--mode requirements` | Phase 2 THINK 阶段需求评审 | `.sprint-state/phase-outputs/requirements-reviewed.json` |
283
306
 
284
307
  **Code Walkthrough 模式**的完整规范 → 详见 `references/code-walkthrough.md`
285
308
 
309
+ **Requirements 模式**的完整规范 → 详见 `references/requirements.md`
310
+
286
311
  ---
287
312
 
288
313
  ## 参数配置
@@ -419,6 +444,28 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
419
444
 
420
445
  **For code-walkthrough mode**, output follows `.code-walkthrough-result.json` schema (see `references/code-walkthrough.md`).
421
446
 
447
+ **For requirements mode**, output follows `requirements-reviewed.json` schema (see `references/requirements.md`):
448
+
449
+ ```json
450
+ {
451
+ "mode": "requirements",
452
+ "verdict": "APPROVED|GAPS_FOUND",
453
+ "timestamp": "2026-07-25T10:30:00Z",
454
+ "requirements_hash": "<SHA-256 hex digest>",
455
+ "head_commit": "<git rev-parse HEAD>",
456
+ "context_file_used": "CONTEXT.md",
457
+ "round": 1,
458
+ "expert_verdicts": [
459
+ { "role": "architecture", "verdict": "APPROVED", "confidence": 9 },
460
+ { "role": "feasibility", "verdict": "APPROVED", "confidence": 8 }
461
+ ],
462
+ "requirements_statement": "<short summary of what was reviewed>",
463
+ "gaps_found": [],
464
+ "rounds_used": 1,
465
+ "escalation_needed": false
466
+ }
467
+ ```
468
+
422
469
  **Anti-patterns mapping:**
423
470
  - `Round 1 → "评审完成"` → MUST NOT have `verdict: APPROVED` if `critical_issues` exist
424
471
  - `只处理 Critical,忽略 Major` → MUST include `major_concerns` array
@@ -452,6 +499,11 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
452
499
  {"mode":"code-walkthrough","commit":"abc123...","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0}
453
500
  ```
454
501
 
502
+ **Requirements mode APPROVED** → `.sprint-state/delphi-reviewed.json`:
503
+ ```json
504
+ {"mode":"requirements","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0}
505
+ ```
506
+
455
507
  ---
456
508
 
457
509
  ## Anti-Patterns
@@ -468,6 +520,8 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
468
520
 
469
521
  **Code-walkthrough 专属 Anti-Patterns** → 详见 `references/code-walkthrough.md`
470
522
 
523
+ **Requirements 专属 Anti-Patterns** → 详见 `references/requirements.md`
524
+
471
525
  ---
472
526
 
473
527
  ## Red Flags
@@ -499,5 +553,6 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
499
553
  | File | Content |
500
554
  |------|---------|
501
555
  | `@references/code-walkthrough.md` | Code-walkthrough mode specification |
556
+ | `@references/requirements.md` | Requirements mode specification |
502
557
  | `@references/orchestrator-dispatch.md` | Orchestrator auto-dispatch rules (#218 subagent multi-round loop) |
503
558
  | `@references/round-templates.md` | Round templates (anonymous/exchange/final/fix report formats) |