Write BDD scenarios in Gherkin. Trigger: acceptance criteria, Given/When/Then, feature files, test scenarios.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
A Gherkin scenario is a contract between someone who wants a behaviour and someone who verifies it. It is written in the language of the domain, not of the UI or the code, so it survives a redesign of both.
Feature: <the capability, from the user's point of view>
Background:
Given <state every scenario below depends on>
Scenario: <the behaviour being verified>
Given <the starting state>
When <the single action>
Then <the observable outcome>
And <a further assertion on that same outcome>One When per scenario. A second When means a second scenario.
Use Scenario Outline when the same behaviour varies only by data:
Scenario Outline: Rejected amounts are refused with a reason
Given an account with balance <balance>
When the customer withdraws <amount>
Then the withdrawal is refused with "<reason>"
Examples:
| balance | amount | reason |
| 100 | 150 | insufficient funds |
| 100 | 0 | amount must be > 0 |
| 100 | -50 | amount must be > 0 |Examples rows that assert different behaviours do not belong in one Outline — split them.
When the customer submits the order — never When I click "#submit-btn". Imperative steps break on every UI change and hide what is actually being tested.Then is observable. A tester or an assertion must be able to see it. Then it works correctly is a hope, not an outcome.Background; shared state is a bug.Given is state, not action. Given the customer has an active subscription — not Given the customer signs up and pays. If the setup reads like a scenario, it is one.Scenario: Expired card is declined at checkout, never Scenario: Test payment 2.| Smell | Why it hurts | Fix |
|---|---|---|
| Click-by-click steps | Rewritten on every UI change | Raise to the domain action |
Then the API returns 200 | Asserts plumbing, not behaviour | Assert what the user gets |
| Scenario 2 depends on scenario 1 | Random order breaks it; one failure cascades | Independent Given per scenario |
| Outline with 20 rows | Nobody reads it; failures are unattributable | Keep the boundary cases, drop the rest |
Conjunctions in one step (When A and B) | Two behaviours, one failure signal | Split the scenario |
Work from the list of use cases and edge cases, not from intuition: every case gets at least one scenario, and coverage is checked against that list. A case with no scenario is a gap to report, not a case to silently drop.
Done when every case maps to at least one scenario, each scenario has exactly one When and an observable Then, and no scenario depends on another.
YoizenSA/dev-ai-workflow
36f5af5
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.