Brand Voice Systems & Reusable Prompt Engineering
On this page
- Why One-Off Prompts Produce "AI Slop"
- The 5-Part Brand Voice Spec
- Modular Prompt Assembly with Prefix Caching
- Automated Style-Drift & Grounding Linter
- Regression Testing Prompts Before Deploying
- Three-Pass Drafting Pipeline (Draft -> Fact Audit -> Compression)
- Enforcing JSON Schemas with Bounded Retries
- Prompt Versioning, Changelogs & Few-Shot Token Budgets
- Tuning Sampling Parameters for Marketing Tasks
- Debugging in Production: How Brand Voice Systems Drift
- Practice
Why One-Off Prompts Produce "AI Slop"#
If you open a blank chat window and type "Write a landing page for our analytics tool", the output will sound like every other AI-generated page on the web: delve, unleash, supercharge, game-changer, in today's fast-paced digital landscape. One-off prompting fails because the model falls back to its average training distribution whenever you omit negative constraints, rhythm examples, and a strict separation between facts, voice, and task.
Production marketing teams replace ad-hoc prompting with a versioned Prompt System stored in Git right next to their templates and content.
The 5-Part Brand Voice Spec#
Vague adjectives like "friendly, authoritative, and bold" do nothing. Define your voice mechanically so both models and human editors can verify it:
- Sentence Rhythm & Lexicon: Target sentence length (12 to 18 words on average), active voice, plain verbs, and explicit rules on contractions and technical jargon.
- Banned Words & Formatting Rules: An explicit blocklist (unlock, elevate, seamless, revolutionize, delve, robust, cutting-edge, tapestry, pivotal) plus formatting constraints (for example, no em dashes, no en dashes, no "In conclusion", no three-item alliteration lists).
- Negative-Example Contrast Pairs: Show one "Bad (generic AI)" paragraph next to one "Good (our voice)" rewrite so the model sees the exact boundary.
- Few-Shot Gold Standards: Two or three real paragraphs written by your best human writer showing how you open an argument, explain trade-offs, and cite numbers.
- Point of View (POV): Concrete beliefs your brand holds that incumbents avoid (for example, "Most attribution dashboards double-count conversions; holdout tests tell the truth").
Modular Prompt Assembly with Prefix Caching#
Keep your BRAND_SPEC and few-shot gold-standard paragraphs in the system message, and pass the task-specific context (product facts, target keyword, audience segment) in the user message. Separating stable rules from per-task inputs lets API providers cache your system prefix, cutting latency and input token costs by 50% or more during batch runs.
import json
BRAND_SPEC = {
"audience": "Technical founders and growth engineers",
"rhythm": "Short, direct sentences (12-18 words avg). Active voice. Explain mechanisms, not hype.",
"banned_words": [
"game-changer", "supercharge", "unlock", "seamless",
"delve", "revolutionize", "cutting-edge", "tapestry",
],
"contrast_pair": {
"bad": "Unlock seamless growth and supercharge your pipeline with our cutting-edge platform.",
"good": "Cut reporting prep from 6 hours to 15 minutes using scheduled SQL exports.",
},
"formatting_rules": [
"Never use em dashes or en dashes.",
"Lead sentence 1 with the concrete problem or number.",
"Never invent statistics or features outside the context block.",
],
}
def build_messages(task: str, context: dict, schema_hint: str) -> list[dict]:
system_prompt = (
f"VOICE SPEC:\n{json.dumps(BRAND_SPEC, indent=2)}\n\n"
"RULES: Follow formatting_rules strictly. Never invent numbers."
)
user_prompt = (
f"GROUND TRUTH:\n{json.dumps(context, indent=2)}\n\n"
f"TASK:\n{task}\n\n"
f"OUTPUT FORMAT:\n{schema_hint}"
)
return [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt},
]
msgs = build_messages(
task="Write 3 hero subheadline variants (max 24 words each).",
context={"tool": "curl to Python", "libraries": ["requests", "httpx"], "price": "free"},
schema_hint='JSON list of strings: ["...", "...", "..."]',
)
print("System prefix chars:", len(msgs[0]["content"]))
print("User payload chars:", len(msgs[1]["content"]))
Automated Style-Drift & Grounding Linter#
You can catch most AI tells deterministically in Python before an editor spends time reviewing a draft. Beyond banned words and unverified percentages, check sentence-length variance and average sentence length: AI drafts often cluster robotically around 19 to 22 words per sentence with flat rhythm.
import re
import statistics
BANNED = re.compile(
r"\b(?:delve|unlock|elevate|seamless(?:ly)?|game-changer|supercharge|revolutionize|cutting-edge|tapestry)\b",
re.IGNORECASE,
)
def lint_draft(text: str, allowed_numbers: set[str], max_avg_words: float = 22.0) -> list[str]:
issues = []
if "\u2014" in text or "\u2013" in text:
issues.append("contains em/en dash")
hits = BANNED.findall(text)
if hits:
issues.append(f"banned words: {sorted(set(w.lower() for w in hits))}")
for num in re.findall(r"\b\d+(?:\.\d+)?%", text):
if num not in allowed_numbers:
issues.append(f"unverified percentage: {num}")
sentences = [s.strip() for s in re.split(r"[.!?]+", text) if s.strip()]
if sentences:
lengths = [len(s.split()) for s in sentences]
avg_len = statistics.mean(lengths)
if avg_len > max_avg_words:
issues.append(f"avg sentence too long ({avg_len:.1f} words > {max_avg_words})")
return issues
draft = "Unlock seamless growth and cut CAC by 47% today!"
print(lint_draft(draft, allowed_numbers={"15%"}))
Output:
['banned words: [\'seamless\', \'unlock\']', 'unverified percentage: 47%']
This same pattern powers automated quality gates in real publishing pipelines: catch banned phrasing, formatting violations, bloated sentences, and unsupported percentages before a human ever reads the draft.
Regression Testing Prompts Before Deploying#
Treat a prompt edit like a code change. Keep a golden_cases.json fixture with 5 to 10 representative inputs (a technical tool page, a comparison page, a lifecycle nudge, an ad hook, and a security post). Whenever you edit BRAND_SPEC, upgrade a model snapshot, or adjust temperature, run the suite through lint_draft() and inspect diffs side by side.
def evaluate_prompt_suite(drafts: list[dict], allowed_numbers: set[str]) -> dict:
passed = 0
failures = []
for d in drafts:
errs = lint_draft(d["text"], allowed_numbers)
if not errs:
passed += 1
else:
failures.append((d["id"], errs))
return {"passed": passed, "total": len(drafts), "failures": failures}
print(evaluate_prompt_suite([
{"id": "hero_1", "text": "Convert curl commands to Python requests and httpx in seconds."},
{"id": "hero_2", "text": "Unlock seamless API scraping and save 40% today."},
], allowed_numbers=set()))
Output:
{'passed': 1, 'total': 2, 'failures': [('hero_2', ["banned words: ['seamless', 'unlock']", 'unverified percentage: 40%'])]}
Three-Pass Drafting Pipeline (Draft -> Fact Audit -> Compression)#
Never ask one prompt to research, write, fact-check, and edit simultaneously. Split generation into three narrow passes so each step has one clear objective:
- Pass 1 (Grounded Draft): Generate the initial copy using only
context_pack/facts andBRAND_SPECrhythm rules. - Pass 2 (Claim & Boundary Audit): Extract every numeric claim, integration name, and promise into JSON and verify each item against
proof.jsonandproduct_facts.md. - Pass 3 (Line-Edit Compression): Cut filler transitions ("In addition," "It is worth noting that"), convert passive verbs to active verbs, and trim total word count by 20% without losing concrete details.
def compress_filler(text: str) -> str:
'''Strip common AI throat-clearing phrases deterministically.'''
filler_starts = (
"It is worth noting that ",
"In addition, ",
"Importantly, ",
"At the end of the day, ",
)
for phrase in filler_starts:
text = text.replace(phrase, "")
return text
sample = "It is worth noting that our parser runs locally. In addition, it exports clean httpx code."
print(compress_filler(sample))
Output:
our parser runs locally. it exports clean httpx code.
Combined with sentence-casing cleanup, deterministic pre-pass trimming removes the repetitive cadence that makes automated drafts feel robotic.
Enforcing JSON Schemas with Bounded Retries#
When a downstream script expects {"variants": ["...", "..."]}, raw markdown fences or conversational preambles ("Sure! Here are 3 variants:") crash json.loads(). Always request structured JSON output, strip accidental code fences, validate required keys and types, and retry at most twice with the validation error appended to the prompt before failing cleanly.
Prompt Versioning, Changelogs & Few-Shot Token Budgets#
Every prompt template in Git should carry a version string (for example, seo_brief_v2.4) and a 1-line changelog entry explaining why it changed and which golden_cases.json metric improved. Keep few-shot examples focused: 2 to 3 crisp paragraphs (roughly 350 to 500 tokens total) capture your cadence and tone without bloating every batch call.
| Prompt Version | Change Made | Golden Suite Pass Rate | Avg Words/Sentence |
|---|---|---|---|
v2.1 |
Added 8 banned words to system spec | 3/5 (2 unverified %) | 21.4 |
v2.2 |
Injected proof.json allowed numbers |
5/5 | 19.8 |
v2.3 |
Added bad-vs-good contrast pair + compression pass | 5/5 | 15.2 |
Tracking versioned pass rates turns prompt tuning from subjective guesswork into measurable engineering.
Tuning Sampling Parameters for Marketing Tasks#
| Task Type | Recommended Temperature | Structured Output | Reason |
|---|---|---|---|
| VoC JSON tagging & extraction | 0.0 to 0.1 |
Strict JSON schema | Needs deterministic classification, zero creativity |
| Technical docs & SEO drafts | 0.2 to 0.4 |
Markdown / JSON sections | Balances natural phrasing with strict fact adherence |
| Ad hook & subject line brainstorm | 0.7 to 0.9 |
JSON array of variants | Needs lexical diversity across 10 to 15 candidates |
Debugging in Production: How Brand Voice Systems Drift#
- Stuffing 2,000 words of rules with zero examples. Models follow 2 concrete few-shot paragraphs and 1 contrast pair far more reliably than 30 abstract style adjectives.
- Letting the model invent numbers. Even if you tell a model "be accurate," asking for "persuasive copy" often causes it to hallucinate "save 10 hours a week." Verify every percentage, dollar figure, and benchmark against
allowed_numbersfrom your context pack. - Using one prompt to draft and edit. Separate generation from critique: run Pass 1 to draft from facts, then Pass 2 acting as a ruthless editor whose only job is cutting filler, tightening verbs, and flagging unsupported claims.
- Silent model-version drift. Provider aliases like
-latestcan silently change tone or JSON formatting overnight. Pin exact model snapshot IDs in your config and re-rungolden_cases.jsonbefore upgrading.
Practice#
- Write a 15-line
BRAND_SPECdictionary for your own site or product, including at least 8 banned words, 1 bad-vs-good contrast pair, and 2 real sample paragraphs you wrote yourself. - Extend
lint_draft()with one custom regex check for your niche (for example, catching passive voice"is being"or vague qualifiers"very","really"). - Run your prompt suite over 5 test inputs and confirm 5/5 pass with zero linter errors.
Check your understanding
4 quick questions on this lesson. Get them all right and the lesson is marked complete.