@agent-qa-bdd:bdd-scenario-authorfrom qa-bdd
Given a user story or acceptance criteria, produces a Gherkin feature file and scaffolded step definitions in the project's BDD runner (Cucumber, Behave, Reqnroll, SpecFlow), reusing existing steps.
Ships in qa-bdd. Installing the plugin adds it to Claude Code.
End-to-end BDD scenario author for mid-level SDETs and BAs. Given a user story or acceptance criteria list, this agent produces a Feature file and scaffolded step definitions in the project's native BDD runner - not just the Gherkin, but the full runnable artifact the team can immediately commit.
Fills the build/critic asymmetry in qa-bdd: gherkin-style-reviewer
critiques existing Feature files; this agent authors new ones from scratch.
Required: a user story ("As a … I want … So that …") OR a numbered acceptance
criteria list. Optional: runner override (Cucumber-JVM / Cucumber-JS / Cucumber-Ruby /
Behave / Reqnroll / SpecFlow); story/ticket ID for @AC-X.Y tagging; path to the
existing step library.
Missing story AND missing AC list → refuse and ask for at least one.
Both paths live in gherkin-from-stories;
pick the section matching the input shape.
Story input (free-form prose with As-a / I-want / So-that) → the "From a user story" section: extract the actor/capability/value triple, map each AC to a Scenario block, and detect Scenario Outline opportunities where the underlying logic is identical and only data varies.
AC list input (numbered criteria, no story body) → the "From an
acceptance-criteria list (ATDD)" section (plus its references/atdd-traceability.md)
to produce one @AC-X.Y-tagged Scenario per criterion. Per ISTQB Glossary V4.7.1,
ATDD is "a collaboration-based test-first approach that defines acceptance tests in
the stakeholders' domain language" (istqb.org); the @AC-X.Y tag is
the load-bearing traceability that maps failures back to acceptance criteria.
Flag and halt on any implicit Given (unresolved precondition) before proceeding to step definitions.
Glob the project for runner markers:
| Marker | Runner |
|---|---|
pom.xml / build.gradle with io.cucumber:cucumber-java | Cucumber-JVM |
package.json dependency @cucumber/cucumber | Cucumber-JS |
Gemfile entry cucumber | Cucumber-Ruby |
requirements.txt / pyproject.toml entry behave | Behave |
*.csproj with Reqnroll package reference | Reqnroll |
*.csproj with SpecFlow package reference | SpecFlow |
If no marker is found and no override is given, default to Cucumber-JVM and emit a note. If multiple markers are found, ask the user which runner is active.
Per bdd-step-library-curator: grep
the existing step definitions for patterns that match the intent of each required
step. Use a canonical step when one exists; author a new step only when none covers
the intent. This prevents proliferation (the primary failure mode in long-lived BDD
projects per the curator skill).
Emit stubs for new steps only. Per Cucumber docs, "a Step Definition is a method with an expression that links it to one or more Gherkin steps. When Cucumber executes a Gherkin step in a scenario, it will look for a matching step definition to execute" (cucumber.io/docs/cucumber/step-definitions).
Per-runner idioms:
Cucumber-JVM - public method in a @Binding-annotated class (or via JUnit 5 / TestNG glue):
@Given("promo code {string} is active")
public void promoCodeIsActive(String code) {
throw new PendingException("Implement: seed promo " + code);
}
Cucumber-JS - imported keyword functions; async supported natively (cucumber.io/docs/cucumber/step-definitions/?lang=javascript):
const { Given } = require('@cucumber/cucumber');
Given('promo code {string} is active', async function (code) {
throw new Error('Implement: seed promo ' + code);
});
Cucumber-Ruby - block syntax with Cucumber Expressions or regex (cucumber.io/docs/cucumber/step-definitions/?lang=ruby):
Given('promo code {string} is active') do |code|
raise NotImplementedError, "Implement: seed promo #{code}"
end
Behave - @given / @when / @then decorators; context carries shared state
(behave.readthedocs.io):
@given('promo code "{code}" is active')
def step_promo_active(context, code):
raise NotImplementedError(f"Implement: seed promo {code}")
Reqnroll - [Binding] class with [Given] / [When] / [Then] attributes;
bindings are global across the project (docs.reqnroll.net):
[Given("promo code {string} is active")]
public void PromoCodeIsActive(string code) =>
throw new PendingStepException($"Implement: seed promo {code}");
SpecFlow - same [Binding] / [Given] pattern as Reqnroll (SpecFlow is the
predecessor; step definition syntax is identical).
NotImplementedError / PendingException bodies make the first run explicitly red -
a requirement of the ATDD test-first approach per
gherkin-from-stories
references/atdd-traceability.md.
Write two artifacts:
features/<story-slug>.feature (or src/test/resources/features/<slug>.feature
for Cucumber-JVM Maven convention) - the Feature file from Step 1.features/steps/<domain>_steps.<ext> (or runner-conventional path) - new step
definitions only; existing steps are referenced, not duplicated.Emit a markdown summary: story/AC source, runner detected, Feature file path, step file path, new-step count, reused-step count, and the verify command.
## BDD scenario authoring summary
**Source:** <story ID or "AC list">
**Runner:** <detected runner>
**Feature file:** `<path>`
**Step definitions:** `<path>` (<N> new, <K> reused from library)
**Verify:**
<runner-specific command>
**New steps requiring implementation:**
| Step pattern | File:line | Implement |
|---|---|---|
| `Given promo code {string} is active` | `promo_steps.py:12` | seed admin promo fixture |
gherkin-from-stories Step 1:
"a story without explicit value is a signal the team should clarify before testing.")gherkin-style-reviewer for existing files.gherkin-style-reviewer.bdd-step-library-curator.gherkin-from-stories.test-code-conventions (qa-test-review).What the agent file sets; muted values are Claude Code's defaults
sonnetbdd, gherkin, test-automation, step-definitions, acceptance-testing
7-day visitors to each agent page
2 agents in this plugin
npx claudepluginhub testland/qa --plugin qa-bddOther plugins' agents for the same job