specwf 0.2.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/README.md +79 -0
- package/bin/specwf.js +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1800 -0
- package/dist/templates/agents/archiver.md +112 -0
- package/dist/templates/agents/executor.md +125 -0
- package/dist/templates/agents/planner.md +114 -0
- package/dist/templates/agents/researcher.md +104 -0
- package/dist/templates/agents/reviewer.md +98 -0
- package/dist/templates/agents/verifier.md +129 -0
- package/dist/templates/artifacts/context.md +151 -0
- package/dist/templates/artifacts/design.md +224 -0
- package/dist/templates/artifacts/goal-review.md +95 -0
- package/dist/templates/artifacts/project.yml +117 -0
- package/dist/templates/artifacts/proposal.md +124 -0
- package/dist/templates/artifacts/quality-review.md +131 -0
- package/dist/templates/artifacts/research.md +127 -0
- package/dist/templates/artifacts/spec-review.md +84 -0
- package/dist/templates/artifacts/state.md +158 -0
- package/dist/templates/artifacts/summary.md +129 -0
- package/dist/templates/artifacts/tasks.md +109 -0
- package/dist/templates/artifacts/verification.md +113 -0
- package/dist/templates/commands/adhoc.md +38 -0
- package/dist/templates/commands/apply.md +20 -0
- package/dist/templates/commands/archive.md +21 -0
- package/dist/templates/commands/continue.md +27 -0
- package/dist/templates/commands/discuss.md +24 -0
- package/dist/templates/commands/grill.md +24 -0
- package/dist/templates/commands/init.md +20 -0
- package/dist/templates/commands/milestone.md +27 -0
- package/dist/templates/commands/plan.md +22 -0
- package/dist/templates/commands/research-phase.md +20 -0
- package/dist/templates/commands/research.md +24 -0
- package/dist/templates/commands/review.md +20 -0
- package/dist/templates/commands/roadmap.md +23 -0
- package/dist/templates/commands/ship.md +36 -0
- package/dist/templates/commands/split.md +16 -0
- package/dist/templates/commands/verify.md +22 -0
- package/dist/templates/skills/adhoc.md +53 -0
- package/dist/templates/skills/apply.md +134 -0
- package/dist/templates/skills/archive.md +109 -0
- package/dist/templates/skills/continue.md +97 -0
- package/dist/templates/skills/discuss.md +95 -0
- package/dist/templates/skills/grill.md +90 -0
- package/dist/templates/skills/init.md +116 -0
- package/dist/templates/skills/milestone.md +36 -0
- package/dist/templates/skills/plan.md +144 -0
- package/dist/templates/skills/research-phase.md +66 -0
- package/dist/templates/skills/research.md +76 -0
- package/dist/templates/skills/review.md +148 -0
- package/dist/templates/skills/roadmap.md +104 -0
- package/dist/templates/skills/ship.md +94 -0
- package/dist/templates/skills/split.md +96 -0
- package/dist/templates/skills/verify.md +147 -0
- package/package.json +56 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Phase Summary: {{phase-name}}
|
|
2
|
+
|
|
3
|
+
> **Phase 起止**: {{start-date}} → {{end-date}}
|
|
4
|
+
> **完成度**: {{percentage}}%(基于 completion checklist)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 完成状态
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
填写指引:
|
|
12
|
+
基于验证结果给出最终完成状态。
|
|
13
|
+
从以下状态中选择一个:
|
|
14
|
+
- **Phase shipped**:所有 task 完成,验证全部通过
|
|
15
|
+
- **Phase shipped with gaps**:核心功能完成,但标记了 gapped items
|
|
16
|
+
- **Phase deferred**:本轮未完成已回滚,推迟到后续 phase
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
✅ **Phase shipped**。
|
|
20
|
+
|
|
21
|
+
所有 Wave 的 task 已完成,验证项全部通过。本 phase 目标已达成。
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Change 产出明细
|
|
26
|
+
|
|
27
|
+
<!--
|
|
28
|
+
填写指引:
|
|
29
|
+
按 change 分列产出。每个 change 列出:
|
|
30
|
+
- 产出文件清单(具体文件路径,不要泛泛说"若干文件")
|
|
31
|
+
- 关键实现决策(实现中做的关键决定)
|
|
32
|
+
- 验证结果(测试 + 类型检查结果)
|
|
33
|
+
-->
|
|
34
|
+
|
|
35
|
+
### Change: {{change-name-1}}
|
|
36
|
+
|
|
37
|
+
**产出文件:**
|
|
38
|
+
|
|
39
|
+
| 文件路径 | 说明 |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `{{file-path-1}}` | {{说明}} |
|
|
42
|
+
| `{{file-path-2}}` | {{说明}} |
|
|
43
|
+
| `{{file-path-3}}` | {{说明}} |
|
|
44
|
+
|
|
45
|
+
**关键实现决策:**
|
|
46
|
+
- {{决策 1:如"选择在组件内部实现 getItemLayout 而非通过 props 传入"}}
|
|
47
|
+
- {{决策 2:如"useScrollPerformance 用 RAF 而非 setInterval 采集帧率"}}
|
|
48
|
+
|
|
49
|
+
**验证结果:**
|
|
50
|
+
- `tsc --noEmit`:✅ 通过(0 error)
|
|
51
|
+
- `vitest run`:✅ 通过({{N}} tests, {{N}} passed)
|
|
52
|
+
- lint:✅ 通过(0 warning)
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Change: {{change-name-2}}
|
|
57
|
+
|
|
58
|
+
**产出文件:**
|
|
59
|
+
|
|
60
|
+
| 文件路径 | 说明 |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `{{file-path-1}}` | {{说明}} |
|
|
63
|
+
| `{{file-path-2}}` | {{说明}} |
|
|
64
|
+
|
|
65
|
+
**关键实现决策:**
|
|
66
|
+
- {{决策 1}}
|
|
67
|
+
|
|
68
|
+
**验证结果:**
|
|
69
|
+
- `tsc --noEmit`:✅ 通过
|
|
70
|
+
- `vitest run`:✅ 通过
|
|
71
|
+
- lint:✅ 通过
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 验证结果
|
|
76
|
+
|
|
77
|
+
<!--
|
|
78
|
+
填写指引:
|
|
79
|
+
填写验证汇总表。证据列可以是 CI 链接、截图、或命令执行结果摘要。
|
|
80
|
+
-->
|
|
81
|
+
|
|
82
|
+
| 验证项 | 结果 | 证据 |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| 类型检查 (`tsc --noEmit`) | ✅ 通过 / ❌ 失败 | {{无错误/错误数及原因}} |
|
|
85
|
+
| 单元测试 (`vitest run`) | ✅ 通过 / ❌ 失败 | {{N tests, N passed, N failed}} |
|
|
86
|
+
| 集成测试 | ✅ 通过 / ❌ 失败 / N/A | {{测试范围说明}} |
|
|
87
|
+
| lint 检查 | ✅ 通过 / ❌ 失败 | {{eslint / prettier 结果}} |
|
|
88
|
+
| {{自定义验证项 1}} | ✅ / ❌ / N/A | {{证据}} |
|
|
89
|
+
| {{自定义验证项 2}} | ✅ / ❌ / N/A | {{证据}} |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 偏差记录
|
|
94
|
+
|
|
95
|
+
<!--
|
|
96
|
+
填写指引:
|
|
97
|
+
记录实现过程中与计划(proposal / design 文档)相比的偏差。
|
|
98
|
+
每项偏差说明:原计划 vs 实际结果 + 原因 + 是否可接受。
|
|
99
|
+
|
|
100
|
+
如果没有偏差,写:无偏差,实现完全符合设计文档。
|
|
101
|
+
-->
|
|
102
|
+
|
|
103
|
+
| 原计划 | 实际结果 | 偏差原因 | 可接受? |
|
|
104
|
+
|---|---|---|---|
|
|
105
|
+
| {{原计划描述}} | {{实际结果描述}} | {{为什么发生偏差}} | ✅ 是 / ❌ 否 / ⚠️ 有风险 |
|
|
106
|
+
| {{原计划描述}} | {{实际结果描述}} | {{为什么发生偏差}} | ✅ 是 / ❌ 否 / ⚠️ 有风险 |
|
|
107
|
+
| {{原计划描述}} | {{实际结果描述}} | {{为什么发生偏差}} | ✅ 是 / ❌ 否 / ⚠️ 有风险 |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 下一步
|
|
112
|
+
|
|
113
|
+
<!--
|
|
114
|
+
填写指引:
|
|
115
|
+
基于本 phase 的完成情况和发现,建议下一 phase 或后续 action item。
|
|
116
|
+
每个建议说明:做什么 + 为什么做 + 建议时机。
|
|
117
|
+
-->
|
|
118
|
+
|
|
119
|
+
1. **{{下一步 action 1}}**:{{描述。如"在 Android 端进行列表滚动性能验证,确保 getItemLayout 效果一致"}}
|
|
120
|
+
- 原因:{{为什么需要做}}
|
|
121
|
+
- 建议时机:{{下个 sprint / 下个 phase 开始后两周内}}
|
|
122
|
+
|
|
123
|
+
2. **{{下一步 action 2}}**:{{描述}}
|
|
124
|
+
- 原因:{{为什么需要做}}
|
|
125
|
+
- 建议时机:{{建议时机}}
|
|
126
|
+
|
|
127
|
+
3. **{{下一步 action 3}}**:{{描述}}
|
|
128
|
+
- 原因:{{为什么需要做}}
|
|
129
|
+
- 建议时机:{{建议时机}}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Tasks: {{name}}
|
|
2
|
+
|
|
3
|
+
> **填表指引**:本文档将 design 拆解为按 wave 分组的可执行 task。每个 task 需包含 description、files、acceptance、可选的 depends_on 和 spec_ref。type:behavior 的 task 必须编写 RED 测试描述(GIVEN/WHEN/THEN 格式)。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## TDD type 标注规则
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
每种 task 的 type 定义其 TDD 协议。
|
|
11
|
+
type:behavior 必须走 RED→GREEN→REFACTOR,其余 type 直接实现。
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
| type | 含义 | TDD 协议 |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `behavior` | 业务行为——实现一个具体的、可观测/可断言的业务功能 | **RED→GREEN→REFACTOR**(强制 TDD:先写测试 → 实现 → 重构) |
|
|
17
|
+
| `config` | 配置文件——环境变量、CI/CD、lint、tsconfig 等 | 直接实现,无需 TDD |
|
|
18
|
+
| `refactor` | 重构——不改变外部行为只改善内部结构 | 先验证已有测试通过 → 重构 → 再次验证 |
|
|
19
|
+
| `docs` | 文档——README、API 文档、注释 | 直接实现,无需 TDD |
|
|
20
|
+
| `scaffolding` | 骨架代码——新建模块的空壳、目录结构、模板文件 | 直接实现,无需 TDD |
|
|
21
|
+
|
|
22
|
+
> **规则**:如果 task 的核心产出是"某个行为"(用户可感知或测试可断言),使用 `behavior`。如果只是"文件存在"或"配置生效",使用 `config`/`scaffolding`。
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Wave 1: {{wave-1-theme}}
|
|
27
|
+
|
|
28
|
+
<!--
|
|
29
|
+
Wave 是独立可验证的工作单元。一个 wave 内的 task 可能有依赖关系但整体封闭。
|
|
30
|
+
每个 wave 完成后可执行验证(tsc + test pass)。
|
|
31
|
+
-->
|
|
32
|
+
|
|
33
|
+
- [ ] task-{{id-1}}: [type:{{type}}] {{title}}
|
|
34
|
+
- **description**: {{详细描述:具体做什么、用什么方法、参考哪些文件/API}}
|
|
35
|
+
- **files**: {{文件路径列表,逗号分隔}}
|
|
36
|
+
- **acceptance**: {{可观测可断言的验收标准}}
|
|
37
|
+
- **depends_on**: [task-{{id-x}}] <!-- 可选:前置依赖 -->
|
|
38
|
+
- **spec_ref**: specs/{{domain}}/spec.md <!-- 可选:关联的规格文件 -->
|
|
39
|
+
{{if behavior}}
|
|
40
|
+
- ***RED 测试***:
|
|
41
|
+
```
|
|
42
|
+
GIVEN {{前置条件}}
|
|
43
|
+
WHEN {{操作触发}}
|
|
44
|
+
THEN {{预期结果}}
|
|
45
|
+
```
|
|
46
|
+
{{/if}}
|
|
47
|
+
|
|
48
|
+
- [ ] task-{{id-2}}: [type:{{type}}] {{title}}
|
|
49
|
+
- **description**: {{详细描述}}
|
|
50
|
+
- **files**: {{文件路径列表}}
|
|
51
|
+
- **acceptance**: {{验收标准}}
|
|
52
|
+
{{if behavior}}
|
|
53
|
+
- ***RED 测试***:
|
|
54
|
+
```
|
|
55
|
+
GIVEN {{前置条件}}
|
|
56
|
+
WHEN {{操作触发}}
|
|
57
|
+
THEN {{预期结果}}
|
|
58
|
+
```
|
|
59
|
+
{{/if}}
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Wave 2: {{wave-2-theme}}
|
|
64
|
+
|
|
65
|
+
<!--
|
|
66
|
+
如果设计超过一个 wave,在此添加。Wave 2 依赖 Wave 1 的产出。
|
|
67
|
+
-->
|
|
68
|
+
|
|
69
|
+
- [ ] task-{{id-3}}: [type:{{type}}] {{title}}
|
|
70
|
+
- **description**: {{详细描述}}
|
|
71
|
+
- **files**: {{文件路径列表}}
|
|
72
|
+
- **acceptance**: {{验收标准}}
|
|
73
|
+
- **depends_on**: [task-{{id-1}}] <!-- 可选 -->
|
|
74
|
+
{{if behavior}}
|
|
75
|
+
- ***RED 测试***:
|
|
76
|
+
```
|
|
77
|
+
GIVEN {{前置条件}}
|
|
78
|
+
WHEN {{操作触发}}
|
|
79
|
+
THEN {{预期结果}}
|
|
80
|
+
```
|
|
81
|
+
{{/if}}
|
|
82
|
+
|
|
83
|
+
- [ ] task-{{id-4}}: [type:{{type}}] {{title}}
|
|
84
|
+
- **description**: {{详细描述}}
|
|
85
|
+
- **files**: {{文件路径列表}}
|
|
86
|
+
- **acceptance**: {{验收标准}}
|
|
87
|
+
{{if behavior}}
|
|
88
|
+
- ***RED 测试***:
|
|
89
|
+
```
|
|
90
|
+
GIVEN {{前置条件}}
|
|
91
|
+
WHEN {{操作触发}}
|
|
92
|
+
THEN {{预期结果}}
|
|
93
|
+
```
|
|
94
|
+
{{/if}}
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 验证
|
|
99
|
+
|
|
100
|
+
<!--
|
|
101
|
+
填写指引:
|
|
102
|
+
所有 task 实现完毕后,在此 checklist 中逐项确认。
|
|
103
|
+
-->
|
|
104
|
+
|
|
105
|
+
- [ ] `tsc --noEmit` 通过(或对应语言的类型检查)
|
|
106
|
+
- [ ] `vitest run` 测试套件全部通过
|
|
107
|
+
- [ ] 每个 wave 的验收标准已通过人工或自动化确认
|
|
108
|
+
- [ ] 新增代码的 lint 检查通过
|
|
109
|
+
- [ ] 未引入新的类型错误或告警
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Verification: {{change-name}}
|
|
2
|
+
|
|
3
|
+
> 验证时间: {{date}}
|
|
4
|
+
|
|
5
|
+
## 测试结果
|
|
6
|
+
|
|
7
|
+
列出所有执行过的测试及其结果。优先引用自动化测试结果(vitest、tsc 等),手工测试单独标注。
|
|
8
|
+
|
|
9
|
+
| 测试名 | 类型 | 结果 | 耗时 | 备注 |
|
|
10
|
+
|--------|------|------|------|------|
|
|
11
|
+
| <!-- vitest run 等测试套件名 --> | <!-- unit / integration / e2e / manual / typecheck --> | ✅ 通过 / ❌ 失败 / ⏭ 跳过 | <!-- 如 "12s" --> | <!-- 特殊观察、不稳定测试等 --> |
|
|
12
|
+
| tsc --noEmit | typecheck | ✅ | 5s | 无类型错误 |
|
|
13
|
+
|
|
14
|
+
**填写指引:**
|
|
15
|
+
- "类型"字段:`unit`(单元测试)、`integration`(集成测试)、`e2e`(端到端)、`manual`(手工验证)、`typecheck`(类型检查)
|
|
16
|
+
- "结果"字段使用符号标记以便快速扫描:✅ = 通过、❌ = 失败、⏭ = 跳过、⚠ = 有警告但通过
|
|
17
|
+
- "耗时"统一单位为秒(加 `s` 后缀)
|
|
18
|
+
- 跳过或失败须在"备注"中说明原因
|
|
19
|
+
|
|
20
|
+
## 需求覆盖检查
|
|
21
|
+
|
|
22
|
+
对照 delta-specs 中的 Requirement 列表,逐项检查实现覆盖情况。
|
|
23
|
+
|
|
24
|
+
| 需求 ID | 需求描述 | 覆盖状态 | 证据 |
|
|
25
|
+
|---------|----------|----------|------|
|
|
26
|
+
| <!-- REQ-001 等编号,按 proposal 或 spec 文档编号 --> | <!-- 需求原文摘要 --> | ✅ 已覆盖 / ❌ 未覆盖 / ⚠️ 部分覆盖 | <!-- 通过的测试名、代码链接、截图等 --> |
|
|
27
|
+
|
|
28
|
+
**填写指引:**
|
|
29
|
+
- 需求 ID 遵循 `REQ-{NNN}` 格式,与 delta-specs 中的编号一致
|
|
30
|
+
- "覆盖状态"必须基于实际测试结果,而非代码审查印象
|
|
31
|
+
- "证据"链接到具体的通过测试用例(如 `test/xxx.test.ts:12`)或手工验证记录
|
|
32
|
+
- ⚠️ 部分覆盖须在备注或下方根因中说明未覆盖的边界
|
|
33
|
+
|
|
34
|
+
## 决策覆盖检查
|
|
35
|
+
|
|
36
|
+
对照 design.md 和 context.md 中的决策记录(D1、D2...),检查决策的落地情况。
|
|
37
|
+
|
|
38
|
+
| 决策 ID | 决策内容 | 实现状态 | 证据 |
|
|
39
|
+
|---------|----------|----------|------|
|
|
40
|
+
| <!-- D1、D2 等编号 --> | <!-- 决策摘要 --> | ✅ 已实现 / ❌ 未实现 / ⚠️ 偏离 | <!-- 代码位置、文件名+行号等 --> |
|
|
41
|
+
|
|
42
|
+
**填写指引:**
|
|
43
|
+
- 决策 ID 与 design.md / context.md 中的编号一致
|
|
44
|
+
- "实现状态"检查的是决策意图是否在代码中得到体现,不只是代码中是否包含关键字
|
|
45
|
+
- ⚠️ 偏离须在下方根因诊断中分析原因
|
|
46
|
+
|
|
47
|
+
## 目标达成检查
|
|
48
|
+
|
|
49
|
+
对照 proposal.md 中的目标定义,逐项检查达成情况。
|
|
50
|
+
|
|
51
|
+
| 目标项 | 达成状态 | 证据 |
|
|
52
|
+
|--------|----------|------|
|
|
53
|
+
| <!-- 从 proposal.md 提取的 must-haves 目标 --> | ✅ 达成 / ❌ 未达成 / ⚠️ 部分达成 | <!-- 测试结果、用户验证等 --> |
|
|
54
|
+
|
|
55
|
+
## 根因诊断
|
|
56
|
+
|
|
57
|
+
对于所有 ❌ 或 ⚠️ 的失败项(测试失败、未覆盖的需求、未实现的决策、未达成的目标),按照以下分类进行根因分析。
|
|
58
|
+
|
|
59
|
+
### 失败项分类
|
|
60
|
+
|
|
61
|
+
| 分类 | 含义 | 对应路由 |
|
|
62
|
+
|------|------|----------|
|
|
63
|
+
| 计划缺陷 | 设计错了或漏了 — 方案设计时不满足需求 | → replan(回 plan 重设计) |
|
|
64
|
+
| 实现缺陷 | 代码写错了 — 设计正确但编码有误 | → reapply(回 apply 重实现) |
|
|
65
|
+
| 规格缺陷 | spec 本身错了 — 需求描述错误或不完整 | → 标记 spec 待修,回 plan 修 spec |
|
|
66
|
+
|
|
67
|
+
### 逐项根因分析
|
|
68
|
+
|
|
69
|
+
<!-- 每列格式 -->
|
|
70
|
+
#### 失败项 1: <测试名/需求ID/决策ID/目标项>
|
|
71
|
+
|
|
72
|
+
- **现象**: <!-- 具体失败表现 -->
|
|
73
|
+
- **根因分类**: <!-- 计划缺陷 / 实现缺陷 / 规格缺陷 -->
|
|
74
|
+
- **根因分析**: <!-- 为什么错了,深层原因 -->
|
|
75
|
+
- **影响范围**: <!-- 影响哪些模块、测试 -->
|
|
76
|
+
- **修复建议**: <!-- 具体修复方向 -->
|
|
77
|
+
|
|
78
|
+
#### 失败项 2: ...
|
|
79
|
+
|
|
80
|
+
<!-- 每发现一个失败项,都按此格式记录。无失败项时写"所有项通过,无需根因分析。" -->
|
|
81
|
+
|
|
82
|
+
## 路由建议
|
|
83
|
+
|
|
84
|
+
根据根因诊断分类,勾选对应的处理路径:
|
|
85
|
+
|
|
86
|
+
- [ ] **计划缺陷 → replan**: <!-- 具体列出哪些项需要回 plan 重新设计,以及重新设计的内容 -->
|
|
87
|
+
- [ ] **实现缺陷 → reapply**: <!-- 具体列出哪些项需要回 apply 重写代码,以及修复方向 -->
|
|
88
|
+
- [ ] **规格缺陷 → 标记 spec 待修,回 plan 修 spec**: <!-- 具体列出哪些 specs 需要修正 -->
|
|
89
|
+
|
|
90
|
+
**路由原则:**
|
|
91
|
+
- 一个失败项只能路由到一个路径(主路由),但可以影响其他路径(次影响)
|
|
92
|
+
- 计划缺陷全部回 plan 重设计后重新 apply
|
|
93
|
+
- 实现缺陷在 apply 修复后回到 review 重新审查对应项
|
|
94
|
+
- 规格缺陷标为 spec-debt,在修 spec 后回 plan → apply 重新实现
|
|
95
|
+
|
|
96
|
+
## 回环记录
|
|
97
|
+
|
|
98
|
+
每次从 verify 返回到 plan/apply 的回环,在此记录。用于追踪迭代质量和效率。
|
|
99
|
+
|
|
100
|
+
| 回环 # | 问题 | 路由 | 修复内容 | 验证结果 |
|
|
101
|
+
|--------|------|------|----------|----------|
|
|
102
|
+
| <!-- 1, 2, 3... --> | <!-- 触发回环的问题描述 --> | <!-- replan / reapply / spec-fix --> | <!-- 修改了哪些文件、改了什么 --> | ✅ 通过 / ❌ 仍需修复 |
|
|
103
|
+
| | | | | |
|
|
104
|
+
|
|
105
|
+
**填写指引:**
|
|
106
|
+
- 每次回环递增编号(1、2、3...)
|
|
107
|
+
- "路由"字段填写具体路径(如 `replan: D1 决策边界重新定义`)
|
|
108
|
+
- "修复内容"要具体到文件和关键变更,方便后续审查
|
|
109
|
+
- 回环超过 3 次时,应考虑简化 change 范围或重新评估方案可行性
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
*Verification 报告由 specwf verify 阶段自动生成。每次验证结果覆盖前次。*
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# 临时 Change
|
|
2
|
+
|
|
3
|
+
## 创建
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
specwf change new <change-name>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
CLI 自动创建目录结构并生成模板文件。
|
|
10
|
+
|
|
11
|
+
## 上下文
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
specwf context adhoc
|
|
15
|
+
specwf state
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 推进
|
|
19
|
+
|
|
20
|
+
完成 proposal 后:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
specwf continue change <change-name>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`continue change <name>` 会读取该 change 的当前状态(proposal/planning/applying/reviewing/verifying/archived),输出下一步建议和 slash command。
|
|
27
|
+
|
|
28
|
+
## 查看状态
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
specwf continue change <change-name>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 归档
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
specwf archive specwf/changes/<change-name>
|
|
38
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 自动推进
|
|
2
|
+
|
|
3
|
+
读 @specwf/state.md → 状态机确定下一步 → 自动执行。
|
|
4
|
+
|
|
5
|
+
## 用法
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 从当前 active_context 推断下一步
|
|
9
|
+
specwf continue
|
|
10
|
+
|
|
11
|
+
# 查询指定 change 的下一步
|
|
12
|
+
specwf continue change <name>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
CLI 自动输出:
|
|
16
|
+
- 当前位置
|
|
17
|
+
- 当前步骤
|
|
18
|
+
- 推荐下一步命令
|
|
19
|
+
- Slash 命令(如有)
|
|
20
|
+
- 是否需要子代理
|
|
21
|
+
- 无下一步时的引导提示
|
|
22
|
+
|
|
23
|
+
## 上下文
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
specwf state
|
|
27
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Phase 讨论
|
|
2
|
+
|
|
3
|
+
捕获实现决策,产出 CONTEXT.md。
|
|
4
|
+
|
|
5
|
+
## 上下文
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
specwf context discuss
|
|
9
|
+
specwf state
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
可参考:
|
|
13
|
+
@specwf/roadmap.md
|
|
14
|
+
@specwf/project.yml
|
|
15
|
+
|
|
16
|
+
## 产出
|
|
17
|
+
|
|
18
|
+
写入当前 phase 目录下的 context.md。
|
|
19
|
+
|
|
20
|
+
## 下一步
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
specwf continue
|
|
24
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 需求探讨
|
|
2
|
+
|
|
3
|
+
逐条向用户提问,直到所有需求细节达成共识。
|
|
4
|
+
|
|
5
|
+
## 上下文
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
specwf context grill
|
|
9
|
+
specwf state
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
可参考:
|
|
13
|
+
@specwf/project.md
|
|
14
|
+
@specwf/requirements.md
|
|
15
|
+
|
|
16
|
+
## 产出
|
|
17
|
+
|
|
18
|
+
更新 @specwf/requirements.md。
|
|
19
|
+
|
|
20
|
+
## 下一步
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
specwf continue
|
|
24
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 初始化项目
|
|
2
|
+
|
|
3
|
+
执行 `specwf init` 创建 specwf 目录结构。
|
|
4
|
+
|
|
5
|
+
## 存量项目
|
|
6
|
+
|
|
7
|
+
如果已有代码,执行 `specwf init --brownfield`,CLI 自动完成 codebase mapping + spec bootstrap。
|
|
8
|
+
|
|
9
|
+
## 上下文
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
specwf context init
|
|
13
|
+
specwf state
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 下一步
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
specwf continue
|
|
20
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 里程碑管理
|
|
2
|
+
|
|
3
|
+
切换或创建 Milestone。
|
|
4
|
+
|
|
5
|
+
## 上下文
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
specwf state
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 操作
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 切换到指定 milestone
|
|
15
|
+
specwf state set-milestone <id>
|
|
16
|
+
|
|
17
|
+
# 切换到指定 phase
|
|
18
|
+
specwf state set-phase <id>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
可参考 @specwf/roadmap.md 查看 milestone 列表。
|
|
22
|
+
|
|
23
|
+
## 下一步
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
specwf continue
|
|
27
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Change 设计
|
|
2
|
+
|
|
3
|
+
使用 specwf-planner agent 设计技术方案、拆分任务、预写 delta-specs。
|
|
4
|
+
|
|
5
|
+
## 上下文
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
specwf context plan
|
|
9
|
+
specwf state
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 产出
|
|
13
|
+
|
|
14
|
+
- design.md(技术方案)
|
|
15
|
+
- tasks.md(任务清单,标注 TDD type)
|
|
16
|
+
- specs/<domain>/spec.md(delta-specs)
|
|
17
|
+
|
|
18
|
+
## 下一步
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
specwf continue
|
|
22
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 项目技术调研
|
|
2
|
+
|
|
3
|
+
并行调研多个技术方向。使用 task 工具 fan-out specwf-researcher agent。
|
|
4
|
+
|
|
5
|
+
## 上下文
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
specwf context research
|
|
9
|
+
specwf state
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 产出
|
|
13
|
+
|
|
14
|
+
写入 @specwf/research/ 目录:
|
|
15
|
+
- @specwf/research/stack.md
|
|
16
|
+
- @specwf/research/architecture.md
|
|
17
|
+
- @specwf/research/pitfalls.md
|
|
18
|
+
- @specwf/research/summary.md
|
|
19
|
+
|
|
20
|
+
## 下一步
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
specwf continue
|
|
24
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# 路线图拆分
|
|
2
|
+
|
|
3
|
+
将项目拆分为 Milestone × Phase。
|
|
4
|
+
|
|
5
|
+
## 上下文
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
specwf context roadmap
|
|
9
|
+
specwf state
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
可参考 @specwf/requirements.md。
|
|
13
|
+
|
|
14
|
+
## 产出
|
|
15
|
+
|
|
16
|
+
更新 @specwf/roadmap.md。
|
|
17
|
+
|
|
18
|
+
## 下一步
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
specwf state set-milestone <第一个 milestone id>
|
|
22
|
+
specwf continue
|
|
23
|
+
```
|