skills/bdd-formulation/SKILL.md
Use when writing new Gherkin scenarios, refining existing feature files, or reviewing scenarios for clarity - applies BRIEF principles and BDD best practices to craft scenarios that serve as living documentation
npx skillsauth add mattwynne/yaks bdd-formulationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Formulation is the craft of writing Gherkin that serves as living documentation. Good scenarios are concrete examples of business rules, not test scripts.
From Seb Rose — six principles for scenario quality:
| Principle | Ask yourself | Anti-pattern | |-----------|-------------|--------------| | Business language | Would a stakeholder understand this? | "refs/notes/yaks", "fast-forward merge" | | Real data | Are the values vivid and concrete? | "test yak", "yak-a", "user1" | | Intention revealing | Does it say what, not how? | Click-by-click UI steps | | Essential | Does every line serve the rule? | Setup for unrelated concerns | | Focused | One rule per scenario? | Scenario fails from unrelated changes | | Brief | Five lines or fewer? | Stakeholders skip long scenarios |
From Liz Keogh:
The Rule keyword states a crisp business rule. Examples illustrate it with specific instances.
# BAD: Rule describes mechanism
Rule: Pulling yaks from origin
# GOOD: Rule states business rule
Rule: After syncing, all users have the same yaks
If the Example heading reads more like a rule than the Rule does, promote it.
Review each scenario against these questions:
Is the Rule a crisp business rule? Not a mechanism, not vague. "Pushing to origin" is a mechanism. "Syncing stores yaks on the remote" is a rule.
Does the Example name add information beyond the Rule? Don't restate the rule. Name the specific instance.
Is the data real and vivid, with a consistent narrative? Pick one concrete story and carry it through the whole feature. Reuse the same entities across scenarios so the feature reads like a coherent narrative, not a collection of isolated test cases. Introduce new entities only when the rule demands it.
# BAD: Each scenario invents unrelated data
"test yak"... "deploy pipeline"... "security audit"...
# GOOD: One story runs through the feature
"make the tea"... "buy biscuits"... "wash the cups"...
Is every line essential? Remove setup that doesn't serve the rule. Collapse round-trips where possible (set state before syncing, not in a separate sync cycle).
One rule per scenario? If an example tests two rules, split it. If multiple examples under one rule test the same thing, merge them.
Are cross-cutting concerns inline? Output/logging assertions belong as additional Then steps on existing scenarios, not as separate rules.
Does the docstring show exact output? When asserting on output, use a docstring with precise expected text. Loose "should include" checks are vague.
When reviewing an existing feature file:
| Mistake | Fix | |---------|-----| | Rule describes mechanism | State the business rule | | Test labels as data | Use vivid, consistent narrative | | Each scenario uses unrelated data | Carry one story through the whole feature | | Example name restates rule | Name the specific instance | | Multiple rules under one Rule | Break into focused rules | | One broad rule, many examples | Does each example illustrate a different rule? | | Separate rule for logging | Add assertions to existing scenarios | | Unnecessary round-trips in setup | Collapse steps where possible |
testing
Use when writing or reviewing Gherkin features, especially after discovering examples or edge cases that reveal a new business rule
databases
Use when running yx commands that create, modify, or delete yaks outside of real project work — provides an isolated temp environment
documentation
Use when starting work on a yak - sets up an isolated git worktree, reads yak context, and guides the full cycle from claiming through merge and cleanup
development
Use when planning work by approaching goals and discovering blockers, before creating comprehensive plans