Neylora Data & AI Academy

Free Learning Resource

Generative AI Prompt Engineering Cheat Sheet

A practical reference for writing clear prompts for LLM applications.

Prompt Structure

ROLE
You are a data science instructor.

TASK
Explain linear regression to beginners.

CONTEXT
The learners know Python basics.

CONSTRAINTS
Use a simple example and avoid advanced mathematics.

OUTPUT FORMAT
Give the explanation in five numbered steps.

Prompt Components

ComponentPurpose
RoleSets expertise or perspective
TaskStates exactly what must be done
ContextProvides relevant background
ConstraintsControls scope, style or length
ExamplesShows the expected pattern
Output FormatDefines the desired structure

Few-Shot Prompt

Example:
Input: Product is damaged
Output: Complaint

Example:
Input: Delivery was late
Output: Complaint

Now classify:
Input: The product arrived on time.
Output:

Checklist

Better Prompt

Explain Generative AI to MBA students in 200 words,
using one business example and a five-point structure.

← Back to Academy