Prompt Engineering Guide

Prompt engineering, explained: the principles that hold up

Your simple, easy to follow guide to becoming a prompt engineering expert in a few clicks.

TextGuide
  • 25 Key Prompt Engineering Principles
  • Essential AI Tool Selection
  • Prompt Engineering Mini-Course
  • Lifetime Access & Updates

Free. Delivered to your inbox in minutes.

On this page

Prompt engineering is the practice of writing instructions for an AI model so the output is usable the first time and the same on the tenth. A prompt that works gives the model a role, context, a task, a format, examples and constraints. This page covers that structure and seven of the 25 principles I use; the full set is in the free guide.

The free guide has all 25 principles, the tool selection chapter and the mini-course. Leave your email and I send it over.

Why prompts fail

Five reasons, and each one has a fix further down the page.

  • The model had to guess the audience. "Write a product description" for a CFO and for a teenager are different jobs. If the audience is missing, the model picks one, and it is rarely yours.
  • The task was two tasks. "Summarize this and suggest improvements" gets a thin summary and thin suggestions. Split them, or order them.
  • The format was left to the model. Ask for nothing and you get the default: an introduction, bullet points, and a closing paragraph you delete.
  • There was no example of good. Models copy what they see more reliably than what they are told. One example beats a paragraph of adjectives.
  • The prompt was written once and never tested. It worked on Tuesday's input and broke on Wednesday's. A prompt that has run once has been demonstrated, and that is all.

The structure of a prompt that works

Six parts, in this order. Some prompts skip one or two of them, but I write all six first and delete later.

Part What it does One line to steal
Role Sets the standard the model works to "You are a senior editor at a trade publication."
Context Gives the facts it cannot guess "The reader is a CFO who has ten minutes."
Task Says the one thing to do "Rewrite the draft below for that reader."
Format Fixes the shape of the output "Two short paragraphs, no bullet points, under 150 words."
Examples Shows what good looks like "Here is a paragraph in the tone I want: ..."
Constraints Says what to leave out "Add no claims that are missing from the draft."

The mega-prompt template is this structure written out as a fill-in document, and it is free.

Seven of the 25 principles

The guide lists 25. These seven are the ones I use on every prompt and the ones I would teach first.

  1. Say the standard, then the task. "Write as a contract lawyer would" placed before "write the clause" changes every line that follows.
  2. Put long material before the instruction. Paste the document, then say what to do with it. When the instruction sits at the end, I get fewer misses on long inputs.
  3. One task per prompt. If you need two outputs, run two prompts, or number the steps and ask for the second only after the first is done.
  4. Show, then tell. One example of the output you want, then the description. If you only have the description, write a rough example yourself.
  5. Name the format precisely. "A table with these four columns" beats "a table". "Under 150 words" beats "short".
  6. Say what to leave out. Banned words, claims it cannot make, questions it should ask instead of assuming. Constraints do more work than the length of the section suggests.
  7. Ask it to ask. End with "Before you answer, ask me anything that would change your answer." The questions that come back tell you what your prompt left out.

How the main models differ

The structure above works on every model I have tested. What changes is where the pieces go and how much the model needs to be told. Cautious notes, because every model updates and the details move.

Model What I adjust Ready prompts
ChatGPT Custom instructions hold the role and constraints across chats, so the prompt itself can be shorter ChatGPT prompts
Claude Long material goes first, wrapped in labeled tags, and the instruction goes after it Claude prompts
Gemini Format instructions get repeated at the end of a long prompt, and the task is stated up front Gemini prompts
Grok Real-time X data changes what context means: say whether live posts are in or out Grok prompts
Perplexity It searches before it answers, so the prompt says which sources count and how to cite them Perplexity prompts

If you only learn one model, learn it on the one you already pay for. The principles carry over. The tags and settings do not.

How to test a prompt

A prompt that has run once has been demonstrated, and demonstrated is a long way from tested. The loop I use has five steps.

  1. Run it on five different inputs, including one ugly one: a messy transcript, a half-finished draft, an input with something missing.
  2. Write down what a pass looks like before you look at the outputs. Otherwise you grade on mood.
  3. Change one line at a time. Two changes at once and you learn nothing about either.
  4. Keep the failed versions. A folder of prompts that did not work is the fastest way to stop repeating them.
  5. Run the final version on a fresh input you have never seen, and read it as the person who will receive it.

The scoring rubric I use for the prompt library is on the documentation page, and it doubles as a grading sheet for your own prompts. If you would rather start from a draft than a blank page, the prompt generator writes the role, context, steps and format from a one-line description, and you test from there. For a structured course on the same material, the free AI courses page has a prompt engineering path.

What is inside the free guide

  • 25 Key Prompt Engineering Principles. The seven above and the other eighteen.
  • Essential AI Tool Selection. Which model and which tool for the job in front of you.
  • Prompt Engineering Mini-Course. The principles as lessons, in order, so you can work through them rather than read them once.
  • Lifetime access and updates. When a model changes and a principle stops holding, the guide changes with it.

Frequently asked questions

What is prompt engineering?

⌄

Prompt engineering is writing instructions for an AI model so the output is usable and repeatable. It covers what to tell the model, in what order, and how to test whether it worked. It is closer to briefing a contractor than to programming.

Do I still need prompt engineering with newer models?

⌄

Yes, though the emphasis has moved. In my experience newer models need less help with phrasing and more with context, format and constraints, because they produce something confident and polished either way. The structure on this page keeps that polish pointed at your job.

Do I need to code?

⌄

No. Every principle here works in a chat window, and the examples on this page are plain English. Code comes in only when you call a model from an application, and even then the prompt is text.

How long does it take to learn?

⌄

An afternoon for the structure, a few weeks of daily use for the habit. The structure is six parts and the principles are twenty-five short rules. The time goes on testing, which is the part people skip.

Which model should I learn on?

⌄

The one you already use every day, because the principles carry across ChatGPT, Claude and Gemini and the habit comes from repetition. Pick one, write ten prompts with the six-part structure, and test each one. Switch models later and only the tags and settings change.

Is the guide free?

⌄

Yes. You leave an email address and I send the guide, the tool selection chapter and the mini-course. Lifetime access and updates are included.

Get the free guide: 25 principles, the tool selection chapter and the mini-course, sent to your email.

Yours free. Keep it forever.

No fluff. Straight to your inbox.

Prompt Engineering Guide

Guide
Delivered by email
  • 25 Key Prompt Engineering Principles
  • Essential AI Tool Selection
  • Prompt Engineering Mini-Course
  • Lifetime Access & Updates

Free. No card required — unsubscribe any time.

Free · Instant delivery · No spam

No card, no catch. The guide is yours to keep, and you can unsubscribe any time.