Spaces:
Sleeping

Piers Lyon Claude Opus 4.7 (1M context) commited on
Commit
42aefe5
Β·
1 Parent(s): 11f303e

Tighten lead quality: programme-shaped opportunities only

Browse files

Colleague feedback: 'opportunities are not suitable for Curium' β€”
generic senior hires + generic news were leaking through. Curium
sells hands-on transformation/change/leadership-development DELIVERY,
so leads must point to a programme starting/in planning, not just any
senior change at any company.

weekly_digest.fetch_warm_leads_for_colleague (SQL filters):
- Jobs: title MUST contain a Curium-relevant function keyword
(transformation/change/operating model/programme/PMO/people/
culture/talent/L&D/leadership/wellbeing/restructure/integration/
M&A/modernisation/ERP/SAP/IFS/Workday/CHRO/CPO/Chief X). Drops
generic Head of Marketing / Sales / Commercial / Product etc.
- News: trigger_type MUST be one of {leadership_change,
restructure, ma_activity, transformation_programme,
culture_capability, contract_award, programme_launch}.
'general' news is dropped at SQL level.

weekly_digest._DIGEST_PROMPT (rewrite):
- Explicit Curium ICP block describing the actual sweet-spot
opportunity types (programmes, M&A integration, ERP rollouts,
operating-model design, leadership development, culture
transformation, restructuring delivery, etc.)
- Explicit KEEP / WEAK / DROP rules with concrete examples
- Asks Claude to first DECIDE keep/drop per lead silently, then
compose the email from kept leads only. If <2 survive, return
__NO_LEADS__ (a quiet-week email is more valuable than padding).
- 'Why now (programme angle)' framing β€” answer 'what programme
does this signal' rather than 'company hired someone senior'
- 'Suggested opener' line β€” drop-in message text per lead

intel_feeds._classify_trigger (stricter):
- leadership_change requires C-suite role + move verb (not just
'appointed')
- transformation_programme requires action verb (launches/
announces/embarks/unveils + transformation, OR explicit ERP/
SAP/Workday rollout language)
- culture_capability requires 'programme' / 'at-scale' phrasing
(drops generic 'engagement')
- contract_award includes 'wins ... contract' with up to 30 chars
between (catches 'Β£100m framework contract' etc.)
- 'general' is the default drop-bucket

brain.analyze_opportunities_batch prompt:
- Explicit 0-49/50-79/80-100 score bands with examples per band
- High band: Programme/Change/Transformation Director, CHRO with
mandate, M&A Integration Lead, ERP Programme Director
- Low band: Sales / Marketing / Customer / Product / Finance /
Legal / Engineering specialist functions β€” wrong fit for Curium
- +15 for warm/client, +10 for target sector, -10 if no programme
indicator in title or description
- 'reason' field must articulate the programme angle, not just
'senior hire'

Verified locally: 'Apple appoints new VP of Engineering' classifies
as general (drop), 'Premier Foods CEO steps down' classifies as
leadership_change (keep), 'Engie wins Β£100m framework contract'
classifies as contract_award (keep), 'Compleat head of marketing
appointed' classifies as general (drop).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (3) hide show
  1. brain.py +41 -7
  2. intel_feeds.py +68 -12
  3. weekly_digest.py +106 -21
brain.py CHANGED
@@ -344,15 +344,49 @@ def analyze_opportunities_batch(job_texts: list[str], context: str | None = None
344
 
345
  {combined}
346
 
347
- For each job, score 0-100 reflecting Curium's interest. Bias the score upward when:
348
- - The hiring company is on the warm/client list above (warm context = ready conversation)
349
- - The role title aligns to TD/CC service lines (transformation, change, culture, leadership, operating model, M&A)
350
- - The sector matches a Curium target sector
351
-
352
- In `reason`, if the company is on the warm/client list, START with `[CLIENT]` so the UI can flag it. Reason should be one sentence.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
 
354
  You MUST respond with ONLY a valid JSON array containing one object per job, in order:
355
- [{{"score": <0-100>, "transformation_delivery_score": <0-100>, "culture_capability_score": <0-100>, "reason": "<brief explanation>", "recommended_services": [<service_ids>], "primary_service_line": "<transformation_delivery|culture_capability|both|none>", "signal_type": "<signal_type>"}}, ...]"""
356
 
357
  try:
358
  anthropic_client = get_client()
 
344
 
345
  {combined}
346
 
347
+ # Curium ICP for jobs β€” what we sell, what we don't
348
+
349
+ Curium is a hands-on transformation + culture consultancy. We are brought in to DELIVER transformation programmes (not strategy advisory). The roles below are useful to us **only when they signal a company has a programme starting or in planning that needs a delivery partner**.
350
+
351
+ ## Score 80-100 (HIGH β€” clear programme need)
352
+ - Head of / Director of / Chief **Transformation** (any flavour: digital, business, AI, operating model)
353
+ - Head of / Director of / Chief **Change** (Change Director, Head of Business Change, Head of Organisational Change)
354
+ - Programme Director / Portfolio Director / Head of PMO / Head of TMO
355
+ - Chief People Officer / CHRO / People Director **with explicit transformation mandate**
356
+ - Head of L&D / Head of Leadership Development / Head of Talent (at-scale capability uplift roles)
357
+ - Head of Culture / Director of Culture / Chief Culture Officer
358
+ - M&A Integration Director / Head of M&A Integration / Post-Merger Integration Lead
359
+ - ERP Programme Director / SAP Implementation Lead / Workday Programme Lead
360
+ - Operating Model Director / Head of Organisational Design
361
+
362
+ ## Score 50-79 (MEDIUM β€” possible programme signal but unclear)
363
+ - Senior CHRO / People Director WITHOUT explicit transformation language (might be steady-state HR, might be transformation β€” needs context)
364
+ - Head of HR Business Partnering, Head of Talent Acquisition (people-function but not necessarily change-led)
365
+ - Senior Programme Manager (mid-level, not Director)
366
+ - Head of Operations (could be operational improvement = TD, or could be steady-state ops)
367
+ - Strategy Director / Head of Strategy (Curium does NOT do strategy advisory β€” relevant only if it's strategy *implementation*)
368
+
369
+ ## Score 0-49 (LOW β€” drop unless company has another strong signal)
370
+ - Head of Sales / Sales Director / Head of Commercial β€” wrong function
371
+ - Head of Marketing / Marketing Director / Brand Director β€” wrong function
372
+ - Head of Customer / Customer Success Director β€” wrong function unless tied to a CX transformation programme
373
+ - Head of Product / Product Director β€” wrong function
374
+ - Head of Finance / Financial Controller (steady-state finance) β€” only relevant if CFO with mandate
375
+ - Head of Legal / GC β€” wrong function
376
+ - Head of IT / Technology Lead (steady-state) β€” only relevant if CIO/CTO with mandate
377
+ - Head of Engineering / Tech Lead β€” wrong function
378
+ - Specialist functions (Head of Tax, Head of Procurement, Head of Property) β€” wrong function
379
+
380
+ ## Bias rules
381
+ - Add **+15** if hiring company is on the warm/client list above (ready conversation)
382
+ - Add **+10** if hiring company is in a Curium target sector
383
+ - Subtract **-10** if no programme indicator in the title or description
384
+ - A senior role at a target-sector company is NOT enough on its own β€” the role MUST point to a transformation/change/culture/leadership-development need
385
+
386
+ In `reason`, be specific about the programme angle. NOT "senior hire at X" β€” instead "X is hiring a Programme Director, suggesting a TD-shaped programme is being kicked off". If hiring company is on the warm/client list, START reason with `[CLIENT]`.
387
 
388
  You MUST respond with ONLY a valid JSON array containing one object per job, in order:
389
+ [{{"score": <0-100>, "transformation_delivery_score": <0-100>, "culture_capability_score": <0-100>, "reason": "<brief explanation focused on programme angle>", "recommended_services": [<service_ids>], "primary_service_line": "<transformation_delivery|culture_capability|both|none>", "signal_type": "<signal_type>"}}, ...]"""
390
 
391
  try:
392
  anthropic_client = get_client()
intel_feeds.py CHANGED
@@ -304,26 +304,82 @@ def fetch_rss(source_key: str, days: int = 7, max_items: int = 50,
304
 
305
 
306
  def _classify_trigger(text: str) -> str:
307
- """Map a news headline+summary to one of our trigger_type values."""
 
 
 
 
 
 
 
 
308
  t = (text or "").lower()
309
- if any(k in t for k in ["appointed", "appoints", "resigns", "departs",
310
- "steps down", "succession", "new ceo", "new cfo",
311
- "chief people", "chief transformation", "chief operating"]):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  return "leadership_change"
 
 
313
  if any(k in t for k in ["restructur", "reorganis", "reorganiz",
314
- "redundanc", "layoff"]):
 
 
315
  return "restructure"
316
- if any(k in t for k in ["merger", "acquisition", "acquired", "buyout",
317
- "carve-out", "carve out", "spin-off", "spin off"]):
 
 
 
318
  return "ma_activity"
319
- if any(k in t for k in ["transformation", "operating model", "programme",
320
- "digital transformation"]):
 
 
 
 
 
 
 
 
 
 
321
  return "transformation_programme"
322
- if any(k in t for k in ["culture change", "wellbeing", "engagement",
323
- "talent strategy", "L&D", "learning and development"]):
 
 
 
 
324
  return "culture_capability"
325
- if any(k in t for k in ["contract", "tender", "framework", "awarded"]):
 
 
 
 
 
 
 
326
  return "contract_award"
 
 
 
 
327
  return "general"
328
 
329
 
 
304
 
305
 
306
  def _classify_trigger(text: str) -> str:
307
+ """Map a news headline+summary to one of our trigger_type values.
308
+
309
+ Stricter than v1: 'leadership_change' now requires a *senior* role
310
+ change (CEO/CFO/CHRO/COO/CTO/Chief X) β€” generic 'appointed' isn't
311
+ enough on its own. 'transformation_programme' requires an actual
312
+ programme verb (launches/announces/embarks/unveils), not just the
313
+ word 'transformation' floating in passing. 'general' is the default
314
+ drop-bucket for everything else; weekly_digest skips general items.
315
+ """
316
  t = (text or "").lower()
317
+
318
+ # Senior leadership change β€” only Chief / CEO / CFO / CHRO / COO / CTO
319
+ # / VP-level moves count. Mid-level "appointed" doesn't.
320
+ senior_role = any(role in t for role in [
321
+ "ceo", "chief executive",
322
+ "cfo", "chief financial",
323
+ "chro", "chief people", "chief human",
324
+ "coo", "chief operating",
325
+ "cto", "chief technology",
326
+ "cio", "chief information",
327
+ "chief transformation", "chief change",
328
+ "chief commercial officer",
329
+ "managing director",
330
+ ])
331
+ move_verb = any(v in t for v in ["appointed", "appoints", "resigns",
332
+ "departs", "steps down", "succession",
333
+ "named", "joins as", "to become",
334
+ "promoted to"])
335
+ if senior_role and move_verb:
336
  return "leadership_change"
337
+
338
+ # Restructure β€” explicit
339
  if any(k in t for k in ["restructur", "reorganis", "reorganiz",
340
+ "redundancies", "redundancy programme",
341
+ "layoff", "lay off", "operating model",
342
+ "cost-out programme", "efficiency programme"]):
343
  return "restructure"
344
+
345
+ # M&A activity β€” completed/announced deals (not rumour)
346
+ if any(k in t for k in ["merger", "acquisition", "acquired", "acquires",
347
+ "buyout", "carve-out", "carve out", "spin-off",
348
+ "spin off", "divest", "demerger", "post-merger"]):
349
  return "ma_activity"
350
+
351
+ # Transformation programme β€” needs an action verb, not just the word
352
+ if any(k in t for k in ["transformation programme", "launches transformation",
353
+ "kicks off transformation", "embarks on transformation",
354
+ "announces transformation", "unveils transformation",
355
+ "digital transformation programme",
356
+ "new operating model", "embark on a programme",
357
+ "ERP rollout", "ERP implementation",
358
+ "SAP rollout", "SAP implementation",
359
+ "Workday rollout", "Workday implementation",
360
+ "IFS implementation",
361
+ "Oracle rollout"]):
362
  return "transformation_programme"
363
+
364
+ # Culture & Capability β€” at-scale, with action verb
365
+ if any(k in t for k in ["culture programme", "leadership programme",
366
+ "leadership development", "talent strategy",
367
+ "behaviour change programme", "succession planning",
368
+ "wellbeing strategy"]):
369
  return "culture_capability"
370
+
371
+ # Contract / framework awards (mainly relevant when a transformation
372
+ # consultancy wins a UK gov framework β€” early signal that we should
373
+ # try to get on the next one)
374
+ if any(k in t for k in ["awarded contract", "wins contract",
375
+ "framework agreement", "framework award",
376
+ "framework contract", "framework deal",
377
+ "signs deal worth", "signs contract worth"]):
378
  return "contract_award"
379
+ # "wins ... contract" with up to 30 chars between (e.g. monetary value)
380
+ if re.search(r"\bwins\b[^.\n]{0,30}\bcontract\b", t):
381
+ return "contract_award"
382
+
383
  return "general"
384
 
385
 
weekly_digest.py CHANGED
@@ -165,6 +165,31 @@ def fetch_warm_leads_for_colleague(colleague_name: str, days: int = 7,
165
  # 2) For each company, pull recent signals (jobs, news, tenders, web_disc)
166
  placeholders = ",".join("?" * len(company_names))
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  jobs = conn.execute(
169
  f"""
170
  SELECT j.job_title, j.job_url, j.job_score, j.job_analysis, j.date_found,
@@ -173,11 +198,19 @@ def fetch_warm_leads_for_colleague(colleague_name: str, days: int = 7,
173
  JOIN companies c ON c.id = j.company_id
174
  WHERE j.date_found >= ? AND c.name IN ({placeholders})
175
  AND j.job_score >= 50
 
176
  ORDER BY j.job_score DESC, j.date_found DESC
177
  """,
178
- [cutoff, *company_names],
179
  ).fetchall()
180
 
 
 
 
 
 
 
 
181
  news = conn.execute(
182
  f"""
183
  SELECT n.headline, n.reason, n.trigger_type, n.urgency, n.news_url,
@@ -187,9 +220,10 @@ def fetch_warm_leads_for_colleague(colleague_name: str, days: int = 7,
187
  JOIN companies c ON c.id = n.company_id
188
  WHERE n.date_found >= ? AND c.name IN ({placeholders})
189
  AND n.news_score >= 50
 
190
  ORDER BY n.news_score DESC, n.date_found DESC
191
  """,
192
- [cutoff, *company_names],
193
  ).fetchall()
194
 
195
  tenders = conn.execute(
@@ -272,36 +306,87 @@ def fetch_warm_leads_for_colleague(colleague_name: str, days: int = 7,
272
 
273
  _DIGEST_PROMPT = """You are composing a Monday-morning sales-intelligence email for **{colleague_name}** at Curium Solutions.
274
 
275
- Curium is a UK transformation + culture consulting firm. {colleague_name} is a partner / consultant with a personal LinkedIn network that maps onto the leads below.
276
-
277
- **Curium's active client list** (if any of these appear, prefix that bullet with `[CLIENT]` β€” these are warm conversations, not cold pitches):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  {client_block}
279
 
280
- **Curium's target sectors:**
 
281
  {sector_block}
282
 
283
- Below is the raw lead data β€” companies where {colleague_name} has a warm network connection AND something material happened in the last 7 days.
284
 
285
  ```json
286
  {raw_data}
287
  ```
288
 
289
- Compose a complete email body in **clean HTML**. Strict rules:
290
 
291
- - Open with: `Morning {colleague_name},` then a one-sentence framing of what's in the email (e.g. "X warm-route leads moved this week β€” three worth a Monday call.").
292
- - For each lead, render a section using this exact structure:
293
- - `<h3>` = "[CLIENT] " (only if a Curium client) + Company name
294
- - `<p>` *Why now*: 1–2 sentences synthesising the signals (jobs/news/tenders) into a story
 
 
 
 
 
 
295
  - `<p>` *Your route in*: name the contact (with role); flag if mover/promoted/senior
296
- - `<ul>` *Sources* β€” each `<li>` has the signal type + a short clickable `<a href="…">title</a>` (use the urls in the raw data β€” don't invent)
297
- - Where useful, recommend **next action** as one sentence ("Suggest dropping a note re: their programme governance")
298
- - Maximum 6 leads. If more come in, pick the highest-priority (jobs β‰₯ news β‰₯ tenders, and Curium clients first).
299
- - Close with `Have a good week,<br>The Curium intelligence platform`.
300
- - UK English, factual, no fluff, no marketing language.
301
- - DO NOT include `<html>`, `<head>`, `<body>` tags β€” only the content. The mailer wraps it.
302
- - DO NOT include any preamble like "Here's the email:" β€” just the HTML.
303
-
304
- If there are NO leads in the raw data, return ONLY the literal string: `__NO_LEADS__`"""
305
 
306
 
307
  _NO_LEADS_BODY_HTML = """<p>Morning {name},</p>
 
165
  # 2) For each company, pull recent signals (jobs, news, tenders, web_disc)
166
  placeholders = ",".join("?" * len(company_names))
167
 
168
+ # Stricter Curium-relevant filtering at SQL level. Curium sells
169
+ # transformation/change/leadership delivery β€” generic senior roles
170
+ # (Head of Marketing/Sales/Commercial) and generic news (earnings,
171
+ # awards, products) are noise. We require:
172
+ # - Jobs: title hints at a Curium-relevant function (LIKE filter
173
+ # for transformation/change/people/culture/etc)
174
+ # - News: trigger_type is a programme/restructure/M&A signal,
175
+ # NOT 'general'
176
+ JOB_TITLE_KEYWORDS = [
177
+ "transformation", "change", "operating model", "programme", "pmo", "tmo",
178
+ "people", "culture", "talent", "learning", "development",
179
+ "leadership", "wellbeing", "engagement", "behaviour",
180
+ "restructur", "reorganis", "reorganiz",
181
+ "integration", "m&a", "merger", "post-merger",
182
+ "modernisation", "modernization",
183
+ "digital transformation", "ai transformation",
184
+ "erp", "sap", "ifs", "workday", "hris",
185
+ "chief people officer", "chief transformation", "chief operating",
186
+ "chief executive", "ceo", "cfo", "chro", "cpo",
187
+ "succession",
188
+ ]
189
+ job_like_clauses = " OR ".join(
190
+ ["LOWER(j.job_title) LIKE ?" for _ in JOB_TITLE_KEYWORDS]
191
+ )
192
+ job_like_params = [f"%{k}%" for k in JOB_TITLE_KEYWORDS]
193
  jobs = conn.execute(
194
  f"""
195
  SELECT j.job_title, j.job_url, j.job_score, j.job_analysis, j.date_found,
 
198
  JOIN companies c ON c.id = j.company_id
199
  WHERE j.date_found >= ? AND c.name IN ({placeholders})
200
  AND j.job_score >= 50
201
+ AND ({job_like_clauses})
202
  ORDER BY j.job_score DESC, j.date_found DESC
203
  """,
204
+ [cutoff, *company_names, *job_like_params],
205
  ).fetchall()
206
 
207
+ # News: only programme-indicating trigger types β€” drop 'general'.
208
+ PROGRAMME_TRIGGERS = (
209
+ "leadership_change", "restructure", "ma_activity",
210
+ "transformation_programme", "culture_capability",
211
+ "contract_award", "programme_launch",
212
+ )
213
+ news_trigger_placeholders = ",".join("?" * len(PROGRAMME_TRIGGERS))
214
  news = conn.execute(
215
  f"""
216
  SELECT n.headline, n.reason, n.trigger_type, n.urgency, n.news_url,
 
220
  JOIN companies c ON c.id = n.company_id
221
  WHERE n.date_found >= ? AND c.name IN ({placeholders})
222
  AND n.news_score >= 50
223
+ AND n.trigger_type IN ({news_trigger_placeholders})
224
  ORDER BY n.news_score DESC, n.date_found DESC
225
  """,
226
+ [cutoff, *company_names, *PROGRAMME_TRIGGERS],
227
  ).fetchall()
228
 
229
  tenders = conn.execute(
 
306
 
307
  _DIGEST_PROMPT = """You are composing a Monday-morning sales-intelligence email for **{colleague_name}** at Curium Solutions.
308
 
309
+ # WHAT CURIUM ACTUALLY SELLS β€” read this carefully before deciding what to include
310
+
311
+ Curium is a UK **hands-on transformation + culture consultancy**. NOT a strategy advisory firm. We are brought in to **DELIVER** transformation programmes, with a particular blend of:
312
+ - **Hands-on programme delivery** β€” we put senior people INTO our clients' programmes
313
+ - **Accelerated change** β€” focus on mindset and behaviours, not just process
314
+ - **Cultural transformation** β€” the human side of change
315
+
316
+ ## Sweet-spot opportunity types
317
+
318
+ The leads below are useful ONLY if they signal one of these:
319
+
320
+ 1. **Active transformation / change programme** β€” already kicked off OR being planned, needing a delivery partner
321
+ 2. **M&A activity** β€” especially the post-deal integration moment (carve-outs, mergers, acquisitions)
322
+ 3. **Operational streamlining / cost-out programmes**
323
+ 4. **Org design / re-design / restructuring** β€” announced or under way
324
+ 5. **Strategy implementation** β€” the *implementation* phase, not the strategy advisory phase
325
+ 6. **Major systems implementations** β€” ERP (SAP, IFS, Workday), HRIS, CRM rollouts. The change-management side is where Curium sells.
326
+ 7. **Leadership development / team effectiveness / executive coaching** β€” at scale, not one-off
327
+ 8. **Cultural transformation** β€” explicit "we need to change our culture" programmes
328
+ 9. **Senior leadership change with a transformation mandate** β€” new CEO/CFO/CHRO/CTO arriving with a brief to change things
329
+
330
+ ## What KEEP / DROP looks like
331
+
332
+ βœ… **KEEP** β€” clear programme/change signal:
333
+ - "[Company] launches Β£45m transformation programme" β†’ KEEP
334
+ - "[Company] hires Programme Director for SAP rollout" β†’ KEEP
335
+ - "[Company] announces M&A / completes acquisition / carve-out" β†’ KEEP
336
+ - "[Company] new CEO outlines restructure plan" β†’ KEEP
337
+ - "[Company] is recruiting Head of Transformation / Director of Change / Chief People Officer / Head of L&D / Head of Culture / Head of Operating Model" β†’ KEEP
338
+ - "[Company] tendering for change/transformation/programme management consultancy" β†’ KEEP
339
+ - "[Company] CHRO hired with mandate to overhaul talent/culture" β†’ KEEP
340
+
341
+ ⚠️ **WEAK** β€” only keep if combined with another hard signal in the dataset:
342
+ - Generic Head of role with no programme context (e.g. "Head of Marketing", "Head of Sales", "Head of Commercial" β€” these are not change/transformation roles)
343
+ - "Senior hire at company X" without context
344
+ - Annual report mentions change in passing
345
+
346
+ ❌ **DROP** β€” these are noise, surface NOTHING about them:
347
+ - Stock price news, earnings beats, dividend announcements (unless tied to a stated programme)
348
+ - Product launches
349
+ - Awards, sponsorships, marketing PR
350
+ - Customer-facing-only roles (Head of Sales, Customer Success Director) without programme context
351
+ - General industry commentary not tied to a specific company action
352
+ - "Hired a new Marketing Director" β€” wrong function for Curium
353
+
354
+ # Curium's active client list
355
+
356
+ If any of these appear, prefix that company's section with `[CLIENT]` β€” they're warm conversations:
357
  {client_block}
358
 
359
+ # Curium's UK target sectors
360
+
361
  {sector_block}
362
 
363
+ # Raw lead data (companies where {colleague_name} has a warm network connection AND has had a signal in the last 7 days)
364
 
365
  ```json
366
  {raw_data}
367
  ```
368
 
369
+ # Your task
370
 
371
+ **Step 1 (silent):** For each lead, decide KEEP or DROP using the criteria above. Be ruthless. A lead is only useful if it points to a CHANGE / TRANSFORMATION / PROGRAMME need that Curium can pitch into. A senior hire at a Curium target sector is NOT enough on its own β€” you need to see WHY a programme might be starting.
372
+
373
+ **Step 2:** Compose the email body in clean HTML, including ONLY the leads you marked KEEP. If fewer than 2 leads survive, return the literal string `__NO_LEADS__` instead β€” a "quiet week" email is more valuable than padded leads.
374
+
375
+ ## Email format (strict)
376
+
377
+ - Open with: `<p>Morning {colleague_name},</p>` then ONE sentence framing what's in the email. Be honest about volume β€” "Three programme-stage leads this week, plus one early signal worth watching." Better than fake density.
378
+ - For each kept lead:
379
+ - `<h3>` β€” `[CLIENT] ` (only if a Curium client) + Company name
380
+ - `<p>` *Why now (programme angle)*: 1-2 sentences explaining specifically what change/transformation activity the data points to and why Curium is the right fit. NOT just "they hired someone senior" β€” say what programme that hire suggests.
381
  - `<p>` *Your route in*: name the contact (with role); flag if mover/promoted/senior
382
+ - `<ul>` *Sources* β€” each `<li>` has the signal type + a short clickable `<a href="…">title</a>` (use the URLs in the raw data, don't invent)
383
+ - `<p>` *Suggested opener*: ONE sentence the partner could literally drop into a message ("Saw the SAP programme announcement β€” I imagine the change-side resourcing is on your mind, happy to share how we approached the same on Premier Foods")
384
+ - Maximum 6 leads.
385
+ - Close with `<p>Have a good week,<br>The Curium intelligence platform</p>`.
386
+
387
+ UK English, factual, no fluff. DO NOT include `<html>`/`<head>`/`<body>` tags. DO NOT preamble with "Here's the email:". DO NOT invent URLs not in the raw data.
388
+
389
+ If 0-1 leads survive Step 1, return ONLY: `__NO_LEADS__`"""
 
390
 
391
 
392
  _NO_LEADS_BODY_HTML = """<p>Morning {name},</p>