KNOWLEDGE HUB

How to Write Good Prompts

A simple framework to build the most effective prompts

Prompting is a double-edge sword. Do too little and you'll get poor results. But if you overcomplicate things, you'll never get anything done.

Here's a simple framework to build the most effective prompts:

Structured prompt example showing REQUIRED and OPTIONAL sections with Output, Context (What, Why, For Whom), Persona, and Pre-Prompt

Let's break it down. First, let's start with our Required Elements:

Required Elements

  1. Output
  2. Context
    • What?
    • Why?
    • For whom?

Next, let's look at our Optional Elements:

Optional Elements

  1. Persona
  2. Examples
  3. Pre-prompt
The elements of the perfect prompt diagram showing REQUIRED and OPTIONAL sections with examples

Required Elements

1) Output

A simple description of what you want the LLM to return.

Remember, AI can't read your mind. So instead of saying, "Tell me about agents," you'll want to indicate what type of output you're looking for. This includes:

  • A summary
  • Feedback on your idea
  • An answer to your specific question
  • An edited version
  • An explanation
  • A script
  • Code
  • An image

2) Context

Next, give it context. I find it helpful to answer 3 "W" questions:

a) What?

Example showing Context: What in a structured prompt with highlighted text

This step further clarifies the output.

While the output is the high-level "ask," this section gives the details and includes the format.

Questions to ponder:

  • Is your summary a paragraph or a bulleted list?
  • Do you want both the good and the bad feedback?
  • How detailed should an explanation be? (A paragraph, page, or essay?)
  • Do you want the edited version to explain why the edits were made?

b) Why?

Example showing Context: Why in a structured prompt with highlighted text

This may be obvious to you, but AI can't read your mind.

Remember, they're smart and hard-working — but they are new to the firm and lack context. And they don't know you or why you do the things you do.

The "why" can be very simple, yet inject a load of context to give you a better output. While the "why" is endless, here are some examples:

  • I'm hiring 5 new employees in the next 6 months
  • I read a lot but struggle with older classics, particularly the Russians
  • I'm coaching someone with anger issues
  • I'm trying to become an expert in Philosophy (so that I can sound smarter at parties)

c) For whom?

Example showing Context: For Whom in a structured prompt with highlighted text

This is another common communication breakdown with LLMs.

AI is going to assume that every output is intended for you, but that's not always the case.

Examples where the output is for somebody else:

  • I'm summarizing this industry report for my busy boss.
  • I'm presenting this to my board of directors.
  • I'm building a curriculum for our new college graduates.
  • I'm writing a sales page for our cold leads who know nothing about our product.

3. Adapting a Persona (Optional)

This is a fun one that new users often overlook.

You can direct AI to adapt a persona to answer your request. For example:

  • Feedback on your startup idea → ask it to play the role of a VC
  • A personal investing plan → ask it to play the role of a financial advisor
  • A legal review of a contract → ask it to play the role of a lawyer
  • A reading tutor for Crime and Punishment → ask it to play the role of a literature professor
  • Advice on fighting less with your spouse → ask it to play the role of a marriage therapist

4) Examples (Optional)

Next up: show, but don't tell.

If you want your output to look a certain way, you want to give AI some examples.

I used this approach when I got Claude to write in my voice — I added 20+ blurbs to show it my writing style.

Here's one of these writing samples:

Are you an over-optimizer? It's tempting to squeeze more into every blank moment and become a micro-tasker of sorts. While it may be efficient, it's surely exhausting. And when we reflect back on our lives — will we really cherish all the things we were able to "squeeze in?"

Another type of example would be to match the formatting:

Summarize this article using the format below.

Example:

Key Takeaway: …
Why It Matters: …
Quote: …

You could also use examples to show how to extract data consistently:

Extract the person's name, title and company from this webpage using the format below:

Input: 'Jane Doe, a VP at Anthropic, said…'

Output: Name: Jane Doe | Title: VP | Company: Anthropic

A few examples work well, but don't overload the prompt. While it might feel more comprehensive, it can also confuse the model.

5. A pre-prompt (Optional)

Finally, you can be lazy — and have the AI do the prompting for you.

Here's one sentence you can add to the end of all of your prompts:

Before you begin ask me [X] follow-up questions to better understand my request.

The best source of context?

The newest models are multi-modal.

That's a very fancy way of saying that they can take in all kinds of inputs beyond the text you type into the prompt. (We've come a long way from the model jiu-jitsu that was required for the o1-pro model.)

This includes:

  • Text files
  • PDFs
  • Spreadsheets
  • Images
  • Videos
  • Audio files
  • Codebases

Again, you'll want to strike the delicate balance of just enough context without overloading the model.

Key takeaways

If you follow this framework, your prompts are going to kick butt. Just remember: be clear, be specific and give them the right context — to ensure they're not flying blind.

AI is a messy and iterative process. Don't expect perfection out of the gates.

After all, if your new colleague got your first request wrong — would you give up on them?