Sub topic 6
Write a specification for each format
This chapter assumes you can write prompts for a chat model, know the basics of email, social, and video marketing, and can read short Python. By now you have a core message and a list of target formats. A format specification turns each target into something a prompt can use.
Why a spec beats "make it shorter"
A prompt like "turn this into a LinkedIn post" leaves the model to guess the length, the structure, and the ending. Each run guesses differently, so the drafts are hard to compare and hard to check.
A format specification fixes those choices once. You write it once per format and reuse it for every asset. Three fields cover most needs:
- Name: what the model is producing, such as
linkedin_post. - Length limit: a maximum word count, because a number is easy to check.
- Structure: the parts the draft must contain, in order.
Anatomy of a good spec
Write a spec for the channel, not for the asset. A LinkedIn post is short and opens with a hook. An email newsletter has a subject line and a call to action. A 60-second video script is spoken, so it must read aloud in about a minute.
| Format | Length | Structure |
|---|---|---|
| linkedin_post | 200 words | Hook line, three short paragraphs, one closing question |
| email_newsletter | 250 words | Subject line, two-sentence intro, three bullets, one call to action |
| video_script_60s | 150 words | Hook in the first 5 seconds, three beats, spoken call to action |
The video limit is lower than the others because speech is slower than reading. At roughly 150 words per minute, 150 words fills about a minute.
Put the spec in code
A small dataclass keeps specs consistent and lets a script loop over them.
from dataclasses import dataclass
@dataclass
class FormatSpec:
name: str
max_words: int
structure: str
FORMATS = [
FormatSpec("linkedin_post", 200, "Hook line, three short paragraphs, one closing question"),
FormatSpec("email_newsletter", 250, "Subject line, two-sentence intro, three bullets, one call to action"),
FormatSpec("video_script_60s", 150, "Hook in the first 5 seconds, three beats, spoken call to action"),
]
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>"
)build_prompt reads the spec's fields and places them in fixed lines. The source sits inside <source> tags so the model can tell your instructions from the material to rewrite. The next chapter covers the prompt itself in more detail.
Common errors
- Vague structure. "Engaging and punchy" cannot be checked. "Hook line, then three short paragraphs" can.
- Length in characters when the platform counts words, or the reverse. Use the unit the channel uses. If a platform enforces a character limit, add a field for it.
- Mixing brand voice into the spec. Voice applies to every format, so keep it in its own instruction. A spec that mentions tone gets edited per channel and drifts.
- Asking for more parts than the length allows. Five required sections in 150 words forces the model to cut something, and you will not know what.
- Treating the limit as a target. "At most" is a ceiling. Drafts that come in under it are fine.
Check the spec against the output
Because each spec has a number and a list of parts, you can check drafts mechanically. A word count is len(draft.split()). A structure check is a human reading the draft against the spec's list. If a draft breaks the spec in the same way twice, fix the spec's wording, not just the draft.
Exercise
You need a 30-second video script for a short-form platform. Write the three fields of a FormatSpec for it, and explain how you chose the word limit.
Show answer
Name: videoscript30s. Max words: about 75, because speech runs near 150 words per minute, so 30 seconds holds about 75 words. Structure: for example, "Hook in the first 3 seconds, two beats, spoken call to action". The structure has fewer beats than the 60-second version because the time is shorter.