wiki / Guides / guide-prompting-basics
basicGuidesbasicsprompt-anatomygetting-startedformatting

Prompting Basics

The anatomy of a good prompt: how to combine task, context, format, constraints, and examples into requests that get useful answers on the first try.

Why prompt structure matters

A language model answers the prompt you actually wrote, not the one you had in your head. When a response misses the mark, the cause is usually missing information rather than a limitation of the model: it did not know who the output was for, what you already tried, or what "good" looks like to you.

Most strong prompts contain the same five ingredients: a clear task, relevant context, a target format, explicit constraints, and, when the output style matters, one or two examples. You will not need all five every time. Short questions do fine on their own. But when a task matters, running through this checklist takes a minute and often saves several rounds of back-and-forth.

Task: say what you want

State the action and the object plainly, ideally in the first sentence. Use a verb: summarize, rewrite, compare, draft, explain, list, critique. Vague requests produce vague answers.

Weak:

Can you help with this email?

Stronger:

Rewrite the email below so it is shorter, keeps a friendly tone,
and ends with a clear request for a decision by Friday.

The second version tells the model the action (rewrite), the goals (shorter, friendly), and the required ending. There is nothing left to guess about what "help" means.

Context: give the model what it cannot guess

Context is everything the model needs but cannot infer: who you are, who the audience is, what happened before, and any source material. Paste relevant text directly into the prompt rather than describing it. If you are asking about your code, include the code. If you are asking for a reply to a message, include the message.

Context: I run a small pottery studio. A customer emailed saying a mug
arrived chipped. This is their second order; the first went fine.
Our policy is free replacement or refund, buyer's choice.

Task: Draft a reply that apologizes, offers both options, and
encourages them to order again.

A useful habit: before sending, ask yourself what a capable stranger would need to do this task well. Whatever they would ask you for, put it in the prompt.

Format: describe the output you want

If you have a shape in mind — a table, a bulleted list, three paragraphs, a subject line plus body, JSON — say so. Models follow format instructions well, and a specified format is much easier to use downstream.

Compare these three laptops for a college student.
Format: a markdown table with rows for price, weight, battery life,
and repairability, followed by a two-sentence recommendation.

Also state the length you want ("about 200 words", "no more than five bullets"). Length instructions are approximate but they reliably shift output toward the size you need.

Constraints: set the boundaries

Constraints tell the model what to avoid or require: reading level, tone, things to exclude, assumptions to make or not make.

Explain how HTTPS works.
Constraints:
- Assume no networking background.
- No analogies involving mail or envelopes; use a different one.
- Do not cover certificate authorities; I'll ask separately.
- Keep it under 300 words.

Negative constraints ("don't do X") work, but pairing them with a positive alternative ("use a different analogy") works better, because it tells the model what to do instead of leaving a gap.

Examples: show, don't just tell

When style or structure is hard to describe, show it. One good example often communicates more than a paragraph of instructions.

Write product descriptions in the style of this example:

Example:
"The Harbor Mug — 12 oz of stoneware that holds heat like a grudge.
Dishwasher safe. Handle fits actual human fingers."

Now write descriptions in that style for:
1. A linen apron with a front pocket
2. A set of four ceramic espresso cups

Make the example genuinely representative: the model will copy its length, tone, and quirks, including ones you did not intend.

Putting it all together

Here is one prompt using all five parts. Notice that labeling the sections is optional — what matters is that the information is present.

Task: Write a job posting for a part-time barista.

Context: We're an independent cafe in a college town. Two current
staff are leaving at the end of the semester. Weekend availability
is the main thing we need. Pay is $16/hr plus tips.

Format: A short intro paragraph, then bulleted responsibilities,
then bulleted requirements, then how to apply (email us at
hiring@example.com).

Constraints: Under 250 words. Warm but not gimmicky. Do not use
the phrase "rockstar" or "fast-paced environment".

Example of our voice, from our website: "We make coffee for people
who have somewhere to be and people who absolutely do not."

Start with task and context on every prompt that matters, add format and constraints when the shape of the answer is important, and add examples when tone or structure is hard to put into words. That checklist alone accounts for most of the difference between a frustrating session and a productive one.

Suggest an edit
Updated 2026-08-18 1 revision
Crafted with precision by MnexWeb