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,453 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
使用 SpecOps 保证(原子提交、STATE.md 追踪)执行小型临时任务。快速模式生成 specops-planner(快速模式)+ specops-executor,在 `.planning/quick/` 中追踪任务,并更新 STATE.md 的"Quick Tasks Completed"表。
|
|
3
|
+
|
|
4
|
+
使用 `--full` 标志:启用计划检查(最多 2 次迭代)和执行后验证,在不需要完整里程碑仪式的情况下提供质量保证。
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<required_reading>
|
|
8
|
+
在开始之前,阅读调用提示的 execution_context 中引用的所有文件。
|
|
9
|
+
</required_reading>
|
|
10
|
+
|
|
11
|
+
<process>
|
|
12
|
+
**步骤 1:解析参数并获取任务描述**
|
|
13
|
+
|
|
14
|
+
解析 `$ARGUMENTS`:
|
|
15
|
+
- `--full` 标志 → 存储为 `$FULL_MODE`(true/false)
|
|
16
|
+
- 剩余文本 → 如果非空则用作 `$DESCRIPTION`
|
|
17
|
+
|
|
18
|
+
如果解析后 `$DESCRIPTION` 为空,交互式提示用户:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
AskUserQuestion(
|
|
22
|
+
header: "快速任务",
|
|
23
|
+
question: "你想做什么?",
|
|
24
|
+
followUp: null
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
将回复存储为 `$DESCRIPTION`。
|
|
29
|
+
|
|
30
|
+
如果仍为空,重新提示:"请提供任务描述。"
|
|
31
|
+
|
|
32
|
+
如果 `$FULL_MODE`:
|
|
33
|
+
```
|
|
34
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
35
|
+
SpecOps ► 快速任务(完整模式)
|
|
36
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
37
|
+
|
|
38
|
+
◆ 计划检查 + 验证已启用
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
**步骤 2:初始化**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
INIT=$(node .opencode/bin/specops-tools.cjs init quick "$DESCRIPTION")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
解析 JSON 获取:`planner_model`、`executor_model`、`checker_model`、`verifier_model`、`commit_docs`、`next_num`、`slug`、`date`、`timestamp`、`quick_dir`、`task_dir`、`roadmap_exists`、`planning_exists`。
|
|
50
|
+
|
|
51
|
+
**如果 `roadmap_exists` 为 false:** 错误——快速模式需要一个带 ROADMAP.md 的活跃项目。请先运行 `/specops:new-project`。
|
|
52
|
+
|
|
53
|
+
快速任务可以在阶段中途运行——验证只检查 ROADMAP.md 是否存在,不检查阶段状态。
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
**步骤 3:创建任务目录**
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
mkdir -p "${task_dir}"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
**步骤 4:创建快速任务目录**
|
|
66
|
+
|
|
67
|
+
为此快速任务创建目录:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
QUICK_DIR=".planning/quick/${next_num}-${slug}"
|
|
71
|
+
mkdir -p "$QUICK_DIR"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
向用户报告:
|
|
75
|
+
```
|
|
76
|
+
正在创建快速任务 ${next_num}:${DESCRIPTION}
|
|
77
|
+
目录:${QUICK_DIR}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
存储 `$QUICK_DIR` 供编排使用。
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
**步骤 5:生成规划器(快速模式)**
|
|
85
|
+
|
|
86
|
+
**如果 `$FULL_MODE`:** 使用 `quick-full` 模式,约束更严格。
|
|
87
|
+
|
|
88
|
+
**如果非 `$FULL_MODE`:** 使用标准 `quick` 模式。
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Task(
|
|
92
|
+
prompt="
|
|
93
|
+
<planning_context>
|
|
94
|
+
|
|
95
|
+
**Mode:** ${FULL_MODE ? 'quick-full' : 'quick'}
|
|
96
|
+
**Directory:** ${QUICK_DIR}
|
|
97
|
+
**Description:** ${DESCRIPTION}
|
|
98
|
+
|
|
99
|
+
<files_to_read>
|
|
100
|
+
- .planning/STATE.md (Project State)
|
|
101
|
+
- ./CLAUDE.md (if exists — follow project-specific guidelines)
|
|
102
|
+
</files_to_read>
|
|
103
|
+
|
|
104
|
+
**Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, plans should account for project skill rules
|
|
105
|
+
|
|
106
|
+
</planning_context>
|
|
107
|
+
|
|
108
|
+
<constraints>
|
|
109
|
+
- Create a SINGLE plan with 1-3 focused tasks
|
|
110
|
+
- Quick tasks should be atomic and self-contained
|
|
111
|
+
- No research phase
|
|
112
|
+
${FULL_MODE ? '- Target ~40% context usage (structured for verification)' : '- Target ~30% context usage (simple, focused)'}
|
|
113
|
+
${FULL_MODE ? '- MUST generate `must_haves` in plan frontmatter (truths, artifacts, key_links)' : ''}
|
|
114
|
+
${FULL_MODE ? '- Each task MUST have `files`, `action`, `verify`, `done` fields' : ''}
|
|
115
|
+
</constraints>
|
|
116
|
+
|
|
117
|
+
<output>
|
|
118
|
+
Write plan to: ${QUICK_DIR}/${next_num}-PLAN.md
|
|
119
|
+
Return: ## PLANNING COMPLETE with plan path
|
|
120
|
+
</output>
|
|
121
|
+
",
|
|
122
|
+
subagent_type="specops-planner",
|
|
123
|
+
model="{planner_model}",
|
|
124
|
+
description="Quick plan: ${DESCRIPTION}"
|
|
125
|
+
)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
规划器返回后:
|
|
129
|
+
1. 验证计划存在于 `${QUICK_DIR}/${next_num}-PLAN.md`
|
|
130
|
+
2. 提取计划数量(快速任务通常为 1)
|
|
131
|
+
3. 报告:"计划已创建:${QUICK_DIR}/${next_num}-PLAN.md"
|
|
132
|
+
|
|
133
|
+
如果未找到计划,报错:"规划器未能创建 ${next_num}-PLAN.md"
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
**步骤 5.5:计划检查循环(仅在 `$FULL_MODE` 时)**
|
|
138
|
+
|
|
139
|
+
如果非 `$FULL_MODE` 则完全跳过此步骤。
|
|
140
|
+
|
|
141
|
+
显示横幅:
|
|
142
|
+
```
|
|
143
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
144
|
+
SpecOps ► 检查计划
|
|
145
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
|
|
147
|
+
◆ 生成计划检查器……
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
检查器提示:
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
<verification_context>
|
|
154
|
+
**Mode:** quick-full
|
|
155
|
+
**Task Description:** ${DESCRIPTION}
|
|
156
|
+
|
|
157
|
+
<files_to_read>
|
|
158
|
+
- ${QUICK_DIR}/${next_num}-PLAN.md (Plan to verify)
|
|
159
|
+
</files_to_read>
|
|
160
|
+
|
|
161
|
+
**Scope:** This is a quick task, not a full phase. Skip checks that require a ROADMAP phase goal.
|
|
162
|
+
</verification_context>
|
|
163
|
+
|
|
164
|
+
<check_dimensions>
|
|
165
|
+
- Requirement coverage: Does the plan address the task description?
|
|
166
|
+
- Task completeness: Do tasks have files, action, verify, done fields?
|
|
167
|
+
- Key links: Are referenced files real?
|
|
168
|
+
- Scope sanity: Is this appropriately sized for a quick task (1-3 tasks)?
|
|
169
|
+
- must_haves derivation: Are must_haves traceable to the task description?
|
|
170
|
+
|
|
171
|
+
Skip: context compliance (no CONTEXT.md), cross-plan deps (single plan), ROADMAP alignment
|
|
172
|
+
</check_dimensions>
|
|
173
|
+
|
|
174
|
+
<expected_output>
|
|
175
|
+
- ## VERIFICATION PASSED — all checks pass
|
|
176
|
+
- ## ISSUES FOUND — structured issue list
|
|
177
|
+
</expected_output>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Task(
|
|
182
|
+
prompt=checker_prompt,
|
|
183
|
+
subagent_type="specops-plan-checker",
|
|
184
|
+
model="{checker_model}",
|
|
185
|
+
description="Check quick plan: ${DESCRIPTION}"
|
|
186
|
+
)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**处理检查器返回:**
|
|
190
|
+
|
|
191
|
+
- **`## VERIFICATION PASSED`:** 显示确认,继续到步骤 6。
|
|
192
|
+
- **`## ISSUES FOUND`:** 显示问题,检查迭代次数,进入修订循环。
|
|
193
|
+
|
|
194
|
+
**修订循环(最多 2 次迭代):**
|
|
195
|
+
|
|
196
|
+
追踪 `iteration_count`(初始计划 + 检查后从 1 开始)。
|
|
197
|
+
|
|
198
|
+
**如果 iteration_count < 2:**
|
|
199
|
+
|
|
200
|
+
显示:`发回规划器修订……(迭代 ${N}/2)`
|
|
201
|
+
|
|
202
|
+
修订提示:
|
|
203
|
+
|
|
204
|
+
```markdown
|
|
205
|
+
<revision_context>
|
|
206
|
+
**Mode:** quick-full (revision)
|
|
207
|
+
|
|
208
|
+
<files_to_read>
|
|
209
|
+
- ${QUICK_DIR}/${next_num}-PLAN.md (Existing plan)
|
|
210
|
+
</files_to_read>
|
|
211
|
+
|
|
212
|
+
**Checker issues:** ${structured_issues_from_checker}
|
|
213
|
+
|
|
214
|
+
</revision_context>
|
|
215
|
+
|
|
216
|
+
<instructions>
|
|
217
|
+
Make targeted updates to address checker issues.
|
|
218
|
+
Do NOT replan from scratch unless issues are fundamental.
|
|
219
|
+
Return what changed.
|
|
220
|
+
</instructions>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
Task(
|
|
225
|
+
prompt="First, read .opencode/agent/specops-planner.md for your role and instructions.\n\n" + revision_prompt,
|
|
226
|
+
subagent_type="general-purpose",
|
|
227
|
+
model="{planner_model}",
|
|
228
|
+
description="Revise quick plan: ${DESCRIPTION}"
|
|
229
|
+
)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
规划器返回后 → 再次生成检查器,递增 iteration_count。
|
|
233
|
+
|
|
234
|
+
**如果 iteration_count >= 2:**
|
|
235
|
+
|
|
236
|
+
显示:`已达最大迭代次数。剩余 ${N} 个问题:` + 问题列表
|
|
237
|
+
|
|
238
|
+
提供选项:1) 强制继续,2) 中止
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
**步骤 6:生成执行器**
|
|
243
|
+
|
|
244
|
+
使用计划引用生成 specops-executor:
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Task(
|
|
248
|
+
prompt="
|
|
249
|
+
Execute quick task ${next_num}.
|
|
250
|
+
|
|
251
|
+
<files_to_read>
|
|
252
|
+
- ${QUICK_DIR}/${next_num}-PLAN.md (Plan)
|
|
253
|
+
- .planning/STATE.md (Project state)
|
|
254
|
+
- ./CLAUDE.md (Project instructions, if exists)
|
|
255
|
+
- .agents/skills/ (Project skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
|
|
256
|
+
</files_to_read>
|
|
257
|
+
|
|
258
|
+
<constraints>
|
|
259
|
+
- Execute all tasks in the plan
|
|
260
|
+
- Commit each task atomically
|
|
261
|
+
- Create summary at: ${QUICK_DIR}/${next_num}-SUMMARY.md
|
|
262
|
+
- Do NOT update ROADMAP.md (quick tasks are separate from planned phases)
|
|
263
|
+
</constraints>
|
|
264
|
+
",
|
|
265
|
+
subagent_type="specops-executor",
|
|
266
|
+
model="{executor_model}",
|
|
267
|
+
description="Execute: ${DESCRIPTION}"
|
|
268
|
+
)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
执行器返回后:
|
|
272
|
+
1. 验证摘要存在于 `${QUICK_DIR}/${next_num}-SUMMARY.md`
|
|
273
|
+
2. 从执行器输出提取提交哈希
|
|
274
|
+
3. 报告完成状态
|
|
275
|
+
|
|
276
|
+
**已知 Claude Code bug(classifyHandoffIfNeeded):** 如果执行器报告"失败"且错误为 `classifyHandoffIfNeeded is not defined`,这是 Claude Code 运行时 bug——不是真正的失败。检查摘要文件是否存在以及 git log 是否显示提交。如果是,视为成功。
|
|
277
|
+
|
|
278
|
+
如果未找到摘要,报错:"执行器未能创建 ${next_num}-SUMMARY.md"
|
|
279
|
+
|
|
280
|
+
注意:对于产生多个计划的快速任务(罕见),按 execute-phase 模式并行波次生成执行器。
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
**步骤 6.5:验证(仅在 `$FULL_MODE` 时)**
|
|
285
|
+
|
|
286
|
+
如果非 `$FULL_MODE` 则完全跳过此步骤。
|
|
287
|
+
|
|
288
|
+
显示横幅:
|
|
289
|
+
```
|
|
290
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
291
|
+
SpecOps ► 验证结果
|
|
292
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
293
|
+
|
|
294
|
+
◆ 生成验证器……
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
Task(
|
|
299
|
+
prompt="Verify quick task goal achievement.
|
|
300
|
+
Task directory: ${QUICK_DIR}
|
|
301
|
+
Task goal: ${DESCRIPTION}
|
|
302
|
+
|
|
303
|
+
<files_to_read>
|
|
304
|
+
- ${QUICK_DIR}/${next_num}-PLAN.md (Plan)
|
|
305
|
+
</files_to_read>
|
|
306
|
+
|
|
307
|
+
Check must_haves against actual codebase. Create VERIFICATION.md at ${QUICK_DIR}/${next_num}-VERIFICATION.md.",
|
|
308
|
+
subagent_type="specops-verifier",
|
|
309
|
+
model="{verifier_model}",
|
|
310
|
+
description="Verify: ${DESCRIPTION}"
|
|
311
|
+
)
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
读取验证状态:
|
|
315
|
+
```bash
|
|
316
|
+
grep "^status:" "${QUICK_DIR}/${next_num}-VERIFICATION.md" | cut -d: -f2 | tr -d ' '
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
存储为 `$VERIFICATION_STATUS`。
|
|
320
|
+
|
|
321
|
+
| 状态 | 操作 |
|
|
322
|
+
|------|------|
|
|
323
|
+
| `passed` | 存储 `$VERIFICATION_STATUS = "Verified"`,继续到步骤 7 |
|
|
324
|
+
| `human_needed` | 显示需要手动检查的项目,存储 `$VERIFICATION_STATUS = "Needs Review"`,继续 |
|
|
325
|
+
| `gaps_found` | 显示缺口摘要,提供选项:1) 重新运行执行器修复缺口,2) 按现状接受。存储 `$VERIFICATION_STATUS = "Gaps"` |
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
**步骤 7:更新 STATE.md**
|
|
330
|
+
|
|
331
|
+
用快速任务完成记录更新 STATE.md。
|
|
332
|
+
|
|
333
|
+
**7a. 检查"Quick Tasks Completed"部分是否存在:**
|
|
334
|
+
|
|
335
|
+
读取 STATE.md 并检查 `### Quick Tasks Completed` 部分。
|
|
336
|
+
|
|
337
|
+
**7b. 如果部分不存在,创建它:**
|
|
338
|
+
|
|
339
|
+
在 `### Blockers/Concerns` 部分之后插入:
|
|
340
|
+
|
|
341
|
+
**如果 `$FULL_MODE`:**
|
|
342
|
+
```markdown
|
|
343
|
+
### Quick Tasks Completed
|
|
344
|
+
|
|
345
|
+
| # | Description | Date | Commit | Status | Directory |
|
|
346
|
+
|---|-------------|------|--------|--------|-----------|
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**如果非 `$FULL_MODE`:**
|
|
350
|
+
```markdown
|
|
351
|
+
### Quick Tasks Completed
|
|
352
|
+
|
|
353
|
+
| # | Description | Date | Commit | Directory |
|
|
354
|
+
|---|-------------|------|--------|-----------|
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**注意:** 如果表格已存在,匹配其现有列格式。如果向已有不带 Status 列的快速任务的项目添加 `--full`,在表头和分隔行添加 Status 列,并为新行的前置行留空 Status。
|
|
358
|
+
|
|
359
|
+
**7c. 向表格追加新行:**
|
|
360
|
+
|
|
361
|
+
使用 init 中的 `date`:
|
|
362
|
+
|
|
363
|
+
**如果 `$FULL_MODE`(或表格有 Status 列):**
|
|
364
|
+
```markdown
|
|
365
|
+
| ${next_num} | ${DESCRIPTION} | ${date} | ${commit_hash} | ${VERIFICATION_STATUS} | [${next_num}-${slug}](./quick/${next_num}-${slug}/) |
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**如果非 `$FULL_MODE`(且表格无 Status 列):**
|
|
369
|
+
```markdown
|
|
370
|
+
| ${next_num} | ${DESCRIPTION} | ${date} | ${commit_hash} | [${next_num}-${slug}](./quick/${next_num}-${slug}/) |
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**7d. 更新"Last activity"行:**
|
|
374
|
+
|
|
375
|
+
使用 init 中的 `date`:
|
|
376
|
+
```
|
|
377
|
+
Last activity: ${date} - Completed quick task ${next_num}: ${DESCRIPTION}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
使用 Edit 工具原子化地进行这些更改
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
**步骤 8:最终提交和完成**
|
|
385
|
+
|
|
386
|
+
暂存并提交快速任务产物:
|
|
387
|
+
|
|
388
|
+
构建文件列表:
|
|
389
|
+
- `${QUICK_DIR}/${next_num}-PLAN.md`
|
|
390
|
+
- `${QUICK_DIR}/${next_num}-SUMMARY.md`
|
|
391
|
+
- `.planning/STATE.md`
|
|
392
|
+
- 如果 `$FULL_MODE` 且验证文件存在:`${QUICK_DIR}/${next_num}-VERIFICATION.md`
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
node .opencode/bin/specops-tools.cjs commit "docs(quick-${next_num}): ${DESCRIPTION}" --files ${file_list}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
获取最终提交哈希:
|
|
399
|
+
```bash
|
|
400
|
+
commit_hash=$(git rev-parse --short HEAD)
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
显示完成输出:
|
|
404
|
+
|
|
405
|
+
**如果 `$FULL_MODE`:**
|
|
406
|
+
```
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
SpecOps > 快速任务完成(完整模式)
|
|
410
|
+
|
|
411
|
+
快速任务 ${next_num}:${DESCRIPTION}
|
|
412
|
+
|
|
413
|
+
摘要:${QUICK_DIR}/${next_num}-SUMMARY.md
|
|
414
|
+
验证:${QUICK_DIR}/${next_num}-VERIFICATION.md(${VERIFICATION_STATUS})
|
|
415
|
+
提交:${commit_hash}
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
准备好下一个任务:/specops:quick
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**如果非 `$FULL_MODE`:**
|
|
423
|
+
```
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
SpecOps > 快速任务完成
|
|
427
|
+
|
|
428
|
+
快速任务 ${next_num}:${DESCRIPTION}
|
|
429
|
+
|
|
430
|
+
摘要:${QUICK_DIR}/${next_num}-SUMMARY.md
|
|
431
|
+
提交:${commit_hash}
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
准备好下一个任务:/specops:quick
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
</process>
|
|
439
|
+
|
|
440
|
+
<success_criteria>
|
|
441
|
+
- [ ] ROADMAP.md 验证通过
|
|
442
|
+
- [ ] 用户提供了任务描述
|
|
443
|
+
- [ ] 存在时已从参数解析 `--full` 标志
|
|
444
|
+
- [ ] 已生成 slug(小写、连字符、最多 40 字符)
|
|
445
|
+
- [ ] 已计算下一个编号(001、002、003……)
|
|
446
|
+
- [ ] 已在 `.planning/quick/NNN-slug/` 创建目录
|
|
447
|
+
- [ ] 规划器已创建 `${next_num}-PLAN.md`
|
|
448
|
+
- [ ] (--full)计划检查器已验证计划,修订循环上限为 2
|
|
449
|
+
- [ ] 执行器已创建 `${next_num}-SUMMARY.md`
|
|
450
|
+
- [ ] (--full)验证器已创建 `${next_num}-VERIFICATION.md`
|
|
451
|
+
- [ ] STATE.md 已更新快速任务行(--full 时包含 Status 列)
|
|
452
|
+
- [ ] 产物已提交
|
|
453
|
+
</success_criteria>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
从项目路线图中移除一个未开始的未来阶段,删除其目录,重新编号所有后续阶段以保持干净的线性序列,并提交更改。git 提交记录作为移除的历史记录。
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<required_reading>
|
|
6
|
+
在开始之前,阅读调用提示的 execution_context 中引用的所有文件。
|
|
7
|
+
</required_reading>
|
|
8
|
+
|
|
9
|
+
<process>
|
|
10
|
+
|
|
11
|
+
<step name="parse_arguments">
|
|
12
|
+
解析命令参数:
|
|
13
|
+
- 参数是要移除的阶段编号(整数或小数)
|
|
14
|
+
- 示例:`/specops:remove-phase 17` → phase = 17
|
|
15
|
+
- 示例:`/specops:remove-phase 16.1` → phase = 16.1
|
|
16
|
+
|
|
17
|
+
如果未提供参数:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
ERROR: Phase number required
|
|
21
|
+
Usage: /specops:remove-phase <phase-number>
|
|
22
|
+
Example: /specops:remove-phase 17
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
退出。
|
|
26
|
+
</step>
|
|
27
|
+
|
|
28
|
+
<step name="init_context">
|
|
29
|
+
加载阶段操作上下文:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
INIT=$(node .opencode/bin/specops-tools.cjs init phase-op "${target}")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
提取:`phase_found`、`phase_dir`、`phase_number`、`commit_docs`、`roadmap_exists`。
|
|
36
|
+
|
|
37
|
+
同时读取 STATE.md 和 ROADMAP.md 内容以解析当前位置。
|
|
38
|
+
</step>
|
|
39
|
+
|
|
40
|
+
<step name="validate_future_phase">
|
|
41
|
+
验证该阶段是未来阶段(未开始):
|
|
42
|
+
|
|
43
|
+
1. 将目标阶段与 STATE.md 中的当前阶段进行比较
|
|
44
|
+
2. 目标必须 > 当前阶段编号
|
|
45
|
+
|
|
46
|
+
如果 target <= 当前阶段:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
ERROR: Cannot remove Phase {target}
|
|
50
|
+
|
|
51
|
+
Only future phases can be removed:
|
|
52
|
+
- Current phase: {current}
|
|
53
|
+
- Phase {target} is current or completed
|
|
54
|
+
|
|
55
|
+
To abandon current work, use /specops:pause-work instead.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
退出。
|
|
59
|
+
</step>
|
|
60
|
+
|
|
61
|
+
<step name="confirm_removal">
|
|
62
|
+
展示移除摘要并确认:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Removing Phase {target}: {Name}
|
|
66
|
+
|
|
67
|
+
This will:
|
|
68
|
+
- Delete: .planning/phases/{target}-{slug}/
|
|
69
|
+
- Renumber all subsequent phases
|
|
70
|
+
- Update: ROADMAP.md, STATE.md
|
|
71
|
+
|
|
72
|
+
Proceed? (y/n)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
等待确认。
|
|
76
|
+
</step>
|
|
77
|
+
|
|
78
|
+
<step name="execute_removal">
|
|
79
|
+
**将整个移除操作委托给 specops-tools:**
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
RESULT=$(node .opencode/bin/specops-tools.cjs phase remove "${target}")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
如果该阶段有已执行的计划(SUMMARY.md 文件),specops-tools 会报错。仅在用户确认后使用 `--force`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
RESULT=$(node .opencode/bin/specops-tools.cjs phase remove "${target}" --force)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
CLI 处理以下操作:
|
|
92
|
+
- 删除阶段目录
|
|
93
|
+
- 重新编号所有后续目录(按逆序避免冲突)
|
|
94
|
+
- 重命名重新编号目录中的所有文件(PLAN.md、SUMMARY.md 等)
|
|
95
|
+
- 更新 ROADMAP.md(移除部分、重新编号所有阶段引用、更新依赖)
|
|
96
|
+
- 更新 STATE.md(递减阶段计数)
|
|
97
|
+
|
|
98
|
+
从结果中提取:`removed`、`directory_deleted`、`renamed_directories`、`renamed_files`、`roadmap_updated`、`state_updated`。
|
|
99
|
+
</step>
|
|
100
|
+
|
|
101
|
+
<step name="commit">
|
|
102
|
+
暂存并提交移除:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
node .opencode/bin/specops-tools.cjs commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
提交消息保留了被移除内容的历史记录。
|
|
109
|
+
</step>
|
|
110
|
+
|
|
111
|
+
<step name="completion">
|
|
112
|
+
展示完成摘要:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
Phase {target} ({original-name}) removed.
|
|
116
|
+
|
|
117
|
+
Changes:
|
|
118
|
+
- Deleted: .planning/phases/{target}-{slug}/
|
|
119
|
+
- Renumbered: {N} directories and {M} files
|
|
120
|
+
- Updated: ROADMAP.md, STATE.md
|
|
121
|
+
- Committed: chore: remove phase {target} ({original-name})
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## What's Next
|
|
126
|
+
|
|
127
|
+
Would you like to:
|
|
128
|
+
- `/specops:progress` — see updated roadmap status
|
|
129
|
+
- Continue with current phase
|
|
130
|
+
- Review roadmap
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
```
|
|
134
|
+
</step>
|
|
135
|
+
|
|
136
|
+
</process>
|
|
137
|
+
|
|
138
|
+
<anti_patterns>
|
|
139
|
+
|
|
140
|
+
- 不要在没有 --force 的情况下移除已完成的阶段(有 SUMMARY.md 文件)
|
|
141
|
+
- 不要移除当前或过去的阶段
|
|
142
|
+
- 不要手动重新编号 — 使用 `specops-tools phase remove` 处理所有重新编号
|
|
143
|
+
- 不要在 STATE.md 中添加"已移除阶段"备注 — git 提交就是记录
|
|
144
|
+
- 不要修改已完成阶段的目录
|
|
145
|
+
</anti_patterns>
|
|
146
|
+
|
|
147
|
+
<success_criteria>
|
|
148
|
+
阶段移除完成的条件:
|
|
149
|
+
|
|
150
|
+
- [ ] 目标阶段已验证为未来/未开始状态
|
|
151
|
+
- [ ] `specops-tools phase remove` 执行成功
|
|
152
|
+
- [ ] 更改已提交并附有描述性消息
|
|
153
|
+
- [ ] 用户已被告知更改内容
|
|
154
|
+
</success_criteria>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
研究如何实现某个阶段。使用阶段上下文生成 specops-phase-researcher。
|
|
3
|
+
|
|
4
|
+
独立的研究命令。大多数工作流中,建议使用 `/specops:plan-phase`,它会自动集成研究流程。
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<process>
|
|
8
|
+
|
|
9
|
+
## Step 0: 解析模型配置
|
|
10
|
+
|
|
11
|
+
@.opencode/references/model-profile-resolution.md
|
|
12
|
+
|
|
13
|
+
解析以下模型:
|
|
14
|
+
- `specops-phase-researcher`
|
|
15
|
+
|
|
16
|
+
## Step 1: 规范化并验证阶段
|
|
17
|
+
|
|
18
|
+
@.opencode/references/phase-argument-parsing.md
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
PHASE_INFO=$(node .opencode/bin/specops-tools.cjs roadmap get-phase "${PHASE}")
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
如果 `found` 为 false:报错并退出。
|
|
25
|
+
|
|
26
|
+
## Step 2: 检查已有研究
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
如果已存在:提供更新/查看/跳过选项。
|
|
33
|
+
|
|
34
|
+
## Step 3: 收集阶段上下文
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
INIT=$(node .opencode/bin/specops-tools.cjs init phase-op "${PHASE}")
|
|
38
|
+
# Extract: phase_dir, padded_phase, phase_number, state_path, requirements_path, context_path
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Step 4: 生成研究 Agent
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Task(
|
|
45
|
+
prompt="<objective>
|
|
46
|
+
Research implementation approach for Phase {phase}: {name}
|
|
47
|
+
</objective>
|
|
48
|
+
|
|
49
|
+
<files_to_read>
|
|
50
|
+
- {context_path} (USER DECISIONS from /specops:discuss-phase)
|
|
51
|
+
- {requirements_path} (Project requirements)
|
|
52
|
+
- {state_path} (Project decisions and history)
|
|
53
|
+
</files_to_read>
|
|
54
|
+
|
|
55
|
+
<additional_context>
|
|
56
|
+
Phase description: {description}
|
|
57
|
+
</additional_context>
|
|
58
|
+
|
|
59
|
+
<output>
|
|
60
|
+
Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
|
|
61
|
+
</output>",
|
|
62
|
+
subagent_type="specops-phase-researcher",
|
|
63
|
+
model="{researcher_model}"
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Step 5: 处理返回结果
|
|
68
|
+
|
|
69
|
+
- `## RESEARCH COMPLETE` — 显示摘要,提供选项:规划/深入研究/审查/完成
|
|
70
|
+
- `## CHECKPOINT REACHED` — 展示给用户,生成后续任务
|
|
71
|
+
- `## RESEARCH INCONCLUSIVE` — 显示尝试记录,提供选项:补充上下文/尝试其他模式/手动处理
|
|
72
|
+
|
|
73
|
+
</process>
|