openspec-sdd-e2e-kit 0.1.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.
Files changed (38) hide show
  1. package/README.md +63 -0
  2. package/bin/sdd-e2e-kit.mjs +53 -0
  3. package/kit/.codex/skills/feature-to-e2e/SKILL.md +188 -0
  4. package/kit/.codex/skills/feature-to-e2e/agents/openai.yaml +4 -0
  5. package/kit/.codex/skills/openspec-apply-change/SKILL.md +180 -0
  6. package/kit/.codex/skills/openspec-archive-change/SKILL.md +157 -0
  7. package/kit/.codex/skills/openspec-continue-change/SKILL.md +136 -0
  8. package/kit/.codex/skills/openspec-explore/SKILL.md +292 -0
  9. package/kit/.codex/skills/openspec-full-spec-discovery/SKILL.md +356 -0
  10. package/kit/.codex/skills/openspec-full-spec-discovery/references/backlog-row-to-main-spec.md +447 -0
  11. package/kit/.codex/skills/openspec-new-change/SKILL.md +92 -0
  12. package/kit/.codex/skills/openspec-propose/SKILL.md +132 -0
  13. package/kit/.codex/skills/spec-to-gherkin/SKILL.md +686 -0
  14. package/kit/SDD_E2E_FLOW.md +268 -0
  15. package/kit/manifest.json +78 -0
  16. package/kit/openspec/config.yaml +18 -0
  17. package/kit/openspec/schemas/sdd-e2e/schema.yaml +128 -0
  18. package/kit/openspec/schemas/sdd-e2e/templates/acceptance-coverage.md +9 -0
  19. package/kit/openspec/schemas/sdd-e2e/templates/design.md +29 -0
  20. package/kit/openspec/schemas/sdd-e2e/templates/feature.feature +13 -0
  21. package/kit/openspec/schemas/sdd-e2e/templates/proposal.md +23 -0
  22. package/kit/openspec/schemas/sdd-e2e/templates/spec.md +21 -0
  23. package/kit/openspec/schemas/sdd-e2e/templates/tasks.md +16 -0
  24. package/kit/openspec/schemas/sdd-e2e/templates/test-cases.md +35 -0
  25. package/kit/openspec/schemas/sdd-e2e.yaml +160 -0
  26. package/kit/openspec/sdd-e2e-flow.md +290 -0
  27. package/kit/openspec/sdd-e2e-maintenance.md +98 -0
  28. package/kit/scripts/sdd/check-report.mjs +34 -0
  29. package/kit/scripts/sdd/lib.mjs +290 -0
  30. package/kit/scripts/sdd/lint-features.mjs +60 -0
  31. package/kit/scripts/sdd/lint-tasks.mjs +41 -0
  32. package/kit/scripts/sdd/self-test.mjs +185 -0
  33. package/kit/scripts/sdd/summarize-acceptance.mjs +41 -0
  34. package/package.json +19 -0
  35. package/src/check.mjs +86 -0
  36. package/src/diff.mjs +101 -0
  37. package/src/install.mjs +159 -0
  38. package/src/lib.mjs +221 -0
@@ -0,0 +1,268 @@
1
+ # OpenSpec SDD + E2E 流程总览
2
+
3
+ 本文是当前项目根目录层级的流程入口文档,用于说明已经落地的项目级 OpenSpec SDD + E2E 工作流。
4
+
5
+ 完整规范见:
6
+
7
+ - `openspec/sdd-e2e-flow.md`
8
+ - `openspec/schemas/sdd-e2e/schema.yaml`
9
+ - `openspec/schemas/sdd-e2e.yaml`
10
+ - `openspec/sdd-e2e-maintenance.md`
11
+ - `openspec/changes/codify-sdd-e2e-flow/`
12
+
13
+ ## 目标
14
+
15
+ 这套流程的目标是把 E2E 验收能力融入 OpenSpec SDD 开发链路,避免在完整 spec 完成后一次性生成过重的 E2E。
16
+
17
+ 核心思想:
18
+
19
+ ```text
20
+ spec 先定义业务规则
21
+ feature 扩写验收场景
22
+ tasks 按 phase 组织实现
23
+ 每个 phase 完成后跑对应 acceptance gate
24
+ 最后再跑 change 级 final acceptance
25
+ ```
26
+
27
+ ## 分层边界
28
+
29
+ ```text
30
+ OpenSpec 本体 / CLI
31
+ 不在本项目中修改
32
+
33
+ 项目级 OpenSpec 规范
34
+ 由 openspec/schemas/sdd-e2e/schema.yaml、openspec/schemas/sdd-e2e.yaml 和 openspec/sdd-e2e-flow.md 定义
35
+
36
+ Codex Skills / Scripts
37
+ 作为执行器,读取项目级规范并落地到具体 change
38
+ ```
39
+
40
+ 本项目当前实现的是第二层和第三层:
41
+
42
+ - 第二层:`schema: sdd-e2e`
43
+ - 第三层:`.codex/skills/*` 和 `scripts/sdd/*`
44
+
45
+ ## 标准流程
46
+
47
+ ```text
48
+ proposal
49
+ -> specs
50
+ -> features
51
+ -> test-cases
52
+ -> design
53
+ -> tasks
54
+ -> phase implementation
55
+ -> phase acceptance
56
+ -> final acceptance
57
+ -> archive
58
+ ```
59
+
60
+ 关键约束:
61
+
62
+ - `features` 必须在 specs 之后、design/tasks 最终定稿之前生成。
63
+ - `tasks.md` 必须按 feature 中的 `@phase:*` 分组。
64
+ - 每个 phase 必须通过 acceptance gate 才能关闭。
65
+ - smoke 只能证明入口和基础链路可用,不能替代 acceptance。
66
+ - final acceptance 通过前不能归档 `schema: sdd-e2e` 的 change。
67
+
68
+ ## 新 Change 如何使用
69
+
70
+ 适用于 UI 行为、交互状态、配置表单、异步请求、发布流程、跨视图同步或需要 E2E 验收的变更。
71
+
72
+ `.openspec.yaml` 应声明:
73
+
74
+ ```yaml
75
+ schema: sdd-e2e
76
+ ```
77
+
78
+ 不再使用 `schemaFile`。OpenSpec CLI 会从 `openspec/schemas/sdd-e2e/schema.yaml` 自动发现项目级 schema。
79
+
80
+ 最小 artifact 结构:
81
+
82
+ ```text
83
+ openspec/changes/<change>/.openspec.yaml
84
+ openspec/changes/<change>/proposal.md
85
+ openspec/changes/<change>/specs/**/spec.md
86
+ openspec/changes/<change>/specs/**/features/*.feature
87
+ openspec/changes/<change>/test-cases.md
88
+ openspec/changes/<change>/design.md
89
+ openspec/changes/<change>/tasks.md
90
+ ```
91
+
92
+ 验收产物:
93
+
94
+ ```text
95
+ specs/e2e/bdd/<change>/validation-report.<phase-id>.md
96
+ openspec/changes/<change>/acceptance-coverage.md
97
+ ```
98
+
99
+ ## Feature 标签契约
100
+
101
+ 每个 Scenario 必须包含:
102
+
103
+ ```text
104
+ @phase:<phase-id>
105
+ @validation:<type>
106
+ @req:<requirement-id>
107
+ @p0 | @p1 | @p2
108
+ ```
109
+
110
+ 允许的 `@validation`:
111
+
112
+ ```text
113
+ mock-e2e
114
+ real-smoke
115
+ component
116
+ unit
117
+ api
118
+ manual
119
+ ```
120
+
121
+ P0/P1 Scenario 还必须包含风险或边界类型标签,例如:
122
+
123
+ ```text
124
+ @race-condition
125
+ @degradation
126
+ @anti-duplicate
127
+ @form-validation
128
+ @conditional-render
129
+ @cross-view-sync
130
+ @state-machine
131
+ @feedback
132
+ @negative
133
+ ```
134
+
135
+ ## Tasks 与 Phase
136
+
137
+ `tasks.md` 必须按 phase 组织:
138
+
139
+ ```md
140
+ ## Phase: <phase-id>
141
+
142
+ Covers: `@phase:<phase-id>`
143
+
144
+ - [ ] 实现任务
145
+ - [ ] Smoke 验证 `@phase:<phase-id>`
146
+ - [ ] Acceptance 验证 `@phase:<phase-id>` 全部自动化 Scenario
147
+ ```
148
+
149
+ 规则:
150
+
151
+ - tasks 不能发明 feature 中不存在的 phase id。
152
+ - feature 中出现的 phase 必须在 tasks 中出现。
153
+ - 每个 phase 必须有 acceptance 验证任务。
154
+ - 调整 phase 时,必须同步修改 feature 和 tasks。
155
+
156
+ ## Gate 命令
157
+
158
+ ```bash
159
+ pnpm sdd:lint-features <change>
160
+ pnpm sdd:lint-tasks <change>
161
+ pnpm sdd:phase <change> <phase>
162
+ pnpm sdd:acceptance <change>
163
+ pnpm sdd:self-test
164
+ ```
165
+
166
+ 命令职责:
167
+
168
+ - `sdd:lint-features`:检查 Scenario 标签完整性、validation 类型、P0 gap-pending 禁止规则、P0/P1 风险标签。
169
+ - `sdd:lint-tasks`:检查 feature phase 与 tasks phase 双向一致,并确认每个 phase 有 acceptance 任务。
170
+ - `sdd:phase`:检查 phase report 是否存在、字段是否完整、是否覆盖当前 phase 下所有必需 P0/P1 Scenario。
171
+ - `sdd:acceptance`:聚合所有 phase report,生成 final acceptance summary。
172
+ - `sdd:self-test`:用临时 fixture 验证 gate 脚本能拦截坏标签、坏 phase、覆盖不足、failed/blocked report。
173
+
174
+ ## Phase Report 要求
175
+
176
+ 每个 phase acceptance report 至少包含:
177
+
178
+ ```text
179
+ selected
180
+ automated
181
+ passed
182
+ mismatch
183
+ blocked
184
+ manual
185
+ gap-pending
186
+ gate: passed | failed
187
+ ```
188
+
189
+ `sdd:phase` 会回读 feature,计算当前 phase 应覆盖的 P0/P1 Scenario 数。只在报告里写 `gate: passed` 不足以通过。
190
+
191
+ ## 失败语义
192
+
193
+ ```text
194
+ passed
195
+ 实现符合 feature。
196
+
197
+ mismatch
198
+ 实际行为与 feature 不一致,需要修正实现或 artifact。
199
+
200
+ blocked
201
+ 环境、登录、权限、数据或依赖阻塞,当前无法可靠验证。
202
+
203
+ manual
204
+ 无法稳定自动化,需要记录人工步骤、证据和接受人。
205
+
206
+ gap-pending
207
+ spec 明确未决的延期场景,必须记录原因和后续任务。
208
+ ```
209
+
210
+ `blocked` 和 `manual` 默认不算通过。只有明确记录接受原因和责任人时,才能作为已知例外处理。
211
+
212
+ ## 规则强度
213
+
214
+ MUST:
215
+
216
+ - `schema: sdd-e2e` 的 change 必须包含 specs、features、test-cases、design 和 tasks。
217
+ - 每个 Scenario 必须有 `@phase`、`@validation`、`@req` 和优先级标签。
218
+ - P0/P1 Scenario 必须有风险或边界标签。
219
+ - tasks 必须与 feature phase 双向一致。
220
+ - phase acceptance 必须通过 `pnpm sdd:phase <change> <phase>`。
221
+ - final acceptance 必须通过 `pnpm sdd:acceptance <change>` 后才能归档。
222
+ - P0 不允许 `@gap-pending`。
223
+
224
+ SHOULD:
225
+
226
+ - UI、异步、表单、发布流程、跨视图同步类变更默认使用 `sdd-e2e`。
227
+ - 每个 phase 控制在可独立验收的小切片。
228
+ - feature 描述用户可观察行为,避免泄露接口字段和实现细节。
229
+
230
+ MAY:
231
+
232
+ - 纯文案、样式微调、无状态轻量修复可以继续使用 `spec-driven`。
233
+ - P2 场景可以只进入 coverage matrix,不一定进入 phase acceptance。
234
+ - `manual` 可用于无法稳定自动化的外部依赖场景,但必须记录人工步骤和接受人。
235
+
236
+ ## 当前落地状态
237
+
238
+ 流程改造 change:
239
+
240
+ ```text
241
+ openspec/changes/codify-sdd-e2e-flow
242
+ ```
243
+
244
+ 已通过:
245
+
246
+ ```bash
247
+ pnpm sdd:self-test
248
+ pnpm sdd:lint-features codify-sdd-e2e-flow
249
+ pnpm sdd:lint-tasks codify-sdd-e2e-flow
250
+ pnpm sdd:phase codify-sdd-e2e-flow artifact-contract
251
+ pnpm sdd:phase codify-sdd-e2e-flow feature-contract
252
+ pnpm sdd:phase codify-sdd-e2e-flow phase-gate
253
+ pnpm sdd:phase codify-sdd-e2e-flow reporting
254
+ ```
255
+
256
+ 当前 final acceptance 预期失败:
257
+
258
+ ```bash
259
+ pnpm sdd:acceptance codify-sdd-e2e-flow
260
+ ```
261
+
262
+ 原因:
263
+
264
+ ```text
265
+ pilot-run phase 尚未执行,缺少 validation-report.pilot-run.md
266
+ ```
267
+
268
+ 也就是说,流程规范和 gate 脚本已经落地,但还需要选择一个小型真实业务 change 跑 pilot,才能关闭最终验收。
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "openspec-sdd-e2e-kit",
3
+ "version": "0.1.0",
4
+ "description": "Project-local OpenSpec SDD + E2E workflow kit",
5
+ "assets": [
6
+ {
7
+ "path": "openspec/config.yaml",
8
+ "type": "file"
9
+ },
10
+ {
11
+ "path": "openspec/schemas/sdd-e2e",
12
+ "type": "directory"
13
+ },
14
+ {
15
+ "path": "openspec/schemas/sdd-e2e.yaml",
16
+ "type": "file"
17
+ },
18
+ {
19
+ "path": "openspec/sdd-e2e-flow.md",
20
+ "type": "file"
21
+ },
22
+ {
23
+ "path": "openspec/sdd-e2e-maintenance.md",
24
+ "type": "file"
25
+ },
26
+ {
27
+ "path": "SDD_E2E_FLOW.md",
28
+ "type": "file"
29
+ },
30
+ {
31
+ "path": ".codex/skills/openspec-apply-change",
32
+ "type": "directory"
33
+ },
34
+ {
35
+ "path": ".codex/skills/openspec-archive-change",
36
+ "type": "directory"
37
+ },
38
+ {
39
+ "path": ".codex/skills/openspec-continue-change",
40
+ "type": "directory"
41
+ },
42
+ {
43
+ "path": ".codex/skills/openspec-explore",
44
+ "type": "directory"
45
+ },
46
+ {
47
+ "path": ".codex/skills/openspec-full-spec-discovery",
48
+ "type": "directory"
49
+ },
50
+ {
51
+ "path": ".codex/skills/openspec-new-change",
52
+ "type": "directory"
53
+ },
54
+ {
55
+ "path": ".codex/skills/openspec-propose",
56
+ "type": "directory"
57
+ },
58
+ {
59
+ "path": ".codex/skills/spec-to-gherkin",
60
+ "type": "directory"
61
+ },
62
+ {
63
+ "path": ".codex/skills/feature-to-e2e",
64
+ "type": "directory"
65
+ },
66
+ {
67
+ "path": "scripts/sdd",
68
+ "type": "directory"
69
+ }
70
+ ],
71
+ "packageScripts": {
72
+ "sdd:acceptance": "node scripts/sdd/summarize-acceptance.mjs",
73
+ "sdd:lint-features": "node scripts/sdd/lint-features.mjs",
74
+ "sdd:lint-tasks": "node scripts/sdd/lint-tasks.mjs",
75
+ "sdd:phase": "node scripts/sdd/check-report.mjs",
76
+ "sdd:self-test": "node scripts/sdd/self-test.mjs"
77
+ }
78
+ }
@@ -0,0 +1,18 @@
1
+ schema: sdd-e2e
2
+ context: |
3
+ This project uses a project-local OpenSpec schema named sdd-e2e.
4
+ The workflow inserts Gherkin feature contracts between specs and design/tasks, then uses phase-scoped acceptance gates during implementation.
5
+ Feature files must be generated before design and tasks are finalized.
6
+ Phase completion is determined by acceptance reports and pnpm sdd:phase, not by smoke checks alone.
7
+ rules:
8
+ features:
9
+ - "Generate Cucumber-compatible .feature files under specs/**/features/."
10
+ - "Every Scenario must include @phase, @validation, @req, and @p0/@p1/@p2 tags."
11
+ - "P0 and P1 scenarios must include risk or boundary tags."
12
+ tasks:
13
+ - "Organize tasks by feature @phase tags using ## Phase: <phase-id> headings."
14
+ - "Every phase must include a matching Covers line and an Acceptance validation task."
15
+ - "Do not invent phases that do not exist in feature tags."
16
+ final-acceptance:
17
+ - "Run pnpm sdd:acceptance <change> and use the generated acceptance-coverage.md."
18
+ - "Do not archive schema: sdd-e2e changes before final acceptance passes unless an exception is explicitly accepted."
@@ -0,0 +1,128 @@
1
+ name: sdd-e2e
2
+ version: 1
3
+ description: Project workflow for OpenSpec SDD with Gherkin feature contracts and phase E2E acceptance gates
4
+ artifacts:
5
+ - id: proposal
6
+ generates: proposal.md
7
+ description: Explain why the change is needed, what will change, and which capabilities are affected
8
+ template: proposal.md
9
+ instruction: |
10
+ Create the proposal artifact for a project-level SDD-E2E change.
11
+
12
+ The proposal must establish the problem, the intended user-visible behavior, the affected capabilities, and the expected impact. Keep implementation detail out unless it is necessary to clarify scope.
13
+
14
+ For UI behavior, interaction state, async requests, configuration forms, publishing flows, or cross-view synchronization, prefer this sdd-e2e workflow over the lightweight spec-driven workflow.
15
+ requires: []
16
+
17
+ - id: specs
18
+ generates: "specs/**/spec.md"
19
+ description: Define normative behavior and business rules using OpenSpec requirements and scenarios
20
+ template: spec.md
21
+ instruction: |
22
+ Create one spec file per capability listed in proposal.md.
23
+
24
+ Specs define what the system SHALL do. Use ADDED/MODIFIED/REMOVED/RENAMED sections and OpenSpec requirement syntax. Every requirement must have at least one scenario with exactly four heading hashes.
25
+
26
+ Do not encode implementation details as requirements unless they are externally observable behavior or a required contract.
27
+ requires:
28
+ - proposal
29
+
30
+ - id: features
31
+ generates: "specs/**/features/*.feature"
32
+ description: Expand specs into Gherkin feature files that define phase-scoped acceptance contracts
33
+ template: feature.feature
34
+ instruction: |
35
+ Generate Gherkin feature files from completed specs before finalizing design or tasks.
36
+
37
+ This artifact is an acceptance contract, not an optional test attachment. Expand beyond the happy path and cover frontend risk dimensions when applicable: state-machine behavior, validation, feedback, degradation, anti-duplicate actions, race conditions, conditional rendering, data echo, and cross-view sync.
38
+
39
+ Every Scenario must include scenario-level tags:
40
+ - @phase:<phase-id>
41
+ - @validation:<mock-e2e|real-smoke|component|unit|api|manual>
42
+ - @req:<requirement-id>
43
+ - @p0, @p1, or @p2
44
+
45
+ P0 and P1 scenarios must include at least one risk or boundary tag. P0 scenarios must not use @gap-pending.
46
+ requires:
47
+ - specs
48
+
49
+ - id: test-cases
50
+ generates: test-cases.md
51
+ description: Summarize rules, spec gaps, coverage matrix, and phase validation plan derived from features
52
+ template: test-cases.md
53
+ instruction: |
54
+ Create the coverage matrix for the generated feature files.
55
+
56
+ Include input sources, business rules, confirmed and pending spec gaps, scenario coverage by requirement, phase summary, validation type distribution, and feature file index.
57
+
58
+ If spec gaps affect E2E executability, record them explicitly and do not pretend they are covered.
59
+ requires:
60
+ - features
61
+
62
+ - id: design
63
+ generates: design.md
64
+ description: Explain the implementation approach, decisions, risks, and validation strategy
65
+ template: design.md
66
+ instruction: |
67
+ Create design.md after specs, features, and test-cases exist.
68
+
69
+ The design must use feature scenarios as input. Pay special attention to @phase boundaries, @validation types, P0/P1 scenarios, and risk tags. Record how implementation will handle mismatch, blocked validation, and known spec gaps.
70
+
71
+ Keep design focused on decisions and trade-offs, not line-by-line implementation.
72
+ requires:
73
+ - specs
74
+ - features
75
+ - test-cases
76
+
77
+ - id: tasks
78
+ generates: tasks.md
79
+ description: Break implementation into phase-scoped tasks tied to feature tags and acceptance gates
80
+ template: tasks.md
81
+ instruction: |
82
+ Create tasks.md using phase groups from feature Scenario tags.
83
+
84
+ Each phase must use:
85
+ ## Phase: <phase-id>
86
+ Covers: `@phase:<phase-id>`
87
+
88
+ Each phase must include implementation tasks and an Acceptance validation task for the same phase. A smoke task can exist, but smoke cannot close a phase.
89
+
90
+ Do not invent phase IDs that do not exist in feature tags. If a phase changes, update both feature tags and tasks.
91
+ requires:
92
+ - design
93
+ - features
94
+ - test-cases
95
+
96
+ - id: final-acceptance
97
+ generates: acceptance-coverage.md
98
+ description: Aggregate all phase acceptance reports and record the change-level final gate result
99
+ template: acceptance-coverage.md
100
+ instruction: |
101
+ Generate final acceptance after phase implementation and phase reports are complete.
102
+
103
+ Run:
104
+ pnpm sdd:acceptance <change>
105
+
106
+ The generated acceptance-coverage.md must show every phase gate and a final passed or failed result. A schema: sdd-e2e change should not be archived until final acceptance passes or the exception is explicitly accepted.
107
+ requires:
108
+ - tasks
109
+
110
+ apply:
111
+ requires:
112
+ - tasks
113
+ tracks: tasks.md
114
+ instruction: |
115
+ Read proposal, specs, features, test-cases, design, and tasks before implementation.
116
+
117
+ Before implementation, run:
118
+ pnpm sdd:lint-features <change>
119
+ pnpm sdd:lint-tasks <change>
120
+
121
+ Implement one phase at a time. For each phase:
122
+ - complete the phase implementation tasks
123
+ - validate the selected @phase:<phase-id> scenarios
124
+ - write specs/e2e/bdd/<change>/validation-report.<phase-id>.md
125
+ - run pnpm sdd:phase <change> <phase-id>
126
+ - only mark the phase Acceptance task done if the phase gate passes
127
+
128
+ After all phases, run pnpm sdd:acceptance <change>. Do not treat smoke-only, blocked, manual, or mismatch results as phase completion unless the report records an accepted exception.
@@ -0,0 +1,9 @@
1
+ # Acceptance Coverage
2
+
3
+ Change: `<change>`
4
+
5
+ | Phase | Gate | Report |
6
+ |---|---|---|
7
+ | `<phase>` | pending | `specs/e2e/bdd/<change>/validation-report.<phase>.md` |
8
+
9
+ Final gate: failed
@@ -0,0 +1,29 @@
1
+ ## Context
2
+
3
+ <!-- Current behavior, relevant code areas, constraints, and dependencies. -->
4
+
5
+ ## Goals / Non-Goals
6
+
7
+ **Goals:**
8
+ - <goal>
9
+
10
+ **Non-Goals:**
11
+ - <non-goal>
12
+
13
+ ## Decisions
14
+
15
+ ### 1. <Decision>
16
+
17
+ <Decision and rationale. Include alternatives considered where useful.>
18
+
19
+ ## Phase Strategy
20
+
21
+ <!-- Explain how implementation maps to @phase tags and how each phase will be validated. -->
22
+
23
+ ## Risks / Trade-offs
24
+
25
+ <!-- Include mismatch, blocked validation, concurrency, data, auth, and rollout risks. -->
26
+
27
+ ## Validation Plan
28
+
29
+ <!-- List lint, unit/component/API/E2E/phase gates. Include pnpm sdd:* commands when applicable. -->
@@ -0,0 +1,13 @@
1
+ @<capability>
2
+ Feature: <capability title>
3
+
4
+ Background:
5
+ Given <stable shared precondition>
6
+
7
+ Rule: <business rule>
8
+
9
+ @phase:<phase-id> @validation:<type> @req:<requirement-id> @p0 @state-machine
10
+ Scenario: <observable scenario>
11
+ Given <precondition>
12
+ When <user action>
13
+ Then <observable result>
@@ -0,0 +1,23 @@
1
+ ## Why
2
+
3
+ <!-- Explain the problem or opportunity. What user-visible limitation does this change address? Why now? -->
4
+
5
+ ## What Changes
6
+
7
+ <!-- Describe the intended behavior changes. Be specific about new capabilities, modified behavior, and removals. -->
8
+
9
+ ## Capabilities
10
+
11
+ ### New Capabilities
12
+
13
+ <!-- List new capability specs to create. Use kebab-case. -->
14
+ - `<name>`: <brief description>
15
+
16
+ ### Modified Capabilities
17
+
18
+ <!-- List existing capability specs whose requirements change. Leave empty if none. -->
19
+ - `<existing-name>`: <what requirement changes>
20
+
21
+ ## Impact
22
+
23
+ <!-- Affected pages, components, stores, services, APIs, data, E2E coverage, or operational risks. -->
@@ -0,0 +1,21 @@
1
+ ## ADDED Requirements
2
+
3
+ ### Requirement: <requirement name>
4
+
5
+ <Normative requirement text. Use SHALL/MUST for required behavior.>
6
+
7
+ #### Scenario: <scenario name>
8
+ - **WHEN** <condition or user action>
9
+ - **THEN** <observable expected outcome>
10
+
11
+ ## MODIFIED Requirements
12
+
13
+ <!-- For modified requirements, copy the full existing requirement block and edit it. -->
14
+
15
+ ## REMOVED Requirements
16
+
17
+ <!-- Include Reason and Migration for removed behavior. -->
18
+
19
+ ## RENAMED Requirements
20
+
21
+ <!-- Use FROM:/TO: for renamed requirements. -->
@@ -0,0 +1,16 @@
1
+ # Phase-Driven Tasks
2
+
3
+ ## Phase: <phase-id>
4
+
5
+ Covers: `@phase:<phase-id>`
6
+
7
+ - [ ] Implement <behavior>
8
+ - [ ] Run focused verification for `@phase:<phase-id>`
9
+ - [ ] Acceptance 验证 `@phase:<phase-id>` 全部自动化 Scenario
10
+
11
+ ## Final Validation
12
+
13
+ - [ ] Run `pnpm sdd:lint-features <change>`
14
+ - [ ] Run `pnpm sdd:lint-tasks <change>`
15
+ - [ ] Run all required implementation checks
16
+ - [ ] Run `pnpm sdd:acceptance <change>`
@@ -0,0 +1,35 @@
1
+ # Test Cases
2
+
3
+ ## Input Sources
4
+
5
+ <!-- List spec files, design notes, product constraints, and relevant implementation context. -->
6
+
7
+ ## Business Rules
8
+
9
+ <!-- Extract rules from specs before listing scenarios. -->
10
+
11
+ ## Spec Gaps
12
+
13
+ <!-- Record confirmed gaps and pending gaps. Mark whether each affects automation. -->
14
+
15
+ ## Coverage Matrix
16
+
17
+ | Rule | Dimension | Priority | Phase | Validation | Scenario |
18
+ |---|---|---:|---|---|---|
19
+ | <rule> | <dimension> | P0 | <phase> | <validation> | <scenario> |
20
+
21
+ ## Phase Validation Summary
22
+
23
+ | Phase | Scenarios | Automated | Manual | Notes |
24
+ |---|---:|---:|---:|---|
25
+ | <phase> | 0 | 0 | 0 | <notes> |
26
+
27
+ ## Feature File Index
28
+
29
+ | File | Requirement | Scenario Count |
30
+ |---|---|---:|
31
+ | `specs/<capability>/features/<file>.feature` | <requirement> | 0 |
32
+
33
+ ## Quality Summary
34
+
35
+ <!-- Include scenario count, unique step pattern count if available, gap-pending count, validation distribution, and lint status. -->