@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.
- package/bin/xp-gate.js +4 -9
- package/lib/__tests__/audit-log.test.ts +107 -0
- package/lib/__tests__/detect-deps.test.js +212 -42
- package/lib/__tests__/doctor.test.js +1 -0
- package/lib/__tests__/gate-audit.test.ts +59 -0
- package/lib/__tests__/init.test.js +47 -1
- package/lib/__tests__/install-skill.test.js +1 -45
- package/lib/__tests__/ui-detector.test.ts +186 -26
- package/lib/__tests__/ui-review.test.ts +119 -0
- package/lib/__tests__/uninstall.test.js +1 -0
- package/lib/detect-deps.js +180 -37
- package/lib/doctor.js +7 -9
- package/lib/gate-audit.ts +26 -42
- package/lib/init.js +42 -13
- package/lib/install-skill.js +20 -48
- package/lib/rollback.js +1 -16
- package/lib/shared-paths.js +30 -0
- package/lib/shared-utils.js +25 -0
- package/lib/ui-detector.ts +20 -14
- package/lib/ui-review.ts +58 -53
- package/lib/uninstall.js +8 -9
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/claude-code/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/claude-code/skills/delphi-review/SKILL.md +454 -0
- package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/claude-code/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/claude-code/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/claude-code/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/claude-code/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/claude-code/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/claude-code/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/claude-code/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/claude-code/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/claude-code/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/claude-code/skills/to-issues/SKILL.md +277 -0
- package/plugins/opencode/README.md +38 -0
- package/plugins/opencode/index.ts +85 -0
- package/plugins/opencode/package.json +18 -0
- package/plugins/opencode/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/opencode/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/opencode/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/opencode/skills/delphi-review/SKILL.md +454 -0
- package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/opencode/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/opencode/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/opencode/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/opencode/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/opencode/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/opencode/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/opencode/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/opencode/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/opencode/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/opencode/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/opencode/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/opencode/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/opencode/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/opencode/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/opencode/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/opencode/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/opencode/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/opencode/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/opencode/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/opencode/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/opencode/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/opencode/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/opencode/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/opencode/skills/to-issues/SKILL.md +277 -0
- package/plugins/opencode/tsconfig.json +15 -0
- package/plugins/qoder/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/qoder/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/qoder/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/qoder/skills/delphi-review/SKILL.md +454 -0
- package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/qoder/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/qoder/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/qoder/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/qoder/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/qoder/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/qoder/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/qoder/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/qoder/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/qoder/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/qoder/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/qoder/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/qoder/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/qoder/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/qoder/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/qoder/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/qoder/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/qoder/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/qoder/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/qoder/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/qoder/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/qoder/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/qoder/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/qoder/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/qoder/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/qoder/skills/to-issues/SKILL.md +277 -0
- package/skills/admin-template-guidelines/SKILL.md +904 -0
- package/skills/delphi-review/SKILL.md +112 -77
- package/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/skills/ralph-loop/SKILL.md +165 -34
- package/skills/sprint-flow/SKILL.md +448 -107
- package/skills/sprint-flow/references/components/skill-invocations.md +1 -1
- package/skills/sprint-flow/references/components/tool-descriptions.md +1 -1
- package/skills/sprint-flow/references/force-levels.md +203 -0
- package/skills/sprint-flow/references/phase-1-plan.md +4 -4
- package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +20 -1
- package/skills/sprint-flow/templates/auto-estimate-output-template.md +7 -5
- package/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/skills/test-driven-development/SKILL.md +71 -0
- package/skills/test-specification-alignment/SKILL.md +98 -24
- package/skills/to-issues/SKILL.md +277 -0
- package/plugins/qoder/AGENTS.md +0 -93
- package/plugins/qoder/README.md +0 -87
- package/plugins/qoder/widgets/quality-report.html +0 -163
- package/plugins/qoder/widgets/sprint-dashboard.html +0 -172
- package/skills/delphi-review/evals/evals.json +0 -82
- package/skills/delphi-review/references/qoder-multi-model.md +0 -191
- package/skills/ralph-loop/evals/evals.json +0 -311
- package/skills/ralph-loop/evolution-history.json +0 -59
- package/skills/ralph-loop/evolution-log.md +0 -16
- package/skills/sprint-flow/evals/evals.json +0 -130
- package/skills/sprint-flow/evolution-history.json +0 -39
- package/skills/sprint-flow/evolution-log.md +0 -23
- package/skills/sprint-flow/references/qoder-adaptation.md +0 -173
- package/skills/test-specification-alignment/evals/evals.json +0 -75
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Phase 0: THINK(需求探索与设计)
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
使用 brainstorming skill 进行结构化需求探索,输出经用户批准的设计文档。
|
|
6
|
+
|
|
7
|
+
**关键变更(ISSUE30)**: 从 `office-hours` 切换到 `brainstorming`,原因:
|
|
8
|
+
- brainstorming 有 **HARD-GATE**(设计未批准 → 不可进入实现),防止 "觉得已经理解了就直接开始写代码"
|
|
9
|
+
- brainstorming 输出结构化设计文档,可直接作为 Phase 1 PLAN 的输入
|
|
10
|
+
- office-hours 的 YC 六问适合新产品方向验证,brainstorming 更适合"具体功能实现前设计"的场景
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 调用 Skills
|
|
15
|
+
|
|
16
|
+
- `brainstorming` (superpowers) — **HARD-GATE**: 设计未批准 → 不可进入实现
|
|
17
|
+
- 可选补充:`office-hours` (gstack) — 当用户需求非常模糊、需要先验证产品方向时
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## HARD-GATE 机制
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
DO NOT enter Phase 1 (PLAN) or do any implementation
|
|
25
|
+
until the brainstorming design has been APPROVED by the user.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
这是 sprint-flow 的关键安全门。brainstorming skill 内部会执行:
|
|
29
|
+
|
|
30
|
+
1. **Explore project context** — 检查文件、文档、最近 commits
|
|
31
|
+
2. **Ask clarifying questions** — 一次一个,理解目的/约束/成功标准
|
|
32
|
+
3. **Propose approaches** — 2-3 个方案,含 trade-offs 和建议
|
|
33
|
+
4. **Present design** — 分节展示,每节获得用户批准
|
|
34
|
+
5. **Write design doc** — 保存到 `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
35
|
+
6. **Transition to implementation** — brainstorming 自动调用 writing-plans
|
|
36
|
+
|
|
37
|
+
**sprint-flow 编排层行为**:
|
|
38
|
+
- 收到 brainstorming APPROVED 设计文档后,自动进入 Phase 1
|
|
39
|
+
- 如果 brainstorming 未完成(用户未 APPROVED),BLOCK 并等待
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 执行步骤
|
|
44
|
+
|
|
45
|
+
### Step 1: 调用 brainstorming skill
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
skill(name="brainstorming", user_message="[需求描述]")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
brainstorming 内部流程:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Explore project context → Ask clarifying questions → Propose 2-3 approaches
|
|
55
|
+
→ Present design sections → User approves design? → YES → Write design doc
|
|
56
|
+
→ Invoke writing-plans skill
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**注意**: brainstorming 内部会自动调用 `writing-plans` 创建实现计划,该计划直接作为 Phase 1 的输入。
|
|
60
|
+
|
|
61
|
+
### Step 2: 等待 HARD-GATE APPROVED
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
⚠️ HARD-GATE: 设计未 APPROVED → 不可进入 Phase 1
|
|
65
|
+
|
|
66
|
+
等待用户审批 brainstorming 输出的设计文档。
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
sprint-flow 编排层检查:
|
|
70
|
+
- [ ] 设计文档已保存 (`docs/plans/YYYY-MM-DD-<topic>-design.md`)
|
|
71
|
+
- [ ] 用户已 APPROVED
|
|
72
|
+
- [ ] 无未解决的 blocking questions
|
|
73
|
+
|
|
74
|
+
如果任一条件不满足 → **BLOCK**,等待用户确认。
|
|
75
|
+
|
|
76
|
+
### Step 3: 保存设计文档路径
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
设计文档路径写入 sprint-state,供 Phase 1 使用。
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
保存到 `<project-root>/.sprint-state/phase-outputs/design-doc.md`(内容为设计文档路径引用,或直接复制设计文档)。
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 可选补充: office-hours(方向验证)
|
|
87
|
+
|
|
88
|
+
当用户输入非常模糊时(如 "我想做一个 AI 工具" 而不是 "开发用户登录功能"),可以先调用 `office-hours` 验证产品方向,再进入 brainstorming 详细设计:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
skill(name="office-hours", user_message="[模糊需求描述]")
|
|
92
|
+
// → Pain Document → 再进入 brainstorming 详细设计
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**使用场景**:
|
|
96
|
+
- 用户描述的是一个新产品/新功能方向,而非具体功能
|
|
97
|
+
- 需要先验证"是否值得做"再进入"怎么做"
|
|
98
|
+
|
|
99
|
+
**如果不满足以上条件**: 直接跳过 office-hours,只使用 brainstorming。
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 暂停点
|
|
104
|
+
|
|
105
|
+
| 暂停点 | 触发条件 | 用户操作 | 自动恢复条件 |
|
|
106
|
+
|--------|---------|---------|-------------|
|
|
107
|
+
| **HARD-GATE** | brainstorming 设计未 APPROVED | 用户审批设计文档 | 设计 APPROVED 后自动进入 Phase 1 |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 输出
|
|
112
|
+
|
|
113
|
+
- Design Document (`docs/plans/YYYY-MM-DD-<topic>-design.md`)
|
|
114
|
+
- Implementation Plan(brainstorming 内部 writing-plans 输出)
|
|
115
|
+
- 进入 Phase 1 自动执行(使用设计文档作为输入)
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Phase 1: PLAN(共识评审)
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
多模型评审,达成 APPROVED 共识。后续步骤自动从 APPROVED 设计文档提取 specification.yaml。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 调用 Skills
|
|
10
|
+
|
|
11
|
+
- `autoplan` (gstack) — CEO → Design → Eng 自动流水线
|
|
12
|
+
- `delphi-review` — 多轮匿名评审直到共识
|
|
13
|
+
- specification.yaml 从 APPROVED 设计文档自动生成(无需独立 skill)
|
|
14
|
+
|
|
15
|
+
**Web 前端项目额外注入**:
|
|
16
|
+
- `design-shotgun` (gstack) — 生成多版 UI 设计变体,用于探索不同的设计方案
|
|
17
|
+
|
|
18
|
+
**Mobile 项目额外注入** (`--type mobile-flutter` / `mobile-react-native`):
|
|
19
|
+
- `design-shotgun` (gstack) — 移动端 UI 设计探索(Web 项目相同,适用 Flutter Web / RN 项目)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 执行步骤
|
|
24
|
+
|
|
25
|
+
### Step 0: Web 前端项目 — 调用 design-shotgun(如适用)
|
|
26
|
+
|
|
27
|
+
**IF project_type is web-nextjs / web-react / web-vue / mobile-flutter / mobile-react-native:**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
skill(name="design-shotgun", user_message="[Pain Document 内容 + 需求描述]")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
design-shotgun 执行:
|
|
34
|
+
- 生成多个 AI 设计变体
|
|
35
|
+
- 打开比较板展示不同设计方案
|
|
36
|
+
- 收集结构化反馈并迭代
|
|
37
|
+
|
|
38
|
+
输出: 多个设计方案(用于 autoplan 的 plan-design-review)
|
|
39
|
+
|
|
40
|
+
**IF backend project:** 跳过此步骤,直接进入 Step 1。
|
|
41
|
+
|
|
42
|
+
### Step 1: 调用 autoplan skill
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
skill(name="autoplan", user_message="[Pain Document 内容]")
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
autoplan 自动执行:
|
|
49
|
+
- `plan-ceo-review` — CEO 视角评审
|
|
50
|
+
- `plan-design-review` — Design 视角评审
|
|
51
|
+
- `plan-eng-review` — Eng 视角评审
|
|
52
|
+
|
|
53
|
+
使用 6 个决策原则自动决策,输出:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
autoplan_result:
|
|
57
|
+
taste_decisions: [] | [decision1, decision2, ...]
|
|
58
|
+
verdict: "AUTO_APPROVED" | "NEEDS_REVIEW"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### Step 2: 条件分支(关键设计)
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
┌───────────────────────────────────────────────────────────────────┐
|
|
67
|
+
│ Phase 1: 条件分支逻辑 │
|
|
68
|
+
├───────────────────────────────────────────────────────────────────┤
|
|
69
|
+
│ │
|
|
70
|
+
│ IF autoplan_result.verdict == "AUTO_APPROVED" │
|
|
71
|
+
│ AND autoplan_result.taste_decisions == [] │
|
|
72
|
+
│ → 调用 lightweight delphi-review(2 专家、1 轮、2/2 APPROVED) │
|
|
73
|
+
│ → 场景: autoplan 所有决策自动通过,无关键分歧,但仍需共识门禁 │
|
|
74
|
+
│ │
|
|
75
|
+
│ IF autoplan_result.verdict == "NEEDS_REVIEW" │
|
|
76
|
+
│ OR autoplan_result.taste_decisions.length > 0 │
|
|
77
|
+
│ → ⚠️ 暂停等待用户确认 taste_decisions │
|
|
78
|
+
│ → 用户确认后,调用标准 delphi-review │
|
|
79
|
+
│ → 场景: 存在关键决策分歧或 autoplan 未完全自动通过 │
|
|
80
|
+
│ │
|
|
81
|
+
└───────────────────────────────────────────────────────────────────┘
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### Step 2a: 如果需要用户确认 taste_decisions
|
|
87
|
+
|
|
88
|
+
暂停并提示用户:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
⚠️ autoplan 发现以下关键决策无法自动决定,请确认:
|
|
92
|
+
|
|
93
|
+
Decision 1: [决策描述]
|
|
94
|
+
Option A: [选项A] - [优缺点]
|
|
95
|
+
Option B: [选项B] - [优缺点]
|
|
96
|
+
|
|
97
|
+
Decision 2: [决策描述]
|
|
98
|
+
Option A: [...]
|
|
99
|
+
Option B: [...]
|
|
100
|
+
|
|
101
|
+
请选择每个决策的选项,或提供您的观点。
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
用户确认后,继续 Step 2b。
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Step 2b: 调用 delphi-review(强制)
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
skill(name="delphi-review", user_message="[设计文档 + taste_decisions 确认结果]")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
delphi-review 执行:
|
|
115
|
+
- Round 1: 3 专家匿名独立评审
|
|
116
|
+
- Round 2+: 交换意见直到共识
|
|
117
|
+
- 输出: APPROVED / REQUEST_CHANGES
|
|
118
|
+
|
|
119
|
+
**如果 REQUEST_CHANGES**:
|
|
120
|
+
- ⚠️ 暂停等待用户修复
|
|
121
|
+
- 修复后重新评审(从 Round 2 起步)
|
|
122
|
+
- 直到 APPROVED
|
|
123
|
+
|
|
124
|
+
**如果 APPROVED**:
|
|
125
|
+
- 自动进入 Step 3
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### Step 3: 从 APPROVED 设计文档提取 specification.yaml
|
|
130
|
+
|
|
131
|
+
设计文档 APPROVED 后,自动提取需求 + AC 生成轻量 specification.yaml(无需独立 skill):
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
# 自动完成: 读取设计文档 → 提取 requirements → 生成 specification.yaml
|
|
135
|
+
# specification.yaml 用于 test-spec-alignment 验证
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
specification:
|
|
140
|
+
requirements:
|
|
141
|
+
- id: REQ-001
|
|
142
|
+
description: [需求描述]
|
|
143
|
+
priority: [critical/high/medium/low]
|
|
144
|
+
|
|
145
|
+
acceptance_criteria:
|
|
146
|
+
- id: AC-001
|
|
147
|
+
requirement: REQ-001
|
|
148
|
+
criteria: [验收标准]
|
|
149
|
+
test_type: [unit/integration/e2e]
|
|
150
|
+
|
|
151
|
+
design_decisions:
|
|
152
|
+
- id: DD-001
|
|
153
|
+
decision: [设计决策]
|
|
154
|
+
rationale: [理由]
|
|
155
|
+
alternatives_considered: [备选方案]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### Step 4: 保存 specification.yaml
|
|
161
|
+
|
|
162
|
+
保存到 `<project-root>/.sprint-state/phase-outputs/specification.yaml`
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 暂停点
|
|
167
|
+
|
|
168
|
+
| 暂停点 | 触发条件 | 用户操作 |
|
|
169
|
+
|--------|---------|---------|
|
|
170
|
+
| taste_decisions 确认 | autoplan 无法自动决策 | 用户确认每个决策 |
|
|
171
|
+
| delphi-review APPROVED | Round 结果 REQUEST_CHANGES | 用户修复并重新评审 |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 输出
|
|
176
|
+
|
|
177
|
+
- specification.yaml
|
|
178
|
+
- 进入 Phase 2 自动执行(除非 `--stop-at plan`)
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Phase 2: BUILD(TDD + 并行执行 + 盲评 + 验证)
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
TDD 执行,多 Agent 并行加速,盲评验证,Gate 1 验证通过。生成 MVP v1。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 调用 Skills
|
|
10
|
+
|
|
11
|
+
| 步骤 | Skill | 来源 | 说明 |
|
|
12
|
+
|------|-------|------|------|
|
|
13
|
+
| 0 | **`dispatching-parallel-agents`** _(新增)_ | superpowers | 检测可并行任务,并行分发独立子任务 |
|
|
14
|
+
| 0 | **`executing-plans`** _(新增)_ | superpowers | 在隔离 session 中执行计划,有 review checkpoint |
|
|
15
|
+
| 1 | `test-driven-development` | superpowers | RED → GREEN → REFACTOR 铁律 |
|
|
16
|
+
| 1.5 | `vercel-react-native-skills` | gstack | React Native 特定测试框架引用(如适用) |
|
|
17
|
+
| 2 | `freeze` | gstack | 锁定业务代码,盲评隔离 |
|
|
18
|
+
| 3 | `requesting-code-review` | superpowers | 独立 agent 盲评(隔离状态) |
|
|
19
|
+
| 4 | `unfreeze` | gstack | 解锁业务代码 |
|
|
20
|
+
| 5 | `verification-before-completion` | superpowers | 测试 + lint 证据优先 |
|
|
21
|
+
| 6 | 成本监控 | sprint-flow 编排层 | 超阈值 BLOCK + 用户决策 |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 执行步骤
|
|
26
|
+
|
|
27
|
+
### Step 0: 并行检测与任务分发(新增 — ISSUE29)
|
|
28
|
+
|
|
29
|
+
**检测可并行任务**:
|
|
30
|
+
从 specification.yaml 或 Phase 1 输出中提取独立任务。并行条件:
|
|
31
|
+
- 无共享状态依赖(不读写同一文件)
|
|
32
|
+
- 无文件冲突风险(不同模块/组件)
|
|
33
|
+
- 2+ 独立任务存在
|
|
34
|
+
|
|
35
|
+
**IF 检测到可并行任务 → dispatching-parallel-agents 模式**:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Phase 2:
|
|
39
|
+
├── task: [独立A] ──┐
|
|
40
|
+
├── task: [独立B] ──┼── dispatching-parallel-agents (并行)
|
|
41
|
+
├── task: [独立C] ──┘
|
|
42
|
+
└── merge → freeze → review → verification
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
每个独立任务调用:
|
|
46
|
+
```
|
|
47
|
+
skill(name="executing-plans", user_message="[计划内容] + review checkpoint")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**IF 无并行机会 → 串行模式**(保持现有行为):
|
|
51
|
+
```
|
|
52
|
+
Phase 2: test-driven-development → freeze → review → verification
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Step 1: TDD 执行(test-driven-development)
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
skill(name="test-driven-development", user_message="[需求描述],基于 specification.yaml")
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**TDD 铁律**:
|
|
62
|
+
1. 🔴 **RED**: 先写测试(根据 specification.yaml 的 acceptance_criteria)
|
|
63
|
+
2. 🟢 **GREEN**: 写最小实现代码让测试通过
|
|
64
|
+
3. 🔵 **REFACTOR**: 重构代码,保持测试通过
|
|
65
|
+
|
|
66
|
+
**语言特定 TDD**(通过 `--lang` 参数选择):
|
|
67
|
+
|
|
68
|
+
| 语言 | 调用的 TDD skill |
|
|
69
|
+
|------|-----------------|
|
|
70
|
+
| Spring Boot | `springboot-tdd` |
|
|
71
|
+
| Django | `django-tdd` |
|
|
72
|
+
| Go | `golang-testing` |
|
|
73
|
+
|
|
74
|
+
**输出**: tests + code
|
|
75
|
+
|
|
76
|
+
### Step 1.5: React Native 特定 TDD(如适用)
|
|
77
|
+
|
|
78
|
+
**移动端项目特定测试策略**:
|
|
79
|
+
|
|
80
|
+
对于 mobile-react-native 项目:
|
|
81
|
+
- 检测 `--type mobile-react-native` 或 `package.json` 中包含 react-native 依赖
|
|
82
|
+
- 使用 Jest 进行单元测试 (RN 默认)
|
|
83
|
+
- 使用 Detox 进行端到端测试
|
|
84
|
+
- 使用 React Native Testing Library 进行组件测试
|
|
85
|
+
- TDD 流程: 先写组件测试 → 极简组件实现 → 通过测试 → 重构
|
|
86
|
+
|
|
87
|
+
配置文件:
|
|
88
|
+
- `jest.config.js` 用于测试环境设置
|
|
89
|
+
- `.detoxrc.js` 包含 Detox 配置
|
|
90
|
+
- iOS/Android 模拟器/真机测试支持
|
|
91
|
+
|
|
92
|
+
**执行顺序**:
|
|
93
|
+
- `npx jest` 运行单元测试
|
|
94
|
+
- `npx detox build && npx detox test` 运行 E2E 测试
|
|
95
|
+
- `npx jest --coverage` 检查测试覆盖率
|
|
96
|
+
|
|
97
|
+
**Flutter 项目**(作为补充):
|
|
98
|
+
- 对于 mobile-flutter 项目: `flutter test --coverage` 运行单元和 widget 测试
|
|
99
|
+
|
|
100
|
+
### Step 2: 盲评隔离(freeze)
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
skill(name="freeze", user_message="[业务代码文件路径]")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
锁定所有业务代码文件,排除测试文件。
|
|
107
|
+
Navigator agent 在盲评阶段将无法访问业务代码。
|
|
108
|
+
|
|
109
|
+
### Step 3: 独立盲评(requesting-code-review)
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
skill(name="requesting-code-review", user_message="[需求] + 测试文件 + 测试结果")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**关键**: 盲评 agent 只接收需求 + 测试 + 测试结果,**不传业务代码**(freeze 锁定中)。
|
|
116
|
+
|
|
117
|
+
**输出**: review findings(问题清单 + 建议)
|
|
118
|
+
|
|
119
|
+
### Step 4: 解锁业务代码(unfreeze)
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
skill(name="unfreeze", user_message="[业务代码文件路径]")
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
解锁业务代码文件,允许后续步骤访问。
|
|
126
|
+
|
|
127
|
+
### Step 5: 验证(verification-before-completion)
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
skill(name="verification-before-completion", user_message="验证实现完整性")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**验证内容**:
|
|
134
|
+
- 测试全部通过
|
|
135
|
+
- Lint 无错误
|
|
136
|
+
- 覆盖率 ≥ 80%
|
|
137
|
+
- 证据优先:必须运行命令并确认输出
|
|
138
|
+
|
|
139
|
+
**失败处理**:
|
|
140
|
+
- 自动修复 max 3 次
|
|
141
|
+
- 每次失败后修复代码,重新运行验证
|
|
142
|
+
- max 3 次失败 → ⚠️ BLOCK,暂停等待用户决定
|
|
143
|
+
|
|
144
|
+
### Step 6: 成本监控(sprint-flow 编排层)
|
|
145
|
+
|
|
146
|
+
sprint-flow 编排层监控本次 Phase 2 的成本:
|
|
147
|
+
|
|
148
|
+
| 阈值 | 值 | 处理 |
|
|
149
|
+
|------|-----|------|
|
|
150
|
+
| 单任务阈值 | $0.15 | BLOCK + 提示用户决定 |
|
|
151
|
+
| 日阈值 | $1.00 | BLOCK + 提示用户决定 |
|
|
152
|
+
|
|
153
|
+
**零降级原则**: 成本超阈值时,必须 BLOCK 并通知用户,由用户决定是否继续。AI 不能自动跳过验证步骤。
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 关键行为保留(原 xp-consensus 17 状态机)
|
|
158
|
+
|
|
159
|
+
| 原状态 | 含义 | 新处理方案 |
|
|
160
|
+
|--------|------|-----------|
|
|
161
|
+
| `CIRCUIT_BREAKER_TRIGGERED` | 成本/资源超阈值 | sprint-flow 编排层监控成本,超阈值 BLOCK + 用户决策 |
|
|
162
|
+
| `ROLLBACK_TO_ROUND1` | Gate 1 失败自动修复 → 回退 | verification-before-completion 失败 → 修复 max 3 次 → 仍失败 BLOCK |
|
|
163
|
+
| `GATE1_FAILED`/`GATE1_COMPLETE` | 区分可修复 vs 致命失败 | verification-before-completion 内置此区分 |
|
|
164
|
+
| `GATE2_RUNNING` | Security Scan 集成 | `cso` (gstack) Phase 1-6 安全审计替代 |
|
|
165
|
+
| `SEALED_CODE_ISOLATION` | freeze 技术隔离 | **保留 freeze skill 调用** |
|
|
166
|
+
| `MOBILE_TDD_EXECUTION` | React Native/Flutter 特定 TDD 执行 | 根据 `--type` 参数选择: mobile-react-native → RN TDD, mobile-flutter → Flutter TDD |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Skill 间数据流契约
|
|
171
|
+
|
|
172
|
+
| 步骤 | Skill | 输入 | 输出 | 失败回退 |
|
|
173
|
+
|------|-------|------|------|----------|
|
|
174
|
+
| 0a | dispatching-parallel-agents | specification.yaml + 任务分解 | 并行子任务分发 | 降级为串行 |
|
|
175
|
+
| 0b | executing-plans | 子任务计划 | 实现 + review checkpoint | BLOCK |
|
|
176
|
+
| 1 | test-driven-development | 需求描述 + 现有代码上下文 | 测试 + 代码 (RED→GREEN→REFACTOR) | 修复 max 3 次 → BLOCK |
|
|
177
|
+
| 1.5 | vercel-react-native-skills | 项目类型 (mobile-react-native 或 mobile-flutter), package.json | RN/Flutter 测试执行结果 | RN/Flutter 测试失败 → 修复 max 3 次 → BLOCK |
|
|
178
|
+
| 2 | freeze | 业务代码文件路径 | 锁定状态确认 | ❌ BLOCK |
|
|
179
|
+
| 3 | requesting-code-review | 需求 + 测试 + 测试结果(**不传业务代码**) | review findings | 继续(记录 findings) |
|
|
180
|
+
| 4 | unfreeze | 业务代码文件路径 | 解锁状态确认 | ❌ BLOCK |
|
|
181
|
+
| 5 | verification-before-completion | 测试执行结果 | pass/fail 证据 | 修复 max 3 次 → BLOCK |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 暂停点
|
|
186
|
+
|
|
187
|
+
| 暂停点 | 触发条件 | 用户操作 |
|
|
188
|
+
|--------|---------|---------|
|
|
189
|
+
| 验证 max 3 失败 | verification-before-completion 失败超过 3 次 | 用户决定修复或放弃 |
|
|
190
|
+
| 成本超阈值 | 单任务 >$0.15 或日 >$1.00 | 用户决定继续或暂停 |
|
|
191
|
+
| RN/Flutter 测试失败 | mobile-react-native 或 mobile-flutter 项目的测试执行失败且自动修复 max 3 次后仍未通过 | 用户决定继续修复或调整方案 |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 输出
|
|
196
|
+
|
|
197
|
+
- MVP v1 (`mvp-v1/` 目录)
|
|
198
|
+
- 进入 Phase 3 自动执行
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Phase 3: REVIEW + TEST(验证)
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
多专家代码走查、测试对齐、浏览器测试。确保 MVP 符合 specification。
|
|
6
|
+
|
|
7
|
+
Web 前端项目额外增加:系统化 QA、视觉审计、性能基线。
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 调用 Skills
|
|
12
|
+
|
|
13
|
+
**所有项目**:
|
|
14
|
+
- `delphi-review --mode code-walkthrough` — 多专家匿名代码走查(2-3 domestic models, >=95% consensus)
|
|
15
|
+
- `test-specification-alignment` — 测试与 Spec 对齐验证
|
|
16
|
+
- `browse` (gstack) — 浏览器自动化测试
|
|
17
|
+
|
|
18
|
+
**Web 前端项目额外注入** (`--type web-nextjs` / `web-react` / `web-vue`):
|
|
19
|
+
- `qa` (gstack) — 三层 QA(Quick/Standard/Exhaustive)系统化测试
|
|
20
|
+
- `design-review` (gstack) — 线上 UI 视觉审计(间距、层级、AI slop 检测)
|
|
21
|
+
- `benchmark` (gstack) — Core Web Vitals 性能基线
|
|
22
|
+
|
|
23
|
+
**Mobile 项目额外注入** (`--type mobile-flutter` / `mobile-react-native`):
|
|
24
|
+
- `flutter-test` — Flutter 单元测试 + widget 测试 (Flutter only)
|
|
25
|
+
- Detox E2E — React Native 端到端测试 (RN only)
|
|
26
|
+
- `flutter-review` (user) — Flutter 代码审查 (Flutter only)
|
|
27
|
+
|
|
28
|
+
**Backend 项目额外注入** (`--type backend-go` / `backend-springboot` / `backend-django`):
|
|
29
|
+
- API Testing — 后端 API 自动化测试
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 执行步骤
|
|
34
|
+
|
|
35
|
+
### Step 1: 调用 delphi-review --mode code-walkthrough
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
skill(name="delphi-review", user_message="--mode code-walkthrough")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
delphi code-walkthrough 执行:
|
|
42
|
+
- 2-3 位国内模型专家匿名独立评审(DeepSeek-v4-pro + Kimi-K2.6 + Qwen3.6-Plus)
|
|
43
|
+
- Round 1: 匿名独立评审(防止 anchoring bias)
|
|
44
|
+
- Round 2: 交换意见,响应关切
|
|
45
|
+
- Round 3: 最终立场(如需)
|
|
46
|
+
- >=95% 共识 + APPROVED 才通过
|
|
47
|
+
|
|
48
|
+
**如果 REQUEST_CHANGES**:
|
|
49
|
+
- ⚠️ 暂停等待用户修复 Critical Issues + 处理 Major Concerns
|
|
50
|
+
- 修复后回到 Round 2 重新评审
|
|
51
|
+
|
|
52
|
+
**如果 APPROVED**:
|
|
53
|
+
- 写入 `.code-walkthrough-result.json`(1 小时有效期)
|
|
54
|
+
- 进入 Step 2
|
|
55
|
+
|
|
56
|
+
### Step 2: 调用 test-specification-alignment
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
skill(name="test-specification-alignment", user_message="--spec specification.yaml --tests mvp-v1/tests")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Phase 1: 验证对齐(可修改测试) → Phase 2: 执行测试(禁止修改测试)
|
|
63
|
+
|
|
64
|
+
失败 → 回退 Phase 2 自动修复。通过 → 进入 Step 3。
|
|
65
|
+
|
|
66
|
+
### Step 2.5: Web 前端 — 调用 qa(如适用)
|
|
67
|
+
|
|
68
|
+
**IF project_type is web-nextjs / web-react / web-vue:**
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
skill(name="qa", user_message="Standard: [部署 URL 或 localhost:3000]")
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
qa 三层可选:
|
|
75
|
+
- Quick: 只测 critical + high 问题
|
|
76
|
+
- Standard (推荐): critical + high + medium
|
|
77
|
+
- Exhaustive: 包括 cosmetic
|
|
78
|
+
|
|
79
|
+
输出: before/after health scores + fix evidence + ship-readiness summary
|
|
80
|
+
|
|
81
|
+
### Step 2.6: Web 前端 — 调用 design-review(如适用)
|
|
82
|
+
|
|
83
|
+
**IF project_type is web-nextjs / web-react / web-vue:**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
skill(name="design-review", user_message="审计 [部署 URL] 的视觉设计")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
design-review 检查:
|
|
90
|
+
- 视觉一致性(间距、颜色、字体)
|
|
91
|
+
- 层级问题(信息架构、布局)
|
|
92
|
+
- AI slop 模式(重复布局、过度设计)
|
|
93
|
+
- 交互响应(动画、加载状态)
|
|
94
|
+
|
|
95
|
+
迭代修复,每次提交原子化。
|
|
96
|
+
|
|
97
|
+
### Step 2.7: Web 前端 — 调用 benchmark(如适用)
|
|
98
|
+
|
|
99
|
+
**IF project_type is web-nextjs / web-react / web-vue:**
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
skill(name="benchmark", user_message="建立 [部署 URL] 的性能基线")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
benchmark 测量:
|
|
106
|
+
- 页面加载时间
|
|
107
|
+
- Core Web Vitals (LCP, FID, CLS)
|
|
108
|
+
- 资源大小
|
|
109
|
+
- 与上次部署对比
|
|
110
|
+
|
|
111
|
+
### Step 2.8: Mobile — Flutter 测试(如适用)
|
|
112
|
+
|
|
113
|
+
**IF project_type is mobile-flutter:**
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
flutter test --coverage 2>&1 | tail -20
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
flutter-test 输出:
|
|
120
|
+
- 测试通过率
|
|
121
|
+
- 覆盖率统计
|
|
122
|
+
- Widget 测试结果
|
|
123
|
+
|
|
124
|
+
### Step 2.9: Mobile — React Native 测试(如适用)
|
|
125
|
+
|
|
126
|
+
**IF project_type is mobile-react-native:**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npx detox test 2>&1 | tail -20
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
RN E2E 输出:
|
|
133
|
+
- Detox 测试结果
|
|
134
|
+
- 模拟器/真机行为验证
|
|
135
|
+
|
|
136
|
+
### Step 2.10: API 自动化测试(后端项目如适用)
|
|
137
|
+
|
|
138
|
+
**IF project_type is backend-go/backend-springboot/backend-django:**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
skill(name="api-test", user_message="针对 [API endpoint] 运行自动化测试")
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Backend 类型支持**:
|
|
145
|
+
- **Go (backend-go)**: 使用 httpbakery 或原生 net/http 测试
|
|
146
|
+
- **Spring Boot (backend-springboot)**: 使用 RestAssured 或 TestRestTemplate
|
|
147
|
+
- **Django (backend-django)**: 使用 Django REST framework 测试客户端或 pytest-django
|
|
148
|
+
|
|
149
|
+
**API 测试覆盖**:
|
|
150
|
+
- 所有 API 端点测试 (GET, POST, PUT, DELETE)
|
|
151
|
+
- 响应状态码验证
|
|
152
|
+
- 响应数据结构验证(符合 Spec)
|
|
153
|
+
- 认证端点测试
|
|
154
|
+
- 错误处理测试 (400, 401, 403, 404, 500)
|
|
155
|
+
|
|
156
|
+
API 测试失败 → 自动回退 Phase 2 修复。
|
|
157
|
+
|
|
158
|
+
### Step 3: 调用 browse skill
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
skill(name="browse", user_message="--url [URL] --test-ui")
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**默认**: `localhost:3000`
|
|
165
|
+
|
|
166
|
+
**Web 前端扩展支持**:
|
|
167
|
+
- 部署环境 URL 测试(如 Vercel/Render/Netlify)
|
|
168
|
+
- 响应式布局测试(mobile/tablet/desktop)
|
|
169
|
+
- 表单交互测试(提交、验证)
|
|
170
|
+
- 认证页面测试(login/register)
|
|
171
|
+
|
|
172
|
+
browse 执行:
|
|
173
|
+
- 启动 Chromium
|
|
174
|
+
- 测试 UI/UX
|
|
175
|
+
- 截图验证
|
|
176
|
+
|
|
177
|
+
发现问题 → 回退 Phase 2 修复。通过 → 进入 Step 4。
|
|
178
|
+
|
|
179
|
+
### Step 4: 保存 Review Report
|
|
180
|
+
|
|
181
|
+
保存到 `<project-root>/.sprint-state/phase-outputs/review-report.md`
|
|
182
|
+
|
|
183
|
+
包含:
|
|
184
|
+
- delphi code-walkthrough result
|
|
185
|
+
- test-specification-alignment result
|
|
186
|
+
- qa report (web only)
|
|
187
|
+
- design-review report (web only)
|
|
188
|
+
- benchmark baseline (web only)
|
|
189
|
+
- browse screenshots
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 暂停点
|
|
194
|
+
|
|
195
|
+
| 暂停点 | 触发条件 | 用户操作 |
|
|
196
|
+
|--------|---------|---------|
|
|
197
|
+
| delphi code-walkthrough REQUEST_CHANGES | Critical Issues 未修复 | 用户修复 → 重新评审 → APPROVED → 继续 |
|
|
198
|
+
| test-alignment 失败 | 自动回退 Phase 2(不暂停) | 自动迭代 |
|
|
199
|
+
| qa 发现问题 (web) | 自动回退修复(不暂停) | 自动迭代 |
|
|
200
|
+
| design-review 发现问题 (web) | 自动回退修复(不暂停) | 自动迭代 |
|
|
201
|
+
| api-test 失败 (backend) | 自动回退 Phase 2(不暂停) | 自动迭代 |
|
|
202
|
+
| browse 发现问题 | 自动回退 Phase 2(不暂停) | 自动迭代 |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 输出
|
|
207
|
+
|
|
208
|
+
- `.code-walkthrough-result.json`(pre-push hook 验证)
|
|
209
|
+
- Review Report (`review-report.md`)
|
|
210
|
+
- Web 前端附加: QA report + design-review report + benchmark baseline
|
|
211
|
+
- Backend 附加: API test report
|
|
212
|
+
- 验证通过的 MVP
|
|
213
|
+
- 进入 Phase 4 ⚠️ **必须人工验收**
|