Skip to content

How to write acceptance criteria that a coding agent can check itself

Vague issues produce vague work. Criteria that are observable, specific and tied to a test let an agent, and a reviewer, tell when the work is done.

Published by Contextingo.

An issue that says “improve the login page” gives an agent nothing to finish against. It will stop when it runs out of ideas, and the reviewer has no list to check it against.

What makes a criterion checkable

  • Observable: something you can see or measure, not a feeling.
  • Specific: names the input and the expected result.
  • Independent: can be checked on its own.
  • Tied to a test where it is possible: the criterion is the test name.

Before and after

VagueCheckable
Login should be fasterThe login request returns in under 300 ms for the seeded test user, measured by login.perf.test
Handle errorsA wrong password shows “Wrong email or password” and does not reveal whether the email exists
Support large filesUploading a 100 MB file succeeds; a 101 MB file is rejected with a 413 response

Also write down

  • Out of scope: what the agent must not touch.
  • Constraints: libraries, performance, compatibility.
  • Known dead ends, so they are not tried again.

Why it pays off

The agent reads the criteria with issue_get, works against them, and cites them in review_submit. The reviewer checks the list against the fetched CI result instead of a story. Work that is checkable is also faster to accept.

See also a review checklist for agent-written pull requests.

Questions

Good to know.

How many criteria should an issue have?

As many as it takes to say when it is done. More than seven usually means the issue should be split.

Can the agent write the criteria?

It can propose them. A person should confirm them before the work starts.

Nothing learned is lost. Nothing unchecked is done.