# Site & Price Tracker

Scrape competitor websites and pricing pages, compare the results against the prior snapshot, and record what changed.

## When to use

- A competitor's pricing page, feature list, or landing page needs periodic checking.
- Someone asks whether a tracked competitor has changed plans, tiers, or messaging.
- A recurring competitive-intelligence sweep is due and prior snapshots exist for comparison.
- A one-off diff is requested between a competitor's current page and its last known state.

## Tools

- `browser-navigate` — load the competitor's pricing or product page in the browser.
- `browser-extract` — pull structured text (prices, tier names, feature bullets) out of the loaded page.
- `shell-execute` — run a small script to diff the freshly extracted content against the prior saved snapshot and compute what changed.
- `write-file` — save the new snapshot and the diff summary as artifacts for future comparisons and reporting.

## Playbook

1. Confirm the target URL(s) and, if available, `read-file` the prior snapshot artifact for that competitor.
2. Load the target page with `browser-navigate`.
3. Pull the relevant content (pricing table, tier names, feature list, copy) with `browser-extract`.
4. If the page requires multiple views (e.g., monthly vs. annual toggle, multiple plan pages), repeat steps 2-3 for each view.
5. Save the freshly extracted content as a new snapshot file using `write-file`.
6. Use `shell-execute` to run a short script that diffs the new snapshot against the prior snapshot and outputs the added, removed, and changed lines.
7. Write the diff summary to a file with `write-file`, noting the competitor, date, and specific changes (e.g., "Pro tier moved from $49 to $59/mo").
8. If no prior snapshot existed, note in the summary that this run establishes the baseline rather than a diff.
9. Finish with `complete-task`, summarizing whether changes were detected and pointing to the snapshot and diff files.

## Failure modes

- Page returns unexpected or blocked content, or layout looks broken -> fall back to `browser-search` to confirm the correct current URL, then retry `browser-navigate`.
- `browser-extract` returns empty or clearly incomplete content -> verify the page fully loaded and the extraction target matches the current page structure; retry once before flagging.
- Repeated failures or throttling from the target site -> back off, space out retries, and note the rate limiting via `update-memory` so future runs pace themselves.
- Site structure has visibly changed (new pricing layout, renamed tiers) -> record this in the diff summary as a structural change rather than a simple price delta, since automated diffing may be unreliable until the extraction approach is adjusted.

## Done when

- A new snapshot file and a diff summary file exist, written via `write-file`, covering the competitor and page(s) checked.
- The diff summary clearly states what changed since the prior snapshot, or that this run is the baseline.
- `complete-task` reports the outcome with references to the saved snapshot and diff artifacts.