francescomargiotta.com

How to write a good prompt: five rules with examples

Updated

A prompt is the request you write to an AI assistant. The difference between a generic answer and a useful one almost always comes down to how clear that request is.

You don't need magic formulas: a few habits are enough.

Rule one: say what you want to get

"Tell me about Lecce" leaves the AI to guess. "Plan a two-day itinerary in Lecce for a couple who love baroque architecture and local food" points to a concrete result. State the goal, not just the topic.

Rule two: give the context it needs

The AI doesn't know who you are, what you've already tried or what constraints you have. Say who the text is for, the level of expertise, the time or budget, and paste the material it should work on instead of hoping it remembers.

Avoid pasting sensitive data: passwords, health information, confidential work material.

Rule three: ask for the format

Describe what the ideal answer looks like: a three-column table, a list of five points, an email of at most ten lines in a friendly tone. Specifying the format cuts down on wasted rounds.

Rule four: show an example

If you want a specific style, paste a short example and ask it to follow it. An example is often worth more than a paragraph of instructions.

Rule five: improve the first answer

The first answer is a draft. Reply with targeted corrections: "shorter", "less formal", "add a practical example", "remove the third point".

You can also ask the AI to question you before it answers: "Before writing, ask me everything you need to know".

A before and after

Before: "Write an email for my boss."

After: "Write an email to my boss asking for two days off on November 12 and 13. Friendly, direct tone, at most eight lines, and mention that I've already handed my tasks over to a colleague."

What a good prompt doesn't fix

A good prompt improves the result a lot, but it doesn't make it infallible: answers still need checking, especially when they contain data, dates or quotations.

Go deeper in the book

LLMs Unpacked
LLMs Unpacked

"LLMs Unpacked" explains what happens after you press enter: how text becomes tokens and how the model builds its answer one piece at a time. It helps you see why a clear request changes the result so much.

See the book

More guides