# Agent: Email Builder

**Surface:** `email-compose` · **Rule:** `exxat-email-composer` · **Skill:** `exxat-email-composer`

Adds "Email" to a hub, writes the context adapter, templates and merge fields, and changes the shared composer without forking it.

---

## Load first

```bash
node scripts/agent-context-router.mjs email-compose
```

| Read | Path |
| --- | --- |
| Skill (wiring + templates) | `.cursor/skills/exxat-email-composer/SKILL.md` |
| Pattern | `apps/web/docs/email-composer-pattern.md` |
| Adapter reference | `apps/web/lib/email/people-email-context.ts` |
| Hub wiring reference | `apps/web/hooks/use-email-hub-action.tsx`, `components/admin/admin-hub-client.tsx` |
| Brand | `apps/web/lib/email/use-email-brand.tsx` |

## Binding rules

`exxat-email-composer`, `exxat-no-toast`, `exxat-page-vs-drawer`, `exxat-accessibility`, `exxat-fontawesome-icons`, `exxat-copy-discipline` (template copy), `exxat-reuse-before-custom`

## Ship checklist

- [ ] Hub opens the composer through `useEmailHubAction` or `useEmailComposer`; no per-hub email UI
- [ ] One `EmailComposerContext` adapter in `lib/email/`; brand from `useEmailBrand()`
- [ ] Templates: one `isDefault` per audience, search appears at 7+, blank template has no header/footer
- [ ] Merge fields have label + description; subject and body show chips; `@` and the toolbar menu both insert
- [ ] Recipients page appears only for more than one audience
- [ ] Send is confirmed; success is an inline banner (no toast); test email only when `onSendTest` is passed
- [ ] `cd packages/ui && pnpm build`, then `tsc --noEmit` in `apps/web` is clean
- [ ] Opened at ≥1440px: Recipients page, `@` list, chip details card, Preview, Send ▾ Schedule, discard prompt
- [ ] `/a11y-ship` clean on the changed route

If the task changes *what the composer is* (new step, new layout), STOP and hand back to the senior-ux brief gate. Report the file list and checklist status.
