Describe the desired change

Lesson 9 of 35 · Working with AI coding agents

A request is a description of work for the agent, not a magic phrase. A useful request tells it what should change, what should stay the same, and how we will recognize a satisfactory result. The person requesting the work still decides whether that result serves the real need.

From a wish to observable behavior

Imagine a local recipe app whose search treats extra spaces as part of the search term. “Fix search” leaves many choices open. A more useful hypothetical request is:

In the recipe list, ignore spaces at the beginning and end of a search term. Keep spaces between words. An input containing only spaces should behave like an empty search and show the unfiltered list. Keep the existing case-sensitivity behavior. Inspect the current search implementation and its tests first. Add focused tests, run the relevant checks, and report the results and any checks you could not run. Stop and ask if empty search currently has a different documented meaning.

This gives the agent a scope (recipe list), desired behavior (trim outer spaces), a boundary (preserve internal spaces and case sensitivity), an edge case (all spaces), and a way to check it. It does not assume a particular file or demand a new dependency. An edge case is an input or situation near the boundary of ordinary use; it is often where an underspecified request reveals itself.

The sentence about stopping matters: if the app’s current empty-search behavior differs, the agent should expose the conflict instead of choosing silently. If the goal is genuinely unclear, ask the agent to identify questions before it proposes changes. Answer those questions before treating the resulting plan as agreed.

Describe evidence, not just activity

“Add tests” is an activity; “show that outer spaces do not alter the matches, including an all-space input” states what the tests should establish. Ask for the actual checks run and their outcomes, not simply a reassuring summary. A requested check is not evidence that it happened.

Avoid specifying every implementation detail when the code has not been inspected. If a particular solution is a real requirement, say why. Otherwise allow the investigation to reveal an existing function or pattern that makes the change smaller and easier to understand.