Cheat sheet
Prompt engineering cheat sheet
Role · Task · Context · Constraints · Format — the five-part prompt.
Updated 2026-07-10
Anatomy
- Role
- You are a senior React engineer…
- Task
- One verb: debug, review, write, explain, refactor.
- Context
- Stack, snippet, error, audience, goal.
- Constraints
- Must / must-not rules. Keep diffs small.
- Format
- JSON, steps, table, checklist.
Quality checks
- Specificity
- Would a junior know what to do from this alone?
- Verifiability
- Can you test the answer (run code, check UI)?
- Security
- Did you ask for XSS/authz review when relevant?
Never miss a drop
Get new guides on web development and AI, Prompt Lab tips, videos, downloads and exclusive deals — straight to your inbox. No spam, unsubscribe anytime.