@boyingliu01/xp-gate 0.8.18 → 0.8.20
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.
- package/lib/init.js +2 -2
- package/lib/install-skill.js +13 -4
- package/lib/principles.js +5 -0
- package/mock-policy/AGENTS.md +2 -2
- package/mutation/AGENTS.md +2 -2
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +2 -2
- package/plugins/claude-code/skills/delphi-review/SKILL.md +76 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +2 -2
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +133 -1083
- package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +5 -2
- package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +333 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +4 -193
- package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +4 -188
- package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +4 -135
- package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +4 -187
- package/plugins/claude-code/skills/sprint-flow/references/phase-minus-1-isolate.md +58 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +2 -2
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +2 -2
- package/plugins/opencode/skills/delphi-review/SKILL.md +76 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +2 -2
- package/plugins/opencode/skills/sprint-flow/SKILL.md +133 -1083
- package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +5 -2
- package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +333 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +4 -193
- package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +4 -188
- package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +4 -135
- package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +4 -187
- package/plugins/opencode/skills/sprint-flow/references/phase-minus-1-isolate.md +58 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +2 -2
- package/plugins/qoder/bin/xp-gate-check +5 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +2 -2
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +2 -2
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +2 -2
- package/principles/AGENTS.md +2 -2
- package/skills/delphi-review/AGENTS.md +2 -2
- package/skills/delphi-review/SKILL.md +76 -0
- package/skills/sprint-flow/AGENTS.md +2 -2
- package/skills/sprint-flow/SKILL.md +133 -1083
- package/skills/sprint-flow/references/components/middleware.md +5 -2
- package/skills/sprint-flow/references/orchestration-rules.md +333 -0
- package/skills/sprint-flow/references/phase-2-build.md +4 -193
- package/skills/sprint-flow/references/phase-6-ship.md +4 -188
- package/skills/sprint-flow/references/phase-7-land.md +4 -135
- package/skills/sprint-flow/references/phase-8-cleanup.md +4 -187
- package/skills/sprint-flow/references/phase-minus-1-isolate.md +58 -0
- package/skills/test-specification-alignment/AGENTS.md +2 -2
package/lib/init.js
CHANGED
|
@@ -335,7 +335,7 @@ async function installLocal(args) {
|
|
|
335
335
|
ensureConfigDir();
|
|
336
336
|
|
|
337
337
|
const manifest = generateManifest(srcDir, projectRoot);
|
|
338
|
-
updateConfig({ lastInit: new Date().toISOString(), mode: 'local', manifest });
|
|
338
|
+
updateConfig({ lastInit: new Date().toISOString(), mode: 'local', templateDir: TEMPLATE_DIR, manifest });
|
|
339
339
|
|
|
340
340
|
injectKarpathyPrinciples(projectRoot);
|
|
341
341
|
configureOpenCodePlugin(srcDir, projectRoot);
|
|
@@ -388,7 +388,7 @@ async function setupGlobal(args) {
|
|
|
388
388
|
ensureConfigDir();
|
|
389
389
|
|
|
390
390
|
const manifest = generateGlobalManifest(srcDir);
|
|
391
|
-
updateConfig({ lastInit: new Date().toISOString(), mode: 'global', manifest });
|
|
391
|
+
updateConfig({ lastInit: new Date().toISOString(), mode: 'global', templateDir: TEMPLATE_DIR, manifest });
|
|
392
392
|
|
|
393
393
|
console.log('\nGlobal setup complete!');
|
|
394
394
|
console.log('All git repositories will now use xp-gate quality gates.');
|
package/lib/install-skill.js
CHANGED
|
@@ -3,12 +3,21 @@ const path = require('path');
|
|
|
3
3
|
const https = require('https');
|
|
4
4
|
const http = require('http');
|
|
5
5
|
const { execSync } = require('child_process');
|
|
6
|
-
const { checkDeps
|
|
6
|
+
const { checkDeps } = require('./detect-deps.js');
|
|
7
7
|
const { downloadFromGitHub } = require('./download-skill.js');
|
|
8
8
|
const { rollback } = require('./rollback.js');
|
|
9
|
-
const { HOME_DIR, CONFIG_DIR } = require('./shared-paths.js');
|
|
9
|
+
const { HOME_DIR, CONFIG_DIR, detectPlatform } = require('./shared-paths.js');
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function getSkillsDir() {
|
|
12
|
+
const platform = detectPlatform();
|
|
13
|
+
if (platform === 'qoder') {
|
|
14
|
+
return path.join(HOME_DIR, '.qoder', 'skills');
|
|
15
|
+
}
|
|
16
|
+
if (platform === 'claude-code') {
|
|
17
|
+
return path.join(HOME_DIR, '.claude', 'skills');
|
|
18
|
+
}
|
|
19
|
+
return path.join(HOME_DIR, '.config', 'opencode', 'skills');
|
|
20
|
+
}
|
|
12
21
|
|
|
13
22
|
const SKILLS_REGISTRY = {
|
|
14
23
|
'sprint-flow': { repo: 'boyingliu01/xp-gate', path: 'skills/sprint-flow' },
|
|
@@ -43,7 +52,7 @@ async function installSkill(name, options = {}) {
|
|
|
43
52
|
return 1;
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
const targetDir = path.join(
|
|
55
|
+
const targetDir = path.join(getSkillsDir(), name);
|
|
47
56
|
if (fs.existsSync(targetDir) && !force) {
|
|
48
57
|
console.error(`Error: ${name} is already installed`);
|
|
49
58
|
console.error('Use --force to overwrite');
|
package/lib/principles.js
CHANGED
|
@@ -10,8 +10,13 @@ const path = require('path');
|
|
|
10
10
|
// - ../../src/principles/index.ts (installed under node_modules/@boyingliu01/xp-gate)
|
|
11
11
|
function findPrinciplesEntry() {
|
|
12
12
|
const candidates = [
|
|
13
|
+
// npm package bundled layout: lib/principles.js → principles/index.ts
|
|
14
|
+
path.resolve(__dirname, '..', 'principles', 'index.ts'),
|
|
15
|
+
// Development layout: lib/principles.js → src/principles/index.ts
|
|
13
16
|
path.resolve(__dirname, '..', '..', '..', 'src', 'principles', 'index.ts'),
|
|
17
|
+
// npm package installed under node_modules/@boyingliu01/xp-gate
|
|
14
18
|
path.resolve(__dirname, '..', '..', 'src', 'principles', 'index.ts'),
|
|
19
|
+
// Running from repo root
|
|
15
20
|
path.resolve(process.cwd(), 'src', 'principles', 'index.ts'),
|
|
16
21
|
];
|
|
17
22
|
for (const c of candidates) {
|
package/mock-policy/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SRC/MOCK-POLICY KNOWLEDGE BASE
|
|
2
2
|
|
|
3
3
|
**Generated:** 2026-06-17
|
|
4
|
-
**Commit:**
|
|
4
|
+
**Commit:** a697146
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.20.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.
|
package/mutation/AGENTS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SRC/MUTATION KNOWLEDGE BASE
|
|
2
2
|
|
|
3
3
|
**Generated:** 2026-06-17
|
|
4
|
-
**Commit:**
|
|
4
|
+
**Commit:** a697146
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.20.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": "xp-gate",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.20",
|
|
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
3
|
**Generated:** 2026-06-17
|
|
4
|
-
**Commit:**
|
|
4
|
+
**Commit:** a697146
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.20.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.
|
|
@@ -190,6 +190,80 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
|
190
190
|
|
|
191
191
|
---
|
|
192
192
|
|
|
193
|
+
## Orchestrator Dispatch Rules(#218 自动多轮调度)
|
|
194
|
+
|
|
195
|
+
### 背景
|
|
196
|
+
|
|
197
|
+
Delphi review 在 sprint-flow 中通过 subagent 调用时,Round 1→Round 2→Round 3 的调度**必须在 subagent 内部自动完成**,不能每轮暂停等待 orchestrator 或用户干预。只有在以下情况才需要 orchestrator 暂停:
|
|
198
|
+
|
|
199
|
+
### 自动调度规则
|
|
200
|
+
|
|
201
|
+
| 场景 | 自动处理 | 需暂停 |
|
|
202
|
+
|------|---------|--------|
|
|
203
|
+
| Round 1 完成,需 Round 2 | ✅ subagent 自动继续 | ❌ |
|
|
204
|
+
| Round 2 完成,需 Round 3 | ✅ subagent 自动继续 | ❌ |
|
|
205
|
+
| Round 3+ 完成,仍需更多轮 | ✅ subagent 自动继续,直到 max_rounds | ❌ |
|
|
206
|
+
| 最终 APPROVED (>=90%) | ✅ subagent 输出结果后退出 | ❌ |
|
|
207
|
+
| 最终 REQUEST_CHANGES(可自动修复) | ✅ subagent 尝试修复措辞、AC 缺失等常见问题后自动重评审 | ❌ |
|
|
208
|
+
| 最终 REQUEST_CHANGES(无法自动修复) | ✅ subagent 输出详细失败报告 | **✅ orchestrator 暂停等用户** |
|
|
209
|
+
| 超过 max_rounds (5) 仍无共识 | ✅ subagent 输出"未达成共识报告" | **✅ orchestrator 暂停等用户决策** |
|
|
210
|
+
|
|
211
|
+
### Subagent 内部 Round 循环
|
|
212
|
+
|
|
213
|
+
当 delphi-review 以 subagent 启动时(非交互式),应执行以下自动循环:
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
round = 1
|
|
217
|
+
while round <= max_review_rounds:
|
|
218
|
+
# 执行当前 round(所有专家匿名/半匿名评审)
|
|
219
|
+
results = execute_round(round)
|
|
220
|
+
|
|
221
|
+
# 检查共识
|
|
222
|
+
consensus = check_consensus(results)
|
|
223
|
+
|
|
224
|
+
if consensus.verdict == "APPROVED" and consensus.ratio >= 0.9:
|
|
225
|
+
emit_verdict("APPROVED", consensus)
|
|
226
|
+
break
|
|
227
|
+
|
|
228
|
+
if round == max_review_rounds:
|
|
229
|
+
# 已达最大轮数仍无共识
|
|
230
|
+
emit_verdict("NO_CONSENSUS", consensus)
|
|
231
|
+
break
|
|
232
|
+
|
|
233
|
+
round += 1
|
|
234
|
+
|
|
235
|
+
if verdict == "REQUEST_CHANGES":
|
|
236
|
+
# 尝试自动修复常见问题
|
|
237
|
+
auto_fix_result = attempt_auto_fix(issues)
|
|
238
|
+
if auto_fix_result.success:
|
|
239
|
+
# 自动修复后,从 Round 2 起步重新评审
|
|
240
|
+
round = 2
|
|
241
|
+
continue # 重新进入循环
|
|
242
|
+
else:
|
|
243
|
+
# 无法自动修复,交给 orchestrator
|
|
244
|
+
emit_verdict("REQUEST_CHANGES", auto_fix_result.failed_issues)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 终止结果输出
|
|
248
|
+
|
|
249
|
+
当 subagent 因终态退出时,必须输出清晰的裁决:
|
|
250
|
+
|
|
251
|
+
- **APPROVED**: 共识报告 + specification.yaml
|
|
252
|
+
- **REQUEST_CHANGES(可自动修复)**: 自动修复后再次评审
|
|
253
|
+
- **REQUEST_CHANGES(不可自动修复)**: 失败报告 + 建议修复方向
|
|
254
|
+
- **NO_CONSENSUS**: 分歧详情报告
|
|
255
|
+
|
|
256
|
+
### 与 orchestrator 的交互约定
|
|
257
|
+
|
|
258
|
+
| 状态 | Subagent 输出 | Orchestrator 动作 |
|
|
259
|
+
|------|--------------|------------------|
|
|
260
|
+
| APPROVED | `{verdict:"APPROVED", consensus_ratio: N, ...}` | 自动进入下一 Phase |
|
|
261
|
+
| REQUEST_CHANGES (auto-fixed) | `{verdict:"APPROVED", auto_fixed: ["..."]}` | 自动进入下一 Phase |
|
|
262
|
+
| REQUEST_CHANGES (unfixable) | `{verdict:"REQUEST_CHANGES", failed_issues: [...]}` | ⚠️ 暂停等用户修复后,通过 task_id 重新 dispatch |
|
|
263
|
+
| NO_CONSENSUS | `{verdict:"NO_CONSENSUS", disagreements: [...]}` | ⚠️ 暂停等用户决策(可继续/中止/强制通过) |
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
193
267
|
## 修复与重新评审
|
|
194
268
|
|
|
195
269
|
如果最终裁决是 REQUEST_CHANGES 或 REJECTED:
|
|
@@ -197,6 +271,8 @@ Phase 0: 准备 → Round 1: 匿名独立评审 → 共识检查
|
|
|
197
271
|
2. 重新评审(从 Round 2 起步,不是 Round 1)
|
|
198
272
|
3. 迭代直到 APPROVED
|
|
199
273
|
|
|
274
|
+
**Automatic re-review(#218)**: 当 delphi-review 以 subagent 运行时,对于常见的自动可控问题(措辞模糊、AC 缺失、格式问题等),subagent 应自行修复后自动重评审,无需等待用户。
|
|
275
|
+
|
|
200
276
|
修复报告格式:
|
|
201
277
|
```markdown
|
|
202
278
|
## 修复报告
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/SPRINT-FLOW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
3
|
**Generated:** 2026-06-17
|
|
4
|
-
**Commit:**
|
|
4
|
+
**Commit:** a697146
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.20.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.
|