Build-an-X workflow that converts user stories into Gherkin scenarios - extracts the actor / capability / value triple from "As a … I want … so that …", maps acceptance criteria to Scenario blocks, identifies parameterizable axes for Scenario Outlines, and emits a Feature file ready for `bdd-step-library-curator`-curated step definitions. Starts from the story itself rather than from an already-extracted acceptance-criteria list; this skill operates at the user-story layer and produces Gherkin directly. Emits Gherkin only: no step definition stubs and no runner detection. For a full runnable artifact (Feature file plus scaffolded step definitions), follow this skill with step-definition scaffolding for the detected runner. Use when a PM hands over a user story or a backlog of stories and the team's first test artifact is the `.feature` file rather than a separate AC doc.
77
97%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
The shift-left flow:
User story → Acceptance Criteria → Gherkin Feature → Step definitions → Testsacceptance-criteria-extractor (in the qa-shift-left plugin)
covers the AC layer (it can emit Gherkin too). This skill is a
direct user-story → Gherkin path for teams that author
Gherkin features as the primary artifact (skipping the
intermediate AC step).
.feature file.If the team uses AC docs as primary, use
acceptance-criteria-extractor (in the qa-shift-left plugin);
this skill is the user-story-first variant.
# Story: Apply promo code at checkout
**As a** logged-in customer
**I want** to apply a promotional code at checkout
**So that** I receive the advertised discount on my orderThe triple maps to the Feature header:
Feature: Apply promo code at checkout
As a logged-in customer
I want to apply a promotional code at checkout
So that I receive the advertised discount on my orderIf the story doesn't have the triple, flag and ask - a story without explicit value is a signal the team should clarify before testing.
The story body usually has a list:
## Acceptance criteria
- Valid promo applies the discount and shows confirmation.
- Expired promo shows an error message.
- Invalid promo shows "Code not found."
- Empty input shows "Please enter a code."
- Already-applied promo shows "Already applied."Each AC becomes a Scenario:
Background:
Given I am a logged-in customer
And my cart contains 1 item at $24.99
Scenario: Apply valid promo
Given promo code "WELCOME10" is active
When I enter "WELCOME10" in the promo input
And I click "Apply"
Then the subtotal updates to $22.49
And a confirmation toast appears: "Code applied"
Scenario: Apply expired promo
Given promo code "EXPIRED50" is inactive
When I enter "EXPIRED50" in the promo input
And I click "Apply"
Then an error appears: "This code has expired"Multiple ACs that vary only in input data become a Scenario Outline:
Scenario Outline: Promo validation rejects bad input
When I enter "<code>" in the promo input
And I click "Apply"
Then an error appears: "<error>"
Examples:
| code | error |
| EXPIRED50 | This code has expired |
| NOTREAL | Code not found |
| (empty) | Please enter a code |
| WELCOME10*2 | Already applied |Per acceptance-criteria-extractor (in the qa-shift-left plugin)
Step 2: "Use Scenario Outline whenever the underlying logic is
identical and only the data varies."
Per
bdd-step-library-curator,
the team has a curated step library. Use existing steps where
possible:
# Use existing step:
Given I am a logged-in customer
# vs (avoid):
Given I have authenticated to the system # NEW STEP - duplicates "I am a logged-in customer"Before authoring a new step, search the library README.
Stories often imply preconditions:
## Story
A customer can apply a promo code.Implicit:
/checkout?
/cart?).Flag instead of guess:
## ⚠ Implicit Given flags (3)
1. Where does the user enter the promo? `/checkout`? `/cart`?
2. What's the cart state? Empty? Multi-item?
3. Authentication required? Guest checkout supported?
The Gherkin Feature can't be authored without these answers.Same flag-and-ask pattern as
acceptance-criteria-extractor (in the qa-shift-left plugin)
Step 6.
The output should pass these style checks:
## Gherkin scenarios for `<story>`
**Source story:** `LIN-1234` (Apply promo code at checkout)
**Implicit-precondition flags:** N
**Scenarios produced:** M
**Step library reuse:** K of M scenarios use existing steps only.
### Generated Feature
(per Step 2-3)
### Implicit-precondition flags
(per Step 5)
### New steps required
| Step | Why new |
|-----------------------------------------------|---------|
| `Given promo code {code} is active` | New domain (admin promo state) |
| `When I enter {code} in the promo input` | New element (promo input field) |
### Recommended next step
After PM clarifies the implicit Givens (per flags above), author
the new step definitions per
`bdd-step-library-curator`
conventions. Pair with the framework's runner per the team's stack
(`cucumber-testing` / `behave-testing` / `reqnroll-testing`).| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Fabricating implicit Givens | Tests pass for the wrong reason; PM never confirmed. | Flag-and-ask (Step 5). |
| One Scenario per AC even when they should be Outline | Test code duplication. | Detect outline opportunities (Step 3). |
| Not consulting the step library | Step proliferation; library bloats. | Search library first (Step 4). |
| Imperative steps ("click button #foo") | Couples to UI; defeats BDD's value. | Declarative ("I apply a promo") (Step 6). |
| Skipping the As-a / I-want / So-that header | Loses the value framing. | Triple at the Feature top (Step 1). |
acceptance-criteria-extractor (in the qa-shift-left plugin) - sibling: AC-first variant.bdd-step-library-curator - step library this skill draws from.acceptance-test-from-criteria - sibling: ATDD-flavored variant.