The Prompting Playbook, Straight from the Docs
The ideas that Anthropic and OpenAI both teach, gathered into one playbook you can use today.
Anthropic and OpenAI agree on most prompting advice. Define success first. Be clear, give the reason, show varied examples and add structure. Name the format and allow the answer I do not know. Change one thing at a time.
- Few-shot
- Showing a few example answers inside the prompt.
- Tag
- A label that marks a part of the prompt, such as notes.
- Chaining
- Splitting a big job into steps, one answer feeding the next.
Anthropic and OpenAI both publish prompting guides. They are long. The good news is that they agree on most things. This lesson gathers the shared ideas into one playbook you can use today. It works in any chat tool, and it works in apps you build.
Before you tune a prompt
The Claude docs start with a warning. Do not polish a prompt until you know what success means. Write down what a good answer looks like. Collect a few test cases. Then write a first draft. Without these, you cannot tell whether a change helped.
The shared playbook
- Be clear and direct. Say what you want in plain words. Do not hint.
- Give the reason. Telling the model why a rule exists helps it apply the rule well.
- Show examples. One to three sample answers teach style better than a long description. Make them different from each other.
- Add structure. Use headings or simple tags to separate instructions, material and examples.
- Say what to do, not only what to avoid. A positive instruction is easier to follow than a ban.
- Name the format. Ask for a table, a list or three bullets.
- Put long material first and the question last. Models read long text better that way.
- Allow doubt. Say that it is fine to answer I do not know.
- Split big jobs into steps. Let one answer feed the next.
A before and after
BEFORE Write something about our new app. AFTER Goal: a launch email for people who already use our free plan. Why: we want them to try the paid plan this month. Material: <notes> ...paste the feature list here... </notes> Rules: under 120 words, friendly tone, one clear button text. Format: subject line, then the email body. Example of our tone: <example> Hi Sam, quick news... </example>
Why tags and headings help
Tags such as notes and example act like labels on boxes. The model can tell which box holds the instructions and which holds the data to read. The Claude docs often use XML-style tags. The OpenAI docs use Markdown headings and tags. Either works. Pick one style and keep it steady.
Match the prompt to the model
The OpenAI docs make one more point. Some models think before they answer. For those, give the goal and the limits, not every step. Other models do better with exact steps. The next lesson explains thinking models.
A worked mini case
Say you want a polite reply to an angry customer. A weak prompt says: reply to this email. A strong one gives the goal, the tone and the limits. It adds the refund rules and one example reply. It asks for under ninety words. The strong prompt takes two minutes longer to write. It saves many rounds of fixing.
Keep a small notebook of prompts that worked. Next time, you start from a good draft instead of a blank page.
- ✓Define success and collect a few test cases before you tune a prompt.
- ✓Be clear, give the reason, show varied examples and add structure.
- ✓Say what to do, name the format and allow the answer I do not know.
- ✓Put long material first and the question last.
- ✓Split big jobs into steps, and change one thing at a time.
Upgrade a weak prompt
- Pick a prompt you use often. Copy it into a note.
- Rewrite it with a goal, a reason, the material, rules, a format and one example.
- Run both versions three times each. Compare the answers.
- Keep the better one in a prompt playbook for later.
Q1What should you do before you tune a prompt?show answer
Write down what success looks like and collect a few test cases. Then you can tell if a change helped.
Q2Why add a reason to a rule?show answer
The model can apply the rule better when it knows the purpose. It handles new cases more sensibly.
Q3Why should examples differ from each other?show answer
If they are all alike, the model copies that one pattern. Varied examples teach the idea behind them.