specops 0.2.5 → 0.3.2
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 +475 -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 +581 -0
- package/.opencode/agent/specops-project-researcher.md +354 -0
- package/.opencode/agent/specops-research-synthesizer.md +242 -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/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/__integration__/fixtures/generator.d.ts +4 -0
- package/dist/__integration__/fixtures/generator.js +1 -0
- package/dist/__integration__/mocks/server.d.ts +7 -0
- package/dist/__integration__/mocks/server.js +1 -0
- package/dist/__integration__/setup.d.ts +6 -0
- package/dist/__integration__/setup.js +1 -0
- package/dist/acceptance/lazyDetector.js +1 -1
- package/dist/acceptance/reporter.js +1 -1
- package/dist/acceptance/runner.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/techContextLoader.js +1 -1
- package/dist/engine.d.ts +1 -0
- 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/supervisorMachine.js +1 -1
- package/dist/persistence/schema.js +1 -1
- package/dist/persistence/stateFile.js +1 -1
- package/dist/plugin-engine.js +1 -1
- package/dist/plugin.js +1 -1
- package/dist/requirement-analysis/analyzers/repository-parser.d.ts +121 -0
- package/dist/requirement-analysis/analyzers/repository-parser.js +1 -0
- package/dist/requirement-analysis/generators/prd-generator.d.ts +90 -0
- package/dist/requirement-analysis/generators/prd-generator.js +1 -0
- package/dist/requirement-analysis/integrations/v1-integration.d.ts +73 -0
- package/dist/requirement-analysis/integrations/v1-integration.js +1 -0
- package/dist/requirement-analysis/tools/analyze-requirements.js +1 -0
- package/dist/requirement-analysis/types/analysis-result.d.ts +326 -0
- package/dist/requirement-analysis/types/analysis-result.js +1 -0
- package/dist/requirement-analysis/types/feature-mapping.d.ts +294 -0
- package/dist/requirement-analysis/types/feature-mapping.js +1 -0
- package/dist/requirement-analysis/types/index.d.ts +171 -0
- package/dist/requirement-analysis/types/index.js +1 -0
- package/dist/requirement-analysis/types/tech-stack.d.ts +213 -0
- package/dist/requirement-analysis/types/tech-stack.js +1 -0
- package/dist/requirement-analysis/utils/error-handler.d.ts +112 -0
- package/dist/requirement-analysis/utils/error-handler.js +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js +1 -1
- package/dist/utils/id.js +1 -1
- package/package.json +4 -2
- package/skills/competitor-search/SKILL.md +169 -0
- package/skills/demand-analysis/SKILL.md +307 -0
- package/skills/feature-search/SKILL.md +182 -0
- package/skills/requirement-analysis/README.md +464 -0
- package/skills/requirement-analysis/SKILL.md +224 -0
- package/skills/requirement-analysis/templates/feature-mapping-template.json +210 -0
- package/skills/requirement-analysis/templates/prd-template.md +104 -0
- package/skills/tech-selection/SKILL.md +198 -0
- package/dist/__e2e__/01-state-engine.e2e.test.d.ts +0 -10
- package/dist/__e2e__/01-state-engine.e2e.test.js +0 -1
- package/dist/acceptance/lazyDetector.test.d.ts +0 -1
- package/dist/acceptance/lazyDetector.test.js +0 -1
- package/dist/acceptance/reporter.test.d.ts +0 -1
- package/dist/acceptance/reporter.test.js +0 -1
- package/dist/acceptance/runner.test.d.ts +0 -1
- package/dist/acceptance/runner.test.js +0 -1
- package/dist/context/promptTemplate.test.d.ts +0 -1
- package/dist/context/promptTemplate.test.js +0 -1
- package/dist/context/techContextLoader.test.d.ts +0 -1
- package/dist/context/techContextLoader.test.js +0 -1
- package/dist/machines/agentMachine.test.d.ts +0 -1
- package/dist/machines/agentMachine.test.js +0 -1
- package/dist/machines/supervisorMachine.test.d.ts +0 -1
- package/dist/machines/supervisorMachine.test.js +0 -1
- package/dist/persistence/stateFile.test.d.ts +0 -1
- package/dist/persistence/stateFile.test.js +0 -1
|
@@ -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}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# 架构模板
|
|
2
|
+
|
|
3
|
+
`.planning/codebase/ARCHITECTURE.md` 的模板 - 记录概念层面的代码组织。
|
|
4
|
+
|
|
5
|
+
**用途:** 记录代码在概念层面的组织方式。与 STRUCTURE.md(展示物理文件位置)互补。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 文件模板
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# 架构
|
|
13
|
+
|
|
14
|
+
**分析日期:** [YYYY-MM-DD]
|
|
15
|
+
|
|
16
|
+
## 模式概览
|
|
17
|
+
|
|
18
|
+
**整体:** [模式名称:例如 "单体 CLI"、"Serverless API"、"全栈 MVC"]
|
|
19
|
+
|
|
20
|
+
**关键特征:**
|
|
21
|
+
- [特征 1:例如 "单一可执行文件"]
|
|
22
|
+
- [特征 2:例如 "无状态请求处理"]
|
|
23
|
+
- [特征 3:例如 "事件驱动"]
|
|
24
|
+
|
|
25
|
+
## 分层
|
|
26
|
+
|
|
27
|
+
[描述概念层及其职责]
|
|
28
|
+
|
|
29
|
+
**[层名称]:**
|
|
30
|
+
- 用途:[这一层做什么]
|
|
31
|
+
- 包含:[代码类型:例如 "路由处理器"、"业务逻辑"]
|
|
32
|
+
- 依赖:[使用什么:例如 "仅数据层"]
|
|
33
|
+
- 被使用:[什么使用它:例如 "API 路由"]
|
|
34
|
+
|
|
35
|
+
**[层名称]:**
|
|
36
|
+
- 用途:[这一层做什么]
|
|
37
|
+
- 包含:[代码类型]
|
|
38
|
+
- 依赖:[使用什么]
|
|
39
|
+
- 被使用:[什么使用它]
|
|
40
|
+
|
|
41
|
+
## 数据流
|
|
42
|
+
|
|
43
|
+
[描述典型的请求/执行生命周期]
|
|
44
|
+
|
|
45
|
+
**[流程名称](例如 "HTTP 请求"、"CLI 命令"、"事件处理"):**
|
|
46
|
+
|
|
47
|
+
1. [入口点:例如 "用户运行命令"]
|
|
48
|
+
2. [处理步骤:例如 "路由器匹配路径"]
|
|
49
|
+
3. [处理步骤:例如 "控制器验证输入"]
|
|
50
|
+
4. [处理步骤:例如 "服务执行逻辑"]
|
|
51
|
+
5. [输出:例如 "返回响应"]
|
|
52
|
+
|
|
53
|
+
**状态管理:**
|
|
54
|
+
- [状态如何处理:例如 "无状态 - 无持久状态"、"每请求数据库"、"内存缓存"]
|
|
55
|
+
|
|
56
|
+
## 关键抽象
|
|
57
|
+
|
|
58
|
+
[整个代码库中使用的核心概念/模式]
|
|
59
|
+
|
|
60
|
+
**[抽象名称]:**
|
|
61
|
+
- 用途:[它代表什么]
|
|
62
|
+
- 示例:[例如 "UserService、ProjectService"]
|
|
63
|
+
- 模式:[例如 "单例"、"工厂"、"仓储"]
|
|
64
|
+
|
|
65
|
+
**[抽象名称]:**
|
|
66
|
+
- 用途:[它代表什么]
|
|
67
|
+
- 示例:[具体示例]
|
|
68
|
+
- 模式:[使用的模式]
|
|
69
|
+
|
|
70
|
+
## 入口点
|
|
71
|
+
|
|
72
|
+
[执行从哪里开始]
|
|
73
|
+
|
|
74
|
+
**[入口点]:**
|
|
75
|
+
- 位置:[简述:例如 "src/index.ts"、"API Gateway 触发"]
|
|
76
|
+
- 触发方式:[什么调用它:例如 "CLI 调用"、"HTTP 请求"]
|
|
77
|
+
- 职责:[它做什么:例如 "解析参数,路由到命令"]
|
|
78
|
+
|
|
79
|
+
## 错误处理
|
|
80
|
+
|
|
81
|
+
**策略:** [错误如何处理:例如 "异常冒泡到顶层处理器"、"每路由错误中间件"]
|
|
82
|
+
|
|
83
|
+
**模式:**
|
|
84
|
+
- [模式:例如 "在控制器层 try/catch"]
|
|
85
|
+
- [模式:例如 "向用户返回错误码"]
|
|
86
|
+
|
|
87
|
+
## 横切关注点
|
|
88
|
+
|
|
89
|
+
[影响多个层的方面]
|
|
90
|
+
|
|
91
|
+
**日志:**
|
|
92
|
+
- [方法:例如 "Winston logger,每请求注入"]
|
|
93
|
+
|
|
94
|
+
**验证:**
|
|
95
|
+
- [方法:例如 "API 边界使用 Zod schema"]
|
|
96
|
+
|
|
97
|
+
**认证:**
|
|
98
|
+
- [方法:例如 "受保护路由使用 JWT 中间件"]
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
*架构分析:[date]*
|
|
103
|
+
*主要模式变更时更新*
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
<good_examples>
|
|
107
|
+
```markdown
|
|
108
|
+
# 架构
|
|
109
|
+
|
|
110
|
+
**分析日期:** 2025-01-20
|
|
111
|
+
|
|
112
|
+
## 模式概览
|
|
113
|
+
|
|
114
|
+
**整体:** 带插件系统的 CLI 应用
|
|
115
|
+
|
|
116
|
+
**关键特征:**
|
|
117
|
+
- 带子命令的单一可执行文件
|
|
118
|
+
- 基于插件的可扩展性
|
|
119
|
+
- 基于文件的状态(无数据库)
|
|
120
|
+
- 同步执行模型
|
|
121
|
+
|
|
122
|
+
## 分层
|
|
123
|
+
|
|
124
|
+
**命令层:**
|
|
125
|
+
- 用途:解析用户输入并路由到适当的处理器
|
|
126
|
+
- 包含:命令定义、参数解析、帮助文本
|
|
127
|
+
- 位置:`src/commands/*.ts`
|
|
128
|
+
- 依赖:服务层提供业务逻辑
|
|
129
|
+
- 被使用:CLI 入口点(`src/index.ts`)
|
|
130
|
+
|
|
131
|
+
**服务层:**
|
|
132
|
+
- 用途:核心业务逻辑
|
|
133
|
+
- 包含:FileService、TemplateService、InstallService
|
|
134
|
+
- 位置:`src/services/*.ts`
|
|
135
|
+
- 依赖:文件系统工具、外部工具
|
|
136
|
+
- 被使用:命令处理器
|
|
137
|
+
|
|
138
|
+
**工具层:**
|
|
139
|
+
- 用途:共享辅助函数和抽象
|
|
140
|
+
- 包含:文件 I/O 封装、路径解析、字符串格式化
|
|
141
|
+
- 位置:`src/utils/*.ts`
|
|
142
|
+
- 依赖:仅 Node.js 内置模块
|
|
143
|
+
- 被使用:服务层
|
|
144
|
+
|
|
145
|
+
## 数据流
|
|
146
|
+
|
|
147
|
+
**CLI 命令执行:**
|
|
148
|
+
|
|
149
|
+
1. 用户运行:`specops new-project`
|
|
150
|
+
2. Commander 解析参数和标志
|
|
151
|
+
3. 调用命令处理器(`src/commands/new-project.ts`)
|
|
152
|
+
4. 处理器调用服务方法(`src/services/project.ts` → `create()`)
|
|
153
|
+
5. 服务读取模板、处理文件、写入输出
|
|
154
|
+
6. 结果输出到控制台
|
|
155
|
+
7. 进程以状态码退出
|
|
156
|
+
|
|
157
|
+
**状态管理:**
|
|
158
|
+
- 基于文件:所有状态存放在 `.planning/` 目录
|
|
159
|
+
- 无持久内存状态
|
|
160
|
+
- 每次命令执行独立
|
|
161
|
+
|
|
162
|
+
## 关键抽象
|
|
163
|
+
|
|
164
|
+
**Service:**
|
|
165
|
+
- 用途:封装某个领域的业务逻辑
|
|
166
|
+
- 示例:`src/services/file.ts`、`src/services/template.ts`、`src/services/project.ts`
|
|
167
|
+
- 模式:类单例(作为模块导入,不实例化)
|
|
168
|
+
|
|
169
|
+
**Command:**
|
|
170
|
+
- 用途:CLI 命令定义
|
|
171
|
+
- 示例:`src/commands/new-project.ts`、`src/commands/plan-phase.ts`
|
|
172
|
+
- 模式:Commander.js 命令注册
|
|
173
|
+
|
|
174
|
+
**Template:**
|
|
175
|
+
- 用途:可复用的文档结构
|
|
176
|
+
- 示例:PROJECT.md、PLAN.md 模板
|
|
177
|
+
- 模式:带替换变量的 Markdown 文件
|
|
178
|
+
|
|
179
|
+
## 入口点
|
|
180
|
+
|
|
181
|
+
**CLI 入口:**
|
|
182
|
+
- 位置:`src/index.ts`
|
|
183
|
+
- 触发方式:用户运行 `specops <command>`
|
|
184
|
+
- 职责:注册命令、解析参数、显示帮助
|
|
185
|
+
|
|
186
|
+
**命令:**
|
|
187
|
+
- 位置:`src/commands/*.ts`
|
|
188
|
+
- 触发方式:CLI 匹配的命令
|
|
189
|
+
- 职责:验证输入、调用服务、格式化输出
|
|
190
|
+
|
|
191
|
+
## 错误处理
|
|
192
|
+
|
|
193
|
+
**策略:** 抛出异常,在命令层捕获,记录日志并退出
|
|
194
|
+
|
|
195
|
+
**模式:**
|
|
196
|
+
- 服务抛出带描述性消息的 Error
|
|
197
|
+
- 命令处理器捕获,将错误输出到 stderr,exit(1)
|
|
198
|
+
- 验证错误在执行前显示(快速失败)
|
|
199
|
+
|
|
200
|
+
## 横切关注点
|
|
201
|
+
|
|
202
|
+
**日志:**
|
|
203
|
+
- Console.log 用于正常输出
|
|
204
|
+
- Console.error 用于错误
|
|
205
|
+
- Chalk 用于彩色输出
|
|
206
|
+
|
|
207
|
+
**验证:**
|
|
208
|
+
- Zod schema 用于配置文件解析
|
|
209
|
+
- 命令处理器中的手动验证
|
|
210
|
+
- 无效输入时快速失败
|
|
211
|
+
|
|
212
|
+
**文件操作:**
|
|
213
|
+
- FileService 对 fs-extra 的抽象
|
|
214
|
+
- 所有路径在操作前验证
|
|
215
|
+
- 原子写入(临时文件 + 重命名)
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
*架构分析:2025-01-20*
|
|
220
|
+
*主要模式变更时更新*
|
|
221
|
+
```
|
|
222
|
+
</good_examples>
|
|
223
|
+
|
|
224
|
+
<guidelines>
|
|
225
|
+
**ARCHITECTURE.md 中应包含的内容:**
|
|
226
|
+
- 整体架构模式(单体、微服务、分层等)
|
|
227
|
+
- 概念层及其关系
|
|
228
|
+
- 数据流/请求生命周期
|
|
229
|
+
- 关键抽象和模式
|
|
230
|
+
- 入口点
|
|
231
|
+
- 错误处理策略
|
|
232
|
+
- 横切关注点(日志、认证、验证)
|
|
233
|
+
|
|
234
|
+
**不应包含的内容:**
|
|
235
|
+
- 详尽的文件列表(那是 STRUCTURE.md 的内容)
|
|
236
|
+
- 技术选型(那是 STACK.md 的内容)
|
|
237
|
+
- 逐行代码走读(参考代码阅读)
|
|
238
|
+
- 特定功能的实现细节
|
|
239
|
+
|
|
240
|
+
**欢迎包含文件路径:**
|
|
241
|
+
包含文件路径作为抽象的具体示例。使用反引号格式:`src/services/user.ts`。这使架构文档在 Claude 规划时可操作。
|
|
242
|
+
|
|
243
|
+
**填写此模板时:**
|
|
244
|
+
- 阅读主入口点(index、server、main)
|
|
245
|
+
- 通过阅读导入/依赖识别分层
|
|
246
|
+
- 追踪典型的请求/命令执行流程
|
|
247
|
+
- 记录反复出现的模式(services、controllers、repositories)
|
|
248
|
+
- 保持描述在概念层面,而非机械层面
|
|
249
|
+
|
|
250
|
+
**在阶段规划中的用途:**
|
|
251
|
+
- 添加新功能时(它适合哪一层?)
|
|
252
|
+
- 重构时(了解当前模式)
|
|
253
|
+
- 识别代码放置位置(哪一层处理 X?)
|
|
254
|
+
- 了解组件之间的依赖关系
|
|
255
|
+
</guidelines>
|