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
@@ -0,0 +1,122 @@
1
+ <purpose>
2
+ 创建 `.continue-here.md` 交接文件,保存完整的工作状态以便跨会话恢复。支持无缝恢复并完整还原上下文。
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ 在开始之前,阅读调用提示的 execution_context 中引用的所有文件。
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ <step name="detect">
12
+ 从最近修改的文件中查找当前阶段目录:
13
+
14
+ ```bash
15
+ # Find most recent phase directory with work
16
+ ls -lt .planning/phases/*/PLAN.md 2>/dev/null | head -1 | grep -oP 'phases/\K[^/]+'
17
+ ```
18
+
19
+ 如果未检测到活跃阶段,询问用户正在暂停哪个阶段的工作。
20
+ </step>
21
+
22
+ <step name="gather">
23
+ **收集完整的交接状态:**
24
+
25
+ 1. **当前位置**:哪个阶段、哪个计划、哪个任务
26
+ 2. **已完成工作**:本次会话完成了什么
27
+ 3. **剩余工作**:当前计划/阶段还剩什么
28
+ 4. **已做决策**:关键决策及其理由
29
+ 5. **阻塞/问题**:任何卡住的地方
30
+ 6. **思维上下文**:当前方法、后续步骤、整体思路
31
+ 7. **已修改文件**:已更改但未提交的内容
32
+
33
+ 如有需要,通过对话式提问向用户确认。
34
+ </step>
35
+
36
+ <step name="write">
37
+ **将交接信息写入 `.planning/phases/XX-name/.continue-here.md`:**
38
+
39
+ ```markdown
40
+ ---
41
+ phase: XX-name
42
+ task: 3
43
+ total_tasks: 7
44
+ status: in_progress
45
+ last_updated: [timestamp from current-timestamp]
46
+ ---
47
+
48
+ <current_state>
49
+ [Where exactly are we? Immediate context]
50
+ </current_state>
51
+
52
+ <completed_work>
53
+
54
+ - Task 1: [name] - Done
55
+ - Task 2: [name] - Done
56
+ - Task 3: [name] - In progress, [what's done]
57
+ </completed_work>
58
+
59
+ <remaining_work>
60
+
61
+ - Task 3: [what's left]
62
+ - Task 4: Not started
63
+ - Task 5: Not started
64
+ </remaining_work>
65
+
66
+ <decisions_made>
67
+
68
+ - Decided to use [X] because [reason]
69
+ - Chose [approach] over [alternative] because [reason]
70
+ </decisions_made>
71
+
72
+ <blockers>
73
+ - [Blocker 1]: [status/workaround]
74
+ </blockers>
75
+
76
+ <context>
77
+ [Mental state, what were you thinking, the plan]
78
+ </context>
79
+
80
+ <next_action>
81
+ Start with: [specific first action when resuming]
82
+ </next_action>
83
+ ```
84
+
85
+ 内容要足够具体,让全新的 Claude 能立即理解。
86
+
87
+ 使用 `current-timestamp` 获取 last_updated 字段。可以使用 init todos(提供时间戳)或直接调用:
88
+ ```bash
89
+ timestamp=$(node .opencode/bin/specops-tools.cjs current-timestamp full --raw)
90
+ ```
91
+ </step>
92
+
93
+ <step name="commit">
94
+ ```bash
95
+ node .opencode/bin/specops-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/phases/*/.continue-here.md
96
+ ```
97
+ </step>
98
+
99
+ <step name="confirm">
100
+ ```
101
+ ✓ Handoff created: .planning/phases/[XX-name]/.continue-here.md
102
+
103
+ Current state:
104
+
105
+ - Phase: [XX-name]
106
+ - Task: [X] of [Y]
107
+ - Status: [in_progress/blocked]
108
+ - Committed as WIP
109
+
110
+ To resume: /specops:resume-work
111
+
112
+ ```
113
+ </step>
114
+
115
+ </process>
116
+
117
+ <success_criteria>
118
+ - [ ] .continue-here.md 已在正确的阶段目录中创建
119
+ - [ ] 所有部分都填写了具体内容
120
+ - [ ] 已作为 WIP 提交
121
+ - [ ] 用户知道文件位置及如何恢复
122
+ </success_criteria>
@@ -0,0 +1,274 @@
1
+ <purpose>
2
+ 创建所有必要的阶段来关闭 `/specops:audit-milestone` 识别出的缺口。读取 MILESTONE-AUDIT.md,将缺口分组为逻辑阶段,在 ROADMAP.md 中创建阶段条目,并提供规划每个阶段的选项。一个命令创建所有修复阶段——无需为每个缺口手动执行 `/specops:add-phase`。
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ 在开始之前,阅读调用提示的 execution_context 中引用的所有文件。
7
+ </required_reading>
8
+
9
+ <process>
10
+
11
+ ## 1. 加载审计结果
12
+
13
+ ```bash
14
+ # 查找最近的审计文件
15
+ ls -t .planning/v*-MILESTONE-AUDIT.md 2>/dev/null | head -1
16
+ ```
17
+
18
+ 解析 YAML frontmatter 以提取结构化缺口:
19
+ - `gaps.requirements` — 未满足的需求
20
+ - `gaps.integration` — 缺失的跨阶段连接
21
+ - `gaps.flows` — 中断的端到端流程
22
+
23
+ 如果没有审计文件或没有缺口,报错:
24
+ ```
25
+ 未找到审计缺口。请先运行 `/specops:audit-milestone`。
26
+ ```
27
+
28
+ ## 2. 确定缺口优先级
29
+
30
+ 按 REQUIREMENTS.md 中的优先级对缺口分组:
31
+
32
+ | 优先级 | 操作 |
33
+ |--------|------|
34
+ | `must` | 创建阶段,阻塞里程碑 |
35
+ | `should` | 创建阶段,推荐 |
36
+ | `nice` | 询问用户:包含还是推迟? |
37
+
38
+ 对于集成/流程缺口,从受影响的需求推断优先级。
39
+
40
+ ## 3. 将缺口分组为阶段
41
+
42
+ 将相关缺口聚类为逻辑阶段:
43
+
44
+ **分组规则:**
45
+ - 影响同一阶段 → 合并为一个修复阶段
46
+ - 同一子系统(认证、API、UI)→ 合并
47
+ - 依赖顺序(先修复桩代码再修复连接)
48
+ - 保持阶段聚焦:每个 2-4 个任务
49
+
50
+ **分组示例:**
51
+ ```
52
+ 缺口:DASH-01 未满足(仪表盘不获取数据)
53
+ 缺口:集成 阶段 1→3(认证未传递到 API 调用)
54
+ 缺口:流程"查看仪表盘"在数据获取处中断
55
+
56
+ → 阶段 6:"连接仪表盘到 API"
57
+ - 在 Dashboard.tsx 中添加 fetch
58
+ - 在 fetch 中包含 auth header
59
+ - 处理响应,更新状态
60
+ - 渲染用户数据
61
+ ```
62
+
63
+ ## 4. 确定阶段编号
64
+
65
+ 找到现有最高阶段编号:
66
+ ```bash
67
+ # 获取排序后的阶段列表,提取最后一个
68
+ PHASES=$(node .opencode/bin/specops-tools.cjs phases list)
69
+ HIGHEST=$(echo "$PHASES" | jq -r '.directories[-1]')
70
+ ```
71
+
72
+ 新阶段从此处继续:
73
+ - 如果阶段 5 是最高的,缺口修复阶段变为阶段 6、7、8……
74
+
75
+ ## 5. 展示缺口修复计划
76
+
77
+ ```markdown
78
+ ## 缺口修复计划
79
+
80
+ **里程碑:** {version}
81
+ **待关闭缺口:** {N} 个需求、{M} 个集成、{K} 个流程
82
+
83
+ ### 拟定阶段
84
+
85
+ **阶段 {N}:{名称}**
86
+ 关闭:
87
+ - {REQ-ID}:{描述}
88
+ - 集成:{from} → {to}
89
+ 任务数:{count}
90
+
91
+ **阶段 {N+1}:{名称}**
92
+ 关闭:
93
+ - {REQ-ID}:{描述}
94
+ - 流程:{流程名称}
95
+ 任务数:{count}
96
+
97
+ {如果存在 nice-to-have 缺口:}
98
+
99
+ ### 已推迟(nice-to-have)
100
+
101
+ 这些缺口是可选的。是否包含?
102
+ - {缺口描述}
103
+ - {缺口描述}
104
+
105
+ ---
106
+
107
+ 创建这 {X} 个阶段?(是 / 调整 / 推迟所有可选项)
108
+ ```
109
+
110
+ 等待用户确认。
111
+
112
+ ## 6. 更新 ROADMAP.md
113
+
114
+ 将新阶段添加到当前里程碑:
115
+
116
+ ```markdown
117
+ ### Phase {N}: {名称}
118
+ **Goal:** {从待关闭的缺口推导}
119
+ **Requirements:** {待满足的 REQ-ID}
120
+ **Gap Closure:** 关闭审计中的缺口
121
+
122
+ ### Phase {N+1}: {名称}
123
+ ...
124
+ ```
125
+
126
+ ## 7. 更新 REQUIREMENTS.md 追溯表(必需)
127
+
128
+ 对于分配到缺口修复阶段的每个 REQ-ID:
129
+ - 更新 Phase 列以反映新的缺口修复阶段
130
+ - 将 Status 重置为 `Pending`
131
+
132
+ 重置审计发现未满足的已勾选需求:
133
+ - 将审计中标记为未满足的需求从 `[x]` 改为 `[ ]`
134
+ - 更新 REQUIREMENTS.md 顶部的覆盖率计数
135
+
136
+ ```bash
137
+ # 验证追溯表反映了缺口修复分配
138
+ grep -c "Pending" .planning/REQUIREMENTS.md
139
+ ```
140
+
141
+ ## 8. 创建阶段目录
142
+
143
+ ```bash
144
+ mkdir -p ".planning/phases/{NN}-{name}"
145
+ ```
146
+
147
+ ## 9. 提交路线图和需求更新
148
+
149
+ ```bash
150
+ node .opencode/bin/specops-tools.cjs commit "docs(roadmap): add gap closure phases {N}-{M}" --files .planning/ROADMAP.md .planning/REQUIREMENTS.md
151
+ ```
152
+
153
+ ## 10. 提供后续步骤
154
+
155
+ ```markdown
156
+ ## ✓ 缺口修复阶段已创建
157
+
158
+ **已添加阶段:** {N} - {M}
159
+ **已处理缺口:** {count} 个需求、{count} 个集成、{count} 个流程
160
+
161
+ ---
162
+
163
+ ## ▶ 下一步
164
+
165
+ **规划第一个缺口修复阶段**
166
+
167
+ `/specops:plan-phase {N}`
168
+
169
+ <sub>先 `/clear` → 全新上下文窗口</sub>
170
+
171
+ ---
172
+
173
+ **其他可用操作:**
174
+ - `/specops:execute-phase {N}` — 如果计划已存在
175
+ - `cat .planning/ROADMAP.md` — 查看更新后的路线图
176
+
177
+ ---
178
+
179
+ **所有缺口阶段完成后:**
180
+
181
+ `/specops:audit-milestone` — 重新审计以验证缺口已关闭
182
+ `/specops:complete-milestone {version}` — 审计通过后归档
183
+ ```
184
+
185
+ </process>
186
+
187
+ <gap_to_phase_mapping>
188
+
189
+ ## 缺口如何变为任务
190
+
191
+ **需求缺口 → 任务:**
192
+ ```yaml
193
+ gap:
194
+ id: DASH-01
195
+ description: "User sees their data"
196
+ reason: "Dashboard exists but doesn't fetch from API"
197
+ missing:
198
+ - "useEffect with fetch to /api/user/data"
199
+ - "State for user data"
200
+ - "Render user data in JSX"
201
+
202
+ becomes:
203
+
204
+ phase: "Wire Dashboard Data"
205
+ tasks:
206
+ - name: "Add data fetching"
207
+ files: [src/components/Dashboard.tsx]
208
+ action: "Add useEffect that fetches /api/user/data on mount"
209
+
210
+ - name: "Add state management"
211
+ files: [src/components/Dashboard.tsx]
212
+ action: "Add useState for userData, loading, error states"
213
+
214
+ - name: "Render user data"
215
+ files: [src/components/Dashboard.tsx]
216
+ action: "Replace placeholder with userData.map rendering"
217
+ ```
218
+
219
+ **集成缺口 → 任务:**
220
+ ```yaml
221
+ gap:
222
+ from_phase: 1
223
+ to_phase: 3
224
+ connection: "Auth token → API calls"
225
+ reason: "Dashboard API calls don't include auth header"
226
+ missing:
227
+ - "Auth header in fetch calls"
228
+ - "Token refresh on 401"
229
+
230
+ becomes:
231
+
232
+ phase: "Add Auth to Dashboard API Calls"
233
+ tasks:
234
+ - name: "Add auth header to fetches"
235
+ files: [src/components/Dashboard.tsx, src/lib/api.ts]
236
+ action: "Include Authorization header with token in all API calls"
237
+
238
+ - name: "Handle 401 responses"
239
+ files: [src/lib/api.ts]
240
+ action: "Add interceptor to refresh token or redirect to login on 401"
241
+ ```
242
+
243
+ **流程缺口 → 任务:**
244
+ ```yaml
245
+ gap:
246
+ name: "User views dashboard after login"
247
+ broken_at: "Dashboard data load"
248
+ reason: "No fetch call"
249
+ missing:
250
+ - "Fetch user data on mount"
251
+ - "Display loading state"
252
+ - "Render user data"
253
+
254
+ becomes:
255
+
256
+ # 通常与需求/集成缺口属于同一阶段
257
+ # 流程缺口经常与其他缺口类型重叠
258
+ ```
259
+
260
+ </gap_to_phase_mapping>
261
+
262
+ <success_criteria>
263
+ - [ ] 已加载 MILESTONE-AUDIT.md 并解析缺口
264
+ - [ ] 已确定缺口优先级(must/should/nice)
265
+ - [ ] 已将缺口分组为逻辑阶段
266
+ - [ ] 用户已确认阶段计划
267
+ - [ ] 已更新 ROADMAP.md 添加新阶段
268
+ - [ ] 已更新 REQUIREMENTS.md 追溯表的缺口修复阶段分配
269
+ - [ ] 已重置未满足需求的复选框(`[x]` → `[ ]`)
270
+ - [ ] 已更新 REQUIREMENTS.md 中的覆盖率计数
271
+ - [ ] 已创建阶段目录
272
+ - [ ] 已提交变更(包含 REQUIREMENTS.md)
273
+ - [ ] 用户知道接下来运行 `/specops:plan-phase`
274
+ </success_criteria>