agentleFS
intent-driven-devintent-driven-dev/intent-driven-template/.agents/skills/gherkin-authoring/SKILL.md

gherkin-authoring

Skill185 starsChanged 32 days agoMITView on GitHub

Use when drafting, reviewing, or improving Gherkin, Cucumber scenarios, BDD acceptance criteria, feature examples, Scenario Outlines, Backgrounds, Rules, Doc Strings, Data Tables, tags, or Gherkin embedded in Markdown.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write Gherkin as executable examples of business behavior.

    line 10
  2. Distinctive:

    Keep scenarios concrete and short, usually 3-5 steps.

    line 22
  3. Distinctive:

    Use the language domain experts use.

    line 47
  4. Very specific:

    Use And and But to improve flow, not to hide new phases of the scenario.

    line 51
  5. Very specific:

    Avoid identical step text under different step keywords.

    line 52
  6. Distinctive:

    Use two-space indentation unless preserving existing style.

    line 53
  7. Very specific:

    Keep Background short and vivid.

    line 54
  8. Very specific:

    Use Scenario Outline only when examples share the same behavior and differ by data.

    line 55
  9. Distinctive:

    When Priya chooses a new password with the reset link Then she can sign in with the new password

    line 72
  10. Distinctive:

    When Priya tries to choose a new password with the reset link Then she is told the reset link has expired And her password is unchanged

    line 78

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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 Authoring

Overview

Write Gherkin as executable examples of business behavior. Optimize for domain language, concrete examples, and observable outcomes; keep implementation and UI mechanics inside step definitions.

Scope

Use this for standalone .feature files and Gherkin embedded in Markdown or other prose. When Gherkin is inside a Markdown wrapper, review or rewrite only the Gherkin section unless the user asks for broader document edits. Preserve fences, headings, and surrounding prose. If the input includes Markdown around the Gherkin, return the Markdown wrapper with only the Gherkin block changed.

Workflow

  1. Identify the Gherkin region: whole .feature file, fenced gherkin block, indented block, quoted acceptance criteria, or inline scenario text.
  2. Preserve the surrounding wrapper unless explicitly asked to change it. For Markdown input, return the heading/prose/fence context, not just the fenced Gherkin block.
  3. Clarify the behavior as examples: initial state, event, observable outcome.
  4. Choose the smallest structure that expresses the behavior: Feature, optional Rule, Background, Scenario/Example, or Scenario Outline with Examples.
  5. Keep scenarios concrete and short, usually 3-5 steps.
  6. Review syntax and readability before returning: colons, step keywords, duplicate step text, observable outcomes, and table/doc string formatting.

Quick Reference

ConstructUse forSyntax note
Feature:One high-level capability per feature document or blockRequires :
Rule:Group scenarios under one business ruleRequires :
Scenario: / Example:One concrete exampleRequires :
Background:Short shared context for following scenariosRequires :; one per Feature or Rule
Scenario Outline:Same behavior with varied dataRequires Examples: and <parameter> placeholders
Examples:Data rows for an outlineRequires : and a table
GivenKnown state or preconditionNo :
WhenEvent or actionNo :
ThenObservable outcomeNo :
And / ButContinue the previous step typeNo :
*Bullet-like step listUse sparingly for list-style setup
@tagGroup or filter features/scenariosPlace above the item tagged
#Line commentLine comments only; no block comments
"""Doc StringPassed as final step argument
``Data TablePassed as final step argument

Authoring Rules

  • Use the language domain experts use. Avoid translating business behavior into UI clicks, HTTP calls, database rows, queues, mocks, or implementation details.
  • Given puts the system in a known state. Avoid user interaction in Given steps.
  • When describes one meaningful event.
  • Then describes an outcome visible to a user or external system. Do not assert hidden database state unless that is the actual external contract.
  • Use And and But to improve flow, not to hide new phases of the scenario.
  • Avoid identical step text under different step keywords; Cucumber ignores Given/When/Then when matching step definitions.
  • Use two-space indentation unless preserving existing style.
  • Keep Background short and vivid. If it grows beyond about four lines, use higher-level steps or split by Rule/Feature.
  • Use Scenario Outline only when examples share the same behavior and differ by data.
  • Escape | as \|, newline as \n, and backslash as \\ inside Data Table cells.

Example

Markdown wrapper preserved; only the Gherkin block is authored:

## Acceptance Criteria

```gherkin
Feature: Password reset
  Rule: Reset links expire after their allowed lifetime

    Scenario: Customer resets their password before the link expires
      Given Priya has requested a password reset
      And the reset link is still valid
      When Priya chooses a new password with the reset link
      Then she can sign in with the new password

    Scenario: Customer uses an expired reset link
      Given Priya has requested a password reset
      And the reset link has expired
      When Priya tries to choose a new password with the reset link
      Then she is told the reset link has expired
      And her password is unchanged
```

Common Mistakes

MistakeFix
Complaining about Markdown around a Gherkin blockPreserve the wrapper and work only on the Gherkin section.
Returning only a fenced Gherkin block when the input was MarkdownReturn the original Markdown wrapper with only the Gherkin content changed.
Feature Checkout or Scenario: Place order:Add the missing colon after Feature; remove extra colon from the scenario title.
Given I click the checkout buttonMove interaction to When; describe state in Given.
Then an order row exists in the databasePrefer an observable result, such as an order confirmation.
Reusing the same step text for Given and ThenChange the wording so the domain meaning is distinct.
Long scripts with many UI actionsRaise the abstraction and keep the scenario to the behavior.
Large Background sectionsUse higher-level context or split scenarios by Rule or Feature.

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.