Prompt engineering is often described as a mystical art. It is not — it is engineering with patterns that work and others that don't.

1. Give a precise role

2. Structure with XML

3. Few-shot examples

4. Explicit chain of thought

5. Negative constraints

6. Minimal relevant context

7. Iterate via diff

8. Self-critique

Finish with "re-read your code and list 3 potential issues." 80% of the time, the AI finds real bugs in its own output.