Prompt Engineering Techniques

Before you tweak the prompt

Decide what “good” looks like. Write down success criteria, 3–5 test cases, and a word/length target. Then iterate against that set so improvements are real, not vibes.

The core moves that matter

These three techniques do most of the work:

  1. Role + guardrails
  • Give a clear job and boundaries: who are you, what to include/exclude, how to format.
  1. Tiny examples (few‑shot)
  • One or two short examples calibrate tone, structure, and level of detail.
  1. Structure first
  • Pre-fill the shape (headings, bullets, or JSON keys) so the model completes it, not invents it.

Quick recipes

  • Improve adherence: add a role, restate constraints at the end, and pre-fill headers.
  • Reduce waffle: ask for bullets and a hard word limit; request a short takeaway.
  • Boost reasoning: “Think step-by-step, then give a 2‑sentence final answer.”
  • Compare options: “Propose 2 approaches with pros/cons and a recommendation.”
  • Extract facts: use tags and ask for structured fields you actually need.

Mini templates

[Role]
You are a careful, practical {persona}. Stay within the provided context.

[Context]
Audience: {who}
Goal: {what}
Constraints: {length, tone, exclusions}

[Instructions]
1) Outline the answer in 3 bullets.
2) Provide the answer.
3) End with a 1‑line takeaway.

[Output]
- Bullets
- Answer
- Takeaway
[Critique + Improve]
Task: {brief}
Current prompt: "{prompt}"
Do: list 3 concrete issues, then propose a revised prompt. Keep ≤120 words.

Try it live

🤖 Prompt Tester
System Prompt
You will use all inputs from the user as your system prompt.
Model: gpt-4o-miniTemperature: 0.6
0/10 messages used

Try expanding the initial system prompt and see how the AI model reacts!

Key Takeaways:

  • Role + guardrails, tiny examples, and structure-first do most of the work.
  • Define “good” up front and iterate against test cases.
  • Pre-fill the shape so the model completes rather than invents.

More Resources:

Sources: