The Anatomy of a Good Prompt
The concept
Most disappointing AI outputs aren't the model's fault — they're the result of a vague prompt. A reliable prompt almost always has four parts, and missing any one of them is where things go wrong:
- Context — who you are, the situation, and any background the model needs that isn't obvious.
- Task — the exact thing you want done, stated as specifically as possible.
- Format — how the output should look: a bulleted list, a table, a specific word count, an email, code.
- Constraints — what to avoid, the tone to use, the audience to write for, length limits.
Think of this the way you'd think about onboarding a new employee for a one-off task: if you just said "write about marketing," a new hire would have no idea where to start — what angle, for whom, how long, in what tone. You'd naturally give them the background, the specific deliverable, the format you expect, and any guardrails. An LLM needs exactly the same clarity, because it has no implicit shared context with you beyond what's in the prompt (and, if set up, a system prompt — covered in the next lesson).
The four parts don't need to appear in a rigid order or be formally labeled every time, but a prompt missing two or three of them will produce generic, unpredictable output — because the model is filling in the gaps with its own best guess about what you probably meant, and that guess is often wrong or too generic to be useful. In practice, the parts that get skipped most often are format and constraints, since people tend to describe the topic (context) and the ask (task) naturally in conversation, but forget to specify how long the answer should be or who it's for — which is exactly why so many first-draft AI outputs come back too long, too generic in tone, or shaped wrong for where they're going to be used.
It's also worth noting that these four parts scale with the complexity of the task. A one-line Slack reply might only need task and constraint ("Reply confirming the meeting time, keep it to one sentence"). A detailed report, a client proposal, or a technical document benefits from spelling out all four explicitly, often across several sentences each, because the cost of a wrong guess is much higher.
Worked example
Compare these two prompts side by side.
Vague: "Write about marketing."
This gives the model no context, no clear task, no format, no constraints. A likely output: a generic, encyclopedia-style overview of what marketing is, written at no particular length, for no particular audience — technically responsive, but useless for almost any real purpose.
Structured: "You're a B2B marketing advisor (context). Write a 150-word LinkedIn post for small SaaS founders on why churn matters more than growth (task + audience). Use a confident, no-jargon tone (constraint). Format as a short hook line, three short paragraphs, and a one-line call to action (format)."
The second prompt produces a specific, usable draft on the first try, because every decision the model would otherwise have had to guess at has been made explicit. The difference isn't "better wording" in some mystical sense — it's that four concrete questions got answered instead of left open.
A third version shows what happens with partial information: "Write a LinkedIn post about churn for SaaS founders." This has task and a hint of audience, but no format and no tone constraint — the output will likely be reasonable in topic but unpredictable in length and voice, landing somewhere between the two extremes above. Noticing which specific part is missing, rather than just "the prompt didn't work," is the skill this lesson is building.
Exercise
Take a prompt you'd realistically use at work this week — a status update, a product description, a customer reply, a social post. Write a first, natural version of it (don't overthink — write it the way you normally would). Then rewrite it explicitly filling in all four parts: context, task, format, constraints. Run both versions through an AI assistant and compare the two outputs side by side.
Then do one more pass: take your structured version and deliberately delete just one of the four parts (try removing only the constraint, leaving context, task, and format intact). Run it again and see what changes in the output. Note specifically which output needed less editing to be usable, and which single missing part made the biggest difference — this isolates, concretely, how much each part is actually doing.
Recap
- Good prompts aren't about magic phrasing — they consistently include context, task, format, and constraints, scaled to how much the task matters.
- A prompt missing any of the four forces the model to guess, producing generic or unpredictable output; format and constraints are the parts people forget most often.
- Treat prompt-writing like briefing a new employee on a one-off task: the clearer the brief, the better and more predictable the result.
Resources
- OpenAI: "Prompt engineering guide" — https://platform.openai.com/docs/guides/prompt-engineering
- Anthropic: "Prompt engineering overview" — https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview
- Google: "Prompting strategies" — https://ai.google.dev/gemini-api/docs/prompting-strategies