# acceptance-criteria > Write testable acceptance criteria in Given/When/Then (Gherkin) format for stories, epics, and features. Use when defining acceptance criteria, writing test scenarios, or when user mentions "acceptance criteria", "Given/When/Then", "Gherkin", "test scenarios", or "AC". - Author: evgeniystepanchuk - Repository: Comfanion/workflow - Version: 20260130225434 - Stars: 2 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/Comfanion/workflow - Web: https://mule.run/skillshub/@@Comfanion/workflow~acceptance-criteria:20260130225434 --- --- name: acceptance-criteria description: Write testable acceptance criteria in Given/When/Then (Gherkin) format for stories, epics, and features. Use when defining acceptance criteria, writing test scenarios, or when user mentions "acceptance criteria", "Given/When/Then", "Gherkin", "test scenarios", or "AC". license: MIT compatibility: opencode metadata: domain: agile format: gherkin --- # Acceptance Criteria Writing Skill ```xml Write testable AC in Given/When/Then format Precondition/context Action/trigger Expected outcome Additional outcomes Can be verified as pass/fail No execution order dependency Exact expected behavior Covers one complete scenario Normal, successful flow Boundary conditions (min/max/empty) Invalid input, failures, no side effects AuthN/AuthZ, 403 Forbidden NFR with measurable metrics (e.g., <200ms p95) High-level checklist (Merchant can create product, Validation works) Feature-level checklist (All CRUD works, Events published, Coverage >80%) Detailed Given/When/Then for each scenario (AC1, AC2, AC3...) Too vague → Define exact behavior Split into separate ACs Focus on WHAT, not HOW Always include negative scenarios Use measurable outcomes (<200ms, not "fast") Given valid data, When POST, Then 201 Created Given existing ID, When GET, Then 200 OK Given existing ID, When PUT, Then 200 OK Given existing ID, When DELETE, Then 204 No Content Given invalid field, When create/update, Then 400 Bad Request Given user with role, When accessing resource, Then allowed/denied ``` --- ## Example: Story-Level AC ```markdown ## Acceptance Criteria ### AC1: Create product with valid data **Given** authenticated merchant with "product:create" permission **When** POST /api/v1/products with valid payload **Then** 201 Created returned **And** product has generated UUID **And** product status is "pending" **And** "product.created" event published ### AC2: Reject invalid product data **Given** authenticated merchant **When** POST /api/v1/products with missing "name" **Then** 400 Bad Request returned **And** error response contains validation details **And** no product is created ### AC3: Reject unauthorized access **Given** user without "product:create" permission **When** POST /api/v1/products **Then** 403 Forbidden returned ``` See `template.md` for full format.