← Use spec sections guides

How to write Done when

How-To Use spec sections Beginner 1061018HOWTO-1061018

HOWTO-1061018Use spec sectionsBeginner

This guide shows you how to write the Done when section in a SpecDD .sdd file.

Done when lists completion criteria. It tells humans and agents when the work is finished, which prevents both stopping too early and continuing into unrelated work.

Short answer

Use Done when for concrete, reviewable completion criteria: tests, checks, preserved behavior, unchanged boundaries, docs updates, or operational evidence. Do not put inline text after Done when:. Keep criteria local to the spec and update them when the contract changes.

Syntax

Done when:
  Missing-place behavior is covered by a check.
  Existing itinerary ordering behavior still passes.
  Destination search behavior is unchanged.

Rules:

Steps

1. Name concrete evidence

Weak:

Done when:
  It works.

Better:

Done when:
  Missing-place validation is covered by a check.

2. Cover required behavior

If Must says:

Must:
  Reject itinerary items without a place name.

Done when can say:

Done when:
  Missing-place rejection is covered by a test or equivalent check.

The completion criterion should point to evidence.

3. Include important negative boundaries

For risky nearby behavior:

Must not:
  Change destination search behavior.

Done when:
  Destination search files are unchanged.

This helps reviewers catch overreach.

4. Keep criteria local

Do not require completion criteria owned by another spec unless this spec has authority for that work. Cross-area criteria may signal that the task should be split.

5. Update stale criteria

When behavior changes, update Done when in the same review path. Stale completion criteria mislead future work.

Common mistakes

How to verify the result

Done when is useful when:

← Use spec sections guides