@chenguangyao/devflow-kit 0.1.43
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/CHANGELOG.md +232 -0
- package/LICENSE +21 -0
- package/README.md +539 -0
- package/bin/devflow.js +9 -0
- package/docs/RFC-001-devflow-kit.md +617 -0
- package/docs/RFC-002-workflow-kernel.md +134 -0
- package/docs/enterprise-integration-supplement.md +274 -0
- package/docs/internal-gitlab-setup.md +426 -0
- package/docs/marketplace-skills.md +231 -0
- package/docs/migration-from-arb.md +232 -0
- package/docs/tooling-overview.md +774 -0
- package/docs/workflow-orchestration.md +695 -0
- package/docs/workflow-ui-prototype.html +271 -0
- package/package.json +52 -0
- package/schemas/config.schema.json +51 -0
- package/schemas/delta.schema.json +22 -0
- package/schemas/state.schema.json +130 -0
- package/schemas/status-surface.schema.json +197 -0
- package/schemas/workflow-confirmation-surface.schema.json +70 -0
- package/schemas/workflow-picker.schema.json +94 -0
- package/scripts/postinstall.js +101 -0
- package/scripts/render-workflow-ui-prototype.js +271 -0
- package/skills/apply/SKILL.md +313 -0
- package/skills/apply/references/discipline-checklist.md +145 -0
- package/skills/apply/references/subagent-implementer-prompt.md +113 -0
- package/skills/apply/references/subagent-orchestration.md +150 -0
- package/skills/apply/references/subagent-reviewer-prompt.md +180 -0
- package/skills/apply/references/tdd-loop.md +287 -0
- package/skills/apply/references/when-plan-is-wrong.md +279 -0
- package/skills/apply/references/worktree-swarm.md +292 -0
- package/skills/archive/SKILL.md +229 -0
- package/skills/archive/references/conflict-resolution.md +336 -0
- package/skills/archive/references/knowledge-deposit.md +381 -0
- package/skills/archive/references/spec-merge.md +365 -0
- package/skills/brainstorm/SKILL.md +123 -0
- package/skills/brainstorm/references/proposal-template.md +244 -0
- package/skills/brainstorm/references/question-catalog.md +168 -0
- package/skills/brainstorm/references/session-template.md +184 -0
- package/skills/ci-fix/SKILL.md +63 -0
- package/skills/ci-fix/references/loop.md +25 -0
- package/skills/code-review/SKILL.md +279 -0
- package/skills/code-review/references/escalation-playbook.md +192 -0
- package/skills/code-review/references/language-cheatsheets/go.md +175 -0
- package/skills/code-review/references/language-cheatsheets/java-spring-mybatis.md +246 -0
- package/skills/code-review/references/language-cheatsheets/python.md +170 -0
- package/skills/code-review/references/language-cheatsheets/vue.md +199 -0
- package/skills/code-review/references/output-template.md +275 -0
- package/skills/code-review/references/review-checklist.md +251 -0
- package/skills/complexity-grading/SKILL.md +259 -0
- package/skills/deliver/SKILL.md +271 -0
- package/skills/deliver/references/delivery-modes.md +299 -0
- package/skills/deliver/references/notify.md +359 -0
- package/skills/deliver/references/pr-description.md +319 -0
- package/skills/dependency-upgrade/SKILL.md +57 -0
- package/skills/dependency-upgrade/references/risk-matrix.md +38 -0
- package/skills/df-orchestrator/SKILL.md +407 -0
- package/skills/df-orchestrator/references/complexity-grading.md +177 -0
- package/skills/df-orchestrator/references/escalation-matrix.md +191 -0
- package/skills/df-orchestrator/references/routing-rules.md +290 -0
- package/skills/df-orchestrator/references/workflow-state-machine.md +208 -0
- package/skills/frontend-quality/SKILL.md +61 -0
- package/skills/frontend-quality/references/checklist.md +35 -0
- package/skills/handoff-resume/SKILL.md +59 -0
- package/skills/handoff-resume/references/handoff-template.md +54 -0
- package/skills/plan/SKILL.md +166 -0
- package/skills/plan/references/task-breakdown.md +207 -0
- package/skills/plan/references/task-sequencing.md +143 -0
- package/skills/plan/references/task-template.md +248 -0
- package/skills/requirement-analysis/SKILL.md +499 -0
- package/skills/requirement-analysis/references/acceptance-criteria.md +183 -0
- package/skills/requirement-analysis/references/code-recon.md +151 -0
- package/skills/requirement-analysis/references/edge-case-catalog.md +164 -0
- package/skills/requirement-analysis/references/requirement-template.md +339 -0
- package/skills/requirement-analysis/references/scope-negotiation.md +162 -0
- package/skills/security-hardening/SKILL.md +60 -0
- package/skills/security-hardening/references/checklist.md +42 -0
- package/skills/tech-spec/SKILL.md +388 -0
- package/skills/tech-spec/references/api-contract-design.md +172 -0
- package/skills/tech-spec/references/decision-records.md +110 -0
- package/skills/tech-spec/references/design-template.md +301 -0
- package/skills/tech-spec/references/rollout-and-rollback.md +203 -0
- package/skills/tech-spec/references/spec-delta-conventions.md +250 -0
- package/skills/tech-spec/references/transaction-patterns.md +212 -0
- package/skills/test-spec/SKILL.md +219 -0
- package/skills/test-spec/references/coverage-strategy.md +218 -0
- package/skills/test-spec/references/edge-case-to-test.md +143 -0
- package/skills/test-spec/references/test-case-template.md +276 -0
- package/skills/verify/SKILL.md +232 -0
- package/skills/verify/references/nfr-verification.md +292 -0
- package/skills/verify/references/report-templates.md +510 -0
- package/skills/verify/references/self-test-guide.md +240 -0
- package/skills/verify/references/verify-rollback-map.md +247 -0
- package/src/cli/commands/_helpers.js +108 -0
- package/src/cli/commands/_submit.js +718 -0
- package/src/cli/commands/apply.js +198 -0
- package/src/cli/commands/archive.js +180 -0
- package/src/cli/commands/checkpoint.js +113 -0
- package/src/cli/commands/deliver.js +377 -0
- package/src/cli/commands/deploy.js +504 -0
- package/src/cli/commands/design.js +158 -0
- package/src/cli/commands/disable.js +21 -0
- package/src/cli/commands/doctor.js +178 -0
- package/src/cli/commands/enable.js +21 -0
- package/src/cli/commands/flow.js +645 -0
- package/src/cli/commands/help.js +93 -0
- package/src/cli/commands/ingest.js +602 -0
- package/src/cli/commands/init.js +341 -0
- package/src/cli/commands/knowledge.js +523 -0
- package/src/cli/commands/logs.js +43 -0
- package/src/cli/commands/new.js +202 -0
- package/src/cli/commands/plan.js +49 -0
- package/src/cli/commands/propose.js +27 -0
- package/src/cli/commands/provider.js +698 -0
- package/src/cli/commands/report.js +143 -0
- package/src/cli/commands/requirement.js +227 -0
- package/src/cli/commands/review.js +301 -0
- package/src/cli/commands/skills.js +457 -0
- package/src/cli/commands/status.js +925 -0
- package/src/cli/commands/switch.js +27 -0
- package/src/cli/commands/sync.js +47 -0
- package/src/cli/commands/test.js +366 -0
- package/src/cli/commands/uninstall.js +32 -0
- package/src/cli/commands/update.js +74 -0
- package/src/cli/commands/verify.js +354 -0
- package/src/cli/commands/worktree.js +78 -0
- package/src/cli/index.js +72 -0
- package/src/cli/parse-args.js +102 -0
- package/src/core/autodetect.js +271 -0
- package/src/core/change.js +208 -0
- package/src/core/checkpoint.js +217 -0
- package/src/core/config.js +60 -0
- package/src/core/delta.js +290 -0
- package/src/core/markers.js +59 -0
- package/src/core/paths.js +173 -0
- package/src/core/plan-tasks.js +36 -0
- package/src/core/project-routing.js +285 -0
- package/src/core/projects.js +200 -0
- package/src/core/state.js +200 -0
- package/src/core/workflow-check.js +177 -0
- package/src/core/workflow-init.js +34 -0
- package/src/core/workflow-picker.js +154 -0
- package/src/core/workflow-policy.js +119 -0
- package/src/core/workflow-suggest.js +181 -0
- package/src/core/workflow-verify.js +88 -0
- package/src/core/workflow.js +433 -0
- package/src/core/worktree.js +241 -0
- package/src/knowledge/categories.js +107 -0
- package/src/knowledge/classify.js +125 -0
- package/src/knowledge/deposit.js +414 -0
- package/src/knowledge/migrate.js +149 -0
- package/src/knowledge/mr.js +219 -0
- package/src/knowledge/query.js +131 -0
- package/src/knowledge/registry.js +151 -0
- package/src/knowledge/sync.js +179 -0
- package/src/providers/base.js +74 -0
- package/src/providers/drivers/api-yapi.js +78 -0
- package/src/providers/drivers/ci-jenkins.js +109 -0
- package/src/providers/drivers/intake-confluence.js +544 -0
- package/src/providers/drivers/kb-git.js +549 -0
- package/src/providers/drivers/kb-weknora.js +472 -0
- package/src/providers/drivers/notify-smtp.js +515 -0
- package/src/providers/drivers/observability-oss.js +43 -0
- package/src/providers/drivers/observability-sls.js +50 -0
- package/src/providers/lifecycle.js +135 -0
- package/src/providers/loader.js +132 -0
- package/src/providers/local.js +190 -0
- package/src/providers/userconfig.js +283 -0
- package/src/reports/aggregate.js +185 -0
- package/src/reports/coverage.js +163 -0
- package/src/reports/detect.js +143 -0
- package/src/reports/parse.js +236 -0
- package/src/templates/files/ci/github.yml +38 -0
- package/src/templates/files/ci/gitlab.yml +27 -0
- package/src/templates/files/design.md +63 -0
- package/src/templates/files/ide/devflow-workflow.md +58 -0
- package/src/templates/files/ide/project-overview-reference.md +1 -0
- package/src/templates/files/ide/project-overview.md +27 -0
- package/src/templates/files/knowledge-index.json +17 -0
- package/src/templates/files/knowledge.md +28 -0
- package/src/templates/files/meta.json +8 -0
- package/src/templates/files/plan.md +38 -0
- package/src/templates/files/proposal.md +33 -0
- package/src/templates/files/reports/contract-test.md +40 -0
- package/src/templates/files/reports/e2e-test.md +30 -0
- package/src/templates/files/reports/integration-test.md +36 -0
- package/src/templates/files/reports/joint-test.md +58 -0
- package/src/templates/files/reports/perf.md +24 -0
- package/src/templates/files/reports/regression.md +20 -0
- package/src/templates/files/reports/remote-test.md +55 -0
- package/src/templates/files/reports/self-test.md +43 -0
- package/src/templates/files/reports/smoke-test.md +22 -0
- package/src/templates/files/reports/unit-test.md +36 -0
- package/src/templates/files/requirement.md +51 -0
- package/src/templates/files/review.md +38 -0
- package/src/templates/files/tests.md +36 -0
- package/src/templates/files/verify.md +32 -0
- package/src/templates/index.js +21 -0
- package/src/utils/log.js +37 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# archive / spec-merge
|
|
2
|
+
|
|
3
|
+
delta → spec 合并语义、heading 规则、多 delta 顺序、边界 case。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 总体模型(OpenSpec-inspired)
|
|
8
|
+
|
|
9
|
+
`devflow/specs/` 代表**当前在生产运行的能力清单**。每个 capability 一个 markdown,描述"系统声明能做什么 + 怎么做"。
|
|
10
|
+
|
|
11
|
+
`delta/*.md` 是本次 change 对 specs 的**增量改动声明**。archive 把这些 delta 合进 specs,使之保持同步。
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 目录结构
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
devflow/
|
|
19
|
+
├── specs/
|
|
20
|
+
│ ├── coupon-management.md ← 券管理能力
|
|
21
|
+
│ ├── order-refund.md ← 退款能力
|
|
22
|
+
│ └── user-notification.md ← 通知能力
|
|
23
|
+
└── changes/<slug>/delta/
|
|
24
|
+
├── coupon-management.md ← 本 change 对 coupon-management 的改动
|
|
25
|
+
└── coupon-batch-grant.md ← 本 change 新增的 capability
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
delta 文件名 = 目标 spec 文件名。不存在同名 spec → 按"新 capability"处理(整个 delta 作为新 spec 内容)。
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 三种 marker
|
|
33
|
+
|
|
34
|
+
### ADDED
|
|
35
|
+
|
|
36
|
+
新增一条 requirement。
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## ADDED: 批量发放优惠券
|
|
40
|
+
|
|
41
|
+
### 批量发放优惠券
|
|
42
|
+
|
|
43
|
+
系统 SHALL 支持单批 ≤ 10000 条的批量发放请求,
|
|
44
|
+
单条处理失败不影响其他条的处理,
|
|
45
|
+
返回结果中包含 grantedCount 和 failedCount。
|
|
46
|
+
|
|
47
|
+
failedReasons MUST 精确到具体用户和具体原因。
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
合并动作:在 `specs/coupon-management.md` 的 `## Requirements` section 下追加整个 `### 批量发放优惠券` 块。
|
|
51
|
+
|
|
52
|
+
### MODIFIED
|
|
53
|
+
|
|
54
|
+
修改已有 requirement 的描述。
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## MODIFIED: 优惠券发放
|
|
58
|
+
|
|
59
|
+
### 优惠券发放
|
|
60
|
+
|
|
61
|
+
系统 SHALL 支持单条或批量发放优惠券。
|
|
62
|
+
单条发放 P99 ≤ 200ms,批量发放(≤ 10000 条)整体 P99 ≤ 60s。
|
|
63
|
+
|
|
64
|
+
失败场景:
|
|
65
|
+
- 用户在黑名单 → fail with RISK_BLOCKED
|
|
66
|
+
- 用户已达领券上限 → fail with LIMIT_REACHED
|
|
67
|
+
- 活动已过期 → fail with ACTIVITY_EXPIRED
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
合并动作:找到 `specs/coupon-management.md` 里的 `### 优惠券发放` 块,整块替换。
|
|
71
|
+
|
|
72
|
+
### REMOVED
|
|
73
|
+
|
|
74
|
+
删除 requirement。
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## REMOVED: 优惠券临时冻结
|
|
78
|
+
|
|
79
|
+
该能力已于 v2.3 弃用,请使用"批量撤销"替代。
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
合并动作:找到 `### 优惠券临时冻结` 块,从 spec 中删除;delta 里的说明保留到 archive(不进 spec)。
|
|
83
|
+
|
|
84
|
+
### RENAMED(可选)
|
|
85
|
+
|
|
86
|
+
```markdown
|
|
87
|
+
## RENAMED: 优惠券锁定 -> 优惠券冻结
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
合并:找 `### 优惠券锁定`,rename heading,保留内容。
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## heading 的对齐规则
|
|
95
|
+
|
|
96
|
+
**匹配是字面 + trim + 空白规范化后的 exact match**:
|
|
97
|
+
|
|
98
|
+
- 大小写:敏感(`优惠券发放` ≠ `优惠券发放 `)
|
|
99
|
+
- 空格:trim 两端 + 内部多空格合一
|
|
100
|
+
- 标点:敏感
|
|
101
|
+
- level:必须 `### `(3 级),其他级别不参与匹配
|
|
102
|
+
|
|
103
|
+
错误示例:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
# delta
|
|
107
|
+
## MODIFIED: 优惠券 发放 ← 中间有空格,不匹配 specs 里 "优惠券发放"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 多个 delta 的合并顺序
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
delta/a.md
|
|
116
|
+
delta/b.md
|
|
117
|
+
delta/c.md
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
CLI 按字母序处理。
|
|
121
|
+
|
|
122
|
+
同一个 spec 文件如果被多个 delta 影响(同一次 slug 不应该这样,但允许),按字母序依次应用;后者看到的是前者应用后的状态。
|
|
123
|
+
|
|
124
|
+
跨 slug 的并行:不是 archive 的职责,见 [`conflict-resolution.md`](conflict-resolution.md)。
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 新 capability 的处理
|
|
129
|
+
|
|
130
|
+
如果 delta 文件名对应的 spec **不存在**,archive 把整个 delta 当作新 spec 内容:
|
|
131
|
+
|
|
132
|
+
delta `coupon-batch-grant.md`:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
## ADDED: 批量发放请求入参
|
|
136
|
+
|
|
137
|
+
### 批量发放请求入参
|
|
138
|
+
|
|
139
|
+
接口:POST /api/v1/coupons/batch-grant
|
|
140
|
+
|
|
141
|
+
请求 body:
|
|
142
|
+
- activityId: 必填
|
|
143
|
+
- users: 必填,数组,≤ 10000
|
|
144
|
+
- batchId: 可选,若传则幂等
|
|
145
|
+
|
|
146
|
+
## ADDED: 批量发放响应
|
|
147
|
+
|
|
148
|
+
### 批量发放响应
|
|
149
|
+
|
|
150
|
+
- grantedCount: int
|
|
151
|
+
- failedCount: int
|
|
152
|
+
- failedReasons: array of {userId, reason, code}
|
|
153
|
+
...
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
archive 产出 `specs/coupon-batch-grant.md`:
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
# Capability: coupon-batch-grant
|
|
160
|
+
|
|
161
|
+
## Requirements
|
|
162
|
+
|
|
163
|
+
### 批量发放请求入参
|
|
164
|
+
...
|
|
165
|
+
|
|
166
|
+
### 批量发放响应
|
|
167
|
+
...
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
顶部 frontmatter / 标题 template 在 `devflow init` 时可配。
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 已有 spec + delta 的合并细节
|
|
175
|
+
|
|
176
|
+
假设 `specs/coupon-management.md` 原有:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
# Capability: coupon-management
|
|
180
|
+
|
|
181
|
+
## Requirements
|
|
182
|
+
|
|
183
|
+
### 优惠券发放
|
|
184
|
+
|
|
185
|
+
系统 SHALL 支持单条发放,P99 ≤ 200ms。
|
|
186
|
+
...
|
|
187
|
+
|
|
188
|
+
### 优惠券查询
|
|
189
|
+
|
|
190
|
+
...
|
|
191
|
+
|
|
192
|
+
### 优惠券撤销
|
|
193
|
+
|
|
194
|
+
...
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
delta:
|
|
198
|
+
|
|
199
|
+
```markdown
|
|
200
|
+
## MODIFIED: 优惠券发放
|
|
201
|
+
### 优惠券发放
|
|
202
|
+
系统 SHALL 支持单条或批量发放,...
|
|
203
|
+
|
|
204
|
+
## ADDED: 批量发放优惠券
|
|
205
|
+
### 批量发放优惠券
|
|
206
|
+
系统 SHALL 支持 ≤ 10000 条 ...
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
合并后:
|
|
210
|
+
|
|
211
|
+
```markdown
|
|
212
|
+
# Capability: coupon-management
|
|
213
|
+
|
|
214
|
+
## Requirements
|
|
215
|
+
|
|
216
|
+
### 优惠券发放
|
|
217
|
+
系统 SHALL 支持单条或批量发放,... ← MODIFIED
|
|
218
|
+
|
|
219
|
+
### 优惠券查询
|
|
220
|
+
...
|
|
221
|
+
|
|
222
|
+
### 优惠券撤销
|
|
223
|
+
...
|
|
224
|
+
|
|
225
|
+
### 批量发放优惠券 ← ADDED
|
|
226
|
+
系统 SHALL 支持 ≤ 10000 条 ...
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
顺序:ADDED 默认 append 到最后;若要精确位置,用:
|
|
230
|
+
|
|
231
|
+
```markdown
|
|
232
|
+
## ADDED-AFTER: "优惠券发放"
|
|
233
|
+
|
|
234
|
+
### 批量发放优惠券
|
|
235
|
+
...
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Frontmatter 和 metadata
|
|
241
|
+
|
|
242
|
+
spec 文件推荐结构:
|
|
243
|
+
|
|
244
|
+
```markdown
|
|
245
|
+
---
|
|
246
|
+
capability: coupon-management
|
|
247
|
+
status: active
|
|
248
|
+
owner: @team-coupon
|
|
249
|
+
lastUpdated: 2026-04-24
|
|
250
|
+
lastChange: coupon-batch-grant
|
|
251
|
+
relatedChanges:
|
|
252
|
+
- 2026-03-10-coupon-activity
|
|
253
|
+
- 2026-04-24-coupon-batch-grant
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
# Capability: coupon-management
|
|
257
|
+
|
|
258
|
+
<description>
|
|
259
|
+
|
|
260
|
+
## Requirements
|
|
261
|
+
...
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
archive 会维护:
|
|
265
|
+
|
|
266
|
+
- `lastUpdated`:当次 archive 时间
|
|
267
|
+
- `lastChange`:当次 slug
|
|
268
|
+
- `relatedChanges`:append 当次 slug
|
|
269
|
+
|
|
270
|
+
owner / status 等字段 archive 不动(project 自己维护)。
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 边界 case
|
|
275
|
+
|
|
276
|
+
### delta 为空(只有 `learnings.md` 无 delta)
|
|
277
|
+
|
|
278
|
+
没 spec 变更,archive 只做"移动文件夹 + 记录归档时间"。
|
|
279
|
+
|
|
280
|
+
### delta 只修一个字段
|
|
281
|
+
|
|
282
|
+
仍然要整块替换 MODIFIED 的 block。不支持"只替换某行"这种细粒度。
|
|
283
|
+
|
|
284
|
+
理由:
|
|
285
|
+
|
|
286
|
+
- 粗粒度更可靠(语法无关)
|
|
287
|
+
- 细粒度 diff 冲突难处理
|
|
288
|
+
- 写 delta 时作者要思考清楚整个 block 现在应该是什么样
|
|
289
|
+
|
|
290
|
+
### RENAMED + MODIFIED 同时发生
|
|
291
|
+
|
|
292
|
+
先 RENAMED,后 MODIFIED(对新 heading)。或等价:用一个 MODIFIED 用新 heading + 新内容。
|
|
293
|
+
|
|
294
|
+
### 删除整个 capability
|
|
295
|
+
|
|
296
|
+
delta 是 `## DELETE_FILE`:
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
## DELETE_FILE
|
|
300
|
+
|
|
301
|
+
本 capability 整体废弃,能力迁移到 `coupon-batch-management` capability。
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
archive 删除 `specs/<capability>.md`(移到 `specs/_deprecated/`)。
|
|
305
|
+
|
|
306
|
+
### 两个 slug 同时 archive(不应该但允许)
|
|
307
|
+
|
|
308
|
+
按 archive 命令执行顺序处理。第二个 archive 看到的是第一个应用后的状态。
|
|
309
|
+
|
|
310
|
+
如果第二个 delta 基于旧状态写,会发生 heading mismatch → conflict → 需协调。
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## validate
|
|
315
|
+
|
|
316
|
+
archive 后 CLI 跑 `devflow specs validate`:
|
|
317
|
+
|
|
318
|
+
- 每个 capability 文件 `## Requirements` section 必须存在
|
|
319
|
+
- 每个 `### heading` 在同一文件内唯一
|
|
320
|
+
- 所有 requirement 有实质内容(非空 block)
|
|
321
|
+
- lastUpdated 不晚于当前时间
|
|
322
|
+
- 不存在交叉引用到已删除 capability
|
|
323
|
+
|
|
324
|
+
validate 不阻塞 archive(先归档,再告警),但 `devflow doctor` 会把 validate error 当 concern。
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 版本与 Git
|
|
329
|
+
|
|
330
|
+
推荐 archive 后:
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
git add devflow/specs/ devflow/archive/
|
|
334
|
+
git commit -m "archive: <slug> — applied spec deltas"
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
commit message 模板 archive CLI 会生成,用户 review 后 commit。
|
|
338
|
+
|
|
339
|
+
不推荐:
|
|
340
|
+
|
|
341
|
+
- 把 spec merge 和业务 code 放同一个 commit(archive 独立)
|
|
342
|
+
- force push specs(历史要稳定)
|
|
343
|
+
- rebase squash spec commits(保留 archive 的时间线)
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## 和 `devflow/archive/` 的关系
|
|
348
|
+
|
|
349
|
+
archive 后的 `devflow/archive/<date>-<slug>/`:
|
|
350
|
+
|
|
351
|
+
- 快照,不改动
|
|
352
|
+
- 反查用:查历史"当时是什么需求、什么设计"
|
|
353
|
+
- specs 里的 `relatedChanges[]` 指回 archive
|
|
354
|
+
|
|
355
|
+
archive 不进 CI build,不打包到 npm,但进 git(长期知识资产)。
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## 常见坑
|
|
360
|
+
|
|
361
|
+
- delta 写在老 spec 基线上,上游已 merge 了其他 slug 的 delta,heading 漂移
|
|
362
|
+
- delta 的 heading 用了 emoji / 非标点,spec 的 heading 无 → 匹配不到
|
|
363
|
+
- 忘了写 delta,只改 code,spec 遗漏(下一个 change 踩坑)
|
|
364
|
+
- 在 delta 里写 "TODO: 待补" → 归档时堂而皇之进 spec → spec 变垃圾堆
|
|
365
|
+
- MODIFIED 内容和 spec 现状差不多(说明没实际改动),浪费 merge 计算
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devflow-brainstorm
|
|
3
|
+
description: |
|
|
4
|
+
devflow-kit 流程中,在用户**没有**任何外部材料(没 PRD / 没 JIRA / 没 Wiki / 没 incident)、只有一个模糊想法
|
|
5
|
+
时的前置硬闸。把"我想做 X" 逼问成"可写进 proposal.md 的问题框架"。当用户说 "我想加一个 X"
|
|
6
|
+
/ "看看能不能做个 Y" / "帮我规划一下 Z" 且没给外部链接时,**必须**触发本 skill,不要直接跳
|
|
7
|
+
design 或写代码。若用户其实有 URL / issue 在手只是没贴出来,追问一下,能走 `devflow ingest` 就
|
|
8
|
+
走,brainstorm 不是 ingest 的替代。
|
|
9
|
+
when_to_use: |
|
|
10
|
+
`devflow new <slug>` 之后、`devflow requirement` 之前的窗口。典型触发:用户纯自然语言描述一个想法,
|
|
11
|
+
没有任何可 ingest 的外部材料。L1 bug 通常不经过 brainstorm(走 ingest incident 或直接
|
|
12
|
+
requirement)。
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# brainstorm
|
|
16
|
+
|
|
17
|
+
这是 `requirement-analysis` 前的**硬闸**。目标不是"头脑风暴想点子",而是**把一个模糊想法逼成可决策的问题框架**:问题是什么、为什么现在做、边界在哪、成功怎么量。
|
|
18
|
+
|
|
19
|
+
## 前置检查(任一缺失则先修)
|
|
20
|
+
|
|
21
|
+
| 输入 | 必需 | 缺失时 |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `devflow/changes/<slug>/proposal.md` 骨架 | 是 | 先跑 `devflow new <slug>` |
|
|
24
|
+
| 用户的原始输入(一段自然语言) | 是 | 追问用户,不能凭空 brainstorm |
|
|
25
|
+
| `devflow/config.json` 的 `detect.language` / `detect.project` | 否(有更佳) | 用于判断代码影响面 |
|
|
26
|
+
|
|
27
|
+
### 必须先问一个问题(防误用)
|
|
28
|
+
|
|
29
|
+
进入 brainstorm 的第一动作:
|
|
30
|
+
|
|
31
|
+
> "你这个想法在哪儿聊过?有没有 PRD / Wiki / 飞书文档 / issue?有的话我直接 ingest,brainstorm 只在完全没材料时用。"
|
|
32
|
+
|
|
33
|
+
用户说"没有" → 进入 brainstorm 正常流程。
|
|
34
|
+
用户说"有,我找找" → 等他给,拿到后走 `devflow ingest`,brainstorm 结束(不跑空)。
|
|
35
|
+
|
|
36
|
+
## 产物
|
|
37
|
+
|
|
38
|
+
编辑 `devflow/changes/<slug>/proposal.md`,必填以下 6 段:
|
|
39
|
+
|
|
40
|
+
| Section | 一句话描述 | 字数建议 |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| **Problem** | 用户的原话,或用户视角的一句话描述 | ≤ 30 字 |
|
|
43
|
+
| **Why now** | 为什么是这周/这季度做而不是下季度 | 1-2 句 |
|
|
44
|
+
| **Constraints** | 时间 / 现有代码 / 不能破坏的东西 | 3-5 项 |
|
|
45
|
+
| **Success criteria** | 可测量的成功标准 | 2-4 项,必须含数字或二值判定 |
|
|
46
|
+
| **Out of scope** | 显式列出本次**不做**的东西 | 3-5 项,越具体越好 |
|
|
47
|
+
| **Recommended level** | L1/L2/L3 + 依据 | 一句结论,依据参见 `df-orchestrator/references/complexity-grading.md` |
|
|
48
|
+
|
|
49
|
+
详细字段语义与反例见 [`references/proposal-template.md`](references/proposal-template.md)。
|
|
50
|
+
|
|
51
|
+
## 提问方法论(核心)
|
|
52
|
+
|
|
53
|
+
brainstorm 不是"问一堆问题",而是"**用尽可能少的问题**把 6 段 proposal 凑齐"。硬约束:
|
|
54
|
+
|
|
55
|
+
- **一次一个问题**,不要炮连珠;用户答完重述理解给用户确认再问下一个
|
|
56
|
+
- **最多 5 个问题**,超过说明你没抓住关键;超过 5 个还问不清 → 建议用户先 `devflow ingest` 外部材料或 `devflow new` 作废重来
|
|
57
|
+
- **不准问"技术实现细节"**(如"你想用 Redis 还是 MySQL?"),那是 tech-spec 的事
|
|
58
|
+
- **不准问多个平行问题**(如"what X and Y and Z?"),会让用户 overwhelmed
|
|
59
|
+
|
|
60
|
+
问题的挑选顺序和套路见 [`references/question-catalog.md`](references/question-catalog.md),按问题类型(新功能 / 改进 / bug-driven / refactor / 合规驱动)有不同的问法集。
|
|
61
|
+
|
|
62
|
+
## 5 个标准问题(按需挑 3-5 个用)
|
|
63
|
+
|
|
64
|
+
| # | 问题 | 回答去哪个 section |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| Q1 | 谁受益?怎么发现 / 触达? | Problem + Why now |
|
|
67
|
+
| Q2 | 成功长什么样?能给个数字吗? | Success criteria |
|
|
68
|
+
| Q3 | 哪部分代码最可能被改? | Constraints + Recommended level |
|
|
69
|
+
| Q4 | 有什么必须保留不能破坏的? | Constraints |
|
|
70
|
+
| Q5 | 本次明确不做什么? | Out of scope |
|
|
71
|
+
|
|
72
|
+
Q3 是**判级的关键**:用户说"登录流程"→ L2 起步;说"后台新增一个 CSV 导出"→ 大概率 L1;说"跨服务加 traceId"→ L3。详细判级规则见 orchestrator 的 `complexity-grading.md`。
|
|
73
|
+
|
|
74
|
+
## 会话范式(Session Template)
|
|
75
|
+
|
|
76
|
+
每次 brainstorm 由 3 个阶段组成:**框架 → 迭代 → 收敛**。每阶段的话术与示例见 [`references/session-template.md`](references/session-template.md),包括:
|
|
77
|
+
|
|
78
|
+
1. 开场话术(30 秒内让用户知道接下来要做啥,不是闲聊)
|
|
79
|
+
2. 迭代问答(单问 → 确认 → 深化)
|
|
80
|
+
3. 收敛产物(把零散回答组织成 proposal.md 的 6 个 section)
|
|
81
|
+
|
|
82
|
+
## 硬闸(Done Criteria)
|
|
83
|
+
|
|
84
|
+
`devflow propose`(或本 skill 判自己完成) 前必须满足:
|
|
85
|
+
|
|
86
|
+
- [ ] proposal.md 的 6 个 section 全部非空
|
|
87
|
+
- [ ] Success criteria 至少 1 条是**可测量的**(有数字 / 二值,"更好用 / 更快" 不算)
|
|
88
|
+
- [ ] Out of scope 至少 2 条具体项(不是 "其他都不做")
|
|
89
|
+
- [ ] Recommended level 写了并给出判定依据
|
|
90
|
+
|
|
91
|
+
未满足 → 继续追问;仍不满足 → 回报 `NEEDS_INPUT`,由 orchestrator 转给用户。
|
|
92
|
+
|
|
93
|
+
## 反模式(见过的全错法)
|
|
94
|
+
|
|
95
|
+
- **brainstorm 当 design 做**:问"数据库选型 / 索引策略 / 并发方案"。这些在 tech-spec 做,在 brainstorm 问会让用户方案先行,需求反而不清。
|
|
96
|
+
- **brainstorm 当 scoping 做**:试图在 brainstorm 里把需求拆到"story-by-story"。那是 requirement-analysis 的活;brainstorm 只框定题目不展开细节。
|
|
97
|
+
- **同时输出 2-3 个方案让用户选**:brainstorm 的产出是**一个框定好的问题**,不是"选项 A/B/C";方案比较放 tech-spec。
|
|
98
|
+
- **问题炮连珠**:一次问 5 个问题,用户只答第 1 个其他忘了 → 假装后面 4 个都得到默认值,后续 phase 炸。
|
|
99
|
+
- **用户说"你帮我想"就真的全凭猜**:遇到这种,要么给用户 2 个**选择题**而不是开放题(降低用户心力),要么回报 `NEEDS_INPUT` 叫 orchestrator 把球踢回去。
|
|
100
|
+
- **没问 Out of scope 就结束**:漏掉 scope 边界会在 apply / review 阶段反复返工;必须显式问。
|
|
101
|
+
- **跳过 Problem 直接写 "Recommended level"**:顺序不能反;没定义 Problem 就判级是瞎蒙。
|
|
102
|
+
|
|
103
|
+
## 完成状态协议
|
|
104
|
+
|
|
105
|
+
完成时输出:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
---STATUS---
|
|
109
|
+
result: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_INPUT
|
|
110
|
+
outputs:
|
|
111
|
+
- devflow/changes/<slug>/proposal.md
|
|
112
|
+
recommendedLevel: L1 | L2 | L3
|
|
113
|
+
nextAction: devflow requirement
|
|
114
|
+
---END_STATUS---
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
orchestrator 接到 DONE → 进入 requirement-analysis。
|
|
118
|
+
|
|
119
|
+
## 参考
|
|
120
|
+
|
|
121
|
+
- [`references/proposal-template.md`](references/proposal-template.md) — proposal.md 6 段的详细模板、正反例、字段边界
|
|
122
|
+
- [`references/question-catalog.md`](references/question-catalog.md) — 按任务类型挑问题(新功能/改进/bug-driven/refactor/合规/性能)
|
|
123
|
+
- [`references/session-template.md`](references/session-template.md) — 开场/迭代/收敛 3 阶段话术与完整对话示例
|