gherkin-generator-skill
Original:🇺🇸 English
Translated
Generates high-quality Gherkin (BDD) scenarios from functional requirements using a two-agent iterative cycle: a generator agent that creates/modifies the Gherkin and a reviewer agent that validates it and proposes improvements. The cycle repeats automatically until the Gherkin passes review. Use this skill whenever the user mentions: "generate Gherkin", "BDD scenarios", "Gherkin test cases", "Feature/Scenario/Given/When/Then", "requirements to Gherkin", "BDD specifications", or asks to transform functional requirements into behaviour tests. Also applies when the user brings a requirements document and wants test cases, acceptance criteria, or user stories with executable examples.
2installs
Sourceehdez73/agent-skills
Added on
NPX Install
npx skill4agent add ehdez73/agent-skills gherkin-generator-skillTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Skill: Gherkin Generator (BDD)
Converts functional requirements into valid, high-quality Gherkin scenarios through an
iterative cycle with two specialised agents.
System Architecture
Functional requirements
│
▼
┌─────────────────────┐
│ gherkin-generator │ ← Agent 1: generates/modifies the .feature file
│ -agent │
└────────┬────────────┘
│ Gherkin draft
▼
┌─────────────────────┐
│ gherkin-reviewer │ ← Agent 2: validates and proposes improvements
│ -agent │
└────────┬────────────┘
│
Approved?
NO ──────────────────► returns to Agent 1 with feedback
YES ─────────────────► delivers the final .feature fileStep-by-step workflow
Step 1 — Prepare the requirements
Before invoking the agents, extract from the user's input:
- Module / feature name (for the Feature name)
- List of functional requirements (numbered or in prose)
- Business context (actors, systems involved)
- Example data if available
If anything is ambiguous, ask the user before starting.
Step 2 — Invoke the Generator Agent
Read the full instructions in .
agents/generator-agent.mdCall the agent with:
INPUT:
requirements: <list of requirements>
context: <business context>
previous_feedback: <empty on first iteration>
previous_gherkin: <empty on first iteration>
iteration: <current iteration number>The agent returns a Gherkin block in format.
.featureStep 3 — Invoke the Reviewer Agent
Read the full instructions in .
agents/reviewer-agent.mdCall the agent with:
INPUT:
gherkin: <output from the generator agent>
original_requirements: <user's original requirements>
iteration: <current iteration number>The agent returns an object with:
approved: true/falsescore: 0-100issues: [list of problems]suggestions: [list of concrete improvements]annotated_gherkin: <the gherkin with inline comments>
Step 4 — Improvement loop
iteration = 1
maximum = 5 ← prevents infinite loops
WHILE iteration <= maximum:
gherkin = generator_agent(requirements, feedback, previous_gherkin)
review = reviewer_agent(gherkin, requirements)
IF review.approved == true OR review.score >= 85:
BREAK
feedback = review.suggestions + review.issues
previous_gherkin = gherkin
iteration += 1
IF iteration > maximum:
deliver the best gherkin obtained with a warning noteStep 5 — Delivery
Present to the user:
- The final file with syntax highlighting
.feature - The reviewer's final score
- A summary of iterations performed
- (Optional) Save the file if the user requests it
Approval criteria (summary)
The Reviewer Agent approves when all of the following are met:
| Criterion | Minimum requirement |
|---|---|
| Requirements coverage | 100% of functional requirements covered |
| Gherkin syntax | No errors (Feature, Scenario, Given/When/Then) |
| Scenario independence | No order dependency between scenarios |
| Step clarity | No technical ambiguities |
| Example data | Scenario Outline + Examples tables when variants exist |
| Language | Consistent throughout the file |
Implementation notes
- Maximum iterations: 5 (configurable by the user)
- Language: use the same language as the input requirements
- Granularity: one file per module/feature
.feature - Tags: add ,
@smoke,@regression,@happy-pathas appropriate@edge-case - Background: use only when ≥3 scenarios share the same Given steps
For implementation details of each agent, read:
agents/generator-agent.mdagents/reviewer-agent.mdreferences/gherkin-best-practices.md