Acceptance Criteria
Write clear, testable acceptance criteria for user stories and feature delivery; use when defining done conditions, creating measurable requirements, applying INVEST checks, documenting negative scenarios, and aligning product, engineering, and QA on expected outcomes.
npx skills add github:pantheon-org/tekhne --skill project-mgmt--issue-tracker-toolkit--acceptance-criteriaNavigation hub for writing measurable, test-ready acceptance criteria.
Use When
- “Write acceptance criteria for this feature.”
- “Define done conditions for this story.”
- “Create testable requirements before implementation.”
- “Apply INVEST quality checks to this story.”
When Not to Use
- Architecture decisions and system design tradeoffs.
- Deep technical specifications about implementation internals.
Workflow
- Capture user outcome and business intent.
- Select criteria format (Given/When/Then or rule-oriented).
- Draft must-pass criteria with measurable outcomes.
- Add negative and boundary scenarios.
- Validate with checklist before sign-off.
Worked Example
Starting Point (Vague Requirement):
“Users should be able to reset their password easily.”
Step 1: Capture Intent
- User outcome: User regains account access after forgetting password.
- Business intent: Reduce support tickets; maintain security.
Step 2: Select Format Choose Given/When/Then (Gherkin) for clarity.
Step 3: Draft Must-Pass Criteria
Given a user is on the login page
When they click "Forgot Password"
Then a password reset form appears within 1 second
Given a user enters a valid email in the reset form
When they click "Send Reset Link"
Then an email is sent within 30 seconds
And the email contains a clickable reset link valid for 24 hours
Given a user clicks the reset link from the email
When they enter a new password (min 8 chars, 1 uppercase, 1 number)
And click "Update Password"
Then the password is updated
And they are redirected to login within 2 seconds
Step 4: Add Negative & Boundary Scenarios
Given a user enters an unregistered email
When they click "Send Reset Link"
Then they see "Email not found" message (no account enumeration)
Given a user's reset link has expired (>24 hours old)
When they click the link
Then they see "Link expired, request a new one"
Given a user enters a weak password (e.g., "pass")
When they click "Update Password"
Then validation error appears: "Password must be 8+ chars with uppercase and number"
Step 5: Validation Checklist
- ✓ All criteria are measurable (pass/fail).
- ✓ Happy path (valid email → reset → new password) covered.
- ✓ Failure paths (invalid email, expired link, weak password) covered.
- ✓ Wording describes outcomes, not implementation (“email is sent within 30s” not “use SendGrid API”).
- ✓ Scope clear: password reset flow only, not account recovery via SMS.
- ✓ Product, engineering, and QA can all understand and test.
Quick Commands
# Find vague language
grep -nE "\b(should be|user-friendly|fast|easy|good)\b" <file>.md
# Count checklist criteria lines
grep -nE "^- \[ \]" <file>.md | wc -l
# Detect missing negative/error words
grep -niE "invalid|error|timeout|denied|failed" <file>.md
Expected Output
User Story:
As a [role], I want [action], so that [benefit].
Acceptance Criteria (Must Have):
- [ ] ...
- [ ] ...
Negative/Edge Scenarios:
- [ ] ...
Out of Scope:
- ...
Anti-Patterns
NEVER use vague, non-measurable criteria
WHY: vague language cannot be tested objectively. BAD: “The system should be fast.” GOOD: “Search returns in <= 2s for 95% of requests.”
NEVER write implementation instructions as acceptance criteria
WHY: criteria define outcomes, not implementation details. BAD: “Use JavaScript validation on submit button click.” GOOD: “Invalid form input shows error message within 1 second.”
NEVER skip negative and boundary scenarios
WHY: real users hit error and edge conditions. BAD: only valid-login scenario listed. GOOD: include invalid credentials, timeout, and expired session behavior.
NEVER couple multiple behaviors into one ambiguous criterion
WHY: broad criteria hide failure source and reduce test clarity. BAD: “Checkout and email and invoice should work.” GOOD: split into separate measurable criteria.
NEVER bypass audience alignment on definition of done
WHY: misalignment causes rework at QA/review time. BAD: criteria written without stakeholder validation. GOOD: confirm criteria with product and QA before implementation.
Verification Checklist
- Every criterion is measurable (pass/fail).
- Happy path and failure paths are both covered.
- Wording describes outcomes, not implementation.
- Scope boundaries are explicit.
- Criteria are understandable by product + QA.
References
| Topic | Reference |
|---|---|
| INVEST criteria | references/invest-criteria.md |
| Gherkin examples | references/gherkin-examples.md |
| Pattern selection | references/patterns-by-type.md |
| Scenario examples | references/examples.md |
| Reusable templates | references/templates.md |
Explicit NEVER/WHY/consequence triplets with side-by-side bad/good examples. Generic warnings score low — concrete failure modes with real impact (security, correctness, performance) score high.
Runtime validation via eval scenarios proving the skill actually changes agent behaviour. Requires evals/ directory, instructions.json, ≥3 scenarios, and ≥80% instruction coverage in summary.json.
Appropriate rigidity for the skill type: strict rules for critical/security skills, balanced steps for process skills, flexible options for tool skills. Mismatched calibration (too rigid or too loose) reduces score.
Expert-only knowledge the AI couldn't derive on its own — domain-specific patterns, production gotchas, decision frameworks, and non-obvious tool behaviour. High scores mean <5% redundancy with what the model already knows.
A clear philosophy plus numbered step-by-step workflows with explicit entry/exit points. Should answer: what is the core principle, how to execute it, and when (and when not) to apply it.
Rich activation keywords and trigger scenarios in the description so the skill fires when needed. Best descriptions read like an exhaustive list of the tasks and concepts that should invoke this skill.
Copy-paste-ready code, complete runnable examples, real file paths and commands. Pseudocode and abstract descriptions score low — concrete, executable content scores high.
SKILL.md as a <100-line navigation hub pointing to focused references/ files. Content should be lazy-loaded on demand, not front-loaded. Includes actionable 'When to Use' conditions per reference.
Proper frontmatter, single-task focus, activation keywords, and cross-harness portability. Skills must work across 40+ agentic harnesses without hardcoded paths or agent-specific references.
Expert-only knowledge the AI couldn't derive on its own — domain-specific patterns, production gotchas, decision frameworks, and non-obvious tool behaviour. High scores mean <5% redundancy with what the model already knows.
A clear philosophy plus numbered step-by-step workflows with explicit entry/exit points. Should answer: what is the core principle, how to execute it, and when (and when not) to apply it.
Explicit NEVER/WHY/consequence triplets with side-by-side bad/good examples. Generic warnings score low — concrete failure modes with real impact (security, correctness, performance) score high.
Proper frontmatter, single-task focus, activation keywords, and cross-harness portability. Skills must work across 40+ agentic harnesses without hardcoded paths or agent-specific references.
SKILL.md as a <100-line navigation hub pointing to focused references/ files. Content should be lazy-loaded on demand, not front-loaded. Includes actionable 'When to Use' conditions per reference.
Appropriate rigidity for the skill type: strict rules for critical/security skills, balanced steps for process skills, flexible options for tool skills. Mismatched calibration (too rigid or too loose) reduces score.
Rich activation keywords and trigger scenarios in the description so the skill fires when needed. Best descriptions read like an exhaustive list of the tasks and concepts that should invoke this skill.
Copy-paste-ready code, complete runnable examples, real file paths and commands. Pseudocode and abstract descriptions score low — concrete, executable content scores high.
No eval scenarios available.
Acceptance Criteria Examples
Example: Checkout Submission
Given/When/Then:
Scenario: Successful checkout
Given a user has items in cart
When the user submits payment with valid details
Then an order confirmation page is displayed
And a confirmation email is sent within 5 seconds
Rule-oriented:
- Checkout confirmation includes order number.
- Order total matches cart total.
- Invalid payment returns actionable error message.
- Session timeout redirects to login and preserves cart.
Gherkin Examples for Acceptance Criteria
Use these examples when the story has ordered interactions or when scenarios will be automated.
Login
Scenario: Successful login with valid credentials
Given the user has a registered account
And the account is not locked
When the user submits valid email and password
Then the user is redirected to the dashboard
And a session is created for 24 hours
Scenario: Login fails with invalid password
Given the user has a registered account
When the user submits a valid email and invalid password
Then an "Incorrect email or password" message is shown
And the user remains on the login page
Password Reset
Scenario: Request reset link
Given the user is on the sign-in page
When the user requests password reset for a registered email
Then a reset email is sent
And the UI shows a confirmation message
Scenario: Expired reset token
Given the user opened a reset link older than 1 hour
When the user submits a new password
Then the reset is rejected
And the UI prompts the user to request a new link
API Create User
Scenario: Create user succeeds
Given a valid auth token with admin scope
When a POST request is sent to /api/v1/users with valid payload
Then the response status is 201
And the response includes id, email, role, and createdAt
Scenario: Create user fails with duplicate email
Given a valid auth token with admin scope
And a user already exists with the requested email
When a POST request is sent to /api/v1/users
Then the response status is 409
And the response includes a duplicate email error
Writing Notes
- Use one behavior-focused scenario name per scenario.
- Keep
Givento prerequisites that matter for outcome. - Keep
Whenas a single user or system action. - Keep
Thenstrictly observable and verifiable.
INVEST Criteria
Use INVEST to evaluate story and acceptance-criteria quality.
INVEST
- Independent: can be delivered without unrelated blockers.
- Negotiable: leaves room for implementation choices.
- Valuable: maps to user/business value.
- Estimable: clear enough to size confidently.
- Small: scoped for one iteration.
- Testable: acceptance checks are objective.
Practical Check
For each criterion, ask:
- Is it observable?
- Is pass/fail unambiguous?
- Does it describe user outcome?
Acceptance Criteria Patterns by Feature Type
Use these rule-oriented patterns when requirements are independent constraints rather than a single sequence.
Form Validation Pattern
Input Validation:
- Email accepts only valid format `user@domain.tld`.
- Password requires at least 12 chars, 1 number, and 1 symbol.
- Invalid fields show inline error text below each field.
Submit Behavior:
- Submit is disabled while any required field is invalid.
- Submit triggers only one request per click.
- Success clears the form and shows confirmation.
Search Pattern
Input:
- Search accepts up to 200 characters.
- Empty search shows "Please enter a search term".
Execution:
- Search triggers on Enter and on Search button click.
- Results return in <= 2 seconds for 95% of queries.
Results:
- Show hotel name, location, price, and rating.
- Show "No results found" when zero matches are returned.
API Integration Pattern
Request:
- Endpoint: POST /api/v1/users
- Requires bearer token with admin scope
- Payload must include email, name, and role
Responses:
- 201 with created user payload on success
- 400 with field-level validation errors for invalid payload
- 401 for missing/invalid token
- 403 for insufficient scope
- 409 for duplicate email
- 500 displays generic retryable service error
UI/UX Behavior Pattern
Layout:
- Primary actions remain visible above the fold on desktop and mobile.
- Content reflows to one column below 768px width.
Interaction:
- Interactive elements expose hover/focus/disabled states.
- Modal closes via explicit close action and Escape key.
Accessibility:
- Keyboard navigation reaches all actionable controls.
- Error messages are announced via assistive technology.
Measurement Pattern
Use measurable wording:
- Time:
<= 500ms,<= 2s for 95% - Quantity:
max 20 results/page - Availability:
99.9% monthly uptime - Limits:
max 100 requests/min/api key
Acceptance Criteria Templates
Template: Given/When/Then
Scenario: [name]
Given [context]
When [action]
Then [outcome]
And [additional outcome]
Template: Rule Checklist
Acceptance Criteria (Must Have):
- [ ] [measurable outcome]
- [ ] [measurable outcome]
Negative/Edge Scenarios:
- [ ] [failure handling]
- [ ] [boundary condition]
Out of Scope:
- [item]