gherkin-feature-writer
Skill0 starsChanged 5 months agoMITView on GitHub
Trigger: Gherkin, .feature file, write feature file, BDD scenario, Given When Then, Cucumber/Behave/SpecFlow, acceptance criteria as scenarios. Write declarative, standard-compliant Gherkin .feature files.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 4r-code-reviewSkill
- acceptance-criteria-generatorSkill
- api-spec-writerSkill
- compliance-guardSkill
- context-engineerSkill
- decision-record-writerSkill
- documentation-architectSkill
- frontend-spec-writerSkill
- judgeSkill
- observability-designerSkill
- prd-writerSkill
- prompt-engineerSkill
- prp-writerSkill
- release-plannerSkill
- reviewerSkill
- risk-assessorSkill
- solution-architectSkill
- spec-architectSkill
- spec-writerSkill
- story-refinerSkill
- task-breakdownSkill
- technical-plannerSkill
- togaf-writerSkill
- traceability-managerSkill
- validation-strategistSkill
- workflow-designerSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Use this skill when the user asks to write or normalize a .feature file, express behavior or acceptance criteria as Given/When/Then …
- Distinctive: line 25
Use it to produce standard-compliant, declarative Gherkin that reads as living documentation and stays maintainable as the system evolves.
- Distinctive: line 27
Do NOT use this skill to write step-definition / glue code, design the feature itself, or convert exhaustive boundary tables that belong in …
- Very specific: line 35
Structure the file: Follow the Output Contract, using assets/feature-template.feature as the scaffold.
- Distinctive: line 36
Self-check: Run the Quality Checklist before returning.
- Distinctive: line 83
Before returning the file, verify:
≈ “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 Feature Writer
When to Use
Use this skill when the user asks to write or normalize a .feature file, express behavior or acceptance criteria as Given/When/Then scenarios, or author BDD specs for Cucumber, Behave, SpecFlow, Reqnroll, or any Gherkin-compatible runner.
Use it to produce standard-compliant, declarative Gherkin that reads as living documentation and stays maintainable as the system evolves.
Do NOT use this skill to write step-definition / glue code, design the feature itself, or convert exhaustive boundary tables that belong in unit tests. This skill writes the specification, not the automation.
Operating Workflow
- Capture the behavior. Identify the feature, the business value, the actor, and the distinct behaviors to specify. If intent is unclear, ask one clarifying question before writing.
- One behavior per scenario. Split each distinct rule/outcome into its own scenario. Apply the Cardinal Rule of BDD: one scenario, one behavior.
- Choose constructs. Pick keywords and structures per the Decision Rules table. Read
references/gherkin-reference.mdfor exact syntax before using Background, Scenario Outline, Data Tables, Doc Strings, or Rule. - Write declaratively. State intent and observable outcomes, not UI keystrokes. Apply
references/gherkin-best-practices.md. - Structure the file. Follow the Output Contract, using
assets/feature-template.featureas the scaffold. OneFeatureper file; capitalize keywords. - Self-check. Run the Quality Checklist before returning. Fix violations rather than reporting them.
Decision Rules
| Situation | Use |
| High-level intent, business-readable spec | Declarative style (default) |
| Precondition shared by ALL scenarios in the file | Background (keep it short; only true shared setup) |
| Same behavior across several input/output sets | Scenario Outline + Examples with <placeholder> |
| Grouping scenarios under one business rule | Rule (Gherkin v6+) with nested examples |
| Structured input/output data for one step | Data Table (|) or Doc String (""") |
| Categorizing/filtering runs (smoke, wip, regression) | Tags (@tag) above Feature/Scenario |
| Step needs "and"/"but" continuation | And / But — never a conjunction inside one step |
| Dozens of boundary rows or exhaustive edge cases | Push to unit tests; keep Gherkin to stakeholder-relevant behavior |
Keyword roles (do not mix)
Given— preconditions / existing state. No actions, no assertions.When— the single action or event under test.Then— observable, verifiable outcome. No actions.And/But/*— continue the previous step type.
Output Contract
Produce a valid .feature file with this structure (see assets/feature-template.feature):
@optional-feature-tags
Feature: <concise capability name>
As a <role>
I want <capability>
So that <business value>
Background: # optional — shared preconditions only
Given <shared state>
@optional-scenario-tags
Scenario: <one concise behavior, stated as outcome>
Given <precondition>
When <single action>
Then <observable outcome>
And <additional outcome>Rules: one Feature per file; keep scenarios to a single-digit step count (<10); each scenario independent (no scenario depends on another's side effects); third-person consistent voice; descriptive scenario titles that name the behavior, not the procedure.
Quality Checklist
Before returning the file, verify:
- Exactly one
Featurewith a value statement (role / capability / benefit). - Each scenario covers ONE behavior with a behavior-naming title.
- Declarative phrasing — no UI mechanics (clicks, keystrokes, selectors).
Given/When/Thenused in their correct roles; no actions inThen, no assertions inGiven.- No single step contains a hidden "and"; chained steps use
And/But. - Scenarios are independent and under ~10 steps each.
Scenario Outlineused only for variations of the same behavior;Examplescolumns match<placeholders>.Backgroundholds only setup shared by all scenarios; no assertions in it.- Keywords capitalized; tables aligned; file ends in
.feature. - No exhaustive boundary data that belongs in unit tests.
References
references/gherkin-reference.md— standard keyword/syntax reference with examples. Read before using advanced constructs.references/gherkin-best-practices.md— declarative style, anti-patterns, titling, step-count rules.assets/feature-template.feature— annotated scaffold and worked declarative example.
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.

