Most production prompts share the same skeleton. Learn the skeleton once, reuse it forever.
┌─────────────────────────────────────────────┐
│ 1. Role / persona │
│ 2. Task / instruction │
│ 3. Context / input data │
│ 4. Constraints & rules │
│ 5. Output format specification │
│ 6. (Optional) Examples │
└─────────────────────────────────────────────┘
"Tell me about this customer feedback."
Vague task, no role, no format, no constraints. The output is unpredictable and unusable by code.
1You are a senior product analyst. ← role
2
3Classify the customer feedback below and ← task
4extract any feature requests.
5
6Feedback: ← context
7"""
8The app is great but it crashes when I export
9to PDF, and I really wish it had dark mode.
10"""
11
12Rules: ← constraints
13- Sentiment must be one of: positive, negative, mixed
14- Only list feature requests explicitly stated
15
16Respond as JSON: ← output format
17{
18 "sentiment": "...",
19 "bugs": ["..."],
20 "feature_requests": ["..."]
21}This is testable, parseable, and reliable.
""", XML tags). Prevents the model from confusing input with commands — also a security boundary (Module 5).1You are {ROLE}.
2
3Your task: {ONE_SENTENCE_GOAL}
4
5Input:
6"""
7{DATA}
8"""
9
10Rules:
11- {RULE_1}
12- {RULE_2}
13
14Output format:
15{FORMAT_SPEC}You will refine this template throughout the course.