specops 0.2.4 → 0.3.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/.opencode/agent/specops-codebase-mapper.md +764 -0
- package/.opencode/agent/specops-debugger.md +1246 -0
- package/.opencode/agent/specops-executor.md +469 -0
- package/.opencode/agent/specops-integration-checker.md +443 -0
- package/.opencode/agent/specops-phase-researcher.md +547 -0
- package/.opencode/agent/specops-plan-checker.md +690 -0
- package/.opencode/agent/specops-planner.md +575 -0
- package/.opencode/agent/specops-project-researcher.md +354 -0
- package/.opencode/agent/specops-research-synthesizer.md +239 -0
- package/.opencode/agent/specops-roadmapper.md +642 -0
- package/.opencode/agent/specops-work-verifier.md +573 -0
- package/.opencode/references/checkpoints.md +776 -0
- package/.opencode/references/continuation-format.md +249 -0
- package/.opencode/references/decimal-phase-calculation.md +65 -0
- package/.opencode/references/git-integration.md +248 -0
- package/.opencode/references/git-planning-commit.md +38 -0
- package/.opencode/references/model-profile-resolution.md +34 -0
- package/.opencode/references/model-profiles.md +92 -0
- package/.opencode/references/phase-argument-parsing.md +61 -0
- package/.opencode/references/planning-config.md +196 -0
- package/.opencode/references/questioning.md +145 -0
- package/.opencode/references/tdd.md +263 -0
- package/.opencode/references/ui-brand.md +160 -0
- package/.opencode/references/verification-patterns.md +612 -0
- package/.opencode/skills/demand-analysis/SKILL.md +142 -10
- package/.opencode/templates/DEBUG.md +164 -0
- package/.opencode/templates/UAT.md +180 -0
- package/.opencode/templates/VALIDATION.md +76 -0
- package/.opencode/templates/codebase/architecture.md +255 -0
- package/.opencode/templates/codebase/concerns.md +310 -0
- package/.opencode/templates/codebase/conventions.md +307 -0
- package/.opencode/templates/codebase/integrations.md +280 -0
- package/.opencode/templates/codebase/stack.md +186 -0
- package/.opencode/templates/codebase/structure.md +285 -0
- package/.opencode/templates/codebase/testing.md +480 -0
- package/.opencode/templates/context.md +221 -0
- package/.opencode/templates/continue-here.md +78 -0
- package/.opencode/templates/debug-subagent-prompt.md +91 -0
- package/.opencode/templates/discovery.md +147 -0
- package/.opencode/templates/milestone-archive.md +123 -0
- package/.opencode/templates/milestone.md +115 -0
- package/.opencode/templates/phase-prompt.md +333 -0
- package/.opencode/templates/planner-subagent-prompt.md +117 -0
- package/.opencode/templates/project.md +184 -0
- package/.opencode/templates/requirements.md +130 -0
- package/.opencode/templates/research-project/ARCHITECTURE.md +204 -0
- package/.opencode/templates/research-project/FEATURES.md +147 -0
- package/.opencode/templates/research-project/PITFALLS.md +200 -0
- package/.opencode/templates/research-project/STACK.md +120 -0
- package/.opencode/templates/research-project/SUMMARY.md +170 -0
- package/.opencode/templates/research.md +278 -0
- package/.opencode/templates/retrospective.md +54 -0
- package/.opencode/templates/roadmap.md +202 -0
- package/.opencode/templates/state.md +176 -0
- package/.opencode/templates/summary-complex.md +59 -0
- package/.opencode/templates/summary-minimal.md +41 -0
- package/.opencode/templates/summary-standard.md +48 -0
- package/.opencode/templates/summary.md +248 -0
- package/.opencode/templates/user-setup.md +311 -0
- package/.opencode/templates/verification-report.md +322 -0
- package/.opencode/workflows/add-phase.md +111 -0
- package/.opencode/workflows/add-tests.md +350 -0
- package/.opencode/workflows/add-todo.md +157 -0
- package/.opencode/workflows/audit-milestone.md +297 -0
- package/.opencode/workflows/check-todos.md +176 -0
- package/.opencode/workflows/cleanup.md +152 -0
- package/.opencode/workflows/complete-milestone.md +763 -0
- package/.opencode/workflows/diagnose-issues.md +219 -0
- package/.opencode/workflows/discovery-phase.md +288 -0
- package/.opencode/workflows/discuss-phase.md +542 -0
- package/.opencode/workflows/execute-phase.md +449 -0
- package/.opencode/workflows/execute-plan.md +447 -0
- package/.opencode/workflows/health.md +156 -0
- package/.opencode/workflows/help.md +489 -0
- package/.opencode/workflows/insert-phase.md +129 -0
- package/.opencode/workflows/list-phase-assumptions.md +178 -0
- package/.opencode/workflows/map-codebase.md +315 -0
- package/.opencode/workflows/new-milestone.md +382 -0
- package/.opencode/workflows/new-project.md +1116 -0
- package/.opencode/workflows/pause-work.md +122 -0
- package/.opencode/workflows/plan-milestone-gaps.md +274 -0
- package/.opencode/workflows/plan-phase.md +569 -0
- package/.opencode/workflows/progress.md +381 -0
- package/.opencode/workflows/quick.md +453 -0
- package/.opencode/workflows/remove-phase.md +154 -0
- package/.opencode/workflows/research-phase.md +73 -0
- package/.opencode/workflows/resume-project.md +304 -0
- package/.opencode/workflows/set-profile.md +80 -0
- package/.opencode/workflows/settings.md +213 -0
- package/.opencode/workflows/transition.md +544 -0
- package/.opencode/workflows/update.md +219 -0
- package/.opencode/workflows/verify-phase.md +242 -0
- package/.opencode/workflows/verify-work.md +569 -0
- package/commands/specops/add-phase.md +43 -0
- package/commands/specops/add-tests.md +41 -0
- package/commands/specops/add-todo.md +47 -0
- package/commands/specops/audit-milestone.md +36 -0
- package/commands/specops/check-todos.md +45 -0
- package/commands/specops/cleanup.md +18 -0
- package/commands/specops/complete-milestone.md +136 -0
- package/commands/specops/debug.md +167 -0
- package/commands/specops/discuss-phase.md +83 -0
- package/commands/specops/execute-phase.md +41 -0
- package/commands/specops/health.md +22 -0
- package/commands/specops/help.md +22 -0
- package/commands/specops/insert-phase.md +32 -0
- package/commands/specops/join-discord.md +18 -0
- package/commands/specops/list-phase-assumptions.md +46 -0
- package/commands/specops/map-codebase.md +71 -0
- package/commands/specops/new-milestone.md +44 -0
- package/commands/specops/new-project.md +42 -0
- package/commands/specops/pause-work.md +38 -0
- package/commands/specops/plan-milestone-gaps.md +34 -0
- package/commands/specops/plan-phase.md +45 -0
- package/commands/specops/progress.md +24 -0
- package/commands/specops/quick.md +41 -0
- package/commands/specops/reapply-patches.md +111 -0
- package/commands/specops/remove-phase.md +31 -0
- package/commands/specops/research-phase.md +189 -0
- package/commands/specops/resume-work.md +40 -0
- package/commands/specops/set-profile.md +34 -0
- package/commands/specops/settings.md +36 -0
- package/commands/specops/update.md +37 -0
- package/commands/specops/verify-work.md +38 -0
- package/dist/__e2e__/01-state-engine.e2e.test.js +1 -1
- package/dist/acceptance/lazyDetector.js +1 -1
- package/dist/acceptance/lazyDetector.test.js +1 -1
- package/dist/acceptance/reporter.js +1 -1
- package/dist/acceptance/reporter.test.js +1 -1
- package/dist/acceptance/runner.js +1 -1
- package/dist/acceptance/runner.test.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/promptTemplate.js +1 -1
- package/dist/context/promptTemplate.test.js +1 -1
- package/dist/context/techContextLoader.js +1 -1
- package/dist/context/techContextLoader.test.js +1 -1
- package/dist/engine.js +1 -1
- package/dist/evolution/distiller.js +1 -1
- package/dist/evolution/index.js +1 -1
- package/dist/evolution/memoryGraph.js +1 -1
- package/dist/evolution/selector.js +1 -1
- package/dist/evolution/signals.js +1 -1
- package/dist/evolution/solidify.js +1 -1
- package/dist/evolution/store.js +1 -1
- package/dist/evolution/types.js +1 -1
- package/dist/init.d.ts +4 -3
- package/dist/init.js +1 -1
- package/dist/machines/agentMachine.js +1 -1
- package/dist/machines/agentMachine.test.js +1 -1
- package/dist/machines/supervisorMachine.js +1 -1
- package/dist/machines/supervisorMachine.test.js +1 -1
- package/dist/persistence/schema.js +1 -1
- package/dist/persistence/stateFile.js +1 -1
- package/dist/persistence/stateFile.test.js +1 -1
- package/dist/plugin-engine.js +1 -1
- package/dist/plugin.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/id.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
通过对话式测试验证已构建的功能,带有持久化状态。创建 UAT.md 跟踪测试进度,在 /clear 后仍然有效,并将缺口反馈到 /specops:plan-phase --gaps。
|
|
3
|
+
|
|
4
|
+
用户测试,Claude 记录。一次一个测试。纯文本响应。
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<philosophy>
|
|
8
|
+
**展示预期,询问现实是否匹配。**
|
|
9
|
+
|
|
10
|
+
Claude 展示应该发生什么。用户确认或描述不同之处。
|
|
11
|
+
- "yes" / "y" / "next" / 空 → 通过
|
|
12
|
+
- 其他任何内容 → 记录为问题,推断严重程度
|
|
13
|
+
|
|
14
|
+
没有通过/失败按钮。没有严重程度问题。只是:"这是应该发生的。是这样吗?"
|
|
15
|
+
</philosophy>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
@.opencode/templates/UAT.md
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<process>
|
|
22
|
+
|
|
23
|
+
<step name="initialize" priority="first">
|
|
24
|
+
如果 $ARGUMENTS 包含阶段编号,加载上下文:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
INIT=$(node .opencode/bin/specops-tools.cjs init verify-work "${PHASE_ARG}")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
解析 JSON 获取:`planner_model`、`checker_model`、`commit_docs`、`phase_found`、`phase_dir`、`phase_number`、`phase_name`、`has_verification`。
|
|
31
|
+
</step>
|
|
32
|
+
|
|
33
|
+
<step name="check_active_session">
|
|
34
|
+
**首先:检查活跃的 UAT 会话**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
find .planning/phases -name "*-UAT.md" -type f 2>/dev/null | head -5
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**如果存在活跃会话且未提供 $ARGUMENTS:**
|
|
41
|
+
|
|
42
|
+
读取每个文件的前置信息(status、phase)和 Current Test 部分。
|
|
43
|
+
|
|
44
|
+
内联显示:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
## 活跃的 UAT 会话
|
|
48
|
+
|
|
49
|
+
| # | 阶段 | 状态 | 当前测试 | 进度 |
|
|
50
|
+
|---|------|------|----------|------|
|
|
51
|
+
| 1 | 04-comments | testing | 3. Reply to Comment | 2/6 |
|
|
52
|
+
| 2 | 05-auth | testing | 1. Login Form | 0/4 |
|
|
53
|
+
|
|
54
|
+
回复编号以恢复,或提供阶段编号开始新会话。
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
等待用户响应。
|
|
58
|
+
|
|
59
|
+
- 如果用户回复编号(1、2)→ 加载该文件,转到 `resume_from_file`
|
|
60
|
+
- 如果用户回复阶段编号 → 视为新会话,转到 `create_uat_file`
|
|
61
|
+
|
|
62
|
+
**如果存在活跃会话且提供了 $ARGUMENTS:**
|
|
63
|
+
|
|
64
|
+
检查该阶段是否已有会话。如果有,提供恢复或重新开始的选项。
|
|
65
|
+
如果没有,继续到 `create_uat_file`。
|
|
66
|
+
|
|
67
|
+
**如果没有活跃会话且未提供 $ARGUMENTS:**
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
没有活跃的 UAT 会话。
|
|
71
|
+
|
|
72
|
+
提供阶段编号开始测试(例如 /specops:verify-work 4)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**如果没有活跃会话且提供了 $ARGUMENTS:**
|
|
76
|
+
|
|
77
|
+
继续到 `create_uat_file`。
|
|
78
|
+
</step>
|
|
79
|
+
|
|
80
|
+
<step name="find_summaries">
|
|
81
|
+
**查找要测试的内容:**
|
|
82
|
+
|
|
83
|
+
使用 init 返回的 `phase_dir`(如果尚未运行 init 则运行)。
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
ls "$phase_dir"/*-SUMMARY.md 2>/dev/null
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
读取每个 SUMMARY.md 以提取可测试的交付物。
|
|
90
|
+
</step>
|
|
91
|
+
|
|
92
|
+
<step name="extract_tests">
|
|
93
|
+
**从 SUMMARY.md 提取可测试的交付物:**
|
|
94
|
+
|
|
95
|
+
解析以下内容:
|
|
96
|
+
1. **成果** - 添加的功能/特性
|
|
97
|
+
2. **面向用户的变更** - UI、工作流、交互
|
|
98
|
+
|
|
99
|
+
聚焦于用户可观察的结果,而不是实现细节。
|
|
100
|
+
|
|
101
|
+
对于每个交付物,创建一个测试:
|
|
102
|
+
- name:简短的测试名称
|
|
103
|
+
- expected:用户应该看到/体验到什么(具体、可观察)
|
|
104
|
+
|
|
105
|
+
示例:
|
|
106
|
+
- 成果:"添加了无限嵌套的评论线程"
|
|
107
|
+
→ 测试:"回复评论"
|
|
108
|
+
→ 预期:"点击回复在评论下方打开内联编辑器。提交后显示回复嵌套在父评论下方,带有视觉缩进。"
|
|
109
|
+
|
|
110
|
+
跳过内部/不可观察的项目(重构、类型变更等)。
|
|
111
|
+
</step>
|
|
112
|
+
|
|
113
|
+
<step name="create_uat_file">
|
|
114
|
+
**创建包含所有测试的 UAT 文件:**
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
mkdir -p "$PHASE_DIR"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
从提取的交付物构建测试列表。
|
|
121
|
+
|
|
122
|
+
创建文件:
|
|
123
|
+
|
|
124
|
+
```markdown
|
|
125
|
+
---
|
|
126
|
+
status: testing
|
|
127
|
+
phase: XX-name
|
|
128
|
+
source: [SUMMARY.md 文件列表]
|
|
129
|
+
started: [ISO 时间戳]
|
|
130
|
+
updated: [ISO 时间戳]
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Current Test
|
|
134
|
+
<!-- 每个测试覆盖写入 - 显示当前位置 -->
|
|
135
|
+
|
|
136
|
+
number: 1
|
|
137
|
+
name: [第一个测试名称]
|
|
138
|
+
expected: |
|
|
139
|
+
[用户应观察到的内容]
|
|
140
|
+
awaiting: user response
|
|
141
|
+
|
|
142
|
+
## Tests
|
|
143
|
+
|
|
144
|
+
### 1. [测试名称]
|
|
145
|
+
expected: [可观察的行为]
|
|
146
|
+
result: [pending]
|
|
147
|
+
|
|
148
|
+
### 2. [测试名称]
|
|
149
|
+
expected: [可观察的行为]
|
|
150
|
+
result: [pending]
|
|
151
|
+
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
## Summary
|
|
155
|
+
|
|
156
|
+
total: [N]
|
|
157
|
+
passed: 0
|
|
158
|
+
issues: 0
|
|
159
|
+
pending: [N]
|
|
160
|
+
skipped: 0
|
|
161
|
+
|
|
162
|
+
## Gaps
|
|
163
|
+
|
|
164
|
+
[暂无]
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
写入 `.planning/phases/XX-name/{phase_num}-UAT.md`
|
|
168
|
+
|
|
169
|
+
继续到 `present_test`。
|
|
170
|
+
</step>
|
|
171
|
+
|
|
172
|
+
<step name="present_test">
|
|
173
|
+
**向用户展示当前测试:**
|
|
174
|
+
|
|
175
|
+
从 UAT 文件读取 Current Test 部分。
|
|
176
|
+
|
|
177
|
+
使用检查点框格式显示:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
181
|
+
║ CHECKPOINT: 需要验证 ║
|
|
182
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
183
|
+
|
|
184
|
+
**测试 {number}: {name}**
|
|
185
|
+
|
|
186
|
+
{expected}
|
|
187
|
+
|
|
188
|
+
──────────────────────────────────────────────────────────────
|
|
189
|
+
→ 输入"pass"或描述问题
|
|
190
|
+
──────────────────────────────────────────────────────────────
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
等待用户响应(纯文本,不使用 AskUserQuestion)。
|
|
194
|
+
</step>
|
|
195
|
+
|
|
196
|
+
<step name="process_response">
|
|
197
|
+
**处理用户响应并更新文件:**
|
|
198
|
+
|
|
199
|
+
**如果响应表示通过:**
|
|
200
|
+
- 空响应、"yes"、"y"、"ok"、"pass"、"next"、"approved"、"✓"
|
|
201
|
+
|
|
202
|
+
更新 Tests 部分:
|
|
203
|
+
```
|
|
204
|
+
### {N}. {name}
|
|
205
|
+
expected: {expected}
|
|
206
|
+
result: pass
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**如果响应表示跳过:**
|
|
210
|
+
- "skip"、"can't test"、"n/a"
|
|
211
|
+
|
|
212
|
+
更新 Tests 部分:
|
|
213
|
+
```
|
|
214
|
+
### {N}. {name}
|
|
215
|
+
expected: {expected}
|
|
216
|
+
result: skipped
|
|
217
|
+
reason: [用户的原因(如提供)]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**如果响应是其他任何内容:**
|
|
221
|
+
- 视为问题描述
|
|
222
|
+
|
|
223
|
+
从描述推断严重程度:
|
|
224
|
+
- 包含:crash、error、exception、fails、broken、unusable → blocker
|
|
225
|
+
- 包含:doesn't work、wrong、missing、can't → major
|
|
226
|
+
- 包含:slow、weird、off、minor、small → minor
|
|
227
|
+
- 包含:color、font、spacing、alignment、visual → cosmetic
|
|
228
|
+
- 不确定时默认:major
|
|
229
|
+
|
|
230
|
+
更新 Tests 部分:
|
|
231
|
+
```
|
|
232
|
+
### {N}. {name}
|
|
233
|
+
expected: {expected}
|
|
234
|
+
result: issue
|
|
235
|
+
reported: "{用户响应原文}"
|
|
236
|
+
severity: {推断的}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
追加到 Gaps 部分(结构化 YAML 供 plan-phase --gaps 使用):
|
|
240
|
+
```yaml
|
|
241
|
+
- truth: "{测试中的预期行为}"
|
|
242
|
+
status: failed
|
|
243
|
+
reason: "User reported: {用户响应原文}"
|
|
244
|
+
severity: {推断的}
|
|
245
|
+
test: {N}
|
|
246
|
+
artifacts: [] # 由诊断填充
|
|
247
|
+
missing: [] # 由诊断填充
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**任何响应后:**
|
|
251
|
+
|
|
252
|
+
更新 Summary 计数。
|
|
253
|
+
更新前置信息的 updated 时间戳。
|
|
254
|
+
|
|
255
|
+
如果还有更多测试 → 更新 Current Test,转到 `present_test`
|
|
256
|
+
如果没有更多测试 → 转到 `complete_session`
|
|
257
|
+
</step>
|
|
258
|
+
|
|
259
|
+
<step name="resume_from_file">
|
|
260
|
+
**从 UAT 文件恢复测试:**
|
|
261
|
+
|
|
262
|
+
读取完整的 UAT 文件。
|
|
263
|
+
|
|
264
|
+
找到第一个 `result: [pending]` 的测试。
|
|
265
|
+
|
|
266
|
+
宣布:
|
|
267
|
+
```
|
|
268
|
+
恢复:Phase {phase} UAT
|
|
269
|
+
进度:{passed + issues + skipped}/{total}
|
|
270
|
+
已发现的问题:{issues count}
|
|
271
|
+
|
|
272
|
+
从测试 {N} 继续...
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
用待处理的测试更新 Current Test 部分。
|
|
276
|
+
继续到 `present_test`。
|
|
277
|
+
</step>
|
|
278
|
+
|
|
279
|
+
<step name="complete_session">
|
|
280
|
+
**完成测试并提交:**
|
|
281
|
+
|
|
282
|
+
更新前置信息:
|
|
283
|
+
- status: complete
|
|
284
|
+
- updated: [现在]
|
|
285
|
+
|
|
286
|
+
清除 Current Test 部分:
|
|
287
|
+
```
|
|
288
|
+
## Current Test
|
|
289
|
+
|
|
290
|
+
[测试完成]
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
提交 UAT 文件:
|
|
294
|
+
```bash
|
|
295
|
+
node .opencode/bin/specops-tools.cjs commit "test({phase_num}): complete UAT - {passed} passed, {issues} issues" --files ".planning/phases/XX-name/{phase_num}-UAT.md"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
展示摘要:
|
|
299
|
+
```
|
|
300
|
+
## UAT 完成:Phase {phase}
|
|
301
|
+
|
|
302
|
+
| 结果 | 数量 |
|
|
303
|
+
|------|------|
|
|
304
|
+
| 通过 | {N} |
|
|
305
|
+
| 问题 | {N} |
|
|
306
|
+
| 跳过 | {N} |
|
|
307
|
+
|
|
308
|
+
[如果 issues > 0:]
|
|
309
|
+
### 发现的问题
|
|
310
|
+
|
|
311
|
+
[来自 Issues 部分的列表]
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**如果 issues > 0:** 继续到 `diagnose_issues`
|
|
315
|
+
|
|
316
|
+
**如果 issues == 0:**
|
|
317
|
+
```
|
|
318
|
+
所有测试通过。准备继续。
|
|
319
|
+
|
|
320
|
+
- `/specops:plan-phase {next}` — 规划下一阶段
|
|
321
|
+
- `/specops:execute-phase {next}` — 执行下一阶段
|
|
322
|
+
```
|
|
323
|
+
</step>
|
|
324
|
+
|
|
325
|
+
<step name="diagnose_issues">
|
|
326
|
+
**在规划修复之前诊断根本原因:**
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
发现 {N} 个问题。正在诊断根本原因...
|
|
332
|
+
|
|
333
|
+
正在并行生成调试 Agent 调查每个问题。
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
- 加载 diagnose-issues 工作流
|
|
337
|
+
- 遵循 @.opencode/workflows/diagnose-issues.md
|
|
338
|
+
- 为每个问题并行生成调试 Agent
|
|
339
|
+
- 收集根本原因
|
|
340
|
+
- 用根本原因更新 UAT.md
|
|
341
|
+
- 继续到 `plan_gap_closure`
|
|
342
|
+
|
|
343
|
+
诊断自动运行——无需用户提示。并行 Agent 同时调查,因此开销最小且修复更准确。
|
|
344
|
+
</step>
|
|
345
|
+
|
|
346
|
+
<step name="plan_gap_closure">
|
|
347
|
+
**从诊断的缺口自动规划修复:**
|
|
348
|
+
|
|
349
|
+
显示:
|
|
350
|
+
```
|
|
351
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
352
|
+
SpecOps ► 规划修复
|
|
353
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
354
|
+
|
|
355
|
+
◆ 正在生成规划器进行缺口修复...
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
以 --gaps 模式生成 specops-planner:
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
Task(
|
|
362
|
+
prompt="""
|
|
363
|
+
<planning_context>
|
|
364
|
+
|
|
365
|
+
**Phase:** {phase_number}
|
|
366
|
+
**Mode:** gap_closure
|
|
367
|
+
|
|
368
|
+
<files_to_read>
|
|
369
|
+
- {phase_dir}/{phase_num}-UAT.md (UAT with diagnoses)
|
|
370
|
+
- .planning/STATE.md (Project State)
|
|
371
|
+
- .planning/ROADMAP.md (Roadmap)
|
|
372
|
+
</files_to_read>
|
|
373
|
+
|
|
374
|
+
</planning_context>
|
|
375
|
+
|
|
376
|
+
<downstream_consumer>
|
|
377
|
+
Output consumed by /specops:execute-phase
|
|
378
|
+
Plans must be executable prompts.
|
|
379
|
+
</downstream_consumer>
|
|
380
|
+
""",
|
|
381
|
+
subagent_type="specops-planner",
|
|
382
|
+
model="{planner_model}",
|
|
383
|
+
description="Plan gap fixes for Phase {phase}"
|
|
384
|
+
)
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
返回时:
|
|
388
|
+
- **PLANNING COMPLETE:** 继续到 `verify_gap_plans`
|
|
389
|
+
- **PLANNING INCONCLUSIVE:** 报告并提供手动干预选项
|
|
390
|
+
</step>
|
|
391
|
+
|
|
392
|
+
<step name="verify_gap_plans">
|
|
393
|
+
**用检查器验证修复计划:**
|
|
394
|
+
|
|
395
|
+
显示:
|
|
396
|
+
```
|
|
397
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
398
|
+
SpecOps ► 验证修复计划
|
|
399
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
400
|
+
|
|
401
|
+
◆ 正在生成计划检查器...
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
初始化:`iteration_count = 1`
|
|
405
|
+
|
|
406
|
+
生成 specops-plan-checker:
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
Task(
|
|
410
|
+
prompt="""
|
|
411
|
+
<verification_context>
|
|
412
|
+
|
|
413
|
+
**Phase:** {phase_number}
|
|
414
|
+
**Phase Goal:** Close diagnosed gaps from UAT
|
|
415
|
+
|
|
416
|
+
<files_to_read>
|
|
417
|
+
- {phase_dir}/*-PLAN.md (Plans to verify)
|
|
418
|
+
</files_to_read>
|
|
419
|
+
|
|
420
|
+
</verification_context>
|
|
421
|
+
|
|
422
|
+
<expected_output>
|
|
423
|
+
Return one of:
|
|
424
|
+
- ## VERIFICATION PASSED — all checks pass
|
|
425
|
+
- ## ISSUES FOUND — structured issue list
|
|
426
|
+
</expected_output>
|
|
427
|
+
""",
|
|
428
|
+
subagent_type="specops-plan-checker",
|
|
429
|
+
model="{checker_model}",
|
|
430
|
+
description="Verify Phase {phase} fix plans"
|
|
431
|
+
)
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
返回时:
|
|
435
|
+
- **VERIFICATION PASSED:** 继续到 `present_ready`
|
|
436
|
+
- **ISSUES FOUND:** 继续到 `revision_loop`
|
|
437
|
+
</step>
|
|
438
|
+
|
|
439
|
+
<step name="revision_loop">
|
|
440
|
+
**迭代规划器 ↔ 检查器直到计划通过(最多 3 次):**
|
|
441
|
+
|
|
442
|
+
**如果 iteration_count < 3:**
|
|
443
|
+
|
|
444
|
+
显示:`正在发回规划器修订...(迭代 {N}/3)`
|
|
445
|
+
|
|
446
|
+
使用修订上下文生成 specops-planner:
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
Task(
|
|
450
|
+
prompt="""
|
|
451
|
+
<revision_context>
|
|
452
|
+
|
|
453
|
+
**Phase:** {phase_number}
|
|
454
|
+
**Mode:** revision
|
|
455
|
+
|
|
456
|
+
<files_to_read>
|
|
457
|
+
- {phase_dir}/*-PLAN.md (Existing plans)
|
|
458
|
+
</files_to_read>
|
|
459
|
+
|
|
460
|
+
**Checker issues:**
|
|
461
|
+
{structured_issues_from_checker}
|
|
462
|
+
|
|
463
|
+
</revision_context>
|
|
464
|
+
|
|
465
|
+
<instructions>
|
|
466
|
+
Read existing PLAN.md files. Make targeted updates to address checker issues.
|
|
467
|
+
Do NOT replan from scratch unless issues are fundamental.
|
|
468
|
+
</instructions>
|
|
469
|
+
""",
|
|
470
|
+
subagent_type="specops-planner",
|
|
471
|
+
model="{planner_model}",
|
|
472
|
+
description="Revise Phase {phase} plans"
|
|
473
|
+
)
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
规划器返回后 → 再次生成检查器(verify_gap_plans 逻辑)
|
|
477
|
+
递增 iteration_count
|
|
478
|
+
|
|
479
|
+
**如果 iteration_count >= 3:**
|
|
480
|
+
|
|
481
|
+
显示:`已达最大迭代次数。{N} 个问题仍然存在。`
|
|
482
|
+
|
|
483
|
+
提供选项:
|
|
484
|
+
1. 强制继续(尽管有问题仍然执行)
|
|
485
|
+
2. 提供指导(用户给出方向,重试)
|
|
486
|
+
3. 放弃(退出,用户手动运行 /specops:plan-phase)
|
|
487
|
+
|
|
488
|
+
等待用户响应。
|
|
489
|
+
</step>
|
|
490
|
+
|
|
491
|
+
<step name="present_ready">
|
|
492
|
+
**展示完成和后续步骤:**
|
|
493
|
+
|
|
494
|
+
```
|
|
495
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
496
|
+
SpecOps ► 修复就绪 ✓
|
|
497
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
498
|
+
|
|
499
|
+
**Phase {X}: {名称}** — {N} 个缺口已诊断,{M} 个修复计划已创建
|
|
500
|
+
|
|
501
|
+
| 缺口 | 根本原因 | 修复计划 |
|
|
502
|
+
|------|----------|----------|
|
|
503
|
+
| {truth 1} | {root_cause} | {phase}-04 |
|
|
504
|
+
| {truth 2} | {root_cause} | {phase}-04 |
|
|
505
|
+
|
|
506
|
+
计划已验证,准备执行。
|
|
507
|
+
|
|
508
|
+
───────────────────────────────────────────────────────────────
|
|
509
|
+
|
|
510
|
+
## ▶ 下一步
|
|
511
|
+
|
|
512
|
+
**执行修复** — 运行修复计划
|
|
513
|
+
|
|
514
|
+
`/clear` 然后 `/specops:execute-phase {phase} --gaps-only`
|
|
515
|
+
|
|
516
|
+
───────────────────────────────────────────────────────────────
|
|
517
|
+
```
|
|
518
|
+
</step>
|
|
519
|
+
|
|
520
|
+
</process>
|
|
521
|
+
|
|
522
|
+
<update_rules>
|
|
523
|
+
**批量写入以提高效率:**
|
|
524
|
+
|
|
525
|
+
将结果保存在内存中。仅在以下情况写入文件:
|
|
526
|
+
1. **发现问题** — 立即保存问题
|
|
527
|
+
2. **会话完成** — 提交前最终写入
|
|
528
|
+
3. **检查点** — 每 5 个通过的测试(安全网)
|
|
529
|
+
|
|
530
|
+
| 部分 | 规则 | 写入时机 |
|
|
531
|
+
|------|------|----------|
|
|
532
|
+
| Frontmatter.status | 覆盖 | 开始、完成 |
|
|
533
|
+
| Frontmatter.updated | 覆盖 | 任何文件写入时 |
|
|
534
|
+
| Current Test | 覆盖 | 任何文件写入时 |
|
|
535
|
+
| Tests.{N}.result | 覆盖 | 任何文件写入时 |
|
|
536
|
+
| Summary | 覆盖 | 任何文件写入时 |
|
|
537
|
+
| Gaps | 追加 | 发现问题时 |
|
|
538
|
+
|
|
539
|
+
上下文重置时:文件显示最后一个检查点。从那里恢复。
|
|
540
|
+
</update_rules>
|
|
541
|
+
|
|
542
|
+
<severity_inference>
|
|
543
|
+
**从用户的自然语言推断严重程度:**
|
|
544
|
+
|
|
545
|
+
| 用户说 | 推断 |
|
|
546
|
+
|--------|------|
|
|
547
|
+
| "crashes"、"error"、"exception"、"fails completely" | blocker |
|
|
548
|
+
| "doesn't work"、"nothing happens"、"wrong behavior" | major |
|
|
549
|
+
| "works but..."、"slow"、"weird"、"minor issue" | minor |
|
|
550
|
+
| "color"、"spacing"、"alignment"、"looks off" | cosmetic |
|
|
551
|
+
|
|
552
|
+
不确定时默认为 **major**。用户可以在需要时纠正。
|
|
553
|
+
|
|
554
|
+
**永远不要问"这有多严重?"** - 直接推断并继续。
|
|
555
|
+
</severity_inference>
|
|
556
|
+
|
|
557
|
+
<success_criteria>
|
|
558
|
+
- [ ] UAT 文件已创建,包含来自 SUMMARY.md 的所有测试
|
|
559
|
+
- [ ] 测试逐个展示,附带预期行为
|
|
560
|
+
- [ ] 用户响应处理为通过/问题/跳过
|
|
561
|
+
- [ ] 严重程度从描述推断(从不询问)
|
|
562
|
+
- [ ] 批量写入:发现问题时、每 5 个通过时或完成时
|
|
563
|
+
- [ ] 完成时已提交
|
|
564
|
+
- [ ] 如有问题:并行调试 Agent 诊断根本原因
|
|
565
|
+
- [ ] 如有问题:specops-planner 创建修复计划(gap_closure 模式)
|
|
566
|
+
- [ ] 如有问题:specops-plan-checker 验证修复计划
|
|
567
|
+
- [ ] 如有问题:修订循环直到计划通过(最多 3 次迭代)
|
|
568
|
+
- [ ] 完成后准备好运行 `/specops:execute-phase --gaps-only`
|
|
569
|
+
</success_criteria>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specops:add-phase
|
|
3
|
+
description: 在路线图中当前里程碑的末尾添加阶段
|
|
4
|
+
argument-hint: <description>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<objective>
|
|
12
|
+
在路线图中当前里程碑的末尾添加一个新的整数阶段。
|
|
13
|
+
|
|
14
|
+
路由到 add-phase 工作流,该工作流处理:
|
|
15
|
+
- 阶段编号计算(下一个顺序整数)
|
|
16
|
+
- 目录创建及 slug 生成
|
|
17
|
+
- 路线图结构更新
|
|
18
|
+
- STATE.md 路线图演进追踪
|
|
19
|
+
</objective>
|
|
20
|
+
|
|
21
|
+
<execution_context>
|
|
22
|
+
@.opencode/workflows/add-phase.md
|
|
23
|
+
</execution_context>
|
|
24
|
+
|
|
25
|
+
<context>
|
|
26
|
+
参数:$ARGUMENTS(阶段描述)
|
|
27
|
+
|
|
28
|
+
路线图和状态在工作流中通过 `init phase-op` 和定向工具调用解析。
|
|
29
|
+
</context>
|
|
30
|
+
|
|
31
|
+
<process>
|
|
32
|
+
**遵循 add-phase 工作流**,来自 `@.opencode/workflows/add-phase.md`。
|
|
33
|
+
|
|
34
|
+
该工作流处理所有逻辑,包括:
|
|
35
|
+
1. 参数解析和验证
|
|
36
|
+
2. 路线图存在性检查
|
|
37
|
+
3. 当前里程碑识别
|
|
38
|
+
4. 下一个阶段编号计算(忽略小数)
|
|
39
|
+
5. 从描述生成 slug
|
|
40
|
+
6. 阶段目录创建
|
|
41
|
+
7. 路线图条目插入
|
|
42
|
+
8. STATE.md 更新
|
|
43
|
+
</process>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specops:add-tests
|
|
3
|
+
description: 根据 UAT 标准和实现为已完成的阶段生成测试
|
|
4
|
+
argument-hint: "<phase> [additional instructions]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- Task
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
argument-instructions: |
|
|
15
|
+
将参数解析为阶段编号(整数、小数或字母后缀),加上可选的自由文本指令。
|
|
16
|
+
示例:/specops:add-tests 12
|
|
17
|
+
示例:/specops:add-tests 12 focus on edge cases in the pricing module
|
|
18
|
+
---
|
|
19
|
+
<objective>
|
|
20
|
+
为已完成的阶段生成单元测试和 E2E 测试,使用其 SUMMARY.md、CONTEXT.md 和 VERIFICATION.md 作为规格说明。
|
|
21
|
+
|
|
22
|
+
分析实现文件,将它们分类为 TDD(单元测试)、E2E(浏览器测试)或 Skip 类别,向用户展示测试计划以获取批准,然后按照 RED-GREEN 规范生成测试。
|
|
23
|
+
|
|
24
|
+
输出:测试文件以消息 `test(phase-{N}): add unit and E2E tests from add-tests command` 提交
|
|
25
|
+
</objective>
|
|
26
|
+
|
|
27
|
+
<execution_context>
|
|
28
|
+
@.opencode/workflows/add-tests.md
|
|
29
|
+
</execution_context>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
阶段:$ARGUMENTS
|
|
33
|
+
|
|
34
|
+
@.planning/STATE.md
|
|
35
|
+
@.planning/ROADMAP.md
|
|
36
|
+
</context>
|
|
37
|
+
|
|
38
|
+
<process>
|
|
39
|
+
端到端执行 @.opencode/workflows/add-tests.md 中的 add-tests 工作流。
|
|
40
|
+
保留所有工作流门控(分类审批、测试计划审批、RED-GREEN 验证、缺口报告)。
|
|
41
|
+
</process>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specops:add-todo
|
|
3
|
+
description: 从当前对话上下文中捕获想法或任务作为待办事项
|
|
4
|
+
argument-hint: [optional description]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- AskUserQuestion
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<objective>
|
|
13
|
+
将 SpecOps 会话中浮现的想法、任务或问题捕获为结构化的待办事项,供后续处理。
|
|
14
|
+
|
|
15
|
+
路由到 add-todo 工作流,该工作流处理:
|
|
16
|
+
- 目录结构创建
|
|
17
|
+
- 从参数或对话中提取内容
|
|
18
|
+
- 从文件路径推断领域
|
|
19
|
+
- 重复检测和解决
|
|
20
|
+
- 创建带 frontmatter 的待办文件
|
|
21
|
+
- STATE.md 更新
|
|
22
|
+
- Git 提交
|
|
23
|
+
</objective>
|
|
24
|
+
|
|
25
|
+
<execution_context>
|
|
26
|
+
@.opencode/workflows/add-todo.md
|
|
27
|
+
</execution_context>
|
|
28
|
+
|
|
29
|
+
<context>
|
|
30
|
+
参数:$ARGUMENTS(可选的待办描述)
|
|
31
|
+
|
|
32
|
+
状态在工作流中通过 `init todos` 和定向读取解析。
|
|
33
|
+
</context>
|
|
34
|
+
|
|
35
|
+
<process>
|
|
36
|
+
**遵循 add-todo 工作流**,来自 `@.opencode/workflows/add-todo.md`。
|
|
37
|
+
|
|
38
|
+
该工作流处理所有逻辑,包括:
|
|
39
|
+
1. 目录确保
|
|
40
|
+
2. 现有领域检查
|
|
41
|
+
3. 内容提取(参数或对话)
|
|
42
|
+
4. 领域推断
|
|
43
|
+
5. 重复检查
|
|
44
|
+
6. 文件创建及 slug 生成
|
|
45
|
+
7. STATE.md 更新
|
|
46
|
+
8. Git 提交
|
|
47
|
+
</process>
|