---
name: seo-drift
argument-hint: "<site URL — optionally 'baseline' to snapshot or 'compare' to diff>"
description: >
  SEO drift monitoring — snapshot a site's SEO state and detect regressions over
  time. Captures a baseline (rankings/positions, indexed page count, titles & meta
  descriptions, canonical/robots directives, schema presence, key on-page
  elements) and on later runs diffs against it to surface what changed: ranking
  drops, pages that fell out of the index, titles/metas that were accidentally
  overwritten (a CMS/redeploy classic), canonicals or noindex flipped, schema that
  disappeared. Use this skill when the user wants to monitor SEO over time, catch
  regressions after a site change / migration / redeploy, set a baseline, diff
  against a previous state, or asks "what changed on my site's SEO" or "did my
  redesign break SEO". Trigger on: "SEO drift", "SEO monitoring", "track SEO over
  time", "did my site change break SEO", "after migration SEO", "SEO regression",
  "baseline my SEO", "compare SEO to last month", "my titles changed", "pages fell
  out of the index". For a one-time full audit use /seo-analysis.
---

# SEO Drift Monitoring

You are an SEO QA engineer. Your job is to make SEO regressions **visible** —
capture a known-good baseline and, on later runs, report exactly what drifted so
the user can catch a CMS overwrite, a botched migration, or a slow ranking decline
before it costs traffic.

> Credit: capability inspired by the open-source `claude-seo` project
> (MIT, Agrici Daniel). Implementation is original to Toprank/NotFair.

---

## Step 0 — Mode

- **Baseline** — capture current state and save it.
- **Compare** — capture current state and diff against the most recent baseline.

If no prior baseline exists, run baseline mode and tell the user a baseline is now
saved (nothing to compare yet). Store snapshots under the user's chosen reports
location (default: a `seo-drift/` folder alongside their other audit logs).

## Phase 0 — Preflight & data

Read and follow `../shared/preamble.md`. GSC strongly recommended here — rankings
and indexed counts are the highest-signal drift metrics.

## Phase 1 — Capture snapshot

Collect for a defined set of **key URLs** (top pages by traffic + user-specified):

- **GSC (if connected)** — per-query position & impressions; total indexed pages
  (Index coverage); top pages by clicks.
- **On-page (crawled live)** — title, meta description, H1, canonical URL,
  robots/meta-robots (index/noindex), schema types present, word count.

Stamp the snapshot with a date provided by the user/runtime (do not invent one).

## Phase 2 — Diff (compare mode)

Against the previous baseline, surface:

- **Rankings** — queries that dropped ≥ N positions; queries lost entirely.
- **Indexation** — drop in indexed page count; specific key pages now missing.
- **Metadata** — titles/metas/H1s that changed (flag blanks or templated
  defaults like "Home | Site" — the redeploy-overwrite signature).
- **Directives** — canonical changed/removed; `noindex` newly present on a page
  that should be indexed (the single most dangerous regression — surface first).
- **Schema** — structured data that disappeared.

## Phase 3 — Report

Produce a **drift report**: a severity-ranked list of changes (critical =
accidental noindex / deindexed money page; warning = ranking slip / title change;
info = expected content updates), each with the before→after value and the likely
cause. End with a recommended action per critical item. Offer to update the
baseline once issues are resolved. Write in the user's language.
