gherkin-convert
Gherkin Format Conversion
Convert specifications between Gherkin/BDD format and other formats.
Supported Conversions
| From | To | Description |
|---|---|---|
| EARS | Gherkin | EARS requirements to scenarios |
| Gherkin | EARS | Scenarios to EARS requirements |
| Canonical | Gherkin | Full spec to feature file |
| Gherkin | Canonical | Feature file to canonical spec |
| Inline AC | Feature | Inline criteria to .feature |
| Feature | Inline AC | .feature to inline criteria |
Workflow
-
Load Source
- Read source file
- Detect current format
-
Parse Content
- Extract requirements/scenarios
- Identify structure
-
Convert
- Spawn
spec-converter gherkinagent - Transform to target format
- Apply best practices
- Spawn
-
Validate
- Check Gherkin syntax
- Verify completeness
-
Output
- Write .feature file or specification
Arguments
$1- Source file path--to- Target format: gherkin, feature, canonical, ears, inline--output- Output file path (optional)
Examples
# Canonical spec to feature file
/spec-driven-development:gherkin-convert .specs/auth/spec.md --to feature
# Feature file to canonical
/spec-driven-development:gherkin-convert tests/login.feature --to canonical
# EARS to Gherkin
/spec-driven-development:gherkin-convert ears-requirements.md --to gherkin
# Inline to feature file
/spec-driven-development:gherkin-convert spec.md --to feature --output tests/spec.feature
Conversion Examples
EARS → Gherkin
Input (EARS):
## FR-1: User Login
WHEN the user submits valid credentials,
the system SHALL authenticate the user
AND redirect to the dashboard.
### Acceptance Criteria
- AC-1.1: Valid credentials grant access
- AC-1.2: Invalid password shows error
Output (Gherkin):
Feature: User Login
As a user
I want to log in with my credentials
So that I can access the dashboard
# FR-1: User Login
Scenario: Successful login with valid credentials
Given a registered user exists
When the user submits valid credentials
Then the user is authenticated
And the user is redirected to the dashboard
Scenario: Failed login with invalid password
Given a registered user exists
When the user submits an invalid password
Then an error message is displayed
And the user remains on the login page
Canonical → Feature File
Input (Canonical):
# Specification: Shopping Cart
## FR-1: Add to Cart
WHEN the user clicks "Add to Cart",
the system SHALL add the item to the user's cart.
### Acceptance Criteria
- [ ] AC-1.1: Given product page, when clicking add, then item in cart
- [ ] AC-1.2: Given item in cart, when adding again, then quantity increases
Output (Feature):
# Specification: Shopping Cart
# Generated from: .specs/cart/spec.md
Feature: Shopping Cart
As a shopper
I want to add items to my cart
So that I can purchase them
@FR-1
Scenario: Add item to cart from product page
Given I am viewing a product page
When I click "Add to Cart"
Then the item is added to my cart
@FR-1
Scenario: Increase quantity when adding existing item
Given I have an item in my cart
When I add the same item again
Then the item quantity increases by 1
Pattern Mapping
| EARS Pattern | Gherkin Mapping |
|---|---|
| WHEN...SHALL | Scenario with When/Then |
| WHILE...SHALL | Given (continuous state) |
| IF...THEN...SHALL | Error/edge case scenario |
| WHERE...SHALL | @tag for feature toggle |
| Ubiquitous | Background or invariant check |
Related Commands
/spec-driven-development:gherkin-author- Create Gherkin scenarios/spec-driven-development:ears-convert- EARS conversions/spec-driven-development:convert- General format conversion
More from melodic-software/claude-code-plugins
design-thinking
Design Thinking methodology for human-centered innovation. Covers the 5-phase IDEO/Stanford d.school approach (Empathize, Define, Ideate, Prototype, Test) with workshop facilitation and exercise templates.
191plantuml-syntax
Authoritative reference for PlantUML diagram syntax. Provides UML and non-UML diagram types, syntax patterns, examples, and setup guidance for generating accurate PlantUML diagrams.
161system-prompt-engineering
Design effective system prompts for custom agents. Use when creating agent system prompts, defining agent identity and rules, or designing high-impact prompts that shape agent behavior.
141architecture-documentation
Generate architecture documents using templates with diagram integration. Use for creating C4 diagrams, viewpoint documents, and technical overviews.
126data-modeling
Data modeling with Entity-Relationship Diagrams (ERDs), data dictionaries, and conceptual/logical/physical models. Documents data structures, relationships, and attributes.
101resume-optimization
Resume structure, achievement bullet formulas, ATS optimization, and job-targeted tailoring for software engineers. Use when reviewing resumes, crafting achievement bullets, extracting keywords from job descriptions, or tailoring content for specific roles.
93