50 Email Engine
ASecurityThe Email Engine — a governed skill + Email Superlibrary that SELECTS the right framework, GENERATES corpus-faithful email copy, QCs it against fail-closed provers, and hands a DRAFT-ONLY deploy plan to the Convert & Flow (GoHighLevel) operator. Owns the reusable IP — 13 email frameworks, 12 persona styles, the buyer-type -> email# -> framework map, the 4 sequence objectives, the 10-email landing-page promo sequence and the 12-email buyer-type / high-ticket-appointment sequences — and gates e...
- 3 stars
- 0 votes
- 0 copies
- 1 view
- Added November 14, 2026
Works with
Security analysis
100/100Pro scans all 20 files and shows the line behind each finding
npx -y skills add trevorotts1/openclaw-onboarding --skill 50-email-engine --agent claude-codeAre you the author of 50 Email Engine?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/trevorotts1-50-email-engine)---
name: email-engine
description: The Email Engine — a governed skill + Email Superlibrary that SELECTS the right framework, GENERATES corpus-faithful email copy, QCs it against fail-closed provers, and hands a DRAFT-ONLY deploy plan to the Convert & Flow (GoHighLevel) operator. Owns the reusable IP — 13 email frameworks, 12 persona styles, the buyer-type -> email# -> framework map, the 4 sequence objectives, the 10-email landing-page promo sequence and the 12-email buyer-type / high-ticket-appointment sequences — and gates every one of those SACRED structures with a deterministic, model-free floor prover (prove-email.py). Runs P1 SELECT -> P2 GENERATE -> P3 QC -> P4 DEPLOY through one canonical entry (email-engine-entry.sh) with a deps/bypass/hash-pin/nonce gate; nothing is ever sent without explicit human approval.
version: 2.0.11
---
# Email Engine (Skill 50)
The methodology + enforcement layer for the Trevor Otts email system. This skill owns the
**IP and the gates**; it authors copy and a build plan, then hands off — it never sends an
email itself.
> The structures, counts, names, and rules captured in `MASTERDOC.md` (and mirrored from
> `SOURCE-EMAIL-CORPUS.md`) are **SACRED** — never floored, reordered, renamed, or
> reinterpreted. Every rule below is machine-enforced by a fail-closed prover, never advisory.
> **Enforcement, not description.**
## What this skill produces / owns
- `EMAIL-MANIFEST.json` — the phase machine (P1 SELECT -> P2 GENERATE -> P3 QC -> P4 DEPLOY),
each phase's `produces_artifact`, `_chk_*` preflight symbols, and the `AF-EMAIL-*` autofail
table with documented triggers.
- `intake/email-intake-questions.json` — the ONE-block intake spec (objective, buyer type,
offer, brand voice, sequence position, founder name; optional high-ticket flag +
persona style) with a `blocks_until_answered` provenance gate.
- `schema/email.schema.json` — the per-email input contract (`subjects[2]`, `previews`,
`body`, `framework`, `objective`, `buyer_type?`, `ctas[]`, `persona_style?`, `founder_name`,
`sequence_id`, `e_slot`).
- `tools/prove-email.py` — THE fail-closed floor prover. Deterministic, stdlib-only, no model
judgement. Enforces every SACRED invariant (see below) with a named `AF-EMAIL-*` code, exits
nonzero on any violation, and carries a built-in `--self-test` (VALID -> exit 0 /
VIOLATION -> exit nonzero).
- `tools/email_matcher.py` + `email_matcher_cli.py` — the tags + embedding-reranker matcher
(mirrors Skill 6's `funnel_matcher.py`): 3 flexibility modes, a confidence threshold, and an
optional semantic `EmbeddingReranker` hook. Never blocks; the user's explicit desire always wins.
- `MASTERDOC.md` — the SACRED email IP verbatim (13 frameworks + structures, the
buyer-type -> email# -> framework map, 12 persona styles, 4 objectives, and the
three named sequences), each rule tied to its `AF-EMAIL-*` code.
- `email-library/` — THE Email Superlibrary: **36 entries** as paired `<id>.json`
(machine `rules{}` spec) + `<id>.md` (how-to / example / tags) under
`frameworks/ buyer-types/ objectives/ persona-styles/ sequences/`, plus the
lexical `catalog-index.json` + built `catalog-built-index.json` and a
`register.py --check` coverage gate.
- `schema/brief.schema.json` + `schema/build-plan.schema.json` — the locked intake
brief contract and the Skill-44 DRAFT-ONLY deploy handoff contract.
- `tools/emit_build_plan.py` — deterministic P4 emitter: brief + approved copy ->
a DRAFT-ONLY Skill-44 (Convert & Flow / GoHighLevel) workflow build plan (email +
wait steps). Model-free; nothing sends.
- `index/` — the SEPARATE embed-once Gemini email index (`EMAIL-INDEX-MANIFEST.json`
with model + dims PINNED, `build-and-publish.sh` operator-box HASH-SKIP delta,
`provision-email-index.sh` -> `provision_email_index()` sha256-verified download,
NEVER a per-box re-embed).
- `examples/golden-landing-10/` — the golden 10-email regression sample (PASSES
end-to-end + issues a certificate) with `broken-variants/` proving fail-closed
rejection.
- `verify.sh` — the READ-ONLY self-verify gate (self-tests + register check + golden
reproduce + broken-variant rejection); nonzero on any failure.
- `email-engine-entry.sh` — the ONE sanctioned command. Deps / bypass-scan / hash-pin / nonce,
fail-closed. Refuses any hand-rolled email sender in the run directory.
- `run_email_engine.py` — the deterministic state machine over the manifest (P1 -> P4, no phase skips).
This skill produces no visual design and does not read Skill 45 (the Design Intelligence Library); its brand voice comes from its 12 persona styles and the brand voice field of the locked brief.
## The SACRED invariants the prover enforces
All from `SOURCE-EMAIL-CORPUS.md`. Each is a deterministic measurer with a named `AF-EMAIL-*` code.
| Invariant | Rule | Code |
|---|---|---|
| Framework set | `framework` is one of the 13 canonical ids; if a structured `sections[]` is supplied it must match the framework's declared part count | `AF-EMAIL-FRAMEWORK-UNKNOWN` / `AF-EMAIL-FRAMEWORK-INCOMPLETE` |
| Buyer-type map (12-email) | E1-2 spontaneous (3-B, Star-Chain-Hook) / E3-6 methodical (F2B, 6 W's, ACCA, PASTOR-Solutions) / E7-9 humanistic (PASTOR-Story, Star-Story-Solution, PAS) / E10-12 competitive (AIDA, Million-Dollar-Sales, BAB) | `AF-EMAIL-BUYERTYPE-MAP` |
| Landing-page map (10-email) | E1-3 PASTOR-Solutions, E4 F2B, E5 6 W's, E6 BAB, E7 3-B, E8 Million-Dollar-Sales, E9 AIDA, E10 PAS | `AF-EMAIL-SEQUENCE-MAP` |
| Sequence length | landing-page = 10 emails; high-ticket / buyer-type = 12 emails; slots contiguous 1..N | `AF-EMAIL-SEQUENCE-LENGTH` |
| Objective validity | exactly one of promotional / abandoned-cart / upsell / downsell / transactional (transactional is the launch welcome_access email only) | `AF-EMAIL-OBJECTIVE-INVALID` |
| Persona-style validity | if set, one of the 12 canonical styles | `AF-EMAIL-PERSONA-INVALID` |
| Persona never named | NEVER name/quote the referenced person (tone only, 100% original) — scanned in EVERY recipient-visible field: subjects, **previews (the inbox preheader)**, body, ctas, sections, disruptive_elements and founder_name (the From line) | `AF-EMAIL-PERSONA-NAMED` |
| Subject count | exactly 2 (A/B), both non-empty | `AF-EMAIL-SUBJECT-COUNT` |
| Preview count | Convert&Flow master = 1 line; high-ticket = 2 (the sequence declares which) | `AF-EMAIL-PREVIEW-COUNT` |
| Word band | 150-300 words, EXCEPT the 3-B Plan (< 150). A logged client-exact override wins over the default band | `AF-EMAIL-WORDBAND` |
| CTA count | >=1 per email; >=3 for the landing-page PASTOR emails (E1-3) | `AF-EMAIL-CTA-COUNT` |
| Subject char band | C&F: 8-12 words, no pricing token / high-ticket: 80-87 rendered chars, exactly ONE emoji | `AF-EMAIL-SUBJECT-CHARBAND` |
| First-name placement | `{{contact.first_name}}` in the first 40 chars of a subject (C&F) / present in a subject (HT) | `AF-EMAIL-FIRSTNAME-PLACEMENT` |
| Formatting | <=4 emojis in the body; never >3 sentences in a paragraph without a break | `AF-EMAIL-FORMAT` |
| Founder signature | the founder's ACTUAL name in the close, never a placeholder token | `AF-EMAIL-SIGNATURE-PLACEHOLDER` |
| Disruptive element (HT) | every high-ticket email carries >=1 disruptive element | `AF-EMAIL-DISRUPTIVE-MISSING` |
| Client-exact override | an override (`word_band_override` / `expected_preview_count` / `subject_mode`) is honored ONLY when echoed in the LOCKED brief; an unlogged override is refused and the SACRED default re-applies | `AF-EMAIL-OVERRIDE-UNLOGGED` |
| Process integrity | when the deploy artifact (`build-plan.json`) is present the REAL `PROCESS-CERTIFICATE.json` is required (`all_phases_pass` + a `certificate_sha` that recomputes); phases cannot be skipped | `AF-PROCESS-INTEGRITY` |
| Deploy-plan valid | a present `working/deploy/build-plan.json` validates against `schema/build-plan.schema.json`'s contract | `AF-EMAIL-DEPLOY-PLAN-INVALID` |
| Intake gate | brief comes from the turn-gated ledger (one block) — verified against an INDEPENDENT `conversation_ledger` export when present (authoritative), else from the self-attested one-block flags — the skill type matches, and all six brief fields are present | `AF-EMAIL-INTAKE-SPLIT` / `AF-EMAIL-TYPE-MISMATCH` / `AF-EMAIL-BRIEF-INCOMPLETE` |
**Client-exact overrides win.** The word band is the DEFAULT floor; when the client states an
exact per-email length it is honored verbatim, never floored, capped, or substituted. (Client-exact
is the fleet-wide absolute law.) The override is honored ONLY when it is **logged in the LOCKED
brief** (`locked_overrides.word_band_override` / `expected_preview_count` / `subject_mode`) — an
override that appears on the authoring-written `emails.json` but is NOT echoed in the locked brief
is refused (`AF-EMAIL-OVERRIDE-UNLOGGED`) and the SACRED default re-applies, so an override can never
silently loosen a gate. The honored override's source is recorded on the process certificate.
## How it runs — THROUGH one canonical entry
```
bash 50-email-engine/email-engine-entry.sh --run-dir <RUN_DIR> [--plan]
```
The entry runs three fail-closed gates (DEPS -> BYPASS-SCAN -> VERSION/HASH-PIN), mints a
run-scoped nonce, and dispatches the deterministic orchestrator `run_email_engine.py`, which
walks the manifest P1 -> P2 -> P3 -> P4 with no phase skips. **P3 QC shells out to
`prove-email.py` and refuses to advance on any `AF-EMAIL-*` violation.** Writing and running a
hand-rolled sender (`python3 working/*send*.py`, a direct GHL/SMTP send outside the sanctioned
handoff) is the **ungoverned path and is FORBIDDEN** (`AF-EMAIL-SEND-BYPASS`). A gate may be
skipped ONLY by a logged owner approval token in
`<run-dir>/working/checkpoints/process_manifest.json` — never silently, never by an agent's choice.
## Deploy is DRAFT-ONLY (P4)
P4 emits a Skill-44 (Convert & Flow / GoHighLevel) build plan as a **draft workflow** only.
Nothing sends. A human approves before any send, and the Skill-44 built-workflow QC gate
(`>= 8.5`) runs on the draft. Scope is workflow email steps only.
The deploy handoff follows the V4 workflow contract, so these are binding:
- **Create is draft.** A new workflow is created with status `draft` only.
- **Exact revision.** Every update carries the exact opaque `expected_revision` read back
from the current definition. It is never synthesised or coerced; a missing, invalid, or
mismatched revision is refused (`revision_missing` / `revision_invalid` /
`stale_revision`, 422) with nothing written.
- **A published workflow is not updatable.** Editing a `published` workflow is refused as
`conflict` (`workflow_published`, 409). There is no automatic unpublish; leaving the
published state is itself a separate, approved status change followed by a fresh read.
- **No auto-publish.** Building, approving, or passing QC never publishes. Publishing or
unpublishing is a separate observed `workflows.status.publish` operation with its own
`draft_transition_approval`, and a status change advances the revision, so a fresh read
follows it. P4, `emit_build_plan.py`, the Skill-44 handoff, and the QC gate never publish.
- **Send authorization is separate.** Approval to build, approve, publish, or QC a workflow
is NOT authorization to send email. A recipient send requires its own explicit human
approval, and this skill never sends. Hand-rolled senders stay FORBIDDEN
(`AF-EMAIL-SEND-BYPASS`).
## Presentations department integration (election-gated delivery option)
The presentations department offers this skill's sequences as an ELECTION-GATED delivery
option, beside its sales/checkout and VSL upsell elections (FIX-PLAN Item 33c; department
doctrine: `presentations/sops/EMAIL-SEQUENCE-BUILDER-SOP.md`). The gate, the draft-only
posture, and the human approval step are stated identically on both sides:
- **Election gate.** The client is asked at presentation intake
(`want_email_sequences`, default NO). Only an explicit "yes" elects the sequences.
A "no" is a client waiver and is valid only with the client's own verbatim reason
(`email_sequences_declined_reason`): a bare "no" fails closed at the delivery gate
(AF-EMAIL-WAIVER-MISSING), and silence is never consent and never a decline. The one
election covers both sequences: the 10-email landing-page promo sequence (prepared
only when the run also elected the sales/checkout page it serves) and the 12-email
high-ticket appointment sequence (the post-delivery follow-up).
- **Draft package, prepared at delivery.** On an elected run the presentations engine
prepares a DRAFT package at delivery time (`working/email/email-brief.json`: sequence
definition, audience, trigger, brief answers sourced only from the run record) and
hands it to Skill 44's operator surface (`working/email/skill44-handoff.json`). The
package is NOT this skill's locked brief: the brief contract's one-block intake
attestation (`asked_all_at_once`, `question_block_msg_id`) is captured by this
skill's own intake at approval time and is never fabricated by the presentations
engine.
- **Human approval, draft-only.** A human approves at Skill 44's operator surface
before this skill runs. On approval this skill executes P1 to P4 through
`email-engine-entry.sh`, and P4 emits the DRAFT-ONLY `build-plan.json` for Skill 44;
every workflow stays a draft until Skill 44's approval and built-workflow QC gate
(>= 8.5) complete. Publication is a separate explicit `workflows.status.publish`
operation and is never automatic; neither the build approval nor publication is send
authorization. The approval and the resulting workflow id are recorded back into
the run record (`working/checkpoints/email.json`). Nothing in this integration sends
an email or arms a sequence; hand-rolled senders stay FORBIDDEN
(AF-EMAIL-SEND-BYPASS).
- **Unavailable fallback.** If this skill is not installed on a box, an elected run
prepares nothing and the run record states that the election was answered but
Skill 50 was unavailable, so no email follow-up is prepared.
## Client-provider rule (binding)
On a client box this skill uses the **client's own configured providers and keys** — never the
operator's, never Anthropic / `claude-*` model ids. The deterministic gates
(`prove-email.py`, `email_matcher.py`, `run_email_engine.py`) are model-free Python that run
identically everywhere; the authoring/QC LLM tiers named for the client path are the client's
own provider chain. This skill is provider-neutral by construction.
## Verify
`bash 50-email-engine/verify.sh` is the self-verify gate: it runs `prove-email.py --self-test`
(built-in VALID + VIOLATION fixtures), `email_matcher_cli.py --selftest`,
`emit_build_plan.py --selftest`, `email-library/register.py --check`, the golden
reproduce, and the broken-variant rejection proof — and exits nonzero on any regression,
so it can gate a merge / CI / a post-install check.
Files in this skill
- CHANGELOG.md
- EMAIL-MANIFEST.json
- ENGINE-PIN.sha256
- MASTERDOC.md
- SKILL.md
- SOURCE-EMAIL-CORPUS.md
- email-engine-entry.sh
- email-library/README.md
- email-library/buyer-types/buyer-type-competitive.json
- email-library/buyer-types/buyer-type-competitive.md
- email-library/buyer-types/buyer-type-humanistic.json
- email-library/buyer-types/buyer-type-humanistic.md
- email-library/buyer-types/buyer-type-methodical.json
- email-library/buyer-types/buyer-type-methodical.md
- email-library/buyer-types/buyer-type-spontaneous.json
- email-library/buyer-types/buyer-type-spontaneous.md
- email-library/catalog-built-index.json
- email-library/catalog-index.json
- email-library/frameworks/framework-acca.json
- email-library/frameworks/framework-acca.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.