home / skills / openclaw / skills / report-generator

report-generator skill

/skills/lijie420461340/report-generator

This skill generates professional data reports with charts and tables, transforming your data into polished dashboards and insights.

npx playbooks add skill openclaw/skills --skill report-generator

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
4.1 KB
---
name: report-generator
description: Generate professional data reports with charts, tables, and visualizations
author: claude-office-skills
version: "1.0"
tags: [report, visualization, charts, data, automation]
models: [claude-sonnet-4, claude-opus-4]
tools: [computer, code_execution, file_operations]
---

# Report Generator Skill

## Overview

This skill enables automatic generation of professional data reports. Create dashboards, KPI summaries, and analytical reports with charts, tables, and insights from your data.

## How to Use

1. Provide data (CSV, Excel, JSON, or describe it)
2. Specify the type of report needed
3. I'll generate a formatted report with visualizations

**Example prompts:**
- "Generate a sales report from this data"
- "Create a monthly KPI dashboard"
- "Build an executive summary with charts"
- "Produce a data analysis report"

## Domain Knowledge

### Report Components

```python
# Report structure
report = {
    'title': 'Monthly Sales Report',
    'period': 'January 2024',
    'sections': [
        'executive_summary',
        'kpi_dashboard',
        'detailed_analysis',
        'charts',
        'recommendations'
    ]
}
```

### Using Python for Reports

```python
import pandas as pd
import matplotlib.pyplot as plt
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas

def generate_report(data, output_path):
    # Load data
    df = pd.read_csv(data)
    
    # Calculate KPIs
    total_revenue = df['revenue'].sum()
    avg_order = df['revenue'].mean()
    growth = df['revenue'].pct_change().mean()
    
    # Create charts
    fig, axes = plt.subplots(2, 2, figsize=(12, 10))
    df.plot(kind='bar', ax=axes[0,0], title='Revenue by Month')
    df.plot(kind='line', ax=axes[0,1], title='Trend')
    plt.savefig('charts.png')
    
    # Generate PDF
    # ... PDF generation code
    
    return output_path
```

### HTML Report Template

```python
def generate_html_report(data, title):
    html = f'''
    <!DOCTYPE html>
    <html>
    <head>
        <title>{title}</title>
        <style>
            body {{ font-family: Arial; margin: 40px; }}
            .kpi {{ display: flex; gap: 20px; }}
            .kpi-card {{ background: #f5f5f5; padding: 20px; border-radius: 8px; }}
            .metric {{ font-size: 2em; font-weight: bold; color: #2563eb; }}
            table {{ border-collapse: collapse; width: 100%; }}
            th, td {{ border: 1px solid #ddd; padding: 12px; text-align: left; }}
        </style>
    </head>
    <body>
        <h1>{title}</h1>
        <div class="kpi">
            <div class="kpi-card">
                <div class="metric">${data['revenue']:,.0f}</div>
                <div>Total Revenue</div>
            </div>
            <div class="kpi-card">
                <div class="metric">{data['growth']:.1%}</div>
                <div>Growth Rate</div>
            </div>
        </div>
        <!-- More content -->
    </body>
    </html>
    '''
    return html
```

## Example: Sales Report

```python
import pandas as pd
import matplotlib.pyplot as plt

def create_sales_report(csv_path, output_path):
    # Read data
    df = pd.read_csv(csv_path)
    
    # Calculate metrics
    metrics = {
        'total_revenue': df['amount'].sum(),
        'total_orders': len(df),
        'avg_order': df['amount'].mean(),
        'top_product': df.groupby('product')['amount'].sum().idxmax()
    }
    
    # Create visualizations
    fig, axes = plt.subplots(2, 2, figsize=(14, 10))
    
    # Revenue by product
    df.groupby('product')['amount'].sum().plot(
        kind='bar', ax=axes[0,0], title='Revenue by Product'
    )
    
    # Monthly trend
    df.groupby('month')['amount'].sum().plot(
        kind='line', ax=axes[0,1], title='Monthly Revenue'
    )
    
    plt.tight_layout()
    plt.savefig(output_path.replace('.html', '_charts.png'))
    
    # Generate HTML report
    html = generate_html_report(metrics, 'Sales Report')
    
    with open(output_path, 'w') as f:
        f.write(html)
    
    return output_path

create_sales_report('sales_data.csv', 'sales_report.html')
```

## Resources

- [Matplotlib](https://matplotlib.org/)
- [Plotly](https://plotly.com/)
- [ReportLab](https://www.reportlab.com/)

Overview

This skill generates professional data reports with charts, tables, and visualizations from CSV, Excel, JSON, or described datasets. It produces formatted outputs such as HTML or PDF reports, KPI dashboards, and executive summaries with automated visualizations. The skill is designed for fast, repeatable reporting workflows and supports common Python libraries for plotting and PDF generation.

How this skill works

Provide the data or a description of the dataset and specify the report type (sales, monthly KPI, executive summary, etc.). The skill parses the data into a DataFrame, computes key metrics, creates charts with Matplotlib or Plotly, and assembles the results into an HTML or PDF template. Final outputs include charts, KPI cards, tables, and a recommendations or insights section.

When to use it

  • Create recurring monthly or weekly dashboards from sales, finance, or operations data
  • Convert raw CSV/Excel/JSON exports into polished reports for stakeholders
  • Produce quick executive summaries with top KPIs and visuals
  • Package analysis into shareable HTML or PDF reports
  • Automate report generation as part of a data pipeline

Best practices

  • Provide clean, well-typed columns (dates, numeric fields) and a sample file to speed up parsing
  • Specify the desired sections and audience (executive, analyst, technical) up front
  • Include time period or grouping fields for trend and aggregation charts
  • Choose vector-friendly chart formats for PDF exports and interactive charts for web reports
  • Validate aggregated results against source data before distribution

Example use cases

  • Monthly sales report with revenue trends, top products, and KPIs
  • KPI dashboard summarizing churn, MRR, and growth rate for a SaaS product
  • Executive summary with charts and recommendations for board meetings
  • Operations report converting CSV logs into visual performance metrics
  • Ad hoc data analysis exported as a formatted HTML report for sharing

FAQ

What input formats are supported?

CSV, Excel (XLS/XLSX), JSON, or a plain description of the dataset and desired metrics.

What output formats can I get?

HTML reports with embedded charts, PNG/JPEG chart images, and PDF exports are supported; interactive Plotly charts can be included for web reports.