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.
Files changed (160) hide show
  1. package/.opencode/agent/specops-codebase-mapper.md +764 -0
  2. package/.opencode/agent/specops-debugger.md +1246 -0
  3. package/.opencode/agent/specops-executor.md +469 -0
  4. package/.opencode/agent/specops-integration-checker.md +443 -0
  5. package/.opencode/agent/specops-phase-researcher.md +547 -0
  6. package/.opencode/agent/specops-plan-checker.md +690 -0
  7. package/.opencode/agent/specops-planner.md +575 -0
  8. package/.opencode/agent/specops-project-researcher.md +354 -0
  9. package/.opencode/agent/specops-research-synthesizer.md +239 -0
  10. package/.opencode/agent/specops-roadmapper.md +642 -0
  11. package/.opencode/agent/specops-work-verifier.md +573 -0
  12. package/.opencode/references/checkpoints.md +776 -0
  13. package/.opencode/references/continuation-format.md +249 -0
  14. package/.opencode/references/decimal-phase-calculation.md +65 -0
  15. package/.opencode/references/git-integration.md +248 -0
  16. package/.opencode/references/git-planning-commit.md +38 -0
  17. package/.opencode/references/model-profile-resolution.md +34 -0
  18. package/.opencode/references/model-profiles.md +92 -0
  19. package/.opencode/references/phase-argument-parsing.md +61 -0
  20. package/.opencode/references/planning-config.md +196 -0
  21. package/.opencode/references/questioning.md +145 -0
  22. package/.opencode/references/tdd.md +263 -0
  23. package/.opencode/references/ui-brand.md +160 -0
  24. package/.opencode/references/verification-patterns.md +612 -0
  25. package/.opencode/skills/demand-analysis/SKILL.md +142 -10
  26. package/.opencode/templates/DEBUG.md +164 -0
  27. package/.opencode/templates/UAT.md +180 -0
  28. package/.opencode/templates/VALIDATION.md +76 -0
  29. package/.opencode/templates/codebase/architecture.md +255 -0
  30. package/.opencode/templates/codebase/concerns.md +310 -0
  31. package/.opencode/templates/codebase/conventions.md +307 -0
  32. package/.opencode/templates/codebase/integrations.md +280 -0
  33. package/.opencode/templates/codebase/stack.md +186 -0
  34. package/.opencode/templates/codebase/structure.md +285 -0
  35. package/.opencode/templates/codebase/testing.md +480 -0
  36. package/.opencode/templates/context.md +221 -0
  37. package/.opencode/templates/continue-here.md +78 -0
  38. package/.opencode/templates/debug-subagent-prompt.md +91 -0
  39. package/.opencode/templates/discovery.md +147 -0
  40. package/.opencode/templates/milestone-archive.md +123 -0
  41. package/.opencode/templates/milestone.md +115 -0
  42. package/.opencode/templates/phase-prompt.md +333 -0
  43. package/.opencode/templates/planner-subagent-prompt.md +117 -0
  44. package/.opencode/templates/project.md +184 -0
  45. package/.opencode/templates/requirements.md +130 -0
  46. package/.opencode/templates/research-project/ARCHITECTURE.md +204 -0
  47. package/.opencode/templates/research-project/FEATURES.md +147 -0
  48. package/.opencode/templates/research-project/PITFALLS.md +200 -0
  49. package/.opencode/templates/research-project/STACK.md +120 -0
  50. package/.opencode/templates/research-project/SUMMARY.md +170 -0
  51. package/.opencode/templates/research.md +278 -0
  52. package/.opencode/templates/retrospective.md +54 -0
  53. package/.opencode/templates/roadmap.md +202 -0
  54. package/.opencode/templates/state.md +176 -0
  55. package/.opencode/templates/summary-complex.md +59 -0
  56. package/.opencode/templates/summary-minimal.md +41 -0
  57. package/.opencode/templates/summary-standard.md +48 -0
  58. package/.opencode/templates/summary.md +248 -0
  59. package/.opencode/templates/user-setup.md +311 -0
  60. package/.opencode/templates/verification-report.md +322 -0
  61. package/.opencode/workflows/add-phase.md +111 -0
  62. package/.opencode/workflows/add-tests.md +350 -0
  63. package/.opencode/workflows/add-todo.md +157 -0
  64. package/.opencode/workflows/audit-milestone.md +297 -0
  65. package/.opencode/workflows/check-todos.md +176 -0
  66. package/.opencode/workflows/cleanup.md +152 -0
  67. package/.opencode/workflows/complete-milestone.md +763 -0
  68. package/.opencode/workflows/diagnose-issues.md +219 -0
  69. package/.opencode/workflows/discovery-phase.md +288 -0
  70. package/.opencode/workflows/discuss-phase.md +542 -0
  71. package/.opencode/workflows/execute-phase.md +449 -0
  72. package/.opencode/workflows/execute-plan.md +447 -0
  73. package/.opencode/workflows/health.md +156 -0
  74. package/.opencode/workflows/help.md +489 -0
  75. package/.opencode/workflows/insert-phase.md +129 -0
  76. package/.opencode/workflows/list-phase-assumptions.md +178 -0
  77. package/.opencode/workflows/map-codebase.md +315 -0
  78. package/.opencode/workflows/new-milestone.md +382 -0
  79. package/.opencode/workflows/new-project.md +1116 -0
  80. package/.opencode/workflows/pause-work.md +122 -0
  81. package/.opencode/workflows/plan-milestone-gaps.md +274 -0
  82. package/.opencode/workflows/plan-phase.md +569 -0
  83. package/.opencode/workflows/progress.md +381 -0
  84. package/.opencode/workflows/quick.md +453 -0
  85. package/.opencode/workflows/remove-phase.md +154 -0
  86. package/.opencode/workflows/research-phase.md +73 -0
  87. package/.opencode/workflows/resume-project.md +304 -0
  88. package/.opencode/workflows/set-profile.md +80 -0
  89. package/.opencode/workflows/settings.md +213 -0
  90. package/.opencode/workflows/transition.md +544 -0
  91. package/.opencode/workflows/update.md +219 -0
  92. package/.opencode/workflows/verify-phase.md +242 -0
  93. package/.opencode/workflows/verify-work.md +569 -0
  94. package/commands/specops/add-phase.md +43 -0
  95. package/commands/specops/add-tests.md +41 -0
  96. package/commands/specops/add-todo.md +47 -0
  97. package/commands/specops/audit-milestone.md +36 -0
  98. package/commands/specops/check-todos.md +45 -0
  99. package/commands/specops/cleanup.md +18 -0
  100. package/commands/specops/complete-milestone.md +136 -0
  101. package/commands/specops/debug.md +167 -0
  102. package/commands/specops/discuss-phase.md +83 -0
  103. package/commands/specops/execute-phase.md +41 -0
  104. package/commands/specops/health.md +22 -0
  105. package/commands/specops/help.md +22 -0
  106. package/commands/specops/insert-phase.md +32 -0
  107. package/commands/specops/join-discord.md +18 -0
  108. package/commands/specops/list-phase-assumptions.md +46 -0
  109. package/commands/specops/map-codebase.md +71 -0
  110. package/commands/specops/new-milestone.md +44 -0
  111. package/commands/specops/new-project.md +42 -0
  112. package/commands/specops/pause-work.md +38 -0
  113. package/commands/specops/plan-milestone-gaps.md +34 -0
  114. package/commands/specops/plan-phase.md +45 -0
  115. package/commands/specops/progress.md +24 -0
  116. package/commands/specops/quick.md +41 -0
  117. package/commands/specops/reapply-patches.md +111 -0
  118. package/commands/specops/remove-phase.md +31 -0
  119. package/commands/specops/research-phase.md +189 -0
  120. package/commands/specops/resume-work.md +40 -0
  121. package/commands/specops/set-profile.md +34 -0
  122. package/commands/specops/settings.md +36 -0
  123. package/commands/specops/update.md +37 -0
  124. package/commands/specops/verify-work.md +38 -0
  125. package/dist/__e2e__/01-state-engine.e2e.test.js +1 -1
  126. package/dist/acceptance/lazyDetector.js +1 -1
  127. package/dist/acceptance/lazyDetector.test.js +1 -1
  128. package/dist/acceptance/reporter.js +1 -1
  129. package/dist/acceptance/reporter.test.js +1 -1
  130. package/dist/acceptance/runner.js +1 -1
  131. package/dist/acceptance/runner.test.js +1 -1
  132. package/dist/cli.js +1 -1
  133. package/dist/context/index.js +1 -1
  134. package/dist/context/promptTemplate.js +1 -1
  135. package/dist/context/promptTemplate.test.js +1 -1
  136. package/dist/context/techContextLoader.js +1 -1
  137. package/dist/context/techContextLoader.test.js +1 -1
  138. package/dist/engine.js +1 -1
  139. package/dist/evolution/distiller.js +1 -1
  140. package/dist/evolution/index.js +1 -1
  141. package/dist/evolution/memoryGraph.js +1 -1
  142. package/dist/evolution/selector.js +1 -1
  143. package/dist/evolution/signals.js +1 -1
  144. package/dist/evolution/solidify.js +1 -1
  145. package/dist/evolution/store.js +1 -1
  146. package/dist/evolution/types.js +1 -1
  147. package/dist/init.d.ts +4 -3
  148. package/dist/init.js +1 -1
  149. package/dist/machines/agentMachine.js +1 -1
  150. package/dist/machines/agentMachine.test.js +1 -1
  151. package/dist/machines/supervisorMachine.js +1 -1
  152. package/dist/machines/supervisorMachine.test.js +1 -1
  153. package/dist/persistence/schema.js +1 -1
  154. package/dist/persistence/stateFile.js +1 -1
  155. package/dist/persistence/stateFile.test.js +1 -1
  156. package/dist/plugin-engine.js +1 -1
  157. package/dist/plugin.js +1 -1
  158. package/dist/types/index.js +1 -1
  159. package/dist/utils/id.js +1 -1
  160. package/package.json +2 -1
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: demand-analysis
3
- description: "需求分析编排 Skill — 完整的 Phase 0 流程:Brainstorm → 输入识别 → 功能拆分 → 竞品搜索 → 功能搜索 → Clone 分析 → 技术选型 → PRD 合成。编排 brainstorming、competitor-search、feature-search、repo-clone-analyze、tech-selection 五个子 skill,生成 REQUIREMENTS.md + TECH-CONTEXT.md,对接 GSD new-project。触发词:'需求分析'、'分析需求'、'analyze demand'、'拆分功能'。"
3
+ description: "需求分析编排 Skill — 完整的 Phase 0 流程:Brainstorm → 输入识别 → 功能拆分 → 竞品搜索 → 功能搜索 → Clone 分析 → 技术选型 → 难点分析 → PRD 合成。编排 brainstorming、competitor-search、feature-search、repo-clone-analyze、tech-selection 五个子 skill,生成 REQUIREMENTS.md + TECH-CONTEXT.md,对接 GSD new-project。触发词:'需求分析'、'分析需求'、'analyze demand'、'拆分功能'、'难点分析'。"
4
4
  ---
5
5
 
6
6
  # 需求分析 Skill(编排层)
7
7
 
8
8
  <role>
9
- 你是需求分析编排专家。你接收用户输入,按 8 个 PHASE 顺序执行完整分析链路:
9
+ 你是需求分析编排专家。你接收用户输入,按 9 个 PHASE 顺序执行完整分析链路:
10
10
 
11
11
  **你不亲自执行搜索、分析和选型 — 你调用专门的子 skill 来完成。**
12
12
 
@@ -18,7 +18,8 @@ description: "需求分析编排 Skill — 完整的 Phase 0 流程:Brainstorm
18
18
  4. 调用 `feature-search` skill 搜索开源实现
19
19
  5. 调用 `repo-clone-analyze` skill Clone 并分析参考项目
20
20
  6. 调用 `tech-selection` skill 进行技术选型
21
- 7. 合成所有产出,生成 REQUIREMENTS.md + TECH-CONTEXT.md
21
+ 7. 难点分析:验证和发现项目技术/功能/集成难点
22
+ 8. 合成所有产出,生成 REQUIREMENTS.md + TECH-CONTEXT.md
22
23
  </role>
23
24
 
24
25
  ---
@@ -29,7 +30,7 @@ description: "需求分析编排 Skill — 完整的 Phase 0 流程:Brainstorm
29
30
  |------|------|
30
31
  | **Brainstorm 门禁** | PHASE 0 设计批准前,**禁止**进入任何后续 PHASE |
31
32
  | **子 skill 调用** | 搜索/分析/选型必须通过 `skill()` 调用,不得自行执行 |
32
- | **顺序执行** | PHASE 必须按 0→1→2→3→4→5→6→7 顺序执行,不得跳过 |
33
+ | **顺序执行** | PHASE 必须按 0→1→2→3→4→5→6→7→8 顺序执行,不得跳过 |
33
34
  | **状态更新** | 每个 PHASE 转换时必须调用 specops CLI 更新状态 |
34
35
  | **全中文输出** | 所有文档、报告、状态描述均使用中文 |
35
36
 
@@ -286,9 +287,119 @@ npx specops update-operation --agent-id <id> --operation "正在进行技术选
286
287
 
287
288
  ---
288
289
 
289
- ## PHASE 7: 合成 PRD
290
+ ## PHASE 7: 难点分析
290
291
 
291
- 将 PHASE 0-6 的所有产出合成为两个文档:
292
+ <difficulty_analysis>
293
+
294
+ ### 难点来源
295
+
296
+ 难点有两个来源,都要覆盖:
297
+
298
+ **来源 1: 用户主动提出的难点**
299
+
300
+ 在 PHASE 0 Brainstorm 或任何交互中,用户可能提到「这个项目的难点是...」「我担心...会很难」。记录下来,在此阶段统一处理。
301
+
302
+ **来源 2: 主动分析潜在难点**
303
+
304
+ 从前面所有 PHASE 的产出中提取潜在难点:
305
+
306
+ | 分析维度 | 数据来源 | 难点信号 |
307
+ |---------|---------|---------|
308
+ | **技术难点** | PHASE 6 技术选型 | 选型中标注的风险项、技术兼容性问题、性能瓶颈 |
309
+ | **功能难点** | PHASE 4 功能搜索 | 「未找到开源实现」的 SC 功能点 — 需完全自研 |
310
+ | **集成难点** | PHASE 5 Clone 分析 | 参考项目间架构模式冲突、数据格式不兼容 |
311
+ | **规模难点** | PHASE 2 功能拆分 | 复杂度标注为「高」的 SC 功能点 |
312
+ | **未知难点** | PHASE 3 竞品分析 | 竞品普遍未解决的功能缺口(说明行业级难题) |
313
+
314
+ ### 每个难点的处理链
315
+
316
+ 对每个识别出的难点,按以下流程处理:
317
+
318
+ ```
319
+ 难点描述
320
+
321
+
322
+ Step 1: 搜索验证(确认是否真的是难点)
323
+ │ 使用 web search / librarian 搜索:
324
+ │ - "[难点关键词] solution"
325
+ │ - "[难点关键词] best practice"
326
+ │ - "[难点关键词] how to solve"
327
+ │ 判断:这是真实存在的技术难题,还是有成熟解决方案?
328
+
329
+ ├─ 有成熟解决方案 ──→ Step 2a
330
+ └─ 无成熟解决方案 ──→ Step 2b
331
+
332
+ Step 2a: 记录解决方案
333
+ - 方案名称 + 链接/来源
334
+ - 实现复杂度估算
335
+ - 是否需要额外依赖
336
+ → 输出到 REQUIREMENTS.md「已解决难点」表
337
+
338
+ Step 2b: 加入项目难点清单
339
+ - 难点描述
340
+ - 风险等级:🔴 高 / 🟡 中 / 🟢 低
341
+ - 影响范围:哪些 SC 功能点受影响
342
+ - 已尝试的搜索关键词(证明确实搜索过)
343
+ - 建议的探索方向(不是解决方案,是可能的研究方向)
344
+ → 输出到 REQUIREMENTS.md「未解决难点」表
345
+ ```
346
+
347
+ ### 搜索策略
348
+
349
+ 对每个难点,至少执行以下搜索:
350
+
351
+ 1. **中文搜索**:`[难点关键词] 解决方案` / `[难点关键词] 最佳实践`
352
+ 2. **英文搜索**:`[difficulty keyword] solution` / `[difficulty keyword] best practice`
353
+ 3. **GitHub 搜索**:搜索相关 issue 和 discussion,看是否有人遇到并解决了同样问题
354
+ 4. **Stack Overflow**:搜索相关问答
355
+
356
+ 如果搜索结果模糊或不确定,**向用户确认**:
357
+ ```
358
+ 我发现 [难点描述] 有以下可能的解决方案:
359
+ 1. [方案 A] — [简要描述]
360
+ 2. [方案 B] — [简要描述]
361
+
362
+ 但这些方案可能不完全适用于我们的场景,因为 [原因]。
363
+ 你觉得哪个方向值得深入研究?还是标记为项目难点?
364
+ ```
365
+
366
+ ### 输出格式
367
+
368
+ #### 已解决难点表
369
+
370
+ | 难点 | 来源 | 解决方案 | 方案来源 | 实现复杂度 | 受影响 SC |
371
+ |------|------|---------|---------|-----------|----------|
372
+ | [描述] | 用户提出 / PHASE X | [方案名] | [链接] | 低/中/高 | SC-001, SC-003 |
373
+
374
+ #### 未解决难点表(项目难点清单)
375
+
376
+ | 难点 | 风险等级 | 来源 | 影响范围 | 搜索记录 | 探索方向 |
377
+ |------|---------|------|---------|---------|---------|
378
+ | [描述] | 🔴 高 | 用户提出 / PHASE X | SC-001, SC-003 | "keyword1 solution"→无结果, "keyword2 best practice"→不适用 | 可能需要 [研究方向] |
379
+
380
+ ### 反模式
381
+
382
+ | 违规行为 | 严重性 |
383
+ |---------|--------|
384
+ | 用户提出的难点不搜索直接记录 | **严重** — 必须先搜索验证 |
385
+ | 只搜索一次就下结论 | 高 — 至少中英文各搜一次 |
386
+ | 不标注风险等级 | 中 |
387
+ | 不记录搜索关键词 | 中 — 必须证明已搜索 |
388
+ | 发现解决方案后不评估适用性 | 中 |
389
+
390
+ **状态更新:**
391
+ ```bash
392
+ npx specops advance --agent-id <id>
393
+ npx specops update-operation --agent-id <id> --operation "正在分析项目难点..." --skill "demand-analysis"
394
+ ```
395
+
396
+ </difficulty_analysis>
397
+
398
+ ---
399
+
400
+ ## PHASE 8: 合成 PRD
401
+
402
+ 将 PHASE 0-7 的所有产出合成为两个文档:
292
403
 
293
404
  ### 输出 1: `.specops/REQUIREMENTS.md`
294
405
 
@@ -366,7 +477,24 @@ npx specops update-operation --agent-id <id> --operation "正在进行技术选
366
477
  | 包名 | 版本 | 用途 |
367
478
  |------|------|------|
368
479
 
369
- ## 七、建议实施路线
480
+ ## 七、难点分析
481
+ > 来源: PHASE 7 难点分析
482
+
483
+ ### 已解决难点
484
+
485
+ | 难点 | 来源 | 解决方案 | 方案来源 | 实现复杂度 | 受影响 SC |
486
+ |------|------|---------|---------|-----------|----------|
487
+ | ... | ... | ... | ... | ... | ... |
488
+
489
+ ### 未解决难点(项目难点清单)
490
+
491
+ | 难点 | 风险等级 | 来源 | 影响范围 | 搜索记录 | 探索方向 |
492
+ |------|---------|------|---------|---------|---------|
493
+ | ... | ... | ... | ... | ... | ... |
494
+
495
+ > ⚠️ 未解决难点需要在 GSD discuss-phase 中进一步讨论确定处理策略。
496
+
497
+ ## 八、建议实施路线
370
498
  ### Phase 1: MVP(预计 X 周)
371
499
  - 实现 SC-001 ~ SC-xxx
372
500
  - 核心技术: [列表]
@@ -437,7 +565,8 @@ PHASE 3: operation="正在搜索竞品..." skill="competitor-
437
565
  PHASE 4: operation="正在搜索开源实现..." skill="feature-search"
438
566
  PHASE 5: operation="正在 Clone 并分析参考项目..." skill="repo-clone-analyze"
439
567
  PHASE 6: operation="正在进行技术选型..." skill="tech-selection"
440
- PHASE 7: operation="正在合成 PRD..." skill="demand-analysis"
568
+ PHASE 7: operation="正在分析项目难点..." skill="demand-analysis"
569
+ PHASE 8: operation="正在合成 PRD..." skill="demand-analysis"
441
570
  ```
442
571
 
443
572
  每个 PHASE 转换时调用:
@@ -484,7 +613,10 @@ PHASE 5: skill(name="repo-clone-analyze")
484
613
  PHASE 6: skill(name="tech-selection")
485
614
  │ 技术选型(含 ref.json 输入)
486
615
 
487
- PHASE 7: 合成 PRD
616
+ PHASE 7: 难点分析
617
+ │ 用户提出 + 主动发现 → 搜索验证 → 分类输出
618
+
619
+ PHASE 8: 合成 PRD
488
620
  │ → .specops/REQUIREMENTS.md
489
621
  │ → .specops/TECH-CONTEXT.md
490
622
  │ → 提示: /gsd-new-project --auto
@@ -511,7 +643,7 @@ PHASE 7: 合成 PRD
511
643
  |---------|--------|
512
644
  | Brainstorm 未批准就进入后续 PHASE | **致命** — 必须获得用户批准 |
513
645
  | 不调用子 skill 自己做搜索/选型/分析 | **严重** — 必须通过 skill() 调用 |
514
- | 跳过 PHASE 0-7 中任何一个 | **严重** |
646
+ | 跳过 PHASE 0-8 中任何一个 | **严重** |
515
647
  | 没有识别输入类型就开始分析 | 高 |
516
648
  | 跳过功能拆分直接出文档 | 高 |
517
649
  | 子 skill 报告还没返回就开始写合成文档 | 高 — 必须等待子 skill 完成 |
@@ -0,0 +1,164 @@
1
+ # 调试模板
2
+
3
+ `.planning/debug/[slug].md` 的模板,活跃调试会话追踪。
4
+
5
+ ---
6
+
7
+ ## 文件模板
8
+
9
+ ```markdown
10
+ ---
11
+ status: gathering | investigating | fixing | verifying | awaiting_human_verify | resolved
12
+ trigger: "[用户原始输入]"
13
+ created: [ISO 时间戳]
14
+ updated: [ISO 时间戳]
15
+ ---
16
+
17
+ ## 当前焦点
18
+ <!-- 每次更新时覆盖,始终反映当前状态 -->
19
+
20
+ hypothesis: [当前正在测试的理论]
21
+ test: [如何测试]
22
+ expecting: [结果为真/假意味着什么]
23
+ next_action: [下一步操作]
24
+
25
+ ## 症状
26
+ <!-- 收集阶段写入,之后不可变 -->
27
+
28
+ expected: [应该发生什么]
29
+ actual: [实际发生什么]
30
+ errors: [错误信息(如有)]
31
+ reproduction: [如何触发]
32
+ started: [何时出问题 / 一直有问题]
33
+
34
+ ## 已排除
35
+ <!-- 仅追加,防止 /clear 后重复调查 -->
36
+
37
+ - hypothesis: [被证伪的理论]
38
+ evidence: [什么证伪了它]
39
+ timestamp: [排除时间]
40
+
41
+ ## 证据
42
+ <!-- 仅追加,调查中发现的事实 -->
43
+
44
+ - timestamp: [发现时间]
45
+ checked: [检查了什么]
46
+ found: [观察到什么]
47
+ implication: [这意味着什么]
48
+
49
+ ## 解决方案
50
+ <!-- 随理解深入覆盖 -->
51
+
52
+ root_cause: [找到前为空]
53
+ fix: [应用前为空]
54
+ verification: [验证前为空]
55
+ files_changed: []
56
+ ```
57
+
58
+ ---
59
+
60
+ <section_rules>
61
+
62
+ **Frontmatter (status, trigger, timestamps):**
63
+ - `status`: 覆盖 - 反映当前阶段
64
+ - `trigger`: 不可变 - 用户原始输入,永不改变
65
+ - `created`: 不可变 - 设置一次
66
+ - `updated`: 覆盖 - 每次变更时更新
67
+
68
+ **当前焦点:**
69
+ - 每次更新时完全覆盖
70
+ - 始终反映 Claude 当前正在做什么
71
+ - 如果 Claude 在 /clear 后读取此文件,能准确知道从哪里恢复
72
+ - 字段: hypothesis, test, expecting, next_action
73
+
74
+ **症状:**
75
+ - 初始收集阶段写入
76
+ - 收集完成后不可变
77
+ - 作为我们要修复什么的参考点
78
+ - 字段: expected, actual, errors, reproduction, started
79
+
80
+ **已排除:**
81
+ - 仅追加,永不删除条目
82
+ - 防止上下文重置后重复调查死胡同
83
+ - 每个条目: 假设、证伪它的证据、时间戳
84
+ - 对跨 /clear 边界的效率至关重要
85
+
86
+ **证据:**
87
+ - 仅追加,永不删除条目
88
+ - 调查中发现的事实
89
+ - 每个条目: 时间戳、检查了什么、发现了什么、含义
90
+ - 构建根本原因的论据
91
+
92
+ **解决方案:**
93
+ - 随理解深入覆盖
94
+ - 尝试修复时可能多次更新
95
+ - 最终状态显示确认的根本原因和已验证的修复
96
+ - 字段: root_cause, fix, verification, files_changed
97
+
98
+ </section_rules>
99
+
100
+ <lifecycle>
101
+
102
+ **创建:** /specops:debug 调用时立即创建
103
+ - 用用户输入创建文件作为 trigger
104
+ - 设置 status 为 "gathering"
105
+ - 当前焦点: next_action = "收集症状"
106
+ - 症状: 空,待填写
107
+
108
+ **症状收集期间:**
109
+ - 用户回答问题时更新症状部分
110
+ - 每个问题更新当前焦点
111
+ - 完成时: status → "investigating"
112
+
113
+ **调查期间:**
114
+ - 每个假设覆盖当前焦点
115
+ - 每个发现追加到证据
116
+ - 假设被证伪时追加到已排除
117
+ - 更新 frontmatter 中的时间戳
118
+
119
+ **修复期间:**
120
+ - status → "fixing"
121
+ - 确认时更新 Resolution.root_cause
122
+ - 应用时更新 Resolution.fix
123
+ - 更新 Resolution.files_changed
124
+
125
+ **验证期间:**
126
+ - status → "verifying"
127
+ - 用结果更新 Resolution.verification
128
+ - 如果验证失败: status → "investigating",重试
129
+
130
+ **自我验证通过后:**
131
+ - status -> "awaiting_human_verify"
132
+ - 在检查点中请求用户明确确认
133
+ - 还不要将文件移到 resolved
134
+
135
+ **解决时:**
136
+ - status → "resolved"
137
+ - 将文件移到 .planning/debug/resolved/ (仅在用户确认修复后)
138
+
139
+ </lifecycle>
140
+
141
+ <resume_behavior>
142
+
143
+ Claude 在 /clear 后读取此文件时:
144
+
145
+ 1. 解析 frontmatter → 了解状态
146
+ 2. 读取当前焦点 → 准确知道在做什么
147
+ 3. 读取已排除 → 知道不要重试什么
148
+ 4. 读取证据 → 知道已经学到了什么
149
+ 5. 从 next_action 继续
150
+
151
+ 文件就是调试大脑。Claude 应该能从任何中断点完美恢复。
152
+
153
+ </resume_behavior>
154
+
155
+ <size_constraint>
156
+
157
+ 保持调试文件聚焦:
158
+ - 证据条目: 每个 1-2 行,只记录事实
159
+ - 已排除: 简短,假设 + 为什么失败
160
+ - 不要叙述性散文,只要结构化数据
161
+
162
+ 如果证据增长很大 (10+ 条目),考虑是否在兜圈子。检查已排除确保没有重复。
163
+
164
+ </size_constraint>
@@ -0,0 +1,180 @@
1
+ # UAT 模板
2
+
3
+ `.planning/phases/XX-name/{phase_num}-UAT.md` 的模板,持久化的 UAT 会话追踪。
4
+
5
+ ---
6
+
7
+ ## 文件模板
8
+
9
+ ```markdown
10
+ ---
11
+ status: testing | complete | diagnosed
12
+ phase: XX-name
13
+ source: [被测试的 SUMMARY.md 文件列表]
14
+ started: [ISO 时间戳]
15
+ updated: [ISO 时间戳]
16
+ ---
17
+
18
+ ## 当前测试
19
+ <!-- 每次测试时覆盖,显示当前位置 -->
20
+
21
+ number: [N]
22
+ name: [测试名称]
23
+ expected: |
24
+ [用户应该观察到什么]
25
+ awaiting: 用户响应
26
+
27
+ ## 测试
28
+
29
+ ### 1. [测试名称]
30
+ expected: [可观测行为 — 用户应该看到什么]
31
+ result: [pending]
32
+
33
+ ### 2. [测试名称]
34
+ expected: [可观测行为]
35
+ result: pass
36
+
37
+ ### 3. [测试名称]
38
+ expected: [可观测行为]
39
+ result: issue
40
+ reported: "[用户原话]"
41
+ severity: major
42
+
43
+ ### 4. [测试名称]
44
+ expected: [可观测行为]
45
+ result: skipped
46
+ reason: [跳过原因]
47
+
48
+ ...
49
+
50
+ ## 总结
51
+
52
+ total: [N]
53
+ passed: [N]
54
+ issues: [N]
55
+ pending: [N]
56
+ skipped: [N]
57
+
58
+ ## 缺口
59
+
60
+ <!-- YAML 格式供 plan-phase --gaps 消费 -->
61
+ - truth: "[测试中的预期行为]"
62
+ status: failed
63
+ reason: "用户报告: [原话]"
64
+ severity: blocker | major | minor | cosmetic
65
+ test: [N]
66
+ root_cause: "" # 诊断后填写
67
+ artifacts: [] # 诊断后填写
68
+ missing: [] # 诊断后填写
69
+ debug_session: "" # 诊断后填写
70
+ ```
71
+
72
+ ---
73
+
74
+ <section_rules>
75
+
76
+ **Frontmatter:**
77
+ - `status`: 覆盖 - "testing" 或 "complete"
78
+ - `phase`: 不可变 - 创建时设置
79
+ - `source`: 不可变 - 被测试的 SUMMARY 文件
80
+ - `started`: 不可变 - 创建时设置
81
+ - `updated`: 覆盖 - 每次变更时更新
82
+
83
+ **当前测试:**
84
+ - 每次测试转换时完全覆盖
85
+ - 显示哪个测试活跃以及等待什么
86
+ - 完成时: "[测试完成]"
87
+
88
+ **测试:**
89
+ - 每个测试: 用户响应时覆盖 result 字段
90
+ - `result` 值: [pending], pass, issue, skipped
91
+ - 如果 issue: 添加 `reported` (原话) 和 `severity` (推断)
92
+ - 如果 skipped: 添加 `reason` (如提供)
93
+
94
+ **总结:**
95
+ - 每次响应后覆盖计数
96
+ - 追踪: total, passed, issues, pending, skipped
97
+
98
+ **缺口:**
99
+ - 发现问题时仅追加 (YAML 格式)
100
+ - 诊断后: 填写 `root_cause`, `artifacts`, `missing`, `debug_session`
101
+ - 此部分直接供 /specops:plan-phase --gaps 使用
102
+
103
+ </section_rules>
104
+
105
+ <diagnosis_lifecycle>
106
+
107
+ **测试完成后 (status: complete),如果有缺口:**
108
+
109
+ 1. 用户运行诊断 (从 verify-work 提供或手动)
110
+ 2. diagnose-issues 工作流生成并行调试代理
111
+ 3. 每个代理调查一个缺口,返回根本原因
112
+ 4. UAT.md 缺口部分更新诊断结果:
113
+ - 每个缺口填写 `root_cause`, `artifacts`, `missing`, `debug_session`
114
+ 5. status → "diagnosed"
115
+ 6. 准备好用 /specops:plan-phase --gaps 配合根本原因使用
116
+
117
+ **诊断后:**
118
+ ```yaml
119
+ ## 缺口
120
+
121
+ - truth: "评论提交后立即出现"
122
+ status: failed
123
+ reason: "用户报告: 可以用但要刷新页面才显示"
124
+ severity: major
125
+ test: 2
126
+ root_cause: "CommentList.tsx 中 useEffect 缺少 commentCount 依赖"
127
+ artifacts:
128
+ - path: "src/components/CommentList.tsx"
129
+ issue: "useEffect 缺少依赖"
130
+ missing:
131
+ - "将 commentCount 添加到 useEffect 依赖数组"
132
+ debug_session: ".planning/debug/comment-not-refreshing.md"
133
+ ```
134
+
135
+ </diagnosis_lifecycle>
136
+
137
+ <lifecycle>
138
+
139
+ **创建:** /specops:verify-work 开始新会话时
140
+ - 从 SUMMARY.md 文件提取测试
141
+ - 设置 status 为 "testing"
142
+ - 当前测试指向测试 1
143
+ - 所有测试 result: [pending]
144
+
145
+ **测试期间:**
146
+ - 从当前测试部分展示测试
147
+ - 用户以通过确认或问题描述响应
148
+ - 更新测试结果 (pass/issue/skipped)
149
+ - 更新总结计数
150
+ - 如果 issue: 追加到缺口部分 (YAML 格式),推断严重程度
151
+ - 将当前测试移到下一个 pending 测试
152
+
153
+ **完成时:**
154
+ - status → "complete"
155
+ - 当前测试 → "[测试完成]"
156
+ - 提交文件
157
+ - 展示总结和下一步
158
+
159
+ **在 /clear 后恢复:**
160
+ 1. 读取 frontmatter → 了解阶段和状态
161
+ 2. 读取当前测试 → 了解在哪里
162
+ 3. 找到第一个 [pending] 结果 → 从那里继续
163
+ 4. 总结显示到目前为止的进度
164
+
165
+ </lifecycle>
166
+
167
+ <severity_guide>
168
+
169
+ 严重程度从用户的自然语言推断,永远不要询问。
170
+
171
+ | 用户描述 | 推断 |
172
+ |---------|------|
173
+ | 崩溃、错误、异常、完全失败、无法使用 | blocker |
174
+ | 不工作、没反应、行为错误、缺失 | major |
175
+ | 能用但...、慢、奇怪、小问题 | minor |
176
+ | 颜色、字体、间距、对齐、视觉、看起来不对 | cosmetic |
177
+
178
+ 默认: **major** (安全的默认值,用户可以纠正)
179
+
180
+ </severity_guide>
@@ -0,0 +1,76 @@
1
+ ---
2
+ phase: {N}
3
+ slug: {phase-slug}
4
+ status: draft
5
+ nyquist_compliant: false
6
+ wave_0_complete: false
7
+ created: {date}
8
+ ---
9
+
10
+ # 阶段 {N} — 验证策略
11
+
12
+ > 每阶段的验证契约,用于执行期间的反馈采样。
13
+
14
+ ---
15
+
16
+ ## 测试基础设施
17
+
18
+ | 属性 | 值 |
19
+ |------|-----|
20
+ | **框架** | {pytest 7.x / jest 29.x / vitest / go test / 其他} |
21
+ | **配置文件** | {路径或 "无 — 波次 0 安装"} |
22
+ | **快速运行命令** | `{quick command}` |
23
+ | **完整套件命令** | `{full command}` |
24
+ | **预估运行时间** | ~{N} 秒 |
25
+
26
+ ---
27
+
28
+ ## 采样频率
29
+
30
+ - **每次任务提交后:** 运行 `{quick run command}`
31
+ - **每个计划波次后:** 运行 `{full suite command}`
32
+ - **`/specops:verify-work` 之前:** 完整套件必须全绿
33
+ - **最大反馈延迟:** {N} 秒
34
+
35
+ ---
36
+
37
+ ## 每任务验证映射
38
+
39
+ | 任务 ID | 计划 | 波次 | 需求 | 测试类型 | 自动化命令 | 文件存在 | 状态 |
40
+ |---------|------|------|------|----------|-----------|---------|------|
41
+ | {N}-01-01 | 01 | 1 | REQ-{XX} | unit | `{command}` | ✅ / ❌ W0 | ⬜ 待定 |
42
+
43
+ *状态: ⬜ 待定 · ✅ 通过 · ❌ 失败 · ⚠️ 不稳定*
44
+
45
+ ---
46
+
47
+ ## 波次 0 要求
48
+
49
+ - [ ] `{tests/test_file.py}` — REQ-{XX} 的桩
50
+ - [ ] `{tests/conftest.py}` — 共享 fixtures
51
+ - [ ] `{framework install}` — 如果未检测到框架
52
+
53
+ *如果无需: "现有基础设施覆盖所有阶段需求。"*
54
+
55
+ ---
56
+
57
+ ## 仅手动验证
58
+
59
+ | 行为 | 需求 | 为何手动 | 测试说明 |
60
+ |------|------|---------|---------|
61
+ | {行为} | REQ-{XX} | {原因} | {步骤} |
62
+
63
+ *如果无需: "所有阶段行为都有自动化验证。"*
64
+
65
+ ---
66
+
67
+ ## 验证签核
68
+
69
+ - [ ] 所有任务有 `<automated>` verify 或波次 0 依赖
70
+ - [ ] 采样连续性: 不超过 3 个连续任务无自动化 verify
71
+ - [ ] 波次 0 覆盖所有 MISSING 引用
72
+ - [ ] 无 watch-mode 标志
73
+ - [ ] 反馈延迟 < {N}s
74
+ - [ ] frontmatter 中 `nyquist_compliant: true` 已设置
75
+
76
+ **批准:** {待定 / 已批准 YYYY-MM-DD}