@gordon.gan/specflow 1.8.0-beta → 1.8.2-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.
Files changed (181) hide show
  1. package/README.md +7 -5
  2. package/dist/cli/commands/document-run.d.ts +98 -0
  3. package/dist/cli/commands/document-run.js +1064 -0
  4. package/dist/cli/index.js +2 -2
  5. package/dist/core/artifact-language.js +11 -1
  6. package/dist/core/document/asset-paths.d.ts +15 -0
  7. package/dist/core/document/asset-paths.js +38 -0
  8. package/dist/core/document/chapters.d.ts +6 -0
  9. package/dist/core/document/chapters.js +38 -0
  10. package/dist/core/document/coverage.d.ts +25 -0
  11. package/dist/core/document/coverage.js +49 -0
  12. package/dist/core/document/digests.d.ts +40 -0
  13. package/dist/core/document/digests.js +144 -0
  14. package/dist/core/document/engine.d.ts +101 -0
  15. package/dist/core/document/engine.js +722 -0
  16. package/dist/core/document/extract.d.ts +61 -0
  17. package/dist/core/document/extract.js +437 -0
  18. package/dist/core/{approval → document}/forbidden-patterns.d.ts +4 -2
  19. package/dist/core/document/forbidden-patterns.js +36 -0
  20. package/dist/core/document/gates.d.ts +39 -0
  21. package/dist/core/document/gates.js +75 -0
  22. package/dist/core/document/input-digest.d.ts +63 -0
  23. package/dist/core/document/input-digest.js +200 -0
  24. package/dist/core/document/input-features.d.ts +43 -0
  25. package/dist/core/document/input-features.js +161 -0
  26. package/dist/core/document/lint.d.ts +39 -0
  27. package/dist/core/document/lint.js +147 -0
  28. package/dist/core/document/llm.d.ts +28 -0
  29. package/dist/core/document/llm.js +22 -0
  30. package/dist/core/document/map.d.ts +52 -0
  31. package/dist/core/document/map.js +296 -0
  32. package/dist/core/document/outline.d.ts +29 -0
  33. package/dist/core/document/outline.js +171 -0
  34. package/dist/core/document/paths.d.ts +23 -0
  35. package/dist/core/document/paths.js +36 -0
  36. package/dist/core/document/profile-validator.d.ts +23 -0
  37. package/dist/core/document/profile-validator.js +155 -0
  38. package/dist/core/document/profiles.d.ts +23 -0
  39. package/dist/core/document/profiles.js +76 -0
  40. package/dist/core/document/render.d.ts +61 -0
  41. package/dist/core/document/render.js +243 -0
  42. package/dist/core/document/review.d.ts +57 -0
  43. package/dist/core/document/review.js +202 -0
  44. package/dist/core/document/scene-detect.d.ts +32 -0
  45. package/dist/core/document/scene-detect.js +237 -0
  46. package/dist/core/document/schemas.d.ts +1111 -0
  47. package/dist/core/document/schemas.js +191 -0
  48. package/dist/integrations/shared/capability-evidence.js +4 -9
  49. package/dist/integrations/shared/command-catalog.js +2 -1
  50. package/dist/integrations/shared/parity-manifest.js +4 -9
  51. package/package.json +2 -1
  52. package/prompts/apply/phase-a-plan.md +1 -1
  53. package/prompts/document/map/acceptance.md +9 -0
  54. package/prompts/document/map/anti-ai.md +29 -0
  55. package/prompts/document/map/api-design.md +26 -0
  56. package/prompts/document/map/architecture.md +27 -0
  57. package/prompts/document/map/benchmark.md +26 -0
  58. package/prompts/document/map/closed-loop.md +9 -0
  59. package/prompts/document/map/compat-migration.md +31 -0
  60. package/prompts/document/map/component-design.md +30 -0
  61. package/prompts/document/map/config-runtime.md +9 -0
  62. package/prompts/document/map/core-flow.md +62 -0
  63. package/prompts/document/map/core-logic.md +9 -0
  64. package/prompts/document/map/data-model.md +18 -0
  65. package/prompts/document/map/deploy.md +26 -0
  66. package/prompts/document/map/fix.md +8 -0
  67. package/prompts/document/map/frontend-architecture.md +35 -0
  68. package/prompts/document/map/goal.md +8 -0
  69. package/prompts/document/map/impact.md +8 -0
  70. package/prompts/document/map/implementability.md +9 -0
  71. package/prompts/document/map/migration-guide.md +36 -0
  72. package/prompts/document/map/mvp-boundary.md +8 -0
  73. package/prompts/document/map/non-goals.md +8 -0
  74. package/prompts/document/map/ops.md +33 -0
  75. package/prompts/document/map/performance.md +32 -0
  76. package/prompts/document/map/poc-demo.md +25 -0
  77. package/prompts/document/map/regression.md +8 -0
  78. package/prompts/document/map/reproduce.md +8 -0
  79. package/prompts/document/map/requirement.md +8 -0
  80. package/prompts/document/map/research.md +25 -0
  81. package/prompts/document/map/root-cause.md +8 -0
  82. package/prompts/document/map/signoff.md +9 -0
  83. package/prompts/document/map/state-management.md +23 -0
  84. package/prompts/document/map/tech-selection.md +29 -0
  85. package/prompts/document/map/test-strategy.md +24 -0
  86. package/prompts/document/map/ui-design.md +21 -0
  87. package/prompts/document/outline/general.md +46 -0
  88. package/prompts/document/review/ai-review.md +57 -0
  89. package/prompts/document/shared/grounding.md +84 -0
  90. package/prompts/explore/explore-session.md +1 -1
  91. package/prompts/propose/design-draft.md +1 -1
  92. package/prompts/propose/proposal.md +1 -1
  93. package/prompts/propose/specs.md +1 -1
  94. package/prompts/propose/tasks-draft.md +1 -1
  95. package/prompts/refine/design-output.md +1 -1
  96. package/prompts/refine/update-artifacts.md +2 -0
  97. package/prompts/shared/artifact-language.md +13 -0
  98. package/skills/specflow-techdoc/SKILL.md +143 -0
  99. package/skills/specflow-techdoc-synth/SKILL.md +115 -0
  100. package/templates/document/chapters/acceptance.yaml +16 -0
  101. package/templates/document/chapters/api-design.yaml +29 -0
  102. package/templates/document/chapters/architecture.yaml +21 -0
  103. package/templates/document/chapters/benchmark.yaml +20 -0
  104. package/templates/document/chapters/closed-loop.yaml +22 -0
  105. package/templates/document/chapters/compat-migration.yaml +21 -0
  106. package/templates/document/chapters/component-design.yaml +22 -0
  107. package/templates/document/chapters/config-runtime.yaml +16 -0
  108. package/templates/document/chapters/core-flow.yaml +27 -0
  109. package/templates/document/chapters/core-logic.yaml +16 -0
  110. package/templates/document/chapters/data-model.yaml +25 -0
  111. package/templates/document/chapters/deploy.yaml +22 -0
  112. package/templates/document/chapters/fix.yaml +18 -0
  113. package/templates/document/chapters/frontend-architecture.yaml +22 -0
  114. package/templates/document/chapters/goal.yaml +17 -0
  115. package/templates/document/chapters/impact.yaml +16 -0
  116. package/templates/document/chapters/implementability.yaml +22 -0
  117. package/templates/document/chapters/migration-guide.yaml +21 -0
  118. package/templates/document/chapters/mvp-boundary.yaml +20 -0
  119. package/templates/document/chapters/non-goals.yaml +17 -0
  120. package/templates/document/chapters/ops.yaml +25 -0
  121. package/templates/document/chapters/performance.yaml +21 -0
  122. package/templates/document/chapters/poc-demo.yaml +22 -0
  123. package/templates/document/chapters/regression.yaml +16 -0
  124. package/templates/document/chapters/reproduce.yaml +16 -0
  125. package/templates/document/chapters/requirement.yaml +18 -0
  126. package/templates/document/chapters/research.yaml +22 -0
  127. package/templates/document/chapters/root-cause.yaml +18 -0
  128. package/templates/document/chapters/signoff.yaml +15 -0
  129. package/templates/document/chapters/state-management.yaml +22 -0
  130. package/templates/document/chapters/tech-selection.yaml +23 -0
  131. package/templates/document/chapters/test-strategy.yaml +23 -0
  132. package/templates/document/chapters/ui-design.yaml +28 -0
  133. package/templates/document/profiles/0to1.yaml +44 -0
  134. package/templates/document/profiles/approve.yaml +22 -0
  135. package/templates/document/profiles/bugfix.yaml +15 -0
  136. package/templates/document/profiles/feature.yaml +23 -0
  137. package/templates/document/profiles/frontend-0to1.yaml +47 -0
  138. package/templates/document/profiles/migration.yaml +42 -0
  139. package/templates/document/profiles/poc.yaml +46 -0
  140. package/dist/cli/commands/approval-assemble.d.ts +0 -64
  141. package/dist/cli/commands/approval-assemble.js +0 -408
  142. package/dist/core/approval/assemble.d.ts +0 -10
  143. package/dist/core/approval/assemble.js +0 -384
  144. package/dist/core/approval/bundle.d.ts +0 -9
  145. package/dist/core/approval/bundle.js +0 -172
  146. package/dist/core/approval/forbidden-patterns.js +0 -40
  147. package/dist/core/approval/index-schema.d.ts +0 -676
  148. package/dist/core/approval/index-schema.js +0 -193
  149. package/dist/core/approval/index.d.ts +0 -12
  150. package/dist/core/approval/index.js +0 -9
  151. package/dist/core/approval/lint.d.ts +0 -10
  152. package/dist/core/approval/lint.js +0 -302
  153. package/dist/core/approval/paths.d.ts +0 -13
  154. package/dist/core/approval/paths.js +0 -43
  155. package/dist/core/approval/pipeline.d.ts +0 -28
  156. package/dist/core/approval/pipeline.js +0 -146
  157. package/dist/core/approval/playbook-schema.d.ts +0 -182
  158. package/dist/core/approval/playbook-schema.js +0 -51
  159. package/dist/core/approval/render.d.ts +0 -20
  160. package/dist/core/approval/render.js +0 -210
  161. package/dist/core/approval/review-pack.d.ts +0 -26
  162. package/dist/core/approval/review-pack.js +0 -205
  163. package/dist/core/approval/types.d.ts +0 -223
  164. package/dist/core/approval/types.js +0 -1
  165. package/prompts/approval/acp-pipeline.md +0 -106
  166. package/prompts/approval/ai-review.md +0 -145
  167. package/prompts/approval/api-guidance.md +0 -179
  168. package/prompts/approval/database-guidance.md +0 -105
  169. package/prompts/approval/frontend-guidance.md +0 -249
  170. package/prompts/approval/generate.md +0 -1596
  171. package/prompts/approval/multi-repo-guidance.md +0 -263
  172. package/prompts/approval/multi-repo-spoke-subagent.md +0 -94
  173. package/prompts/approval/project-conventions-guidance.md +0 -171
  174. package/prompts/approval/runtime-guidance.md +0 -64
  175. package/prompts/approval/segmented-generation.md +0 -157
  176. package/skills/specflow-approval/SKILL.md +0 -778
  177. package/templates/approval-index.yaml +0 -93
  178. package/templates/approval-part.md +0 -15
  179. package/templates/approval-playbook-talos-scenario-job-compile.yaml +0 -29
  180. package/templates/approval-playbook.yaml +0 -28
  181. package/templates/approval.md +0 -261
@@ -1,263 +0,0 @@
1
- # Approval · Multi-Repo (多仓) Guidance
2
-
3
- > Used by `/specflow:approval` when the user **自然语言指定多仓**、workset 含多个规划根、或
4
- > design/tasks 明确跨 `talos` / `talos-web` / `talos-worker` 等仓库。
5
- >
6
- > **目的**:按各仓四件套与锚点生成技术审批文档,并 **询问用户** 产出 **一份合订** 还是 **多份分仓**;
7
- > 合订时 **必须** 指定 **主仓** 存放 `approval.md` 与 `approval/` 工作区。
8
-
9
- ---
10
-
11
- ## 0. When to run
12
-
13
- | 信号 | 动作 |
14
- |------|------|
15
- | 用户说「三仓 / talos+web+worker / 多仓合订 / 前后端一体」 | 启用 `multi_repo.enabled=true` |
16
- | `specflow workset` / 会话上下文含多个 git 规划根 | 列出候选仓,请用户确认 |
17
- | 仅单仓 change,无跨仓表述 | `multi_repo.enabled=false`,走单仓流程 |
18
- | Hub + Spoke 联邦 | 见 §5;各 Spoke 可有不同 change id |
19
-
20
- Announce:
21
-
22
- ```text
23
- Multi-repo approval: enabled | single-repo
24
- Repos in scope: talos(scenario-job-compile), talos-web(web-scenario-cases), …
25
- Document mode: (pending user) unified | per_repo
26
- Primary repo (if unified): (pending user)
27
- ```
28
-
29
- ---
30
-
31
- ## 1. Resolve repos (硬顺序)
32
-
33
- 1. **Parse user natural language** — 仓名、别名(平台/控制台/Worker)、change 名。
34
- 2. **Cross-check workset** — `specflow workset list` / 用户给出的绝对路径;成员顺序 **不** 等于主仓。
35
- 3. **Per repo, verify** (Read-only):
36
- - `specflow/changes/<change>/.specflow.yaml` → `phase: refined`
37
- - 四件套:`proposal.md`, `specs/**`, `design.md`, `tasks.md`
38
- 4. **Record** in `approval/index.yaml` → `multi_repo.repos[]`:
39
-
40
- ```yaml
41
- multi_repo:
42
- enabled: true
43
- document_mode: unified # unified | per_repo — 用户确认后写入
44
- primary_repo: talos # unified 时必填
45
- repos:
46
- - id: talos
47
- label: 平台
48
- role: platform
49
- change: scenario-job-compile
50
- root_hint: /path/to/talos # agent 读取用,可选
51
- - id: talos-web
52
- label: 控制台
53
- role: web
54
- change: web-scenario-cases
55
- - id: talos-worker
56
- label: Worker
57
- role: worker
58
- change: scenario-execution
59
- ```
60
-
61
- **禁止**在未 Read 各仓四件套前假设内容一致;change id **可以** 各仓不同。
62
-
63
- ---
64
-
65
- ## 2. User gate — 一份还是多份 (硬)
66
-
67
- 在 Pass 1 之前或 Stage 12a 之前,**必须** 询问:
68
-
69
- ```text
70
- 本需求跨 N 个仓库,审批技术文档如何产出?
71
-
72
- A) 一份合订视图 (bundle) — 各仓 per_repo 真源 + CLI bundle 只读合订 (**推荐**)
73
- B) 多份分仓 (per_repo) — 每仓各自 approval.md(默认 Map 模式)
74
- C) 一份 LLM 合订 (legacy unified) — 仅当用户明确要求且无 bundle;不推荐
75
-
76
- 请选择 A、B 或 C。
77
- ```
78
-
79
- ### 2.1 Bundle(推荐 — A)
80
-
81
- **真源**: 各仓 **per_repo** `approval.md` + `approval/parts/`(ACP Map 分片)。
82
-
83
- **只读合订**: 主仓 `approval-playbook.yaml` + `specflow approval bundle <primary.change>` → `approval-unified.md`(**无 LLM 合并**)。
84
-
85
- 再询问主仓:
86
-
87
- ```text
88
- 合订 playbook 与 bundle 输出存放在哪个主仓?
89
- 1) talos (平台)
90
- 2) talos-web (控制台)
91
-
92
- ```
93
-
94
- **硬规则**:
95
-
96
- - `multi_repo.document_mode: per_repo`
97
- - `multi_repo.bundle.enabled: true`
98
- - `multi_repo.primary_repo: <id>` — playbook 与 bundle 输出路径
99
- - 各仓独立 Stage 12 + assemble;**全部 assemble 通过后** 在主仓执行 bundle
100
- - `acp.pipeline: acp/v2` 写入 `index.yaml`
101
-
102
- ```yaml
103
- multi_repo:
104
- document_mode: per_repo
105
- primary_repo: talos
106
- bundle:
107
- enabled: true
108
- output: approval-unified.md
109
- outputs:
110
- per_repo: [ …各仓路径… ]
111
- bundle:
112
- repo: talos
113
- change: scenario-job-compile
114
- path: specflow/changes/scenario-job-compile/approval-unified.md
115
- ```
116
-
117
- ### 2.2 Per-repo only(B)
118
-
119
- 见 §2.3;`bundle.enabled: false`。
120
-
121
- ### 2.3 Legacy unified LLM 合订(C — 不推荐)
122
-
123
- 仅在用户 **明确要求** 且拒绝 bundle 时使用。再询问主仓:
124
-
125
- ```text
126
- 合订文档存放在哪个主仓?(approval.md 与 approval/ 工作区写在该仓 change 目录下)
127
- ```
128
-
129
- **硬规则**:
130
-
131
- - `multi_repo.document_mode: unified`
132
- - `multi_repo.primary_repo: <id>` **必填**
133
- - **工作区路径**(分片模式):
134
- - `specflow/changes/<primary.change>/approval/index.yaml`
135
- - `specflow/changes/<primary.change>/approval/parts/*.md`
136
- - 产出:`specflow/changes/<primary.change>/approval.md`
137
- - CLI:`specflow approval assemble <primary.change>` **在主仓规划根**执行
138
- - 文档 §1.2 / §2.3 / 附录 B **必须** 按仓分表;Pass 6 锚点 **分仓列举**
139
- - 合订 **不是** 只写主仓 design;须合并各仓 specs/design/tasks 的跨端语义
140
-
141
- 写入 `multi_repo.outputs.unified`:
142
-
143
- ```yaml
144
- outputs:
145
- unified:
146
- repo: talos
147
- change: scenario-job-compile
148
- path: specflow/changes/scenario-job-compile/approval.md
149
- ```
150
-
151
- ### 2.4 Per-repo(B 详情)
152
-
153
- **硬规则**:
154
-
155
- - `multi_repo.document_mode: per_repo`
156
- - **每个** `repos[]` 条目独立:
157
- - 在该仓 `specflow/changes/<repo.change>/approval/`(分片)或 `approval.md`(单体)
158
- - 内容 **仅** 本仓 scope;交叉引用用「见 `<other-repo>` approval §x」
159
- - 各仓分别 `specflow approval assemble <repo.change>`(若在主仓 CLI,需 `--store` 或 cd 到该根)
160
- - **禁止**只在主仓写一份然后复制到其它仓
161
-
162
- 写入 `multi_repo.outputs.per_repo[]`:
163
-
164
- ```yaml
165
- outputs:
166
- per_repo:
167
- - repo: talos
168
- change: scenario-job-compile
169
- path: specflow/changes/scenario-job-compile/approval.md
170
- - repo: talos-web
171
- change: web-scenario-cases
172
- path: specflow/changes/web-scenario-cases/approval.md
173
- ```
174
-
175
- ---
176
-
177
- ## 3. Analysis & Map 上下文
178
-
179
- | 模式 | Read 范围 | index 库存 |
180
- |------|-----------|------------|
181
- | unified | 各仓四件套 + 各仓锚点 + 各仓约定 | `interfaces/pages/tables` 带 `repo` 字段(推荐) |
182
- | per_repo | **当前仓**四件套 + 本仓锚点 | 仅本仓实体 |
183
-
184
- **Unified 分片建议**:
185
-
186
- - `02-design-review` — 三仓决策表
187
- - `04.5-api` — 按 `repo` 或 L1/L2/L3/L4 分批;Worker 切片须 Read `api-guidance.md` + worker OpenAPI 路径
188
- - `04.6-*` — 仅 `ui_in_scope` 且 web 仓
189
- - 附录 B — 按仓允许/禁止路径
190
-
191
- **Inventory 扩展**(可选列):
192
-
193
- ```yaml
194
- interfaces:
195
- - id: I4
196
- short: 逐步上报
197
- change: scenario-job-compile
198
- part: 04.5-api-worker
199
- repo: talos-worker
200
- ```
201
-
202
- ---
203
-
204
- ## 4. Document header (unified)
205
-
206
- 合订 `approval.md` 头部 **必须** 声明:
207
-
208
- ```markdown
209
- > **覆盖变更(多仓合订,主仓: talos)**:
210
- > - 平台 `talos/scenario-job-compile`
211
- > - 控制台 `talos-web/web-scenario-cases`
212
- > - Worker `talos-worker/scenario-execution`
213
- > **存放路径**: `specflow/changes/scenario-job-compile/approval.md`
214
- ```
215
-
216
- ---
217
-
218
- ## 5. Hub / Federated 注意
219
-
220
- - Hub change id 可与 Spoke change id **同名或不同**;`multi_repo.repos[].change` 用 **各规划根内真实目录名**。
221
- - Hub 合同摘要可读 `--store`;Spoke approval **不**替代 Hub archive。
222
- - `coordination.yaml`(若有)可 Read;无则 chat 列出各仓 phase。
223
-
224
- ---
225
-
226
- ## 6. 自检
227
-
228
- - [ ] 用户已选 unified **或** per_repo
229
- - [ ] unified → `primary_repo` 已选且工作区在该仓
230
- - [ ] per_repo → 每仓输出路径已写入 `outputs.per_repo`
231
- - [ ] 各仓四件套已 Read;非主仓内容已进合订正文或分仓文档
232
- - [ ] Gate 摘要中列出 **所有** 将写入的 `approval.md` 路径
233
-
234
- ---
235
-
236
- ## 7. 与单仓关系
237
-
238
- `multi_repo.enabled=false` 时忽略本章;`change` 字段为当前规划根 change,行为与旧版一致。
239
-
240
- ---
241
-
242
- ## 8. 主仓一键 · Subagent 并行 (mode A/B)
243
-
244
- > Router: `prompts/approval/multi-repo-spoke-subagent.md` · Orchestrator: `skills/specflow-approval/SKILL.md` **Stage 1c**
245
-
246
- 当用户在 **主仓** 发起 `/specflow:approval` 且已选 **A (bundle)** 或 **B (per_repo)**:
247
-
248
- | 角色 | 职责 |
249
- |------|------|
250
- | **主 Agent(主仓)** | intake、playbook、scope 拆分、闭环 Pass 1–11、主仓 Map、等待子仓、主仓 finalize、bundle |
251
- | **Subagent × 子仓** | 各子仓独立 `approval/` → Map → 12e → `finalize <spoke.change>`(**禁止** `--bundle`) |
252
-
253
- **硬顺序**:
254
-
255
- 1. 主仓写好 `approval-playbook.yaml` + `multi_repo.repos[].root_hint`
256
- 2. **并行**派发子仓 subagent(web / worker / …)
257
- 3. **等待**全部 `finalize_ok: true`
258
- 4. 主仓 Map + finalize
259
- 5. 主仓 `finalize --bundle --workspace-root <主仓规划根>`
260
-
261
- **禁止**: 仅在主仓 unified 合订而不拆仓;子仓未 finalize 就 bundle;让用户手动 cd 子仓跑 CLI(除非 subagent 不可用)。
262
-
263
- **从 unified 迁移**: 将 `04.6-ui`、Worker L2 接口等 **搬迁** 到对应子仓 parts;主仓留 cross-ref + 平台/L3 正文。示例 playbook: `templates/approval-playbook-talos-scenario-job-compile.yaml`。
@@ -1,94 +0,0 @@
1
- # Approval · Multi-Repo Spoke Subagent Brief
2
-
3
- > **Invoked by** primary `/specflow:approval` orchestrator via **Task** subagent (one per non-primary repo).
4
- > Primary repo Map/Review/Finalize stays on the **orchestrator** unless user explicitly runs approval from a spoke root.
5
-
6
- ---
7
-
8
- ## Mission
9
-
10
- Run **full ACP approval for ONE spoke repo only** — Index → Map → Stage 12e AI Review → `specflow approval finalize <spoke.change>` — scoped to that repo's four artifacts and **only** entities assigned to this repo in the shared playbook / primary `index.yaml`.
11
-
12
- **Do NOT** write into the primary repo. **Do NOT** LLM-merge cross-repo content into one file.
13
-
14
- **Spoke index rule**: only **`primary_repo`** sets `multi_repo.bundle.enabled: true` + hosts `approval-playbook.yaml`. Spoke repos set `bundle.enabled: false` — they **never** run `--bundle`.
15
-
16
- ---
17
-
18
- ## Inputs (primary must pass all)
19
-
20
- | Field | Example |
21
- |-------|---------|
22
- | `repo_id` | `talos-web` |
23
- | `planning_root` | `/Users/gankang/TALOS-WORK/talos-web` |
24
- | `change` | `web-scenario-cases` |
25
- | `role` | `web` |
26
- | `primary_change` | `scenario-job-compile` |
27
- | `primary_repo_id` | `talos` |
28
- | `workset_root` | `/Users/gankang/TALOS-WORK` |
29
- | `scope` | Which parts/capabilities/interfaces/pages belong to this spoke (from playbook or primary index) |
30
- | `cross_ref_policy` | Cross-repo refs: `见 talos approval §4.5 I8` — never duplicate platform DDL/RPC bodies |
31
-
32
- Read before writing:
33
-
34
- 1. `specflow/changes/<change>/` four artifacts (phase must be `refined`)
35
- 2. `prompts/approval/generate.md` (Part E/F), `acp-pipeline.md`, `ai-review.md`
36
- 3. Role packs: `frontend-guidance.md` (web), `api-guidance.md` (worker), etc.
37
- 4. Primary `approval/index.yaml` `multi_repo.repos[]` entry for this repo
38
-
39
- ---
40
-
41
- ## Hard scope rules
42
-
43
- | Role | Own in approval/parts | Cross-ref only (do not copy bodies) |
44
- |------|----------------------|-------------------------------------|
45
- | `platform` | compile, scheduler RPC/L4, DDL, gateway, ingest | Worker L2 HTTP, console pages |
46
- | `web` | §4.6 UI, web APIs (I5/I6), nav/routes | Platform scheduler/result RPC details |
47
- | `worker` | L2 Worker HTTP (I7/I9), executor logic, Pack | Platform L3 SubmitStepResult, Web UI |
48
-
49
- Each spoke document is **standalone per repo**: `01-intro` … `10-signoff` with **repo-scoped** §1–§3 and detailed §4 batches for that repo only.
50
-
51
- ---
52
-
53
- ## Execution order (spoke)
54
-
55
- ```text
56
- cd <planning_root>
57
- → Write approval/index.yaml (multi_repo.enabled=false OR spoke-local block only)
58
- → Write approval/analysis.json (Passes scoped to this repo)
59
- → 12a skeleton parts
60
- → 12b Map batches (repo scope only)
61
- → 12e: specflow approval finalize <change> # may pause → review-packet
62
- → Fix parts; write review-result.json + part_hashes (specflow approval review-hashes --json)
63
- → specflow approval finalize <change> # must exit ok
64
- ```
65
-
66
- **Never** run `--bundle` on a spoke. Bundle is **primary only**, after all spokes report success.
67
-
68
- ---
69
-
70
- ## Return payload to orchestrator (required)
71
-
72
- Report in final message:
73
-
74
- ```yaml
75
- repo_id: talos-web
76
- change: web-scenario-cases
77
- finalize_ok: true
78
- output_path: specflow/changes/web-scenario-cases/approval.md
79
- review_result: specflow/changes/web-scenario-cases/approval/review-result.json
80
- lint_errors: []
81
- blocked: false
82
- notes: ""
83
- ```
84
-
85
- If `finalize_ok: false`, set `blocked: true` and paste diagnostics — orchestrator **must not** bundle.
86
-
87
- ---
88
-
89
- ## Anti-patterns
90
-
91
- - Writing `04.6-ui` into platform repo when web spoke exists
92
- - Running bundle from spoke cwd
93
- - Skipping finalize and pasting assembled markdown
94
- - Unified LLM merge (mode C) when mode A was chosen
@@ -1,171 +0,0 @@
1
- # Approval · Project Conventions Router
2
-
3
- > Used by `/specflow:approval` before drafting **§3 架构 / §4.4 数据 / §4.5 接口 / §4.6 前端**
4
- > (frontend when `uiInScope=yes`).
5
- > **目的**:让方案贴合**本仓库**的 skill / rule / 工程约定,而不是只套 SpecFlow 通用 guidance。
6
- > **懒加载**:按主题按需 `Read`,禁止一次灌入全部 IDE rules。
7
- > **Not** an MCP tool; **禁止** `invoke /xxx skill` —— 一律解析路径后 `Read`。
8
-
9
- ---
10
-
11
- ## 0. Priority (冲突时必须遵守)
12
-
13
- ```text
14
- ① 项目约定 + 现网代码/DDL/OpenAPI > ② SpecFlow Guidance Pack > ③ LLM 常识
15
- ```
16
-
17
- - ① 决定「能不能做、禁令、现网形状」。
18
- - ② 只补强「怎么写清楚」(如完整 CREATE TABLE、接口失败示例骨架)。
19
- - ②/③ **不得**覆盖 ①(例:项目约定「本迭代禁止迁移」时,不得按通用 skill 发明 `ALTER`)。
20
-
21
- Announce after resolve:
22
-
23
- ```text
24
- Project conventions (architecture|api|database|frontend): <paths…> | none
25
- Conflict policy: project > SpecFlow guidance > LLM
26
- ```
27
-
28
- ---
29
-
30
- ## 1. Topics (何时加载)
31
-
32
- | 主题 `topic` | 何时 **必须**跑本路由 | 典型要找的内容 |
33
- |--------------|----------------------|----------------|
34
- | `architecture` | 起草 **§3** 前 | 分层、模块边界、目录约定、禁止直连 |
35
- | `database` | 起草 **§4.4** 前(且有持久化) | 迁移工具禁令、命名、字符集、现网表规范 |
36
- | `api` | 起草 **§4.5** 前(且有对外/跨端接口) | 错误码、鉴权、契约/OpenAPI、通道;然后 **`api-guidance.md`**(分层、RPC 锁名、proto 可生成包) |
37
- | `frontend` | 起草 **§4.6** 前(且 `uiInScope=yes`) | 组件/状态/路由/API client/设计系统/**表单/测试/a11y** 等落地约定;须含 IDE skills/rules 扫描(见 `frontend-guidance.md` §3) |
38
-
39
- 每个主题 **最多 Read 5 个文件**(配置列出的优先;自动探测时取最相关的前 5 个)。细节 references 仅在入口文件点名时再读(禁止 reference 链式跳转)。
40
-
41
- ---
42
-
43
- ## 2. Resolve paths (跨 IDE)
44
-
45
- ### 2.1 显式配置(最高优先)
46
-
47
- 读 `specflow/config.yaml` → `conventions.<topic>`(字符串路径数组,相对项目根)。
48
- 有配置则 **只 Read 这些路径**(仍受「最多 5 个」限制);缺文件 → WARNING。
49
-
50
- ```yaml
51
- conventions:
52
- architecture:
53
- - docs/engineering/architecture.md
54
- api:
55
- - docs/api/guidelines.md
56
- database:
57
- - docs/db/conventions.md
58
- frontend:
59
- - docs/frontend/conventions.md
60
- ```
61
-
62
- ### 2.2 自动探测(无配置时)
63
-
64
- 1. 判定 `activeIde`(本会话 IDE):Cursor / Claude / Codex。
65
- 2. **先**扫 activeIde 候选。
66
- 3. 若无命中:按 `cursor → claude → agents` 回退扫同主题候选。
67
- 4. 再扫**仓根中立**路径。
68
- 5. 仍无 → `none`(允许继续,但总则/架构说明须写「未发现项目级约定」)。
69
-
70
- #### 候选路径表
71
-
72
- **仓根中立(跨 IDE 推荐真相源)**
73
-
74
- | topic | 候选(存在则纳入) |
75
- |-------|------------------|
76
- | `architecture` | `docs/engineering/architecture.md`, `.specflow/conventions/architecture.md`, `ARCHITECTURE.md` |
77
- | `api` | `docs/api/guidelines.md`, `docs/engineering/api.md`, `.specflow/conventions/api.md` |
78
- | `database` | `docs/db/conventions.md`, `docs/engineering/database.md`, `.specflow/conventions/database.md` |
79
- | `frontend` | `docs/frontend/conventions.md`, `docs/frontend/patterns.md`, `docs/frontend/testing.md`, `docs/engineering/frontend.md`, `.specflow/conventions/frontend.md`, `agent_docs/tech_stack.md`, `agent_docs/code_patterns.md`, `agent_docs/testing.md` |
80
-
81
- **Cursor**
82
-
83
- | topic | 候选 |
84
- |-------|------|
85
- | 通用 | `.cursor/rules/**/*.mdc` 中文件名/标题含 architecture\|api\|database\|db\|frontend\|backend\|ui\|react\|vue\|component\|tailwind\|a11y\|playwright 的条目(每主题最多 2) |
86
- | skill | `.cursor/skills/**/SKILL.md` 目录名或 frontmatter `name`/`description` 匹配主题关键词 |
87
-
88
- **Claude**
89
-
90
- | topic | 候选 |
91
- |-------|------|
92
- | 通用 | `CLAUDE.md`, `.claude/CLAUDE.md`(整文件较大时只提取与主题相关章节) |
93
- | skill | `.claude/skills/**/SKILL.md`(主题关键词匹配) |
94
- | rules | `.claude/rules/**/*`(若存在;同名过滤) |
95
-
96
- **Codex**
97
-
98
- | topic | 候选 |
99
- |-------|------|
100
- | 通用 | `AGENTS.md`(提取与主题相关段落) |
101
- | skill | `.agents/skills/**/SKILL.md`(主题关键词匹配) |
102
-
103
- 关键词提示:
104
-
105
- - `architecture|arch|分层|模块`
106
- - `api|openapi|rpc|接口|错误码`
107
- - `database|db|sql|迁移|schema`
108
- - `frontend|ui|react|vue|next|svelte|tailwind|component|控制台|页面|组件|表单|路由|a11y|playwright|vitest|样式|design.?system`
109
-
110
- > **前端专题**:`topic=frontend` 时 **必须**按 `frontend-guidance.md` §3 扩扫 IDE skills/rules
111
- > 与落地文档(状态/表单/测试/a11y 等);不要只命中一个泛化的「frontend」文件名就停。
112
-
113
- ---
114
-
115
- ## 3. How to apply (写入方案时)
116
-
117
- 1. **用可读中文**把约定写进 §2.1 / §3 图要点 / §4.4 / §4.5 / §4.6(禁止代码腔堆砌)。
118
- 2. **硬禁令**原样保留语义(例:「本迭代禁止 goose 迁移」)。
119
- 3. 与 SpecFlow DB/API 硬门槛同时满足:项目禁令优先;表达骨架用 SpecFlow 规则。
120
- 4. 在对应章节**标明来源路径**(总则「项目约定」列,或架构图要点首条)。
121
- 5. 若探测到约定文件但正文未体现关键禁令 → 确认摘要 / §8(若有)记 `WARNING`:
122
- `发现项目约定 <path> 但方案未采纳关键约束`。
123
-
124
- ---
125
-
126
- ## 4. Interaction with SpecFlow database guidance
127
-
128
- 写 §4.4 时顺序固定:
129
-
130
- 1. 本路由 `topic=database`(项目约定)
131
- 2. `prompts/approval/database-guidance.md`(SpecFlow pack + dbStack)
132
- 3. 现网 DDL / 迁移 / 锚点文件(Pass 6)
133
- 4. 起草:表形状与禁令 ← ①+③;DDL 完整度与类型惯例 ← ②
134
-
135
- §4.4.1 总则必须同时填写:
136
-
137
- | 项 | 说明 |
138
- |----|------|
139
- | 项目约定 | 实际 Read 到的路径,或 **未发现** |
140
- | DB 技能 | SpecFlow guidance 路径或 `LLM-fallback` |
141
- | DDL 来源 | 迁移/基线路径或本迭代新增 |
142
-
143
- ---
144
-
145
- ## 4b. Interaction with frontend guidance
146
-
147
- 写 §4.6 时顺序固定:
148
-
149
- 1. 本路由 `topic=frontend`(项目约定 docs + IDE skills/rules 关键词匹配)
150
- 2. **强制**再跑 `prompts/approval/frontend-guidance.md` §3 —— 补扫开发落地维
151
- (组件/路由/状态/表单/API client/样式/a11y/测试/lint);与步骤 1 **去重**,合计 ≤5 文件
152
- 3. 现网路由/布局/API client 锚点(Pass 6)
153
- 4. 起草:页面/组件边界与禁令 ← ①+②+③;章节骨架与 G5/G6 ← `frontend-guidance` 其余条款
154
-
155
- §4.6.1 总则必须填写:
156
-
157
- | 项 | 说明 |
158
- |----|------|
159
- | 项目约定 | config + 中立 docs 路径,或 **未发现** |
160
- | IDE skills/rules | 实际 Read 的 `.cursor/.claude/.agents` skill/rule 路径,或 **未发现** |
161
- | FE 栈 | 五元组 |
162
-
163
- 无 UI → 整章省略。发现约定但方案未采纳 → WARNING。
164
-
165
- ---
166
-
167
- ## 5. Why this shape
168
-
169
- - IDE 目录不同 → 用 **activeIde + 回退 + 中立 docs** 统一发现,不强迫业务仓只选一个 IDE。
170
- - 上下文有限 → **按主题懒加载**,最多 3 文件。
171
- - 贴合项目 → **优先级写死**,并要求总则可核对来源。
@@ -1,64 +0,0 @@
1
- # Approval · Runtime Semantics Guidance (optional domain pack)
2
-
3
- > **Optional** — load only when the change design touches async execution, leases, retries,
4
- > cancellation, LWW/idempotency keys, or result-ingest validation.
5
- >
6
- > **Not** part of default Stage 12e checklist. Use when analysis/design mentions these topics;
7
- > then add checks from §2 to AI review findings for **this change only**.
8
-
9
- ---
10
-
11
- ## 1. When to load
12
-
13
- | Signal in design/analysis | Action |
14
- |---------------------------|--------|
15
- | Job lease, reclaim, retry, duplicate execution | §1.1 |
16
- | User/system cancel, abort, teardown | §1.2 |
17
- | Step/job status enum vs ingest validator | §1.3 |
18
- | None of the above | **Skip this file** |
19
-
20
- ---
21
-
22
- ## 2. Mandatory decisions (pick one per topic — when in scope)
23
-
24
- ### 2.1 Retry / reclaim vs accumulated state
25
-
26
- When the same execution key can run again, document how prior partial state is handled:
27
-
28
- | Option | Write in approval |
29
- |--------|-------------------|
30
- | **A wipe** | Clear prior results before re-run |
31
- | **B epoch/version** | Reads/writes scoped by epoch or version |
32
- | **C no retry** | Disable retry for this execution type |
33
-
34
- **Hard**: add decision row + §4 scenario + testable AC. **Forbidden**: leave unspecified when retry exists in design.
35
-
36
- ### 2.2 Cancel / abort
37
-
38
- When cancel is in scope:
39
-
40
- - Document abort behavior (in-flight work, teardown, partial commit)
41
- - Terminal status for cancelled runs
42
- - §4.3 sequence for cancel path
43
-
44
- ### 2.3 Status ingest / validator alignment
45
-
46
- When external ingest validates status values:
47
-
48
- - Document the **closed** allowed set
49
- - **Forbidden**: doc lists values outside validator unless same iteration changes validator
50
-
51
- ---
52
-
53
- ## 3. AI review hook (when loaded)
54
-
55
- Add targeted findings (category `runtime_semantics`) — do not apply to changes without these topics.
56
-
57
- ```yaml
58
- design_points: [P<n>-retry-policy, P<n>-cancel]
59
- acp:
60
- review:
61
- enabled: true
62
- ```
63
-
64
- Cross-links: `api-guidance.md` (contract layers), `ai-review.md` (generic R9 unclosed branches).