# Assembly Planner — Test Examples
# Each example shows: USER INPUT → EXPECTED OUTPUT
# Use these to validate the planner and as few-shot examples if needed.

═══════════════════════════════════════════════════════════════
EXAMPLE 1: Simple, data-provided
═══════════════════════════════════════════════════════════════

USER INPUT:
"Create a quarterly earnings report for Acme Corp. Q3 2026.
Revenue: $18.7M (+34% YoY). Gross margin: 28.4% (+340bps).
ARR: $52.1M. Net retention: 127%.
Segments: SaaS Platform $11.2M (60%, +41%), Professional Services $4.8M (26%, +22%), Marketplace $2.7M (14%, +67%).
Q4 guidance: $20-21M revenue."

EXPECTED OUTPUT:
{
  "meta": {
    "title": "Acme Corp — Q3 2026 Earnings Review",
    "description": "Interactive quarterly earnings report with KPIs, revenue trends, segment breakdown, and forward outlook",
    "template_match": "Quarterly Earnings"
  },
  "theme": "midnight-mint",
  "wrapper": {
    "engine": "18",
    "config": {
      "progress_bar": true
    }
  },
  "sections": [
    {
      "id": "headline",
      "title": "Q3 2026 Earnings",
      "components": [],
      "content": {
        "headline": "Revenue grew 34% while margins expanded to 28.4%",
        "body": "Strong execution across all segments drove record quarterly performance, with SaaS ARR crossing the $50M threshold for the first time.",
        "notes": null
      }
    },
    {
      "id": "key-metrics",
      "title": "Key Metrics",
      "components": [
        {
          "engine": "03",
          "instance_id": "hero-kpis",
          "role": "Primary KPI cards with quarterly highlights",
          "config": { "layout": "grid-4", "animate": true },
          "data": {
            "metrics": [
              { "label": "Revenue", "value": "$18.7M", "change": "+34% YoY", "direction": "up" },
              { "label": "Gross Margin", "value": "28.4%", "change": "+340bps", "direction": "up" },
              { "label": "ARR", "value": "$52.1M", "change": "Milestone", "direction": "up" },
              { "label": "Net Retention", "value": "127%", "change": "+8pts", "direction": "up" }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "revenue-trend",
      "title": "Revenue by Quarter",
      "components": [
        {
          "engine": "03",
          "instance_id": "revenue-chart",
          "role": "Quarterly revenue bar chart",
          "config": {},
          "data": {
            "charts": [
              {
                "type": "bar",
                "title": "Quarterly Revenue ($M)",
                "labels": ["Q1 '25", "Q2 '25", "Q3 '25", "Q4 '25", "Q1 '26", "Q2 '26", "Q3 '26"],
                "datasets": [
                  { "label": "Revenue", "data": [9.2, 10.8, 12.1, 13.9, 14.7, 16.3, 18.7] }
                ]
              }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "segments",
      "title": "Segment Breakdown",
      "components": [
        {
          "engine": "03",
          "instance_id": "segment-cards",
          "role": "Segment revenue cards with progress bars",
          "config": { "layout": "grid-3" },
          "data": {
            "metrics": [
              { "label": "SaaS Platform", "value": "$11.2M", "change": "+41% YoY · 60% of revenue", "direction": "up" },
              { "label": "Professional Services", "value": "$4.8M", "change": "+22% YoY · 26% of revenue", "direction": "up" },
              { "label": "Marketplace", "value": "$2.7M", "change": "+67% YoY · 14% of revenue", "direction": "up" }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "outlook",
      "title": "Forward Outlook",
      "components": [
        {
          "engine": "17",
          "instance_id": "q4-scenarios",
          "role": "Q4 guidance scenario modeler",
          "config": {},
          "data": {
            "variables": [
              { "id": "enterprise_close_rate", "label": "Enterprise Close Rate", "min": 20, "max": 60, "default": 40, "step": 5, "suffix": "%" },
              { "id": "marketplace_growth", "label": "Marketplace Growth", "min": 30, "max": 100, "default": 67, "step": 5, "suffix": "%" },
              { "id": "net_retention", "label": "Net Retention", "min": 110, "max": 140, "default": 127, "step": 1, "suffix": "%" }
            ],
            "scenarios": [
              { "name": "Bull Case", "values": { "enterprise_close_rate": 55, "marketplace_growth": 90, "net_retention": 132 } },
              { "name": "Base Case", "values": { "enterprise_close_rate": 40, "marketplace_growth": 67, "net_retention": 127 } },
              { "name": "Bear Case", "values": { "enterprise_close_rate": 25, "marketplace_growth": 40, "net_retention": 118 } }
            ],
            "outputs": [
              { "label": "Q4 Revenue", "expression": "(18.7 * (1 + (enterprise_close_rate - 40) / 200) * (1 + (marketplace_growth - 67) / 500) * (net_retention / 127)).toFixed(1)", "format": "currency" }
            ]
          }
        }
      ],
      "content": {
        "headline": "Q4 Guidance: $20-21M Revenue",
        "body": "Management expects 28-35% YoY growth driven by enterprise pipeline conversion, international expansion, and APAC marketplace launch.",
        "notes": null
      }
    }
  ],
  "fonts": ["Fraunces", "DM Sans", "JetBrains Mono"],
  "cdn_libs": ["https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"],
  "footer": {
    "left": "Confidential — Acme Corp",
    "right": "Built on IterFact"
  }
}


═══════════════════════════════════════════════════════════════
EXAMPLE 2: Vague request, no data (planner must compose)
═══════════════════════════════════════════════════════════════

USER INPUT:
"I need a pitch deck for my startup. We're a B2B SaaS company
doing AI-powered contract analysis. Pre-seed, looking to raise $2M."

EXPECTED OUTPUT:
{
  "meta": {
    "title": "[PLACEHOLDER: Company Name] — Pre-Seed Pitch Deck",
    "description": "Fundraising pitch deck for AI-powered contract analysis startup seeking $2M pre-seed",
    "template_match": "Fundraising Pitch"
  },
  "theme": "midnight-mint",
  "wrapper": {
    "engine": "02",
    "config": {
      "navigation": "bottom",
      "transition": "slide",
      "progress_bar": true
    }
  },
  "sections": [
    {
      "id": "cover",
      "title": "Cover",
      "components": [],
      "content": {
        "headline": "[PLACEHOLDER: Company Name]",
        "body": "AI-powered contract analysis that [PLACEHOLDER: key value proposition]. Raising $2M pre-seed.",
        "notes": "Content pass: generate compelling tagline from company description"
      }
    },
    {
      "id": "problem",
      "title": "The Problem",
      "components": [],
      "content": {
        "headline": "[PLACEHOLDER: Problem statement]",
        "body": "[PLACEHOLDER: 2-3 sentences on the pain point in contract review/analysis]",
        "notes": "Content pass: research contract analysis pain points, quantify time/cost waste"
      }
    },
    {
      "id": "solution",
      "title": "Our Solution",
      "components": [
        {
          "engine": "23",
          "instance_id": "product-screens",
          "role": "Product screenshot gallery",
          "config": {},
          "data": {
            "images": [
              { "src": "[PLACEHOLDER]", "alt": "Dashboard view", "caption": "AI-powered contract review dashboard" },
              { "src": "[PLACEHOLDER]", "alt": "Analysis view", "caption": "Clause-by-clause risk analysis" },
              { "src": "[PLACEHOLDER]", "alt": "Insights view", "caption": "Cross-contract pattern detection" }
            ]
          }
        }
      ],
      "content": {
        "headline": "AI that reads contracts like a senior associate",
        "body": null,
        "notes": "Content pass: refine headline based on actual product positioning"
      }
    },
    {
      "id": "market",
      "title": "Market Opportunity",
      "components": [
        {
          "engine": "08",
          "instance_id": "tam-calculator",
          "role": "TAM/SAM/SOM interactive calculator",
          "config": {},
          "data": {
            "inputs": [
              { "id": "total_companies", "label": "Companies with 50+ contracts/yr", "min": 100000, "max": 2000000, "default": 500000, "step": 50000, "prefix": "", "suffix": "" },
              { "id": "avg_contract_value", "label": "Avg Annual Contract Value", "min": 500, "max": 10000, "default": 3000, "step": 500, "prefix": "$", "suffix": "" },
              { "id": "sam_pct", "label": "Serviceable %", "min": 5, "max": 40, "default": 15, "step": 1, "suffix": "%" },
              { "id": "som_pct", "label": "Obtainable % (3yr)", "min": 1, "max": 10, "default": 3, "step": 0.5, "suffix": "%" }
            ],
            "outputs": [
              { "label": "TAM", "expression": "(total_companies * avg_contract_value / 1e9).toFixed(1) + 'B'", "format": "text" },
              { "label": "SAM", "expression": "(total_companies * avg_contract_value * sam_pct / 100 / 1e6).toFixed(0) + 'M'", "format": "text" },
              { "label": "SOM (3yr)", "expression": "(total_companies * avg_contract_value * sam_pct / 100 * som_pct / 100 / 1e6).toFixed(0) + 'M'", "format": "text" }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "traction",
      "title": "Traction",
      "components": [
        {
          "engine": "03",
          "instance_id": "traction-kpis",
          "role": "Early traction metric cards",
          "config": { "layout": "grid-3" },
          "data": {
            "metrics": [
              { "label": "Contracts Analyzed", "value": "[PLACEHOLDER]", "change": "[PLACEHOLDER]", "direction": "up" },
              { "label": "Pilot Customers", "value": "[PLACEHOLDER]", "change": "[PLACEHOLDER]", "direction": "up" },
              { "label": "Time Saved per Contract", "value": "[PLACEHOLDER]", "change": "vs manual", "direction": "up" }
            ]
          }
        },
        {
          "engine": "05",
          "instance_id": "milestones",
          "role": "Key milestones timeline",
          "config": {},
          "data": {
            "events": [
              { "date": "[PLACEHOLDER]", "title": "Founded", "description": "[PLACEHOLDER]", "icon": "🚀" },
              { "date": "[PLACEHOLDER]", "title": "MVP Launch", "description": "[PLACEHOLDER]", "icon": "🛠️" },
              { "date": "[PLACEHOLDER]", "title": "First Pilots", "description": "[PLACEHOLDER]", "icon": "🤝" },
              { "date": "[PLACEHOLDER]", "title": "Pre-Seed Target", "description": "$2M raise", "icon": "💰" }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "competition",
      "title": "Why Us",
      "components": [
        {
          "engine": "07",
          "instance_id": "competitive-matrix",
          "role": "Feature comparison vs alternatives",
          "config": {},
          "data": {
            "items": [
              { "name": "[PLACEHOLDER: Company]", "subtitle": "Our solution", "recommended": true },
              { "name": "Manual Review", "subtitle": "Status quo", "recommended": false },
              { "name": "Legacy CLM", "subtitle": "Existing tools", "recommended": false }
            ],
            "features": [
              { "name": "AI-Powered Analysis", "values": [true, false, false] },
              { "name": "Clause-Level Risk Scoring", "values": [true, false, false] },
              { "name": "Cross-Contract Patterns", "values": [true, false, false] },
              { "name": "Sub-10min Review Time", "values": [true, false, true] },
              { "name": "No Training Required", "values": [true, true, false] },
              { "name": "Custom Playbook Support", "values": [true, false, true] }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "team",
      "title": "Team",
      "components": [
        {
          "engine": "19",
          "instance_id": "founding-team",
          "role": "Founding team bios",
          "config": {},
          "data": {
            "people": [
              { "name": "[PLACEHOLDER]", "title": "CEO & Co-Founder", "department": "Leadership", "image_placeholder": "[PH]", "reports_to": null },
              { "name": "[PLACEHOLDER]", "title": "CTO & Co-Founder", "department": "Leadership", "image_placeholder": "[PH]", "reports_to": null }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": "Content pass: fill team bios from uploaded info" }
    },
    {
      "id": "the-ask",
      "title": "The Ask",
      "components": [
        {
          "engine": "03",
          "instance_id": "use-of-funds",
          "role": "Use of funds breakdown",
          "config": {},
          "data": {
            "metrics": [
              { "label": "Raising", "value": "$2M", "change": "Pre-Seed", "direction": "up" },
              { "label": "Runway", "value": "18 months", "change": "[PLACEHOLDER]", "direction": "flat" },
              { "label": "Key Milestone", "value": "[PLACEHOLDER]", "change": "Target", "direction": "up" }
            ],
            "charts": [
              {
                "type": "doughnut",
                "title": "Use of Funds",
                "labels": ["Engineering", "Sales & Marketing", "Operations", "Buffer"],
                "datasets": [{ "label": "Allocation", "data": [45, 30, 15, 10] }]
              }
            ]
          }
        }
      ],
      "content": {
        "headline": "Raising $2M to reach [PLACEHOLDER: key milestone]",
        "body": null,
        "notes": null
      }
    }
  ],
  "fonts": ["Fraunces", "DM Sans", "JetBrains Mono"],
  "cdn_libs": ["https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"],
  "footer": {
    "left": "Confidential",
    "right": "Built on IterFact"
  }
}


═══════════════════════════════════════════════════════════════
EXAMPLE 3: Non-recipe request (planner must compose from scratch)
═══════════════════════════════════════════════════════════════

USER INPUT:
"Make me an interactive wedding invitation for Sarah & James.
June 15, 2027. Ceremony at St. Patrick's Cathedral, NYC.
Reception at The Plaza Hotel. Black tie. RSVP by May 1st."

EXPECTED OUTPUT:
{
  "meta": {
    "title": "Sarah & James — June 15, 2027",
    "description": "Interactive wedding invitation with ceremony details, venue map, and RSVP",
    "template_match": null
  },
  "theme": "deep-violet",
  "wrapper": {
    "engine": "01",
    "config": {
      "progress_bar": false
    }
  },
  "sections": [
    {
      "id": "announcement",
      "title": "Together with their families",
      "components": [],
      "content": {
        "headline": "Sarah & James",
        "body": "Request the pleasure of your company at the celebration of their marriage\nSunday, the Fifteenth of June\nTwo Thousand Twenty-Seven",
        "notes": null
      }
    },
    {
      "id": "details",
      "title": "Ceremony & Reception",
      "components": [
        {
          "engine": "05",
          "instance_id": "event-schedule",
          "role": "Wedding day schedule",
          "config": {},
          "data": {
            "events": [
              { "date": "4:00 PM", "title": "Ceremony", "description": "St. Patrick's Cathedral, 5th Avenue, New York", "icon": "⛪" },
              { "date": "6:00 PM", "title": "Cocktail Hour", "description": "The Plaza Hotel, Grand Ballroom Foyer", "icon": "🥂" },
              { "date": "7:00 PM", "title": "Reception & Dinner", "description": "The Plaza Hotel, Grand Ballroom", "icon": "🎶" },
              { "date": "11:00 PM", "title": "Last Dance", "description": "The Plaza Hotel", "icon": "💃" }
            ]
          }
        }
      ],
      "content": {
        "headline": null,
        "body": "Black Tie",
        "notes": null
      }
    },
    {
      "id": "venue",
      "title": "Venues",
      "components": [
        {
          "engine": "20",
          "instance_id": "venue-map",
          "role": "Map with ceremony and reception locations",
          "config": {},
          "data": {
            "locations": [
              { "name": "St. Patrick's Cathedral", "lat": 40.7585, "lng": -73.9762, "description": "Ceremony — 4:00 PM", "category": "ceremony" },
              { "name": "The Plaza Hotel", "lat": 40.7645, "lng": -73.9744, "description": "Reception — 6:00 PM", "category": "reception" }
            ]
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "countdown",
      "title": "Counting Down",
      "components": [
        {
          "engine": "24",
          "instance_id": "wedding-countdown",
          "role": "Days until the wedding",
          "config": {},
          "data": {
            "event_date": "2027-06-15T16:00:00-04:00",
            "event_name": "Sarah & James"
          }
        }
      ],
      "content": { "headline": null, "body": null, "notes": null }
    },
    {
      "id": "rsvp",
      "title": "RSVP",
      "components": [
        {
          "engine": "16",
          "instance_id": "rsvp-form",
          "role": "Wedding RSVP with meal selection",
          "config": {},
          "data": {
            "steps": [
              {
                "title": "Your Response",
                "fields": [
                  { "id": "name", "label": "Full Name", "type": "text", "required": true },
                  { "id": "attending", "label": "Will you attend?", "type": "select", "options": ["Joyfully Accepts", "Regretfully Declines"], "required": true },
                  { "id": "guests", "label": "Number of Guests", "type": "number", "min": 1, "max": 4 },
                  { "id": "meal", "label": "Meal Preference", "type": "select", "options": ["Filet Mignon", "Atlantic Salmon", "Vegetarian Risotto"] },
                  { "id": "dietary", "label": "Dietary Restrictions", "type": "textarea" },
                  { "id": "song", "label": "Song Request", "type": "text" }
                ]
              }
            ]
          }
        }
      ],
      "content": {
        "headline": "Kindly respond by May 1st, 2027",
        "body": null,
        "notes": null
      }
    }
  ],
  "fonts": ["Cormorant Garamond", "DM Sans", "JetBrains Mono"],
  "cdn_libs": [],
  "footer": {
    "left": "Sarah & James · June 15, 2027",
    "right": "Built on IterFact"
  }
}


═══════════════════════════════════════════════════════════════
TOKEN COST ESTIMATES
═══════════════════════════════════════════════════════════════

System prompt (raw):     ~2,800 tokens
User input (typical):    ~200-500 tokens
Output (typical plan):   ~1,200-2,500 tokens
───────────────────────────────────────────
Total per call:          ~4,200-5,800 tokens

At Sonnet pricing ($3/M input, $15/M output):
  Input cost:  ~$0.009-$0.010
  Output cost: ~$0.018-$0.038
  TOTAL:       ~$0.03-$0.05 per planning call

At Haiku pricing ($0.25/M input, $1.25/M output):
  TOTAL:       ~$0.003-$0.005 per planning call

With recipe caching (skip planner for known templates):
  TOTAL:       $0.00 for cached recipes
