ask-matt
MAmattpocock/skills337k近 7 天新增 4,978 个 star
Reusable approval-loop pattern for fanning out lead personalization across parallel Claude Code Task sub-agents. Shows the user 1 sample personalization, collects feedback, runs 10 more, approves, runs 10 more — stops when 2 consecutive rounds have zero edits, then scales to the full list. ALWAYS uses Claude Code Task tool sub-agents — never an external Anthropic/OpenAI API key. Use when any skill needs per-lead custom variables (situation lines, value lines, CTAs).
Cold email personalization at scale requires per-lead generation. Claude Code's Task tool lets you fan out to many sub-agents in parallel, each personalizing a slice of the lead list. This skill defines the reusable approval-loop pattern.
This skill runs entirely inside Claude Code via the Task tool. No Anthropic SDK calls, no OpenAI calls. This is intentional:
At very large scale (1,000+ leads), the tuned prompt can optionally be shipped to the Anthropic API for throughput. But TUNING and normal campaign runs (under 500 leads) always go through the Task tool.
Don't personalize 500 leads and then discover the prompt is wrong. Loop first, then scale.
company_description.situation_line, value_line, cta_soft.Lead | situation_line | value_line | cta_soft
[email protected] | You're building the only APM for Ruby. | Our Ruby customers find ... | Worth 10 min?
[email protected] | ... | ... | ...
Once locked:
lead_id./auto-research-public or similar orchestration skills need parallel personalization/auto-research-public or similar orchestration skills need parallel personalizationBefore fanning out, your lead batch should be a JSON array where each lead has:
{
"lead_id": "<stable identifier>",
"first_name": "<str>",
"last_name": "<str>",
"email": "<str>",
"company_name": "<str>",
"company_domain": "<str>",
"company_description": "<1-3 sentences about what the company does>",
"title": "<str>",
"linkedin_url": "<optional>",
"enrichment_data": { ... any extra signals ... }
}
The richer the company_description, the better the personalization. If you only have company names, the output will be generic.
Decide up front what fields each sub-agent must return. Example:
{
"lead_id": "<same id>",
"situation_line": "<1 sentence — what you noticed about their company>",
"value_line": "<1 sentence — connecting their situation to your offer>",
"cta_soft": "<1 sentence — soft ask, e.g. 'worth a 15 min chat?'>"
}
Fewer fields = less that can go wrong. Default to 3 fields maximum per variant.
If testing 3 copy variants, run 3 parallel sub-agents per company (or per batch). Each gets a different angle prompt:
This gives you 3x the data from one list — you can A/B/C test which angle resonates.
For 100 leads:
For 1000 leads:
Every personalization sub-agent gets a prompt of this shape:
You are personalizing cold email fields for N leads.
CONTEXT:
- We sell: <one sentence from client-profile.yaml>
- Our ICP: <one sentence>
- Our offer: <the CTA we're asking them to respond to>
- Tone: <casual | formal | peer-to-peer>
FIELDS TO GENERATE (per lead):
- situation_line: <definition + 1 good example + 1 bad example>
- value_line: <definition + 1 good example + 1 bad example>
- cta_soft: <definition + 1 good example + 1 bad example>
RULES:
1. Never fabricate facts. If the company description is thin, say something generic but not false.
2. Never use em dashes (—). Use periods or commas.
3. Never use the word "leverage", "synergy", "ecosystem".
4. Maximum length: <N words per field>.
5. If a lead is missing company_description, return "<fields cannot be generated — skip>"
LEADS:
<JSON array>
RETURN:
A JSON array with the same lead_ids and the personalization fields. Save to /tmp/personalization-<batch-id>.json and print "DONE" when complete.
Pseudocode for the orchestrator (runs in the main Claude Code conversation):
leads = load leads from JSON
batches = chunk leads into groups of 10-20
for each batch:
for each variant in [A, B, C]:
Task(
description: "Personalize batch <i> variant <v>",
subagent_type: "general-purpose",
prompt: <template above with variant-specific angle>
)
# All tasks run in parallel (multiple tool calls in one message)
Wait for all tasks to finish, then read /tmp/personalization-*.json and merge.
Or, launching all in a single message with multiple Task calls:
# Launch 3 parallel sub-agents for one batch (variants A, B, C)
Task(description: "batch-1-variant-A", ...)
Task(description: "batch-1-variant-B", ...)
Task(description: "batch-1-variant-C", ...)
Sub-agents can:
The orchestrator should:
personalization_status: "skipped" and use static copy insteadNever ship personalization fields that contain the string "cannot be generated" or similar — filter these out before upload.
After all sub-agents complete:
/tmp/personalization-*.json fileslead_id{
...original lead fields,
"variant_a": { "situation_line": "...", "value_line": "...", "cta_soft": "..." },
"variant_b": { ... },
"variant_c": { ... }
}
{{situation_line_a}}, {{value_line_a}}, etc.The loop exits automatically when:
On stop:
~/cold-email-ai-skills/profiles/<business-slug>/personalization-prompt.txtclient-profile.yaml metadata entry:
personalization_prompt:
path: profiles/<slug>/personalization-prompt.txt
variant_count: 3
tuned_at: YYYY-MM-DD
rounds_to_convergence: 3
If the user gives edits on round N+1 after 2 approved rounds, that's fine — the counter resets, and the loop continues.
Before uploading, manually spot-check 5 random leads per variant. Common issues:
references/prompt-template.md — copy-pasteable prompt templatereferences/example-output.json — what a well-personalized batch looks likereferences/failure-modes.md — common sub-agent failures and how to detect themThis is a pattern doc, not a standalone skill. It's invoked by /auto-research-public and /campaign-copywriting when they need per-lead personalization at scale.
If you're reading this directly, you're probably designing a new campaign-orchestration flow — return to whichever skill sent you here.
/auto-research-public — the primary consumer of this pattern/icp-onboarding — produces the client-profile.yaml the prompt pulls from/cold-email-starter-kit references 03-campaign-copywriting.md for copy principles the prompt enforcesMAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
OBobra/superpowers331k近 7 天新增 4,772 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star