@boyingliu01/xp-gate 0.12.8 → 0.12.10
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/adapter-common.sh +13 -18
- package/lib/__tests__/doctor.test.js +65 -38
- package/lib/check-version.js +19 -4
- package/lib/upgrade.js +64 -0
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/mutation/runners/stryker-runner.ts +7 -5
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +117 -14
- package/plugins/claude-code/skills/sprint-flow/__tests__/sprint-flow.test.cjs +444 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +104 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/SKILL.md +117 -14
- package/plugins/opencode/skills/sprint-flow/__tests__/sprint-flow.test.cjs +444 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +104 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/principles/__tests__/config.test.ts +1 -1
- package/principles/config.ts +1 -1
- package/principles/rules/__tests__/clean-code/large-file.test.ts +6 -6
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/sprint-flow/SKILL.md +117 -14
- package/skills/sprint-flow/__tests__/sprint-flow.test.cjs +444 -0
- package/skills/sprint-flow/references/phase-2-build.md +104 -0
- package/skills/test-specification-alignment/AGENTS.md +3 -3
|
@@ -11,7 +11,7 @@ const mockAdapter = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
describe('largeFileRule', () => {
|
|
14
|
-
it('should return an empty array when file has fewer than
|
|
14
|
+
it('should return an empty array when file has fewer than threshold lines', () => {
|
|
15
15
|
const shortFileAdapter = {
|
|
16
16
|
...mockAdapter,
|
|
17
17
|
countLines: () => 499
|
|
@@ -21,10 +21,10 @@ describe('largeFileRule', () => {
|
|
|
21
21
|
expect(violations).toHaveLength(0);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it('should detect files exceeding
|
|
24
|
+
it('should detect files exceeding 1000 lines', () => {
|
|
25
25
|
const largeFileAdapter: never = {
|
|
26
26
|
...mockAdapter,
|
|
27
|
-
countLines: () =>
|
|
27
|
+
countLines: () => 1001
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const violations = largeFileRule.check('test-large.ts', largeFileAdapter);
|
|
@@ -33,7 +33,7 @@ describe('largeFileRule', () => {
|
|
|
33
33
|
file: 'test-large.ts',
|
|
34
34
|
line: 1,
|
|
35
35
|
ruleId: 'clean-code.large-file',
|
|
36
|
-
message: 'File is too large:
|
|
36
|
+
message: 'File is too large: 1001 lines (maximum: 1000)',
|
|
37
37
|
severity: 'warning'
|
|
38
38
|
});
|
|
39
39
|
});
|
|
@@ -41,7 +41,7 @@ describe('largeFileRule', () => {
|
|
|
41
41
|
it('should handle exactly threshold lines as not violating', () => {
|
|
42
42
|
const thresholdFileAdapter: never = {
|
|
43
43
|
...mockAdapter,
|
|
44
|
-
countLines: () =>
|
|
44
|
+
countLines: () => 1000
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const violations = largeFileRule.check('test-threshold.ts', thresholdFileAdapter);
|
|
@@ -57,7 +57,7 @@ describe('largeFileRule', () => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it('should use the correct threshold', () => {
|
|
60
|
-
expect(largeFileRule.threshold).toEqual(
|
|
60
|
+
expect(largeFileRule.threshold).toEqual(1000);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
it('should return empty violations when adapter throws error', () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-03
|
|
4
|
+
**Commit:** c3ed581
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.4.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-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-03
|
|
4
|
+
**Commit:** c3ed581
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.12.
|
|
6
|
+
**Version:** 0.12.4.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**11-phase** development pipeline: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → 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.
|
|
@@ -13,7 +13,7 @@ description: >
|
|
|
13
13
|
- "start sprint"
|
|
14
14
|
- "一键开发"
|
|
15
15
|
- "/sprint-flow"
|
|
16
|
-
触发后第一行输出: `Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE →
|
|
16
|
+
触发后第一行输出: `Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → FEEDBACK → SHIP → LAND → USER ACCEPTANCE → CLEANUP`
|
|
17
17
|
用法: /sprint-flow "[需求描述]"
|
|
18
18
|
示例: /sprint-flow "开发访谈机器人,支持多轮对话"
|
|
19
19
|
可选参数:
|
|
@@ -37,6 +37,44 @@ triggers:
|
|
|
37
37
|
- "开发新功能"
|
|
38
38
|
- "实现 X"
|
|
39
39
|
- "一键开发"
|
|
40
|
+
triggers_negative_examples:
|
|
41
|
+
- "实现排序算法" # algorithm implementation, not feature development
|
|
42
|
+
- "实现一下" # casual "do it", not a sprint request
|
|
43
|
+
- "帮我实现这个函数" # single function, not full feature
|
|
44
|
+
- "怎么实现登录功能" # asking HOW, not requesting development
|
|
45
|
+
- "start spring boot" # framework name, not sprint
|
|
46
|
+
- "开发环境配置" # environment setup, not feature development
|
|
47
|
+
- "一键部署" # deploy, not develop
|
|
48
|
+
- "新功能建议" # feature suggestion/request, not execution
|
|
49
|
+
- "implement a sort function" # algorithm, not full feature
|
|
50
|
+
- "how to implement auth" # educational question
|
|
51
|
+
triggers_negative_test_cases:
|
|
52
|
+
- input: "实现排序算法"
|
|
53
|
+
expect: "NOT triggered"
|
|
54
|
+
- input: "实现一下"
|
|
55
|
+
expect: "NOT triggered"
|
|
56
|
+
- input: "帮我实现这个函数"
|
|
57
|
+
expect: "NOT triggered"
|
|
58
|
+
- input: "怎么实现登录功能"
|
|
59
|
+
expect: "NOT triggered"
|
|
60
|
+
- input: "start spring boot"
|
|
61
|
+
expect: "NOT triggered"
|
|
62
|
+
- input: "开发环境配置"
|
|
63
|
+
expect: "NOT triggered"
|
|
64
|
+
- input: "一键部署"
|
|
65
|
+
expect: "NOT triggered"
|
|
66
|
+
- input: "新功能建议"
|
|
67
|
+
expect: "NOT triggered"
|
|
68
|
+
- input: "implement a sort function"
|
|
69
|
+
expect: "NOT triggered"
|
|
70
|
+
- input: "how to implement auth"
|
|
71
|
+
expect: "NOT triggered"
|
|
72
|
+
- input: "开发用户认证模块"
|
|
73
|
+
expect: "triggered"
|
|
74
|
+
- input: "/sprint-flow \"开发访谈机器人\""
|
|
75
|
+
expect: "triggered"
|
|
76
|
+
- input: "一键开发 REST API"
|
|
77
|
+
expect: "triggered"
|
|
40
78
|
workflow_steps:
|
|
41
79
|
- "Phase -1: ISOLATE"
|
|
42
80
|
- "Phase -0.5: AUTO-ESTIMATE"
|
|
@@ -108,6 +146,35 @@ workflow_steps:
|
|
|
108
146
|
|
|
109
147
|
---
|
|
110
148
|
|
|
149
|
+
## Unique Value Proposition
|
|
150
|
+
|
|
151
|
+
Sprint Flow is NOT just a sequential launcher of existing skills. Here's what makes it different from manually running each skill:
|
|
152
|
+
|
|
153
|
+
### Why Sprint Flow vs Manual Skill Execution
|
|
154
|
+
|
|
155
|
+
| Dimension | Manual Execution | Sprint Flow |
|
|
156
|
+
|-----------|-----------------|-------------|
|
|
157
|
+
| **Context Continuity** | Each skill starts fresh; lost design decisions between phases | Phase summaries + sprint-state.json maintain full traceability across 11 phases |
|
|
158
|
+
| **Gate Enforcement** | No enforcement — easy to skip Delphi, skip TDD, skip UAT | HARD-GATE: design must be APPROVED (≥90% Delphi consensus) before coding; UAT is mandatory (no bypass) |
|
|
159
|
+
| **Token Efficiency** | Linear context accumulation across phases — ~150K+ tokens | Ralph-loop default: 40-67% token savings via clean REQ-level contexts |
|
|
160
|
+
| **Emergent Requirements** | Discovered late, silently ignored or merged | Phase 7 USER ACCEPTANCE explicitly captures emergent issues via template; triggers Sprint 2 for critical issues |
|
|
161
|
+
| **Quality Ecosystem** | No integration with quality gates | Integrated with xp-gate's full quality ecosystem: Gate 5 (coverage), Gate M2 (mock density), Delphi code-walkthrough |
|
|
162
|
+
| **Progress Tracking** | Ad-hoc, memory-based | `.sprint-state/` persistence with phase history, timing, and metrics — `--status` renders progress dashboard |
|
|
163
|
+
|
|
164
|
+
### Key Differentiators
|
|
165
|
+
|
|
166
|
+
1. **40-67% Token Savings via Ralph Loop**: Phase 2 default (`ralph-loop`) processes one REQ at a time with clean context, avoiding the linear context accumulation that costs 150K+ tokens in parallel mode.
|
|
167
|
+
|
|
168
|
+
2. **HARD-GATE Discipline**: Design must pass Delphi review (≥90% consensus, ≥2 model providers, domestic models only) before Phase 2 BUILD can start. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
|
|
169
|
+
|
|
170
|
+
3. **Emergent Requirements Acknowledgment**: Based on research showing 78% of failures are invisible to AI (arXiv study), Phase 7 USER ACCEPTANCE is a mandatory manual verification step — cannot be automated, skipped, or bypassed.
|
|
171
|
+
|
|
172
|
+
4. **XP-Gate Quality Ecosystem Integration**: Sprint Flow is part of the broader xp-gate ecosystem. Phase 2 BUILD integrates with Gate 5 (test coverage ≥80%), Gate M2 (mock density ≤30%), and Gate MW (code-walkthrough validation). Phase 3 REVIEW runs Delphi code-walkthrough that generates `.code-walkthrough-result.json` for pre-push enforcement.
|
|
173
|
+
|
|
174
|
+
5. **Full Lifecycle Coverage**: From worktree isolation (Phase -1) to cleanup (Phase 8), sprint-flow covers the entire development lifecycle — not just the "write code" part. AUTO-ESTIMATE (Phase -0.5) prevents over-engineering by routing lightweight changes through simplified workflows.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
111
178
|
## 完整流程(默认无参数)
|
|
112
179
|
|
|
113
180
|
调用 `/sprint-flow "[需求描述]"` 后,自动执行以下流程:
|
|
@@ -162,7 +229,7 @@ Phase 8: CLEANUP → worktree remove + branch delete + sprint summary
|
|
|
162
229
|
|
|
163
230
|
**Phase Flow**:
|
|
164
231
|
```
|
|
165
|
-
ISOLATE → AUTO-ESTIMATE → THINK → PLAN → [GITHOOKS-GATE] → BUILD → REVIEW → SHIP → LAND → USER
|
|
232
|
+
ISOLATE → AUTO-ESTIMATE → THINK → PLAN → [GITHOOKS-GATE] → BUILD → REVIEW → FEEDBACK → SHIP → LAND → USER ACCEPTANCE → CLEANUP
|
|
166
233
|
```
|
|
167
234
|
|
|
168
235
|
**Hard Gates**:
|
|
@@ -202,7 +269,7 @@ ISOLATE → AUTO-ESTIMATE → THINK → PLAN → [GITHOOKS-GATE] → BUILD → R
|
|
|
202
269
|
6. 触发 `/sprint-flow` 后,**第一行输出应包含工作流阶段概览**:
|
|
203
270
|
|
|
204
271
|
```
|
|
205
|
-
Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE →
|
|
272
|
+
Sprint Flow: ISOLATE → AUTO-ESTIMATE → THINK → PLAN → BUILD → REVIEW → FEEDBACK → SHIP → LAND → USER ACCEPTANCE → CLEANUP
|
|
206
273
|
```
|
|
207
274
|
|
|
208
275
|
### Phase -1: ISOLATE(git worktree 隔离)
|
|
@@ -508,17 +575,22 @@ See [Output Contract](#output-contract) below for the canonical machine-readable
|
|
|
508
575
|
## References
|
|
509
576
|
|
|
510
577
|
详细指令文件位于 `@references/`:
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
578
|
+
|
|
579
|
+
> ⚠️ **Filename numbering note**: Reference filenames use legacy numbering that does NOT match the canonical phase numbers in this document. The table below provides the correct mapping.
|
|
580
|
+
|
|
581
|
+
| File | Canonical Phase | Phase Name |
|
|
582
|
+
|------|----------------|------------|
|
|
583
|
+
| `@references/phase-minus-1-isolate.md` | Phase -1 | ISOLATE |
|
|
584
|
+
| `@references/phase-minus-0-5-auto-estimate.md` | Phase -0.5 | AUTO-ESTIMATE |
|
|
585
|
+
| `@references/phase-0-think.md` | Phase 0 | THINK |
|
|
586
|
+
| `@references/phase-1-plan.md` | Phase 1 | PLAN |
|
|
587
|
+
| `@references/phase-2-build.md` | Phase 2 | BUILD |
|
|
588
|
+
| `@references/phase-3-review.md` | Phase 3 | REVIEW |
|
|
589
|
+
| `@references/phase-5-feedback.md` | Phase 4 | FEEDBACK (⚠️ filename says phase-5) |
|
|
590
|
+
| `@references/phase-6-ship.md` | Phase 5 | SHIP (⚠️ filename says phase-6) |
|
|
591
|
+
| `@references/phase-7-land.md` | Phase 6 | LAND (⚠️ filename says phase-7) |
|
|
592
|
+
| `@references/phase-4-uat.md` | Phase 7 | USER ACCEPTANCE (⚠️ filename says phase-4) |
|
|
593
|
+
| `@references/phase-8-cleanup.md` | Phase 8 | CLEANUP |
|
|
522
594
|
|
|
523
595
|
---
|
|
524
596
|
|
|
@@ -543,3 +615,34 @@ See [Output Contract](#output-contract) below for the canonical machine-readable
|
|
|
543
615
|
| 78% failures invisible | arXiv research | Phase 7 必要性证明 |
|
|
544
616
|
| Think → Plan → Build → Ship | gstack ETHOS | 整体流程设计 |
|
|
545
617
|
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
## Phase Flow Consistency
|
|
621
|
+
|
|
622
|
+
This section documents the canonical 11-phase order to ensure all future edits keep the phase sequence synchronized across all locations in this document and its reference files.
|
|
623
|
+
|
|
624
|
+
**Canonical Phase Order** (Phase -1, -0.5, 0..8):
|
|
625
|
+
|
|
626
|
+
| Phase # | Name | Phase # | Name |
|
|
627
|
+
|---------|------|---------|------|
|
|
628
|
+
| -1 | ISOLATE | 4 | FEEDBACK |
|
|
629
|
+
| -0.5 | AUTO-ESTIMATE | 5 | SHIP |
|
|
630
|
+
| 0 | THINK | 6 | LAND |
|
|
631
|
+
| 1 | PLAN | 7 | USER ACCEPTANCE |
|
|
632
|
+
| 2 | BUILD | 8 | CLEANUP |
|
|
633
|
+
| 3 | REVIEW | | |
|
|
634
|
+
|
|
635
|
+
**Locations that MUST keep this order synchronized**:
|
|
636
|
+
1. **Frontmatter `workflow_steps`** (lines ~40-51): Phase list
|
|
637
|
+
2. **Frontmatter `description` trigger text** (line ~16): Flow string
|
|
638
|
+
3. **Body "完整流程" section** (lines ~115-127): Phase descriptions in order
|
|
639
|
+
4. **Body "Phase Flow" diagram** (line ~164): ASCII flow diagram
|
|
640
|
+
5. **Body "强制输出格式规范" section** (line ~204): Output format
|
|
641
|
+
6. **Body "Workflow Steps" table** (lines ~149-162): Step/Phase table
|
|
642
|
+
7. **Body "References" section** (lines ~516-521): Reference file list
|
|
643
|
+
8. **`references/orchestration-rules.md` Phase Subagent Dispatch Matrix**: Phase/Name order
|
|
644
|
+
9. **`references/phase-4-uat.md`**: Phase 7 USER ACCEPTANCE (⚠️ file named phase-4, phase number is 7)
|
|
645
|
+
10. **`references/phase-5-feedback.md`**: Phase 4 FEEDBACK (⚠️ file named phase-5, phase number is 4)
|
|
646
|
+
|
|
647
|
+
**⚠️ Known naming discrepancy**: Reference files use legacy numbering (`phase-4-uat.md` for Phase 7, `phase-5-feedback.md` for Phase 4, `phase-6-ship.md` for Phase 5, `phase-7-land.md` for Phase 6). The canonical phase NUMBER is determined by the `Phase #` column above — reference file names are mapped via the References section, not by their filename digits.
|
|
648
|
+
|