How do you tell a coding agent when the job is done?
Give a coding agent an observable outcome, constraints, and a check that matches the task. “Improve validation” leaves the finish line undefined.
Our example rejects empty and whitespace-only names while accepting Ada. Passing those assertions proves those cases, not that every requirement was understood.
Understand it. Then fix it.
Describe a result you can check.
Give it an observable result, constraints, and a check. Here, the rule is simple: a required name must reject empty or whitespace-only text.
A task with a finish line.
Say: fix required-name validation. Empty text and spaces must fail; Ada must pass. Keep the function signature. Add the failing case, then run the tests.
Make the rule executable.
These assertions encode the requirement. Trimming before checking length fixes this case. A green test proves these examples, not that every requirement was understood.
const required = s =>
s.trim().length > 0;
assert.equal(required(""), false);
assert.equal(required(" "), false);
assert.equal(required("Ada"), true);Use the check that fits the task.
For a visual change, give a reference and a browser check instead. Ask for evidence and remaining limits. Review that the check actually matches your goal.
Code blocks are teaching excerpts. Keep the surrounding error handling and application requirements.
Save the code excerpts ↓Read the full transcript
How do you tell a coding agent when the job is done? I said improve validation. It improved the folder names. Give it an observable result, constraints, and a check. Here, the rule is simple: a required name must reject empty or whitespace-only text. Say: fix required-name validation. Empty text and spaces must fail; Ada must pass. Keep the function signature. Add the failing case, then run the tests. These assertions encode the requirement. Trimming before checking length fixes this case. A green test proves these examples, not that every requirement was understood. For a visual change, give a reference and a browser check instead. Ask for evidence and remaining limits. Review that the check actually matches your goal. The folders are immaculate. The bug has a nicer office.