# SERP Analysis
Analyze the search engine results page (SERP) for a set of target queries, capturing top competitors, ranking features, and content gaps into a structured report file.

## When to use
- A content or SEO (search engine optimization) team requests a competitive gap analysis for a keyword set.
- You need to understand which content formats and features currently rank before drafting a new page.
- A campaign kickoff calls for a baseline snapshot of the competitive landscape for target queries.
- An existing report is stale and needs refreshing with current rankings.

## Tools
- `browser-search`: run each target query to surface the current SERP and identify ranking pages.
- `browser-navigate`: open each ranking result and any SERP feature (People Also Ask, featured snippet source, etc.) to inspect it directly.
- `browser-extract`: pull structured content (headings, word count signals, topics covered, schema/feature markers) from each opened page.
- `write-file`: save the compiled findings as the final SERP analysis report.

## Playbook
1. Confirm the query set and scope (target market, device/locale assumptions) before starting.
2. For each query, run `browser-search` to capture the top-ranking organic results and any visible SERP features (featured snippets, People Also Ask, video/image packs).
3. For each of the top results (aim for the top 5-10 per query), use `browser-navigate` to open the page.
4. On each opened page, use `browser-extract` to capture title, headings/structure, approximate content depth, topics/subtopics covered, and any notable on-page elements (FAQs, tables, comparison charts).
5. Note recurring SERP features across queries (snippets, PAA, packs) and which competitors own them.
6. Cross-reference extracted topics across competitors per query to identify content gaps: subtopics multiple top results cover that are candidates for inclusion, and unique angles no one has covered yet.
7. Organize findings per query: ranking competitors, dominant content format, SERP features present, and the identified content gap list.
8. Compile the full analysis, query by query, into a single readable report with a summary of cross-query patterns.
9. Save the completed report using `write-file`, then summarize the key gaps and recommended next actions via complete-task.

## Failure modes
- If a search or page load returns no usable result, verify the query/URL and retry once with `browser-search` before skipping that query.
- If a competitor page blocks or fails to load via `browser-navigate`, note it as inaccessible in the report rather than fabricating its content.
- If you hit repeated failures suggesting a rate limit or block, back off, continue with remaining queries, and note the gap for follow-up.
- If the SERP layout has clearly changed and extraction doesn't match expectations, fall back to a fresh `browser-search` pass to re-orient before continuing.

## Done when
- A single report file exists (via `write-file`) covering every query in the set with competitors, SERP features, and content gaps.
- Each query section is backed by actual `browser-extract` data from navigated competitor pages, not assumptions.
- The report ends with a clear, prioritized list of content gap recommendations.