---
name: curcuma-email-improve
route: "Improve, critique, or fix an EXISTING email HTML"
router-terms: improve, fix, critique, review, optimize, audit, check, debug, broken, not rendering, outlook issue, dark mode broken, mobile issue, make better
description: |
  Audit an existing HTML email against real production standards and produce
  a fixed version. Runs the email through get_pattern checks to identify what's
  missing (bulletproof buttons? MSO conditionals? preheader? responsive?),
  compares its structure to industry norms, then outputs corrected HTML.
  Use when the user has existing email HTML and wants it improved or fixed.
  Trigger on: "improve this", "fix this email", "why does this break in
  Outlook", "audit this email", "make this responsive", "add dark mode".
---

# Curcuma Email Improve

Audit and fix an existing HTML email against what 19,795 real production
emails actually ship. Don't guess at what's wrong — check against data.

## When to Use This

- User pastes existing email HTML and wants it improved
- User reports a rendering bug ("breaks in Outlook", "mobile looks wrong")
- User wants an accessibility/quality audit
- User wants to add a missing feature (dark mode, responsive, preheader)

## When NOT to Use

- User wants a brand new email from scratch → `curcuma-email-design`
- User wants research on a topic, not a fix → `curcuma-email-research`

## CRITICAL: Output Behavior

**This skill produces a fixed HTML file, not a report.**

1. Save the improved email as `email-output/{type}-improved-{date}.html`
2. Output the full corrected HTML inline
3. Report a checklist of what was found and fixed

---

## Workflow

### Step 1: Read the existing email

If the user pastes HTML, read it carefully. If they provide a file path, read
the file. Extract:
- Structure (tables, columns, width)
- CTA implementation (border-radius? bulletproof? image?)
- MSO conditionals (present? missing?)
- Responsive CSS (present? breakpoints?)
- Preheader (present? length?)
- Alt text on images (coverage?)
- Dark mode support (color-scheme meta? prefers-color-scheme?)
- Unsubscribe link (present?)

### Step 2: Run pattern checks

For each pattern the email might be missing, call get_pattern to get the
industry baseline:

```
get_pattern(name="bulletproof button")
get_pattern(name="mso conditional")
get_pattern(name="responsive")
get_pattern(name="preheader")
get_pattern(name="dark mode")
get_pattern(name="footer")
```

Each returns:
- Prevalence (% of real emails using it)
- Production code examples
- Variant breakdown

### Step 3: Build the fix list

Compare the existing email to the **pattern data you just retrieved**.
For each gap, record the baseline **from the tool response** (never from
memory or this table’s cells):

| Check | Industry baseline | Action if missing |
|---|---|---|
| Bulletproof buttons | *(from get_pattern)* | Replace plain `<a>` buttons with VML/padded-td fallback |
| MSO conditionals | *(from get_pattern)* | Add `<!--[if mso]>` blocks for Outlook fixes |
| Responsive CSS | *(from get_pattern)* | Add @media query for mobile stacking |
| Preheader | *(from get_pattern)* | Add hidden preview text div |
| Dark mode | *(from get_pattern)* | Add color-scheme meta + prefers-color-scheme CSS |
| Alt text / images | *(from get_pattern `images`)* | Add/fix alt attributes on all images |
| Unsubscribe / footer | *(from get_pattern `footer`)* | Add unsubscribe link + physical address |
| Ghost tables | *(from get_pattern)* | Add for multi-column Outlook support |
| Image width/height | — | Set explicit dimensions to prevent layout shift |

**Hard fail:** do not invent prevalence percentages. If you did not call
`get_pattern` for a check, omit the baseline number.

### Step 4: Find reference emails for specific fixes

For structural issues (broken layout, poor CTA design), find better examples:

```
search_emails(query="welcome", limit=5, max_per_company=1)
get_email_summary(slug="<best-match-slug>")
```

Use the summary's `structure` and `cta_buttons` fields to understand how
well-designed emails handle the same problem.

### Step 5: Apply fixes

Write the corrected HTML. Preserve the user's content (copy, images, brand
colors) — only fix the structural and technical issues.

Common fixes:
- **Outlook button fix**: Replace `<a style="border-radius:8px">` with full
  VML bulletproof button from get_pattern examples
- **Responsive fix**: Add `<style>@media(max-width:600px){...}</style>` with
  column stacking and fluid images
- **Preheader fix**: Add `<div style="display:none;max-height:0">Preview text</div>`
  right after `<body>`
- **Dark mode fix**: Add `<meta name="color-scheme" content="light dark">` and
  `@media(prefers-color-scheme:dark){...}` overrides
- **Alt text fix**: Add `alt="Descriptive text"` to every `<img>`

### Step 6: Deliver

Save and output the fixed HTML. Report the checklist:

```
AUDIT RESULTS:
[x] Bulletproof buttons — ADDED (was: plain border-radius, breaks in Outlook)
    baseline: {paste prevalence string from get_pattern bulletproof-button}
[x] MSO conditionals — ADDED (was: missing, Outlook rendering unstyled)
    baseline: {from get_pattern mso-conditional}
[ ] Responsive CSS — already present (good)
[x] Preheader — ADDED (was: missing, no inbox preview text)
[x] Alt text — FIXED (3 images were missing alt attributes)
[ ] Dark mode — not added (optional if get_pattern shows low prevalence — ask user;
    quote the tool’s prevalence string, do not invent one)

Based on get_pattern results in this session (cite pattern names + returned prevalence).
```

## Grounding

See `skills/GROUNDING.md`. When fixing layout/CTA taste, `search_emails` +
`get_email_summary` for the same email type and cite slugs. Do not “improve”
by inventing a new design system from training data. Do not replace broken
images with placehold.co — use real assets or honest `{{IMG_*}}` + needs list.

## Anti-patterns

- DON'T rewrite the email from scratch — fix what's broken, preserve what works
- DON'T add every pattern blindly — if `get_pattern(name="dark-mode")` shows
  low prevalence, treat it as optional and ask the user
- DON'T skip the pattern checks — "I know email best practices" misses real data
- DON'T change the brand's visual identity — fix structure, not aesthetics
- DON'T invent reference patterns without tool calls and slug citations
- DON'T paper over missing images with fake placeholder hosts
