From 47f261a45e7e4265e4ee99e73b842b6b7330bc75 Mon Sep 17 00:00:00 2001 From: Pablo Ontiveros Date: Thu, 16 Apr 2026 13:15:43 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20enforce=20BDD/E2E=20in=20dev-story=20?= =?UTF-8?q?=E2=80=94=20Gherkin=20gate=20+=20E2E=20required=20for=20UI=20fl?= =?UTF-8?q?ows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Step 1: add BDD/SDD/E2E pre-check gate; warns when TEA is installed but no ATDD checklist exists, and warns when checklist has no Gherkin scenarios - Step 5: red phase now identifies test type (unit vs E2E) before writing the failing test, so UI tasks explicitly require E2E red phase - Step 6: E2E tests required for all user-facing flows (removes the 'when story requirements demand them' opt-in conditional) - Step 9 DoD: same language fix — E2E mandatory for UI flows --- .../bmad-dev-story/workflow.md | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/bmm-skills/4-implementation/bmad-dev-story/workflow.md b/src/bmm-skills/4-implementation/bmad-dev-story/workflow.md index 4164479c3..f68aea667 100644 --- a/src/bmm-skills/4-implementation/bmad-dev-story/workflow.md +++ b/src/bmm-skills/4-implementation/bmad-dev-story/workflow.md @@ -157,6 +157,31 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + + + Search {test_artifacts} for an ATDD checklist matching pattern: `atdd-checklist-{{story_key}}*.md` or `*{{story_key}}*atdd*.md` + + ⚠️ **No ATDD checklist found for {{story_key}}** + +Missing before implementation: +- [ ] BDD: Gherkin scenarios covering Acceptance Criteria +- [ ] E2E: Failing test scaffold for user-facing flows (if applicable) +- [ ] SDD: API contract/spec for stories touching route files (if applicable) + +Recommended: run **bmad-testarch-atdd** first to scaffold acceptance tests. + Continue without ATDD checklist? [y] proceed anyway · [n] halt and run testarch-atdd first: + + HALT — run /bmad-testarch-atdd for {{story_key}} before continuing + + + + Scan checklist for Gherkin scenarios (lines starting with Given/When/Then or Feature:/Scenario:) + + ⚠️ **ATDD checklist exists but contains no Gherkin scenarios** — BDD coverage is missing for {{story_key}} + + + + Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status Load comprehensive context from story file's Dev Notes section @@ -267,7 +292,8 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: Plan implementation following red-green-refactor cycle - Write FAILING tests first for the task/subtask functionality + Identify test type for this task: unit test (business logic / API) or E2E test (user-facing screen / navigation flow) + Write FAILING test of the appropriate type first — unit test for logic, E2E test for UI flows Confirm tests fail before implementation - this validates test correctness @@ -294,7 +320,7 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: Create unit tests for business logic and core functionality introduced/changed by the task Add integration tests for component interactions specified in story requirements - Include end-to-end tests for critical user flows when story requirements demand them + Include end-to-end tests for all user-facing flows; unit tests are mandatory for all business logic and API routes Cover edge cases and error handling scenarios identified in story Dev Notes @@ -372,7 +398,7 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: - Implementation satisfies every Acceptance Criterion - Unit tests for core functionality added/updated - Integration tests for component interactions added when required - - End-to-end tests for critical flows added when story demands them + - End-to-end tests added for all user-facing flows (unit tests for logic/API routes) - All tests pass (no regressions, new tests successful) - Code quality checks pass (linting, static analysis if configured) - File List includes every new/modified/deleted file (relative paths)