@boyingliu01/xp-gate 0.18.5 → 0.19.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.
Files changed (254) hide show
  1. package/adapter-common.sh +27 -0
  2. package/adapters/gate-3.sh +0 -0
  3. package/adapters/gate-4.sh +0 -0
  4. package/adapters/gate-7.sh +0 -0
  5. package/adapters/gate-8.sh +0 -0
  6. package/adapters/gate-9.sh +0 -0
  7. package/adapters/powershell.sh +114 -35
  8. package/adapters/typescript.sh +8 -8
  9. package/build-integrity/__tests__/import-resolver.test.ts +22 -0
  10. package/build-integrity/__tests__/orchestrator.test.ts +1 -2
  11. package/build-integrity/gate-10.ts +7 -0
  12. package/gate-12-file-hygiene.sh +230 -0
  13. package/hooks/adapter-common.sh +27 -0
  14. package/hooks/gate-10.sh +105 -0
  15. package/hooks/gate-12-file-hygiene.sh +0 -0
  16. package/hooks/lib/validate-code-walkthrough.cjs +125 -0
  17. package/hooks/pre-commit +130 -33
  18. package/hooks/pre-push +15 -91
  19. package/lib/__tests__/check-version.test.js +67 -46
  20. package/lib/__tests__/doctor.test.js +7 -6
  21. package/lib/__tests__/gate-runner.test.js +267 -0
  22. package/lib/__tests__/init.test.js +32 -0
  23. package/lib/__tests__/npm-package.test.js +13 -0
  24. package/lib/__tests__/phase-transition.test.js +604 -12
  25. package/lib/__tests__/sprint-discovery.test.ts +0 -1
  26. package/lib/__tests__/sprint-status-rework.test.js +100 -1
  27. package/lib/__tests__/update-hooks.test.js +143 -10
  28. package/lib/__tests__/upgrade-exec.test.js +73 -45
  29. package/lib/__tests__/upgrade-skill-sync.test.js +1 -1
  30. package/lib/__tests__/upgrade.test.js +12 -11
  31. package/lib/doctor.js +2 -1
  32. package/lib/gate-runner.js +68 -23
  33. package/lib/init.js +34 -5
  34. package/lib/install-skill.js +1 -0
  35. package/lib/mattpocock-license-verdict.json +1 -1
  36. package/lib/phase-transition.js +203 -23
  37. package/lib/shared-paths.js +2 -0
  38. package/lib/sprint-status.js +15 -4
  39. package/lib/test-alignment.ts +3 -13
  40. package/lib/update-hooks.js +129 -15
  41. package/mock-policy/AGENTS.md +4 -4
  42. package/mock-policy/__tests__/gate-m3.test.ts +0 -5
  43. package/mock-policy/__tests__/scope-scanner.test.ts +8 -2
  44. package/mutation/AGENTS.md +3 -3
  45. package/mutation/__tests__/mutmut-runner.test.ts +443 -2
  46. package/mutation/__tests__/update-baseline.test.ts +0 -2
  47. package/mutation/runners/mutmut-runner.ts +67 -17
  48. package/package.json +9 -3
  49. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  50. package/plugins/claude-code/skills/clipboard-vision/SKILL.md +47 -0
  51. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  52. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  53. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  54. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  55. package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  56. package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.sh +161 -0
  57. package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  58. package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  59. package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +24 -27
  60. package/plugins/claude-code/skills/delphi-review/AGENTS.md +12 -11
  61. package/plugins/claude-code/skills/delphi-review/INSTALL.md +15 -17
  62. package/plugins/claude-code/skills/delphi-review/SKILL.md +30 -29
  63. package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +6 -10
  64. package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +33 -49
  65. package/plugins/claude-code/skills/delphi-review/references/requirements.md +66 -54
  66. package/plugins/claude-code/skills/delphi-review/references/round-templates.md +7 -7
  67. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +4 -4
  68. package/plugins/claude-code/skills/sprint-flow/SKILL.md +4 -4
  69. package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +2 -2
  70. package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +37 -35
  71. package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +1 -1
  72. package/plugins/claude-code/skills/sprint-flow/references/phase-1-prep.md +1 -1
  73. package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +24 -14
  74. package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +6 -6
  75. package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +2 -2
  76. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
  77. package/plugins/dsh/README.md +25 -0
  78. package/plugins/dsh/cordis.patch.yml +7 -0
  79. package/plugins/dsh/package.json +70 -0
  80. package/plugins/dsh/scripts/prepack.cjs +82 -0
  81. package/plugins/dsh/skills/admin-template-guidelines/SKILL.md +113 -0
  82. package/plugins/dsh/skills/admin-template-guidelines/references/rule-1.md +91 -0
  83. package/plugins/dsh/skills/admin-template-guidelines/references/rule-2.md +155 -0
  84. package/plugins/dsh/skills/admin-template-guidelines/references/rule-3.md +70 -0
  85. package/plugins/dsh/skills/admin-template-guidelines/references/rule-4.md +154 -0
  86. package/plugins/dsh/skills/admin-template-guidelines/references/rule-5.md +126 -0
  87. package/plugins/dsh/skills/admin-template-guidelines/references/rule-6.md +180 -0
  88. package/plugins/dsh/skills/batch-grill-me/SKILL.md +15 -0
  89. package/plugins/dsh/skills/clipboard-vision/SKILL.md +47 -0
  90. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  91. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  92. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  93. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  94. package/plugins/dsh/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  95. package/plugins/dsh/skills/clipboard-vision/describe-clipboard.sh +161 -0
  96. package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  97. package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  98. package/plugins/dsh/skills/delphi-review/.delphi-config.json.example +70 -0
  99. package/plugins/dsh/skills/delphi-review/AGENTS.md +67 -0
  100. package/plugins/dsh/skills/delphi-review/INSTALL.md +150 -0
  101. package/plugins/dsh/skills/delphi-review/SKILL.md +559 -0
  102. package/plugins/dsh/skills/delphi-review/hooks.md +19 -0
  103. package/plugins/dsh/skills/delphi-review/opencode.json.delphi.example +52 -0
  104. package/plugins/dsh/skills/delphi-review/references/code-walkthrough.md +470 -0
  105. package/plugins/dsh/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
  106. package/plugins/dsh/skills/delphi-review/references/requirements.md +402 -0
  107. package/plugins/dsh/skills/delphi-review/references/round-templates.md +134 -0
  108. package/plugins/dsh/skills/delphi-review/scripts/verify-consensus.sh +43 -0
  109. package/plugins/dsh/skills/delphi-review/tools.md +29 -0
  110. package/plugins/dsh/skills/domain-modeling/ADR-FORMAT.md +64 -0
  111. package/plugins/dsh/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  112. package/plugins/dsh/skills/domain-modeling/SKILL.md +74 -0
  113. package/plugins/dsh/skills/grill-with-docs/SKILL.md +7 -0
  114. package/plugins/dsh/skills/grilling/SKILL.md +12 -0
  115. package/plugins/dsh/skills/improve-codebase-architecture/SKILL.md +156 -0
  116. package/plugins/dsh/skills/ralph-loop/SKILL.md +198 -0
  117. package/plugins/dsh/skills/ralph-loop/references/components.md +113 -0
  118. package/plugins/dsh/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
  119. package/plugins/dsh/skills/ralph-loop/references/workflow-details.md +99 -0
  120. package/plugins/dsh/skills/ralph-loop/templates/progress-log.md +36 -0
  121. package/plugins/dsh/skills/sprint-flow/AGENTS.md +103 -0
  122. package/plugins/dsh/skills/sprint-flow/SKILL.md +411 -0
  123. package/plugins/dsh/skills/sprint-flow/__tests__/sprint-flow.test.cjs +457 -0
  124. package/plugins/dsh/skills/sprint-flow/hooks.md +18 -0
  125. package/plugins/dsh/skills/sprint-flow/references/components/memory.md +87 -0
  126. package/plugins/dsh/skills/sprint-flow/references/components/middleware.md +75 -0
  127. package/plugins/dsh/skills/sprint-flow/references/components/skill-invocations.md +105 -0
  128. package/plugins/dsh/skills/sprint-flow/references/components/system-prompt.md +27 -0
  129. package/plugins/dsh/skills/sprint-flow/references/components/tool-descriptions.md +95 -0
  130. package/plugins/dsh/skills/sprint-flow/references/force-levels.md +204 -0
  131. package/plugins/dsh/skills/sprint-flow/references/orchestration-rules.md +236 -0
  132. package/plugins/dsh/skills/sprint-flow/references/phase-1-prep.md +294 -0
  133. package/plugins/dsh/skills/sprint-flow/references/phase-2-design.md +273 -0
  134. package/plugins/dsh/skills/sprint-flow/references/phase-3-build.md +348 -0
  135. package/plugins/dsh/skills/sprint-flow/references/phase-4-verify.md +225 -0
  136. package/plugins/dsh/skills/sprint-flow/references/phase-5-ship.md +222 -0
  137. package/plugins/dsh/skills/sprint-flow/references/phase-6-close.md +266 -0
  138. package/plugins/dsh/skills/sprint-flow/references/phase-overview.md +486 -0
  139. package/plugins/dsh/skills/sprint-flow/scripts/verify-sprint-state.sh +38 -0
  140. package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
  141. package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-output-template.md +110 -0
  142. package/plugins/dsh/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
  143. package/plugins/dsh/skills/sprint-flow/templates/pain-document-template.md +115 -0
  144. package/plugins/dsh/skills/sprint-flow/templates/sprint-progress-template.md +140 -0
  145. package/plugins/dsh/skills/sprint-flow/templates/sprint-summary-template.md +121 -0
  146. package/plugins/dsh/skills/sprint-flow/tools.md +29 -0
  147. package/plugins/dsh/skills/test-driven-development/SKILL.md +371 -0
  148. package/plugins/dsh/skills/test-driven-development/testing-anti-patterns.md +299 -0
  149. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +56 -0
  150. package/plugins/dsh/skills/test-specification-alignment/SKILL.md +205 -0
  151. package/plugins/dsh/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
  152. package/plugins/dsh/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
  153. package/plugins/dsh/skills/test-specification-alignment/references/specification-format.md +348 -0
  154. package/plugins/dsh/skills/to-issues/SKILL.md +277 -0
  155. package/plugins/dsh/src/command.test.ts +102 -0
  156. package/plugins/dsh/src/command.ts +75 -0
  157. package/plugins/dsh/src/contract.test.ts +62 -0
  158. package/plugins/dsh/src/gate-runner.test.ts +100 -0
  159. package/plugins/dsh/src/gate-runner.ts +58 -0
  160. package/plugins/dsh/src/index.test.ts +97 -0
  161. package/plugins/dsh/src/index.ts +94 -0
  162. package/plugins/dsh/src/skills.test.ts +58 -0
  163. package/plugins/dsh/tsconfig.build.json +13 -0
  164. package/plugins/dsh/tsconfig.json +19 -0
  165. package/plugins/dsh/vitest.config.ts +8 -0
  166. package/plugins/opencode/package.json +1 -1
  167. package/plugins/opencode/scripts/prepack.cjs +1 -0
  168. package/plugins/opencode/skills/clipboard-vision/SKILL.md +47 -0
  169. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  170. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  171. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  172. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  173. package/plugins/opencode/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  174. package/plugins/opencode/skills/clipboard-vision/describe-clipboard.sh +161 -0
  175. package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  176. package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  177. package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +24 -27
  178. package/plugins/opencode/skills/delphi-review/AGENTS.md +12 -11
  179. package/plugins/opencode/skills/delphi-review/INSTALL.md +15 -17
  180. package/plugins/opencode/skills/delphi-review/SKILL.md +30 -29
  181. package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +6 -10
  182. package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +33 -49
  183. package/plugins/opencode/skills/delphi-review/references/requirements.md +66 -54
  184. package/plugins/opencode/skills/delphi-review/references/round-templates.md +7 -7
  185. package/plugins/opencode/skills/sprint-flow/AGENTS.md +4 -4
  186. package/plugins/opencode/skills/sprint-flow/SKILL.md +4 -4
  187. package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +2 -2
  188. package/plugins/opencode/skills/sprint-flow/references/force-levels.md +37 -35
  189. package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +1 -1
  190. package/plugins/opencode/skills/sprint-flow/references/phase-1-prep.md +1 -1
  191. package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +24 -14
  192. package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +6 -6
  193. package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +2 -2
  194. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
  195. package/plugins/qoder/plugin.json +1 -1
  196. package/plugins/qoder/skills/clipboard-vision/SKILL.md +47 -0
  197. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  198. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  199. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  200. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  201. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/SKILL.md +47 -0
  202. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  203. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  204. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  205. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  206. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  207. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  208. package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  209. package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  210. package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +3 -11
  211. package/plugins/qoder/skills/delphi-review/AGENTS.md +14 -16
  212. package/plugins/qoder/skills/delphi-review/INSTALL.md +12 -12
  213. package/plugins/qoder/skills/delphi-review/SKILL.md +58 -25
  214. package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +1 -1
  215. package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +33 -49
  216. package/plugins/qoder/skills/sprint-flow/AGENTS.md +4 -4
  217. package/plugins/qoder/skills/sprint-flow/SKILL.md +2 -2
  218. package/plugins/qoder/skills/sprint-flow/references/force-levels.md +38 -35
  219. package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +1 -1
  220. package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +48 -6
  221. package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +5 -6
  222. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
  223. package/principles/AGENTS.md +3 -3
  224. package/scripts/__tests__/sync-package-content.test.js +30 -0
  225. package/scripts/delphi-external-review.cjs +194 -63
  226. package/scripts/sync-package-content.js +9 -2
  227. package/skills/clipboard-vision/SKILL.md +47 -0
  228. package/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  229. package/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  230. package/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  231. package/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  232. package/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  233. package/skills/clipboard-vision/describe-clipboard.sh +161 -0
  234. package/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  235. package/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  236. package/skills/delphi-review/.delphi-config.json.example +24 -27
  237. package/skills/delphi-review/AGENTS.md +12 -11
  238. package/skills/delphi-review/INSTALL.md +15 -17
  239. package/skills/delphi-review/SKILL.md +30 -29
  240. package/skills/delphi-review/opencode.json.delphi.example +6 -10
  241. package/skills/delphi-review/references/code-walkthrough.md +33 -49
  242. package/skills/delphi-review/references/requirements.md +66 -54
  243. package/skills/delphi-review/references/round-templates.md +7 -7
  244. package/skills/sprint-flow/AGENTS.md +4 -4
  245. package/skills/sprint-flow/SKILL.md +4 -4
  246. package/skills/sprint-flow/references/components/skill-invocations.md +2 -2
  247. package/skills/sprint-flow/references/force-levels.md +37 -35
  248. package/skills/sprint-flow/references/orchestration-rules.md +1 -1
  249. package/skills/sprint-flow/references/phase-1-prep.md +1 -1
  250. package/skills/sprint-flow/references/phase-2-design.md +24 -14
  251. package/skills/sprint-flow/references/phase-4-verify.md +6 -6
  252. package/skills/sprint-flow/references/phase-overview.md +2 -2
  253. package/skills/test-specification-alignment/AGENTS.md +3 -3
  254. package/sprint-gate.sh +291 -0
@@ -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
+ (--mode requirements) modes. Uses exactly 3
8
+ successfully executed experts with distinct model IDs and 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,
@@ -169,10 +170,10 @@ tools_denied:
169
170
  ## Scope
170
171
 
171
172
  **In Scope:**
172
- - Multi-round anonymous expert consensus review (design + code-walkthrough modes)
173
- - 2-3 experts from different providers with statistical consensus (>= 90%)
173
+ - Multi-round anonymous expert consensus review (design + requirements + code-walkthrough modes)
174
+ - Exactly 3 experts with distinct trimmed executable model IDs and statistical consensus (>= 90%)
174
175
  - Structured verdict: APPROVED / PASS_WITH_CAVEATS / REQUEST_CHANGES
175
- - Domestic models only (no Anthropic/OpenAI/Google)
176
+ - Provider, vendor, gateway, country, and model nationality are unrestricted; any expert execution failure blocks approval
176
177
 
177
178
  **Out of Scope:**
178
179
  - Does NOT implement code changes (review only, implementation is separate)
@@ -226,11 +227,11 @@ tools_denied:
226
227
  ## Workflow
227
228
 
228
229
  1. **Step 0: Input Validation** — Check input contains reviewable content (design doc/code/spec/diff). Empty input → `[DelphiReview:BLOCKED]`.
229
- 2. **Round 1: Anonymous Independent Review** — Experts review without seeing each other's opinions. Output individual verdict JSON.
230
- 3. **Consensus Check** — Consensus >=90% AND all APPROVED → complete.
231
- 4. **Round 2: Exchange Opinions** — Experts see others' opinions, re-evaluate.
232
- 5. **Round 3: Final Positions** — Final stance, output disagreements if any.
233
- 6. **Fix & Re-Review** — REQUEST_CHANGES → fix Critical+Major → restart from Round 2.
230
+ 2. **Round 1: Anonymous Independent Review** — Launch the architecture, technical, and feasibility Custom Agents independently. Record three successful `delphi_expert_result` records and each `requested_model`.
231
+ 3. **Execution Verification** — Require all three records and three distinct trimmed requested model IDs. Model provider, vendor, gateway, and nationality are unrestricted.
232
+ 4. **Consensus Check** — Aggregate all three results; consensus >=90% AND all APPROVED → complete.
233
+ 5. **Rounds 2-5** — Exchange evidence and re-evaluate with all three Custom Agents until approved or five rounds are exhausted.
234
+ 6. **Failure Handling** — Missing/failed agents, duplicate model IDs, or no consensus after Round 5 → BLOCK; never reduce the expert count.
234
235
  7. **Generate Output** — Consensus report + specification.yaml (design) or `.code-walkthrough-result.json` (walkthrough) + `delphi-reviewed.json`.
235
236
 
236
237
  ## Activation (MANDATORY for L1 Trigger Detection)
@@ -255,7 +256,7 @@ Each round MUST output a structured round marker:
255
256
 
256
257
  **Rules**:
257
258
  - Every round marker MUST appear as a separate, identifiable line
258
- - Round numbering MUST be sequential (1, 2, 3)
259
+ - Round numbering MUST be sequential (1 through at most 5)
259
260
  - After each round, output consensus summary: `consensus_ratio=N/N`, `verdict_status: converging | stable | diverging`
260
261
  - Final round MUST output verdict: `APPROVED | PASS_WITH_CAVEATS | REQUEST_CHANGES | PROCESS_BLOCK`
261
262
 
@@ -280,9 +281,38 @@ Each round MUST output a structured round marker:
280
281
  |------|------|------|------|
281
282
  | `design`(默认) | `/delphi-review` | 需求/设计/架构/PR 评审 | 共识报告 + specification.yaml |
282
283
  | `code-walkthrough` | `--mode code-walkthrough` | git push 前代码走查 | `.code-walkthrough-result.json` |
284
+ | `requirements` | `--mode requirements` | Phase 2 R1 需求完整性评审 | `.sprint-state/phase-outputs/requirements-reviewed.json` |
283
285
 
284
286
  **Code Walkthrough 模式**的完整规范 → 详见 `references/code-walkthrough.md`
285
287
 
288
+ ### Requirements 模式(Qoder Custom Agents)
289
+
290
+ 在 Phase 2 需求探索完成、设计审批前,并行运行 Qoder 的 architecture、technical、feasibility 三个 Custom Agent。Round 1 保持匿名;任一 Agent 未成功返回、任一裁决不是 `APPROVED`、三个 trimmed `requested_model` 不互异,或聚合 `consensus_ratio < 0.90` 时,R1 必须 BLOCK,不能减少专家数或使用仲裁结果代替。
291
+
292
+ APPROVED 后读取 `git rev-parse HEAD` 的精确结果并写入 `.sprint-state/phase-outputs/requirements-reviewed.json`。无法解析 HEAD 时不得写 APPROVED 证据:
293
+
294
+ ```json
295
+ {
296
+ "mode": "requirements",
297
+ "verdict": "APPROVED",
298
+ "timestamp": "2026-08-20T10:30:00Z",
299
+ "requirements_statement": "<被评审的原始需求陈述>",
300
+ "context_file_used": "CONTEXT.md | null",
301
+ "requirements_hash": "<SHA-256 of requirements_statement + context exact UTF-8 content if used + timestamp YYYY-MM-DD>",
302
+ "head_commit": "<exact git rev-parse HEAD>",
303
+ "consensus_ratio": 0.90,
304
+ "expert_verdicts": [
305
+ { "role": "architecture", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-a" },
306
+ { "role": "technical", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-b" },
307
+ { "role": "feasibility", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-c" }
308
+ ]
309
+ }
310
+ ```
311
+
312
+ Schema-v2 对 context 路径执行项目根目录 containment 与 realpath 检查,并在 Phase 2 transition 时重新计算 hash;生成 hash 为小写 hex,比较时大小写不敏感。
313
+
314
+ `confidence` 可以由 Custom Agent 提供,但不是 R1 evidence contract 的必需字段。Phase 2 全部步骤完成、进入 Phase 3 前必须执行 `npx xp-gate phase-transition 2 completed`;schema-v2 Sprint 只有通过程序化校验才能继续。
315
+
286
316
  ---
287
317
 
288
318
  ## 参数配置
@@ -291,16 +321,15 @@ Each round MUST output a structured round marker:
291
321
 
292
322
  | 配置 | 专家 | 适用场景 |
293
323
  |------|------|---------|
294
- | 2 专家(默认) | A(架构) + B(实现) | 代码变更、小型设计 |
295
- | 3 专家 | A(架构) + B(实现) + C(可行性) | 架构决策、需求文档 |
324
+ | 3 专家(强制) | A(架构) + B(实现) + C(可行性) | 所有评审模式 |
296
325
 
297
326
  ### 模型选择策略(强制 — 平台适配)
298
327
 
299
328
  **关键原则**:
300
- - ✅ 三个专家必须来自 **至少 2 家不同 provider**
329
+ - ✅ 三个专家必须成功执行且使用 **三个 distinct trimmed model IDs**
301
330
  - ❌ 禁止 hardcode 模型名称
302
- - ❌ 禁止三个专家全部使用同一 provider 的模型
303
- - ❌ 禁止使用 Anthropic/OpenAI/Google 等国外模型
331
+ - ✅ Provider、vendor、gateway 和模型国籍不受限制
332
+ - ❌ `provider: local` fallback 不能计为成功执行
304
333
 
305
334
  #### Qoder 平台(推荐 — Custom Agent 模式)
306
335
 
@@ -393,10 +422,7 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
393
422
 
394
423
  ## Output Format (MANDATORY for L3)
395
424
 
396
- **⚠️ Single vs Multi-Expert Output**:
397
- - **Multi-Expert Mode (default)**: MUST use the full JSON schema below. Each expert outputs independently; the orchestrator aggregates into `consensus_report`.
398
- - **Single Reviewer Mode** (explicit `--single`): MAY use simplified text template: `[DelphiReview] verdict=APPROVED|REQUEST_CHANGES|BLOCKED confidence=N/10 issues=[critical:N, major:N, minor:N] summary: [1-2 sentences]`.
399
- - **Never mix formats**.
425
+ Every Delphi mode MUST use the full JSON schema below. Each of the three Qoder Custom Agents outputs independently and the orchestrator aggregates only after execution verification. There is no single-reviewer Delphi approval path.
400
426
 
401
427
  ```json
402
428
  {
@@ -419,6 +445,8 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
419
445
 
420
446
  **For code-walkthrough mode**, output follows `.code-walkthrough-result.json` schema (see `references/code-walkthrough.md`).
421
447
 
448
+ **For requirements mode**, output follows the Requirements 模式 schema above and includes exact HEAD plus all three successful Custom Agent results.
449
+
422
450
  **Anti-patterns mapping:**
423
451
  - `Round 1 → "评审完成"` → MUST NOT have `verdict: APPROVED` if `critical_issues` exist
424
452
  - `只处理 Critical,忽略 Major` → MUST include `major_concerns` array
@@ -429,7 +457,7 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
429
457
  ## Terminal State Checklist
430
458
 
431
459
  - [ ] Phase 0 完成(文档验证 + 专家分配)
432
- - [ ] Round 1-3 完成(所有专家评审)
460
+ - [ ] 已完成所需轮次(最多 5 轮,每轮三个 Custom Agent 均执行)
433
461
  - [ ] 问题共识比例 >=90%
434
462
  - [ ] 所有 Critical Issues 已解决,Major Concerns 已处理
435
463
  - [ ] 最终裁决是 **APPROVED** 或 **APPROVED_WITH_MINOR**
@@ -452,6 +480,11 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
452
480
  {"mode":"code-walkthrough","commit":"abc123...","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0}
453
481
  ```
454
482
 
483
+ **Requirements mode APPROVED** → `.sprint-state/delphi-reviewed.json`:
484
+ ```json
485
+ {"mode":"requirements","timestamp":"...","verdict":"APPROVED","consensus_ratio":1.0}
486
+ ```
487
+
455
488
  ---
456
489
 
457
490
  ## Anti-Patterns
@@ -460,11 +493,11 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
460
493
  |---------|---------|
461
494
  | Round 1 未 APPROVED 就"评审完成" | 迭代直到 APPROVED,修复后重新评审 |
462
495
  | 只处理 Critical,忽略 Major | 零容忍:Critical/Major 全部必须处理 |
463
- | 单专家自评 | 至少 2 位不同 provider 的专家 |
496
+ | 单专家自评 | 三个 distinct executable models 全部成功执行 |
464
497
  | 用户说"时间紧急"就跳过 | 评审是投资不是开销 |
465
498
  | "专家几乎一致"就通过 | "几乎" = 不一致,继续到 >=90% |
466
- | 使用 Anthropic/GPT/Gemini | 必须使用国产开源模型 |
467
- | 三个专家同一厂家 | 必须来自至少 2 家不同厂家 |
499
+ | 按 provider 或模型国籍限制选择 | 仅强制三个 distinct trimmed model IDs |
500
+ | `provider: local` fallback 计入 | fallback 不算成功执行证据 |
468
501
 
469
502
  **Code-walkthrough 专属 Anti-Patterns** → 详见 `references/code-walkthrough.md`
470
503
 
@@ -477,7 +510,7 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
477
510
  | 要求跳过评审 | "skip review", "不用评审", "跳过评审" | → 提醒评审是投资而非开销 |
478
511
  | 时间压力 | "来不及", "时间紧", "emergency" | → 提醒时间紧迫正是需要评审的时刻 |
479
512
  | 提前终止 | Round 1 后用户说 "可以了", "够了" | → BLOCK: 评审未达终止条件 |
480
- | 单专家自评 | 用户仅指定 1 个专家 | → 提醒至少需要 2 位专家 |
513
+ | 单专家自评 | 用户仅指定 1 个专家 | → BLOCK:必须执行 architecture、technical、feasibility 三个 Custom Agent |
481
514
  | 无文档输入 | 仅触发词,无设计/代码内容 | → `[DelphiReview:BLOCKED]` |
482
515
 
483
516
  ---
@@ -4,7 +4,7 @@
4
4
  "===========================================",
5
5
  "Copy the relevant 'agent' block below into your opencode.json.",
6
6
  "Replace YOUR_PROVIDER/YOUR_MODEL with your actual provider and model names.",
7
- "At least 2 of the 3 agents should use different providers for cross-bias protection."
7
+ "All 3 agents must use distinct trimmed executable model IDs; providers may be shared."
8
8
  ],
9
9
 
10
10
  "$example_providers": {
@@ -14,11 +14,11 @@
14
14
 
15
15
  ## Five Core Properties
16
16
 
17
- 1. **匿名性** — Expert A/B 互不知道对方意见
17
+ 1. **匿名性** — Expert A/B/C 在 Round 1 互不知道对方意见
18
18
  2. **迭代共识** — 多轮直到 APPROVED
19
19
  3. **零容忍** — Critical Issues 必须修复
20
20
  4. **零降级** — 环境/资源问题必须阻断,通知用户解决
21
- 5. **强制覆盖** — 超过阈值必须 BLOCK,不能跳过
21
+ 5. **强制覆盖** — 变更必须完整评审;大型变更由用户选择完整评审或在评审前拆分
22
22
 
23
23
  ---
24
24
 
@@ -72,11 +72,13 @@ pre-push hook
72
72
  │ │
73
73
  │ ├─→ Expert B (实现 + 代码质量) 匿名评审 (含 principles_findings)
74
74
  │ │
75
+ │ ├─→ Expert C (可行性) 匿名评审 (含 principles_findings)
76
+ │ │
75
77
  │ ├─→ 共识检查
76
78
  │ │ │
77
- │ │ ├─→ 2/2 APPROVED → 允许推送
79
+ │ │ ├─→ 三份成功结果、三个 distinct requested_model、≥90% → 允许推送
78
80
  │ │ │
79
- │ │ ├─→ 分歧 → Expert C 仲裁
81
+ │ │ ├─→ 分歧 → 继续下一轮(最多 5 轮)
80
82
  │ │ │
81
83
  │ │ └─→ REQUEST_CHANGES → 阻塞推送
82
84
  │ │
@@ -93,9 +95,9 @@ pre-push hook
93
95
  |------|------|------|
94
96
  | Expert A | 架构 + 设计评审 | `.delphi-config.json` → `experts.architecture` |
95
97
  | Expert B | 实现 + 代码质量 | `.delphi-config.json` → `experts.technical` |
96
- | Expert C (仲裁) | 冲突裁决 | `.delphi-config.json` → `experts.feasibility` |
98
+ | Expert C | 可行性评审 | `.delphi-config.json` → `experts.feasibility` |
97
99
 
98
- > ⚠️ **注意**: 至少配置 **两个不同 provider** 的模型。详见 [INSTALL.md](./INSTALL.md)。
100
+ > 必须成功执行三个专家角色,并验证三个 distinct trimmed requested_model。Provider、vendor、gateway 和模型国籍均不受限制。`provider: local` fallback 不能计数,local hosted endpoint 可作为普通 callable provider。
99
101
 
100
102
  ---
101
103
 
@@ -171,8 +173,9 @@ pre-push hook
171
173
  │ │
172
174
  │ └─→ Step 2: Delphi Code Walkthrough
173
175
  │ │
174
- │ ├─→ Expert A 评审 (含 principles_findings)
175
- │ ├─→ Expert B 评审 (含 principles_findings)
176
+ │ ├─→ Expert A / architecture 评审 (含 principles_findings)
177
+ │ ├─→ Expert B / technical 评审 (含 principles_findings)
178
+ │ ├─→ Expert C / feasibility 评审 (含 principles_findings)
176
179
  │ └─→ 共识检查
177
180
  │
178
181
  └─→ 允许/阻塞推送
@@ -237,10 +240,10 @@ pre-push hook
237
240
 
238
241
  | 条件 | 结果 |
239
242
  |------|------|
240
- | 2/2 APPROVED + 无 Critical Issues | ✅ 允许推送 |
241
- | 2/2 APPROVED + 有 Minor Issues | ✅ 允许推送(记录问题) |
242
- | 1/2 APPROVED | ⚠️ 需要 Expert C 仲裁 |
243
- | 0/2 APPROVED | ❌ 阻塞推送 |
243
+ | 三份成功结果、三个 distinct requested_model、≥90% 且无 Critical Issues | ✅ 允许推送 |
244
+ | 三份成功结果、≥90% 且有 Minor Issues | ✅ 允许推送(记录问题) |
245
+ | 任一专家失败、缺失或模型重复 | ❌ 阻塞推送 |
246
+ | 共识不足或有 Critical Issues | ❌ 阻塞推送 |
244
247
  | 有 Critical Issues | ❌ 阻塞推送 |
245
248
  | 有 Major Issues 且未处理 | ❌ 阻塞推送 |
246
249
 
@@ -251,26 +254,9 @@ pre-push hook
251
254
  | 指标 | 阈值 | 处理 |
252
255
  |------|------|------|
253
256
  | 单次走查成本 | ~$0.03 | 正常执行 |
254
- | 最大评审文件数 | 20 个文件 | 超过 → **BLOCK** |
255
- | 最大 diff 行数 | 500 行 | 超过 → **BLOCK** |
257
+ | 变更规模 | 无硬性文件数或行数上限 | 大型变更必须完整评审或由用户选择拆分 |
256
258
 
257
- **超过阈值处理 (零降级)**:
258
-
259
- ```
260
- IF 超过阈值:
261
- → BLOCK 推送
262
- → 通知用户:变更过大,无法有效评审
263
- → 用户选项:
264
- A. 拆分变更(推荐)
265
- B. 用户明确授权跳过走查(需书面确认风险)
266
-
267
- ❌ 禁止自动跳过走查
268
- ❌ 禁止自动分批并批准
269
- ```
270
-
271
- **设计原则**:
272
- - 大变更跳过评审 = 质量风险泄露到生产环境
273
- - 用户有权决定是否接受风险,AI 不能自动跳过
259
+ 大型变更没有自动跳过或绕过路径。用户可以选择完整评审,或在评审前主动拆分变更;每个变更仍须通过完整的走查和证据验证。
274
260
 
275
261
  ---
276
262
 
@@ -282,7 +268,7 @@ IF 超过阈值:
282
268
  BEFORE code walkthrough:
283
269
  ├─ 检查 Expert A 模型可用性
284
270
  ├─ 检查 Expert B 模型可用性
285
- ├─ 检查 Expert C 模型可用性(仲裁时需要)
271
+ ├─ 检查 Expert C 模型可用性
286
272
  └─ 检查 OpenCode CLI 可用性
287
273
 
288
274
  IF 任何检查失败:
@@ -296,8 +282,7 @@ IF 任何检查失败:
296
282
 
297
283
  | 情况 | 处理 |
298
284
  |------|------|
299
- | Expert A API 错误 | BLOCK + 提示用户检查 API key |
300
- | Expert B API 错误 | BLOCK + 提示用户检查 API key |
285
+ | 任一专家 API 错误 | BLOCK + 提示用户检查 provider/API key |
301
286
  | OpenCode CLI 缺失 | BLOCK + 提示用户安装 OpenCode |
302
287
 
303
288
  ---
@@ -305,7 +290,7 @@ IF 任何检查失败:
305
290
  ## Expert 评审输出格式
306
291
 
307
292
  ```markdown
308
- ## Code Walkthrough - Expert [A/B]
293
+ ## Code Walkthrough - Expert [A/B/C]
309
294
 
310
295
  ### 变更摘要
311
296
  [变更的主要内容]
@@ -340,6 +325,7 @@ IF 任何检查失败:
340
325
  ### 专家意见汇总
341
326
  - Expert A: [APPROVED / REQUEST_CHANGES]
342
327
  - Expert B: [APPROVED / REQUEST_CHANGES]
328
+ - Expert C: [APPROVED / REQUEST_CHANGES]
343
329
 
344
330
  ### 共识结果
345
331
  [CONSENSUS / DISAGREEMENT]
@@ -370,8 +356,9 @@ IF 任何检查失败:
370
356
  "verdict": "APPROVED",
371
357
  "confidence": 9,
372
358
  "experts": [
373
- { "id": "Expert A", "verdict": "APPROVED", "confidence": 9 },
374
- { "id": "Expert B", "verdict": "APPROVED", "confidence": 8 }
359
+ { "id": "Expert A", "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a" },
360
+ { "id": "Expert B", "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model": null },
361
+ { "id": "Expert C", "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c" }
375
362
  ],
376
363
  "issues": [],
377
364
  "consensus_ratio": 1.0,
@@ -409,7 +396,8 @@ Hook 验证以下条件(全部满足才允许 push):
409
396
  2. JSON 格式有效
410
397
  3. commit hash 匹配当前 HEAD
411
398
  4. verdict = APPROVED
412
- 5. timestamp 未过期 (< 1小时)
399
+ 5. timestamp 未过期
400
+ 6. expires 必须是 timestamp 之后恰好 1 小时
413
401
 
414
402
  ---
415
403
 
@@ -430,8 +418,7 @@ Hook 验证以下条件(全部满足才允许 push):
430
418
  | 错误 | 正确 |
431
419
  |------|------|
432
420
  | Expert 不可用时跳过走查 | BLOCK + 提示用户修复环境 |
433
- | 超过阈值自动跳过走查 | BLOCK + 提示用户拆分变更 |
434
- | 超过阈值自动分批评审 | BLOCK + 用户决定是否拆分或授权跳过 |
421
+ | 大型变更 | 完整评审或由用户在评审前拆分 |
435
422
  | OpenCode CLI 缺失时允许推送 | BLOCK + 提示用户安装 OpenCode |
436
423
  | 模型 API 错误时降级单模型 | BLOCK + 提示用户检查 API 配置 |
437
424
  | 未写入 `.code-walkthrough-result.json` 就声明完成 | MUST 写入结果文件后才能完成 |
@@ -443,15 +430,17 @@ Hook 验证以下条件(全部满足才允许 push):
443
430
 
444
431
  **Pre-requisites (MANDATORY - BLOCK if missing):**
445
432
  - [ ] OpenCode CLI 已安装且可用
446
- - [ ] Expert A 模型 API 可用
447
- - [ ] Expert B 模型 API 可用
448
- - [ ] 变更大小在阈值内(文件 ≤20,行数 ≤500)
433
+ - [ ] 三个专家模型 API 均可用
434
+ - [ ] 变更已由用户选择完整评审或拆分为可审阅的变更
449
435
  - [ ] Expert A 完成匿名评审
450
436
  - [ ] Expert B 完成匿名评审
437
+ - [ ] Expert C 完成匿名评审
451
438
  - [ ] 共识检查完成
452
439
 
453
440
  **CRITICAL - 共识验证 (code-walkthrough):**
454
- - [ ] 至少 2/2 或 2/3 专家 APPROVED
441
+ - [ ] 三个成功结果均为 `result_type=delphi_expert_result`
442
+ - [ ] 三个 `requested_model` trimmed 后 distinct
443
+ - [ ] 聚合共识 >=90%,并在 exact HEAD 上写入结果
455
444
  - [ ] 无 Critical Issues 未解决
456
445
  - [ ] 无 Major Issues 未处理(或有处理计划)
457
446
 
@@ -471,11 +460,6 @@ Hook 验证以下条件(全部满足才允许 push):
471
460
  - **CANNOT 允许推送**
472
461
  - **MUST 修复后重新走查**
473
462
 
474
- **IF 超过大小阈值:**
475
- - **CANNOT 允许推送**
476
- - **MUST BLOCK 并提示拆分变更**
477
- - **用户可明确授权跳过(需确认风险)**
478
-
479
463
  **⭐ APPROVED 后必做 (code-walkthrough mode):写入结果文件**
480
464
 
481
465
  IF mode == `code-walkthrough` AND 最终裁决是 APPROVED,评审完成后必须:
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-29
4
- **Commit:** 05d23ae
3
+ **Generated:** 2026-08-30
4
+ **Commit:** 0848858
5
5
  **Branch:** main
6
- **Version:** 0.18.5.0
6
+ **Version:** 0.19.1.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -64,7 +64,7 @@ skills/sprint-flow/
64
64
 
65
65
  ## CONVENTIONS
66
66
  - **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context, saving 40-67% tokens.
67
- - **delphi-review HARD-GATE in Phase 2/6 DESIGN**: design must reach ≥90% consensus across ≥2 model providers, domestic models only. Unapproved → BLOCK coding.
67
+ - **delphi-review HARD-GATE in Phase 2/6 DESIGN**: design must reach ≥90% consensus from exactly three successfully executed, distinct model IDs. Provider, vendor, and country are unrestricted; any expert execution failure or unapproved result → BLOCK coding.
68
68
  - **`learn` is called twice**: once per REQ in Phase 3/6 (ralph-loop internal) and once in Phase 4/6 VERIFY (Sprint-level retro).
69
69
  - **Phase isolation**: each phase has explicit entry/exit criteria documented in its `references/phase-*.md` file.
70
70
  - **Emergent Requirements** discovered in Phase 6/6 CLOSE (USER ACCEPTANCE) are explicitly captured via `templates/emergent-issues-template.md` — never silently merged.
@@ -160,7 +160,7 @@ Sprint Flow is NOT just a sequential launcher of existing skills. Here's what ma
160
160
 
161
161
  1. **40-67% Token Savings via Ralph Loop**: Phase 3 BUILD default (`ralph-loop`) processes one REQ at a time with clean context, avoiding the linear context accumulation that costs 150K+ tokens in parallel mode.
162
162
 
163
- 2. **HARD-GATE Discipline**: Design must pass Delphi review (≥90% consensus, ≥2 model providers, domestic models only) before Phase 3 BUILD can start. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
163
+ 2. **HARD-GATE Discipline**: Design must pass Delphi review (≥90% consensus from exactly three successfully executed, distinct model IDs; provider, vendor, and country unrestricted) before Phase 3 BUILD can start. Any expert execution failure blocks approval. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
164
164
 
165
165
  3. **Emergent Requirements Acknowledgment**: Based on research showing 78% of failures are invisible to AI (arXiv study), Phase 6 CLOSE includes mandatory manual UAT verification — cannot be automated, skipped, or bypassed.
166
166
 
@@ -280,7 +280,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
280
280
  - **Step 4: to-issues** — `skill(name="to-issues")` — 垂直切片 Issue 拆分 → slices-manifest.json
281
281
  - **Step 5: specification.yaml** — 从 APPROVED 设计文档自动提取
282
282
  - **Web 前端额外注入**: `design-shotgun`
283
- - **条件分支**: IF autoplan AUTO_APPROVED → lightweight delphi-review (2 专家、1 轮); ELSE → 标准 delphi-review (3 专家)
283
+ - **条件分支**: force level 只调整上下文深度;所有路径都执行 architecture、technical、feasibility 三个 Custom Agent,最多 5 轮
284
284
 
285
285
  ### Phase 2/6→3/6: GITHOOKS-GATE(质量门禁安装检查)
286
286
 
@@ -2,12 +2,14 @@
2
2
 
3
3
  **执行时机**: Phase 2/6 DESIGN 之前,PREP AUTO-ESTIMATE 完成后。
4
4
 
5
- **目的**: 根据需求规模匹配适度评审流程,平衡质量保障与效率。
5
+ **目的**: 根据需求规模调整上下文深度与迭代预算,平衡质量保障与效率。Force level 永远不改变专家数量或批准语义。
6
6
 
7
7
  **核心原则**:
8
8
  - 所有级别**必须经过 Delphi 评审**,不可跳过
9
- - 轻量级采用**简化 Delphi**(2 专家、1 轮),仍需 2/2 批准
10
- - 标准/复杂采用**完整 Delphi**(2-3 专家、多轮)
9
+ - 所有级别都采用 architecture、technical、feasibility 三专家 Delphi;Round 1 独立执行并验证三份成功结果
10
+ - 模型 ID、provider、vendor、gateway 和国籍不受限制;`requested_model` trimmed 后必须 distinct
11
+ - Qoder 上三个角色分别由对应 Custom Agent 执行;force level 只改变传给 Agent 的上下文深度与迭代预算
12
+ - 评审达到 ≥90% 共识,最多 5 轮;失败或无法验证时阻断
11
13
  - 自动升级机制:当出现风险信号时强制升级级别
12
14
 
13
15
  ---
@@ -16,9 +18,9 @@
16
18
 
17
19
  | 级别 | 适用场景 | 专家数 | 最多轮数 | 通过条件 | 预计耗时 |
18
20
  |------|---------|--------|---------|----------|---------|
19
- | **轻量** | 小改动、局部修改、删除代码 | 2 | 1 | 2/2 批准 | 10-20 分钟 |
20
- | **标准** | 常规功能开发、模块重构 | 2 | 2 | 2/2 批准 | 30-60 分钟 |
21
- | **复杂** | 核心模块、跨模块变更、新增架构 | 3 | 3 | 3/3 批准 | 1-2 小时 |
21
+ | **轻量** | 小改动、局部修改、删除代码 | 3 | 1-5 | ≥90% 聚合共识 | 10-20 分钟 |
22
+ | **标准** | 常规功能开发、模块重构 | 3 | 1-5 | ≥90% 聚合共识 | 30-60 分钟 |
23
+ | **复杂** | 核心模块、跨模块变更、新增架构 | 3 | 1-5 | ≥90% 聚合共识 | 1-2 小时 |
22
24
 
23
25
  ---
24
26
 
@@ -26,9 +28,9 @@
26
28
 
27
29
  | 级别 | delphi-review 调用 | 预计 Token 消耗 | 成本说明 |
28
30
  |------|-------------------|--------------|---------|
29
- | **轻量** | 1 次(2 专家、1 轮) | ~8,000 | 简化流程,单轮评审 |
30
- | **标准** | 1-2 次(2 专家、1-2 轮) | ~15,000-25,000 | 可能需要 1 轮反馈 |
31
- | **复杂** | 1-3 次(3 专家、1-3 轮) | ~30,000-60,000 | 多轮深度评审 |
31
+ | **轻量** | 1 次(3 专家、最多 5 轮) | ~8,000 | 简化上下文,仍需完整执行 |
32
+ | **标准** | 1-2 次(3 专家、最多 5 轮) | ~15,000-25,000 | 可能需要反馈轮次 |
33
+ | **复杂** | 1-3 次(3 专家、最多 5 轮) | ~30,000-60,000 | 多轮深度评审 |
32
34
 
33
35
  > **成本计算依据**: 基于实际 Sprint 历史数据,假设每次 delphi-review 调用平均消耗 8,000-10,000 Token(含 3 位专家的输入输出)。
34
36
 
@@ -56,7 +58,7 @@
56
58
  | 触发条件 | 原级别 | 升级至 | 说明 |
57
59
  |---------|--------|--------|------|
58
60
  | Delphi 评审出现 REQUEST_CHANGES | 轻量 | 标准 | 需要第二轮评审 |
59
- | 专家意见分歧(1 票反对) | 轻量/标准 | 复杂 | 需要第 3 专家仲裁 |
61
+ | 专家意见分歧 | 轻量/标准 | 复杂 | 增加上下文深度与后续轮次预算,不增加或替换专家 |
60
62
  | 涉及公共 API 变更 | 轻量 | 标准 | 影响外部调用方 |
61
63
  | 修改文件数 > 5 或 LOC > 200 | 轻量 | 标准 | 改动规模超出轻量范围 |
62
64
  | 存在循环依赖 | 轻量/标准 | 复杂 | 架构风险高 |
@@ -81,10 +83,10 @@ AUTO-ESTIMATE 输出 → Force Levels 执行 → 自动升级机制(如触发
81
83
 
82
84
  | AUTO-ESTIMATE 指标 | 建议级别 | Force Levels 执行 |
83
85
  |-------------------|---------|------------------|
84
- | 引用计数 ≤ 3 + 跨模块 ≤ 1 | 轻量 | 2 专家、1 轮 Delphi |
85
- | 引用计数 4-10 或 跨模块 2 | 标准 | 2 专家、最多 2 轮 Delphi |
86
- | 引用计数 > 10 或 跨模块 ≥ 3 | 复杂 | 3 专家、最多 3 轮 Delphi |
87
- | 存在循环依赖 | 强制复杂 | 3 专家、最多 3 轮 + 架构评审 |
86
+ | 引用计数 ≤ 3 + 跨模块 ≤ 1 | 轻量 | 3 专家、最多 5 轮 Delphi |
87
+ | 引用计数 4-10 或 跨模块 2 | 标准 | 3 专家、最多 5 轮 Delphi |
88
+ | 引用计数 > 10 或 跨模块 ≥ 3 | 复杂 | 3 专家、最多 5 轮 Delphi |
89
+ | 存在循环依赖 | 强制复杂 | 3 专家、最多 5 轮 + 架构评审 |
88
90
 
89
91
  **关键区别**:
90
92
  - AUTO-ESTIMATE: **客观指标分析**(代码结构、引用计数)
@@ -100,15 +102,15 @@ AUTO-ESTIMATE 输出 → Force Levels 执行 → 自动升级机制(如触发
100
102
  |------|------------|-------------|
101
103
  | Phase 2/6 DESIGN 设计评审 | 3 专家、≥90% 共识、生成 specification.yaml | 不适用(设计阶段) |
102
104
  | Phase 3/6 BUILD 入口 | **必须检查** `.sprint-state/delphi-reviewed.json` 中 `verdict=APPROVED` | 轻量/标准/复杂:通过对应强度的 delphi-review 生成该门禁文件 |
103
- | 轻量级评审 | 生成 `delphi-reviewed.json`(2 专家、1 轮、2/2 批准) | 2 专家、1 轮、写入门禁文件 |
104
- | 标准级评审 | 生成 `delphi-reviewed.json`(2 专家、最多 2 轮、2/2 批准) | 2 专家、最多 2 轮、写入门禁文件 |
105
- | 复杂级评审 | 生成 `delphi-reviewed.json`(3 专家、最多 3 轮、3/3 批准) | 3 专家、最多 3 轮、写入门禁文件 |
105
+ | 轻量级评审 | 生成 `delphi-reviewed.json`(3 专家、最多 5 轮、≥90% 聚合共识) | 3 专家、最多 5 轮、写入门禁文件 |
106
+ | 标准级评审 | 生成 `delphi-reviewed.json`(3 专家、最多 5 轮、≥90% 聚合共识) | 3 专家、最多 5 轮、写入门禁文件 |
107
+ | 复杂级评审 | 生成 `delphi-reviewed.json`(3 专家、最多 5 轮、≥90% 聚合共识) | 3 专家、最多 5 轮、写入门禁文件 |
106
108
  | Phase 4/6 VERIFY 代码走查 | 再次检查 `delphi-reviewed.json` 或重新评审 | 复用 Force Levels 规则 |
107
109
 
108
110
  **关键规则**:
109
111
  - **DELPHI-GATE 永不跳过**:Phase 3/6 BUILD 入口必须检查 `.sprint-state/delphi-reviewed.json` 中 `verdict=APPROVED`
110
- - **Force Levels 定义评审强度**:轻量/标准/复杂决定用 2 专家 1 轮还是 3 专家 3 轮来**产生**门禁文件
111
- - **轻量级不是跳过评审**:而是简化流程(2 专家、1 轮),但仍需生成门禁文件
112
+ - **Force Levels 定义上下文强度**:所有级别都用三专家、distinct model IDs 和最多 5 轮来**产生**门禁文件
113
+ - **轻量级不是跳过评审**:只缩短上下文,不减少专家或共识验证
112
114
  - **LIGHTWEIGHT ≠ ONE-EXPERT**: 1 专家违反 Delphi 核心原则,禁止
113
115
 
114
116
  ---
@@ -122,9 +124,9 @@ AUTO-ESTIMATE 输出 → Force Levels 执行 → 自动升级机制(如触发
122
124
  - 无循环依赖
123
125
 
124
126
  **执行流程**:
125
- 1. 2 位专家独立评审(DeepSeek-v4-pro + Kimi-K2.6)
126
- 2. 单轮评审,无需多轮迭代
127
- 3. **2/2 批准**才通过(不允许 1/2 批准)
127
+ 1. 三位专家独立评审并验证 distinct requested_model
128
+ 2. 最多 5 轮迭代,直到达到 ≥90% 聚合共识
129
+ 3. 三份成功结果且 APPROVED 才通过
128
130
  4. 评审通过后写入 `.sprint-state/delphi-reviewed.json`
129
131
 
130
132
  **输出文件** (`.sprint-state/delphi-reviewed.json`):
@@ -133,13 +135,14 @@ AUTO-ESTIMATE 输出 → Force Levels 执行 → 自动升级机制(如触发
133
135
  "sprint_id": "sprint-2026-06-05-01",
134
136
  "level": "轻量",
135
137
  "delphi_review": {
136
- "experts": ["deepseek-v4-pro", "kimi-k2.6"],
138
+ "experts": ["architecture-model", "technical-model", "feasibility-model"],
137
139
  "rounds": 1,
138
140
  "votes": {
139
141
  "expert_a": "APPROVED",
140
- "expert_b": "APPROVED"
142
+ "expert_b": "APPROVED",
143
+ "expert_c": "APPROVED"
141
144
  },
142
- "consensus": "2/2 APPROVED",
145
+ "consensus": ">=90% APPROVED",
143
146
  "timestamp": "2026-06-05T10:30:00Z"
144
147
  },
145
148
  "status": "passed"
@@ -161,13 +164,13 @@ AUTO-ESTIMATE 输出 → Force Levels 执行 → 自动升级机制(如触发
161
164
  - 中等规模改动(5-15 个文件、200-500 行改动)
162
165
 
163
166
  **执行流程**:
164
- 1. 2 位专家独立评审(Round 1)
165
- 2. 如有 REQUEST_CHANGES,进入 Round 2(最多 2 轮)
166
- 3. **2/2 批准**才通过
167
+ 1. 三位专家独立评审(Round 1)
168
+ 2. 如有 REQUEST_CHANGES,继续后续轮次(最多 5 轮)
169
+ 3. 三份成功结果聚合达到 ≥90% 才通过
167
170
  4. 评审通过后写入 `.sprint-state/delphi-reviewed.json`
168
171
 
169
172
  **升级至复杂级条件**:
170
- - Round 2 仍有分歧(1 票反对)→ 升级至复杂级(第 3 专家仲裁)
173
+ - Round 5 仍未达到共识 → BLOCK,不能以仲裁或多数票绕过
171
174
  - 涉及核心模块(core/handlers)→ 升级至复杂级
172
175
  - 存在循环依赖 → 升级至复杂级
173
176
 
@@ -182,14 +185,14 @@ AUTO-ESTIMATE 输出 → Force Levels 执行 → 自动升级机制(如触发
182
185
  - 公共 API 重大变更
183
186
 
184
187
  **执行流程**:
185
- 1. 3 位专家独立评审(DeepSeek-v4-pro + Kimi-K2.6 + Qwen3.6-Plus)
186
- 2. 最多 3 轮评审(Round 1-3)
187
- 3. **3/3 批准**才通过
188
+ 1. architecture、technical、feasibility 三位专家使用用户配置的任意可执行模型独立评审
189
+ 2. 最多 5 轮评审
190
+ 3. 三份成功结果聚合达到 ≥90% 且全部 APPROVED 才通过
188
191
  4. 评审通过后写入 `.sprint-state/delphi-reviewed.json`
189
192
 
190
- **仲裁机制**:
191
- - Round 2 仍有分歧 → 第 3 专家(Qwen3.6-Plus)加入仲裁
192
- - Round 3 必须达成一致,否则 BLOCK 进入 Phase 3/6 BUILD
193
+ **分歧处理**:
194
+ - 每轮都保持同一组 architecture、technical、feasibility 三个角色,不新增仲裁者,也不减少执行
195
+ - Round 5 仍未达到批准共识时 BLOCK 进入 Phase 3/6 BUILD
193
196
 
194
197
  ---
195
198
 
@@ -216,7 +216,7 @@ find . -name "*{target}*.test.*" -o -name "*{target}*.spec.*" | grep -v node_mod
216
216
 
217
217
  **DELPHI-GATE invariant**: 所有流程级别(轻量/标准/复杂)的 Phase 3/6 BUILD 启动前,**必须**检查 `.sprint-state/delphi-reviewed.json` 的 verdict 为 `APPROVED`。未通过 delphi-review 直接路由到 BUILD 属于严重违规。
218
218
 
219
- **轻量级的正确理解**: 轻量级意味着 reduced-intensity 的 delphi-review(**2 专家、1 轮、2/2 APPROVED、较短上下文**),**不是**跳过 delphi-review,**不是** 1 专家评审。见 references/force-levels.md 的轻量级流程定义。
219
+ **轻量级的正确理解**: 轻量级意味着较短上下文与较低迭代预算,仍由 architecture、technical、feasibility 三个 Custom Agent 独立执行并聚合 ≥90% 共识。它不跳过 delphi-review,也不减少专家数。见 references/force-levels.md。
220
220
 
221
221
  **自动 escalation 规则**(检测到以下情况时,自动提升流程级别):
222
222