Chapter 4 · Beyond Text and Trustworthy Use
Building a Prompt Library: Names, Templates, Test Cases and Limitations
- Page 20 of 24
- 16 min read
One tested prompt is useful. Five or ten tested prompts, with names, notes and sample inputs, are a small toolbox that saves you time every week and that a colleague can pick up without asking you. This page finishes the debugging routine from Iteration and Debugging: Diagnosing Weak Outputs One Change at a Time with the harder problems (claims without support, answers that disagree with each other, a model that guesses instead of asking), and then turns your best prompts into a personal library: templates with replaceable fields, one version per audience, a list of known limitations, and a habit of re-testing, because apps and models change without notice.
What you will learn
- How to diagnose unsupported claims and repeated or contradictory answers, and how to use a self-review checklist without trusting it blindly.
- How to make the model ask for clarification instead of guessing.
- How to write a template with replaceable fields, keep separate prompts for different audiences, and record the known limitations of each prompt.
- How to compare the same prompt across the models you can use, and why you must re-check prompts after a model or product change.
- How to build and maintain a five-prompt personal library, with a template you can copy.
More diagnosis: when the content is the problem
The last page covered missing context, ambiguity, length and format. The problems below are about whether the content can be trusted. Here is the full diagnosis table, with the earlier rows repeated so that you have one table to keep. Remember: likely causes, not certain ones, and change one thing at a time.
| Symptom | Likely cause | One change to try |
|---|---|---|
| Generic or invented details | Missing context | Add the real facts and "use only these facts". |
| Does a different job than you meant | Ambiguous instruction | One action verb; name the product. |
| Too long, off-topic | No length or focus limit | Add a length limit; say what to leave out. |
| Right content, wrong shape | Format unclear | Describe the shape and show one example row. |
| Claims with no source in your text | No rule to stay with the material; the model fills gaps | Require a short quote for each claim; allow "not stated". |
| Different answers on each run, or answers that disagree | Open question; several valid readings; ordinary variation | Narrow the question and fix the criteria; run again twice. |
| Confident guess where information is missing | The model was never told it may ask or say "unknown" | Add: "If something needed is missing, ask me first." |
| Passes your test input, fails on others | Test input too easy or too narrow | Add a second, harder input to the saved test. |
Diagnose unsupported claims
An unsupported claim is a statement that your source text does not contain: a number, a reason, a quote, a source name. It is the most dangerous symptom because it sounds exactly like the supported statements. The usual cause is that nothing in the prompt tells the model to stay inside the material, and nothing gives it a way out when the material has no answer.
Weak prompt:
Why did our website visits drop in September? Here is the monthly report.Better prompt:
Using only the report below, say why website visits dropped in September.
For each reason, quote the sentence from the report that supports it.
If the report does not give a reason, write "Not stated in the report"
and do not suggest causes from general knowledge.
Report:
{report}Test for this cause: take every claim in the reply and find its quote in the report. If you cannot find it, the claim is unsupported, whatever it sounds like. A requested quote is a better check than a requested "source", because a quote can be searched in your text. Note that the model may still change a quote slightly or quote a sentence that does not really support the claim, so read the quotes, do not only count them.
Diagnose repeated or contradictory answers
Two situations. In the first, you ask the same question twice and get different answers. In the second, one reply disagrees with itself (for example, a total in the first paragraph that is different from the total in the table). Variation between runs is normal for these systems, and it is not by itself a bug. It becomes a problem when the answer should be the same each time, for example a category label or a number.
Likely causes: the question allows several valid answers, the criteria are not stated, or the input is borderline. A lower randomness setting does not fix this reliably and does not make an answer true; narrowing the question does more. When you see a contradiction, do not ask "which is right?" in the same chat and accept the first confident reply. Ask for the evidence for each version, then check the source yourself.
Better prompt:
Earlier you gave two different totals: 1,240 and 1,420.
Recompute the total from the table below, row by row, showing each addition.
Then say which of the two earlier totals matches, or "neither".
Do not change any number in the table.
Table:
{table}Then add up the numbers yourself or in a spreadsheet. The recomputation shows where the mistake was; it does not prove that the new total is correct.
Use a self-review checklist without trusting it blindly
You can ask the model to check its own answer before it replies, with a short checklist. This often catches simple problems such as a missing item, a broken word limit or a skipped format rule. But the same model that made a mistake can miss it again, and it can say "all checks passed" when they did not. So treat the self-review as a first filter, and keep your own check.
Better prompt:
Write the reply first. Then, under the line "SELF-CHECK", answer yes or no
for each item and add one line of evidence for each:
1. Body is at most 80 words (give the count).
2. Every date and number appears in the facts above.
3. Nothing was promised that the facts do not support.
4. The requested format was followed.
If any answer is no, write a corrected reply after the self-check.Example reply (illustrative; yours will differ):
SELF-CHECK
1. Yes. 61 words.
2. Yes. 2026-11-04 and the refund option are both in the facts.
3. Yes. No discount offered.
4. Yes. Subject line, blank line, body, sign-off.What to do with it: count the words yourself, find each date in your facts and read the reply once for promises. Do not accept a "Yes" without evidence. A self-check can be wrong in both directions: it can pass a flawed reply, and it can flag something that is fine. Its value is that it makes problems easier to see; it does not replace your review.
Ask for clarification instead of guessing
If a needed fact is missing, the model's default is to produce an answer anyway. Give it permission, and a rule, to stop and ask. This is often the best single fix for guessing. For a task with several missing pieces, ask it to list them as numbered questions, so you can answer by number.
Better prompt:
Draft an email inviting customers to our open day.
Before you write anything, check whether you have: the date, the time,
the place and how to register. If any of these is missing, do not write
the email. Ask me for the missing items as a numbered list, then wait.Example reply (illustrative; yours will differ):
I need a few details before I can write the email:
1. What is the date of the open day?
2. What time does it start and end?
3. What is the address or room?
4. How should customers register?What to verify: that the reply asks only for what is really missing, and does not invent defaults ("Saturday, 10:00") in brackets. Some models still guess, so if you see an invented value, repeat the rule more clearly: "Do not assume any value."
From prompts to a library
Use a prompt template with replaceable fields
A template is a prompt where the parts that change are marked as fields. You keep the wording that works and replace only the fields each time. In this tutorial, a field is written in curly braces with a clear name: {audience}, {facts}, {text}. You paste the template, replace each field by hand, and send. Always replace every field; a leftover {facts} in a sent prompt is a common slip.
Prompt:
You are a clear and polite writer.
Write one {message_type} for {audience}.
Facts (use only these):
{facts}
Constraints:
- At most {max_words} words.
- Plain words. No promises that are not in the facts.
- If a fact is missing, write [MISSING] instead of guessing.
Output format: {format}Example of filling it: message_type = "notice", audience = "parents of children in the youngest class", facts = "School trip moved to 2026-11-12; same cost; permission forms due 2026-11-05", max_words = 70, format = "title, then two short paragraphs". The template gives consistent results, and it is easy to improve: when you fix the template, every future use improves. Keep the number of fields small. A template with fifteen fields is harder to use than writing a new prompt.
Maintain separate prompts for different audiences
You can put the audience in a field, and for many tasks that is enough. But when two audiences need different content, structure and tone, keep two prompts. A weekly project update for a manager (decisions, risks, dates) is not a variation of the same update for the team (tasks, who does what, what is blocked). Two prompts with clear names are easier to test and repair than one prompt full of "if the reader is...".
| Name | Audience | What is different |
|---|---|---|
| weekly-update-manager-v1 | Manager, two minutes | 3 bullets: decisions needed, risks, dates. No task detail. |
| weekly-update-team-v1 | Team, working level | Table: task, owner, status, blocked by. Plain language. |
| weekly-update-client-v1 | Client, non-technical | Short paragraph: progress, next step, what we need from you. |
Share the common facts, but test each prompt with its own sample input and expected output, as on the previous page.
Record known limitations of a prompt
Every prompt has places where it fails. Writing them down makes the library honest, and it saves the next person (or you, in three months) from using a prompt where it does not work. Add a "Known limitations" line to each prompt card, and update it whenever you find a new failure. Be specific about what you observed.
Known limitations:
- Works on comments under 100 words each; long comments lose detail.
- Sometimes counts one complaint twice if it appears in two sentences.
- Not tested on languages other than English.
- Does not handle sarcasm reliably.
- Never use for legal or medical text.Compare the same prompt across available models
If you can use more than one assistant or model, run the same prompt, with the same input, on each, and compare the outputs with the same checklist. Differences can be large: in length, in whether the model asks for missing facts, in how closely it follows format rules. Do not decide from one run, and do not decide that one is better in general: you learn which works better for this prompt on this input. Record the results in the prompt's card with the date.
| Check | Assistant A | Assistant B |
|---|---|---|
| Follows the 3-bullet limit | Yes | No (4 bullets) |
| Invents a number | No | No |
| Asks for the missing date | Yes | Guesses a date |
| Words used | 52 | 88 |
The table is invented to show the layout; use your own results, and use the names that your apps show, with the date. A prompt that is fragile, giving good results on only one model, is a sign that it relies on that model's habits rather than on clear instructions.
Recheck prompts after a model or product change
Assistants are updated, sometimes with notice and sometimes without. The same prompt can later give a different style, a different length, or a different handling of your rules. Providers also change what features exist and where. So your saved test input and expected output are not only for repair; they are your alarm. Re-test when you notice a change in behaviour, when an app announces a new model or version, and from time to time (for example once a month) for the prompts that you depend on.
- Run each important prompt on its saved test input.
- Check the output against the expected output and the checklist.
- Write the result and the date on the card: "Rechecked 2026-11-12: passes" or "Rechecked: now 4 bullets, fixed in v3".
- If it fails, use the diagnosis table and change one thing.
Check what your app supports before you rely on a feature (file upload, voice, saved instructions, model choice). Which features exist and what they do change over time and differ between apps; this tutorial does not list them. Read your app's help pages, and remember the date you read them.
Your personal library
A library is a single file, or a folder, with one card per prompt and a short index at the top. Copy this template into your notes app and fill it for your five prompts.
PROMPT LIBRARY
Owner: {your name} Last reviewed: {YYYY-MM-DD}
INDEX
1. {name-v1} - {one line: what it does}
2. {name-v1} - {one line}
3. {name-v1} - {one line}
4. {name-v1} - {one line}
5. {name-v1} - {one line}
CARD 1
Name: {task-audience-version}
Task: {what it does}
Audience: {who reads the result}
Prompt:
{full prompt text, with {fields} for the parts that change}
Test input: {one typical input}
Expected output: {what good looks like, checked by me}
Known limitations: {what fails, what not to use it for}
Models/apps tried: {name, date, result}
Change log: {date: one change, what happened}
Next recheck: {YYYY-MM-DD}Notes for use. Keep prompts short enough to read in one screen. Delete cards that you do not use. Never put private data or real customer information in a saved test input; use invented examples, as this tutorial does. (The next page covers what not to paste into a chat.)
Where this shows up at work
- Teams: a shared library with owners and dates means a new colleague uses tested prompts from day one, and a failing prompt is repaired once for everybody.
- Freelancers and small businesses: templates for proposals, replies and posts give consistent quality and quick starts.
- Quality and compliance: known limitations and recheck dates are the first things an auditor or a manager will ask for when AI text goes to customers.
- Building AI features: a developer's prompt file, test cases and change log are the same library idea in code. See Git, APIs and Backend for AI: Advanced for prompt versioning and evaluation basics.
Common mistakes
- Accepting a claim because it sounds sure. Fix: require a quote from your material for every claim, and allow "not stated".
- Trusting a self-check. It can say "all passed" when it did not. Fix: ask for evidence in each line, then check the key points yourself.
- Letting the model guess missing facts. Fix: add the rule "ask me first" and say what counts as missing.
- Leaving fields unreplaced in a template. A sent
{facts}looks careless. Fix: read the prompt once before you send it. - Never rechecking. A prompt that worked last quarter may not work now. Fix: put a recheck date on every card.
- A library that grows without limit. Fix: keep only prompts that you use, and name them well.
Try it yourself
- Easy. For each case choose the likely cause and one change: (a) a summary of a report includes a figure that is not in the report; (b) you asked for a customer label twice and got "complaint" once and "question" once; (c) the model wrote an invitation with a made-up address.
- Medium. Take the template in this page. Fill it twice, for two audiences of your choice (for example a customer and a colleague), with the same facts. Add a self-check with evidence lines to one of them. Run both and compare: what is different, and was the self-check right?
- Hard. Build a five-prompt personal library with the copy template. Choose five tasks you really do (for example: email reply, meeting notes, summary of a long text, a table from messy notes, a translation check). For each card write a name, task, audience, prompt (use at least one template field in three of them), one test input with invented data, and an expected output that you checked. Run each prompt once; record the date, the result and at least one known limitation. For one prompt, test a second assistant if you have it, and record the result.
Answers
Easy. (a) Unsupported claim: no rule to stay with the report. Change: "Use only the report; give a quote for each figure; write 'not stated' if absent". (b) Contradictory answers: the label criteria are not stated and the comment may fit both. Change: define each label in one line and say which wins for mixed comments. (c) Guessing at missing information. Change: "If the address is missing, ask me first; do not invent one." Pass checklist: one cause each, one change each, and the change matches the cause.
Medium. A strong result has two prompts built from the same template with different values for audience, max_words and format, and the same facts. The self-check has four or five numbered items, each with an evidence line (a word count, a date found in the facts). You pass if: no field is left unreplaced; you counted the words yourself; you can say what differs between the two replies (tone, length, order); and you note whether the self-check missed anything you found.
Hard. Answers differ. Your library passes if: all five cards have all the fields of the template; names follow task-audience-version; three or more prompts use fields with clear names; test inputs contain only invented data; each expected output was checked against its input; every card has a real known limitation (not "none"); and each card has a "next recheck" date. A very strong library has a two-audience pair, as in the table above, and a change log with at least one one-line change.
Summary
- Unsupported claims need a rule to stay with the material and a quote for each claim; contradictory answers need a narrower question and an independent check.
- A self-review checklist finds easy problems. Ask for evidence per item and do not trust it blindly.
- Give the model permission to ask for missing facts instead of guessing.
- Build the library from templates with named fields, separate prompts for different audiences, and a "known limitations" line on every card.
- Compare the same prompt across the models you can use, and recheck important prompts after a model or product change, because they change without notice.
Next: Reliable and Private Prompting: Uncertainty, Evidence and Sensitive Data shows how to ask for uncertainty and evidence, and what not to paste into an assistant.

