Programming with AI
ENRU
3.11

Technique — let the AI ask the questions

a way to see what you left out

What it is

Before the AI starts work, ask it to ask you questions. The technique addresses reason 1 from article 3.1 — "you didn't say" — and addresses it better than any template, because it finds the gaps you did not know were there.

The one-line form:

Prompt
Before writing any code, ask me 3 questions whose answers
would most change the solution.

The limit of "3" matters. Without it there will be ten questions, half of them trivial, and you will get bored of answering by the fourth.

What it looks like in code

The task looks clear:

Prompt
Add a /stats command to the bot — a user's statistics for the month.
Before writing any code, ask me 3 questions whose answers
would most change the solution.

The reply:

AI reply
1. "For the month" — the last 30 days or the current calendar
   month? The database query depends on it.
2. Statistics for one's own data only, or can an admin view
   someone else's? That changes the permission check.
3. What should be shown if there is no data for the period at
   all — zeroes or a "no data" message?

All three are genuine forks, and your prompt closed none of them. Without the questions you would have got three decisions that were not yours and found out about them when the command behaved oddly.

A stronger variant

Better
Before writing any code: list the decisions you will have to
make on my behalf if I don't answer. For each one, say what
you would choose by default.

This variant is better value: it requires no answers. The AI shows a list of its decisions with the defaults, you read it and step in only where you disagree.

AI reply
I'll decide for you:
- period: the last 30 days (simpler and more usual for bots)
- access: own data only
- empty period: a "no data" message, not zeroes
- format: a list of lines, no table

One sentence — "all correct except the period, I need the calendar month" — and the task is settled.

What to tell the AI

When the technique is especially useful

  • A task in your own words, with no detail. When you have not yet thought through how it should work.
  • An unfamiliar domain. Integrating with an API you don't know, a format you are seeing for the first time.
  • Expensive rework. Migrations, changes to the shape of the data, anything hard to roll back later.

When it isn't needed

If the task is already described using the template from article 3.4, there will be no questions left — and an AI that has been asked to ask will ask something formal just to comply. On clear tasks the technique only adds a step.

Answers can be short

There is no need to answer at length; marking them is enough:

Prompt
1 — calendar month
2 — own data only
3 — "no data"

What to look for

Questions for the sake of questions. "What is your naming style?", "Do you want comments?" — formal questions that change nothing. A sign the task was clear already and the technique is superfluous here.

The AI asked and then answered itself. Sometimes it poses questions and, without waiting, carries on writing code with its own assumptions. Not fatal, but the decisions were made by it — read which ones.

More than three questions. If the limit does not hold and there are a dozen, the task is stated too broadly. Break it into parts.

Cheat sheet

  • "Ask 3 questions whose answers would most change the solution."

  • The numeric limit is required, or there will be ten.

  • Stronger: "which decisions will you make for me, and what are your defaults?"

  • One line per answer is enough.

  • On a clear task the technique is superfluous — the questions will be formal.

  • A dozen questions means the task is too broad; split it.