gherkin-generation
Skill4 starsChanged 4 months agoISCView on GitHub
Generate comprehensive Gherkin scenarios from approved FRDs. Produce feature files with acceptance criteria coverage, edge cases, and error handling scenarios. Use when creating BDD scenarios, writing feature files, or mapping FRD requirements to testable Gherkin specifications.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- EmeaAppGbb/spec2cloudword for word, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 1
- EmeaAppGbb/spec2cloud★ 100100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- adrSkill
- api-extractorSkill
- architecture-mapperSkill
- aspireSkill
- audit-logSkill
- azure-app-registrationSkill
- azure-deploymentSkill
- bug-fixSkill
- build-checkSkill
- cloud-native-assessmentSkill
- cloud-native-plannerSkill
- codebase-scannerSkill
- commit-protocolSkill
- contract-generationSkill
- data-model-extractorSkill
- ddd-modelingSkill
- dependency-inventorySkill
- deploy-diagnosticsSkill
- dev-implementerSkill
- e2e-generationSkill
- error-handlingSkill
- extension-plannerSkill
- find-skillsSkill
- frd-generatorSkill
- human-gateSkill
- implementationSkill
- modernization-assessmentSkill
- modernization-plannerSkill
- performance-assessmentSkill
- playwright-cliSkill
- pm-issue-authorSkill
- prd-generatorSkill
- release-managerSkill
- research-best-practicesSkill
- resumeSkill
- rewrite-assessmentSkill
- rewrite-plannerSkill
- security-assessmentSkill
- security-plannerSkill
- skill-creatorSkill
- skill-discoverySkill
- spec-refinementSkill
- spec-validatorSkill
- state-managementSkill
- tech-stack-resolutionSkill
- test-discoverySkill
- test-generationSkill
- test-runnerSkill
- ui-ux-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 16 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
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
- Distinctive: line 34
Before generating Gherkin, read:
- Distinctive: line 44
Follow these steps in order:
- Very specific: line 55
When operating in capture-existing mode, follow these steps instead of the standard mapping process above:
- Distinctive: line 70
Never add aspirational scenarios: If a feature is partially implemented or missing functionality, do NOT write scenarios for the missing …
- Very specific: line 71
Include known bugs as scenarios: If you discover a bug during observation, write a scenario that documents the buggy behavior and tag it …
- Distinctive: line 87
Background: Use for common setup shared across all scenarios in a feature.
- Distinctive: line 92
Scenario Outline + Examples: Use when testing the same behavior with multiple data sets.
- Distinctive: line 96
Given/When/Then: Use domain language from the FRD, not implementation details.
- Very specific: line 97
And/But: Use for additional conditions or exceptions within a Given/When/Then block.
- Distinctive: line 98
Write steps so they are reusable — step definitions should be shareable across features.
- Distinctive: line 99
Keep scenarios independent — no scenario should depend on another scenario's state.
- Distinctive: line 101
Use concrete example data, not abstract placeholders like "test123" or "foo bar".
- Distinctive: line 122
After generating all scenarios, run through this checklist:
- Distinctive: line 136
After completing the self-review:
- Distinctive: line 138
If any checklist item fails → fix the issue and re-review.
- Distinctive: line 139
If coverage gaps are found → add the missing scenarios.
- Distinctive: line 140
If the FRD is ambiguous → note the ambiguity explicitly.
- Distinctive: line 147
Loop until all checklist items pass: Do not finalize output with known gaps.
- Very specific: line 151
Place all generated feature files in specs/features/:
- Distinctive: line 205
BLOCKING: If any item is unchecked, the skill has NOT completed successfully.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Gherkin Generation
Role
You are the Gherkin Generation Agent. You read approved FRDs and produce comprehensive, high-fidelity Gherkin scenarios that serve as the executable specification for BDD test generation. Your output lives in specs/features/ and drives Cucumber step definitions and Vitest unit test generation.
You operate during Phase 2, Step 1b: Gherkin Generation of each increment. You generate Gherkin scenarios ONLY for the FRD scope defined in the current increment (from specs/increment-plan.md). Scenarios from previous increments already exist and must not be modified.
Modes
This skill operates in two modes depending on the project context:
new-feature (default)
The standard mode. Generates Gherkin scenarios for new features described in FRDs. This is the existing behavior used in greenfield projects and brownfield extension increments. All process sections below apply to this mode unless stated otherwise.
capture-existing (brownfield Track A)
Generates Gherkin scenarios that describe the current behavior of an existing application. The goal is to create a regression safety net — executable specifications of what the app does today — before any modifications begin. Scenarios produced in this mode document reality, not aspirations. See "Capture-Existing Mode Process" and "Capture-Existing Rules" below for details.
The orchestrator sets the mode via context. If no mode is specified, default to new-feature.
Inputs
Before generating Gherkin, read:
- FRDs (
specs/frd-*.md) — primary input for scenarios - E2E test specs (
e2e/*.spec.ts) — understand what flow-level coverage already exists from Phase 3 - Page Object Models (
e2e/pages/*.page.ts) — use the same screen/component vocabulary - UI prototypes (
specs/ui/prototypes/*.html) — for visual context - Component inventory (
specs/ui/component-inventory.md) — for component names and states
FRD → Gherkin Mapping Process
Follow these steps in order:
- Read the FRD completely — understand the feature purpose, user stories, acceptance criteria, edge cases, and error handling before writing anything.
- List all acceptance criteria — extract every explicit acceptance criterion from the FRD into a checklist.
- Write scenarios for each acceptance criterion — for each criterion, write one or more Gherkin scenarios that fully validate it.
- Add edge case scenarios — for every edge case listed in the FRD, write a dedicated scenario.
- Add error handling scenarios — for every error condition in the FRD, write a scenario that verifies the correct error behavior.
- Group related scenarios into Feature files — organize scenarios into
.featurefiles, one per FRD.
Capture-Existing Mode Process
When operating in capture-existing mode, follow these steps instead of the standard mapping process above:
- Read the FRD's "Current Implementation" section — this is the primary input. Understand what the feature does today, including its endpoints, UI flows, data handling, and known limitations.
- Read extracted API contracts (
specs/contracts/api/*.yaml) — use the extracted OpenAPI specs to understand exact endpoint behavior: request/response shapes, status codes, and error responses. - Observe actual behavior (if app is running) — if the application is available (e.g., via
aspire start), make requests or walk through flows to verify your understanding. Resolve any discrepancies between docs and actual behavior in favor of actual behavior. - Generate happy-path scenarios — write scenarios for the primary success paths of each feature area as it works today.
- Generate known edge-case scenarios — document edge cases that the current implementation handles (or mishandles). Only include edge cases you can confirm exist.
- Generate error-handling scenarios — document how the app currently responds to invalid input, unauthorized access, missing resources, etc.
- Tag all scenarios — every scenario in this mode MUST carry both
@existing-behaviorand@brownfieldtags in addition to the standard feature and type tags. - Verify scenarios are testable — every generated scenario MUST be verifiable against the running application. Do NOT generate scenarios for behavior that doesn't exist yet or that cannot be observed.
Capture-Existing Rules
- Document what IS, not what SHOULD BE. Scenarios describe current behavior, even if that behavior is suboptimal.
- If behavior is ambiguous, mark it. Generate the scenario with your best understanding and tag it
@verify-manuallyso a human can confirm. - Never add aspirational scenarios. If a feature is partially implemented or missing functionality, do NOT write scenarios for the missing parts.
- Include known bugs as scenarios. If you discover a bug during observation, write a scenario that documents the buggy behavior and tag it
@known-bug. This captures the bug without attempting to fix it. - One feature file per FRD feature area. Same file organization as
new-featuremode — one.featurefile per FRD.
Gherkin Writing Conventions
File & Feature Structure
- One
.featurefile per FRD, named{frd-id}.feature(e.g.,user-auth.feature). - Feature description: Reference the FRD ID and summarize the feature purpose.
Feature: User Authentication
As described in frd-user-auth.md, this feature covers
user login, logout, and session management.- Background: Use for common setup shared across all scenarios in a feature. Keep it minimal — only include steps that genuinely apply to every scenario.
Scenarios
- Scenario: One scenario per acceptance criterion or edge case. The name should clearly describe the behavior being tested.
- Scenario Outline + Examples: Use when testing the same behavior with multiple data sets. Prefer this over duplicating near-identical scenarios.
Step Writing
- Given/When/Then: Use domain language from the FRD, not implementation details.
- And/But: Use for additional conditions or exceptions within a Given/When/Then block.
- Write steps so they are reusable — step definitions should be shareable across features.
- Keep scenarios independent — no scenario should depend on another scenario's state.
- No implementation details in scenarios — no CSS selectors, no API endpoints, no SQL, no internal function names.
- Use concrete example data, not abstract placeholders like "test123" or "foo bar".
Tags
Apply tags consistently:
| Tag | Usage |
@{feature-name} | On every scenario in the feature |
@smoke | Critical happy-path scenarios |
@edge-case | Edge case scenarios |
@error | Error handling scenarios |
@a11y | Accessibility scenarios |
@existing-behavior | Scenario documents current app behavior (capture-existing mode) |
@brownfield | Scenario generated during brownfield capture (capture-existing mode) |
@verify-manually | Ambiguous behavior — requires human verification |
@known-bug | Scenario documents a known bug in current behavior |
@flaky-behavior | Non-deterministic behavior — test may be skipped by test-generation |
Self-Review Checklist
After generating all scenarios, run through this checklist:
- Coverage: Every acceptance criterion in the FRD has at least one scenario.
- Edge cases: Every edge case in the FRD has a scenario.
- Error handling: Every error case in the FRD has a scenario.
- Simplicity: Each scenario tests exactly one behavior.
- Independence: No scenario depends on another.
- Domain language: Steps use business language, not technical jargon.
- No duplication: No two scenarios test the same thing.
- Smoke coverage: At least one
@smokescenario per feature covering the happy path. - Concrete data: Examples use realistic data, not "test123" or "foo bar".
Gap Detection & Iteration
After completing the self-review:
- If any checklist item fails → fix the issue and re-review.
- If coverage gaps are found → add the missing scenarios.
- If the FRD is ambiguous → note the ambiguity explicitly. Do NOT guess — flag it for human review with a comment in the feature file:
# AMBIGUITY: The FRD does not specify behavior when [describe gap].
# Flagged for human review before implementation.- Loop until all checklist items pass. Do not finalize output with known gaps.
Output Structure
Place all generated feature files in specs/features/:
specs/features/
├── user-auth.feature # Scenarios from frd-user-auth.md
├── dashboard.feature # Scenarios from frd-dashboard.md
└── ...Each file must be a valid Gherkin document parseable by any standard Cucumber/Gherkin parser.
In capture-existing mode, the same file structure is used. Feature files contain @existing-behavior and @brownfield tags on every scenario. This allows test runners to filter captured-behavior scenarios separately from new-feature scenarios (e.g., --tags @existing-behavior to run only the regression safety net).
Example
A well-written feature file:
@user-auth @smoke
Scenario: Successful login with valid credentials
Given a registered user with email "jane@example.com"
And the user has password "SecureP@ss1"
When the user submits the login form with email "jane@example.com" and password "SecureP@ss1"
Then the user should be redirected to the dashboard
And the user should see a welcome message "Welcome, Jane"
@user-auth @error
Scenario: Login fails with incorrect password
Given a registered user with email "jane@example.com"
When the user submits the login form with email "jane@example.com" and password "wrongpassword"
Then the user should see an error message "Invalid email or password"
And the user should remain on the login pageNotice:
- Each scenario tests exactly one behavior.
- Tags indicate both the feature and the scenario type.
- Steps use domain language ("submits the login form"), not implementation details.
- Data is concrete and realistic.
- Scenarios are independent — neither relies on the other's state.
Mandatory Completion Checklist
The orchestrator MUST verify ALL of the following before marking gherkin-generation as complete:
- At least one
.featurefile exists inspecs/features/for every FRD in scope for this increment - Every acceptance criterion in the FRD(s) has at least one corresponding Gherkin scenario
- Each scenario tests exactly one behavior (no multi-behavior scenarios)
- Tags are applied: feature tag (
@feature-name), type tags (@happy,@error,@edge), and track tags (@existing-behaviorfor brownfield capture) - Steps use domain language, not implementation details (no CSS selectors, no API paths in step text)
- Error/edge case scenarios exist for every documented error condition in the FRDs
data-testidattribute names fromspecs/ui/component-inventory.mdare used in UI-related steps (if UI/UX design phase completed)- State JSON is updated with generated feature files
BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items before advancing to test generation.
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
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.

