@boyingliu01/xp-gate 0.15.5 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -100,6 +100,7 @@ function migrateState(state, stateDir) {
100
100
  function createInitialState(projectRoot) {
101
101
  return {
102
102
  _schema_version: 1,
103
+ evidence_schema_version: 2,
103
104
  id: `sprint-${Date.now()}`,
104
105
  task_description: '-',
105
106
  phase: 1,
@@ -9,6 +9,7 @@
9
9
 
10
10
  const fs = require('fs');
11
11
  const path = require('path');
12
+ const { execSync } = require('child_process');
12
13
  const { discoverActiveSprints } = require('./sprint-discovery');
13
14
  const { SprintStateManager } = require('./sprint-state-manager');
14
15
 
@@ -216,6 +217,109 @@ function jsonMode(state) {
216
217
  return JSON.stringify(state, null, 2);
217
218
  }
218
219
 
220
+ // #369: fix commit matching — conventional commits + keyword boundary
221
+ const FIX_RE = /^(fix(\(.+\))?:)|\b(fix|bugfix|hotfix|patch|修复)\b/i;
222
+
223
+ /**
224
+ * Count fix commits in a git repo since a given date (#369).
225
+ * Scans all branches (--all) per Round 1 repo-wide decision.
226
+ * @param {string} repoDir - Repository root
227
+ * @param {string} sinceDate - ISO 8601 date string
228
+ * @returns {number} Count of fix commits
229
+ */
230
+ function getFixCommitCount(repoDir, sinceDate) {
231
+ try {
232
+ const out = execSync(
233
+ `git log --all --since="${sinceDate}" --pretty=format:"%s"`,
234
+ { cwd: repoDir, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }
235
+ );
236
+ return out.split('\n').filter(l => l.trim() && FIX_RE.test(l.trim())).length;
237
+ } catch {
238
+ return 0;
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Handle --rework-check mode: compute rework rate for recently closed sprints (#369).
244
+ * @param {string} searchDir - Project root directory
245
+ * @param {number} windowDays - Window in days after completed_at
246
+ * @returns {Promise<number>} Exit code
247
+ */
248
+ async function handleReworkCheck(searchDir, windowDays) {
249
+ const stateDir = path.join(searchDir, '.sprint-state');
250
+ const historyDir = path.join(stateDir, 'sprint-history');
251
+ const sprintStateFile = path.join(stateDir, 'sprint-state.json');
252
+
253
+ const sprints = [];
254
+
255
+ // Current sprint-state.json
256
+ if (fs.existsSync(sprintStateFile)) {
257
+ try {
258
+ const state = JSON.parse(fs.readFileSync(sprintStateFile, 'utf8'));
259
+ if (state.metrics && state.metrics.completed_at) {
260
+ sprints.push({ id: state.id || 'unknown', state, file: sprintStateFile });
261
+ }
262
+ } catch { /* skip malformed */ }
263
+ }
264
+
265
+ // History files
266
+ if (fs.existsSync(historyDir)) {
267
+ for (const f of fs.readdirSync(historyDir).filter(f => f.endsWith('.json'))) {
268
+ try {
269
+ const fp = path.join(historyDir, f);
270
+ const state = JSON.parse(fs.readFileSync(fp, 'utf8'));
271
+ if (state.metrics && state.metrics.completed_at) {
272
+ sprints.push({ id: state.id || f.replace('.json', ''), state, file: fp });
273
+ }
274
+ } catch { /* skip malformed */ }
275
+ }
276
+ }
277
+
278
+ const now = Date.now();
279
+ const windowMs = windowDays * 86400000;
280
+ const inWindow = sprints.filter(s => {
281
+ const t = new Date(s.state.metrics.completed_at).getTime();
282
+ return !isNaN(t) && (now - t) <= windowMs;
283
+ });
284
+
285
+ if (inWindow.length === 0) {
286
+ console.log(`No closed sprints within ${windowDays} day${windowDays === 1 ? '' : 's'}`);
287
+ return 0;
288
+ }
289
+
290
+ console.log(`Rework Rate Check (window: ${windowDays} days)`);
291
+ console.log('─'.repeat(60));
292
+
293
+ let hasAlert = false;
294
+ for (const { id, state, file } of inWindow) {
295
+ const totalCommits = state.metrics.total_sprint_commits || 0;
296
+ const fixCommits = getFixCommitCount(searchDir, state.metrics.completed_at);
297
+ const rate = fixCommits / Math.max(totalCommits, 1);
298
+
299
+ // Write rework_rate back to the source file
300
+ state.metrics.rework_rate = rate;
301
+ try {
302
+ fs.writeFileSync(file, JSON.stringify(state, null, 2));
303
+ } catch { /* non-fatal */ }
304
+
305
+ const pct = (rate * 100).toFixed(1);
306
+ console.log(` ${id}: ${pct}% (${fixCommits} fix / ${totalCommits} total commits)`);
307
+ if (rate > 0.30) {
308
+ console.log(` ⚠️ ${id}: ${pct}% rework — exceeds 30% threshold`);
309
+ hasAlert = true;
310
+ }
311
+ }
312
+
313
+ console.log('─'.repeat(60));
314
+ if (hasAlert) {
315
+ console.log('⚠️ Rework rate alert: one or more sprints exceed 30% threshold');
316
+ } else {
317
+ console.log('All sprints within acceptable rework rate (≤30%)');
318
+ }
319
+
320
+ return 0;
321
+ }
322
+
219
323
  /**
220
324
  * CLI entry point. Parses args and executes the appropriate mode.
221
325
  * @param {string[]} args - CLI subargs (without 'sprint-status')
@@ -237,6 +341,13 @@ async function handleSprintStatus(args = []) {
237
341
  }
238
342
  }
239
343
 
344
+ // #369: --rework-check is mutually exclusive with regular status view
345
+ if (args.includes('--rework-check')) {
346
+ const wdIdx = args.indexOf('--window-days');
347
+ const windowDays = (wdIdx >= 0 && args[wdIdx + 1]) ? parseInt(args[wdIdx + 1], 10) : 7;
348
+ return handleReworkCheck(searchDir, isNaN(windowDays) ? 7 : windowDays);
349
+ }
350
+
240
351
  if (allFlag) {
241
352
  return handleAllSprints(searchDir, jsonFlag, watchFlag);
242
353
  }
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY 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
  Mock layering policy enforcement — Gate M3 of pre-push hook. Ensures integration tests use real implementations for internal dependencies, mock external dependencies, and annotate pending mocks with removal plans. Combines project scope scanning, mock decision engine, and per-file validation into a single pipeline.
@@ -1,9 +1,9 @@
1
1
  # SRC/MUTATION 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
  **Gate M** (incremental mutation testing) + **Gate M2** helpers (test-layer detection used by `src/mock-policy/`). Pre-push quality gate. TypeScript-only; uses Stryker.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/xp-gate",
3
- "version": "0.15.5",
3
+ "version": "0.18.1",
4
4
  "description": "AI-driven development workflow: 6 quality gates + Delphi review + Sprint Flow",
5
5
  "bin": {
6
6
  "xp-gate": "./bin/xp-gate.js"
@@ -40,7 +40,8 @@
40
40
  },
41
41
  "scripts": {
42
42
  "version": "0.14.31",
43
- "prepack": "node scripts/sync-package-content.js",
43
+ "license-check": "node scripts/check-mattpocock-license.cjs",
44
+ "prepack": "node scripts/check-mattpocock-license.cjs && node scripts/sync-package-content.js",
44
45
  "test": "echo \"Run tests\" && exit 0"
45
46
  },
46
47
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.15.5",
3
+ "version": "0.18.1",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
File without changes
File without changes
@@ -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) |