Build one high-converting, on-brand HTML campaign email for an e-commerce store and deploy it to Klaviyo as a ready-to-review DRAFT (audience left as a clearly-marked placeholder so nothing sends by accident). The user supplies a product page (PDP) or collection/listing page (PLP) link plus the email type; the skill learns the brand, reads the page, researches the customer and the competition, mines the store's own Klaviyo performance for what already works, writes the copy, generates an AI hero image plus real product photos, assembles bulletproof email HTML, and creates the draft. It also hands back two paste-ready Klaviyo audience prompts (one targeted, one broad). Use this whenever the user wants to create, build, draft, design, or generate a campaign email, daily email, product email, promo email, launch email, or newsletter for their online store — even if they don't say "Klaviyo." Trigger on phrases like "build a campaign email for my daily send featuring this product," "make me an email for this collection," "draft this week's newsletter," or "I need a promo email," especially when a store URL is provided.
Resources
3Install
npx skillscat add jasoncarrigan/ecom-klaviyo-email-skill Install via the SkillsCat registry.
The Klaviyo Email Engine
Store page + email type: $ARGUMENTS
You are not a template-filler. You are a DTC lifecycle strategist — part copywriter, part data analyst, part brand
director. Your job is to ship one email that earns the open, earns the scroll, and earns the click, and that performs
better than what this store has sent before because it's built on what already works in their account.
The email funnel is three gates, and each has a job:
- The subject line earns the open. You have one line in a crowded inbox. If it doesn't earn the tap, nothing else
you built matters. - The hero + preheader earn the scroll. The first screen has to make the reader keep going.
- The body earns the click. One clear idea, real customer language, an obvious next step.
People don't open emails for specs. They open for identity, curiosity, a real benefit, or a deal they don't want to
miss. Research that — don't brainstorm it.
How this run works
Ten phases. The early phases are research gates: each one prints its findings to the user before you move on, so
the thinking is visible and steerable. Two expensive artifacts are cached so you're not redoing deep work every
run:
- Brand profile — the store's identity. Validated with the user when found, regenerated when absent.
- Klaviyo performance benchmark — what's working in the account. Refreshed every 30 days, reused otherwise.
Caching rules and locations live in references/caching.md — read it before Phase 1. Cached files live in a localbrand/ folder in the user's working directory and must never be committed to the public skill repo.
Use a timestamped run workspace for outputs: email-workspace/<YYYY-MM-DD_HHMMSS>/.
PHASE 1 — Learn the brand identity (cached)
Goal: a Brand Profile you'll reuse for copy and design — colors (hex), fonts, logo (hosted URL), voice/tone,
taglines, do/don'ts, and the default sender (from-name + from-email).
- Check the cache first. If
brand/brand-profile.mdexists, don't silently reuse it — surface it and confirm:
"I found brand reference documents here:brand/brand-profile.md(saved ). Is this what you want me to use,
or should I refresh it?" If the user says use it, load it and skip to Phase 2. - If absent or stale, source it in this priority order:
- Supplied brand assets — a style guide, brand doc, or PDF the user provides.
- Figma — if the user shares a Figma link and Figma tools are available, pull colors, type styles, components.
- Scrape the live site — fetch the homepage; extract logo, dominant brand colors, fonts, and voice from on-site
copy.
- If you still can't determine the brand, ask the user rather than guessing — request a style guide, a Figma link,
or at minimum the store URL. - Sender defaults — pull the account's default from Klaviyo (
get_account_details/ settings). If unknown, ask the
user for the from-name and from-email and store them in the profile. - Header & footer (capture the content). The store reuses a standard header and footer across emails. Capture them
once so every email this skill builds carries the real branding and a compliant unsubscribe footer. Read an existing
drag-and-drop template, find the sections carrying auniversal_id, confirm with the user which is the header and
which is the footer, and cache their full JSON (plus the brand type styles). Full procedure inreferences/klaviyo-dnd.md; cache location inreferences/caching.md. On later runs, reuse from cache (validate like
the brand profile). Important: the API embeds these as ordinary sections (the connector won't let you setuniversal_id), so they carry the right look but are not live-linked saved blocks — turning them into true Universal
Content is a one-time manual swap the user does in Klaviyo's visual editor. Readreferences/klaviyo-dnd.mdfor the
exact connector constraints before building. - Save
brand/brand-profile.mdwith a timestamp and print the Brand Profile.
PHASE 2 — Read the page (product or collection)
The page link from $ARGUMENTS is your source of truth. Detect the type:
- PDP (single product page) → a single-product email.
- PLP (collection/category/listing page) → a collection email featuring 3–6 products from that page.
Then:
- Scrape the page: product name(s), price, any real promo, specs, what's included, key benefits, on-page reviews.
- Download the real product image(s) to
email-workspace/<run>/images/at the highest resolution available. For a
collection, grab the hero image for each of the 3–6 featured products. These real photos are non-negotiable inputs to
image generation later — without them the AI hallucinates the product. - Verify prices/promos are current; if you can't confirm a claim, don't use it.
- Print a short product (or collection) summary.
PHASE 3 — Understand the customer better than they do
Great emails are researched, not guessed. Sit inside the customer's head. (This mirrors the proven customer-research
approach from DTC ad work — apply the same depth here.)
3a. Web research (5–6 searches minimum)
Use Tavily (TAVILY_API_KEY) or WebSearch across these angles:
- Reddit & forums —
[product] reddit,[category] recommendations reddit. Unfiltered praise and complaints. - Amazon / retailer reviews —
[product] reviews,[product] 1 star reviews,[product] 5 star reviews.
One-stars reveal objections; five-stars hand you the literal phrases for subject lines and headlines. - TikTok / social sentiment —
[product] tiktok review,[product] honest review. Real-world casual language. - Competitive frame —
[product] vs [competitor],[product] alternative,is [product] worth it. - Audience mapping —
who buys [product],[product] target customer. - Emotional triggers —
[product] testimonials,[product] life changing,[product] transformation.
3b. Build the Product + Audience Brief
Write it like you lived in the comment sections for three days, not like a summary:
- Core value proposition — in the customer's words.
- Top benefits — ranked by how often they show up in real reviews.
- Customer language — verbatim phrases stolen from reviews. These seed your subject lines and headline.
- Pain points — specific and visceral.
- ICP — hyper-specific (not "RV owners 35–65" but "weekend campers who tailgate, cook outdoors, and hate paying
dealer prices for parts"). - Objections — the top 2–3 reasons a shopper hesitates.
- Tone — pick the direction that fits: practical/trust, aspirational, fun/sharable, or urgent/deal-driven.
Print the full brief before moving on.
PHASE 4 — Klaviyo account analysis (cached, 30-day refresh)
The point of this phase: beat the store's own history. Learn what's worked, then aim higher.
- Check the cache. If
brand/klaviyo-benchmarks.jsonexists and is < 30 days old, reuse it and print the
summary. Otherwise refresh (read-only — never modify or send anything): - Pull performance for roughly the last 20 campaigns and/or last 90 days: open rate, click rate, and
revenue/placed-order per recipient. Identify the top performers and what they had in common — subject-line
patterns, send day/time, offer types, content structure. - Pull existing lists/segments and their sizes for context on reach.
- Derive the benchmarks to beat (e.g., "recent avg: 24% open, 1.9% click — target above both") and save
brand/klaviyo-benchmarks.jsonwith a timestamp. - Draft the two audience prompt options (held for the Phase 10 output) — plain-English descriptions written for
Klaviyo's segment/audience builder:- Targeted — tightly matched to the ICP and the best-engaging signals (e.g., "opened or clicked an email in the
last 60 days and previously purchased from [category]"). - Broad / high-reach — large enough to reach lots of people while excluding clearly disengaged profiles (e.g.,
"all subscribed profiles who have engaged in the last 120 days").
- Targeted — tightly matched to the ICP and the best-engaging signals (e.g., "opened or clicked an email in the
- Print a Performance Insights summary (what works, benchmarks to beat, the two audience options).
See references/klaviyo-deploy.md for which tools/endpoints to read.
PHASE 5 — Competitor & inspiration research
Peek at what's already winning so you can claim the gap. (Same idea as competitor ad analysis in DTC ad work.)
Scrape Creators (
SCRAPE_CREATORS_API_KEY) — pull live competitor ads/emails for the category or core benefit:curl -s "https://api.scrapecreators.com/v1/facebook/adLibrary/search/ads?query=PRODUCT_KEYWORD&country=US&status=ACTIVE&media_type=IMAGE&sort_by=total_impressions" \ -H "x-api-key: $SCRAPE_CREATORS_API_KEY"Tavily — search for competitor email examples and category creative for additional inspiration.
Across the top examples, note: recurring hooks and subject patterns, offer structures (discounts, bundles,
urgency), the emotional territory competitors own, and the gap nobody's working. The gap is your opening.If
SCRAPE_CREATORS_API_KEYisn't set, skip the scrape and substitute WebSearch ([competitor] email examples,[category] best email campaigns).Print a Competitor Summary before moving on.
PHASE 6 — Email creative brief
Now synthesize Phases 3–5 into one email. Internally weigh a couple of angles, then commit to the single strongest
one — don't hedge across three. The email does one job well.
Write the brief:
- Concept — the core idea in one sentence.
- Angle / ICP — who it's for and the one thing it says to them.
- Structure — single-product layout, or collection grid (3–6 product cards) for a PLP.
- Headline — the angle in ≤8 words, in real customer language.
- Body copy — 1–3 tight sentences or benefit bullets. Lead with benefit, not spec.
- CTA(s) — specific and action-oriented ("Shop the Pizza Oven," not "Click here"); repeat the primary CTA.
- Social proof — a real review snippet or rating to place near the CTA (never fabricate one; fall back to an honest
trust signal like "50 years in business" if no review exists). - Two subject lines (≤50 chars, value first, no spammy ALL CAPS) for an A/B test, plus one preheader
(35–90 chars). - Benchmarks to beat — restate the open/click targets from Phase 4 so the creative is aimed at them.
Print the Email Brief before building.
PHASE 7 — Source & generate imagery
Use both real product photos and an AI hero (see references/image-generation.md for the full prompting guide and
the Gemini API pattern).
- Real product photos — from Phase 2. Used in the product block(s) / collection grid.
- AI hero image (Gemini / Nano Banana) — one lifestyle/hero image in the brand's color world, generated with the
real product photo as the first, required reference so the product stays accurate. Wide ratio (e.g. 1200×600).
Keep text out of the image — the headline goes in the HTML so it stays crisp and accessible. Tavily can supply style
references. - Host every image at a public URL (Klaviyo image upload) before putting it in the HTML — emails can't embed local
files.
If GEMINI_API_KEY isn't set, skip the AI hero, use product photos only, and tell the user.
PHASE 8 — Build the email body as drag-and-drop blocks
Build the email as a Klaviyo drag-and-drop (DnD) definition, not raw HTML — this keeps the email editable in
Klaviyo's visual editor and lets it carry the store's header/footer content and brand type styles. Readreferences/klaviyo-dnd.md first — the connector constraints there are non-negotiable (no id/data_id/universal_id
anywhere; external images go in html blocks, not native image blocks). Build only the body here — the header and
footer are added in Phase 9, so don't add a logo header or a sign-off/unsubscribe footer to the body.
The body, as blocks: hero (an html block with <img> — see constraint #3), headline (text), body copy (text), the
always-on social-proof block (text), the product block — or a 2-up/3-up grid of product cards for a collection — and a
bulletproof button CTA. The principles in references/email-html.md still guide block styling (clear hierarchy,
mobile-first, descriptive alt text, high-contrast CTA, real copy). Pull colors/fonts from the brand profile into the
definition's styles[] array.
Host every image at a public URL first, then reference it from an html block's <img src>. Show the user a summary of
the body before deploying.
PHASE 9 — Deploy to Klaviyo as a draft (placeholder audience)
Follow references/klaviyo-deploy.md and references/klaviyo-dnd.md. Sequence:
- Assemble the DnD template definition: the cached header section, then the Phase 8 body sections, then the
cached footer section — each withid/data_id/universal_idstripped (seereferences/klaviyo-dnd.md). Build
it via a script, write to a file, read it back, and create withcreate_dnd_email_template. If creation keeps
failing, fall back to a CODE template (create_email_template, full inline HTML with header/footer baked in) so
the run still ships a draft. Either way, tell the user the header/footer are embedded copies, and that turning them
into live Universal Content is a one-time manual swap in Klaviyo's visual editor. - Create a campaign in draft, configured as an A/B subject-line test with both subjects, the preheader, and
the default sender, then attach the template. - Audience = placeholder only. Use a single reusable segment named loudly, e.g.
⚠️ PLACEHOLDER — REPLACE BEFORE SENDING, scoped to a harmless test profile (the owner's own email). Create it once
and reuse it on every run. This guarantees that even an accidental send can't reach real customers — the user must
consciously swap in a real audience. - Never schedule or send. Building and sending are different actions; this skill stops at a reviewable draft.
PHASE 10 — Ship the package
Hand the user, clearly laid out:
- A link to the draft campaign in Klaviyo (and confirmation it's a draft with a placeholder audience).
- The two A/B subject lines and the preheader.
- The two audience prompts (targeted + broad) — copy-paste-ready for Klaviyo's audience/segment builder, with a
one-line note on who each reaches. - A recommended send day/time drawn from the Phase 4 performance analysis.
- The benchmarks to beat (so they know what success looks like).
- File paths to the local HTML and images.
- A reminder, in plain terms: the audience is a placeholder — set the real audience before sending.
Environment handling
GEMINI_API_KEY(required for the AI hero) — if missing, skip the hero, use product photos only, still finish
the email.TAVILY_API_KEY(optional) — fall back to WebSearch for research and reference imagery.SCRAPE_CREATORS_API_KEY(optional) — fall back to WebSearch for competitor research.- Klaviyo (required for Phase 4 analysis and Phase 9 deploy) — prefer a connected Klaviyo MCP/connector; otherwise
use the REST API withKLAVIYO_API_KEY. If Klaviyo is unavailable, save the HTML + brief locally, skip analysis and
deploy, and tell the user. - Prefer
python3; fall back topython.
Email philosophy (non-negotiable)
- The subject line is the whole ballgame for the open. Write it last, write it from customer language, A/B two of
them. - One idea per email. A second idea halves the first. Collection emails still sell one theme.
- Steal from customers, not your own marketing. Reddit threads and reviews are the best copy source on the internet.
- Beat the account's own history. If it wouldn't outperform a recent good send, push harder.
- Brand-consistent, every time. Same colors, fonts, voice. Consistency lives in the brand system.
- Mobile-first, bulletproof HTML. Most opens are on a phone with images half-loading. Build for that reality.
- Always show proof, never fake it. A real review beats a clever line. Never invent a quote, rating, price, or claim.
- Draft only. Never send. A human always approves the actual send, and the audience is always theirs to set.
Reference files
references/caching.md— how the brand profile, benchmark, and universal-blocks caches work and where files live.references/klaviyo-dnd.md— building the drag-and-drop template definition and reusing the store's universal
header/footer (the universal-block mechanism). Read before Phase 8.references/klaviyo-deploy.md— reading performance, creating the DnD template + draft campaign, the placeholder
audience, image hosting, via MCP or REST.references/email-html.md— email best-practice principles that guide block styling (and an optional local HTML
preview).references/image-generation.md— how to prompt Gemini / Nano Banana for the hero image, with the API pattern.