@boyingliu01/xp-gate 0.5.3 → 0.7.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.
- package/bin/xp-gate.js +134 -4
- package/hooks/pre-push +11 -2
- package/lib/__tests__/detect-deps.test.js +34 -0
- package/lib/__tests__/gate-audit.test.ts +199 -0
- package/lib/__tests__/install-skill.test.js +45 -0
- package/lib/detect-deps.js +19 -6
- package/lib/gate-audit.ts +279 -0
- package/lib/install-skill.js +26 -15
- package/lib/ui-detector.ts +5 -5
- package/lib/ui-review.ts +22 -22
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/qoder/AGENTS.md +93 -0
- package/plugins/qoder/README.md +87 -0
- package/plugins/qoder/widgets/quality-report.html +163 -0
- package/plugins/qoder/widgets/sprint-dashboard.html +172 -0
- package/skills/delphi-review/SKILL.md +48 -0
- package/skills/delphi-review/references/qoder-multi-model.md +191 -0
- package/skills/ralph-loop/SKILL.md +40 -0
- package/skills/sprint-flow/SKILL.md +68 -0
- package/skills/sprint-flow/references/qoder-adaptation.md +173 -0
- package/skills/test-specification-alignment/SKILL.md +23 -0
|
@@ -263,6 +263,25 @@ Phase 2 第一步必须执行 DELPHI-GATE 检查。没有 delphi-review APPROVED
|
|
|
263
263
|
3. 验证 `verdict` 字段 == `"APPROVED"` → 不等于 → 同上 BLOCK
|
|
264
264
|
4. ✅ 通过 → 进入 BUILD 编码
|
|
265
265
|
|
|
266
|
+
**⚠️ Qoder Pre-Edit Gate(MANDATORY — 替代 Claude Code 的 delphi-review-guard.sh Hook)**:
|
|
267
|
+
|
|
268
|
+
在 Qoder 环境中,由于没有 PreToolUse/PostToolUse 文件系统钩子,orchestrator **MUST** 在每次文件编辑/写入操作之前执行以下检查:
|
|
269
|
+
|
|
270
|
+
1. 检查 `.sprint-state/` 目录是否存在 → 不存在 → 跳过检查(非 sprint 项目)
|
|
271
|
+
2. 读取 `.sprint-state/delphi-reviewed.json` → 文件不存在 → **BLOCK**: 输出 `[DELPHI-GATE] delphi-review not APPROVED. 请先运行 /delphi-review`
|
|
272
|
+
3. `verdict` != `"APPROVED"` → **BLOCK**
|
|
273
|
+
4. `verdict` == `"APPROVED"` → 允许编辑
|
|
274
|
+
|
|
275
|
+
此检查在 Phase 2 至 Phase 6 期间持续生效。orchestrator 不可绕过此检查。
|
|
276
|
+
|
|
277
|
+
**Post-REQ Principles Check(替代 Claude Code 的 PostToolUse xp-gate-check Hook)**:
|
|
278
|
+
|
|
279
|
+
每个 REQ 完成后(ralph-loop 三层验证 Gate 之后),orchestrator **MUST** 运行:
|
|
280
|
+
```bash
|
|
281
|
+
npx -y tsx src/principles/index.ts --files "<changed_files>" --format console
|
|
282
|
+
```
|
|
283
|
+
如果 src/principles/ 不存在(非 xp-gate 项目),则跳过此步骤。
|
|
284
|
+
|
|
266
285
|
**输入**: `slices-manifest.json`(由 Phase 1 `/to-issues` 生成),按 `execution_order` 逐个执行。
|
|
267
286
|
|
|
268
287
|
**默认模式**: `ralph-loop` — 逐 REQ/切片 迭代构建。每个切片(REQ)dispatch 独立 subagent,干净上下文,全量回归测试。Token 节约 40-67%。参见 `skills/ralph-loop/SKILL.md`。
|
|
@@ -425,6 +444,55 @@ Phase 2 第一步必须执行 DELPHI-GATE 检查。没有 delphi-review APPROVED
|
|
|
425
444
|
| 7 | LAND | ✅ | `deep` | `["land-and-deploy"]` | subagent |
|
|
426
445
|
| 8 | CLEANUP | ❌ | Bash(直接执行) | 无 | orchestrator |
|
|
427
446
|
|
|
447
|
+
### Qoder Agent Dispatch Mapping(Qoder 平台替代方案)
|
|
448
|
+
|
|
449
|
+
在 Qoder 环境中,OpenCode 的 `task()` API 和 superpowers/gstack 外部 skill 不可用。以下映射表说明每个 Phase 在 Qoder 中的执行方式:
|
|
450
|
+
|
|
451
|
+
| Phase | 原 task()/skill 调用 | Qoder 替代方案 | 说明 |
|
|
452
|
+
|-------|----------------------|--------------|------|
|
|
453
|
+
| -1 ISOLATE | Bash 直接执行 | **Bash 直接执行**(无变化) | git worktree 操作平台无关 |
|
|
454
|
+
| -0.5 AUTO-ESTIMATE | Bash 直接执行 | **Bash 直接执行**(无变化) | grep -rn 平台无关 |
|
|
455
|
+
| 0 THINK | `task(deep, brainstorming)` | **plan-agent subagent** | 需求探索与设计适合 plan-agent |
|
|
456
|
+
| 1 PLAN | `task(deep, autoplan+delphi+to-issues)` | **plan-agent subagent** | 规划类任务 |
|
|
457
|
+
| 2 BUILD | `ralph-loop` + 外部 skill | **orchestrator 直接执行** | ralph-loop 逐 REQ 迭代,不需要独立 subagent |
|
|
458
|
+
| 2 步骤 4 | `requesting-code-review` | **CodeReview subagent** | 代码盲评天然适合 CodeReview agent |
|
|
459
|
+
| 2 步骤 6 | `verification-before-completion` | **orchestrator 内联** | 运行测试 + lint + coverage + principles |
|
|
460
|
+
| 3 REVIEW | `task(deep, delphi+test-spec)` | **CodeReview subagent** + **browser-use MCP** | 代码走查 + 浏览器自动化 |
|
|
461
|
+
| 4 ACCEPT | 强制人工 | **强制人工**(无变化) | 必须人工验收 |
|
|
462
|
+
| 5 FEEDBACK | `task(quick, learn+retro+debug)` | **plan-agent** + **Memory 系统** | 回顾分析 + UpdateMemory 持久化 |
|
|
463
|
+
| 6 SHIP | `task(quick, finishing-branch+ship)` | **orchestrator 直接执行** | git + gh CLI 操作平台无关 |
|
|
464
|
+
| 7 LAND | `task(deep, land-and-deploy)` | **orchestrator 直接执行** | gh pr merge + CI polling |
|
|
465
|
+
| 8 CLEANUP | Bash 直接执行 | **Bash 直接执行**(无变化) | git worktree remove 平台无关 |
|
|
466
|
+
|
|
467
|
+
**Qoder 外部 Skill 降级表**(替代 superpowers/gstack 依赖):
|
|
468
|
+
|
|
469
|
+
| 外部 Skill | 来源 | Qoder 替代方案 |
|
|
470
|
+
|-----------|------|----------------|
|
|
471
|
+
| brainstorming | superpowers | orchestrator 内联需求探索对话 |
|
|
472
|
+
| autoplan | gstack | plan-agent 分析代码库生成计划 |
|
|
473
|
+
| freeze / unfreeze | gstack | Qoder Pre-Edit Gate 替代(见上方) |
|
|
474
|
+
| requesting-code-review | superpowers | **CodeReview subagent** |
|
|
475
|
+
| verification-before-completion | superpowers | orchestrator 运行测试+lint+coverage+principles |
|
|
476
|
+
| learn / retro | gstack | Qoder **Memory 系统**(UpdateMemory / SearchMemory) |
|
|
477
|
+
| browse | gstack | **browser-use MCP** 工具(navigate_page, click, fill, take_screenshot) |
|
|
478
|
+
| ship / finishing-a-development-branch | superpowers/gstack | orchestrator 执行 git + gh CLI |
|
|
479
|
+
| systematic-debugging | superpowers | orchestrator 内联分析错误日志 |
|
|
480
|
+
| land-and-deploy / canary | gstack | orchestrator 执行 gh + curl/Invoke-RestMethod |
|
|
481
|
+
| dispatching-parallel-agents | superpowers | orchestrator 按 dependency_graph 顺序执行 |
|
|
482
|
+
| executing-plans | superpowers | orchestrator 直接执行 |
|
|
483
|
+
|
|
484
|
+
**Qoder genui Widget 集成**:
|
|
485
|
+
|
|
486
|
+
Phase 3 REVIEW 完成后,orchestrator **SHOULD** 使用 genui `show_widget` MCP 工具展示质量报告:
|
|
487
|
+
- Widget 模板:`plugins/qoder/widgets/quality-report.html`
|
|
488
|
+
- 数据源:读取项目根目录的 `quality-report.json`
|
|
489
|
+
|
|
490
|
+
Sprint 执行过程中,用户可通过 `/sprint-status` 触发 genui `show_widget` 展示 Sprint 仪表板:
|
|
491
|
+
- Widget 模板:`plugins/qoder/widgets/sprint-dashboard.html`
|
|
492
|
+
- 数据源:`.sprint-state/sprint-state.json`
|
|
493
|
+
|
|
494
|
+
详细适配规则参见 `references/qoder-adaptation.md`。
|
|
495
|
+
|
|
428
496
|
**上下文隔离原则**:
|
|
429
497
|
- 每个 Subagent 在**独立 session** 中启动,不继承 orchestrator 的对话历史
|
|
430
498
|
- orchestrator session 仅接收 subagent 的最终结果摘要(~13,000 tokens/sprint)
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Qoder Platform Adaptation Guide for Sprint Flow
|
|
2
|
+
|
|
3
|
+
**Version:** v0.6.0
|
|
4
|
+
**Platform:** Qoder IDE
|
|
5
|
+
**Status:** Active
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Platform Differences
|
|
10
|
+
|
|
11
|
+
### 1.1 No File-System Event Hooks
|
|
12
|
+
|
|
13
|
+
| Capability | Claude Code | OpenCode | Qoder |
|
|
14
|
+
|-----------|------------|----------|-------|
|
|
15
|
+
| PreToolUse Hook | ✅ `delphi-review-guard.sh` | ❌ | ❌ |
|
|
16
|
+
| PostToolUse Hook | ✅ `xp-gate-check` | ❌ | ❌ |
|
|
17
|
+
| Custom Tools | ❌ | ✅ `tool()` | ❌ (MCP instead) |
|
|
18
|
+
|
|
19
|
+
**Adaptation**: Gates embedded in SKILL.md as `<MANDATORY>` instructions. Orchestrator MUST execute checks before each file edit.
|
|
20
|
+
|
|
21
|
+
### 1.2 No `task()` Subagent API
|
|
22
|
+
|
|
23
|
+
| Capability | OpenCode | Qoder |
|
|
24
|
+
|-----------|----------|-------|
|
|
25
|
+
| Subagent dispatch | `task(category, load_skills)` | Agent tool (Browser/CodeReview/plan-agent) |
|
|
26
|
+
| Multi-model | Agent config with different models | Qoder multi-model capability |
|
|
27
|
+
| Context isolation | Automatic per-task | Automatic per-Agent |
|
|
28
|
+
|
|
29
|
+
**Adaptation**: Phase→Agent mapping table in sprint-flow SKILL.md.
|
|
30
|
+
|
|
31
|
+
### 1.3 No superpowers/gstack Ecosystem
|
|
32
|
+
|
|
33
|
+
Qoder does not have access to the superpowers or gstack skill ecosystems. All external skill calls are replaced by:
|
|
34
|
+
- **Orchestrator inline execution** (for simple tasks)
|
|
35
|
+
- **Qoder native capabilities** (Memory, CodeReview, browser-use)
|
|
36
|
+
- **Agent subagents** (for complex analysis/planning)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 2. External Skill Replacement Matrix
|
|
41
|
+
|
|
42
|
+
### 2.1 brainstorming (superpowers) → Orchestrator Inline
|
|
43
|
+
|
|
44
|
+
**Original**: `task(category="deep", load_skills=["brainstorming"])`
|
|
45
|
+
|
|
46
|
+
**Qoder Replacement**: Orchestrator conducts an interactive requirements exploration dialogue:
|
|
47
|
+
1. Ask clarifying questions about the feature
|
|
48
|
+
2. Analyze existing codebase for relevant modules
|
|
49
|
+
3. Generate a structured design document
|
|
50
|
+
4. Present to user for approval (HARD-GATE)
|
|
51
|
+
|
|
52
|
+
### 2.2 autoplan (gstack) → plan-agent Subagent
|
|
53
|
+
|
|
54
|
+
**Original**: `task(category="deep", load_skills=["autoplan"])`
|
|
55
|
+
|
|
56
|
+
**Qoder Replacement**: Dispatch `plan-agent` subagent with:
|
|
57
|
+
- Design document as input
|
|
58
|
+
- Codebase structure analysis
|
|
59
|
+
- Generate implementation plan with REQ/AC structure
|
|
60
|
+
- Output: specification.yaml draft
|
|
61
|
+
|
|
62
|
+
### 2.3 freeze/unfreeze (gstack) → Pre-Edit Gate
|
|
63
|
+
|
|
64
|
+
**Original**: `freeze` locks test directories, `unfreeze` unlocks
|
|
65
|
+
|
|
66
|
+
**Qoder Replacement**: Pre-Edit Gate in sprint-flow SKILL.md:
|
|
67
|
+
- During Phase 2 freeze state, orchestrator MUST check target file path
|
|
68
|
+
- If file is in test directory → BLOCK with message
|
|
69
|
+
- This is a behavioral constraint, not a physical lock
|
|
70
|
+
|
|
71
|
+
### 2.4 requesting-code-review (superpowers) → CodeReview Subagent
|
|
72
|
+
|
|
73
|
+
**Original**: `task(category="unspecified-high", load_skills=["requesting-code-review"])`
|
|
74
|
+
|
|
75
|
+
**Qoder Replacement**: Dispatch `CodeReview` subagent:
|
|
76
|
+
- Input: changed files since last REQ commit
|
|
77
|
+
- Blind review (no access to business intent, only code)
|
|
78
|
+
- Output: review findings
|
|
79
|
+
|
|
80
|
+
### 2.5 verification-before-completion (superpowers) → Orchestrator Inline
|
|
81
|
+
|
|
82
|
+
**Original**: `task(load_skills=["verification-before-completion"])`
|
|
83
|
+
|
|
84
|
+
**Qoder Replacement**: Orchestrator executes sequentially:
|
|
85
|
+
1. `npm test` / `pytest` / `go test` (test runner)
|
|
86
|
+
2. `npx eslint` / `ruff check` / `golangci-lint` (linter)
|
|
87
|
+
3. `npx tsx src/principles/index.ts` (principles check)
|
|
88
|
+
4. Coverage report check (≥80%)
|
|
89
|
+
|
|
90
|
+
### 2.6 learn/retro (gstack) → Qoder Memory System
|
|
91
|
+
|
|
92
|
+
**Original**: `task(load_skills=["learn", "retro"])`
|
|
93
|
+
|
|
94
|
+
**Qoder Replacement**:
|
|
95
|
+
- **learn**: `UpdateMemory` with appropriate category
|
|
96
|
+
- Architecture decisions → `expert_experience`
|
|
97
|
+
- Coding patterns → `development_practice_specification`
|
|
98
|
+
- Project structure → `project_introduction`
|
|
99
|
+
- **retro**: `plan-agent` subagent analyzes git log + code quality trends
|
|
100
|
+
- Output stored via `UpdateMemory` as `task_summary_experience`
|
|
101
|
+
|
|
102
|
+
### 2.7 browse (gstack) → browser-use MCP
|
|
103
|
+
|
|
104
|
+
**Original**: `browse` navigates to localhost, interacts with UI
|
|
105
|
+
|
|
106
|
+
**Qoder Replacement**: Use `browser-use` MCP tools:
|
|
107
|
+
- `navigate_page` → navigate to localhost:3000
|
|
108
|
+
- `click` / `fill` → interact with UI elements
|
|
109
|
+
- `take_screenshot` → capture visual verification
|
|
110
|
+
- `take_snapshot` → get accessibility tree for validation
|
|
111
|
+
|
|
112
|
+
### 2.8 ship/finishing-branch → Orchestrator Git/GH CLI
|
|
113
|
+
|
|
114
|
+
**Original**: External skill calls
|
|
115
|
+
|
|
116
|
+
**Qoder Replacement**: Orchestrator executes:
|
|
117
|
+
- `git add` + `git commit` + `git push`
|
|
118
|
+
- `gh pr create` + `gh pr merge`
|
|
119
|
+
- Standard git workflow (platform-independent)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 3. genui Widget Integration
|
|
124
|
+
|
|
125
|
+
### 3.1 Quality Report Widget
|
|
126
|
+
|
|
127
|
+
**Trigger**: After Phase 3 REVIEW completes
|
|
128
|
+
|
|
129
|
+
**Execution**:
|
|
130
|
+
```
|
|
131
|
+
show_widget(widget_path="plugins/qoder/widgets/quality-report.html", data={...quality-report.json contents...})
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 3.2 Sprint Dashboard Widget
|
|
135
|
+
|
|
136
|
+
**Trigger**: User requests `/sprint-status` or Phase transition
|
|
137
|
+
|
|
138
|
+
**Execution**:
|
|
139
|
+
```
|
|
140
|
+
show_widget(widget_path="plugins/qoder/widgets/sprint-dashboard.html", data={...sprint-state.json contents...})
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 4. Memory System Integration
|
|
146
|
+
|
|
147
|
+
### 4.1 Learnings Categories
|
|
148
|
+
|
|
149
|
+
| ralph-loop Category | Qoder Memory Category | Scope |
|
|
150
|
+
|--------------------|-----------------------|-------|
|
|
151
|
+
| permanent (architecture) | `expert_experience` | workspace |
|
|
152
|
+
| permanent (convention) | `development_practice_specification` | workspace |
|
|
153
|
+
| permanent (structure) | `project_introduction` | workspace |
|
|
154
|
+
| contextual | Not persisted | session only |
|
|
155
|
+
| sprint retro | `task_summary_experience` | workspace |
|
|
156
|
+
|
|
157
|
+
### 4.2 Memory Lifecycle
|
|
158
|
+
|
|
159
|
+
1. **REQ complete** → `UpdateMemory` for permanent learnings
|
|
160
|
+
2. **Sprint Phase 5** → `UpdateMemory` for sprint-level retro
|
|
161
|
+
3. **Next sprint** → `SearchMemory` to recall relevant learnings
|
|
162
|
+
4. **Stale learnings** → User can request memory cleanup
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 5. Known Limitations
|
|
167
|
+
|
|
168
|
+
| Limitation | Impact | Mitigation |
|
|
169
|
+
|-----------|--------|-----------|
|
|
170
|
+
| Skill-embedded gates less reliable than hooks | Agent may ignore constraints | `<MANDATORY>` tags + Terminal State Checklist |
|
|
171
|
+
| No physical file-system lock for freeze | Test files could be modified | Pre-Edit Gate + Terminal State verification |
|
|
172
|
+
| Single model for all experts (degraded mode) | Loses cross-provider anonymity | Clearly label degraded reviews |
|
|
173
|
+
| No `k6`/`locust` integration | Load testing limited | Future: MCP server for load testing |
|
|
@@ -569,6 +569,29 @@ legacy_mode:
|
|
|
569
569
|
|
|
570
570
|
---
|
|
571
571
|
|
|
572
|
+
## Qoder 平台适配
|
|
573
|
+
|
|
574
|
+
### freeze 机制替代(替代 gstack/freeze skill)
|
|
575
|
+
|
|
576
|
+
在 Qoder 环境中,freeze/unfreeze 通过 sprint-flow 的 **Pre-Edit Gate** 替代:
|
|
577
|
+
- Phase 2 执行期间,orchestrator 禁止修改测试目录下的文件
|
|
578
|
+
- 此约束通过 SKILL.md 指令强制执行(非物理阻断)
|
|
579
|
+
- orchestrator 在每次文件编辑前检查:如果目标文件位于测试目录且当前处于 Phase 2 freeze 状态,则 **BLOCK**
|
|
580
|
+
|
|
581
|
+
### Agent 配置适配
|
|
582
|
+
|
|
583
|
+
| 原配置 | Qoder 替代 | 说明 |
|
|
584
|
+
|---------|------------|------|
|
|
585
|
+
| Phase 1 Agent (Qwen3.5-Plus) | **orchestrator 直接执行** | YAML 解析 + AST 解析由 orchestrator 内联完成 |
|
|
586
|
+
| Phase 2 Agent (GLM-5) | **orchestrator 直接执行** | 测试执行由 orchestrator 通过 Bash 工具完成 |
|
|
587
|
+
|
|
588
|
+
### Qoder 集成点
|
|
589
|
+
|
|
590
|
+
- Phase 3 REVIEW 完成后,使用 genui `show_widget` 展示对齐报告摘要
|
|
591
|
+
- 对齐分数记录通过 `UpdateMemory` 持久化(development_test_specification 类型)
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
572
595
|
## Anti-Patterns
|
|
573
596
|
|
|
574
597
|
| 错误 | 正确 |
|