Acceptance criteria define 'done.' When AI agents implement your specs, precise Given/When/Then scenarios are the difference between code that works and code that almost works.
Acceptance criteria answer one question: "How do we know this is done?"
In traditional development, vague acceptance criteria are annoying but survivable — the developer asks clarifying questions. With AI coding agents, vague criteria are fatal. The agent doesn't ask questions. It guesses. And it guesses wrong.
Given/When/Then is a format from Behavior-Driven Development (BDD) that structures acceptance criteria as scenarios:
Example:
``` Given a user is logged in and has admin role When they navigate to /settings/team Then they see the team management panel with member list ```
This format is powerful because it's simultaneously human-readable and machine-parseable. Your PM can write it. Your AI agent can consume it.
AI coding agents use acceptance criteria to:
Without acceptance criteria, the agent has to infer what "done" means from the spec description. This is where hallucination happens.
Bad: ``` Given a user submits the form Then the data is saved, an email is sent, and the dashboard updates ```
Good: ``` Scenario 1: Data persistence Given a user fills in all required fields When they click Submit Then the form data is saved to the database
Scenario 2: Email notification Given a user has submitted the form When the save is successful Then a confirmation email is sent to the user's address
Scenario 3: Dashboard update Given a user has submitted the form When they navigate to the dashboard Then the new entry appears in the recent activity list ```
Bad: ``` Given a user is on the page When they do the thing Then it works ```
Good: ``` Given a user is authenticated with role "editor" And they are viewing project "acme-web" change #42 When they click the "Approve" button Then the change status transitions from "review" to "ready" And a notification is sent to the change author ```
Don't just test the happy path. AI agents need to know what should NOT happen:
``` Given a user is authenticated with role "viewer" When they attempt to click the "Approve" button Then the button is disabled And a tooltip shows "Only editors and admins can approve" ```
``` Given a user submits the form with an email field containing "user@" When validation runs Then an inline error appears: "Please enter a valid email address" And the form is NOT submitted ```
Colign treats acceptance criteria as first-class entities, not footnotes. Each scenario is:
This means your AI agent doesn't just see "build a login page." It sees every specific behavior the login page must exhibit, every edge case it must handle, and every negative scenario it must prevent.
This is the tightest possible loop between "what should it do?" and "does it do it?"
Q: How many scenarios per spec? A: Typically 5–15. Fewer than 5 usually means missing edge cases. More than 15 might mean the spec scope is too large.
Q: Should acceptance criteria be technical or business-focused? A: Business-focused, written in domain language. The AI agent translates to technical implementation. This keeps criteria accessible to PMs and designers.
Q: Can AI help write acceptance criteria? A: Yes. Colign's `suggest_spec` tool can propose scenarios based on your spec. But always review them — AI tends to miss negative scenarios and domain-specific edge cases.