Applied AI Portfolio · Agent 05

Live Apparel · Retail Copy Generator

Promotional
Copy Generator

A structured output agent for Meridian Athletic — a fictional outdoor apparel brand. Built to generate three distinct A/B/C promotional copy variants from product inputs, with hard token limits and a single API call.

3
Copy Variants
~240
System Prompt Tokens
1
API Call
<800
Max Output Tokens
01 —

Problem & Objective

Marketing and merchandising teams at apparel brands write dozens of copy variants every week — product descriptions, email subject lines, promotional headlines. The work is repetitive, brand-sensitive, and bottlenecked by the availability of copywriters. A generic AI prompt produces inconsistent output: wrong tone, uncapped length, no A/B structure.

The objective was to build an agent that produces three production-ready copy variants in a single call — each with a fixed structure, enforced word limits, and a distinct tone register — so marketing teams can A/B test without a copywriter in the loop.

The Problem

Unstructured AI copy prompts return inconsistent length, tone, and format. Teams can't A/B test outputs that don't conform to a schema, and there's no way to guarantee brand voice without prompt engineering discipline.

The Objective

An agent that accepts product inputs and returns three structured copy variants — tagline, headline, body, CTA — each under hard word limits, in three distinct tone registers, parseable as JSON with no post-processing.

02 —

System Prompt & Token Design

The system prompt is the entire product. At ~240 tokens, it enforces output schema, caps every field at hard word limits, assigns a distinct tone register to each variant, and mandates clean JSON with no preamble. This is deliberate PM craft: maximum output reliability from minimum token spend.

Every constraint in the prompt is a product decision — not a technical one. Word limits exist because real marketing channels (push notifications, email subject lines) have character caps. Tone separation exists so teams can test emotional vs. performance messaging. JSON-only output exists so the UI can parse without regex.

System Prompt Structure
// Identity & Role You are a senior copywriter for a premium outdoor apparel brand. Generate exactly 3 distinct promotional copy variants (A, B, C). // Output Rules - Return ONLY valid JSON, no preamble or explanation - Each variant must have exactly 4 fields: tagline, headline, body, cta // Field Constraints (hard limits) - tagline: ≤8 words — bold and memorable - headline: ≤12 words — benefit-driven - body: ≤30 words — aspirational, feature-specific - cta: ≤5 words — action-oriented // Tone Registers (A/B/C) - Variant A: emotional / storytelling tone - Variant B: performance / technical tone - Variant C: urgency / value tone // Return Format {"variants":[{"id":"A","tagline":"...","headline":"...","body":"...","cta":"..."}, {"id":"B",...},{"id":"C",...}]}

The user message adds product name, key features, target audience, and price point — typically ~50–80 tokens. Total call budget sits around 1,100 tokens, well under the threshold where cost or latency becomes a concern.

System Prompt
~240
Schema, constraints, tone rules, JSON format instruction
User Input
~60
Product name, features, audience, price point
Max Output
<800
3 variants × 4 fields × hard word limits
Total budget per call ~1,100 tokens
03 —

Structured Output & Variant Logic

Each variant targets a different buyer psychology. Variant A builds emotional connection — useful for brand awareness campaigns. Variant B leads with technical performance — useful for product detail pages and search ads. Variant C creates urgency — useful for promotions and retargeting. The same product input produces three channel-ready outputs in one call.

Variant Tone Register Sample Output — Meridian Alpine Shell Best Used For
A Emotional
"The mountain doesn't wait."
Headline: Built for those who move before the weather decides. Body: Lightweight, waterproof, and ready when you are — the Alpine Shell packs to your palm and performs at the summit.
Brand awareness, lifestyle campaigns, social
B Performance
"20K waterproof. Zero compromise."
Headline: 20K-rated waterproof shell in recycled nylon, under 300g. Body: Pit vents regulate temperature on the ascent. Packable shell deploys in seconds. Engineered for unpredictable alpine conditions.
PDPs, search ads, gear review placements
C Urgency
"Season-ready. Limited stock."
Headline: Premium alpine protection — now at the price that moves fast. Body: The Alpine Shell is back for the season. Waterproof, packable, sustainable. Sizes selling fast — don't get caught in the open.
Promotions, retargeting, email campaigns

The output schema is enforced entirely through prompt — no function calling, no tool use, no post-processing pipeline. JSON is parsed directly in the UI. If the model returns well-formed JSON (which it does consistently with a clear schema instruction), the UI renders immediately.

Output Field Schema
Field Word Limit Purpose Channel Fit
tagline ≤ 8 words Brand-level hook, emotionally resonant Social, OOH, campaign hero
headline ≤ 12 words Benefit-led, scannable, SEO-friendly Email subject, PDP title, search ad
body ≤ 30 words Feature-specific, aspirational, tone-matched Email body, PDP description, ad copy
cta ≤ 5 words Action-oriented, creates momentum Button text, push notification, banner
04 —

Concepts Demonstrated

✍️
System Prompt Engineering

Role, schema, field constraints, tone registers, and output format — all encoded in ~240 tokens. Every word in the system prompt is a product decision that directly affects output quality and consistency.

📐
Structured Output

JSON schema enforced through prompt instruction — no function calling required. 4 fields per variant, 3 variants per call, parseable directly in the UI without regex or post-processing.

🪙
Token Efficiency

~1,100 tokens total per call. No RAG, no multi-step pipeline, no tool use. Single synchronous call — demonstrating that well-designed prompts deliver production value without architectural complexity.

🎚️
Tone Register Control

Three distinct psychological levers — emotional, performance, urgency — generated from a single product input. Gives marketing teams channel-ready A/B/C variants without a copywriter in the loop.

🔌
Anthropic API

Direct API integration with system prompt injection, max_tokens cap, and JSON response parsing. Live token usage displayed post-call to make efficiency visible and auditable.

⚡
PM-First AI Design

Every constraint — word limits, tone splits, JSON schema — maps to a real business requirement: channel character limits, A/B testing needs, downstream system integration. AI in service of product, not the other way around.

05 —

Lessons Learned

1
Hard word limits work better than soft guidance. Telling the model "be concise" produces variable length. Specifying "≤8 words" produces consistent, channel-ready output. Constraints are features, not restrictions.
2
Schema in the system prompt eliminates post-processing. Specifying the exact JSON structure — field names, nesting, array format — means the response parses directly. No regex, no error-prone string manipulation between API and UI.
3
Tone registers need behavioural descriptions, not adjectives. "Emotional tone" alone is vague. Pairing it with "storytelling, human connection, aspiration" produces consistently distinct output from "performance, technical specs, measurable outcomes."
4
The token counter is a product feature, not a debugging tool. Displaying system prompt tokens, input tokens, and output tokens in the UI makes AI efficiency legible to non-technical stakeholders. Visibility builds trust and supports governance conversations.
5
API keys must go through a proxy from day one. Embedding keys in client-side HTML — even with spend limits — exposes them in view-source. A Cloudflare Worker proxy should be the default starting point for any browser-based agent before it goes to production.