Sub topic 7
Build the repurposing prompt
What this chapter assumes
You should have a core message and a short list of key claims for your source asset, a written brand voice, and a format spec for each target channel. The earlier chapters in this tutorial cover those three inputs. You should also have written prompts for a chat model before. The Python is optional, but the prompt-building function is the clearest way to see how the parts fit together.
This chapter assembles those inputs into one prompt. It covers what each part does, how to order the parts, how to word the rule about facts, and which mistakes show up most often.
The working model
A repurposing prompt is a template with fixed slots. Four slots change per job: the source, the core message, the brand voice, and the format spec. Everything else stays the same across all formats and all assets. The fixed text is where you put your rules, so you write it once and reuse it.
The prompt answers five questions for the model:
- What is the task? (Rewrite this source as a specific format.)
- What should the reader take away? (The core message.)
- How should it sound? (The brand voice.)
- What shape must it have? (Length and structure from the format spec.)
- What may it say? (Only what the source supports.)
Each question maps to one line or block in the prompt. Keeping them separate makes failures easy to diagnose. If a draft is too long, you look at the length line. If it sounds generic, you look at the voice line. If it invents a statistic, you look at the facts rule and at the source block.
Anatomy of the prompt
The task line
Start with one sentence that names the transformation and the target: "Rewrite the source material as a linkedin_post." The verb matters. "Rewrite" tells the model to carry content across. "Write a post about this" invites it to add its own knowledge. "Summarize" produces a shorter version of the source, which is a different job and usually wrong for a channel format.
Use the format name from your spec rather than a loose description. A name like email_newsletter also lets you match drafts back to specs later.
The core message
State the core message in one or two sentences, labeled. This is the point the reader should remember, not a list of everything in the source. Without it, the model picks what to emphasize from the source, and it often picks the first section or the most quotable one. A labeled core message gives it a ranking: include whatever supports this, and drop whatever does not.
The brand voice
Pass the voice as instructions you can check, such as "plain, direct, second person, no exclamation marks, no jargon without a definition." Adjectives like "friendly and professional" leave too much open. If you have a longer voice guide, put a short version in the prompt and add one or two sample sentences from approved copy. Examples pull style more strongly than descriptions, but a long example can leak its wording into every draft. Keep samples short and vary them.
The format spec
Turn the spec into plain lines: a word cap and a structure. The structure line should name the parts in order, such as "Subject line, two-sentence intro, three bullets, one call to action." The model follows a named sequence better than a general instruction like "make it punchy."
Use a cap ("at most 200 words") instead of a target ("about 200 words"). A cap is something you can verify with a word count. Models often miss exact counts, so treat the cap as a rule you check afterward, not one the model enforces.
The facts rule
The facts rule is the line that protects you from invented claims:
Use only facts, numbers, and claims that appear in the source.
If something is not in the source, leave it out.The second sentence gives the model a safe action when a format wants something the source lacks. A video script wants a hook with a surprising number, and the source may have none. Without the permission to leave it out, the model fills the gap. Chapter 9 covers verification of the drafts, but the prompt is the first line of defense.
A reference implementation
This code builds the prompt from the four inputs. The FormatSpec dataclass holds the per-format values. The function puts the rules and the labeled inputs in a fixed order, and wraps the source in tags.
from dataclasses import dataclass
@dataclass
class FormatSpec:
name: str
max_words: int
structure: str
def build_prompt(source: str, core_message: str, voice: str, spec: FormatSpec) -> str:
return (
f"Rewrite the source material as a {spec.name}.\n"
f"Core message: {core_message}\n"
f"Brand voice: {voice}\n"
f"Length: at most {spec.max_words} words.\n"
f"Structure: {spec.structure}.\n"
"Use only facts, numbers, and claims that appear in the source. "
"If something is not in the source, leave it out.\n\n"
f"<source>\n{source}\n</source>"
)
if __name__ == "__main__":
spec = FormatSpec(
"linkedin_post",
200,
"Hook line, three short paragraphs, one closing question",
)
prompt = build_prompt(
source="Our survey of 120 teams found that weekly planning cut missed deadlines.",
core_message="Short weekly planning reduces missed deadlines.",
voice="Plain, direct, second person, no exclamation marks.",
spec=spec,
)
print(prompt)Run it and read the printed prompt. Every line you wrote in the template appears once, in the order the model reads it.
Design decisions and their reasons
Put the source last
The source is the longest block. Placing it at the end keeps the short instructions together at the top, where they are easy to read and easy to edit. It also puts the source right before the model starts writing. In long-context use, models tend to attend well to material near the end of the prompt. If your source is very long, consider repeating the facts rule in one short line after the closing tag as a reminder.
Delimit the source
The <source> tags mark where the instructions stop and the material begins. This matters for two reasons. First, the model can tell your rules apart from text in the source that happens to read like rules, such as a webinar transcript saying "make sure you subscribe." Second, it limits damage if the source contains text aimed at the model. Treat the source as data. If your source can come from untrusted places, such as scraped pages or user uploads, check for a literal </source> in it before building the prompt, and refuse or escape it.
One prompt per format
Resist asking for all formats in one call. A single prompt that requests a post, an email, and a script has to split its word budget and attention, and one weak section can hide inside a long reply. Separate calls let you set different caps, retry only the failing format, and compare results. The cost is more calls, which the batch chapter handles.
Keep fixed text fixed
Do not rewrite the template for each job. If you change the wording every time, you cannot tell whether a better draft came from the template or from luck. Version the template, such as repurpose_v3, and change it only when you have a reason you can name.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Draft contains a statistic not in the source | Facts rule missing, or no permission to omit | Add both sentences of the facts rule and check numbers afterward |
| Draft runs past the word cap | Cap given as a target, or cap stated far from the structure | State "at most N words" and check the count in code |
| Every format sounds the same | Voice is vague, or the structure line is missing | Give checkable voice rules and name the parts of the format |
| Draft summarizes the source and ignores the format | Task verb is "summarize" or the structure is not named | Use "rewrite as" with the format name and ordered structure |
| Model follows an instruction found in the source | Source not delimited or rules placed after the source | Wrap the source in tags and put the rules before it |
| Draft emphasizes a minor section | Core message missing or too long | Give one or two sentences naming the single takeaway |
Checking the prompt before you scale
Test the template on one asset and all formats before running a batch. Look at three things in each draft: whether the structure matches the spec in order, whether the word count is within the cap, and whether any number or claim is absent from the source. The number check can be automated. A simple version extracts every number from the draft and the source and lists the difference, which shows likely invented statistics. It will not catch a wrong claim written in words, so a human still reads each draft.
When a draft fails, change one thing in the template and rerun on the same asset. Changing two things at once leaves you unsure which one helped.
Summary of the template
The prompt has a task line, a labeled core message, a checkable voice, a capped format with ordered structure, a facts rule with an omit option, and a delimited source placed last. You build one prompt per format, keep the fixed text under version control, and verify length and numbers in code. The next chapter covers asking for structured output, so that the same prompt can return drafts a program can read.
Exercise
A draft for video_script_60s includes the line "83% of teams saw results," but your source mentions only "most teams." Name two places in the prompt or workflow where you could have prevented this, and say what you would change in each.
Show answer
First, the prompt: make sure the facts rule includes both sentences, "Use only facts, numbers, and claims that appear in the source" and "If something is not in the source, leave it out," so the model has permission to omit a number instead of inventing one. Second, the workflow: run the number check (unsupported_numbers) on every draft, which would flag "83%" because it does not appear in the source, and send the draft to human review before publishing. A third option is to put "most teams" into the core message or key claims, so the model has a supported phrase to use for the hook.
Exercise
Why is the source placed inside <source> tags and at the end of the prompt, and what extra check should you add if the source comes from an untrusted location?
Show answer
The tags separate your instructions from the material to rewrite, so instruction-like text inside the source is treated as data. Placing the source last keeps the short rules together at the top and puts the source next to where the model starts writing. For untrusted sources, check whether the text contains a literal </source> (or other tag-breaking text) before building the prompt, and reject or escape it.