Copy System

Autonomous AI ad copy generation pipeline. 6-stage pipeline with 7 editing passes, 3 quality gates, compliance engine, and a self-improving feedback loop via ad performance data.

Tech Stack

  • Framework: Next.js 16, TypeScript, Tailwind
  • Hosting: Cloudflare Workers (OpenNext)
  • Database: D1 (copy-system-db)
  • D1 ID: 52b93002-22c0-44c8-b585-e65ae20eac8a
  • Vector DB: Cloudflare Vectorize (voc-embeddings, 1536 dim, cosine, OpenAI text-embedding-3-small)
  • LLM: Anthropic Claude (pipeline agents), OpenAI (embeddings)
  • Scraping: CamoFox (Google VOC mining)
  • Auth: Cloudflare Access + CF-Access-Authenticated-User-Email header

URLs & Repos

  • Production: copy.coy.gg
  • Repo: coydevs/copy-system (GitHub, private)
  • Meta App ID: 1792537038079116 (shared with ABO Launcher)

Key Features

  • VOC Manager - Paste/upload voice-of-customer quotes
  • Google VOC Mining - Scrape Reddit via Google using CamoFox
  • Meta OAuth - Import ads from Facebook (ads_read, ads_management)
  • Auto-scoring - CPA/ROAS/hold/refund composite scoring
  • Manual score override
  • Pipeline run UI with real-time progress
  • Text + JSON export

Pipeline Stages

  1. Discussion - Schwartz awareness + sophistication mapping
  2. Concepts (5x3=15) - Evolve playbook, Rule of One
  3. Outlines - 8-section skeleton per copy
  4. Copywriting - Inverted writing (CTA first), 8 separate LLM calls per copy
  5. Hooks (5 per file = 75 total) - 12 hook types
  6. Editing (7 passes) - Cross-file analysis, character consistency, DR optimization, compliance scan, mechanical enforcement, mobile formatting, cross-file diversity

Quality Gates

  • Gate 1: Rule of One + banned patterns + angle diversity
  • Gate 2: Template sequence + proof distribution + metaphor diversity
  • Gate 3: 30+ per-file checks + hook scoring + formatting validation

Compliance Engine

27 rules (12 high, 10 medium, 5 low severity). Auto-fix for 18 violations. Power words list (55 words).

Phase 2: Feedback Loop

Ad ingestion, composite scoring, DNA extraction, pattern synthesis, trend detection, feedback injection into pipeline.

  • Thompson Sampling (80/20 exploit/explore)
  • Per-niche vector DB partitions
  • 8 safety rules

Deployment

Cloudflare Workers via OpenNext. Deploy with Wrangler.