1---2name: metrics-analyzer3description: Analyze product data from a CSV file or pasted data. Finds trends, anomalies, segments, and actionable insights. Ask questions about your data in plain English.4---56# Metrics Analyzer78Turn raw product data into insights. No dashboards — just clear answers to "what happened, why, and what should we do about it."910## Process11121. **Load the data.** Read the CSV file or parse pasted data. Identify columns, data types, date ranges, and row count.132. **Understand structure.** Detect date columns, metric columns (numeric), and dimension columns (categorical). Identify the grain (daily, weekly, per-user, per-transaction).143. **Compute summary statistics.** For each key metric: mean, median, min, max, standard deviation, and recent trend direction.154. **Detect trends.** Compare recent period vs. prior period. Calculate week-over-week and month-over-month changes. Flag anything moving more than 10% as notable.165. **Flag anomalies.** Identify data points more than 2 standard deviations from the mean. Check for sudden drops, spikes, or flatlines.176. **Segment analysis.** If dimension columns exist, break metrics by segment. Find which segments are driving overall changes.187. **Generate insights.** Synthesize findings into 3 actionable insights ranked by business impact.1920## Output Format2122## Data Summary23- **Rows:** [N] | **Columns:** [N] | **Date range:** [start] to [end]24- **Grain:** [daily/weekly/per-user/etc.]25- **Key metrics found:** [list]26- **Dimensions found:** [list]2728## Key Metrics Overview29| Metric | Current | Prior Period | Change | Trend |30|--------|---------|-------------|--------|-------|31| [metric] | [value] | [value] | [+/-X%] | [up/down/stable] |3233## Trends34- **[Metric 1]:** [Direction] [magnitude] over [time period]. [One sentence context.]35- **[Metric 2]:** [Direction] [magnitude] over [time period]. [One sentence context.]3637## Anomalies38- **[Date/period]:** [What happened] — [metric] was [value] vs. expected [value]. Possible cause: [hypothesis].3940## Segment Breakdown41| Segment | [Metric] | vs. Average | Notable |42|---------|----------|-------------|---------|43| [segment] | [value] | [+/-X%] | [yes/no + why] |4445## Top 3 Insights461. **[Insight title]:** [What the data shows] — [Why it matters] — [Suggested action]472. **[Insight title]:** [What the data shows] — [Why it matters] — [Suggested action]483. **[Insight title]:** [What the data shows] — [Why it matters] — [Suggested action]4950## Recommended Next Analysis51- [What to dig into next and why]5253## Rules5455- Always start by showing the data summary so the user can confirm the data loaded correctly.56- Use Bash with Python (pandas) for any computation. Do not eyeball numbers — calculate them.57- Trends must include magnitude ("up 12%"), not just direction ("going up").58- Every anomaly must include a hypothesis for the cause, even if speculative. Label speculative causes clearly.59- Insights must be actionable. "Revenue is up" is an observation. "Revenue is up 15% driven by Segment X — double down on acquisition there" is an insight.60- If the data is messy (missing values, inconsistent formats), clean it and report what you did.61- If the data is too small for meaningful analysis (under 30 data points), say so explicitly.62- Do not generate charts — describe what a chart would show in words. The user can visualize later.63- If the user asks a specific question about the data, answer that question FIRST, then provide the broader analysis.64- Save the analysis to a file in the current working directory as `metrics-analysis-[date].md`.