# Competitor Analysis — Workflow Reference ## Contents - [Discovery Batch JSON Schema](#discovery-batch-json-schema) — browse cloud search output format - [Competitor Research Markdown Format](#competitor-research-markdown-format) — frontmatter + body section spec - [Extracting Page Text](#extracting-page-text) — browse cloud fetch (markdown default; --format raw for HTML) - [Discovery — parallel Bash, not subagents](#discovery--parallel-bash-not-subagents) — Wave A/B/C recipes - [Enrichment fan-out — 5 subagents PER competitor](#enrichment-fan-out--5-subagents-per-competitor-deepdeeper-modes) - [Legacy: Single-subagent template](#legacy-single-subagent-template-quick-mode-only) — quick mode only - [Wave Management](#wave-management) — parallelism rule, gate phase, sizing formula - [Report Compilation](#report-compilation) — compile_report.mjs invocation ## Discovery Batch JSON Schema File: `/tmp/competitor_discovery_batch_{N}.json` `browse cloud search --output` writes a JSON object: ```json { "requestId": "abc123", "query": "alternatives to acme", "results": [ { "id": "...", "url": "https://example.com", "title": "Example Corp", "image": null, "favicon": null } ] } ``` The `list_urls.mjs` script (run with `--prefix competitor`) deduplicates across batches. ## Competitor Research Markdown Format File: `{OUTPUT_DIR}/{competitor-slug}.md` — see `references/example-research.md` for the full template. **YAML frontmatter fields** (used by `compile_report.mjs`): - `competitor_name` (required) - `website` (required) - `tagline` - `positioning` - `product_description` - `target_customer` - `pricing_model` - `pricing_tiers` (pipe-separated: `Free | Pro $99 | Enterprise Contact`) - `key_features` (pipe-separated) - `integrations` (pipe-separated) - `headquarters` - `founded` - `employee_estimate` - `funding_info` - `strategic_diff` (one-line for overview table; deeper mode only) **Body sections** (in this order — `compile_report.mjs` parses by heading): - `## Product` - `## Pricing` - `## Features` - `## Positioning` - `## Comparison vs {user_company}` (deeper only) - `## Mentions` - `## Benchmarks` (deeper only) - `## Research Findings` **Mentions line format** (parsed into the mentions feed): ``` - **[SourceType]** Title | Snippet (source: URL, YYYY-MM-DD) ``` `SourceType` ∈ `Benchmark | Comparison | News | Reddit | HN | LinkedIn | YouTube | Review | Podcast | X`. Date is optional but preferred. ## Extracting Page Text `browse cloud fetch --allow-redirects` returns clean **markdown by default** — no HTML stripping needed. Just cap the length: ```bash browse cloud fetch --allow-redirects "https://rivalco.com/pricing" | head -c 3000 ``` If you need the original HTML (e.g. to read the `