Formalizes acceptance criteria into structured, executable Gherkin feature files.
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.Key capabilities
- →Convert use case documents into Gherkin `.feature` files
- →Generate Feature blocks with narrative
- →Generate Background sections for shared preconditions
- →Create Happy Path scenarios
- →Generate Extension/Alternative scenarios
- →Include Business Rule scenarios
How it works
The skill transforms a use case document into a structured Gherkin `.feature` file by applying specific rules for scenario types, keywords, tags, and traceability comments.
Inputs & outputs
When to use gen-gherkin-feature
- →Creating feature files for Cucumber
- →Defining BDD acceptance scenarios
- →Formalizing requirements for developers
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
When not to use it
- →When inventing behavior not present in the use case
- →When more than one `When` step is desired per scenario
- →When `Scenario Outline` is not mandatory for multiple data sets
Limitations
- →Does not invent behavior not present in the use case
- →No scenario covers more than one `When` step
- →`Scenario Outline` is mandatory whenever the same rule applies to 2+ data sets
How it compares
This skill formalizes acceptance criteria from a use case into executable Gherkin scenarios with traceability and specific structural rules, providing a consistent and BDD-ready output unlike manual Gherkin writing.
Compared to similar skills
gen-gherkin-feature side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| gen-gherkin-feature (this skill) | 0 | 4mo | No flags | Intermediate |
| code-review-checklist | 3 | 29d | No flags | Beginner |
| openspec-verify-change | 3 | 6mo | Review | Advanced |
| superpowers-finish | 1 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
code-review-checklist
vudovn
Code review guidelines covering code quality, security, and best practices.
openspec-verify-change
studyzy
验证实现是否与变更产出物匹配。当用户想要在归档前验证实现是否完整、正确且一致时使用。
superpowers-finish
anthonylee991
Finalizes work: runs verification, summarizes changes, notes follow-ups, and ensures repo hygiene. Use at the end of an implementation or debugging session.
positron-qa-verify
posit-dev
Generates clear, actionable verification guides for QA testing of Positron bug fixes and features
categorize-revdep-issues
r-lib
Write revdep/issue.md to group packages by common error categories
pr-review
microsoft
Multi-dimensional review of a PR or feature branch in the microsoft/winappcli repo. Activate when a contributor asks to "review my PR", "review my changes", "vet my branch before pushing", "do a full review", "PR review", "review this feature", or similar. Fans out parallel sub-agents covering secur