# Story Gherkin

> Translate a user story into 2–5 Gherkin (Given/When/Then) BDD scenarios covering happy path, alternatives, edge cases, and error conditions. Use when the user asks for Gherkin / BDD scenarios, Cucumber steps, acceptance test scenarios, or "write this as Given/When/Then".

- Skill: `jdinkla/story-gherkin` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jdinkla/story-gherkin`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jdinkla/story-gherkin/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jdinkla (https://skillmd.com/u/jdinkla)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jdinkla/story-gherkin

---


# Gherkin Scenarios

Translate a user story into well-structured Gherkin (Given/When/Then) BDD scenarios.

## Input

Take the user story from whichever of these is available first:

1. Text passed as arguments to this skill or slash command.
2. A file reference like `@path/to/story.md` — read the file first.
3. The current editor selection or most recently referenced story in the conversation.
4. If none of the above, ask the user to paste the story or point to a file.

## Instructions

You are a behavior-driven development (BDD) expert specializing in Gherkin syntax.

**Gherkin Format:**
- **Feature** — high-level description of the feature
- **Scenario** — specific test case or example
  - **Given** — initial context / preconditions
  - **When** — action or event
  - **Then** — expected outcome
  - **And / But** — additional steps

**Guidelines:**

1. Create 2–5 scenarios covering:
   - Happy path (main success scenario)
   - Alternative paths (valid variations)
   - Edge cases (boundary conditions)
   - Error cases (what should NOT happen)

2. Each scenario should be:
   - Specific and testable
   - Written from user's perspective
   - Focused on behavior, not implementation
   - Clear and unambiguous

3. Step format:
   - Given: set up initial state (past tense)
   - When: describe the action (present tense)
   - Then: assert the outcome (present tense)
   - Use "And" to chain multiple steps of the same type

4. Be concrete — use specific examples with actual data values, not placeholders.

5. Keep it simple — one scenario = one behavior; plain language over technical jargon.

## Output format

Render as markdown in the chat. Use fenced code blocks (```gherkin) for the scenarios so they copy cleanly.

- **Feature Title** — short name for the feature
- **Feature Description** — 1–2 sentence explanation
- **Scenarios** — 2–5 scenarios with their Given/When/Then/And steps, each in a gherkin code block
- **Notes** — any important clarifications or assumptions

Example shape:

```gherkin
Feature: Password Reset
Description: Users can reset their password via email to regain account access.

Scenario: Successful password reset
  Given I am on the login page
  And I have forgotten my password
  When I click "Forgot Password"
  And I enter my email "user@example.com"
  And I click "Send Reset Link"
  Then I should see "Password reset email sent"
  And I should receive an email with a reset link
```

No JSON.

