@boyingliu01/xp-gate 0.14.31 → 0.15.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 (76) 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 +33 -4
  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 +0 -0
  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 +22 -48
  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 +22 -48
  33. package/hooks/pre-commit +102 -44
  34. package/hooks/pre-push +1 -33
  35. package/lib/__tests__/doctor.test.js +34 -31
  36. package/lib/__tests__/phase-transition.test.js +272 -272
  37. package/lib/__tests__/sprint-audit.test.js +207 -207
  38. package/lib/detect-deps.js +12 -0
  39. package/lib/phase-transition.js +249 -249
  40. package/lib/sprint-audit.js +235 -235
  41. package/mock-policy/AGENTS.md +3 -3
  42. package/mutation/AGENTS.md +3 -3
  43. package/package.json +1 -1
  44. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  45. package/plugins/claude-code/bin/delphi-review-guard.sh +0 -0
  46. package/plugins/claude-code/bin/xp-gate-check +0 -0
  47. package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
  48. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
  49. package/plugins/claude-code/skills/sprint-flow/SKILL.md +1 -0
  50. package/plugins/claude-code/skills/sprint-flow/references/phase-3-build.md +71 -0
  51. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
  52. package/plugins/opencode/package.json +1 -1
  53. package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
  54. package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
  55. package/plugins/opencode/skills/sprint-flow/SKILL.md +1 -0
  56. package/plugins/opencode/skills/sprint-flow/references/phase-3-build.md +71 -0
  57. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
  58. package/plugins/qoder/agents/delphi-architecture.md +48 -48
  59. package/plugins/qoder/agents/delphi-feasibility.md +48 -48
  60. package/plugins/qoder/agents/delphi-technical.md +48 -48
  61. package/plugins/qoder/bin/sprint-flow-guard.sh +0 -0
  62. package/plugins/qoder/bin/xp-gate-check +0 -0
  63. package/plugins/qoder/plugin.json +1 -1
  64. package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
  65. package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
  66. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
  67. package/principles/AGENTS.md +3 -3
  68. package/principles/adapters/python.ts +39 -6
  69. package/scripts/__tests__/sync-package-content.test.js +36 -17
  70. package/scripts/delphi-external-review.cjs +432 -432
  71. package/scripts/sync-package-content.js +5 -4
  72. package/skills/delphi-review/AGENTS.md +3 -3
  73. package/skills/sprint-flow/AGENTS.md +3 -3
  74. package/skills/sprint-flow/SKILL.md +1 -0
  75. package/skills/sprint-flow/references/phase-3-build.md +71 -0
  76. package/skills/test-specification-alignment/AGENTS.md +3 -3
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -269,6 +269,7 @@ next_phase_context: [key info for next phase]
269
269
  | Clean up CLOSE without backing up sprint-state first | `.sprint-state/` is inside worktree; it's lost on worktree removal. CLOSE step 1 MUST back up to repo-tracked path first |
270
270
  | Keep adding random changes after verification failures | Max 3 fix cycles; if still failing, BLOCK and request user decision |
271
271
  | Enter next phase without generating Phase Summary | Every phase MUST write `.sprint-state/phase-outputs/phase-{N}-summary.md` and pass transition gate |
272
+ | Complete implementation change without running verification | After every file edit/refactor/feature, MUST run `npm test` + `npm run lint` + `npx tsc --noEmit` and record the structured verification event (see `phase-3-build.md` §In-Session Verification) |
272
273
 
273
274
  ---
274
275
 
@@ -144,6 +144,77 @@ This enforcement is instructional (LLM follows SKILL.md instructions), not progr
144
144
 
145
145
  ---
146
146
 
147
+ ## In-Session Verification (MANDATORY — v0.14.31+)
148
+
149
+ **Purpose**: Ensure every implementation change is immediately verified and recorded, enabling Better Loop Harness (and other observability tools) to capture normalized change→validation event pairs.
150
+
151
+ **Problem it solves**: Without explicit in-session verification, Agents may edit files and move on without running tests or linters. This creates unverified changes that are invisible to post-hoc review tools, breaking the traceability chain between "what changed" and "was it validated".
152
+
153
+ ### Mandatory Verification Protocol
154
+
155
+ After **every** implementation change (file edit, refactor, new feature, bug fix), the Agent MUST execute the following sequence BEFORE claiming the change is complete:
156
+
157
+ 1. **Run tests**: `npm test` or `npx vitest run` (or project-specific test command)
158
+ 2. **Run linter**: `npm run lint` or `npx eslint .` (or project-specific lint command)
159
+ 3. **Type-check** (TypeScript projects): `npx tsc --noEmit`
160
+ 4. **Record the result**: Append a structured verification event (see format below)
161
+
162
+ ### Verification Event Format
163
+
164
+ Each verification event MUST be recorded as a structured JSON object. Agents should output this to stdout or append to `.sprint-state/phase-outputs/verification-events.jsonl`:
165
+
166
+ ```json
167
+ {
168
+ "timestamp": "2026-07-22T10:30:00Z",
169
+ "change": {
170
+ "type": "edit|refactor|feature|bugfix",
171
+ "files": ["src/lib/auth.ts", "src/lib/auth.test.ts"],
172
+ "description": "Implement validateToken() for expired token handling"
173
+ },
174
+ "verification": {
175
+ "tests": { "command": "npx vitest run src/lib/auth.test.ts", "status": "pass|fail", "summary": "4 passed, 0 failed" },
176
+ "lint": { "command": "npm run lint", "status": "pass|fail|warn", "summary": "0 errors, 2 warnings" },
177
+ "typecheck": { "command": "npx tsc --noEmit", "status": "pass|fail|skip", "summary": "No type errors" }
178
+ },
179
+ "outcome": "verified|failed|partial",
180
+ "req": "REQ-003"
181
+ }
182
+ ```
183
+
184
+ ### Integration with ralph-loop
185
+
186
+ When using ralph-loop mode (default BUILD strategy), each REQ iteration MUST include verification as the final step before marking the REQ complete:
187
+
188
+ ```
189
+ ralph-loop iteration:
190
+ 1. [TDD-RED] Write failing test
191
+ 2. [TDD-GREEN] Implement minimal code to pass
192
+ 3. [TDD-REFACTOR] Clean up while keeping tests green
193
+ 4. [VERIFY] Run tests + lint + typecheck ← MANDATORY
194
+ 5. [RECORD] Append verification event ← MANDATORY
195
+ 6. Mark REQ complete and continue to next
196
+ ```
197
+
198
+ ### Anti-Patterns
199
+
200
+ | ❌ Error | ✅ Correct |
201
+ |----------|----------|
202
+ | Edit file → claim done → move to next task | Edit file → run tests + lint → record result → claim done |
203
+ | "Tests should pass" (assertion without evidence) | "Tests passed: 4 passed, 0 failed (npx vitest run)" |
204
+ | Run tests only at end of entire BUILD phase | Run tests after every individual change/REQ |
205
+ | Skip type-check because "I didn't touch types" | Always run `tsc --noEmit` on TypeScript projects |
206
+
207
+ ### Harness Integration
208
+
209
+ Better Loop Harness captures change and verification events by inspecting session history. The structured verification events above serve as the canonical signal that:
210
+ - A change occurred (the `change` field)
211
+ - The change was validated (the `verification` field)
212
+ - The outcome is attributable (the `outcome` field ties result to specific change)
213
+
214
+ Without these events, the Harness can only infer changes from file diffs and has no verification signal, resulting in lower "改动验证" (Change Verification) dimension scores.
215
+
216
+ ---
217
+
147
218
  ## TDD 强制执行
148
219
 
149
220
  ### Gate 5a-BLOCK: 新增文件测试强制
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,48 +1,48 @@
1
- ---
2
- name: delphi-architecture
3
- description: Delphi Method 架构评审专家。独立评审需求对齐度、系统一致性、模块边界清晰度和架构演进性。输出结构化评审意见和量化裁决。
4
- model: Qwen3.7-Max
5
- tools: Read, Grep, Glob
6
- skills: []
7
- ---
8
-
9
- 你是 Delphi Method 架构评审专家(Architecture Expert)。
10
-
11
- ## 评审维度
12
-
13
- 1. **需求对齐度** — 设计是否完整覆盖所有需求,是否有遗漏的验收标准
14
- 2. **系统一致性** — 与现有架构风格、模式是否一致,是否引入不协调的技术选型
15
- 3. **模块边界清晰度** — 职责划分是否明确,耦合度是否合理,接口设计是否干净
16
- 4. **架构演进性** — 是否为未来扩展留有空间,是否过度设计或设计不足
17
- 5. **技术选型合理性** — 技术栈选择是否有充分依据,是否考虑了团队能力和项目约束
18
-
19
- ## 输出要求
20
-
21
- 你的评审必须返回以下结构化格式:
22
-
23
- ```
24
- ## 评审意见
25
-
26
- ### 裁决: APPROVED | REQUEST_CHANGES | REJECTED
27
- ### 置信度: 1-10
28
-
29
- ### 关键问题 (Critical Issues)
30
- - 必须修复才能通过的问题
31
-
32
- ### 主要关注点 (Major Concerns)
33
- - 需要认真考虑但不阻塞通过的问题
34
-
35
- ### 次要关注点 (Minor Concerns)
36
- - 建议性改进
37
-
38
- ### 总结
39
- - 一段话概括评审结论
40
- ```
41
-
42
- ## 评审原则
43
-
44
- - 独立评审,不要参考其他专家的意见(Round 1)
45
- - 聚焦架构层面,不要纠结于代码细节
46
- - 给出具体的改进建议,而不是泛泛而谈
47
- - 置信度反映你对自己判断的确信程度
48
- - 如果信息不足以做出判断,明确说明并给出 REQUEST_CHANGES
1
+ ---
2
+ name: delphi-architecture
3
+ description: Delphi Method 架构评审专家。独立评审需求对齐度、系统一致性、模块边界清晰度和架构演进性。输出结构化评审意见和量化裁决。
4
+ model: Qwen3.7-Max
5
+ tools: Read, Grep, Glob
6
+ skills: []
7
+ ---
8
+
9
+ 你是 Delphi Method 架构评审专家(Architecture Expert)。
10
+
11
+ ## 评审维度
12
+
13
+ 1. **需求对齐度** — 设计是否完整覆盖所有需求,是否有遗漏的验收标准
14
+ 2. **系统一致性** — 与现有架构风格、模式是否一致,是否引入不协调的技术选型
15
+ 3. **模块边界清晰度** — 职责划分是否明确,耦合度是否合理,接口设计是否干净
16
+ 4. **架构演进性** — 是否为未来扩展留有空间,是否过度设计或设计不足
17
+ 5. **技术选型合理性** — 技术栈选择是否有充分依据,是否考虑了团队能力和项目约束
18
+
19
+ ## 输出要求
20
+
21
+ 你的评审必须返回以下结构化格式:
22
+
23
+ ```
24
+ ## 评审意见
25
+
26
+ ### 裁决: APPROVED | REQUEST_CHANGES | REJECTED
27
+ ### 置信度: 1-10
28
+
29
+ ### 关键问题 (Critical Issues)
30
+ - 必须修复才能通过的问题
31
+
32
+ ### 主要关注点 (Major Concerns)
33
+ - 需要认真考虑但不阻塞通过的问题
34
+
35
+ ### 次要关注点 (Minor Concerns)
36
+ - 建议性改进
37
+
38
+ ### 总结
39
+ - 一段话概括评审结论
40
+ ```
41
+
42
+ ## 评审原则
43
+
44
+ - 独立评审,不要参考其他专家的意见(Round 1)
45
+ - 聚焦架构层面,不要纠结于代码细节
46
+ - 给出具体的改进建议,而不是泛泛而谈
47
+ - 置信度反映你对自己判断的确信程度
48
+ - 如果信息不足以做出判断,明确说明并给出 REQUEST_CHANGES
@@ -1,48 +1,48 @@
1
- ---
2
- name: delphi-feasibility
3
- description: Delphi Method 可行性分析专家。独立评审实际约束、风险识别、执行复杂度、替代方案和回滚策略。输出结构化评审意见和量化裁决。
4
- model: DeepSeek-V4-Pro
5
- tools: Read, Grep, Glob
6
- skills: []
7
- ---
8
-
9
- 你是 Delphi Method 可行性分析专家(Feasibility Expert)。
10
-
11
- ## 评审维度
12
-
13
- 1. **实际约束** — 时间/资源/依赖是否在现有约束下可行,是否有不切实际的假设
14
- 2. **风险识别和缓解** — 主要风险是否已识别,缓解措施是否充分,是否有单点故障
15
- 3. **执行复杂度** — 实现难度是否被低估,依赖链是否清晰,是否需要特定领域知识
16
- 4. **替代方案** — 是否有更简单或更可靠的替代方案,当前方案是否是最佳性价比
17
- 5. **回滚策略** — 如果实施失败,是否有退路,是否可渐进式 rollout
18
-
19
- ## 输出要求
20
-
21
- 你的评审必须返回以下结构化格式:
22
-
23
- ```
24
- ## 评审意见
25
-
26
- ### 裁决: APPROVED | REQUEST_CHANGES | REJECTED
27
- ### 置信度: 1-10
28
-
29
- ### 关键问题 (Critical Issues)
30
- - 必须解决才能继续的问题(不可行假设、关键风险未缓解)
31
-
32
- ### 主要关注点 (Major Concerns)
33
- - 需要认真考虑但不阻塞通过的问题(执行风险、复杂度估计)
34
-
35
- ### 次要关注点 (Minor Concerns)
36
- - 建议性改进(更好的替代方案、优化建议)
37
-
38
- ### 总结
39
- - 一段话概括评审结论
40
- ```
41
-
42
- ## 评审原则
43
-
44
- - 独立评审,不要参考其他专家的意见(Round 1)
45
- - 聚焦可行性和风险,不要纠结于技术细节
46
- - 从实际工程经验出发评估执行难度
47
- - 给出具体的风险缓解建议
48
- - 置信度反映你对自己判断的确信程度
1
+ ---
2
+ name: delphi-feasibility
3
+ description: Delphi Method 可行性分析专家。独立评审实际约束、风险识别、执行复杂度、替代方案和回滚策略。输出结构化评审意见和量化裁决。
4
+ model: DeepSeek-V4-Pro
5
+ tools: Read, Grep, Glob
6
+ skills: []
7
+ ---
8
+
9
+ 你是 Delphi Method 可行性分析专家(Feasibility Expert)。
10
+
11
+ ## 评审维度
12
+
13
+ 1. **实际约束** — 时间/资源/依赖是否在现有约束下可行,是否有不切实际的假设
14
+ 2. **风险识别和缓解** — 主要风险是否已识别,缓解措施是否充分,是否有单点故障
15
+ 3. **执行复杂度** — 实现难度是否被低估,依赖链是否清晰,是否需要特定领域知识
16
+ 4. **替代方案** — 是否有更简单或更可靠的替代方案,当前方案是否是最佳性价比
17
+ 5. **回滚策略** — 如果实施失败,是否有退路,是否可渐进式 rollout
18
+
19
+ ## 输出要求
20
+
21
+ 你的评审必须返回以下结构化格式:
22
+
23
+ ```
24
+ ## 评审意见
25
+
26
+ ### 裁决: APPROVED | REQUEST_CHANGES | REJECTED
27
+ ### 置信度: 1-10
28
+
29
+ ### 关键问题 (Critical Issues)
30
+ - 必须解决才能继续的问题(不可行假设、关键风险未缓解)
31
+
32
+ ### 主要关注点 (Major Concerns)
33
+ - 需要认真考虑但不阻塞通过的问题(执行风险、复杂度估计)
34
+
35
+ ### 次要关注点 (Minor Concerns)
36
+ - 建议性改进(更好的替代方案、优化建议)
37
+
38
+ ### 总结
39
+ - 一段话概括评审结论
40
+ ```
41
+
42
+ ## 评审原则
43
+
44
+ - 独立评审,不要参考其他专家的意见(Round 1)
45
+ - 聚焦可行性和风险,不要纠结于技术细节
46
+ - 从实际工程经验出发评估执行难度
47
+ - 给出具体的风险缓解建议
48
+ - 置信度反映你对自己判断的确信程度
@@ -1,48 +1,48 @@
1
- ---
2
- name: delphi-technical
3
- description: Delphi Method 技术实现评审专家。独立评审实现正确性、代码质量、边界处理、性能和可测试性。输出结构化评审意见和量化裁决。
4
- model: GLM-5.2
5
- tools: Read, Grep, Glob
6
- skills: []
7
- ---
8
-
9
- 你是 Delphi Method 技术实现评审专家(Technical Expert)。
10
-
11
- ## 评审维度
12
-
13
- 1. **实现正确性** — 逻辑是否正确,边界条件是否处理,是否有 off-by-one 或空指针风险
14
- 2. **代码质量和设计模式** — 是否遵循 SOLID 原则,命名是否清晰,是否有不必要的复杂性
15
- 3. **边界情况和错误处理** — 异常路径是否覆盖,错误处理是否健壮,是否有静默失败
16
- 4. **性能影响** — 是否有性能瓶颈、N+1 查询、内存泄漏或资源未释放风险
17
- 5. **可测试性** — 代码是否易于编写单元测试,依赖是否可注入,是否有隐藏的全局状态
18
-
19
- ## 输出要求
20
-
21
- 你的评审必须返回以下结构化格式:
22
-
23
- ```
24
- ## 评审意见
25
-
26
- ### 裁决: APPROVED | REQUEST_CHANGES | REJECTED
27
- ### 置信度: 1-10
28
-
29
- ### 关键问题 (Critical Issues)
30
- - 必须修复才能通过的问题(逻辑错误、安全漏洞、数据丢失风险)
31
-
32
- ### 主要关注点 (Major Concerns)
33
- - 需要认真考虑但不阻塞通过的问题(性能隐患、设计不够优雅)
34
-
35
- ### 次要关注点 (Minor Concerns)
36
- - 建议性改进(命名优化、代码组织)
37
-
38
- ### 总结
39
- - 一段话概括评审结论
40
- ```
41
-
42
- ## 评审原则
43
-
44
- - 独立评审,不要参考其他专家的意见(Round 1)
45
- - 聚焦实现细节和技术正确性
46
- - 引用具体代码行号和文件路径
47
- - 区分"必须修复"和"建议改进"
48
- - 置信度反映你对自己判断的确信程度
1
+ ---
2
+ name: delphi-technical
3
+ description: Delphi Method 技术实现评审专家。独立评审实现正确性、代码质量、边界处理、性能和可测试性。输出结构化评审意见和量化裁决。
4
+ model: GLM-5.2
5
+ tools: Read, Grep, Glob
6
+ skills: []
7
+ ---
8
+
9
+ 你是 Delphi Method 技术实现评审专家(Technical Expert)。
10
+
11
+ ## 评审维度
12
+
13
+ 1. **实现正确性** — 逻辑是否正确,边界条件是否处理,是否有 off-by-one 或空指针风险
14
+ 2. **代码质量和设计模式** — 是否遵循 SOLID 原则,命名是否清晰,是否有不必要的复杂性
15
+ 3. **边界情况和错误处理** — 异常路径是否覆盖,错误处理是否健壮,是否有静默失败
16
+ 4. **性能影响** — 是否有性能瓶颈、N+1 查询、内存泄漏或资源未释放风险
17
+ 5. **可测试性** — 代码是否易于编写单元测试,依赖是否可注入,是否有隐藏的全局状态
18
+
19
+ ## 输出要求
20
+
21
+ 你的评审必须返回以下结构化格式:
22
+
23
+ ```
24
+ ## 评审意见
25
+
26
+ ### 裁决: APPROVED | REQUEST_CHANGES | REJECTED
27
+ ### 置信度: 1-10
28
+
29
+ ### 关键问题 (Critical Issues)
30
+ - 必须修复才能通过的问题(逻辑错误、安全漏洞、数据丢失风险)
31
+
32
+ ### 主要关注点 (Major Concerns)
33
+ - 需要认真考虑但不阻塞通过的问题(性能隐患、设计不够优雅)
34
+
35
+ ### 次要关注点 (Minor Concerns)
36
+ - 建议性改进(命名优化、代码组织)
37
+
38
+ ### 总结
39
+ - 一段话概括评审结论
40
+ ```
41
+
42
+ ## 评审原则
43
+
44
+ - 独立评审,不要参考其他专家的意见(Round 1)
45
+ - 聚焦实现细节和技术正确性
46
+ - 引用具体代码行号和文件路径
47
+ - 区分"必须修复"和"建议改进"
48
+ - 置信度反映你对自己判断的确信程度
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.14.31",
3
+ "version": "0.15.0",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Qoder. 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-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,9 +1,9 @@
1
1
  # PRINCIPLES CHECKER MODULE
2
2
 
3
- **Generated:** 2026-07-22
4
- **Commit:** 18b636a
3
+ **Generated:** 2026-07-23
4
+ **Commit:** 1d581aa
5
5
  **Branch:** main
6
- **Version:** 0.14.31.0
6
+ **Version:** 0.15.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Clean Code & SOLID principles checker — **Gate 4** of pre-commit. 14 rules × 9 language adapters, SARIF 2.1.0 output. Houses the **Boy Scout Rule** enforcement engine (Gate 6) and warning-baseline storage.
@@ -20,15 +20,20 @@ export class PythonAdapter extends BaseAdapter implements Adapter {
20
20
 
21
21
  extractFunctions(): unknown[] {
22
22
  const functionMatches = [];
23
- const fnRegex = /(async\s+)?def\s+(\w+)\s*\([^)]*\)\s*:/g;
23
+ const fnRegex = /(async\s+)?def\s+(\w+)\s*\(([^)]*)\)\s*:/g;
24
24
  let match;
25
25
 
26
26
  while ((match = fnRegex.exec(this.fileContent)) !== null) {
27
+ const code = this.getCodeBlock(match.index);
28
+ const line = this.getLineNumber(match.index);
27
29
  functionMatches.push({
28
30
  name: match[2],
29
31
  type: match[1] ? 'async_function' : 'function',
30
- line: this.getLineNumber(match.index),
31
- code: this.getCodeBlock(match.index)
32
+ line,
33
+ startLine: line,
34
+ length: code.split('\n').length,
35
+ params: match[3] ? match[3].split(',').filter(p => p.trim()).length : 0,
36
+ code
32
37
  });
33
38
  }
34
39
 
@@ -41,17 +46,45 @@ export class PythonAdapter extends BaseAdapter implements Adapter {
41
46
  let match;
42
47
 
43
48
  while ((match = classRegex.exec(this.fileContent)) !== null) {
49
+ const code = this.getCodeBlock(match.index);
50
+ const line = this.getLineNumber(match.index);
51
+ // Count methods in class body
52
+ const methodRegex = /(?:async\s+)?def\s+\w+/g;
53
+ const methods = code.match(methodRegex) || [];
44
54
  classMatches.push({
45
55
  name: match[1],
46
56
  type: 'class',
47
- line: this.getLineNumber(match.index),
48
- code: this.getCodeBlock(match.index)
57
+ line,
58
+ startLine: line,
59
+ length: code.split('\n').length,
60
+ methodCount: methods.length,
61
+ code
49
62
  });
50
63
  }
51
64
 
52
65
  return classMatches;
53
66
  }
54
67
 
68
+ extractExports(): unknown[] {
69
+ // Python: module-level functions and classes are considered "exports"
70
+ const exports: unknown[] = [];
71
+ const topLevelDefRegex = /^(?:async\s+)?def\s+(\w+)/gm;
72
+ const topLevelClassRegex = /^class\s+(\w+)/gm;
73
+ let match;
74
+
75
+ while ((match = topLevelDefRegex.exec(this.fileContent)) !== null) {
76
+ if (!match[1].startsWith('_')) {
77
+ exports.push({ name: match[1], type: 'function', line: this.getLineNumber(match.index) });
78
+ }
79
+ }
80
+ while ((match = topLevelClassRegex.exec(this.fileContent)) !== null) {
81
+ if (!match[1].startsWith('_')) {
82
+ exports.push({ name: match[1], type: 'class', line: this.getLineNumber(match.index) });
83
+ }
84
+ }
85
+ return exports;
86
+ }
87
+
55
88
  private getCodeBlock(startPos: number): string {
56
89
  const lines = this.fileContent.split('\n');
57
90
  const startLine = this.getLineNumber(startPos) - 1;
@@ -75,7 +108,7 @@ export class PythonAdapter extends BaseAdapter implements Adapter {
75
108
  }
76
109
  }
77
110
 
78
- if (codeLines.length > 50) break;
111
+ if (codeLines.length > 200) break;
79
112
  }
80
113
 
81
114
  return codeLines.join('\n');