Skip to main content
Glama
README.md
# Preflight

### Your agent writes 50 drafts. Preflight picks which one ships.

Add Preflight to Claude Code, Cursor, or Codex in one command. Compare ads, emails, copy, and UI blind before spending traffic, evolve stronger variants, and earn a **100% credit rebate** when you report real outcomes.

> **Free `$10` starter balance on signup · No credit card · Private by default · Pay per call at cost**  
> Website & benchmarks: [preflight.tech](https://preflight.tech) · Hosted MCP: `https://preflight.tech/api/mcp`

---

## Install in One Command

### 1. Agent Skills (`skills.sh` · Claude Code, Cursor, Codex, Copilot)
```bash
npx skills add MikeKovetsky/preflight
```
Installs four focused skills (or pick one with `--skill`):
- `preflight`: Universal `decide` / `evolve` / `report` workflow
- `preflight-ads`: Pre-spend ranking & creative brief evolution for still image ads
- `preflight-emails`: Pre-send A/B evaluation for marketing & lifecycle emails
- `preflight-copy`: Bounded evolutionary copy optimization for heroes, CTAs, paywalls, and pricing

### 2. Connect the Hosted MCP Server (OAuth 2.1 + Bearer API Keys)

**Claude Code:**
```bash
claude mcp add --transport http preflight https://preflight.tech/api/mcp
```

**Claude.ai / Claude Desktop / ChatGPT:** Add a Custom Connector at `https://preflight.tech/api/mcp` (OAuth 2.1 opens a browser sign-in or creates a free `$10` account on the spot).

**Cursor (`.cursor/mcp.json`):**
```json
{
  "mcpServers": {
    "preflight": {
      "url": "https://preflight.tech/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:PREFLIGHT_API_KEY}"
      }
    }
  }
}
```

**OpenAI Codex (`~/.codex/config.toml`):**
```toml
[mcp_servers.preflight]
url = "https://preflight.tech/api/mcp"
bearer_token_env_var = "PREFLIGHT_API_KEY"
```

### 3. CLI (`run-preflight`, zero dependencies, Node 18+)
```bash
# Mint a free $10 API key (no card)
npx run-preflight signup you@company.com

# Compare two variants (text, URLs, or local PNG/JPG files)
npx run-preflight decide "Headline A" "Headline B" --surface landing_page --audience "AI founders"

# Evolve stronger copy with verified fact & claim linting (use --rounds 1 for fast checks)
npx run-preflight evolve "Baseline headline" --surface landing_page_hero --rounds 1 --facts "free $10 key,no card"
```

### 4. GitHub Action (PR Conversion Gate)
```yaml
- uses: MikeKovetsky/preflight@v0.16.2
  with:
    api_key: ${{ secrets.PREFLIGHT_API_KEY }}
    baseline_url: https://yourapp.com/pricing
    candidate_url: ${{ steps.preview.outputs.url }}/pricing
    surface: pricing
    audience: "Technical startup founders"
    github_token: ${{ secrets.GITHUB_TOKEN }}
```
See [examples/github-pr-gate.yml](examples/github-pr-gate.yml) for a full workflow.

---

## The 3 MCP Tools

| Tool | What it does | Typical cost |
|---|---|---:|
| **`decide`** | Compares `2..N` variants (copy, URLs, screenshots, still ad images) blind in both presentation orders, with 4 checks on the deciding pair. Returns `DECISIVE_WIN` only when all 4 agree, else `TIED_LOW_SIGNAL`. | ~$0.07 |
| **`evolve`** | Runs a bounded multi-round generation, deterministic claim/length linting (`verified_facts`, `banned_claims`), and pairwise ranking loop with a fresh 4-answer holdout exit check (`overfit_warning`). | Token-metered at cost (`max_rounds: 1` for fast checks) |
| **`report`** | Grades a prior `prediction_id` against real post-launch results (pure NumPy, zero LLM calls) and automatically rebates **100% of the call cost** when the submitted variants match the pre-registered SHA-256 hashes. | $0 (+100% rebate) |

---

## Benchmarks & Honest Limits

Every number below was measured strictly blind (zero spend, CTR, CPA, or winner labels shown to the model). Full tables and receipts live at [preflight.tech/benchmark](https://preflight.tech/benchmark).

| Benchmark (blind against real outcomes) | Preflight `decide` | Notes |
|---|---:|---|
| **Meta still image ads** (139 real pairs) | **72.3% (402/556)** | **80.4%** on confident 4/4 `DECISIVE_WIN` calls; Claude Fable 5.2 scored `63.3%` on the same pairs |
| **Commercial UX/UI & paywall A/B tests** (61 pairs, with context) | **84.8% (207/244)** | Meaningful layout/offer changes perform far better than subtle styling tweaks |
| **Real subscriber email A/B tests** (343 pairs) | **71.9% (493/686)** | `64%–68%` balanced accuracy, `5–12` points ahead of Claude Fable 5.2 |

**Where it does NOT work (published openly):**
- **Video ads:** Not supported yet (still images, screenshots, URLs, and copy only).
- **Google Search text ads:** Unproven (raw models sit near a coin flip on same-era search copy).
- **Subtle landing-page layout tweaks:** Generic page-only A/B tests are much noisier than clear offer, ad, email, or copy differences.
- **Not a replacement for live traffic on big bets:** `evolve` checks new copy against a fresh 4-answer holdout (`overfit_warning`), but real-traffic lift still needs live confirmation.

---

## Repository Layout

```text
.
├── skills/
│   ├── preflight/SKILL.md          # Universal Preflight MCP skill
│   ├── preflight-ads/SKILL.md      # Paid still image ads & ad copy
│   ├── preflight-emails/SKILL.md   # Lifecycle & marketing emails
│   └── preflight-copy/SKILL.md     # Landing pages, CTAs, paywalls, pricing
├── cli/                            # Zero-dependency run-preflight CLI (npm)
├── action.yml + action/run.mjs     # GitHub Action PR Conversion Gate
├── server.json                     # Official MCP Registry manifest
└── examples/                       # Copy-paste Claude Code, CI, and Node recipes
```

## License

MIT. See [LICENSE](LICENSE).