@boyingliu01/opencode-plugin 0.15.5 → 0.17.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/index.ts
CHANGED
|
@@ -132,6 +132,7 @@ async function checkXpGateUpdate(): Promise<UpgradeResult> {
|
|
|
132
132
|
const exitCode = await new Promise<number | null>((resolve, reject) => {
|
|
133
133
|
const child = spawn("npm", ["install", "-g", `${XP_GATE_NPM_PKG}@${remoteVersion}`], {
|
|
134
134
|
stdio: "pipe",
|
|
135
|
+
shell: true, // Required on Windows: npm is a .cmd file
|
|
135
136
|
timeout: 120_000,
|
|
136
137
|
})
|
|
137
138
|
child.on("close", (code) => resolve(code))
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-24
|
|
4
|
+
**Commit:** 8152a68
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.17.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-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-24
|
|
4
|
+
**Commit:** 8152a68
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.17.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.
|
|
@@ -199,11 +199,28 @@ Every phase MUST output its header as the first line of that phase's output. For
|
|
|
199
199
|
3. NEVER merge phase output — each phase gets its own header
|
|
200
200
|
4. On `/sprint-flow` trigger, first line MUST output: `Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE`
|
|
201
201
|
5. Each phase completion MUST write Phase Summary to `.sprint-state/phase-outputs/phase-{N}-summary.md`
|
|
202
|
-
6. Each phase completion MUST call `xp-gate phase-transition <N> <status> --render` — this programmatically updates `sprint-state.json` AND renders the ASCII dashboard in one command (resolves #338, #146)
|
|
203
202
|
|
|
204
|
-
### Phase Transition
|
|
203
|
+
### Phase Transition — TodoWrite Embedded (MANDATORY, resolves #366)
|
|
205
204
|
|
|
206
|
-
|
|
205
|
+
6. **Sprint initialization**: Phase 1 PREP MUST begin with `npx xp-gate sprint-init "<task_description>"` — this is the single entry point for sprint creation. NEVER manually write sprint-state.json.
|
|
206
|
+
|
|
207
|
+
7. **Phase transitions are embedded in TodoWrite items**, not as separate post-actions. Each phase's TodoWrite item MUST include the phase-transition call as part of the same atomic step:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
TodoWrite item format:
|
|
211
|
+
- "Phase N: <main task> + phase-transition N completed → N+1 in_progress --render"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Example TodoWrite items for a sprint:
|
|
215
|
+
```
|
|
216
|
+
- Phase 1: PREP — estimate + sprint-init + phase-transition 1 completed --render
|
|
217
|
+
- Phase 2: DESIGN — delphi review + phase-transition 2 completed --render
|
|
218
|
+
- Phase 3: BUILD — implementation + phase-transition 3 completed --render
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Rationale**: TodoWrite items are the LLM's most consistently executed operations. Embedding phase-transition elevates it from "post-action meta-info" (priority 4, ignored) to "main task step" (priority 2, executed).
|
|
222
|
+
|
|
223
|
+
8. **NEVER** manually write to `sprint-state.json` or manually render the dashboard. ALWAYS use:
|
|
207
224
|
```
|
|
208
225
|
npx xp-gate phase-transition <phase> <status> --render [--outputs '<json>']
|
|
209
226
|
```
|
|
@@ -211,14 +228,8 @@ Every phase MUST output its header as the first line of that phase's output. For
|
|
|
211
228
|
- `<status>`: `in_progress` | `completed` | `skipped` | `failed` | `paused`
|
|
212
229
|
- `--render`: Auto-renders ASCII progress dashboard after state update
|
|
213
230
|
- `--outputs '<json>'`: Optional JSON of phase outputs to record
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
npx xp-gate phase-transition 1 completed --render --outputs '{"estimate":"3 story points"}'
|
|
218
|
-
npx xp-gate phase-transition 2 in_progress --render
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
This is a **HARD GATE** — the orchestrator MUST invoke this CLI command. Text-level instructions to "update state" or "render dashboard" are DEPRECATED; the CLI is the single source of truth for state transitions and dashboard rendering.
|
|
231
|
+
|
|
232
|
+
This is a **HARD GATE** — the CLI is the single source of truth for state transitions and dashboard rendering.
|
|
222
233
|
|
|
223
234
|
### Phase Output Status Schema (MANDATORY per phase)
|
|
224
235
|
|
|
@@ -233,25 +244,73 @@ next_phase_context: [key info for next phase]
|
|
|
233
244
|
|
|
234
245
|
---
|
|
235
246
|
|
|
236
|
-
##
|
|
247
|
+
## Phase 1/6: PREP (准备工作)
|
|
248
|
+
|
|
249
|
+
**触发条件**:用户输入匹配 Triggers 表中任一短语,或显式调用 `/sprint-flow`。
|
|
250
|
+
|
|
251
|
+
**输入**:
|
|
252
|
+
| 输入 | 来源 | 必需 |
|
|
253
|
+
|------|------|------|
|
|
254
|
+
| 功能描述 | 用户命令参数 | 是 |
|
|
255
|
+
| 当前分支 | `git branch --show-current` | 自动检测 |
|
|
256
|
+
| 项目语言 | `--lang` 参数或自动检测 | 否 |
|
|
257
|
+
|
|
258
|
+
**步骤**:
|
|
259
|
+
1. 输出首行:`Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE`
|
|
260
|
+
2. 检测当前分支是否为保护分支(main/master/develop)
|
|
261
|
+
3. 创建 git worktree 隔离(除非 `--no-isolate`):
|
|
262
|
+
```bash
|
|
263
|
+
git worktree add .worktrees/sprint-$(date +%Y%m%d-%H%M%S) -b sprint/YYYY-MM-DD-NN
|
|
264
|
+
```
|
|
265
|
+
4. AUTO-ESTIMATE 规模评估(分析功能描述复杂度)
|
|
266
|
+
5. 分类:lightweight / standard / complex
|
|
267
|
+
6. 执行 `npx xp-gate sprint-init "<task_description>"` 初始化状态
|
|
268
|
+
7. 执行 `npx xp-gate phase-transition 1 completed --render`
|
|
269
|
+
|
|
270
|
+
**输出**:
|
|
271
|
+
| 输出物 | 路径 | 格式 |
|
|
272
|
+
|--------|------|------|
|
|
273
|
+
| Worktree 路径 | `.worktrees/sprint-*` | 目录 |
|
|
274
|
+
| Sprint 状态 | `.sprint-state/sprint-state.json` | JSON |
|
|
275
|
+
| Phase Summary | `.sprint-state/phase-outputs/phase-1-summary.md` | Markdown |
|
|
276
|
+
|
|
277
|
+
**详细参考**:`@references/phase-1-prep.md`
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 门禁条件表 (Gate Conditions)
|
|
282
|
+
|
|
283
|
+
| 门禁 | 位置 | 条件 | 失败处理 |
|
|
284
|
+
|------|------|------|----------|
|
|
285
|
+
| GITHOOKS-GATE | Phase 2→3 | hooks 已安装且可执行 | 自动修复 (`xp-gate doctor --fix`),失败则 BLOCK |
|
|
286
|
+
| DELPHI-GATE | Phase 2→3 | delphi-review APPROVED (≥90%) | 重新设计或用户覆盖(记录原因) |
|
|
287
|
+
| VERSION-GATE | Phase 4→5 | VERSION 文件与 package.json 一致 | 执行 `node scripts/sync-version.cjs` |
|
|
288
|
+
| SHIP→CLOSE GATE | Phase 5→6 | PR 已合并 + release 完成 | BLOCK,等待合并确认 |
|
|
289
|
+
| feedback-log GATE | Phase 4→5 | feedback-log.md 存在 | BLOCK,必须完成 VERIFY |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Phase 2–6 详细指令
|
|
294
|
+
|
|
295
|
+
> Phase 2–6 的完整步骤、输入/输出契约、模板和 Skill 集成详情见 `references/` 目录。本节提供路由摘要。
|
|
237
296
|
|
|
238
|
-
|
|
297
|
+
| Phase | 参考文件 | 核心 Skill 链 |
|
|
298
|
+
|-------|----------|---------------|
|
|
299
|
+
| 2/6 DESIGN | `@references/phase-2-design.md` | CONTEXT.md 预检 → brainstorming → autoplan → delphi-review → to-issues |
|
|
300
|
+
| 3/6 BUILD | `@references/phase-3-build.md` | GITHOOKS-GATE → DELPHI-GATE → ralph-loop (TDD) → freeze → blind review |
|
|
301
|
+
| 4/6 VERIFY | `@references/phase-4-verify.md` | delphi code-walkthrough → test-spec-alignment → browse QA → retro |
|
|
302
|
+
| 5/6 SHIP | `@references/phase-5-ship.md` | VERSION-GATE → finishing-branch → ship (PR) → land-and-deploy → merge |
|
|
303
|
+
| 6/6 CLOSE | `@references/phase-6-close.md` | SHIP→CLOSE GATE → backup → USER ACCEPTANCE → emergent → cleanup |
|
|
239
304
|
|
|
240
|
-
|
|
305
|
+
**路径约定**:`@references/` 和 `@templates/` 相对于 skill 目录(`skills/sprint-flow/`)解析。
|
|
241
306
|
|
|
242
|
-
|
|
243
|
-
|
|
|
244
|
-
|
|
245
|
-
| `@references/phase-overview.md` |
|
|
246
|
-
| `@references/
|
|
247
|
-
| `@references/
|
|
248
|
-
| `@
|
|
249
|
-
| `@references/phase-4-verify.md` | 4/6 | VERIFY — code-walkthrough + QA + feedback |
|
|
250
|
-
| `@references/phase-5-ship.md` | 5/6 | SHIP — PR + merge + deploy + canary |
|
|
251
|
-
| `@references/phase-6-close.md` | 6/6 | CLOSE — UAT + cleanup |
|
|
252
|
-
| `@references/orchestration-rules.md` | ALL | Agent dispatch, context inheritance, transition gates |
|
|
253
|
-
| `@references/force-levels.md` | ALL | Phase forcing rules |
|
|
254
|
-
| `@templates/` | ALL | Pain doc, emergent issues, sprint summary, progress templates |
|
|
307
|
+
**完整参考文件索引**:
|
|
308
|
+
| 文件 | 内容 |
|
|
309
|
+
|------|------|
|
|
310
|
+
| `@references/phase-overview.md` | 全阶段详情、Skill 集成、参数、输出契约 |
|
|
311
|
+
| `@references/orchestration-rules.md` | Agent 调度、上下文继承、转换门禁 |
|
|
312
|
+
| `@references/force-levels.md` | 阶段强制执行规则 |
|
|
313
|
+
| `@templates/` | Pain doc、emergent issues、sprint summary、progress 模板 |
|
|
255
314
|
|
|
256
315
|
---
|
|
257
316
|
|
|
@@ -273,6 +332,72 @@ next_phase_context: [key info for next phase]
|
|
|
273
332
|
|
|
274
333
|
---
|
|
275
334
|
|
|
335
|
+
## 状态机 (State Machine)
|
|
336
|
+
|
|
337
|
+
```mermaid
|
|
338
|
+
stateDiagram-v2
|
|
339
|
+
[*] --> PREP : trigger matched
|
|
340
|
+
PREP --> DESIGN : worktree ready
|
|
341
|
+
DESIGN --> BUILD : APPROVED ≥90%
|
|
342
|
+
DESIGN --> DESIGN : REQUEST_CHANGES (max 3 rounds)
|
|
343
|
+
BUILD --> VERIFY : tests pass
|
|
344
|
+
BUILD --> BUILD : fix cycle (max 3)
|
|
345
|
+
VERIFY --> SHIP : feedback-log exists
|
|
346
|
+
VERIFY --> BUILD : critical issues found
|
|
347
|
+
SHIP --> CLOSE : PR merged
|
|
348
|
+
SHIP --> SHIP : CI failed (retry)
|
|
349
|
+
CLOSE --> [*] : UAT confirmed
|
|
350
|
+
BUILD --> BLOCKED : 3 fix cycles exhausted
|
|
351
|
+
DESIGN --> BLOCKED : 3 redesign rounds exhausted
|
|
352
|
+
BLOCKED --> [*] : user decision
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## 决策记录模板 (Decision Record)
|
|
358
|
+
|
|
359
|
+
每个用户决策点必须记录到 `.sprint-state/decisions.md`:
|
|
360
|
+
|
|
361
|
+
```markdown
|
|
362
|
+
## Decision DR-{NNN}
|
|
363
|
+
- **Phase**: {phase_number}/6 {PHASE_NAME}
|
|
364
|
+
- **Question**: {what was asked}
|
|
365
|
+
- **Options**: {options presented}
|
|
366
|
+
- **Choice**: {user's selection}
|
|
367
|
+
- **Rationale**: {why this choice}
|
|
368
|
+
- **Timestamp**: {ISO 8601}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**强制决策点**:
|
|
372
|
+
| 决策点 | 阶段 | 触发条件 |
|
|
373
|
+
|--------|------|----------|
|
|
374
|
+
| 规模确认 | PREP | AUTO-ESTIMATE 结果与用户预期不符 |
|
|
375
|
+
| 设计审批 | DESIGN | delphi-review 返回 REQUEST_CHANGES |
|
|
376
|
+
| 修复策略 | BUILD | 修复循环达到 3 次上限 |
|
|
377
|
+
| 发布确认 | SHIP | PR 创建后等待用户确认合并 |
|
|
378
|
+
| UAT 结果 | CLOSE | 用户手动验收(必须手动,禁止自动化) |
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## 失败处理 (Failure Handling)
|
|
383
|
+
|
|
384
|
+
| 失败场景 | 处理策略 | 升级条件 |
|
|
385
|
+
|----------|----------|----------|
|
|
386
|
+
| Worktree 创建失败 | 重试 1 次,失败则提示用户手动处理 | 磁盘空间不足或权限问题 |
|
|
387
|
+
| delphi-review 连续 REQUEST_CHANGES | 最多 3 轮重设计,超过则 BLOCK | 3 轮后仍未 APPROVED |
|
|
388
|
+
| BUILD 修复循环超限 | 最多 3 次 fix cycle,超过则 BLOCK + 用户决策 | 测试持续失败 |
|
|
389
|
+
| CI 失败 | 分析失败原因,尝试 1 次自动修复 | 非 flaky 失败 |
|
|
390
|
+
| PR 合并冲突 | 提示用户手动解决 | 始终(禁止自动 force) |
|
|
391
|
+
| 工具缺失 | SKIP(不 BLOCK),记录到 phase summary | 始终不阻断 |
|
|
392
|
+
|
|
393
|
+
**BLOCK 状态处理**:
|
|
394
|
+
1. 写入 `.sprint-state/sprint-state.json` 状态为 `blocked`
|
|
395
|
+
2. 输出阻塞原因 + 已完成工作 + 建议操作
|
|
396
|
+
3. 等待用户决策(继续/放弃/降级)
|
|
397
|
+
4. 记录决策到 `decisions.md`
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
276
401
|
## 使用示例
|
|
277
402
|
|
|
278
403
|
| 场景 | 命令 | 说明 |
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-07-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-07-24
|
|
4
|
+
**Commit:** 8152a68
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.17.0.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|