How to Write Prompts That Actually Get Better Results From AI
The structure behind prompts that consistently work, the mistakes that quietly sabotage most of them, and how to fix a bad answer without starting over.
Published February 1, 2026
Most disappointing AI outputs trace back to an underspecified prompt, not a limitation of the model. Language models answer the question that was actually asked, as literally as they can interpret it, which means a vague prompt reliably produces a vague, generic answer, even from a very capable model.
The four things a working prompt usually specifies
Role: who should the model act as when answering? "Write as a senior backend engineer reviewing a pull request" produces a very different, more useful answer than no role at all.
Task: what exactly needs to happen, stated as an action, not a topic. "Explain database indexing" is a topic. "Explain database indexing to a junior developer who's about to add an index to a slow query, in under 200 words" is a task.
Format: how should the answer be structured? Bullet points, a table, a specific length, code only with no explanation. Without this, the model guesses, and its guess is often longer and more hedged than what's actually useful.
Constraints: what should the answer avoid, assume, or stay within? Audience level, tools already in use, things already tried that didn't work. Constraints cut out the generic middle-of-the-road answer a model defaults to when it doesn't know the specifics of the situation.
The mistakes that quietly sabotage most prompts
Asking for everything at once. A prompt that asks a model to research, analyze, write, and format in one pass tends to produce a shallower version of all four than four focused prompts run in sequence would.
Contradictory instructions. "Keep it brief but cover every edge case" asks for two things that trade off against each other; the model has to guess which one you actually meant.
No example when the output format matters. If a specific tone, structure, or style matters, showing one example of it does more than a paragraph of description trying to describe that style in the abstract.
Treating the first answer as final. The single highest-leverage habit is following up on a mediocre answer with a specific correction ("more concise," "assume the reader already knows X," "the second point is wrong because Y") rather than either accepting it or rewriting the whole prompt from scratch.
A practical way to build one
Start from role, task, format, and constraints as a checklist rather than trying to write a polished paragraph on the first try. It's fine, and often better, to write a prompt as literal labeled fields, then read it back once you're done. If a generated first answer misses the mark, look at which of the four is missing or ambiguous before assuming the model just "doesn't get it," since in most cases a specific correction on the actual gap gets there faster than starting over with a totally different prompt.