# /measure-page — Page Performance Check

## Usage
```
/measure-page /landing              # Measure by URL path
/measure-page page-001              # Measure by page ID
/measure-page all                   # Measure all tracked pages
```

## Input
- `$ARGUMENTS` — **required**: page URL path, page ID, or "all"

## Process

### Step 1: Identify Page
1. Read `data/pages.json`
2. Find the page by:
   - URL path match (e.g., `/landing`)
   - Page ID match (e.g., `page-001`)
   - If "all", process all pages with status "live"
3. If page not found, list available pages and exit

### Step 2: Gather Metrics
Check for analytics integration:

1. **KPI Adapters** — check `data/business-context.json` for configured analytics adapters
2. **Manual Input** — if no adapter, ask the user for metrics:
   - Bounce rate (%)
   - Conversion rate (%)
   - Average time on page (seconds)
   - Total visitors (in measurement period)

### Step 3: Benchmark Comparison
Compare metrics against:

1. **Industry benchmarks** (use WebSearch if needed):
   - Landing page average bounce rate: 40-60%
   - Landing page average conversion rate: 2-5%
   - Good time on page: >60 seconds

2. **Competitor pages** — if competitor data exists in `data/competitors.json`, compare:
   - Our CTA clarity vs. theirs
   - Our social proof depth vs. theirs
   - Our headline specificity vs. theirs

### Step 4: Identify Improvements
Based on metrics and benchmarks, identify specific improvement opportunities:

- **High bounce rate (>60%)** → headline mismatch, slow load, unclear value prop
- **Low conversion (<2%)** → weak CTA, missing social proof, too many options
- **Low time on page (<30s)** → content not engaging, poor above-the-fold
- **Good metrics** → consider A/B test variations for further optimization

For each issue, provide:
- The specific problem
- Evidence from the metrics
- Recommended fix (referencing positioning data)
- Expected impact

### Step 5: Update Pages Data
Update `data/pages.json` with the measurements:
```json
{
  "metrics": {
    "bounce_rate": 45.2,
    "conversion_rate": 3.1,
    "avg_time_on_page": 87,
    "visitors": 1250
  }
}
```

### Step 6: Generate Optimization Ideas
If metrics are below benchmarks, generate improvement ideas in `data/ideas.json`:
- Category: "growth" or "ux_design"
- Tag with page ID
- Include specific, actionable implementation plan
- Reference positioning data for copy improvements

### Step 7: Output
Print:
- Current metrics vs. benchmarks (table format)
- Performance grade (A/B/C/D/F)
- Top 3 improvement recommendations
- Ideas generated (if any)

## Output Files
- `data/pages.json` — updated metrics
- `data/ideas.json` — new optimization ideas (if applicable)
