@gordon.gan/specflow 1.4.3-beta → 1.4.6-beta
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 +2 -2
- package/dist/cli/commands/approval-assemble.d.ts +21 -0
- package/dist/cli/commands/approval-assemble.js +95 -0
- package/dist/cli/index.js +2 -0
- package/dist/core/approval/assemble.d.ts +10 -0
- package/dist/core/approval/assemble.js +337 -0
- package/dist/core/approval/index-schema.d.ts +244 -0
- package/dist/core/approval/index-schema.js +90 -0
- package/dist/core/approval/index.d.ts +4 -0
- package/dist/core/approval/index.js +3 -0
- package/dist/core/approval/paths.d.ts +8 -0
- package/dist/core/approval/paths.js +28 -0
- package/dist/core/approval/types.d.ts +92 -0
- package/dist/core/approval/types.js +1 -0
- package/dist/core/project-config.d.ts +4 -0
- package/dist/core/project-config.js +49 -0
- package/dist/core/project-conventions.d.ts +15 -0
- package/dist/core/project-conventions.js +66 -0
- package/package.json +1 -1
- package/prompts/approval/database-guidance.md +10 -8
- package/prompts/approval/frontend-guidance.md +249 -0
- package/prompts/approval/generate.md +368 -160
- package/prompts/approval/project-conventions-guidance.md +171 -0
- package/prompts/approval/segmented-generation.md +145 -0
- package/skills/GUIDANCE_PACKS.md +47 -24
- package/skills/database/README.md +11 -10
- package/skills/specflow-approval/SKILL.md +254 -87
- package/templates/approval-index.yaml +52 -0
- package/templates/approval-part.md +15 -0
- package/templates/approval.md +81 -310
|
@@ -80,13 +80,71 @@ change names, file paths, commands, and code in their original form.
|
|
|
80
80
|
- `Cargo.toml` → Rust
|
|
81
81
|
- `tsconfig.json` → TypeScript (refines Node detection)
|
|
82
82
|
- If none match, set `techStack: unknown`
|
|
83
|
-
5.
|
|
83
|
+
5. Set `projectMode`:
|
|
84
|
+
- `greenfield` — no meaningful application source yet (no `src/`/`app/`/`internal/`/`lib/`
|
|
85
|
+
with real code, or only empty scaffold); Pass 6 will be SKIPPED greenfield
|
|
86
|
+
- `brownfield` — existing product code to ground against
|
|
87
|
+
6. **Detect database stack** (for §4.4 guidance). Follow
|
|
84
88
|
`prompts/approval/database-guidance.md` §1 — set
|
|
85
89
|
`dbStack: mysql|postgresql|oracle|redis|elasticsearch|none`. Prefer OLTP
|
|
86
90
|
(`mysql`/`postgresql`/`oracle`) over cache/search when multiple match.
|
|
87
|
-
|
|
91
|
+
7. **Scan four artifacts for tech selection coverage** (proposal / design / tasks / specs):
|
|
92
|
+
look for explicit choices on: 前端、后端、数据库与缓存、基础设施(含 CI/部署/云)。
|
|
93
|
+
Set `stackCoverage: complete | partial | missing`.
|
|
94
|
+
8. **Detect `uiInScope`** (follow `prompts/approval/frontend-guidance.md` §1):
|
|
95
|
+
UI/控制台/页面/组件 signals → `uiInScope=yes|no`. When yes, check FE 五元组 coverage
|
|
96
|
+
(Framework / Styling / State / UI kit / FE testing); incomplete counts as
|
|
97
|
+
`stackCoverage=partial` for 前端.
|
|
98
|
+
9. Read `specflow/specs/` baseline if it exists (for Pass 7 baseline cross-check).
|
|
99
|
+
|
|
100
|
+
Announce: "Generating technical approval document for change `<name>` (phase=refined,
|
|
101
|
+
language=<lang>, projectMode=<greenfield|brownfield>, techStack=<stack>, dbStack=<db>,
|
|
102
|
+
uiInScope=<yes|no>, stackCoverage=<complete|partial|missing>)."
|
|
88
103
|
|
|
89
|
-
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Gate: Tech Stack Intake (0→1 / 四件套缺选型)
|
|
107
|
+
|
|
108
|
+
**Trigger** (any):
|
|
109
|
+
|
|
110
|
+
- `projectMode = greenfield`, **or**
|
|
111
|
+
- `stackCoverage = missing | partial` for dimensions this change needs
|
|
112
|
+
(e.g. UI change needs 前端; persistence needs 数据库与缓存; ship needs 基础设施)
|
|
113
|
+
|
|
114
|
+
**Do NOT** invent a full stack. **STOP and ask the user** in chat (structured), then wait:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
本变更需要补全技术选型(四件套未写清 / 0→1 绿场)。请确认或补充下列方向
|
|
118
|
+
(可写「本变更不涉及」跳过某一维):
|
|
119
|
+
|
|
120
|
+
1. 前端:Framework / Styling / State / UI kit / FE testing(五元组;或不涉及前端)
|
|
121
|
+
2. 后端:语言/框架、API 风格(HTTP/gRPC/…)、进程模型
|
|
122
|
+
3. 数据库与缓存:主存(MySQL/PG/…)、缓存(Redis/…)、搜索(若有)
|
|
123
|
+
4. 基础设施:运行环境(K8s/VM/Serverless)、CI/CD、对象存储/消息队列(若有)
|
|
124
|
+
5. 其它约束:公司强制栈、禁止项、必须复用的现网组件
|
|
125
|
+
|
|
126
|
+
若本变更含 UI 且前端仍不清,追问(可合并一次问完):
|
|
127
|
+
- 关键页面/路由清单(或「沿用现网,本迭代只改某页」)
|
|
128
|
+
- 验证命令(dev / test / e2e / browser)
|
|
129
|
+
- (可选)若用 v0/Lovable 等 AI builder:导出与本地可构建计划
|
|
130
|
+
|
|
131
|
+
回复示例:
|
|
132
|
+
前端 Next.js+TS / Tailwind / Zustand / shadcn / Vitest+Playwright;
|
|
133
|
+
后端 Go+Gin;DB MySQL 8 + Redis;基础设施 K8s + GitHub Actions;
|
|
134
|
+
禁止自建消息队列,复用公司 Kafka。
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
After the user answers:
|
|
138
|
+
|
|
139
|
+
1. Record answers for §2.2 技术选型 + fold into §2.4 决策评审表 (new D-rows).
|
|
140
|
+
2. Suggest (do not force) updating `design.md` via `/specflow:refine` later; approval may
|
|
141
|
+
proceed with chat-confirmed stack for this `approval.md` only.
|
|
142
|
+
3. Re-run dbStack detection if the user named a DB; re-check FE 五元组 if UI in scope.
|
|
143
|
+
4. Continue subsequent stages.
|
|
144
|
+
|
|
145
|
+
If the user refuses to choose and the change clearly needs a stack → mark
|
|
146
|
+
`[待 refine 澄清: 技术选型]` and **do not** fabricate architecture/DDL/页面树 around a
|
|
147
|
+
guessed stack.
|
|
90
148
|
|
|
91
149
|
---
|
|
92
150
|
|
|
@@ -95,36 +153,30 @@ Announce: "Generating technical approval document for change `<name>` (phase=ref
|
|
|
95
153
|
Read these files and follow them:
|
|
96
154
|
|
|
97
155
|
1. `.claude/specflow/prompts/approval/generate.md` (or repo `prompts/approval/generate.md`)
|
|
98
|
-
2. `prompts/approval/database-guidance.md` — DB **guidance pack** router
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
`generate.md` +
|
|
105
|
-
|
|
106
|
-
- The 7-dimension closed-loop verification (Passes 1–7
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
→ `Read`; miss → LLM-fallback. Packs are **not** installed under IDE `skills/` discovery.
|
|
123
|
-
stack → Read in-repo skill; no hit → LLM fallback; **never** fetch remote skills / MCP wrap
|
|
124
|
-
- Anchor-file extraction and code-reading rules (depth: anchor file only, no recursion)
|
|
125
|
-
|
|
126
|
-
You MUST read `generate.md` before performing any analysis or writing `approval.md`. Do not
|
|
127
|
-
invent the assessment dimensions or document structure — they are defined in that prompt.
|
|
156
|
+
2. `prompts/approval/database-guidance.md` — SpecFlow DB **guidance pack** router
|
|
157
|
+
3. `prompts/approval/frontend-guidance.md` — UI scope + FE 五元组 + §4.6 contract
|
|
158
|
+
4. `prompts/approval/project-conventions-guidance.md` — **project** skill/rule/docs
|
|
159
|
+
lazy-load (architecture / api / database / frontend); cross-IDE path resolve;
|
|
160
|
+
priority **project > SpecFlow guidance > LLM**
|
|
161
|
+
|
|
162
|
+
`generate.md` + convention/DB/FE routers together specify:
|
|
163
|
+
|
|
164
|
+
- The 7-dimension closed-loop verification (Passes 1–7)
|
|
165
|
+
- Design quality, architecture, detailed design, test/deploy (optional chapters), implementability
|
|
166
|
+
- Document order: §1 → §2 → §3 → §4 → **(optional §5)** → §6 → **(optional §7/§8)** → §9 → §10(签字栏 only)
|
|
167
|
+
- **Quality Gates G1–G6** + **Style & Tone**(含禁止正文代码腔)
|
|
168
|
+
- **Optional chapters** §5 / §7 / §8 — ask before write; **AI 预审** chat-only
|
|
169
|
+
- **Project conventions** lazy-load before §3/§4.4/§4.5/§4.6; **project > SpecFlow guidance > LLM**
|
|
170
|
+
- **DB guidance** after project DB conventions; resolve
|
|
171
|
+
`{ide}/specflow/guidance/database/<stack>/` (or package `skills/database/`); record
|
|
172
|
+
项目约定 + DB 技能 + `dbStack` in §4.4.1; never fetch remote / MCP
|
|
173
|
+
- **FE guidance** when `uiInScope=yes`: `frontend-guidance.md` §3 **must** scan
|
|
174
|
+
IDE skills/rules + 落地文档(组件/路由/状态/表单/样式/a11y/测试) + `topic=frontend`;
|
|
175
|
+
§4.6 cites 项目约定 + IDE skills/rules; G5/G6; Visual Loop; never invent page trees
|
|
176
|
+
- **Tech stack intake**: greenfield or four-artifacts missing 前端/后端/数据库与缓存/基础设施
|
|
177
|
+
→ ask user before inventing stacks; FE needs 五元组; record in §2.2; never fabricate
|
|
178
|
+
|
|
179
|
+
You MUST read `generate.md` before any analysis or writing `approval.md`.
|
|
128
180
|
|
|
129
181
|
---
|
|
130
182
|
|
|
@@ -181,9 +233,10 @@ After all 7 Passes:
|
|
|
181
233
|
- `PASS WITH WARNINGS` if no `FAIL` but at least one `WARNING`
|
|
182
234
|
- `PASS` if all Passes are `PASS` (a `SKIPPED` Pass does not affect the verdict)
|
|
183
235
|
|
|
184
|
-
When writing `approval.md` **§8
|
|
185
|
-
Part E §8)
|
|
186
|
-
|
|
236
|
+
When writing `approval.md` **§8** (only if the user opted in), use the **single compact
|
|
237
|
+
table** only (see generate.md Part E §8). Always run Passes 1–7 for the **chat** summary
|
|
238
|
+
even when §8 is omitted from the document. Expand evidence only for ⚠️/❌ rows
|
|
239
|
+
(max 2–3 bullets); PASS/SKIPPED stay one line.
|
|
187
240
|
|
|
188
241
|
---
|
|
189
242
|
|
|
@@ -227,9 +280,11 @@ Scan `design.md` for the 5 extensibility signals:
|
|
|
227
280
|
|
|
228
281
|
## Stage 6: Architecture Design
|
|
229
282
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
283
|
+
**Before drafting §3**: follow `project-conventions-guidance.md` with `topic=architecture`
|
|
284
|
+
(lazy-load ≤3 project convention files). Apply project bans to 图要点; cite path or「未发现」.
|
|
285
|
+
|
|
286
|
+
Produce the **architecture design** section (approval.md **§3**) defined in
|
|
287
|
+
`generate.md` Part E.
|
|
233
288
|
|
|
234
289
|
It is complementary to Detailed Design: architecture is about **module-to-module
|
|
235
290
|
relationships** (macro), detailed design is about **module-internal implementation**
|
|
@@ -278,22 +333,30 @@ Produce the **detailed design** section (approval.md **§4** 方案详细设计)
|
|
|
278
333
|
|
|
279
334
|
**Selective** categories; uninvolved ones get explicit「不涉及 X」markers.
|
|
280
335
|
|
|
281
|
-
Order and hard requirements (from `generate.md` §4.1–4.
|
|
336
|
+
Order and hard requirements (from `generate.md` §4.1–4.9):
|
|
282
337
|
|
|
283
338
|
1. **设计要点一览** — P1…Pn invariants from design decisions (required).
|
|
284
339
|
2. **核心业务时序 · Happy Path** — complete Mermaid `sequenceDiagram` for the main success
|
|
285
340
|
path + post-diagram「设计要点」(required).
|
|
286
341
|
3. **业务场景时序** — each scenario: purpose + diagram + **设计要点说明** (required notes;
|
|
287
342
|
bare diagrams fail quality).
|
|
288
|
-
4. **数据结构** — Before
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
5.
|
|
295
|
-
|
|
296
|
-
|
|
343
|
+
4. **数据结构** — Before §4.4: (1) `project-conventions-guidance.md` `topic=database`;
|
|
344
|
+
(2) `database-guidance.md` + SpecFlow guidance pack / `dbStack`; (3) live DDL/anchors.
|
|
345
|
+
Priority: **project + live DDL > SpecFlow pack > LLM**. §4.4.1 must list 项目约定 + DB 技能.
|
|
346
|
+
**Outline**: only `4.4.1–4.4.4` + `##### table`; DDL/字段说明/JSON = `**bold**`.
|
|
347
|
+
5. **接口设计** — Before §4.5: `project-conventions-guidance.md` `topic=api`.
|
|
348
|
+
Then inventory + fields + examples + errors…
|
|
349
|
+
**Outline**: only `4.5.1–4.5.3` + `##### In`; 请求体字段/示例/错误 = `**bold**`.
|
|
350
|
+
6. **前端 / UI** — When `uiInScope=yes`: before §4.6:
|
|
351
|
+
(1) `project-conventions-guidance.md` `topic=frontend`;
|
|
352
|
+
(2) **`frontend-guidance.md` §3** — 强制扫描 IDE skills/rules(`.cursor`/`.claude`/`.agents`)
|
|
353
|
+
与落地文档(组件命名、路由、状态、表单、API client、样式/token、a11y、测试命令、lint 禁令);
|
|
354
|
+
合计 ≤5 文件,禁止 `invoke` skill;
|
|
355
|
+
(3) live UI anchors from design/tasks.
|
|
356
|
+
Then write 五元组 + 页面/路由 + Page 详设(空/加载/错态) + 状态 + Visual Loop.
|
|
357
|
+
§4.6.1 must list **项目约定** + **IDE skills/rules**.
|
|
358
|
+
**Outline**: only `4.6.1–4.6.5` + `##### Page · …`. **G5/G6**. Omit chapter if no UI.
|
|
359
|
+
7. **核心算法 / 配置 / 兼容性** — §4.7–4.9 as applicable.
|
|
297
360
|
|
|
298
361
|
**Traceability**: every element → **§5** Requirement/Scenario and **§2** decision.
|
|
299
362
|
If not implementer-ready, mark `[待 refine 澄清: <元素>]`.
|
|
@@ -302,24 +365,34 @@ Present the detailed design to the user as part of the confirmation summary.
|
|
|
302
365
|
|
|
303
366
|
---
|
|
304
367
|
|
|
305
|
-
## Stage 8: Acceptance Criteria (
|
|
368
|
+
## Stage 8: Acceptance Criteria (optional)
|
|
369
|
+
|
|
370
|
+
**Ask the user** whether to include **§5 验收标准** in `approval.md`.
|
|
306
371
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
372
|
+
- If **yes**: produce §5 only **after** §3/§4 are drafted; exhaustive Requirement +
|
|
373
|
+
Scenario list with 3-level testability.
|
|
374
|
+
- If **no**: omit the entire chapter (no placeholder).
|
|
310
375
|
|
|
311
376
|
---
|
|
312
377
|
|
|
313
378
|
## Stage 9: Test Strategy
|
|
314
379
|
|
|
315
|
-
Produce
|
|
316
|
-
|
|
380
|
+
Produce **§6 测试策略**. If §5 is included, every criterion maps to ≥1 test layer.
|
|
381
|
+
If §5 was omitted, map layers to named Requirement/Scenario from delta specs.
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Stage 10: Deployment & Release (optional)
|
|
386
|
+
|
|
387
|
+
**Ask the user** whether to include **§7 部署/发布/回滚**. If yes, produce the section;
|
|
388
|
+
if no, omit entirely.
|
|
317
389
|
|
|
318
390
|
---
|
|
319
391
|
|
|
320
|
-
## Stage
|
|
392
|
+
## Stage 10b: Closed-Loop table (optional)
|
|
321
393
|
|
|
322
|
-
|
|
394
|
+
Closed-loop **analysis** (Passes 1–7) always runs. **Ask the user** whether to include
|
|
395
|
+
**§8 闭环性检查表** in the document. If no, omit §8; still report overall verdict in chat.
|
|
323
396
|
|
|
324
397
|
---
|
|
325
398
|
|
|
@@ -345,57 +418,151 @@ Each dimension produces a verdict (`READY` | `NEEDS REFINEMENT` | `BLOCKED`) wit
|
|
|
345
418
|
|
|
346
419
|
---
|
|
347
420
|
|
|
348
|
-
## Stage 12: Generate approval.md
|
|
421
|
+
## Stage 12: Generate approval.md (Index → Map → CLI Reduce)
|
|
422
|
+
|
|
423
|
+
Follow `generate.md` Part E (structure) and Part F (segmented pipeline + anti-lazy rules).
|
|
424
|
+
Read `prompts/approval/segmented-generation.md` when `mode=segmented`.
|
|
425
|
+
|
|
426
|
+
**Output artifact**: `specflow/changes/<name>/approval.md`
|
|
427
|
+
**Workspace** (segmented): `specflow/changes/<name>/approval/` — `index.yaml`, `analysis.json`, `parts/*.md`, `manifest.json`
|
|
428
|
+
|
|
429
|
+
### 12.0 Mode selection (before writing)
|
|
430
|
+
|
|
431
|
+
| Trigger | Mode |
|
|
432
|
+
|---------|------|
|
|
433
|
+
| `tables > 2` OR `interfaces > 3` OR `pages > 2` OR user opted §5 | **segmented** (mandatory) |
|
|
434
|
+
| Else | ask user: **segmented** (recommended) or **monolithic** |
|
|
435
|
+
|
|
436
|
+
Copy `templates/approval-index.yaml` → `approval/index.yaml`; fill `tables[]` / `interfaces[]` / `pages[]` with stable ids and `part` paths **before** any Map batch.
|
|
437
|
+
|
|
438
|
+
**Anti-lazy (hard)**: when segmented, **never** one-shot the full `approval.md`; **never** stub parts (`TODO` / `待补充` / empty); **always** finish with CLI Reduce (12d).
|
|
349
439
|
|
|
350
|
-
|
|
351
|
-
`approval.md` inside the change directory at `specflow/changes/<name>/approval.md`.
|
|
440
|
+
### 12a Index + Skeleton
|
|
352
441
|
|
|
353
|
-
|
|
442
|
+
Write **first** (Gate depends on this):
|
|
354
443
|
|
|
355
|
-
1.
|
|
356
|
-
2.
|
|
357
|
-
3.
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
444
|
+
1. `approval/index.yaml` — full `parts_order`, entity inventory, `optional.s5/s7/s8`, `mode`
|
|
445
|
+
2. `approval/analysis.json` — Pass 1–7 + quality + implementability summaries
|
|
446
|
+
3. `approval/parts/` skeleton:
|
|
447
|
+
- `01-intro.md` … `03-architecture.md`
|
|
448
|
+
- `04-detail-core.md` (§4.1–4.3 only)
|
|
449
|
+
- `06-test.md`, `09-implementability.md`, `10-signoff.md`
|
|
361
450
|
|
|
362
|
-
|
|
451
|
+
Use `templates/approval-part.md` fragment header; parts use `###`/`####` only — **no** foreign `## N.` headings.
|
|
363
452
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
453
|
+
### 12b Map Append (batched §4.4 / §4.5 / §4.6 / §4.7–§4.9)
|
|
454
|
+
|
|
455
|
+
Per batch, Read only: `index.yaml`, `analysis.json` digests, design/tasks/spec snippets for batch ids, lazy-loaded conventions (caps per topic), anchor files.
|
|
456
|
+
|
|
457
|
+
Respect `index.batching.*_per_call`. After each part: update `approval/manifest.json` entry.
|
|
458
|
+
|
|
459
|
+
Minimums (no shortcuts — see Part E hard rules 9–10, 18–20):
|
|
460
|
+
|
|
461
|
+
- §4.4 batch: DDL + 字段说明 + 本迭代用法 per table; G3/G4 when applicable
|
|
462
|
+
- §4.5 batch: meta + fields + success examples + **failure example (G2)** + error table per interface (**含不变**;完整格式,禁止精简)
|
|
463
|
+
- §4.6 batch (when `uiInScope`): IDE skills/rules scan first; page/route + states + G6; §4.5 `In` refs
|
|
464
|
+
|
|
465
|
+
### 12c Optional chapters
|
|
466
|
+
|
|
467
|
+
Only if user accepted **and** `optional.s5/s7/s8: true` in index:
|
|
468
|
+
|
|
469
|
+
- Insert `05-*` / `07-deploy` / `08-closed-loop` into `parts_order`
|
|
470
|
+
- §8: one table only (from analysis)
|
|
471
|
+
|
|
472
|
+
### 12d CLI Reduce (mandatory for segmented)
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
specflow approval check <change>
|
|
476
|
+
specflow approval assemble <change> --force
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
- `check` must pass with **zero errors** before assemble
|
|
480
|
+
- Reduce is **deterministic** — no LLM stitching
|
|
481
|
+
- Report final path: `specflow/changes/<name>/approval.md`
|
|
482
|
+
|
|
483
|
+
### Monolithic fast path
|
|
484
|
+
|
|
485
|
+
When user chose `mode: monolithic` and lightweight inventory: write `approval.md` directly **or** parts + single assemble. Same Part E quality bars apply.
|
|
486
|
+
|
|
487
|
+
Document chapter order (hard for included chapters):
|
|
488
|
+
|
|
489
|
+
1. §1 绪论与边界
|
|
490
|
+
2. §2 技术方案评估 — **可读中文**写现状与约束(禁止代码腔堆砌)
|
|
491
|
+
3. §3 架构整体设计
|
|
492
|
+
4. §4 方案详细设计
|
|
493
|
+
5. §5 验收标准 — **仅用户确认要时**
|
|
494
|
+
6. §6 测试策略
|
|
495
|
+
7. §7 部署 — **仅用户确认要时**
|
|
496
|
+
8. §8 闭环表 — **仅用户确认要时**(分析仍必做)
|
|
497
|
+
9. §9 可实施性评估
|
|
498
|
+
10. §10 审批 — **仅人工签字栏**(无 AI 预审小节)
|
|
499
|
+
|
|
500
|
+
Key rules (all modes):
|
|
501
|
+
|
|
502
|
+
- §1 truthful; Journey traces to §5 if present else named specs; Non-Goals with reasons.
|
|
503
|
+
- **§2.2 技术选型**: required for greenfield or when four artifacts lack needed stack
|
|
504
|
+
dimensions; only after Tech Stack Intake (user confirm); never invent full stack.
|
|
505
|
+
Frontend (when UI) needs 五元组, not「React」alone.
|
|
506
|
+
- Decision Review includes every `design.md` decision (plus D-FE/D-BE/D-DB/D-Infra when intake ran).
|
|
507
|
+
- §5 when included: exhaustive + after §3/§4.
|
|
508
|
+
- §3/§4 hard bars + outline hygiene; **G1–G6**; Style & Tone including **no code-dump prose**.
|
|
509
|
+
- §4.6 when `uiInScope`: pages/routes + G5/G6 + Visual Loop; **must Read** IDE
|
|
510
|
+
skills/rules/落地规约 before draft; cite paths in §4.6.1; omit if no UI.
|
|
511
|
+
- §8 when included: one compact table; always report closed-loop verdict in chat.
|
|
512
|
+
- Test Strategy maps to §5 or specs names; Deployment only if opted in.
|
|
513
|
+
- Sign-off blank; **never** write AI pre-approval into the file; never recommend approve if any verdict is `FAIL`.
|
|
374
514
|
|
|
375
515
|
---
|
|
376
516
|
|
|
377
517
|
## Gate: User Confirmation
|
|
378
518
|
|
|
379
|
-
Present a summary to the user:
|
|
519
|
+
Present a summary to the user (**chat only** — these are not document chapters):
|
|
380
520
|
|
|
381
521
|
- Closed-loop overall verdict (PASS / PASS WITH WARNINGS / FAIL)
|
|
382
522
|
- Design quality verdict (PASS / WARNING / FAIL)
|
|
383
523
|
- Implementability overall verdict (READY / NEEDS REFINEMENT / BLOCKED)
|
|
384
|
-
- AI pre-approval recommendation (建议批准 / 有条件批准 / 退回 refine / 拒绝)
|
|
524
|
+
- **AI pre-approval recommendation** (建议批准 / 有条件批准 / 退回 refine / 拒绝) + 理由
|
|
385
525
|
- The path where `approval.md` will be written
|
|
386
526
|
|
|
387
|
-
Ask explicitly:
|
|
527
|
+
Ask explicitly about **optional chapters** (record in `approval/index.yaml` → `optional.s5/s7/s8`):
|
|
528
|
+
|
|
529
|
+
```text
|
|
530
|
+
是否将以下章节写入审批文档?
|
|
531
|
+
- §5 验收标准: 要 / 不要
|
|
532
|
+
- §7 部署/发布/回滚: 要 / 不要
|
|
533
|
+
- §8 闭环性检查表: 要 / 不要
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
If not forced segmented, ask generation mode:
|
|
537
|
+
|
|
538
|
+
```text
|
|
539
|
+
审批文档生成方式:
|
|
540
|
+
- segmented (推荐): 分片写入 approval/parts/,CLI 拼接 approval.md
|
|
541
|
+
- monolithic: 一次性写入 approval.md(仅轻量变更)
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
**After Stage 12a**, show index inventory (tables / interfaces / pages) and ask:
|
|
545
|
+
|
|
546
|
+
> "确认 index 与可选章节后继续 Map 生成?"
|
|
547
|
+
|
|
548
|
+
Do NOT run 12b until index + optional choices are confirmed.
|
|
549
|
+
|
|
550
|
+
After 12b/12c, run `specflow approval check` and fix all errors before asking final write.
|
|
551
|
+
|
|
552
|
+
Then ask:
|
|
388
553
|
|
|
389
|
-
> "
|
|
554
|
+
> "确认拼接并写入 `specflow/changes/<name>/approval.md`?"
|
|
390
555
|
|
|
391
|
-
Do NOT
|
|
392
|
-
re-run the relevant Pass or dimension and update the summary before re-asking.
|
|
556
|
+
Do NOT assemble until the user confirms (unless they already confirmed end-to-end generation).
|
|
393
557
|
|
|
394
558
|
On confirmation:
|
|
395
559
|
|
|
396
|
-
1.
|
|
397
|
-
2.
|
|
398
|
-
3.
|
|
560
|
+
1. **Segmented**: `specflow approval assemble <change> --force` — do not paste assembled markdown manually.
|
|
561
|
+
2. **Monolithic**: write `approval.md` directly (or parts + assemble).
|
|
562
|
+
3. Include only optional chapters the user accepted.
|
|
563
|
+
4. Do **not** include「AI 预审建议」in the file.
|
|
564
|
+
5. Do NOT change `phase` — it remains `refined`.
|
|
565
|
+
6. Report the file path and next-step suggestions.
|
|
399
566
|
|
|
400
567
|
---
|
|
401
568
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# specflow.approval.index/v1 — copy to specflow/changes/<name>/approval/index.yaml
|
|
2
|
+
schema: specflow.approval.index/v1
|
|
3
|
+
change: <change-name>
|
|
4
|
+
generated_at: 2026-08-26T12:00:00+08:00
|
|
5
|
+
mode: segmented
|
|
6
|
+
ui_in_scope: false
|
|
7
|
+
db_in_scope: true
|
|
8
|
+
api_in_scope: true
|
|
9
|
+
|
|
10
|
+
optional:
|
|
11
|
+
s5: false
|
|
12
|
+
s7: false
|
|
13
|
+
s8: false
|
|
14
|
+
|
|
15
|
+
parts_order:
|
|
16
|
+
- 01-intro
|
|
17
|
+
- 02-design-review
|
|
18
|
+
- 03-architecture
|
|
19
|
+
- 04-detail-core
|
|
20
|
+
- 04.4-data
|
|
21
|
+
- 04.5-api
|
|
22
|
+
- 04.7-logic
|
|
23
|
+
- 04.8-config
|
|
24
|
+
- 04.9-compat
|
|
25
|
+
- 06-test
|
|
26
|
+
- 09-implementability
|
|
27
|
+
- 10-signoff
|
|
28
|
+
|
|
29
|
+
design_points: [P1]
|
|
30
|
+
decisions: [D1]
|
|
31
|
+
|
|
32
|
+
tables: []
|
|
33
|
+
interfaces: []
|
|
34
|
+
pages: []
|
|
35
|
+
capabilities: []
|
|
36
|
+
|
|
37
|
+
batching:
|
|
38
|
+
tables_per_call: 3
|
|
39
|
+
interfaces_per_call: 3
|
|
40
|
+
pages_per_call: 3
|
|
41
|
+
capabilities_per_call: 1
|
|
42
|
+
|
|
43
|
+
conventions:
|
|
44
|
+
architecture: []
|
|
45
|
+
database: []
|
|
46
|
+
api: []
|
|
47
|
+
frontend: []
|
|
48
|
+
|
|
49
|
+
meta:
|
|
50
|
+
language: zh-CN
|
|
51
|
+
tech_stack: unknown
|
|
52
|
+
project_mode: brownfield
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Approval part fragment — NOT a standalone document.
|
|
3
|
+
Written under specflow/changes/<name>/approval/parts/<part-id>.md
|
|
4
|
+
Assembled by: specflow approval assemble <change>
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<!-- part-id: <must match filename without .md> -->
|
|
8
|
+
<!-- index-ref: approval/index.yaml parts_order -->
|
|
9
|
+
|
|
10
|
+
<!-- FORBIDDEN in parts:
|
|
11
|
+
- Top-level "# 技术方案审批文档"
|
|
12
|
+
- Foreign chapter headings "## N." not owned by this part
|
|
13
|
+
- TODO / 待补充 / 此处省略 / 详见 design (without §ref)
|
|
14
|
+
- Empty or placeholder-only body
|
|
15
|
+
-->
|