# Chapter 7 — Chaining Prompts

# ── CHAIN 1: Monthly Commentary Pipeline ────────────────────────
# Step 1: Extract raw data summary
# Prompt to AI:
"Given this sales CSV excerpt [paste 20 rows], extract:
- Total revenue for each month present
- Order count per month
- Most common status per month
Format as a JSON object."

# Step 2: Write commentary from structured output
# Use the JSON from Step 1 as input:
"Using this monthly summary: [paste JSON output]
Write 2-sentence commentary for each month.
Tone: professional analyst. Start each with the month name."

# Step 3: Format for PowerPoint
# Use the commentary from Step 2:
"Convert these monthly commentaries into PowerPoint slide bullets.
Max 2 bullets per month. Max 10 words per bullet. Keep the numbers."

# ── CHAIN 2: Customer Email Pipeline ────────────────────────────
# Step 1: Customer profile from data
"Summarise this customer's order history in 3 bullet points.
Customer: Alpine Innovations
Orders: [paste relevant rows from sales.csv]
Include: total spend, most ordered product, last order date, status breakdown."

# Step 2: Draft personalised email
"Using this customer profile: [paste Step 1 output]
Draft a re-engagement email from our Sales Manager.
The customer has not ordered in 60 days.
Offer: 10% discount on their most purchased product.
Tone: warm but professional. Max 150 words."

# Step 3: Subject line variants
"Generate 5 subject line variants for this email: [paste email]
- Variant A: curiosity-driven
- Variant B: benefit-focused
- Variant C: personalised (uses company name)
- Variant D: urgency-based
- Variant E: question format"
