Prompt Engineering Cheat Sheet

The patterns, structures and fixes that reliably improve output

A one-page reference for writing prompts that work: the anatomy of a strong prompt, the six patterns worth memorising, ready-to-copy templates, and the mistakes that quietly ruin results.

Category: Prompt Engineering Difficulty: Beginner Version: 1.0 Updated: August 4, 2026 Author: Sabir

Overview

A prompt is an instruction, not a wish. The single biggest improvement most people can make is to state the ROLE, the TASK, the FORMAT and the CONSTRAINTS explicitly instead of hoping the model infers them.

Anatomy of a prompt

Include these in roughly this order. You rarely need all six, but naming them stops you forgetting the one that matters.

Part What it does Example
Role Sets voice, expertise and assumed audience You are a senior technical editor.
Task The single thing you want done Rewrite the paragraph below for clarity.
Context Facts the model cannot guess The audience is non-technical hospital staff.
Format Exact output shape Return a markdown table with 3 columns.
Constraints Hard limits and exclusions Under 120 words. No marketing language.
Examples One or two worked cases Input: ... Output: ...

Patterns worth memorising

Pattern When to use it Cue phrase
Zero-shot Simple, well-known tasks Just ask directly
Few-shot Output must match a specific style Here are two examples: ...
Chain-of-thought Multi-step reasoning or maths Work through this step by step
Role prompting Domain expertise or tone matters You are a ...
Structured output The result feeds another system Return valid JSON matching this schema
Self-critique Accuracy matters more than speed Review your answer and list any errors

Common mistakes

Each of these silently degrades output. Check them before blaming the model.

Prompt templates

Universal rewrite prompt

A dependable starting point for any "make this better" task.

SYSTEM

You are a meticulous editor. You preserve the author's meaning and voice. You never add facts that are not present in the source.

USER

Rewrite the text below for {{goal}}.

Audience: {{audience}}
Tone: {{tone}}
Hard limit: {{limit}}

Return only the rewritten text, with no preamble.

---
{{text}}
VariableDescriptionExample
{{goal}}What you want improvedclarity and brevity
{{audience}}Who will read itfirst-time customers
{{tone}}Desired registerplain, warm, non-salesy
{{limit}}A measurable constraintunder 100 words
{{text}}The source textPaste the paragraph here

EXAMPLE OUTPUT

Your booking is confirmed for Tuesday at 2pm. We will send a reminder the day before. If you need to change it, reply to this message and we will sort it out.
If the result drifts, add: "Do not change any names, dates or numbers."

Structured extraction prompt

Turns messy text into machine-readable JSON.

SYSTEM

You extract data. You return valid JSON only, with no commentary and no markdown fences.

USER

Extract the fields below from the text.

If a field is absent, use null. Never guess.

Schema:
{{schema}}

Text:
{{text}}
VariableDescriptionExample
{{schema}}The JSON shape you want{"name": string, "date": string|null}
{{text}}Source contentPaste the email here

EXAMPLE OUTPUT

{"name": "Priya Raman", "date": "2026-03-14"}
Pair this with the API's JSON mode where available — the instruction alone is not a guarantee.

FAQs

Does prompt length matter?

Only insofar as it costs tokens and can push your instruction out of focus. A precise 60-word prompt usually beats a rambling 400-word one.

Should I use "please" and "thank you"?

It makes no measurable difference to quality. Use whatever register you are comfortable with.

Why does the same prompt give different answers?

Most models sample randomly. Set temperature to 0 (or the lowest available) when you need repeatable output.

Resources