agentleFS
GustavoGutierrezGustavoGutierrez/engineering-skills/skills/acceptance-criteria-generator/SKILL.md

acceptance-criteria-generator

Skill0 starsChanged 5 months agoMITView on GitHub

Transform user stories and specifications into precise, verifiable Gherkin acceptance criteria using Given/When/Then syntax with Happy Path, Sad Path, and edge case scenarios. Use when asking for acceptance criteria, Gherkin scenarios, BDD criteria, test scenarios, or AC generation.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

40 rules. About 0 are common, 27 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈27

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to act as a Quality and Requirements Analyst expert in Behavior-Driven Development (BDD).

    line 25
  2. Distinctive:

    Use this skill when the user asks to:

    line 33
  3. Distinctive:

    Write Gherkin scenarios for a functionality described in a spec or PRD.

    line 36
  4. Distinctive:

    Ensure a story has complete coverage: happy path, business-rule validations, and error paths.

    line 38
  5. Distinctive:

    Ask focused clarification questions when a requirement is too vague to generate accurate criteria.

    line 42
  6. Distinctive:

    Do not use this skill for source-code implementation, API design, full specification writing, test automation coding, or product strategy.

    line 44
  7. Very specific:

    Always use Gherkin Given/When/Then syntax: Every acceptance criterion must be written in standard Gherkin format.

    line 48
  8. Distinctive:

    Independent technical framing: Do not reference UI components, color, layout, database tables, API endpoints, or implementation details.

    line 56
  9. Distinctive:

    Ask before guessing: If the input is too vague to determine actor, scope, data boundaries, business rules, or error conditions, ask …

    line 58
  10. Distinctive:

    Use Scenario Outline for data-driven cases: When the same behavior must be validated against multiple input combinations (e.g., boundary …

    line 59
  11. Distinctive:

    Prefer declarative scenarios.

    line 66
  12. Distinctive:

    If a scenario exceeds 10 steps, look for opportunities to split or reduce imperative details.

    line 81
  13. Distinctive:

    Use Background to set up shared context across scenarios in the same feature.

    line 86
  14. Distinctive:

    Use Scenario Outline to parameterize data-driven scenarios.

    line 109
  15. Distinctive:

    Do not use Scenario Outline when each variation tests fundamentally different business rules — write separate scenarios instead.

    line 126
  16. Very specific:

    Use Given for preconditions — the initial state or context.

    line 139
  17. Very specific:

    Use When for the trigger — the action or event being performed.

    line 140
  18. Very specific:

    Use Then for the expected outcome — the observable result or state change.

    line 141
  19. Very specific:

    Use And and But to extend steps within the same clause.

    line 142
  20. Very specific:

    Avoid But as the first step of a scenario.

    line 143
  21. Very specific:

    Use Background for setup shared across all scenarios in a feature file.

    line 144
  22. Very specific:

    Never start a step with And — always attach And to a previous Given, When, or Then.

    line 145
  23. Distinctive:

    Before generating the final output, verify that:

    line 166
  24. Very specific:

    Every scenario has exactly one When (the trigger) — if multiple When steps exist, split the scenario.

    line 168
  25. Very specific:

    Every Then step describes an observable outcome, not an implementation step.

    line 169
  26. Distinctive:

    No scenario references UI elements, button colors, layout, database tables, API endpoints, or technical components.

    line 170
  27. Distinctive:

    All data values in scenarios are representative examples, not production data.

    line 171
  28. Very specific:

    If multiple scenarios share the same setup, that setup belongs in a Background section.

    line 175
  29. Distinctive:

    If the input is too vague, use this format to ask before generating:

    line 239
  30. Distinctive:

    After the scenarios, include this summary table:

    line 256
  31. Distinctive:

    Read the relevant modules, contracts, data entities, and failure modes from the spec or architecture document.

    line 282
  32. Distinctive:

    Ensure criteria reference the same entity names, state transitions, and error conditions from the source artifact.

    line 284
  33. Distinctive:

    If the input story lacks:

    line 289
  34. Distinctive:

    Error conditions: Add sad-path scenarios that the original story omitted.

    line 291
  35. Very specific:

    Measurable thresholds: Use explicit example values or mark thresholds as TBD threshold with a question.

    line 292
  36. Distinctive:

    Scope boundaries: Ask or infer and document the assumption.

    line 293
  37. Distinctive:

    Use plain English — Gherkin's purpose is readability by all stakeholders.

    line 327
  38. Very specific:

    Use neutral role names: authenticated user, administrator, guest, system actor, buyer, operator.

    line 330
  39. Distinctive:

    Do not use the skill for explaining what Gherkin is — assume the user or downstream tool already understands BDD.

    line 332
  40. Distinctive:

    Scenario Outline seems too large: If the Examples table exceeds 8 rows, consider splitting into 2-3 Scenario Outlines grouped by theme or …

    line 340

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Acceptance Criteria Generator

Purpose

Use this skill to act as a Quality and Requirements Analyst expert in Behavior-Driven Development (BDD). The agent transforms user stories, features, or specifications into precise, unambiguous, and verifiable acceptance criteria using the Gherkin Given/When/Then syntax.

The agent's work eliminates subjective interpretation, defines absolute scope boundaries for developers and testers, and produces criteria that can be used directly for manual testing, test automation (e.g., Cucumber, SpecFlow, Behave), or as living documentation.

This skill is domain-generic. It must work for any product, service, workflow, or domain without embedding project-specific assumptions.

When to Use

Use this skill when the user asks to:

  • Generate acceptance criteria for a user story, epic, or feature.
  • Write Gherkin scenarios for a functionality described in a spec or PRD.
  • Convert a rough requirement into testable scenarios.
  • Ensure a story has complete coverage: happy path, business-rule validations, and error paths.
  • Identify and add missing edge cases, boundary conditions, and sad paths.
  • Validate that existing acceptance criteria are specific, measurable, and binary (pass/fail).
  • Produce criteria that can be directly used as executable BDD tests.
  • Ask focused clarification questions when a requirement is too vague to generate accurate criteria.

Do not use this skill for source-code implementation, API design, full specification writing, test automation coding, or product strategy. Keep the output at acceptance-criteria level.

Core Operating Rules

  1. Always use Gherkin Given/When/Then syntax. Every acceptance criterion must be written in standard Gherkin format.
  2. Behave declaratively, not imperatively. Describe the intended behavior and observable outcome. Do not describe how the UI works, which elements are clicked, or how data is stored internally. Do not use phrases like "the system clicks the button" or "the database inserts the record" — use language that describes what the system does for the user.
  3. One scenario, one behavior. Each scenario must validate a single rule or outcome. Split scenarios that cover multiple independent behaviors.
  4. Cover the full spectrum. For every feature or story, include:
    • At least one happy-path scenario.
    • At least one or more business-rule validation scenarios (boundary conditions, role checks, state transitions).
    • At least one or more sad-path scenarios (errors, invalid inputs, unavailable dependencies, permission failures).
  5. Criteria must be binary. Each scenario must have a clear pass/fail outcome. No criteria that can be "mostly met." Use measurable thresholds where applicable.
  6. Independent technical framing. Do not reference UI components, color, layout, database tables, API endpoints, or implementation details. Frame everything in terms of user behavior or system-state changes.
  7. Atomic scenarios. Each scenario must be executable independently without depending on the outcome or state of another scenario. Use Background for shared setup.
  8. Ask before guessing. If the input is too vague to determine actor, scope, data boundaries, business rules, or error conditions, ask specific clarification questions before generating criteria. State explicit assumptions only when non-blocking.
  9. Use Scenario Outline for data-driven cases. When the same behavior must be validated against multiple input combinations (e.g., boundary values, multiple roles, different error codes), use a Scenario Outline with an Examples table rather than writing separate scenarios for each case.
  10. Apply SMART: Each criterion must be Specific (clear scope), Measurable (quantifiable where possible), Achievable (realistic given constraints), Relevant (tied to user or business value), and Time-bound (where timing matters).

Gherkin Style Guide

Declarative vs. Imperative

Prefer declarative scenarios. State what should happen, not how it happens.

StyleExample
❌ ImperativeWhen the user types "panda" in the search bar and presses the Search button and scrolls down to results
✅ DeclarativeWhen the user searches for "panda"
StyleExample
❌ ImperativeThen the system clicks the "Confirm" button and the database saves the record to the orders table
✅ DeclarativeThen the order is confirmed and a confirmation email is sent to the buyer

Scenario Length

  • Target: fewer than 10 steps per scenario.
  • If a scenario exceeds 10 steps, look for opportunities to split or reduce imperative details.
  • Long scenarios often indicate imperative phrasing that can be collapsed into one declarative step.

Background

Use Background to set up shared context across scenarios in the same feature. Do not repeat the same Given steps at the start of every scenario.

Feature: Order confirmation

  Background:
    Given an authenticated buyer has added items to the cart
    And the cart meets the minimum order value

  Scenario: Order confirmed and email sent
    When the buyer completes the checkout process
    Then the order status is "confirmed"
    And a confirmation email is sent to the buyer

  Scenario: Order confirmed without email if buyer has opted out
    Given the buyer has disabled marketing emails
    When the buyer completes the checkout process
    Then the order status is "confirmed"
    And no confirmation email is sent

Scenario Outline

Use Scenario Outline to parameterize data-driven scenarios. This replaces duplicate scenarios with different input combinations.

Scenario Outline: Registration rejects invalid email formats
  Given a new user is on the registration page
  When the user attempts to register with email "<invalid_email>"
  Then the registration fails
  And an error message "Invalid email format" is displayed

  Examples:
    | invalid_email       |
    | notanemail          |
    | missing@domain      |
    | @domainonly.com     |
    | spaces in@email.com |

Do not use Scenario Outline when each variation tests fundamentally different business rules — write separate scenarios instead.

Step Reuse and Generalization

Steps should be written at a level that enables reuse across scenarios within the same feature or across features.

Reusable step styleExample
Good reusable stepGiven an authenticated user
Too specific to reuseGiven a user with email "alice@example.com" and password "SecurePass!" who has completed MFA

Vocabulary Rules

  • Use Given for preconditions — the initial state or context.
  • Use When for the trigger — the action or event being performed.
  • Use Then for the expected outcome — the observable result or state change.
  • Use And and But to extend steps within the same clause.
  • Avoid But as the first step of a scenario.
  • Use Background for setup shared across all scenarios in a feature file.
  • Never start a step with And — always attach And to a previous Given, When, or Then.

Scenario Coverage Matrix

For each story or feature, generate scenarios across these coverage categories:

Coverage TypeRequiredDescription
Happy PathYesPrimary successful flow from start to finish
Business Rule ValidationYesBoundary values, role permissions, state transitions, allowed vs. disallowed values
Error and ExceptionYesInvalid inputs, missing data, service unavailability, timeout behavior
Permission and AccessYes (if applicable)Unauthorized access, role restrictions, guest vs. authenticated flows
Data IntegrityYes (if applicable)Persistence, consistency, rollback, duplicate handling
Performance and TimingConditionalOnly when the original requirement specifies time thresholds or load conditions
AccessibilityConditionalOnly when the original requirement specifies WCAG, screen reader, or assistive tech needs
SecurityConditionalOnly when the original requirement specifies auth, encryption, audit, or data protection

The minimum required for any story is one Happy Path, one Business Rule, and one Sad Path scenario.

Completeness Validation

Before generating the final output, verify that:

  • Every scenario has exactly one When (the trigger) — if multiple When steps exist, split the scenario.
  • Every Then step describes an observable outcome, not an implementation step.
  • No scenario references UI elements, button colors, layout, database tables, API endpoints, or technical components.
  • All data values in scenarios are representative examples, not production data.
  • Boundary values are explicit (e.g., "maximum 50 characters", "at most 10 attempts").
  • Error messages are quoted verbatim — include the expected message string in the Then step.
  • Each scenario is self-contained and executable independently.
  • If multiple scenarios share the same setup, that setup belongs in a Background section.

Output Structure

Standard Format

# Acceptance Criteria: <Feature or Story Title>

## Feature Context
- **Feature:** <Name of the functionality being described>
- **Primary Business Rule:** <One-sentence rule that governs the core behavior>
- **Scope Boundaries:**
  - In scope: <What is included in these criteria>
  - Out of scope: <What is explicitly NOT covered by these criteria>

## Acceptance Scenarios

### Scenario 1: <Descriptive title — Happy Path>
**Type:** Happy Path

**Given** <initial context, actor, and preconditions>
**And** <additional context if needed>
**When** <the action or trigger performed by the actor>
**Then** <observable outcome — the primary result>
**And** <additional outcomes if needed>

### Scenario 2: <Descriptive title — Business Rule Boundary>
**Type:** Business Rule Validation

**Given** <context with specific data or role condition>
**When** <action with boundary or role condition>
**Then** <specific enforced outcome>
**And** <additional enforced outcome if needed>

### Scenario 3: <Descriptive title — Error or Sad Path>
**Type:** Sad Path / Error Handling

**Given** <error or failure precondition>
**When** <action is attempted>
**Then** <safe, visible, or recoverable error behavior>
**And** <no unintended side effects are produced>

<!-- continue for all required scenarios -->

Scenario Outline Format (when applicable)

### Scenario Outline: <Descriptive title for parameterized behavior>

**Given** <initial context>
**When** <action with parameterized input "<input>">
**Then** <observable outcome for that input>

**Examples:**
| Input | Expected Outcome |
| --- | --- |
| <value 1> | <outcome 1> |
| <value 2> | <outcome 2> |

Clarification Questions Format

If the input is too vague, use this format to ask before generating:

## Clarification Questions Required

Before generating complete acceptance criteria, the following information is needed:

1. **<Question about actor, scope, or data boundary>**
   - Why it matters: <Impact on criteria accuracy>
   - Options if known: <Possible answers or constraints>

2. **<Question about error handling, integration, or business rule>**
   - Why it matters: <What would be missed without this answer>

Quality Summary

After the scenarios, include this summary table:

## Coverage Summary

| Scenario | Type | Rule Validated |
| --- | --- | --- |
| Scenario 1 | Happy Path | <Primary success flow> |
| Scenario 2 | Business Rule | <Specific rule or boundary> |
| Scenario 3 | Sad Path | <Specific error or failure> |
| ... | ... | ... |

| Coverage Check | Status |
| --- | --- |
| Happy Path present | ✅ / ❌ |
| Business Rule scenario(s) present | ✅ / ❌ |
| Sad Path scenario(s) present | ✅ / ❌ |
| All scenarios independently executable | ✅ / ❌ |
| No implementation details in steps | ✅ / ❌ |
| No ambiguous or vague language | ✅ / ❌ |

Handling Known Artifact Types

From spec-architect or solution-architect artifacts

  1. Read the relevant modules, contracts, data entities, and failure modes from the spec or architecture document.
  2. Generate acceptance criteria that map to the contracts and data ownership defined there.
  3. Ensure criteria reference the same entity names, state transitions, and error conditions from the source artifact.
  4. Preserve requirement or module IDs if provided and traceable.

From user stories with missing elements

If the input story lacks:

  • Actor specificity: Infer the most likely actor from the action described and note the assumption.
  • Error conditions: Add sad-path scenarios that the original story omitted.
  • Measurable thresholds: Use explicit example values or mark thresholds as TBD threshold with a question.
  • Scope boundaries: Ask or infer and document the assumption.

Anti-Patterns to Avoid

Anti-PatternWhy It FailsCorrect Approach
Imperative steps with UI actionsBrittle, not reusable, describes implementation not behaviorUse declarative steps that describe outcomes
Multiple When steps in one scenarioViolates "one scenario, one behavior" — causes confusion about what is being testedSplit into separate scenarios
Vague Then outcomesCannot be verified — ambiguous pass/failState exact expected observable outcome
Criteria with "and then" chaining multiple outcomesMakes it unclear which assertion failedSplit outcomes into separate Then steps or separate scenarios
Using "should" or "could"Describes a possibility rather than a requirementUse "must" language or state the actual expected behavior
Including production data valuesIntroduces real data risk and makes scenarios non-reusableUse representative, fictional example data
Describing UI layout or component namesTies criteria to implementation, breaks when UI changesDescribe the capability, not the interface
Writing criteria before understanding the domain ruleProduces technically correct but semantically wrong criteriaAsk clarification questions first

Quick-Reference Gherkin Rules

  • Given sets the stage — preconditions and initial state.
  • When is the trigger — a single action or event.
  • Then is the assertion — a single observable outcome.
  • And/But extend the current step — do not start a scenario with these.
  • Background is shared setup — do not repeat across scenarios.
  • Scenario Outline + Examples replaces N duplicate scenarios with one parameterized scenario.
  • Steps should be self-explanatory to a non-technical reader.
  • Each step should fit on one line.
  • Scenario names must be descriptive titles, not step-by-step descriptions.

Present Results to User

Lead with the complete scenario set. Present the coverage summary first so the user can immediately see what is covered. Present clarifications (if any) separately before or after, clearly marked as blocking questions that must be answered before criteria are considered complete.

Response Style

  • Be precise. Each step must be understandable by a product manager, developer, and QA engineer without explanation.
  • Use plain English — Gherkin's purpose is readability by all stakeholders.
  • State data values as representative examples: email "user@example.com", amount "1000.00", code "ABC123".
  • Quote exact error messages in Then steps: Then an error message "Email format is invalid" is displayed.
  • Use neutral role names: authenticated user, administrator, guest, system actor, buyer, operator.
  • Mark unknown thresholds as TBD threshold and flag as an open question.
  • Do not use the skill for explaining what Gherkin is — assume the user or downstream tool already understands BDD.

Troubleshooting

  • Input is a full PRD or spec: Extract the functional requirements relevant to the specific story or feature being requested, then generate criteria for that subset.
  • User asks for bullet-point criteria instead of Gherkin: Gently redirect to Gherkin Given/When/Then — explain that this format is required for verifiability and potential automation. If the user insists, produce both formats.
  • Too many scenarios (>10): The story or feature scope is likely too large. Mark it as a candidate for splitting and provide criteria for the happy path + most critical paths first.
  • Input has contradictory requirements: Surface the contradiction in the Clarification Questions section rather than guessing.
  • Scenario Outline seems too large: If the Examples table exceeds 8 rows, consider splitting into 2-3 Scenario Outlines grouped by theme or input category.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.