---
name: domain-recon-ads
description: >
  Given a homepage URL, research the company/product, founder, market landscape,
  then generate a marketing brief and optionally launch Meta ad campaigns.
  Designed for agency use — one Meta Business Manager can run ads for many clients.
compatibility: Created for Zo Computer
metadata:
  author: rob.zo.computer
  version: "0.1"
---

# domain-recon-ads

End-to-end company research → marketing brief → ad launch, triggered by a single URL.

## Quick Start

```bash
# Research only (no ads)
python Skills/domain-recon-ads/scripts/recon.py "https://example.com"

# Research + launch Meta ads
python Skills/domain-recon-ads/scripts/recon.py "https://example.com" --ads
```

## What It Does

### Phase 1: Research (always runs)

1. **Scrape & summarize** the homepage and key pages (about, pricing, docs)
2. **Identify founder(s)** — web search, LinkedIn, X/Twitter
3. **Product analysis** — what it does, pricing model, target audience, tech stack signals
4. **Competitive landscape** — similar products, market positioning
5. **Generate brief** — structured markdown report saved to `output/<slug>/brief.md`

### Phase 2: Marketing Assets (always runs)

6. **Ad copy variants** — 5 headline/body combos for different angles
7. **Audience suggestions** — Meta targeting recommendations (interests, lookalikes, demographics)
8. **Ad image generation** — selects a top angle, then uses `generate_image` to produce a compelling 1:1 ad image aligned to the copy and stores it as `ad-image.png`

### Phase 3: Meta Ads (with `--ads` flag)

9. **Create campaign** — awareness, traffic, or conversions objective
10. **Create ad set** — with suggested targeting
11. **Create ad creative** — uploads generated image and uses it in creative when available (falls back to text-only creative if upload fails)
12. **Launch in review** — campaign starts paused for human approval

## Prerequisites

### For research only (Phase 1-2)

No special setup — uses Zo's built-in web search, browser, and generation tools.

### For Meta Ads (Phase 3)

You need a **Meta Business Manager** configured as an agency:

1. **Create Business Manager** at [business.facebook.com](https://business.facebook.com)
2. **Create a Meta App** at [developers.facebook.com](https://developers.facebook.com) with Marketing API access
3. **Create a System User** in Business Manager → Business Settings → System Users
   - Role: Admin
   - Generate token with scopes: `ads_management`, `ads_read`, `business_management`, `pages_read_engagement`
4. **Save secrets** in [Settings > Advanced](/?t=settings&s=advanced):
   - `META_ACCESS_TOKEN` — System User access token
   - `META_AD_ACCOUNT_ID` — Default ad account ID (format: `act_XXXXXXXXX`)
   - `META_PAGE_ID` — Facebook Page ID to run ads from

### Multi-client setup

For running ads on behalf of clients:

- Each client grants your Business Manager **partner access** to their ad account
- Override the default ad account per-run: `--ad-account act_XXXXXXXXX`
- Or clients create ad accounts under your Business Manager directly

See `references/meta-ads-setup.md` for detailed walkthrough.

## Output Structure

```
output/domain-recon-ads/<slug>/
├── brief.md                  # Full research brief
├── founder.md                # Founder/team profile
├── competitors.md            # Competitive landscape
├── ad-copy.md                # Generated ad copy variants
├── audience.md               # Targeting recommendations
├── ad-image.png              # Generated ad image (when successful)
├── ad-image-generation.md    # Prompt + image generation result trace
├── campaign-log.json         # Meta campaign IDs + status (if ads launched)
└── raw/                      # Raw scraped content, search results
    ├── homepage.md
    ├── about.md
    ├── pricing.md
    └── search-results.json
```

## CLI Reference

```
python Skills/domain-recon-ads/scripts/recon.py <url> [options]

Arguments:
  url                   Homepage URL to research

Options:
  --ads                 Launch Meta ad campaign after research
  --ad-account ID       Override META_AD_ACCOUNT_ID for this run
  --page-id ID          Override META_PAGE_ID for this run
  --budget CENTS        Daily budget in cents (default: 2000 = $20/day)
  --objective TYPE      Campaign objective: AWARENESS | TRAFFIC | CONVERSIONS (default: TRAFFIC)
  --output-dir DIR      Override output directory
  --verbose             Print detailed progress
```

## How the Research Works

The script uses Zo's `/zo/ask` API to parallelize research:

1. **Scraping**: `read_webpage` on homepage + discovered subpages
2. **Founder search**: `web_research` (category=people, linkedin) + `x_search`
3. **Market research**: `web_search` + `web_research` (category=company) for competitors
4. **Synthesis**: A final Zo invocation assembles all findings into the brief

Each phase runs as independent child Zo invocations for speed.

## Cleanup

```bash
# Remove output for a specific domain
rm -rf output/domain-recon-ads/<slug>

# Remove all output
rm -rf output/domain-recon-ads
```
