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,249 @@
1
+ # 延续格式
2
+
3
+ 完成命令或工作流后呈现下一步的标准格式。
4
+
5
+ ## 核心结构
6
+
7
+ ```
8
+ ---
9
+
10
+ ## ▶ Next Up
11
+
12
+ **{identifier}: {name}** — {one-line description}
13
+
14
+ `{command to copy-paste}`
15
+
16
+ <sub>`/clear` first → fresh context window</sub>
17
+
18
+ ---
19
+
20
+ **Also available:**
21
+ - `{alternative option 1}` — description
22
+ - `{alternative option 2}` — description
23
+
24
+ ---
25
+ ```
26
+
27
+ ## 格式规则
28
+
29
+ 1. **始终展示它是什么** - 名称 + 描述,永远不要只有命令路径
30
+ 2. **从源头拉取上下文** - ROADMAP.md 用于阶段,PLAN.md `<objective>` 用于计划
31
+ 3. **命令用行内代码** - 反引号,易于复制粘贴,渲染为可点击链接
32
+ 4. **`/clear` 说明** - 始终包含,保持简洁但解释原因
33
+ 5. **"Also available" 而非 "Other options"** - 听起来更像应用
34
+ 6. **视觉分隔符** - 上下用 `---` 使其突出
35
+
36
+ ## 变体
37
+
38
+ ### 执行下一个计划
39
+
40
+ ```
41
+ ---
42
+
43
+ ## ▶ Next Up
44
+
45
+ **02-03: Refresh Token Rotation** — Add /api/auth/refresh with sliding expiry
46
+
47
+ `/specops:execute-phase 2`
48
+
49
+ <sub>`/clear` first → fresh context window</sub>
50
+
51
+ ---
52
+
53
+ **Also available:**
54
+ - Review plan before executing
55
+ - `/specops:list-phase-assumptions 2` — check assumptions
56
+
57
+ ---
58
+ ```
59
+
60
+ ### 执行阶段中的最后一个计划
61
+
62
+ 添加说明这是最后一个计划以及之后会发生什么:
63
+
64
+ ```
65
+ ---
66
+
67
+ ## ▶ Next Up
68
+
69
+ **02-03: Refresh Token Rotation** — Add /api/auth/refresh with sliding expiry
70
+ <sub>Final plan in Phase 2</sub>
71
+
72
+ `/specops:execute-phase 2`
73
+
74
+ <sub>`/clear` first → fresh context window</sub>
75
+
76
+ ---
77
+
78
+ **After this completes:**
79
+ - Phase 2 → Phase 3 transition
80
+ - Next: **Phase 3: Core Features** — User dashboard and settings
81
+
82
+ ---
83
+ ```
84
+
85
+ ### 规划一个阶段
86
+
87
+ ```
88
+ ---
89
+
90
+ ## ▶ Next Up
91
+
92
+ **Phase 2: Authentication** — JWT login flow with refresh tokens
93
+
94
+ `/specops:plan-phase 2`
95
+
96
+ <sub>`/clear` first → fresh context window</sub>
97
+
98
+ ---
99
+
100
+ **Also available:**
101
+ - `/specops:discuss-phase 2` — gather context first
102
+ - `/specops:research-phase 2` — investigate unknowns
103
+ - Review roadmap
104
+
105
+ ---
106
+ ```
107
+
108
+ ### 阶段完成,准备下一个
109
+
110
+ 在下一步操作前显示完成状态:
111
+
112
+ ```
113
+ ---
114
+
115
+ ## ✓ Phase 2 Complete
116
+
117
+ 3/3 plans executed
118
+
119
+ ## ▶ Next Up
120
+
121
+ **Phase 3: Core Features** — User dashboard, settings, and data export
122
+
123
+ `/specops:plan-phase 3`
124
+
125
+ <sub>`/clear` first → fresh context window</sub>
126
+
127
+ ---
128
+
129
+ **Also available:**
130
+ - `/specops:discuss-phase 3` — gather context first
131
+ - `/specops:research-phase 3` — investigate unknowns
132
+ - Review what Phase 2 built
133
+
134
+ ---
135
+ ```
136
+
137
+ ### 多个同等选项
138
+
139
+ 当没有明确的主要操作时:
140
+
141
+ ```
142
+ ---
143
+
144
+ ## ▶ Next Up
145
+
146
+ **Phase 3: Core Features** — User dashboard, settings, and data export
147
+
148
+ **To plan directly:** `/specops:plan-phase 3`
149
+
150
+ **To discuss context first:** `/specops:discuss-phase 3`
151
+
152
+ **To research unknowns:** `/specops:research-phase 3`
153
+
154
+ <sub>`/clear` first → fresh context window</sub>
155
+
156
+ ---
157
+ ```
158
+
159
+ ### 里程碑完成
160
+
161
+ ```
162
+ ---
163
+
164
+ ## 🎉 Milestone v1.0 Complete
165
+
166
+ All 4 phases shipped
167
+
168
+ ## ▶ Next Up
169
+
170
+ **Start v1.1** — questioning → research → requirements → roadmap
171
+
172
+ `/specops:new-milestone`
173
+
174
+ <sub>`/clear` first → fresh context window</sub>
175
+
176
+ ---
177
+ ```
178
+
179
+ ## 拉取上下文
180
+
181
+ ### 对于阶段(从 ROADMAP.md):
182
+
183
+ ```markdown
184
+ ### Phase 2: Authentication
185
+ **Goal**: JWT login flow with refresh tokens
186
+ ```
187
+
188
+ 提取:`**Phase 2: Authentication** — JWT login flow with refresh tokens`
189
+
190
+ ### 对于计划(从 ROADMAP.md):
191
+
192
+ ```markdown
193
+ Plans:
194
+ - [ ] 02-03: Add refresh token rotation
195
+ ```
196
+
197
+ 或从 PLAN.md `<objective>`:
198
+
199
+ ```xml
200
+ <objective>
201
+ Add refresh token rotation with sliding expiry window.
202
+
203
+ Purpose: Extend session lifetime without compromising security.
204
+ </objective>
205
+ ```
206
+
207
+ 提取:`**02-03: Refresh Token Rotation** — Add /api/auth/refresh with sliding expiry`
208
+
209
+ ## 反模式
210
+
211
+ ### 不要:只有命令(没有上下文)
212
+
213
+ ```
214
+ ## To Continue
215
+
216
+ Run `/clear`, then paste:
217
+ /specops:execute-phase 2
218
+ ```
219
+
220
+ 用户不知道 02-03 是关于什么的。
221
+
222
+ ### 不要:缺少 /clear 说明
223
+
224
+ ```
225
+ `/specops:plan-phase 3`
226
+
227
+ Run /clear first.
228
+ ```
229
+
230
+ 没有解释为什么。用户可能会跳过。
231
+
232
+ ### 不要:「Other options」措辞
233
+
234
+ ```
235
+ Other options:
236
+ - Review roadmap
237
+ ```
238
+
239
+ 听起来像事后想法。用 "Also available:" 代替。
240
+
241
+ ### 不要:命令用围栏代码块
242
+
243
+ ````
244
+ ```
245
+ /specops:plan-phase 3
246
+ ```
247
+ ````
248
+
249
+ 模板内的围栏代码块会造成嵌套歧义。用行内反引号代替。
@@ -0,0 +1,65 @@
1
+ # 小数阶段计算
2
+
3
+ 计算紧急插入的下一个小数阶段编号。
4
+
5
+ ## 使用 specops-tools
6
+
7
+ ```bash
8
+ # 获取阶段 6 之后的下一个小数阶段
9
+ node .opencode/bin/specops-tools.cjs phase next-decimal 6
10
+ ```
11
+
12
+ 输出:
13
+ ```json
14
+ {
15
+ "found": true,
16
+ "base_phase": "06",
17
+ "next": "06.1",
18
+ "existing": []
19
+ }
20
+ ```
21
+
22
+ 已有小数阶段时:
23
+ ```json
24
+ {
25
+ "found": true,
26
+ "base_phase": "06",
27
+ "next": "06.3",
28
+ "existing": ["06.1", "06.2"]
29
+ }
30
+ ```
31
+
32
+ ## 提取值
33
+
34
+ ```bash
35
+ DECIMAL_INFO=$(node .opencode/bin/specops-tools.cjs phase next-decimal "${AFTER_PHASE}")
36
+ DECIMAL_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.next')
37
+ BASE_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.base_phase')
38
+ ```
39
+
40
+ 或使用 --raw 标志:
41
+ ```bash
42
+ DECIMAL_PHASE=$(node .opencode/bin/specops-tools.cjs phase next-decimal "${AFTER_PHASE}" --raw)
43
+ # 仅返回:06.1
44
+ ```
45
+
46
+ ## 示例
47
+
48
+ | 现有阶段 | 下一个阶段 |
49
+ |----------|-----------|
50
+ | 仅 06 | 06.1 |
51
+ | 06, 06.1 | 06.2 |
52
+ | 06, 06.1, 06.2 | 06.3 |
53
+ | 06, 06.1, 06.3(有间隔) | 06.4 |
54
+
55
+ ## 目录命名
56
+
57
+ 小数阶段目录使用完整的小数编号:
58
+
59
+ ```bash
60
+ SLUG=$(node .opencode/bin/specops-tools.cjs generate-slug "$DESCRIPTION" --raw)
61
+ PHASE_DIR=".planning/phases/${DECIMAL_PHASE}-${SLUG}"
62
+ mkdir -p "$PHASE_DIR"
63
+ ```
64
+
65
+ 示例:`.planning/phases/06.1-fix-critical-auth-bug/`
@@ -0,0 +1,248 @@
1
+ <overview>
2
+ SpecOps 框架的 Git 集成。
3
+ </overview>
4
+
5
+ <core_principle>
6
+
7
+ **提交成果,而非过程。**
8
+
9
+ Git 日志应该读起来像已交付内容的变更日志,而非规划活动的日记。
10
+ </core_principle>
11
+
12
+ <commit_points>
13
+
14
+ | 事件 | 提交? | 原因 |
15
+ | ----------------------- | ------ | ------------------------------------------------ |
16
+ | BRIEF + ROADMAP 创建 | 是 | 项目初始化 |
17
+ | PLAN.md 创建 | 否 | 中间产物 - 随计划完成一起提交 |
18
+ | RESEARCH.md 创建 | 否 | 中间产物 |
19
+ | DISCOVERY.md 创建 | 否 | 中间产物 |
20
+ | **任务完成** | 是 | 原子工作单元(每个任务 1 个提交) |
21
+ | **计划完成** | 是 | 元数据提交(SUMMARY + STATE + ROADMAP) |
22
+ | 交接创建 | 是 | 保存 WIP 状态 |
23
+
24
+ </commit_points>
25
+
26
+ <git_check>
27
+
28
+ ```bash
29
+ [ -d .git ] && echo "GIT_EXISTS" || echo "NO_GIT"
30
+ ```
31
+
32
+ 如果 NO_GIT:静默运行 `git init`。SpecOps 项目始终有自己的仓库。
33
+ </git_check>
34
+
35
+ <commit_formats>
36
+
37
+ <format name="initialization">
38
+ ## 项目初始化(brief + roadmap 一起)
39
+
40
+ ```
41
+ docs: initialize [project-name] ([N] phases)
42
+
43
+ [PROJECT.md 中的一句话描述]
44
+
45
+ Phases:
46
+ 1. [phase-name]: [goal]
47
+ 2. [phase-name]: [goal]
48
+ 3. [phase-name]: [goal]
49
+ ```
50
+
51
+ 提交内容:
52
+
53
+ ```bash
54
+ node .opencode/bin/specops-tools.cjs commit "docs: initialize [project-name] ([N] phases)" --files .planning/
55
+ ```
56
+
57
+ </format>
58
+
59
+ <format name="task-completion">
60
+ ## 任务完成(计划执行期间)
61
+
62
+ 每个任务在完成后立即获得自己的提交。
63
+
64
+ ```
65
+ {type}({phase}-{plan}): {task-name}
66
+
67
+ - [Key change 1]
68
+ - [Key change 2]
69
+ - [Key change 3]
70
+ ```
71
+
72
+ **提交类型:**
73
+ - `feat` - 新功能/特性
74
+ - `fix` - Bug 修复
75
+ - `test` - 仅测试(TDD RED 阶段)
76
+ - `refactor` - 代码清理(TDD REFACTOR 阶段)
77
+ - `perf` - 性能改进
78
+ - `chore` - 依赖、配置、工具
79
+
80
+ **示例:**
81
+
82
+ ```bash
83
+ # 标准任务
84
+ git add src/api/auth.ts src/types/user.ts
85
+ git commit -m "feat(08-02): create user registration endpoint
86
+
87
+ - POST /auth/register validates email and password
88
+ - Checks for duplicate users
89
+ - Returns JWT token on success
90
+ "
91
+
92
+ # TDD 任务 - RED 阶段
93
+ git add src/__tests__/jwt.test.ts
94
+ git commit -m "test(07-02): add failing test for JWT generation
95
+
96
+ - Tests token contains user ID claim
97
+ - Tests token expires in 1 hour
98
+ - Tests signature verification
99
+ "
100
+
101
+ # TDD 任务 - GREEN 阶段
102
+ git add src/utils/jwt.ts
103
+ git commit -m "feat(07-02): implement JWT generation
104
+
105
+ - Uses jose library for signing
106
+ - Includes user ID and expiry claims
107
+ - Signs with HS256 algorithm
108
+ "
109
+ ```
110
+
111
+ </format>
112
+
113
+ <format name="plan-completion">
114
+ ## 计划完成(所有任务完成后)
115
+
116
+ 所有任务提交后,一个最终的元数据提交记录计划完成。
117
+
118
+ ```
119
+ docs({phase}-{plan}): complete [plan-name] plan
120
+
121
+ Tasks completed: [N]/[N]
122
+ - [Task 1 name]
123
+ - [Task 2 name]
124
+ - [Task 3 name]
125
+
126
+ SUMMARY: .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md
127
+ ```
128
+
129
+ 提交内容:
130
+
131
+ ```bash
132
+ node .opencode/bin/specops-tools.cjs commit "docs({phase}-{plan}): complete [plan-name] plan" --files .planning/phases/XX-name/{phase}-{plan}-PLAN.md .planning/phases/XX-name/{phase}-{plan}-SUMMARY.md .planning/STATE.md .planning/ROADMAP.md
133
+ ```
134
+
135
+ **注意:** 代码文件不包含在内,已在每个任务中提交。
136
+
137
+ </format>
138
+
139
+ <format name="handoff">
140
+ ## 交接(WIP)
141
+
142
+ ```
143
+ wip: [phase-name] paused at task [X]/[Y]
144
+
145
+ Current: [task name]
146
+ [If blocked:] Blocked: [reason]
147
+ ```
148
+
149
+ 提交内容:
150
+
151
+ ```bash
152
+ node .opencode/bin/specops-tools.cjs commit "wip: [phase-name] paused at task [X]/[Y]" --files .planning/
153
+ ```
154
+
155
+ </format>
156
+ </commit_formats>
157
+
158
+ <example_log>
159
+
160
+ **旧方式(按计划提交):**
161
+ ```
162
+ a7f2d1 feat(checkout): Stripe payments with webhook verification
163
+ 3e9c4b feat(products): catalog with search, filters, and pagination
164
+ 8a1b2c feat(auth): JWT with refresh rotation using jose
165
+ 5c3d7e feat(foundation): Next.js 15 + Prisma + Tailwind scaffold
166
+ 2f4a8d docs: initialize ecommerce-app (5 phases)
167
+ ```
168
+
169
+ **新方式(按任务提交):**
170
+ ```
171
+ # Phase 04 - Checkout
172
+ 1a2b3c docs(04-01): complete checkout flow plan
173
+ 4d5e6f feat(04-01): add webhook signature verification
174
+ 7g8h9i feat(04-01): implement payment session creation
175
+ 0j1k2l feat(04-01): create checkout page component
176
+
177
+ # Phase 03 - Products
178
+ 3m4n5o docs(03-02): complete product listing plan
179
+ 6p7q8r feat(03-02): add pagination controls
180
+ 9s0t1u feat(03-02): implement search and filters
181
+ 2v3w4x feat(03-01): create product catalog schema
182
+
183
+ # Phase 02 - Auth
184
+ 5y6z7a docs(02-02): complete token refresh plan
185
+ 8b9c0d feat(02-02): implement refresh token rotation
186
+ 1e2f3g test(02-02): add failing test for token refresh
187
+ 4h5i6j docs(02-01): complete JWT setup plan
188
+ 7k8l9m feat(02-01): add JWT generation and validation
189
+ 0n1o2p chore(02-01): install jose library
190
+
191
+ # Phase 01 - Foundation
192
+ 3q4r5s docs(01-01): complete scaffold plan
193
+ 6t7u8v feat(01-01): configure Tailwind and globals
194
+ 9w0x1y feat(01-01): set up Prisma with database
195
+ 2z3a4b feat(01-01): create Next.js 15 project
196
+
197
+ # Initialization
198
+ 5c6d7e docs: initialize ecommerce-app (5 phases)
199
+ ```
200
+
201
+ 每个计划产生 2-4 个提交(任务 + 元数据)。清晰、细粒度、可 bisect。
202
+
203
+ </example_log>
204
+
205
+ <anti_patterns>
206
+
207
+ **仍然不提交(中间产物):**
208
+ - PLAN.md 创建(随计划完成一起提交)
209
+ - RESEARCH.md(中间产物)
210
+ - DISCOVERY.md(中间产物)
211
+ - 小的规划调整
212
+ - 「修复路线图中的拼写错误」
213
+
214
+ **要提交(成果):**
215
+ - 每个任务完成(feat/fix/test/refactor)
216
+ - 计划完成元数据(docs)
217
+ - 项目初始化(docs)
218
+
219
+ **关键原则:** 提交可工作的代码和已交付的成果,而非规划过程。
220
+
221
+ </anti_patterns>
222
+
223
+ <commit_strategy_rationale>
224
+
225
+ ## 为什么按任务提交?
226
+
227
+ **AI 的上下文工程:**
228
+ - Git 历史成为未来 Claude 会话的主要上下文来源
229
+ - `git log --grep="{phase}-{plan}"` 显示计划的所有工作
230
+ - `git diff <hash>^..<hash>` 显示每个任务的精确变更
231
+ - 减少对解析 SUMMARY.md 的依赖 = 更多上下文用于实际工作
232
+
233
+ **故障恢复:**
234
+ - 任务 1 已提交 ✅,任务 2 失败 ❌
235
+ - 下一个会话中的 Claude:看到任务 1 完成,可以重试任务 2
236
+ - 可以 `git reset --hard` 到最后一个成功的任务
237
+
238
+ **调试:**
239
+ - `git bisect` 找到精确的失败任务,而非只是失败的计划
240
+ - `git blame` 追溯到特定任务上下文
241
+ - 每个提交可独立回滚
242
+
243
+ **可观测性:**
244
+ - 独立开发者 + Claude 工作流受益于细粒度归因
245
+ - 原子提交是 git 最佳实践
246
+ - 当消费者是 Claude 而非人类时,「提交噪音」无关紧要
247
+
248
+ </commit_strategy_rationale>
@@ -0,0 +1,38 @@
1
+ # Git 规划提交
2
+
3
+ 使用 specops-tools CLI 提交规划产物,它会自动检查 `commit_docs` 配置和 gitignore 状态。
4
+
5
+ ## 通过 CLI 提交
6
+
7
+ 始终使用 `specops-tools.cjs commit` 处理 `.planning/` 文件,它会自动处理 `commit_docs` 和 gitignore 检查:
8
+
9
+ ```bash
10
+ node .opencode/bin/specops-tools.cjs commit "docs({scope}): {description}" --files .planning/STATE.md .planning/ROADMAP.md
11
+ ```
12
+
13
+ 如果 `commit_docs` 为 `false` 或 `.planning/` 被 gitignore,CLI 会返回 `skipped`(附带原因)。无需手动条件检查。
14
+
15
+ ## 修改上一次提交
16
+
17
+ 将 `.planning/` 文件变更合并到上一次提交:
18
+
19
+ ```bash
20
+ node .opencode/bin/specops-tools.cjs commit "" --files .planning/codebase/*.md --amend
21
+ ```
22
+
23
+ ## 提交消息模式
24
+
25
+ | 命令 | 范围 | 示例 |
26
+ |------|------|------|
27
+ | plan-phase | phase | `docs(phase-03): create authentication plans` |
28
+ | execute-phase | phase | `docs(phase-03): complete authentication phase` |
29
+ | new-milestone | milestone | `docs: start milestone v1.1` |
30
+ | remove-phase | chore | `chore: remove phase 17 (dashboard)` |
31
+ | insert-phase | phase | `docs: insert phase 16.1 (critical fix)` |
32
+ | add-phase | phase | `docs: add phase 07 (settings page)` |
33
+
34
+ ## 何时跳过
35
+
36
+ - 配置中 `commit_docs: false`
37
+ - `.planning/` 被 gitignore
38
+ - 没有要提交的变更(用 `git status --porcelain .planning/` 检查)
@@ -0,0 +1,34 @@
1
+ # 模型配置解析
2
+
3
+ 在编排开始时解析一次模型配置,然后在所有 Task 调用中使用。
4
+
5
+ ## 解析模式
6
+
7
+ ```bash
8
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
9
+ ```
10
+
11
+ 默认值:如果未设置或配置缺失,为 `balanced`。
12
+
13
+ ## 查找表
14
+
15
+ @.opencode/references/model-profiles.md
16
+
17
+ 在表中查找已解析配置对应的代理。将 model 参数传递给 Task 调用:
18
+
19
+ ```
20
+ Task(
21
+ prompt="...",
22
+ subagent_type="specops-planner",
23
+ model="{resolved_model}" # "inherit"、"sonnet" 或 "haiku"
24
+ )
25
+ ```
26
+
27
+ **注意:** Opus 级别的代理解析为 `"inherit"`(不是 `"opus"`)。这使代理使用父会话的模型,避免与可能阻止特定 opus 版本的组织策略冲突。
28
+
29
+ ## 用法
30
+
31
+ 1. 在编排开始时解析一次
32
+ 2. 存储配置值
33
+ 3. 生成代理时从表中查找每个代理的模型
34
+ 4. 将 model 参数传递给每个 Task 调用(值:`"inherit"`、`"sonnet"`、`"haiku"`)