@edupia-tutor/spec-driven-docs 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/build.js +230 -0
- package/bin/index.js +598 -0
- package/commands/debug.md +830 -0
- package/commands/debug.tmpl +257 -0
- package/commands/define-product.md +652 -0
- package/commands/define-product.tmpl +158 -0
- package/commands/dev-gen-test.md +1010 -0
- package/commands/dev-gen-test.tmpl +490 -0
- package/commands/dev-run-test.md +744 -0
- package/commands/dev-run-test.tmpl +224 -0
- package/commands/dev-smoke-test.md +711 -0
- package/commands/dev-smoke-test.tmpl +217 -0
- package/commands/fix-bug.md +744 -0
- package/commands/fix-bug.tmpl +171 -0
- package/commands/generate-bdd.md +1054 -0
- package/commands/generate-bdd.tmpl +534 -0
- package/commands/generate-code.md +869 -0
- package/commands/generate-code.tmpl +349 -0
- package/commands/generate-design-spec.md +958 -0
- package/commands/generate-design-spec.tmpl +464 -0
- package/commands/generate-prd.md +748 -0
- package/commands/generate-prd.tmpl +254 -0
- package/commands/generate-spec-manifest.md +658 -0
- package/commands/generate-spec-manifest.tmpl +164 -0
- package/commands/generate-tech-docs.md +849 -0
- package/commands/generate-tech-docs.tmpl +355 -0
- package/commands/learn.md +636 -0
- package/commands/learn.tmpl +63 -0
- package/commands/map-testids.md +575 -0
- package/commands/map-testids.tmpl +81 -0
- package/commands/propose-scenario.md +623 -0
- package/commands/propose-scenario.tmpl +129 -0
- package/commands/qc-analyze.md +580 -0
- package/commands/qc-analyze.tmpl +86 -0
- package/commands/qc-design-test.md +562 -0
- package/commands/qc-design-test.tmpl +68 -0
- package/commands/qc-plan.md +543 -0
- package/commands/qc-plan.tmpl +49 -0
- package/commands/qc-report.md +554 -0
- package/commands/qc-report.tmpl +60 -0
- package/commands/qc-review.md +547 -0
- package/commands/qc-review.tmpl +53 -0
- package/commands/qc-run-test.md +604 -0
- package/commands/qc-run-test.tmpl +84 -0
- package/commands/refine-prd.md +772 -0
- package/commands/refine-prd.tmpl +140 -0
- package/commands/report-bug.md +639 -0
- package/commands/report-bug.tmpl +145 -0
- package/commands/review-code.md +677 -0
- package/commands/review-code.tmpl +104 -0
- package/commands/review-context.md +1047 -0
- package/commands/review-context.tmpl +415 -0
- package/commands/review-tech-docs.md +811 -0
- package/commands/review-tech-docs.tmpl +317 -0
- package/commands/setup-ai-first.md +545 -0
- package/commands/setup-ai-first.tmpl +358 -0
- package/commands/sync.md +451 -0
- package/commands/sync.tmpl +351 -0
- package/commands/update-framework.md +251 -0
- package/commands/update-framework.tmpl +151 -0
- package/commands/validate-traces.md +842 -0
- package/commands/validate-traces.tmpl +348 -0
- package/core/FRAMEWORK_VERSION +1 -0
- package/core/commands/debug.md +830 -0
- package/core/commands/define-product.md +652 -0
- package/core/commands/dev-gen-test.md +1010 -0
- package/core/commands/dev-run-test.md +744 -0
- package/core/commands/dev-smoke-test.md +711 -0
- package/core/commands/fix-bug.md +744 -0
- package/core/commands/generate-bdd.md +1054 -0
- package/core/commands/generate-code.md +869 -0
- package/core/commands/generate-design-spec.md +958 -0
- package/core/commands/generate-prd.md +748 -0
- package/core/commands/generate-spec-manifest.md +658 -0
- package/core/commands/generate-tech-docs.md +849 -0
- package/core/commands/learn.md +636 -0
- package/core/commands/map-testids.md +575 -0
- package/core/commands/propose-scenario.md +623 -0
- package/core/commands/qc-analyze.md +580 -0
- package/core/commands/qc-design-test.md +562 -0
- package/core/commands/qc-plan.md +543 -0
- package/core/commands/qc-report.md +554 -0
- package/core/commands/qc-review.md +547 -0
- package/core/commands/qc-run-test.md +604 -0
- package/core/commands/refine-prd.md +772 -0
- package/core/commands/report-bug.md +639 -0
- package/core/commands/review-code.md +677 -0
- package/core/commands/review-context.md +1047 -0
- package/core/commands/review-tech-docs.md +811 -0
- package/core/commands/setup-ai-first.md +545 -0
- package/core/commands/sync.md +451 -0
- package/core/commands/update-framework.md +251 -0
- package/core/commands/validate-traces.md +842 -0
- package/core/hooks/data-guard.js +141 -0
- package/core/hooks/settings.json +18 -0
- package/core/modules/android-compose/module.yaml +13 -0
- package/core/modules/android-compose/stack-profile.yaml +57 -0
- package/core/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/core/modules/angular/module.yaml +6 -0
- package/core/modules/angular/stack-profile.yaml +38 -0
- package/core/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/core/modules/context-engineering/module.yaml +9 -0
- package/core/modules/context-engineering/stack-profile.yaml +61 -0
- package/core/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/core/modules/dotnet/module.yaml +6 -0
- package/core/modules/dotnet/stack-profile.yaml +50 -0
- package/core/modules/flutter/module.yaml +14 -0
- package/core/modules/flutter/stack-profile.yaml +59 -0
- package/core/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/core/modules/golang/module.yaml +6 -0
- package/core/modules/golang/stack-profile.yaml +40 -0
- package/core/modules/ios-swiftui/module.yaml +13 -0
- package/core/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/core/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/core/modules/java-spring/module.yaml +15 -0
- package/core/modules/java-spring/stack-profile.yaml +28 -0
- package/core/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/core/modules/nextjs/module.yaml +14 -0
- package/core/modules/nextjs/stack-profile.yaml +74 -0
- package/core/modules/nuxt/module.yaml +14 -0
- package/core/modules/nuxt/stack-profile.yaml +58 -0
- package/core/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/core/modules/php-laravel/module.yaml +15 -0
- package/core/modules/php-laravel/stack-profile.yaml +56 -0
- package/core/modules/qc-playwright/stack-profile.yaml +66 -0
- package/core/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/core/modules/react/module.yaml +14 -0
- package/core/modules/react/stack-profile.yaml +63 -0
- package/core/modules/react-native/module.yaml +14 -0
- package/core/modules/react-native/stack-profile.yaml +56 -0
- package/core/modules/vue/module.yaml +14 -0
- package/core/modules/vue/stack-profile.yaml +65 -0
- package/core/rules/data-protection.md +80 -0
- package/core/rules/workflow.md +44 -0
- package/core/skills/code/SKILL.md +770 -0
- package/core/skills/debug/SKILL.md +869 -0
- package/core/skills/design-spec/SKILL.md +589 -0
- package/core/skills/discovery/SKILL.md +554 -0
- package/core/skills/prd/SKILL.md +562 -0
- package/core/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/core/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/core/skills/qc/qa-analyst/business-rules.md +59 -0
- package/core/skills/qc/qa-analyst/data-flow.md +64 -0
- package/core/skills/qc/qa-analyst/spec-breakdown.md +61 -0
- package/core/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/core/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/core/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/core/skills/qc/qa-designer/functional/api.md +45 -0
- package/core/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/core/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/core/skills/qc/qa-designer/integration/api.md +42 -0
- package/core/skills/qc/qa-designer/integration/db.md +39 -0
- package/core/skills/qc/qa-designer/integration/gui.md +40 -0
- package/core/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/core/skills/qc/qa-designer/non-functional.md +40 -0
- package/core/skills/qc/qa-planner/test-plan.md +120 -0
- package/core/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/core/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/core/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/core/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/core/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/core/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/core/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/core/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/core/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/core/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/core/skills/qc/qa-runner/e2e.md +49 -0
- package/core/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/core/skills/qc/qa-runner/functional/api.md +35 -0
- package/core/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/core/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/core/skills/qc/qa-runner/integration.md +47 -0
- package/core/skills/qc/qa-runner/non-functional.md +49 -0
- package/core/skills/qc/qa-runner/report/report.md +37 -0
- package/core/skills/setup-ai-first/SKILL.md +216 -0
- package/core/skills/spec/SKILL.md +461 -0
- package/core/skills/test/SKILL.md +1297 -0
- package/core/steps/capture-lesson.md +79 -0
- package/core/steps/context-loader.md +307 -0
- package/core/steps/gate.md +87 -0
- package/core/steps/report-footer.md +100 -0
- package/core/steps/review-fanout.md +138 -0
- package/core/steps/spawn-agent.md +124 -0
- package/core/steps/trace-mirror.md +26 -0
- package/core/templates/architecture.template.md +113 -0
- package/core/templates/design-spec.template.md +217 -0
- package/core/templates/feature.template +259 -0
- package/core/templates/platform-guide.template.md +145 -0
- package/core/templates/prd.template.md +327 -0
- package/core/templates/product-definition.template.md +168 -0
- package/core/templates/project-context.yaml +161 -0
- package/docs/01-getting-started/README.md +19 -0
- package/docs/01-getting-started/core-concepts.md +102 -0
- package/docs/01-getting-started/installation.md +156 -0
- package/docs/01-getting-started/quickstart.md +85 -0
- package/docs/02-guides/README.md +26 -0
- package/docs/02-guides/developer/README.md +46 -0
- package/docs/02-guides/developer/bdd-and-trace.md +125 -0
- package/docs/02-guides/developer/commands.md +76 -0
- package/docs/02-guides/developer/pr-checklist.md +15 -0
- package/docs/02-guides/developer/scenarios.md +460 -0
- package/docs/02-guides/developer/workflow.md +121 -0
- package/docs/02-guides/product-owner/README.md +79 -0
- package/docs/02-guides/product-owner/commands.md +30 -0
- package/docs/02-guides/product-owner/handoff-checklist.md +42 -0
- package/docs/02-guides/product-owner/prd-writing-rules.md +45 -0
- package/docs/02-guides/product-owner/scenarios.md +436 -0
- package/docs/02-guides/tester/README.md +75 -0
- package/docs/02-guides/tester/bug-reporting.md +117 -0
- package/docs/02-guides/tester/qc-automation.md +165 -0
- package/docs/02-guides/tester/reading-specs.md +79 -0
- package/docs/02-guides/tester/scenarios.md +186 -0
- package/docs/02-guides/tester/spec-manifest.md +130 -0
- package/docs/02-guides/tester/test-checklist.md +31 -0
- package/docs/02-guides/tester/workflow.md +77 -0
- package/docs/03-concepts/README.md +19 -0
- package/docs/03-concepts/architecture.md +248 -0
- package/docs/03-concepts/pipeline.md +274 -0
- package/docs/03-concepts/traceability.md +149 -0
- package/docs/04-operations/README.md +33 -0
- package/docs/04-operations/bug-flow.md +362 -0
- package/docs/04-operations/publishing.md +137 -0
- package/docs/04-operations/sync-and-update.md +522 -0
- package/docs/05-reference/README.md +32 -0
- package/docs/05-reference/command-cheatsheet.md +147 -0
- package/docs/05-reference/commands.md +232 -0
- package/docs/05-reference/modules.md +110 -0
- package/docs/05-reference/trace-schema.md +153 -0
- package/docs/README.md +49 -0
- package/hooks/data-guard.js +141 -0
- package/hooks/settings.json +18 -0
- package/modules/android-compose/module.yaml +13 -0
- package/modules/android-compose/stack-profile.yaml +57 -0
- package/modules/angular/architecture-snippets/component-patterns.md +187 -0
- package/modules/angular/module.yaml +6 -0
- package/modules/angular/stack-profile.yaml +38 -0
- package/modules/context-engineering/architecture-snippets/context-design.md +119 -0
- package/modules/context-engineering/module.yaml +9 -0
- package/modules/context-engineering/stack-profile.yaml +61 -0
- package/modules/dotnet/architecture-snippets/clean-arch.md +160 -0
- package/modules/dotnet/module.yaml +6 -0
- package/modules/dotnet/stack-profile.yaml +50 -0
- package/modules/flutter/module.yaml +14 -0
- package/modules/flutter/stack-profile.yaml +59 -0
- package/modules/golang/architecture-snippets/domain-layout.md +283 -0
- package/modules/golang/module.yaml +6 -0
- package/modules/golang/stack-profile.yaml +40 -0
- package/modules/ios-swiftui/module.yaml +13 -0
- package/modules/ios-swiftui/stack-profile.yaml +55 -0
- package/modules/java-spring/architecture-snippets/layered-arch.md +201 -0
- package/modules/java-spring/module.yaml +15 -0
- package/modules/java-spring/stack-profile.yaml +28 -0
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +269 -0
- package/modules/nextjs/module.yaml +14 -0
- package/modules/nextjs/stack-profile.yaml +74 -0
- package/modules/nuxt/module.yaml +14 -0
- package/modules/nuxt/stack-profile.yaml +58 -0
- package/modules/php-laravel/architecture-snippets/service-repository.md +302 -0
- package/modules/php-laravel/module.yaml +15 -0
- package/modules/php-laravel/stack-profile.yaml +56 -0
- package/modules/qc-playwright/stack-profile.yaml +66 -0
- package/modules/react/architecture-snippets/hooks-query-patterns.md +254 -0
- package/modules/react/module.yaml +14 -0
- package/modules/react/stack-profile.yaml +63 -0
- package/modules/react-native/module.yaml +14 -0
- package/modules/react-native/stack-profile.yaml +56 -0
- package/modules/vue/module.yaml +14 -0
- package/modules/vue/stack-profile.yaml +65 -0
- package/package.json +49 -0
- package/rules/data-protection.md +80 -0
- package/rules/workflow.md +44 -0
- package/scripts/init.sh +49 -0
- package/scripts/migrate-specs.js +256 -0
- package/scripts/upgrade.sh +94 -0
- package/skills/code/SKILL.md +770 -0
- package/skills/code/SKILL.tmpl +176 -0
- package/skills/debug/SKILL.md +869 -0
- package/skills/debug/SKILL.tmpl +262 -0
- package/skills/design-spec/SKILL.md +589 -0
- package/skills/design-spec/SKILL.tmpl +95 -0
- package/skills/discovery/SKILL.md +554 -0
- package/skills/discovery/SKILL.tmpl +147 -0
- package/skills/prd/SKILL.md +562 -0
- package/skills/prd/SKILL.tmpl +188 -0
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +63 -0
- package/skills/qc/qa-analyst/acceptance-criteria.md +60 -0
- package/skills/qc/qa-analyst/business-rules.md +59 -0
- package/skills/qc/qa-analyst/data-flow.md +64 -0
- package/skills/qc/qa-analyst/spec-breakdown.md +61 -0
- package/skills/qc/qa-designer/e2e/journey.md +41 -0
- package/skills/qc/qa-designer/exploratory/charter.md +68 -0
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +43 -0
- package/skills/qc/qa-designer/functional/api.md +45 -0
- package/skills/qc/qa-designer/functional/gui-feature.md +46 -0
- package/skills/qc/qa-designer/functional/gui-screen.md +52 -0
- package/skills/qc/qa-designer/integration/api.md +42 -0
- package/skills/qc/qa-designer/integration/db.md +39 -0
- package/skills/qc/qa-designer/integration/gui.md +40 -0
- package/skills/qc/qa-designer/integration/kafka.md +40 -0
- package/skills/qc/qa-designer/non-functional.md +40 -0
- package/skills/qc/qa-planner/test-plan.md +120 -0
- package/skills/qc/qa-reviewer/script/e2e.md +87 -0
- package/skills/qc/qa-reviewer/script/exploratory.md +45 -0
- package/skills/qc/qa-reviewer/script/functional.md +101 -0
- package/skills/qc/qa-reviewer/script/integration.md +91 -0
- package/skills/qc/qa-reviewer/script/non-functional.md +126 -0
- package/skills/qc/qa-reviewer/test-case/e2e.md +73 -0
- package/skills/qc/qa-reviewer/test-case/exploratory.md +43 -0
- package/skills/qc/qa-reviewer/test-case/functional.md +76 -0
- package/skills/qc/qa-reviewer/test-case/integration.md +69 -0
- package/skills/qc/qa-reviewer/test-case/non-functional.md +73 -0
- package/skills/qc/qa-runner/e2e.md +49 -0
- package/skills/qc/qa-runner/exploratory/session.md +36 -0
- package/skills/qc/qa-runner/functional/api.md +35 -0
- package/skills/qc/qa-runner/functional/gui-feature.md +51 -0
- package/skills/qc/qa-runner/functional/gui-screen.md +55 -0
- package/skills/qc/qa-runner/integration.md +47 -0
- package/skills/qc/qa-runner/non-functional.md +49 -0
- package/skills/qc/qa-runner/report/report.md +37 -0
- package/skills/setup-ai-first/SKILL.md +216 -0
- package/skills/setup-ai-first/SKILL.tmpl +116 -0
- package/skills/spec/SKILL.md +461 -0
- package/skills/spec/SKILL.tmpl +174 -0
- package/skills/test/SKILL.md +1297 -0
- package/skills/test/SKILL.tmpl +296 -0
- package/steps/capture-lesson.md +79 -0
- package/steps/context-loader.md +307 -0
- package/steps/gate.md +87 -0
- package/steps/report-footer.md +100 -0
- package/steps/review-fanout.md +138 -0
- package/steps/spawn-agent.md +124 -0
- package/steps/trace-mirror.md +26 -0
- package/templates/architecture.template.md +113 -0
- package/templates/design-spec.template.md +217 -0
- package/templates/feature.template +259 -0
- package/templates/platform-guide.template.md +145 -0
- package/templates/prd.template.md +327 -0
- package/templates/product-definition.template.md +168 -0
- package/templates/project-context.yaml +161 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
# /generate-bdd — Generate BDD Feature Files
|
|
2
|
+
|
|
3
|
+
## Gate
|
|
4
|
+
{{include:steps/gate.md}}
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
{{include:steps/context-loader.md}}
|
|
8
|
+
|
|
9
|
+
> **Tester proposals (optional input):** before generating, check `{paths.bdd_proposals_dir}/` (default `{spec_source}/feedback/bdd-proposals/`) for scenarios proposed by testers via `/propose-scenario` that map to this UC's ACs. Incorporate any the PO/Dev has accepted — then the tester's draft is removed/archived from `feedback/`. Skip if the folder is empty.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Repo Mode Detection
|
|
14
|
+
|
|
15
|
+
After loading context, determine which mode to operate in:
|
|
16
|
+
|
|
17
|
+
- **Spec repo mode**: `project-context.yaml` has NO `services` section OR `setup.mode: spec`
|
|
18
|
+
- **Umbrella mode**: `project-context.yaml` HAS `services` section AND `setup.mode: umbrella`
|
|
19
|
+
|
|
20
|
+
→ Spec repo mode → proceed to **Platform Selection** below (skip Service Detection)
|
|
21
|
+
→ Umbrella mode → proceed to **Service Detection** below (skip Platform Selection)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Platform Selection (Spec Repo Mode Only)
|
|
26
|
+
|
|
27
|
+
*Skip this section if running in umbrella mode.*
|
|
28
|
+
|
|
29
|
+
Ask the user to select the target platform:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Which platform is this BDD for?
|
|
33
|
+
1. web — FE/Web (React, Next.js, Angular, Vue, Nuxt)
|
|
34
|
+
2. app — Mobile (Flutter, React Native, iOS, Android)
|
|
35
|
+
3. system — System/BE BDD (synthesized from existing web + app BDDs)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Wait for user selection. Set `active_platform` = chosen value.
|
|
39
|
+
|
|
40
|
+
**Output path (spec repo mode):**
|
|
41
|
+
`{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
42
|
+
|
|
43
|
+
**Platform vocabulary:**
|
|
44
|
+
|
|
45
|
+
| Platform | "user action" | "type/input" | "observe" | "navigate" |
|
|
46
|
+
|---|---|---|---|---|
|
|
47
|
+
| web | "clicks" | "types into" / "enters" | "sees" / "the page shows" | "navigates to" / "goes to" |
|
|
48
|
+
| app | "taps" | "enters" / "inputs" | "sees" / "the screen shows" | "navigates to" / "opens" |
|
|
49
|
+
| system | N/A — use business events | — | "the system returns" / "receives response" | — |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## System BDD Synthesis (active_platform = system)
|
|
54
|
+
|
|
55
|
+
*Only applies when platform = system. Skip for web and app.*
|
|
56
|
+
|
|
57
|
+
### Step S0 — Brownfield Check
|
|
58
|
+
|
|
59
|
+
Check the source PRD Metadata table for `| **API Source** | existing |`.
|
|
60
|
+
|
|
61
|
+
**Nếu `API Source: existing`:**
|
|
62
|
+
- API contract đã được PO ghi trong phần "Existing API Contract" của PRD.
|
|
63
|
+
- **Skip Steps S1–S3** — không cần scan FE/App BDD, không cần conflict resolution.
|
|
64
|
+
- Dùng bảng "Existing API Contract" trong PRD làm contract input cho Step S4.
|
|
65
|
+
- Set `# @trace.api_source: existing` trong header của file system BDD được gen.
|
|
66
|
+
|
|
67
|
+
**Nếu `API Source` không có hoặc không phải `existing`:**
|
|
68
|
+
- Tiếp tục Steps S1–S3 (normal synthesis flow).
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Step S1 — Scan available FE/App BDDs
|
|
73
|
+
|
|
74
|
+
Search for existing BDDs for this TICKET-ID:
|
|
75
|
+
- Web BDDs: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/web/{TICKET-ID}-*.feature`
|
|
76
|
+
- App BDDs: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/app/{TICKET-ID}-*.feature`
|
|
77
|
+
|
|
78
|
+
Classify the feature:
|
|
79
|
+
|
|
80
|
+
| Condition | Mode |
|
|
81
|
+
|---|---|
|
|
82
|
+
| Both web + app BDDs found | **Multi-platform** — synthesize from both |
|
|
83
|
+
| Only web BDD found | **Web-only** — synthesize from web |
|
|
84
|
+
| Only app BDD found | **App-only** — synthesize from app |
|
|
85
|
+
| No FE/App BDDs found | **Backend-only** — gen directly from PRD |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Step S2 — Extract expected contracts per platform
|
|
90
|
+
|
|
91
|
+
For each found BDD file, extract:
|
|
92
|
+
- **Triggers**: what user actions call the backend? (map to logical "request" events)
|
|
93
|
+
- **Expected response data**: what fields/shape does each `Then` clause need from the system?
|
|
94
|
+
- **Error signals**: what error states must the backend signal?
|
|
95
|
+
- **Business rules**: what invariants does each platform assume the system enforces?
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Step S3 — Cross-Platform Conflict Check (multi-platform mode only)
|
|
100
|
+
|
|
101
|
+
*Skip if web-only, app-only, or backend-only.*
|
|
102
|
+
|
|
103
|
+
Compare the extracted contracts across platforms. Flag a conflict if any of these differ:
|
|
104
|
+
|
|
105
|
+
| Conflict type | Example |
|
|
106
|
+
|---|---|
|
|
107
|
+
| **Response shape mismatch** | Web expects `{ token, redirect_url }`, App expects `{ token, user_profile }` |
|
|
108
|
+
| **Error semantics mismatch** | Web expects HTTP 423 for lock, App expects custom error code `ACC_LOCKED` |
|
|
109
|
+
| **Business rule contradiction** | Web BDD says "lock after 5 attempts", App BDD says "lock after 3 attempts" |
|
|
110
|
+
| **Data field conflict** | Web expects `expires_in: seconds`, App expects `expires_at: ISO timestamp` |
|
|
111
|
+
|
|
112
|
+
**If conflicts detected → CHECKPOINT (mandatory, cannot skip):**
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
⚠️ CROSS-PLATFORM CONTRACT CONFLICT
|
|
116
|
+
──────────────────────────────────────────────────────────────────
|
|
117
|
+
Feature : {TICKET-ID} — {UC name}
|
|
118
|
+
|
|
119
|
+
Conflict 1: Response shape mismatch
|
|
120
|
+
Web BDD (Then): user sees dashboard → implies { token, redirect_url }
|
|
121
|
+
App BDD (Then): app navigates to HomeScreen → implies { token, user_profile }
|
|
122
|
+
|
|
123
|
+
Resolution options:
|
|
124
|
+
A — Union response
|
|
125
|
+
BE returns all fields: { token, redirect_url, user_profile }
|
|
126
|
+
Clients ignore fields they don't use. Simple, slight over-fetch.
|
|
127
|
+
B — Platform hint in request
|
|
128
|
+
Client sends X-Platform: web|app in header, BE tailors response.
|
|
129
|
+
Cleaner responses, more BE logic.
|
|
130
|
+
C — Separate endpoints
|
|
131
|
+
POST /auth/login/web and POST /auth/login/app
|
|
132
|
+
Maximum flexibility, more endpoints to maintain.
|
|
133
|
+
D — Custom: describe your approach
|
|
134
|
+
──────────────────────────────────────────────────────────────────
|
|
135
|
+
Choose resolution for each conflict (A/B/C/D):
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Wait for PO's resolution per conflict. Record each decision as a `# @system.resolution:` annotation in the generated system BDD file.
|
|
139
|
+
|
|
140
|
+
**If no conflicts → proceed to Step S4 directly.**
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### Step S4 — Generate System BDD scenarios
|
|
145
|
+
|
|
146
|
+
Generate scenarios based on mode and resolved conflicts:
|
|
147
|
+
|
|
148
|
+
- **Multi-platform**: synthesize from both web + app contracts, applying resolved resolutions
|
|
149
|
+
- **Web-only / App-only**: derive from the single platform's contracts
|
|
150
|
+
- **Backend-only**: derive directly from PRD AC/BR using business event language (not HTTP)
|
|
151
|
+
|
|
152
|
+
System BDD step vocabulary (always use — regardless of FE/App vocabulary):
|
|
153
|
+
- Triggers: "the system receives {event}" / "a {actor} submits {action}"
|
|
154
|
+
- Assertions: "the system returns {data}" / "the system signals {error}" / "the system stores {state}"
|
|
155
|
+
- Do NOT use UI words (click, tap, see, navigate) in system BDD
|
|
156
|
+
|
|
157
|
+
**If multi-platform with resolution A (union):**
|
|
158
|
+
- System BDD shows the full response contract: all fields from all platforms
|
|
159
|
+
- Add comment: `# @system.resolution: union — clients receive all fields`
|
|
160
|
+
|
|
161
|
+
**If resolution B (platform hint):**
|
|
162
|
+
- Write separate `Scenario Outline` using Examples table for `web` vs `app` response variants
|
|
163
|
+
- Add comment: `# @system.resolution: platform-hint — X-Platform header determines response shape`
|
|
164
|
+
|
|
165
|
+
**If resolution C (separate endpoints):**
|
|
166
|
+
- Write separate Scenarios for each endpoint
|
|
167
|
+
- Note the endpoint split explicitly in the SCOPE section
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Service Detection (Umbrella Mode Only)
|
|
172
|
+
|
|
173
|
+
*Skip this section if running in spec repo mode.*
|
|
174
|
+
|
|
175
|
+
Read the PRD Metadata table for `| **Service** |` and `| **Module** |` rows.
|
|
176
|
+
|
|
177
|
+
| Condition | Action |
|
|
178
|
+
|---|---|
|
|
179
|
+
| PRD has `Service` row AND value is not "default" | Use it as `active_service` + `active_module`. Load catalog for that module. |
|
|
180
|
+
| PRD has no `Service` row AND `services` defined in project-context.yaml | Ask: "Which service is this BDD for?" (list services, wait for selection) |
|
|
181
|
+
| Single-service project (no `services` array) | `active_service = "default"`, `active_module = tech_stack.module` |
|
|
182
|
+
|
|
183
|
+
**Output path (umbrella mode):**
|
|
184
|
+
- `active_service = "default"` → `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
185
|
+
- `active_service ≠ "default"` → `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_service}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
186
|
+
|
|
187
|
+
**Platform vocabulary** — adapt BDD step wording based on `active_module`:
|
|
188
|
+
|
|
189
|
+
| Platform type | Modules | "click" | "type" | "see" | "navigate" |
|
|
190
|
+
|---|---|---|---|---|---|
|
|
191
|
+
| Web | react, nextjs, vue, nuxt, angular | "clicks" | "types into" / "enters" | "sees" / "the page shows" | "navigates to" / "goes to" |
|
|
192
|
+
| Mobile | flutter, react-native, ios-swiftui, android-compose | "taps" | "enters" / "inputs" | "sees" / "the screen shows" | "navigates to" / "opens" |
|
|
193
|
+
| Backend / API | java-spring, golang, dotnet, php-laravel | *(no UI steps — use)* "submits a request" / "calls the API" | — | "receives response" / "the system returns" | — |
|
|
194
|
+
|
|
195
|
+
Apply this vocabulary silently when writing Gherkin steps. Do NOT mix web and mobile terms in the same feature file.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Orchestration Check
|
|
200
|
+
|
|
201
|
+
*Skip this section if already in sub-agent mode (Step 0 of Gate was triggered).*
|
|
202
|
+
|
|
203
|
+
After loading context, check if the target PRD is large enough to warrant sub-agents:
|
|
204
|
+
|
|
205
|
+
1. Count `#### {TICKET-ID}-UC` headings in the PRD → **UC count**.
|
|
206
|
+
2. Count total lines in the PRD → **line count**.
|
|
207
|
+
3. If **UC count > 3** OR **line count > 300**:
|
|
208
|
+
- Switch to orchestration mode — follow `steps/spawn-agent.md`.
|
|
209
|
+
- The main session becomes the orchestrator: spawn 1 sub-agent per UC.
|
|
210
|
+
- Each sub-agent runs `/generate-bdd` with `_agent_mode: true` payload.
|
|
211
|
+
- Collect results and show merged report.
|
|
212
|
+
- **Do NOT continue with the steps below.**
|
|
213
|
+
4. If UC count ≤ 3 AND line count ≤ 300 → continue with Version Check below (single-session mode).
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Sub-Agent Return Format
|
|
218
|
+
|
|
219
|
+
*This section applies when running as a sub-agent (Gate Step 0 detected `_agent_mode: true`).*
|
|
220
|
+
|
|
221
|
+
After generating all `.feature` and `.tsv` files for the assigned UC, return the structured result JSON (as specified in `steps/spawn-agent.md` Step E):
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{ "uc_id": "{TICKET-ID}-UC{N}", "files_created": ["path/to/file1", "path/to/file2"], "status": "success | error", "errors": [] }
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Version Check
|
|
230
|
+
|
|
231
|
+
Before generating, check for existing `.feature` files for this PRD:
|
|
232
|
+
|
|
233
|
+
1. Resolve the search path based on mode:
|
|
234
|
+
- **Spec repo mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC*.feature`
|
|
235
|
+
- **Umbrella mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC*.feature` (or with `{active_service}/` if multi-service)
|
|
236
|
+
2. Read current PRD `| **Version** |` from metadata (e.g., `1.2`).
|
|
237
|
+
|
|
238
|
+
**If no existing feature files** → fresh generation, proceed normally. Use PRD version as `@trace.prd_version`.
|
|
239
|
+
|
|
240
|
+
**If existing feature files found**:
|
|
241
|
+
- Read `# @trace.prd_version:` from the existing feature file header.
|
|
242
|
+
- Compare with current PRD version.
|
|
243
|
+
- If **same** → ask: "BDD already generated from PRD v{version}. Regenerate? (Y/N)"
|
|
244
|
+
- If **different** (PRD was updated):
|
|
245
|
+
1. Read `## Changelog` from the PRD — extract all rows newer than the existing BDD's `@trace.prd_version`.
|
|
246
|
+
2. Show CHECKPOINT:
|
|
247
|
+
```
|
|
248
|
+
⚠️ PRD version drift detected
|
|
249
|
+
BDD was generated from PRD v{old}
|
|
250
|
+
PRD is now at v{new}
|
|
251
|
+
|
|
252
|
+
Changes since v{old}:
|
|
253
|
+
{changelog rows}
|
|
254
|
+
|
|
255
|
+
Options:
|
|
256
|
+
Y — update only affected scenarios
|
|
257
|
+
F — full regeneration of all scenarios
|
|
258
|
+
N — cancel
|
|
259
|
+
```
|
|
260
|
+
3. Proceed based on user choice.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## BDD Writing Rules (R1-R10 — enforce strictly)
|
|
265
|
+
|
|
266
|
+
| Rule | Name | Requirement |
|
|
267
|
+
|------|------|-------------|
|
|
268
|
+
| R1 | Given/When/Then Semantics | Given=state, When=action, Then=outcome. Every SC needs full G/W/T. |
|
|
269
|
+
| R2 | One Behavior Per Scenario | 1 SC = 1 behavior. Do NOT chain When→Then→When→Then. |
|
|
270
|
+
| R3 | Ubiquitous Language | Do NOT use UI selectors / API names / tech terms in steps. |
|
|
271
|
+
| R4 | Outside-in Naming | SC name describes business outcome. No "click" / "(Case X)" / component names. |
|
|
272
|
+
| R5 | Declarative over Imperative | Describe WHAT (business intent), NOT HOW (UI mechanic). |
|
|
273
|
+
| R6 | Observable Outcomes Only | Then asserts observable outcome. Not UI intermediate state / internal state. |
|
|
274
|
+
| R7 | Key Examples / Concrete | Use concrete values. Not vague "valid data". |
|
|
275
|
+
| R8 | Independence | SC runs independently. Does not depend on state from another SC. |
|
|
276
|
+
| R9 | Test Data Completeness | Data table has enough fields to derive expected Then. |
|
|
277
|
+
| R10 | Scope Boundary Explicit | Cross-UC reference uses navigation wording + Note comment. |
|
|
278
|
+
|
|
279
|
+
## Project Compliance (fail review if missing — C.1-C.5)
|
|
280
|
+
|
|
281
|
+
| Check | Rule |
|
|
282
|
+
|-------|------|
|
|
283
|
+
| C.1 Wireframe Coverage | Every component/action in Wireframe has ≥1 SC. |
|
|
284
|
+
| C.2 PRD Traceability | Every AC and every BR (including each logic bullet) maps to ≥1 SC. |
|
|
285
|
+
| C.3 Business Dictionary | Use correct canonical terms from business-dictionary.md. |
|
|
286
|
+
| C.4 Banned Terms | 0 banned terms in file — grep before generating. |
|
|
287
|
+
| C.5 NHÓM Grouping | Feature ≥3 SCs → MUST have NHÓM grouping by business theme. |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## NHÓM Grouping Convention (C.5 — mandatory for ≥3 scenarios)
|
|
292
|
+
|
|
293
|
+
Group by business theme, NOT by happy/negative/edge.
|
|
294
|
+
|
|
295
|
+
Format header (indent 2 spaces, same level as Background):
|
|
296
|
+
```
|
|
297
|
+
# ==========================================================
|
|
298
|
+
# NHÓM N: <Business theme> (<BR refs if applicable>)
|
|
299
|
+
# ==========================================================
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Rules:
|
|
303
|
+
- Number sequentially NHÓM 1 → N. SC IDs sequential across lifecycle (do not reset per NHÓM).
|
|
304
|
+
- Each NHÓM can contain @happy + @edge + @negative of the same theme.
|
|
305
|
+
- SCs in NHÓM do not need to be in ID order (NHÓM 2 can contain SC4, SC8, SC11 if same theme).
|
|
306
|
+
|
|
307
|
+
Suggested patterns (adjust per UC):
|
|
308
|
+
- `Init / Save success — valid data combinations`
|
|
309
|
+
- `Validation / Block when invalid`
|
|
310
|
+
- `Error handling — API fail / system error`
|
|
311
|
+
- `Cancel changes / Close modal without saving`
|
|
312
|
+
- `Cross-system / Downstream effects`
|
|
313
|
+
- `Idempotency & Concurrency`
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## UC Decomposition
|
|
318
|
+
|
|
319
|
+
For each UC in the PRD, present the SC outline **before generating**:
|
|
320
|
+
```
|
|
321
|
+
{TICKET-ID}-UC1: {Use Case Name}
|
|
322
|
+
NHÓM 1: {Theme} (BR1, BR2)
|
|
323
|
+
SC1 [@happy]: {business outcome}
|
|
324
|
+
SC2 [@happy @alternative]: {variant outcome}
|
|
325
|
+
NHÓM 2: {Theme} (BR2, BR3)
|
|
326
|
+
SC3 [@edge]: {edge case}
|
|
327
|
+
SC4 [@negative]: {error handling}
|
|
328
|
+
ACs covered: AC1, AC2
|
|
329
|
+
BRs covered: {TICKET-ID}-UC1-BR1, BR2, BR3
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
CHECKPOINT: "Does this outline look correct? Do you want to add or remove any SCs?" → **Wait for confirm before generating.**
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Generate
|
|
337
|
+
|
|
338
|
+
**Output path by mode:**
|
|
339
|
+
- **Spec repo mode**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
340
|
+
- **Umbrella mode (single-service)**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
341
|
+
- **Umbrella mode (multi-service)**: `{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_service}/{TICKET-ID}-UC{N}-{slug}.feature`
|
|
342
|
+
|
|
343
|
+
For each UC, write to the resolved path above. Use vocabulary for the active platform (from Platform Selection or Service Detection).
|
|
344
|
+
|
|
345
|
+
```gherkin
|
|
346
|
+
# ============================================================
|
|
347
|
+
# @trace.id: {TICKET-ID}-UC{N}
|
|
348
|
+
# @trace.title: <Feature name>
|
|
349
|
+
# @trace.revision: 1 ← static field; use @trace.bdd_version for version tracking (incremented by /review-context --fix or --resume)
|
|
350
|
+
# @trace.domain: <domain>
|
|
351
|
+
# @trace.platform: {active_platform — web | app | system | (omit in umbrella mode)}
|
|
352
|
+
# @trace.service: {active_service — omit in spec repo mode}
|
|
353
|
+
# @trace.module: {active_module in umbrella mode; "unknown" in spec repo mode}
|
|
354
|
+
# @trace.status: draft
|
|
355
|
+
# @trace.author: AI-generated
|
|
356
|
+
# @trace.created_at: {YYYY-MM-DD}
|
|
357
|
+
# @trace.prd: {TICKET-ID}
|
|
358
|
+
# @trace.prd_version: {read from PRD metadata "| **Version** |"}
|
|
359
|
+
# @trace.bdd_version: {1.0 if fresh generation; increment by 0.1 on re-generation — e.g. 1.0 → 1.1}
|
|
360
|
+
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1, {TICKET-ID}-UC{N}-BR2
|
|
361
|
+
# @trace.dataset: {domain}.testdata.yaml
|
|
362
|
+
# ============================================================
|
|
363
|
+
|
|
364
|
+
# === CONTEXT ===
|
|
365
|
+
# Actor: <role performing the action, e.g., Consumer, Staff, System>
|
|
366
|
+
# Screens: <related screens, e.g., Cart → Confirm Order → Order Detail>
|
|
367
|
+
# Entities: <business entities, e.g., Order, OrderItem, Consumer>
|
|
368
|
+
# Pre-state: <shared state before entering scenarios>
|
|
369
|
+
|
|
370
|
+
# === SCOPE ===
|
|
371
|
+
# In: <what this UC covers>
|
|
372
|
+
# Out: <what is NOT in this UC — link to other UC/feature (R10)>
|
|
373
|
+
|
|
374
|
+
# === BUSINESS DEFINITION ===
|
|
375
|
+
# Quick reference for terms used in this feature. SoT details: business-dictionary.md
|
|
376
|
+
# <Term 1>: <short definition>
|
|
377
|
+
# <Term 2>: <short definition>
|
|
378
|
+
|
|
379
|
+
Feature: <Feature name>
|
|
380
|
+
As a <role>
|
|
381
|
+
I want to <action>
|
|
382
|
+
So that <business value>
|
|
383
|
+
|
|
384
|
+
Background:
|
|
385
|
+
Given <shared precondition — use aliases from dataset, not technical IDs>
|
|
386
|
+
|
|
387
|
+
# ==========================================================
|
|
388
|
+
# NHÓM 1: <Business theme> (<BR refs>)
|
|
389
|
+
# ==========================================================
|
|
390
|
+
|
|
391
|
+
# Side-effects: <list brief Then side-effects to verify>
|
|
392
|
+
# @trace.scenario: {TICKET-ID}-UC{N}-SC1
|
|
393
|
+
# @trace.sc_version: 1.0
|
|
394
|
+
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1
|
|
395
|
+
@happy
|
|
396
|
+
Scenario: <describe business outcome — use precise verb: create/receive/assign/block>
|
|
397
|
+
Given <input state — alias from dataset>
|
|
398
|
+
When <single action>
|
|
399
|
+
Then <main observable outcome>
|
|
400
|
+
And <side-effect 1 declared in header>
|
|
401
|
+
|
|
402
|
+
# Side-effects: <...>
|
|
403
|
+
# @trace.scenario: {TICKET-ID}-UC{N}-SC2
|
|
404
|
+
# @trace.sc_version: 1.0
|
|
405
|
+
# @trace.business_rules: {TICKET-ID}-UC{N}-BR1
|
|
406
|
+
@happy @alternative
|
|
407
|
+
Scenario: <same NHÓM 1 theme but different path — e.g., different enum value>
|
|
408
|
+
Given <state>
|
|
409
|
+
When <action>
|
|
410
|
+
Then <outcome>
|
|
411
|
+
|
|
412
|
+
# ==========================================================
|
|
413
|
+
# NHÓM 2: <Business theme 2> (<BR refs>)
|
|
414
|
+
# ==========================================================
|
|
415
|
+
|
|
416
|
+
# Side-effects: <...>
|
|
417
|
+
# @trace.scenario: {TICKET-ID}-UC{N}-SC3
|
|
418
|
+
# @trace.sc_version: 1.0
|
|
419
|
+
# @trace.business_rules: {TICKET-ID}-UC{N}-BR2
|
|
420
|
+
@edge
|
|
421
|
+
Scenario: <boundary / error scenario>
|
|
422
|
+
Given <state>
|
|
423
|
+
When <action>
|
|
424
|
+
Then <expected error handling>
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Coverage Matrix & Pre-merge Checklist *(appended to end of each file)*
|
|
428
|
+
|
|
429
|
+
```gherkin
|
|
430
|
+
# === PRD COVERAGE (C.1 + C.2) ===
|
|
431
|
+
# AC mapping:
|
|
432
|
+
# AC1 (...) → SC1, SC2
|
|
433
|
+
# AC2 (...) → SC3
|
|
434
|
+
# BR mapping (each bullet MUST have ≥1 SC — C.2):
|
|
435
|
+
# {TICKET-ID}-UC{N}-BR1 (...) → SC1, SC2
|
|
436
|
+
# {TICKET-ID}-UC{N}-BR2 (...) → SC3
|
|
437
|
+
# Wireframe mapping (every component/action ≥1 SC — C.1):
|
|
438
|
+
# Screen "<screen name>":
|
|
439
|
+
# [x] <action 1> → SC1
|
|
440
|
+
# [x] <action 2> → SC2
|
|
441
|
+
# [ ] <action 3> → MISSING ← BLOCK MERGE
|
|
442
|
+
|
|
443
|
+
# === PRE-MERGE CHECKLIST ===
|
|
444
|
+
# - [ ] Every SC has Side-effects + @trace.scenario + @trace.sc_version + @trace.business_rules
|
|
445
|
+
# - [ ] Coverage Matrix: 0 MISSING lines (C.1)
|
|
446
|
+
# - [ ] Every AC/BR maps to ≥1 SC (C.2)
|
|
447
|
+
# - [ ] 0 banned terms (C.4) — grep file before merging
|
|
448
|
+
# - [ ] Feature ≥3 SCs has NHÓM grouping by business theme (C.5)
|
|
449
|
+
# - [ ] If popup/modal: Popup/Modal Lifecycle declared in BUSINESS DEFINITION
|
|
450
|
+
# - [ ] If display logic ≥2 dimensions: Display Logic Matrix in BUSINESS DEFINITION
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Write Trace State
|
|
456
|
+
|
|
457
|
+
After generating all `.feature` files, create or update `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}.tsv` for each UC.
|
|
458
|
+
|
|
459
|
+
> **Umbrella + `spec_source`:** both the `.feature` files **and** the trace `.tsv` write to the **spec repo** (`{spec_source}/specs/{domain}/{prd-slug}/bdd/…` and `{spec_source}/.trace/{domain}/{prd-slug}/…`, resolved by context-loader) — a **single-repo** write, committed/pushed to the spec submodule. (Trace is consolidated in the spec repo so the PM manages all status in one place; code-side commands update it cross-repo later.)
|
|
460
|
+
|
|
461
|
+
**TSV columns (tab-separated, one header row + one data row per scenario):**
|
|
462
|
+
```
|
|
463
|
+
sc_id\tsc_title\tspec_ver\tgen_ver\timplemented_by\ttest_count\ttest_classes\tdev_selftest\tdev_selftest_at\tqc_status\tqc_run_at\tqc_owner\tqc_blocked_by\tprd_version\tbdd_version\ttech_doc_revision\tfe_tech_doc_revision\tprd_status\tuc_status\tfe_phase\tstatus\tlast_updated
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
**Rules:**
|
|
467
|
+
- If file does not exist → create with header row + all scenario rows.
|
|
468
|
+
- If file exists (re-generation) → for each SC in the new `.feature`:
|
|
469
|
+
- SC already in `.tsv` AND `spec_ver` is unchanged → update only: `sc_title`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated`. Leave all other columns unchanged.
|
|
470
|
+
- SC already in `.tsv` AND `spec_ver` changed (scenario was modified) → update: `sc_title`, `spec_ver`, `prd_version`, `bdd_version`, `prd_status`, `uc_status`, `last_updated` AND set `status = DRIFT` immediately (so the TSV reflects drift without waiting for `/validate-traces`). Leave `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `tech_doc_revision`, `fe_tech_doc_revision` unchanged.
|
|
471
|
+
- SC is new (added in this re-gen) → append new row with `gen_ver`, `implemented_by`, `test_count`, `test_classes`, `dev_selftest`, `dev_selftest_at`, `qc_status`, `qc_run_at`, `qc_owner`, `qc_blocked_by`, `tech_doc_revision`, `fe_tech_doc_revision` all set to `—`.
|
|
472
|
+
- SC no longer in `.feature` (removed) → delete its row.
|
|
473
|
+
|
|
474
|
+
**Values to write for each scenario:**
|
|
475
|
+
|
|
476
|
+
| Column | Value |
|
|
477
|
+
|--------|-------|
|
|
478
|
+
| `sc_id` | `{UC-ID}-SC{N}` |
|
|
479
|
+
| `sc_title` | scenario title text |
|
|
480
|
+
| `spec_ver` | `@trace.sc_version` of this scenario |
|
|
481
|
+
| `gen_ver` | `—` (not yet generated) |
|
|
482
|
+
| `implemented_by` | `—` |
|
|
483
|
+
| `test_count` | `—` |
|
|
484
|
+
| `test_classes` | `—` |
|
|
485
|
+
| `dev_selftest` | `—` (no tests run yet) |
|
|
486
|
+
| `dev_selftest_at` | `—` |
|
|
487
|
+
| `qc_status` | `—` (official QC automation result — set by `/qc-run-test`) |
|
|
488
|
+
| `qc_run_at` | `—` |
|
|
489
|
+
| `qc_owner` | `—` (who a non-passing SC waits on: `dev` / `po` — set by `/qc-run-test` + `/report-bug`) |
|
|
490
|
+
| `qc_blocked_by` | `—` (linked `BUG-{id}` / `GAP-{id}` — set by `/qc-run-test` + `/report-bug`) |
|
|
491
|
+
| `prd_version` | `@trace.prd_version` from `.feature` header |
|
|
492
|
+
| `bdd_version` | `@trace.bdd_version` from `.feature` header |
|
|
493
|
+
| `tech_doc_revision` | `—` (BE API contract revision — set by `/generate-code` + `/review-tech-docs`) |
|
|
494
|
+
| `fe_tech_doc_revision` | `—` (FE client tech-design revision `{UC-ID}-tech-design-{platform}.md` — set by `/generate-code --phase=integration` + `/review-tech-docs` on an FE doc) |
|
|
495
|
+
| `prd_status` | read `\| **Status** \|` from PRD metadata |
|
|
496
|
+
| `uc_status` | `draft` for new UCs; keep existing value for re-gen |
|
|
497
|
+
| `fe_phase` | `—` (set by `/generate-code --phase` when FE implements) |
|
|
498
|
+
| `status` | `UNTRACKED` |
|
|
499
|
+
| `last_updated` | today `YYYY-MM-DD` |
|
|
500
|
+
|
|
501
|
+
## Refresh Panel Mirror
|
|
502
|
+
{{include:steps/trace-mirror.md}}
|
|
503
|
+
|
|
504
|
+
## Output
|
|
505
|
+
|
|
506
|
+
{{include:steps/report-footer.md}}
|
|
507
|
+
|
|
508
|
+
```
|
|
509
|
+
/generate-bdd Complete
|
|
510
|
+
|
|
511
|
+
[Spec repo mode — platform: {active_platform}]
|
|
512
|
+
Files:
|
|
513
|
+
{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC1-{slug}.feature ({N} scenarios)
|
|
514
|
+
{paths.specs_dir}/{domain}/{prd-slug}/bdd/{active_platform}/{TICKET-ID}-UC2-{slug}.feature ({N} scenarios)
|
|
515
|
+
Trace:
|
|
516
|
+
{paths.trace_dir}/{domain}/{prd-slug}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
517
|
+
{paths.trace_dir}/{domain}/{prd-slug}/{TICKET-ID}-UC2.tsv ({N} rows)
|
|
518
|
+
Next (spec repo):
|
|
519
|
+
→ Run /generate-bdd again for other platforms (web → app → system)
|
|
520
|
+
→ After all platforms generated: commit + push + notify dev team
|
|
521
|
+
→ Dev team reads BDD from spec submodule — no /generate-bdd on their side
|
|
522
|
+
|
|
523
|
+
[Umbrella mode — service: {active_service}]
|
|
524
|
+
Files:
|
|
525
|
+
{paths.specs_dir}/{domain}/{prd-slug}/bdd/{TICKET-ID}-UC1-{slug}.feature ({N} scenarios)
|
|
526
|
+
Trace:
|
|
527
|
+
{paths.trace_dir}/{domain}/{prd-slug}/{TICKET-ID}-UC1.tsv ({N} rows)
|
|
528
|
+
Next (umbrella):
|
|
529
|
+
→ /review-context {feature-file} to verify coverage
|
|
530
|
+
→ /generate-tech-docs {feature-file}
|
|
531
|
+
→ /generate-code {feature-file}
|
|
532
|
+
|
|
533
|
+
📊 Living Docs: run /validate-traces (or /sync) to push this trace to the spec-module dashboard.
|
|
534
|
+
```
|