Prompt anatomy and frameworks
A strong prompt states the role, task, context, constraints and output format. TAG, CO-STAR and RISEN are checklists for those same parts, not techniques in their own right.
By the end
Name the parts of a strong prompt, rewrite a vague prompt into one that states them, and spot which missing part caused a generic answer.
A strong prompt states the role, the task, the context, the constraints and the output format. Frameworks like TAG and CO-STAR are checklists for those same parts. Learn the parts first and the acronyms become labels for them.
Learn
- The parts. Role (who the model is), task (what to do), context (audience, purpose, background), constraints (length, tone, must and must-not), format (shape of the answer), and examples (Day 3).
- System vs user prompt. The system prompt sets standing behavior. The user turn carries the request and the data.
- Delimiters. Wrap data in XML tags or triple quotes so the model can tell instructions from material. This also blunts prompt injection, because untrusted text is visibly marked as data.
- Say what to do, not only what to avoid. "Avoid generic phrases" works partially. "Use a concrete product detail and an unexpected image" works better. Banning a phrase can even prime it.
- Give the reason. "Keep it under 10 words because it runs on a bottle cap" beats a bare rule, because the model can apply the reason to cases the rule did not name.
Frameworks you will see named
| Framework | Stands for | Best for |
|---|---|---|
| TAG | Task, Action, Goal | Quick task prompts |
| RTF | Role, Task, Format | Simple structured outputs |
| CO-STAR | Context, Objective, Style, Tone, Audience, Response | Writing and marketing copy |
| RISEN | Role, Instructions, Steps, End goal, Narrowing | Multi-step procedures |
These are memory aids, not techniques. Tests care whether you can spot the missing part, not the acronym. ReAct, which sounds similar, is a different idea covered on Day 6.
Drill
- Start from "Write taglines for our water bottle."
- Rewrite it with CO-STAR, then with TAG.
- Compare the outputs and note which missing part caused the original to be generic.
Check yourself
- Why is a positive instruction usually stronger than a negative one?
- What two jobs do XML tags do in a prompt?
Test yourself
6 multiple-choice questions and 9 flashcards on this lesson, shuffled every time, with the reason behind every answer.