# Capability: Preview verification

## Intent phrases

- preview changes
- check staging
- verify page looks right
- open in browser

## Requires capabilities

Always available.

## Prerequisites

- Draft saved (`save` creates drafts)
- Staging URL from `cms-edit://customer/overview` or `capabilities.json` → `website.devBaseUrl`
- Entry ID from session (after `open` / `save`) or `--entry-id`

## Preview targets

After saving a draft, agents should return **all applicable URLs** and explain which to use when.

| Target | Label | When to use |
|--------|-------|-------------|
| **contentfulLivePreview** | Live preview (publish here) | **Primary for editors.** Opens `app.contentful.com/.../entries/.../preview/...` — in-app preview with inspector. User clicks the green **Publish** button at the top to go live. |
| **staging** | Preview (staging site) | Full-page check on staging, e.g. `{devBaseUrl}/resources/news/{tag}/{slug}/` (includes Vercel bypass params when configured). |
| **siteLivePreview** | Preview redirect | `{devBaseUrl}/preview?id={entryId}` — entry-aware redirect to the staging path. |
| **production** | Production site | Published content only — compare after publish. |
| **contentfulEntry** | Contentful entry editor | Classic entry form. Prefer **Live preview** for review and publish. |

## Steps

1. After `save`, list all preview URLs:
   ```
   cms_edit ["preview", "urls", "<slug>"]
   ```
   Or with explicit entry ID:
   ```
   cms_edit ["preview", "urls", "<slug>", "--entry-id", "<entry-id>"]
   ```
   Use `--json` for machine-readable output.

2. **Hand off to the editor with both links:**
   - **Live preview** — for reviewing the draft and publishing (green Publish button in Contentful).
   - **Preview (staging site)** — for a full-screen check on the staging deployment.

3. Summarize what to check before publish handoff — use the checklist below (add multi-block items when relevant).

### What to check (all drafts)

- [ ] Headings: page H1 from hero/template only; no invented body section titles
- [ ] CTAs / links resolve
- [ ] Images and featured/OG media present and roughly correct crop
- [ ] Template blocks not duplicated in `content`

### Multi-block / package builds (extra)

When the draft was built from a soft-proof or multi-block plan:

- [ ] **Sequence** matches the agreed soft-proof (no silent reordering)
- [ ] **Placeholders** for GO-WITH-GAPS slots still present and labeled (not dropped)
- [ ] **No invented pairs** — side-by-side collections only where the source was a true pair
- [ ] **Copy** is the source text structured into blocks — not rewritten
- [ ] Media behaviour per site playbook (e.g. decorative video autoplay/loop, width %)
- [ ] Adjacent body-only sections may look airy on some sites (known section spacing) — flag, don’t invent empty paragraphs to “fix”

### Legacy single URL

```
cms_edit ["preview", "url", "--page-slug", "<slug>"]
```

Returns the staging preview path only.

## Confirmation gates

1. Confirm draft saved before preview
2. Summarize what to check (headings, CTAs, images; multi-block soft-proof items when relevant)
3. Tell user production URL will not show draft content until published

## Out of scope

- Publish (human uses Live preview → Publish button)
- Rewriting copy during QA

## Related resources

- `cms-edit://customer/overview`
- `cms-edit://customer/task-publish-handoff`
- `cms-edit://customer/task-source-readiness-review`
- `cms-edit://customer/production-site`