You're running the PageHub workflow "Open my shop" 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: Screenshots of the shop page, a product page and the order-confirmed page before and after, plus the product count and the checkout settings.
- Keep to about 14 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: site <your site id> sells the owner's real products through Stripe, with a
shop page, product pages, a cart and an order-confirmed page, all in the draft.

Their products, if not in Stripe yet: (not given)
Shop feel: (not given)

Never move money. Never place an order, issue a refund, or change prices in
Stripe. Never invent products, prices, photos or shipping rates.

## 1. Read the rules and measure (about 2 minutes)

1. `get_style_reference` with `topic: "integrations"`. Its "Stripe" and "Build a
   shop" sections are the wiring rules for every step below.
2. `list_pages`. Note any page that is already a shop, product or
   order-confirmed page, so you extend it instead of adding a second one.
3. `screenshot_site` of the home page at `width: 390`, and of the shop page if
   there is one. These are the "before" pictures.

## 2. Connect Stripe (about 1 minute)

Call `stripe_connect` with `siteId`.
- Not ready: it returns a one-time setup link that only the site owner can
  finish. Give it to the user, say it takes a few minutes on Stripe, and ask
  them to run this workflow again when they're done. Stop here.
- Plan-gated: the shop needs a paid plan. Say so and stop.
- Ready: go on.

## 3. Bring in the products (about 2 minutes)

1. `list_collections`. If there is no `products` collection yet, call
   `refresh_products` (it returns the product count).
2. `stripe_search_products` and `stripe_list_categories` to see what they sell:
   names, prices, photos, categories.
3. If Stripe has products, use those. Don't touch the `products` collection by
   hand; it fills itself from Stripe.
4. If Stripe has no products and "Their products" lists some, make a collection
   from exactly that list:
   - `create_collection` with `slug: "shop-items"` and a `schema` of `title` (text),
     `slug` (text), `description` (text), `price` (number, in cents: 2500 is
     $25.00), `image` (image).
   - `create_collection_rows` with one row per listed product. Leave `image`
     empty unless the user gave a photo.
   - `set_checkout` with `collectionSlug: "shop-items"` and `priceField:
     "price"`.
   - Check with `list_collection_rows` that every product is there.
5. If there are no products anywhere, tell the user to add them on the
   dashboard Shop page or in Stripe, then run this again. Stop here.

## 4. Build the shop pages (about 6 minutes)

Use the library storefront blocks, then make them fit the site. Find them with
`search_blocks` (`q: "product grid"`, `"product detail"`, `"cart drawer"`,
`"order confirmed"`, `"checkout cancelled"`) and read each one with `get_block`
before stamping it.

1. **Shop page.** `add_page` with `name: "Shop"`, a `seo.title` and
   `seo.description` written from what they sell. `apply_kit_block` with
   `slug: "connector-product-grid"` and that `pageId`, then `edit_site_files` to
   write the heading and intro from their real products. For the
   "shop-items" collection, change the grid's loop to read
   `collections['shop-items']` instead of the Stripe catalog.
2. **Product page** (Stripe products only). `add_page` with `name: "Product"`,
   then `update_page` with `pathPattern: ":handle"` so each product lives at
   `/product/<its slug>`. `apply_kit_block` with
   `slug: "storefront-product-detail"` on that page.
3. **Order confirmed page.** `add_page` with `name: "Order confirmed"`, then
   `apply_kit_block` with `slug: "order-confirmed"`. In the block, replace
   links to pages the site doesn't have (`/account`, `/shipping-returns`) with
   the site's real contact page, or remove them.
4. **Cart.** The cart drawer and the checkout-cancelled banner render on every
   page, so place them in the footer partial: `get_block` with
   `slug: "cart-drawer"` and again with `slug: "checkout-cancelled-banner"`,
   then add each block's markup to `partials/footer.liquid` with
   `edit_site_files` (it must not sit inside a page's own section).
5. **Wire the links.** One `edit_site_files`:
   - Product card links: the grid's links are placeholders (`href="#/..."`).
     Make them the real Product page url plus the product slug.
   - Every checkout button, in the cart drawer and on Buy Now buttons, carries
     `data-cart-success` set to the Order confirmed page's url.
   - The header partial: add a "Shop" link to the Shop page and a cart button
     with `data-cart="open"` (and a `data-cart-count` badge) with a cart icon
     from the `tb` set through the site's icon filter. If the header has a
     mobile menu, add the Shop link there too.
6. **Match the site.** `read_site_file` the header partial and one existing
   section, and restyle the new sections to match: the same palette
   tokens (`bg-base-100` with `text-base-content`, `bg-primary` with
   `text-primary-content`), spatial tokens (`py-space-lg`, `gap-space-md`,
   `px-container-x` on the section root, `max-w-page mx-auto` on the inner),
   `font-heading` and the site's button classes. Follow the shop feel when it
   was given. No hex colours, no `py-16`, no new fonts.

If an edit fails, read the file again and retry once with the smallest change,
then note the exact error and move on.

## 5. Prove it (about 2 minutes)

1. `screenshot_site` at `width: 390` and `width: 1440` of the shop page, one
   product page (`path` set to `product/<a real product slug>`), and the order
   confirmed page. Every product shows its real name, price and photo, and
   nothing reads "Acme" or shows an empty card.
2. `audit_accessibility` with the Shop page's `pageId`. Fix contrast failures
   with stronger palette tokens.

Checkout itself can't be tested from here. Tell the user how to try it: if
their Stripe account is in test mode, buy one product with Stripe's test card
4242 4242 4242 4242 on the draft preview. Never on live payments.

## 6. Report

Reply with:
- Before and after screenshots of the shop, a product page and the
  order-confirmed page.
- How many products are on sale and where they come from (Stripe, or the list
  they gave).
- What you added, in plain words ("Shop page with 12 products, a cart in the
  header").
- What needs the user's decision, which you didn't touch: shipping rates,
  countries and tax (dashboard Shop page), product photos that are missing,
  customer accounts.
- The draft preview link (the `Draft preview:` address `screenshot_site` prints; never one you build), and a question: publish the shop now? Ask before
  `publish_site`.
