Skip to main content
CodeLint.Dev Dev Tools

Prompt Engineering Patterns

13 proven patterns with examples — from zero-shot to Tree of Thoughts and ReAct.

Prompts the model to reason step-by-step before giving a final answer. Dramatically improves performance on arithmetic, logic, and multi-step reasoning tasks.

When to use

Math problems, logic puzzles, legal/policy reasoning, multi-step code debugging, any task where intermediate reasoning matters.

Example: Word problem with CoT
Solve this step by step.

A store sells apples for $1.20 each and oranges for $0.80 each.
Sarah buys 5 apples and 3 oranges. She pays with a $10 bill.
How much change does she receive?

Let's think step by step:
The model works through the arithmetic explicitly, reducing errors.
Tips
  • "Let's think step by step" is the canonical zero-shot CoT trigger
  • For few-shot CoT: include solved examples that show the reasoning chain
  • Ask for reasoning before the final answer — not after
  • CoT is less useful for simple lookups; overhead not worth it