Gherkin Acceptance Criteria Skill
Purpose
This Skill provides comprehensive guidance for writing Gherkin acceptance criteria using Given-When-Then syntax to create clear, testable specifications for features and user stories.
When to use this Skill: writing acceptance criteria for user stories, defining testable requirements in plans, specifying expected behaviour for features, and documenting edge cases and error handling.
Core Concepts
What is Gherkin?
Gherkin is a structured language for writing acceptance criteria using Given-When-Then syntax. It enables:
- Clear communication: Non-technical stakeholders understand requirements
- Testable specifications: Scenarios map directly to automated tests
- Complete coverage: All scenarios and edge cases documented
- Unambiguous expectations: No room for interpretation
Given-When-Then Structure
Anatomy of a scenario:
Scenario: [Brief description of scenario]
Given [Initial context/preconditions]
When [Action or event occurs]
Then [Expected outcome/postconditions]
Breakdown:
- Given: Sets up the context (initial state, preconditions, setup)
- When: Describes the action or event (user action, system event, trigger)
- Then: Specifies expected outcome (assertions, verification, results)
Journey Coherence
See Journey Coherence for the full rule text, conforming/non-conforming examples, and the canonical convention link.
Basic Scenario Patterns
See Basic Scenario Patterns for three worked patterns: simple success path, error handling, and boundary conditions.
Advanced Gherkin Features
See Advanced Gherkin Features for Background blocks, Scenario Outline with Examples tables, and Data Tables.
Common Domain Patterns
See Domain Patterns — Auth and CRUD and Domain Patterns — Form Validation and API Responses for worked full-feature examples across authentication, CRUD, form validation, and API responses.
Best Practices
See Writing Clear Scenarios and Scenario Independence, UI Coupling, and Style for the DO/DON'T rules, scenario independence, avoiding UI coupling, and declarative vs imperative style — each with good/bad examples.
Common Mistakes
See Common Mistakes for the four most common Gherkin mistakes — too many steps, asserting internal implementation, ambiguous language, and testing multiple behaviours — each with a fix.
Phase Gate Acceptance Checks
See Phase Gate Acceptance Checks for how phase
gate checklist items in delivery.md meet the same testability standard as Gherkin scenarios.
Integration with Plans
See Integration with Plans for the plan-level acceptance criteria format and the user story acceptance criteria format.
Reference Documentation
Primary Convention: Acceptance Criteria Convention
Directory Structure Convention: Specs Directory Structure Convention — Where to place feature files in the specs/ directory
Related Conventions: Plans Organization, Maker-Checker-Fixer Pattern
Related Skills: repo-practicing-trunk-based-development, repo-applying-maker-checker-fixer
Related Agents: plan-maker, plan-checker, plan-execution-checker
External Resources: Official Gherkin Reference, Writing Better Gherkin
This Skill packages essential Gherkin acceptance criteria knowledge for writing clear, testable specifications. For additional patterns and examples, consult external Gherkin resources.