@boyingliu01/xp-gate 0.7.0 → 0.8.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 (197) hide show
  1. package/bin/xp-gate.js +4 -9
  2. package/lib/__tests__/audit-log.test.ts +107 -0
  3. package/lib/__tests__/detect-deps.test.js +212 -42
  4. package/lib/__tests__/doctor.test.js +1 -0
  5. package/lib/__tests__/gate-audit.test.ts +59 -0
  6. package/lib/__tests__/init.test.js +47 -1
  7. package/lib/__tests__/install-skill.test.js +1 -45
  8. package/lib/__tests__/ui-detector.test.ts +186 -26
  9. package/lib/__tests__/ui-review.test.ts +119 -0
  10. package/lib/__tests__/uninstall.test.js +1 -0
  11. package/lib/detect-deps.js +180 -37
  12. package/lib/doctor.js +7 -9
  13. package/lib/gate-audit.ts +26 -42
  14. package/lib/init.js +42 -13
  15. package/lib/install-skill.js +20 -48
  16. package/lib/rollback.js +1 -16
  17. package/lib/shared-paths.js +30 -0
  18. package/lib/shared-utils.js +25 -0
  19. package/lib/ui-detector.ts +20 -14
  20. package/lib/ui-review.ts +58 -53
  21. package/lib/uninstall.js +8 -9
  22. package/package.json +1 -1
  23. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  24. package/plugins/claude-code/skills/admin-template-guidelines/SKILL.md +904 -0
  25. package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +45 -0
  26. package/plugins/claude-code/skills/delphi-review/AGENTS.md +66 -0
  27. package/plugins/claude-code/skills/delphi-review/INSTALL.md +152 -0
  28. package/plugins/claude-code/skills/delphi-review/SKILL.md +454 -0
  29. package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +56 -0
  30. package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +486 -0
  31. package/plugins/claude-code/skills/improve-codebase-architecture/SKILL.md +156 -0
  32. package/plugins/claude-code/skills/ralph-loop/SKILL.md +501 -0
  33. package/plugins/claude-code/skills/ralph-loop/references/components/memory.md +55 -0
  34. package/plugins/claude-code/skills/ralph-loop/references/components/middleware.md +54 -0
  35. package/plugins/claude-code/skills/ralph-loop/references/components/skill-invocations.md +39 -0
  36. package/plugins/claude-code/skills/ralph-loop/references/components/system-prompt.md +24 -0
  37. package/plugins/claude-code/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
  38. package/plugins/claude-code/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
  39. package/plugins/claude-code/skills/ralph-loop/templates/progress-log.md +36 -0
  40. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +68 -0
  41. package/plugins/claude-code/skills/sprint-flow/SKILL.md +1248 -0
  42. package/plugins/claude-code/skills/sprint-flow/references/components/memory.md +87 -0
  43. package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +72 -0
  44. package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +104 -0
  45. package/plugins/claude-code/skills/sprint-flow/references/components/system-prompt.md +27 -0
  46. package/plugins/claude-code/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
  47. package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +203 -0
  48. package/plugins/claude-code/skills/sprint-flow/references/phase-0-think.md +115 -0
  49. package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +178 -0
  50. package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +198 -0
  51. package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +213 -0
  52. package/plugins/claude-code/skills/sprint-flow/references/phase-4-uat.md +125 -0
  53. package/plugins/claude-code/skills/sprint-flow/references/phase-5-feedback.md +100 -0
  54. package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +193 -0
  55. package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +140 -0
  56. package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
  57. package/plugins/claude-code/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
  58. package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
  59. package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
  60. package/plugins/claude-code/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
  61. package/plugins/claude-code/skills/sprint-flow/templates/pain-document-template.md +115 -0
  62. package/plugins/claude-code/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
  63. package/plugins/claude-code/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
  64. package/plugins/claude-code/skills/test-driven-development/SKILL.md +71 -0
  65. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +56 -0
  66. package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +702 -0
  67. package/plugins/claude-code/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
  68. package/plugins/claude-code/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
  69. package/plugins/claude-code/skills/test-specification-alignment/references/specification-format.md +348 -0
  70. package/plugins/claude-code/skills/to-issues/SKILL.md +277 -0
  71. package/plugins/opencode/README.md +38 -0
  72. package/plugins/opencode/index.ts +85 -0
  73. package/plugins/opencode/package.json +18 -0
  74. package/plugins/opencode/skills/admin-template-guidelines/SKILL.md +904 -0
  75. package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +45 -0
  76. package/plugins/opencode/skills/delphi-review/AGENTS.md +66 -0
  77. package/plugins/opencode/skills/delphi-review/INSTALL.md +152 -0
  78. package/plugins/opencode/skills/delphi-review/SKILL.md +454 -0
  79. package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +56 -0
  80. package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +486 -0
  81. package/plugins/opencode/skills/improve-codebase-architecture/SKILL.md +156 -0
  82. package/plugins/opencode/skills/ralph-loop/SKILL.md +501 -0
  83. package/plugins/opencode/skills/ralph-loop/references/components/memory.md +55 -0
  84. package/plugins/opencode/skills/ralph-loop/references/components/middleware.md +54 -0
  85. package/plugins/opencode/skills/ralph-loop/references/components/skill-invocations.md +39 -0
  86. package/plugins/opencode/skills/ralph-loop/references/components/system-prompt.md +24 -0
  87. package/plugins/opencode/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
  88. package/plugins/opencode/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
  89. package/plugins/opencode/skills/ralph-loop/templates/progress-log.md +36 -0
  90. package/plugins/opencode/skills/sprint-flow/AGENTS.md +68 -0
  91. package/plugins/opencode/skills/sprint-flow/SKILL.md +1248 -0
  92. package/plugins/opencode/skills/sprint-flow/references/components/memory.md +87 -0
  93. package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +72 -0
  94. package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +104 -0
  95. package/plugins/opencode/skills/sprint-flow/references/components/system-prompt.md +27 -0
  96. package/plugins/opencode/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
  97. package/plugins/opencode/skills/sprint-flow/references/force-levels.md +203 -0
  98. package/plugins/opencode/skills/sprint-flow/references/phase-0-think.md +115 -0
  99. package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +178 -0
  100. package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +198 -0
  101. package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +213 -0
  102. package/plugins/opencode/skills/sprint-flow/references/phase-4-uat.md +125 -0
  103. package/plugins/opencode/skills/sprint-flow/references/phase-5-feedback.md +100 -0
  104. package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +193 -0
  105. package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +140 -0
  106. package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
  107. package/plugins/opencode/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
  108. package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
  109. package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
  110. package/plugins/opencode/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
  111. package/plugins/opencode/skills/sprint-flow/templates/pain-document-template.md +115 -0
  112. package/plugins/opencode/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
  113. package/plugins/opencode/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
  114. package/plugins/opencode/skills/test-driven-development/SKILL.md +71 -0
  115. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +56 -0
  116. package/plugins/opencode/skills/test-specification-alignment/SKILL.md +702 -0
  117. package/plugins/opencode/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
  118. package/plugins/opencode/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
  119. package/plugins/opencode/skills/test-specification-alignment/references/specification-format.md +348 -0
  120. package/plugins/opencode/skills/to-issues/SKILL.md +277 -0
  121. package/plugins/opencode/tsconfig.json +15 -0
  122. package/plugins/qoder/skills/admin-template-guidelines/SKILL.md +904 -0
  123. package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +45 -0
  124. package/plugins/qoder/skills/delphi-review/AGENTS.md +66 -0
  125. package/plugins/qoder/skills/delphi-review/INSTALL.md +152 -0
  126. package/plugins/qoder/skills/delphi-review/SKILL.md +454 -0
  127. package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +56 -0
  128. package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +486 -0
  129. package/plugins/qoder/skills/improve-codebase-architecture/SKILL.md +156 -0
  130. package/plugins/qoder/skills/ralph-loop/SKILL.md +501 -0
  131. package/plugins/qoder/skills/ralph-loop/references/components/memory.md +55 -0
  132. package/plugins/qoder/skills/ralph-loop/references/components/middleware.md +54 -0
  133. package/plugins/qoder/skills/ralph-loop/references/components/skill-invocations.md +39 -0
  134. package/plugins/qoder/skills/ralph-loop/references/components/system-prompt.md +24 -0
  135. package/plugins/qoder/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
  136. package/plugins/qoder/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
  137. package/plugins/qoder/skills/ralph-loop/templates/progress-log.md +36 -0
  138. package/plugins/qoder/skills/sprint-flow/AGENTS.md +68 -0
  139. package/plugins/qoder/skills/sprint-flow/SKILL.md +1248 -0
  140. package/plugins/qoder/skills/sprint-flow/references/components/memory.md +87 -0
  141. package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +72 -0
  142. package/plugins/qoder/skills/sprint-flow/references/components/skill-invocations.md +104 -0
  143. package/plugins/qoder/skills/sprint-flow/references/components/system-prompt.md +27 -0
  144. package/plugins/qoder/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
  145. package/plugins/qoder/skills/sprint-flow/references/force-levels.md +203 -0
  146. package/plugins/qoder/skills/sprint-flow/references/phase-0-think.md +115 -0
  147. package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +178 -0
  148. package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +198 -0
  149. package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +213 -0
  150. package/plugins/qoder/skills/sprint-flow/references/phase-4-uat.md +125 -0
  151. package/plugins/qoder/skills/sprint-flow/references/phase-5-feedback.md +100 -0
  152. package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +193 -0
  153. package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +140 -0
  154. package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
  155. package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
  156. package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
  157. package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
  158. package/plugins/qoder/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
  159. package/plugins/qoder/skills/sprint-flow/templates/pain-document-template.md +115 -0
  160. package/plugins/qoder/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
  161. package/plugins/qoder/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
  162. package/plugins/qoder/skills/test-driven-development/SKILL.md +71 -0
  163. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +56 -0
  164. package/plugins/qoder/skills/test-specification-alignment/SKILL.md +702 -0
  165. package/plugins/qoder/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
  166. package/plugins/qoder/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
  167. package/plugins/qoder/skills/test-specification-alignment/references/specification-format.md +348 -0
  168. package/plugins/qoder/skills/to-issues/SKILL.md +277 -0
  169. package/skills/admin-template-guidelines/SKILL.md +904 -0
  170. package/skills/delphi-review/SKILL.md +112 -77
  171. package/skills/improve-codebase-architecture/SKILL.md +156 -0
  172. package/skills/ralph-loop/SKILL.md +165 -34
  173. package/skills/sprint-flow/SKILL.md +448 -107
  174. package/skills/sprint-flow/references/components/skill-invocations.md +1 -1
  175. package/skills/sprint-flow/references/components/tool-descriptions.md +1 -1
  176. package/skills/sprint-flow/references/force-levels.md +203 -0
  177. package/skills/sprint-flow/references/phase-1-plan.md +4 -4
  178. package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +20 -1
  179. package/skills/sprint-flow/templates/auto-estimate-output-template.md +7 -5
  180. package/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
  181. package/skills/test-driven-development/SKILL.md +71 -0
  182. package/skills/test-specification-alignment/SKILL.md +98 -24
  183. package/skills/to-issues/SKILL.md +277 -0
  184. package/plugins/qoder/AGENTS.md +0 -93
  185. package/plugins/qoder/README.md +0 -87
  186. package/plugins/qoder/widgets/quality-report.html +0 -163
  187. package/plugins/qoder/widgets/sprint-dashboard.html +0 -172
  188. package/skills/delphi-review/evals/evals.json +0 -82
  189. package/skills/delphi-review/references/qoder-multi-model.md +0 -191
  190. package/skills/ralph-loop/evals/evals.json +0 -311
  191. package/skills/ralph-loop/evolution-history.json +0 -59
  192. package/skills/ralph-loop/evolution-log.md +0 -16
  193. package/skills/sprint-flow/evals/evals.json +0 -130
  194. package/skills/sprint-flow/evolution-history.json +0 -39
  195. package/skills/sprint-flow/evolution-log.md +0 -23
  196. package/skills/sprint-flow/references/qoder-adaptation.md +0 -173
  197. package/skills/test-specification-alignment/evals/evals.json +0 -75
@@ -1,311 +0,0 @@
1
- [
2
- {
3
- "id": "ralph-001",
4
- "name": "specification.yaml 作为输入源验证",
5
- "description": "验证 ralph-loop 使用 specification.yaml 中的 REQ 作为迭代单元,而非 stories.json",
6
- "input": {
7
- "specification": {
8
- "requirements": [
9
- { "id": "REQ-001", "description": "创建 User Model", "acceptance_criteria": [{ "id": "AC-001-01", "criteria": "email unique" }], "status": "pending" },
10
- { "id": "REQ-002", "description": "实现密码加密", "depends_on": ["REQ-001"], "status": "pending" }
11
- ]
12
- }
13
- },
14
- "expected": {
15
- "input_source": "specification.yaml",
16
- "iteration_units": ["REQ-001", "REQ-002"],
17
- "no_stories_json": true
18
- }
19
- },
20
- {
21
- "id": "ralph-002",
22
- "name": "拓扑排序 + 依赖顺序",
23
- "description": "验证 REQ 按 depends_on 拓扑排序,同层按 priority 升序",
24
- "input": {
25
- "requirements": [
26
- { "id": "REQ-003", "depends_on": ["REQ-002"], "priority": 3 },
27
- { "id": "REQ-001", "depends_on": [], "priority": 1 },
28
- { "id": "REQ-002", "depends_on": ["REQ-001"], "priority": 2 }
29
- ]
30
- },
31
- "expected": {
32
- "sorted_order": ["REQ-001", "REQ-002", "REQ-003"],
33
- "algorithm": "Kahn's topological sort"
34
- }
35
- },
36
- {
37
- "id": "ralph-003",
38
- "name": "循环依赖检测",
39
- "description": "REQ 存在循环依赖时 → BLOCK + 报告循环链",
40
- "input": {
41
- "requirements": [
42
- { "id": "REQ-001", "depends_on": ["REQ-002"] },
43
- { "id": "REQ-002", "depends_on": ["REQ-003"] },
44
- { "id": "REQ-003", "depends_on": ["REQ-001"] }
45
- ]
46
- },
47
- "expected": {
48
- "status": "blocked",
49
- "cycle_detected": true,
50
- "cycle_chain": "REQ-001 → REQ-002 → REQ-003 → REQ-001"
51
- }
52
- },
53
- {
54
- "id": "ralph-004",
55
- "name": "Learnings 双层分类 — permanent 自动升级",
56
- "description": "被 ≥2 个 REQ 引用的 learnings 自动升级为 permanent",
57
- "input": {
58
- "learnings": [
59
- { "id": 1, "text": "migration files in src/migrations/", "ref_count": 1, "scope": "contextual" },
60
- { "id": 2, "text": "Auth middleware before validation", "ref_count": 3, "scope": "interface" }
61
- ]
62
- },
63
- "expected": {
64
- "permanent": [
65
- { "id": 2, "reason": "ref_count >= 2 AND scope == interface" }
66
- ],
67
- "contextual": [
68
- { "id": 1, "reason": "ref_count < 2 AND scope != interface" }
69
- ]
70
- }
71
- },
72
- {
73
- "id": "ralph-005",
74
- "name": "Subagent 上下文隔离 — 不传递历史对话",
75
- "description": "每个 subagent context 仅包含:当前 REQ + AC + permanent/contextual/retry-failures + AGENTS.md + git log -5",
76
- "input": {
77
- "current_req": "REQ-003",
78
- "learnings": { "permanent": ["rule1"], "contextual": ["tip1", "tip2"] },
79
- "agents_md": "project conventions",
80
- "git_log": "commit1, commit2"
81
- },
82
- "expected": {
83
- "context_sources": ["current_req", "acceptance_criteria", "permanent_learnings", "contextual_learnings", "agents_md", "git_log"],
84
- "no_historical_dialogue": true,
85
- "context_is_bounded": true
86
- }
87
- },
88
- {
89
- "id": "ralph-006",
90
- "name": "三层验证 Gate — 失败不提交",
91
- "description": "验证失败 → 不 commit → retry(L1: typecheck+lint, L2: all tests, L3: coverage)",
92
- "input": {
93
- "verification": { "l1": "fail", "l2": "skipped", "l3": "skipped" },
94
- "retry_count": 0,
95
- "max_retries": 3
96
- },
97
- "expected": {
98
- "committed": false,
99
- "retry": true,
100
- "new_retry_count": 1,
101
- "run_all_tests_on_next_try": true
102
- }
103
- },
104
- {
105
- "id": "ralph-007",
106
- "name": "全量回归测试 — 不只跑 @test REQ-XXX",
107
- "description": "REQ-003 完成后,L2 验证跑 ALL tests(包括 @test REQ-001, @test REQ-002),不只跑 @test REQ-003",
108
- "input": {
109
- "current_req": "REQ-003",
110
- "available_tests": ["test_REQ-001", "test_REQ-002", "test_REQ-003"],
111
- "test_scope": "all"
112
- },
113
- "expected": {
114
- "tests_run": ["test_REQ-001", "test_REQ-002", "test_REQ-003"],
115
- "scope": "full_regression",
116
- "not_just_current_req": true
117
- }
118
- },
119
- {
120
- "id": "ralph-008",
121
- "name": "Retry 失败上下文注入",
122
- "description": "retry 时注入上次失败的错误摘要,不是重复相同上下文",
123
- "input": {
124
- "retry_count": 1,
125
- "last_failure": { "linter": ["unused-var at line 42"], "tests": ["test_login fails: 401 != 200"] }
126
- },
127
- "expected": {
128
- "context_extended": true,
129
- "failure_summary": "Linter: unused-var at line 42. Tests: test_login fails",
130
- "instruction": "请使用不同的实现方式"
131
- }
132
- },
133
- {
134
- "id": "ralph-009",
135
- "name": "BLOCK 状态 — 依赖级联",
136
- "description": "上游 REQ-001 blocked → REQ-002, REQ-003 自动 blocked(含依赖链)",
137
- "input": {
138
- "requirements": [
139
- { "id": "REQ-001", "status": "blocked", "reason": "max_retry_exceeded" },
140
- { "id": "REQ-002", "depends_on": ["REQ-001"], "status": "pending" },
141
- { "id": "REQ-003", "depends_on": ["REQ-002"], "status": "pending" }
142
- ]
143
- },
144
- "expected": {
145
- "REQ-001_status": "blocked",
146
- "REQ-002_status": "blocked(auto)",
147
- "REQ-003_status": "blocked(auto)",
148
- "dependency_chain": "REQ-001(blocked) → REQ-002 → REQ-003"
149
- }
150
- },
151
- {
152
- "id": "ralph-010",
153
- "name": "PARTIAL 状态行为",
154
- "description": "部分完成时:已 done commits 保留,Phase 3 仅检查 done REQs",
155
- "input": {
156
- "reqs_done": 4,
157
- "reqs_total": 6,
158
- "reqs_blocked": 1,
159
- "reqs_skipped": 1,
160
- "status": "partial"
161
- },
162
- "expected": {
163
- "commits_retained": true,
164
- "phase3_scope": "done_reqs_only",
165
- "spec_alignment_scope": "partial",
166
- "report": "4/6 REQ 完成,1 blocked,1 skipped"
167
- }
168
- },
169
- {
170
- "id": "ralph-011",
171
- "name": "AGENTS.md 由 orchestrator 统一更新",
172
- "description": "subagent 不直接写 AGENTS.md,输出 agentmd_addition 字段给 orchestrator",
173
- "input": {
174
- "subagent_output": { "agentmd_addition": "## ralph-loop: REQ-003 (api endpoint)\n- Patterns: REST CRUD" },
175
- "orchestrator_action": "read_agents_md → append → commit"
176
- },
177
- "expected": {
178
- "agens_md_updated_by": "orchestrator",
179
- "no_subagent_direct_write": true,
180
- "no_race_condition": true
181
- }
182
- },
183
- {
184
- "id": "ralph-012",
185
- "name": "状态输出格式 — v3.0",
186
- "description": "输出 JSON 必须符合 v3.0 state format",
187
- "input": {
188
- "output": {
189
- "skill_name": "ralph-loop",
190
- "version": "2.0.0",
191
- "specification_source": "specification.yaml",
192
- "requirements": { "total": 6, "done": 2, "pending": 3, "blocked": 1, "skipped": 0 },
193
- "learnings": { "permanent": ["..."], "contextual": ["..."] },
194
- "topology_order": ["REQ-001", "REQ-002", "REQ-003"]
195
- }
196
- },
197
- "expected": {
198
- "valid": true,
199
- "assertions": [
200
- "done + pending + blocked + skipped == total",
201
- "learnings has permanent and contextual arrays",
202
- "topology_order exists and is non-empty"
203
- ]
204
- }
205
- },
206
- {
207
- "id": "ralph-013",
208
- "name": "崩溃恢复 — checkpoint 机制",
209
- "description": "主进程崩溃后,从 checkpoint 恢复,跳过已 done REQs",
210
- "input": {
211
- "checkpoint": {
212
- "iteration": 3,
213
- "done_reqs": ["REQ-001", "REQ-002"],
214
- "last_commit": "ralph-loop: REQ-002"
215
- },
216
- "recover_from": "crash"
217
- },
218
- "expected": {
219
- "next_req": "REQ-003",
220
- "skip_reqs": ["REQ-001", "REQ-002"],
221
- "commits_retained": true,
222
- "no_redo_committed": true
223
- }
224
- },
225
- {
226
- "id": "ralph-014",
227
- "name": "REQ 粒度过大检测",
228
- "description": "REQ 超时 2 次后 BLOCK + 提示用户拆分",
229
- "input": {
230
- "req": "REQ-004",
231
- "timeout_count": 2,
232
- "max_timeout": 300
233
- },
234
- "expected": {
235
- "status": "blocked",
236
- "message": "REQ-004 过大,建议拆分为多个子 REQ",
237
- "user_options": ["split", "skip", "continue"]
238
- }
239
- },
240
- {
241
- "id": "ralph-015",
242
- "name": "Subagent dispatch — OpenCode task()",
243
- "description": "验证 dispatch 使用 task() 工具,带正确 input contract",
244
- "input": {
245
- "req": "REQ-001",
246
- "dispatch_method": "task(category=unspecified-high, load_skills=[test-driven-development], timeout=300)",
247
- "context": {
248
- "requirement": "REQ-001: 创建 User Model",
249
- "permanent_learnings": ["auth middleware before validation"],
250
- "contextual_learnings": ["migration files in src/migrations/"],
251
- "agents_md": "project conventions",
252
- "git_log": "commit1, commit2, commit3"
253
- }
254
- },
255
- "expected": {
256
- "dispatched": true,
257
- "timeout_configured": true,
258
- "skills_loaded": ["test-driven-development"],
259
- "context_bounded": true
260
- }
261
- },
262
- {
263
- "id": "ralph-016",
264
- "name": "首次 REQ,无 test-utils.ts — dispatch test-infra 子任务",
265
- "description": "验证首个 REQ 执行时,若 test-utils.ts 不存在,先 dispatch 测试基础设施 subagent,不直接 dispatch 业务代码",
266
- "input": {
267
- "req": "REQ-001",
268
- "test_utils_exists": false,
269
- "infra_check_result": "missing"
270
- },
271
- "expected": {
272
- "test_infra_dispatched": true,
273
- "business_code_dispatched": false,
274
- "infra_action": "generate_new",
275
- "infra_max_retries": 2
276
- }
277
- },
278
- {
279
- "id": "ralph-017",
280
- "name": "后续 REQ,test-utils.ts 已存在且接口完整 — 跳过 test-infra",
281
- "description": "验证后续 REQ 执行时,若 test-utils.ts 已存在且导出 createTestApp() 和 withTestDb(),直接 dispatch 业务代码",
282
- "input": {
283
- "req": "REQ-003",
284
- "test_utils_exists": true,
285
- "exports": ["createTestApp", "withTestDb"],
286
- "infra_check_result": "complete"
287
- },
288
- "expected": {
289
- "test_infra_dispatched": false,
290
- "business_code_dispatched": true,
291
- "infra_summary_injected": true
292
- }
293
- },
294
- {
295
- "id": "ralph-018",
296
- "name": "test-utils.ts 存在但接口不完整 — dispatch test-infra 增量补充",
297
- "description": "验证 test-utils.ts 存在但缺少必需接口(如只有 createTestApp 缺少 withTestDb)时,dispatch test-infra 增量补充",
298
- "input": {
299
- "req": "REQ-002",
300
- "test_utils_exists": true,
301
- "exports": ["createTestApp"],
302
- "missing_exports": ["withTestDb"],
303
- "infra_check_result": "partial"
304
- },
305
- "expected": {
306
- "test_infra_dispatched": true,
307
- "business_code_dispatched": false,
308
- "infra_action": "incremental_add_missing_exports"
309
- }
310
- }
311
- ]
@@ -1,59 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "Ralph Loop Evolution History",
4
- "description": "Machine-readable change manifest for AHE-inspired skill evolution.",
5
- "iterations": [
6
- {
7
- "id": 1,
8
- "date": "2026-05-22",
9
- "trigger": "new-feature",
10
- "issue": "#62 (sync with sprint-flow)",
11
- "root_cause": "ralph-loop is sprint-flow Phase 2 default build mode. Component structure must be consistent with parent skill's observability infrastructure.",
12
- "component_changes": ["middleware", "tools", "memory"],
13
- "files_changed": [
14
- "skills/ralph-loop/references/components/system-prompt.md",
15
- "skills/ralph-loop/references/components/tool-descriptions.md",
16
- "skills/ralph-loop/references/components/middleware.md",
17
- "skills/ralph-loop/references/components/skill-invocations.md",
18
- "skills/ralph-loop/references/components/memory.md",
19
- "skills/ralph-loop/evolution-log.md",
20
- "skills/ralph-loop/evolution-history.json"
21
- ],
22
- "prediction": {
23
- "metric": "skill-consistency",
24
- "direction": "up",
25
- "delta_pct": 100,
26
- "risk": "No measurable impact; metrics depend on P1 debugger implementation"
27
- },
28
- "actual_outcome": null,
29
- "delphi_review": "Sync modification per Delphi Round 2 minority concern resolution"
30
- },
31
- {
32
- "id": 2,
33
- "date": "2026-05-25",
34
- "trigger": "bug-fix-and-feature-enhancement",
35
- "issue": "#66 (test-infra-first + dispatch category fix)",
36
- "root_cause": "category='build' was invalid, causing silent skill load failures. Test infrastructure was not checked before TDD dispatch, leading to subagents reinventing test helpers.",
37
- "component_changes": ["middleware", "tools", "memory", "skill-invocations", "evals"],
38
- "files_changed": [
39
- "skills/ralph-loop/SKILL.md",
40
- "skills/ralph-loop/references/components/tool-descriptions.md",
41
- "skills/ralph-loop/references/components/middleware.md",
42
- "skills/ralph-loop/references/components/skill-invocations.md",
43
- "skills/ralph-loop/references/components/memory.md",
44
- "skills/ralph-loop/evals/evals.json",
45
- "skills/ralph-loop/templates/progress-log.md",
46
- "skills/ralph-loop/evolution-log.md",
47
- "skills/ralph-loop/evolution-history.json"
48
- ],
49
- "prediction": {
50
- "metric": "tdd-enforcement-rate",
51
- "direction": "up",
52
- "delta_pct": 40,
53
- "risk": "test-infra dispatch may fail if no subagent available; mitigated by fallback inline generation"
54
- },
55
- "actual_outcome": null,
56
- "delphi_review": "code-walkthrough Round 1 REQUEST_CHANGES → fixed state machine inconsistency + reference cleanup"
57
- }
58
- ]
59
- }
@@ -1,16 +0,0 @@
1
- # Evolution Log — ralph-loop
2
-
3
- > AHE 启发的可观测性变更日志。
4
-
5
- ## Entry 001 — 2026-05-22 — AHE Observability Infrastructure (P0 Sync)
6
-
7
- - **Trigger**: new-feature — 与 sprint-flow #62 同步创建 components/ 分解结构
8
- - **Evidence**: Delphi Round 2 Expert C 少数派意见明确要求 ralph-loop 同步修改
9
- - **Root Cause**: ralph-loop 是 sprint-flow Phase 2 默认构建模式,组件结构不一致会导致引用断裂
10
- - **Change Made**:
11
- 1. 创建 `references/components/` 目录,包含 5 个 AHE 对齐组件
12
- 2. 创建 `evolution-log.md`
13
- 3. 创建 `evolution-history.json`
14
- - **Self-Predicted Impact**: 保证 sprint-flow 与 ralph-loop 对 observability 组件的引用一致性
15
- - **Actual Outcome**: ⏳ pending
16
- - **Component Changed**: [middleware, tools, memory]
@@ -1,130 +0,0 @@
1
- {
2
- "skill_name": "sprint-flow",
3
- "skill_path": "skills/sprint-flow/SKILL.md",
4
- "evals": [
5
- {
6
- "id": 1,
7
- "name": "full-sprint-normal-feature",
8
- "category": "normal",
9
- "prompt": "开发一个用户登录功能,支持邮箱密码登录和OAuth2.0第三方登录(GitHub和Google)。需要记住登录状态,支持'记住我'功能。请用sprint-flow执行。",
10
- "expected_output": "执行完整sprint流程:Phase 0(Think)→Phase 1(Plan含autoplan)→Phase 2(Build含TDD)→Phase 3(Review)→Phase 4(人工验收,必须暂停)→Phase 5(Feedback)→Phase 6(Ship)。Phase 4必须暂停等用户确认,不能自动跳过。",
11
- "files": [],
12
- "assertions": [
13
- {"name": "phase-0-think", "type": "contains", "value": "Phase 0"},
14
- {"name": "phase-1-plan", "type": "contains", "value": "Phase 1"},
15
- {"name": "phase-2-build", "type": "contains", "value": "Phase 2"},
16
- {"name": "phase-3-review", "type": "contains", "value": "Phase 3"},
17
- {"name": "phase-4-uat-pause", "type": "contains", "value": "Phase 4"},
18
- {"name": "phase-4-not-automated", "type": "not_contains", "value": "验收通过"},
19
- {"name": "user-acceptance-required", "type": "contains", "value": "人工"},
20
- {"name": "pain-document-generated", "type": "contains", "value": "Pain Document"}
21
- ]
22
- },
23
- {
24
- "id": 2,
25
- "name": "taste-decision-pause",
26
- "category": "boundary",
27
- "prompt": "开发一个实时通知系统。技术选型上,WebSocket和SSE都可以实现,但各有优劣。我团队主要用React+Node.js。请用sprint-flow执行。",
28
- "expected_output": "autoplan应该发现taste_decision(WebSocket vs SSE选择),暂停等用户确认技术选型后继续。不能自动替用户做技术选型决策。",
29
- "files": [],
30
- "assertions": [
31
- {"name": "taste-decision-surfaced", "type": "contains", "value": "taste_decision"},
32
- {"name": "pause-for-user", "type": "contains", "value": "暂停"},
33
- {"name": "no-auto-tech-choice", "type": "not_contains", "value": "自动选择"}
34
- ]
35
- },
36
- {
37
- "id": 3,
38
- "name": "phase-4-cannot-be-automated",
39
- "category": "boundary",
40
- "prompt": "sprint-flow跑到Phase 4了,能不能跳过用户验收直接发布?我赶时间。",
41
- "expected_output": "Phase 4人工验收不可跳过、不可自动化。78%失败不可见(学术证据),emergent requirements无法消除。即使用户赶时间,也必须完成人工验收。可以提供'快速验收清单'但必须有人确认。",
42
- "files": [],
43
- "assertions": [
44
- {"name": "phase-4-mandatory", "type": "contains", "value": "必须"},
45
- {"name": "emergent-issues-mentioned", "type": "contains", "value": "emergent"},
46
- {"name": "cannot-skip-uat", "type": "not_contains", "value": "跳过验收"}
47
- ]
48
- },
49
- {
50
- "id": 4,
51
- "name": "stop-at-plan",
52
- "category": "boundary",
53
- "prompt": "我想先看看方案再决定要不要继续开发。执行/sprint-flow '给XP-Gate添加代码覆盖率趋势分析功能' --stop-at plan",
54
- "expected_output": "只执行到Phase 1(Plan)后停止,输出specification.yaml并等待用户决定。不应自动进入Phase 2。",
55
- "files": [],
56
- "assertions": [
57
- {"name": "stops-at-plan", "type": "contains", "value": "specification.yaml"},
58
- {"name": "no-build-phase", "type": "not_contains", "value": "Phase 2"}
59
- ]
60
- },
61
- {
62
- "id": 5,
63
- "name": "phase-subagent-dispatch",
64
- "category": "normal",
65
- "prompt": "sprint-flow '开发一个用户反馈表单功能',请执行 Phase 0 THINK 阶段",
66
- "expected_output": "Phase 0 THINK 必须通过独立 subagent 执行(task with category=deep 和 load_skills=['brainstorming']),而不是在同一 session 内。subagent 输入应包含 phase--1-summary 的 worktree 路径。输出设计文档。",
67
- "files": [],
68
- "assertions": [
69
- {"name": "subagent-dispatch-think", "type": "contains", "value": "category"},
70
- {"name": "brainstorming-skill-loaded", "type": "contains", "value": "brainstorming"},
71
- {"name": "design-doc-output", "type": "contains", "value": "设计文"}
72
- ]
73
- },
74
- {
75
- "id": 6,
76
- "name": "context-inheritance-across-phases",
77
- "category": "normal",
78
- "prompt": "sprint-flow 进入 Phase 3 REVIEW 阶段,前两个阶段已完成。Phase 1 产出了 specification.yaml,Phase 2 产出了 MVP 代码。",
79
- "expected_output": "Phase 3 必须加载 phase-2-summary.md 和 MVP 作为输入。Phase summary 应包含 YAML frontmatter 和必填字段(phase, decisions, next_phase_context)。",
80
- "files": [],
81
- "assertions": [
82
- {"name": "load-phase-2-summary", "type": "contains", "value": "phase-2-summary"},
83
- {"name": "yaml-frontmatter-schema", "type": "contains", "value": "frontmatter"},
84
- {"name": "reviews-existing-code", "type": "contains", "value": "MVP"}
85
- ]
86
- },
87
- {
88
- "id": 7,
89
- "name": "phase-transition-gate-enforcement",
90
- "category": "boundary",
91
- "prompt": "sprint-flow Phase 1 完成后,Phase summary 文件忘记写了,直接要进入 Phase 2。会发生什么?",
92
- "expected_output": "Phase Transition Gate 检查 phase-1-summary.md 是否存在。如果缺失,必须 BLOCK 不可 dispatch Phase 2。orchestrator 强制执行验证。",
93
- "files": [],
94
- "assertions": [
95
- {"name": "gate-blocks-missing-summary", "type": "contains", "value": "BLOCK"},
96
- {"name": "summary-required", "type": "contains", "value": "summary"},
97
- {"name": "orchestrator-enforces", "type": "contains", "value": "orchestrator"}
98
- ]
99
- },
100
- {
101
- "id": 8,
102
- "name": "worktree-enforcement-issue-84",
103
- "category": "boundary",
104
- "prompt": "sprint-flow Phase -1 创建了 worktree,但 agent 开始在主目录编辑文件而不是在 worktree 目录下。这有什么问题?",
105
- "expected_output": "指出 Phase -1 完成后,所有后续文件编辑必须在 worktree 目录下执行。主目录编辑不会同步到 worktree,导致 merge conflicts 和文件遗漏。",
106
- "files": [],
107
- "assertions": [
108
- {"name": "worktree-required", "type": "contains", "value": "worktree"},
109
- {"name": "all-edits-in-worktree", "type": "contains", "value": "所有"},
110
- {"name": "merge-conflict-risk", "type": "contains", "value": "merge"}
111
- ]
112
- }
113
- ],
114
- "trigger_evals": {
115
- "should_trigger": [
116
- "开发一个新功能,支持用户导出PDF报告",
117
- "我要做用户权限管理模块,帮我走完整流程",
118
- "sprint-flow 开发消息队列服务",
119
- "一键开发数据导入功能",
120
- "从需求到发布,帮我做用户通知功能"
121
- ],
122
- "should_not_trigger": [
123
- "修复这个TypeScript类型错误",
124
- "帮我review一下这段代码",
125
- "运行测试看看有没有问题",
126
- "解释一下delphi-review怎么用",
127
- "git commit一下"
128
- ]
129
- }
130
- }
@@ -1,39 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "Sprint Flow Evolution History",
4
- "description": "Machine-readable change manifest for AHE-inspired skill evolution. Updated after each skill modification.",
5
- "iterations": [
6
- {
7
- "id": 1,
8
- "date": "2026-05-22",
9
- "trigger": "new-feature",
10
- "issue": "#62",
11
- "root_cause": "SKILL.md monolith prevents component-level ablation experiments. No observable feedback accumulation. Iteration driven by intuition, not evidence.",
12
- "component_changes": ["middleware", "tools", "memory"],
13
- "files_changed": [
14
- "skills/sprint-flow/references/components/system-prompt.md",
15
- "skills/sprint-flow/references/components/tool-descriptions.md",
16
- "skills/sprint-flow/references/components/middleware.md",
17
- "skills/sprint-flow/references/components/skill-invocations.md",
18
- "skills/sprint-flow/references/components/memory.md",
19
- "skills/sprint-flow/evolution-log.md",
20
- "skills/sprint-flow/evolution-history.json",
21
- "skills/ralph-loop/references/components/system-prompt.md",
22
- "skills/ralph-loop/references/components/tool-descriptions.md",
23
- "skills/ralph-loop/references/components/middleware.md",
24
- "skills/ralph-loop/references/components/skill-invocations.md",
25
- "skills/ralph-loop/references/components/memory.md",
26
- "skills/ralph-loop/evolution-log.md",
27
- "skills/ralph-loop/evolution-history.json"
28
- ],
29
- "prediction": {
30
- "metric": "component-attribution-accuracy",
31
- "direction": "up",
32
- "delta_pct": 100,
33
- "risk": "No measurable impact yet; metrics depend on P1 debugger implementation"
34
- },
35
- "actual_outcome": null,
36
- "delphi_review": "Round 2 APPROVED (2/3 majority, minority concern: ralph-loop sync)"
37
- }
38
- ]
39
- }
@@ -1,23 +0,0 @@
1
- # Evolution Log — sprint-flow
2
-
3
- > AHE 启发的可观测性变更日志。每次对 sprint-flow 组件的修改必须记录。
4
-
5
- ## Entry 001 — 2026-05-22 — AHE Observability Infrastructure (P0)
6
-
7
- - **Trigger**: new-feature — Issue #62: 为 XP-Gate Skills 建立可观测性基础设施
8
- - **Evidence**: GitHub Issue #62 描述 — 无法做消融实验,反馈无法积累,迭代依赖直觉
9
- - **Root Cause**: SKILL.md 单文件结构导致组件级修改无法归因到具体组件
10
- - **Change Made**:
11
- 1. 创建 `references/components/` 目录,包含 5 个 AHE 对齐组件:
12
- - `system-prompt.md` (核心原则 L34-43)
13
- - `tool-descriptions.md` (Phase Skill 调用 L120-298)
14
- - `middleware.md` (状态机+暂停点 L46-84)
15
- - `skill-invocations.md` (Phase→Skill 映射 L88-103)
16
- - `memory.md` (Sprint State JSON L190-334)
17
- 2. 创建 `evolution-log.md` (本文)
18
- 3. 创建 `evolution-history.json` (初始 schema + Iteration 001 记录)
19
- 4. 同步为 ralph-loop 创建同等 components/ 结构
20
- - **Self-Predicted Impact**: ablation 实验成为可能;单次组件修改的因果归因从 0% → 100%
21
- - **Actual Outcome**: ⏳ pending(P1 debugger 实施后测量)
22
- - **Component Changed**: [middleware, tools, memory]
23
- - **Delphi Review**: Round 2 APPROVED (2/3, 记录少数派 ralph-loop 关切)