Sub topic 6
Write a specification for each format
This chapter assumes you can write prompts for a chat model, know what channels like email, LinkedIn, and short video are used for, and can read basic Python. You have already extracted a core message and chosen target formats. Now you turn each chosen format into a written specification, a spec, that a prompt and a checker can both use.
Why a spec beats "write a LinkedIn post"
A request like "turn this into a LinkedIn post" leaves the model to guess the length, the structure, who the reader is, and what to leave out. It will guess differently on each run. You then edit the guesses by hand, and the editing time is what repurposing was meant to save.
A format spec fixes those guesses in one place. It is a short, written description of what a finished piece must look like for one channel. It has three jobs:
- It tells the model exactly what shape to produce.
- It gives a reviewer a list to check the draft against.
- It lets code check the measurable parts automatically.
Write a spec once per format and reuse it for every asset. The prompt changes with each source asset, but the spec stays stable.
What goes into a spec
A useful spec separates facts about the channel from facts about your preferences. The table lists the fields that cover most marketing formats.
| Field | What it answers | Example |
|---|---|---|
| name | Which format is this? | `linkedin_post` |
| channel | Where will it be published? | LinkedIn feed |
| audience | Who reads it, and what do they already know? | Operations managers who know the problem but not our product |
| max_words | How long can it be? | 200 |
| structure | What parts, in what order? | Hook line, three short paragraphs, one closing question |
| must_include | What has to appear? | A call to action, the core message |
| must_avoid | What must not appear? | Jargon, hashtags in the body, clickbait phrases |
Each field should be something you can verify. "Engaging" is not a spec. "A hook in the first line that states the core message as a claim" is.
Length
Set a limit that fits the channel, and state it as a maximum. Models are unreliable at hitting an exact word count but fairly good at staying under a limit. A maximum is also what you check for. If a format has a hard platform limit, set your limit below it with some margin. A post that must stay under 3,000 characters should aim for about 2,400, because a model's idea of length and a platform's character counter often disagree.
Use the unit the channel uses. Email subject lines are limited by characters because inboxes truncate them. Video scripts are better measured by spoken time. A rough rule is 130 to 150 spoken words per minute, so a 60-second script fits about 150 words, including pauses.
Structure
Structure is the most valuable field because it makes drafts predictable. Name the parts in order and say how big each one is. Compare two versions:
- Weak: "A short newsletter with the main points."
- Strong: "Subject line (under 60 characters), a two-sentence intro, exactly three bullets of one sentence each, one call to action."
The strong version can be checked by counting bullets. It also tells the model where each claim from the source goes. If your source has five key claims and the format has three bullets, you now see a decision that someone must make: which three claims matter most. Make that decision in the spec or the core message, not by letting the model choose silently.
Audience
The same core message needs different framing for different readers. Audience goes beyond a job title. Say what the reader already knows, what they care about, and how they read the channel. A newsletter subscriber who opted in will read three bullets. A person scrolling a feed gives you one line to earn the next. Put that difference in the spec as a sentence, for example "Reads on a phone, scrolling, decides in the first line whether to continue."
Required and forbidden elements
Use must_include for things a reviewer would otherwise have to remember: a call to action, a link placeholder, a required disclosure line. Use must_avoid for patterns you know to be a problem, such as phrases your brand voice bans or claims your legal team has not approved. Keep both lists short. Long lists get partially ignored and are hard to check.
A spec as code
Storing specs as data keeps them consistent and lets you reuse them across prompts and checks. This version extends the dataclass used later in the batch workflow with the audience and the two lists. It also adds a function that checks the measurable parts of a draft.
from dataclasses import dataclass
@dataclass(frozen=True)
class FormatSpec:
name: str
channel: str
audience: str
max_words: int
structure: str
must_include: tuple[str, ...] = ()
must_avoid: tuple[str, ...] = ()
LINKEDIN = FormatSpec(
name="linkedin_post",
channel="LinkedIn feed",
audience="Operations managers who know the problem but not our product; read on a phone",
max_words=200,
structure="Hook line, three short paragraphs, one closing question",
must_include=("?",),
must_avoid=("click here", "game-changer"),
)
def check_draft(draft: str, spec: FormatSpec) -> list[str]:
problems = []
count = len(draft.split())
if count > spec.max_words:
problems.append(f"too long: {count} words, limit {spec.max_words}")
lowered = draft.lower()
for phrase in spec.must_include:
if phrase.lower() not in lowered:
problems.append(f"missing required element: {phrase!r}")
for phrase in spec.must_avoid:
if phrase.lower() in lowered:
problems.append(f"contains forbidden phrase: {phrase!r}")
return problems
if __name__ == "__main__":
draft = "Most reports are read once. Ours is a game-changer for planning."
for problem in check_draft(draft, LINKEDIN):
print(problem)Running this prints two problems: the draft has no question mark, and it contains the banned phrase "game-changer". The spec is frozen=True so a spec cannot be changed by accident in the middle of a batch run. The lists are tuples for the same reason.
The check covers only what code can verify. It cannot tell whether the hook is good or whether there are exactly three paragraphs. For those, you either add a structural check (see below) or leave them to the human reviewer.
From spec to prompt
The spec feeds the prompt directly. The next chapter builds the full repurposing prompt, but the connection is simple. Each spec field becomes one line of instructions. The length field becomes "at most N words". The structure field becomes "Structure: ...". The must_include and must_avoid lists become short sentences. The audience becomes a line that tells the model who it is writing for.
Because both sides read the same object, they cannot drift apart. If you change the word limit from 200 to 150, the prompt and the check both change.
Checking structure
Some structure rules can be checked cheaply. If a spec says "exactly three bullets", count lines that start with - . If it says "subject line under 60 characters", read the first line. Add these as small, format-specific checks, but be selective. A check that is wrong in one case in ten will train reviewers to ignore it.
def count_bullets(draft: str) -> int:
return sum(1 for line in draft.splitlines() if line.lstrip().startswith("- "))
def subject_line(draft: str) -> str:
first = draft.strip().splitlines()[0] if draft.strip() else ""
return first.removeprefix("Subject:").strip()
newsletter_draft = "Subject: Three ways to cut report time\nIntro text.\n- One\n- Two\n- Three"
print(count_bullets(newsletter_draft)) # 3
print(len(subject_line(newsletter_draft))) # 31These checks depend on a predictable layout. A later chapter shows how to ask for structured output so you do not have to parse free text at all.
Common errors
- Vague adjectives instead of rules. "Punchy" and "professional" mean different things on each run. Replace them with observable rules such as sentence length or banned phrases, and keep the tone itself in the brand voice instructions.
- Mixing voice into the spec. Voice applies to every format, while a spec applies to one. If you copy voice rules into each spec, they diverge over time. Keep them separate and combine them in the prompt.
- Limits that conflict with structure. A 100-word limit with a hook, five bullets, and a paragraph of background cannot be met. Count the minimum words each part needs before you set the limit.
- Specs that ask for new content. Fields like "include a statistic" push the model to invent one if the source has none. Ask for "a statistic from the source, if one exists" and let the check for unsupported numbers catch failures.
- No example of the structure. If a format has an unusual shape, add one short sample of the layout, with placeholder text rather than real claims. Do not use a real past post as the sample, because the model may copy its facts.
Keeping specs maintainable
Keep all specs in one file, version it with your other work, and record why a rule exists. When a reviewer rejects drafts for the same reason three times, the fix belongs in the spec, not in repeated manual edits. Over time the spec becomes the record of what your team learned about each channel. Also review limits when a platform changes its rules, since a spec that was correct last year may now cut off the closing line of every post.
Summary
A format spec states, for one channel, the audience, a maximum length, an ordered structure, and short lists of required and forbidden elements. Write rules a person or a function can verify. Store specs as data so the prompt and the checks read the same source. Automate the checks that are cheap and reliable, and leave judgment about quality to the review step.
Exercise
A teammate writes this spec for an email newsletter: "Short, punchy, friendly, mention the main benefits, include a customer quote." Name three problems with it and rewrite it as a spec with the fields from this chapter.
Show answer
Problems: (1) "short, punchy, friendly" are vague adjectives that cannot be checked, and tone belongs in the brand voice instructions; (2) "mention the main benefits" gives no count or order, so the model chooses which claims to include; (3) "include a customer quote" forces an invented quote if the source has none. A rewrite: name = emailnewsletter; channel = subscriber inbox; audience = opted-in subscribers who know the product category and read on a phone; maxwords = 250; structure = subject line under 60 characters, two-sentence intro, exactly three one-sentence bullets for the three highest-priority claims from the core message, one call to action; mustinclude = the call to action; mustavoid = banned phrases from the brand voice list; plus the rule "a customer quote only if one appears in the source".
Exercise
Using the FormatSpec dataclass, write a spec for a 60-second video script, and explain how you chose max_words.
Show answer
Example: FormatSpec(name="videoscript60s", channel="short vertical video", audience="viewers who scroll with sound on and decide within five seconds", maxwords=150, structure="Hook in the first 5 seconds, three beats, spoken call to action", mustinclude=("subscribe",) or another call to action fitting your campaign, must_avoid=("click the link below",) if the platform has no clickable links). The limit comes from speaking pace: about 130 to 150 spoken words per minute, so 150 words is the upper bound for 60 seconds, and a lower value such as 130 leaves room for pauses.
Exercise
Why should check_draft report problems as a list instead of stopping at the first one?
Show answer
A draft can fail several rules at once, such as being too long and containing a banned phrase. Returning every problem lets the reviewer, or a retry prompt, fix all of them in one pass instead of discovering them one at a time.