Back to Skills

gherkin-authoring

verified

Gherkin acceptance criteria authoring. Use when writing Given/When/Then scenarios, feature files, or BDD-style specifications. Provides syntax reference, best practices, and Reqnroll integration guidance.

View on GitHub

Marketplace

melodic-software

melodic-software/claude-code-plugins

Plugin

spec-driven-development

Repository
Verified Org

melodic-software/claude-code-plugins
13stars

plugins/spec-driven-development/skills/gherkin-authoring/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/spec-driven-development/skills/gherkin-authoring/SKILL.md -a claude-code --skill gherkin-authoring

Installation paths:

Claude
.claude/skills/gherkin-authoring/
Powered by add-skill CLI

Instructions

# Gherkin Authoring

Gherkin/BDD acceptance criteria authoring for executable specifications.

## When to Use This Skill

**Keywords:** Gherkin, Given/When/Then, BDD, behavior-driven development, feature files, scenarios, acceptance criteria, Reqnroll, Cucumber, SpecFlow, executable specifications

**Use this skill when:**

- Writing acceptance criteria in Given/When/Then format
- Creating .feature files for BDD testing
- Converting requirements to executable specifications
- Setting up Reqnroll tests in .NET projects
- Understanding Gherkin syntax and best practices

## Quick Syntax Reference

### Feature File Structure

```gherkin
Feature: <Feature Name>
  <Feature description>

  Background:
    Given <common precondition>

  Scenario: <Scenario Name>
    Given <precondition>
    When <action>
    Then <expected outcome>

  Scenario Outline: <Parameterized Scenario>
    Given <precondition with <parameter>>
    When <action with <parameter>>
    Then <expected outcome with <parameter>>

    Examples:
      | parameter |
      | value1    |
      | value2    |
```

### Step Keywords

| Keyword | Purpose | Example |
| --- | --- | --- |
| `Given` | Setup preconditions | Given a user is logged in |
| `When` | Describe action | When the user clicks submit |
| `Then` | Assert outcome | Then the form is saved |
| `And` | Additional step (same type) | And an email is sent |
| `But` | Negative condition | But no error is shown |

## Writing Effective Scenarios

### The Three A's Pattern

Gherkin maps to the Arrange-Act-Assert pattern:

| Gherkin | AAA | Purpose |
| --- | --- | --- |
| Given | Arrange | Set up the test context |
| When | Act | Perform the action under test |
| Then | Assert | Verify the expected outcome |

### Single Behavior Per Scenario

**Good - One behavior:**

```gherkin
Scenario: User login with valid credentials
  Given a registered user exists
  When the user enters valid credentials
  Then the user is logged in
```

**Bad - Multiple behaviors:**

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
8598 chars