Use when formalizing acceptance criteria from a use case into executable Gherkin scenarios. Generates a .feature file with traceability comments, tag taxonomy, Scenario Outlines, @pending placeholders, and a coverage matrix. Pairs with gen-use-case (upstream) and gen-test-class (downstream). Also in
Install
mkdir -p .claude/skills/gen-gherkin-feature && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15133" && unzip -o skill.zip -d .claude/skills/gen-gherkin-feature && rm skill.zipInstalls to .claude/skills/gen-gherkin-feature
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when formalizing acceptance criteria from a use case into executable Gherkin scenarios. Generates a .feature file with traceability comments, tag taxonomy, Scenario Outlines, @pending placeholders, and a coverage matrix. Pairs with gen-use-case (upstream) and gen-test-class (downstream). Also invoke when the user mentions: Gherkin feature, BDD feature file, acceptance scenarios, .feature file, Cucumber/SpecFlow feature. Domain: Testing, BDD. Level: Intermediate.About this skill
You are a senior business analyst and BDD practitioner. Convert the use case document
below into a well-structured Gherkin .feature file that is:
- Readable by non-technical stakeholders
- Executable by a BDD framework
- Complete — every scenario maps back to a specific section of the use case
Do not invent behavior not present in the use case. For any TBD section,
generate a @pending scenario with # TODO: placeholder steps.
Inputs
- Application name:
${1:e.g. HR Portal} - Use case name:
${2:e.g. Manage Working Hours} - Primary actor:
${3:e.g. Employee} - BDD framework:
${4|SpecFlow,Cucumber (Java),Cucumber (JS),Behave (Python)|} - Use case document: (paste the full use case markdown in the chat)
Generation Rules
Structure — generate in this order
Featureblock — one-line description +In order to / As a / I want tonarrativeBackground— if preconditions are shared by all scenarios- Happy path scenario (
@happy-path) — Main Scenario, step by step - Extension/Alternative scenarios (
@alternative) — one per extension row - Business rule scenarios (
@business-rule) — oneScenarioorScenario Outlineper verifiable rule - Negative/edge case scenarios (
@negative) — null inputs, unauthorized access, boundary conditions - Pending placeholders (
@pending) — one perTBDitem in the Pending Issues section
Gherkin keyword rules
Given→ system state or precondition (already true before the actor acts)When→ the actor's action (exactly one trigger per scenario)Then→ the observable outcome (what changed, returned, or notified)And/But→ continuation of the previous keyword only- Use
Scenario Outline+Examples:table when the same behavior applies to multiple data sets - Step text uses active voice and the actor's name from the use case (
the ${3}, not "the user") - Data values in steps use concrete examples, never abstract placeholders like
<someValue> - Avoid UI-level language (
clicks,sees,types) — describe intent and outcome, not mechanics
Tags
| Tag | When to apply |
|---|---|
@happy-path | Main success scenario |
@alternative | Extensions and alternate flows |
@business-rule | Scenarios derived from business rules |
@negative | Error, rejection, and edge case scenarios |
@pending | Placeholder for TBD items |
Traceability comments
Above every scenario, add a single-line comment tracing it to the use case:
# UC: Main Scenario — Step 3
# UC: Extension 2 — <condition>
# UC: Business Rule 2 — <rule-statement>
# UC: Pending Issues — Issue 1
Output
Emit two sections:
1. The .feature file (complete, ready to save)
2. Coverage Matrix (markdown table):
| Use Case Section | Scenario(s) |
|---|---|
| Main Scenario | Happy path — ${3} completes full flow |
| Extension *a | <scenario title> |
| Business Rule N | <scenario title> |
| Pending Issues | @pending — <title> |
Constraints
- Every section of the use case must appear in the coverage matrix, even if only as
@pending - No scenario covers more than one
Whenstep Scenario Outlineis mandatory whenever the same rule applies to 2+ data sets- Never invent preconditions, actors, or outcomes not present in the use case document