Default PR headlines to awareness framing, only allow announcement language for actual news
- Added _is_actual_news() detection based on PR Topic field signals (e.g. "Actual News", "New Product", "Launch") - Headline generator defaults to awareness verbs (Highlights, Reinforces, Delivers) and bans announcement verbs (Announces, Launches, Expands) - Judge prompt disqualifies fabricated events for non-news topics - Body writer prompt explicitly forbids inventing expansions, milestones, or demand claims — frames as existing capabilities - Updated skill file to match awareness-by-default approach Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fix/customer-field-migration
parent
d3b778bdb5
commit
84c81b6df4
|
|
@ -236,10 +236,28 @@ def _clean_pr_output(raw: str, headline: str) -> str:
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def _is_actual_news(topic: str) -> bool:
|
||||||
|
"""Detect whether the topic signals genuinely new news.
|
||||||
|
|
||||||
|
Returns True if the topic contains explicit markers like 'actual news',
|
||||||
|
'new product', 'launch', 'acquisition', 'partnership', 'certification',
|
||||||
|
or 'award'. The user is expected to signal this in the PR Topic field.
|
||||||
|
"""
|
||||||
|
signals = [
|
||||||
|
"actual news", "new product", "launch", "launches",
|
||||||
|
"acquisition", "partnership", "certification", "award",
|
||||||
|
"unveil", "unveils", "introduce", "introduces",
|
||||||
|
]
|
||||||
|
topic_lower = topic.lower()
|
||||||
|
return any(s in topic_lower for s in signals)
|
||||||
|
|
||||||
|
|
||||||
def _build_headline_prompt(
|
def _build_headline_prompt(
|
||||||
topic: str, company_name: str, url: str, lsi_terms: str, headlines_ref: str
|
topic: str, company_name: str, url: str, lsi_terms: str, headlines_ref: str
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Build the prompt for Step 1: generate 7 headlines."""
|
"""Build the prompt for Step 1: generate 7 headlines."""
|
||||||
|
is_news = _is_actual_news(topic)
|
||||||
|
|
||||||
prompt = (
|
prompt = (
|
||||||
f"Generate exactly 7 unique press release headline options for the following.\n\n"
|
f"Generate exactly 7 unique press release headline options for the following.\n\n"
|
||||||
f"Topic: {topic}\n"
|
f"Topic: {topic}\n"
|
||||||
|
|
@ -254,14 +272,34 @@ def _build_headline_prompt(
|
||||||
"\nRules for EVERY headline:\n"
|
"\nRules for EVERY headline:\n"
|
||||||
"- Maximum 70 characters (including spaces)\n"
|
"- Maximum 70 characters (including spaces)\n"
|
||||||
"- Title case\n"
|
"- Title case\n"
|
||||||
"- News-focused, not promotional\n"
|
|
||||||
"- NO location/geographic keywords\n"
|
"- NO location/geographic keywords\n"
|
||||||
"- NO superlatives (best, top, leading, #1)\n"
|
"- NO superlatives (best, top, leading, #1)\n"
|
||||||
"- NO questions\n"
|
"- NO questions\n"
|
||||||
"- NO colons — colons are considered lower quality\n"
|
"- NO colons — colons are considered lower quality\n"
|
||||||
"- Must contain an actual news announcement\n"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if is_news:
|
||||||
|
prompt += (
|
||||||
|
"\nThis topic is ACTUAL NEWS — a real new event, product, partnership, "
|
||||||
|
"or achievement. You may use announcement verbs like 'Announces', "
|
||||||
|
"'Launches', 'Introduces', 'Unveils'.\n"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
prompt += (
|
||||||
|
"\nIMPORTANT — AWARENESS FRAMING:\n"
|
||||||
|
"The company ALREADY offers this product/service/capability. Nothing is "
|
||||||
|
"new, nothing was just launched, expanded, or achieved. You are writing "
|
||||||
|
"an awareness piece about existing capabilities framed in news-wire style.\n\n"
|
||||||
|
"REQUIRED verbs — use these: 'Highlights', 'Reinforces', 'Delivers', "
|
||||||
|
"'Strengthens', 'Showcases', 'Details', 'Offers', 'Provides'\n\n"
|
||||||
|
"BANNED — do NOT use any of these:\n"
|
||||||
|
"- 'Announces', 'Launches', 'Introduces', 'Unveils', 'Expands', "
|
||||||
|
"'Reveals', 'Announces New'\n"
|
||||||
|
"- 'Significant expansion', 'major milestone', 'growing demand', "
|
||||||
|
"'new capabilities', 'celebrates X years'\n"
|
||||||
|
"- Any language that implies something CHANGED or is NEW when it is not\n"
|
||||||
|
)
|
||||||
|
|
||||||
if headlines_ref:
|
if headlines_ref:
|
||||||
prompt += (
|
prompt += (
|
||||||
"\nHere are examples of high-quality headlines to use as reference "
|
"\nHere are examples of high-quality headlines to use as reference "
|
||||||
|
|
@ -276,8 +314,10 @@ def _build_headline_prompt(
|
||||||
return prompt
|
return prompt
|
||||||
|
|
||||||
|
|
||||||
def _build_judge_prompt(headlines: str, headlines_ref: str) -> str:
|
def _build_judge_prompt(headlines: str, headlines_ref: str, topic: str = "") -> str:
|
||||||
"""Build the prompt for Step 2: pick the 2 best headlines."""
|
"""Build the prompt for Step 2: pick the 2 best headlines."""
|
||||||
|
is_news = _is_actual_news(topic)
|
||||||
|
|
||||||
prompt = (
|
prompt = (
|
||||||
"You are judging press release headlines for Press Advantage distribution. "
|
"You are judging press release headlines for Press Advantage distribution. "
|
||||||
"Pick the 2 best headlines from the candidates below.\n\n"
|
"Pick the 2 best headlines from the candidates below.\n\n"
|
||||||
|
|
@ -287,12 +327,25 @@ def _build_judge_prompt(headlines: str, headlines_ref: str) -> str:
|
||||||
"- Contains superlatives (best, top, leading, #1)\n"
|
"- Contains superlatives (best, top, leading, #1)\n"
|
||||||
"- Is a question\n"
|
"- Is a question\n"
|
||||||
"- Exceeds 70 characters\n"
|
"- Exceeds 70 characters\n"
|
||||||
"- Implies a NEW product launch when none exists (avoid 'launches', "
|
)
|
||||||
"'introduces', 'unveils', 'announces new' unless the topic is genuinely new)\n\n"
|
|
||||||
|
if is_news:
|
||||||
|
prompt += (
|
||||||
|
"- (This topic IS actual news — announcement verbs are acceptable)\n\n"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
prompt += (
|
||||||
|
"- Uses 'Announces', 'Launches', 'Introduces', 'Unveils', 'Expands', "
|
||||||
|
"'Reveals', or 'Announces New' (this is NOT actual news)\n"
|
||||||
|
"- Implies something CHANGED, is NEW, or was just achieved when it was not "
|
||||||
|
"(e.g. 'significant expansion', 'major milestone', 'growing demand')\n\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
prompt += (
|
||||||
"PREFER headlines that:\n"
|
"PREFER headlines that:\n"
|
||||||
"- Match the tone and structure of the reference examples below\n"
|
"- Match the tone and structure of the reference examples below\n"
|
||||||
"- Use action verbs like 'Highlights', 'Expands', 'Strengthens', "
|
"- Use awareness verbs like 'Highlights', 'Strengthens', "
|
||||||
"'Reinforces', 'Delivers', 'Adds'\n"
|
"'Reinforces', 'Delivers', 'Showcases', 'Details'\n"
|
||||||
"- Describe what the company DOES or OFFERS, not what it just invented\n"
|
"- Describe what the company DOES or OFFERS, not what it just invented\n"
|
||||||
"- Read like a real news wire headline, not a product announcement\n\n"
|
"- Read like a real news wire headline, not a product announcement\n\n"
|
||||||
f"Candidates:\n{headlines}\n\n"
|
f"Candidates:\n{headlines}\n\n"
|
||||||
|
|
@ -388,6 +441,8 @@ def _build_pr_prompt(
|
||||||
anchor_phrase: str = "",
|
anchor_phrase: str = "",
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Build the prompt for Step 3: write one full press release."""
|
"""Build the prompt for Step 3: write one full press release."""
|
||||||
|
is_news = _is_actual_news(topic)
|
||||||
|
|
||||||
prompt = (
|
prompt = (
|
||||||
f"{skill_text}\n\n"
|
f"{skill_text}\n\n"
|
||||||
"---\n\n"
|
"---\n\n"
|
||||||
|
|
@ -397,6 +452,25 @@ def _build_pr_prompt(
|
||||||
f"Topic: {topic}\n"
|
f"Topic: {topic}\n"
|
||||||
f"Company: {company_name}\n"
|
f"Company: {company_name}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if is_news:
|
||||||
|
prompt += (
|
||||||
|
"\nThis is ACTUAL NEWS — a real new event, product, or achievement. "
|
||||||
|
"You may use announcement language (announced, launched, introduced).\n"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
prompt += (
|
||||||
|
"\nAWARENESS FRAMING — CRITICAL:\n"
|
||||||
|
"The company ALREADY offers this product/service/capability. Nothing new "
|
||||||
|
"happened. Do NOT write that the company 'announced', 'expanded', 'launched', "
|
||||||
|
"'achieved a milestone', or 'saw growing demand'. These are LIES if nothing "
|
||||||
|
"actually changed.\n"
|
||||||
|
"Instead write about what the company DOES, what it OFFERS, what it PROVIDES. "
|
||||||
|
"Frame it as drawing attention to existing capabilities — highlighting, "
|
||||||
|
"reinforcing, detailing, showcasing.\n"
|
||||||
|
"The first paragraph should describe what the company offers, NOT announce "
|
||||||
|
"a fictional event.\n"
|
||||||
|
)
|
||||||
if url:
|
if url:
|
||||||
prompt += f"Reference URL (fetch for context): {url}\n"
|
prompt += f"Reference URL (fetch for context): {url}\n"
|
||||||
if lsi_terms:
|
if lsi_terms:
|
||||||
|
|
@ -557,7 +631,7 @@ def write_press_releases(
|
||||||
log.info("[PR Pipeline] Step 2/4: AI judge selecting best 2 headlines...")
|
log.info("[PR Pipeline] Step 2/4: AI judge selecting best 2 headlines...")
|
||||||
_set_status(ctx, "Step 2/4: AI judge selecting best 2 headlines...")
|
_set_status(ctx, "Step 2/4: AI judge selecting best 2 headlines...")
|
||||||
step_start = time.time()
|
step_start = time.time()
|
||||||
judge_prompt = _build_judge_prompt(headlines_raw, headlines_ref)
|
judge_prompt = _build_judge_prompt(headlines_raw, headlines_ref, topic)
|
||||||
messages = [
|
messages = [
|
||||||
{"role": "system", "content": "You are a senior PR editor."},
|
{"role": "system", "content": "You are a senior PR editor."},
|
||||||
{"role": "user", "content": judge_prompt},
|
{"role": "user", "content": judge_prompt},
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,10 @@ When the user provides a press release topic, follow this workflow:
|
||||||
- Each headline must be:
|
- Each headline must be:
|
||||||
- Maximum 70 characters
|
- Maximum 70 characters
|
||||||
- Title case
|
- Title case
|
||||||
- News-focused (not promotional)
|
- News-wire style (not promotional)
|
||||||
- Free of location keywords, superlatives (best/top/leading/#1), and questions
|
- Free of location keywords, superlatives (best/top/leading/#1), and questions
|
||||||
- Not make up information that isn't true.
|
- MUST NOT fabricate events, expansions, milestones, or demand claims
|
||||||
|
- Unless the topic explicitly signals actual news (e.g. "Actual News", "New Product", "Launch"), assume the company ALREADY offers this — use awareness verbs like "Highlights", "Reinforces", "Delivers", "Showcases", NOT announcement verbs like "Announces", "Launches", "Expands"
|
||||||
- Present all 7 titles to an AI agent to judge which is best. This can be decided by looking at titles on Press Advantage for other businesses, and seeing how closely the headline follows the instructions.
|
- Present all 7 titles to an AI agent to judge which is best. This can be decided by looking at titles on Press Advantage for other businesses, and seeing how closely the headline follows the instructions.
|
||||||
|
|
||||||
** EXAMPLE GREAT HEADLINES: **
|
** EXAMPLE GREAT HEADLINES: **
|
||||||
|
|
@ -75,8 +76,10 @@ When generating the 7 headline options:
|
||||||
|
|
||||||
### Content Type
|
### Content Type
|
||||||
- This is a PRESS RELEASE, not an advertorial, blog post, or promotional content
|
- This is a PRESS RELEASE, not an advertorial, blog post, or promotional content
|
||||||
- Must be objective news announcement written in journalistic style
|
- Must be written in objective, journalistic style
|
||||||
- Must announce actual NEWS (about products/services, milestones, awards, reactions to current events)
|
- By default this is an AWARENESS piece — the company already offers this capability. Frame it as highlighting/reinforcing existing offerings, NOT as announcing something new
|
||||||
|
- Only use announcement language (announces, launches, introduces) when the topic explicitly signals actual news (e.g. topic contains "Actual News", "New Product", "Launch")
|
||||||
|
- Do NOT fabricate events, expansions, milestones, or demand claims. If nothing new happened, do not pretend it did.
|
||||||
- Must read like it could appear verbatim in a newspaper
|
- Must read like it could appear verbatim in a newspaper
|
||||||
|
|
||||||
### Writing Style - MANDATORY
|
### Writing Style - MANDATORY
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue