You're running the PageHub workflow "Go live" on site <your site id>.
- Pass `id: "<your site id>"` on every PageHub tool call (the Stripe and checkout tools name it `siteId: "<your site id>"`).
- Every change stages in the site's draft. Never call `publish_site` unless the user says to publish.
- Finish by showing the proof: A launch checklist with each item done, skipped or waiting on you, SEO results before and after for each page, and phone screenshots of the home page.
- Keep to about 12 minutes of work. If more is left, list it and stop.
- Draft preview: https://pagehub.dev/view/<your site id>
- This needs the PageHub connector (https://pagehub.dev/api/mcp). If its tools aren't available, tell the user to add it and stop.

Goal: get site <your site id> ready to launch, staging every change in the draft,
then publish only when the user says yes.

Domain: (not given)
Favicon image: (not given)
Share image: (not given)
Google Analytics ID: (not given)

Keep a checklist as you go. Every item ends as "done", "skipped" (with why) or
"waiting on you" (with the one thing the user has to do).

## 1. Where it stands (read-only, about 3 minutes)

1. `select_site` prints the site title and description, the share image,
   whether it is published, and search indexing. Write these down.
2. `list_pages` for page ids and slugs. Skip hidden pages and the 404 page.
   Work on at most 6 pages: the home page first, then nav order.
3. `audit_seo` with `pageId` for each of those pages. This is the "before"
   column.
4. `screenshot_site` of the home page at `width: 390`, `fullPage: true`. This
   is the "before" picture. Look for leftover template text ("Lorem ipsum",
   "Your Company", "555-0100", "example.com"). List any you find; don't rewrite
   it in this workflow.
5. `read_site_file` on `site.json`. Note whether `favicon` is set and whether
   `company.logo` is set.

## 2. Staged fixes (about 5 minutes)

These all save to the draft and go live only on publish.

Favicon:
- Favicon image given: `set_favicon` with `imageUrl` set to it.
- Not given, no favicon yet, and the site has a logo: read the logo's media
  id from `company.logo` in `site.json` and call `set_favicon` with `mediaId` (no
  upload needed). Only do this when the logo is roughly square;
  otherwise mark it "waiting on you: send a square icon".
- Never draw or invent an icon (`svgContent` is for an SVG the user gave you).

Titles and descriptions, every page:
- `update_page` with `seo.title` (50 to 60 characters) and `seo.description`
  (120 to 155 characters), written from what that page actually says and
  naming the business and, where the page shows it, the town. Each page's
  title is different. Keep any title or description that is already good.
- Exactly one h1 per page; if `audit_seo` reports none or several, fix it with
  the heading's existing text (change extra h1 elements to h2, keeping their classes), with `edit_site_files`.

Share image:
- Share image given: `upload_image` with `imageUrl`, then `update_page` on the
  home page with `seo.ogImage` set to the `url` it returns. Without one, pages
  use an automatic text card; mark it "skipped".

Analytics:
- ID given and it starts with `G-`: `set_integrations` with `googleAnalytics`.
  An ID in another format (`GTM-`, `AW-`) goes in the matching field; see
  `get_style_reference` with `topic: "integrations"`. Not given: "skipped".

Forms (no tool can send a test submission, so check how each is wired):
- `search_site_files` for `form` across the pages, then read each form's file
  with `read_site_file` (at most 6). A form is ready when it is a Liquid form
  block that names where messages go (an inbox or a collection), every input
  has a `name` and a label, and it shows a thank-you with a posted-successfully
  check and its errors.
- A form missing the thank-you state: add it with `edit_site_files`, in the
  site's existing copy style (a short "Thanks, we'll be in touch" message
  using the business's tone). Follow `get_style_reference` with
  `topic: "liquid"` for the shape.
- A form that isn't wired to an inbox or collection: mark it "waiting on you"
  (where should messages go?). Don't guess.
- Ask the user to send one real test message from the preview link before
  publishing; mark forms "waiting on you" until they confirm it arrived.

## 3. Domain (ask first, about 2 minutes)

- Domain given: `check_domain` with `domain`. Show the user whether it is free
  to attach and the DNS records it will need. Then ask: "Attach this domain
  now?" Only on a yes, `set_domain` with `domain` (leave `redirectMode` at its
  default unless they asked for www). Hand back the DNS records it returns
  exactly as given; never retype them from memory. Rules and error meanings:
  `get_style_reference` with `topic: "domains"`.
- Already attached: `get_domain_status` and report whether DNS is working yet
  or which records are still missing.
- On a 409 (the domain is on another account) or a 403 (plan limit), stop and
  tell the user what it means in plain words.
- No domain given: the site launches on its free PageHub address. "Skipped".

## 4. Prove it (about 1 minute)

1. Re-run `audit_seo` on the same pages. This is the "after" column.
2. Re-take the home page screenshot at `width: 390`. If anything looks broken,
   undo that change.

## 5. Report and the launch question

Reply with:
- The checklist, grouped: done, waiting on you, skipped.
- A table: page, SEO score before and after.
- The sitemap: it is built automatically at /sitemap.xml on the live address
  and lists every page that isn't hidden. Once live, the user can submit it in
  Google Search Console.
- The draft preview link (the `Draft preview:` address `screenshot_site` prints; never one you build).

Then ask these as one question, and do nothing until the user answers:
1. Search indexing. If `select_site` showed "noindex" or "private_preview", ask
   whether to turn search indexing on. Only on a yes, `update_site` with
   `crawlMode: "public"`. It applies at once, not in the draft, so never do it
   for a site that isn't on its final domain yet.
2. Publish. Only on a yes, `publish_site`. After publishing, re-check the domain with `get_domain_status`
   if one is attached.

Don't do these, and list them instead: rewriting page copy or leftover
template text, changing the theme or layout, deleting pages, or changing the
site-wide title, description or share image with `update_site` (that is live
at once).
