Skip to content
FollowtheDamnCode

The Art of Prompting

Being specific, giving context, and iterating instead of accepting the first answer a model gives you.

Big idea

A model only knows what you actually put in the prompt, so most weak answers come from an underspecified request rather than a failing model — the fix is to be specific, give context, and iterate.

The idea

A model can only work with what you actually gave it — it has no access to the context in your head. Most disappointing answers aren't a model "failing," they're a genuinely ambiguous or underspecified prompt getting a genuinely reasonable answer to a different question than the one you meant to ask.

Think of it like

Sitting in a barber's chair and saying "just a trim" leaves the barber guessing: how much off, what style, shorter on the sides or not? A skilled barber will give you a perfectly reasonable cut that still might not be what you pictured. Bring a photo, mention you have a wedding on Saturday, and speak up halfway through if the fringe is getting too short, and you walk out happy. Prompting is that same conversation: the model is the skilled barber, and the details, the reason behind the request, and your mid-way corrections are what close the gap.

Be specific

"Write me a function to sort a list" is technically answerable a hundred different ways. "Write a Python function that sorts a list of dictionaries by their created_at key, descending, and handles a missing key by treating it as the oldest" leaves almost nothing to guess at. The gap between those two prompts is usually the entire gap in answer quality.

Give context, not just instructions

Telling the model why you want something, or what constraints it's under, lets it make good judgment calls on the parts you didn't spell out. "Summarize this for my team" and "summarize this for a Friday standup where nobody has read the source doc" produce different summaries — the second prompt gives the model something to optimize for beyond just "shorter."

Iterate instead of accepting the first answer

The first response is a draft, not a verdict. If it's close but not right, saying exactly what's wrong ("too long," "missing the edge case where the list is empty," "wrong tone for this audience") is almost always faster than starting over with a longer initial prompt trying to prevent every possible miss. Treating a conversation with a model as a back-and-forth refinement, the way you'd revise a first draft with a colleague, gets better results than treating it as a vending machine you only get one try at.

Before and after

A vague prompt leaves the model to guess the audience, format, and length:

Explain recursion.

A specific prompt answers those questions up front:

You're tutoring a student who knows loops and functions in Python but has never seen recursion.
Explain recursion in under 150 words, using a factorial example with code.
End with one common mistake to avoid.

The four things that change answers most, in order: who it's for, what form the answer takes (bullets, code, a table, a length limit), the context it needs (paste the error, the data, the draft), and an example of what good looks like.

Try it

Two prompts, the same model, side by side — running on your machine:

Which addition to a prompt usually improves the answer most?

Key terms

  • Prompt — Everything you send the model, including how it is phrased and what context comes with it.
  • Underspecified prompt — A request vague enough that many different answers would all be reasonable.
  • Context — The reasons and constraints behind a request that help the model make good judgment calls.
  • Iteration — Refining an answer through follow-up messages that say exactly what to change.

Why it matters

Prompting well isn't a trick or a hack — it's the same skill as writing a clear, unambiguous request to any other person: state the goal, give the relevant constraints, and be willing to clarify. Everything else in this track (system prompts, few-shot examples, chain-of-thought) is really just a more structured version of this same idea.