Back to skills
SkillHub ClubResearch & OpsData / AI

business-analytics-reporter

This skill should be used when analyzing business sales and revenue data from CSV files to identify weak areas, generate statistical insights, and provide strategic improvement recommendations. Use when the user requests a business performance report, asks to analyze sales data, wants to identify areas of weakness, or needs recommendations on business improvement strategies.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
0
Hot score
74
Updated
March 20, 2026
Overall rating
C1.2
Composite score
1.2
Best-practice grade
N/A

Install command

npx @skill-hub/cli install merllinsbeard-ai-claude-skills-collection-business-analytics-reporter
data-analysisbusiness-intelligenceperformance-reportingstrategic-planning

Repository

merllinsbeard/ai-claude-skills-collection

Skill path: business/business-analytics-reporter

This skill should be used when analyzing business sales and revenue data from CSV files to identify weak areas, generate statistical insights, and provide strategic improvement recommendations. Use when the user requests a business performance report, asks to analyze sales data, wants to identify areas of weakness, or needs recommendations on business improvement strategies.

Open repository

Best for

Primary workflow: Research & Ops.

Technical facets: Data / AI.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: merllinsbeard.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install business-analytics-reporter into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/merllinsbeard/ai-claude-skills-collection before adding business-analytics-reporter to shared team environments
  • Use business-analytics-reporter for business workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: business-analytics-reporter
description: This skill should be used when analyzing business sales and revenue data from CSV files to identify weak areas, generate statistical insights, and provide strategic improvement recommendations. Use when the user requests a business performance report, asks to analyze sales data, wants to identify areas of weakness, or needs recommendations on business improvement strategies.
---

# Business Analytics Reporter

## Overview

Generate comprehensive business performance reports that analyze sales and revenue data, identify areas where the business is lacking, interpret what the statistics indicate, and provide actionable improvement strategies. The skill uses data-driven analysis to detect weak areas and recommends specific strategies backed by business frameworks.

## When to Use This Skill

Invoke this skill when users request:
- "Analyze my business data and tell me where we're lacking"
- "Generate a report on what areas need improvement"
- "What do these sales numbers tell us about our business performance?"
- "Create a business analysis report with improvement strategies"
- "Identify weak areas in our revenue data"
- "What strategies should we use to improve our business metrics?"

The skill expects CSV files containing business data (sales, revenue, transactions) with columns like dates, amounts, categories, or products.

## Core Workflow

### Step 1: Data Loading and Exploration

Start by understanding the data structure and what the user wants to analyze.

**Ask clarifying questions if needed:**
- What specific metrics or areas should the analysis focus on?
- Are there particular time periods or categories of interest?
- Should the report include visualizations or focus on written analysis?

**Load and explore the data:**
```python
import pandas as pd

# Load the CSV file
df = pd.read_csv('business_data.csv')

# Display basic information
print(f"Data shape: {df.shape}")
print(f"Columns: {df.columns.tolist()}")
print(f"Date range: {df['date'].min()} to {df['date'].max()}")
print(df.head())
```

### Step 2: Run Automated Analysis

Use the bundled analysis script to generate comprehensive insights:

```bash
python scripts/analyze_business_data.py path/to/business_data.csv output_report.json
```

The script will:
1. Automatically detect data structure (revenue columns, date columns, categories)
2. Calculate statistical metrics (mean, median, growth rates, volatility)
3. Identify trends and patterns
4. Detect weak areas and underperforming segments
5. Generate improvement strategies based on findings
6. Output a structured JSON report

**Output structure:**
```json
{
  "metadata": {...},
  "findings": {
    "basic_statistics": {...},
    "trend_analysis": {...},
    "category_analysis": {...},
    "variability": {...}
  },
  "weak_areas": [...],
  "improvement_strategies": [...]
}
```

### Step 3: Interpret the Analysis Results

Read the generated JSON report and interpret the findings for the user in plain language.

**Focus on:**
1. **Current State**: What the data shows about business performance
2. **Weak Areas**: Specific problems identified with severity levels
3. **Root Causes**: Why these issues exist (use business frameworks from references/)
4. **Impact**: What these weaknesses mean for the business

**Example interpretation:**
```
Based on the analysis of your sales data from January to December 2024:

Current State:
- Total revenue: $1.2M with average monthly revenue of $100K
- Average growth rate: -3.5% indicating declining performance
- Revenue stability: High volatility (CV: 58%) suggesting inconsistent performance

Weak Areas Identified:
1. Revenue Growth (High Severity): Negative average growth rate of -3.5%
2. Performance Consistency (Medium Severity): 45% of periods show declining performance
3. Category Performance (Medium Severity): 4 underperforming categories identified
```

### Step 4: Generate Detailed Recommendations

Consult the business frameworks reference to provide strategic recommendations:

**Load business frameworks for context:**
Refer to `references/business_frameworks.md` for:
- Revenue growth strategies (market penetration, product development, etc.)
- Operational excellence frameworks
- Customer-centric strategies
- Pricing strategy frameworks
- Common weak area solutions

**Structure recommendations as:**

For each identified weak area, provide:
1. **Strategic Initiative Name**: Clear, actionable program name
2. **Objective**: What this strategy aims to achieve
3. **Key Actions**: 3-5 specific, prioritized steps
4. **Expected Impact**: High/Medium/Low
5. **Timeline**: Realistic implementation timeframe
6. **Success Metrics**: How to measure improvement

**Example recommendation:**
```
Strategy: Revenue Acceleration Program
Area: Revenue Growth
Objective: Reverse negative growth trend and achieve 10%+ monthly growth

Key Actions:
1. Implement aggressive customer acquisition campaigns
2. Review and optimize pricing strategy
3. Launch upselling and cross-selling initiatives
4. Expand into new market segments or geographies
5. Accelerate product development and innovation

Expected Impact: High
Timeline: 3-6 months
Success Metrics: Monthly revenue growth rate, new customer acquisition, ARPU increase
```

### Step 5: Create Visualizations (Optional)

If requested, create interactive visualizations using Plotly to illustrate findings:

**Consult visualization guide:**
Refer to `references/visualization_guide.md` for:
- Recommended chart types for different analyses
- Code examples for creating charts
- Best practices for business dashboards

**Common visualizations to create:**
1. **Revenue Trend Chart**: Line chart showing revenue over time with growth rate overlay
2. **Category Performance**: Bar chart sorted by revenue contribution
3. **Volatility Analysis**: Box plot or standard deviation visualization
4. **Weak Areas Heatmap**: Visual representation of severity and impact

**Example code for revenue trend:**
```python
import plotly.graph_objects as go
from plotly.subplots import make_subplots

fig = make_subplots(specs=[[{"secondary_y": True}]])

# Add revenue line
fig.add_trace(
    go.Scatter(x=df['date'], y=df['revenue'], name="Revenue",
               line=dict(color='blue', width=3)),
    secondary_y=False
)

# Add growth rate line
fig.add_trace(
    go.Scatter(x=df['date'], y=df['growth_rate'], name="Growth Rate",
               line=dict(color='green', dash='dash')),
    secondary_y=True
)

fig.update_layout(title_text="Revenue Performance & Growth Rate")
fig.show()
```

### Step 6: Generate Final Report

Compile findings into a comprehensive report format.

**Option A: Generate HTML Report**

Use the report template from `assets/report_template.html`:

```python
# Read the template
with open('assets/report_template.html', 'r') as f:
    template = f.read()

# Load analysis results
with open('output_report.json', 'r') as f:
    analysis = json.load(f)

# Populate the template with actual data
# Replace placeholders with real values from analysis
# Add Plotly charts as JavaScript
# Save as final HTML report

with open('business_report.html', 'w') as f:
    f.write(populated_template)
```

The HTML template includes:
- Executive summary with key metrics
- Interactive charts for trends and categories
- Styled weak area cards with severity indicators
- Strategic recommendations with action items
- Professional styling and print-ready format

**Option B: Generate Markdown Report**

Create a structured markdown document:

```markdown
# Business Performance Analysis Report

**Generated:** [Date]
**Data Period:** [Period]

## Executive Summary

[Brief overview of findings]

## Key Metrics

- Total Revenue: $X
- Average Growth Rate: X%
- Revenue Stability: [Assessment]
- Weak Areas Identified: X

## Performance Trends

[Insert chart or describe trends]

## Areas of Weakness

### 1. [Weak Area Name] (Severity)
**Finding:** [Description]
**Impact:** [Business impact]

### 2. [Next weak area...]

## Strategic Recommendations

### Strategy 1: [Name]
**Objective:** [Goal]
**Actions:**
- [Action 1]
- [Action 2]
...

**Expected Impact:** High/Medium/Low
**Timeline:** X months
```

## Key Analysis Metrics

The analysis script calculates the following metrics automatically:

### Growth Analysis
- **Average Growth Rate**: Period-over-period revenue change percentage
- **Declining Period Count**: Number of periods with negative growth
- **Trend Direction**: Overall trajectory (growing, declining, stable)

### Stability Analysis
- **Coefficient of Variation (CV)**: Measures revenue volatility
  - CV < 25%: Stable performance
  - CV 25-50%: Moderate volatility
  - CV > 50%: High volatility (flag as weak area)

### Category Performance
- **Revenue Contribution**: Percentage breakdown by category
- **Underperforming Categories**: Bottom 25% by average performance
- **Top/Bottom Performers**: Best and worst performing categories

### Statistical Indicators
- Mean, Median, Standard Deviation for all numeric columns
- Min/Max values and ranges
- Total aggregates

## Business Frameworks Reference

When generating recommendations, leverage the frameworks documented in `references/business_frameworks.md`:

1. **Revenue Growth Strategies**: Market penetration, product development, market development, diversification
2. **Operational Excellence**: Process optimization, resource allocation, quality management
3. **Customer-Centric Strategies**: Retention programs, CLV optimization, segmentation
4. **Pricing Strategies**: Value-based, dynamic, competitive pricing
5. **Data-Driven Decision Making**: Analytics maturity model, KPI frameworks

Match identified weak areas with appropriate strategic frameworks to provide contextually relevant recommendations.

## Tips for Effective Reports

1. **Start with the Big Picture**: Lead with overall performance and key findings
2. **Prioritize by Severity**: Focus on high-severity issues first
3. **Be Specific**: Provide concrete numbers and percentages, not vague assessments
4. **Action-Oriented**: Every weak area should have actionable recommendations
5. **Context Matters**: Consider industry benchmarks and business context
6. **Visual Communication**: Use charts to make trends immediately clear
7. **Executive-Friendly**: Structure for quick scanning with clear headers and summaries

## Common Weak Areas and Detection

The analysis automatically detects these common business problems:

| Weak Area | Detection Criteria | Typical Root Causes |
|-----------|-------------------|---------------------|
| Revenue Growth | Negative average growth rate | Market saturation, increased competition, poor positioning |
| Performance Consistency | >40% declining periods | Lack of recurring revenue, seasonal dependency |
| Revenue Stability | CV > 50% | Customer concentration, volatile demand |
| Category Performance | Categories in bottom 25% | Poor product-market fit, pricing issues, low awareness |

## Example Usage

**User request:** "Analyze my Q4 sales data and tell me where we're weak and how to improve"

**Workflow:**
1. Load the CSV: `df = pd.read_csv('q4_sales.csv')`
2. Run analysis: `python scripts/analyze_business_data.py q4_sales.csv q4_report.json`
3. Read results: `with open('q4_report.json') as f: report = json.load(f)`
4. Interpret findings for the user in natural language
5. Create visualizations using Plotly (refer to `references/visualization_guide.md`)
6. Generate HTML report using `assets/report_template.html`
7. Provide strategic recommendations using `references/business_frameworks.md`

**Expected output:**
- Clear explanation of current business performance
- 3-5 identified weak areas with severity levels
- 4-6 strategic initiatives with specific action plans
- Interactive visualizations (if requested)
- Professional HTML or markdown report

## Resources

### scripts/
- `analyze_business_data.py`: Automated analysis engine that detects data structure, calculates metrics, identifies weak areas, and generates improvement strategies

### references/
- `business_frameworks.md`: Comprehensive guide to business strategy frameworks, common weak areas, and solution templates
- `visualization_guide.md`: Chart type recommendations, Plotly code examples, and dashboard design best practices

### assets/
- `report_template.html`: Professional HTML template with interactive visualizations, styled cards for weak areas and strategies, and print-ready formatting


---

## Referenced Files

> The following files are referenced in this skill and included for context.

### scripts/analyze_business_data.py

```python
#!/usr/bin/env python3
"""
Business Data Analysis and Report Generator

This script analyzes business sales and revenue data from CSV files and generates
comprehensive reports with insights on areas of weakness and improvement strategies.
"""

import pandas as pd
import numpy as np
import json
import sys
from datetime import datetime
from pathlib import Path


def load_and_validate_data(csv_path):
    """Load CSV data and perform basic validation."""
    try:
        df = pd.read_csv(csv_path)
        print(f"✓ Loaded data: {len(df)} rows, {len(df.columns)} columns")
        return df
    except Exception as e:
        print(f"✗ Error loading CSV: {e}", file=sys.stderr)
        sys.exit(1)


def detect_data_structure(df):
    """Detect what type of business data we're working with."""
    columns_lower = [col.lower() for col in df.columns]

    data_type = {
        'has_revenue': any(key in ' '.join(columns_lower) for key in ['revenue', 'sales', 'amount', 'price', 'total']),
        'has_date': any(key in ' '.join(columns_lower) for key in ['date', 'time', 'month', 'year', 'period']),
        'has_category': any(key in ' '.join(columns_lower) for key in ['category', 'product', 'region', 'department', 'type']),
        'has_quantity': any(key in ' '.join(columns_lower) for key in ['quantity', 'units', 'count', 'volume']),
        'has_customer': any(key in ' '.join(columns_lower) for key in ['customer', 'client', 'user'])
    }

    return data_type


def calculate_basic_stats(df, revenue_col=None):
    """Calculate basic statistical metrics."""
    stats = {
        'total_rows': len(df),
        'date_range': None,
        'basic_stats': {}
    }

    # Detect date column
    date_cols = [col for col in df.columns if any(x in col.lower() for x in ['date', 'time'])]
    if date_cols:
        try:
            df[date_cols[0]] = pd.to_datetime(df[date_cols[0]], errors='coerce')
            stats['date_range'] = {
                'start': df[date_cols[0]].min().strftime('%Y-%m-%d') if pd.notna(df[date_cols[0]].min()) else None,
                'end': df[date_cols[0]].max().strftime('%Y-%m-%d') if pd.notna(df[date_cols[0]].max()) else None
            }
        except:
            pass

    # Calculate stats for numeric columns
    numeric_cols = df.select_dtypes(include=[np.number]).columns
    for col in numeric_cols:
        stats['basic_stats'][col] = {
            'mean': float(df[col].mean()),
            'median': float(df[col].median()),
            'std': float(df[col].std()),
            'min': float(df[col].min()),
            'max': float(df[col].max()),
            'total': float(df[col].sum())
        }

    return stats


def identify_revenue_column(df):
    """Automatically identify the revenue/sales column."""
    revenue_keywords = ['revenue', 'sales', 'amount', 'total', 'price', 'value']

    for col in df.columns:
        if any(keyword in col.lower() for keyword in revenue_keywords):
            if df[col].dtype in [np.float64, np.int64]:
                return col

    # Fallback: return first numeric column
    numeric_cols = df.select_dtypes(include=[np.number]).columns
    return numeric_cols[0] if len(numeric_cols) > 0 else None


def analyze_trends(df, date_col=None, value_col=None):
    """Analyze trends over time."""
    if date_col is None or value_col is None:
        return None

    try:
        df_sorted = df.sort_values(date_col)

        # Calculate period-over-period growth
        df_sorted['prev_value'] = df_sorted[value_col].shift(1)
        df_sorted['growth_rate'] = ((df_sorted[value_col] - df_sorted['prev_value']) / df_sorted['prev_value'] * 100)

        avg_growth = df_sorted['growth_rate'].mean()

        # Identify declining periods
        declining_periods = df_sorted[df_sorted['growth_rate'] < 0]

        return {
            'average_growth_rate': float(avg_growth) if pd.notna(avg_growth) else 0,
            'declining_period_count': len(declining_periods),
            'declining_percentage': (len(declining_periods) / len(df_sorted) * 100) if len(df_sorted) > 0 else 0
        }
    except:
        return None


def analyze_categories(df, category_col=None, value_col=None):
    """Analyze performance by category."""
    if category_col is None or value_col is None:
        return None

    try:
        category_stats = df.groupby(category_col)[value_col].agg([
            ('total', 'sum'),
            ('average', 'mean'),
            ('count', 'count')
        ]).round(2)

        # Calculate percentage contribution
        category_stats['percentage'] = (category_stats['total'] / category_stats['total'].sum() * 100).round(2)

        # Identify underperforming categories (bottom 25%)
        threshold = category_stats['average'].quantile(0.25)
        underperforming = category_stats[category_stats['average'] <= threshold]

        return {
            'categories': category_stats.to_dict('index'),
            'underperforming_categories': list(underperforming.index),
            'top_category': category_stats['total'].idxmax(),
            'bottom_category': category_stats['total'].idxmin()
        }
    except:
        return None


def calculate_variability(df, value_col):
    """Calculate coefficient of variation to assess stability."""
    try:
        mean_val = df[value_col].mean()
        std_val = df[value_col].std()
        cv = (std_val / mean_val * 100) if mean_val != 0 else 0

        return {
            'coefficient_of_variation': float(cv),
            'stability_assessment': 'High volatility' if cv > 50 else 'Moderate volatility' if cv > 25 else 'Stable'
        }
    except:
        return None


def generate_analysis_report(df):
    """Generate comprehensive analysis report."""
    report = {
        'metadata': {
            'analysis_date': datetime.now().isoformat(),
            'data_shape': {'rows': len(df), 'columns': len(df.columns)},
            'columns': list(df.columns)
        },
        'data_structure': detect_data_structure(df),
        'findings': {}
    }

    # Identify key columns
    revenue_col = identify_revenue_column(df)
    date_cols = [col for col in df.columns if any(x in col.lower() for x in ['date', 'time'])]
    date_col = date_cols[0] if date_cols else None
    category_cols = [col for col in df.columns if any(x in col.lower() for x in ['category', 'product', 'region', 'type', 'department'])]
    category_col = category_cols[0] if category_cols else None

    report['key_columns'] = {
        'revenue_column': revenue_col,
        'date_column': date_col,
        'category_column': category_col
    }

    # Basic statistics
    report['findings']['basic_statistics'] = calculate_basic_stats(df, revenue_col)

    # Trend analysis
    if date_col and revenue_col:
        try:
            df[date_col] = pd.to_datetime(df[date_col], errors='coerce')
            report['findings']['trend_analysis'] = analyze_trends(df, date_col, revenue_col)
        except:
            report['findings']['trend_analysis'] = None

    # Category analysis
    if category_col and revenue_col:
        report['findings']['category_analysis'] = analyze_categories(df, category_col, revenue_col)

    # Variability analysis
    if revenue_col:
        report['findings']['variability'] = calculate_variability(df, revenue_col)

    return report


def identify_weak_areas(report):
    """Identify areas where the business is lacking."""
    weak_areas = []

    # Check trend analysis
    if report['findings'].get('trend_analysis'):
        trend = report['findings']['trend_analysis']
        if trend['average_growth_rate'] < 0:
            weak_areas.append({
                'area': 'Revenue Growth',
                'severity': 'High',
                'finding': f"Negative average growth rate of {trend['average_growth_rate']:.2f}%",
                'metric': trend['average_growth_rate']
            })

        if trend['declining_percentage'] > 40:
            weak_areas.append({
                'area': 'Performance Consistency',
                'severity': 'Medium',
                'finding': f"{trend['declining_percentage']:.1f}% of periods show declining performance",
                'metric': trend['declining_percentage']
            })

    # Check variability
    if report['findings'].get('variability'):
        variability = report['findings']['variability']
        if variability['coefficient_of_variation'] > 50:
            weak_areas.append({
                'area': 'Revenue Stability',
                'severity': 'Medium',
                'finding': f"High volatility detected (CV: {variability['coefficient_of_variation']:.1f}%)",
                'metric': variability['coefficient_of_variation']
            })

    # Check category performance
    if report['findings'].get('category_analysis'):
        cat_analysis = report['findings']['category_analysis']
        if cat_analysis['underperforming_categories']:
            weak_areas.append({
                'area': 'Category Performance',
                'severity': 'Medium',
                'finding': f"{len(cat_analysis['underperforming_categories'])} underperforming categories identified",
                'details': cat_analysis['underperforming_categories']
            })

    return weak_areas


def generate_improvement_strategies(weak_areas, report):
    """Generate specific improvement strategies based on weak areas."""
    strategies = []

    for weak_area in weak_areas:
        if weak_area['area'] == 'Revenue Growth':
            strategies.append({
                'area': 'Revenue Growth',
                'strategy': 'Revenue Acceleration Program',
                'actions': [
                    'Implement aggressive customer acquisition campaigns',
                    'Review and optimize pricing strategy',
                    'Launch upselling and cross-selling initiatives',
                    'Expand into new market segments or geographies',
                    'Accelerate product development and innovation'
                ],
                'expected_impact': 'High',
                'timeline': '3-6 months'
            })

        elif weak_area['area'] == 'Performance Consistency':
            strategies.append({
                'area': 'Performance Consistency',
                'strategy': 'Business Stabilization Plan',
                'actions': [
                    'Establish consistent sales processes and methodologies',
                    'Implement predictive analytics for demand forecasting',
                    'Develop recurring revenue streams (subscriptions, contracts)',
                    'Build customer loyalty programs to increase retention',
                    'Smooth out seasonal variations with counter-cyclical products'
                ],
                'expected_impact': 'Medium',
                'timeline': '4-8 months'
            })

        elif weak_area['area'] == 'Revenue Stability':
            strategies.append({
                'area': 'Revenue Stability',
                'strategy': 'Volatility Reduction Initiative',
                'actions': [
                    'Diversify revenue streams across products and customer segments',
                    'Establish minimum order requirements or retainer agreements',
                    'Implement inventory management to reduce supply chain disruptions',
                    'Create predictable pricing models (annual contracts vs. spot pricing)',
                    'Build strategic partnerships for consistent deal flow'
                ],
                'expected_impact': 'Medium',
                'timeline': '6-12 months'
            })

        elif weak_area['area'] == 'Category Performance':
            strategies.append({
                'area': 'Category Performance',
                'strategy': 'Portfolio Optimization',
                'actions': [
                    'Conduct deep-dive analysis on underperforming categories',
                    'Consider discontinuing or restructuring bottom performers',
                    'Reallocate resources to high-performing categories',
                    'Investigate pricing, positioning, or quality issues',
                    'Test targeted marketing campaigns for weak categories'
                ],
                'expected_impact': 'High',
                'timeline': '2-4 months'
            })

    # Add general recommendations
    strategies.append({
        'area': 'Data-Driven Culture',
        'strategy': 'Analytics Infrastructure Development',
        'actions': [
            'Implement real-time dashboards for key business metrics',
            'Establish regular reporting cadence (daily, weekly, monthly)',
            'Train team on data interpretation and decision-making',
            'Set up automated alerts for anomaly detection',
            'Build customer segmentation and cohort analysis capabilities'
        ],
        'expected_impact': 'High',
        'timeline': '3-6 months'
    })

    return strategies


def main():
    if len(sys.argv) < 2:
        print("Usage: python analyze_business_data.py <path_to_csv> [output_json]")
        sys.exit(1)

    csv_path = sys.argv[1]
    output_path = sys.argv[2] if len(sys.argv) > 2 else "business_analysis_report.json"

    print(f"\n📊 Business Data Analysis Report Generator")
    print(f"{'=' * 60}\n")

    # Load data
    print(f"Loading data from: {csv_path}")
    df = load_and_validate_data(csv_path)

    # Generate analysis
    print("\nAnalyzing business data...")
    report = generate_analysis_report(df)

    # Identify weak areas
    print("Identifying areas of weakness...")
    weak_areas = identify_weak_areas(report)
    report['weak_areas'] = weak_areas

    # Generate strategies
    print("Generating improvement strategies...")
    strategies = generate_improvement_strategies(weak_areas, report)
    report['improvement_strategies'] = strategies

    # Save report
    with open(output_path, 'w') as f:
        json.dump(report, f, indent=2)

    print(f"\n✓ Analysis complete! Report saved to: {output_path}")
    print(f"\nKey Findings:")
    print(f"  - {len(weak_areas)} areas of weakness identified")
    print(f"  - {len(strategies)} improvement strategies generated")

    if weak_areas:
        print(f"\nWeak Areas Summary:")
        for area in weak_areas:
            print(f"  • {area['area']} ({area['severity']} severity): {area['finding']}")


if __name__ == "__main__":
    main()

```

### assets/report_template.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Business Performance Analysis Report</title>
    <script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background: #f5f7fa;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
        }

        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 40px;
            border-radius: 10px;
            margin-bottom: 30px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .header h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
        }

        .header .subtitle {
            font-size: 1.1em;
            opacity: 0.9;
        }

        .metrics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .metric-card {
            background: white;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .metric-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .metric-label {
            font-size: 0.9em;
            color: #666;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }

        .metric-value {
            font-size: 2.2em;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .metric-change {
            font-size: 0.9em;
            padding: 4px 8px;
            border-radius: 4px;
            display: inline-block;
        }

        .metric-change.positive {
            background: #d4edda;
            color: #155724;
        }

        .metric-change.negative {
            background: #f8d7da;
            color: #721c24;
        }

        .metric-change.neutral {
            background: #e2e3e5;
            color: #383d41;
        }

        .section {
            background: white;
            padding: 30px;
            border-radius: 10px;
            margin-bottom: 30px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .section h2 {
            color: #2c3e50;
            font-size: 1.8em;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 3px solid #667eea;
        }

        .chart-container {
            margin: 20px 0;
            min-height: 400px;
        }

        .weak-areas-grid {
            display: grid;
            gap: 20px;
            margin-top: 20px;
        }

        .weak-area-card {
            background: #fff5f5;
            border-left: 5px solid #e53e3e;
            padding: 20px;
            border-radius: 5px;
            transition: transform 0.2s;
        }

        .weak-area-card:hover {
            transform: translateX(5px);
        }

        .weak-area-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .weak-area-title {
            font-size: 1.3em;
            font-weight: bold;
            color: #c53030;
        }

        .severity-badge {
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 0.85em;
            font-weight: bold;
            text-transform: uppercase;
        }

        .severity-high {
            background: #fc8181;
            color: #742a2a;
        }

        .severity-medium {
            background: #fbd38d;
            color: #7c2d12;
        }

        .severity-low {
            background: #fed7d7;
            color: #9c4221;
        }

        .weak-area-finding {
            color: #555;
            margin: 10px 0;
            line-height: 1.8;
        }

        .strategies-grid {
            display: grid;
            gap: 25px;
            margin-top: 20px;
        }

        .strategy-card {
            background: #f0f9ff;
            border-left: 5px solid #3182ce;
            padding: 25px;
            border-radius: 5px;
        }

        .strategy-header {
            margin-bottom: 15px;
        }

        .strategy-title {
            font-size: 1.4em;
            font-weight: bold;
            color: #2c5282;
            margin-bottom: 5px;
        }

        .strategy-area {
            color: #4299e1;
            font-weight: 600;
        }

        .strategy-actions {
            margin: 15px 0;
        }

        .strategy-actions ul {
            list-style: none;
            padding-left: 0;
        }

        .strategy-actions li {
            padding: 8px 0;
            padding-left: 25px;
            position: relative;
            color: #2d3748;
        }

        .strategy-actions li:before {
            content: "→";
            position: absolute;
            left: 0;
            color: #3182ce;
            font-weight: bold;
        }

        .strategy-meta {
            display: flex;
            gap: 20px;
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid #bee3f8;
            font-size: 0.9em;
        }

        .strategy-meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .strategy-meta-label {
            font-weight: 600;
            color: #2c5282;
        }

        .impact-high {
            color: #38a169;
            font-weight: bold;
        }

        .impact-medium {
            color: #d69e2e;
            font-weight: bold;
        }

        .footer {
            text-align: center;
            padding: 30px;
            color: #666;
            font-size: 0.9em;
        }

        @media print {
            .header {
                background: #667eea;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }
            .metric-card, .section {
                page-break-inside: avoid;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- Header -->
        <div class="header">
            <h1>Business Performance Analysis Report</h1>
            <div class="subtitle">
                <span id="report-date">Generated: [DATE]</span> |
                <span id="data-period">Data Period: [PERIOD]</span>
            </div>
        </div>

        <!-- Key Metrics -->
        <div class="metrics-grid">
            <div class="metric-card">
                <div class="metric-label">Total Revenue</div>
                <div class="metric-value" id="total-revenue">[VALUE]</div>
                <span class="metric-change positive" id="revenue-change">[CHANGE]</span>
            </div>

            <div class="metric-card">
                <div class="metric-label">Average Growth Rate</div>
                <div class="metric-value" id="growth-rate">[VALUE]</div>
                <span class="metric-change neutral" id="growth-status">[STATUS]</span>
            </div>

            <div class="metric-card">
                <div class="metric-label">Revenue Stability</div>
                <div class="metric-value" id="stability">[VALUE]</div>
                <span class="metric-change neutral" id="stability-status">[STATUS]</span>
            </div>

            <div class="metric-card">
                <div class="metric-label">Weak Areas Identified</div>
                <div class="metric-value" id="weak-areas-count">[COUNT]</div>
                <span class="metric-change negative" id="areas-status">Requires Attention</span>
            </div>
        </div>

        <!-- Performance Trends Section -->
        <div class="section">
            <h2>📈 Performance Trends</h2>
            <div class="chart-container" id="trend-chart"></div>
        </div>

        <!-- Category Performance Section -->
        <div class="section">
            <h2>📊 Category Performance</h2>
            <div class="chart-container" id="category-chart"></div>
        </div>

        <!-- Weak Areas Section -->
        <div class="section">
            <h2>⚠️ Areas of Weakness</h2>
            <p style="color: #666; margin-bottom: 20px;">
                The following areas have been identified as requiring immediate attention based on data analysis:
            </p>
            <div class="weak-areas-grid" id="weak-areas-container">
                <!-- Weak areas will be inserted here -->
            </div>
        </div>

        <!-- Improvement Strategies Section -->
        <div class="section">
            <h2>💡 Improvement Strategies</h2>
            <p style="color: #666; margin-bottom: 20px;">
                Recommended strategic initiatives to address identified weaknesses and drive business growth:
            </p>
            <div class="strategies-grid" id="strategies-container">
                <!-- Strategies will be inserted here -->
            </div>
        </div>

        <!-- Data Insights Section -->
        <div class="section">
            <h2>🔍 Statistical Insights</h2>
            <div id="insights-content">
                <!-- Statistical insights will be inserted here -->
            </div>
        </div>

        <!-- Footer -->
        <div class="footer">
            <p>This report was generated using automated business intelligence analysis.</p>
            <p>For questions or clarifications, please contact your analytics team.</p>
        </div>
    </div>

    <script>
        // Placeholder JavaScript - This will be populated with actual data from the analysis

        // Example: How to populate weak areas dynamically
        function renderWeakAreas(weakAreas) {
            const container = document.getElementById('weak-areas-container');
            container.innerHTML = weakAreas.map(area => `
                <div class="weak-area-card">
                    <div class="weak-area-header">
                        <div class="weak-area-title">${area.area}</div>
                        <span class="severity-badge severity-${area.severity.toLowerCase()}">${area.severity}</span>
                    </div>
                    <div class="weak-area-finding">${area.finding}</div>
                    ${area.details ? `<div style="margin-top: 10px; font-size: 0.9em; color: #666;">
                        <strong>Affected areas:</strong> ${area.details.join(', ')}
                    </div>` : ''}
                </div>
            `).join('');
        }

        // Example: How to populate strategies dynamically
        function renderStrategies(strategies) {
            const container = document.getElementById('strategies-container');
            container.innerHTML = strategies.map(strategy => `
                <div class="strategy-card">
                    <div class="strategy-header">
                        <div class="strategy-area">${strategy.area}</div>
                        <div class="strategy-title">${strategy.strategy}</div>
                    </div>
                    <div class="strategy-actions">
                        <strong>Key Actions:</strong>
                        <ul>
                            ${strategy.actions.map(action => `<li>${action}</li>`).join('')}
                        </ul>
                    </div>
                    <div class="strategy-meta">
                        <div class="strategy-meta-item">
                            <span class="strategy-meta-label">Expected Impact:</span>
                            <span class="impact-${strategy.expected_impact.toLowerCase()}">${strategy.expected_impact}</span>
                        </div>
                        <div class="strategy-meta-item">
                            <span class="strategy-meta-label">Timeline:</span>
                            <span>${strategy.timeline}</span>
                        </div>
                    </div>
                </div>
            `).join('');
        }

        // Example: Creating a simple trend chart with Plotly
        function createTrendChart(dates, values) {
            const trace = {
                x: dates,
                y: values,
                type: 'scatter',
                mode: 'lines+markers',
                line: {color: '#667eea', width: 3},
                marker: {size: 8}
            };

            const layout = {
                title: 'Revenue Trend Over Time',
                xaxis: {title: 'Date'},
                yaxis: {title: 'Revenue ($)'},
                hovermode: 'closest'
            };

            Plotly.newPlot('trend-chart', [trace], layout, {responsive: true});
        }

        // Initialize with sample data (replace with actual data from analysis)
        document.addEventListener('DOMContentLoaded', function() {
            // Set report date
            document.getElementById('report-date').textContent = 'Generated: ' + new Date().toLocaleDateString();

            // This is where you would load actual analysis results
            // For example, from a JSON file generated by analyze_business_data.py
        });
    </script>
</body>
</html>

```

### references/business_frameworks.md

```markdown
# Business Analysis Frameworks and Metrics

## Key Business Metrics for Sales & Revenue Analysis

### Revenue Metrics
- **Total Revenue**: Sum of all sales over a period
- **Average Revenue Per Unit (ARPU)**: Total revenue / Number of customers or units
- **Revenue Growth Rate**: ((Current Period Revenue - Previous Period Revenue) / Previous Period Revenue) × 100
- **Month-over-Month (MoM) Growth**: Short-term growth trend
- **Year-over-Year (YoY) Growth**: Long-term growth comparison

### Performance Indicators
- **Sales Velocity**: Rate at which deals move through the pipeline
- **Conversion Rate**: (Successful conversions / Total opportunities) × 100
- **Average Order Value (AOV)**: Total revenue / Number of orders
- **Revenue Per Category**: Performance breakdown by product/service line

### Stability & Risk Metrics
- **Coefficient of Variation (CV)**: (Standard Deviation / Mean) × 100
  - CV < 25%: Stable performance
  - CV 25-50%: Moderate volatility
  - CV > 50%: High volatility (risk area)
- **Revenue Concentration**: Percentage of revenue from top customers/categories
- **Seasonality Index**: Measure of seasonal patterns

## Business Improvement Frameworks

### 1. Revenue Growth Strategies

#### Market Penetration
- Increase market share in existing markets
- Aggressive marketing and sales campaigns
- Competitive pricing strategies
- Customer acquisition programs

#### Product Development
- Launch new products/services
- Enhance existing offerings
- Innovation and R&D investment
- Feature expansion based on customer feedback

#### Market Development
- Enter new geographic markets
- Target new customer segments
- Expand distribution channels
- Strategic partnerships

#### Diversification
- Add complementary products/services
- Enter related industries
- Vertical or horizontal integration
- Risk mitigation through variety

### 2. Operational Excellence Framework

#### Process Optimization
- Streamline sales processes
- Reduce cycle times
- Automate repetitive tasks
- Eliminate bottlenecks

#### Resource Allocation
- Focus on high-performing categories
- Divest or restructure underperformers
- Optimize inventory management
- Strategic capacity planning

#### Quality Management
- Improve product/service quality
- Reduce defect rates
- Customer satisfaction initiatives
- Continuous improvement culture

### 3. Customer-Centric Strategies

#### Retention & Loyalty
- Customer loyalty programs
- Personalized experiences
- Proactive customer service
- Regular engagement initiatives

#### Customer Lifetime Value (CLV) Optimization
- Increase purchase frequency
- Upselling and cross-selling
- Premium tier development
- Reduce churn rate

#### Customer Segmentation
- High-value customer focus
- Targeted marketing campaigns
- Customized offerings per segment
- Resource prioritization

### 4. Pricing Strategy Framework

#### Value-Based Pricing
- Price based on customer perceived value
- Premium positioning for quality
- Bundle offerings for value perception

#### Dynamic Pricing
- Adjust prices based on demand
- Seasonal pricing strategies
- Promotional pricing tactics

#### Competitive Pricing
- Market rate alignment
- Penetration pricing for new markets
- Price leadership strategy

### 5. Data-Driven Decision Making

#### Analytics Maturity Model
1. **Descriptive**: What happened? (Historical reporting)
2. **Diagnostic**: Why did it happen? (Root cause analysis)
3. **Predictive**: What will happen? (Forecasting)
4. **Prescriptive**: What should we do? (Recommendations)

#### Key Performance Indicators (KPI) Framework
- **Leading Indicators**: Predict future performance (pipeline, leads)
- **Lagging Indicators**: Measure past results (revenue, profit)
- **Balanced Scorecard**: Financial, customer, internal process, learning & growth

## Common Business Weak Areas and Solutions

### Area: Declining Revenue
**Symptoms**: Negative growth rate, decreasing order volume
**Root Causes**: Market saturation, increased competition, product obsolescence, poor positioning
**Solutions**:
- Conduct market research to identify opportunities
- Refresh product offerings
- Enhance value proposition
- Improve marketing effectiveness
- Explore new markets or segments

### Area: High Volatility
**Symptoms**: Inconsistent revenue, unpredictable performance
**Root Causes**: Lack of recurring revenue, seasonal dependency, customer concentration
**Solutions**:
- Develop subscription or contract-based models
- Diversify customer base
- Create counter-seasonal products
- Build strategic partnerships
- Implement demand forecasting

### Area: Category Underperformance
**Symptoms**: Low contribution from certain products/categories
**Root Causes**: Poor product-market fit, pricing issues, low awareness, quality problems
**Solutions**:
- Conduct category review analysis
- Test price adjustments
- Invest in targeted marketing
- Consider product discontinuation
- Reallocate resources to winners

### Area: Low Profit Margins
**Symptoms**: High revenue but low profitability
**Root Causes**: High costs, pricing pressure, inefficient operations
**Solutions**:
- Cost optimization initiatives
- Negotiate better supplier terms
- Improve operational efficiency
- Value-based pricing strategy
- Focus on high-margin segments

### Area: Customer Churn
**Symptoms**: High customer turnover rate
**Root Causes**: Poor customer experience, lack of engagement, competitive alternatives
**Solutions**:
- Implement customer success programs
- Regular customer feedback loops
- Loyalty and retention programs
- Improve product quality and support
- Personalized customer engagement

## Strategic Recommendation Template

### For Each Weak Area Identified:

1. **Current State Assessment**
   - What the data shows
   - Severity and business impact
   - Trend direction

2. **Root Cause Analysis**
   - Why this weakness exists
   - Contributing factors
   - Internal vs. external causes

3. **Strategic Initiative**
   - Named strategy or program
   - Clear objective
   - Expected outcomes

4. **Tactical Actions**
   - Specific, actionable steps
   - Prioritized by impact
   - Resource requirements

5. **Success Metrics**
   - How to measure improvement
   - Target benchmarks
   - Timeline for results

6. **Implementation Roadmap**
   - Phase 1: Quick wins (0-3 months)
   - Phase 2: Medium-term initiatives (3-6 months)
   - Phase 3: Long-term transformation (6-12+ months)

```

### references/visualization_guide.md

```markdown
# Data Visualization Guide for Business Reports

## Recommended Chart Types for Business Analysis

### Revenue & Sales Analysis

#### Line Charts
**Use for**: Trends over time, growth analysis
**Best for**: Revenue trends, sales performance, growth rates
**Example**: Monthly revenue over the past year

#### Bar Charts
**Use for**: Category comparisons, rankings
**Best for**: Revenue by product, sales by region, performance rankings
**Example**: Top 10 products by revenue

#### Stacked Bar Charts
**Use for**: Part-to-whole comparisons over categories
**Best for**: Revenue composition, segment contribution
**Example**: Revenue breakdown by product category per quarter

### Performance Analysis

#### Area Charts
**Use for**: Cumulative trends, volume over time
**Best for**: Cumulative revenue, market share evolution
**Example**: Year-to-date revenue accumulation

#### Waterfall Charts
**Use for**: Sequential changes, breakdowns
**Best for**: Revenue bridges, variance analysis
**Example**: How revenue changed from Q1 to Q2

#### Scatter Plots
**Use for**: Correlation analysis, outlier detection
**Best for**: Price vs. volume, cost vs. revenue relationships
**Example**: Product performance matrix (volume vs. margin)

### Composition & Distribution

#### Pie/Donut Charts
**Use for**: Part-to-whole relationships (limit to 5-7 segments)
**Best for**: Market share, revenue composition
**Example**: Percentage contribution by product line

#### Treemap
**Use for**: Hierarchical part-to-whole with many categories
**Best for**: Revenue contribution with subcategories
**Example**: Revenue by region, then by product

#### Box Plots
**Use for**: Distribution analysis, variability
**Best for**: Revenue distribution, outlier identification
**Example**: Monthly sales distribution over a year

### Comparison Analysis

#### Grouped Bar Charts
**Use for**: Multiple metrics across categories
**Best for**: Year-over-year comparisons, before/after analysis
**Example**: 2024 vs 2025 revenue by quarter

#### Heatmaps
**Use for**: Pattern identification, correlation matrices
**Best for**: Performance by time period and category
**Example**: Sales performance by day of week and hour

#### Bullet Charts
**Use for**: Target vs. actual performance
**Best for**: KPI dashboards, goal tracking
**Example**: Revenue vs. target with performance bands

## Python Visualization Libraries

### Plotly (Recommended for Interactive Reports)
```python
import plotly.graph_objects as go
import plotly.express as px

# Interactive line chart
fig = px.line(df, x='date', y='revenue', title='Revenue Trend')
fig.show()

# Interactive bar chart
fig = px.bar(df, x='category', y='sales', color='region')
fig.show()
```

### Matplotlib + Seaborn (For Static Reports)
```python
import matplotlib.pyplot as plt
import seaborn as sns

# Simple line plot
plt.figure(figsize=(10, 6))
plt.plot(df['date'], df['revenue'])
plt.title('Revenue Over Time')
plt.xlabel('Date')
plt.ylabel('Revenue ($)')
plt.show()

# Seaborn bar plot
sns.barplot(data=df, x='category', y='sales')
plt.show()
```

## Visualization Best Practices

### Color Usage
- **Consistent color scheme**: Use same colors for same categories across charts
- **Highlight important data**: Use accent colors for key insights
- **Accessibility**: Ensure color-blind friendly palettes
- **Professional palette**: Stick to 3-5 primary colors

Recommended color schemes:
- **Growth/Positive**: Green shades
- **Decline/Negative**: Red shades
- **Neutral/Baseline**: Gray or blue shades
- **Categories**: Distinct, contrasting colors

### Chart Design Principles
1. **Clarity**: Remove chartjunk, keep it simple
2. **Context**: Always label axes, add titles and legends
3. **Scale**: Start y-axis at zero for bar charts (unless showing variance)
4. **Sorting**: Order categories by value (descending) for better readability
5. **Annotations**: Highlight key data points with labels or callouts

### Dashboard Layout
For comprehensive business reports, organize visualizations:

1. **Executive Summary Section**
   - Key metric cards (total revenue, growth rate, etc.)
   - Primary trend chart (overall performance)

2. **Deep Dive Analysis**
   - Category breakdown charts
   - Time-based analysis
   - Comparison charts

3. **Insights & Weak Areas**
   - Highlight charts showing problem areas
   - Performance distribution
   - Outlier identification

4. **Recommendations**
   - Goal vs. actual charts
   - Projected impact visualizations

## Chart Creation Examples

### Example 1: Revenue Trend with Growth Rate
```python
import plotly.graph_objects as go
from plotly.subplots import make_subplots

# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])

# Add revenue line
fig.add_trace(
    go.Scatter(x=df['date'], y=df['revenue'], name="Revenue", line=dict(color='blue', width=3)),
    secondary_y=False
)

# Add growth rate line
fig.add_trace(
    go.Scatter(x=df['date'], y=df['growth_rate'], name="Growth Rate", line=dict(color='green', dash='dash')),
    secondary_y=True
)

# Update axes
fig.update_xaxes(title_text="Date")
fig.update_yaxes(title_text="Revenue ($)", secondary_y=False)
fig.update_yaxes(title_text="Growth Rate (%)", secondary_y=True)

fig.update_layout(title_text="Revenue Performance & Growth Rate")
```

### Example 2: Category Performance Comparison
```python
import plotly.express as px

# Sort by revenue descending
df_sorted = df.sort_values('revenue', ascending=False)

# Create bar chart
fig = px.bar(
    df_sorted,
    x='category',
    y='revenue',
    color='performance_tier',  # e.g., 'High', 'Medium', 'Low'
    title='Revenue by Category',
    labels={'revenue': 'Revenue ($)', 'category': 'Product Category'},
    color_discrete_map={'High': 'green', 'Medium': 'orange', 'Low': 'red'}
)

fig.update_layout(xaxis_tickangle=-45)
```

### Example 3: Variance Analysis (Waterfall)
```python
import plotly.graph_objects as go

# Example: Q1 to Q2 revenue bridge
fig = go.Figure(go.Waterfall(
    x=['Q1 Revenue', 'New Sales', 'Churn', 'Price Increase', 'Q2 Revenue'],
    y=[1000, 300, -150, 100, 1250],
    measure=['absolute', 'relative', 'relative', 'relative', 'total'],
    text=['+1000', '+300', '-150', '+100', '1250'],
    textposition='outside',
    connector={'line': {'color': 'rgb(63, 63, 63)'}},
))

fig.update_layout(title='Q1 to Q2 Revenue Bridge', yaxis_title='Revenue ($1000s)')
```

## HTML Report Template Structure

```html
<!DOCTYPE html>
<html>
<head>
    <title>Business Analysis Report</title>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
    <style>
        body { font-family: Arial, sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px; }
        .header { background: #2c3e50; color: white; padding: 20px; margin-bottom: 30px; }
        .section { margin-bottom: 40px; }
        .metric-card { display: inline-block; background: #ecf0f1; padding: 20px; margin: 10px; border-radius: 5px; }
        .weak-area { background: #ffe6e6; padding: 15px; margin: 10px 0; border-left: 4px solid #e74c3c; }
        .strategy { background: #e6f7ff; padding: 15px; margin: 10px 0; border-left: 4px solid #3498db; }
    </style>
</head>
<body>
    <div class="header">
        <h1>Business Performance Analysis Report</h1>
        <p>Generated: [Date]</p>
    </div>

    <div class="section">
        <h2>Executive Summary</h2>
        <!-- Metric cards -->
    </div>

    <div class="section">
        <h2>Performance Trends</h2>
        <div id="trend-chart"></div>
    </div>

    <div class="section">
        <h2>Areas of Weakness</h2>
        <!-- Weak area cards with charts -->
    </div>

    <div class="section">
        <h2>Improvement Strategies</h2>
        <!-- Strategy recommendations -->
    </div>

    <script>
        // Plotly chart JavaScript
    </script>
</body>
</html>
```

## Integration with Analysis Script

When using the `analyze_business_data.py` script, create visualizations for:

1. **Revenue Trend Chart**: Line chart showing revenue over time with growth rate overlay
2. **Category Performance Chart**: Bar chart of revenue by category, sorted by performance
3. **Volatility Chart**: Box plot or standard deviation chart showing revenue stability
4. **Weak Areas Heatmap**: Visual representation of severity and impact
5. **Strategy Impact Projection**: Chart showing expected improvement trajectories

```

business-analytics-reporter | SkillHub