Skip to content

How to Write a Good Prompt: A 5-Part Framework

A simple five-part framework for writing prompts that get better answers from ChatGPT, Claude, or any AI. Includes before and after examples.

By Orgwyse Published Last updated 7 min read

On this page
  1. The five parts
  2. Goal, with a weak prompt and a better one
  3. Context
  4. Constraints
  5. Format
  6. Example
  7. A full before and after
  8. When to add an example, and when not to
  9. Keep the prompts that worked
  10. FAQ

A useful prompt tells the model the goal, the context, the constraints, the format, and, when you have one, an example of the result. You can skip a part when it is obvious. You should not skip it when you are unhappy with the answer and you have not said it yet.

The five parts work in ChatGPT, Claude, and anywhere else you type to a model. They are not tied to a menu that will be renamed next month.

The five parts

Write them as labels if you are still learning the shape. Once it is habit, prose is fine, as long as all five questions are answered.

Goal. What should be true when the answer is done? “Help me with this email” is not a goal. “Draft a reply that declines the Friday meeting and offers Tuesday” is.

Context. What does the model need that it cannot see? The audience, the stage of the work, what you already decided, what it must not assume.

Constraints. Length, tone, sources it may use, things it must not do. Constraints are where vague answers go to die.

Format. A paragraph, a table, a checklist, a patch. If you need to paste the result somewhere, say what that somewhere accepts.

Example. One short sample of the shape you want, or one sample of the input and the output. Use this when the format is easy to miss, and skip it when the format is “three bullets.”

You do not need jargon. You need those answers. A longer prompt is not a better prompt. A prompt that omits the decision you have already made is a worse one, because the model will invent the decision.

Goal, with a weak prompt and a better one

Weak

Make this better.

Better

Rewrite the paragraph so a new teammate can follow the steps without asking what “the usual process” means. Keep every fact. You may split sentences.

The weak prompt hides the goal inside the word “better.” Better for whom, at what job? State the job.

Context

Weak

Ideas for my talk.

Better

I am speaking for 12 minutes to clinic managers who have already bought the software. They do not need a product tour. Suggest 4 talk sections that help them get their staff to actually use the booking screen.

Context is the part people skip because it feels obvious. It is obvious to you because you have been in the work all week. Unless memory or project files supply it, the model has the paragraph you pasted and little else. Claude’s memory is on by default for Free, Pro, and Max, and ChatGPT memory is covered in data controls.

Paste the source. If the source is long, paste the relevant part and say what you left out: “Below is the error and the function that throws. I left out the tests.”

Constraints

Weak

Write a post about houseplants.

Better

Explain why a pothos drops leaves indoors. 180 to 220 words. No product links. No list of ten species. Assume the reader has one plant and a north-facing window.

Good constraints are checkable. “Make it punchy” is not checkable. “No sentence over 20 words” is. “Don’t invent numbers” is. “Use only the notes I pasted” is.

If you have a real limit, say it. A 90-second answer and a 2,000-word essay are different tasks. The model will pick one if you don’t.

Format

Weak

What should I do about the flaky test?

Better

The test below fails about one run in five. Give me three numbered checks, in the order I should try them. For each, one sentence on what result would confirm that this is the cause. Do not rewrite the test yet.

Ask for the shape you will actually use. If you are going to drop the answer into a ticket, ask for a ticket: summary line, steps, expected result. If you are going to read it once, a short paragraph is enough. Asking for JSON, a memo, and a slide outline in the same breath usually gets you three half-versions.

Example

Add an example when the goal is a style or a transformation, not when it is a simple question.

Weak

Turn my notes into status updates.

Better

Turn each note into one status line. Shape: Project — state — next step. Example note: "auth. still broken for expired tokens. priya looking thursday" Example line: "Auth — expired tokens still fail — Priya checks Thursday." Notes: 1. billing export. customers ask for csv. not started. 2. onboarding email. draft done. waiting on legal for one sentence.

The example does more than a paragraph of adjectives. One short example is often enough for a simple format. For a harder transformation, vendor guidance suggests a few varied examples (Anthropic says 3 to 5; OpenAI’s best practices suggest a couple). Keep them short and clearly separated from the task. If you cannot write the example, you may not know the format yet. Decide the format first. More worked examples are in 50 reusable prompt templates.

A full before and after

Before:

Can you look at my essay and fix it? It’s for school.

After:

Prompt
Goal: Revise this essay so the argument is visible in the first paragraph and each later paragraph supports it.
Context: First-year history course. 900 words maximum. The question is whether the 1965 Voting Rights Act changed registration in Mississippi in the first two years. I am allowed to use only the two sources pasted under the essay.
Constraints: Do not add facts that are not in those sources. Do not change my conclusion. Keep my examples, but you may reorder them. Flag any sentence you had to leave unsupported.
Format: Return the revised essay, then a short list of what you changed and why.
Essay:
[paste]
Sources:
[paste]

The after version can still get a fact wrong. The constraints give you a way to check: if a sentence is not in your sources, the model was told not to write it, and you can send it back with the sentence quoted. That second turn is normal. Prompt chaining is the habit of planning those turns instead of hoping one message does the whole job.

When to add an example, and when not to

Add an example when:

  • You want a voice you can point at. “Like this, not like a press release.”
  • The output is a transformation of input, as in the status-line case.
  • The model has already given you the right content in the wrong shape. Paste its last answer and show one corrected piece. “Make the rest match this one.”

Skip the example when the format is ordinary prose, a short list, or a yes-or-no with a reason. An example you wrote in a hurry will be copied, including its mistakes.

Keep the prompts that worked

When a prompt produces something you would send, save the prompt, not only the answer. Strip out the private details and leave the slots:

Goal: … Context: the reader is [role]. Constraints: [length], use only [source]. Format: …

Store that text where you will find it next time: a note, a document, a snippet manager. Re-paste it and fill the slots. A prompt library you have to rediscover is not a library. A set you can copy is in 50 reusable prompt templates.

Don’t paste secrets, other people’s private messages, or unpublished medical and legal details into a prompt unless you have already decided the provider may store that chat. What they store, and which settings change it, is covered in Are your ChatGPT chats private?.

FAQ

Do I have to use all five parts every time?

No. A quick factual question needs a goal and, if it matters, a constraint such as “say if you are unsure.” Use all five when the last answer was generic, when the output has to fit a format, or when you are about to spend the result on real work.

Should I say “act as an expert”?

Only if you also say which decisions that role would make. “Act as an editor” does less than “cut repetition and flag unsupported claims.” The role is not a substitute for the goal.

Why did the model ignore my format?

The format was probably one line at the end of a long paste, or it conflicted with the example. Put the format in its own sentence, and make the example match it. If the answer is still the wrong shape, reply with the format sentence quoted and one corrected paragraph. Don’t restate the entire task.

Is a longer prompt always better?

No. Extra background that does not change the answer gives the model more ways to wander. Include the context the task depends on, and leave out the history that does not.

Can I reuse a prompt in another product?

Yes. The five parts are not tied to one vendor’s features. A prompt that names a button, a model nickname, or a temporary mode will break when that interface changes. Write the task, not the menu.

Last updated 17 October 2026 · Spotted something out of date? [email protected]