← Blog

Definition of done for AI agents: why “done” shouldn't be the agent's word

“Done!” is the cheapest thing an agent can write. Sometimes it means the feature works; sometimes it means the code compiles and the tests the agent wrote for itself pass. Two things fix this: a criterion you can check, written before the work, and a rule that the agent shows proof instead of closing the task itself.

#Why “done” drifts

An agent finishes when it believes the task is finished. Without a criterion, that belief rests on whatever it could check from inside the session: the build passes, its own tests are green. Whether the user can actually pay, or the page actually loads on a phone, often stays unchecked. The result is the familiar “done, but it doesn't work”.

#What a good “done when” looks like

One sentence, about something visible or runnable: a command, a scenario, a screenshot, a number.

Vague

  • Payments work
  • Improve the onboarding
  • The site is fast
  • Set up the server

Checkable

  • A test card payment shows up as an order
  • A new user reaches the first saved note in under a minute, on a phone
  • The home page scores 90+ in Lighthouse on mobile
  • curl https://example.com/health returns 200 from the new server

The first criterion on the right is taken from a real node in Treeyard's example tree, “Checkout with Stripe (test mode)”. Its card shows it right under the title.

The node's menu in treeyard: a new session of any CLI, and agent jobs without a session — break into steps, write a “done when”, run the check, node diffs
The node's menu on Enter: start a session, or let an agent break the node into steps, write its “done when” or run its check.

#The agent shows proof, a person accepts

1

The agent works against the criterion

It gets the node's “done when” in its context from the first message.

2

It sets “in review” and attaches proof

A command and its output, a screenshot added to the node, its commits.

3

You look

V shows the node's diffs: everything its sessions committed.

4

You accept the work

d marks the node done. If it isn't done, it goes back with a journal entry about what is missing.

An agent can't skip the last step even if it tries: when an agent sets a node to done, Treeyard turns it into review by itself. That's by design.

Why it's worth the extra step

  • “Done” means the thing works, not that the agent thinks so
  • The proof stays in the node: a month later you can see what was checked and how
  • A mistake is caught at review, not by a user

What it costs

  • A minute of your time per node
  • Criteria have to be written before the work, not after

Questions

Can another agent do the review?
The practice behind Treeyard allows a separate reviewing session with a fresh context. But closing the node stays your call.
What counts as proof for UI work?
A screenshot. treeyard image <id> shot.png --note "what it shows" attaches it to the node.
Is this only for code?
No. “Ten strangers ordered the coffee” is a “done when” too, and probably the most important one in the tree.

More from the blog