@boyingliu01/xp-gate 0.10.11 → 0.10.12

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 (44) hide show
  1. package/lib/__tests__/check-version.test.js +19 -5
  2. package/lib/__tests__/install-skill.test.js +1 -1
  3. package/mock-policy/AGENTS.md +3 -3
  4. package/mutation/AGENTS.md +3 -3
  5. package/package.json +1 -1
  6. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  7. package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
  8. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
  9. package/plugins/claude-code/skills/sprint-flow/SKILL.md +6 -9
  10. package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +8 -6
  11. package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +2 -2
  12. package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +3 -1
  13. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
  14. package/plugins/opencode/__tests__/xp-gate-e2e-upgrade.test.ts +562 -0
  15. package/plugins/opencode/package.json +1 -1
  16. package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
  17. package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
  18. package/plugins/opencode/skills/sprint-flow/SKILL.md +6 -9
  19. package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +8 -6
  20. package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +2 -2
  21. package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +3 -1
  22. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
  23. package/plugins/qoder/plugin.json +1 -1
  24. package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
  25. package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
  26. package/plugins/qoder/skills/sprint-flow/SKILL.md +191 -1088
  27. package/plugins/qoder/skills/sprint-flow/references/orchestration-rules.md +365 -0
  28. package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +2 -2
  29. package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +25 -180
  30. package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +3 -1
  31. package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +4 -188
  32. package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +4 -135
  33. package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +4 -187
  34. package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +6 -0
  35. package/plugins/qoder/skills/sprint-flow/references/phase-minus-1-isolate.md +58 -0
  36. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
  37. package/principles/AGENTS.md +3 -3
  38. package/skills/delphi-review/AGENTS.md +3 -3
  39. package/skills/sprint-flow/AGENTS.md +3 -3
  40. package/skills/sprint-flow/SKILL.md +6 -9
  41. package/skills/sprint-flow/references/orchestration-rules.md +8 -6
  42. package/skills/sprint-flow/references/phase-1-plan.md +2 -2
  43. package/skills/sprint-flow/references/phase-3-review.md +3 -1
  44. package/skills/test-specification-alignment/AGENTS.md +3 -3
@@ -180,11 +180,11 @@ describe('check-version.js — REQ-001-01', () => {
180
180
  }
181
181
 
182
182
  function withMockedHttps(latestVersion, fn) {
183
- const fs = require('fs');
184
- const os = require('os');
185
- const cpPath = require('path').join(os.homedir(), '.xp-gate', 'version-cache.json');
186
- if (fs.existsSync(cpPath)) {
187
- try { fs.unlinkSync(cpPath); } catch { }
183
+ const fsm = require('fs');
184
+ const osm = require('os');
185
+ const cpPath = require('path').join(osm.homedir(), '.xp-gate', 'version-cache.json');
186
+ if (fsm.existsSync(cpPath)) {
187
+ try { fsm.unlinkSync(cpPath); } catch { }
188
188
  }
189
189
  evictCache();
190
190
  const https = require('https');
@@ -204,11 +204,25 @@ describe('check-version.js — REQ-001-01', () => {
204
204
  callback(mockRes);
205
205
  return { on: () => undefined, destroy: () => undefined };
206
206
  };
207
+ // Mock getLocalVersion to return a fixed version so tests don't
208
+ // depend on the real package.json version (which drifts over time).
209
+ const savedReadFileSync = fsm.readFileSync;
210
+ const pkgJsonDir = require('path').join(
211
+ require('path').dirname(require.resolve('../check-version')),
212
+ '..'
213
+ );
214
+ fsm.readFileSync = (...args) => {
215
+ if (String(args[0]).endsWith('package.json') && String(args[0]) === require('path').join(pkgJsonDir, 'package.json')) {
216
+ return JSON.stringify({ name: '@boyingliu01/xp-gate', version: '0.8.21' });
217
+ }
218
+ return savedReadFileSync.apply(fsm, args);
219
+ };
207
220
  try {
208
221
  const m = require('../check-version');
209
222
  return fn(m);
210
223
  } finally {
211
224
  https.get = saved;
225
+ fsm.readFileSync = savedReadFileSync;
212
226
  }
213
227
  }
214
228
 
@@ -192,7 +192,7 @@ describe('install-skill', () => {
192
192
  const result = await installSkill('sprint-flow');
193
193
 
194
194
  expect(result).toBe(1);
195
- expect(console.error).toHaveBeenCalledWith('Error: sprint-flow is already installed');
195
+ expect(console.error).toHaveBeenCalledWith('Error: sprint-flow is already installed\nUse --force to overwrite');
196
196
  });
197
197
 
198
198
  it('backs up and replaces when target exists and force=true', async () => {
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-23
4
- **Commit:** bac916f
3
+ **Generated:** 2026-06-24
4
+ **Commit:** f8338d6
5
5
  **Branch:** main
6
- **Version:** 0.10.11.0
6
+ **Version:** 0.10.12.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-06-23
4
- **Commit:** bac916f
3
+ **Generated:** 2026-06-24
4
+ **Commit:** f8338d6
5
5
  **Branch:** main
6
- **Version:** 0.10.11.0
6
+ **Version:** 0.10.12.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.10.11",
3
+ "version": "0.10.12",
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"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
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": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-23
4
- **Commit:** bac916f
3
+ **Generated:** 2026-06-24
4
+ **Commit:** f8338d6
5
5
  **Branch:** main
6
- **Version:** 0.10.11.0
6
+ **Version:** 0.10.12.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-23
4
- **Commit:** bac916f
3
+ **Generated:** 2026-06-24
4
+ **Commit:** f8338d6
5
5
  **Branch:** main
6
- **Version:** 0.10.11.0
6
+ **Version:** 0.10.12.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → USER ACCEPTANCE → FEEDBACK → SHIP → LAND → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
@@ -237,11 +237,11 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
237
237
  - **HARD-GATE**: 设计未批准 → 不可进入实现
238
238
 
239
239
  ### Phase 1: PLAN(共识评审)
240
- - **注意**: `autoplan` 和 `to-issues` 是交互式 skill,**必须由 orchestrator 直接执行**(Issue #225, #248)
241
- - **执行模式(三阶段)**:
240
+ - **注意**: `autoplan`、`delphi-review` 和 `to-issues` 均为交互式 skill,**必须由 orchestrator 直接执行**(Issue #225, #248, #249
241
+ - **执行模式(三阶段,全部 orchestrator 直接执行)**:
242
242
  1. **Orchestrator 直接执行 autoplan**: `skill(name="autoplan")` → 用户确认 taste_decisions
243
- 2. **Orchestrator 直接执行 to-issues**: `skill(name="to-issues")` 用户确认 Issue 拆分方案
244
- 3. **Subagent 执行 delphi-review**: `task(category="deep", load_skills=["delphi-review"])` 非交互式,可自动运行至 APPROVED
243
+ 2. **Orchestrator 直接执行 delphi-review**: `skill(name="delphi-review")` 等待 APPROVED(非 APPROVED 时需等待用户确认/处理)
244
+ 3. **Orchestrator 直接执行 to-issues**: `skill(name="to-issues")` 用户确认 Issue 拆分方案
245
245
  - 输入: phase-0-summary.md + 设计文档
246
246
  - 输出: `specification.yaml`(含 user_stories[])+ `slices-manifest.json`
247
247
 
@@ -276,13 +276,10 @@ Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW
276
276
  5. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
277
277
 
278
278
  ### Phase 3: REVIEW + TEST(验证)
279
- - **Subagent dispatch**: orchestrator 通过 `task(category="deep", load_skills=["delphi-review", "test-specification-alignment"])` 启动独立 session
279
+ - **Orchestrator 直接执行**: delphi-review code-walkthrough 需要用户确认 verdict(Issue #249),**必须由 orchestrator 直接调用** `skill(name="delphi-review")`
280
+ - **Orchestrator 按序执行**: `delphi-review --mode code-walkthrough` → 等待 APPROVED → `test-specification-alignment` → `browse` (gstack) → 可选 `qa`/`design-review`/`benchmark` (gstack)
280
281
  - 输入: phase-2-summary.md + MVP 代码
281
282
  - 输出: 评审报告 + 测试对齐结果
282
- - `delphi-review --mode code-walkthrough` — 多专家匿名代码走查
283
- - `test-specification-alignment` — 测试与 Spec 对齐验证
284
- - `browse` (gstack) — 浏览器自动化测试
285
- - `k6` / `locust` / `gatling` — 负载/压力测试(可选,后端项目)
286
283
 
287
284
  ### 负载/压力测试(可选)
288
285
  - **适用项目**:主要用于后端服务的压力测试 (k6/Locust/Gatling),Web 前端已有 `benchmark` 技能覆盖 Core Web Vitals、加载时间和资源大小等性能指标
@@ -31,9 +31,9 @@
31
31
  | -1 | ISOLATE | ❌ | Bash(直接执行) | 无 | orchestrator |
32
32
  | -0.5 | AUTO-ESTIMATE | ❌ | Bash(直接执行) | 无 | orchestrator |
33
33
  | 0 | THINK | ❌ | orchestrator(直接执行) | `["brainstorming"]` | orchestrator |
34
- | 1 | PLAN | ⚠️ | orchestrator 执行 autoplan + to-issues(交互)→ subagent 执行 delphi-review | 见下方说明 | orchestrator + subagent |
34
+ | 1 | PLAN | | orchestrator(直接执行) | `["autoplan", "delphi-review", "to-issues"]` | orchestrator |
35
35
  | 2 | BUILD | ✅ | ralph-loop | `["test-driven-development"]` | subagent |
36
- | 3 | REVIEW | | `deep` | `["delphi-review", "test-specification-alignment"]` | subagent |
36
+ | 3 | REVIEW | | orchestrator(直接执行) | `["delphi-review", "test-specification-alignment"]` | orchestrator |
37
37
  | 4 | USER ACCEPT | ❌ | **强制人工** | 无 | 用户 |
38
38
  | 5 | FEEDBACK | ✅ | `quick` | `["learn", "retro", "systematic-debugging"]` | subagent |
39
39
  | 6 | SHIP | ❌ | orchestrator(直接执行) | `["finishing-a-development-branch", "ship"]` | orchestrator |
@@ -46,15 +46,17 @@
46
46
  |-------|-------|---------------------------|
47
47
  | 0 | `brainstorming` | 需要与用户对话确认需求、提出澄清问题。Subagent 是 fire-and-forget 模式,无法暂停等待用户输入(Issue #217) |
48
48
  | 1 | `autoplan` | taste_decisions 节点暂停等待用户确认。必须由 orchestrator 直接执行(Issue #225) |
49
+ | 1 | `delphi-review` | design 模式需等待 verdict APPROVED;非 APPROVED 时需用户确认是否接受分歧方案(Issue #249) |
49
50
  | 1 | `to-issues` | Step 6 "向用户确认" — 展示拆分结果,等待用户批准后才生成 slices-manifest.json |
51
+ | 3 | `delphi-review --mode code-walkthrough` | Code walkthrough 非 APPROVED 时需暂停等待用户处理 Critical Issues(Issue #249) |
50
52
  | 6 | `finishing-a-development-branch` | 4 选项菜单 (merge/PR/keep/discard) 需要用户选择;Option 4 (discard) 要求 typed confirmation |
51
53
  | 6 | `ship` | PR 创建前需要用户确认;包含 AskUserQuestion STOP 点 |
52
54
  | 7 | `land-and-deploy` | Merge 确认、rollback 决策 — 均为用户交互点 |
53
55
 
54
- **Phase 1 执行模式(两阶段)**:
56
+ **Phase 1 执行模式(全部 orchestrator 直接执行)**:
55
57
  1. **Orchestrator 直接执行 autoplan**:`skill(name="autoplan")` → 等待用户确认 taste_decisions
56
- 2. **Orchestrator 直接执行 to-issues**:`skill(name="to-issues")` → 等待用户确认 Issue 拆分
57
- 3. **Subagent 执行 delphi-review**:`task(category="deep", load_skills=["delphi-review"])` 非交互式,可自动运行至 APPROVED
58
+ 2. **Orchestrator 直接执行 delphi-review**:`skill(name="delphi-review")` → 等待 APPROVED(非 APPROVED 时暂停等待用户确认)
59
+ 3. **Orchestrator 直接执行 to-issues**:`skill(name="to-issues")` 等待用户确认 Issue 拆分
58
60
 
59
61
  **上下文隔离原则**:
60
62
  - 每个 Subagent 在**独立 session** 中启动,不继承 orchestrator 的对话历史
@@ -71,7 +73,7 @@
71
73
  | Phase 0 | phase--1-summary(仅路径) | 隔离环境信息(worktree 路径) |
72
74
  | Phase 1 | phase-0-summary.md + design-doc | 设计决策 + 结构化规格 |
73
75
  | Phase 2 | phase-1-summary.md + specification.yaml | 评审结论 + REQ 列表 |
74
- | Phase 3 | phase-2-summary.md + MVP 代码 | 构建结果 |
76
+ | Phase 3 | phase-2-summary.md + MVP 代码 | 构建结果(orchestrator 直接执行,无 subagent 上下文继承) |
75
77
  | Phase 4 | — | **人工验收**。Phase 4 不产生 subagent summary,但用户验收结果记录在 `.sprint-state/phase-outputs/emergent-issues.md`(如有 emergent issues)。Phase 5 加载此文件。 |
76
78
  | Phase 5 | phase-4-summary.md + emergent-issues.md | 验收结论 |
77
79
  | Phase 6 | phase-5-summary.md + feedback-log.md | 复盘结论 |
@@ -105,7 +105,7 @@ Decision 2: [决策描述]
105
105
 
106
106
  ---
107
107
 
108
- ### Step 2b: 调用 delphi-review(强制)
108
+ ### Step 2b: 调用 delphi-review(强制,orchestrator 直接执行)
109
109
 
110
110
  ```bash
111
111
  skill(name="delphi-review", user_message="[设计文档 + taste_decisions 确认结果]")
@@ -117,7 +117,7 @@ delphi-review 执行:
117
117
  - 输出: APPROVED / REQUEST_CHANGES
118
118
 
119
119
  **如果 REQUEST_CHANGES**:
120
- - ⚠️ 暂停等待用户修复
120
+ - ⚠️ 暂停等待用户处理(orchestrator 直接执行,可交互确认)
121
121
  - 修复后重新评审(从 Round 2 起步)
122
122
  - 直到 APPROVED
123
123
 
@@ -4,6 +4,8 @@
4
4
 
5
5
  多专家代码走查、测试对齐、浏览器测试。确保 MVP 符合 specification。
6
6
 
7
+ **执行者**: orchestrator 直接执行全部步骤(非 subagent dispatch)— Issue #249。
8
+
7
9
  Web 前端项目额外增加:系统化 QA、视觉审计、性能基线。
8
10
 
9
11
  ---
@@ -46,7 +48,7 @@ delphi code-walkthrough 执行:
46
48
  - ≥90% 共识 + APPROVED 才通过
47
49
 
48
50
  **如果 REQUEST_CHANGES**:
49
- - ⚠️ 暂停等待用户修复 Critical Issues + 处理 Major Concerns
51
+ - ⚠️ 暂停等待用户处理 Critical Issues + Major Concerns(orchestrator 直接执行,可交互)
50
52
  - 修复后回到 Round 2 重新评审
51
53
 
52
54
  **如果 APPROVED**:
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-06-23
4
- **Commit:** bac916f
3
+ **Generated:** 2026-06-24
4
+ **Commit:** f8338d6
5
5
  **Branch:** main
6
- **Version:** 0.10.11.0
6
+ **Version:** 0.10.12.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.