@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
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Issue #370: One-time migration to mark existing anomalous audit records.
4
+ *
5
+ * Scans .xp-gate/audit.jsonl for entries where duration_ms > max_duration_ms
6
+ * (default 7200000ms = 2h, configurable via .xp-gate-config.json audit.max_duration_ms)
7
+ * and adds `duration_anomaly: true` to those entries.
8
+ *
9
+ * Original duration_ms values are PRESERVED — never clamped or modified.
10
+ *
11
+ * Usage: node src/npm-package/scripts/migrate-audit-anomalies.mjs [--dry-run]
12
+ */
13
+ import { readFileSync, writeFileSync, existsSync } from 'fs';
14
+ import { join } from 'path';
15
+
16
+ const repoRoot = process.cwd();
17
+ const auditPath = join(repoRoot, '.xp-gate', 'audit.jsonl');
18
+ const configPath = join(repoRoot, '.xp-gate-config.json');
19
+ const dryRun = process.argv.includes('--dry-run');
20
+
21
+ // Read max_duration_ms from config (default 7200000)
22
+ let maxDurationMs = 7200000;
23
+ if (existsSync(configPath)) {
24
+ try {
25
+ const config = JSON.parse(readFileSync(configPath, 'utf8'));
26
+ if (config.audit && typeof config.audit.max_duration_ms === 'number') {
27
+ maxDurationMs = config.audit.max_duration_ms;
28
+ }
29
+ } catch {
30
+ // Use default
31
+ }
32
+ }
33
+
34
+ if (!existsSync(auditPath)) {
35
+ console.log(`No audit log found at ${auditPath} — nothing to migrate.`);
36
+ process.exit(0);
37
+ }
38
+
39
+ const content = readFileSync(auditPath, 'utf8');
40
+ const lines = content.split('\n');
41
+ let markedCount = 0;
42
+ let alreadyMarked = 0;
43
+ const updatedLines = [];
44
+
45
+ for (const line of lines) {
46
+ if (!line.trim()) {
47
+ updatedLines.push(line);
48
+ continue;
49
+ }
50
+ try {
51
+ const entry = JSON.parse(line);
52
+ if (entry.duration_ms > maxDurationMs) {
53
+ if (entry.duration_anomaly === true) {
54
+ alreadyMarked++;
55
+ } else {
56
+ entry.duration_anomaly = true;
57
+ markedCount++;
58
+ }
59
+ }
60
+ updatedLines.push(JSON.stringify(entry));
61
+ } catch {
62
+ // Preserve malformed lines as-is
63
+ updatedLines.push(line);
64
+ }
65
+ }
66
+
67
+ if (dryRun) {
68
+ console.log(`[DRY RUN] Would mark ${markedCount} records with duration_anomaly: true`);
69
+ console.log(`[DRY RUN] Already marked: ${alreadyMarked}`);
70
+ console.log(`[DRY RUN] Threshold: duration_ms > ${maxDurationMs}`);
71
+ } else {
72
+ writeFileSync(auditPath, updatedLines.join('\n'), 'utf8');
73
+ console.log(`Migration complete:`);
74
+ console.log(` Marked ${markedCount} records with duration_anomaly: true`);
75
+ console.log(` Already marked: ${alreadyMarked}`);
76
+ console.log(` Threshold: duration_ms > ${maxDurationMs}`);
77
+ console.log(` File: ${auditPath}`);
78
+ }
@@ -9,7 +9,11 @@ const REPO_ROOT = path.resolve(PKG_ROOT, '..', '..');
9
9
 
10
10
  const CORE_SKILLS = [
11
11
  'admin-template-guidelines',
12
+ 'batch-grill-me',
12
13
  'delphi-review',
14
+ 'domain-modeling',
15
+ 'grill-with-docs',
16
+ 'grilling',
13
17
  'improve-codebase-architecture',
14
18
  'ralph-loop',
15
19
  'sprint-flow',
@@ -172,6 +176,48 @@ function syncAdapters() {
172
176
  return copied + gateFiles.length;
173
177
  }
174
178
 
179
+ function syncHooks() {
180
+ const SRC = path.join(REPO_ROOT, 'githooks');
181
+ const DST = path.join(PKG_ROOT, 'hooks');
182
+ // In-place copy (no rmrf) to avoid race condition with parallel test readers.
183
+ fs.mkdirSync(DST, { recursive: true });
184
+
185
+ const HOOK_FILES = ['pre-commit', 'pre-push', 'adapter-common.sh'];
186
+ let copied = 0;
187
+
188
+ for (const name of HOOK_FILES) {
189
+ const srcPath = path.join(SRC, name);
190
+ const dstPath = path.join(DST, name);
191
+ if (fs.existsSync(srcPath)) {
192
+ fs.copyFileSync(srcPath, dstPath);
193
+ copied += 1;
194
+ }
195
+ }
196
+
197
+ // Copy lib/ subdirectory recursively
198
+ const libSrc = path.join(SRC, 'lib');
199
+ const libDst = path.join(DST, 'lib');
200
+ if (fs.existsSync(libSrc)) {
201
+ copyDir(libSrc, libDst);
202
+ copied += 1;
203
+ }
204
+
205
+ // Copy gate-*.sh files from githooks root to hooks/
206
+ const gateFiles = fs.readdirSync(SRC).filter(f =>
207
+ f.endsWith('.sh') && (f.startsWith('gate-') || f === 'sprint-gate.sh')
208
+ );
209
+ for (const f of gateFiles) {
210
+ fs.copyFileSync(path.join(SRC, f), path.join(DST, f));
211
+ }
212
+ if (gateFiles.length > 0) {
213
+ console.error(`[sync] hooks/ gate scripts: ${gateFiles.join(', ')}`);
214
+ copied += gateFiles.length;
215
+ }
216
+
217
+ console.error(`[sync] hooks/ (${copied} entries)`);
218
+ return copied;
219
+ }
220
+
175
221
  function syncModules(moduleName) {
176
222
  const src = path.join(REPO_ROOT, 'src', moduleName);
177
223
  const dest = path.join(PKG_ROOT, moduleName);
@@ -406,11 +452,12 @@ function main() {
406
452
  const plugins = syncPlugins();
407
453
  const scripts = syncScripts();
408
454
  const adapters = syncAdapters();
409
- const principles = syncModules('principles');
410
- const mutation = syncModules('mutation');
411
- const mockPolicy = syncModules('mock-policy');
412
- const buildIntegrity = syncModules('build-integrity');
413
- console.error(`[sync] done: ${skills} skill(s), ${plugins} plugin(s), ${scripts} script(s), ${adapters} adapter entries, ${principles + mutation + mockPolicy + buildIntegrity} module(s)`);
455
+ const hooks = syncHooks();
456
+ const principles = syncModules('principles');
457
+ const mutation = syncModules('mutation');
458
+ const mockPolicy = syncModules('mock-policy');
459
+ const buildIntegrity = syncModules('build-integrity');
460
+ console.error(`[sync] done: ${skills} skill(s), ${plugins} plugin(s), ${scripts} script(s), ${adapters} adapter entries, ${hooks} hook entries, ${principles + mutation + mockPolicy + buildIntegrity} module(s)`);
414
461
  if (skills !== CORE_SKILLS.length) {
415
462
  console.error(`[sync] ERROR: expected ${CORE_SKILLS.length} skills, copied ${skills}`);
416
463
  process.exit(1);
@@ -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) |