agentleFS
jdinklajdinkla/user-story-skills/skills/story-gherkin/SKILL.md

story-gherkin

Skill0 starsChanged 7 months agoMITView on GitHub

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".

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If none of the above, ask the user to paste the story or point to a file.

    line 17
  2. Distinctive:

    When: describe the action (present tense)

    line 47
  3. Distinctive:

    Use "And" to chain multiple steps of the same type

    line 49
  4. Distinctive:

    Keep it simple — one scenario = one behavior.

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.