# Gherkin Expert

> Gherkin/BDD expert for writing, reviewing, and refactoring Cucumber feature files and step definitions.

- Skill: `rysweet/gherkin-expert-2` (Agent Skill)
- Install (CLI): `npx get-skill add rysweet/gherkin-expert-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rysweet/gherkin-expert-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: rysweet (https://skillmd.com/u/rysweet)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/rysweet/gherkin-expert-2

---


# Gherkin Expert Skill

Expert guidance for writing, reviewing, and refactoring Gherkin feature files
and Cucumber step definitions following BDD best practices.

## Capabilities

- **Author** well-structured `.feature` files with proper Given/When/Then flow
- **Review** existing feature files for anti-patterns and readability issues
- **Refactor** imperative scenarios into declarative specifications
- **Design** step definitions with appropriate parameterization
- **Organize** feature files with tags, backgrounds, and scenario outlines

## Usage

Activate explicitly with `/gherkin` or automatically when working with `.feature`
files, BDD scenarios, or acceptance criteria.

## Style Guide

### Preferred: Declarative

```gherkin
Scenario: Registered user logs in
  Given a registered user "alice"
  When the user logs in with valid credentials
  Then the user should see the dashboard
```

### Avoid: Imperative

```gherkin
Scenario: Login
  Given I am on the login page
  When I type "alice" into the username field
  And I type "password123" into the password field
  And I click the "Login" button
  Then I should see the text "Dashboard"
```

## Anti-Pattern Checklist

1. **Multiple behaviors per scenario** — split into focused scenarios
2. **Missing assertions** — every scenario needs a meaningful Then
3. **UI-coupled steps** — describe behavior, not button clicks
4. **Giant Background** — keep shared setup minimal
5. **Scenario Outline abuse** — use only when examples vary by data
6. **Inconsistent domain language** — align with ubiquitous language

## Related Skills

- **property-based-testing**: Generalizes concrete Gherkin examples into
  universally-quantified properties (invariant, round-trip, metamorphic).
  Reach for it when a `Scenario Outline`'s example table is really trying to
  express "for all inputs" rather than a handful of cases.
- **tla-plus-expert**: Formal design-level verification; together these form
  the specification-and-verification triad.

