Sub topic 13
Building a prompt library and variation log
This chapter covers the last step of the workflow: keeping a record of what you asked, what came back, and what happened to it. It assumes you can write a structured prompt, generate a batch of variations, check claims, and prepare copy for an A/B test. The record is what lets you repeat that process without starting from nothing.
Why keep records
Without records, a good prompt lives in one chat window and disappears. A month later you cannot say which angle was tested, which version of the prompt produced a winning line, or whether anyone checked the claims in it.
Two simple tools solve this:
- A prompt library is a collection of prompts you have used and trust, stored so you can reuse them.
- A variation log is a table with one row per draft. It records where each draft came from and what happened to it.
The library records how you ask. The log records what you got.
What goes in a prompt library
Store each prompt as a template. Keep the fixed parts (role, voice, constraints, output format) and mark the parts that change from campaign to campaign.
For each entry, note:
- A short name, such as "email subject lines by angle".
- A version label, such as
v2. - The template text, with placeholders for goal, offer, and angle.
- What changed since the last version, and why.
- Any known weakness, such as "tends to run over 50 characters".
The Python example below builds one prompt per angle from a shared brief. Only the angle changes, so the template is a good candidate for the library.
brief = {
"role": "a copywriter for a small online bookshop",
"goal": "get subscribers to start a free 14-day reading club trial",
"voice": "warm, plain, lightly humorous, no exclamation marks",
"max_chars": 50,
}
angles = ["urgency", "social proof", "benefit", "curiosity"]
def build_prompt(brief, angle):
return (
f"You are {brief['role']}.\n"
f"Goal: {brief['goal']}.\n"
f"Voice: {brief['voice']}.\n"
f"Write 3 email subject lines using the '{angle}' angle.\n"
f"Each must be {brief['max_chars']} characters or fewer.\n"
"Do not invent statistics, prices, or customer numbers.\n"
"Return one subject line per line, with no numbering."
)
prompts = {angle: build_prompt(brief, angle) for angle in angles}
print(prompts["curiosity"])When you change the template, raise the version label. Do not edit a version that already produced logged drafts, or the log will point to text that no longer exists.
What goes in a variation log
The log can be a spreadsheet or a plain CSV file. Each row is one draft:
id,date,angle,prompt_version,subject_line,claims_checked,status
S1,2026-11-26,urgency,v2,Your free trial ends soon,yes,approved
S2,2026-11-26,curiosity,v2,What would you read with 14 free days?,yes,approved
S3,2026-11-26,social proof,v2,Join the club readers keep talking about,no,needs reviewEach column has a purpose:
| Column | Purpose |
|---|---|
| `id` | A stable label to use in A/B test plans and reports |
| `angle` | The dimension you varied, so you can compare like with like |
| `prompt_version` | Links the draft to the library entry that produced it |
| `claims_checked` | Shows whether facts and compliance were reviewed |
| `status` | Tracks the draft, for example drafted, needs review, approved, tested, or rejected |
Row S3 shows why the log matters. It is not approved, and its claims are unchecked, so nobody should send it by mistake.
Connecting the log to testing
After a test, add columns for the result, such as test_date, sent_to, and open_rate. Then write one line about what you learned, for example "curiosity beat urgency for this list". Over time these notes show which angles suit which audience, and you can feed them back into the next brief.
Common errors
- Logging only the winning draft. Rejected drafts show what to avoid.
- Recording a draft without its prompt version, which breaks the link back to the library.
- Editing a template in place instead of creating a new version.
- Leaving
claims_checkedblank. Treat blank as "no".
Exercise
A teammate changes the wording of your "email subject lines by angle" prompt and saves it over the old text. Two weeks later you want to know why the v2 drafts in the log performed better than new ones. What went wrong, and what should the teammate have done?
Show answer
The old v2 text was overwritten, so the log's prompt_version column now points to a prompt that no longer exists, and you cannot tell what produced the earlier drafts. The teammate should have saved the change as a new version (v3) with a note on what changed and why, leaving v2 intact.