Articles

What makes a good task for a coding agent?

· First published on LinkedIn

Most requirements are written for people: they say what the system should do. A coding agent also needs to know which code to change. Given only “payments should go through for all supported cards”, it redoes the analysis alone: it searches the codebase, guesses, fixes, and writes tests that agree with its guess.

The options

  • give the agent the requirement as it is and pay for a stronger language model, or
  • write a separate technical task next to the requirement, or
  • make the requirement itself a task at the level of code.

Our choice: the third. A good task says four things:

  • Now: what the code does today, with the file and the lines.
  • Should: the behaviour that is required.
  • Where: the place the change goes.
  • Check: the command that proves it.

If the code already does the right thing and only the description was out of date, the task says so, and the model changes instead of the code.

Two rules keep it honest

  • Every code reference is proven: the analyst may cite a line only if its own search returned it.
  • The check reaches the coder word for word, and a check that runs no tests counts as a failure.

The theory. Textbooks keep requirements free of implementation: what, never how. Agile teams know the Definition of Done: when work counts as finished. Our Check line is exactly that. Its twin, the Definition of Ready, says when a ticket can be started without asking questions. An agent cannot ask, so for an agent “ready” means the task already says where.

The price. Analysts read the code, not only the source, so analysis is slower and costs more, and line references age as the code changes. We pay once per requirement instead of on every attempt to code it.

What makes a good task for a coding agent? The same requirement given twice. In business language, a secret agent with a magnifying glass wanders between files full of question marks, and the result is a guess: a fix somewhere, with tests that agree with it. At the level of code, the task says Now, Should, Where and Check, the same agent goes straight to one file, and the result is money: payments go through.